From f7913567535d889569b93c20e46db9df8d2a645a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 6 Oct 2014 15:53:42 +0000 Subject: [PATCH] Import pandas_0.14.1-2.debian.tar.xz [dgit import tarball pandas 0.14.1-2 pandas_0.14.1-2.debian.tar.xz] --- README.source | 8 + TODO | 5 + changelog | 348 + compat | 1 + control | 146 + copyright | 197 + cythonized-files/VERSION | 1 + cythonized-files/pandas/algos.c | 185767 ++++++++++++++++++++++ cythonized-files/pandas/hashtable.c | 25417 +++ cythonized-files/pandas/index.c | 19179 +++ cythonized-files/pandas/lib.c | 81711 ++++++++++ cythonized-files/pandas/msgpack.cpp | 14209 ++ cythonized-files/pandas/parser.c | 31721 ++++ cythonized-files/pandas/src/sparse.c | 24464 +++ cythonized-files/pandas/src/testing.c | 4188 + cythonized-files/pandas/tslib.c | 71036 +++++++++ cythonized-files3/VERSION | 1 + cythonized-files3/pandas/algos.c | 185767 ++++++++++++++++++++++ cythonized-files3/pandas/hashtable.c | 25417 +++ cythonized-files3/pandas/index.c | 19180 +++ cythonized-files3/pandas/lib.c | 81711 ++++++++++ cythonized-files3/pandas/msgpack.cpp | 14209 ++ cythonized-files3/pandas/parser.c | 31721 ++++ cythonized-files3/pandas/src/sparse.c | 24464 +++ cythonized-files3/pandas/src/testing.c | 4188 + cythonized-files3/pandas/tslib.c | 71037 +++++++++ gbp.conf | 10 + patches/changeset_314012d.diff | 14 + patches/deb_disable_googleanalytics | 92 + patches/deb_skip_sequencelike_on_armel | 12 + patches/deb_skip_test_pytables_failure | 27 + patches/jessie-dsc-patch | 1 + patches/nocython3-dsc-patch | 20 + patches/precise-dsc-patch | 1 + patches/quantal-dsc-patch | 1 + patches/series | 4 + patches/sid-dsc-patch | 1 + patches/wheezy-dsc-patch | 1 + pycompat | 1 + python-pandas-doc.docs | 1 + python-pandas-doc.examples | 1 + python-pandas-doc.links | 1 + python-pandas-lib.install | 1 + python-pandas.install | 1 + python3-pandas-lib.install | 1 + python3-pandas.install | 1 + rules | 136 + source/format | 1 + source/options | 1 + tests/control | 33 + tests/unittests | 11 + tests/unittests3 | 11 + watch | 3 + 53 files changed, 916481 insertions(+) create mode 100644 README.source create mode 100644 TODO create mode 100644 changelog create mode 100644 compat create mode 100644 control create mode 100644 copyright create mode 100644 cythonized-files/VERSION create mode 100644 cythonized-files/pandas/algos.c create mode 100644 cythonized-files/pandas/hashtable.c create mode 100644 cythonized-files/pandas/index.c create mode 100644 cythonized-files/pandas/lib.c create mode 100644 cythonized-files/pandas/msgpack.cpp create mode 100644 cythonized-files/pandas/parser.c create mode 100644 cythonized-files/pandas/src/sparse.c create mode 100644 cythonized-files/pandas/src/testing.c create mode 100644 cythonized-files/pandas/tslib.c create mode 100644 cythonized-files3/VERSION create mode 100644 cythonized-files3/pandas/algos.c create mode 100644 cythonized-files3/pandas/hashtable.c create mode 100644 cythonized-files3/pandas/index.c create mode 100644 cythonized-files3/pandas/lib.c create mode 100644 cythonized-files3/pandas/msgpack.cpp create mode 100644 cythonized-files3/pandas/parser.c create mode 100644 cythonized-files3/pandas/src/sparse.c create mode 100644 cythonized-files3/pandas/src/testing.c create mode 100644 cythonized-files3/pandas/tslib.c create mode 100644 gbp.conf create mode 100644 patches/changeset_314012d.diff create mode 100644 patches/deb_disable_googleanalytics create mode 100644 patches/deb_skip_sequencelike_on_armel create mode 100644 patches/deb_skip_test_pytables_failure create mode 120000 patches/jessie-dsc-patch create mode 100644 patches/nocython3-dsc-patch create mode 120000 patches/precise-dsc-patch create mode 120000 patches/quantal-dsc-patch create mode 100644 patches/series create mode 120000 patches/sid-dsc-patch create mode 120000 patches/wheezy-dsc-patch create mode 100644 pycompat create mode 100644 python-pandas-doc.docs create mode 100644 python-pandas-doc.examples create mode 100644 python-pandas-doc.links create mode 100644 python-pandas-lib.install create mode 100644 python-pandas.install create mode 100644 python3-pandas-lib.install create mode 100644 python3-pandas.install create mode 100755 rules create mode 100644 source/format create mode 100644 source/options create mode 100644 tests/control create mode 100755 tests/unittests create mode 100755 tests/unittests3 create mode 100644 watch diff --git a/README.source b/README.source new file mode 100644 index 00000000..d2dc062b --- /dev/null +++ b/README.source @@ -0,0 +1,8 @@ +pandas for Debian +----------------- + +For flexibility and easier interaction with upstream, packaging VCS is +done on top of upstream's GIT hosted on github: +git://github.com/wesm/pandas.git + + -- Yaroslav Halchenko , Tue, 13 Sep 2011 12:25:02 -0400 diff --git a/TODO b/TODO new file mode 100644 index 00000000..f6dcac41 --- /dev/null +++ b/TODO @@ -0,0 +1,5 @@ +* Check if dateutil is indeed (>= 1.5) -- absent on Ubuntus +* IPython 0.11 seems to be required to build docs + - there was a bug report requesting -doc iirc +* adjust copyright to mention code in setup.py borrowed from pyzmq +* gather more of copyright/license added in 0.8. diff --git a/changelog b/changelog new file mode 100644 index 00000000..891c4ff2 --- /dev/null +++ b/changelog @@ -0,0 +1,348 @@ +pandas (0.14.1-2) unstable; urgency=medium + + * debian/patches/changeset_314012d.diff + - Fix converter test for MPL1.4 (Closes: #763709) + + -- Yaroslav Halchenko Mon, 06 Oct 2014 11:53:42 -0400 + +pandas (0.14.1-1) unstable; urgency=medium + + * New upstream release + + -- Yaroslav Halchenko Thu, 10 Jul 2014 23:38:49 -0400 + +pandas (0.14.0+git393-g959e3e4-1) UNRELEASED; urgency=medium + + * New upstream snapshot from v0.14.0-345-g8cd3dd6 + * debian/rules + - disable running disabled tests to prevent clipboard tests failures + under kfreebsd kernels + + -- Yaroslav Halchenko Mon, 07 Jul 2014 12:29:50 -0400 + +pandas (0.14.0+git213-g741b2fa-1) experimental; urgency=medium + + * New upstream snapshot from v0.14.0-213-g741b2fa. + + -- Yaroslav Halchenko Thu, 19 Jun 2014 10:30:42 -0400 + +pandas (0.14.0+git17-g3849d5d-1) unstable; urgency=medium + + * New upstream snapshot from v0.14.0-17-g3849d5d -- has resolved a number + of bugs sneaked into 0.14.0 release, and caused FTBFS on some platforms + and backports + + -- Yaroslav Halchenko Sun, 01 Jun 2014 00:54:34 -0400 + +pandas (0.14.0-1) unstable; urgency=medium + + * New upstream release + + -- Yaroslav Halchenko Fri, 30 May 2014 08:45:35 -0400 + +pandas (0.14.0~rc1+git79-g1fa5dd4-1) experimental; urgency=medium + + * New upstream snapshot from v0.14.0rc1-73-g8793356 + * debian/patches: + - dropped CPed changeset_*s + - added deb_disable_googleanalytics + * debian/control: + - boosted policy compliance to 3.9.5 + + -- Yaroslav Halchenko Tue, 27 May 2014 16:00:00 -0400 + +pandas (0.13.1-2) unstable; urgency=low + + * debian/patches/changeset_6d56e7300d66d3ba76684334bbb44b6cd0ea9f61.diff + to fix FTBFS of statsmodels due to failing tests (Closes: #735804) + + -- Yaroslav Halchenko Sat, 08 Feb 2014 12:46:42 -0500 + +pandas (0.13.1-1) unstable; urgency=low + + * Fresh upstream release + * debian/patches + - deb_skip_test_pytables_failure to mitigate error while testing on + amd64 wheezy and ubuntu 12.04 + + -- Yaroslav Halchenko Tue, 04 Feb 2014 12:09:29 -0500 + +pandas (0.13.0+git464-g15a8ff7-1) experimental; urgency=low + + * Fresh pre-release snapshot + * debian/patches + - removed all cherry-picked patches (should have been upstreamed) + + -- Yaroslav Halchenko Wed, 29 Jan 2014 21:27:45 -0500 + +pandas (0.13.0-2) unstable; urgency=low + + * debian/patches + - 0001-BLD-fix-cythonized-msgpack-extension-in-setup.py-GH5.patch + to resolve issue with building C++ Cython extension using + pre-generated sources + - 0001-Add-division-future-import-everywhere.patch + 0002-remove-explicit-truediv-kwarg.patch + to resolve compatibility issues with elderly Numexpr + - 0001-BUG-Yahoo-finance-changed-ichart-url.-Fixed-here.patch + - deb_skip_sequencelike_on_armel to prevent FTBFS on armel due to failing + test: https://github.com/pydata/pandas/issues/4473 + + -- Yaroslav Halchenko Fri, 03 Jan 2014 23:13:48 -0500 + +pandas (0.13.0-1) unstable; urgency=low + + * Fresh upstream release + - resolved compatibility with matplotlib 1.3 (Closes: #733848) + * debian/{control,rules} + - use xvfb (added to build-depends together with xauth, and xclip) + for tests + - define http*_proxy to prevent downloads + - install .md files not .rst for docs -- were renamed upstream + - include .cpp Cython generated files into debian/cythonized-files* + + -- Yaroslav Halchenko Wed, 01 Jan 2014 18:08:22 -0500 + +pandas (0.12.0-2) unstable; urgency=low + + [ Dmitry Shachnev ] + * DEP-8 tests improvements: + - Use Xvfb for running tests. + - Increase verbosity using -v flag. + - Fix printing interpreter version in unittests3. + * Fix indentaion in debian/control. + + [ Yaroslav Halchenko ] + * debian/control + - place python3-matplotlib ahead of elderly python-matplotlib without + python3 support since now we have python3-matplotlib in sid + * debian/copyright + - go through reported missing copyright/license statements (Closes: + #700564) Thanks Luca Falavigna for the report + * debian/rules,patches + - exclude test test_bar_log due to incompatibility with matplotlib 1.3.0 (test + adjusted upstream and would be re-enabled for the new release). + - debian/patches/changeset_952c5f0bc433622d21df20ed761ee4cb728370eb.diff + adds matplotlib 1.3.0 compatibility + + -- Yaroslav Halchenko Sat, 14 Sep 2013 20:02:58 -0400 + +pandas (0.12.0-1) unstable; urgency=low + + * New upstream release: + - should address failed tests on 32bit platforms + * debian/patches + - neurodebian: allow to build for jessie with outdated cython + * debian/control + - build for Python2 >= 2.7 due to some (probably temporary) incompatibilities + in tests with 2.6 + + -- Yaroslav Halchenko Wed, 24 Jul 2013 23:29:03 -0400 + +pandas (0.12.0~rc1+git127-gec8920a-1) experimental; urgency=low + + * New upstream snapshot from origin/master at v0.12.0rc1-127-gec8920a + - should address FTBFS due to failing tests on big endians + + -- Yaroslav Halchenko Sat, 20 Jul 2013 09:23:04 -0400 + +pandas (0.12.0~rc1+git112-gb79996c-1) experimental; urgency=low + + * Fresh git snapshot of upstream candidate release. Experimental build + to verify functioning across the ports. + * debian/control + - dedented last "paragraph" to break it away from the 2nd one. + Thanks Beatrice Torracca for the detailed report (Closes: #712260) + - Depends on python-six now + * debian/{,tests/}control + - added python{,3}-bs4, python-html5lib to Build-Depends for more + thorough testing + + -- Yaroslav Halchenko Thu, 18 Jul 2013 13:15:19 -0400 + +pandas (0.11.0-2) unstable; urgency=low + + [ Yaroslav Halchenko ] + * Upload to unstable -- this upstream release addressed Cython 0.19 + compatibility issue (Closes: #710608) + * Recommends numexpr + * Re-cythonized using Cython 0.19 + + [ Dmitry Shachnev ] + * debian/tests/unittests3: use nosetests3 instead of nosetests-3.x. + + -- Yaroslav Halchenko Mon, 03 Jun 2013 11:57:43 -0400 + +pandas (0.11.0-1) experimental; urgency=low + + * New upstream release + + -- Yaroslav Halchenko Tue, 23 Apr 2013 22:40:15 -0400 + +pandas (0.10.1-1) experimental; urgency=low + + * New upstream release + + -- Yaroslav Halchenko Tue, 22 Jan 2013 13:07:31 -0500 + +pandas (0.10.0-1) experimental; urgency=low + + * New upstream release + - drops python 2.5 support (we are dropping pyversions in favor of + X-Python-Version) + * debian/patches: + - all previous are in upstream now, dropped locally + - added -dsc-patch'es for systems without cython3 + * debian/control: + - added python-statsmodels for the extended tests coverage + + -- Yaroslav Halchenko Mon, 17 Dec 2012 12:27:25 -0500 + +pandas (0.9.1-2) unstable; urgency=low + + [ Julian Taylor ] + * Provide python3 packages + * Add autopkgtests + * debian/patches: + - relax-float-tests.patch: + replace float equality tests with almost equal + - fix-endian-tests.patch: + patch from upstream to fix the test failure on big endian machines + + [ Yaroslav Halchenko ] + * Upload to unstable + * Dropping pysupport + * debian/rules: + - slight reduction of code duplication between python 2 and 3 + - cythonize for both python 2 and 3 into separate directories + + -- Yaroslav Halchenko Sat, 01 Dec 2012 22:57:47 -0500 + +pandas (0.9.1-1) experimental; urgency=low + + * New upstream release + * Boosted policy to 3.9.3 (no due changes) + * debian/rules + - Fixed up cleaning up of cythonized files + + -- Yaroslav Halchenko Wed, 14 Nov 2012 09:44:14 -0500 + +pandas (0.9.0-1) experimental; urgency=low + + * New upstream release + + -- Yaroslav Halchenko Sun, 07 Oct 2012 21:26:23 -0400 + +pandas (0.9.0~rc2-1) experimental; urgency=low + + * New upstream release candidate + + -- Yaroslav Halchenko Fri, 21 Sep 2012 10:27:52 -0400 + +pandas (0.8.1-1) unstable; urgency=low + + * Primarily a bugfix upstream release. + * up_tag_yahoo_test_requiring_network patch removed. + + -- Yaroslav Halchenko Sun, 22 Jul 2012 20:13:16 -0400 + +pandas (0.8.0-2) unstable; urgency=medium + + * up_tag_yahoo_test_requiring_network patch cherry-picked from upstream + GIT so that tests would not be excercised at package build time + (Closes: #681449) + + -- Yaroslav Halchenko Fri, 13 Jul 2012 08:54:41 -0400 + +pandas (0.8.0-1) unstable; urgency=low + + * Fresh upstream release + * debian/control + - drop python-statsmodels from Build-Depends since it might not be yet + available on some architectures and is not critical for the test + - recommend python-statsmodels instead of deprecated + python-scikits.statsmodels + + -- Yaroslav Halchenko Fri, 29 Jun 2012 13:02:28 -0400 + +pandas (0.8.0~rc2+git26-g76c6351-1) experimental; urgency=low + + * Fresh upstream release candidate + - all patches dropped (upstreamed) + - requires numpy >= 1.6 + + -- Yaroslav Halchenko Tue, 12 Jun 2012 13:23:27 -0400 + +pandas (0.7.3-1) unstable; urgency=low + + * Fresh upstream release + - few post-release patches (submitted upstream) to exclude unittests + requiring network access + * debian/control: + - python-openpyxl, python-xlwt, python-xlrd into Build-Depends + and Recommends + * debian/rules: + - exclude running tests marked with @network + + -- Yaroslav Halchenko Thu, 12 Apr 2012 11:27:31 -0400 + +pandas (0.7.1+git1-ga2e86c2-1) unstable; urgency=low + + * New upstream release with a bugfix which followed + + -- Yaroslav Halchenko Thu, 01 Mar 2012 22:28:10 -0500 + +pandas (0.7.0-1) unstable; urgency=low + + * New upstream release + * Updated pre-cythoned .c files for older Debian/Ubuntu releases. + Added a stamp file with upstream version to assure up-to-dateness + of the generated files + * Dropped all exclusions of unittests and patches -- shouldn't be necessary + any longer + * Build only for requested versions (not all supported) of Python + * Do nothing for build operation, rely on overloaded install + (to avoid undesired re-cythonization on elderly Ubuntus) + * Adjusted url in watch due to migration of repository under pydata + organization + + -- Yaroslav Halchenko Mon, 16 Jan 2012 19:31:50 -0500 + +pandas (0.6.1-1) UNRELEASED; urgency=low + + * New upstream release + * python-tk into Build-Depends + * Create matplotlibrc with backend: Agg to allow tests run without $DISPLAY + * Carry pre-cythonized .c files for systems with older Cython + * Skip few tests known to fail + + -- Yaroslav Halchenko Tue, 13 Dec 2011 18:36:11 -0500 + +pandas (0.5.0+git7-gcf32be2-1) unstable; urgency=low + + * New upstream release with post-release fixes + + -- Yaroslav Halchenko Tue, 01 Nov 2011 21:15:06 -0400 + +pandas (0.4.3-1) unstable; urgency=low + + * New upstream release(s): primarily bugfixes and optimizations but also + with some minor API changes and new functionality + * Adjusted debian/watch to match new layout on github + + -- Yaroslav Halchenko Tue, 18 Oct 2011 11:27:50 -0400 + +pandas (0.4.1-1) unstable; urgency=low + + * New upstream bugfix release + - incorporated all debian/patches + * debian/rules: 'clean' removes generated pandas/version.py + * debian/copyright: adjusted to become DEP-5 compliant + + -- Yaroslav Halchenko Sun, 25 Sep 2011 21:48:30 -0400 + +pandas (0.4.0-1) unstable; urgency=low + + * Initial Debian release (Closes: #641464) + + -- Yaroslav Halchenko Tue, 13 Sep 2011 12:24:05 -0400 diff --git a/compat b/compat new file mode 100644 index 00000000..7f8f011e --- /dev/null +++ b/compat @@ -0,0 +1 @@ +7 diff --git a/control b/control new file mode 100644 index 00000000..74338ec1 --- /dev/null +++ b/control @@ -0,0 +1,146 @@ +Source: pandas +Section: python +Priority: optional +Maintainer: NeuroDebian Team +Uploaders: Yaroslav Halchenko , Michael Hanke +Build-Depends: debhelper (>= 7.0.50), + python-all-dev (>= 2.5), + python-setuptools, + cython (>= 0.17.1~), + python-numpy (>= 1:1.6.1~), python-dateutil, + python-scipy, + python-tz, + python-tables, + python-sphinx (>= 1.0~), + python-nose, + python-matplotlib, + python-tk, + python-openpyxl, python-xlwt, python-xlrd, + python-statsmodels, + python-bs4, + python-html5lib, + python-six, + python3-all-dev, + python3-setuptools, + cython3 (>= 0.17.1~) | cython (<< 0.17.1~), + python3-numpy (>= 1:1.6.1~), python3-dateutil, + python3-scipy, + python3-tz, + python3-sphinx (>= 1.0~), + python3-nose, + python3-matplotlib | python-matplotlib (<< 1.2.0~), + python3-tk, + python3-bs4, + python3-six, + xvfb, xauth, xclip, +X-Python-Version: >= 2.7 +X-Python3-Version: >= 3.2 +Standards-Version: 3.9.5 +Homepage: http://pandas.sourceforge.net +Vcs-Browser: http://github.com/neurodebian/pandas +Vcs-Git: git://github.com/neurodebian/pandas.git +XS-Testsuite: autopkgtest + +Package: python-pandas +Architecture: all +Depends: ${misc:Depends}, ${python:Depends}, + python-numpy (>= 1:1.6~), + python-dateutil, + python-pandas-lib(>= ${source:Version}), + python-six, +Recommends: python-scipy, + python-matplotlib, + python-tables, + python-numexpr, + python-tz, + python-xlrd, + python-statsmodels, + python-openpyxl, python-xlwt, python-xlrd, + python-bs4, + python-html5lib, +Provides: ${python:Provides} +Suggests: python-pandas-doc +Description: data structures for "relational" or "labeled" data + pandas is a Python package providing fast, flexible, and expressive + data structures designed to make working with "relational" or + "labeled" data both easy and intuitive. It aims to be the fundamental + high-level building block for doing practical, real world data + analysis in Python. pandas is well suited for many different kinds of + data: + . + - Tabular data with heterogeneously-typed columns, as in an SQL + table or Excel spreadsheet + - Ordered and unordered (not necessarily fixed-frequency) time + series data. + - Arbitrary matrix data (homogeneously typed or heterogeneous) with + row and column labels + - Any other form of observational / statistical data sets. The data + actually need not be labeled at all to be placed into a pandas + data structure + . + This package contains the Python 2 version. + +Package: python3-pandas +Architecture: all +Depends: ${misc:Depends}, ${python3:Depends}, + python3-numpy (>= 1:1.6~), + python3-dateutil, + python3-pandas-lib(>= ${source:Version}) +Recommends: python3-scipy, + python3-matplotlib, + python3-numexpr, + python3-tables, + python3-tz, + python3-bs4, + python3-html5lib, + python3-six, +Suggests: python-pandas-doc +Description: data structures for "relational" or "labeled" data - Python 3 + pandas is a Python package providing fast, flexible, and expressive + data structures designed to make working with "relational" or + "labeled" data both easy and intuitive. It aims to be the fundamental + high-level building block for doing practical, real world data + analysis in Python. pandas is well suited for many different kinds of + data: + . + - Tabular data with heterogeneously-typed columns, as in an SQL + table or Excel spreadsheet + - Ordered and unordered (not necessarily fixed-frequency) time + series data. + - Arbitrary matrix data (homogeneously typed or heterogeneous) with + row and column labels + - Any other form of observational / statistical data sets. The data + actually need not be labeled at all to be placed into a pandas + data structure + . + This package contains the Python 3 version. + +# No doc package built due to dependency on ipython 0.11 - only experimental +# Package: python-pandas-doc +# Architecture: all +# Section: doc +# Depends: ${misc:Depends}, libjs-jquery +# Suggests: python-pandas +# Description: documentation and examples for pandas +# This package contains documentation and example scripts for +# python-pandas. + +Package: python-pandas-lib +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, ${python:Depends}, python-numpy +Provides: ${python:Provides} +XB-Python-Version: ${python:Versions} +Description: low-level implementations and bindings for pandas + This is an add-on package for python-pandas providing + architecture-dependent extensions. + . + This package contains the Python 2 version. + +Package: python3-pandas-lib +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, ${python3:Depends}, python3-numpy +Description: low-level implementations and bindings for pandas - Python 3 + This is an add-on package for python-pandas providing + architecture-dependent extensions. + . + This package contains the Python 3 version. diff --git a/copyright b/copyright new file mode 100644 index 00000000..44fe4c3c --- /dev/null +++ b/copyright @@ -0,0 +1,197 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pandas +Upstream-Contact: Wes McKinney +Source-Location: http://github.com/wesm/pandas + +Files: * +Copyright: 2008-2011 AQR Capital Management, LLC + 2011 Wes McKinney and pandas developers + 2011-2013, Lambda Foundry, Inc. and PyData Development Team +License: BSD-3 + +Files: pandas/io/auth.py +Copyright: 2012, Google Inc. +License: Apache + +Files: pandas/src/datetime +Copyright: 2005-2013, NumPy Developers +License: BSD-3 +Origin: numpy +Comment: Listed as derived from Numpy 1.7 + +Files: pandas/src/headers/ms_* +Copyright: 2006, Alexander Chemeris +License: BSD-3 + +Files: pandas/src/klib +Copyright: 2008, 2009, 2011 by Attractive Chaos +License: Expat + +Files: pandas/src/skiplist.pyx +Copyright: 2009, Raymond Hettinger +License: Expat +Origin: http://code.activestate.com/recipes/576930/ +Comment: it is a Cython code "inspired" by the original Python code by Raymond + +Files: pandas/util/clipboard.py +Copyright: 2010, Albert Sweigart +License: BSD-3 +Origin: Pyperclip v1.3 + +Files: scripts/git-mrb +Copyright: 2011-2012, Fernando Perez +Origin: IPython +License: BSD-3 + +Files: doc/source/themes/agogo/* +Copyright: 2007-2011 by the Sphinx team +License: BSD-2 + +Files: doc/sphinxext/* +Copyright: 2008, Stefan van der Walt , Pauli Virtanen +License: BSD-2 + +Files: doc/sphinxext/compiler_unparse.py + doc/sphinxext/comment_eater.py + doc/sphinxext/traitsdoc.py +Copyright: 2006, Enthought, Inc. +License: BSD-3 + +Files: doc/sphinxext/only_directives.py + doc/sphinxext/plot_directive.py +Copyright: 2002-2008, John D. Hunter +License: matplotlib +Origin: matplotlib + +Files: debian/* +Copyright: 2011-2013, Yaroslav Halchenko +License: BSD-3 + +License: BSD-2 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the copyright holder nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: matplotlib + 1. This LICENSE AGREEMENT is between John D. Hunter (“JDH”), and the + Individual or Organization (“Licensee”) accessing and otherwise using + matplotlib software in source or binary form and its associated + documentation. + 2. Subject to the terms and conditions of this License Agreement, JDH + hereby grants Licensee a nonexclusive, royalty-free, world-wide + license to reproduce, analyze, test, perform and/or display publicly, + prepare derivative works, distribute, and otherwise use matplotlib + 0.98.3 alone or in any derivative version, provided, however, that + JDH’s License Agreement and JDH’s notice of copyright, i.e., + “Copyright (c) 2002-2008 John D. Hunter; All Rights Reserved” are + retained in matplotlib 0.98.3 alone or in any derivative version + prepared by Licensee. + 3. In the event Licensee prepares a derivative work that is based on + or incorporates matplotlib 0.98.3 or any part thereof, and wants to + make the derivative work available to others as provided herein, then + Licensee hereby agrees to include in any such work a brief summary of + the changes made to matplotlib 0.98.3. + 4. JDH is making matplotlib 0.98.3 available to Licensee on an “AS + IS” basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR + IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND + DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR + FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB + 0.98.3 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. + 5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF + MATPLOTLIB 0.98.3 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL + DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE + USING MATPLOTLIB 0.98.3, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED + OF THE POSSIBILITY THEREOF. + 6. This License Agreement will automatically terminate upon a + material breach of its terms and conditions. + 7. Nothing in this License Agreement shall be deemed to create any + relationship of agency, partnership, or joint venture between JDH and + Licensee. This License Agreement does not grant permission to use JDH + trademarks or trade name in a trademark sense to endorse or promote + products or services of Licensee, or any third party. + 8. By copying, installing or otherwise using matplotlib 0.98.3, + Licensee agrees to be bound by the terms and conditions of this + License Agreement. + +License: Expat + 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. + +License: Apache + 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. + . + On Debian systems full text of the license could be found in + /usr/share/common-licenses/Apache-2.0 . diff --git a/cythonized-files/VERSION b/cythonized-files/VERSION new file mode 100644 index 00000000..930e3000 --- /dev/null +++ b/cythonized-files/VERSION @@ -0,0 +1 @@ +0.14.1 diff --git a/cythonized-files/pandas/algos.c b/cythonized-files/pandas/algos.c new file mode 100644 index 00000000..03d052ad --- /dev/null +++ b/cythonized-files/pandas/algos.c @@ -0,0 +1,185767 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__algos +#define __PYX_HAVE_API__pandas__algos +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "numpy_helper.h" +#include "src/headers/math.h" +#include "math.h" +#include "skiplist.h" +#include "headers/stdint.h" +#include "datetime.h" +#include "datetime_helper.h" +#include "numpy/ndarrayobject.h" +#include "numpy/npy_common.h" +#include "datetime/np_datetime.h" +#include "datetime/np_datetime_strings.h" +#include "khash_python.h" +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "algos.pyx", + "skiplist.pyx", + "generated.pyx", + "join.pyx", + "datetime.pxd", + "numpy.pxd", + "util.pxd", + "stringsource", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; + +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && MSC_VER + #include + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using MSVC atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview) \ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview) \ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#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 + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; + +/* "pandas/src/generated.pyx":27 + * from khash cimport * + * + * ctypedef unsigned char UChar # <<<<<<<<<<<<<< + * + * cimport util + */ +typedef unsigned char __pyx_t_6pandas_5algos_UChar; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_5algos_Node; +struct __pyx_obj_6pandas_5algos_IndexableSkiplist; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_t_6pandas_5algos_pairs; + +/* "pandas/algos.pyx":1392 + * # Rolling median, min, max + * + * ctypedef double_t (* skiplist_f)(object sl, int n, int p) # <<<<<<<<<<<<<< + * + * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op): + */ +typedef __pyx_t_5numpy_double_t (*__pyx_t_6pandas_5algos_skiplist_f)(PyObject *, int, int); + +/* "pandas/algos.pyx":1520 + * # https://github.com/kwgoodman/bottleneck + * + * cdef struct pairs: # <<<<<<<<<<<<<< + * double value + * int death + */ +struct __pyx_t_6pandas_5algos_pairs { + double value; + int death; +}; + +/* "pandas/src/skiplist.pyx":32 + * # TODO: optimize this, make less messy + * + * cdef class Node: # <<<<<<<<<<<<<< + * cdef public: + * double_t value + */ +struct __pyx_obj_6pandas_5algos_Node { + PyObject_HEAD + __pyx_t_5numpy_double_t value; + PyObject *next; + PyObject *width; +}; + + +/* "pandas/src/skiplist.pyx":46 + * NIL = Node(np.inf, [], []) + * + * cdef class IndexableSkiplist: # <<<<<<<<<<<<<< + * ''' + * Sorted collection supporting O(lg n) insertion, removal, and + */ +struct __pyx_obj_6pandas_5algos_IndexableSkiplist { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *__pyx_vtab; + Py_ssize_t size; + Py_ssize_t maxlevels; + struct __pyx_obj_6pandas_5algos_Node *head; +}; + + +/* "View.MemoryView":99 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":269 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":302 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":922 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "pandas/src/skiplist.pyx":46 + * NIL = Node(np.inf, [], []) + * + * cdef class IndexableSkiplist: # <<<<<<<<<<<<<< + * ''' + * Sorted collection supporting O(lg n) insertion, removal, and + */ + +struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist { + PyObject *(*get)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch); + PyObject *(*insert)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch); + PyObject *(*remove)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *__pyx_vtabptr_6pandas_5algos_IndexableSkiplist; + + +/* "View.MemoryView":302 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":922 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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 CYTHON_INLINE 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); + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* proto */ + +static CYTHON_INLINE long __Pyx_mod_long(long, long); /* 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); + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#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); + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/ +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + 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 +} + +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_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 { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +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(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +typedef struct { + __pyx_CyFunctionObject func; + PyObject *__signatures__; + PyObject *type; + PyObject *self; +} __pyx_FusedFunctionObject; +#define __pyx_FusedFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __pyx_FusedFunction_New(__pyx_FusedFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__pyx_FusedFunction_New(PyTypeObject *type, + PyMethodDef *ml, int flags, + PyObject *qualname, PyObject *self, + PyObject *module, PyObject *globals, + PyObject *code); +static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self); +static PyTypeObject *__pyx_FusedFunctionType = NULL; +static int __pyx_FusedFunction_init(void); +#define __Pyx_FusedFunction_USED + +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *); + +static CYTHON_INLINE npy_int16 __Pyx_PyInt_As_npy_int16(PyObject *); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_object(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int8_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int16(npy_int16 value); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int16_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value); + +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint16(npy_uint16 value); + +static CYTHON_INLINE npy_uint16 __Pyx_PyInt_As_npy_uint16(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint16_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_uint16_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value); + +static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint32_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); + +static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj); /* proto */ + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float32_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_float32_t(const char *itemp, PyObject *obj); /* proto */ + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj); /* proto */ + +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int8_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_int8_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int16_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_int16_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int32_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_int32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int64_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_int64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint8_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_uint8_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint16_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_uint16_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint32_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_uint32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint64_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_uint64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float32_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_float32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float64_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_float64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +static PyObject *__pyx_memview_get_object(const char *itemp); /* proto */ +static int __pyx_memview_set_object(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, + char order, int ndim); + +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython.view' */ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'util' */ +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *); /*proto*/ + +/* Module declarations from 'skiplist' */ + +/* Module declarations from 'libc' */ + +/* Module declarations from 'datetime' */ + +/* Module declarations from 'datetime' */ +static PyTypeObject *__pyx_ptype_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0; +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'pandas.algos' */ +static PyTypeObject *__pyx_ptype_6pandas_5algos_Node = 0; +static PyTypeObject *__pyx_ptype_6pandas_5algos_IndexableSkiplist = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_FP_ERR; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_REL_TOL; +static __pyx_t_5numpy_int8_t __pyx_v_6pandas_5algos_MINint8; +static __pyx_t_5numpy_int16_t __pyx_v_6pandas_5algos_MINint16; +static __pyx_t_5numpy_int32_t __pyx_v_6pandas_5algos_MINint32; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_MINint64; +static __pyx_t_5numpy_float16_t __pyx_v_6pandas_5algos_MINfloat16; +static __pyx_t_5numpy_float32_t __pyx_v_6pandas_5algos_MINfloat32; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_MINfloat64; +static __pyx_t_5numpy_int8_t __pyx_v_6pandas_5algos_MAXint8; +static __pyx_t_5numpy_int16_t __pyx_v_6pandas_5algos_MAXint16; +static __pyx_t_5numpy_int32_t __pyx_v_6pandas_5algos_MAXint32; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_MAXint64; +static __pyx_t_5numpy_float16_t __pyx_v_6pandas_5algos_MAXfloat16; +static __pyx_t_5numpy_float32_t __pyx_v_6pandas_5algos_MAXfloat32; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_MAXfloat64; +static double __pyx_v_6pandas_5algos_NaN; +static double __pyx_v_6pandas_5algos_nan; +static int __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE; +static int __pyx_v_6pandas_5algos_TIEBREAK_MIN; +static int __pyx_v_6pandas_5algos_TIEBREAK_MAX; +static int __pyx_v_6pandas_5algos_TIEBREAK_FIRST; +static int __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; +static int __pyx_v_6pandas_5algos_TIEBREAK_DENSE; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_iNaT; +static int __pyx_v_6pandas_5algos_PLATFORM_INT; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_max(int, int); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_min(int, int); /*proto*/ +static double __pyx_f_6pandas_5algos_Log2(double); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos__take_2d_float64(PyArrayObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos__take_2d_int64(PyArrayObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos__take_2d_object(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5algos_float64_are_diff(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_are_diff(PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_kth_smallest_c(__pyx_t_5numpy_float64_t *, Py_ssize_t, Py_ssize_t); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos__roll_skiplist_op(PyArrayObject *, int, int, __pyx_t_6pandas_5algos_skiplist_f); /*proto*/ +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_median(PyObject *, int, int); /*proto*/ +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_max(PyObject *, int, int); /*proto*/ +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_min(PyObject *, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_5algos__median_linear(__pyx_t_5numpy_float64_t *, int); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_platform_int(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_float64(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_float32(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int8(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int16(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int32(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int64(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_object(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_float64(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_float32(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_object(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_int32(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_int64(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_bool(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_0__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int8_t *, __pyx_t_5numpy_int8_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_1__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int16_t *, __pyx_t_5numpy_int16_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_2__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int32_t *, __pyx_t_5numpy_int32_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_3__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_4__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint8_t *, __pyx_t_5numpy_uint8_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_5__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint16_t *, __pyx_t_5numpy_uint16_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_6__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_7__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint64_t *, __pyx_t_5numpy_uint64_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_8__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float32_t *, __pyx_t_5numpy_float32_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_9__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); /*proto*/ +static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_Py_ssize_t = { "Py_ssize_t", NULL, sizeof(Py_ssize_t), { 0 }, 0, IS_UNSIGNED(Py_ssize_t) ? 'U' : 'I', IS_UNSIGNED(Py_ssize_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t = { "int16_t", NULL, sizeof(__pyx_t_5numpy_int16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int16_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t = { "uint16_t", NULL, sizeof(__pyx_t_5numpy_uint16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint16_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t = { "uint32_t", NULL, sizeof(__pyx_t_5numpy_uint32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t = { "uint64_t", NULL, sizeof(__pyx_t_5numpy_uint64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint64_t), 0 }; +#define __Pyx_MODULE_NAME "pandas.algos" +int __pyx_module_is_main_pandas__algos = 0; + +/* Implementation of 'pandas.algos' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_ord; +static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_AssertionError; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_xrange; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node___init__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, __pyx_t_5numpy_double_t __pyx_v_value, PyObject *__pyx_v_next, PyObject *__pyx_v_width); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_4Node_5value___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_5value_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_4Node_4next___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_4next_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_4next_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_4Node_5width___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_5width_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_5width_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_expected_size); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_rank_1d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_2rank_1d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_4rank_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_6rank_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_8rank_1d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, int __pyx_v_retry, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_10rank_2d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_12_check_minp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_N); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_14kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_16median(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_534__pyx_fuse_0median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_536__pyx_fuse_1median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_538__pyx_fuse_2median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_540__pyx_fuse_3median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_542__pyx_fuse_4median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_544__pyx_fuse_5median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_546__pyx_fuse_6median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_548__pyx_fuse_7median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_550__pyx_fuse_8median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_552__pyx_fuse_9median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_18max_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_20min_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_22roll_sum(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_24roll_mean(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_26ewma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_28nancorr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, PyObject *__pyx_v_cov, PyObject *__pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_30nancorr_spearman(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, Py_ssize_t __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_32roll_var(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, int __pyx_v_ddof); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_34roll_skew(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_36roll_kurt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_38roll_median_c(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_40roll_median_cython(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_42roll_max2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_44roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_46roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_48roll_min2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_50roll_quantile(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, double __pyx_v_quantile); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_52roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_54roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg, int __pyx_v_avg_wgt); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_56is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_58groupby_indices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_60group_labels(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_62groupsort_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, Py_ssize_t __pyx_v_ngroups); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_64group_nth_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_66group_nth_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_68group_last_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_70group_last_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_72group_median(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_74inner_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_76left_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups, PyObject *__pyx_v_sort); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_78full_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_80_get_result_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sorter, PyObject *__pyx_v_indexer); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_82ffill_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_84ffill_by_group(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_group_ids, __pyx_t_5numpy_int64_t __pyx_v_max_group); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_86ensure_platform_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_88ensure_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_90ensure_float32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_92ensure_int8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_94ensure_int16(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_96ensure_int32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_98ensure_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_100ensure_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_102map_indices_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_104map_indices_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_106map_indices_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_108map_indices_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_110map_indices_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_112map_indices_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_114pad_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_116pad_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_118pad_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_120pad_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_122pad_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_124pad_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_126backfill_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_128backfill_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_130backfill_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_132backfill_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_134backfill_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_136backfill_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_138pad_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_140pad_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_142pad_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_144pad_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_146pad_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_148pad_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_150backfill_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_152backfill_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_154backfill_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_156backfill_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_158backfill_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_160backfill_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_166pad_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_186is_monotonic_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_188is_monotonic_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_190is_monotonic_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_192is_monotonic_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_194is_monotonic_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_196is_monotonic_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_198groupby_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_200groupby_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_202groupby_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_204groupby_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_206groupby_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_208groupby_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_210arrmap_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_212arrmap_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_214arrmap_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_216arrmap_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_218arrmap_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_220arrmap_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_222take_1d_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_224take_1d_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_226take_1d_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_228take_1d_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_230take_1d_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_232take_1d_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_234take_1d_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_236take_1d_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_238take_1d_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_240take_1d_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_242take_1d_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_244take_1d_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_246take_1d_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_248take_1d_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_250take_1d_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_252take_1d_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_254take_1d_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_256take_1d_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_258take_1d_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_372take_2d_multi_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_374diff_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_376diff_2d_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_378diff_2d_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_380diff_2d_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_382diff_2d_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_384diff_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_386group_last_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_388group_last_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_390group_last_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_392group_last_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_394group_nth_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_396group_nth_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_398group_nth_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_400group_nth_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_402group_add_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_404group_add_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_406group_add_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_408group_add_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_410group_prod_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_412group_prod_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_414group_prod_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_416group_prod_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_418group_var_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_420group_var_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_422group_var_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_424group_var_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_426group_mean_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_428group_mean_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_430group_mean_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_432group_mean_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_434group_min_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_436group_min_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_438group_min_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_440group_min_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_442group_max_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_444group_max_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_446group_max_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_448group_max_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_450group_ohlc_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_452group_ohlc_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_454group_count_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_456group_count_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_458group_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_460group_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_462group_count_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_464group_count_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_466group_count_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_468group_count_bin_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_480left_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_482left_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_484left_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_486left_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_488left_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_490outer_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_492outer_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_494outer_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_496outer_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_498outer_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_500inner_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_502inner_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_504inner_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_506inner_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_508inner_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6pandas_5algos_Node(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5algos_IndexableSkiplist(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_A[] = "A"; +static char __pyx_k_B[] = "B"; +static char __pyx_k_C[] = "C"; +static char __pyx_k_D[] = "D"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_K[] = "K"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_N[] = "N"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_R[] = "R"; +static char __pyx_k_S[] = "S"; +static char __pyx_k_T[] = "T"; +static char __pyx_k_a[] = "a"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_c[] = "c"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_e[] = "e"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_m[] = "m"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_o[] = "o"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_s[] = "s"; +static char __pyx_k_u[] = "u"; +static char __pyx_k_v[] = "v"; +static char __pyx_k_w[] = "w"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k_z[] = "z"; +static char __pyx_k_NA[] = "NA"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_ai[] = "ai"; +static char __pyx_k_as[] = "_as"; +static char __pyx_k_ct[] = "ct"; +static char __pyx_k_eq[] = "__eq__"; +static char __pyx_k_f8[] = "f8"; +static char __pyx_k_fv[] = "fv"; +static char __pyx_k_ge[] = "__ge__"; +static char __pyx_k_gt[] = "__gt__"; +static char __pyx_k_i0[] = "i0"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_id[] = "id"; +static char __pyx_k_lc[] = "lc"; +static char __pyx_k_le[] = "__le__"; +static char __pyx_k_lt[] = "__lt__"; +static char __pyx_k_n0[] = "n0"; +static char __pyx_k_ne[] = "__ne__"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_rc[] = "rc"; +static char __pyx_k_sl[] = "sl"; +static char __pyx_k_sx[] = "sx"; +static char __pyx_k_sy[] = "sy"; +static char __pyx_k_vx[] = "vx"; +static char __pyx_k_vy[] = "vy"; +static char __pyx_k_xi[] = "xi"; +static char __pyx_k_xx[] = "xx"; +static char __pyx_k_yi[] = "yi"; +static char __pyx_k_NIL[] = "NIL"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k__32[] = "()"; +static char __pyx_k__34[] = "|"; +static char __pyx_k_adj[] = "adj"; +static char __pyx_k_arg[] = "arg"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_avg[] = "avg"; +static char __pyx_k_buf[] = "buf"; +static char __pyx_k_cmp[] = "__cmp__"; +static char __pyx_k_com[] = "com"; +static char __pyx_k_cov[] = "cov"; +static char __pyx_k_cur[] = "cur"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_dim[] = "dim"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_gid[] = "gid"; +static char __pyx_k_ids[] = "ids"; +static char __pyx_k_idx[] = "idx"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_int[] = "int_"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_lab[] = "lab"; +static char __pyx_k_lib[] = "lib"; +static char __pyx_k_lim[] = "lim"; +static char __pyx_k_loc[] = "loc"; +static char __pyx_k_mat[] = "mat"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_new[] = "new"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_old[] = "old"; +static char __pyx_k_ord[] = "ord"; +static char __pyx_k_out[] = "out"; +static char __pyx_k_pct[] = "pct"; +static char __pyx_k_pre[] = "pre"; +static char __pyx_k_ptr[] = "ptr"; +static char __pyx_k_put[] = "put"; +static char __pyx_k_res[] = "res"; +static char __pyx_k_ret[] = "ret"; +static char __pyx_k_rev[] = "rev"; +static char __pyx_k_top[] = "top"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_win[] = "win"; +static char __pyx_k_xxx[] = "xxx"; +static char __pyx_k_zip[] = "zip"; +static char __pyx_k_NINF[] = "NINF"; +static char __pyx_k_aold[] = "aold"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_axis[] = "axis"; +static char __pyx_k_base[] = "base"; +static char __pyx_k_bins[] = "bins"; +static char __pyx_k_copy[] = "copy"; +static char __pyx_k_data[] = "data"; +static char __pyx_k_ddof[] = "ddof"; +static char __pyx_k_dims[] = "dims"; +static char __pyx_k_dups[] = "dups"; +static char __pyx_k_ewma[] = "ewma"; +static char __pyx_k_fill[] = "fill"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_idx0[] = "idx0"; +static char __pyx_k_idx1[] = "idx1"; +static char __pyx_k_in_i[] = "in_i"; +static char __pyx_k_in_k[] = "in_k"; +static char __pyx_k_in_n[] = "in_n"; +static char __pyx_k_infs[] = "infs"; +static char __pyx_k_int8[] = "int8"; +static char __pyx_k_keep[] = "keep"; +static char __pyx_k_kind[] = "kind"; +static char __pyx_k_last[] = "last"; +static char __pyx_k_left[] = "left"; +static char __pyx_k_lval[] = "lval"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mask[] = "mask"; +static char __pyx_k_maxx[] = "maxx"; +static char __pyx_k_mean[] = "mean"; +static char __pyx_k_minp[] = "minp"; +static char __pyx_k_minx[] = "minx"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_name[] = "name"; +static char __pyx_k_ndim[] = "ndim"; +static char __pyx_k_neww[] = "neww"; +static char __pyx_k_next[] = "next"; +static char __pyx_k_nobs[] = "nobs"; +static char __pyx_k_oldw[] = "oldw"; +static char __pyx_k_pack[] = "pack"; +static char __pyx_k_prev[] = "prev"; +static char __pyx_k_rank[] = "rank"; +static char __pyx_k_resx[] = "resx"; +static char __pyx_k_ring[] = "ring"; +static char __pyx_k_rval[] = "rval"; +static char __pyx_k_seen[] = "seen"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_size[] = "size"; +static char __pyx_k_sort[] = "sort"; +static char __pyx_k_step[] = "step"; +static char __pyx_k_stop[] = "stop"; +static char __pyx_k_sumx[] = "sumx"; +static char __pyx_k_sumy[] = "sumy"; +static char __pyx_k_take[] = "take"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_vecs[] = "vecs"; +static char __pyx_k_view[] = "view"; +static char __pyx_k_vlow[] = "vlow"; +static char __pyx_k_xxxx[] = "xxxx"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_array[] = "array"; +static char __pyx_k_class[] = "__class__"; +static char __pyx_k_count[] = "count"; +static char __pyx_k_delta[] = "delta"; +static char __pyx_k_dense[] = "dense"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_error[] = "error"; +static char __pyx_k_first[] = "first"; +static char __pyx_k_flags[] = "flags"; +static char __pyx_k_iinfo[] = "iinfo"; +static char __pyx_k_index[] = "index"; +static char __pyx_k_input[] = "input"; +static char __pyx_k_int16[] = "int16"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_isnan[] = "isnan"; +static char __pyx_k_label[] = "label"; +static char __pyx_k_limit[] = "limit"; +static char __pyx_k_meanx[] = "meanx"; +static char __pyx_k_meany[] = "meany"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_nbins[] = "nbins"; +static char __pyx_k_nleft[] = "nleft"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_other[] = "other"; +static char __pyx_k_prodx[] = "prodx"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_ranks[] = "ranks"; +static char __pyx_k_retry[] = "retry"; +static char __pyx_k_right[] = "right"; +static char __pyx_k_shape[] = "shape"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_start[] = "start"; +static char __pyx_k_strip[] = "strip"; +static char __pyx_k_sum_x[] = "sum_x"; +static char __pyx_k_sumxx[] = "sumxx"; +static char __pyx_k_sumyy[] = "sumyy"; +static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_vhigh[] = "vhigh"; +static char __pyx_k_vopen[] = "vopen"; +static char __pyx_k_where[] = "where"; +static char __pyx_k_width[] = "width"; +static char __pyx_k_win_i[] = "win_i"; +static char __pyx_k_win_k[] = "win_k"; +static char __pyx_k_win_n[] = "win_n"; +static char __pyx_k_zeros[] = "zeros"; +static char __pyx_k_adjust[] = "adjust"; +static char __pyx_k_arange[] = "arange"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_bufarr[] = "bufarr"; +static char __pyx_k_counts[] = "counts"; +static char __pyx_k_format[] = "format"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_in_arr[] = "in_arr"; +static char __pyx_k_insert[] = "insert"; +static char __pyx_k_int8_t[] = "int8_t"; +static char __pyx_k_kwargs[] = "kwargs"; +static char __pyx_k_labels[] = "labels"; +static char __pyx_k_lambda[] = ""; +static char __pyx_k_length[] = "length"; +static char __pyx_k_mean_x[] = "mean_x"; +static char __pyx_k_median[] = "median"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_name_2[] = "__name__"; +static char __pyx_k_neg_ct[] = "neg_ct"; +static char __pyx_k_nright[] = "nright"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_offset[] = "offset"; +static char __pyx_k_oldbuf[] = "oldbuf"; +static char __pyx_k_output[] = "output"; +static char __pyx_k_pandas[] = "pandas"; +static char __pyx_k_random[] = "random"; +static char __pyx_k_remove[] = "remove"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_sorter[] = "sorter"; +static char __pyx_k_struct[] = "struct"; +static char __pyx_k_unpack[] = "unpack"; +static char __pyx_k_val_in[] = "val_in"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_vclose[] = "vclose"; +static char __pyx_k_window[] = "window"; +static char __pyx_k_xrange[] = "xrange"; +static char __pyx_k_argsort[] = "argsort"; +static char __pyx_k_asarray[] = "asarray"; +static char __pyx_k_average[] = "average"; +static char __pyx_k_avg_wgt[] = "avg_wgt"; +static char __pyx_k_divisor[] = "divisor"; +static char __pyx_k_float16[] = "float16"; +static char __pyx_k_float32[] = "float32"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_fortran[] = "fortran"; +static char __pyx_k_indexer[] = "indexer"; +static char __pyx_k_int16_t[] = "int16_t"; +static char __pyx_k_int32_t[] = "int32_t"; +static char __pyx_k_int64_t[] = "int64_t"; +static char __pyx_k_keep_na[] = "keep_na"; +static char __pyx_k_maskedx[] = "maskedx"; +static char __pyx_k_maskedy[] = "maskedy"; +static char __pyx_k_members[] = "members"; +static char __pyx_k_memview[] = "memview"; +static char __pyx_k_minpair[] = "minpair"; +static char __pyx_k_nancorr[] = "nancorr"; +static char __pyx_k_ndarray[] = "ndarray"; +static char __pyx_k_ngroups[] = "ngroups"; +static char __pyx_k_nlevels[] = "nlevels"; +static char __pyx_k_nonzero[] = "nonzero"; +static char __pyx_k_periods[] = "periods"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_putmask[] = "putmask"; +static char __pyx_k_reverse[] = "reverse"; +static char __pyx_k_ssqdm_x[] = "ssqdm_x"; +static char __pyx_k_tot_wgt[] = "tot_wgt"; +static char __pyx_k_uint8_t[] = "uint8_t"; +static char __pyx_k_val_win[] = "val_win"; +static char __pyx_k_weights[] = "weights"; +static char __pyx_k_Ellipsis[] = "Ellipsis"; +static char __pyx_k_Infinity[] = "Infinity"; +static char __pyx_k_KeyError[] = "KeyError"; +static char __pyx_k_counts_2[] = "_counts"; +static char __pyx_k_datetime[] = "datetime"; +static char __pyx_k_defaults[] = "defaults"; +static char __pyx_k_isfinite[] = "isfinite"; +static char __pyx_k_itemsize[] = "itemsize"; +static char __pyx_k_last_obs[] = "last_obs"; +static char __pyx_k_left_pos[] = "left_pos"; +static char __pyx_k_lindexer[] = "lindexer"; +static char __pyx_k_midpoint[] = "midpoint"; +static char __pyx_k_object_2[] = "object_"; +static char __pyx_k_pad_bool[] = "pad_bool"; +static char __pyx_k_position[] = "position"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_quantile[] = "quantile"; +static char __pyx_k_rindexer[] = "rindexer"; +static char __pyx_k_roll_max[] = "roll_max"; +static char __pyx_k_roll_min[] = "roll_min"; +static char __pyx_k_roll_sum[] = "roll_sum"; +static char __pyx_k_roll_var[] = "roll_var"; +static char __pyx_k_skiplist[] = "skiplist"; +static char __pyx_k_tiebreak[] = "tiebreak"; +static char __pyx_k_uint16_t[] = "uint16_t"; +static char __pyx_k_uint32_t[] = "uint32_t"; +static char __pyx_k_uint64_t[] = "uint64_t"; +static char __pyx_k_Not_Found[] = "Not Found"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_argsorted[] = "argsorted"; +static char __pyx_k_ascending[] = "ascending"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_float32_t[] = "float32_t"; +static char __pyx_k_float64_t[] = "float64_t"; +static char __pyx_k_got_first[] = "got_first"; +static char __pyx_k_group_ids[] = "group_ids"; +static char __pyx_k_is_unique[] = "is_unique"; +static char __pyx_k_isnullobj[] = "isnullobj"; +static char __pyx_k_max_group[] = "max_group"; +static char __pyx_k_mergesort[] = "mergesort"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_na_option[] = "na_option"; +static char __pyx_k_nan_value[] = "nan_value"; +static char __pyx_k_ones_like[] = "ones_like"; +static char __pyx_k_pad_int32[] = "pad_int32"; +static char __pyx_k_pad_int64[] = "pad_int64"; +static char __pyx_k_right_pos[] = "right_pos"; +static char __pyx_k_roll_kurt[] = "roll_kurt"; +static char __pyx_k_roll_max2[] = "roll_max2"; +static char __pyx_k_roll_mean[] = "roll_mean"; +static char __pyx_k_roll_min2[] = "roll_min2"; +static char __pyx_k_roll_skew[] = "roll_skew"; +static char __pyx_k_sum_ranks[] = "sum_ranks"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_check_minp[] = "_check_minp"; +static char __pyx_k_empty_like[] = "empty_like"; +static char __pyx_k_fill_count[] = "fill_count"; +static char __pyx_k_fill_value[] = "fill_value"; +static char __pyx_k_inner_join[] = "inner_join"; +static char __pyx_k_left_count[] = "left_count"; +static char __pyx_k_max_groups[] = "max_groups"; +static char __pyx_k_max_subseq[] = "max_subseq"; +static char __pyx_k_min_subseq[] = "min_subseq"; +static char __pyx_k_pad_object[] = "pad_object"; +static char __pyx_k_pandas_lib[] = "pandas.lib"; +static char __pyx_k_pydatetime[] = "pydatetime"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_signatures[] = "signatures"; +static char __pyx_k_valid_locs[] = "valid_locs"; +static char __pyx_k_zeros_like[] = "zeros_like"; +static char __pyx_k_ImportError[] = "ImportError"; +static char __pyx_k_MemoryError[] = "MemoryError"; +static char __pyx_k_NegInfinity[] = "NegInfinity"; +static char __pyx_k_arrmap_bool[] = "arrmap_bool"; +static char __pyx_k_isnullobj2d[] = "isnullobj2d"; +static char __pyx_k_left_sorter[] = "left_sorter"; +static char __pyx_k_microsecond[] = "microsecond"; +static char __pyx_k_pad_float32[] = "pad_float32"; +static char __pyx_k_pad_float64[] = "pad_float64"; +static char __pyx_k_return_true[] = "_return_true"; +static char __pyx_k_right_count[] = "right_count"; +static char __pyx_k_roll_window[] = "roll_window"; +static char __pyx_k_sorted_data[] = "sorted_data"; +static char __pyx_k_tiebreakers[] = "tiebreakers"; +static char __pyx_k_ties_method[] = "ties_method"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_arrmap_int32[] = "arrmap_int32"; +static char __pyx_k_arrmap_int64[] = "arrmap_int64"; +static char __pyx_k_c_contiguous[] = "c_contiguous"; +static char __pyx_k_diff_2d_int8[] = "diff_2d_int8"; +static char __pyx_k_f_contiguous[] = "f_contiguous"; +static char __pyx_k_group_labels[] = "group_labels"; +static char __pyx_k_group_median[] = "group_median"; +static char __pyx_k_groupby_bool[] = "groupby_bool"; +static char __pyx_k_is_lexsorted[] = "is_lexsorted"; +static char __pyx_k_kth_smallest[] = "kth_smallest"; +static char __pyx_k_left_indexer[] = "left_indexer"; +static char __pyx_k_pandas_algos[] = "pandas.algos"; +static char __pyx_k_return_false[] = "_return_false"; +static char __pyx_k_right_sorter[] = "right_sorter"; +static char __pyx_k_roll_generic[] = "roll_generic"; +static char __pyx_k_arrmap_object[] = "arrmap_object"; +static char __pyx_k_backfill_bool[] = "backfill_bool"; +static char __pyx_k_diff_2d_int16[] = "diff_2d_int16"; +static char __pyx_k_diff_2d_int32[] = "diff_2d_int32"; +static char __pyx_k_diff_2d_int64[] = "diff_2d_int64"; +static char __pyx_k_expected_size[] = "expected_size"; +static char __pyx_k_ffill_indexer[] = "ffill_indexer"; +static char __pyx_k_groupby_int32[] = "groupby_int32"; +static char __pyx_k_groupby_int64[] = "groupby_int64"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_rank_1d_int64[] = "rank_1d_int64"; +static char __pyx_k_rank_2d_int64[] = "rank_2d_int64"; +static char __pyx_k_right_indexer[] = "right_indexer"; +static char __pyx_k_roll_median_c[] = "roll_median_c"; +static char __pyx_k_roll_quantile[] = "roll_quantile"; +static char __pyx_k_AssertionError[] = "AssertionError"; +static char __pyx_k_arrmap_float32[] = "arrmap_float32"; +static char __pyx_k_arrmap_float64[] = "arrmap_float64"; +static char __pyx_k_backfill_int32[] = "backfill_int32"; +static char __pyx_k_backfill_int64[] = "backfill_int64"; +static char __pyx_k_ffill_by_group[] = "ffill_by_group"; +static char __pyx_k_groupby_object[] = "groupby_object"; +static char __pyx_k_list_of_arrays[] = "list_of_arrays"; +static char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static char __pyx_k_backfill_object[] = "backfill_object"; +static char __pyx_k_diff_2d_float32[] = "diff_2d_float32"; +static char __pyx_k_diff_2d_float64[] = "diff_2d_float64"; +static char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static char __pyx_k_full_outer_join[] = "full_outer_join"; +static char __pyx_k_groupby_float32[] = "groupby_float32"; +static char __pyx_k_groupby_float64[] = "groupby_float64"; +static char __pyx_k_groupby_indices[] = "groupby_indices"; +static char __pyx_k_left_outer_join[] = "left_outer_join"; +static char __pyx_k_rank_1d_float64[] = "rank_1d_float64"; +static char __pyx_k_rank_1d_generic[] = "rank_1d_generic"; +static char __pyx_k_rank_2d_float64[] = "rank_2d_float64"; +static char __pyx_k_rank_2d_generic[] = "rank_2d_generic"; +static char __pyx_k_total_tie_count[] = "total_tie_count"; +static char __pyx_k_backfill_float32[] = "backfill_float32"; +static char __pyx_k_backfill_float64[] = "backfill_float64"; +static char __pyx_k_group_nth_object[] = "group_nth_object"; +static char __pyx_k_nancorr_spearman[] = "nancorr_spearman"; +static char __pyx_k_pad_inplace_bool[] = "pad_inplace_bool"; +static char __pyx_k_pyx_fuse_0median[] = "__pyx_fuse_0median"; +static char __pyx_k_pyx_fuse_1median[] = "__pyx_fuse_1median"; +static char __pyx_k_pyx_fuse_2median[] = "__pyx_fuse_2median"; +static char __pyx_k_pyx_fuse_3median[] = "__pyx_fuse_3median"; +static char __pyx_k_pyx_fuse_4median[] = "__pyx_fuse_4median"; +static char __pyx_k_pyx_fuse_5median[] = "__pyx_fuse_5median"; +static char __pyx_k_pyx_fuse_6median[] = "__pyx_fuse_6median"; +static char __pyx_k_pyx_fuse_7median[] = "__pyx_fuse_7median"; +static char __pyx_k_pyx_fuse_8median[] = "__pyx_fuse_8median"; +static char __pyx_k_pyx_fuse_9median[] = "__pyx_fuse_9median"; +static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s"; +static char __pyx_k_group_add_float32[] = "group_add_float32"; +static char __pyx_k_group_add_float64[] = "group_add_float64"; +static char __pyx_k_group_count_int64[] = "group_count_int64"; +static char __pyx_k_group_last_object[] = "group_last_object"; +static char __pyx_k_group_max_float32[] = "group_max_float32"; +static char __pyx_k_group_max_float64[] = "group_max_float64"; +static char __pyx_k_group_min_float32[] = "group_min_float32"; +static char __pyx_k_group_min_float64[] = "group_min_float64"; +static char __pyx_k_group_nth_float32[] = "group_nth_float32"; +static char __pyx_k_group_nth_float64[] = "group_nth_float64"; +static char __pyx_k_group_var_float32[] = "group_var_float32"; +static char __pyx_k_group_var_float64[] = "group_var_float64"; +static char __pyx_k_groupsort_indexer[] = "groupsort_indexer"; +static char __pyx_k_is_monotonic_bool[] = "is_monotonic_bool"; +static char __pyx_k_pad_inplace_int32[] = "pad_inplace_int32"; +static char __pyx_k_pad_inplace_int64[] = "pad_inplace_int64"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_take_1d_bool_bool[] = "take_1d_bool_bool"; +static char __pyx_k_take_1d_int8_int8[] = "take_1d_int8_int8"; +static char __pyx_k_get_result_indexer[] = "_get_result_indexer"; +static char __pyx_k_group_count_object[] = "group_count_object"; +static char __pyx_k_group_last_float32[] = "group_last_float32"; +static char __pyx_k_group_last_float64[] = "group_last_float64"; +static char __pyx_k_group_mean_float32[] = "group_mean_float32"; +static char __pyx_k_group_mean_float64[] = "group_mean_float64"; +static char __pyx_k_group_ohlc_float32[] = "group_ohlc_float32"; +static char __pyx_k_group_ohlc_float64[] = "group_ohlc_float64"; +static char __pyx_k_group_prod_float32[] = "group_prod_float32"; +static char __pyx_k_group_prod_float64[] = "group_prod_float64"; +static char __pyx_k_is_monotonic_int32[] = "is_monotonic_int32"; +static char __pyx_k_is_monotonic_int64[] = "is_monotonic_int64"; +static char __pyx_k_pad_inplace_object[] = "pad_inplace_object"; +static char __pyx_k_roll_median_cython[] = "roll_median_cython"; +static char __pyx_k_strided_and_direct[] = ""; +static char __pyx_k_take_1d_int8_int32[] = "take_1d_int8_int32"; +static char __pyx_k_take_1d_int8_int64[] = "take_1d_int8_int64"; +static char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static char __pyx_k_group_count_float32[] = "group_count_float32"; +static char __pyx_k_group_count_float64[] = "group_count_float64"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_is_monotonic_object[] = "is_monotonic_object"; +static char __pyx_k_pad_2d_inplace_bool[] = "pad_2d_inplace_bool"; +static char __pyx_k_pad_inplace_float32[] = "pad_inplace_float32"; +static char __pyx_k_pad_inplace_float64[] = "pad_inplace_float64"; +static char __pyx_k_pandas_src_join_pyx[] = "pandas/src/join.pyx"; +static char __pyx_k_take_1d_bool_object[] = "take_1d_bool_object"; +static char __pyx_k_take_1d_int16_int16[] = "take_1d_int16_int16"; +static char __pyx_k_take_1d_int16_int32[] = "take_1d_int16_int32"; +static char __pyx_k_take_1d_int16_int64[] = "take_1d_int16_int64"; +static char __pyx_k_take_1d_int32_int32[] = "take_1d_int32_int32"; +static char __pyx_k_take_1d_int32_int64[] = "take_1d_int32_int64"; +static char __pyx_k_take_1d_int64_int64[] = "take_1d_int64_int64"; +static char __pyx_k_group_nth_bin_object[] = "group_nth_bin_object"; +static char __pyx_k_is_monotonic_float32[] = "is_monotonic_float32"; +static char __pyx_k_is_monotonic_float64[] = "is_monotonic_float64"; +static char __pyx_k_len_index_len_labels[] = "len(index) != len(labels)"; +static char __pyx_k_pad_2d_inplace_int32[] = "pad_2d_inplace_int32"; +static char __pyx_k_pad_2d_inplace_int64[] = "pad_2d_inplace_int64"; +static char __pyx_k_strided_and_indirect[] = ""; +static char __pyx_k_take_1d_int8_float64[] = "take_1d_int8_float64"; +static char __pyx_k_Invalid_window_size_d[] = "Invalid window size %d"; +static char __pyx_k_backfill_inplace_bool[] = "backfill_inplace_bool"; +static char __pyx_k_contiguous_and_direct[] = ""; +static char __pyx_k_group_add_bin_float32[] = "group_add_bin_float32"; +static char __pyx_k_group_add_bin_float64[] = "group_add_bin_float64"; +static char __pyx_k_group_count_bin_int64[] = "group_count_bin_int64"; +static char __pyx_k_group_last_bin_object[] = "group_last_bin_object"; +static char __pyx_k_group_max_bin_float32[] = "group_max_bin_float32"; +static char __pyx_k_group_max_bin_float64[] = "group_max_bin_float64"; +static char __pyx_k_group_min_bin_float32[] = "group_min_bin_float32"; +static char __pyx_k_group_min_bin_float64[] = "group_min_bin_float64"; +static char __pyx_k_group_nth_bin_float32[] = "group_nth_bin_float32"; +static char __pyx_k_group_nth_bin_float64[] = "group_nth_bin_float64"; +static char __pyx_k_group_var_bin_float32[] = "group_var_bin_float32"; +static char __pyx_k_group_var_bin_float64[] = "group_var_bin_float64"; +static char __pyx_k_maybe_convert_objects[] = "maybe_convert_objects"; +static char __pyx_k_min_periods_must_be_0[] = "min_periods must be >= 0"; +static char __pyx_k_pad_2d_inplace_object[] = "pad_2d_inplace_object"; +static char __pyx_k_take_1d_int16_float64[] = "take_1d_int16_float64"; +static char __pyx_k_take_1d_int32_float64[] = "take_1d_int32_float64"; +static char __pyx_k_take_1d_int64_float64[] = "take_1d_int64_float64"; +static char __pyx_k_take_1d_object_object[] = "take_1d_object_object"; +static char __pyx_k_MemoryView_of_r_object[] = ""; +static char __pyx_k_backfill_inplace_int32[] = "backfill_inplace_int32"; +static char __pyx_k_backfill_inplace_int64[] = "backfill_inplace_int64"; +static char __pyx_k_group_count_bin_object[] = "group_count_bin_object"; +static char __pyx_k_group_last_bin_float32[] = "group_last_bin_float32"; +static char __pyx_k_group_last_bin_float64[] = "group_last_bin_float64"; +static char __pyx_k_group_mean_bin_float32[] = "group_mean_bin_float32"; +static char __pyx_k_group_mean_bin_float64[] = "group_mean_bin_float64"; +static char __pyx_k_group_prod_bin_float32[] = "group_prod_bin_float32"; +static char __pyx_k_group_prod_bin_float64[] = "group_prod_bin_float64"; +static char __pyx_k_pad_2d_inplace_float32[] = "pad_2d_inplace_float32"; +static char __pyx_k_pad_2d_inplace_float64[] = "pad_2d_inplace_float64"; +static char __pyx_k_pyx_fuse_0kth_smallest[] = "__pyx_fuse_0kth_smallest"; +static char __pyx_k_pyx_fuse_1kth_smallest[] = "__pyx_fuse_1kth_smallest"; +static char __pyx_k_pyx_fuse_2kth_smallest[] = "__pyx_fuse_2kth_smallest"; +static char __pyx_k_pyx_fuse_3kth_smallest[] = "__pyx_fuse_3kth_smallest"; +static char __pyx_k_pyx_fuse_4kth_smallest[] = "__pyx_fuse_4kth_smallest"; +static char __pyx_k_pyx_fuse_5kth_smallest[] = "__pyx_fuse_5kth_smallest"; +static char __pyx_k_pyx_fuse_6kth_smallest[] = "__pyx_fuse_6kth_smallest"; +static char __pyx_k_pyx_fuse_7kth_smallest[] = "__pyx_fuse_7kth_smallest"; +static char __pyx_k_pyx_fuse_8kth_smallest[] = "__pyx_fuse_8kth_smallest"; +static char __pyx_k_pyx_fuse_9kth_smallest[] = "__pyx_fuse_9kth_smallest"; +static char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static char __pyx_k_backfill_inplace_object[] = "backfill_inplace_object"; +static char __pyx_k_contiguous_and_indirect[] = ""; +static char __pyx_k_group_count_bin_float32[] = "group_count_bin_float32"; +static char __pyx_k_group_count_bin_float64[] = "group_count_bin_float64"; +static char __pyx_k_left_join_indexer_int32[] = "left_join_indexer_int32"; +static char __pyx_k_left_join_indexer_int64[] = "left_join_indexer_int64"; +static char __pyx_k_take_1d_float32_float32[] = "take_1d_float32_float32"; +static char __pyx_k_take_1d_float32_float64[] = "take_1d_float32_float64"; +static char __pyx_k_take_1d_float64_float64[] = "take_1d_float64_float64"; +static char __pyx_k_take_2d_axis0_bool_bool[] = "take_2d_axis0_bool_bool"; +static char __pyx_k_take_2d_axis0_int8_int8[] = "take_2d_axis0_int8_int8"; +static char __pyx_k_take_2d_axis1_bool_bool[] = "take_2d_axis1_bool_bool"; +static char __pyx_k_take_2d_axis1_int8_int8[] = "take_2d_axis1_int8_int8"; +static char __pyx_k_take_2d_multi_bool_bool[] = "take_2d_multi_bool_bool"; +static char __pyx_k_take_2d_multi_int8_int8[] = "take_2d_multi_int8_int8"; +static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static char __pyx_k_backfill_2d_inplace_bool[] = "backfill_2d_inplace_bool"; +static char __pyx_k_backfill_inplace_float32[] = "backfill_inplace_float32"; +static char __pyx_k_backfill_inplace_float64[] = "backfill_inplace_float64"; +static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)"; +static char __pyx_k_inner_join_indexer_int32[] = "inner_join_indexer_int32"; +static char __pyx_k_inner_join_indexer_int64[] = "inner_join_indexer_int64"; +static char __pyx_k_left_join_indexer_object[] = "left_join_indexer_object"; +static char __pyx_k_outer_join_indexer_int32[] = "outer_join_indexer_int32"; +static char __pyx_k_outer_join_indexer_int64[] = "outer_join_indexer_int64"; +static char __pyx_k_pandas_src_generated_pyx[] = "pandas/src/generated.pyx"; +static char __pyx_k_take_2d_axis0_int8_int32[] = "take_2d_axis0_int8_int32"; +static char __pyx_k_take_2d_axis0_int8_int64[] = "take_2d_axis0_int8_int64"; +static char __pyx_k_take_2d_axis1_int8_int32[] = "take_2d_axis1_int8_int32"; +static char __pyx_k_take_2d_axis1_int8_int64[] = "take_2d_axis1_int8_int64"; +static char __pyx_k_take_2d_multi_int8_int32[] = "take_2d_multi_int8_int32"; +static char __pyx_k_take_2d_multi_int8_int64[] = "take_2d_multi_int8_int64"; +static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct"; +static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static char __pyx_k_backfill_2d_inplace_int32[] = "backfill_2d_inplace_int32"; +static char __pyx_k_backfill_2d_inplace_int64[] = "backfill_2d_inplace_int64"; +static char __pyx_k_inner_join_indexer_object[] = "inner_join_indexer_object"; +static char __pyx_k_left_join_indexer_float32[] = "left_join_indexer_float32"; +static char __pyx_k_left_join_indexer_float64[] = "left_join_indexer_float64"; +static char __pyx_k_outer_join_indexer_object[] = "outer_join_indexer_object"; +static char __pyx_k_take_2d_axis0_bool_object[] = "take_2d_axis0_bool_object"; +static char __pyx_k_take_2d_axis0_int16_int16[] = "take_2d_axis0_int16_int16"; +static char __pyx_k_take_2d_axis0_int16_int32[] = "take_2d_axis0_int16_int32"; +static char __pyx_k_take_2d_axis0_int16_int64[] = "take_2d_axis0_int16_int64"; +static char __pyx_k_take_2d_axis0_int32_int32[] = "take_2d_axis0_int32_int32"; +static char __pyx_k_take_2d_axis0_int32_int64[] = "take_2d_axis0_int32_int64"; +static char __pyx_k_take_2d_axis0_int64_int64[] = "take_2d_axis0_int64_int64"; +static char __pyx_k_take_2d_axis1_bool_object[] = "take_2d_axis1_bool_object"; +static char __pyx_k_take_2d_axis1_int16_int16[] = "take_2d_axis1_int16_int16"; +static char __pyx_k_take_2d_axis1_int16_int32[] = "take_2d_axis1_int16_int32"; +static char __pyx_k_take_2d_axis1_int16_int64[] = "take_2d_axis1_int16_int64"; +static char __pyx_k_take_2d_axis1_int32_int32[] = "take_2d_axis1_int32_int32"; +static char __pyx_k_take_2d_axis1_int32_int64[] = "take_2d_axis1_int32_int64"; +static char __pyx_k_take_2d_axis1_int64_int64[] = "take_2d_axis1_int64_int64"; +static char __pyx_k_take_2d_multi_bool_object[] = "take_2d_multi_bool_object"; +static char __pyx_k_take_2d_multi_int16_int16[] = "take_2d_multi_int16_int16"; +static char __pyx_k_take_2d_multi_int16_int32[] = "take_2d_multi_int16_int32"; +static char __pyx_k_take_2d_multi_int16_int64[] = "take_2d_multi_int16_int64"; +static char __pyx_k_take_2d_multi_int32_int32[] = "take_2d_multi_int32_int32"; +static char __pyx_k_take_2d_multi_int32_int64[] = "take_2d_multi_int32_int64"; +static char __pyx_k_take_2d_multi_int64_int64[] = "take_2d_multi_int64_int64"; +static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)"; +static char __pyx_k_Limit_must_be_non_negative[] = "Limit must be non-negative"; +static char __pyx_k_backfill_2d_inplace_object[] = "backfill_2d_inplace_object"; +static char __pyx_k_inner_join_indexer_float32[] = "inner_join_indexer_float32"; +static char __pyx_k_inner_join_indexer_float64[] = "inner_join_indexer_float64"; +static char __pyx_k_outer_join_indexer_float32[] = "outer_join_indexer_float32"; +static char __pyx_k_outer_join_indexer_float64[] = "outer_join_indexer_float64"; +static char __pyx_k_take_2d_axis0_int8_float64[] = "take_2d_axis0_int8_float64"; +static char __pyx_k_take_2d_axis1_int8_float64[] = "take_2d_axis1_int8_float64"; +static char __pyx_k_take_2d_multi_int8_float64[] = "take_2d_multi_int8_float64"; +static char __pyx_k_No_matching_signature_found[] = "No matching signature found"; +static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)"; +static char __pyx_k_backfill_2d_inplace_float32[] = "backfill_2d_inplace_float32"; +static char __pyx_k_backfill_2d_inplace_float64[] = "backfill_2d_inplace_float64"; +static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_take_2d_axis0_int16_float64[] = "take_2d_axis0_int16_float64"; +static char __pyx_k_take_2d_axis0_int32_float64[] = "take_2d_axis0_int32_float64"; +static char __pyx_k_take_2d_axis0_int64_float64[] = "take_2d_axis0_int64_float64"; +static char __pyx_k_take_2d_axis0_object_object[] = "take_2d_axis0_object_object"; +static char __pyx_k_take_2d_axis1_int16_float64[] = "take_2d_axis1_int16_float64"; +static char __pyx_k_take_2d_axis1_int32_float64[] = "take_2d_axis1_int32_float64"; +static char __pyx_k_take_2d_axis1_int64_float64[] = "take_2d_axis1_int64_float64"; +static char __pyx_k_take_2d_axis1_object_object[] = "take_2d_axis1_object_object"; +static char __pyx_k_take_2d_multi_int16_float64[] = "take_2d_multi_int16_float64"; +static char __pyx_k_take_2d_multi_int32_float64[] = "take_2d_multi_int32_float64"; +static char __pyx_k_take_2d_multi_int64_float64[] = "take_2d_multi_int64_float64"; +static char __pyx_k_take_2d_multi_object_object[] = "take_2d_multi_object_object"; +static char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments"; +static char __pyx_k_take_2d_axis0_float32_float32[] = "take_2d_axis0_float32_float32"; +static char __pyx_k_take_2d_axis0_float32_float64[] = "take_2d_axis0_float32_float64"; +static char __pyx_k_take_2d_axis0_float64_float64[] = "take_2d_axis0_float64_float64"; +static char __pyx_k_take_2d_axis1_float32_float32[] = "take_2d_axis1_float32_float32"; +static char __pyx_k_take_2d_axis1_float32_float64[] = "take_2d_axis1_float32_float64"; +static char __pyx_k_take_2d_axis1_float64_float64[] = "take_2d_axis1_float64_float64"; +static char __pyx_k_take_2d_multi_float32_float32[] = "take_2d_multi_float32_float32"; +static char __pyx_k_take_2d_multi_float32_float64[] = "take_2d_multi_float32_float64"; +static char __pyx_k_take_2d_multi_float64_float64[] = "take_2d_multi_float64_float64"; +static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static char __pyx_k_left_join_indexer_unique_int32[] = "left_join_indexer_unique_int32"; +static char __pyx_k_left_join_indexer_unique_int64[] = "left_join_indexer_unique_int64"; +static char __pyx_k_min_periods_d_must_be_window_d[] = "min_periods (%d) must be <= window (%d)"; +static char __pyx_k_strided_and_direct_or_indirect[] = ""; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/algos.pyx"; +static char __pyx_k_left_join_indexer_unique_object[] = "left_join_indexer_unique_object"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; +static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions"; +static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types"; +static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static char __pyx_k_Invalid_min_periods_size_d_great[] = "Invalid min_periods size %d greater than window %d"; +static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static char __pyx_k_Output_array_must_have_4_columns[] = "Output array must have 4 columns"; +static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static char __pyx_k_first_not_supported_for_non_nume[] = "first not supported for non-numeric data"; +static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static char __pyx_k_left_join_indexer_unique_float32[] = "left_join_indexer_unique_float32"; +static char __pyx_k_left_join_indexer_unique_float64[] = "left_join_indexer_unique_float64"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_A; +static PyObject *__pyx_n_s_AssertionError; +static PyObject *__pyx_n_s_B; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_n_s_C; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_D; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_kp_s_Expected_at_least_d_arguments; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_n_s_Infinity; +static PyObject *__pyx_kp_s_Invalid_min_periods_size_d_great; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_kp_s_Invalid_window_size_d; +static PyObject *__pyx_n_s_K; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_kp_s_Limit_must_be_non_negative; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_N; +static PyObject *__pyx_n_s_NA; +static PyObject *__pyx_n_s_NIL; +static PyObject *__pyx_n_s_NINF; +static PyObject *__pyx_n_s_NaN; +static PyObject *__pyx_n_s_NegInfinity; +static PyObject *__pyx_kp_s_No_matching_signature_found; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_kp_s_Not_Found; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_n_s_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_kp_s_Output_array_must_have_4_columns; +static PyObject *__pyx_n_s_R; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_S; +static PyObject *__pyx_n_s_T; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_kp_s_Unable_to_parse_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s__32; +static PyObject *__pyx_kp_s__34; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_adj; +static PyObject *__pyx_n_s_adjust; +static PyObject *__pyx_n_s_ai; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_aold; +static PyObject *__pyx_n_s_arange; +static PyObject *__pyx_n_s_arg; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_argsort; +static PyObject *__pyx_n_s_argsorted; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_arrmap_bool; +static PyObject *__pyx_n_s_arrmap_float32; +static PyObject *__pyx_n_s_arrmap_float64; +static PyObject *__pyx_n_s_arrmap_int32; +static PyObject *__pyx_n_s_arrmap_int64; +static PyObject *__pyx_n_s_arrmap_object; +static PyObject *__pyx_n_s_as; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_ascending; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_average; +static PyObject *__pyx_n_s_avg; +static PyObject *__pyx_n_s_avg_wgt; +static PyObject *__pyx_n_s_axis; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_backfill_2d_inplace_bool; +static PyObject *__pyx_n_s_backfill_2d_inplace_float32; +static PyObject *__pyx_n_s_backfill_2d_inplace_float64; +static PyObject *__pyx_n_s_backfill_2d_inplace_int32; +static PyObject *__pyx_n_s_backfill_2d_inplace_int64; +static PyObject *__pyx_n_s_backfill_2d_inplace_object; +static PyObject *__pyx_n_s_backfill_bool; +static PyObject *__pyx_n_s_backfill_float32; +static PyObject *__pyx_n_s_backfill_float64; +static PyObject *__pyx_n_s_backfill_inplace_bool; +static PyObject *__pyx_n_s_backfill_inplace_float32; +static PyObject *__pyx_n_s_backfill_inplace_float64; +static PyObject *__pyx_n_s_backfill_inplace_int32; +static PyObject *__pyx_n_s_backfill_inplace_int64; +static PyObject *__pyx_n_s_backfill_inplace_object; +static PyObject *__pyx_n_s_backfill_int32; +static PyObject *__pyx_n_s_backfill_int64; +static PyObject *__pyx_n_s_backfill_object; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_bins; +static PyObject *__pyx_n_s_buf; +static PyObject *__pyx_n_s_bufarr; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_c_contiguous; +static PyObject *__pyx_n_s_check_minp; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cmp; +static PyObject *__pyx_n_s_com; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_counts; +static PyObject *__pyx_n_s_counts_2; +static PyObject *__pyx_n_s_cov; +static PyObject *__pyx_n_s_ct; +static PyObject *__pyx_n_s_cur; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_ddof; +static PyObject *__pyx_n_s_defaults; +static PyObject *__pyx_n_s_delta; +static PyObject *__pyx_n_s_dense; +static PyObject *__pyx_n_s_diff_2d_float32; +static PyObject *__pyx_n_s_diff_2d_float64; +static PyObject *__pyx_n_s_diff_2d_int16; +static PyObject *__pyx_n_s_diff_2d_int32; +static PyObject *__pyx_n_s_diff_2d_int64; +static PyObject *__pyx_n_s_diff_2d_int8; +static PyObject *__pyx_n_s_dim; +static PyObject *__pyx_n_s_dims; +static PyObject *__pyx_n_s_divisor; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_dups; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_empty_like; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_eq; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_ewma; +static PyObject *__pyx_n_s_expected_size; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_f8; +static PyObject *__pyx_n_s_f_contiguous; +static PyObject *__pyx_n_s_ffill_by_group; +static PyObject *__pyx_n_s_ffill_indexer; +static PyObject *__pyx_n_s_fill; +static PyObject *__pyx_n_s_fill_count; +static PyObject *__pyx_n_s_fill_value; +static PyObject *__pyx_n_s_first; +static PyObject *__pyx_kp_s_first_not_supported_for_non_nume; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float16; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_float32_t; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_float64_t; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_full_outer_join; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_fv; +static PyObject *__pyx_n_s_ge; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_result_indexer; +static PyObject *__pyx_n_s_gid; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_got_first; +static PyObject *__pyx_n_s_group_add_bin_float32; +static PyObject *__pyx_n_s_group_add_bin_float64; +static PyObject *__pyx_n_s_group_add_float32; +static PyObject *__pyx_n_s_group_add_float64; +static PyObject *__pyx_n_s_group_count_bin_float32; +static PyObject *__pyx_n_s_group_count_bin_float64; +static PyObject *__pyx_n_s_group_count_bin_int64; +static PyObject *__pyx_n_s_group_count_bin_object; +static PyObject *__pyx_n_s_group_count_float32; +static PyObject *__pyx_n_s_group_count_float64; +static PyObject *__pyx_n_s_group_count_int64; +static PyObject *__pyx_n_s_group_count_object; +static PyObject *__pyx_n_s_group_ids; +static PyObject *__pyx_n_s_group_labels; +static PyObject *__pyx_n_s_group_last_bin_float32; +static PyObject *__pyx_n_s_group_last_bin_float64; +static PyObject *__pyx_n_s_group_last_bin_object; +static PyObject *__pyx_n_s_group_last_float32; +static PyObject *__pyx_n_s_group_last_float64; +static PyObject *__pyx_n_s_group_last_object; +static PyObject *__pyx_n_s_group_max_bin_float32; +static PyObject *__pyx_n_s_group_max_bin_float64; +static PyObject *__pyx_n_s_group_max_float32; +static PyObject *__pyx_n_s_group_max_float64; +static PyObject *__pyx_n_s_group_mean_bin_float32; +static PyObject *__pyx_n_s_group_mean_bin_float64; +static PyObject *__pyx_n_s_group_mean_float32; +static PyObject *__pyx_n_s_group_mean_float64; +static PyObject *__pyx_n_s_group_median; +static PyObject *__pyx_n_s_group_min_bin_float32; +static PyObject *__pyx_n_s_group_min_bin_float64; +static PyObject *__pyx_n_s_group_min_float32; +static PyObject *__pyx_n_s_group_min_float64; +static PyObject *__pyx_n_s_group_nth_bin_float32; +static PyObject *__pyx_n_s_group_nth_bin_float64; +static PyObject *__pyx_n_s_group_nth_bin_object; +static PyObject *__pyx_n_s_group_nth_float32; +static PyObject *__pyx_n_s_group_nth_float64; +static PyObject *__pyx_n_s_group_nth_object; +static PyObject *__pyx_n_s_group_ohlc_float32; +static PyObject *__pyx_n_s_group_ohlc_float64; +static PyObject *__pyx_n_s_group_prod_bin_float32; +static PyObject *__pyx_n_s_group_prod_bin_float64; +static PyObject *__pyx_n_s_group_prod_float32; +static PyObject *__pyx_n_s_group_prod_float64; +static PyObject *__pyx_n_s_group_var_bin_float32; +static PyObject *__pyx_n_s_group_var_bin_float64; +static PyObject *__pyx_n_s_group_var_float32; +static PyObject *__pyx_n_s_group_var_float64; +static PyObject *__pyx_n_s_groupby_bool; +static PyObject *__pyx_n_s_groupby_float32; +static PyObject *__pyx_n_s_groupby_float64; +static PyObject *__pyx_n_s_groupby_indices; +static PyObject *__pyx_n_s_groupby_int32; +static PyObject *__pyx_n_s_groupby_int64; +static PyObject *__pyx_n_s_groupby_object; +static PyObject *__pyx_n_s_groupsort_indexer; +static PyObject *__pyx_n_s_gt; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_i0; +static PyObject *__pyx_n_s_i8; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_ids; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_idx0; +static PyObject *__pyx_n_s_idx1; +static PyObject *__pyx_n_s_iinfo; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_in_arr; +static PyObject *__pyx_n_s_in_i; +static PyObject *__pyx_n_s_in_k; +static PyObject *__pyx_n_s_in_n; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_indexer; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_infs; +static PyObject *__pyx_n_s_inner_join; +static PyObject *__pyx_n_s_inner_join_indexer_float32; +static PyObject *__pyx_n_s_inner_join_indexer_float64; +static PyObject *__pyx_n_s_inner_join_indexer_int32; +static PyObject *__pyx_n_s_inner_join_indexer_int64; +static PyObject *__pyx_n_s_inner_join_indexer_object; +static PyObject *__pyx_n_s_input; +static PyObject *__pyx_n_s_insert; +static PyObject *__pyx_n_s_int; +static PyObject *__pyx_n_s_int16; +static PyObject *__pyx_n_s_int16_t; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int32_t; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_int64_t; +static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_int8_t; +static PyObject *__pyx_n_s_is_lexsorted; +static PyObject *__pyx_n_s_is_monotonic_bool; +static PyObject *__pyx_n_s_is_monotonic_float32; +static PyObject *__pyx_n_s_is_monotonic_float64; +static PyObject *__pyx_n_s_is_monotonic_int32; +static PyObject *__pyx_n_s_is_monotonic_int64; +static PyObject *__pyx_n_s_is_monotonic_object; +static PyObject *__pyx_n_s_is_unique; +static PyObject *__pyx_n_s_isfinite; +static PyObject *__pyx_n_s_isnan; +static PyObject *__pyx_n_s_isnullobj; +static PyObject *__pyx_n_s_isnullobj2d; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_keep; +static PyObject *__pyx_n_s_keep_na; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_kind; +static PyObject *__pyx_n_s_kth_smallest; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lab; +static PyObject *__pyx_n_s_label; +static PyObject *__pyx_n_s_labels; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_last; +static PyObject *__pyx_n_s_last_obs; +static PyObject *__pyx_n_s_lc; +static PyObject *__pyx_n_s_le; +static PyObject *__pyx_n_s_left; +static PyObject *__pyx_n_s_left_count; +static PyObject *__pyx_n_s_left_indexer; +static PyObject *__pyx_n_s_left_join_indexer_float32; +static PyObject *__pyx_n_s_left_join_indexer_float64; +static PyObject *__pyx_n_s_left_join_indexer_int32; +static PyObject *__pyx_n_s_left_join_indexer_int64; +static PyObject *__pyx_n_s_left_join_indexer_object; +static PyObject *__pyx_n_s_left_join_indexer_unique_float32; +static PyObject *__pyx_n_s_left_join_indexer_unique_float64; +static PyObject *__pyx_n_s_left_join_indexer_unique_int32; +static PyObject *__pyx_n_s_left_join_indexer_unique_int64; +static PyObject *__pyx_n_s_left_join_indexer_unique_object; +static PyObject *__pyx_n_s_left_outer_join; +static PyObject *__pyx_n_s_left_pos; +static PyObject *__pyx_n_s_left_sorter; +static PyObject *__pyx_kp_s_len_index_len_labels; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_lib; +static PyObject *__pyx_n_s_lim; +static PyObject *__pyx_n_s_limit; +static PyObject *__pyx_n_s_lindexer; +static PyObject *__pyx_n_s_list_of_arrays; +static PyObject *__pyx_n_s_loc; +static PyObject *__pyx_n_s_lt; +static PyObject *__pyx_n_s_lval; +static PyObject *__pyx_n_s_m; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mask; +static PyObject *__pyx_n_s_maskedx; +static PyObject *__pyx_n_s_maskedy; +static PyObject *__pyx_n_s_mat; +static PyObject *__pyx_n_s_max; +static PyObject *__pyx_n_s_max_group; +static PyObject *__pyx_n_s_max_groups; +static PyObject *__pyx_n_s_max_subseq; +static PyObject *__pyx_n_s_maxx; +static PyObject *__pyx_n_s_maybe_convert_objects; +static PyObject *__pyx_n_s_mean; +static PyObject *__pyx_n_s_mean_x; +static PyObject *__pyx_n_s_meanx; +static PyObject *__pyx_n_s_meany; +static PyObject *__pyx_n_s_median; +static PyObject *__pyx_n_s_members; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mergesort; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_microsecond; +static PyObject *__pyx_n_s_midpoint; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_kp_s_min_periods_d_must_be_window_d; +static PyObject *__pyx_kp_s_min_periods_must_be_0; +static PyObject *__pyx_n_s_min_subseq; +static PyObject *__pyx_n_s_minp; +static PyObject *__pyx_n_s_minpair; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_minx; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_n0; +static PyObject *__pyx_n_s_na_option; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_n_s_nan_value; +static PyObject *__pyx_n_s_nancorr; +static PyObject *__pyx_n_s_nancorr_spearman; +static PyObject *__pyx_n_s_nbins; +static PyObject *__pyx_n_s_ndarray; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_ne; +static PyObject *__pyx_n_s_neg_ct; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_neww; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_ngroups; +static PyObject *__pyx_n_s_nleft; +static PyObject *__pyx_n_s_nlevels; +static PyObject *__pyx_n_s_nobs; +static PyObject *__pyx_n_s_nonzero; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_nright; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_o; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_object_2; +static PyObject *__pyx_n_s_offset; +static PyObject *__pyx_n_s_old; +static PyObject *__pyx_n_s_oldbuf; +static PyObject *__pyx_n_s_oldw; +static PyObject *__pyx_n_s_ones_like; +static PyObject *__pyx_n_s_ord; +static PyObject *__pyx_n_s_other; +static PyObject *__pyx_n_s_out; +static PyObject *__pyx_n_s_outer_join_indexer_float32; +static PyObject *__pyx_n_s_outer_join_indexer_float64; +static PyObject *__pyx_n_s_outer_join_indexer_int32; +static PyObject *__pyx_n_s_outer_join_indexer_int64; +static PyObject *__pyx_n_s_outer_join_indexer_object; +static PyObject *__pyx_n_s_output; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pad_2d_inplace_bool; +static PyObject *__pyx_n_s_pad_2d_inplace_float32; +static PyObject *__pyx_n_s_pad_2d_inplace_float64; +static PyObject *__pyx_n_s_pad_2d_inplace_int32; +static PyObject *__pyx_n_s_pad_2d_inplace_int64; +static PyObject *__pyx_n_s_pad_2d_inplace_object; +static PyObject *__pyx_n_s_pad_bool; +static PyObject *__pyx_n_s_pad_float32; +static PyObject *__pyx_n_s_pad_float64; +static PyObject *__pyx_n_s_pad_inplace_bool; +static PyObject *__pyx_n_s_pad_inplace_float32; +static PyObject *__pyx_n_s_pad_inplace_float64; +static PyObject *__pyx_n_s_pad_inplace_int32; +static PyObject *__pyx_n_s_pad_inplace_int64; +static PyObject *__pyx_n_s_pad_inplace_object; +static PyObject *__pyx_n_s_pad_int32; +static PyObject *__pyx_n_s_pad_int64; +static PyObject *__pyx_n_s_pad_object; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_pandas_algos; +static PyObject *__pyx_n_s_pandas_lib; +static PyObject *__pyx_kp_s_pandas_src_generated_pyx; +static PyObject *__pyx_kp_s_pandas_src_join_pyx; +static PyObject *__pyx_n_s_pct; +static PyObject *__pyx_n_s_periods; +static PyObject *__pyx_n_s_position; +static PyObject *__pyx_n_s_pre; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_prev; +static PyObject *__pyx_n_s_prodx; +static PyObject *__pyx_n_s_ptr; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_putmask; +static PyObject *__pyx_n_s_pydatetime; +static PyObject *__pyx_n_s_pyx_fuse_0kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_0median; +static PyObject *__pyx_n_s_pyx_fuse_1kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_1median; +static PyObject *__pyx_n_s_pyx_fuse_2kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_2median; +static PyObject *__pyx_n_s_pyx_fuse_3kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_3median; +static PyObject *__pyx_n_s_pyx_fuse_4kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_4median; +static PyObject *__pyx_n_s_pyx_fuse_5kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_5median; +static PyObject *__pyx_n_s_pyx_fuse_6kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_6median; +static PyObject *__pyx_n_s_pyx_fuse_7kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_7median; +static PyObject *__pyx_n_s_pyx_fuse_8kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_8median; +static PyObject *__pyx_n_s_pyx_fuse_9kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_9median; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_quantile; +static PyObject *__pyx_n_s_random; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_rank; +static PyObject *__pyx_n_s_rank_1d_float64; +static PyObject *__pyx_n_s_rank_1d_generic; +static PyObject *__pyx_n_s_rank_1d_int64; +static PyObject *__pyx_n_s_rank_2d_float64; +static PyObject *__pyx_n_s_rank_2d_generic; +static PyObject *__pyx_n_s_rank_2d_int64; +static PyObject *__pyx_n_s_ranks; +static PyObject *__pyx_n_s_rc; +static PyObject *__pyx_n_s_remove; +static PyObject *__pyx_n_s_res; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_resx; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_retry; +static PyObject *__pyx_n_s_return_false; +static PyObject *__pyx_n_s_return_true; +static PyObject *__pyx_n_s_rev; +static PyObject *__pyx_n_s_reverse; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_right_count; +static PyObject *__pyx_n_s_right_indexer; +static PyObject *__pyx_n_s_right_pos; +static PyObject *__pyx_n_s_right_sorter; +static PyObject *__pyx_n_s_rindexer; +static PyObject *__pyx_n_s_ring; +static PyObject *__pyx_n_s_roll_generic; +static PyObject *__pyx_n_s_roll_kurt; +static PyObject *__pyx_n_s_roll_max; +static PyObject *__pyx_n_s_roll_max2; +static PyObject *__pyx_n_s_roll_mean; +static PyObject *__pyx_n_s_roll_median_c; +static PyObject *__pyx_n_s_roll_median_cython; +static PyObject *__pyx_n_s_roll_min; +static PyObject *__pyx_n_s_roll_min2; +static PyObject *__pyx_n_s_roll_quantile; +static PyObject *__pyx_n_s_roll_skew; +static PyObject *__pyx_n_s_roll_sum; +static PyObject *__pyx_n_s_roll_var; +static PyObject *__pyx_n_s_roll_window; +static PyObject *__pyx_n_s_rval; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_seen; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_signatures; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_skiplist; +static PyObject *__pyx_n_s_sl; +static PyObject *__pyx_n_s_sort; +static PyObject *__pyx_n_s_sorted_data; +static PyObject *__pyx_n_s_sorter; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_ssqdm_x; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_n_s_strip; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_sum_ranks; +static PyObject *__pyx_n_s_sum_x; +static PyObject *__pyx_n_s_sumx; +static PyObject *__pyx_n_s_sumxx; +static PyObject *__pyx_n_s_sumy; +static PyObject *__pyx_n_s_sumyy; +static PyObject *__pyx_n_s_sx; +static PyObject *__pyx_n_s_sy; +static PyObject *__pyx_n_s_take; +static PyObject *__pyx_n_s_take_1d_bool_bool; +static PyObject *__pyx_n_s_take_1d_bool_object; +static PyObject *__pyx_n_s_take_1d_float32_float32; +static PyObject *__pyx_n_s_take_1d_float32_float64; +static PyObject *__pyx_n_s_take_1d_float64_float64; +static PyObject *__pyx_n_s_take_1d_int16_float64; +static PyObject *__pyx_n_s_take_1d_int16_int16; +static PyObject *__pyx_n_s_take_1d_int16_int32; +static PyObject *__pyx_n_s_take_1d_int16_int64; +static PyObject *__pyx_n_s_take_1d_int32_float64; +static PyObject *__pyx_n_s_take_1d_int32_int32; +static PyObject *__pyx_n_s_take_1d_int32_int64; +static PyObject *__pyx_n_s_take_1d_int64_float64; +static PyObject *__pyx_n_s_take_1d_int64_int64; +static PyObject *__pyx_n_s_take_1d_int8_float64; +static PyObject *__pyx_n_s_take_1d_int8_int32; +static PyObject *__pyx_n_s_take_1d_int8_int64; +static PyObject *__pyx_n_s_take_1d_int8_int8; +static PyObject *__pyx_n_s_take_1d_object_object; +static PyObject *__pyx_n_s_take_2d_axis0_bool_bool; +static PyObject *__pyx_n_s_take_2d_axis0_bool_object; +static PyObject *__pyx_n_s_take_2d_axis0_float32_float32; +static PyObject *__pyx_n_s_take_2d_axis0_float32_float64; +static PyObject *__pyx_n_s_take_2d_axis0_float64_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int16_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int16_int16; +static PyObject *__pyx_n_s_take_2d_axis0_int16_int32; +static PyObject *__pyx_n_s_take_2d_axis0_int16_int64; +static PyObject *__pyx_n_s_take_2d_axis0_int32_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int32_int32; +static PyObject *__pyx_n_s_take_2d_axis0_int32_int64; +static PyObject *__pyx_n_s_take_2d_axis0_int64_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int64_int64; +static PyObject *__pyx_n_s_take_2d_axis0_int8_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int8_int32; +static PyObject *__pyx_n_s_take_2d_axis0_int8_int64; +static PyObject *__pyx_n_s_take_2d_axis0_int8_int8; +static PyObject *__pyx_n_s_take_2d_axis0_object_object; +static PyObject *__pyx_n_s_take_2d_axis1_bool_bool; +static PyObject *__pyx_n_s_take_2d_axis1_bool_object; +static PyObject *__pyx_n_s_take_2d_axis1_float32_float32; +static PyObject *__pyx_n_s_take_2d_axis1_float32_float64; +static PyObject *__pyx_n_s_take_2d_axis1_float64_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int16_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int16_int16; +static PyObject *__pyx_n_s_take_2d_axis1_int16_int32; +static PyObject *__pyx_n_s_take_2d_axis1_int16_int64; +static PyObject *__pyx_n_s_take_2d_axis1_int32_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int32_int32; +static PyObject *__pyx_n_s_take_2d_axis1_int32_int64; +static PyObject *__pyx_n_s_take_2d_axis1_int64_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int64_int64; +static PyObject *__pyx_n_s_take_2d_axis1_int8_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int8_int32; +static PyObject *__pyx_n_s_take_2d_axis1_int8_int64; +static PyObject *__pyx_n_s_take_2d_axis1_int8_int8; +static PyObject *__pyx_n_s_take_2d_axis1_object_object; +static PyObject *__pyx_n_s_take_2d_multi_bool_bool; +static PyObject *__pyx_n_s_take_2d_multi_bool_object; +static PyObject *__pyx_n_s_take_2d_multi_float32_float32; +static PyObject *__pyx_n_s_take_2d_multi_float32_float64; +static PyObject *__pyx_n_s_take_2d_multi_float64_float64; +static PyObject *__pyx_n_s_take_2d_multi_int16_float64; +static PyObject *__pyx_n_s_take_2d_multi_int16_int16; +static PyObject *__pyx_n_s_take_2d_multi_int16_int32; +static PyObject *__pyx_n_s_take_2d_multi_int16_int64; +static PyObject *__pyx_n_s_take_2d_multi_int32_float64; +static PyObject *__pyx_n_s_take_2d_multi_int32_int32; +static PyObject *__pyx_n_s_take_2d_multi_int32_int64; +static PyObject *__pyx_n_s_take_2d_multi_int64_float64; +static PyObject *__pyx_n_s_take_2d_multi_int64_int64; +static PyObject *__pyx_n_s_take_2d_multi_int8_float64; +static PyObject *__pyx_n_s_take_2d_multi_int8_int32; +static PyObject *__pyx_n_s_take_2d_multi_int8_int64; +static PyObject *__pyx_n_s_take_2d_multi_int8_int8; +static PyObject *__pyx_n_s_take_2d_multi_object_object; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_tiebreak; +static PyObject *__pyx_n_s_tiebreakers; +static PyObject *__pyx_n_s_ties_method; +static PyObject *__pyx_n_s_top; +static PyObject *__pyx_n_s_tot_wgt; +static PyObject *__pyx_n_s_total_tie_count; +static PyObject *__pyx_n_s_u; +static PyObject *__pyx_n_s_uint16_t; +static PyObject *__pyx_n_s_uint32_t; +static PyObject *__pyx_n_s_uint64_t; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_n_s_uint8_t; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_val_in; +static PyObject *__pyx_n_s_val_win; +static PyObject *__pyx_n_s_valid_locs; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_vclose; +static PyObject *__pyx_n_s_vecs; +static PyObject *__pyx_n_s_vhigh; +static PyObject *__pyx_n_s_view; +static PyObject *__pyx_n_s_vlow; +static PyObject *__pyx_n_s_vopen; +static PyObject *__pyx_n_s_vx; +static PyObject *__pyx_n_s_vy; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_n_s_weights; +static PyObject *__pyx_n_s_where; +static PyObject *__pyx_n_s_width; +static PyObject *__pyx_n_s_win; +static PyObject *__pyx_n_s_win_i; +static PyObject *__pyx_n_s_win_k; +static PyObject *__pyx_n_s_win_n; +static PyObject *__pyx_n_s_window; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xi; +static PyObject *__pyx_n_s_xrange; +static PyObject *__pyx_n_s_xx; +static PyObject *__pyx_n_s_xxx; +static PyObject *__pyx_n_s_xxxx; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_n_s_yi; +static PyObject *__pyx_n_s_z; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_n_s_zeros_like; +static PyObject *__pyx_n_s_zip; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_100; +static PyObject *__pyx_int_105; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_k__116; +static PyObject *__pyx_k__117; +static PyObject *__pyx_k__118; +static PyObject *__pyx_k__119; +static PyObject *__pyx_k__120; +static PyObject *__pyx_k__121; +static PyObject *__pyx_k__122; +static PyObject *__pyx_k__123; +static PyObject *__pyx_k__124; +static PyObject *__pyx_k__125; +static PyObject *__pyx_k__126; +static PyObject *__pyx_k__127; +static PyObject *__pyx_k__128; +static PyObject *__pyx_k__129; +static PyObject *__pyx_k__130; +static PyObject *__pyx_k__131; +static PyObject *__pyx_k__132; +static PyObject *__pyx_k__133; +static PyObject *__pyx_k__134; +static PyObject *__pyx_k__135; +static PyObject *__pyx_k__136; +static PyObject *__pyx_k__137; +static PyObject *__pyx_k__138; +static PyObject *__pyx_k__139; +static PyObject *__pyx_k__140; +static PyObject *__pyx_k__141; +static PyObject *__pyx_k__142; +static PyObject *__pyx_k__143; +static PyObject *__pyx_k__144; +static PyObject *__pyx_k__145; +static PyObject *__pyx_k__146; +static PyObject *__pyx_k__147; +static PyObject *__pyx_k__148; +static PyObject *__pyx_k__149; +static PyObject *__pyx_k__150; +static PyObject *__pyx_k__151; +static PyObject *__pyx_k__152; +static PyObject *__pyx_k__153; +static PyObject *__pyx_k__154; +static PyObject *__pyx_k__155; +static PyObject *__pyx_k__156; +static PyObject *__pyx_k__157; +static PyObject *__pyx_k__158; +static PyObject *__pyx_k__159; +static PyObject *__pyx_k__160; +static PyObject *__pyx_k__161; +static PyObject *__pyx_k__162; +static PyObject *__pyx_k__163; +static PyObject *__pyx_k__164; +static PyObject *__pyx_k__165; +static PyObject *__pyx_k__166; +static PyObject *__pyx_k__167; +static PyObject *__pyx_k__168; +static PyObject *__pyx_k__169; +static PyObject *__pyx_k__170; +static PyObject *__pyx_k__171; +static PyObject *__pyx_k__172; +static PyObject *__pyx_k__173; +static PyObject *__pyx_k__174; +static PyObject *__pyx_k__175; +static PyObject *__pyx_k__176; +static PyObject *__pyx_k__177; +static PyObject *__pyx_k__178; +static PyObject *__pyx_k__179; +static PyObject *__pyx_k__180; +static PyObject *__pyx_k__181; +static PyObject *__pyx_k__182; +static PyObject *__pyx_k__183; +static PyObject *__pyx_k__184; +static PyObject *__pyx_k__185; +static PyObject *__pyx_k__186; +static PyObject *__pyx_k__187; +static PyObject *__pyx_k__188; +static PyObject *__pyx_k__189; +static PyObject *__pyx_k__190; +static PyObject *__pyx_k__191; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_slice__2; +static PyObject *__pyx_slice__4; +static PyObject *__pyx_slice__7; +static PyObject *__pyx_slice__8; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__11; +static PyObject *__pyx_slice__13; +static PyObject *__pyx_slice__14; +static PyObject *__pyx_slice__17; +static PyObject *__pyx_slice__19; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; +static PyObject *__pyx_slice__29; +static PyObject *__pyx_slice__46; +static PyObject *__pyx_slice__47; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__89; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_tuple__100; +static PyObject *__pyx_tuple__101; +static PyObject *__pyx_tuple__102; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__104; +static PyObject *__pyx_tuple__105; +static PyObject *__pyx_tuple__106; +static PyObject *__pyx_tuple__107; +static PyObject *__pyx_tuple__108; +static PyObject *__pyx_tuple__109; +static PyObject *__pyx_tuple__110; +static PyObject *__pyx_tuple__111; +static PyObject *__pyx_tuple__112; +static PyObject *__pyx_tuple__113; +static PyObject *__pyx_tuple__114; +static PyObject *__pyx_tuple__115; +static PyObject *__pyx_tuple__192; +static PyObject *__pyx_tuple__193; +static PyObject *__pyx_tuple__194; +static PyObject *__pyx_tuple__195; +static PyObject *__pyx_tuple__196; +static PyObject *__pyx_tuple__197; +static PyObject *__pyx_tuple__198; +static PyObject *__pyx_tuple__199; +static PyObject *__pyx_tuple__200; +static PyObject *__pyx_tuple__201; +static PyObject *__pyx_tuple__202; +static PyObject *__pyx_tuple__203; +static PyObject *__pyx_tuple__204; +static PyObject *__pyx_tuple__205; +static PyObject *__pyx_tuple__206; +static PyObject *__pyx_tuple__207; +static PyObject *__pyx_tuple__208; +static PyObject *__pyx_tuple__209; +static PyObject *__pyx_tuple__210; +static PyObject *__pyx_tuple__211; +static PyObject *__pyx_tuple__212; +static PyObject *__pyx_tuple__213; +static PyObject *__pyx_tuple__214; +static PyObject *__pyx_tuple__215; +static PyObject *__pyx_tuple__216; +static PyObject *__pyx_tuple__217; +static PyObject *__pyx_tuple__218; +static PyObject *__pyx_tuple__219; +static PyObject *__pyx_tuple__220; +static PyObject *__pyx_tuple__221; +static PyObject *__pyx_tuple__222; +static PyObject *__pyx_tuple__223; +static PyObject *__pyx_tuple__224; +static PyObject *__pyx_tuple__225; +static PyObject *__pyx_tuple__226; +static PyObject *__pyx_tuple__227; +static PyObject *__pyx_tuple__228; +static PyObject *__pyx_tuple__229; +static PyObject *__pyx_tuple__230; +static PyObject *__pyx_tuple__231; +static PyObject *__pyx_tuple__232; +static PyObject *__pyx_tuple__233; +static PyObject *__pyx_tuple__235; +static PyObject *__pyx_tuple__237; +static PyObject *__pyx_tuple__239; +static PyObject *__pyx_tuple__241; +static PyObject *__pyx_tuple__243; +static PyObject *__pyx_tuple__245; +static PyObject *__pyx_tuple__247; +static PyObject *__pyx_tuple__249; +static PyObject *__pyx_tuple__251; +static PyObject *__pyx_tuple__253; +static PyObject *__pyx_tuple__255; +static PyObject *__pyx_tuple__257; +static PyObject *__pyx_tuple__259; +static PyObject *__pyx_tuple__261; +static PyObject *__pyx_tuple__263; +static PyObject *__pyx_tuple__265; +static PyObject *__pyx_tuple__267; +static PyObject *__pyx_tuple__269; +static PyObject *__pyx_tuple__271; +static PyObject *__pyx_tuple__273; +static PyObject *__pyx_tuple__275; +static PyObject *__pyx_tuple__277; +static PyObject *__pyx_tuple__279; +static PyObject *__pyx_tuple__281; +static PyObject *__pyx_tuple__283; +static PyObject *__pyx_tuple__285; +static PyObject *__pyx_tuple__287; +static PyObject *__pyx_tuple__289; +static PyObject *__pyx_tuple__291; +static PyObject *__pyx_tuple__293; +static PyObject *__pyx_tuple__295; +static PyObject *__pyx_tuple__297; +static PyObject *__pyx_tuple__299; +static PyObject *__pyx_tuple__301; +static PyObject *__pyx_tuple__303; +static PyObject *__pyx_tuple__305; +static PyObject *__pyx_tuple__307; +static PyObject *__pyx_tuple__309; +static PyObject *__pyx_tuple__311; +static PyObject *__pyx_tuple__313; +static PyObject *__pyx_tuple__315; +static PyObject *__pyx_tuple__317; +static PyObject *__pyx_tuple__319; +static PyObject *__pyx_tuple__320; +static PyObject *__pyx_tuple__322; +static PyObject *__pyx_tuple__324; +static PyObject *__pyx_tuple__326; +static PyObject *__pyx_tuple__328; +static PyObject *__pyx_tuple__330; +static PyObject *__pyx_tuple__332; +static PyObject *__pyx_tuple__334; +static PyObject *__pyx_tuple__336; +static PyObject *__pyx_tuple__338; +static PyObject *__pyx_tuple__340; +static PyObject *__pyx_tuple__342; +static PyObject *__pyx_tuple__344; +static PyObject *__pyx_tuple__346; +static PyObject *__pyx_tuple__348; +static PyObject *__pyx_tuple__350; +static PyObject *__pyx_tuple__352; +static PyObject *__pyx_tuple__354; +static PyObject *__pyx_tuple__356; +static PyObject *__pyx_tuple__358; +static PyObject *__pyx_tuple__360; +static PyObject *__pyx_tuple__362; +static PyObject *__pyx_tuple__364; +static PyObject *__pyx_tuple__366; +static PyObject *__pyx_tuple__368; +static PyObject *__pyx_tuple__370; +static PyObject *__pyx_tuple__372; +static PyObject *__pyx_tuple__374; +static PyObject *__pyx_tuple__376; +static PyObject *__pyx_tuple__378; +static PyObject *__pyx_tuple__380; +static PyObject *__pyx_tuple__382; +static PyObject *__pyx_tuple__384; +static PyObject *__pyx_tuple__386; +static PyObject *__pyx_tuple__388; +static PyObject *__pyx_tuple__390; +static PyObject *__pyx_tuple__392; +static PyObject *__pyx_tuple__394; +static PyObject *__pyx_tuple__396; +static PyObject *__pyx_tuple__398; +static PyObject *__pyx_tuple__400; +static PyObject *__pyx_tuple__402; +static PyObject *__pyx_tuple__404; +static PyObject *__pyx_tuple__406; +static PyObject *__pyx_tuple__408; +static PyObject *__pyx_tuple__410; +static PyObject *__pyx_tuple__412; +static PyObject *__pyx_tuple__414; +static PyObject *__pyx_tuple__416; +static PyObject *__pyx_tuple__418; +static PyObject *__pyx_tuple__420; +static PyObject *__pyx_tuple__422; +static PyObject *__pyx_tuple__424; +static PyObject *__pyx_tuple__426; +static PyObject *__pyx_tuple__428; +static PyObject *__pyx_tuple__430; +static PyObject *__pyx_tuple__432; +static PyObject *__pyx_tuple__434; +static PyObject *__pyx_tuple__436; +static PyObject *__pyx_tuple__438; +static PyObject *__pyx_tuple__440; +static PyObject *__pyx_tuple__442; +static PyObject *__pyx_tuple__444; +static PyObject *__pyx_tuple__446; +static PyObject *__pyx_tuple__448; +static PyObject *__pyx_tuple__450; +static PyObject *__pyx_tuple__452; +static PyObject *__pyx_tuple__454; +static PyObject *__pyx_tuple__456; +static PyObject *__pyx_tuple__458; +static PyObject *__pyx_tuple__460; +static PyObject *__pyx_tuple__462; +static PyObject *__pyx_tuple__464; +static PyObject *__pyx_tuple__466; +static PyObject *__pyx_tuple__468; +static PyObject *__pyx_tuple__470; +static PyObject *__pyx_tuple__472; +static PyObject *__pyx_tuple__474; +static PyObject *__pyx_tuple__476; +static PyObject *__pyx_tuple__478; +static PyObject *__pyx_tuple__480; +static PyObject *__pyx_tuple__482; +static PyObject *__pyx_tuple__484; +static PyObject *__pyx_tuple__486; +static PyObject *__pyx_tuple__488; +static PyObject *__pyx_tuple__490; +static PyObject *__pyx_tuple__492; +static PyObject *__pyx_tuple__494; +static PyObject *__pyx_tuple__496; +static PyObject *__pyx_tuple__498; +static PyObject *__pyx_tuple__500; +static PyObject *__pyx_tuple__502; +static PyObject *__pyx_tuple__504; +static PyObject *__pyx_tuple__506; +static PyObject *__pyx_tuple__508; +static PyObject *__pyx_tuple__510; +static PyObject *__pyx_tuple__512; +static PyObject *__pyx_tuple__514; +static PyObject *__pyx_tuple__516; +static PyObject *__pyx_tuple__518; +static PyObject *__pyx_tuple__520; +static PyObject *__pyx_tuple__522; +static PyObject *__pyx_tuple__524; +static PyObject *__pyx_tuple__526; +static PyObject *__pyx_tuple__528; +static PyObject *__pyx_tuple__530; +static PyObject *__pyx_tuple__532; +static PyObject *__pyx_tuple__534; +static PyObject *__pyx_tuple__536; +static PyObject *__pyx_tuple__538; +static PyObject *__pyx_tuple__540; +static PyObject *__pyx_tuple__542; +static PyObject *__pyx_tuple__544; +static PyObject *__pyx_tuple__546; +static PyObject *__pyx_tuple__548; +static PyObject *__pyx_tuple__550; +static PyObject *__pyx_tuple__552; +static PyObject *__pyx_tuple__554; +static PyObject *__pyx_tuple__556; +static PyObject *__pyx_tuple__558; +static PyObject *__pyx_tuple__560; +static PyObject *__pyx_tuple__562; +static PyObject *__pyx_tuple__564; +static PyObject *__pyx_tuple__566; +static PyObject *__pyx_tuple__568; +static PyObject *__pyx_tuple__570; +static PyObject *__pyx_tuple__572; +static PyObject *__pyx_tuple__574; +static PyObject *__pyx_tuple__576; +static PyObject *__pyx_tuple__578; +static PyObject *__pyx_tuple__580; +static PyObject *__pyx_tuple__582; +static PyObject *__pyx_tuple__584; +static PyObject *__pyx_tuple__586; +static PyObject *__pyx_tuple__588; +static PyObject *__pyx_tuple__590; +static PyObject *__pyx_tuple__592; +static PyObject *__pyx_tuple__594; +static PyObject *__pyx_tuple__596; +static PyObject *__pyx_tuple__598; +static PyObject *__pyx_tuple__600; +static PyObject *__pyx_tuple__602; +static PyObject *__pyx_tuple__604; +static PyObject *__pyx_tuple__606; +static PyObject *__pyx_tuple__608; +static PyObject *__pyx_tuple__610; +static PyObject *__pyx_tuple__612; +static PyObject *__pyx_tuple__614; +static PyObject *__pyx_tuple__616; +static PyObject *__pyx_tuple__618; +static PyObject *__pyx_tuple__620; +static PyObject *__pyx_tuple__622; +static PyObject *__pyx_tuple__624; +static PyObject *__pyx_tuple__626; +static PyObject *__pyx_tuple__628; +static PyObject *__pyx_tuple__630; +static PyObject *__pyx_tuple__632; +static PyObject *__pyx_tuple__634; +static PyObject *__pyx_tuple__636; +static PyObject *__pyx_tuple__638; +static PyObject *__pyx_tuple__640; +static PyObject *__pyx_tuple__642; +static PyObject *__pyx_tuple__644; +static PyObject *__pyx_tuple__646; +static PyObject *__pyx_tuple__648; +static PyObject *__pyx_tuple__650; +static PyObject *__pyx_tuple__652; +static PyObject *__pyx_tuple__654; +static PyObject *__pyx_tuple__656; +static PyObject *__pyx_tuple__658; +static PyObject *__pyx_tuple__660; +static PyObject *__pyx_tuple__662; +static PyObject *__pyx_tuple__664; +static PyObject *__pyx_tuple__666; +static PyObject *__pyx_tuple__668; +static PyObject *__pyx_tuple__670; +static PyObject *__pyx_tuple__672; +static PyObject *__pyx_tuple__674; +static PyObject *__pyx_tuple__676; +static PyObject *__pyx_tuple__678; +static PyObject *__pyx_tuple__680; +static PyObject *__pyx_tuple__682; +static PyObject *__pyx_tuple__684; +static PyObject *__pyx_tuple__686; +static PyObject *__pyx_tuple__688; +static PyObject *__pyx_tuple__690; +static PyObject *__pyx_tuple__692; +static PyObject *__pyx_tuple__694; +static PyObject *__pyx_tuple__696; +static PyObject *__pyx_tuple__698; +static PyObject *__pyx_tuple__700; +static PyObject *__pyx_tuple__702; +static PyObject *__pyx_tuple__704; +static PyObject *__pyx_tuple__706; +static PyObject *__pyx_tuple__708; +static PyObject *__pyx_tuple__710; +static PyObject *__pyx_tuple__712; +static PyObject *__pyx_tuple__714; +static PyObject *__pyx_tuple__716; +static PyObject *__pyx_tuple__717; +static PyObject *__pyx_tuple__718; +static PyObject *__pyx_tuple__719; +static PyObject *__pyx_tuple__720; +static PyObject *__pyx_codeobj__234; +static PyObject *__pyx_codeobj__236; +static PyObject *__pyx_codeobj__238; +static PyObject *__pyx_codeobj__240; +static PyObject *__pyx_codeobj__242; +static PyObject *__pyx_codeobj__244; +static PyObject *__pyx_codeobj__246; +static PyObject *__pyx_codeobj__248; +static PyObject *__pyx_codeobj__250; +static PyObject *__pyx_codeobj__252; +static PyObject *__pyx_codeobj__254; +static PyObject *__pyx_codeobj__256; +static PyObject *__pyx_codeobj__258; +static PyObject *__pyx_codeobj__260; +static PyObject *__pyx_codeobj__262; +static PyObject *__pyx_codeobj__264; +static PyObject *__pyx_codeobj__266; +static PyObject *__pyx_codeobj__268; +static PyObject *__pyx_codeobj__270; +static PyObject *__pyx_codeobj__272; +static PyObject *__pyx_codeobj__274; +static PyObject *__pyx_codeobj__276; +static PyObject *__pyx_codeobj__278; +static PyObject *__pyx_codeobj__280; +static PyObject *__pyx_codeobj__282; +static PyObject *__pyx_codeobj__284; +static PyObject *__pyx_codeobj__286; +static PyObject *__pyx_codeobj__288; +static PyObject *__pyx_codeobj__290; +static PyObject *__pyx_codeobj__292; +static PyObject *__pyx_codeobj__294; +static PyObject *__pyx_codeobj__296; +static PyObject *__pyx_codeobj__298; +static PyObject *__pyx_codeobj__300; +static PyObject *__pyx_codeobj__302; +static PyObject *__pyx_codeobj__304; +static PyObject *__pyx_codeobj__306; +static PyObject *__pyx_codeobj__308; +static PyObject *__pyx_codeobj__310; +static PyObject *__pyx_codeobj__312; +static PyObject *__pyx_codeobj__314; +static PyObject *__pyx_codeobj__316; +static PyObject *__pyx_codeobj__318; +static PyObject *__pyx_codeobj__321; +static PyObject *__pyx_codeobj__323; +static PyObject *__pyx_codeobj__325; +static PyObject *__pyx_codeobj__327; +static PyObject *__pyx_codeobj__329; +static PyObject *__pyx_codeobj__331; +static PyObject *__pyx_codeobj__333; +static PyObject *__pyx_codeobj__335; +static PyObject *__pyx_codeobj__337; +static PyObject *__pyx_codeobj__339; +static PyObject *__pyx_codeobj__341; +static PyObject *__pyx_codeobj__343; +static PyObject *__pyx_codeobj__345; +static PyObject *__pyx_codeobj__347; +static PyObject *__pyx_codeobj__349; +static PyObject *__pyx_codeobj__351; +static PyObject *__pyx_codeobj__353; +static PyObject *__pyx_codeobj__355; +static PyObject *__pyx_codeobj__357; +static PyObject *__pyx_codeobj__359; +static PyObject *__pyx_codeobj__361; +static PyObject *__pyx_codeobj__363; +static PyObject *__pyx_codeobj__365; +static PyObject *__pyx_codeobj__367; +static PyObject *__pyx_codeobj__369; +static PyObject *__pyx_codeobj__371; +static PyObject *__pyx_codeobj__373; +static PyObject *__pyx_codeobj__375; +static PyObject *__pyx_codeobj__377; +static PyObject *__pyx_codeobj__379; +static PyObject *__pyx_codeobj__381; +static PyObject *__pyx_codeobj__383; +static PyObject *__pyx_codeobj__385; +static PyObject *__pyx_codeobj__387; +static PyObject *__pyx_codeobj__389; +static PyObject *__pyx_codeobj__391; +static PyObject *__pyx_codeobj__393; +static PyObject *__pyx_codeobj__395; +static PyObject *__pyx_codeobj__397; +static PyObject *__pyx_codeobj__399; +static PyObject *__pyx_codeobj__401; +static PyObject *__pyx_codeobj__403; +static PyObject *__pyx_codeobj__405; +static PyObject *__pyx_codeobj__407; +static PyObject *__pyx_codeobj__409; +static PyObject *__pyx_codeobj__411; +static PyObject *__pyx_codeobj__413; +static PyObject *__pyx_codeobj__415; +static PyObject *__pyx_codeobj__417; +static PyObject *__pyx_codeobj__419; +static PyObject *__pyx_codeobj__421; +static PyObject *__pyx_codeobj__423; +static PyObject *__pyx_codeobj__425; +static PyObject *__pyx_codeobj__427; +static PyObject *__pyx_codeobj__429; +static PyObject *__pyx_codeobj__431; +static PyObject *__pyx_codeobj__433; +static PyObject *__pyx_codeobj__435; +static PyObject *__pyx_codeobj__437; +static PyObject *__pyx_codeobj__439; +static PyObject *__pyx_codeobj__441; +static PyObject *__pyx_codeobj__443; +static PyObject *__pyx_codeobj__445; +static PyObject *__pyx_codeobj__447; +static PyObject *__pyx_codeobj__449; +static PyObject *__pyx_codeobj__451; +static PyObject *__pyx_codeobj__453; +static PyObject *__pyx_codeobj__455; +static PyObject *__pyx_codeobj__457; +static PyObject *__pyx_codeobj__459; +static PyObject *__pyx_codeobj__461; +static PyObject *__pyx_codeobj__463; +static PyObject *__pyx_codeobj__465; +static PyObject *__pyx_codeobj__467; +static PyObject *__pyx_codeobj__469; +static PyObject *__pyx_codeobj__471; +static PyObject *__pyx_codeobj__473; +static PyObject *__pyx_codeobj__475; +static PyObject *__pyx_codeobj__477; +static PyObject *__pyx_codeobj__479; +static PyObject *__pyx_codeobj__481; +static PyObject *__pyx_codeobj__483; +static PyObject *__pyx_codeobj__485; +static PyObject *__pyx_codeobj__487; +static PyObject *__pyx_codeobj__489; +static PyObject *__pyx_codeobj__491; +static PyObject *__pyx_codeobj__493; +static PyObject *__pyx_codeobj__495; +static PyObject *__pyx_codeobj__497; +static PyObject *__pyx_codeobj__499; +static PyObject *__pyx_codeobj__501; +static PyObject *__pyx_codeobj__503; +static PyObject *__pyx_codeobj__505; +static PyObject *__pyx_codeobj__507; +static PyObject *__pyx_codeobj__509; +static PyObject *__pyx_codeobj__511; +static PyObject *__pyx_codeobj__513; +static PyObject *__pyx_codeobj__515; +static PyObject *__pyx_codeobj__517; +static PyObject *__pyx_codeobj__519; +static PyObject *__pyx_codeobj__521; +static PyObject *__pyx_codeobj__523; +static PyObject *__pyx_codeobj__525; +static PyObject *__pyx_codeobj__527; +static PyObject *__pyx_codeobj__529; +static PyObject *__pyx_codeobj__531; +static PyObject *__pyx_codeobj__533; +static PyObject *__pyx_codeobj__535; +static PyObject *__pyx_codeobj__537; +static PyObject *__pyx_codeobj__539; +static PyObject *__pyx_codeobj__541; +static PyObject *__pyx_codeobj__543; +static PyObject *__pyx_codeobj__545; +static PyObject *__pyx_codeobj__547; +static PyObject *__pyx_codeobj__549; +static PyObject *__pyx_codeobj__551; +static PyObject *__pyx_codeobj__553; +static PyObject *__pyx_codeobj__555; +static PyObject *__pyx_codeobj__557; +static PyObject *__pyx_codeobj__559; +static PyObject *__pyx_codeobj__561; +static PyObject *__pyx_codeobj__563; +static PyObject *__pyx_codeobj__565; +static PyObject *__pyx_codeobj__567; +static PyObject *__pyx_codeobj__569; +static PyObject *__pyx_codeobj__571; +static PyObject *__pyx_codeobj__573; +static PyObject *__pyx_codeobj__575; +static PyObject *__pyx_codeobj__577; +static PyObject *__pyx_codeobj__579; +static PyObject *__pyx_codeobj__581; +static PyObject *__pyx_codeobj__583; +static PyObject *__pyx_codeobj__585; +static PyObject *__pyx_codeobj__587; +static PyObject *__pyx_codeobj__589; +static PyObject *__pyx_codeobj__591; +static PyObject *__pyx_codeobj__593; +static PyObject *__pyx_codeobj__595; +static PyObject *__pyx_codeobj__597; +static PyObject *__pyx_codeobj__599; +static PyObject *__pyx_codeobj__601; +static PyObject *__pyx_codeobj__603; +static PyObject *__pyx_codeobj__605; +static PyObject *__pyx_codeobj__607; +static PyObject *__pyx_codeobj__609; +static PyObject *__pyx_codeobj__611; +static PyObject *__pyx_codeobj__613; +static PyObject *__pyx_codeobj__615; +static PyObject *__pyx_codeobj__617; +static PyObject *__pyx_codeobj__619; +static PyObject *__pyx_codeobj__621; +static PyObject *__pyx_codeobj__623; +static PyObject *__pyx_codeobj__625; +static PyObject *__pyx_codeobj__627; +static PyObject *__pyx_codeobj__629; +static PyObject *__pyx_codeobj__631; +static PyObject *__pyx_codeobj__633; +static PyObject *__pyx_codeobj__635; +static PyObject *__pyx_codeobj__637; +static PyObject *__pyx_codeobj__639; +static PyObject *__pyx_codeobj__641; +static PyObject *__pyx_codeobj__643; +static PyObject *__pyx_codeobj__645; +static PyObject *__pyx_codeobj__647; +static PyObject *__pyx_codeobj__649; +static PyObject *__pyx_codeobj__651; +static PyObject *__pyx_codeobj__653; +static PyObject *__pyx_codeobj__655; +static PyObject *__pyx_codeobj__657; +static PyObject *__pyx_codeobj__659; +static PyObject *__pyx_codeobj__661; +static PyObject *__pyx_codeobj__663; +static PyObject *__pyx_codeobj__665; +static PyObject *__pyx_codeobj__667; +static PyObject *__pyx_codeobj__669; +static PyObject *__pyx_codeobj__671; +static PyObject *__pyx_codeobj__673; +static PyObject *__pyx_codeobj__675; +static PyObject *__pyx_codeobj__677; +static PyObject *__pyx_codeobj__679; +static PyObject *__pyx_codeobj__681; +static PyObject *__pyx_codeobj__683; +static PyObject *__pyx_codeobj__685; +static PyObject *__pyx_codeobj__687; +static PyObject *__pyx_codeobj__689; +static PyObject *__pyx_codeobj__691; +static PyObject *__pyx_codeobj__693; +static PyObject *__pyx_codeobj__695; +static PyObject *__pyx_codeobj__697; +static PyObject *__pyx_codeobj__699; +static PyObject *__pyx_codeobj__701; +static PyObject *__pyx_codeobj__703; +static PyObject *__pyx_codeobj__705; +static PyObject *__pyx_codeobj__707; +static PyObject *__pyx_codeobj__709; +static PyObject *__pyx_codeobj__711; +static PyObject *__pyx_codeobj__713; +static PyObject *__pyx_codeobj__715; + +/* "pandas/algos.pyx":565 + * return left != right + * + * _return_false = lambda self, other: False # <<<<<<<<<<<<<< + * _return_true = lambda self, other: True + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_510lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_510lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_6pandas_5algos_510lambda1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_510lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_other = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_6pandas_5algos_lambda1(__pyx_self, __pyx_v_self, __pyx_v_other); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":566 + * + * _return_false = lambda self, other: False + * _return_true = lambda self, other: True # <<<<<<<<<<<<<< + * + * class Infinity(object): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_511lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_511lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_pw_6pandas_5algos_511lambda2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_511lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_other = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("lambda2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_6pandas_5algos_lambda2(__pyx_self, __pyx_v_self, __pyx_v_other); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda2", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":55 + * + * + * cdef inline int int_max(int a, int b): return a if a >= b else b # <<<<<<<<<<<<<< + * cdef inline int int_min(int a, int b): return a if a <= b else b + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_max(int __pyx_v_a, int __pyx_v_b) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("int_max", 0); + if (((__pyx_v_a >= __pyx_v_b) != 0)) { + __pyx_t_1 = __pyx_v_a; + } else { + __pyx_t_1 = __pyx_v_b; + } + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":56 + * + * cdef inline int int_max(int a, int b): return a if a >= b else b + * cdef inline int int_min(int a, int b): return a if a <= b else b # <<<<<<<<<<<<<< + * + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_min(int __pyx_v_a, int __pyx_v_b) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("int_min", 0); + if (((__pyx_v_a <= __pyx_v_b) != 0)) { + __pyx_t_1 = __pyx_v_a; + } else { + __pyx_t_1 = __pyx_v_b; + } + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":18 + * # MSVC does not have log2! + * + * cdef double Log2(double x): # <<<<<<<<<<<<<< + * return log(x) / log(2.) + * + */ + +static double __pyx_f_6pandas_5algos_Log2(double __pyx_v_x) { + double __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + double __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("Log2", 0); + + /* "pandas/src/skiplist.pyx":19 + * + * cdef double Log2(double x): + * return log(x) / log(2.) # <<<<<<<<<<<<<< + * + * cimport numpy as np + */ + __pyx_t_1 = log(__pyx_v_x); + __pyx_t_2 = log(2.); + if (unlikely(__pyx_t_2 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = (__pyx_t_1 / __pyx_t_2); + goto __pyx_L0; + + /* "pandas/src/skiplist.pyx":18 + * # MSVC does not have log2! + * + * cdef double Log2(double x): # <<<<<<<<<<<<<< + * return log(x) / log(2.) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.algos.Log2", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":38 + * list width + * + * def __init__(self, double_t value, list next, list width): # <<<<<<<<<<<<<< + * self.value = value + * self.next = next + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_double_t __pyx_v_value; + PyObject *__pyx_v_next = 0; + PyObject *__pyx_v_width = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_next,&__pyx_n_s_width,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_next)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_value = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_value == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_next = ((PyObject*)values[1]); + __pyx_v_width = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.Node.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_next), (&PyList_Type), 1, "next", 1))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), (&PyList_Type), 1, "width", 1))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_4Node___init__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), __pyx_v_value, __pyx_v_next, __pyx_v_width); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node___init__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, __pyx_t_5numpy_double_t __pyx_v_value, PyObject *__pyx_v_next, PyObject *__pyx_v_width) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/skiplist.pyx":39 + * + * def __init__(self, double_t value, list next, list width): + * self.value = value # <<<<<<<<<<<<<< + * self.next = next + * self.width = width + */ + __pyx_v_self->value = __pyx_v_value; + + /* "pandas/src/skiplist.pyx":40 + * def __init__(self, double_t value, list next, list width): + * self.value = value + * self.next = next # <<<<<<<<<<<<<< + * self.width = width + * + */ + __Pyx_INCREF(__pyx_v_next); + __Pyx_GIVEREF(__pyx_v_next); + __Pyx_GOTREF(__pyx_v_self->next); + __Pyx_DECREF(__pyx_v_self->next); + __pyx_v_self->next = __pyx_v_next; + + /* "pandas/src/skiplist.pyx":41 + * self.value = value + * self.next = next + * self.width = width # <<<<<<<<<<<<<< + * + * # Singleton terminator node + */ + __Pyx_INCREF(__pyx_v_width); + __Pyx_GIVEREF(__pyx_v_width); + __Pyx_GOTREF(__pyx_v_self->width); + __Pyx_DECREF(__pyx_v_self->width); + __pyx_v_self->width = __pyx_v_width; + + /* "pandas/src/skiplist.pyx":38 + * list width + * + * def __init__(self, double_t value, list next, list width): # <<<<<<<<<<<<<< + * self.value = value + * self.next = next + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":34 + * cdef class Node: + * cdef public: + * double_t value # <<<<<<<<<<<<<< + * list next + * list width + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_4Node_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_4Node_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5value___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_4Node_5value___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.Node.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5value_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_5value_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_double_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->value = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.algos.Node.value.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":35 + * cdef public: + * double_t value + * list next # <<<<<<<<<<<<<< + * list width + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_4Node_4next_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_4Node_4next_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_4Node_4next___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->next); + __pyx_r = __pyx_v_self->next; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_4next_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_4next_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_4next_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->next); + __Pyx_DECREF(__pyx_v_self->next); + __pyx_v_self->next = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.Node.next.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_4next_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_4next_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next_4__del__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_4next_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->next); + __Pyx_DECREF(__pyx_v_self->next); + __pyx_v_self->next = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":36 + * double_t value + * list next + * list width # <<<<<<<<<<<<<< + * + * def __init__(self, double_t value, list next, list width): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_4Node_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_4Node_5width_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_4Node_5width___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->width); + __pyx_r = __pyx_v_self->width; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_5width_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->width); + __Pyx_DECREF(__pyx_v_self->width); + __pyx_v_self->width = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.Node.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_5width_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_5width_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width_4__del__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_5width_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->width); + __Pyx_DECREF(__pyx_v_self->width); + __pyx_v_self->width = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":55 + * Node head + * + * def __init__(self, expected_size=100): # <<<<<<<<<<<<<< + * self.size = 0 + * self.maxlevels = int(1 + Log2(expected_size)) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_17IndexableSkiplist_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_5algos_17IndexableSkiplist_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_expected_size = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_expected_size,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_100); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_expected_size); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_expected_size = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), __pyx_v_expected_size); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_expected_size) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/skiplist.pyx":56 + * + * def __init__(self, expected_size=100): + * self.size = 0 # <<<<<<<<<<<<<< + * self.maxlevels = int(1 + Log2(expected_size)) + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) + */ + __pyx_v_self->size = 0; + + /* "pandas/src/skiplist.pyx":57 + * def __init__(self, expected_size=100): + * self.size = 0 + * self.maxlevels = int(1 + Log2(expected_size)) # <<<<<<<<<<<<<< + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) + * + */ + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_expected_size); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->maxlevels = ((Py_ssize_t)(1.0 + __pyx_f_6pandas_5algos_Log2(__pyx_t_1))); + + /* "pandas/src/skiplist.pyx":58 + * self.size = 0 + * self.maxlevels = int(1 + Log2(expected_size)) + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_1); + PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + } + } + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->head); + __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); + __pyx_v_self->head = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":55 + * Node head + * + * def __init__(self, expected_size=100): # <<<<<<<<<<<<<< + * self.size = 0 + * self.maxlevels = int(1 + Log2(expected_size)) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":60 + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.size + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/src/skiplist.pyx":61 + * + * def __len__(self): + * return self.size # <<<<<<<<<<<<<< + * + * def __getitem__(self, i): + */ + __pyx_r = __pyx_v_self->size; + goto __pyx_L0; + + /* "pandas/src/skiplist.pyx":60 + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.size + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":63 + * return self.size + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * return self.get(i) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "pandas/src/skiplist.pyx":64 + * + * def __getitem__(self, i): + * return self.get(i) # <<<<<<<<<<<<<< + * + * cpdef get(self, Py_ssize_t i): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/skiplist.pyx":63 + * return self.size + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * return self.get(i) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":66 + * return self.get(i) + * + * cpdef get(self, Py_ssize_t i): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level + * cdef Node node + */ + +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_level; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_node = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":70 + * cdef Node node + * + * node = self.head # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":71 + * + * node = self.head + * i += 1 # <<<<<<<<<<<<<< + * + * for level in range(self.maxlevels - 1, -1, -1): + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/skiplist.pyx":73 + * i += 1 + * + * for level in range(self.maxlevels - 1, -1, -1): # <<<<<<<<<<<<<< + * while node.width[level] <= i: + * i -= node.width[level] + */ + for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) { + __pyx_v_level = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":74 + * + * for level in range(self.maxlevels - 1, -1, -1): + * while node.width[level] <= i: # <<<<<<<<<<<<<< + * i -= node.width[level] + * node = node.next[level] + */ + while (1) { + if (unlikely(__pyx_v_node->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_5) break; + + /* "pandas/src/skiplist.pyx":75 + * for level in range(self.maxlevels - 1, -1, -1): + * while node.width[level] <= i: + * i -= node.width[level] # <<<<<<<<<<<<<< + * node = node.next[level] + * + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_node->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/skiplist.pyx":76 + * while node.width[level] <= i: + * i -= node.width[level] + * node = node.next[level] # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_node, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + } + } + + /* "pandas/src/skiplist.pyx":79 + * + * + * return node.value # <<<<<<<<<<<<<< + * + * cpdef insert(self, double value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_node->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/skiplist.pyx":66 + * return self.get(i) + * + * cpdef get(self, Py_ssize_t i): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level + * cdef Node node + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_node); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) { + Py_ssize_t __pyx_v_i; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + assert(__pyx_arg_i); { + __pyx_v_i = __Pyx_PyIndex_AsSsize_t(__pyx_arg_i); if (unlikely((__pyx_v_i == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((Py_ssize_t)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_v_i, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":81 + * return node.value + * + * cpdef insert(self, double value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level, steps, d + * cdef Node node, prevnode, newnode, next_at_level, tmp + */ + +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_insert(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_level; + Py_ssize_t __pyx_v_steps; + Py_ssize_t __pyx_v_d; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_node = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_prevnode = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_newnode = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_next_at_level = 0; + PyObject *__pyx_v_chain = 0; + PyObject *__pyx_v_steps_at_level = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + double __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("insert", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":87 + * + * # find first node on each level where node.next[levels].value > value + * chain = [None] * self.maxlevels # <<<<<<<<<<<<<< + * steps_at_level = [0] * self.maxlevels + * node = self.head + */ + __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + __pyx_v_chain = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":88 + * # find first node on each level where node.next[levels].value > value + * chain = [None] * self.maxlevels + * steps_at_level = [0] * self.maxlevels # <<<<<<<<<<<<<< + * node = self.head + * + */ + __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + } + } + __pyx_v_steps_at_level = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":89 + * chain = [None] * self.maxlevels + * steps_at_level = [0] * self.maxlevels + * node = self.head # <<<<<<<<<<<<<< + * + * for level in range(self.maxlevels - 1, -1, -1): + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":91 + * node = self.head + * + * for level in range(self.maxlevels - 1, -1, -1): # <<<<<<<<<<<<<< + * next_at_level = node.next[level] + * + */ + for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) { + __pyx_v_level = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":92 + * + * for level in range(self.maxlevels - 1, -1, -1): + * next_at_level = node.next[level] # <<<<<<<<<<<<<< + * + * while next_at_level.value <= value: + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":94 + * next_at_level = node.next[level] + * + * while next_at_level.value <= value: # <<<<<<<<<<<<<< + * steps_at_level[level] = (steps_at_level[level] + + * node.width[level]) + */ + while (1) { + __pyx_t_5 = ((__pyx_v_next_at_level->value <= __pyx_v_value) != 0); + if (!__pyx_t_5) break; + + /* "pandas/src/skiplist.pyx":95 + * + * while next_at_level.value <= value: + * steps_at_level[level] = (steps_at_level[level] + # <<<<<<<<<<<<<< + * node.width[level]) + * node = next_at_level + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_steps_at_level, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/skiplist.pyx":96 + * while next_at_level.value <= value: + * steps_at_level[level] = (steps_at_level[level] + + * node.width[level]) # <<<<<<<<<<<<<< + * node = next_at_level + * next_at_level = node.next[level] + */ + if (unlikely(__pyx_v_node->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/src/skiplist.pyx":95 + * + * while next_at_level.value <= value: + * steps_at_level[level] = (steps_at_level[level] + # <<<<<<<<<<<<<< + * node.width[level]) + * node = next_at_level + */ + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_steps_at_level, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/skiplist.pyx":97 + * steps_at_level[level] = (steps_at_level[level] + + * node.width[level]) + * node = next_at_level # <<<<<<<<<<<<<< + * next_at_level = node.next[level] + * + */ + __Pyx_INCREF(((PyObject *)__pyx_v_next_at_level)); + __Pyx_DECREF_SET(__pyx_v_node, __pyx_v_next_at_level); + + /* "pandas/src/skiplist.pyx":98 + * node.width[level]) + * node = next_at_level + * next_at_level = node.next[level] # <<<<<<<<<<<<<< + * + * chain[level] = node + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_3)); + __pyx_t_3 = 0; + } + + /* "pandas/src/skiplist.pyx":100 + * next_at_level = node.next[level] + * + * chain[level] = node # <<<<<<<<<<<<<< + * + * # insert a link to the newnode at each level + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_chain, __pyx_v_level, ((PyObject *)__pyx_v_node), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/skiplist.pyx":103 + * + * # insert a link to the newnode at each level + * d = min(self.maxlevels, 1 - int(Log2(random()))) # <<<<<<<<<<<<<< + * newnode = Node(value, [None] * d, [None] * d) + * steps = 0 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_random); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_f_6pandas_5algos_Log2(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_int_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_v_self->maxlevels; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + } else { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __pyx_t_7; + __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_d = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":104 + * # insert a link to the newnode at each level + * d = min(self.maxlevels, 1 - int(Log2(random()))) + * newnode = Node(value, [None] * d, [None] * d) # <<<<<<<<<<<<<< + * steps = 0 + * + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(1 * ((__pyx_v_d<0) ? 0:__pyx_v_d)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_d; __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + __pyx_t_7 = PyList_New(1 * ((__pyx_v_d<0) ? 0:__pyx_v_d)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_d; __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_newnode = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/src/skiplist.pyx":105 + * d = min(self.maxlevels, 1 - int(Log2(random()))) + * newnode = Node(value, [None] * d, [None] * d) + * steps = 0 # <<<<<<<<<<<<<< + * + * for level in range(d): + */ + __pyx_v_steps = 0; + + /* "pandas/src/skiplist.pyx":107 + * steps = 0 + * + * for level in range(d): # <<<<<<<<<<<<<< + * prevnode = chain[level] + * newnode.next[level] = prevnode.next[level] + */ + __pyx_t_4 = __pyx_v_d; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "pandas/src/skiplist.pyx":108 + * + * for level in range(d): + * prevnode = chain[level] # <<<<<<<<<<<<<< + * newnode.next[level] = prevnode.next[level] + * prevnode.next[level] = newnode + */ + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_prevnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)); + __pyx_t_7 = 0; + + /* "pandas/src/skiplist.pyx":109 + * for level in range(d): + * prevnode = chain[level] + * newnode.next[level] = prevnode.next[level] # <<<<<<<<<<<<<< + * prevnode.next[level] = newnode + * newnode.width[level] = (prevnode.width[level] - steps) + */ + if (unlikely(__pyx_v_prevnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_prevnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(__pyx_v_newnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_newnode->next, __pyx_v_level, __pyx_t_7, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/skiplist.pyx":110 + * prevnode = chain[level] + * newnode.next[level] = prevnode.next[level] + * prevnode.next[level] = newnode # <<<<<<<<<<<<<< + * newnode.width[level] = (prevnode.width[level] - steps) + * prevnode.width[level] = steps + 1 + */ + if (unlikely(__pyx_v_prevnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->next, __pyx_v_level, ((PyObject *)__pyx_v_newnode), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/skiplist.pyx":111 + * newnode.next[level] = prevnode.next[level] + * prevnode.next[level] = newnode + * newnode.width[level] = (prevnode.width[level] - steps) # <<<<<<<<<<<<<< + * prevnode.width[level] = steps + 1 + * steps += steps_at_level[level] + */ + if (unlikely(__pyx_v_prevnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_prevnode->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_steps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_v_newnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_newnode->width, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/skiplist.pyx":112 + * prevnode.next[level] = newnode + * newnode.width[level] = (prevnode.width[level] - steps) + * prevnode.width[level] = steps + 1 # <<<<<<<<<<<<<< + * steps += steps_at_level[level] + * + */ + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_steps + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_prevnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->width, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/skiplist.pyx":113 + * newnode.width[level] = (prevnode.width[level] - steps) + * prevnode.width[level] = steps + 1 + * steps += steps_at_level[level] # <<<<<<<<<<<<<< + * + * for level in range(d, self.maxlevels): + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_steps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_steps_at_level, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_steps = __pyx_t_9; + } + + /* "pandas/src/skiplist.pyx":115 + * steps += steps_at_level[level] + * + * for level in range(d, self.maxlevels): # <<<<<<<<<<<<<< + * ( chain[level]).width[level] += 1 + * + */ + __pyx_t_4 = __pyx_v_self->maxlevels; + for (__pyx_t_8 = __pyx_v_d; __pyx_t_8 < __pyx_t_4; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "pandas/src/skiplist.pyx":116 + * + * for level in range(d, self.maxlevels): + * ( chain[level]).width[level] += 1 # <<<<<<<<<<<<<< + * + * self.size += 1 + */ + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width); + __pyx_t_10 = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = __pyx_v_level; + if (unlikely(__pyx_t_10 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_t_10, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_10 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_t_10, __pyx_t_9, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + + /* "pandas/src/skiplist.pyx":118 + * ( chain[level]).width[level] += 1 + * + * self.size += 1 # <<<<<<<<<<<<<< + * + * cpdef remove(self, double value): + */ + __pyx_v_self->size = (__pyx_v_self->size + 1); + + /* "pandas/src/skiplist.pyx":81 + * return node.value + * + * cpdef insert(self, double value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level, steps, d + * cdef Node node, prevnode, newnode, next_at_level, tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_node); + __Pyx_XDECREF((PyObject *)__pyx_v_prevnode); + __Pyx_XDECREF((PyObject *)__pyx_v_newnode); + __Pyx_XDECREF((PyObject *)__pyx_v_next_at_level); + __Pyx_XDECREF(__pyx_v_chain); + __Pyx_XDECREF(__pyx_v_steps_at_level); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + double __pyx_v_value; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("insert (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((double)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("insert", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->insert(__pyx_v_self, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":120 + * self.size += 1 + * + * cpdef remove(self, double value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level, d + * cdef Node node, prevnode, tmpnode, next_at_level + */ + +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_remove(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_level; + Py_ssize_t __pyx_v_d; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_node = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_prevnode = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_tmpnode = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_next_at_level = 0; + PyObject *__pyx_v_chain = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("remove", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":126 + * + * # find first node on each level where node.next[levels].value >= value + * chain = [None] * self.maxlevels # <<<<<<<<<<<<<< + * node = self.head + * + */ + __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + __pyx_v_chain = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":127 + * # find first node on each level where node.next[levels].value >= value + * chain = [None] * self.maxlevels + * node = self.head # <<<<<<<<<<<<<< + * + * for level in range(self.maxlevels - 1, -1, -1): + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":129 + * node = self.head + * + * for level in range(self.maxlevels - 1, -1, -1): # <<<<<<<<<<<<<< + * next_at_level = node.next[level] + * while next_at_level.value < value: + */ + for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) { + __pyx_v_level = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":130 + * + * for level in range(self.maxlevels - 1, -1, -1): + * next_at_level = node.next[level] # <<<<<<<<<<<<<< + * while next_at_level.value < value: + * node = next_at_level + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":131 + * for level in range(self.maxlevels - 1, -1, -1): + * next_at_level = node.next[level] + * while next_at_level.value < value: # <<<<<<<<<<<<<< + * node = next_at_level + * next_at_level = node.next[level] + */ + while (1) { + __pyx_t_5 = ((__pyx_v_next_at_level->value < __pyx_v_value) != 0); + if (!__pyx_t_5) break; + + /* "pandas/src/skiplist.pyx":132 + * next_at_level = node.next[level] + * while next_at_level.value < value: + * node = next_at_level # <<<<<<<<<<<<<< + * next_at_level = node.next[level] + * + */ + __Pyx_INCREF(((PyObject *)__pyx_v_next_at_level)); + __Pyx_DECREF_SET(__pyx_v_node, __pyx_v_next_at_level); + + /* "pandas/src/skiplist.pyx":133 + * while next_at_level.value < value: + * node = next_at_level + * next_at_level = node.next[level] # <<<<<<<<<<<<<< + * + * chain[level] = node + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":135 + * next_at_level = node.next[level] + * + * chain[level] = node # <<<<<<<<<<<<<< + * + * if value != ( ( ( chain[0]).next)[0]).value: + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_chain, __pyx_v_level, ((PyObject *)__pyx_v_node), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/skiplist.pyx":137 + * chain[level] = node + * + * if value != ( ( ( chain[0]).next)[0]).value: # <<<<<<<<<<<<<< + * raise KeyError('Not Found') + * + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_chain, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)->next, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = ((__pyx_v_value != ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)->value) != 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/src/skiplist.pyx":138 + * + * if value != ( ( ( chain[0]).next)[0]).value: + * raise KeyError('Not Found') # <<<<<<<<<<<<<< + * + * # remove one link at each level + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/skiplist.pyx":141 + * + * # remove one link at each level + * d = len(( ( ( chain[0]).next)[0]).next) # <<<<<<<<<<<<<< + * + * for level in range(d): + */ + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_chain, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)->next, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)->next; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_d = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":143 + * d = len(( ( ( chain[0]).next)[0]).next) + * + * for level in range(d): # <<<<<<<<<<<<<< + * prevnode = chain[level] + * tmpnode = prevnode.next[level] + */ + __pyx_t_4 = __pyx_v_d; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_4; __pyx_t_6+=1) { + __pyx_v_level = __pyx_t_6; + + /* "pandas/src/skiplist.pyx":144 + * + * for level in range(d): + * prevnode = chain[level] # <<<<<<<<<<<<<< + * tmpnode = prevnode.next[level] + * prevnode.width[level] += tmpnode.width[level] - 1 + */ + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_prevnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":145 + * for level in range(d): + * prevnode = chain[level] + * tmpnode = prevnode.next[level] # <<<<<<<<<<<<<< + * prevnode.width[level] += tmpnode.width[level] - 1 + * prevnode.next[level] = tmpnode.next[level] + */ + if (unlikely(__pyx_v_prevnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_prevnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_tmpnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":146 + * prevnode = chain[level] + * tmpnode = prevnode.next[level] + * prevnode.width[level] += tmpnode.width[level] - 1 # <<<<<<<<<<<<<< + * prevnode.next[level] = tmpnode.next[level] + * + */ + if (unlikely(__pyx_v_prevnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(__pyx_v_prevnode->width); + __pyx_t_7 = __pyx_v_prevnode->width; + __pyx_t_8 = __pyx_v_level; + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_t_7, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_tmpnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_tmpnode->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_t_8, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/skiplist.pyx":147 + * tmpnode = prevnode.next[level] + * prevnode.width[level] += tmpnode.width[level] - 1 + * prevnode.next[level] = tmpnode.next[level] # <<<<<<<<<<<<<< + * + * for level in range(d, self.maxlevels): + */ + if (unlikely(__pyx_v_tmpnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_tmpnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_prevnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->next, __pyx_v_level, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":149 + * prevnode.next[level] = tmpnode.next[level] + * + * for level in range(d, self.maxlevels): # <<<<<<<<<<<<<< + * tmpnode = chain[level] + * tmpnode.width[level] -= 1 + */ + __pyx_t_4 = __pyx_v_self->maxlevels; + for (__pyx_t_6 = __pyx_v_d; __pyx_t_6 < __pyx_t_4; __pyx_t_6+=1) { + __pyx_v_level = __pyx_t_6; + + /* "pandas/src/skiplist.pyx":150 + * + * for level in range(d, self.maxlevels): + * tmpnode = chain[level] # <<<<<<<<<<<<<< + * tmpnode.width[level] -= 1 + * + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_tmpnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":151 + * for level in range(d, self.maxlevels): + * tmpnode = chain[level] + * tmpnode.width[level] -= 1 # <<<<<<<<<<<<<< + * + * self.size -= 1 + */ + if (unlikely(__pyx_v_tmpnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(__pyx_v_tmpnode->width); + __pyx_t_7 = __pyx_v_tmpnode->width; + __pyx_t_8 = __pyx_v_level; + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_t_7, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_t_8, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + + /* "pandas/src/skiplist.pyx":153 + * tmpnode.width[level] -= 1 + * + * self.size -= 1 # <<<<<<<<<<<<<< + */ + __pyx_v_self->size = (__pyx_v_self->size - 1); + + /* "pandas/src/skiplist.pyx":120 + * self.size += 1 + * + * cpdef remove(self, double value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level, d + * cdef Node node, prevnode, tmpnode, next_at_level + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_node); + __Pyx_XDECREF((PyObject *)__pyx_v_prevnode); + __Pyx_XDECREF((PyObject *)__pyx_v_tmpnode); + __Pyx_XDECREF((PyObject *)__pyx_v_next_at_level); + __Pyx_XDECREF(__pyx_v_chain); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + double __pyx_v_value; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("remove (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((double)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("remove", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->remove(__pyx_v_self, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":93 + * # from cython cimport floating, integral + * + * cdef _take_2d_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_5algos__take_2d_float64(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_take_2d_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":97 + * cdef: + * Py_ssize_t i, j, N, K + * ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] result + * object val + */ + if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_idx; + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":101 + * object val + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * result = np.empty_like(values) + * for i in range(N): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":102 + * + * N, K = ( values).shape + * result = np.empty_like(values) # <<<<<<<<<<<<<< + * for i in range(N): + * for j in range(K): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":103 + * N, K = ( values).shape + * result = np.empty_like(values) + * for i in range(N): # <<<<<<<<<<<<<< + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + */ + __pyx_t_7 = __pyx_v_N; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/algos.pyx":104 + * result = np.empty_like(values) + * for i in range(N): + * for j in range(K): # <<<<<<<<<<<<<< + * result[i, j] = values[i, indexer[i, j]] + * return result + */ + __pyx_t_13 = __pyx_v_K; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "pandas/algos.pyx":105 + * for i in range(N): + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides)); + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + } + } + + /* "pandas/algos.pyx":106 + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + * return result # <<<<<<<<<<<<<< + * + * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":93 + * # from cython cimport floating, integral + * + * cdef _take_2d_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos._take_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":108 + * return result + * + * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_5algos__take_2d_int64(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_take_2d_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":112 + * cdef: + * Py_ssize_t i, j, N, K + * ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx # <<<<<<<<<<<<<< + * ndarray[int64_t, ndim=2] result + * object val + */ + if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_idx; + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":116 + * object val + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * result = np.empty_like(values) + * for i in range(N): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":117 + * + * N, K = ( values).shape + * result = np.empty_like(values) # <<<<<<<<<<<<<< + * for i in range(N): + * for j in range(K): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":118 + * N, K = ( values).shape + * result = np.empty_like(values) + * for i in range(N): # <<<<<<<<<<<<<< + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + */ + __pyx_t_7 = __pyx_v_N; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/algos.pyx":119 + * result = np.empty_like(values) + * for i in range(N): + * for j in range(K): # <<<<<<<<<<<<<< + * result[i, j] = values[i, indexer[i, j]] + * return result + */ + __pyx_t_13 = __pyx_v_K; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "pandas/algos.pyx":120 + * for i in range(N): + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides)); + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + } + } + + /* "pandas/algos.pyx":121 + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + * return result # <<<<<<<<<<<<<< + * + * cdef _take_2d_object(ndarray[object, ndim=2] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":108 + * return result + * + * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos._take_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":123 + * return result + * + * cdef _take_2d_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_5algos__take_2d_object(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + PyObject **__pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_take_2d_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":127 + * cdef: + * Py_ssize_t i, j, N, K + * ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx # <<<<<<<<<<<<<< + * ndarray[object, ndim=2] result + * object val + */ + if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_idx; + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":131 + * object val + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * result = values.copy() + * for i in range(N): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":132 + * + * N, K = ( values).shape + * result = values.copy() # <<<<<<<<<<<<<< + * for i in range(N): + * for j in range(K): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":133 + * N, K = ( values).shape + * result = values.copy() + * for i in range(N): # <<<<<<<<<<<<<< + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + */ + __pyx_t_7 = __pyx_v_N; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/algos.pyx":134 + * result = values.copy() + * for i in range(N): + * for j in range(K): # <<<<<<<<<<<<<< + * result[i, j] = values[i, indexer[i, j]] + * return result + */ + __pyx_t_13 = __pyx_v_K; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "pandas/algos.pyx":135 + * for i in range(N): + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides)); + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_21); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_21); + *__pyx_t_21 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_21); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + } + + /* "pandas/algos.pyx":136 + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":123 + * return result + * + * cdef _take_2d_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos._take_2d_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":139 + * + * + * cdef inline bint float64_are_diff(float64_t left, float64_t right): # <<<<<<<<<<<<<< + * cdef double abs_diff, allowed + * if right == MAXfloat64 or right == -MAXfloat64: + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5algos_float64_are_diff(__pyx_t_5numpy_float64_t __pyx_v_left, __pyx_t_5numpy_float64_t __pyx_v_right) { + double __pyx_v_abs_diff; + double __pyx_v_allowed; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("float64_are_diff", 0); + + /* "pandas/algos.pyx":141 + * cdef inline bint float64_are_diff(float64_t left, float64_t right): + * cdef double abs_diff, allowed + * if right == MAXfloat64 or right == -MAXfloat64: # <<<<<<<<<<<<<< + * if left == right: + * return False + */ + __pyx_t_1 = ((__pyx_v_right == __pyx_v_6pandas_5algos_MAXfloat64) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_right == (-__pyx_v_6pandas_5algos_MAXfloat64)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/algos.pyx":142 + * cdef double abs_diff, allowed + * if right == MAXfloat64 or right == -MAXfloat64: + * if left == right: # <<<<<<<<<<<<<< + * return False + * else: + */ + __pyx_t_3 = ((__pyx_v_left == __pyx_v_right) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":143 + * if right == MAXfloat64 or right == -MAXfloat64: + * if left == right: + * return False # <<<<<<<<<<<<<< + * else: + * return True + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":145 + * return False + * else: + * return True # <<<<<<<<<<<<<< + * else: + * abs_diff = fabs(left - right) + */ + __pyx_r = 1; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/algos.pyx":147 + * return True + * else: + * abs_diff = fabs(left - right) # <<<<<<<<<<<<<< + * allowed = REL_TOL * fabs(right) + * return abs_diff > allowed + */ + __pyx_v_abs_diff = fabs((__pyx_v_left - __pyx_v_right)); + + /* "pandas/algos.pyx":148 + * else: + * abs_diff = fabs(left - right) + * allowed = REL_TOL * fabs(right) # <<<<<<<<<<<<<< + * return abs_diff > allowed + * + */ + __pyx_v_allowed = (__pyx_v_6pandas_5algos_REL_TOL * fabs(__pyx_v_right)); + + /* "pandas/algos.pyx":149 + * abs_diff = fabs(left - right) + * allowed = REL_TOL * fabs(right) + * return abs_diff > allowed # <<<<<<<<<<<<<< + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, + */ + __pyx_r = (__pyx_v_abs_diff > __pyx_v_allowed); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":139 + * + * + * cdef inline bint float64_are_diff(float64_t left, float64_t right): # <<<<<<<<<<<<<< + * cdef double abs_diff, allowed + * if right == MAXfloat64 or right == -MAXfloat64: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_1rank_1d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_rank_1d_float64[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_1rank_1d_float64 = {__Pyx_NAMESTR("rank_1d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_1rank_1d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_rank_1d_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_1rank_1d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_1d_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_n_s_average); + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)__pyx_n_s_keep); + + /* "pandas/algos.pyx":152 + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, + * na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_float64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_ties_method = values[1]; + __pyx_v_ascending = values[2]; + __pyx_v_na_option = values[3]; + __pyx_v_pct = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_1d_float64", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_1d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_rank_1d_float64(__pyx_self, __pyx_v_in_arr, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_rank_1d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_sorted_data = 0; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_argsorted = 0; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_nan_value; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + int __pyx_v_keep_na; + float __pyx_v_count; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sorted_data; + __Pyx_Buffer __pyx_pybuffer_sorted_data; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __pyx_t_5numpy_float64_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + __pyx_t_5numpy_int64_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + __pyx_t_5numpy_int64_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + __pyx_t_5numpy_int64_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_1d_float64", 0); + __pyx_pybuffer_sorted_data.pybuffer.buf = NULL; + __pyx_pybuffer_sorted_data.refcount = 0; + __pyx_pybuffernd_sorted_data.data = NULL; + __pyx_pybuffernd_sorted_data.rcbuffer = &__pyx_pybuffer_sorted_data; + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":158 + * + * cdef: + * Py_ssize_t i, j, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t] sorted_data, ranks, values + * ndarray[int64_t] argsorted + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":162 + * ndarray[int64_t] argsorted + * float64_t val, nan_value + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * bint keep_na = 0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":163 + * float64_t val, nan_value + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * bint keep_na = 0 + * float count = 0.0 + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":164 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * bint keep_na = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_keep_na = 0; + + /* "pandas/algos.pyx":165 + * int tiebreak = 0 + * bint keep_na = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * tiebreak = tiebreakers[ties_method] + * + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":166 + * bint keep_na = 0 + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * values = np.asarray(in_arr).copy() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":168 + * tiebreak = tiebreakers[ties_method] + * + * values = np.asarray(in_arr).copy() # <<<<<<<<<<<<<< + * + * keep_na = na_option == 'keep' + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":170 + * values = np.asarray(in_arr).copy() + * + * keep_na = na_option == 'keep' # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_keep_na = __pyx_t_9; + + /* "pandas/algos.pyx":172 + * keep_na = na_option == 'keep' + * + * if ascending ^ (na_option == 'top'): # <<<<<<<<<<<<<< + * nan_value = np.inf + * else: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_9) { + + /* "pandas/algos.pyx":173 + * + * if ascending ^ (na_option == 'top'): + * nan_value = np.inf # <<<<<<<<<<<<<< + * else: + * nan_value = -np.inf + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_nan_value = __pyx_t_10; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":175 + * nan_value = np.inf + * else: + * nan_value = -np.inf # <<<<<<<<<<<<<< + * mask = np.isnan(values) + * np.putmask(values, mask, nan_value) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_nan_value = __pyx_t_10; + } + __pyx_L3:; + + /* "pandas/algos.pyx":176 + * else: + * nan_value = -np.inf + * mask = np.isnan(values) # <<<<<<<<<<<<<< + * np.putmask(values, mask, nan_value) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_mask = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":177 + * nan_value = -np.inf + * mask = np.isnan(values) + * np.putmask(values, mask, nan_value) # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nan_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":179 + * np.putmask(values, mask, nan_value) + * + * n = len(values) # <<<<<<<<<<<<<< + * ranks = np.empty(n, dtype='f8') + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_11; + + /* "pandas/algos.pyx":180 + * + * n = len(values) + * ranks = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * + * # py2.5/win32 hack, can't pass i8 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/algos.pyx":183 + * + * # py2.5/win32 hack, can't pass i8 + * if tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') + */ + __pyx_t_9 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_9) { + + /* "pandas/algos.pyx":185 + * if tiebreak == TIEBREAK_FIRST: + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') # <<<<<<<<<<<<<< + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":186 + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') + * if not ascending: # <<<<<<<<<<<<<< + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = ((!__pyx_t_9) != 0); + if (__pyx_t_13) { + + /* "pandas/algos.pyx":187 + * _as = values.argsort(kind='mergesort') + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING # <<<<<<<<<<<<<< + * else: + * _as = values.argsort() + */ + __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":189 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort() # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v__as = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "pandas/algos.pyx":191 + * _as = values.argsort() + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[::-1] + * + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((!__pyx_t_13) != 0); + if (__pyx_t_9) { + + /* "pandas/algos.pyx":192 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_t_1 = PyObject_GetItem(__pyx_v__as, __pyx_slice__2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/algos.pyx":194 + * _as = _as[::-1] + * + * sorted_data = values.take(_as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v__as); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__as); + __Pyx_GIVEREF(__pyx_v__as); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_sorted_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_sorted_data.diminfo[0].strides = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sorted_data.diminfo[0].shape = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/algos.pyx":195 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":197 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * sum_ranks += i + 1 + * dups += 1 + */ + __pyx_t_11 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_11; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/algos.pyx":198 + * + * for i in range(n): + * sum_ranks += i + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = sorted_data[i] + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1)); + + /* "pandas/algos.pyx":199 + * for i in range(n): + * sum_ranks += i + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = sorted_data[i] + * if (val == nan_value) and keep_na: + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":200 + * sum_ranks += i + 1 + * dups += 1 + * val = sorted_data[i] # <<<<<<<<<<<<<< + * if (val == nan_value) and keep_na: + * ranks[argsorted[i]] = nan + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_sorted_data.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_sorted_data.diminfo[0].strides)); + + /* "pandas/algos.pyx":201 + * dups += 1 + * val = sorted_data[i] + * if (val == nan_value) and keep_na: # <<<<<<<<<<<<<< + * ranks[argsorted[i]] = nan + * continue + */ + __pyx_t_9 = ((__pyx_v_val == __pyx_v_nan_value) != 0); + if (__pyx_t_9) { + __pyx_t_13 = (__pyx_v_keep_na != 0); + } else { + __pyx_t_13 = __pyx_t_9; + } + if (__pyx_t_13) { + + /* "pandas/algos.pyx":202 + * val = sorted_data[i] + * if (val == nan_value) and keep_na: + * ranks[argsorted[i]] = nan # <<<<<<<<<<<<<< + * continue + * count += 1.0 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_6pandas_5algos_nan; + + /* "pandas/algos.pyx":203 + * if (val == nan_value) and keep_na: + * ranks[argsorted[i]] = nan + * continue # <<<<<<<<<<<<<< + * count += 1.0 + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): + */ + goto __pyx_L7_continue; + } + + /* "pandas/algos.pyx":204 + * ranks[argsorted[i]] = nan + * continue + * count += 1.0 # <<<<<<<<<<<<<< + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":205 + * continue + * count += 1.0 + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_13 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0); + if (!__pyx_t_13) { + __pyx_t_19 = (__pyx_v_i + 1); + __pyx_t_3 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_sorted_data.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (__pyx_f_6pandas_5algos_float64_are_diff((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_sorted_data.diminfo[0].strides)), __pyx_v_val) != 0); + __pyx_t_20 = __pyx_t_9; + } else { + __pyx_t_20 = __pyx_t_13; + } + if (__pyx_t_20) { + + /* "pandas/algos.pyx":206 + * count += 1.0 + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":207 + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":208 + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":209 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":210 + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":211 + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":212 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":213 + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":214 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":215 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":216 + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":217 + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_29 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_j + 1); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":218 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":219 + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":220 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":221 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":222 + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":223 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":224 + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_34 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":225 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * return ranks / count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L10; + } + __pyx_L10:; + __pyx_L7_continue:; + } + + /* "pandas/algos.pyx":226 + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * return ranks / count + * else: + */ + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_20) { + + /* "pandas/algos.pyx":227 + * sum_ranks = dups = 0 + * if pct: + * return ranks / count # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":229 + * return ranks / count + * else: + * return ranks # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_1d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data); + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_3rank_1d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_2rank_1d_int64[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_3rank_1d_int64 = {__Pyx_NAMESTR("rank_1d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_3rank_1d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_2rank_1d_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_3rank_1d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + CYTHON_UNUSED PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_1d_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_n_s_average); + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)__pyx_n_s_keep); + + /* "pandas/algos.pyx":233 + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, + * na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_ties_method = values[1]; + __pyx_v_ascending = values[2]; + __pyx_v_na_option = values[3]; + __pyx_v_pct = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_1d_int64", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_1d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_2rank_1d_int64(__pyx_self, __pyx_v_in_arr, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_2rank_1d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_sorted_data = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_argsorted = 0; + __pyx_t_5numpy_int64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + float __pyx_v_count; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sorted_data; + __Pyx_Buffer __pyx_pybuffer_sorted_data; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + __pyx_t_5numpy_int64_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + __pyx_t_5numpy_int64_t __pyx_t_32; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_1d_int64", 0); + __pyx_pybuffer_sorted_data.pybuffer.buf = NULL; + __pyx_pybuffer_sorted_data.refcount = 0; + __pyx_pybuffernd_sorted_data.data = NULL; + __pyx_pybuffernd_sorted_data.rcbuffer = &__pyx_pybuffer_sorted_data; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":239 + * + * cdef: + * Py_ssize_t i, j, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[int64_t] sorted_data, values + * ndarray[float64_t] ranks + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":244 + * ndarray[int64_t] argsorted + * int64_t val + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * float count = 0.0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":245 + * int64_t val + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":246 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * tiebreak = tiebreakers[ties_method] + * + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":247 + * int tiebreak = 0 + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * values = np.asarray(in_arr) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":249 + * tiebreak = tiebreakers[ties_method] + * + * values = np.asarray(in_arr) # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":251 + * values = np.asarray(in_arr) + * + * n = len(values) # <<<<<<<<<<<<<< + * ranks = np.empty(n, dtype='f8') + * + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_9; + + /* "pandas/algos.pyx":252 + * + * n = len(values) + * ranks = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * + * # py2.5/win32 hack, can't pass i8 + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/algos.pyx":255 + * + * # py2.5/win32 hack, can't pass i8 + * if tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') + */ + __pyx_t_12 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_12) { + + /* "pandas/algos.pyx":257 + * if tiebreak == TIEBREAK_FIRST: + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') # <<<<<<<<<<<<<< + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v__as = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":258 + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') + * if not ascending: # <<<<<<<<<<<<<< + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + */ + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = ((!__pyx_t_12) != 0); + if (__pyx_t_13) { + + /* "pandas/algos.pyx":259 + * _as = values.argsort(kind='mergesort') + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING # <<<<<<<<<<<<<< + * else: + * _as = values.argsort() + */ + __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":261 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort() # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/algos.pyx":263 + * _as = values.argsort() + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[::-1] + * + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((!__pyx_t_13) != 0); + if (__pyx_t_12) { + + /* "pandas/algos.pyx":264 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v__as, __pyx_slice__4); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":266 + * _as = _as[::-1] + * + * sorted_data = values.take(_as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__as); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__as); + __Pyx_GIVEREF(__pyx_v__as); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_sorted_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_sorted_data.diminfo[0].strides = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sorted_data.diminfo[0].shape = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/algos.pyx":267 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":269 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * sum_ranks += i + 1 + * dups += 1 + */ + __pyx_t_9 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_9; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/algos.pyx":270 + * + * for i in range(n): + * sum_ranks += i + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = sorted_data[i] + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1)); + + /* "pandas/algos.pyx":271 + * for i in range(n): + * sum_ranks += i + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = sorted_data[i] + * count += 1.0 + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":272 + * sum_ranks += i + 1 + * dups += 1 + * val = sorted_data[i] # <<<<<<<<<<<<<< + * count += 1.0 + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_sorted_data.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_sorted_data.diminfo[0].strides)); + + /* "pandas/algos.pyx":273 + * dups += 1 + * val = sorted_data[i] + * count += 1.0 # <<<<<<<<<<<<<< + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":274 + * val = sorted_data[i] + * count += 1.0 + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_12 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0); + if (!__pyx_t_12) { + __pyx_t_17 = (__pyx_v_i + 1); + __pyx_t_3 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_sorted_data.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = ((fabs(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_sorted_data.diminfo[0].strides)) - __pyx_v_val)) > 0.0) != 0); + __pyx_t_18 = __pyx_t_13; + } else { + __pyx_t_18 = __pyx_t_12; + } + if (__pyx_t_18) { + + /* "pandas/algos.pyx":275 + * count += 1.0 + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":276 + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":277 + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":278 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":279 + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":280 + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":281 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":282 + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":283 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":284 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":285 + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":286 + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_j + 1); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":287 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":288 + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":289 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_29 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":290 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":291 + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":292 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":293 + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":294 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * return ranks / count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "pandas/algos.pyx":295 + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * return ranks / count + * else: + */ + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_18) { + + /* "pandas/algos.pyx":296 + * sum_ranks = dups = 0 + * if pct: + * return ranks / count # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":298 + * return ranks / count + * else: + * return ranks # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_1d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_5rank_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_4rank_2d_float64[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_5rank_2d_float64 = {__Pyx_NAMESTR("rank_2d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_5rank_2d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_4rank_2d_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_5rank_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_2d_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_int_0); + values[2] = ((PyObject *)__pyx_n_s_average); + + /* "pandas/algos.pyx":302 + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', + * ascending=True, na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)__pyx_n_s_keep); + values[5] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_float64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_axis = values[1]; + __pyx_v_ties_method = values[2]; + __pyx_v_ascending = values[3]; + __pyx_v_na_option = values[4]; + __pyx_v_pct = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_2d_float64", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_4rank_2d_float64(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_4rank_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_z; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_argsorted = 0; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_nan_value; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + int __pyx_v_keep_na; + float __pyx_v_count; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + PyArrayObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + int __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + __pyx_t_5numpy_int64_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + __pyx_t_5numpy_int64_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + __pyx_t_5numpy_int64_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + __pyx_t_5numpy_int64_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_int64_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + __pyx_t_5numpy_int64_t __pyx_t_53; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_2d_float64", 0); + __Pyx_INCREF(__pyx_v_in_arr); + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":308 + * + * cdef: + * Py_ssize_t i, j, z, k, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] ranks, values + * ndarray[int64_t, ndim=2] argsorted + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":312 + * ndarray[int64_t, ndim=2] argsorted + * float64_t val, nan_value + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * bint keep_na = 0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":313 + * float64_t val, nan_value + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * bint keep_na = 0 + * float count = 0.0 + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":314 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * bint keep_na = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * + */ + __pyx_v_keep_na = 0; + + /* "pandas/algos.pyx":315 + * int tiebreak = 0 + * bint keep_na = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":317 + * float count = 0.0 + * + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * keep_na = na_option == 'keep' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":319 + * tiebreak = tiebreakers[ties_method] + * + * keep_na = na_option == 'keep' # <<<<<<<<<<<<<< + * + * in_arr = np.asarray(in_arr) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_keep_na = __pyx_t_4; + + /* "pandas/algos.pyx":321 + * keep_na = na_option == 'keep' + * + * in_arr = np.asarray(in_arr) # <<<<<<<<<<<<<< + * + * if axis == 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_in_arr, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":323 + * in_arr = np.asarray(in_arr) + * + * if axis == 0: # <<<<<<<<<<<<<< + * values = in_arr.T.copy() + * else: + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":324 + * + * if axis == 0: + * values = in_arr.T.copy() # <<<<<<<<<<<<<< + * else: + * values = in_arr.copy() + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":326 + * values = in_arr.T.copy() + * else: + * values = in_arr.copy() # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "pandas/algos.pyx":328 + * values = in_arr.copy() + * + * if ascending ^ (na_option == 'top'): # <<<<<<<<<<<<<< + * nan_value = np.inf + * else: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":329 + * + * if ascending ^ (na_option == 'top'): + * nan_value = np.inf # <<<<<<<<<<<<<< + * else: + * nan_value = -np.inf + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nan_value = __pyx_t_10; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":331 + * nan_value = np.inf + * else: + * nan_value = -np.inf # <<<<<<<<<<<<<< + * + * np.putmask(values, np.isnan(values), nan_value) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nan_value = __pyx_t_10; + } + __pyx_L4:; + + /* "pandas/algos.pyx":333 + * nan_value = -np.inf + * + * np.putmask(values, np.isnan(values), nan_value) # <<<<<<<<<<<<<< + * + * n, k = ( values).shape + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nan_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_11 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":335 + * np.putmask(values, np.isnan(values), nan_value) + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * ranks = np.empty((n, k), dtype='f8') + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_n = __pyx_t_13; + __pyx_v_k = __pyx_t_14; + + /* "pandas/algos.pyx":336 + * + * n, k = ( values).shape + * ranks = np.empty((n, k), dtype='f8') # <<<<<<<<<<<<<< + * + * if tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":338 + * ranks = np.empty((n, k), dtype='f8') + * + * if tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') + */ + __pyx_t_4 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":340 + * if tiebreak == TIEBREAK_FIRST: + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') # <<<<<<<<<<<<<< + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_axis, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v__as = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":341 + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') + * if not ascending: # <<<<<<<<<<<<<< + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((!__pyx_t_4) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":342 + * _as = values.argsort(axis=1, kind='mergesort') + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING # <<<<<<<<<<<<<< + * else: + * _as = values.argsort(1) + */ + __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; + goto __pyx_L8; + } + __pyx_L8:; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/algos.pyx":344 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_11; + __pyx_t_11 = 0; + } + __pyx_L7:; + + /* "pandas/algos.pyx":346 + * _as = values.argsort(1) + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[:, ::-1] + * + */ + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((!__pyx_t_15) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":347 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_float64(values, _as) + */ + __pyx_t_11 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__9); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":349 + * _as = _as[:, ::-1] + * + * values = _take_2d_float64(values, _as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_11 = __pyx_f_6pandas_5algos__take_2d_float64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_11)); + __pyx_t_11 = 0; + + /* "pandas/algos.pyx":350 + * + * values = _take_2d_float64(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":352 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * dups = sum_ranks = 0 + * total_tie_count = 0 + */ + __pyx_t_14 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":353 + * + * for i in range(n): + * dups = sum_ranks = 0 # <<<<<<<<<<<<<< + * total_tie_count = 0 + * count = 0.0 + */ + __pyx_v_dups = 0; + __pyx_v_sum_ranks = 0; + + /* "pandas/algos.pyx":354 + * for i in range(n): + * dups = sum_ranks = 0 + * total_tie_count = 0 # <<<<<<<<<<<<<< + * count = 0.0 + * for j in range(k): + */ + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":355 + * dups = sum_ranks = 0 + * total_tie_count = 0 + * count = 0.0 # <<<<<<<<<<<<<< + * for j in range(k): + * sum_ranks += j + 1 + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":356 + * total_tie_count = 0 + * count = 0.0 + * for j in range(k): # <<<<<<<<<<<<<< + * sum_ranks += j + 1 + * dups += 1 + */ + __pyx_t_17 = __pyx_v_k; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_j = __pyx_t_18; + + /* "pandas/algos.pyx":357 + * count = 0.0 + * for j in range(k): + * sum_ranks += j + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = values[i, j] + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_j + 1)); + + /* "pandas/algos.pyx":358 + * for j in range(k): + * sum_ranks += j + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = values[i, j] + * if val == nan_value and keep_na: + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":359 + * sum_ranks += j + 1 + * dups += 1 + * val = values[i, j] # <<<<<<<<<<<<<< + * if val == nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/algos.pyx":360 + * dups += 1 + * val = values[i, j] + * if val == nan_value and keep_na: # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, j]] = nan + * continue + */ + __pyx_t_4 = ((__pyx_v_val == __pyx_v_nan_value) != 0); + if (__pyx_t_4) { + __pyx_t_15 = (__pyx_v_keep_na != 0); + } else { + __pyx_t_15 = __pyx_t_4; + } + if (__pyx_t_15) { + + /* "pandas/algos.pyx":361 + * val = values[i, j] + * if val == nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan # <<<<<<<<<<<<<< + * continue + * count += 1.0 + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + + /* "pandas/algos.pyx":362 + * if val == nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan + * continue # <<<<<<<<<<<<<< + * count += 1.0 + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): + */ + goto __pyx_L12_continue; + } + + /* "pandas/algos.pyx":363 + * ranks[i, argsorted[i, j]] = nan + * continue + * count += 1.0 # <<<<<<<<<<<<<< + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":364 + * continue + * count += 1.0 + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_15 = ((__pyx_v_j == (__pyx_v_k - 1)) != 0); + if (!__pyx_t_15) { + __pyx_t_25 = __pyx_v_i; + __pyx_t_26 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (__pyx_f_6pandas_5algos_float64_are_diff((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_values.diminfo[1].strides)), __pyx_v_val) != 0); + __pyx_t_27 = __pyx_t_4; + } else { + __pyx_t_27 = __pyx_t_15; + } + if (__pyx_t_27) { + + /* "pandas/algos.pyx":365 + * count += 1.0 + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":366 + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":367 + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":368 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":369 + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":370 + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":371 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":372 + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":373 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":374 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":375 + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":376 + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_43 < 0) { + __pyx_t_43 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_z + 1); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":377 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":378 + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":379 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_46 = __pyx_v_i; + __pyx_t_47 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_46 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_47 < 0) { + __pyx_t_47 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_48 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_49 < 0) { + __pyx_t_49 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":380 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":381 + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":382 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":383 + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_50 = __pyx_v_i; + __pyx_t_51 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_50 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_50 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_51 < 0) { + __pyx_t_51 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_51 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_52 = __pyx_v_i; + __pyx_t_53 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_52 < 0) { + __pyx_t_52 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_52 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_53 < 0) { + __pyx_t_53 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_53 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/algos.pyx":384 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * ranks[i, :] /= count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L15; + } + __pyx_L15:; + __pyx_L12_continue:; + } + + /* "pandas/algos.pyx":385 + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * ranks[i, :] /= count + * if axis == 0: + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_27) { + + /* "pandas/algos.pyx":386 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_slice__11); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_slice__11); + __Pyx_GIVEREF(__pyx_slice__11); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_11); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_11, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L29; + } + __pyx_L29:; + } + + /* "pandas/algos.pyx":387 + * if pct: + * ranks[i, :] /= count + * if axis == 0: # <<<<<<<<<<<<<< + * return ranks.T + * else: + */ + __pyx_t_11 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_27) { + + /* "pandas/algos.pyx":388 + * ranks[i, :] /= count + * if axis == 0: + * return ranks.T # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":390 + * return ranks.T + * else: + * return ranks # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XDECREF(__pyx_v_in_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_7rank_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_6rank_2d_int64[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_7rank_2d_int64 = {__Pyx_NAMESTR("rank_2d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_7rank_2d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_6rank_2d_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_7rank_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + CYTHON_UNUSED PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_2d_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_int_0); + values[2] = ((PyObject *)__pyx_n_s_average); + + /* "pandas/algos.pyx":394 + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', + * ascending=True, na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)__pyx_n_s_keep); + values[5] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_axis = values[1]; + __pyx_v_ties_method = values[2]; + __pyx_v_ascending = values[3]; + __pyx_v_na_option = values[4]; + __pyx_v_pct = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_2d_int64", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_6rank_2d_int64(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_6rank_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_z; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_argsorted = 0; + PyArrayObject *__pyx_v_values = 0; + __pyx_t_5numpy_int64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + float __pyx_v_count; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyArrayObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + __pyx_t_5numpy_int64_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + __pyx_t_5numpy_int64_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + __pyx_t_5numpy_int64_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + __pyx_t_5numpy_int64_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + __pyx_t_5numpy_int64_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_int64_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_2d_int64", 0); + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + + /* "pandas/algos.pyx":400 + * + * cdef: + * Py_ssize_t i, j, z, k, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] ranks + * ndarray[int64_t, ndim=2] argsorted + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":405 + * ndarray[int64_t, ndim=2, cast=True] values + * int64_t val + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * float count = 0.0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":406 + * int64_t val + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":407 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * tiebreak = tiebreakers[ties_method] + * + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":408 + * int tiebreak = 0 + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * if axis == 0: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":410 + * tiebreak = tiebreakers[ties_method] + * + * if axis == 0: # <<<<<<<<<<<<<< + * values = np.asarray(in_arr).T + * else: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":411 + * + * if axis == 0: + * values = np.asarray(in_arr).T # <<<<<<<<<<<<<< + * else: + * values = np.asarray(in_arr) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":413 + * values = np.asarray(in_arr).T + * else: + * values = np.asarray(in_arr) # <<<<<<<<<<<<<< + * + * n, k = ( values).shape + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "pandas/algos.pyx":415 + * values = np.asarray(in_arr) + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * ranks = np.empty((n, k), dtype='f8') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_n = __pyx_t_12; + __pyx_v_k = __pyx_t_13; + + /* "pandas/algos.pyx":416 + * + * n, k = ( values).shape + * ranks = np.empty((n, k), dtype='f8') # <<<<<<<<<<<<<< + * + * if tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":418 + * ranks = np.empty((n, k), dtype='f8') + * + * if tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') + */ + __pyx_t_4 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":420 + * if tiebreak == TIEBREAK_FIRST: + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') # <<<<<<<<<<<<<< + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_axis, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v__as = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":421 + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') + * if not ascending: # <<<<<<<<<<<<<< + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((!__pyx_t_4) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":422 + * _as = values.argsort(axis=1, kind='mergesort') + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING # <<<<<<<<<<<<<< + * else: + * _as = values.argsort(1) + */ + __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/algos.pyx":424 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v__as = __pyx_t_10; + __pyx_t_10 = 0; + } + __pyx_L6:; + + /* "pandas/algos.pyx":426 + * _as = values.argsort(1) + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[:, ::-1] + * + */ + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((!__pyx_t_15) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":427 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_int64(values, _as) + */ + __pyx_t_10 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__15); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_10); + __pyx_t_10 = 0; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":429 + * _as = _as[:, ::-1] + * + * values = _take_2d_int64(values, _as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_10 = __pyx_f_6pandas_5algos__take_2d_int64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_10)); + __pyx_t_10 = 0; + + /* "pandas/algos.pyx":430 + * + * values = _take_2d_int64(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":432 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * dups = sum_ranks = 0 + * total_tie_count = 0 + */ + __pyx_t_13 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/algos.pyx":433 + * + * for i in range(n): + * dups = sum_ranks = 0 # <<<<<<<<<<<<<< + * total_tie_count = 0 + * count = 0.0 + */ + __pyx_v_dups = 0; + __pyx_v_sum_ranks = 0; + + /* "pandas/algos.pyx":434 + * for i in range(n): + * dups = sum_ranks = 0 + * total_tie_count = 0 # <<<<<<<<<<<<<< + * count = 0.0 + * for j in range(k): + */ + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":435 + * dups = sum_ranks = 0 + * total_tie_count = 0 + * count = 0.0 # <<<<<<<<<<<<<< + * for j in range(k): + * sum_ranks += j + 1 + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":436 + * total_tie_count = 0 + * count = 0.0 + * for j in range(k): # <<<<<<<<<<<<<< + * sum_ranks += j + 1 + * dups += 1 + */ + __pyx_t_17 = __pyx_v_k; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_j = __pyx_t_18; + + /* "pandas/algos.pyx":437 + * count = 0.0 + * for j in range(k): + * sum_ranks += j + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = values[i, j] + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_j + 1)); + + /* "pandas/algos.pyx":438 + * for j in range(k): + * sum_ranks += j + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = values[i, j] + * count += 1.0 + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":439 + * sum_ranks += j + 1 + * dups += 1 + * val = values[i, j] # <<<<<<<<<<<<<< + * count += 1.0 + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/algos.pyx":440 + * dups += 1 + * val = values[i, j] + * count += 1.0 # <<<<<<<<<<<<<< + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":441 + * val = values[i, j] + * count += 1.0 + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_4 = ((__pyx_v_j == (__pyx_v_k - 1)) != 0); + if (!__pyx_t_4) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = ((fabs(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)) - __pyx_v_val)) > __pyx_v_6pandas_5algos_FP_ERR) != 0); + __pyx_t_23 = __pyx_t_15; + } else { + __pyx_t_23 = __pyx_t_4; + } + if (__pyx_t_23) { + + /* "pandas/algos.pyx":442 + * count += 1.0 + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":443 + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":444 + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":445 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":446 + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":447 + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":448 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":449 + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":450 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":451 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":452 + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":453 + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_z + 1); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":454 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":455 + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":456 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_43 < 0) { + __pyx_t_43 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":457 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":458 + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":459 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":460 + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_46 = __pyx_v_i; + __pyx_t_47 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_46 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_47 < 0) { + __pyx_t_47 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_48 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_49 < 0) { + __pyx_t_49 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/algos.pyx":461 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * ranks[i, :] /= count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/algos.pyx":462 + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * ranks[i, :] /= count + * if axis == 0: + */ + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_23 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_23) { + + /* "pandas/algos.pyx":463 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_slice__17); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_slice__17); + __Pyx_GIVEREF(__pyx_slice__17); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_10); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_10, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L27; + } + __pyx_L27:; + } + + /* "pandas/algos.pyx":464 + * if pct: + * ranks[i, :] /= count + * if axis == 0: # <<<<<<<<<<<<<< + * return ranks.T + * else: + */ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_23 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_23) { + + /* "pandas/algos.pyx":465 + * ranks[i, :] /= count + * if axis == 0: + * return ranks.T # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":467 + * return ranks.T + * else: + * return ranks # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_9rank_1d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_8rank_1d_generic[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_9rank_1d_generic = {__Pyx_NAMESTR("rank_1d_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_9rank_1d_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_8rank_1d_generic)}; +static PyObject *__pyx_pw_6pandas_5algos_9rank_1d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + int __pyx_v_retry; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_1d_generic (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_retry,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[2] = ((PyObject *)__pyx_n_s_average); + + /* "pandas/algos.pyx":471 + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', + * ascending=True, na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)__pyx_n_s_keep); + values[5] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_retry); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + if (values[1]) { + __pyx_v_retry = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_retry == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_retry = ((int)1); + } + __pyx_v_ties_method = values[2]; + __pyx_v_ascending = values[3]; + __pyx_v_na_option = values[4]; + __pyx_v_pct = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_1d_generic", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_8rank_1d_generic(__pyx_self, __pyx_v_in_arr, __pyx_v_retry, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_8rank_1d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, int __pyx_v_retry, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_sorted_data = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_argsorted = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_nan_value = 0; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + int __pyx_v_keep_na; + float __pyx_v_count; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_v__as = NULL; + PyObject *__pyx_v_valid_locs = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + PyArrayObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + __pyx_t_5numpy_int64_t __pyx_t_20; + int __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + __pyx_t_5numpy_int64_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + __pyx_t_5numpy_int64_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + __pyx_t_5numpy_int64_t __pyx_t_31; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_1d_generic", 0); + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":477 + * + * cdef: + * Py_ssize_t i, j, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t] ranks + * ndarray sorted_data, values + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":482 + * ndarray[int64_t] argsorted + * object val, nan_value + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * bint keep_na = 0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":483 + * object val, nan_value + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * bint keep_na = 0 + * float count = 0.0 + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":484 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * bint keep_na = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * + */ + __pyx_v_keep_na = 0; + + /* "pandas/algos.pyx":485 + * int tiebreak = 0 + * bint keep_na = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":488 + * + * + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * keep_na = na_option == 'keep' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":490 + * tiebreak = tiebreakers[ties_method] + * + * keep_na = na_option == 'keep' # <<<<<<<<<<<<<< + * + * values = np.array(in_arr, copy=True) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_keep_na = __pyx_t_4; + + /* "pandas/algos.pyx":492 + * keep_na = na_option == 'keep' + * + * values = np.array(in_arr, copy=True) # <<<<<<<<<<<<<< + * + * if values.dtype != np.object_: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_values = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/algos.pyx":494 + * values = np.array(in_arr, copy=True) + * + * if values.dtype != np.object_: # <<<<<<<<<<<<<< + * values = values.astype('O') + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":495 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/algos.pyx":497 + * values = values.astype('O') + * + * if ascending ^ (na_option == 'top'): # <<<<<<<<<<<<<< + * # always greater than everything + * nan_value = Infinity() + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":499 + * if ascending ^ (na_option == 'top'): + * # always greater than everything + * nan_value = Infinity() # <<<<<<<<<<<<<< + * else: + * nan_value = NegInfinity() + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Infinity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_nan_value = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":501 + * nan_value = Infinity() + * else: + * nan_value = NegInfinity() # <<<<<<<<<<<<<< + * + * mask = lib.isnullobj(values) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NegInfinity); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nan_value = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L4:; + + /* "pandas/algos.pyx":503 + * nan_value = NegInfinity() + * + * mask = lib.isnullobj(values) # <<<<<<<<<<<<<< + * np.putmask(values, mask, nan_value) + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnullobj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_mask = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/algos.pyx":504 + * + * mask = lib.isnullobj(values) + * np.putmask(values, mask, nan_value) # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + __Pyx_INCREF(__pyx_v_nan_value); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_nan_value); + __Pyx_GIVEREF(__pyx_v_nan_value); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":506 + * np.putmask(values, mask, nan_value) + * + * n = len(values) # <<<<<<<<<<<<<< + * ranks = np.empty(n, dtype='f8') + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_7; + + /* "pandas/algos.pyx":507 + * + * n = len(values) + * ranks = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * + * # py2.5/win32 hack, can't pass i8 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":510 + * + * # py2.5/win32 hack, can't pass i8 + * try: # <<<<<<<<<<<<<< + * _as = values.argsort() + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/algos.pyx":511 + * # py2.5/win32 hack, can't pass i8 + * try: + * _as = values.argsort() # <<<<<<<<<<<<<< + * except TypeError: + * if not retry: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_2; + __pyx_t_2 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":512 + * try: + * _as = values.argsort() + * except TypeError: # <<<<<<<<<<<<<< + * if not retry: + * raise + */ + __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_3) { + __Pyx_AddTraceback("pandas.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/algos.pyx":513 + * _as = values.argsort() + * except TypeError: + * if not retry: # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_4 = ((!(__pyx_v_retry != 0)) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":514 + * except TypeError: + * if not retry: + * raise # <<<<<<<<<<<<<< + * + * valid_locs = (~mask).nonzero()[0] + */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_5); + __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + } + + /* "pandas/algos.pyx":516 + * raise + * + * valid_locs = (~mask).nonzero()[0] # <<<<<<<<<<<<<< + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, + * ties_method=ties_method, + */ + __pyx_t_6 = PyNumber_Invert(__pyx_v_mask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}; + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_valid_locs = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/algos.pyx":517 + * + * valid_locs = (~mask).nonzero()[0] + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, # <<<<<<<<<<<<<< + * ties_method=ties_method, + * ascending=ascending)) + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_put); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_generic); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_valid_locs); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_valid_locs); + __Pyx_GIVEREF(__pyx_v_valid_locs); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_15 = 0; + __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/algos.pyx":518 + * valid_locs = (~mask).nonzero()[0] + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, + * ties_method=ties_method, # <<<<<<<<<<<<<< + * ascending=ascending)) + * np.putmask(ranks, mask, np.nan) + */ + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_ties_method, __pyx_v_ties_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + + /* "pandas/algos.pyx":519 + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, + * ties_method=ties_method, + * ascending=ascending)) # <<<<<<<<<<<<<< + * np.putmask(ranks, mask, np.nan) + * return ranks + */ + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_ascending, __pyx_v_ascending) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + + /* "pandas/algos.pyx":517 + * + * valid_locs = (~mask).nonzero()[0] + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, # <<<<<<<<<<<<<< + * ties_method=ties_method, + * ascending=ascending)) + */ + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_valid_locs); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_valid_locs); + __Pyx_GIVEREF(__pyx_v_valid_locs); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":520 + * ties_method=ties_method, + * ascending=ascending)) + * np.putmask(ranks, mask, np.nan) # <<<<<<<<<<<<<< + * return ranks + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_putmask); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_ranks)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_ranks)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":521 + * ascending=ascending)) + * np.putmask(ranks, mask, np.nan) + * return ranks # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L8_except_return; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L6_exception_handled; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L8_except_return:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L0; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + __pyx_L12_try_end:; + } + + /* "pandas/algos.pyx":523 + * return ranks + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[::-1] + * + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((!__pyx_t_4) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":524 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v__as, __pyx_slice__19); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/algos.pyx":526 + * _as = _as[::-1] + * + * sorted_data = values.take(_as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * for i in range(n): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__as); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__as); + __Pyx_GIVEREF(__pyx_v__as); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":527 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * sum_ranks += i + 1 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":528 + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') + * for i in range(n): # <<<<<<<<<<<<<< + * sum_ranks += i + 1 + * dups += 1 + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_7; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + + /* "pandas/algos.pyx":529 + * argsorted = _as.astype('i8') + * for i in range(n): + * sum_ranks += i + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = util.get_value_at(sorted_data, i) + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1)); + + /* "pandas/algos.pyx":530 + * for i in range(n): + * sum_ranks += i + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = util.get_value_at(sorted_data, i) + * if val is nan_value and keep_na: + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":531 + * sum_ranks += i + 1 + * dups += 1 + * val = util.get_value_at(sorted_data, i) # <<<<<<<<<<<<<< + * if val is nan_value and keep_na: + * ranks[argsorted[i]] = nan + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_sorted_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":532 + * dups += 1 + * val = util.get_value_at(sorted_data, i) + * if val is nan_value and keep_na: # <<<<<<<<<<<<<< + * ranks[argsorted[i]] = nan + * continue + */ + __pyx_t_16 = (__pyx_v_val == __pyx_v_nan_value); + if ((__pyx_t_16 != 0)) { + __pyx_t_4 = (__pyx_v_keep_na != 0); + } else { + __pyx_t_4 = (__pyx_t_16 != 0); + } + if (__pyx_t_4) { + + /* "pandas/algos.pyx":533 + * val = util.get_value_at(sorted_data, i) + * if val is nan_value and keep_na: + * ranks[argsorted[i]] = nan # <<<<<<<<<<<<<< + * continue + * if (i == n - 1 or + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_6pandas_5algos_nan; + + /* "pandas/algos.pyx":534 + * if val is nan_value and keep_na: + * ranks[argsorted[i]] = nan + * continue # <<<<<<<<<<<<<< + * if (i == n - 1 or + * are_diff(util.get_value_at(sorted_data, i + 1), val)): + */ + goto __pyx_L17_continue; + } + + /* "pandas/algos.pyx":535 + * ranks[argsorted[i]] = nan + * continue + * if (i == n - 1 or # <<<<<<<<<<<<<< + * are_diff(util.get_value_at(sorted_data, i + 1), val)): + * count += 1.0 + */ + __pyx_t_4 = (__pyx_v_i == (__pyx_v_n - 1)); + if (!__pyx_t_4) { + + /* "pandas/algos.pyx":536 + * continue + * if (i == n - 1 or + * are_diff(util.get_value_at(sorted_data, i + 1), val)): # <<<<<<<<<<<<<< + * count += 1.0 + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_i + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_f_4util_get_value_at(__pyx_v_sorted_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_f_6pandas_5algos_are_diff(__pyx_t_1, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_21 = __pyx_t_16; + } else { + __pyx_t_21 = __pyx_t_4; + } + if (__pyx_t_21) { + + /* "pandas/algos.pyx":537 + * if (i == n - 1 or + * are_diff(util.get_value_at(sorted_data, i + 1), val)): + * count += 1.0 # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":538 + * are_diff(util.get_value_at(sorted_data, i + 1), val)): + * count += 1.0 + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":539 + * count += 1.0 + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_22 = (__pyx_v_i + 1); + for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "pandas/algos.pyx":540 + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L21; + } + + /* "pandas/algos.pyx":541 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":542 + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_22 = (__pyx_v_i + 1); + for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "pandas/algos.pyx":543 + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_27 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2); + } + goto __pyx_L21; + } + + /* "pandas/algos.pyx":544 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":545 + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_22 = (__pyx_v_i + 1); + for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "pandas/algos.pyx":546 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for non-numeric data') + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1); + } + goto __pyx_L21; + } + + /* "pandas/algos.pyx":547 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * raise ValueError('first not supported for non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":548 + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for non-numeric data') # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":549 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":550 + * raise ValueError('first not supported for non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":551 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_22 = (__pyx_v_i + 1); + for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "pandas/algos.pyx":552 + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_31 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/algos.pyx":553 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * return ranks / count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L20; + } + __pyx_L20:; + __pyx_L17_continue:; + } + + /* "pandas/algos.pyx":554 + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * return ranks / count + * else: + */ + __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_21) { + + /* "pandas/algos.pyx":555 + * sum_ranks = dups = 0 + * if pct: + * return ranks / count # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":557 + * return ranks / count + * else: + * return ranks # <<<<<<<<<<<<<< + * + * cdef inline are_diff(object left, object right): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_nan_value); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XDECREF(__pyx_v_valid_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":559 + * return ranks + * + * cdef inline are_diff(object left, object right): # <<<<<<<<<<<<<< + * try: + * return fabs(left - right) > FP_ERR + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_are_diff(PyObject *__pyx_v_left, PyObject *__pyx_v_right) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + double __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("are_diff", 0); + + /* "pandas/algos.pyx":560 + * + * cdef inline are_diff(object left, object right): + * try: # <<<<<<<<<<<<<< + * return fabs(left - right) > FP_ERR + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/algos.pyx":561 + * cdef inline are_diff(object left, object right): + * try: + * return fabs(left - right) > FP_ERR # <<<<<<<<<<<<<< + * except TypeError: + * return left != right + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyNumber_Subtract(__pyx_v_left, __pyx_v_right); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong((fabs(__pyx_t_5) > __pyx_v_6pandas_5algos_FP_ERR)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/algos.pyx":562 + * try: + * return fabs(left - right) > FP_ERR + * except TypeError: # <<<<<<<<<<<<<< + * return left != right + * + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_6) { + __Pyx_AddTraceback("pandas.algos.are_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/algos.pyx":563 + * return fabs(left - right) > FP_ERR + * except TypeError: + * return left != right # <<<<<<<<<<<<<< + * + * _return_false = lambda self, other: False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_left, __pyx_v_right, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/algos.pyx":559 + * return ranks + * + * cdef inline are_diff(object left, object right): # <<<<<<<<<<<<<< + * try: + * return fabs(left - right) > FP_ERR + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.algos.are_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_11rank_2d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_10rank_2d_generic[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_11rank_2d_generic = {__Pyx_NAMESTR("rank_2d_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_11rank_2d_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_10rank_2d_generic)}; +static PyObject *__pyx_pw_6pandas_5algos_11rank_2d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_2d_generic (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_int_0); + values[2] = ((PyObject *)__pyx_n_s_average); + + /* "pandas/algos.pyx":589 + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', + * ascending=True, na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)__pyx_n_s_keep); + values[5] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_axis = values[1]; + __pyx_v_ties_method = values[2]; + __pyx_v_ascending = values[3]; + __pyx_v_na_option = values[4]; + __pyx_v_pct = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_2d_generic", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_10rank_2d_generic(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_10rank_2d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_z; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_infs; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_argsorted = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_nan_value = 0; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + int __pyx_v_keep_na; + float __pyx_v_count; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_t_21; + PyArrayObject *__pyx_t_22 = NULL; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + int __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + __pyx_t_5numpy_int64_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + __pyx_t_5numpy_int64_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + __pyx_t_5numpy_int64_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + __pyx_t_5numpy_int64_t __pyx_t_51; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_2d_generic", 0); + __Pyx_INCREF(__pyx_v_in_arr); + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":595 + * + * cdef: + * Py_ssize_t i, j, z, k, n, infs, dups = 0 # <<<<<<<<<<<<<< + * Py_ssize_t total_tie_count = 0 + * ndarray[float64_t, ndim=2] ranks + */ + __pyx_v_dups = 0; + + /* "pandas/algos.pyx":596 + * cdef: + * Py_ssize_t i, j, z, k, n, infs, dups = 0 + * Py_ssize_t total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] ranks + * ndarray[object, ndim=2] values + */ + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":601 + * ndarray[int64_t, ndim=2] argsorted + * object val, nan_value + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * bint keep_na = 0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":602 + * object val, nan_value + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * bint keep_na = 0 + * float count = 0.0 + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":603 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * bint keep_na = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * + */ + __pyx_v_keep_na = 0; + + /* "pandas/algos.pyx":604 + * int tiebreak = 0 + * bint keep_na = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":606 + * float count = 0.0 + * + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * keep_na = na_option == 'keep' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":608 + * tiebreak = tiebreakers[ties_method] + * + * keep_na = na_option == 'keep' # <<<<<<<<<<<<<< + * + * in_arr = np.asarray(in_arr) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_keep_na = __pyx_t_4; + + /* "pandas/algos.pyx":610 + * keep_na = na_option == 'keep' + * + * in_arr = np.asarray(in_arr) # <<<<<<<<<<<<<< + * + * if axis == 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_in_arr, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":612 + * in_arr = np.asarray(in_arr) + * + * if axis == 0: # <<<<<<<<<<<<<< + * values = in_arr.T.copy() + * else: + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":613 + * + * if axis == 0: + * values = in_arr.T.copy() # <<<<<<<<<<<<<< + * else: + * values = in_arr.copy() + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":615 + * values = in_arr.T.copy() + * else: + * values = in_arr.copy() # <<<<<<<<<<<<<< + * + * if values.dtype != np.object_: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "pandas/algos.pyx":617 + * values = in_arr.copy() + * + * if values.dtype != np.object_: # <<<<<<<<<<<<<< + * values = values.astype('O') + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":618 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/algos.pyx":620 + * values = values.astype('O') + * + * if ascending ^ (na_option == 'top'): # <<<<<<<<<<<<<< + * # always greater than everything + * nan_value = Infinity() + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":622 + * if ascending ^ (na_option == 'top'): + * # always greater than everything + * nan_value = Infinity() # <<<<<<<<<<<<<< + * else: + * nan_value = NegInfinity() + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Infinity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_nan_value = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/algos.pyx":624 + * nan_value = Infinity() + * else: + * nan_value = NegInfinity() # <<<<<<<<<<<<<< + * + * mask = lib.isnullobj2d(values) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NegInfinity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_nan_value = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L5:; + + /* "pandas/algos.pyx":626 + * nan_value = NegInfinity() + * + * mask = lib.isnullobj2d(values) # <<<<<<<<<<<<<< + * np.putmask(values, mask, nan_value) + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnullobj2d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_mask = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":627 + * + * mask = lib.isnullobj2d(values) + * np.putmask(values, mask, nan_value) # <<<<<<<<<<<<<< + * + * n, k = ( values).shape + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + __Pyx_INCREF(__pyx_v_nan_value); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_nan_value); + __Pyx_GIVEREF(__pyx_v_nan_value); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":629 + * np.putmask(values, mask, nan_value) + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * ranks = np.empty((n, k), dtype='f8') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_n = __pyx_t_12; + __pyx_v_k = __pyx_t_13; + + /* "pandas/algos.pyx":630 + * + * n, k = ( values).shape + * ranks = np.empty((n, k), dtype='f8') # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":632 + * ranks = np.empty((n, k), dtype='f8') + * + * try: # <<<<<<<<<<<<<< + * _as = values.argsort(1) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/algos.pyx":633 + * + * try: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * except TypeError: + * values = in_arr + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_10; + __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/algos.pyx":634 + * try: + * _as = values.argsort(1) + * except TypeError: # <<<<<<<<<<<<<< + * values = in_arr + * for i in range(len(values)): + */ + __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_3) { + __Pyx_AddTraceback("pandas.algos.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/algos.pyx":635 + * _as = values.argsort(1) + * except TypeError: + * values = in_arr # <<<<<<<<<<<<<< + * for i in range(len(values)): + * ranks[i] = rank_1d_generic(in_arr[i], + */ + if (!(likely(((__pyx_v_in_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_in_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __pyx_t_5 = __pyx_v_in_arr; + __Pyx_INCREF(__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + } + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":636 + * except TypeError: + * values = in_arr + * for i in range(len(values)): # <<<<<<<<<<<<<< + * ranks[i] = rank_1d_generic(in_arr[i], + * ties_method=ties_method, + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/algos.pyx":637 + * values = in_arr + * for i in range(len(values)): + * ranks[i] = rank_1d_generic(in_arr[i], # <<<<<<<<<<<<<< + * ties_method=ties_method, + * ascending=ascending, + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_generic); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_in_arr, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}; + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_18); + + /* "pandas/algos.pyx":638 + * for i in range(len(values)): + * ranks[i] = rank_1d_generic(in_arr[i], + * ties_method=ties_method, # <<<<<<<<<<<<<< + * ascending=ascending, + * pct=pct) + */ + if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_ties_method, __pyx_v_ties_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + + /* "pandas/algos.pyx":639 + * ranks[i] = rank_1d_generic(in_arr[i], + * ties_method=ties_method, + * ascending=ascending, # <<<<<<<<<<<<<< + * pct=pct) + * if axis == 0: + */ + if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_ascending, __pyx_v_ascending) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + + /* "pandas/algos.pyx":640 + * ties_method=ties_method, + * ascending=ascending, + * pct=pct) # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_pct, __pyx_v_pct) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + + /* "pandas/algos.pyx":637 + * values = in_arr + * for i in range(len(values)): + * ranks[i] = rank_1d_generic(in_arr[i], # <<<<<<<<<<<<<< + * ties_method=ties_method, + * ascending=ascending, + */ + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_19, __pyx_t_18); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_ranks), __pyx_v_i, __pyx_t_20, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + } + + /* "pandas/algos.pyx":641 + * ascending=ascending, + * pct=pct) + * if axis == 0: # <<<<<<<<<<<<<< + * return ranks.T + * else: + */ + __pyx_t_20 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":642 + * pct=pct) + * if axis == 0: + * return ranks.T # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_r = __pyx_t_20; + __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L11_except_return; + } + /*else*/ { + + /* "pandas/algos.pyx":644 + * return ranks.T + * else: + * return ranks # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L11_except_return; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L11_except_return:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L0; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L15_try_end:; + } + + /* "pandas/algos.pyx":646 + * return ranks + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[:, ::-1] + * + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((!__pyx_t_4) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":647 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_object(values, _as) + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__26); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/algos.pyx":649 + * _as = _as[:, ::-1] + * + * values = _take_2d_object(values, _as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_2 = __pyx_f_6pandas_5algos__take_2d_object(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":650 + * + * values = _take_2d_object(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":652 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * dups = sum_ranks = infs = 0 + * total_tie_count = 0 + */ + __pyx_t_13 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/algos.pyx":653 + * + * for i in range(n): + * dups = sum_ranks = infs = 0 # <<<<<<<<<<<<<< + * total_tie_count = 0 + * count = 0.0 + */ + __pyx_v_dups = 0; + __pyx_v_sum_ranks = 0; + __pyx_v_infs = 0; + + /* "pandas/algos.pyx":654 + * for i in range(n): + * dups = sum_ranks = infs = 0 + * total_tie_count = 0 # <<<<<<<<<<<<<< + * count = 0.0 + * for j in range(k): + */ + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":655 + * dups = sum_ranks = infs = 0 + * total_tie_count = 0 + * count = 0.0 # <<<<<<<<<<<<<< + * for j in range(k): + * val = values[i, j] + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":656 + * total_tie_count = 0 + * count = 0.0 + * for j in range(k): # <<<<<<<<<<<<<< + * val = values[i, j] + * if val is nan_value and keep_na: + */ + __pyx_t_23 = __pyx_v_k; + for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { + __pyx_v_j = __pyx_t_24; + + /* "pandas/algos.pyx":657 + * count = 0.0 + * for j in range(k): + * val = values[i, j] # <<<<<<<<<<<<<< + * if val is nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_26 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":658 + * for j in range(k): + * val = values[i, j] + * if val is nan_value and keep_na: # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, j]] = nan + * infs += 1 + */ + __pyx_t_21 = (__pyx_v_val == __pyx_v_nan_value); + if ((__pyx_t_21 != 0)) { + __pyx_t_4 = (__pyx_v_keep_na != 0); + } else { + __pyx_t_4 = (__pyx_t_21 != 0); + } + if (__pyx_t_4) { + + /* "pandas/algos.pyx":659 + * val = values[i, j] + * if val is nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan # <<<<<<<<<<<<<< + * infs += 1 + * continue + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + + /* "pandas/algos.pyx":660 + * if val is nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan + * infs += 1 # <<<<<<<<<<<<<< + * continue + * count += 1.0 + */ + __pyx_v_infs = (__pyx_v_infs + 1); + + /* "pandas/algos.pyx":661 + * ranks[i, argsorted[i, j]] = nan + * infs += 1 + * continue # <<<<<<<<<<<<<< + * count += 1.0 + * sum_ranks += (j - infs) + 1 + */ + goto __pyx_L24_continue; + } + + /* "pandas/algos.pyx":662 + * infs += 1 + * continue + * count += 1.0 # <<<<<<<<<<<<<< + * sum_ranks += (j - infs) + 1 + * dups += 1 + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":663 + * continue + * count += 1.0 + * sum_ranks += (j - infs) + 1 # <<<<<<<<<<<<<< + * dups += 1 + * if j == k - 1 or are_diff(values[i, j + 1], val): + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + ((__pyx_v_j - __pyx_v_infs) + 1)); + + /* "pandas/algos.pyx":664 + * count += 1.0 + * sum_ranks += (j - infs) + 1 + * dups += 1 # <<<<<<<<<<<<<< + * if j == k - 1 or are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":665 + * sum_ranks += (j - infs) + 1 + * dups += 1 + * if j == k - 1 or are_diff(values[i, j + 1], val): # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_4 = (__pyx_v_j == (__pyx_v_k - 1)); + if (!__pyx_t_4) { + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_2 = __pyx_f_6pandas_5algos_are_diff(__pyx_t_1, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_33 = __pyx_t_21; + } else { + __pyx_t_33 = __pyx_t_4; + } + if (__pyx_t_33) { + + /* "pandas/algos.pyx":666 + * dups += 1 + * if j == k - 1 or are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":667 + * if j == k - 1 or are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_34 = (__pyx_v_j + 1); + for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_z = __pyx_t_35; + + /* "pandas/algos.pyx":668 + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L28; + } + + /* "pandas/algos.pyx":669 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":670 + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_34 = (__pyx_v_j + 1); + for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_z = __pyx_t_35; + + /* "pandas/algos.pyx":671 + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_43 < 0) { + __pyx_t_43 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2); + } + goto __pyx_L28; + } + + /* "pandas/algos.pyx":672 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":673 + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_34 = (__pyx_v_j + 1); + for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_z = __pyx_t_35; + + /* "pandas/algos.pyx":674 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for ' + */ + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_46 = __pyx_v_i; + __pyx_t_47 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_46 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_47 < 0) { + __pyx_t_47 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1); + } + goto __pyx_L28; + } + + /* "pandas/algos.pyx":675 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * raise ValueError('first not supported for ' + * 'non-numeric data') + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":676 + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for ' # <<<<<<<<<<<<<< + * 'non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":678 + * raise ValueError('first not supported for ' + * 'non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":679 + * 'non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":680 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_34 = (__pyx_v_j + 1); + for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_z = __pyx_t_35; + + /* "pandas/algos.pyx":681 + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_48 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_49 < 0) { + __pyx_t_49 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_50 = __pyx_v_i; + __pyx_t_51 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_50 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_50 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_51 < 0) { + __pyx_t_51 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_51 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L28; + } + __pyx_L28:; + + /* "pandas/algos.pyx":682 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * ranks[i, :] /= count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L27; + } + __pyx_L27:; + __pyx_L24_continue:; + } + + /* "pandas/algos.pyx":683 + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * ranks[i, :] /= count + * if axis == 0: + */ + __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_33 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_33) { + + /* "pandas/algos.pyx":684 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_slice__29); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_20 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_1, __pyx_t_20) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L37; + } + __pyx_L37:; + } + + /* "pandas/algos.pyx":685 + * if pct: + * ranks[i, :] /= count + * if axis == 0: # <<<<<<<<<<<<<< + * return ranks.T + * else: + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_33 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_33) { + + /* "pandas/algos.pyx":686 + * ranks[i, :] /= count + * if axis == 0: + * return ranks.T # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":688 + * return ranks.T + * else: + * return ranks # <<<<<<<<<<<<<< + * + * # def _take_indexer_2d(ndarray[float64_t, ndim=2] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_nan_value); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XDECREF(__pyx_v_in_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":715 + * # - + * + * def _check_minp(win, minp, N): # <<<<<<<<<<<<<< + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_13_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_13_check_minp = {__Pyx_NAMESTR("_check_minp"), (PyCFunction)__pyx_pw_6pandas_5algos_13_check_minp, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_13_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_win = 0; + PyObject *__pyx_v_minp = 0; + PyObject *__pyx_v_N = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_minp (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_N,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_minp") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_win = values[0]; + __pyx_v_minp = values[1]; + __pyx_v_N = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_12_check_minp(__pyx_self, __pyx_v_win, __pyx_v_minp, __pyx_v_N); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_12_check_minp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_N) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_minp", 0); + __Pyx_INCREF(__pyx_v_minp); + + /* "pandas/algos.pyx":716 + * + * def _check_minp(win, minp, N): + * if minp > win: # <<<<<<<<<<<<<< + * raise ValueError('min_periods (%d) must be <= window (%d)' + * % (minp, win)) + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_win, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/algos.pyx":718 + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + * % (minp, win)) # <<<<<<<<<<<<<< + * elif minp > N: + * minp = N + 1 + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_minp); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_minp); + __Pyx_GIVEREF(__pyx_v_minp); + __Pyx_INCREF(__pyx_v_win); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_win); + __Pyx_GIVEREF(__pyx_v_win); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_min_periods_d_must_be_window_d, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":717 + * def _check_minp(win, minp, N): + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' # <<<<<<<<<<<<<< + * % (minp, win)) + * elif minp > N: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":719 + * raise ValueError('min_periods (%d) must be <= window (%d)' + * % (minp, win)) + * elif minp > N: # <<<<<<<<<<<<<< + * minp = N + 1 + * elif minp == 0: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_N, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/algos.pyx":720 + * % (minp, win)) + * elif minp > N: + * minp = N + 1 # <<<<<<<<<<<<<< + * elif minp == 0: + * minp = 1 + */ + __pyx_t_3 = PyNumber_Add(__pyx_v_N, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_minp, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + + /* "pandas/algos.pyx":721 + * elif minp > N: + * minp = N + 1 + * elif minp == 0: # <<<<<<<<<<<<<< + * minp = 1 + * elif minp < 0: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/algos.pyx":722 + * minp = N + 1 + * elif minp == 0: + * minp = 1 # <<<<<<<<<<<<<< + * elif minp < 0: + * raise ValueError('min_periods must be >= 0') + */ + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF_SET(__pyx_v_minp, __pyx_int_1); + goto __pyx_L3; + } + + /* "pandas/algos.pyx":723 + * elif minp == 0: + * minp = 1 + * elif minp < 0: # <<<<<<<<<<<<<< + * raise ValueError('min_periods must be >= 0') + * return minp + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/algos.pyx":724 + * minp = 1 + * elif minp < 0: + * raise ValueError('min_periods must be >= 0') # <<<<<<<<<<<<<< + * return minp + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/algos.pyx":725 + * elif minp < 0: + * raise ValueError('min_periods must be >= 0') + * return minp # <<<<<<<<<<<<<< + * + * # original C implementation by N. Devillard. + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_minp); + __pyx_r = __pyx_v_minp; + goto __pyx_L0; + + /* "pandas/algos.pyx":715 + * # - + * + * def _check_minp(win, minp, N): # <<<<<<<<<<<<<< + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.algos._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_minp); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_0__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int8_t *__pyx_v_a, __pyx_t_5numpy_int8_t *__pyx_v_b) { + __pyx_t_5numpy_int8_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_0swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_1__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int16_t *__pyx_v_a, __pyx_t_5numpy_int16_t *__pyx_v_b) { + __pyx_t_5numpy_int16_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_1swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_2__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int32_t *__pyx_v_a, __pyx_t_5numpy_int32_t *__pyx_v_b) { + __pyx_t_5numpy_int32_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_2swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_3__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int64_t *__pyx_v_a, __pyx_t_5numpy_int64_t *__pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_3swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_4__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint8_t *__pyx_v_a, __pyx_t_5numpy_uint8_t *__pyx_v_b) { + __pyx_t_5numpy_uint8_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_4swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_5__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint16_t *__pyx_v_a, __pyx_t_5numpy_uint16_t *__pyx_v_b) { + __pyx_t_5numpy_uint16_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_5swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_6__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint32_t *__pyx_v_a, __pyx_t_5numpy_uint32_t *__pyx_v_b) { + __pyx_t_5numpy_uint32_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_6swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_7__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint64_t *__pyx_v_a, __pyx_t_5numpy_uint64_t *__pyx_v_b) { + __pyx_t_5numpy_uint64_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_7swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_8__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float32_t *__pyx_v_a, __pyx_t_5numpy_float32_t *__pyx_v_b) { + __pyx_t_5numpy_float32_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_8swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_9__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float64_t *__pyx_v_a, __pyx_t_5numpy_float64_t *__pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_9swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_15kth_smallest = {__Pyx_NAMESTR("kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_15kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_signatures = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + CYTHON_UNUSED PyObject *__pyx_v_defaults = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_signatures = values[0]; + __pyx_v_args = values[1]; + __pyx_v_kwargs = values[2]; + __pyx_v_defaults = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_14kth_smallest(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_14kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { + PyObject *__pyx_v_dest_sig = NULL; + PyObject *__pyx_v_numpy = NULL; + __Pyx_memviewslice __pyx_v_memslice; + Py_ssize_t __pyx_v_itemsize; + int __pyx_v_dtype_signed; + char __pyx_v_kind; + int __pyx_v____pyx_uint8_t_is_signed; + int __pyx_v____pyx_uint64_t_is_signed; + int __pyx_v____pyx_uint16_t_is_signed; + int __pyx_v____pyx_uint32_t_is_signed; + int __pyx_v____pyx_int8_t_is_signed; + int __pyx_v____pyx_int16_t_is_signed; + int __pyx_v____pyx_int32_t_is_signed; + int __pyx_v____pyx_int64_t_is_signed; + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_v_dtype = NULL; + PyObject *__pyx_v_candidates = NULL; + PyObject *__pyx_v_sig = NULL; + int __pyx_v_match_found; + PyObject *__pyx_v_src_type = NULL; + PyObject *__pyx_v_dst_type = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + char __pyx_t_12; + int __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *(*__pyx_t_20)(PyObject *); + int __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("kth_smallest", 0); + __Pyx_INCREF(__pyx_v_kwargs); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_v_dest_sig = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_v_kwargs == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_numpy = __pyx_t_1; + __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_numpy, Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L11_try_end:; + } + __pyx_v_itemsize = -1; + __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1) < 0); + __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1) < 0); + __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1) < 0); + __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1) < 0); + __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1) < 0); + __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0); + __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0); + __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0); + __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((0 < __pyx_t_10) != 0); + if (__pyx_t_3) { + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_arg = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_a, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + __pyx_t_9 = PyObject_GetItem(__pyx_v_kwargs, __pyx_n_s_a); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_arg = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + /*else*/ { + __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L14:; + if (0) { + goto __pyx_L15; + } + /*else*/ { + while (1) { + if (!1) break; + __pyx_t_2 = (__pyx_v_numpy != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_dtype = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L19; + } + __pyx_t_2 = (__pyx_memoryview_check(__pyx_v_arg) != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyObject_IsInstance(__pyx_t_8, __pyx_t_9); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_3 != 0); + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dtype = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L19; + } + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_dtype = Py_None; + } + __pyx_L19:; + __pyx_v_itemsize = -1; + __pyx_t_11 = (__pyx_v_dtype != Py_None); + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_itemsize = __pyx_t_10; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_12 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_12 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_kind = __pyx_t_12; + __pyx_t_8 = __Pyx_PyInt_From_char(__pyx_v_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_105, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dtype_signed = __pyx_t_2; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_9, __pyx_tuple__31, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_2 != 0); + if (__pyx_t_11) { + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_3 = ((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize); + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + goto __pyx_L21; + } + __pyx_L21:; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L18; + } + __pyx_L18:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L32; + } + __pyx_L32:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L34; + } + __pyx_L34:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L36; + } + __pyx_L36:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L38; + } + __pyx_L38:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L40; + } + __pyx_L40:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L42; + } + __pyx_L42:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L44; + } + __pyx_L44:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L46; + } + __pyx_L46:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L48; + } + __pyx_L48:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L50; + } + __pyx_L50:; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_L17_break:; + } + __pyx_L15:; + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_candidates = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + if (PyList_CheckExact(__pyx_v_signatures) || PyTuple_CheckExact(__pyx_v_signatures)) { + __pyx_t_9 = __pyx_v_signatures; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_signatures); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; + } + for (;;) { + if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_14(__pyx_t_9); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_v_match_found = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_dest_sig); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dest_sig); + __Pyx_GIVEREF(__pyx_v_dest_sig); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_16(__pyx_t_8); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_17 = PyList_GET_ITEM(sequence, 0); + __pyx_t_18 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(__pyx_t_18); + #else + __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; + index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_17); + index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_18); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L57_unpacking_done; + __pyx_L56_unpacking_failed:; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L57_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17); + __pyx_t_17 = 0; + __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_11 = (__pyx_v_dst_type != Py_None); + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + __pyx_v_match_found = 1; + goto __pyx_L59; + } + /*else*/ { + __pyx_v_match_found = 0; + goto __pyx_L55_break; + } + __pyx_L59:; + goto __pyx_L58; + } + __pyx_L58:; + } + __pyx_L55_break:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = (__pyx_v_match_found != 0); + if (__pyx_t_2) { + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L60; + } + __pyx_L60:; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0); + __pyx_t_11 = ((!__pyx_t_2) != 0); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((__pyx_t_10 > 1) != 0); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyObject_GetItem(__pyx_v_signatures, PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dest_sig); + __Pyx_XDECREF(__pyx_v_numpy); + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XDECREF(__pyx_v_dtype); + __Pyx_XDECREF(__pyx_v_candidates); + __Pyx_XDECREF(__pyx_v_sig); + __Pyx_XDECREF(__pyx_v_src_type); + __Pyx_XDECREF(__pyx_v_dst_type); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int8_t __pyx_v_x; + __pyx_t_5numpy_int8_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_0kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_0__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5algos_513__pyx_fuse_0kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_0kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_0kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_0kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int8(__pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int16_t __pyx_v_x; + __pyx_t_5numpy_int16_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_1kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_1__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5algos_515__pyx_fuse_1kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_1kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_1kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_1kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int16(__pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int32_t __pyx_v_x; + __pyx_t_5numpy_int32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_2kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_2__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5algos_517__pyx_fuse_2kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_2kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_2kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_2kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_x; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_3kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_3__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5algos_519__pyx_fuse_3kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_3kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_3kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_3kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint8_t __pyx_v_x; + __pyx_t_5numpy_uint8_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_4kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_4__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5algos_521__pyx_fuse_4kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_4kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_4kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_4kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_4kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint16_t __pyx_v_x; + __pyx_t_5numpy_uint16_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_5kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_5__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5algos_523__pyx_fuse_5kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_5kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_5kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_5kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_5kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint16(__pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint32_t __pyx_v_x; + __pyx_t_5numpy_uint32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_6kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_6__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5algos_525__pyx_fuse_6kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_6kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_6kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_6kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_6kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint64_t __pyx_v_x; + __pyx_t_5numpy_uint64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_7kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_7__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5algos_527__pyx_fuse_7kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_7kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_7kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_7kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_7kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float32_t __pyx_v_x; + __pyx_t_5numpy_float32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_8kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_8__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5algos_529__pyx_fuse_8kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_8kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_8kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_8kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_8kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_8kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_8kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t __pyx_v_x; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_9kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_9__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5algos_531__pyx_fuse_9kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_9kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_9kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_9kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_9kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_9kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_9kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":797 + * + * + * cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i,j,l,m + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_kth_smallest_c(__pyx_t_5numpy_float64_t *__pyx_v_a, Py_ssize_t __pyx_v_k, Py_ssize_t __pyx_v_n) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + __pyx_t_5numpy_double_t __pyx_v_x; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("kth_smallest_c", 0); + + /* "pandas/algos.pyx":802 + * double_t x, t + * + * l = 0 # <<<<<<<<<<<<<< + * m = n-1 + * while (l j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":816 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_1) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":818 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_1 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_1) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":819 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_1 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_1) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":820 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyFloat_FromDouble((__pyx_v_a[__pyx_v_k])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":797 + * + * + * cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i,j,l,m + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.algos.kth_smallest_c", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_16median[] = "\n A faster median\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_17median = {__Pyx_NAMESTR("median"), (PyCFunction)__pyx_pw_6pandas_5algos_17median, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_signatures = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + CYTHON_UNUSED PyObject *__pyx_v_defaults = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_signatures = values[0]; + __pyx_v_args = values[1]; + __pyx_v_kwargs = values[2]; + __pyx_v_defaults = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_16median(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_16median(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { + PyObject *__pyx_v_dest_sig = NULL; + PyObject *__pyx_v_numpy = NULL; + __Pyx_memviewslice __pyx_v_memslice; + Py_ssize_t __pyx_v_itemsize; + int __pyx_v_dtype_signed; + char __pyx_v_kind; + int __pyx_v____pyx_int32_t_is_signed; + int __pyx_v____pyx_int64_t_is_signed; + int __pyx_v____pyx_uint8_t_is_signed; + int __pyx_v____pyx_uint16_t_is_signed; + int __pyx_v____pyx_uint32_t_is_signed; + int __pyx_v____pyx_uint64_t_is_signed; + int __pyx_v____pyx_int8_t_is_signed; + int __pyx_v____pyx_int16_t_is_signed; + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_v_dtype = NULL; + PyObject *__pyx_v_candidates = NULL; + PyObject *__pyx_v_sig = NULL; + int __pyx_v_match_found; + PyObject *__pyx_v_src_type = NULL; + PyObject *__pyx_v_dst_type = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + char __pyx_t_12; + int __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *(*__pyx_t_20)(PyObject *); + int __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("median", 0); + __Pyx_INCREF(__pyx_v_kwargs); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_v_dest_sig = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_v_kwargs == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_numpy = __pyx_t_1; + __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_numpy, Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L11_try_end:; + } + __pyx_v_itemsize = -1; + __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0); + __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0); + __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1) < 0); + __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1) < 0); + __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1) < 0); + __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1) < 0); + __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1) < 0); + __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0); + __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((0 < __pyx_t_10) != 0); + if (__pyx_t_3) { + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_arg = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_arr, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + __pyx_t_9 = PyObject_GetItem(__pyx_v_kwargs, __pyx_n_s_arr); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_arg = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + /*else*/ { + __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L14:; + if (0) { + goto __pyx_L15; + } + /*else*/ { + while (1) { + if (!1) break; + __pyx_t_2 = (__pyx_v_numpy != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_dtype = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L19; + } + __pyx_t_2 = (__pyx_memoryview_check(__pyx_v_arg) != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyObject_IsInstance(__pyx_t_8, __pyx_t_9); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_3 != 0); + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dtype = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L19; + } + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_dtype = Py_None; + } + __pyx_L19:; + __pyx_v_itemsize = -1; + __pyx_t_11 = (__pyx_v_dtype != Py_None); + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_itemsize = __pyx_t_10; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_12 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_12 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_kind = __pyx_t_12; + __pyx_t_8 = __Pyx_PyInt_From_char(__pyx_v_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_105, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dtype_signed = __pyx_t_2; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_9, __pyx_tuple__38, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_2 != 0); + if (__pyx_t_11) { + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_3 = ((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize); + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + goto __pyx_L21; + } + __pyx_L21:; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L18; + } + __pyx_L18:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L32; + } + __pyx_L32:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L34; + } + __pyx_L34:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L36; + } + __pyx_L36:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L38; + } + __pyx_L38:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L40; + } + __pyx_L40:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L42; + } + __pyx_L42:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L44; + } + __pyx_L44:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L46; + } + __pyx_L46:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L48; + } + __pyx_L48:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L50; + } + __pyx_L50:; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_L17_break:; + } + __pyx_L15:; + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_candidates = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + if (PyList_CheckExact(__pyx_v_signatures) || PyTuple_CheckExact(__pyx_v_signatures)) { + __pyx_t_9 = __pyx_v_signatures; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_signatures); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; + } + for (;;) { + if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_14(__pyx_t_9); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_v_match_found = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_dest_sig); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dest_sig); + __Pyx_GIVEREF(__pyx_v_dest_sig); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_16(__pyx_t_8); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_17 = PyList_GET_ITEM(sequence, 0); + __pyx_t_18 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(__pyx_t_18); + #else + __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; + index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_17); + index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_18); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L57_unpacking_done; + __pyx_L56_unpacking_failed:; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L57_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17); + __pyx_t_17 = 0; + __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_11 = (__pyx_v_dst_type != Py_None); + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + __pyx_v_match_found = 1; + goto __pyx_L59; + } + /*else*/ { + __pyx_v_match_found = 0; + goto __pyx_L55_break; + } + __pyx_L59:; + goto __pyx_L58; + } + __pyx_L58:; + } + __pyx_L55_break:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = (__pyx_v_match_found != 0); + if (__pyx_t_2) { + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L60; + } + __pyx_L60:; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0); + __pyx_t_11 = ((!__pyx_t_2) != 0); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((__pyx_t_10 > 1) != 0); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_GetItem(__pyx_v_signatures, __pyx_t_9); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dest_sig); + __Pyx_XDECREF(__pyx_v_numpy); + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XDECREF(__pyx_v_dtype); + __Pyx_XDECREF(__pyx_v_candidates); + __Pyx_XDECREF(__pyx_v_sig); + __Pyx_XDECREF(__pyx_v_src_type); + __Pyx_XDECREF(__pyx_v_dst_type); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int8_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_int8_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_0median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int8_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5algos_535__pyx_fuse_0median = {__Pyx_NAMESTR("__pyx_fuse_0median"), (PyCFunction)__pyx_pw_6pandas_5algos_535__pyx_fuse_0median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_0median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_534__pyx_fuse_0median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_534__pyx_fuse_0median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_0median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int8(__pyx_fuse_0__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int16_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_int16_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_1median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int16_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5algos_537__pyx_fuse_1median = {__Pyx_NAMESTR("__pyx_fuse_1median"), (PyCFunction)__pyx_pw_6pandas_5algos_537__pyx_fuse_1median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_1median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_536__pyx_fuse_1median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_536__pyx_fuse_1median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_1median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int16(__pyx_fuse_1__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_int32_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_2median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5algos_539__pyx_fuse_2median = {__Pyx_NAMESTR("__pyx_fuse_2median"), (PyCFunction)__pyx_pw_6pandas_5algos_539__pyx_fuse_2median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_2median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_538__pyx_fuse_2median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_538__pyx_fuse_2median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_2median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_fuse_2__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_3median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div___pyx_t_5numpy_int64_t((__pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5algos_541__pyx_fuse_3median = {__Pyx_NAMESTR("__pyx_fuse_3median"), (PyCFunction)__pyx_pw_6pandas_5algos_541__pyx_fuse_3median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_3median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_540__pyx_fuse_3median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_540__pyx_fuse_3median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_3median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_fuse_3__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint8_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_4median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint8_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5algos_543__pyx_fuse_4median = {__Pyx_NAMESTR("__pyx_fuse_4median"), (PyCFunction)__pyx_pw_6pandas_5algos_543__pyx_fuse_4median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_4median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_542__pyx_fuse_4median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_542__pyx_fuse_4median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_4median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_fuse_4__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint16_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_uint16_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_5median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_uint16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint16_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5algos_545__pyx_fuse_5median = {__Pyx_NAMESTR("__pyx_fuse_5median"), (PyCFunction)__pyx_pw_6pandas_5algos_545__pyx_fuse_5median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_5median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_544__pyx_fuse_5median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_544__pyx_fuse_5median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_5median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint16(__pyx_fuse_5__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_uint32_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_6median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5algos_547__pyx_fuse_6median = {__Pyx_NAMESTR("__pyx_fuse_6median"), (PyCFunction)__pyx_pw_6pandas_5algos_547__pyx_fuse_6median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_6median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_546__pyx_fuse_6median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_546__pyx_fuse_6median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_6median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_fuse_6__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_uint64_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_7median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((__pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5algos_549__pyx_fuse_7median = {__Pyx_NAMESTR("__pyx_fuse_7median"), (PyCFunction)__pyx_pw_6pandas_5algos_549__pyx_fuse_7median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_7median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_548__pyx_fuse_7median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_548__pyx_fuse_7median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_7median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_fuse_7__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_float32_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_8median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((__pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2.0); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5algos_551__pyx_fuse_8median = {__Pyx_NAMESTR("__pyx_fuse_8median"), (PyCFunction)__pyx_pw_6pandas_5algos_551__pyx_fuse_8median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_8median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_550__pyx_fuse_8median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_550__pyx_fuse_8median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_8median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_8__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_9median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((__pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2.0); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5algos_553__pyx_fuse_9median = {__Pyx_NAMESTR("__pyx_fuse_9median"), (PyCFunction)__pyx_pw_6pandas_5algos_553__pyx_fuse_9median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_9median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_552__pyx_fuse_9median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_552__pyx_fuse_9median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_9median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_9__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":843 + * # -------------- Min, Max subsequence + * + * def max_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_19max_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_19max_subseq = {__Pyx_NAMESTR("max_subseq"), (PyCFunction)__pyx_pw_6pandas_5algos_19max_subseq, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_19max_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("max_subseq (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_18max_subseq(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_18max_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_s; + Py_ssize_t __pyx_v_e; + Py_ssize_t __pyx_v_T; + Py_ssize_t __pyx_v_n; + double __pyx_v_m; + double __pyx_v_S; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("max_subseq", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":845 + * def max_subseq(ndarray[double_t] arr): + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n # <<<<<<<<<<<<<< + * double m, S + * + */ + __pyx_v_i = 0; + __pyx_v_s = 0; + __pyx_v_e = 0; + + /* "pandas/algos.pyx":848 + * double m, S + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if len(arr) == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/algos.pyx":850 + * n = len(arr) + * + * if len(arr) == 0: # <<<<<<<<<<<<<< + * return (-1,-1,None) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_t_1 == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":851 + * + * if len(arr) == 0: + * return (-1,-1,None) # <<<<<<<<<<<<<< + * + * m = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__43); + __pyx_r = __pyx_tuple__43; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":853 + * return (-1,-1,None) + * + * m = arr[0] # <<<<<<<<<<<<<< + * S = m + * T = 0 + */ + __pyx_t_3 = 0; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_m = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/algos.pyx":854 + * + * m = arr[0] + * S = m # <<<<<<<<<<<<<< + * T = 0 + * + */ + __pyx_v_S = __pyx_v_m; + + /* "pandas/algos.pyx":855 + * m = arr[0] + * S = m + * T = 0 # <<<<<<<<<<<<<< + * + * for i in range(1, n): + */ + __pyx_v_T = 0; + + /* "pandas/algos.pyx":857 + * T = 0 + * + * for i in range(1, n): # <<<<<<<<<<<<<< + * # S = max { S + A[i], A[i] ) + * if (S > 0): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/algos.pyx":859 + * for i in range(1, n): + * # S = max { S + A[i], A[i] ) + * if (S > 0): # <<<<<<<<<<<<<< + * S = S + arr[i] + * else: + */ + __pyx_t_2 = ((__pyx_v_S > 0.0) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":860 + * # S = max { S + A[i], A[i] ) + * if (S > 0): + * S = S + arr[i] # <<<<<<<<<<<<<< + * else: + * S = arr[i] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_S = (__pyx_v_S + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides))); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/algos.pyx":862 + * S = S + arr[i] + * else: + * S = arr[i] # <<<<<<<<<<<<<< + * T = i + * if S > m: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_S = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/algos.pyx":863 + * else: + * S = arr[i] + * T = i # <<<<<<<<<<<<<< + * if S > m: + * s = T + */ + __pyx_v_T = __pyx_v_i; + } + __pyx_L6:; + + /* "pandas/algos.pyx":864 + * S = arr[i] + * T = i + * if S > m: # <<<<<<<<<<<<<< + * s = T + * e = i + */ + __pyx_t_2 = ((__pyx_v_S > __pyx_v_m) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":865 + * T = i + * if S > m: + * s = T # <<<<<<<<<<<<<< + * e = i + * m = S + */ + __pyx_v_s = __pyx_v_T; + + /* "pandas/algos.pyx":866 + * if S > m: + * s = T + * e = i # <<<<<<<<<<<<<< + * m = S + * + */ + __pyx_v_e = __pyx_v_i; + + /* "pandas/algos.pyx":867 + * s = T + * e = i + * m = S # <<<<<<<<<<<<<< + * + * return (s, e, m) + */ + __pyx_v_m = __pyx_v_S; + goto __pyx_L7; + } + __pyx_L7:; + } + + /* "pandas/algos.pyx":869 + * m = S + * + * return (s, e, m) # <<<<<<<<<<<<<< + * + * def min_subseq(ndarray[double_t] arr): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_s); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_e); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_m); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":843 + * # -------------- Min, Max subsequence + * + * def max_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.max_subseq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":871 + * return (s, e, m) + * + * def min_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s, e + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_21min_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_21min_subseq = {__Pyx_NAMESTR("min_subseq"), (PyCFunction)__pyx_pw_6pandas_5algos_21min_subseq, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_21min_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("min_subseq (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_20min_subseq(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_20min_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_s; + Py_ssize_t __pyx_v_e; + double __pyx_v_m; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + double __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("min_subseq", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":876 + * double m + * + * (s, e, m) = max_subseq(-arr) # <<<<<<<<<<<<<< + * + * return (s, e, -m) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_max_subseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Negative(((PyObject *)__pyx_v_arr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_s = __pyx_t_7; + __pyx_v_e = __pyx_t_8; + __pyx_v_m = __pyx_t_9; + + /* "pandas/algos.pyx":878 + * (s, e, m) = max_subseq(-arr) + * + * return (s, e, -m) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_e); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyFloat_FromDouble((-__pyx_v_m)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":871 + * return (s, e, m) + * + * def min_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s, e + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.min_subseq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":883 + * # Rolling sum + * + * def roll_sum(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_23roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_23roll_sum = {__Pyx_NAMESTR("roll_sum"), (PyCFunction)__pyx_pw_6pandas_5algos_23roll_sum, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_23roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_sum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_sum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_22roll_sum(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_22roll_sum(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_sum_x; + int __pyx_v_nobs; + int __pyx_v_i; + int __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_sum", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":884 + * + * def roll_sum(ndarray[double_t] input, int win, int minp): + * cdef double val, prev, sum_x = 0 # <<<<<<<<<<<<<< + * cdef int nobs = 0, i + * cdef int N = len(input) + */ + __pyx_v_sum_x = 0.0; + + /* "pandas/algos.pyx":885 + * def roll_sum(ndarray[double_t] input, int win, int minp): + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i # <<<<<<<<<<<<<< + * cdef int N = len(input) + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":886 + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + * cdef int N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":888 + * cdef int N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":890 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":892 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":893 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":896 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * sum_x += val + */ + __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":897 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * sum_x += val + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":898 + * if val == val: + * nobs += 1 + * sum_x += val # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":900 + * sum_x += val + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":902 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":903 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":905 + * val = input[i] + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * sum_x += val + */ + __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":906 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * sum_x += val + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":907 + * if val == val: + * nobs += 1 + * sum_x += val # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val); + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":909 + * sum_x += val + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * if prev == prev: + */ + __pyx_t_11 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":910 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * if prev == prev: + * sum_x -= prev + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_15 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_15 = 0; + if (unlikely(__pyx_t_15 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_15); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":911 + * if i > win - 1: + * prev = input[i - win] + * if prev == prev: # <<<<<<<<<<<<<< + * sum_x -= prev + * nobs -= 1 + */ + __pyx_t_11 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":912 + * prev = input[i - win] + * if prev == prev: + * sum_x -= prev # <<<<<<<<<<<<<< + * nobs -= 1 + * + */ + __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev); + + /* "pandas/algos.pyx":913 + * if prev == prev: + * sum_x -= prev + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":915 + * nobs -= 1 + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * output[i] = sum_x + * else: + */ + __pyx_t_11 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":916 + * + * if nobs >= minp: + * output[i] = sum_x # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_16 = 0; + if (unlikely(__pyx_t_16 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_16); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_sum_x; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":918 + * output[i] = sum_x + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_17 = 0; + if (unlikely(__pyx_t_17 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_17); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":920 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":883 + * # Rolling sum + * + * def roll_sum(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":925 + * # Rolling mean + * + * def roll_mean(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_25roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_25roll_mean = {__Pyx_NAMESTR("roll_mean"), (PyCFunction)__pyx_pw_6pandas_5algos_25roll_mean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_25roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_mean (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_mean") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_24roll_mean(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_24roll_mean(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_result; + double __pyx_v_sum_x; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_neg_ct; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_mean", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":928 + * int win, int minp): + * cdef: + * double val, prev, result, sum_x = 0 # <<<<<<<<<<<<<< + * Py_ssize_t nobs = 0, i, neg_ct = 0 + * Py_ssize_t N = len(input) + */ + __pyx_v_sum_x = 0.0; + + /* "pandas/algos.pyx":929 + * cdef: + * double val, prev, result, sum_x = 0 + * Py_ssize_t nobs = 0, i, neg_ct = 0 # <<<<<<<<<<<<<< + * Py_ssize_t N = len(input) + * + */ + __pyx_v_nobs = 0; + __pyx_v_neg_ct = 0; + + /* "pandas/algos.pyx":930 + * double val, prev, result, sum_x = 0 + * Py_ssize_t nobs = 0, i, neg_ct = 0 + * Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":932 + * Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * minp = _check_minp(win, minp, N) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":933 + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":935 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":936 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":939 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * sum_x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":940 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * sum_x += val + * if signbit(val): + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":941 + * if val == val: + * nobs += 1 + * sum_x += val # <<<<<<<<<<<<<< + * if signbit(val): + * neg_ct += 1 + */ + __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val); + + /* "pandas/algos.pyx":942 + * nobs += 1 + * sum_x += val + * if signbit(val): # <<<<<<<<<<<<<< + * neg_ct += 1 + * + */ + __pyx_t_10 = (signbit(__pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":943 + * sum_x += val + * if signbit(val): + * neg_ct += 1 # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_v_neg_ct = (__pyx_v_neg_ct + 1); + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":945 + * neg_ct += 1 + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":947 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":948 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":950 + * val = input[i] + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * sum_x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":951 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * sum_x += val + * if signbit(val): + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":952 + * if val == val: + * nobs += 1 + * sum_x += val # <<<<<<<<<<<<<< + * if signbit(val): + * neg_ct += 1 + */ + __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val); + + /* "pandas/algos.pyx":953 + * nobs += 1 + * sum_x += val + * if signbit(val): # <<<<<<<<<<<<<< + * neg_ct += 1 + * + */ + __pyx_t_10 = (signbit(__pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":954 + * sum_x += val + * if signbit(val): + * neg_ct += 1 # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_v_neg_ct = (__pyx_v_neg_ct + 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":956 + * neg_ct += 1 + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * if prev == prev: + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":957 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * if prev == prev: + * sum_x -= prev + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":958 + * if i > win - 1: + * prev = input[i - win] + * if prev == prev: # <<<<<<<<<<<<<< + * sum_x -= prev + * nobs -= 1 + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":959 + * prev = input[i - win] + * if prev == prev: + * sum_x -= prev # <<<<<<<<<<<<<< + * nobs -= 1 + * if signbit(prev): + */ + __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev); + + /* "pandas/algos.pyx":960 + * if prev == prev: + * sum_x -= prev + * nobs -= 1 # <<<<<<<<<<<<<< + * if signbit(prev): + * neg_ct -= 1 + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + + /* "pandas/algos.pyx":961 + * sum_x -= prev + * nobs -= 1 + * if signbit(prev): # <<<<<<<<<<<<<< + * neg_ct -= 1 + * + */ + __pyx_t_10 = (signbit(__pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":962 + * nobs -= 1 + * if signbit(prev): + * neg_ct -= 1 # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_neg_ct = (__pyx_v_neg_ct - 1); + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":964 + * neg_ct -= 1 + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * result = sum_x / nobs + * if neg_ct == 0 and result < 0: + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":965 + * + * if nobs >= minp: + * result = sum_x / nobs # <<<<<<<<<<<<<< + * if neg_ct == 0 and result < 0: + * # all positive + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_result = (__pyx_v_sum_x / __pyx_v_nobs); + + /* "pandas/algos.pyx":966 + * if nobs >= minp: + * result = sum_x / nobs + * if neg_ct == 0 and result < 0: # <<<<<<<<<<<<<< + * # all positive + * output[i] = 0 + */ + __pyx_t_10 = ((__pyx_v_neg_ct == 0) != 0); + if (__pyx_t_10) { + __pyx_t_15 = ((__pyx_v_result < 0.0) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_10; + } + if (__pyx_t_16) { + + /* "pandas/algos.pyx":968 + * if neg_ct == 0 and result < 0: + * # all positive + * output[i] = 0 # <<<<<<<<<<<<<< + * elif neg_ct == nobs and result > 0: + * # all negative + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = 0.0; + goto __pyx_L15; + } + + /* "pandas/algos.pyx":969 + * # all positive + * output[i] = 0 + * elif neg_ct == nobs and result > 0: # <<<<<<<<<<<<<< + * # all negative + * output[i] = 0 + */ + __pyx_t_16 = ((__pyx_v_neg_ct == __pyx_v_nobs) != 0); + if (__pyx_t_16) { + __pyx_t_10 = ((__pyx_v_result > 0.0) != 0); + __pyx_t_15 = __pyx_t_10; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (__pyx_t_15) { + + /* "pandas/algos.pyx":971 + * elif neg_ct == nobs and result > 0: + * # all negative + * output[i] = 0 # <<<<<<<<<<<<<< + * else: + * output[i] = result + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = 0.0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/algos.pyx":973 + * output[i] = 0 + * else: + * output[i] = result # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_result; + } + __pyx_L15:; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/algos.pyx":975 + * output[i] = result + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":977 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":925 + * # Rolling mean + * + * def roll_mean(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":982 + * # Exponentially weighted moving average + * + * def ewma(ndarray[double_t] input, double_t com, int adjust): # <<<<<<<<<<<<<< + * ''' + * Compute exponentially-weighted moving average using center-of-mass. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_27ewma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_26ewma[] = "\n Compute exponentially-weighted moving average using center-of-mass.\n\n Parameters\n ----------\n input : ndarray (float64 type)\n com : float64\n\n Returns\n -------\n y : ndarray\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_27ewma = {__Pyx_NAMESTR("ewma"), (PyCFunction)__pyx_pw_6pandas_5algos_27ewma, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_26ewma)}; +static PyObject *__pyx_pw_6pandas_5algos_27ewma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + __pyx_t_5numpy_double_t __pyx_v_com; + int __pyx_v_adjust; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ewma (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_com,&__pyx_n_s_adjust,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_com)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_adjust)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ewma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_com = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_com == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_adjust = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_adjust == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.ewma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_26ewma(__pyx_self, __pyx_v_input, __pyx_v_com, __pyx_v_adjust); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_26ewma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust) { + double __pyx_v_cur; + double __pyx_v_prev; + double __pyx_v_neww; + double __pyx_v_oldw; + double __pyx_v_adj; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __pyx_t_5numpy_double_t __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + long __pyx_t_11; + long __pyx_t_12; + long __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + double __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ewma", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":998 + * cdef double cur, prev, neww, oldw, adj + * cdef Py_ssize_t i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1000 + * cdef Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * if N == 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1002 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * if N == 0: # <<<<<<<<<<<<<< + * return output + * + */ + __pyx_t_7 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1003 + * + * if N == 0: + * return output # <<<<<<<<<<<<<< + * + * neww = 1. / (1. + com) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1005 + * return output + * + * neww = 1. / (1. + com) # <<<<<<<<<<<<<< + * oldw = 1. - neww + * adj = oldw + */ + __pyx_t_8 = (1. + __pyx_v_com); + if (unlikely(__pyx_t_8 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_neww = (1. / __pyx_t_8); + + /* "pandas/algos.pyx":1006 + * + * neww = 1. / (1. + com) + * oldw = 1. - neww # <<<<<<<<<<<<<< + * adj = oldw + * + */ + __pyx_v_oldw = (1. - __pyx_v_neww); + + /* "pandas/algos.pyx":1007 + * neww = 1. / (1. + com) + * oldw = 1. - neww + * adj = oldw # <<<<<<<<<<<<<< + * + * if adjust: + */ + __pyx_v_adj = __pyx_v_oldw; + + /* "pandas/algos.pyx":1009 + * adj = oldw + * + * if adjust: # <<<<<<<<<<<<<< + * output[0] = neww * input[0] + * else: + */ + __pyx_t_7 = (__pyx_v_adjust != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1010 + * + * if adjust: + * output[0] = neww * input[0] # <<<<<<<<<<<<<< + * else: + * output[0] = input[0] + */ + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_t_10 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_v_neww * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_input.diminfo[0].strides))); + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":1012 + * output[0] = neww * input[0] + * else: + * output[0] = input[0] # <<<<<<<<<<<<<< + * + * for i from 1 <= i < N: + */ + __pyx_t_12 = 0; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = 0; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_output.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_input.diminfo[0].strides)); + } + __pyx_L4:; + + /* "pandas/algos.pyx":1014 + * output[0] = input[0] + * + * for i from 1 <= i < N: # <<<<<<<<<<<<<< + * cur = input[i] + * prev = output[i - 1] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1015 + * + * for i from 1 <= i < N: + * cur = input[i] # <<<<<<<<<<<<<< + * prev = output[i - 1] + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1016 + * for i from 1 <= i < N: + * cur = input[i] + * prev = output[i - 1] # <<<<<<<<<<<<<< + * + * if cur == cur: + */ + __pyx_t_15 = (__pyx_v_i - 1); + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides)); + + /* "pandas/algos.pyx":1018 + * prev = output[i - 1] + * + * if cur == cur: # <<<<<<<<<<<<<< + * if prev == prev: + * output[i] = oldw * prev + neww * cur + */ + __pyx_t_7 = ((__pyx_v_cur == __pyx_v_cur) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1019 + * + * if cur == cur: + * if prev == prev: # <<<<<<<<<<<<<< + * output[i] = oldw * prev + neww * cur + * else: + */ + __pyx_t_7 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1020 + * if cur == cur: + * if prev == prev: + * output[i] = oldw * prev + neww * cur # <<<<<<<<<<<<<< + * else: + * output[i] = neww * cur + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = ((__pyx_v_oldw * __pyx_v_prev) + (__pyx_v_neww * __pyx_v_cur)); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/algos.pyx":1022 + * output[i] = oldw * prev + neww * cur + * else: + * output[i] = neww * cur # <<<<<<<<<<<<<< + * else: + * output[i] = prev + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_v_neww * __pyx_v_cur); + } + __pyx_L8:; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/algos.pyx":1024 + * output[i] = neww * cur + * else: + * output[i] = prev # <<<<<<<<<<<<<< + * + * if adjust: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_prev; + } + __pyx_L7:; + } + + /* "pandas/algos.pyx":1026 + * output[i] = prev + * + * if adjust: # <<<<<<<<<<<<<< + * for i from 0 <= i < N: + * cur = input[i] + */ + __pyx_t_7 = (__pyx_v_adjust != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1027 + * + * if adjust: + * for i from 0 <= i < N: # <<<<<<<<<<<<<< + * cur = input[i] + * + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1028 + * if adjust: + * for i from 0 <= i < N: + * cur = input[i] # <<<<<<<<<<<<<< + * + * if cur == cur: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1030 + * cur = input[i] + * + * if cur == cur: # <<<<<<<<<<<<<< + * output[i] = output[i] / (1. - adj) + * adj *= oldw + */ + __pyx_t_7 = ((__pyx_v_cur == __pyx_v_cur) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1031 + * + * if cur == cur: + * output[i] = output[i] / (1. - adj) # <<<<<<<<<<<<<< + * adj *= oldw + * else: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides)); + __pyx_t_21 = (1. - __pyx_v_adj); + if (unlikely(__pyx_t_21 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_t_8 / __pyx_t_21); + + /* "pandas/algos.pyx":1032 + * if cur == cur: + * output[i] = output[i] / (1. - adj) + * adj *= oldw # <<<<<<<<<<<<<< + * else: + * if i >= 1: + */ + __pyx_v_adj = (__pyx_v_adj * __pyx_v_oldw); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1034 + * adj *= oldw + * else: + * if i >= 1: # <<<<<<<<<<<<<< + * output[i] = output[i - 1] + * + */ + __pyx_t_7 = ((__pyx_v_i >= 1) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1035 + * else: + * if i >= 1: + * output[i] = output[i - 1] # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_t_10 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_output.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_output.diminfo[0].strides)); + goto __pyx_L13; + } + __pyx_L13:; + } + __pyx_L12:; + } + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1037 + * output[i] = output[i - 1] + * + * return output # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":982 + * # Exponentially weighted moving average + * + * def ewma(ndarray[double_t] input, double_t com, int adjust): # <<<<<<<<<<<<<< + * ''' + * Compute exponentially-weighted moving average using center-of-mass. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.ewma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1044 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_29nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_29nancorr = {__Pyx_NAMESTR("nancorr"), (PyCFunction)__pyx_pw_6pandas_5algos_29nancorr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_29nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_mat = 0; + PyObject *__pyx_v_cov = 0; + PyObject *__pyx_v_minp = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nancorr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_cov,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cov); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nancorr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_mat = ((PyArrayObject *)values[0]); + __pyx_v_cov = values[1]; + __pyx_v_minp = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("nancorr", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.nancorr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_5numpy_ndarray, 1, "mat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_28nancorr(__pyx_self, __pyx_v_mat, __pyx_v_cov, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_28nancorr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, PyObject *__pyx_v_cov, PyObject *__pyx_v_minp) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_mask = 0; + __pyx_t_5numpy_int64_t __pyx_v_nobs; + __pyx_t_5numpy_float64_t __pyx_v_vx; + __pyx_t_5numpy_float64_t __pyx_v_vy; + __pyx_t_5numpy_float64_t __pyx_v_sumx; + __pyx_t_5numpy_float64_t __pyx_v_sumy; + __pyx_t_5numpy_float64_t __pyx_v_sumxx; + __pyx_t_5numpy_float64_t __pyx_v_sumyy; + __pyx_t_5numpy_float64_t __pyx_v_meanx; + __pyx_t_5numpy_float64_t __pyx_v_meany; + __pyx_t_5numpy_float64_t __pyx_v_divisor; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mat; + __Pyx_Buffer __pyx_pybuffer_mat; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyArrayObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_float64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + double __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("nancorr", 0); + __Pyx_INCREF(__pyx_v_minp); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_mat.pybuffer.buf = NULL; + __pyx_pybuffer_mat.refcount = 0; + __pyx_pybuffernd_mat.data = NULL; + __pyx_pybuffernd_mat.rcbuffer = &__pyx_pybuffer_mat; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mat.rcbuffer->pybuffer, (PyObject*)__pyx_v_mat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mat.diminfo[0].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mat.diminfo[0].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mat.diminfo[1].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mat.diminfo[1].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":1049 + * ndarray[float64_t, ndim=2] result + * ndarray[uint8_t, ndim=2] mask + * int64_t nobs = 0 # <<<<<<<<<<<<<< + * float64_t vx, vy, sumx, sumy, sumxx, sumyy, meanx, meany, divisor + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1052 + * float64_t vx, vy, sumx, sumy, sumxx, sumyy, meanx, meany, divisor + * + * N, K = ( mat).shape # <<<<<<<<<<<<<< + * + * if minp is None: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":1054 + * N, K = ( mat).shape + * + * if minp is None: # <<<<<<<<<<<<<< + * minp = 1 + * + */ + __pyx_t_8 = (__pyx_v_minp == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/algos.pyx":1055 + * + * if minp is None: + * minp = 1 # <<<<<<<<<<<<<< + * + * result = np.empty((K, K), dtype=np.float64) + */ + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF_SET(__pyx_v_minp, __pyx_int_1); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1057 + * minp = 1 + * + * result = np.empty((K, K), dtype=np.float64) # <<<<<<<<<<<<<< + * mask = np.isfinite(mat).view(np.uint8) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/algos.pyx":1058 + * + * result = np.empty((K, K), dtype=np.float64) + * mask = np.isfinite(mat).view(np.uint8) # <<<<<<<<<<<<<< + * + * for xi in range(K): + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_mat)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_mat)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_mat)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13); + } + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = 0; + __pyx_v_mask = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":1060 + * mask = np.isfinite(mat).view(np.uint8) + * + * for xi in range(K): # <<<<<<<<<<<<<< + * for yi in range(xi + 1): + * nobs = sumxx = sumyy = sumx = sumy = 0 + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_xi = __pyx_t_6; + + /* "pandas/algos.pyx":1061 + * + * for xi in range(K): + * for yi in range(xi + 1): # <<<<<<<<<<<<<< + * nobs = sumxx = sumyy = sumx = sumy = 0 + * for i in range(N): + */ + __pyx_t_17 = (__pyx_v_xi + 1); + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_yi = __pyx_t_18; + + /* "pandas/algos.pyx":1062 + * for xi in range(K): + * for yi in range(xi + 1): + * nobs = sumxx = sumyy = sumx = sumy = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + */ + __pyx_v_nobs = 0; + __pyx_v_sumxx = 0; + __pyx_v_sumyy = 0; + __pyx_v_sumx = 0; + __pyx_v_sumy = 0; + + /* "pandas/algos.pyx":1063 + * for yi in range(xi + 1): + * nobs = sumxx = sumyy = sumx = sumy = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] + */ + __pyx_t_19 = __pyx_v_N; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_i = __pyx_t_20; + + /* "pandas/algos.pyx":1064 + * nobs = sumxx = sumyy = sumx = sumy = 0 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: # <<<<<<<<<<<<<< + * vx = mat[i, xi] + * vy = mat[i, yi] + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_xi; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_yi; + __pyx_t_8 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + __pyx_t_25 = __pyx_t_8; + } else { + __pyx_t_25 = __pyx_t_9; + } + if (__pyx_t_25) { + + /* "pandas/algos.pyx":1065 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] # <<<<<<<<<<<<<< + * vy = mat[i, yi] + * nobs += 1 + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = __pyx_v_xi; + __pyx_v_vx = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_mat.diminfo[1].strides)); + + /* "pandas/algos.pyx":1066 + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] + * vy = mat[i, yi] # <<<<<<<<<<<<<< + * nobs += 1 + * sumx += vx + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_yi; + __pyx_v_vy = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_mat.diminfo[1].strides)); + + /* "pandas/algos.pyx":1067 + * vx = mat[i, xi] + * vy = mat[i, yi] + * nobs += 1 # <<<<<<<<<<<<<< + * sumx += vx + * sumy += vy + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1068 + * vy = mat[i, yi] + * nobs += 1 + * sumx += vx # <<<<<<<<<<<<<< + * sumy += vy + * + */ + __pyx_v_sumx = (__pyx_v_sumx + __pyx_v_vx); + + /* "pandas/algos.pyx":1069 + * nobs += 1 + * sumx += vx + * sumy += vy # <<<<<<<<<<<<<< + * + * if nobs < minp: + */ + __pyx_v_sumy = (__pyx_v_sumy + __pyx_v_vy); + goto __pyx_L12; + } + __pyx_L12:; + } + + /* "pandas/algos.pyx":1071 + * sumy += vy + * + * if nobs < minp: # <<<<<<<<<<<<<< + * result[xi, yi] = result[yi, xi] = np.NaN + * else: + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_minp, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_25 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_25 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_25) { + + /* "pandas/algos.pyx":1072 + * + * if nobs < minp: + * result[xi, yi] = result[yi, xi] = np.NaN # <<<<<<<<<<<<<< + * else: + * meanx = sumx / nobs + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __pyx_v_xi; + __pyx_t_20 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_31 = __pyx_v_yi; + __pyx_t_32 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1074 + * result[xi, yi] = result[yi, xi] = np.NaN + * else: + * meanx = sumx / nobs # <<<<<<<<<<<<<< + * meany = sumy / nobs + * + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_meanx = (__pyx_v_sumx / __pyx_v_nobs); + + /* "pandas/algos.pyx":1075 + * else: + * meanx = sumx / nobs + * meany = sumy / nobs # <<<<<<<<<<<<<< + * + * # now the cov numerator + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_meany = (__pyx_v_sumy / __pyx_v_nobs); + + /* "pandas/algos.pyx":1078 + * + * # now the cov numerator + * sumx = 0 # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_v_sumx = 0.0; + + /* "pandas/algos.pyx":1080 + * sumx = 0 + * + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] - meanx + */ + __pyx_t_33 = __pyx_v_N; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_i = __pyx_t_34; + + /* "pandas/algos.pyx":1081 + * + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: # <<<<<<<<<<<<<< + * vx = mat[i, xi] - meanx + * vy = mat[i, yi] - meany + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_xi; + __pyx_t_25 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_25) { + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_yi; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + __pyx_t_8 = __pyx_t_9; + } else { + __pyx_t_8 = __pyx_t_25; + } + if (__pyx_t_8) { + + /* "pandas/algos.pyx":1082 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] - meanx # <<<<<<<<<<<<<< + * vy = mat[i, yi] - meany + * + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_xi; + __pyx_v_vx = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_mat.diminfo[1].strides)) - __pyx_v_meanx); + + /* "pandas/algos.pyx":1083 + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] - meanx + * vy = mat[i, yi] - meany # <<<<<<<<<<<<<< + * + * sumx += vx * vy + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_yi; + __pyx_v_vy = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_mat.diminfo[1].strides)) - __pyx_v_meany); + + /* "pandas/algos.pyx":1085 + * vy = mat[i, yi] - meany + * + * sumx += vx * vy # <<<<<<<<<<<<<< + * sumxx += vx * vx + * sumyy += vy * vy + */ + __pyx_v_sumx = (__pyx_v_sumx + (__pyx_v_vx * __pyx_v_vy)); + + /* "pandas/algos.pyx":1086 + * + * sumx += vx * vy + * sumxx += vx * vx # <<<<<<<<<<<<<< + * sumyy += vy * vy + * + */ + __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx)); + + /* "pandas/algos.pyx":1087 + * sumx += vx * vy + * sumxx += vx * vx + * sumyy += vy * vy # <<<<<<<<<<<<<< + * + * divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy) + */ + __pyx_v_sumyy = (__pyx_v_sumyy + (__pyx_v_vy * __pyx_v_vy)); + goto __pyx_L16; + } + __pyx_L16:; + } + + /* "pandas/algos.pyx":1089 + * sumyy += vy * vy + * + * divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy) # <<<<<<<<<<<<<< + * + * if divisor != 0: + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_cov); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_8) { + __pyx_t_43 = (__pyx_v_nobs - 1.0); + } else { + __pyx_t_43 = sqrt((__pyx_v_sumxx * __pyx_v_sumyy)); + } + __pyx_v_divisor = __pyx_t_43; + + /* "pandas/algos.pyx":1091 + * divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy) + * + * if divisor != 0: # <<<<<<<<<<<<<< + * result[xi, yi] = result[yi, xi] = sumx / divisor + * else: + */ + __pyx_t_8 = ((__pyx_v_divisor != 0.0) != 0); + if (__pyx_t_8) { + + /* "pandas/algos.pyx":1092 + * + * if divisor != 0: + * result[xi, yi] = result[yi, xi] = sumx / divisor # <<<<<<<<<<<<<< + * else: + * result[xi, yi] = result[yi, xi] = np.NaN + */ + if (unlikely(__pyx_v_divisor == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = (__pyx_v_sumx / __pyx_v_divisor); + __pyx_t_33 = __pyx_v_xi; + __pyx_t_34 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __pyx_t_44 = __pyx_v_yi; + __pyx_t_45 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/algos.pyx":1094 + * result[xi, yi] = result[yi, xi] = sumx / divisor + * else: + * result[xi, yi] = result[yi, xi] = np.NaN # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_46 = __pyx_v_xi; + __pyx_t_47 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_48 = __pyx_v_yi; + __pyx_t_49 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L17:; + } + __pyx_L13:; + } + } + + /* "pandas/algos.pyx":1096 + * result[xi, yi] = result[yi, xi] = np.NaN + * + * return result # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":1044 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.nancorr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_mask); + __Pyx_XDECREF(__pyx_v_minp); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1103 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_31nancorr_spearman(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_31nancorr_spearman = {__Pyx_NAMESTR("nancorr_spearman"), (PyCFunction)__pyx_pw_6pandas_5algos_31nancorr_spearman, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_31nancorr_spearman(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_mat = 0; + Py_ssize_t __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nancorr_spearman (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_minp,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nancorr_spearman") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_mat = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_minp = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_minp == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_minp = ((Py_ssize_t)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("nancorr_spearman", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.nancorr_spearman", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_5numpy_ndarray, 1, "mat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_30nancorr_spearman(__pyx_self, __pyx_v_mat, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_30nancorr_spearman(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, Py_ssize_t __pyx_v_minp) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_maskedx = 0; + PyArrayObject *__pyx_v_maskedy = 0; + PyArrayObject *__pyx_v_mask = 0; + __pyx_t_5numpy_int64_t __pyx_v_nobs; + __pyx_t_5numpy_float64_t __pyx_v_vx; + __pyx_t_5numpy_float64_t __pyx_v_vy; + __pyx_t_5numpy_float64_t __pyx_v_sumx; + __pyx_t_5numpy_float64_t __pyx_v_sumxx; + __pyx_t_5numpy_float64_t __pyx_v_sumyy; + __pyx_t_5numpy_float64_t __pyx_v_mean; + __pyx_t_5numpy_float64_t __pyx_v_divisor; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maskedx; + __Pyx_Buffer __pyx_pybuffer_maskedx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maskedy; + __Pyx_Buffer __pyx_pybuffer_maskedy; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mat; + __Pyx_Buffer __pyx_pybuffer_mat; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_t_24; + int __pyx_t_25; + __pyx_t_5numpy_float64_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + PyArrayObject *__pyx_t_29 = NULL; + PyArrayObject *__pyx_t_30 = NULL; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + __pyx_t_5numpy_int64_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("nancorr_spearman", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_maskedx.pybuffer.buf = NULL; + __pyx_pybuffer_maskedx.refcount = 0; + __pyx_pybuffernd_maskedx.data = NULL; + __pyx_pybuffernd_maskedx.rcbuffer = &__pyx_pybuffer_maskedx; + __pyx_pybuffer_maskedy.pybuffer.buf = NULL; + __pyx_pybuffer_maskedy.refcount = 0; + __pyx_pybuffernd_maskedy.data = NULL; + __pyx_pybuffernd_maskedy.rcbuffer = &__pyx_pybuffer_maskedy; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_mat.pybuffer.buf = NULL; + __pyx_pybuffer_mat.refcount = 0; + __pyx_pybuffernd_mat.data = NULL; + __pyx_pybuffernd_mat.rcbuffer = &__pyx_pybuffer_mat; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mat.rcbuffer->pybuffer, (PyObject*)__pyx_v_mat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mat.diminfo[0].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mat.diminfo[0].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mat.diminfo[1].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mat.diminfo[1].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":1110 + * ndarray[float64_t, ndim=1] maskedy + * ndarray[uint8_t, ndim=2] mask + * int64_t nobs = 0 # <<<<<<<<<<<<<< + * float64_t vx, vy, sumx, sumxx, sumyy, mean, divisor + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1113 + * float64_t vx, vy, sumx, sumxx, sumyy, mean, divisor + * + * N, K = ( mat).shape # <<<<<<<<<<<<<< + * + * result = np.empty((K, K), dtype=np.float64) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":1115 + * N, K = ( mat).shape + * + * result = np.empty((K, K), dtype=np.float64) # <<<<<<<<<<<<<< + * mask = np.isfinite(mat).view(np.uint8) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/algos.pyx":1116 + * + * result = np.empty((K, K), dtype=np.float64) + * mask = np.isfinite(mat).view(np.uint8) # <<<<<<<<<<<<<< + * + * for xi in range(K): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_mat)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_mat)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_mat)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_mask = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":1118 + * mask = np.isfinite(mat).view(np.uint8) + * + * for xi in range(K): # <<<<<<<<<<<<<< + * for yi in range(xi + 1): + * nobs = 0 + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_xi = __pyx_t_6; + + /* "pandas/algos.pyx":1119 + * + * for xi in range(K): + * for yi in range(xi + 1): # <<<<<<<<<<<<<< + * nobs = 0 + * for i in range(N): + */ + __pyx_t_15 = (__pyx_v_xi + 1); + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_yi = __pyx_t_16; + + /* "pandas/algos.pyx":1120 + * for xi in range(K): + * for yi in range(xi + 1): + * nobs = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1121 + * for yi in range(xi + 1): + * nobs = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i, xi] and mask[i, yi]: + * nobs += 1 + */ + __pyx_t_17 = __pyx_v_N; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + + /* "pandas/algos.pyx":1122 + * nobs = 0 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: # <<<<<<<<<<<<<< + * nobs += 1 + * + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_xi; + __pyx_t_21 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_21) { + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_yi; + __pyx_t_24 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + __pyx_t_25 = __pyx_t_24; + } else { + __pyx_t_25 = __pyx_t_21; + } + if (__pyx_t_25) { + + /* "pandas/algos.pyx":1123 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + * nobs += 1 # <<<<<<<<<<<<<< + * + * if nobs < minp: + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":1125 + * nobs += 1 + * + * if nobs < minp: # <<<<<<<<<<<<<< + * result[xi, yi] = result[yi, xi] = np.NaN + * else: + */ + __pyx_t_25 = ((__pyx_v_nobs < __pyx_v_minp) != 0); + if (__pyx_t_25) { + + /* "pandas/algos.pyx":1126 + * + * if nobs < minp: + * result[xi, yi] = result[yi, xi] = np.NaN # <<<<<<<<<<<<<< + * else: + * maskedx = np.empty(nobs, dtype=np.float64) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __pyx_v_xi; + __pyx_t_18 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __pyx_v_yi; + __pyx_t_28 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1128 + * result[xi, yi] = result[yi, xi] = np.NaN + * else: + * maskedx = np.empty(nobs, dtype=np.float64) # <<<<<<<<<<<<<< + * maskedy = np.empty(nobs, dtype=np.float64) + * j = 0 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_29 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_maskedx.diminfo[0].strides = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedx.diminfo[0].shape = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = 0; + __Pyx_XDECREF_SET(__pyx_v_maskedx, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":1129 + * else: + * maskedx = np.empty(nobs, dtype=np.float64) + * maskedy = np.empty(nobs, dtype=np.float64) # <<<<<<<<<<<<<< + * j = 0 + * for i in range(N): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_30 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_maskedy.diminfo[0].strides = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedy.diminfo[0].shape = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = 0; + __Pyx_XDECREF_SET(__pyx_v_maskedy, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1130 + * maskedx = np.empty(nobs, dtype=np.float64) + * maskedy = np.empty(nobs, dtype=np.float64) + * j = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + */ + __pyx_v_j = 0; + + /* "pandas/algos.pyx":1131 + * maskedy = np.empty(nobs, dtype=np.float64) + * j = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i, xi] and mask[i, yi]: + * maskedx[j] = mat[i, xi] + */ + __pyx_t_31 = __pyx_v_N; + for (__pyx_t_32 = 0; __pyx_t_32 < __pyx_t_31; __pyx_t_32+=1) { + __pyx_v_i = __pyx_t_32; + + /* "pandas/algos.pyx":1132 + * j = 0 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: # <<<<<<<<<<<<<< + * maskedx[j] = mat[i, xi] + * maskedy[j] = mat[i, yi] + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_xi; + __pyx_t_25 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_25) { + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_yi; + __pyx_t_21 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + __pyx_t_24 = __pyx_t_21; + } else { + __pyx_t_24 = __pyx_t_25; + } + if (__pyx_t_24) { + + /* "pandas/algos.pyx":1133 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + * maskedx[j] = mat[i, xi] # <<<<<<<<<<<<<< + * maskedy[j] = mat[i, yi] + * j += 1 + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_xi; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_maskedx.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_mat.diminfo[1].strides)); + + /* "pandas/algos.pyx":1134 + * if mask[i, xi] and mask[i, yi]: + * maskedx[j] = mat[i, xi] + * maskedy[j] = mat[i, yi] # <<<<<<<<<<<<<< + * j += 1 + * maskedx = rank_1d_float64(maskedx) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_yi; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_maskedy.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_mat.diminfo[1].strides)); + + /* "pandas/algos.pyx":1135 + * maskedx[j] = mat[i, xi] + * maskedy[j] = mat[i, yi] + * j += 1 # <<<<<<<<<<<<<< + * maskedx = rank_1d_float64(maskedx) + * maskedy = rank_1d_float64(maskedy) + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L15; + } + __pyx_L15:; + } + + /* "pandas/algos.pyx":1136 + * maskedy[j] = mat[i, yi] + * j += 1 + * maskedx = rank_1d_float64(maskedx) # <<<<<<<<<<<<<< + * maskedy = rank_1d_float64(maskedy) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_maskedx)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_maskedx)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_maskedx)); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_29 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_maskedx.diminfo[0].strides = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedx.diminfo[0].shape = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = 0; + __Pyx_DECREF_SET(__pyx_v_maskedx, ((PyArrayObject *)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "pandas/algos.pyx":1137 + * j += 1 + * maskedx = rank_1d_float64(maskedx) + * maskedy = rank_1d_float64(maskedy) # <<<<<<<<<<<<<< + * + * mean = (nobs + 1) / 2. + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_maskedy)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_maskedy)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_maskedy)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_30 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_maskedy.diminfo[0].strides = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedy.diminfo[0].shape = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = 0; + __Pyx_DECREF_SET(__pyx_v_maskedy, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1139 + * maskedy = rank_1d_float64(maskedy) + * + * mean = (nobs + 1) / 2. # <<<<<<<<<<<<<< + * + * # now the cov numerator + */ + __pyx_v_mean = ((__pyx_v_nobs + 1) / 2.); + + /* "pandas/algos.pyx":1142 + * + * # now the cov numerator + * sumx = sumxx = sumyy = 0 # <<<<<<<<<<<<<< + * + * for i in range(nobs): + */ + __pyx_v_sumx = 0; + __pyx_v_sumxx = 0; + __pyx_v_sumyy = 0; + + /* "pandas/algos.pyx":1144 + * sumx = sumxx = sumyy = 0 + * + * for i in range(nobs): # <<<<<<<<<<<<<< + * vx = maskedx[i] - mean + * vy = maskedy[i] - mean + */ + __pyx_t_43 = __pyx_v_nobs; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_43; __pyx_t_31+=1) { + __pyx_v_i = __pyx_t_31; + + /* "pandas/algos.pyx":1145 + * + * for i in range(nobs): + * vx = maskedx[i] - mean # <<<<<<<<<<<<<< + * vy = maskedy[i] - mean + * + */ + __pyx_t_32 = __pyx_v_i; + __pyx_v_vx = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maskedx.diminfo[0].strides)) - __pyx_v_mean); + + /* "pandas/algos.pyx":1146 + * for i in range(nobs): + * vx = maskedx[i] - mean + * vy = maskedy[i] - mean # <<<<<<<<<<<<<< + * + * sumx += vx * vy + */ + __pyx_t_44 = __pyx_v_i; + __pyx_v_vy = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_maskedy.diminfo[0].strides)) - __pyx_v_mean); + + /* "pandas/algos.pyx":1148 + * vy = maskedy[i] - mean + * + * sumx += vx * vy # <<<<<<<<<<<<<< + * sumxx += vx * vx + * sumyy += vy * vy + */ + __pyx_v_sumx = (__pyx_v_sumx + (__pyx_v_vx * __pyx_v_vy)); + + /* "pandas/algos.pyx":1149 + * + * sumx += vx * vy + * sumxx += vx * vx # <<<<<<<<<<<<<< + * sumyy += vy * vy + * + */ + __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx)); + + /* "pandas/algos.pyx":1150 + * sumx += vx * vy + * sumxx += vx * vx + * sumyy += vy * vy # <<<<<<<<<<<<<< + * + * divisor = sqrt(sumxx * sumyy) + */ + __pyx_v_sumyy = (__pyx_v_sumyy + (__pyx_v_vy * __pyx_v_vy)); + } + + /* "pandas/algos.pyx":1152 + * sumyy += vy * vy + * + * divisor = sqrt(sumxx * sumyy) # <<<<<<<<<<<<<< + * + * if divisor != 0: + */ + __pyx_v_divisor = sqrt((__pyx_v_sumxx * __pyx_v_sumyy)); + + /* "pandas/algos.pyx":1154 + * divisor = sqrt(sumxx * sumyy) + * + * if divisor != 0: # <<<<<<<<<<<<<< + * result[xi, yi] = result[yi, xi] = sumx / divisor + * else: + */ + __pyx_t_24 = ((__pyx_v_divisor != 0.0) != 0); + if (__pyx_t_24) { + + /* "pandas/algos.pyx":1155 + * + * if divisor != 0: + * result[xi, yi] = result[yi, xi] = sumx / divisor # <<<<<<<<<<<<<< + * else: + * result[xi, yi] = result[yi, xi] = np.NaN + */ + if (unlikely(__pyx_v_divisor == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = (__pyx_v_sumx / __pyx_v_divisor); + __pyx_t_31 = __pyx_v_xi; + __pyx_t_45 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __pyx_t_46 = __pyx_v_yi; + __pyx_t_47 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/algos.pyx":1157 + * result[xi, yi] = result[yi, xi] = sumx / divisor + * else: + * result[xi, yi] = result[yi, xi] = np.NaN # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_48 = __pyx_v_xi; + __pyx_t_49 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_50 = __pyx_v_yi; + __pyx_t_51 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L18:; + } + __pyx_L12:; + } + } + + /* "pandas/algos.pyx":1159 + * result[xi, yi] = result[yi, xi] = np.NaN + * + * return result # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":1103 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.nancorr_spearman", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_maskedx); + __Pyx_XDECREF((PyObject *)__pyx_v_maskedy); + __Pyx_XDECREF((PyObject *)__pyx_v_mask); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1164 + * # Rolling variance + * + * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1): # <<<<<<<<<<<<<< + * """ + * Numerically stable implementation using Welford's method. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_33roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_32roll_var[] = "\n Numerically stable implementation using Welford's method.\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_33roll_var = {__Pyx_NAMESTR("roll_var"), (PyCFunction)__pyx_pw_6pandas_5algos_33roll_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_32roll_var)}; +static PyObject *__pyx_pw_6pandas_5algos_33roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_v_ddof; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_var (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_ddof,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ddof); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[3]) { + __pyx_v_ddof = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_ddof == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_ddof = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_32roll_var(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_ddof); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_32roll_var(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, int __pyx_v_ddof) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_mean_x; + double __pyx_v_ssqdm_x; + double __pyx_v_nobs; + double __pyx_v_delta; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + double __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_var", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1168 + * Numerically stable implementation using Welford's method. + * """ + * cdef double val, prev, mean_x = 0, ssqdm_x = 0, nobs = 0, delta # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef Py_ssize_t N = len(input) + */ + __pyx_v_mean_x = 0.0; + __pyx_v_ssqdm_x = 0.0; + __pyx_v_nobs = 0.0; + + /* "pandas/algos.pyx":1170 + * cdef double val, prev, mean_x = 0, ssqdm_x = 0, nobs = 0, delta + * cdef Py_ssize_t i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1172 + * cdef Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1174 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * # Check for windows larger than array, addresses #7297 + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1177 + * + * # Check for windows larger than array, addresses #7297 + * win = min(win, N) # <<<<<<<<<<<<<< + * + * # Over the first window, observations can only be added, never removed + */ + __pyx_t_1 = __pyx_v_N; + __pyx_t_8 = __pyx_v_win; + if (((__pyx_t_1 < __pyx_t_8) != 0)) { + __pyx_t_9 = __pyx_t_1; + } else { + __pyx_t_9 = __pyx_t_8; + } + __pyx_v_win = __pyx_t_9; + + /* "pandas/algos.pyx":1180 + * + * # Over the first window, observations can only be added, never removed + * for i from 0 <= i < win: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_8 = __pyx_v_win; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) { + + /* "pandas/algos.pyx":1181 + * # Over the first window, observations can only be added, never removed + * for i from 0 <= i < win: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1184 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * delta = (val - mean_x) + */ + __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1185 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * delta = (val - mean_x) + * mean_x += delta / nobs + */ + __pyx_v_nobs = (__pyx_v_nobs + 1.0); + + /* "pandas/algos.pyx":1186 + * if val == val: + * nobs += 1 + * delta = (val - mean_x) # <<<<<<<<<<<<<< + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) + */ + __pyx_v_delta = (__pyx_v_val - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1187 + * nobs += 1 + * delta = (val - mean_x) + * mean_x += delta / nobs # <<<<<<<<<<<<<< + * ssqdm_x += delta * (val - mean_x) + * + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs)); + + /* "pandas/algos.pyx":1188 + * delta = (val - mean_x) + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + (__pyx_v_delta * (__pyx_v_val - __pyx_v_mean_x))); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1190 + * ssqdm_x += delta * (val - mean_x) + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * #pathological case + * if nobs == 1: + */ + __pyx_t_11 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1192 + * if nobs >= minp: + * #pathological case + * if nobs == 1: # <<<<<<<<<<<<<< + * val = 0 + * else: + */ + __pyx_t_11 = ((__pyx_v_nobs == 1.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1193 + * #pathological case + * if nobs == 1: + * val = 0 # <<<<<<<<<<<<<< + * else: + * val = ssqdm_x / (nobs - ddof) + */ + __pyx_v_val = 0.0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/algos.pyx":1195 + * val = 0 + * else: + * val = ssqdm_x / (nobs - ddof) # <<<<<<<<<<<<<< + * if val < 0: + * val = 0 + */ + __pyx_t_12 = (__pyx_v_nobs - __pyx_v_ddof); + if (unlikely(__pyx_t_12 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (__pyx_v_ssqdm_x / __pyx_t_12); + + /* "pandas/algos.pyx":1196 + * else: + * val = ssqdm_x / (nobs - ddof) + * if val < 0: # <<<<<<<<<<<<<< + * val = 0 + * else: + */ + __pyx_t_11 = ((__pyx_v_val < 0.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1197 + * val = ssqdm_x / (nobs - ddof) + * if val < 0: + * val = 0 # <<<<<<<<<<<<<< + * else: + * val = NaN + */ + __pyx_v_val = 0.0; + goto __pyx_L8; + } + __pyx_L8:; + } + __pyx_L7:; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/algos.pyx":1199 + * val = 0 + * else: + * val = NaN # <<<<<<<<<<<<<< + * + * output[i] = val + */ + __pyx_v_val = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L6:; + + /* "pandas/algos.pyx":1201 + * val = NaN + * + * output[i] = val # <<<<<<<<<<<<<< + * + * # After the first window, observations can both be added and removed + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_val; + } + + /* "pandas/algos.pyx":1204 + * + * # After the first window, observations can both be added and removed + * for i from win <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * prev = input[i - win] + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_v_i = __pyx_v_win; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { + + /* "pandas/algos.pyx":1205 + * # After the first window, observations can both be added and removed + * for i from win <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * prev = input[i - win] + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1206 + * for i from win <= i < N: + * val = input[i] + * prev = input[i - win] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_15 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1208 + * prev = input[i - win] + * + * if val == val: # <<<<<<<<<<<<<< + * if prev == prev: + * # Adding one observation and removing another one + */ + __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1209 + * + * if val == val: + * if prev == prev: # <<<<<<<<<<<<<< + * # Adding one observation and removing another one + * delta = val - prev + */ + __pyx_t_11 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1211 + * if prev == prev: + * # Adding one observation and removing another one + * delta = val - prev # <<<<<<<<<<<<<< + * prev -= mean_x + * mean_x += delta / nobs + */ + __pyx_v_delta = (__pyx_v_val - __pyx_v_prev); + + /* "pandas/algos.pyx":1212 + * # Adding one observation and removing another one + * delta = val - prev + * prev -= mean_x # <<<<<<<<<<<<<< + * mean_x += delta / nobs + * val -= mean_x + */ + __pyx_v_prev = (__pyx_v_prev - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1213 + * delta = val - prev + * prev -= mean_x + * mean_x += delta / nobs # <<<<<<<<<<<<<< + * val -= mean_x + * ssqdm_x += (val + prev) * delta + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs)); + + /* "pandas/algos.pyx":1214 + * prev -= mean_x + * mean_x += delta / nobs + * val -= mean_x # <<<<<<<<<<<<<< + * ssqdm_x += (val + prev) * delta + * else: + */ + __pyx_v_val = (__pyx_v_val - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1215 + * mean_x += delta / nobs + * val -= mean_x + * ssqdm_x += (val + prev) * delta # <<<<<<<<<<<<<< + * else: + * # Adding one observation and not removing any + */ + __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + ((__pyx_v_val + __pyx_v_prev) * __pyx_v_delta)); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1218 + * else: + * # Adding one observation and not removing any + * nobs += 1 # <<<<<<<<<<<<<< + * delta = (val - mean_x) + * mean_x += delta / nobs + */ + __pyx_v_nobs = (__pyx_v_nobs + 1.0); + + /* "pandas/algos.pyx":1219 + * # Adding one observation and not removing any + * nobs += 1 + * delta = (val - mean_x) # <<<<<<<<<<<<<< + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) + */ + __pyx_v_delta = (__pyx_v_val - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1220 + * nobs += 1 + * delta = (val - mean_x) + * mean_x += delta / nobs # <<<<<<<<<<<<<< + * ssqdm_x += delta * (val - mean_x) + * elif prev == prev: + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs)); + + /* "pandas/algos.pyx":1221 + * delta = (val - mean_x) + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) # <<<<<<<<<<<<<< + * elif prev == prev: + * # Adding no new observation, but removing one + */ + __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + (__pyx_v_delta * (__pyx_v_val - __pyx_v_mean_x))); + } + __pyx_L12:; + goto __pyx_L11; + } + + /* "pandas/algos.pyx":1222 + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) + * elif prev == prev: # <<<<<<<<<<<<<< + * # Adding no new observation, but removing one + * nobs -= 1 + */ + __pyx_t_11 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1224 + * elif prev == prev: + * # Adding no new observation, but removing one + * nobs -= 1 # <<<<<<<<<<<<<< + * if nobs: + * delta = (prev - mean_x) + */ + __pyx_v_nobs = (__pyx_v_nobs - 1.0); + + /* "pandas/algos.pyx":1225 + * # Adding no new observation, but removing one + * nobs -= 1 + * if nobs: # <<<<<<<<<<<<<< + * delta = (prev - mean_x) + * mean_x -= delta / nobs + */ + __pyx_t_11 = (__pyx_v_nobs != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1226 + * nobs -= 1 + * if nobs: + * delta = (prev - mean_x) # <<<<<<<<<<<<<< + * mean_x -= delta / nobs + * ssqdm_x -= delta * (prev - mean_x) + */ + __pyx_v_delta = (__pyx_v_prev - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1227 + * if nobs: + * delta = (prev - mean_x) + * mean_x -= delta / nobs # <<<<<<<<<<<<<< + * ssqdm_x -= delta * (prev - mean_x) + * else: + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mean_x = (__pyx_v_mean_x - (__pyx_v_delta / __pyx_v_nobs)); + + /* "pandas/algos.pyx":1228 + * delta = (prev - mean_x) + * mean_x -= delta / nobs + * ssqdm_x -= delta * (prev - mean_x) # <<<<<<<<<<<<<< + * else: + * mean_x = 0 + */ + __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x - (__pyx_v_delta * (__pyx_v_prev - __pyx_v_mean_x))); + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1230 + * ssqdm_x -= delta * (prev - mean_x) + * else: + * mean_x = 0 # <<<<<<<<<<<<<< + * ssqdm_x = 0 + * # Variance is unchanged if no observation is added or removed + */ + __pyx_v_mean_x = 0.0; + + /* "pandas/algos.pyx":1231 + * else: + * mean_x = 0 + * ssqdm_x = 0 # <<<<<<<<<<<<<< + * # Variance is unchanged if no observation is added or removed + * + */ + __pyx_v_ssqdm_x = 0.0; + } + __pyx_L13:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":1234 + * # Variance is unchanged if no observation is added or removed + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * #pathological case + * if nobs == 1: + */ + __pyx_t_11 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1236 + * if nobs >= minp: + * #pathological case + * if nobs == 1: # <<<<<<<<<<<<<< + * val = 0 + * else: + */ + __pyx_t_11 = ((__pyx_v_nobs == 1.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1237 + * #pathological case + * if nobs == 1: + * val = 0 # <<<<<<<<<<<<<< + * else: + * val = ssqdm_x / (nobs - ddof) + */ + __pyx_v_val = 0.0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/algos.pyx":1239 + * val = 0 + * else: + * val = ssqdm_x / (nobs - ddof) # <<<<<<<<<<<<<< + * if val < 0: + * val = 0 + */ + __pyx_t_12 = (__pyx_v_nobs - __pyx_v_ddof); + if (unlikely(__pyx_t_12 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (__pyx_v_ssqdm_x / __pyx_t_12); + + /* "pandas/algos.pyx":1240 + * else: + * val = ssqdm_x / (nobs - ddof) + * if val < 0: # <<<<<<<<<<<<<< + * val = 0 + * else: + */ + __pyx_t_11 = ((__pyx_v_val < 0.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1241 + * val = ssqdm_x / (nobs - ddof) + * if val < 0: + * val = 0 # <<<<<<<<<<<<<< + * else: + * val = NaN + */ + __pyx_v_val = 0.0; + goto __pyx_L16; + } + __pyx_L16:; + } + __pyx_L15:; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/algos.pyx":1243 + * val = 0 + * else: + * val = NaN # <<<<<<<<<<<<<< + * + * output[i] = val + */ + __pyx_v_val = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L14:; + + /* "pandas/algos.pyx":1245 + * val = NaN + * + * output[i] = val # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_val; + } + + /* "pandas/algos.pyx":1247 + * output[i] = val + * + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1164 + * # Rolling variance + * + * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1): # <<<<<<<<<<<<<< + * """ + * Numerically stable implementation using Welford's method. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1253 + * # Rolling skewness + * + * def roll_skew(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_35roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_35roll_skew = {__Pyx_NAMESTR("roll_skew"), (PyCFunction)__pyx_pw_6pandas_5algos_35roll_skew, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_35roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_skew (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_skew") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_34roll_skew(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_34roll_skew(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_x; + double __pyx_v_xx; + double __pyx_v_xxx; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + double __pyx_v_A; + double __pyx_v_B; + double __pyx_v_C; + double __pyx_v_R; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + double __pyx_t_18; + double __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_skew", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1255 + * def roll_skew(ndarray[double_t] input, int win, int minp): + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) + */ + __pyx_v_x = 0.0; + __pyx_v_xx = 0.0; + __pyx_v_xxx = 0.0; + + /* "pandas/algos.pyx":1256 + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + * cdef Py_ssize_t nobs = 0, i # <<<<<<<<<<<<<< + * cdef Py_ssize_t N = len(input) + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1257 + * cdef double x = 0, xx = 0, xxx = 0 + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1259 + * cdef Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * # 3 components of the skewness equation + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1264 + * cdef double A, B, C, R + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1266 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1267 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1270 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1271 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * x += val + * xx += val * val + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1272 + * if val == val: + * nobs += 1 + * x += val # <<<<<<<<<<<<<< + * xx += val * val + * xxx += val * val * val + */ + __pyx_v_x = (__pyx_v_x + __pyx_v_val); + + /* "pandas/algos.pyx":1273 + * nobs += 1 + * x += val + * xx += val * val # <<<<<<<<<<<<<< + * xxx += val * val * val + * + */ + __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val)); + + /* "pandas/algos.pyx":1274 + * x += val + * xx += val * val + * xxx += val * val * val # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1276 + * xxx += val * val * val + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1278 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1279 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1281 + * val = input[i] + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1282 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * x += val + * xx += val * val + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1283 + * if val == val: + * nobs += 1 + * x += val # <<<<<<<<<<<<<< + * xx += val * val + * xxx += val * val * val + */ + __pyx_v_x = (__pyx_v_x + __pyx_v_val); + + /* "pandas/algos.pyx":1284 + * nobs += 1 + * x += val + * xx += val * val # <<<<<<<<<<<<<< + * xxx += val * val * val + * + */ + __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val)); + + /* "pandas/algos.pyx":1285 + * x += val + * xx += val * val + * xxx += val * val * val # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1287 + * xxx += val * val * val + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * if prev == prev: + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1288 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * if prev == prev: + * x -= prev + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1289 + * if i > win - 1: + * prev = input[i - win] + * if prev == prev: # <<<<<<<<<<<<<< + * x -= prev + * xx -= prev * prev + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1290 + * prev = input[i - win] + * if prev == prev: + * x -= prev # <<<<<<<<<<<<<< + * xx -= prev * prev + * xxx -= prev * prev * prev + */ + __pyx_v_x = (__pyx_v_x - __pyx_v_prev); + + /* "pandas/algos.pyx":1291 + * if prev == prev: + * x -= prev + * xx -= prev * prev # <<<<<<<<<<<<<< + * xxx -= prev * prev * prev + * + */ + __pyx_v_xx = (__pyx_v_xx - (__pyx_v_prev * __pyx_v_prev)); + + /* "pandas/algos.pyx":1292 + * x -= prev + * xx -= prev * prev + * xxx -= prev * prev * prev # <<<<<<<<<<<<<< + * + * nobs -= 1 + */ + __pyx_v_xxx = (__pyx_v_xxx - ((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev)); + + /* "pandas/algos.pyx":1294 + * xxx -= prev * prev * prev + * + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1296 + * nobs -= 1 + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * A = x / nobs + * B = xx / nobs - A * A + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1297 + * + * if nobs >= minp: + * A = x / nobs # <<<<<<<<<<<<<< + * B = xx / nobs - A * A + * C = xxx / nobs - A * A * A - 3 * A * B + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_A = (__pyx_v_x / __pyx_v_nobs); + + /* "pandas/algos.pyx":1298 + * if nobs >= minp: + * A = x / nobs + * B = xx / nobs - A * A # <<<<<<<<<<<<<< + * C = xxx / nobs - A * A * A - 3 * A * B + * + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - (__pyx_v_A * __pyx_v_A)); + + /* "pandas/algos.pyx":1299 + * A = x / nobs + * B = xx / nobs - A * A + * C = xxx / nobs - A * A * A - 3 * A * B # <<<<<<<<<<<<<< + * + * R = sqrt(B) + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_C = (((__pyx_v_xxx / __pyx_v_nobs) - ((__pyx_v_A * __pyx_v_A) * __pyx_v_A)) - ((3.0 * __pyx_v_A) * __pyx_v_B)); + + /* "pandas/algos.pyx":1301 + * C = xxx / nobs - A * A * A - 3 * A * B + * + * R = sqrt(B) # <<<<<<<<<<<<<< + * + * if B == 0 or nobs < 3: + */ + __pyx_v_R = sqrt(__pyx_v_B); + + /* "pandas/algos.pyx":1303 + * R = sqrt(B) + * + * if B == 0 or nobs < 3: # <<<<<<<<<<<<<< + * output[i] = NaN + * else: + */ + __pyx_t_10 = ((__pyx_v_B == 0.0) != 0); + if (!__pyx_t_10) { + __pyx_t_15 = ((__pyx_v_nobs < 3) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_10; + } + if (__pyx_t_16) { + + /* "pandas/algos.pyx":1304 + * + * if B == 0 or nobs < 3: + * output[i] = NaN # <<<<<<<<<<<<<< + * else: + * output[i] = ((sqrt(nobs * (nobs - 1.)) * C) / + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1306 + * output[i] = NaN + * else: + * output[i] = ((sqrt(nobs * (nobs - 1.)) * C) / # <<<<<<<<<<<<<< + * ((nobs-2) * R * R * R)) + * else: + */ + __pyx_t_18 = (sqrt((__pyx_v_nobs * (__pyx_v_nobs - 1.))) * __pyx_v_C); + + /* "pandas/algos.pyx":1307 + * else: + * output[i] = ((sqrt(nobs * (nobs - 1.)) * C) / + * ((nobs-2) * R * R * R)) # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_19 = ((((__pyx_v_nobs - 2) * __pyx_v_R) * __pyx_v_R) * __pyx_v_R); + + /* "pandas/algos.pyx":1306 + * output[i] = NaN + * else: + * output[i] = ((sqrt(nobs * (nobs - 1.)) * C) / # <<<<<<<<<<<<<< + * ((nobs-2) * R * R * R)) + * else: + */ + if (unlikely(__pyx_t_19 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_t_18 / __pyx_t_19); + } + __pyx_L12:; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":1309 + * ((nobs-2) * R * R * R)) + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":1311 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1253 + * # Rolling skewness + * + * def roll_skew(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1317 + * + * + * def roll_kurt(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef double val, prev + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_37roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_37roll_kurt = {__Pyx_NAMESTR("roll_kurt"), (PyCFunction)__pyx_pw_6pandas_5algos_37roll_kurt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_37roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_kurt (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_kurt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_36roll_kurt(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_36roll_kurt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_x; + double __pyx_v_xx; + double __pyx_v_xxx; + double __pyx_v_xxxx; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + double __pyx_v_A; + double __pyx_v_B; + double __pyx_v_C; + double __pyx_v_D; + double __pyx_v_R; + double __pyx_v_K; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + double __pyx_t_18; + double __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_kurt", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1320 + * int win, int minp): + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0, xxxx = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) + */ + __pyx_v_x = 0.0; + __pyx_v_xx = 0.0; + __pyx_v_xxx = 0.0; + __pyx_v_xxxx = 0.0; + + /* "pandas/algos.pyx":1321 + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0, xxxx = 0 + * cdef Py_ssize_t nobs = 0, i # <<<<<<<<<<<<<< + * cdef Py_ssize_t N = len(input) + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1322 + * cdef double x = 0, xx = 0, xxx = 0, xxxx = 0 + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1324 + * cdef Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * # 5 components of the kurtosis equation + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1329 + * cdef double A, B, C, D, R, K + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1331 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1332 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1335 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1336 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * + * # seriously don't ask me why this is faster + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1339 + * + * # seriously don't ask me why this is faster + * x += val # <<<<<<<<<<<<<< + * xx += val * val + * xxx += val * val * val + */ + __pyx_v_x = (__pyx_v_x + __pyx_v_val); + + /* "pandas/algos.pyx":1340 + * # seriously don't ask me why this is faster + * x += val + * xx += val * val # <<<<<<<<<<<<<< + * xxx += val * val * val + * xxxx += val * val * val * val + */ + __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val)); + + /* "pandas/algos.pyx":1341 + * x += val + * xx += val * val + * xxx += val * val * val # <<<<<<<<<<<<<< + * xxxx += val * val * val * val + * + */ + __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); + + /* "pandas/algos.pyx":1342 + * xx += val * val + * xxx += val * val * val + * xxxx += val * val * val * val # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_v_xxxx = (__pyx_v_xxxx + (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val)); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1344 + * xxxx += val * val * val * val + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1346 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1347 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1349 + * val = input[i] + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1350 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * x += val + * xx += val * val + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1351 + * if val == val: + * nobs += 1 + * x += val # <<<<<<<<<<<<<< + * xx += val * val + * xxx += val * val * val + */ + __pyx_v_x = (__pyx_v_x + __pyx_v_val); + + /* "pandas/algos.pyx":1352 + * nobs += 1 + * x += val + * xx += val * val # <<<<<<<<<<<<<< + * xxx += val * val * val + * xxxx += val * val * val * val + */ + __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val)); + + /* "pandas/algos.pyx":1353 + * x += val + * xx += val * val + * xxx += val * val * val # <<<<<<<<<<<<<< + * xxxx += val * val * val * val + * + */ + __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); + + /* "pandas/algos.pyx":1354 + * xx += val * val + * xxx += val * val * val + * xxxx += val * val * val * val # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_v_xxxx = (__pyx_v_xxxx + (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val)); + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1356 + * xxxx += val * val * val * val + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * if prev == prev: + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1357 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * if prev == prev: + * x -= prev + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1358 + * if i > win - 1: + * prev = input[i - win] + * if prev == prev: # <<<<<<<<<<<<<< + * x -= prev + * xx -= prev * prev + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1359 + * prev = input[i - win] + * if prev == prev: + * x -= prev # <<<<<<<<<<<<<< + * xx -= prev * prev + * xxx -= prev * prev * prev + */ + __pyx_v_x = (__pyx_v_x - __pyx_v_prev); + + /* "pandas/algos.pyx":1360 + * if prev == prev: + * x -= prev + * xx -= prev * prev # <<<<<<<<<<<<<< + * xxx -= prev * prev * prev + * xxxx -= prev * prev * prev * prev + */ + __pyx_v_xx = (__pyx_v_xx - (__pyx_v_prev * __pyx_v_prev)); + + /* "pandas/algos.pyx":1361 + * x -= prev + * xx -= prev * prev + * xxx -= prev * prev * prev # <<<<<<<<<<<<<< + * xxxx -= prev * prev * prev * prev + * + */ + __pyx_v_xxx = (__pyx_v_xxx - ((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev)); + + /* "pandas/algos.pyx":1362 + * xx -= prev * prev + * xxx -= prev * prev * prev + * xxxx -= prev * prev * prev * prev # <<<<<<<<<<<<<< + * + * nobs -= 1 + */ + __pyx_v_xxxx = (__pyx_v_xxxx - (((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev) * __pyx_v_prev)); + + /* "pandas/algos.pyx":1364 + * xxxx -= prev * prev * prev * prev + * + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1366 + * nobs -= 1 + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * A = x / nobs + * R = A * A + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1367 + * + * if nobs >= minp: + * A = x / nobs # <<<<<<<<<<<<<< + * R = A * A + * B = xx / nobs - R + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_A = (__pyx_v_x / __pyx_v_nobs); + + /* "pandas/algos.pyx":1368 + * if nobs >= minp: + * A = x / nobs + * R = A * A # <<<<<<<<<<<<<< + * B = xx / nobs - R + * R = R * A + */ + __pyx_v_R = (__pyx_v_A * __pyx_v_A); + + /* "pandas/algos.pyx":1369 + * A = x / nobs + * R = A * A + * B = xx / nobs - R # <<<<<<<<<<<<<< + * R = R * A + * C = xxx / nobs - R - 3 * A * B + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - __pyx_v_R); + + /* "pandas/algos.pyx":1370 + * R = A * A + * B = xx / nobs - R + * R = R * A # <<<<<<<<<<<<<< + * C = xxx / nobs - R - 3 * A * B + * R = R * A + */ + __pyx_v_R = (__pyx_v_R * __pyx_v_A); + + /* "pandas/algos.pyx":1371 + * B = xx / nobs - R + * R = R * A + * C = xxx / nobs - R - 3 * A * B # <<<<<<<<<<<<<< + * R = R * A + * D = xxxx / nobs - R - 6*B*A*A - 4*C*A + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_C = (((__pyx_v_xxx / __pyx_v_nobs) - __pyx_v_R) - ((3.0 * __pyx_v_A) * __pyx_v_B)); + + /* "pandas/algos.pyx":1372 + * R = R * A + * C = xxx / nobs - R - 3 * A * B + * R = R * A # <<<<<<<<<<<<<< + * D = xxxx / nobs - R - 6*B*A*A - 4*C*A + * + */ + __pyx_v_R = (__pyx_v_R * __pyx_v_A); + + /* "pandas/algos.pyx":1373 + * C = xxx / nobs - R - 3 * A * B + * R = R * A + * D = xxxx / nobs - R - 6*B*A*A - 4*C*A # <<<<<<<<<<<<<< + * + * if B == 0 or nobs < 4: + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_D = ((((__pyx_v_xxxx / __pyx_v_nobs) - __pyx_v_R) - (((6.0 * __pyx_v_B) * __pyx_v_A) * __pyx_v_A)) - ((4.0 * __pyx_v_C) * __pyx_v_A)); + + /* "pandas/algos.pyx":1375 + * D = xxxx / nobs - R - 6*B*A*A - 4*C*A + * + * if B == 0 or nobs < 4: # <<<<<<<<<<<<<< + * output[i] = NaN + * + */ + __pyx_t_10 = ((__pyx_v_B == 0.0) != 0); + if (!__pyx_t_10) { + __pyx_t_15 = ((__pyx_v_nobs < 4) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_10; + } + if (__pyx_t_16) { + + /* "pandas/algos.pyx":1376 + * + * if B == 0 or nobs < 4: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1379 + * + * else: + * K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2) # <<<<<<<<<<<<<< + * K = K / ((nobs - 2.)*(nobs-3.)) + * + */ + __pyx_t_18 = (((__pyx_v_nobs * __pyx_v_nobs) - 1.) * __pyx_v_D); + __pyx_t_19 = (__pyx_v_B * __pyx_v_B); + if (unlikely(__pyx_t_19 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_K = ((__pyx_t_18 / __pyx_t_19) - (3.0 * pow((__pyx_v_nobs - 1.), 2.0))); + + /* "pandas/algos.pyx":1380 + * else: + * K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2) + * K = K / ((nobs - 2.)*(nobs-3.)) # <<<<<<<<<<<<<< + * + * output[i] = K + */ + __pyx_t_19 = ((__pyx_v_nobs - 2.) * (__pyx_v_nobs - 3.)); + if (unlikely(__pyx_t_19 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_K = (__pyx_v_K / __pyx_t_19); + + /* "pandas/algos.pyx":1382 + * K = K / ((nobs - 2.)*(nobs-3.)) + * + * output[i] = K # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_K; + } + __pyx_L12:; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":1385 + * + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":1387 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1317 + * + * + * def roll_kurt(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef double val, prev + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1394 + * ctypedef double_t (* skiplist_f)(object sl, int n, int p) + * + * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op): # <<<<<<<<<<<<<< + * cdef ndarray[double_t] input = arg + * cdef double val, prev, midpoint + */ + +static PyObject *__pyx_f_6pandas_5algos__roll_skiplist_op(PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp, __pyx_t_6pandas_5algos_skiplist_f __pyx_v_op) { + PyArrayObject *__pyx_v_input = 0; + double __pyx_v_val; + double __pyx_v_prev; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_skiplist = 0; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_roll_skiplist_op", 0); + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + + /* "pandas/algos.pyx":1395 + * + * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op): + * cdef ndarray[double_t] input = arg # <<<<<<<<<<<<<< + * cdef double val, prev, midpoint + * cdef IndexableSkiplist skiplist + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_arg), &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_input = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + } + } + __Pyx_INCREF(((PyObject *)__pyx_v_arg)); + __pyx_v_input = ((PyArrayObject *)__pyx_v_arg); + + /* "pandas/algos.pyx":1398 + * cdef double val, prev, midpoint + * cdef IndexableSkiplist skiplist + * cdef Py_ssize_t nobs = 0, i # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t N = len(input) + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1400 + * cdef Py_ssize_t nobs = 0, i + * + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1401 + * + * cdef Py_ssize_t N = len(input) + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * skiplist = IndexableSkiplist(win) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1403 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * skiplist = IndexableSkiplist(win) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_IndexableSkiplist)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1405 + * skiplist = IndexableSkiplist(win) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1407 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1408 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1411 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist.insert(val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1412 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist.insert(val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1413 + * if val == val: + * nobs += 1 + * skiplist.insert(val) # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1415 + * skiplist.insert(val) + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1417 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1418 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1420 + * val = input[i] + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1421 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * + * if prev == prev: + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1423 + * prev = input[i - win] + * + * if prev == prev: # <<<<<<<<<<<<<< + * skiplist.remove(prev) + * nobs -= 1 + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1424 + * + * if prev == prev: + * skiplist.remove(prev) # <<<<<<<<<<<<<< + * nobs -= 1 + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1425 + * if prev == prev: + * skiplist.remove(prev) + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1427 + * nobs -= 1 + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist.insert(val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1428 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist.insert(val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1429 + * if val == val: + * nobs += 1 + * skiplist.insert(val) # <<<<<<<<<<<<<< + * + * output[i] = op(skiplist, nobs, minp) + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/algos.pyx":1431 + * skiplist.insert(val) + * + * output[i] = op(skiplist, nobs, minp) # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_op(((PyObject *)__pyx_v_skiplist), __pyx_v_nobs, __pyx_v_minp); + } + + /* "pandas/algos.pyx":1433 + * output[i] = op(skiplist, nobs, minp) + * + * return output # <<<<<<<<<<<<<< + * + * from skiplist cimport * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1394 + * ctypedef double_t (* skiplist_f)(object sl, int n, int p) + * + * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op): # <<<<<<<<<<<<<< + * cdef ndarray[double_t] input = arg + * cdef double val, prev, midpoint + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos._roll_skiplist_op", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_input); + __Pyx_XDECREF((PyObject *)__pyx_v_skiplist); + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1437 + * from skiplist cimport * + * + * def roll_median_c(ndarray[float64_t] arg, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, res, prev + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_39roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_39roll_median_c = {__Pyx_NAMESTR("roll_median_c"), (PyCFunction)__pyx_pw_6pandas_5algos_39roll_median_c, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_39roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arg = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_median_c (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arg,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_median_c") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_arg = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_5numpy_ndarray, 1, "arg", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_38roll_median_c(__pyx_self, __pyx_v_arg, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_38roll_median_c(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_res; + double __pyx_v_prev; + int __pyx_v_ret; + skiplist_t *__pyx_v_sl; + Py_ssize_t __pyx_v_midpoint; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arg; + __Pyx_Buffer __pyx_pybuffer_arg; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_median_c", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_arg.pybuffer.buf = NULL; + __pyx_pybuffer_arg.refcount = 0; + __pyx_pybuffernd_arg.data = NULL; + __pyx_pybuffernd_arg.rcbuffer = &__pyx_pybuffer_arg; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arg.rcbuffer->pybuffer, (PyObject*)__pyx_v_arg, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arg.diminfo[0].strides = __pyx_pybuffernd_arg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arg.diminfo[0].shape = __pyx_pybuffernd_arg.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1440 + * cdef double val, res, prev + * cdef: + * int ret=0 # <<<<<<<<<<<<<< + * skiplist_t *sl + * Py_ssize_t midpoint, nobs = 0, i + */ + __pyx_v_ret = 0; + + /* "pandas/algos.pyx":1442 + * int ret=0 + * skiplist_t *sl + * Py_ssize_t midpoint, nobs = 0, i # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1445 + * + * + * cdef Py_ssize_t N = len(arg) # <<<<<<<<<<<<<< + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arg)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1446 + * + * cdef Py_ssize_t N = len(arg) + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * sl = skiplist_init(win) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1448 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * sl = skiplist_init(win) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_v_sl = skiplist_init(__pyx_v_win); + + /* "pandas/algos.pyx":1450 + * sl = skiplist_init(win) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1452 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = arg[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1453 + * + * for i from 0 <= i < minp - 1: + * val = arg[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_arg.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_arg.diminfo[0].strides)); + + /* "pandas/algos.pyx":1456 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist_insert(sl, val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1457 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist_insert(sl, val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1458 + * if val == val: + * nobs += 1 + * skiplist_insert(sl, val) # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + skiplist_insert(__pyx_v_sl, __pyx_v_val); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1460 + * skiplist_insert(sl, val) + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1462 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = arg[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1463 + * + * for i from minp - 1 <= i < N: + * val = arg[i] # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_arg.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arg.diminfo[0].strides)); + + /* "pandas/algos.pyx":1465 + * val = arg[i] + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = arg[i - win] + * + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1466 + * + * if i > win - 1: + * prev = arg[i - win] # <<<<<<<<<<<<<< + * + * if prev == prev: + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arg.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arg.diminfo[0].strides)); + + /* "pandas/algos.pyx":1468 + * prev = arg[i - win] + * + * if prev == prev: # <<<<<<<<<<<<<< + * skiplist_remove(sl, prev) + * nobs -= 1 + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1469 + * + * if prev == prev: + * skiplist_remove(sl, prev) # <<<<<<<<<<<<<< + * nobs -= 1 + * + */ + skiplist_remove(__pyx_v_sl, __pyx_v_prev); + + /* "pandas/algos.pyx":1470 + * if prev == prev: + * skiplist_remove(sl, prev) + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1472 + * nobs -= 1 + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist_insert(sl, val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1473 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist_insert(sl, val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1474 + * if val == val: + * nobs += 1 + * skiplist_insert(sl, val) # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + skiplist_insert(__pyx_v_sl, __pyx_v_val); + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/algos.pyx":1476 + * skiplist_insert(sl, val) + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * midpoint = nobs / 2 + * if nobs % 2: + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1477 + * + * if nobs >= minp: + * midpoint = nobs / 2 # <<<<<<<<<<<<<< + * if nobs % 2: + * res = skiplist_get(sl, midpoint, &ret) + */ + __pyx_v_midpoint = __Pyx_div_Py_ssize_t(__pyx_v_nobs, 2); + + /* "pandas/algos.pyx":1478 + * if nobs >= minp: + * midpoint = nobs / 2 + * if nobs % 2: # <<<<<<<<<<<<<< + * res = skiplist_get(sl, midpoint, &ret) + * else: + */ + __pyx_t_10 = (__Pyx_mod_Py_ssize_t(__pyx_v_nobs, 2) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1479 + * midpoint = nobs / 2 + * if nobs % 2: + * res = skiplist_get(sl, midpoint, &ret) # <<<<<<<<<<<<<< + * else: + * res = (skiplist_get(sl, midpoint, &ret) + + */ + __pyx_v_res = skiplist_get(__pyx_v_sl, __pyx_v_midpoint, (&__pyx_v_ret)); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1482 + * else: + * res = (skiplist_get(sl, midpoint, &ret) + + * skiplist_get(sl, (midpoint - 1), &ret)) / 2 # <<<<<<<<<<<<<< + * else: + * res = NaN + */ + __pyx_v_res = ((skiplist_get(__pyx_v_sl, __pyx_v_midpoint, (&__pyx_v_ret)) + skiplist_get(__pyx_v_sl, (__pyx_v_midpoint - 1), (&__pyx_v_ret))) / 2.0); + } + __pyx_L12:; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":1484 + * skiplist_get(sl, (midpoint - 1), &ret)) / 2 + * else: + * res = NaN # <<<<<<<<<<<<<< + * + * output[i] = res + */ + __pyx_v_res = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + + /* "pandas/algos.pyx":1486 + * res = NaN + * + * output[i] = res # <<<<<<<<<<<<<< + * + * skiplist_destroy(sl) + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_res; + } + + /* "pandas/algos.pyx":1488 + * output[i] = res + * + * skiplist_destroy(sl) # <<<<<<<<<<<<<< + * + * return output + */ + skiplist_destroy(__pyx_v_sl); + + /* "pandas/algos.pyx":1490 + * skiplist_destroy(sl) + * + * return output # <<<<<<<<<<<<<< + * + * def roll_median_cython(ndarray input, int win, int minp): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1437 + * from skiplist cimport * + * + * def roll_median_c(ndarray[float64_t] arg, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, res, prev + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arg.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arg.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1492 + * return output + * + * def roll_median_cython(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_41roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_40roll_median_cython[] = "\n O(N log(window)) implementation using skip list\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_41roll_median_cython = {__Pyx_NAMESTR("roll_median_cython"), (PyCFunction)__pyx_pw_6pandas_5algos_41roll_median_cython, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_40roll_median_cython)}; +static PyObject *__pyx_pw_6pandas_5algos_41roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_median_cython (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_median_cython") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_median_cython", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_40roll_median_cython(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_40roll_median_cython(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_median_cython", 0); + + /* "pandas/algos.pyx":1496 + * O(N log(window)) implementation using skip list + * ''' + * return _roll_skiplist_op(input, win, minp, _get_median) # <<<<<<<<<<<<<< + * + * # Unfortunately had to resort to some hackery here, would like for + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_median); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1492 + * return output + * + * def roll_median_cython(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.roll_median_cython", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1501 + * # Cython to be able to get this right. + * + * cdef double_t _get_median(object sl, int nobs, int minp): # <<<<<<<<<<<<<< + * cdef Py_ssize_t midpoint + * cdef IndexableSkiplist skiplist = sl + */ + +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_median(PyObject *__pyx_v_sl, int __pyx_v_nobs, int __pyx_v_minp) { + Py_ssize_t __pyx_v_midpoint; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_skiplist = 0; + __pyx_t_5numpy_double_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_double_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_median", 0); + + /* "pandas/algos.pyx":1503 + * cdef double_t _get_median(object sl, int nobs, int minp): + * cdef Py_ssize_t midpoint + * cdef IndexableSkiplist skiplist = sl # <<<<<<<<<<<<<< + * if nobs >= minp: + * midpoint = nobs / 2 + */ + __pyx_t_1 = __pyx_v_sl; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":1504 + * cdef Py_ssize_t midpoint + * cdef IndexableSkiplist skiplist = sl + * if nobs >= minp: # <<<<<<<<<<<<<< + * midpoint = nobs / 2 + * if nobs % 2: + */ + __pyx_t_2 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":1505 + * cdef IndexableSkiplist skiplist = sl + * if nobs >= minp: + * midpoint = nobs / 2 # <<<<<<<<<<<<<< + * if nobs % 2: + * return skiplist.get(midpoint) + */ + __pyx_v_midpoint = __Pyx_div_long(__pyx_v_nobs, 2); + + /* "pandas/algos.pyx":1506 + * if nobs >= minp: + * midpoint = nobs / 2 + * if nobs % 2: # <<<<<<<<<<<<<< + * return skiplist.get(midpoint) + * else: + */ + __pyx_t_2 = (__Pyx_mod_long(__pyx_v_nobs, 2) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":1507 + * midpoint = nobs / 2 + * if nobs % 2: + * return skiplist.get(midpoint) # <<<<<<<<<<<<<< + * else: + * return (skiplist.get(midpoint) + + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_v_midpoint, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":1509 + * return skiplist.get(midpoint) + * else: + * return (skiplist.get(midpoint) + # <<<<<<<<<<<<<< + * skiplist.get(midpoint - 1)) / 2 + * else: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_v_midpoint, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/algos.pyx":1510 + * else: + * return (skiplist.get(midpoint) + + * skiplist.get(midpoint - 1)) / 2 # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, (__pyx_v_midpoint - 1), 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/algos.pyx":1509 + * return skiplist.get(midpoint) + * else: + * return (skiplist.get(midpoint) + # <<<<<<<<<<<<<< + * skiplist.get(midpoint - 1)) / 2 + * else: + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/algos.pyx":1510 + * else: + * return (skiplist.get(midpoint) + + * skiplist.get(midpoint - 1)) / 2 # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_3 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/algos.pyx":1512 + * skiplist.get(midpoint - 1)) / 2 + * else: + * return NaN # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __pyx_r = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1501 + * # Cython to be able to get this right. + * + * cdef double_t _get_median(object sl, int nobs, int minp): # <<<<<<<<<<<<<< + * cdef Py_ssize_t midpoint + * cdef IndexableSkiplist skiplist = sl + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_WriteUnraisable("pandas.algos._get_median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_skiplist); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1528 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_max2(ndarray[float64_t] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_43roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_42roll_max2[] = "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs."; +static PyMethodDef __pyx_mdef_6pandas_5algos_43roll_max2 = {__Pyx_NAMESTR("roll_max2"), (PyCFunction)__pyx_pw_6pandas_5algos_43roll_max2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_42roll_max2)}; +static PyObject *__pyx_pw_6pandas_5algos_43roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_a = 0; + int __pyx_v_window; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_max2 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_window,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_a = ((PyArrayObject *)values[0]); + __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_max2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_42roll_max2(__pyx_self, __pyx_v_a, __pyx_v_window, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_42roll_max2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp) { + __pyx_t_5numpy_float64_t __pyx_v_ai; + __pyx_t_5numpy_float64_t __pyx_v_aold; + Py_ssize_t __pyx_v_count; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_ring; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_minpair; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_end; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_last; + Py_ssize_t __pyx_v_i0; + npy_intp *__pyx_v_dim; + Py_ssize_t __pyx_v_n0; + npy_intp *__pyx_v_dims; + PyArrayObject *__pyx_v_y = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_a; + __Pyx_Buffer __pyx_pybuffer_a; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + npy_intp __pyx_t_1[1]; + PyObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + double __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + long __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_max2", 0); + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_a.pybuffer.buf = NULL; + __pyx_pybuffer_a.refcount = 0; + __pyx_pybuffernd_a.data = NULL; + __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1538 + * cdef Py_ssize_t i0 + * cdef np.npy_intp *dim + * dim = PyArray_DIMS(a) # <<<<<<<<<<<<<< + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] + */ + __pyx_v_dim = PyArray_DIMS(((PyArrayObject *)__pyx_v_a)); + + /* "pandas/algos.pyx":1539 + * cdef np.npy_intp *dim + * dim = PyArray_DIMS(a) + * cdef Py_ssize_t n0 = dim[0] # <<<<<<<<<<<<<< + * cdef np.npy_intp *dims = [n0] + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, + */ + __pyx_v_n0 = (__pyx_v_dim[0]); + + /* "pandas/algos.pyx":1540 + * dim = PyArray_DIMS(a) + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, + * NPY_float64, 0) + */ + __pyx_t_1[0] = __pyx_v_n0; + __pyx_v_dims = __pyx_t_1; + + /* "pandas/algos.pyx":1541 + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, # <<<<<<<<<<<<<< + * NPY_float64, 0) + * + */ + __pyx_t_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_y = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1544 + * NPY_float64, 0) + * + * if window < 1: # <<<<<<<<<<<<<< + * raise ValueError('Invalid window size %d' + * % (window)) + */ + __pyx_t_4 = ((__pyx_v_window < 1) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1546 + * if window < 1: + * raise ValueError('Invalid window size %d' + * % (window)) # <<<<<<<<<<<<<< + * + * if minp > window: + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_window_size_d, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1545 + * + * if window < 1: + * raise ValueError('Invalid window size %d' # <<<<<<<<<<<<<< + * % (window)) + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":1548 + * % (window)) + * + * if minp > window: # <<<<<<<<<<<<<< + * raise ValueError('Invalid min_periods size %d greater than window %d' + * % (minp, window)) + */ + __pyx_t_4 = ((__pyx_v_minp > __pyx_v_window) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1550 + * if minp > window: + * raise ValueError('Invalid min_periods size %d greater than window %d' + * % (minp, window)) # <<<<<<<<<<<<<< + * + * minp = _check_minp(window, minp, n0) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_5 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/algos.pyx":1549 + * + * if minp > window: + * raise ValueError('Invalid min_periods size %d greater than window %d' # <<<<<<<<<<<<<< + * % (minp, window)) + * + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":1552 + * % (minp, window)) + * + * minp = _check_minp(window, minp, n0) # <<<<<<<<<<<<<< + * + * window = min(window, n0) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_minp = __pyx_t_9; + + /* "pandas/algos.pyx":1554 + * minp = _check_minp(window, minp, n0) + * + * window = min(window, n0) # <<<<<<<<<<<<<< + * + * ring = stdlib.malloc(window * sizeof(pairs)) + */ + __pyx_t_10 = __pyx_v_n0; + __pyx_t_9 = __pyx_v_window; + if (((__pyx_t_10 < __pyx_t_9) != 0)) { + __pyx_t_11 = __pyx_t_10; + } else { + __pyx_t_11 = __pyx_t_9; + } + __pyx_v_window = __pyx_t_11; + + /* "pandas/algos.pyx":1556 + * window = min(window, n0) + * + * ring = stdlib.malloc(window * sizeof(pairs)) # <<<<<<<<<<<<<< + * end = ring + window + * last = ring + */ + __pyx_v_ring = ((struct __pyx_t_6pandas_5algos_pairs *)malloc((__pyx_v_window * (sizeof(struct __pyx_t_6pandas_5algos_pairs))))); + + /* "pandas/algos.pyx":1557 + * + * ring = stdlib.malloc(window * sizeof(pairs)) + * end = ring + window # <<<<<<<<<<<<<< + * last = ring + * + */ + __pyx_v_end = (__pyx_v_ring + __pyx_v_window); + + /* "pandas/algos.pyx":1558 + * ring = stdlib.malloc(window * sizeof(pairs)) + * end = ring + window + * last = ring # <<<<<<<<<<<<<< + * + * minpair = ring + */ + __pyx_v_last = __pyx_v_ring; + + /* "pandas/algos.pyx":1560 + * last = ring + * + * minpair = ring # <<<<<<<<<<<<<< + * ai = a[0] + * if ai == ai: + */ + __pyx_v_minpair = __pyx_v_ring; + + /* "pandas/algos.pyx":1561 + * + * minpair = ring + * ai = a[0] # <<<<<<<<<<<<<< + * if ai == ai: + * minpair.value = ai + */ + __pyx_t_12 = 0; + __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1562 + * minpair = ring + * ai = a[0] + * if ai == ai: # <<<<<<<<<<<<<< + * minpair.value = ai + * else: + */ + __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1563 + * ai = a[0] + * if ai == ai: + * minpair.value = ai # <<<<<<<<<<<<<< + * else: + * minpair.value = MINfloat64 + */ + __pyx_v_minpair->value = __pyx_v_ai; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/algos.pyx":1565 + * minpair.value = ai + * else: + * minpair.value = MINfloat64 # <<<<<<<<<<<<<< + * minpair.death = window + * + */ + __pyx_v_minpair->value = __pyx_v_6pandas_5algos_MINfloat64; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1566 + * else: + * minpair.value = MINfloat64 + * minpair.death = window # <<<<<<<<<<<<<< + * + * count = 0 + */ + __pyx_v_minpair->death = __pyx_v_window; + + /* "pandas/algos.pyx":1568 + * minpair.death = window + * + * count = 0 # <<<<<<<<<<<<<< + * for i0 in range(n0): + * ai = a[i0] + */ + __pyx_v_count = 0; + + /* "pandas/algos.pyx":1569 + * + * count = 0 + * for i0 in range(n0): # <<<<<<<<<<<<<< + * ai = a[i0] + * if ai == ai: + */ + __pyx_t_11 = __pyx_v_n0; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10+=1) { + __pyx_v_i0 = __pyx_t_10; + + /* "pandas/algos.pyx":1570 + * count = 0 + * for i0 in range(n0): + * ai = a[i0] # <<<<<<<<<<<<<< + * if ai == ai: + * count += 1 + */ + __pyx_t_13 = __pyx_v_i0; + __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1571 + * for i0 in range(n0): + * ai = a[i0] + * if ai == ai: # <<<<<<<<<<<<<< + * count += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1572 + * ai = a[i0] + * if ai == ai: + * count += 1 # <<<<<<<<<<<<<< + * else: + * ai = MINfloat64 + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/algos.pyx":1574 + * count += 1 + * else: + * ai = MINfloat64 # <<<<<<<<<<<<<< + * if i0 >= window: + * aold = a[i0 - window] + */ + __pyx_v_ai = __pyx_v_6pandas_5algos_MINfloat64; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1575 + * else: + * ai = MINfloat64 + * if i0 >= window: # <<<<<<<<<<<<<< + * aold = a[i0 - window] + * if aold == aold: + */ + __pyx_t_4 = ((__pyx_v_i0 >= __pyx_v_window) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1576 + * ai = MINfloat64 + * if i0 >= window: + * aold = a[i0 - window] # <<<<<<<<<<<<<< + * if aold == aold: + * count -= 1 + */ + __pyx_t_14 = (__pyx_v_i0 - __pyx_v_window); + __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1577 + * if i0 >= window: + * aold = a[i0 - window] + * if aold == aold: # <<<<<<<<<<<<<< + * count -= 1 + * if minpair.death == i0: + */ + __pyx_t_4 = ((__pyx_v_aold == __pyx_v_aold) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1578 + * aold = a[i0 - window] + * if aold == aold: + * count -= 1 # <<<<<<<<<<<<<< + * if minpair.death == i0: + * minpair += 1 + */ + __pyx_v_count = (__pyx_v_count - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1579 + * if aold == aold: + * count -= 1 + * if minpair.death == i0: # <<<<<<<<<<<<<< + * minpair += 1 + * if minpair >= end: + */ + __pyx_t_4 = ((__pyx_v_minpair->death == __pyx_v_i0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1580 + * count -= 1 + * if minpair.death == i0: + * minpair += 1 # <<<<<<<<<<<<<< + * if minpair >= end: + * minpair = ring + */ + __pyx_v_minpair = (__pyx_v_minpair + 1); + + /* "pandas/algos.pyx":1581 + * if minpair.death == i0: + * minpair += 1 + * if minpair >= end: # <<<<<<<<<<<<<< + * minpair = ring + * if ai >= minpair.value: + */ + __pyx_t_4 = ((__pyx_v_minpair >= __pyx_v_end) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1582 + * minpair += 1 + * if minpair >= end: + * minpair = ring # <<<<<<<<<<<<<< + * if ai >= minpair.value: + * minpair.value = ai + */ + __pyx_v_minpair = __pyx_v_ring; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":1583 + * if minpair >= end: + * minpair = ring + * if ai >= minpair.value: # <<<<<<<<<<<<<< + * minpair.value = ai + * minpair.death = i0 + window + */ + __pyx_t_4 = ((__pyx_v_ai >= __pyx_v_minpair->value) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1584 + * minpair = ring + * if ai >= minpair.value: + * minpair.value = ai # <<<<<<<<<<<<<< + * minpair.death = i0 + window + * last = minpair + */ + __pyx_v_minpair->value = __pyx_v_ai; + + /* "pandas/algos.pyx":1585 + * if ai >= minpair.value: + * minpair.value = ai + * minpair.death = i0 + window # <<<<<<<<<<<<<< + * last = minpair + * else: + */ + __pyx_v_minpair->death = (__pyx_v_i0 + __pyx_v_window); + + /* "pandas/algos.pyx":1586 + * minpair.value = ai + * minpair.death = i0 + window + * last = minpair # <<<<<<<<<<<<<< + * else: + * while last.value <= ai: + */ + __pyx_v_last = __pyx_v_minpair; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1588 + * last = minpair + * else: + * while last.value <= ai: # <<<<<<<<<<<<<< + * if last == ring: + * last = end + */ + while (1) { + __pyx_t_4 = ((__pyx_v_last->value <= __pyx_v_ai) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":1589 + * else: + * while last.value <= ai: + * if last == ring: # <<<<<<<<<<<<<< + * last = end + * last -= 1 + */ + __pyx_t_4 = ((__pyx_v_last == __pyx_v_ring) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1590 + * while last.value <= ai: + * if last == ring: + * last = end # <<<<<<<<<<<<<< + * last -= 1 + * last += 1 + */ + __pyx_v_last = __pyx_v_end; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/algos.pyx":1591 + * if last == ring: + * last = end + * last -= 1 # <<<<<<<<<<<<<< + * last += 1 + * if last == end: + */ + __pyx_v_last = (__pyx_v_last - 1); + } + + /* "pandas/algos.pyx":1592 + * last = end + * last -= 1 + * last += 1 # <<<<<<<<<<<<<< + * if last == end: + * last = ring + */ + __pyx_v_last = (__pyx_v_last + 1); + + /* "pandas/algos.pyx":1593 + * last -= 1 + * last += 1 + * if last == end: # <<<<<<<<<<<<<< + * last = ring + * last.value = ai + */ + __pyx_t_4 = ((__pyx_v_last == __pyx_v_end) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1594 + * last += 1 + * if last == end: + * last = ring # <<<<<<<<<<<<<< + * last.value = ai + * last.death = i0 + window + */ + __pyx_v_last = __pyx_v_ring; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/algos.pyx":1595 + * if last == end: + * last = ring + * last.value = ai # <<<<<<<<<<<<<< + * last.death = i0 + window + * if count >= minp: + */ + __pyx_v_last->value = __pyx_v_ai; + + /* "pandas/algos.pyx":1596 + * last = ring + * last.value = ai + * last.death = i0 + window # <<<<<<<<<<<<<< + * if count >= minp: + * y[i0] = minpair.value + */ + __pyx_v_last->death = (__pyx_v_i0 + __pyx_v_window); + } + __pyx_L13:; + + /* "pandas/algos.pyx":1597 + * last.value = ai + * last.death = i0 + window + * if count >= minp: # <<<<<<<<<<<<<< + * y[i0] = minpair.value + * else: + */ + __pyx_t_4 = ((__pyx_v_count >= __pyx_v_minp) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1598 + * last.death = i0 + window + * if count >= minp: + * y[i0] = minpair.value # <<<<<<<<<<<<<< + * else: + * y[i0] = NaN + */ + __pyx_t_15 = __pyx_v_minpair->value; + __pyx_t_16 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_15; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/algos.pyx":1600 + * y[i0] = minpair.value + * else: + * y[i0] = NaN # <<<<<<<<<<<<<< + * + * for i0 in range(minp - 1): + */ + __pyx_t_17 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L18:; + } + + /* "pandas/algos.pyx":1602 + * y[i0] = NaN + * + * for i0 in range(minp - 1): # <<<<<<<<<<<<<< + * y[i0] = NaN + * + */ + __pyx_t_18 = (__pyx_v_minp - 1); + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_18; __pyx_t_11+=1) { + __pyx_v_i0 = __pyx_t_11; + + /* "pandas/algos.pyx":1603 + * + * for i0 in range(minp - 1): + * y[i0] = NaN # <<<<<<<<<<<<<< + * + * stdlib.free(ring) + */ + __pyx_t_10 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1605 + * y[i0] = NaN + * + * stdlib.free(ring) # <<<<<<<<<<<<<< + * return y + * + */ + free(__pyx_v_ring); + + /* "pandas/algos.pyx":1606 + * + * stdlib.free(ring) + * return y # <<<<<<<<<<<<<< + * + * def roll_max(ndarray input, int win, int minp): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_y)); + __pyx_r = ((PyObject *)__pyx_v_y); + goto __pyx_L0; + + /* "pandas/algos.pyx":1528 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_max2(ndarray[float64_t] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_max2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1608 + * return y + * + * def roll_max(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_45roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_44roll_max[] = "\n O(N log(window)) implementation using skip list\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_45roll_max = {__Pyx_NAMESTR("roll_max"), (PyCFunction)__pyx_pw_6pandas_5algos_45roll_max, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_44roll_max)}; +static PyObject *__pyx_pw_6pandas_5algos_45roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_max (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_44roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_44roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_max", 0); + + /* "pandas/algos.pyx":1612 + * O(N log(window)) implementation using skip list + * ''' + * return _roll_skiplist_op(input, win, minp, _get_max) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1608 + * return y + * + * def roll_max(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1615 + * + * + * cdef double_t _get_max(object skiplist, int nobs, int minp): # <<<<<<<<<<<<<< + * if nobs >= minp: + * return skiplist.get(nobs - 1) + */ + +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_max(PyObject *__pyx_v_skiplist, int __pyx_v_nobs, int __pyx_v_minp) { + __pyx_t_5numpy_double_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __pyx_t_5numpy_double_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_max", 0); + + /* "pandas/algos.pyx":1616 + * + * cdef double_t _get_max(object skiplist, int nobs, int minp): + * if nobs >= minp: # <<<<<<<<<<<<<< + * return skiplist.get(nobs - 1) + * else: + */ + __pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_1) { + + /* "pandas/algos.pyx":1617 + * cdef double_t _get_max(object skiplist, int nobs, int minp): + * if nobs >= minp: + * return skiplist.get(nobs - 1) # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_skiplist, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_nobs - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":1619 + * return skiplist.get(nobs - 1) + * else: + * return NaN # <<<<<<<<<<<<<< + * + * def roll_min(ndarray input, int win, int minp): + */ + __pyx_r = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1615 + * + * + * cdef double_t _get_max(object skiplist, int nobs, int minp): # <<<<<<<<<<<<<< + * if nobs >= minp: + * return skiplist.get(nobs - 1) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.algos._get_max", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1621 + * return NaN + * + * def roll_min(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_47roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_46roll_min[] = "\n O(N log(window)) implementation using skip list\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_47roll_min = {__Pyx_NAMESTR("roll_min"), (PyCFunction)__pyx_pw_6pandas_5algos_47roll_min, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_46roll_min)}; +static PyObject *__pyx_pw_6pandas_5algos_47roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_min (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_46roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_46roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_min", 0); + + /* "pandas/algos.pyx":1625 + * O(N log(window)) implementation using skip list + * ''' + * return _roll_skiplist_op(input, win, minp, _get_min) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1621 + * return NaN + * + * def roll_min(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1629 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_49roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_48roll_min2[] = "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs."; +static PyMethodDef __pyx_mdef_6pandas_5algos_49roll_min2 = {__Pyx_NAMESTR("roll_min2"), (PyCFunction)__pyx_pw_6pandas_5algos_49roll_min2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_48roll_min2)}; +static PyObject *__pyx_pw_6pandas_5algos_49roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_a = 0; + int __pyx_v_window; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_min2 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_window,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_a = ((PyArrayObject *)values[0]); + __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_min2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_48roll_min2(__pyx_self, __pyx_v_a, __pyx_v_window, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_48roll_min2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp) { + __pyx_t_5numpy_float64_t __pyx_v_ai; + __pyx_t_5numpy_float64_t __pyx_v_aold; + Py_ssize_t __pyx_v_count; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_ring; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_minpair; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_end; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_last; + Py_ssize_t __pyx_v_i0; + npy_intp *__pyx_v_dim; + Py_ssize_t __pyx_v_n0; + npy_intp *__pyx_v_dims; + PyArrayObject *__pyx_v_y = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_a; + __Pyx_Buffer __pyx_pybuffer_a; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + npy_intp __pyx_t_1[1]; + PyObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + double __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + long __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_min2", 0); + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_a.pybuffer.buf = NULL; + __pyx_pybuffer_a.refcount = 0; + __pyx_pybuffernd_a.data = NULL; + __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1639 + * cdef Py_ssize_t i0 + * cdef np.npy_intp *dim + * dim = PyArray_DIMS(a) # <<<<<<<<<<<<<< + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] + */ + __pyx_v_dim = PyArray_DIMS(((PyArrayObject *)__pyx_v_a)); + + /* "pandas/algos.pyx":1640 + * cdef np.npy_intp *dim + * dim = PyArray_DIMS(a) + * cdef Py_ssize_t n0 = dim[0] # <<<<<<<<<<<<<< + * cdef np.npy_intp *dims = [n0] + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, + */ + __pyx_v_n0 = (__pyx_v_dim[0]); + + /* "pandas/algos.pyx":1641 + * dim = PyArray_DIMS(a) + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, + * NPY_float64, 0) + */ + __pyx_t_1[0] = __pyx_v_n0; + __pyx_v_dims = __pyx_t_1; + + /* "pandas/algos.pyx":1642 + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, # <<<<<<<<<<<<<< + * NPY_float64, 0) + * + */ + __pyx_t_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_y = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1645 + * NPY_float64, 0) + * + * if window < 1: # <<<<<<<<<<<<<< + * raise ValueError('Invalid window size %d' + * % (window)) + */ + __pyx_t_4 = ((__pyx_v_window < 1) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1647 + * if window < 1: + * raise ValueError('Invalid window size %d' + * % (window)) # <<<<<<<<<<<<<< + * + * if minp > window: + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_window_size_d, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1646 + * + * if window < 1: + * raise ValueError('Invalid window size %d' # <<<<<<<<<<<<<< + * % (window)) + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":1649 + * % (window)) + * + * if minp > window: # <<<<<<<<<<<<<< + * raise ValueError('Invalid min_periods size %d greater than window %d' + * % (minp, window)) + */ + __pyx_t_4 = ((__pyx_v_minp > __pyx_v_window) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1651 + * if minp > window: + * raise ValueError('Invalid min_periods size %d greater than window %d' + * % (minp, window)) # <<<<<<<<<<<<<< + * + * window = min(window, n0) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_5 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/algos.pyx":1650 + * + * if minp > window: + * raise ValueError('Invalid min_periods size %d greater than window %d' # <<<<<<<<<<<<<< + * % (minp, window)) + * + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":1653 + * % (minp, window)) + * + * window = min(window, n0) # <<<<<<<<<<<<<< + * + * minp = _check_minp(window, minp, n0) + */ + __pyx_t_7 = __pyx_v_n0; + __pyx_t_8 = __pyx_v_window; + if (((__pyx_t_7 < __pyx_t_8) != 0)) { + __pyx_t_9 = __pyx_t_7; + } else { + __pyx_t_9 = __pyx_t_8; + } + __pyx_v_window = __pyx_t_9; + + /* "pandas/algos.pyx":1655 + * window = min(window, n0) + * + * minp = _check_minp(window, minp, n0) # <<<<<<<<<<<<<< + * + * ring = stdlib.malloc(window * sizeof(pairs)) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1657 + * minp = _check_minp(window, minp, n0) + * + * ring = stdlib.malloc(window * sizeof(pairs)) # <<<<<<<<<<<<<< + * end = ring + window + * last = ring + */ + __pyx_v_ring = ((struct __pyx_t_6pandas_5algos_pairs *)malloc((__pyx_v_window * (sizeof(struct __pyx_t_6pandas_5algos_pairs))))); + + /* "pandas/algos.pyx":1658 + * + * ring = stdlib.malloc(window * sizeof(pairs)) + * end = ring + window # <<<<<<<<<<<<<< + * last = ring + * + */ + __pyx_v_end = (__pyx_v_ring + __pyx_v_window); + + /* "pandas/algos.pyx":1659 + * ring = stdlib.malloc(window * sizeof(pairs)) + * end = ring + window + * last = ring # <<<<<<<<<<<<<< + * + * minpair = ring + */ + __pyx_v_last = __pyx_v_ring; + + /* "pandas/algos.pyx":1661 + * last = ring + * + * minpair = ring # <<<<<<<<<<<<<< + * ai = a[0] + * if ai == ai: + */ + __pyx_v_minpair = __pyx_v_ring; + + /* "pandas/algos.pyx":1662 + * + * minpair = ring + * ai = a[0] # <<<<<<<<<<<<<< + * if ai == ai: + * minpair.value = ai + */ + __pyx_t_12 = 0; + __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1663 + * minpair = ring + * ai = a[0] + * if ai == ai: # <<<<<<<<<<<<<< + * minpair.value = ai + * else: + */ + __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1664 + * ai = a[0] + * if ai == ai: + * minpair.value = ai # <<<<<<<<<<<<<< + * else: + * minpair.value = MAXfloat64 + */ + __pyx_v_minpair->value = __pyx_v_ai; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/algos.pyx":1666 + * minpair.value = ai + * else: + * minpair.value = MAXfloat64 # <<<<<<<<<<<<<< + * minpair.death = window + * + */ + __pyx_v_minpair->value = __pyx_v_6pandas_5algos_MAXfloat64; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1667 + * else: + * minpair.value = MAXfloat64 + * minpair.death = window # <<<<<<<<<<<<<< + * + * count = 0 + */ + __pyx_v_minpair->death = __pyx_v_window; + + /* "pandas/algos.pyx":1669 + * minpair.death = window + * + * count = 0 # <<<<<<<<<<<<<< + * for i0 in range(n0): + * ai = a[i0] + */ + __pyx_v_count = 0; + + /* "pandas/algos.pyx":1670 + * + * count = 0 + * for i0 in range(n0): # <<<<<<<<<<<<<< + * ai = a[i0] + * if ai == ai: + */ + __pyx_t_9 = __pyx_v_n0; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_9; __pyx_t_7+=1) { + __pyx_v_i0 = __pyx_t_7; + + /* "pandas/algos.pyx":1671 + * count = 0 + * for i0 in range(n0): + * ai = a[i0] # <<<<<<<<<<<<<< + * if ai == ai: + * count += 1 + */ + __pyx_t_13 = __pyx_v_i0; + __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1672 + * for i0 in range(n0): + * ai = a[i0] + * if ai == ai: # <<<<<<<<<<<<<< + * count += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1673 + * ai = a[i0] + * if ai == ai: + * count += 1 # <<<<<<<<<<<<<< + * else: + * ai = MAXfloat64 + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/algos.pyx":1675 + * count += 1 + * else: + * ai = MAXfloat64 # <<<<<<<<<<<<<< + * if i0 >= window: + * aold = a[i0 - window] + */ + __pyx_v_ai = __pyx_v_6pandas_5algos_MAXfloat64; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1676 + * else: + * ai = MAXfloat64 + * if i0 >= window: # <<<<<<<<<<<<<< + * aold = a[i0 - window] + * if aold == aold: + */ + __pyx_t_4 = ((__pyx_v_i0 >= __pyx_v_window) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1677 + * ai = MAXfloat64 + * if i0 >= window: + * aold = a[i0 - window] # <<<<<<<<<<<<<< + * if aold == aold: + * count -= 1 + */ + __pyx_t_14 = (__pyx_v_i0 - __pyx_v_window); + __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1678 + * if i0 >= window: + * aold = a[i0 - window] + * if aold == aold: # <<<<<<<<<<<<<< + * count -= 1 + * if minpair.death == i0: + */ + __pyx_t_4 = ((__pyx_v_aold == __pyx_v_aold) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1679 + * aold = a[i0 - window] + * if aold == aold: + * count -= 1 # <<<<<<<<<<<<<< + * if minpair.death == i0: + * minpair += 1 + */ + __pyx_v_count = (__pyx_v_count - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1680 + * if aold == aold: + * count -= 1 + * if minpair.death == i0: # <<<<<<<<<<<<<< + * minpair += 1 + * if minpair >= end: + */ + __pyx_t_4 = ((__pyx_v_minpair->death == __pyx_v_i0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1681 + * count -= 1 + * if minpair.death == i0: + * minpair += 1 # <<<<<<<<<<<<<< + * if minpair >= end: + * minpair = ring + */ + __pyx_v_minpair = (__pyx_v_minpair + 1); + + /* "pandas/algos.pyx":1682 + * if minpair.death == i0: + * minpair += 1 + * if minpair >= end: # <<<<<<<<<<<<<< + * minpair = ring + * if ai <= minpair.value: + */ + __pyx_t_4 = ((__pyx_v_minpair >= __pyx_v_end) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1683 + * minpair += 1 + * if minpair >= end: + * minpair = ring # <<<<<<<<<<<<<< + * if ai <= minpair.value: + * minpair.value = ai + */ + __pyx_v_minpair = __pyx_v_ring; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":1684 + * if minpair >= end: + * minpair = ring + * if ai <= minpair.value: # <<<<<<<<<<<<<< + * minpair.value = ai + * minpair.death = i0 + window + */ + __pyx_t_4 = ((__pyx_v_ai <= __pyx_v_minpair->value) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1685 + * minpair = ring + * if ai <= minpair.value: + * minpair.value = ai # <<<<<<<<<<<<<< + * minpair.death = i0 + window + * last = minpair + */ + __pyx_v_minpair->value = __pyx_v_ai; + + /* "pandas/algos.pyx":1686 + * if ai <= minpair.value: + * minpair.value = ai + * minpair.death = i0 + window # <<<<<<<<<<<<<< + * last = minpair + * else: + */ + __pyx_v_minpair->death = (__pyx_v_i0 + __pyx_v_window); + + /* "pandas/algos.pyx":1687 + * minpair.value = ai + * minpair.death = i0 + window + * last = minpair # <<<<<<<<<<<<<< + * else: + * while last.value >= ai: + */ + __pyx_v_last = __pyx_v_minpair; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1689 + * last = minpair + * else: + * while last.value >= ai: # <<<<<<<<<<<<<< + * if last == ring: + * last = end + */ + while (1) { + __pyx_t_4 = ((__pyx_v_last->value >= __pyx_v_ai) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":1690 + * else: + * while last.value >= ai: + * if last == ring: # <<<<<<<<<<<<<< + * last = end + * last -= 1 + */ + __pyx_t_4 = ((__pyx_v_last == __pyx_v_ring) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1691 + * while last.value >= ai: + * if last == ring: + * last = end # <<<<<<<<<<<<<< + * last -= 1 + * last += 1 + */ + __pyx_v_last = __pyx_v_end; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/algos.pyx":1692 + * if last == ring: + * last = end + * last -= 1 # <<<<<<<<<<<<<< + * last += 1 + * if last == end: + */ + __pyx_v_last = (__pyx_v_last - 1); + } + + /* "pandas/algos.pyx":1693 + * last = end + * last -= 1 + * last += 1 # <<<<<<<<<<<<<< + * if last == end: + * last = ring + */ + __pyx_v_last = (__pyx_v_last + 1); + + /* "pandas/algos.pyx":1694 + * last -= 1 + * last += 1 + * if last == end: # <<<<<<<<<<<<<< + * last = ring + * last.value = ai + */ + __pyx_t_4 = ((__pyx_v_last == __pyx_v_end) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1695 + * last += 1 + * if last == end: + * last = ring # <<<<<<<<<<<<<< + * last.value = ai + * last.death = i0 + window + */ + __pyx_v_last = __pyx_v_ring; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/algos.pyx":1696 + * if last == end: + * last = ring + * last.value = ai # <<<<<<<<<<<<<< + * last.death = i0 + window + * if count >= minp: + */ + __pyx_v_last->value = __pyx_v_ai; + + /* "pandas/algos.pyx":1697 + * last = ring + * last.value = ai + * last.death = i0 + window # <<<<<<<<<<<<<< + * if count >= minp: + * y[i0] = minpair.value + */ + __pyx_v_last->death = (__pyx_v_i0 + __pyx_v_window); + } + __pyx_L13:; + + /* "pandas/algos.pyx":1698 + * last.value = ai + * last.death = i0 + window + * if count >= minp: # <<<<<<<<<<<<<< + * y[i0] = minpair.value + * else: + */ + __pyx_t_4 = ((__pyx_v_count >= __pyx_v_minp) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1699 + * last.death = i0 + window + * if count >= minp: + * y[i0] = minpair.value # <<<<<<<<<<<<<< + * else: + * y[i0] = NaN + */ + __pyx_t_15 = __pyx_v_minpair->value; + __pyx_t_16 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_15; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/algos.pyx":1701 + * y[i0] = minpair.value + * else: + * y[i0] = NaN # <<<<<<<<<<<<<< + * + * for i0 in range(minp - 1): + */ + __pyx_t_17 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L18:; + } + + /* "pandas/algos.pyx":1703 + * y[i0] = NaN + * + * for i0 in range(minp - 1): # <<<<<<<<<<<<<< + * y[i0] = NaN + * + */ + __pyx_t_18 = (__pyx_v_minp - 1); + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_18; __pyx_t_9+=1) { + __pyx_v_i0 = __pyx_t_9; + + /* "pandas/algos.pyx":1704 + * + * for i0 in range(minp - 1): + * y[i0] = NaN # <<<<<<<<<<<<<< + * + * stdlib.free(ring) + */ + __pyx_t_7 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1706 + * y[i0] = NaN + * + * stdlib.free(ring) # <<<<<<<<<<<<<< + * return y + * + */ + free(__pyx_v_ring); + + /* "pandas/algos.pyx":1707 + * + * stdlib.free(ring) + * return y # <<<<<<<<<<<<<< + * + * cdef double_t _get_min(object skiplist, int nobs, int minp): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_y)); + __pyx_r = ((PyObject *)__pyx_v_y); + goto __pyx_L0; + + /* "pandas/algos.pyx":1629 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_min2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1709 + * return y + * + * cdef double_t _get_min(object skiplist, int nobs, int minp): # <<<<<<<<<<<<<< + * if nobs >= minp: + * return skiplist.get(0) + */ + +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_min(PyObject *__pyx_v_skiplist, int __pyx_v_nobs, int __pyx_v_minp) { + __pyx_t_5numpy_double_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_double_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_min", 0); + + /* "pandas/algos.pyx":1710 + * + * cdef double_t _get_min(object skiplist, int nobs, int minp): + * if nobs >= minp: # <<<<<<<<<<<<<< + * return skiplist.get(0) + * else: + */ + __pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_1) { + + /* "pandas/algos.pyx":1711 + * cdef double_t _get_min(object skiplist, int nobs, int minp): + * if nobs >= minp: + * return skiplist.get(0) # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_skiplist, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":1713 + * return skiplist.get(0) + * else: + * return NaN # <<<<<<<<<<<<<< + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, + */ + __pyx_r = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1709 + * return y + * + * cdef double_t _get_min(object skiplist, int nobs, int minp): # <<<<<<<<<<<<<< + * if nobs >= minp: + * return skiplist.get(0) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("pandas.algos._get_min", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1715 + * return NaN + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, double quantile): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_51roll_quantile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_50roll_quantile[] = "\n O(N log(window)) implementation using skip list\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_51roll_quantile = {__Pyx_NAMESTR("roll_quantile"), (PyCFunction)__pyx_pw_6pandas_5algos_51roll_quantile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_50roll_quantile)}; +static PyObject *__pyx_pw_6pandas_5algos_51roll_quantile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + double __pyx_v_quantile; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_quantile (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_quantile,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_quantile)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_quantile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_quantile = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_quantile == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_quantile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_50roll_quantile(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_quantile); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_50roll_quantile(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, double __pyx_v_quantile) { + double __pyx_v_val; + double __pyx_v_prev; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_skiplist = 0; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + PyObject *__pyx_v_idx = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_double_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_quantile", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1722 + * cdef double val, prev, midpoint + * cdef IndexableSkiplist skiplist + * cdef Py_ssize_t nobs = 0, i # <<<<<<<<<<<<<< + * cdef Py_ssize_t N = len(input) + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1723 + * cdef IndexableSkiplist skiplist + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1724 + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * skiplist = IndexableSkiplist(win) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1726 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * skiplist = IndexableSkiplist(win) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_IndexableSkiplist)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1728 + * skiplist = IndexableSkiplist(win) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1730 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1731 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1734 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist.insert(val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1735 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist.insert(val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1736 + * if val == val: + * nobs += 1 + * skiplist.insert(val) # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1738 + * skiplist.insert(val) + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1740 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1741 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1743 + * val = input[i] + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1744 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * + * if prev == prev: + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1746 + * prev = input[i - win] + * + * if prev == prev: # <<<<<<<<<<<<<< + * skiplist.remove(prev) + * nobs -= 1 + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1747 + * + * if prev == prev: + * skiplist.remove(prev) # <<<<<<<<<<<<<< + * nobs -= 1 + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1748 + * if prev == prev: + * skiplist.remove(prev) + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1750 + * nobs -= 1 + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist.insert(val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1751 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist.insert(val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1752 + * if val == val: + * nobs += 1 + * skiplist.insert(val) # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/algos.pyx":1754 + * skiplist.insert(val) + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * idx = int((quantile / 1.) * (nobs - 1)) + * output[i] = skiplist.get(idx) + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1755 + * + * if nobs >= minp: + * idx = int((quantile / 1.) * (nobs - 1)) # <<<<<<<<<<<<<< + * output[i] = skiplist.get(idx) + * else: + */ + __pyx_t_3 = PyFloat_FromDouble(((__pyx_v_quantile / 1.) * (__pyx_v_nobs - 1))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1756 + * if nobs >= minp: + * idx = int((quantile / 1.) * (nobs - 1)) + * output[i] = skiplist.get(idx) # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_t_15, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":1758 + * output[i] = skiplist.get(idx) + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":1760 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1715 + * return NaN + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, double quantile): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_quantile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_skiplist); + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1762 + * return output + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, object func, object args, object kwargs): + * cdef ndarray[double_t] output, counts, bufarr + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_53roll_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_53roll_generic = {__Pyx_NAMESTR("roll_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_53roll_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_53roll_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_generic (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_func,&__pyx_n_s_args,&__pyx_n_s_kwargs,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_func = values[3]; + __pyx_v_args = values[4]; + __pyx_v_kwargs = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_52roll_generic(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_52roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyArrayObject *__pyx_v_output = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_bufarr = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t *__pyx_v_buf; + __pyx_t_5numpy_float64_t *__pyx_v_oldbuf; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bufarr; + __Pyx_Buffer __pyx_pybuffer_bufarr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + __pyx_t_5numpy_double_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_generic", 0); + __Pyx_INCREF((PyObject *)__pyx_v_input); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_bufarr.pybuffer.buf = NULL; + __pyx_pybuffer_bufarr.refcount = 0; + __pyx_pybuffernd_bufarr.data = NULL; + __pyx_pybuffernd_bufarr.rcbuffer = &__pyx_pybuffer_bufarr; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1769 + * cdef float64_t *oldbuf + * + * if not input.flags.c_contiguous: # <<<<<<<<<<<<<< + * input = input.copy('C') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_input), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1770 + * + * if not input.flags.c_contiguous: + * input = input.copy('C') # <<<<<<<<<<<<<< + * + * buf = input.data + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_input), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_input, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/algos.pyx":1772 + * input = input.copy('C') + * + * buf = input.data # <<<<<<<<<<<<<< + * + * n = len(input) + */ + __pyx_v_buf = ((__pyx_t_5numpy_float64_t *)__pyx_v_input->data); + + /* "pandas/algos.pyx":1774 + * buf = input.data + * + * n = len(input) # <<<<<<<<<<<<<< + * if n == 0: + * return input + */ + __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_10; + + /* "pandas/algos.pyx":1775 + * + * n = len(input) + * if n == 0: # <<<<<<<<<<<<<< + * return input + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1776 + * n = len(input) + * if n == 0: + * return input # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, n) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_input)); + __pyx_r = ((PyObject *)__pyx_v_input); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1778 + * return input + * + * minp = _check_minp(win, minp, n) # <<<<<<<<<<<<<< + * output = np.empty(n, dtype=float) + * counts = roll_sum(np.isfinite(input).astype(float), win, minp) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_2 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_12); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_minp = __pyx_t_6; + + /* "pandas/algos.pyx":1779 + * + * minp = _check_minp(win, minp, n) + * output = np.empty(n, dtype=float) # <<<<<<<<<<<<<< + * counts = roll_sum(np.isfinite(input).astype(float), win, minp) + * + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/algos.pyx":1780 + * minp = _check_minp(win, minp, n) + * output = np.empty(n, dtype=float) + * counts = roll_sum(np.isfinite(input).astype(float), win, minp) # <<<<<<<<<<<<<< + * + * bufarr = np.empty(win, dtype=float) + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_roll_sum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)__pyx_v_input)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_input)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_input)); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)((PyObject*)(&PyFloat_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_1 = 0; + __pyx_t_13 = 0; + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/algos.pyx":1782 + * counts = roll_sum(np.isfinite(input).astype(float), win, minp) + * + * bufarr = np.empty(win, dtype=float) # <<<<<<<<<<<<<< + * oldbuf = bufarr.data + * + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_bufarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_bufarr.diminfo[0].strides = __pyx_pybuffernd_bufarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bufarr.diminfo[0].shape = __pyx_pybuffernd_bufarr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_bufarr = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1783 + * + * bufarr = np.empty(win, dtype=float) + * oldbuf = bufarr.data # <<<<<<<<<<<<<< + * + * n = len(input) + */ + __pyx_v_oldbuf = ((__pyx_t_5numpy_float64_t *)__pyx_v_bufarr->data); + + /* "pandas/algos.pyx":1785 + * oldbuf = bufarr.data + * + * n = len(input) # <<<<<<<<<<<<<< + * for i from 0 <= i < int_min(win, n): + * if counts[i] >= minp: + */ + __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_10; + + /* "pandas/algos.pyx":1786 + * + * n = len(input) + * for i from 0 <= i < int_min(win, n): # <<<<<<<<<<<<<< + * if counts[i] >= minp: + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, + */ + __pyx_t_6 = __pyx_f_6pandas_5algos_int_min(__pyx_v_win, __pyx_v_n); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { + + /* "pandas/algos.pyx":1787 + * n = len(input) + * for i from 0 <= i < int_min(win, n): + * if counts[i] >= minp: # <<<<<<<<<<<<<< + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, + * **kwargs) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_15 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_15 = 0; + if (unlikely(__pyx_t_15 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_15); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_counts.diminfo[0].strides)) >= __pyx_v_minp) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1788 + * for i from 0 <= i < int_min(win, n): + * if counts[i] >= minp: + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, # <<<<<<<<<<<<<< + * **kwargs) + * else: + */ + __pyx_t_13 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_input), __pyx_f_6pandas_5algos_int_max(((__pyx_v_i - __pyx_v_win) + 1), 0), (__pyx_v_i + 1), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1789 + * if counts[i] >= minp: + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, + * **kwargs) # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (likely(PyDict_Check(__pyx_v_kwargs))) { + __pyx_t_13 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_13); + } else { + __pyx_t_13 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + } + + /* "pandas/algos.pyx":1788 + * for i from 0 <= i < int_min(win, n): + * if counts[i] >= minp: + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, # <<<<<<<<<<<<<< + * **kwargs) + * else: + */ + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_15 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_15 = 0; + if (unlikely(__pyx_t_15 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_15); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/algos.pyx":1791 + * **kwargs) + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from win <= i < n: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_15 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_15 = 0; + if (unlikely(__pyx_t_15 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_15); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L7:; + } + + /* "pandas/algos.pyx":1793 + * output[i] = NaN + * + * for i from win <= i < n: # <<<<<<<<<<<<<< + * buf = buf + 1 + * bufarr.data = buf + */ + __pyx_t_19 = __pyx_v_n; + for (__pyx_v_i = __pyx_v_win; __pyx_v_i < __pyx_t_19; __pyx_v_i++) { + + /* "pandas/algos.pyx":1794 + * + * for i from win <= i < n: + * buf = buf + 1 # <<<<<<<<<<<<<< + * bufarr.data = buf + * if counts[i] >= minp: + */ + __pyx_v_buf = (__pyx_v_buf + 1); + + /* "pandas/algos.pyx":1795 + * for i from win <= i < n: + * buf = buf + 1 + * bufarr.data = buf # <<<<<<<<<<<<<< + * if counts[i] >= minp: + * output[i] = func(bufarr, *args, **kwargs) + */ + __pyx_v_bufarr->data = ((char *)__pyx_v_buf); + + /* "pandas/algos.pyx":1796 + * buf = buf + 1 + * bufarr.data = buf + * if counts[i] >= minp: # <<<<<<<<<<<<<< + * output[i] = func(bufarr, *args, **kwargs) + * else: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides)) >= __pyx_v_minp) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1797 + * bufarr.data = buf + * if counts[i] >= minp: + * output[i] = func(bufarr, *args, **kwargs) # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)__pyx_v_bufarr)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_bufarr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_bufarr)); + __pyx_t_13 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (likely(PyDict_Check(__pyx_v_kwargs))) { + __pyx_t_13 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_13); + } else { + __pyx_t_13 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + } + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/algos.pyx":1799 + * output[i] = func(bufarr, *args, **kwargs) + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * bufarr.data = oldbuf + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L10:; + } + + /* "pandas/algos.pyx":1801 + * output[i] = NaN + * + * bufarr.data = oldbuf # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_v_bufarr->data = ((char *)__pyx_v_oldbuf); + + /* "pandas/algos.pyx":1803 + * bufarr.data = oldbuf + * + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1762 + * return output + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, object func, object args, object kwargs): + * cdef ndarray[double_t] output, counts, bufarr + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF((PyObject *)__pyx_v_bufarr); + __Pyx_XDECREF((PyObject *)__pyx_v_input); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_55roll_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_54roll_window[] = "\n Assume len(weights) << len(input)\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_55roll_window = {__Pyx_NAMESTR("roll_window"), (PyCFunction)__pyx_pw_6pandas_5algos_55roll_window, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_54roll_window)}; +static PyObject *__pyx_pw_6pandas_5algos_55roll_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + PyArrayObject *__pyx_v_weights = 0; + int __pyx_v_minp; + int __pyx_v_avg; + int __pyx_v_avg_wgt; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_window (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_weights,&__pyx_n_s_minp,&__pyx_n_s_avg,&__pyx_n_s_avg_wgt,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_avg); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_avg_wgt); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_window") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_weights = ((PyArrayObject *)values[1]); + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[3]) { + __pyx_v_avg = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_avg == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + + /* "pandas/algos.pyx":1808 + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): # <<<<<<<<<<<<<< + * """ + * Assume len(weights) << len(input) + */ + __pyx_v_avg = ((int)1); + } + if (values[4]) { + __pyx_v_avg_wgt = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_avg_wgt == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_avg_wgt = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_window", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_54roll_window(__pyx_self, __pyx_v_input, __pyx_v_weights, __pyx_v_minp, __pyx_v_avg, __pyx_v_avg_wgt); + + /* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_54roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg, int __pyx_v_avg_wgt) { + PyArrayObject *__pyx_v_output = 0; + PyArrayObject *__pyx_v_tot_wgt = 0; + PyArrayObject *__pyx_v_counts = 0; + Py_ssize_t __pyx_v_in_i; + Py_ssize_t __pyx_v_win_i; + Py_ssize_t __pyx_v_win_n; + Py_ssize_t __pyx_v_in_n; + __pyx_t_5numpy_float64_t __pyx_v_val_in; + __pyx_t_5numpy_float64_t __pyx_v_val_win; + __pyx_t_5numpy_float64_t __pyx_v_c; + __pyx_t_5numpy_float64_t __pyx_v_w; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + __Pyx_LocalBuf_ND __pyx_pybuffernd_tot_wgt; + __Pyx_Buffer __pyx_pybuffer_tot_wgt; + __Pyx_LocalBuf_ND __pyx_pybuffernd_weights; + __Pyx_Buffer __pyx_pybuffer_weights; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_window", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_tot_wgt.pybuffer.buf = NULL; + __pyx_pybuffer_tot_wgt.refcount = 0; + __pyx_pybuffernd_tot_wgt.data = NULL; + __pyx_pybuffernd_tot_wgt.rcbuffer = &__pyx_pybuffer_tot_wgt; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + __pyx_pybuffer_weights.pybuffer.buf = NULL; + __pyx_pybuffer_weights.refcount = 0; + __pyx_pybuffernd_weights.data = NULL; + __pyx_pybuffernd_weights.rcbuffer = &__pyx_pybuffer_weights; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_weights.diminfo[0].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weights.diminfo[0].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1817 + * float64_t val_in, val_win, c, w + * + * in_n = len(input) # <<<<<<<<<<<<<< + * win_n = len(weights) + * output = np.zeros(in_n, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_in_n = __pyx_t_1; + + /* "pandas/algos.pyx":1818 + * + * in_n = len(input) + * win_n = len(weights) # <<<<<<<<<<<<<< + * output = np.zeros(in_n, dtype=float) + * counts = np.zeros(in_n, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_weights)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_win_n = __pyx_t_1; + + /* "pandas/algos.pyx":1819 + * in_n = len(input) + * win_n = len(weights) + * output = np.zeros(in_n, dtype=float) # <<<<<<<<<<<<<< + * counts = np.zeros(in_n, dtype=float) + * if avg: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1820 + * win_n = len(weights) + * output = np.zeros(in_n, dtype=float) + * counts = np.zeros(in_n, dtype=float) # <<<<<<<<<<<<<< + * if avg: + * tot_wgt = np.zeros(in_n, dtype=float) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1821 + * output = np.zeros(in_n, dtype=float) + * counts = np.zeros(in_n, dtype=float) + * if avg: # <<<<<<<<<<<<<< + * tot_wgt = np.zeros(in_n, dtype=float) + * + */ + __pyx_t_11 = (__pyx_v_avg != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1822 + * counts = np.zeros(in_n, dtype=float) + * if avg: + * tot_wgt = np.zeros(in_n, dtype=float) # <<<<<<<<<<<<<< + * + * minp = _check_minp(len(weights), minp, in_n) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer, (PyObject*)__pyx_v_tot_wgt, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_tot_wgt.diminfo[0].strides = __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tot_wgt.diminfo[0].shape = __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_tot_wgt = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/algos.pyx":1824 + * tot_wgt = np.zeros(in_n, dtype=float) + * + * minp = _check_minp(len(weights), minp, in_n) # <<<<<<<<<<<<<< + * + * if avg_wgt: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_weights)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_minp = __pyx_t_7; + + /* "pandas/algos.pyx":1826 + * minp = _check_minp(len(weights), minp, in_n) + * + * if avg_wgt: # <<<<<<<<<<<<<< + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] + */ + __pyx_t_11 = (__pyx_v_avg_wgt != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1827 + * + * if avg_wgt: + * for win_i from 0 <= win_i < win_n: # <<<<<<<<<<<<<< + * val_win = weights[win_i] + * if val_win != val_win: + */ + __pyx_t_1 = __pyx_v_win_n; + for (__pyx_v_win_i = 0; __pyx_v_win_i < __pyx_t_1; __pyx_v_win_i++) { + + /* "pandas/algos.pyx":1828 + * if avg_wgt: + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] # <<<<<<<<<<<<<< + * if val_win != val_win: + * continue + */ + __pyx_t_13 = __pyx_v_win_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_weights.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_weights.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val_win = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weights.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_weights.diminfo[0].strides)); + + /* "pandas/algos.pyx":1829 + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] + * if val_win != val_win: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_11 = ((__pyx_v_val_win != __pyx_v_val_win) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1830 + * val_win = weights[win_i] + * if val_win != val_win: + * continue # <<<<<<<<<<<<<< + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + */ + goto __pyx_L5_continue; + } + + /* "pandas/algos.pyx":1832 + * continue + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: # <<<<<<<<<<<<<< + * val_in = input[in_i] + * if val_in == val_in: + */ + __pyx_t_14 = ((__pyx_v_in_n - (__pyx_v_win_n - __pyx_v_win_i)) + 1); + for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_14; __pyx_v_in_i++) { + + /* "pandas/algos.pyx":1833 + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + * val_in = input[in_i] # <<<<<<<<<<<<<< + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + */ + __pyx_t_15 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val_in = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1834 + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + * val_in = input[in_i] + * if val_in == val_in: # <<<<<<<<<<<<<< + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 + */ + __pyx_t_11 = ((__pyx_v_val_in == __pyx_v_val_in) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1835 + * val_in = input[in_i] + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win # <<<<<<<<<<<<<< + * counts[in_i + (win_n - win_i) - 1] += 1 + * tot_wgt[in_i + (win_n - win_i) - 1] += val_win + */ + __pyx_t_16 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) += (__pyx_v_val_in * __pyx_v_val_win); + + /* "pandas/algos.pyx":1836 + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 # <<<<<<<<<<<<<< + * tot_wgt[in_i + (win_n - win_i) - 1] += val_win + * + */ + __pyx_t_17 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1.0; + + /* "pandas/algos.pyx":1837 + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 + * tot_wgt[in_i + (win_n - win_i) - 1] += val_win # <<<<<<<<<<<<<< + * + * for in_i from 0 <= in_i < in_n: + */ + __pyx_t_18 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_tot_wgt.diminfo[0].strides) += __pyx_v_val_win; + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L5_continue:; + } + + /* "pandas/algos.pyx":1839 + * tot_wgt[in_i + (win_n - win_i) - 1] += val_win + * + * for in_i from 0 <= in_i < in_n: # <<<<<<<<<<<<<< + * c = counts[in_i] + * if c < minp: + */ + __pyx_t_1 = __pyx_v_in_n; + for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_1; __pyx_v_in_i++) { + + /* "pandas/algos.pyx":1840 + * + * for in_i from 0 <= in_i < in_n: + * c = counts[in_i] # <<<<<<<<<<<<<< + * if c < minp: + * output[in_i] = NaN + */ + __pyx_t_14 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_c = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides)); + + /* "pandas/algos.pyx":1841 + * for in_i from 0 <= in_i < in_n: + * c = counts[in_i] + * if c < minp: # <<<<<<<<<<<<<< + * output[in_i] = NaN + * else: + */ + __pyx_t_11 = ((__pyx_v_c < __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1842 + * c = counts[in_i] + * if c < minp: + * output[in_i] = NaN # <<<<<<<<<<<<<< + * else: + * w = tot_wgt[in_i] + */ + __pyx_t_19 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1844 + * output[in_i] = NaN + * else: + * w = tot_wgt[in_i] # <<<<<<<<<<<<<< + * if w == 0: + * output[in_i] = NaN + */ + __pyx_t_20 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_w = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_tot_wgt.diminfo[0].strides)); + + /* "pandas/algos.pyx":1845 + * else: + * w = tot_wgt[in_i] + * if w == 0: # <<<<<<<<<<<<<< + * output[in_i] = NaN + * else: + */ + __pyx_t_11 = ((__pyx_v_w == 0.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1846 + * w = tot_wgt[in_i] + * if w == 0: + * output[in_i] = NaN # <<<<<<<<<<<<<< + * else: + * output[in_i] /= tot_wgt[in_i] + */ + __pyx_t_21 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/algos.pyx":1848 + * output[in_i] = NaN + * else: + * output[in_i] /= tot_wgt[in_i] # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_22 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_output.diminfo[0].strides) /= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_tot_wgt.diminfo[0].strides)); + } + __pyx_L14:; + } + __pyx_L13:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":1851 + * + * else: + * for win_i from 0 <= win_i < win_n: # <<<<<<<<<<<<<< + * val_win = weights[win_i] + * if val_win != val_win: + */ + __pyx_t_1 = __pyx_v_win_n; + for (__pyx_v_win_i = 0; __pyx_v_win_i < __pyx_t_1; __pyx_v_win_i++) { + + /* "pandas/algos.pyx":1852 + * else: + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] # <<<<<<<<<<<<<< + * if val_win != val_win: + * continue + */ + __pyx_t_24 = __pyx_v_win_i; + __pyx_t_7 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_weights.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_weights.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val_win = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weights.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_weights.diminfo[0].strides)); + + /* "pandas/algos.pyx":1853 + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] + * if val_win != val_win: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_11 = ((__pyx_v_val_win != __pyx_v_val_win) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1854 + * val_win = weights[win_i] + * if val_win != val_win: + * continue # <<<<<<<<<<<<<< + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + */ + goto __pyx_L15_continue; + } + + /* "pandas/algos.pyx":1856 + * continue + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: # <<<<<<<<<<<<<< + * val_in = input[in_i] + * + */ + __pyx_t_25 = ((__pyx_v_in_n - (__pyx_v_win_n - __pyx_v_win_i)) + 1); + for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_25; __pyx_v_in_i++) { + + /* "pandas/algos.pyx":1857 + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + * val_in = input[in_i] # <<<<<<<<<<<<<< + * + * if val_in == val_in: + */ + __pyx_t_26 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val_in = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1859 + * val_in = input[in_i] + * + * if val_in == val_in: # <<<<<<<<<<<<<< + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 + */ + __pyx_t_11 = ((__pyx_v_val_in == __pyx_v_val_in) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1860 + * + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win # <<<<<<<<<<<<<< + * counts[in_i + (win_n - win_i) - 1] += 1 + * + */ + __pyx_t_27 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_output.diminfo[0].strides) += (__pyx_v_val_in * __pyx_v_val_win); + + /* "pandas/algos.pyx":1861 + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 # <<<<<<<<<<<<<< + * + * for in_i from 0 <= in_i < in_n: + */ + __pyx_t_28 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_counts.diminfo[0].strides) += 1.0; + goto __pyx_L20; + } + __pyx_L20:; + } + __pyx_L15_continue:; + } + + /* "pandas/algos.pyx":1863 + * counts[in_i + (win_n - win_i) - 1] += 1 + * + * for in_i from 0 <= in_i < in_n: # <<<<<<<<<<<<<< + * c = counts[in_i] + * if c < minp: + */ + __pyx_t_1 = __pyx_v_in_n; + for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_1; __pyx_v_in_i++) { + + /* "pandas/algos.pyx":1864 + * + * for in_i from 0 <= in_i < in_n: + * c = counts[in_i] # <<<<<<<<<<<<<< + * if c < minp: + * output[in_i] = NaN + */ + __pyx_t_25 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_c = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_counts.diminfo[0].strides)); + + /* "pandas/algos.pyx":1865 + * for in_i from 0 <= in_i < in_n: + * c = counts[in_i] + * if c < minp: # <<<<<<<<<<<<<< + * output[in_i] = NaN + * elif avg: + */ + __pyx_t_11 = ((__pyx_v_c < __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1866 + * c = counts[in_i] + * if c < minp: + * output[in_i] = NaN # <<<<<<<<<<<<<< + * elif avg: + * output[in_i] /= c + */ + __pyx_t_29 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L23; + } + + /* "pandas/algos.pyx":1867 + * if c < minp: + * output[in_i] = NaN + * elif avg: # <<<<<<<<<<<<<< + * output[in_i] /= c + * + */ + __pyx_t_11 = (__pyx_v_avg != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1868 + * output[in_i] = NaN + * elif avg: + * output[in_i] /= c # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_30 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) /= __pyx_v_c; + goto __pyx_L23; + } + __pyx_L23:; + } + } + __pyx_L4:; + + /* "pandas/algos.pyx":1870 + * output[in_i] /= c + * + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_window", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XDECREF((PyObject *)__pyx_v_tot_wgt); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1879 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_57is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_57is_lexsorted = {__Pyx_NAMESTR("is_lexsorted"), (PyCFunction)__pyx_pw_6pandas_5algos_57is_lexsorted, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_57is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_lexsorted (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_list_of_arrays), (&PyList_Type), 1, "list_of_arrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_56is_lexsorted(__pyx_self, ((PyObject*)__pyx_v_list_of_arrays)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_56is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) { + int __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_nlevels; + __pyx_t_5numpy_int64_t __pyx_v_k; + __pyx_t_5numpy_int64_t __pyx_v_cur; + __pyx_t_5numpy_int64_t __pyx_v_pre; + PyArrayObject *__pyx_v_arr = 0; + __pyx_t_5numpy_int64_t **__pyx_v_vecs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_lexsorted", 0); + + /* "pandas/algos.pyx":1886 + * ndarray arr + * + * nlevels = len(list_of_arrays) # <<<<<<<<<<<<<< + * n = len(list_of_arrays[0]) + * + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_list_of_arrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nlevels = __pyx_t_1; + + /* "pandas/algos.pyx":1887 + * + * nlevels = len(list_of_arrays) + * n = len(list_of_arrays[0]) # <<<<<<<<<<<<<< + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_1; + + /* "pandas/algos.pyx":1889 + * n = len(list_of_arrays[0]) + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) # <<<<<<<<<<<<<< + * for i from 0 <= i < nlevels: + * # vecs[i] = ( list_of_arrays[i]).data + */ + __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_v_nlevels * (sizeof(__pyx_t_5numpy_int64_t *))))); + + /* "pandas/algos.pyx":1890 + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) + * for i from 0 <= i < nlevels: # <<<<<<<<<<<<<< + * # vecs[i] = ( list_of_arrays[i]).data + * + */ + __pyx_t_1 = __pyx_v_nlevels; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1893 + * # vecs[i] = ( list_of_arrays[i]).data + * + * arr = list_of_arrays[i] # <<<<<<<<<<<<<< + * vecs[i] = arr.data + * # assume uniqueness?? + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1894 + * + * arr = list_of_arrays[i] + * vecs[i] = arr.data # <<<<<<<<<<<<<< + * # assume uniqueness?? + * + */ + (__pyx_v_vecs[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)__pyx_v_arr->data); + } + + /* "pandas/algos.pyx":1897 + * # assume uniqueness?? + * + * for i from 1 <= i < n: # <<<<<<<<<<<<<< + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1898 + * + * for i from 1 <= i < n: + * for k from 0 <= k < nlevels: # <<<<<<<<<<<<<< + * cur = vecs[k][i] + * pre = vecs[k][i-1] + */ + __pyx_t_3 = __pyx_v_nlevels; + for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { + + /* "pandas/algos.pyx":1899 + * for i from 1 <= i < n: + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] # <<<<<<<<<<<<<< + * pre = vecs[k][i-1] + * if cur == pre: + */ + __pyx_v_cur = ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_i]); + + /* "pandas/algos.pyx":1900 + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] + * pre = vecs[k][i-1] # <<<<<<<<<<<<<< + * if cur == pre: + * continue + */ + __pyx_v_pre = ((__pyx_v_vecs[__pyx_v_k])[(__pyx_v_i - 1)]); + + /* "pandas/algos.pyx":1901 + * cur = vecs[k][i] + * pre = vecs[k][i-1] + * if cur == pre: # <<<<<<<<<<<<<< + * continue + * elif cur > pre: + */ + __pyx_t_4 = ((__pyx_v_cur == __pyx_v_pre) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1902 + * pre = vecs[k][i-1] + * if cur == pre: + * continue # <<<<<<<<<<<<<< + * elif cur > pre: + * break + */ + goto __pyx_L7_continue; + } + + /* "pandas/algos.pyx":1903 + * if cur == pre: + * continue + * elif cur > pre: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_4 = ((__pyx_v_cur > __pyx_v_pre) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1904 + * continue + * elif cur > pre: + * break # <<<<<<<<<<<<<< + * else: + * return False + */ + goto __pyx_L8_break; + } + /*else*/ { + + /* "pandas/algos.pyx":1906 + * break + * else: + * return False # <<<<<<<<<<<<<< + * free(vecs) + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L7_continue:; + } + __pyx_L8_break:; + } + + /* "pandas/algos.pyx":1907 + * else: + * return False + * free(vecs) # <<<<<<<<<<<<<< + * return True + * + */ + free(__pyx_v_vecs); + + /* "pandas/algos.pyx":1908 + * return False + * free(vecs) + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/algos.pyx":1879 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.algos.is_lexsorted", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1912 + * + * @cython.boundscheck(False) + * def groupby_indices(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_59groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_59groupby_indices = {__Pyx_NAMESTR("groupby_indices"), (PyCFunction)__pyx_pw_6pandas_5algos_59groupby_indices, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_59groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_indices (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_58groupby_indices(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_58groupby_indices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_seen = 0; + __pyx_t_5numpy_int64_t __pyx_v_loc; + PyObject *__pyx_v_ids = 0; + __pyx_t_5numpy_int64_t __pyx_v_k; + __pyx_t_5numpy_int64_t **__pyx_v_vecs; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_seen; + __Pyx_Buffer __pyx_pybuffer_seen; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + __pyx_t_5numpy_int64_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_indices", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_seen.pybuffer.buf = NULL; + __pyx_pybuffer_seen.refcount = 0; + __pyx_pybuffernd_seen.data = NULL; + __pyx_pybuffernd_seen.rcbuffer = &__pyx_pybuffer_seen; + + /* "pandas/algos.pyx":1914 + * def groupby_indices(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, counts, arr, seen + * int64_t loc + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/algos.pyx":1917 + * ndarray[int64_t] labels, counts, arr, seen + * int64_t loc + * dict ids = {} # <<<<<<<<<<<<<< + * object val + * int64_t k + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_ids = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1921 + * int64_t k + * + * ids, labels, counts = group_labels(values) # <<<<<<<<<<<<<< + * seen = np.zeros_like(counts) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_group_labels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = PyList_GET_ITEM(sequence, 2); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_ids, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_8 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1922 + * + * ids, labels, counts = group_labels(values) + * seen = np.zeros_like(counts) # <<<<<<<<<<<<<< + * + * # try not to get in trouble here... + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_counts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_counts)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seen.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seen.rcbuffer->pybuffer, (PyObject*)__pyx_v_seen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_seen.diminfo[0].strides = __pyx_pybuffernd_seen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_seen.diminfo[0].shape = __pyx_pybuffernd_seen.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_seen = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1925 + * + * # try not to get in trouble here... + * cdef int64_t **vecs = malloc(len(ids) * sizeof(int64_t*)) # <<<<<<<<<<<<<< + * result = {} + * for i from 0 <= i < len(counts): + */ + if (unlikely(__pyx_v_ids == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyDict_Size(__pyx_v_ids); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_t_1 * (sizeof(__pyx_t_5numpy_int64_t *))))); + + /* "pandas/algos.pyx":1926 + * # try not to get in trouble here... + * cdef int64_t **vecs = malloc(len(ids) * sizeof(int64_t*)) + * result = {} # <<<<<<<<<<<<<< + * for i from 0 <= i < len(counts): + * arr = np.empty(counts[i], dtype=np.int64) + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1927 + * cdef int64_t **vecs = malloc(len(ids) * sizeof(int64_t*)) + * result = {} + * for i from 0 <= i < len(counts): # <<<<<<<<<<<<<< + * arr = np.empty(counts[i], dtype=np.int64) + * result[ids[i]] = arr + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1928 + * result = {} + * for i from 0 <= i < len(counts): + * arr = np.empty(counts[i], dtype=np.int64) # <<<<<<<<<<<<<< + * result[ids[i]] = arr + * vecs[i] = arr.data + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __pyx_v_i; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_counts.diminfo[0].shape; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "pandas/algos.pyx":1929 + * for i from 0 <= i < len(counts): + * arr = np.empty(counts[i], dtype=np.int64) + * result[ids[i]] = arr # <<<<<<<<<<<<<< + * vecs[i] = arr.data + * + */ + if (unlikely(__pyx_v_ids == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_ids, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_2, ((PyObject *)__pyx_v_arr)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1930 + * arr = np.empty(counts[i], dtype=np.int64) + * result[ids[i]] = arr + * vecs[i] = arr.data # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + (__pyx_v_vecs[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)__pyx_v_arr->data); + } + + /* "pandas/algos.pyx":1932 + * vecs[i] = arr.data + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * k = labels[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1933 + * + * for i from 0 <= i < n: + * k = labels[i] # <<<<<<<<<<<<<< + * + * # was NaN + */ + __pyx_t_14 = __pyx_v_i; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_labels.diminfo[0].shape; + __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/algos.pyx":1936 + * + * # was NaN + * if k == -1: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_15 = ((__pyx_v_k == -1) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":1937 + * # was NaN + * if k == -1: + * continue # <<<<<<<<<<<<<< + * + * loc = seen[k] + */ + goto __pyx_L7_continue; + } + + /* "pandas/algos.pyx":1939 + * continue + * + * loc = seen[k] # <<<<<<<<<<<<<< + * vecs[k][loc] = i + * seen[k] = loc + 1 + */ + __pyx_t_16 = __pyx_v_k; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_seen.diminfo[0].shape; + __pyx_v_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_seen.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_seen.diminfo[0].strides)); + + /* "pandas/algos.pyx":1940 + * + * loc = seen[k] + * vecs[k][loc] = i # <<<<<<<<<<<<<< + * seen[k] = loc + 1 + * + */ + ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_loc]) = __pyx_v_i; + + /* "pandas/algos.pyx":1941 + * loc = seen[k] + * vecs[k][loc] = i + * seen[k] = loc + 1 # <<<<<<<<<<<<<< + * + * free(vecs) + */ + __pyx_t_17 = __pyx_v_k; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_seen.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_seen.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_seen.diminfo[0].strides) = (__pyx_v_loc + 1); + __pyx_L7_continue:; + } + + /* "pandas/algos.pyx":1943 + * seen[k] = loc + 1 + * + * free(vecs) # <<<<<<<<<<<<<< + * + * return result + */ + free(__pyx_v_vecs); + + /* "pandas/algos.pyx":1945 + * free(vecs) + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/algos.pyx":1912 + * + * @cython.boundscheck(False) + * def groupby_indices(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_indices", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XDECREF((PyObject *)__pyx_v_seen); + __Pyx_XDECREF(__pyx_v_ids); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1949 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_labels(ndarray[object] values): # <<<<<<<<<<<<<< + * ''' + * Compute label vector from input values and associated useful data + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_61group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static char __pyx_doc_6pandas_5algos_60group_labels[] = "\n Compute label vector from input values and associated useful data\n\n Returns\n -------\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_61group_labels = {__Pyx_NAMESTR("group_labels"), (PyCFunction)__pyx_pw_6pandas_5algos_61group_labels, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_60group_labels)}; +static PyObject *__pyx_pw_6pandas_5algos_61group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_labels (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_60group_labels(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_60group_labels(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + PyArrayObject *__pyx_v_counts = 0; + PyObject *__pyx_v_ids = 0; + PyObject *__pyx_v_reverse = 0; + __pyx_t_5numpy_int64_t __pyx_v_idx; + PyObject *__pyx_v_val = 0; + __pyx_t_5numpy_int64_t __pyx_v_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + __pyx_t_5numpy_int64_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + __pyx_t_5numpy_int64_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + __pyx_t_5numpy_int64_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_labels", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1957 + * ''' + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * ndarray[int64_t] counts = np.empty(n, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/algos.pyx":1958 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * ndarray[int64_t] counts = np.empty(n, dtype=np.int64) + * dict ids = {}, reverse = {} + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/algos.pyx":1959 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * ndarray[int64_t] counts = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * dict ids = {}, reverse = {} + * int64_t idx + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_8 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1960 + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * ndarray[int64_t] counts = np.empty(n, dtype=np.int64) + * dict ids = {}, reverse = {} # <<<<<<<<<<<<<< + * int64_t idx + * object val + */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_ids = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_reverse = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1963 + * int64_t idx + * object val + * int64_t count = 0 # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_v_count = 0; + + /* "pandas/algos.pyx":1965 + * int64_t count = 0 + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1966 + * + * for i from 0 <= i < n: + * val = values[i] # <<<<<<<<<<<<<< + * + * # is NaN + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1969 + * + * # is NaN + * if val != val: # <<<<<<<<<<<<<< + * labels[i] = -1 + * continue + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1970 + * # is NaN + * if val != val: + * labels[i] = -1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides) = -1; + + /* "pandas/algos.pyx":1971 + * if val != val: + * labels[i] = -1 + * continue # <<<<<<<<<<<<<< + * + * # for large number of groups, not doing try: except: makes a big + */ + goto __pyx_L3_continue; + } + + /* "pandas/algos.pyx":1975 + * # for large number of groups, not doing try: except: makes a big + * # difference + * if val in ids: # <<<<<<<<<<<<<< + * idx = ids[val] + * labels[i] = idx + */ + __pyx_t_10 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_ids, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (__pyx_t_10 != 0); + if (__pyx_t_12) { + + /* "pandas/algos.pyx":1976 + * # difference + * if val in ids: + * idx = ids[val] # <<<<<<<<<<<<<< + * labels[i] = idx + * counts[idx] = counts[idx] + 1 + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ids, __pyx_v_val); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_idx = __pyx_t_13; + + /* "pandas/algos.pyx":1977 + * if val in ids: + * idx = ids[val] + * labels[i] = idx # <<<<<<<<<<<<<< + * counts[idx] = counts[idx] + 1 + * else: + */ + __pyx_t_14 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + + /* "pandas/algos.pyx":1978 + * idx = ids[val] + * labels[i] = idx + * counts[idx] = counts[idx] + 1 # <<<<<<<<<<<<<< + * else: + * ids[val] = count + */ + __pyx_t_13 = __pyx_v_idx; + __pyx_t_15 = __pyx_v_idx; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides)) + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/algos.pyx":1980 + * counts[idx] = counts[idx] + 1 + * else: + * ids[val] = count # <<<<<<<<<<<<<< + * reverse[count] = val + * labels[i] = count + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_ids, __pyx_v_val, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1981 + * else: + * ids[val] = count + * reverse[count] = val # <<<<<<<<<<<<<< + * labels[i] = count + * counts[count] = 1 + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_reverse, __pyx_t_5, __pyx_v_val) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1982 + * ids[val] = count + * reverse[count] = val + * labels[i] = count # <<<<<<<<<<<<<< + * counts[count] = 1 + * count += 1 + */ + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/algos.pyx":1983 + * reverse[count] = val + * labels[i] = count + * counts[count] = 1 # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_17 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = 1; + + /* "pandas/algos.pyx":1984 + * labels[i] = count + * counts[count] = 1 + * count += 1 # <<<<<<<<<<<<<< + * + * return reverse, labels, counts[:count].copy() + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/algos.pyx":1986 + * count += 1 + * + * return reverse, labels, counts[:count].copy() # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1949 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_labels(ndarray[object] values): # <<<<<<<<<<<<<< + * ''' + * Compute label vector from input values and associated useful data + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF(__pyx_v_ids); + __Pyx_XDECREF(__pyx_v_reverse); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1991 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, loc, label, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_63groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_63groupsort_indexer = {__Pyx_NAMESTR("groupsort_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_63groupsort_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_63groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + Py_ssize_t __pyx_v_ngroups; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupsort_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_ngroups,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ngroups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupsort_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupsort_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupsort_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupsort_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_62groupsort_indexer(__pyx_self, __pyx_v_index, __pyx_v_ngroups); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_62groupsort_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, Py_ssize_t __pyx_v_ngroups) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_label; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_where = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_where; + __Pyx_Buffer __pyx_pybuffer_where; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + __pyx_t_5numpy_int64_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_5numpy_int64_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupsort_indexer", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_where.pybuffer.buf = NULL; + __pyx_pybuffer_where.refcount = 0; + __pyx_pybuffernd_where.data = NULL; + __pyx_pybuffernd_where.rcbuffer = &__pyx_pybuffer_where; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1997 + * + * # count group sizes, location 0 for NA + * counts = np.zeros(ngroups + 1, dtype=np.int64) # <<<<<<<<<<<<<< + * n = len(index) + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_ngroups + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1998 + * # count group sizes, location 0 for NA + * counts = np.zeros(ngroups + 1, dtype=np.int64) + * n = len(index) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * counts[index[i] + 1] += 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_11; + + /* "pandas/algos.pyx":1999 + * counts = np.zeros(ngroups + 1, dtype=np.int64) + * n = len(index) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * counts[index[i] + 1] += 1 + * + */ + __pyx_t_11 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/algos.pyx":2000 + * n = len(index) + * for i from 0 <= i < n: + * counts[index[i] + 1] += 1 # <<<<<<<<<<<<<< + * + * # mark the start of each contiguous group of like-indexed data + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_index.diminfo[0].strides)) + 1); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + } + + /* "pandas/algos.pyx":2003 + * + * # mark the start of each contiguous group of like-indexed data + * where = np.zeros(ngroups + 1, dtype=np.int64) # <<<<<<<<<<<<<< + * for i from 1 <= i < ngroups + 1: + * where[i] = where[i - 1] + counts[i - 1] + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_ngroups + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_where.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_where.rcbuffer->pybuffer, (PyObject*)__pyx_v_where, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_where.diminfo[0].strides = __pyx_pybuffernd_where.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_where.diminfo[0].shape = __pyx_pybuffernd_where.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_where = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":2004 + * # mark the start of each contiguous group of like-indexed data + * where = np.zeros(ngroups + 1, dtype=np.int64) + * for i from 1 <= i < ngroups + 1: # <<<<<<<<<<<<<< + * where[i] = where[i - 1] + counts[i - 1] + * + */ + __pyx_t_11 = (__pyx_v_ngroups + 1); + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/algos.pyx":2005 + * where = np.zeros(ngroups + 1, dtype=np.int64) + * for i from 1 <= i < ngroups + 1: + * where[i] = where[i - 1] + counts[i - 1] # <<<<<<<<<<<<<< + * + * # this is our indexer + */ + __pyx_t_14 = (__pyx_v_i - 1); + __pyx_t_15 = (__pyx_v_i - 1); + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_where.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_where.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides))); + } + + /* "pandas/algos.pyx":2008 + * + * # this is our indexer + * result = np.zeros(n, dtype=np.int64) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * label = index[i] + 1 + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2009 + * # this is our indexer + * result = np.zeros(n, dtype=np.int64) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * label = index[i] + 1 + * result[where[label]] = i + */ + __pyx_t_11 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/algos.pyx":2010 + * result = np.zeros(n, dtype=np.int64) + * for i from 0 <= i < n: + * label = index[i] + 1 # <<<<<<<<<<<<<< + * result[where[label]] = i + * where[label] += 1 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_v_label = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)) + 1); + + /* "pandas/algos.pyx":2011 + * for i from 0 <= i < n: + * label = index[i] + 1 + * result[where[label]] = i # <<<<<<<<<<<<<< + * where[label] += 1 + * + */ + __pyx_t_18 = __pyx_v_label; + __pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_where.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/algos.pyx":2012 + * label = index[i] + 1 + * result[where[label]] = i + * where[label] += 1 # <<<<<<<<<<<<<< + * + * return result, counts + */ + __pyx_t_20 = __pyx_v_label; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_where.diminfo[0].strides) += 1; + } + + /* "pandas/algos.pyx":2014 + * where[label] += 1 + * + * return result, counts # <<<<<<<<<<<<<< + * + * # TODO: aggregate multiple columns in single pass + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_counts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_counts)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1991 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, loc, label, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupsort_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF((PyObject *)__pyx_v_where); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2022 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_65group_nth_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_64group_nth_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_65group_nth_object = {__Pyx_NAMESTR("group_nth_object"), (PyCFunction)__pyx_pw_6pandas_5algos_65group_nth_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_64group_nth_object)}; +static PyObject *__pyx_pw_6pandas_5algos_65group_nth_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_64group_nth_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_64group_nth_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_resx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + PyObject **__pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_object", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2037 + * ndarray[object, ndim=2] resx + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty(( out).shape, dtype=object) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":2038 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty(( out).shape, dtype=object) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2040 + * resx = np.empty(( out).shape, dtype=object) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_13; + __pyx_v_K = __pyx_t_14; + + /* "pandas/algos.pyx":2042 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_14 = __pyx_v_N; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":2043 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/algos.pyx":2044 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_16 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2045 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L5_continue; + } + + /* "pandas/algos.pyx":2047 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/algos.pyx":2048 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/algos.pyx":2049 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2052 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2053 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if nobs[lab, j] == rank: + * resx[lab, j] = val + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/algos.pyx":2054 + * if val == val: + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2055 + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = __pyx_v_j; + __pyx_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_28); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_28); + *__pyx_t_28 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_28); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L5_continue:; + } + + /* "pandas/algos.pyx":2057 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":2058 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/algos.pyx":2059 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2060 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + __pyx_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_28); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_28); + *__pyx_t_28 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_28); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/algos.pyx":2062 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_28); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_28); + *__pyx_t_28 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_28); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L16:; + } + } + + /* "pandas/algos.pyx":2022 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2066 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_67group_nth_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_66group_nth_bin_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_67group_nth_bin_object = {__Pyx_NAMESTR("group_nth_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_67group_nth_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_66group_nth_bin_object)}; +static PyObject *__pyx_pw_6pandas_5algos_67group_nth_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_bin_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_66group_nth_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_66group_nth_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + PyObject *(*__pyx_t_16)(PyObject *); + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + PyObject **__pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_bin_object", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2080 + * ndarray[float64_t, ndim=2] nobs + * + * nobs = np.zeros(( out).shape, dtype=np.float64) # <<<<<<<<<<<<<< + * resx = np.empty(( out).shape, dtype=object) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":2081 + * + * nobs = np.zeros(( out).shape, dtype=np.float64) + * resx = np.empty(( out).shape, dtype=object) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2083 + * resx = np.empty(( out).shape, dtype=object) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__pyx_t_12 - 1); + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_14) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":2084 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_14; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":2086 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_14 + 1); + } + __pyx_L3:; + + /* "pandas/algos.pyx":2088 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_3 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_14; + __pyx_v_K = __pyx_t_12; + + /* "pandas/algos.pyx":2090 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/algos.pyx":2091 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/algos.pyx":2092 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_15 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_15) { + __pyx_t_17 = __pyx_v_b; + __pyx_t_18 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_19 = __pyx_t_18; + } else { + __pyx_t_19 = __pyx_t_15; + } + if (!__pyx_t_19) break; + + /* "pandas/algos.pyx":2093 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/algos.pyx":2095 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/algos.pyx":2096 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_21 = __pyx_v_K; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":2097 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2100 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2101 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if nobs[b, j] == rank: + * resx[b, j] = val + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/algos.pyx":2102 + * if val == val: + * nobs[b, j] += 1 + * if nobs[b, j] == rank: # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + __pyx_t_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2103 + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_31); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_31); + *__pyx_t_31 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_31); + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/algos.pyx":2105 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_12 = __pyx_v_ngroups; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/algos.pyx":2106 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_21 = __pyx_v_K; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":2107 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2108 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_31); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_31); + *__pyx_t_31 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_31); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/algos.pyx":2110 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_31); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_31); + *__pyx_t_31 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_31); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L18:; + } + } + + /* "pandas/algos.pyx":2066 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2114 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_69group_last_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_68group_last_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_69group_last_object = {__Pyx_NAMESTR("group_last_object"), (PyCFunction)__pyx_pw_6pandas_5algos_69group_last_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_68group_last_object)}; +static PyObject *__pyx_pw_6pandas_5algos_69group_last_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_68group_last_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_68group_last_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + PyObject **__pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_object", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2128 + * ndarray[int64_t, ndim=2] nobs + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty(( out).shape, dtype=object) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":2129 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty(( out).shape, dtype=object) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2131 + * resx = np.empty(( out).shape, dtype=object) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_13; + __pyx_v_K = __pyx_t_14; + + /* "pandas/algos.pyx":2133 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_14 = __pyx_v_N; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":2134 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/algos.pyx":2135 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_16 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2136 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L5_continue; + } + + /* "pandas/algos.pyx":2138 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/algos.pyx":2139 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/algos.pyx":2140 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2143 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * resx[lab, j] = val + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2144 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/algos.pyx":2145 + * if val == val: + * nobs[lab, j] += 1 + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_26); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L5_continue:; + } + + /* "pandas/algos.pyx":2147 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":2148 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/algos.pyx":2149 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2150 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/algos.pyx":2152 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L15:; + } + } + + /* "pandas/algos.pyx":2114 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2156 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_71group_last_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_70group_last_bin_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_71group_last_bin_object = {__Pyx_NAMESTR("group_last_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_71group_last_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_70group_last_bin_object)}; +static PyObject *__pyx_pw_6pandas_5algos_71group_last_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_bin_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_70group_last_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_70group_last_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + PyObject *(*__pyx_t_16)(PyObject *); + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + PyObject **__pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_bin_object", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2170 + * ndarray[float64_t, ndim=2] nobs + * + * nobs = np.zeros(( out).shape, dtype=np.float64) # <<<<<<<<<<<<<< + * resx = np.empty(( out).shape, dtype=object) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":2171 + * + * nobs = np.zeros(( out).shape, dtype=np.float64) + * resx = np.empty(( out).shape, dtype=object) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2173 + * resx = np.empty(( out).shape, dtype=object) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__pyx_t_12 - 1); + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_14) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":2174 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_14; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":2176 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_14 + 1); + } + __pyx_L3:; + + /* "pandas/algos.pyx":2178 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_3 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_14; + __pyx_v_K = __pyx_t_12; + + /* "pandas/algos.pyx":2180 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/algos.pyx":2181 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/algos.pyx":2182 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_15 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_15) { + __pyx_t_17 = __pyx_v_b; + __pyx_t_18 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_19 = __pyx_t_18; + } else { + __pyx_t_19 = __pyx_t_15; + } + if (!__pyx_t_19) break; + + /* "pandas/algos.pyx":2183 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/algos.pyx":2185 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/algos.pyx":2186 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_21 = __pyx_v_K; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":2187 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2190 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * resx[b, j] = val + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2191 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/algos.pyx":2192 + * if val == val: + * nobs[b, j] += 1 + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_29); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_29); + *__pyx_t_29 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_29); + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/algos.pyx":2194 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_12 = __pyx_v_ngroups; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/algos.pyx":2195 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_21 = __pyx_v_K; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":2196 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + __pyx_t_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2197 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_29); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_29); + *__pyx_t_29 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_29); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/algos.pyx":2199 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_29); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_29); + *__pyx_t_29 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_29); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L17:; + } + } + + /* "pandas/algos.pyx":2156 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2206 + * # median + * + * def group_median(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_73group_median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_72group_median[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_73group_median = {__Pyx_NAMESTR("group_median"), (PyCFunction)__pyx_pw_6pandas_5algos_73group_median, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_72group_median)}; +static PyObject *__pyx_pw_6pandas_5algos_73group_median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_median (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_median") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_72group_median(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_72group_median(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_size; + PyArrayObject *__pyx_v__counts = 0; + PyArrayObject *__pyx_v_data = 0; + __pyx_t_5numpy_float64_t *__pyx_v_ptr; + PyObject *__pyx_v_indexer = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd__counts; + __Pyx_Buffer __pyx_pybuffer__counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + long __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_median", 0); + __pyx_pybuffer__counts.pybuffer.buf = NULL; + __pyx_pybuffer__counts.refcount = 0; + __pyx_pybuffernd__counts.data = NULL; + __pyx_pybuffernd__counts.rcbuffer = &__pyx_pybuffer__counts; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2218 + * ndarray data + * float64_t* ptr + * ngroups = len(counts) # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_1; + + /* "pandas/algos.pyx":2219 + * float64_t* ptr + * ngroups = len(counts) + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * indexer, _counts = groupsort_indexer(labels, ngroups) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_1; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":2221 + * N, K = ( values).shape + * + * indexer, _counts = groupsort_indexer(labels, ngroups) # <<<<<<<<<<<<<< + * counts[:] = _counts[1:] + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_indexer = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__counts.rcbuffer->pybuffer, (PyObject*)__pyx_v__counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd__counts.diminfo[0].strides = __pyx_pybuffernd__counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__counts.diminfo[0].shape = __pyx_pybuffernd__counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v__counts = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2222 + * + * indexer, _counts = groupsort_indexer(labels, ngroups) + * counts[:] = _counts[1:] # <<<<<<<<<<<<<< + * + * data = np.empty((K, N), dtype=np.float64) + */ + __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v__counts), 1, 0, NULL, NULL, &__pyx_slice__46, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_counts), __pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__47, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/algos.pyx":2224 + * counts[:] = _counts[1:] + * + * data = np.empty((K, N), dtype=np.float64) # <<<<<<<<<<<<<< + * ptr = data.data + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_data = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2225 + * + * data = np.empty((K, N), dtype=np.float64) + * ptr = data.data # <<<<<<<<<<<<<< + * + * take_2d_axis1_float64_float64(values.T, indexer, out=data) + */ + __pyx_v_ptr = ((__pyx_t_5numpy_float64_t *)__pyx_v_data->data); + + /* "pandas/algos.pyx":2227 + * ptr = data.data + * + * take_2d_axis1_float64_float64(values.T, indexer, out=data) # <<<<<<<<<<<<<< + * + * for i in range(K): + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_take_2d_axis1_float64_float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_indexer); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_indexer); + __Pyx_GIVEREF(__pyx_v_indexer); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_out, ((PyObject *)__pyx_v_data)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2229 + * take_2d_axis1_float64_float64(values.T, indexer, out=data) + * + * for i in range(K): # <<<<<<<<<<<<<< + * # exclude NA group + * ptr += _counts[0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_7; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "pandas/algos.pyx":2231 + * for i in range(K): + * # exclude NA group + * ptr += _counts[0] # <<<<<<<<<<<<<< + * for j in range(ngroups): + * size = _counts[j + 1] + */ + __pyx_t_14 = 0; + __pyx_t_9 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd__counts.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd__counts.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ptr = (__pyx_v_ptr + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd__counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd__counts.diminfo[0].strides))); + + /* "pandas/algos.pyx":2232 + * # exclude NA group + * ptr += _counts[0] + * for j in range(ngroups): # <<<<<<<<<<<<<< + * size = _counts[j + 1] + * out[j, i] = _median_linear(ptr, size) + */ + __pyx_t_15 = __pyx_v_ngroups; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/algos.pyx":2233 + * ptr += _counts[0] + * for j in range(ngroups): + * size = _counts[j + 1] # <<<<<<<<<<<<<< + * out[j, i] = _median_linear(ptr, size) + * ptr += size + */ + __pyx_t_17 = (__pyx_v_j + 1); + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd__counts.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd__counts.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_size = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd__counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd__counts.diminfo[0].strides)); + + /* "pandas/algos.pyx":2234 + * for j in range(ngroups): + * size = _counts[j + 1] + * out[j, i] = _median_linear(ptr, size) # <<<<<<<<<<<<<< + * ptr += size + * + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_f_6pandas_5algos__median_linear(__pyx_v_ptr, __pyx_v_size); + + /* "pandas/algos.pyx":2235 + * size = _counts[j + 1] + * out[j, i] = _median_linear(ptr, size) + * ptr += size # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_ptr = (__pyx_v_ptr + __pyx_v_size); + } + } + + /* "pandas/algos.pyx":2206 + * # median + * + * def group_median(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v__counts); + __Pyx_XDECREF((PyObject *)__pyx_v_data); + __Pyx_XDECREF(__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2238 + * + * + * cdef inline float64_t _median_linear(float64_t* a, int n): # <<<<<<<<<<<<<< + * cdef int i, j, na_count = 0 + * cdef float64_t result + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_5algos__median_linear(__pyx_t_5numpy_float64_t *__pyx_v_a, int __pyx_v_n) { + int __pyx_v_i; + int __pyx_v_j; + int __pyx_v_na_count; + __pyx_t_5numpy_float64_t __pyx_v_result; + __pyx_t_5numpy_float64_t *__pyx_v_tmp; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_median_linear", 0); + + /* "pandas/algos.pyx":2239 + * + * cdef inline float64_t _median_linear(float64_t* a, int n): + * cdef int i, j, na_count = 0 # <<<<<<<<<<<<<< + * cdef float64_t result + * cdef float64_t* tmp + */ + __pyx_v_na_count = 0; + + /* "pandas/algos.pyx":2244 + * + * # count NAs + * for i in range(n): # <<<<<<<<<<<<<< + * if a[i] != a[i]: + * na_count += 1 + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/algos.pyx":2245 + * # count NAs + * for i in range(n): + * if a[i] != a[i]: # <<<<<<<<<<<<<< + * na_count += 1 + * + */ + __pyx_t_3 = (((__pyx_v_a[__pyx_v_i]) != (__pyx_v_a[__pyx_v_i])) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2246 + * for i in range(n): + * if a[i] != a[i]: + * na_count += 1 # <<<<<<<<<<<<<< + * + * if na_count: + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/algos.pyx":2248 + * na_count += 1 + * + * if na_count: # <<<<<<<<<<<<<< + * if na_count == n: + * return NaN + */ + __pyx_t_3 = (__pyx_v_na_count != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2249 + * + * if na_count: + * if na_count == n: # <<<<<<<<<<<<<< + * return NaN + * + */ + __pyx_t_3 = ((__pyx_v_na_count == __pyx_v_n) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2250 + * if na_count: + * if na_count == n: + * return NaN # <<<<<<<<<<<<<< + * + * tmp = malloc((n - na_count) * sizeof(float64_t)) + */ + __pyx_r = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":2252 + * return NaN + * + * tmp = malloc((n - na_count) * sizeof(float64_t)) # <<<<<<<<<<<<<< + * + * j = 0 + */ + __pyx_v_tmp = ((__pyx_t_5numpy_float64_t *)malloc(((__pyx_v_n - __pyx_v_na_count) * (sizeof(__pyx_t_5numpy_float64_t))))); + + /* "pandas/algos.pyx":2254 + * tmp = malloc((n - na_count) * sizeof(float64_t)) + * + * j = 0 # <<<<<<<<<<<<<< + * for i in range(n): + * if a[i] == a[i]: + */ + __pyx_v_j = 0; + + /* "pandas/algos.pyx":2255 + * + * j = 0 + * for i in range(n): # <<<<<<<<<<<<<< + * if a[i] == a[i]: + * tmp[j] = a[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/algos.pyx":2256 + * j = 0 + * for i in range(n): + * if a[i] == a[i]: # <<<<<<<<<<<<<< + * tmp[j] = a[i] + * j += 1 + */ + __pyx_t_3 = (((__pyx_v_a[__pyx_v_i]) == (__pyx_v_a[__pyx_v_i])) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2257 + * for i in range(n): + * if a[i] == a[i]: + * tmp[j] = a[i] # <<<<<<<<<<<<<< + * j += 1 + * + */ + (__pyx_v_tmp[__pyx_v_j]) = (__pyx_v_a[__pyx_v_i]); + + /* "pandas/algos.pyx":2258 + * if a[i] == a[i]: + * tmp[j] = a[i] + * j += 1 # <<<<<<<<<<<<<< + * + * a = tmp + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + + /* "pandas/algos.pyx":2260 + * j += 1 + * + * a = tmp # <<<<<<<<<<<<<< + * n -= na_count + * + */ + __pyx_v_a = __pyx_v_tmp; + + /* "pandas/algos.pyx":2261 + * + * a = tmp + * n -= na_count # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_n = (__pyx_v_n - __pyx_v_na_count); + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/algos.pyx":2264 + * + * + * if n % 2: # <<<<<<<<<<<<<< + * result = kth_smallest_c( a, n / 2, n) + * else: + */ + __pyx_t_3 = (__Pyx_mod_long(__pyx_v_n, 2) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2265 + * + * if n % 2: + * result = kth_smallest_c( a, n / 2, n) # <<<<<<<<<<<<<< + * else: + * result = (kth_smallest_c(a, n / 2, n) + + */ + __pyx_t_4 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, __Pyx_div_long(__pyx_v_n, 2), __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_5; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":2267 + * result = kth_smallest_c( a, n / 2, n) + * else: + * result = (kth_smallest_c(a, n / 2, n) + # <<<<<<<<<<<<<< + * kth_smallest_c(a, n / 2 - 1, n)) / 2 + * + */ + __pyx_t_4 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, __Pyx_div_long(__pyx_v_n, 2), __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/algos.pyx":2268 + * else: + * result = (kth_smallest_c(a, n / 2, n) + + * kth_smallest_c(a, n / 2 - 1, n)) / 2 # <<<<<<<<<<<<<< + * + * if na_count: + */ + __pyx_t_6 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, (__Pyx_div_long(__pyx_v_n, 2) - 1), __pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/algos.pyx":2267 + * result = kth_smallest_c( a, n / 2, n) + * else: + * result = (kth_smallest_c(a, n / 2, n) + # <<<<<<<<<<<<<< + * kth_smallest_c(a, n / 2 - 1, n)) / 2 + * + */ + __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/algos.pyx":2268 + * else: + * result = (kth_smallest_c(a, n / 2, n) + + * kth_smallest_c(a, n / 2 - 1, n)) / 2 # <<<<<<<<<<<<<< + * + * if na_count: + */ + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_5; + } + __pyx_L11:; + + /* "pandas/algos.pyx":2270 + * kth_smallest_c(a, n / 2 - 1, n)) / 2 + * + * if na_count: # <<<<<<<<<<<<<< + * free(a) + * + */ + __pyx_t_3 = (__pyx_v_na_count != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2271 + * + * if na_count: + * free(a) # <<<<<<<<<<<<<< + * + * return result + */ + free(__pyx_v_a); + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/algos.pyx":2273 + * free(a) + * + * return result # <<<<<<<<<<<<<< + * + * include "join.pyx" + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/algos.pyx":2238 + * + * + * cdef inline float64_t _median_linear(float64_t* a, int n): # <<<<<<<<<<<<<< + * cdef int i, j, na_count = 0 + * cdef float64_t result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_WriteUnraisable("pandas.algos._median_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":1 + * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_75inner_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_75inner_join = {__Pyx_NAMESTR("inner_join"), (PyCFunction)__pyx_pw_6pandas_5algos_75inner_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_75inner_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + Py_ssize_t __pyx_v_max_groups; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_74inner_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_74inner_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_count; + PyArrayObject *__pyx_v_left_count = 0; + PyArrayObject *__pyx_v_right_count = 0; + PyArrayObject *__pyx_v_left_sorter = 0; + PyArrayObject *__pyx_v_right_sorter = 0; + PyArrayObject *__pyx_v_left_indexer = 0; + PyArrayObject *__pyx_v_right_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_lc; + __pyx_t_5numpy_int64_t __pyx_v_rc; + Py_ssize_t __pyx_v_left_pos; + Py_ssize_t __pyx_v_right_pos; + Py_ssize_t __pyx_v_position; + Py_ssize_t __pyx_v_offset; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count; + __Pyx_Buffer __pyx_pybuffer_left_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer; + __Pyx_Buffer __pyx_pybuffer_left_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_sorter; + __Pyx_Buffer __pyx_pybuffer_left_sorter; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count; + __Pyx_Buffer __pyx_pybuffer_right_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer; + __Pyx_Buffer __pyx_pybuffer_right_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_sorter; + __Pyx_Buffer __pyx_pybuffer_right_sorter; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + long __pyx_t_18; + long __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyArrayObject *__pyx_t_21 = NULL; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join", 0); + __pyx_pybuffer_left_count.pybuffer.buf = NULL; + __pyx_pybuffer_left_count.refcount = 0; + __pyx_pybuffernd_left_count.data = NULL; + __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count; + __pyx_pybuffer_right_count.pybuffer.buf = NULL; + __pyx_pybuffer_right_count.refcount = 0; + __pyx_pybuffernd_right_count.data = NULL; + __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count; + __pyx_pybuffer_left_sorter.pybuffer.buf = NULL; + __pyx_pybuffer_left_sorter.refcount = 0; + __pyx_pybuffernd_left_sorter.data = NULL; + __pyx_pybuffernd_left_sorter.rcbuffer = &__pyx_pybuffer_left_sorter; + __pyx_pybuffer_right_sorter.pybuffer.buf = NULL; + __pyx_pybuffer_right_sorter.refcount = 0; + __pyx_pybuffernd_right_sorter.data = NULL; + __pyx_pybuffernd_right_sorter.rcbuffer = &__pyx_pybuffer_right_sorter; + __pyx_pybuffer_left_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_left_indexer.refcount = 0; + __pyx_pybuffernd_left_indexer.data = NULL; + __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer; + __pyx_pybuffer_right_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_right_indexer.refcount = 0; + __pyx_pybuffernd_right_indexer.data = NULL; + __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":4 + * Py_ssize_t max_groups): + * cdef: + * Py_ssize_t i, j, k, count = 0 # <<<<<<<<<<<<<< + * ndarray[int64_t] left_count, right_count, left_sorter, right_sorter + * ndarray[int64_t] left_indexer, right_indexer + */ + __pyx_v_count = 0; + + /* "pandas/src/join.pyx":11 + * # NA group in location 0 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) # <<<<<<<<<<<<<< + * right_sorter, right_count = groupsort_indexer(right, max_groups) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_sorter.diminfo[0].strides = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_sorter.diminfo[0].shape = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/join.pyx":12 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) + * right_sorter, right_count = groupsort_indexer(right, max_groups) # <<<<<<<<<<<<<< + * + * # First pass, determine size of result set, do not use the NA group + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_right_sorter.diminfo[0].strides = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_sorter.diminfo[0].shape = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":15 + * + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":16 + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":17 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc > 0 and lc > 0: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":19 + * rc = right_count[i] + * + * if rc > 0 and lc > 0: # <<<<<<<<<<<<<< + * count += lc * rc + * + */ + __pyx_t_15 = ((__pyx_v_rc > 0) != 0); + if (__pyx_t_15) { + __pyx_t_16 = ((__pyx_v_lc > 0) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_15; + } + if (__pyx_t_17) { + + /* "pandas/src/join.pyx":20 + * + * if rc > 0 and lc > 0: + * count += lc * rc # <<<<<<<<<<<<<< + * + * # group 0 is the NA group + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_lc * __pyx_v_rc)); + goto __pyx_L9; + } + __pyx_L9:; + } + + /* "pandas/src/join.pyx":24 + * # group 0 is the NA group + * cdef: + * Py_ssize_t loc, left_pos = 0, right_pos = 0, position = 0 # <<<<<<<<<<<<<< + * Py_ssize_t offset + * + */ + __pyx_v_left_pos = 0; + __pyx_v_right_pos = 0; + __pyx_v_position = 0; + + /* "pandas/src/join.pyx":28 + * + * # exclude the NA group + * left_pos = left_count[0] # <<<<<<<<<<<<<< + * right_pos = right_count[0] + * + */ + __pyx_t_18 = 0; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":29 + * # exclude the NA group + * left_pos = left_count[0] + * right_pos = right_count[0] # <<<<<<<<<<<<<< + * + * left_indexer = np.empty(count, dtype=np.int64) + */ + __pyx_t_19 = 0; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":31 + * right_pos = right_count[0] + * + * left_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * right_indexer = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":32 + * + * left_indexer = np.empty(count, dtype=np.int64) + * right_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(1, max_groups + 1): + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":34 + * right_indexer = np.empty(count, dtype=np.int64) + * + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":35 + * + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":36 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc > 0 and lc > 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":38 + * rc = right_count[i] + * + * if rc > 0 and lc > 0: # <<<<<<<<<<<<<< + * for j in range(lc): + * offset = position + j * rc + */ + __pyx_t_17 = ((__pyx_v_rc > 0) != 0); + if (__pyx_t_17) { + __pyx_t_15 = ((__pyx_v_lc > 0) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (__pyx_t_16) { + + /* "pandas/src/join.pyx":39 + * + * if rc > 0 and lc > 0: + * for j in range(lc): # <<<<<<<<<<<<<< + * offset = position + j * rc + * for k in range(rc): + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":40 + * if rc > 0 and lc > 0: + * for j in range(lc): + * offset = position + j * rc # <<<<<<<<<<<<<< + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + */ + __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc)); + + /* "pandas/src/join.pyx":41 + * for j in range(lc): + * offset = position + j * rc + * for k in range(rc): # <<<<<<<<<<<<<< + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + */ + __pyx_t_26 = __pyx_v_rc; + for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { + __pyx_v_k = __pyx_t_27; + + /* "pandas/src/join.pyx":42 + * offset = position + j * rc + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + */ + __pyx_t_28 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":43 + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k # <<<<<<<<<<<<<< + * position += lc * rc + * left_pos += lc + */ + __pyx_t_29 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k); + } + } + + /* "pandas/src/join.pyx":44 + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + * position += lc * rc # <<<<<<<<<<<<<< + * left_pos += lc + * right_pos += rc + */ + __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc)); + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/join.pyx":45 + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + * left_pos += lc # <<<<<<<<<<<<<< + * right_pos += rc + * + */ + __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc); + + /* "pandas/src/join.pyx":46 + * position += lc * rc + * left_pos += lc + * right_pos += rc # <<<<<<<<<<<<<< + * + * return (_get_result_indexer(left_sorter, left_indexer), + */ + __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc); + } + + /* "pandas/src/join.pyx":48 + * right_pos += rc + * + * return (_get_result_indexer(left_sorter, left_indexer), # <<<<<<<<<<<<<< + * _get_result_indexer(right_sorter, right_indexer)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer)); + PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":49 + * + * return (_get_result_indexer(left_sorter, left_indexer), + * _get_result_indexer(right_sorter, right_indexer)) # <<<<<<<<<<<<<< + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_right_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":48 + * right_pos += rc + * + * return (_get_result_indexer(left_sorter, left_indexer), # <<<<<<<<<<<<<< + * _get_result_indexer(right_sorter, right_indexer)) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/join.pyx":1 + * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_left_count); + __Pyx_XDECREF((PyObject *)__pyx_v_right_count); + __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_77left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_77left_outer_join = {__Pyx_NAMESTR("left_outer_join"), (PyCFunction)__pyx_pw_6pandas_5algos_77left_outer_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_77left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + Py_ssize_t __pyx_v_max_groups; + PyObject *__pyx_v_sort = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_outer_join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,&__pyx_n_s_sort,0}; + PyObject* values[4] = {0,0,0,0}; + + /* "pandas/src/join.pyx":52 + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, + * Py_ssize_t max_groups, sort=True): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, count = 0 + */ + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sort); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_outer_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sort = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_76left_outer_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups, __pyx_v_sort); + + /* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_76left_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups, PyObject *__pyx_v_sort) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_count; + PyArrayObject *__pyx_v_left_count = 0; + PyArrayObject *__pyx_v_right_count = 0; + PyArrayObject *__pyx_v_left_sorter = 0; + PyArrayObject *__pyx_v_right_sorter = 0; + PyArrayObject *__pyx_v_rev = 0; + PyArrayObject *__pyx_v_left_indexer = 0; + PyArrayObject *__pyx_v_right_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_lc; + __pyx_t_5numpy_int64_t __pyx_v_rc; + Py_ssize_t __pyx_v_left_pos; + Py_ssize_t __pyx_v_right_pos; + Py_ssize_t __pyx_v_position; + Py_ssize_t __pyx_v_offset; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count; + __Pyx_Buffer __pyx_pybuffer_left_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer; + __Pyx_Buffer __pyx_pybuffer_left_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count; + __Pyx_Buffer __pyx_pybuffer_right_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer; + __Pyx_Buffer __pyx_pybuffer_right_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + long __pyx_t_18; + long __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyArrayObject *__pyx_t_21 = NULL; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + int __pyx_t_32; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_outer_join", 0); + __pyx_pybuffer_left_count.pybuffer.buf = NULL; + __pyx_pybuffer_left_count.refcount = 0; + __pyx_pybuffernd_left_count.data = NULL; + __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count; + __pyx_pybuffer_right_count.pybuffer.buf = NULL; + __pyx_pybuffer_right_count.refcount = 0; + __pyx_pybuffernd_right_count.data = NULL; + __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count; + __pyx_pybuffer_left_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_left_indexer.refcount = 0; + __pyx_pybuffernd_left_indexer.data = NULL; + __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer; + __pyx_pybuffer_right_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_right_indexer.refcount = 0; + __pyx_pybuffernd_right_indexer.data = NULL; + __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":54 + * Py_ssize_t max_groups, sort=True): + * cdef: + * Py_ssize_t i, j, k, count = 0 # <<<<<<<<<<<<<< + * ndarray[int64_t] left_count, right_count + * ndarray left_sorter, right_sorter, rev + */ + __pyx_v_count = 0; + + /* "pandas/src/join.pyx":62 + * # NA group in location 0 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) # <<<<<<<<<<<<<< + * right_sorter, right_count = groupsort_indexer(right, max_groups) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/join.pyx":63 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) + * right_sorter, right_count = groupsort_indexer(right, max_groups) # <<<<<<<<<<<<<< + * + * # First pass, determine size of result set, do not use the NA group + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":66 + * + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * if right_count[i] > 0: + * count += left_count[i] * right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":67 + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): + * if right_count[i] > 0: # <<<<<<<<<<<<<< + * count += left_count[i] * right_count[i] + * else: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right_count.diminfo[0].strides)) > 0) != 0); + if (__pyx_t_14) { + + /* "pandas/src/join.pyx":68 + * for i in range(1, max_groups + 1): + * if right_count[i] > 0: + * count += left_count[i] * right_count[i] # <<<<<<<<<<<<<< + * else: + * count += left_count[i] + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_count = (__pyx_v_count + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left_count.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_right_count.diminfo[0].strides)))); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/join.pyx":70 + * count += left_count[i] * right_count[i] + * else: + * count += left_count[i] # <<<<<<<<<<<<<< + * + * # group 0 is the NA group + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_count = (__pyx_v_count + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left_count.diminfo[0].strides))); + } + __pyx_L9:; + } + + /* "pandas/src/join.pyx":74 + * # group 0 is the NA group + * cdef: + * Py_ssize_t loc, left_pos = 0, right_pos = 0, position = 0 # <<<<<<<<<<<<<< + * Py_ssize_t offset + * + */ + __pyx_v_left_pos = 0; + __pyx_v_right_pos = 0; + __pyx_v_position = 0; + + /* "pandas/src/join.pyx":78 + * + * # exclude the NA group + * left_pos = left_count[0] # <<<<<<<<<<<<<< + * right_pos = right_count[0] + * + */ + __pyx_t_18 = 0; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":79 + * # exclude the NA group + * left_pos = left_count[0] + * right_pos = right_count[0] # <<<<<<<<<<<<<< + * + * left_indexer = np.empty(count, dtype=np.int64) + */ + __pyx_t_19 = 0; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":81 + * right_pos = right_count[0] + * + * left_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * right_indexer = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":82 + * + * left_indexer = np.empty(count, dtype=np.int64) + * right_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(1, max_groups + 1): + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":84 + * right_indexer = np.empty(count, dtype=np.int64) + * + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":85 + * + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":86 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc == 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":88 + * rc = right_count[i] + * + * if rc == 0: # <<<<<<<<<<<<<< + * for j in range(lc): + * left_indexer[position + j] = left_pos + j + */ + __pyx_t_14 = ((__pyx_v_rc == 0) != 0); + if (__pyx_t_14) { + + /* "pandas/src/join.pyx":89 + * + * if rc == 0: + * for j in range(lc): # <<<<<<<<<<<<<< + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":90 + * if rc == 0: + * for j in range(lc): + * left_indexer[position + j] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[position + j] = -1 + * position += lc + */ + __pyx_t_26 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":91 + * for j in range(lc): + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 # <<<<<<<<<<<<<< + * position += lc + * else: + */ + __pyx_t_27 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = -1; + } + + /* "pandas/src/join.pyx":92 + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 + * position += lc # <<<<<<<<<<<<<< + * else: + * for j in range(lc): + */ + __pyx_v_position = (__pyx_v_position + __pyx_v_lc); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/join.pyx":94 + * position += lc + * else: + * for j in range(lc): # <<<<<<<<<<<<<< + * offset = position + j * rc + * for k in range(rc): + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":95 + * else: + * for j in range(lc): + * offset = position + j * rc # <<<<<<<<<<<<<< + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + */ + __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc)); + + /* "pandas/src/join.pyx":96 + * for j in range(lc): + * offset = position + j * rc + * for k in range(rc): # <<<<<<<<<<<<<< + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + */ + __pyx_t_28 = __pyx_v_rc; + for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_k = __pyx_t_29; + + /* "pandas/src/join.pyx":97 + * offset = position + j * rc + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + */ + __pyx_t_30 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":98 + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k # <<<<<<<<<<<<<< + * position += lc * rc + * left_pos += lc + */ + __pyx_t_31 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k); + } + } + + /* "pandas/src/join.pyx":99 + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + * position += lc * rc # <<<<<<<<<<<<<< + * left_pos += lc + * right_pos += rc + */ + __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc)); + } + __pyx_L12:; + + /* "pandas/src/join.pyx":100 + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + * left_pos += lc # <<<<<<<<<<<<<< + * right_pos += rc + * + */ + __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc); + + /* "pandas/src/join.pyx":101 + * position += lc * rc + * left_pos += lc + * right_pos += rc # <<<<<<<<<<<<<< + * + * left_indexer = _get_result_indexer(left_sorter, left_indexer) + */ + __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc); + } + + /* "pandas/src/join.pyx":103 + * right_pos += rc + * + * left_indexer = _get_result_indexer(left_sorter, left_indexer) # <<<<<<<<<<<<<< + * right_indexer = _get_result_indexer(right_sorter, right_indexer) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer)); + PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v_left_indexer, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/src/join.pyx":104 + * + * left_indexer = _get_result_indexer(left_sorter, left_indexer) + * right_indexer = _get_result_indexer(right_sorter, right_indexer) # <<<<<<<<<<<<<< + * + * if not sort: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter)); + PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_right_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer)); + PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_right_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v_right_indexer, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":106 + * right_indexer = _get_result_indexer(right_sorter, right_indexer) + * + * if not sort: # <<<<<<<<<<<<<< + * if left_sorter.dtype != np.int_: + * left_sorter = left_sorter.astype(np.int_) + */ + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_32 = ((!__pyx_t_14) != 0); + if (__pyx_t_32) { + + /* "pandas/src/join.pyx":107 + * + * if not sort: + * if left_sorter.dtype != np.int_: # <<<<<<<<<<<<<< + * left_sorter = left_sorter.astype(np.int_) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_32 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_32 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (__pyx_t_32) { + + /* "pandas/src/join.pyx":108 + * if not sort: + * if left_sorter.dtype != np.int_: + * left_sorter = left_sorter.astype(np.int_) # <<<<<<<<<<<<<< + * + * rev = np.empty(len(left), dtype=np.int_) + */ + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s_astype); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_left_sorter, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/src/join.pyx":110 + * left_sorter = left_sorter.astype(np.int_) + * + * rev = np.empty(len(left), dtype=np.int_) # <<<<<<<<<<<<<< + * rev.put(left_sorter, np.arange(len(left))) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_rev = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":111 + * + * rev = np.empty(len(left), dtype=np.int_) + * rev.put(left_sorter, np.arange(len(left))) # <<<<<<<<<<<<<< + * + * right_indexer = right_indexer.take(rev) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rev), __pyx_n_s_put); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":113 + * rev.put(left_sorter, np.arange(len(left))) + * + * right_indexer = right_indexer.take(rev) # <<<<<<<<<<<<<< + * left_indexer = left_indexer.take(rev) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_indexer), __pyx_n_s_take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_rev)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_rev)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rev)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v_right_indexer, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":114 + * + * right_indexer = right_indexer.take(rev) + * left_indexer = left_indexer.take(rev) # <<<<<<<<<<<<<< + * + * return left_indexer, right_indexer + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_indexer), __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_rev)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_rev)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rev)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v_left_indexer, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + goto __pyx_L19; + } + __pyx_L19:; + + /* "pandas/src/join.pyx":116 + * left_indexer = left_indexer.take(rev) + * + * return left_indexer, right_indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_left_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer)); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_left_count); + __Pyx_XDECREF((PyObject *)__pyx_v_right_count); + __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_rev); + __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":120 + * + * + * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_79full_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_79full_outer_join = {__Pyx_NAMESTR("full_outer_join"), (PyCFunction)__pyx_pw_6pandas_5algos_79full_outer_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_79full_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + Py_ssize_t __pyx_v_max_groups; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full_outer_join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "full_outer_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.full_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_78full_outer_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_78full_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_count; + PyArrayObject *__pyx_v_left_count = 0; + PyArrayObject *__pyx_v_right_count = 0; + PyArrayObject *__pyx_v_left_sorter = 0; + PyArrayObject *__pyx_v_right_sorter = 0; + PyArrayObject *__pyx_v_left_indexer = 0; + PyArrayObject *__pyx_v_right_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_lc; + __pyx_t_5numpy_int64_t __pyx_v_rc; + __pyx_t_5numpy_int64_t __pyx_v_left_pos; + __pyx_t_5numpy_int64_t __pyx_v_right_pos; + Py_ssize_t __pyx_v_offset; + Py_ssize_t __pyx_v_position; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count; + __Pyx_Buffer __pyx_pybuffer_left_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer; + __Pyx_Buffer __pyx_pybuffer_left_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_sorter; + __Pyx_Buffer __pyx_pybuffer_left_sorter; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count; + __Pyx_Buffer __pyx_pybuffer_right_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer; + __Pyx_Buffer __pyx_pybuffer_right_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_sorter; + __Pyx_Buffer __pyx_pybuffer_right_sorter; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + long __pyx_t_18; + long __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyArrayObject *__pyx_t_21 = NULL; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("full_outer_join", 0); + __pyx_pybuffer_left_count.pybuffer.buf = NULL; + __pyx_pybuffer_left_count.refcount = 0; + __pyx_pybuffernd_left_count.data = NULL; + __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count; + __pyx_pybuffer_right_count.pybuffer.buf = NULL; + __pyx_pybuffer_right_count.refcount = 0; + __pyx_pybuffernd_right_count.data = NULL; + __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count; + __pyx_pybuffer_left_sorter.pybuffer.buf = NULL; + __pyx_pybuffer_left_sorter.refcount = 0; + __pyx_pybuffernd_left_sorter.data = NULL; + __pyx_pybuffernd_left_sorter.rcbuffer = &__pyx_pybuffer_left_sorter; + __pyx_pybuffer_right_sorter.pybuffer.buf = NULL; + __pyx_pybuffer_right_sorter.refcount = 0; + __pyx_pybuffernd_right_sorter.data = NULL; + __pyx_pybuffernd_right_sorter.rcbuffer = &__pyx_pybuffer_right_sorter; + __pyx_pybuffer_left_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_left_indexer.refcount = 0; + __pyx_pybuffernd_left_indexer.data = NULL; + __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer; + __pyx_pybuffer_right_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_right_indexer.refcount = 0; + __pyx_pybuffernd_right_indexer.data = NULL; + __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":123 + * Py_ssize_t max_groups): + * cdef: + * Py_ssize_t i, j, k, count = 0 # <<<<<<<<<<<<<< + * ndarray[int64_t] left_count, right_count, left_sorter, right_sorter + * ndarray[int64_t] left_indexer, right_indexer + */ + __pyx_v_count = 0; + + /* "pandas/src/join.pyx":130 + * # NA group in location 0 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) # <<<<<<<<<<<<<< + * right_sorter, right_count = groupsort_indexer(right, max_groups) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_sorter.diminfo[0].strides = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_sorter.diminfo[0].shape = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/join.pyx":131 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) + * right_sorter, right_count = groupsort_indexer(right, max_groups) # <<<<<<<<<<<<<< + * + * # First pass, determine size of result set, do not use the NA group + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_right_sorter.diminfo[0].strides = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_sorter.diminfo[0].shape = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":134 + * + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":135 + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":136 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc > 0 and lc > 0: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":138 + * rc = right_count[i] + * + * if rc > 0 and lc > 0: # <<<<<<<<<<<<<< + * count += lc * rc + * else: + */ + __pyx_t_15 = ((__pyx_v_rc > 0) != 0); + if (__pyx_t_15) { + __pyx_t_16 = ((__pyx_v_lc > 0) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_15; + } + if (__pyx_t_17) { + + /* "pandas/src/join.pyx":139 + * + * if rc > 0 and lc > 0: + * count += lc * rc # <<<<<<<<<<<<<< + * else: + * count += lc + rc + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_lc * __pyx_v_rc)); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/join.pyx":141 + * count += lc * rc + * else: + * count += lc + rc # <<<<<<<<<<<<<< + * + * # group 0 is the NA group + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_lc + __pyx_v_rc)); + } + __pyx_L9:; + } + + /* "pandas/src/join.pyx":145 + * # group 0 is the NA group + * cdef: + * int64_t left_pos = 0, right_pos = 0 # <<<<<<<<<<<<<< + * Py_ssize_t offset, position = 0 + * + */ + __pyx_v_left_pos = 0; + __pyx_v_right_pos = 0; + + /* "pandas/src/join.pyx":146 + * cdef: + * int64_t left_pos = 0, right_pos = 0 + * Py_ssize_t offset, position = 0 # <<<<<<<<<<<<<< + * + * # exclude the NA group + */ + __pyx_v_position = 0; + + /* "pandas/src/join.pyx":149 + * + * # exclude the NA group + * left_pos = left_count[0] # <<<<<<<<<<<<<< + * right_pos = right_count[0] + * + */ + __pyx_t_18 = 0; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":150 + * # exclude the NA group + * left_pos = left_count[0] + * right_pos = right_count[0] # <<<<<<<<<<<<<< + * + * left_indexer = np.empty(count, dtype=np.int64) + */ + __pyx_t_19 = 0; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":152 + * right_pos = right_count[0] + * + * left_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * right_indexer = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":153 + * + * left_indexer = np.empty(count, dtype=np.int64) + * right_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(1, max_groups + 1): + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":155 + * right_indexer = np.empty(count, dtype=np.int64) + * + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":156 + * + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":157 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc == 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":159 + * rc = right_count[i] + * + * if rc == 0: # <<<<<<<<<<<<<< + * for j in range(lc): + * left_indexer[position + j] = left_pos + j + */ + __pyx_t_17 = ((__pyx_v_rc == 0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/join.pyx":160 + * + * if rc == 0: + * for j in range(lc): # <<<<<<<<<<<<<< + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":161 + * if rc == 0: + * for j in range(lc): + * left_indexer[position + j] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[position + j] = -1 + * position += lc + */ + __pyx_t_26 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":162 + * for j in range(lc): + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 # <<<<<<<<<<<<<< + * position += lc + * elif lc == 0: + */ + __pyx_t_27 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = -1; + } + + /* "pandas/src/join.pyx":163 + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 + * position += lc # <<<<<<<<<<<<<< + * elif lc == 0: + * for j in range(rc): + */ + __pyx_v_position = (__pyx_v_position + __pyx_v_lc); + goto __pyx_L12; + } + + /* "pandas/src/join.pyx":164 + * right_indexer[position + j] = -1 + * position += lc + * elif lc == 0: # <<<<<<<<<<<<<< + * for j in range(rc): + * left_indexer[position + j] = -1 + */ + __pyx_t_17 = ((__pyx_v_lc == 0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/join.pyx":165 + * position += lc + * elif lc == 0: + * for j in range(rc): # <<<<<<<<<<<<<< + * left_indexer[position + j] = -1 + * right_indexer[position + j] = right_pos + j + */ + __pyx_t_24 = __pyx_v_rc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":166 + * elif lc == 0: + * for j in range(rc): + * left_indexer[position + j] = -1 # <<<<<<<<<<<<<< + * right_indexer[position + j] = right_pos + j + * position += rc + */ + __pyx_t_28 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/join.pyx":167 + * for j in range(rc): + * left_indexer[position + j] = -1 + * right_indexer[position + j] = right_pos + j # <<<<<<<<<<<<<< + * position += rc + * else: + */ + __pyx_t_29 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_j); + } + + /* "pandas/src/join.pyx":168 + * left_indexer[position + j] = -1 + * right_indexer[position + j] = right_pos + j + * position += rc # <<<<<<<<<<<<<< + * else: + * for j in range(lc): + */ + __pyx_v_position = (__pyx_v_position + __pyx_v_rc); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/join.pyx":170 + * position += rc + * else: + * for j in range(lc): # <<<<<<<<<<<<<< + * offset = position + j * rc + * for k in range(rc): + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":171 + * else: + * for j in range(lc): + * offset = position + j * rc # <<<<<<<<<<<<<< + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + */ + __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc)); + + /* "pandas/src/join.pyx":172 + * for j in range(lc): + * offset = position + j * rc + * for k in range(rc): # <<<<<<<<<<<<<< + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + */ + __pyx_t_30 = __pyx_v_rc; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_k = __pyx_t_31; + + /* "pandas/src/join.pyx":173 + * offset = position + j * rc + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + */ + __pyx_t_32 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":174 + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k # <<<<<<<<<<<<<< + * position += lc * rc + * left_pos += lc + */ + __pyx_t_33 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k); + } + } + + /* "pandas/src/join.pyx":175 + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + * position += lc * rc # <<<<<<<<<<<<<< + * left_pos += lc + * right_pos += rc + */ + __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc)); + } + __pyx_L12:; + + /* "pandas/src/join.pyx":176 + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + * left_pos += lc # <<<<<<<<<<<<<< + * right_pos += rc + * + */ + __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc); + + /* "pandas/src/join.pyx":177 + * position += lc * rc + * left_pos += lc + * right_pos += rc # <<<<<<<<<<<<<< + * + * return (_get_result_indexer(left_sorter, left_indexer), + */ + __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc); + } + + /* "pandas/src/join.pyx":179 + * right_pos += rc + * + * return (_get_result_indexer(left_sorter, left_indexer), # <<<<<<<<<<<<<< + * _get_result_indexer(right_sorter, right_indexer)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer)); + PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":180 + * + * return (_get_result_indexer(left_sorter, left_indexer), + * _get_result_indexer(right_sorter, right_indexer)) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_right_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":179 + * right_pos += rc + * + * return (_get_result_indexer(left_sorter, left_indexer), # <<<<<<<<<<<<<< + * _get_result_indexer(right_sorter, right_indexer)) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/join.pyx":120 + * + * + * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.full_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_left_count); + __Pyx_XDECREF((PyObject *)__pyx_v_right_count); + __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":184 + * + * + * def _get_result_indexer(sorter, indexer): # <<<<<<<<<<<<<< + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_81_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_81_get_result_indexer = {__Pyx_NAMESTR("_get_result_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_81_get_result_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_81_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_sorter = 0; + PyObject *__pyx_v_indexer = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_result_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sorter,&__pyx_n_s_indexer,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sorter)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_get_result_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_result_indexer") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_sorter = values[0]; + __pyx_v_indexer = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_result_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos._get_result_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_80_get_result_indexer(__pyx_self, __pyx_v_sorter, __pyx_v_indexer); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_80_get_result_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sorter, PyObject *__pyx_v_indexer) { + PyObject *__pyx_v_res = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_result_indexer", 0); + __Pyx_INCREF(__pyx_v_indexer); + + /* "pandas/src/join.pyx":185 + * + * def _get_result_indexer(sorter, indexer): + * if indexer.dtype != np.int_: # <<<<<<<<<<<<<< + * indexer = indexer.astype(np.int_) + * if len(sorter) > 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_indexer, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "pandas/src/join.pyx":186 + * def _get_result_indexer(sorter, indexer): + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) # <<<<<<<<<<<<<< + * if len(sorter) > 0: + * res = sorter.take(indexer) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_indexer, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_indexer, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/join.pyx":187 + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + * if len(sorter) > 0: # <<<<<<<<<<<<<< + * res = sorter.take(indexer) + * np.putmask(res, indexer == -1, -1) + */ + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_t_5 > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/src/join.pyx":188 + * indexer = indexer.astype(np.int_) + * if len(sorter) > 0: + * res = sorter.take(indexer) # <<<<<<<<<<<<<< + * np.putmask(res, indexer == -1, -1) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sorter, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_indexer); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_indexer); + __Pyx_GIVEREF(__pyx_v_indexer); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_res = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":189 + * if len(sorter) > 0: + * res = sorter.take(indexer) + * np.putmask(res, indexer == -1, -1) # <<<<<<<<<<<<<< + * else: + * # length-0 case + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_v_indexer, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/join.pyx":192 + * else: + * # length-0 case + * res = np.empty(len(indexer), dtype=np.int64) # <<<<<<<<<<<<<< + * res.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_indexer); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_res = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/src/join.pyx":193 + * # length-0 case + * res = np.empty(len(indexer), dtype=np.int64) + * res.fill(-1) # <<<<<<<<<<<<<< + * + * return res + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_fill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "pandas/src/join.pyx":195 + * res.fill(-1) + * + * return res # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "pandas/src/join.pyx":184 + * + * + * def _get_result_indexer(sorter, indexer): # <<<<<<<<<<<<<< + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.algos._get_result_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF(__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":199 + * + * + * def ffill_indexer(ndarray[int64_t] indexer): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indexer) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_83ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_83ffill_indexer = {__Pyx_NAMESTR("ffill_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_83ffill_indexer, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_83ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ffill_indexer (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_82ffill_indexer(__pyx_self, ((PyArrayObject *)__pyx_v_indexer)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_82ffill_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_int64_t __pyx_v_val; + __pyx_t_5numpy_int64_t __pyx_v_last_obs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ffill_indexer", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":201 + * def ffill_indexer(ndarray[int64_t] indexer): + * cdef: + * Py_ssize_t i, n = len(indexer) # <<<<<<<<<<<<<< + * ndarray[int64_t] result + * int64_t val, last_obs + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/join.pyx":205 + * int64_t val, last_obs + * + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * last_obs = -1 + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/join.pyx":206 + * + * result = np.empty(n, dtype=np.int64) + * last_obs = -1 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_last_obs = -1; + + /* "pandas/src/join.pyx":208 + * last_obs = -1 + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = indexer[i] + * if val == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":209 + * + * for i in range(n): + * val = indexer[i] # <<<<<<<<<<<<<< + * if val == -1: + * result[i] = last_obs + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/join.pyx":210 + * for i in range(n): + * val = indexer[i] + * if val == -1: # <<<<<<<<<<<<<< + * result[i] = last_obs + * else: + */ + __pyx_t_14 = ((__pyx_v_val == -1) != 0); + if (__pyx_t_14) { + + /* "pandas/src/join.pyx":211 + * val = indexer[i] + * if val == -1: + * result[i] = last_obs # <<<<<<<<<<<<<< + * else: + * result[i] = val + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_last_obs; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/join.pyx":213 + * result[i] = last_obs + * else: + * result[i] = val # <<<<<<<<<<<<<< + * last_obs = val + * + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val; + + /* "pandas/src/join.pyx":214 + * else: + * result[i] = val + * last_obs = val # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_last_obs = __pyx_v_val; + } + __pyx_L5:; + } + + /* "pandas/src/join.pyx":216 + * last_obs = val + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/join.pyx":199 + * + * + * def ffill_indexer(ndarray[int64_t] indexer): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indexer) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.ffill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":219 + * + * + * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids, # <<<<<<<<<<<<<< + * int64_t max_group): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_85ffill_by_group(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_85ffill_by_group = {__Pyx_NAMESTR("ffill_by_group"), (PyCFunction)__pyx_pw_6pandas_5algos_85ffill_by_group, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_85ffill_by_group(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_group_ids = 0; + __pyx_t_5numpy_int64_t __pyx_v_max_group; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ffill_by_group (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indexer,&__pyx_n_s_group_ids,&__pyx_n_s_max_group,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_group_ids)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_group)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ffill_by_group") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_indexer = ((PyArrayObject *)values[0]); + __pyx_v_group_ids = ((PyArrayObject *)values[1]); + __pyx_v_max_group = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_max_group == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.ffill_by_group", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_group_ids), __pyx_ptype_5numpy_ndarray, 1, "group_ids", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_84ffill_by_group(__pyx_self, __pyx_v_indexer, __pyx_v_group_ids, __pyx_v_max_group); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_84ffill_by_group(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_group_ids, __pyx_t_5numpy_int64_t __pyx_v_max_group) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_last_obs = 0; + __pyx_t_5numpy_int64_t __pyx_v_gid; + __pyx_t_5numpy_int64_t __pyx_v_val; + __Pyx_LocalBuf_ND __pyx_pybuffernd_group_ids; + __Pyx_Buffer __pyx_pybuffer_group_ids; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_last_obs; + __Pyx_Buffer __pyx_pybuffer_last_obs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_5numpy_int64_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ffill_by_group", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_last_obs.pybuffer.buf = NULL; + __pyx_pybuffer_last_obs.refcount = 0; + __pyx_pybuffernd_last_obs.data = NULL; + __pyx_pybuffernd_last_obs.rcbuffer = &__pyx_pybuffer_last_obs; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_group_ids.pybuffer.buf = NULL; + __pyx_pybuffer_group_ids.refcount = 0; + __pyx_pybuffernd_group_ids.data = NULL; + __pyx_pybuffernd_group_ids.rcbuffer = &__pyx_pybuffer_group_ids; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_group_ids.rcbuffer->pybuffer, (PyObject*)__pyx_v_group_ids, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_group_ids.diminfo[0].strides = __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_group_ids.diminfo[0].shape = __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":222 + * int64_t max_group): + * cdef: + * Py_ssize_t i, n = len(indexer) # <<<<<<<<<<<<<< + * ndarray[int64_t] result, last_obs + * int64_t gid, val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/join.pyx":226 + * int64_t gid, val + * + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * last_obs = np.empty(max_group, dtype=np.int64) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/join.pyx":228 + * result = np.empty(n, dtype=np.int64) + * + * last_obs = np.empty(max_group, dtype=np.int64) # <<<<<<<<<<<<<< + * last_obs.fill(-1) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_max_group); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer, (PyObject*)__pyx_v_last_obs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_last_obs.diminfo[0].strides = __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_last_obs.diminfo[0].shape = __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_last_obs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/join.pyx":229 + * + * last_obs = np.empty(max_group, dtype=np.int64) + * last_obs.fill(-1) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_last_obs), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/join.pyx":231 + * last_obs.fill(-1) + * + * for i in range(n): # <<<<<<<<<<<<<< + * gid = group_ids[i] + * val = indexer[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":232 + * + * for i in range(n): + * gid = group_ids[i] # <<<<<<<<<<<<<< + * val = indexer[i] + * if val == -1: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_group_ids.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_group_ids.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_gid = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_group_ids.diminfo[0].strides)); + + /* "pandas/src/join.pyx":233 + * for i in range(n): + * gid = group_ids[i] + * val = indexer[i] # <<<<<<<<<<<<<< + * if val == -1: + * result[i] = last_obs[gid] + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/join.pyx":234 + * gid = group_ids[i] + * val = indexer[i] + * if val == -1: # <<<<<<<<<<<<<< + * result[i] = last_obs[gid] + * else: + */ + __pyx_t_15 = ((__pyx_v_val == -1) != 0); + if (__pyx_t_15) { + + /* "pandas/src/join.pyx":235 + * val = indexer[i] + * if val == -1: + * result[i] = last_obs[gid] # <<<<<<<<<<<<<< + * else: + * result[i] = val + */ + __pyx_t_16 = __pyx_v_gid; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_last_obs.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_last_obs.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_last_obs.diminfo[0].strides)); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/join.pyx":237 + * result[i] = last_obs[gid] + * else: + * result[i] = val # <<<<<<<<<<<<<< + * last_obs[gid] = val + * + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val; + + /* "pandas/src/join.pyx":238 + * else: + * result[i] = val + * last_obs[gid] = val # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_19 = __pyx_v_gid; + __pyx_t_8 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_last_obs.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_last_obs.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_last_obs.diminfo[0].strides) = __pyx_v_val; + } + __pyx_L5:; + } + + /* "pandas/src/join.pyx":240 + * last_obs[gid] = val + * + * return result # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/join.pyx":219 + * + * + * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids, # <<<<<<<<<<<<<< + * int64_t max_group): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_group_ids.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.ffill_by_group", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_group_ids.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_last_obs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":43 + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num + * + * cpdef ensure_platform_int(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == PLATFORM_INT: + */ + +static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_platform_int(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_platform_int", 0); + + /* "pandas/src/generated.pyx":44 + * + * cpdef ensure_platform_int(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == PLATFORM_INT: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":45 + * cpdef ensure_platform_int(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == PLATFORM_INT: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == __pyx_v_6pandas_5algos_PLATFORM_INT) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":46 + * if util.is_array(arr): + * if ( arr).descr.type_num == PLATFORM_INT: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":48 + * return arr + * else: + * return arr.astype(np.int_) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int_) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":50 + * return arr.astype(np.int_) + * else: + * return np.array(arr, dtype=np.int_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":43 + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num + * + * cpdef ensure_platform_int(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == PLATFORM_INT: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_platform_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_platform_int (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_86ensure_platform_int(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_86ensure_platform_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_platform_int", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_platform_int(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_platform_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":54 + * + * + * cpdef ensure_float64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT64: + */ + +static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_float64(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_float64", 0); + + /* "pandas/src/generated.pyx":55 + * + * cpdef ensure_float64(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_FLOAT64: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":56 + * cpdef ensure_float64(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT64: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_FLOAT64) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":57 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT64: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.float64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":59 + * return arr + * else: + * return arr.astype(np.float64) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.float64) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":61 + * return arr.astype(np.float64) + * else: + * return np.array(arr, dtype=np.float64) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":54 + * + * + * cpdef ensure_float64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT64: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_float64 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_88ensure_float64(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_88ensure_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_float64", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_float64(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":64 + * + * + * cpdef ensure_float32(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT32: + */ + +static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_float32(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_float32", 0); + + /* "pandas/src/generated.pyx":65 + * + * cpdef ensure_float32(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_FLOAT32: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":66 + * cpdef ensure_float32(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT32: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_FLOAT32) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":67 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT32: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.float32) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":69 + * return arr + * else: + * return arr.astype(np.float32) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.float32) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":71 + * return arr.astype(np.float32) + * else: + * return np.array(arr, dtype=np.float32) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":64 + * + * + * cpdef ensure_float32(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT32: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_float32 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_90ensure_float32(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_90ensure_float32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_float32", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_float32(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":74 + * + * + * cpdef ensure_int8(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT8: + */ + +static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int8(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int8", 0); + + /* "pandas/src/generated.pyx":75 + * + * cpdef ensure_int8(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT8: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":76 + * cpdef ensure_int8(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT8: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT8) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":77 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT8: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int8) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":79 + * return arr + * else: + * return arr.astype(np.int8) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int8) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":81 + * return arr.astype(np.int8) + * else: + * return np.array(arr, dtype=np.int8) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":74 + * + * + * cpdef ensure_int8(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT8: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_int8 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_92ensure_int8(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_92ensure_int8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int8", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int8(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":84 + * + * + * cpdef ensure_int16(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT16: + */ + +static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int16(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int16", 0); + + /* "pandas/src/generated.pyx":85 + * + * cpdef ensure_int16(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT16: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":86 + * cpdef ensure_int16(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT16: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT16) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":87 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT16: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int16) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":89 + * return arr + * else: + * return arr.astype(np.int16) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int16) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":91 + * return arr.astype(np.int16) + * else: + * return np.array(arr, dtype=np.int16) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":84 + * + * + * cpdef ensure_int16(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT16: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_int16 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_94ensure_int16(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_94ensure_int16(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int16", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int16(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":94 + * + * + * cpdef ensure_int32(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT32: + */ + +static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int32(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int32", 0); + + /* "pandas/src/generated.pyx":95 + * + * cpdef ensure_int32(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT32: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":96 + * cpdef ensure_int32(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT32: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT32) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":97 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT32: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int32) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":99 + * return arr + * else: + * return arr.astype(np.int32) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int32) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":101 + * return arr.astype(np.int32) + * else: + * return np.array(arr, dtype=np.int32) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":94 + * + * + * cpdef ensure_int32(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT32: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_int32 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_96ensure_int32(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_96ensure_int32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int32", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int32(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":104 + * + * + * cpdef ensure_int64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + */ + +static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int64(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int64", 0); + + /* "pandas/src/generated.pyx":105 + * + * cpdef ensure_int64(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT64: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":106 + * cpdef ensure_int64(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT64) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":107 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":109 + * return arr + * else: + * return arr.astype(np.int64) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":111 + * return arr.astype(np.int64) + * else: + * return np.array(arr, dtype=np.int64) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":104 + * + * + * cpdef ensure_int64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_int64 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_98ensure_int64(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_98ensure_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int64", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int64(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":114 + * + * + * cpdef ensure_object(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_OBJECT: + */ + +static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_object(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_object", 0); + + /* "pandas/src/generated.pyx":115 + * + * cpdef ensure_object(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_OBJECT: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":116 + * cpdef ensure_object(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_OBJECT: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_OBJECT) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":117 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_OBJECT: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.object_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":119 + * return arr + * else: + * return arr.astype(np.object_) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.object_) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":121 + * return arr.astype(np.object_) + * else: + * return np.array(arr, dtype=np.object_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":114 + * + * + * cpdef ensure_object(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_OBJECT: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_object (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_100ensure_object(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_100ensure_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_object", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_object(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_float64(ndarray[float64_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_float64(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_float64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":137 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":139 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":141 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":142 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":144 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_float64(ndarray[float64_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_102map_indices_float64[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_float64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_102map_indices_float64(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_102map_indices_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_float64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_float64(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_float32(ndarray[float32_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_float32(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_float32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":159 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":161 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":163 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":164 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":166 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_float32(ndarray[float32_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_104map_indices_float32[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_float32 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_104map_indices_float32(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_104map_indices_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_float32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_float32(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":170 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_object(ndarray[object] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_object(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_object", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":181 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":183 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":185 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":186 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_4, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":188 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":170 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_object(ndarray[object] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_106map_indices_object[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_object (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_106map_indices_object(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_106map_indices_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_object", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_object(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":192 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_int32(ndarray[int32_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_int32(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_int32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":203 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":205 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":207 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":208 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":210 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":192 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_int32(ndarray[int32_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_108map_indices_int32[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_int32 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_108map_indices_int32(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_108map_indices_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_int32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_int32(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":214 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_int64(ndarray[int64_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_int64(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_int64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":225 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":227 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":229 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":230 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":232 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":214 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_int64(ndarray[int64_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_110map_indices_int64[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_int64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_110map_indices_int64(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_110map_indices_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_int64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_int64(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":236 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_bool(ndarray[uint8_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_bool(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_bool", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":247 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":249 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":251 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":252 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":254 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":236 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_bool(ndarray[uint8_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_112map_indices_bool[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_bool (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_112map_indices_bool(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_112map_indices_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_bool", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_bool(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_115pad_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_115pad_float64 = {__Pyx_NAMESTR("pad_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_115pad_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_115pad_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":260 + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_114pad_float64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_114pad_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float64_t __pyx_v_cur; + __pyx_t_5numpy_float64_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_float64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":264 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef float64_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":266 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":267 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":268 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":269 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":271 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":272 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":274 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":275 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":276 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":278 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":279 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":281 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":283 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":285 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":286 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":288 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":289 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":290 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":292 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":293 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":294 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":295 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":296 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":297 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":298 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":299 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":300 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":302 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":304 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":305 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":306 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":307 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":308 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":309 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":310 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":312 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":313 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":314 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":316 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_117pad_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_117pad_float32 = {__Pyx_NAMESTR("pad_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_117pad_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_117pad_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":321 + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_116pad_float32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_116pad_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float32_t __pyx_v_cur; + __pyx_t_5numpy_float32_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_float32_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":325 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef float32_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":327 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":328 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":329 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":330 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":332 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":333 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":335 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":336 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":337 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":339 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":340 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":342 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":344 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":346 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":347 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":349 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":350 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":351 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":353 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":354 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":355 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":356 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":357 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":358 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":359 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":360 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":361 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":363 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":365 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":366 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":367 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":368 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":369 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":370 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":371 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":373 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":374 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":375 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":377 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_119pad_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_119pad_object = {__Pyx_NAMESTR("pad_object"), (PyCFunction)__pyx_pw_6pandas_5algos_119pad_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_119pad_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":382 + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_118pad_object(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_118pad_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + PyObject *__pyx_v_cur = 0; + PyObject *__pyx_v_next = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":386 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef object cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":388 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":389 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":390 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":391 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":393 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":394 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":396 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":397 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":398 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":400 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = (__pyx_v_nleft == 0); + if (!__pyx_t_13) { + __pyx_t_12 = (__pyx_v_nright == 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_14 = 0; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":401 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":403 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":405 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_v_cur = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":407 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = (__pyx_v_j <= (__pyx_v_nright - 1)); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":408 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":410 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":411 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":412 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":414 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":415 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":416 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":417 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":418 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_16) { + __pyx_t_12 = (__pyx_v_fill_count < __pyx_v_lim); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":419 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":420 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":421 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":422 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":424 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_next, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":426 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = (__pyx_v_j < __pyx_v_nright); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_cur, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_PyObject_IsTrue(__pyx_t_4)) { + __Pyx_DECREF(__pyx_t_4); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_next, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":427 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":428 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":429 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":430 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":431 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":432 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":434 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":435 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":436 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __Pyx_INCREF(__pyx_v_next); + __Pyx_DECREF_SET(__pyx_v_cur, __pyx_v_next); + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":438 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF(__pyx_v_cur); + __Pyx_XDECREF(__pyx_v_next); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_121pad_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_121pad_int32 = {__Pyx_NAMESTR("pad_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_121pad_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_121pad_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":443 + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_120pad_int32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_120pad_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int32_t __pyx_v_cur; + __pyx_t_5numpy_int32_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int32_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":447 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef int32_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":449 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":450 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":451 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":452 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":454 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":455 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":457 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":458 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":459 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":461 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":462 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":464 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":466 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":468 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":469 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":471 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":472 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":473 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":475 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":476 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":477 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":478 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":479 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":480 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":481 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":482 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":483 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":485 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":487 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":488 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":489 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":490 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":491 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":492 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":493 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":495 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":496 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":497 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":499 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_123pad_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_123pad_int64 = {__Pyx_NAMESTR("pad_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_123pad_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_123pad_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":504 + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_122pad_int64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_122pad_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_cur; + __pyx_t_5numpy_int64_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":508 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef int64_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":510 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":511 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":512 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":513 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":515 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":516 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":518 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":519 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":520 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":522 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":523 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":525 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":527 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":529 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":530 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":532 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":533 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":534 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":536 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":537 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":538 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":539 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":540 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":541 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":542 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":543 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":544 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":546 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":548 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":549 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":550 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":551 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":552 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":553 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":554 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":556 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":557 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":558 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":560 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_125pad_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_125pad_bool = {__Pyx_NAMESTR("pad_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_125pad_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_125pad_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":565 + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_124pad_bool(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_124pad_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_uint8_t __pyx_v_cur; + __pyx_t_5numpy_uint8_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_uint8_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_bool", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":569 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef uint8_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":571 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":572 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":573 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":574 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":576 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":577 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":579 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":580 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":581 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":583 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":584 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":586 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":588 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":590 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":591 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":593 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":594 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":595 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":597 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":598 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":599 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":600 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":601 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":602 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":603 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":604 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":605 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":607 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":609 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":610 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":611 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":612 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":613 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":614 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":615 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":617 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":618 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":619 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":621 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_127backfill_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_127backfill_float64 = {__Pyx_NAMESTR("backfill_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_127backfill_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_127backfill_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":627 + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_126backfill_float64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_126backfill_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float64_t __pyx_v_cur; + __pyx_t_5numpy_float64_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_float64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":631 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef float64_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":633 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":634 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":635 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":636 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":638 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":639 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":641 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":642 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":643 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":645 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":646 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":648 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":649 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":651 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":653 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":654 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":656 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":657 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":658 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":660 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":661 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":662 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":663 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":664 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":665 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":666 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":667 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":668 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":670 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":672 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":673 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":674 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":675 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":676 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":677 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":678 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":680 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":681 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":682 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":684 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_129backfill_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_129backfill_float32 = {__Pyx_NAMESTR("backfill_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_129backfill_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_129backfill_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":689 + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_128backfill_float32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_128backfill_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float32_t __pyx_v_cur; + __pyx_t_5numpy_float32_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_float32_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":693 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef float32_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":695 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":696 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":697 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":698 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":700 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":701 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":703 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":704 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":705 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":707 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":708 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":710 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":711 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":713 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":715 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":716 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":718 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":719 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":720 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":722 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":723 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":724 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":725 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":726 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":727 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":728 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":729 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":730 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":732 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":734 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":735 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":736 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":737 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":738 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":739 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":740 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":742 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":743 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":744 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":746 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_131backfill_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_131backfill_object = {__Pyx_NAMESTR("backfill_object"), (PyCFunction)__pyx_pw_6pandas_5algos_131backfill_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_131backfill_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":751 + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_130backfill_object(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_130backfill_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + PyObject *__pyx_v_cur = 0; + PyObject *__pyx_v_prev = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":755 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef object cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":757 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":758 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":759 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":760 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":762 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":763 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":765 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":766 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":767 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":769 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = (__pyx_v_nleft == 0); + if (!__pyx_t_13) { + __pyx_t_12 = (__pyx_v_nright == 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":770 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":772 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":773 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":775 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_v_cur = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":777 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = (__pyx_v_j >= 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":778 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":780 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":781 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":782 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":784 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":785 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":786 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":787 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":788 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_16) { + __pyx_t_12 = (__pyx_v_fill_count < __pyx_v_lim); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":789 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":790 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":791 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":792 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":794 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_prev, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":796 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = (__pyx_v_j >= 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_prev, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_PyObject_IsTrue(__pyx_t_4)) { + __Pyx_DECREF(__pyx_t_4); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":797 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":798 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":799 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_12) { + __pyx_t_13 = (__pyx_v_fill_count < __pyx_v_lim); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":800 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":801 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":802 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":804 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":805 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":806 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __Pyx_INCREF(__pyx_v_prev); + __Pyx_DECREF_SET(__pyx_v_cur, __pyx_v_prev); + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":808 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF(__pyx_v_cur); + __Pyx_XDECREF(__pyx_v_prev); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_133backfill_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_133backfill_int32 = {__Pyx_NAMESTR("backfill_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_133backfill_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_133backfill_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":813 + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_132backfill_int32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_132backfill_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int32_t __pyx_v_cur; + __pyx_t_5numpy_int32_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int32_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":817 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef int32_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":819 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":820 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":821 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":822 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":824 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":825 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":827 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":828 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":829 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":831 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":832 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":834 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":835 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":837 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":839 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":840 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":842 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":843 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":844 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":846 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":847 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":848 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":849 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":850 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":851 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":852 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":853 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":854 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":856 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":858 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":859 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":860 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":861 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":862 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":863 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":864 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":866 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":867 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":868 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":870 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_135backfill_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_135backfill_int64 = {__Pyx_NAMESTR("backfill_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_135backfill_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_135backfill_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":875 + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_134backfill_int64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_134backfill_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_cur; + __pyx_t_5numpy_int64_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":879 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef int64_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":881 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":882 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":883 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":884 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":886 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":887 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":889 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":890 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":891 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":893 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":894 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":896 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":897 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":899 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":901 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":902 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":904 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":905 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":906 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":908 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":909 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":910 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":911 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":912 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":913 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":914 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":915 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":916 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":918 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":920 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":921 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":922 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":923 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":924 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":925 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":926 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":928 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":929 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":930 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":932 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_137backfill_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_137backfill_bool = {__Pyx_NAMESTR("backfill_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_137backfill_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_137backfill_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":937 + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_136backfill_bool(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_136backfill_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_uint8_t __pyx_v_cur; + __pyx_t_5numpy_uint8_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_uint8_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_bool", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":941 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef uint8_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":943 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":944 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":945 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":946 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":948 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":949 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":951 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":952 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":953 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":955 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":956 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":958 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":959 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":961 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":963 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":964 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":966 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":967 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":968 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":970 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":971 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":972 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":973 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":974 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":975 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":976 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":977 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":978 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":980 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":982 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":983 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":984 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":985 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":986 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":987 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":988 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":990 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":991 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":992 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":994 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_139pad_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_139pad_inplace_float64 = {__Pyx_NAMESTR("pad_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_139pad_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_139pad_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1001 + * def pad_inplace_float64(ndarray[float64_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef float64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_138pad_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_138pad_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1004 + * cdef Py_ssize_t i, N + * cdef float64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1006 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1009 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1010 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1012 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1013 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1015 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1016 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1017 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1019 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1020 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1021 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1022 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1023 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1024 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1025 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1027 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1028 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_141pad_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_141pad_inplace_float32 = {__Pyx_NAMESTR("pad_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_141pad_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_141pad_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1034 + * def pad_inplace_float32(ndarray[float32_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef float32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_140pad_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_140pad_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_float32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1037 + * cdef Py_ssize_t i, N + * cdef float32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1039 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1042 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1043 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1045 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1046 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1048 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1049 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1050 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1052 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1053 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1054 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1055 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1056 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1057 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1058 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1060 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1061 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_143pad_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_143pad_inplace_object = {__Pyx_NAMESTR("pad_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_143pad_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_143pad_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1067 + * def pad_inplace_object(ndarray[object] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef object val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_142pad_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_142pad_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyObject *__pyx_v_val = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1070 + * cdef Py_ssize_t i, N + * cdef object val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1072 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1075 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1076 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1078 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1079 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1081 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1082 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1083 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1085 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_v_val = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":1086 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1087 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1088 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1089 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1090 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1091 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1093 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1094 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_145pad_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_145pad_inplace_int32 = {__Pyx_NAMESTR("pad_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_145pad_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_145pad_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1100 + * def pad_inplace_int32(ndarray[int32_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef int32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_144pad_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_144pad_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1103 + * cdef Py_ssize_t i, N + * cdef int32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1105 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1108 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1109 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1111 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1112 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1114 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1115 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1116 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1118 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1119 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1120 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1121 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1122 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1123 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1124 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1126 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1127 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_147pad_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_147pad_inplace_int64 = {__Pyx_NAMESTR("pad_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_147pad_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_147pad_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1133 + * def pad_inplace_int64(ndarray[int64_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef int64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_146pad_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_146pad_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1136 + * cdef Py_ssize_t i, N + * cdef int64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1138 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1141 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1142 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1144 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1145 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1147 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1148 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1149 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1151 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1152 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1153 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1154 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1155 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1156 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1157 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1159 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1160 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_149pad_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_149pad_inplace_bool = {__Pyx_NAMESTR("pad_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_149pad_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_149pad_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1166 + * def pad_inplace_bool(ndarray[uint8_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef uint8_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_148pad_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_148pad_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_uint8_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1169 + * cdef Py_ssize_t i, N + * cdef uint8_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1171 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1174 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1175 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1177 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1178 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1180 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1181 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1182 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1184 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1185 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1186 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1187 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1188 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1189 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1190 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1192 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1193 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_151backfill_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_151backfill_inplace_float64 = {__Pyx_NAMESTR("backfill_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_151backfill_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_151backfill_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1200 + * def backfill_inplace_float64(ndarray[float64_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef float64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_150backfill_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_150backfill_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1203 + * cdef Py_ssize_t i, N + * cdef float64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1205 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1208 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1209 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1211 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1212 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1214 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1215 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1216 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1218 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1219 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1220 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1221 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1222 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1223 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1224 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1226 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1227 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_153backfill_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_153backfill_inplace_float32 = {__Pyx_NAMESTR("backfill_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_153backfill_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_153backfill_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1232 + * def backfill_inplace_float32(ndarray[float32_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef float32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_152backfill_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_152backfill_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_float32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1235 + * cdef Py_ssize_t i, N + * cdef float32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1237 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1240 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1241 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1243 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1244 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1246 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1247 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1248 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1250 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1251 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1252 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1253 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1254 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1255 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1256 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1258 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1259 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_155backfill_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_155backfill_inplace_object = {__Pyx_NAMESTR("backfill_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_155backfill_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_155backfill_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1264 + * def backfill_inplace_object(ndarray[object] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef object val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_154backfill_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_154backfill_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyObject *__pyx_v_val = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject **__pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1267 + * cdef Py_ssize_t i, N + * cdef object val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1269 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1272 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1273 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1275 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1276 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1278 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1279 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1280 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1282 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_v_val = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":1283 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1284 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1285 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1286 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1287 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1288 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_9); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_9); + *__pyx_t_9 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_9); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1290 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1291 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_157backfill_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_157backfill_inplace_int32 = {__Pyx_NAMESTR("backfill_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_157backfill_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_157backfill_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1296 + * def backfill_inplace_int32(ndarray[int32_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef int32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_156backfill_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_156backfill_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1299 + * cdef Py_ssize_t i, N + * cdef int32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1301 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1304 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1305 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1307 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1308 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1310 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1311 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1312 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1314 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1315 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1316 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1317 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1318 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1319 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1320 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1322 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1323 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_159backfill_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_159backfill_inplace_int64 = {__Pyx_NAMESTR("backfill_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_159backfill_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_159backfill_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1328 + * def backfill_inplace_int64(ndarray[int64_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef int64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_158backfill_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_158backfill_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1331 + * cdef Py_ssize_t i, N + * cdef int64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1333 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1336 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1337 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1339 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1340 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1342 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1343 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1344 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1346 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1347 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1348 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1349 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1350 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1351 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1352 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1354 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1355 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_161backfill_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_161backfill_inplace_bool = {__Pyx_NAMESTR("backfill_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_161backfill_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_161backfill_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1360 + * def backfill_inplace_bool(ndarray[uint8_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef uint8_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_160backfill_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_160backfill_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_uint8_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1363 + * cdef Py_ssize_t i, N + * cdef uint8_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1365 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1368 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1369 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1371 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1372 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1374 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1375 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1376 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1378 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1379 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1380 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1381 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1382 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1383 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1384 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1386 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1387 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_163pad_2d_inplace_float64 = {__Pyx_NAMESTR("pad_2d_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1393 + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef float64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1396 + * cdef Py_ssize_t i, j, N, K + * cdef float64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1398 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1401 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1402 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1404 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1405 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1407 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1408 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1409 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1411 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1412 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1413 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1414 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1415 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1416 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1417 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1418 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1419 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1421 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1422 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_165pad_2d_inplace_float32 = {__Pyx_NAMESTR("pad_2d_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1427 + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef float32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1430 + * cdef Py_ssize_t i, j, N, K + * cdef float32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1432 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1435 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1436 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1438 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1439 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1441 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1442 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1443 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1445 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1446 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1447 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1448 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1449 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1450 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1451 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1452 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1453 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1455 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1456 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_167pad_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_167pad_2d_inplace_object = {__Pyx_NAMESTR("pad_2d_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_167pad_2d_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_167pad_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1461 + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef object val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_166pad_2d_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_166pad_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyObject *__pyx_v_val = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + PyObject **__pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1464 + * cdef Py_ssize_t i, j, N, K + * cdef object val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1466 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1469 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1470 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1472 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1473 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1475 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1476 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1477 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1479 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1480 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1481 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1482 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1483 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1484 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1485 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1486 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1487 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_19); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_19); + *__pyx_t_19 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_19); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1489 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1490 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_20 = __pyx_v_j; + __pyx_t_21 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_169pad_2d_inplace_int32 = {__Pyx_NAMESTR("pad_2d_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1495 + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef int32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1498 + * cdef Py_ssize_t i, j, N, K + * cdef int32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1500 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1503 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1504 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1506 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1507 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1509 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1510 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1511 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1513 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1514 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1515 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1516 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1517 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1518 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1519 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1520 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1521 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1523 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1524 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_171pad_2d_inplace_int64 = {__Pyx_NAMESTR("pad_2d_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1529 + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef int64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1532 + * cdef Py_ssize_t i, j, N, K + * cdef int64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1534 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1537 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1538 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1540 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1541 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1543 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1544 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1545 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1547 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1548 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1549 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1550 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1551 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1552 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1553 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1554 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1555 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1557 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1558 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_173pad_2d_inplace_bool = {__Pyx_NAMESTR("pad_2d_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1563 + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef uint8_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_uint8_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1566 + * cdef Py_ssize_t i, j, N, K + * cdef uint8_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1568 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1571 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1572 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1574 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1575 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1577 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1578 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1579 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1581 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1582 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1583 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1584 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1585 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1586 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1587 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1588 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1589 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1591 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1592 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_175backfill_2d_inplace_float64 = {__Pyx_NAMESTR("backfill_2d_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1598 + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef float64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1601 + * cdef Py_ssize_t i, j, N, K + * cdef float64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1603 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1606 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1607 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1609 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1610 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1612 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1613 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1614 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1616 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1617 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1618 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1619 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1620 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1621 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1622 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1623 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1624 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1626 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1627 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_177backfill_2d_inplace_float32 = {__Pyx_NAMESTR("backfill_2d_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1632 + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef float32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1635 + * cdef Py_ssize_t i, j, N, K + * cdef float32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1637 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1640 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1641 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1643 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1644 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1646 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1647 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1648 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1650 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1651 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1652 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1653 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1654 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1655 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1656 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1657 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1658 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1660 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1661 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_179backfill_2d_inplace_object = {__Pyx_NAMESTR("backfill_2d_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1666 + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef object val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyObject *__pyx_v_val = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject **__pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1669 + * cdef Py_ssize_t i, j, N, K + * cdef object val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1671 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1674 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1675 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1677 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1678 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1680 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1681 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1682 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1684 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1685 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1686 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1687 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1688 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1689 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1690 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1691 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1692 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_18); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1694 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1695 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_181backfill_2d_inplace_int32 = {__Pyx_NAMESTR("backfill_2d_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1700 + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef int32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1703 + * cdef Py_ssize_t i, j, N, K + * cdef int32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1705 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1708 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1709 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1711 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1712 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1714 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1715 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1716 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1718 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1719 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1720 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1721 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1722 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1723 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1724 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1725 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1726 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1728 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1729 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_183backfill_2d_inplace_int64 = {__Pyx_NAMESTR("backfill_2d_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1734 + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef int64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1737 + * cdef Py_ssize_t i, j, N, K + * cdef int64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1739 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1742 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1743 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1745 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1746 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1748 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1749 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1750 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1752 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1753 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1754 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1755 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1756 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1757 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1758 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1759 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1760 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1762 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1763 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_185backfill_2d_inplace_bool = {__Pyx_NAMESTR("backfill_2d_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1768 + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef uint8_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_uint8_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1771 + * cdef Py_ssize_t i, j, N, K + * cdef uint8_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1773 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1776 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1777 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1779 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1780 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1782 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1783 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1784 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1786 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1787 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1788 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1789 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1790 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1791 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1792 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1793 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1794 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1796 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1797 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1801 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float64(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_187is_monotonic_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_186is_monotonic_float64[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_187is_monotonic_float64 = {__Pyx_NAMESTR("is_monotonic_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_187is_monotonic_float64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_186is_monotonic_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_187is_monotonic_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_float64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_186is_monotonic_float64(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_186is_monotonic_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t __pyx_v_prev; + __pyx_t_5numpy_float64_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_float64", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1810 + * Py_ssize_t i, n + * float64_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1812 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1814 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1815 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__98); + __pyx_r = __pyx_tuple__98; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1817 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1818 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1819 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1820 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1821 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__99); + __pyx_r = __pyx_tuple__99; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1822 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1823 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1824 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1825 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1801 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float64(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1828 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float32(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_189is_monotonic_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_188is_monotonic_float32[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_189is_monotonic_float32 = {__Pyx_NAMESTR("is_monotonic_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_189is_monotonic_float32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_188is_monotonic_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_189is_monotonic_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_float32 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_188is_monotonic_float32(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_188is_monotonic_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float32_t __pyx_v_prev; + __pyx_t_5numpy_float32_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_float32", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1837 + * Py_ssize_t i, n + * float32_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1839 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1841 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1842 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__100); + __pyx_r = __pyx_tuple__100; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1844 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1845 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1846 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1847 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1848 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__101); + __pyx_r = __pyx_tuple__101; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1849 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1850 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1851 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1852 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1828 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float32(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1855 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_object(ndarray[object] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_191is_monotonic_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_190is_monotonic_object[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_191is_monotonic_object = {__Pyx_NAMESTR("is_monotonic_object"), (PyCFunction)__pyx_pw_6pandas_5algos_191is_monotonic_object, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_190is_monotonic_object)}; +static PyObject *__pyx_pw_6pandas_5algos_191is_monotonic_object(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_object (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_190is_monotonic_object(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_190is_monotonic_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_prev = 0; + PyObject *__pyx_v_cur = 0; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_object", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1864 + * Py_ssize_t i, n + * object prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1866 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1868 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1869 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__102); + __pyx_r = __pyx_tuple__102; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1871 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_4 = 0; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_v_prev = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":1872 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/src/generated.pyx":1873 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_cur, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":1874 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1875 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__103); + __pyx_r = __pyx_tuple__103; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1876 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1877 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1878 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __Pyx_INCREF(__pyx_v_cur); + __Pyx_DECREF_SET(__pyx_v_prev, __pyx_v_cur); + } + + /* "pandas/src/generated.pyx":1879 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1855 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_object(ndarray[object] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_prev); + __Pyx_XDECREF(__pyx_v_cur); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1882 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int32(ndarray[int32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_193is_monotonic_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_192is_monotonic_int32[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_193is_monotonic_int32 = {__Pyx_NAMESTR("is_monotonic_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_193is_monotonic_int32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_192is_monotonic_int32)}; +static PyObject *__pyx_pw_6pandas_5algos_193is_monotonic_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_int32 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_192is_monotonic_int32(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_192is_monotonic_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int32_t __pyx_v_prev; + __pyx_t_5numpy_int32_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_int32", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1891 + * Py_ssize_t i, n + * int32_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1893 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1895 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1896 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__104); + __pyx_r = __pyx_tuple__104; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1898 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1899 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1900 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1901 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1902 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__105); + __pyx_r = __pyx_tuple__105; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1903 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1904 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1905 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1906 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1882 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int32(ndarray[int32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1909 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int64(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_195is_monotonic_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_194is_monotonic_int64[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_195is_monotonic_int64 = {__Pyx_NAMESTR("is_monotonic_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_195is_monotonic_int64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_194is_monotonic_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_195is_monotonic_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_int64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_194is_monotonic_int64(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_194is_monotonic_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_prev; + __pyx_t_5numpy_int64_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_int64", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1918 + * Py_ssize_t i, n + * int64_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1920 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1922 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1923 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__106); + __pyx_r = __pyx_tuple__106; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1925 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1926 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1927 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1928 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1929 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__107); + __pyx_r = __pyx_tuple__107; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1930 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1931 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1932 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1933 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1909 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int64(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_bool(ndarray[uint8_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_197is_monotonic_bool(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_196is_monotonic_bool[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_197is_monotonic_bool = {__Pyx_NAMESTR("is_monotonic_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_197is_monotonic_bool, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_196is_monotonic_bool)}; +static PyObject *__pyx_pw_6pandas_5algos_197is_monotonic_bool(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_bool (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_196is_monotonic_bool(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_196is_monotonic_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint8_t __pyx_v_prev; + __pyx_t_5numpy_uint8_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_bool", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1945 + * Py_ssize_t i, n + * uint8_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1947 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1949 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1950 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__108); + __pyx_r = __pyx_tuple__108; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1952 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1953 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1954 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1955 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1956 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__109); + __pyx_r = __pyx_tuple__109; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1957 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1958 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1959 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1960 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_bool(ndarray[uint8_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1964 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_199groupby_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_199groupby_float64 = {__Pyx_NAMESTR("groupby_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_199groupby_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_199groupby_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_198groupby_float64(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_198groupby_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_float64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1965 + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1970 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":1972 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1973 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1975 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1976 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1978 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1979 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":1981 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1982 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":1983 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1984 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1986 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":1988 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1964 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1992 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_201groupby_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_201groupby_float32 = {__Pyx_NAMESTR("groupby_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_201groupby_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_201groupby_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_200groupby_float32(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_200groupby_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_float32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1993 + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1998 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2000 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2001 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2003 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2004 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2006 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2007 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2009 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2010 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2011 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2012 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2014 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2016 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1992 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2020 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_203groupby_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_203groupby_object = {__Pyx_NAMESTR("groupby_object"), (PyCFunction)__pyx_pw_6pandas_5algos_203groupby_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_203groupby_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_202groupby_object(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_202groupby_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_object", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2021 + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2026 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2028 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2029 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2031 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2032 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2034 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2035 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2037 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2038 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2039 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2040 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2042 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2044 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2020 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2048 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_205groupby_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_205groupby_int32 = {__Pyx_NAMESTR("groupby_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_205groupby_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_205groupby_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_204groupby_int32(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_204groupby_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_int32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2049 + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2054 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2056 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2057 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2059 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2060 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2062 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2063 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2065 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2066 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2067 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2068 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2070 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2072 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2048 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2076 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_207groupby_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_207groupby_int64 = {__Pyx_NAMESTR("groupby_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_207groupby_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_207groupby_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_206groupby_int64(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_206groupby_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_int64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2077 + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2082 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2084 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2085 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2087 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2088 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2090 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2091 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2093 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2094 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2095 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2096 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2098 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2100 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2076 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2104 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_209groupby_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_209groupby_bool = {__Pyx_NAMESTR("groupby_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_209groupby_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_209groupby_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_bool", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_208groupby_bool(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_208groupby_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_bool", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2105 + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2110 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2112 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2113 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2115 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2116 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2118 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2119 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2121 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2122 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2123 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2124 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2126 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2128 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2104 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_211arrmap_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_211arrmap_float64 = {__Pyx_NAMESTR("arrmap_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_211arrmap_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_211arrmap_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_210arrmap_float64(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_210arrmap_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_float64", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2134 + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2135 + * def arrmap_float64(ndarray[float64_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2137 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2139 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2141 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2142 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2144 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_213arrmap_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_213arrmap_float32 = {__Pyx_NAMESTR("arrmap_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_213arrmap_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_213arrmap_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_212arrmap_float32(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_212arrmap_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_float32", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2149 + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2150 + * def arrmap_float32(ndarray[float32_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2152 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2154 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2156 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2157 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2159 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_215arrmap_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_215arrmap_object = {__Pyx_NAMESTR("arrmap_object"), (PyCFunction)__pyx_pw_6pandas_5algos_215arrmap_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_215arrmap_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_214arrmap_object(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_214arrmap_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_object", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2164 + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2165 + * def arrmap_object(ndarray[object] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2167 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2169 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2171 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2172 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2174 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2178 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_217arrmap_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_217arrmap_int32 = {__Pyx_NAMESTR("arrmap_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_217arrmap_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_217arrmap_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_216arrmap_int32(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_216arrmap_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_int32", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2179 + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2180 + * def arrmap_int32(ndarray[int32_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2182 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2184 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2186 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2187 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2189 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2178 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2193 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_219arrmap_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_219arrmap_int64 = {__Pyx_NAMESTR("arrmap_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_219arrmap_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_219arrmap_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_218arrmap_int64(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_218arrmap_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_int64", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2194 + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2195 + * def arrmap_int64(ndarray[int64_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2197 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2199 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2201 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2202 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2204 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2193 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2208 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_221arrmap_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_221arrmap_bool = {__Pyx_NAMESTR("arrmap_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_221arrmap_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_221arrmap_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_bool", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_220arrmap_bool(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_220arrmap_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_bool", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2209 + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2210 + * def arrmap_bool(ndarray[uint8_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2212 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2214 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2216 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2217 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2219 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2208 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2223 + * + * @cython.wraparound(False) + * def take_1d_bool_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_223take_1d_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_223take_1d_bool_bool = {__Pyx_NAMESTR("take_1d_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_223take_1d_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_223take_1d_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_bool_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__116; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_222take_1d_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_222take_1d_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_uint8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_uint8_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_bool_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2231 + * uint8_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2233 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2234 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2235 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2236 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2237 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2239 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2223 + * + * @cython.wraparound(False) + * def take_1d_bool_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2242 + * + * @cython.wraparound(False) + * def take_1d_bool_object(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_225take_1d_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_225take_1d_bool_object = {__Pyx_NAMESTR("take_1d_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_225take_1d_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_225take_1d_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_bool_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__117; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_224take_1d_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_224take_1d_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject **__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_bool_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2250 + * object fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2252 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":2253 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2254 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_2 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_2 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2255 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2256 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = True if values[idx] > 0 else False + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_6); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_6); + *__pyx_t_6 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_6); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2258 + * out[i] = fv + * else: + * out[i] = True if values[idx] > 0 else False # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides)) > 0) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_7 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_7 = Py_False; + } + __pyx_t_9 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_6); + *__pyx_t_6 = __pyx_t_7; + __Pyx_GIVEREF(*__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2242 + * + * @cython.wraparound(False) + * def take_1d_bool_object(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2261 + * + * @cython.wraparound(False) + * def take_1d_int8_int8(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_227take_1d_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_227take_1d_int8_int8 = {__Pyx_NAMESTR("take_1d_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_227take_1d_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_227take_1d_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int8_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__118; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_226take_1d_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_226take_1d_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int8_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int8_int8", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2269 + * int8_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2271 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2272 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2273 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2274 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2275 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2277 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2261 + * + * @cython.wraparound(False) + * def take_1d_int8_int8(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2280 + * + * @cython.wraparound(False) + * def take_1d_int8_int32(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_229take_1d_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_229take_1d_int8_int32 = {__Pyx_NAMESTR("take_1d_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_229take_1d_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_229take_1d_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int8_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__119; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_228take_1d_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_228take_1d_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int8_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2288 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2290 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2291 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2292 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2293 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2294 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2296 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2280 + * + * @cython.wraparound(False) + * def take_1d_int8_int32(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2299 + * + * @cython.wraparound(False) + * def take_1d_int8_int64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_231take_1d_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_231take_1d_int8_int64 = {__Pyx_NAMESTR("take_1d_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_231take_1d_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_231take_1d_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int8_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__120; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_230take_1d_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_230take_1d_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int8_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2307 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2309 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2310 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2311 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2312 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2313 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2315 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2299 + * + * @cython.wraparound(False) + * def take_1d_int8_int64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2318 + * + * @cython.wraparound(False) + * def take_1d_int8_float64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_233take_1d_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_233take_1d_int8_float64 = {__Pyx_NAMESTR("take_1d_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_233take_1d_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_233take_1d_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int8_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__121; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_232take_1d_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_232take_1d_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int8_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2326 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2328 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2329 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2330 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2331 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2332 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2334 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2318 + * + * @cython.wraparound(False) + * def take_1d_int8_float64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2337 + * + * @cython.wraparound(False) + * def take_1d_int16_int16(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_235take_1d_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_235take_1d_int16_int16 = {__Pyx_NAMESTR("take_1d_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_235take_1d_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_235take_1d_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int16_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__122; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_234take_1d_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_234take_1d_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int16_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int16_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int16_int16", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2345 + * int16_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2347 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2348 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2349 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2350 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2351 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2353 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2337 + * + * @cython.wraparound(False) + * def take_1d_int16_int16(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2356 + * + * @cython.wraparound(False) + * def take_1d_int16_int32(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_237take_1d_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_237take_1d_int16_int32 = {__Pyx_NAMESTR("take_1d_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_237take_1d_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_237take_1d_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int16_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__123; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_236take_1d_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_236take_1d_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int16_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2364 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2366 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2367 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2368 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2369 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2370 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2372 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2356 + * + * @cython.wraparound(False) + * def take_1d_int16_int32(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2375 + * + * @cython.wraparound(False) + * def take_1d_int16_int64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_239take_1d_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_239take_1d_int16_int64 = {__Pyx_NAMESTR("take_1d_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_239take_1d_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_239take_1d_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int16_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__124; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_238take_1d_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_238take_1d_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int16_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2383 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2385 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2386 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2387 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2388 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2389 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2391 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2375 + * + * @cython.wraparound(False) + * def take_1d_int16_int64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2394 + * + * @cython.wraparound(False) + * def take_1d_int16_float64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_241take_1d_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_241take_1d_int16_float64 = {__Pyx_NAMESTR("take_1d_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_241take_1d_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_241take_1d_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int16_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__125; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_240take_1d_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_240take_1d_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int16_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2402 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2404 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2405 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2406 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2407 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2408 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2410 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2394 + * + * @cython.wraparound(False) + * def take_1d_int16_float64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2413 + * + * @cython.wraparound(False) + * def take_1d_int32_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_243take_1d_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_243take_1d_int32_int32 = {__Pyx_NAMESTR("take_1d_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_243take_1d_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_243take_1d_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int32_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__126; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_242take_1d_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_242take_1d_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int32_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2421 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2423 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2424 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2425 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2426 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2427 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2429 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2413 + * + * @cython.wraparound(False) + * def take_1d_int32_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2432 + * + * @cython.wraparound(False) + * def take_1d_int32_int64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_245take_1d_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_245take_1d_int32_int64 = {__Pyx_NAMESTR("take_1d_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_245take_1d_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_245take_1d_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int32_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__127; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_244take_1d_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_244take_1d_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int32_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2440 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2442 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2443 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2444 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2445 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2446 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2448 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2432 + * + * @cython.wraparound(False) + * def take_1d_int32_int64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2451 + * + * @cython.wraparound(False) + * def take_1d_int32_float64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_247take_1d_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_247take_1d_int32_float64 = {__Pyx_NAMESTR("take_1d_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_247take_1d_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_247take_1d_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__128; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_246take_1d_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_246take_1d_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int32_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2459 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2461 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2462 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2463 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2464 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2465 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2467 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2451 + * + * @cython.wraparound(False) + * def take_1d_int32_float64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2470 + * + * @cython.wraparound(False) + * def take_1d_int64_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_249take_1d_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_249take_1d_int64_int64 = {__Pyx_NAMESTR("take_1d_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_249take_1d_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_249take_1d_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int64_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__129; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_248take_1d_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_248take_1d_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int64_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2478 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2480 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2481 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2482 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2483 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2484 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2486 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2470 + * + * @cython.wraparound(False) + * def take_1d_int64_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2489 + * + * @cython.wraparound(False) + * def take_1d_int64_float64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_251take_1d_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_251take_1d_int64_float64 = {__Pyx_NAMESTR("take_1d_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_251take_1d_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_251take_1d_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__130; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_250take_1d_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_250take_1d_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int64_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2497 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2499 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2500 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2501 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2502 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2503 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2505 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2489 + * + * @cython.wraparound(False) + * def take_1d_int64_float64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2508 + * + * @cython.wraparound(False) + * def take_1d_float32_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_253take_1d_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_253take_1d_float32_float32 = {__Pyx_NAMESTR("take_1d_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_253take_1d_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_253take_1d_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_float32_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__131; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_252take_1d_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_252take_1d_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_float32_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2516 + * float32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2518 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2519 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2520 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2521 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2522 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2524 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2508 + * + * @cython.wraparound(False) + * def take_1d_float32_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2527 + * + * @cython.wraparound(False) + * def take_1d_float32_float64(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_255take_1d_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_255take_1d_float32_float64 = {__Pyx_NAMESTR("take_1d_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_255take_1d_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_255take_1d_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_float32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__132; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_254take_1d_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_254take_1d_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_float32_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2535 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2537 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2538 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2539 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2540 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2541 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2543 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2527 + * + * @cython.wraparound(False) + * def take_1d_float32_float64(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2546 + * + * @cython.wraparound(False) + * def take_1d_float64_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_257take_1d_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_257take_1d_float64_float64 = {__Pyx_NAMESTR("take_1d_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_257take_1d_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_257take_1d_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_float64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__133; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_256take_1d_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_256take_1d_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_float64_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2554 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2556 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2557 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2558 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2559 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2560 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2562 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2546 + * + * @cython.wraparound(False) + * def take_1d_float64_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2565 + * + * @cython.wraparound(False) + * def take_1d_object_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_259take_1d_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_259take_1d_object_object = {__Pyx_NAMESTR("take_1d_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_259take_1d_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_259take_1d_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_object_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__134; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_258take_1d_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_258take_1d_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject **__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_object_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2573 + * object fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2575 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":2576 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2577 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_2 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_2 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2578 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2579 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_6); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_6); + *__pyx_t_6 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_6); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2581 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_9 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_6); + *__pyx_t_6 = __pyx_t_7; + __Pyx_GIVEREF(*__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2565 + * + * @cython.wraparound(False) + * def take_1d_object_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2586 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_261take_2d_axis0_bool_bool = {__Pyx_NAMESTR("take_2d_axis0_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_bool_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__135; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_uint8_t __pyx_v_fv; + __pyx_t_5numpy_uint8_t *__pyx_v_v; + __pyx_t_5numpy_uint8_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_uint8_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_bool_bool", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2594 + * uint8_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2595 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2597 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2605 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(uint8_t) and + * sizeof(uint8_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2606 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(uint8_t) and # <<<<<<<<<<<<<< + * sizeof(uint8_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_uint8_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2607 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(uint8_t) and + * sizeof(uint8_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_uint8_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2609 + * sizeof(uint8_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2610 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2611 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2612 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2613 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2615 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(uint8_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":2616 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(uint8_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":2617 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(uint8_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_uint8_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":2618 + * o = &out[i, 0] + * memmove(o, v, (sizeof(uint8_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":2620 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2621 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2622 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2623 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2624 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2626 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2627 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":2586 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2631 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_263take_2d_axis0_bool_object = {__Pyx_NAMESTR("take_2d_axis0_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_bool_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__136; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject **__pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_bool_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2639 + * object fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2640 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2642 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":2665 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2666 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_2 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2667 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_3 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2668 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_4 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2669 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_6 = __pyx_v_j; + __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_5 * __pyx_v_out.strides[0]) ) + __pyx_t_6 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_7); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_7); + *__pyx_t_7 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_7); + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2671 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = True if values[idx, j] > 0 else False + * + */ + __pyx_t_4 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2672 + * else: + * for j from 0 <= j < k: + * out[i, j] = True if values[idx, j] > 0 else False # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_idx; + __pyx_t_10 = __pyx_v_j; + if ((((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_9 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))) > 0) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_8 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_8 = Py_False; + } + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_DECREF(*__pyx_t_7); + *__pyx_t_7 = __pyx_t_8; + __Pyx_GIVEREF(*__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2631 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_265take_2d_axis0_int8_int8 = {__Pyx_NAMESTR("take_2d_axis0_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__137; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int8_t __pyx_v_fv; + __pyx_t_5numpy_int8_t *__pyx_v_v; + __pyx_t_5numpy_int8_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int8_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int8", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2684 + * int8_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2685 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2687 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2695 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(int8_t) and + * sizeof(int8_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2696 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int8_t) and # <<<<<<<<<<<<<< + * sizeof(int8_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int8_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2697 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int8_t) and + * sizeof(int8_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int8_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2699 + * sizeof(int8_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2700 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2701 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2702 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2703 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2705 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(int8_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":2706 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(int8_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":2707 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(int8_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int8_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":2708 + * o = &out[i, 0] + * memmove(o, v, (sizeof(int8_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":2710 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2711 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2712 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2713 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2714 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2716 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2717 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":2676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_267take_2d_axis0_int8_int32 = {__Pyx_NAMESTR("take_2d_axis0_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__138; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2729 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2730 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2732 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2755 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2756 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2757 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2758 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2759 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2761 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2762 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2766 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_269take_2d_axis0_int8_int64 = {__Pyx_NAMESTR("take_2d_axis0_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__139; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2774 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2775 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2777 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2800 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2801 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2802 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2803 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2804 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2806 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2807 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2766 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2811 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_271take_2d_axis0_int8_float64 = {__Pyx_NAMESTR("take_2d_axis0_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int8_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__140; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2813; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int8_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2819 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2820 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2822 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2845 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2846 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2847 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2848 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2849 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2851 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2852 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2811 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2856 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_273take_2d_axis0_int16_int16 = {__Pyx_NAMESTR("take_2d_axis0_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__141; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int16_t __pyx_v_fv; + __pyx_t_5numpy_int16_t *__pyx_v_v; + __pyx_t_5numpy_int16_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int16_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int16", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2864 + * int16_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2865 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2867 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2875 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(int16_t) and + * sizeof(int16_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2876 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int16_t) and # <<<<<<<<<<<<<< + * sizeof(int16_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int16_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2877 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int16_t) and + * sizeof(int16_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int16_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2879 + * sizeof(int16_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2880 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2881 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2882 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2883 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2885 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(int16_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":2886 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(int16_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":2887 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(int16_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int16_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":2888 + * o = &out[i, 0] + * memmove(o, v, (sizeof(int16_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":2890 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2891 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2892 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2893 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2894 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2896 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2897 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":2856 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2901 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_275take_2d_axis0_int16_int32 = {__Pyx_NAMESTR("take_2d_axis0_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__142; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2909 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2910 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2912 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2935 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2936 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2937 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2938 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2939 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2941 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2942 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2901 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2946 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_277take_2d_axis0_int16_int64 = {__Pyx_NAMESTR("take_2d_axis0_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__143; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2954 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2955 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2957 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2980 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2981 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2982 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2983 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2984 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2986 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2987 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2946 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2991 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_279take_2d_axis0_int16_float64 = {__Pyx_NAMESTR("take_2d_axis0_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int16_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__144; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int16_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2999 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3000 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3002 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3025 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3026 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3027 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3028 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3029 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3031 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3032 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2991 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3036 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_281take_2d_axis0_int32_int32 = {__Pyx_NAMESTR("take_2d_axis0_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int32_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__145; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __pyx_t_5numpy_int32_t *__pyx_v_v; + __pyx_t_5numpy_int32_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int32_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3044 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3045 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3047 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3055 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(int32_t) and + * sizeof(int32_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3056 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int32_t) and # <<<<<<<<<<<<<< + * sizeof(int32_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int32_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3057 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int32_t) and + * sizeof(int32_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int32_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3059 + * sizeof(int32_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3060 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3061 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3062 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3063 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3065 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(int32_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":3066 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(int32_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":3067 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(int32_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int32_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":3068 + * o = &out[i, 0] + * memmove(o, v, (sizeof(int32_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3070 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3071 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3072 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3073 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3074 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3076 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3077 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":3036 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3081 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_283take_2d_axis0_int32_int64 = {__Pyx_NAMESTR("take_2d_axis0_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int32_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__146; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int32_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3089 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3090 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3092 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3115 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3116 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3117 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3118 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3119 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3121 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3122 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3081 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_285take_2d_axis0_int32_float64 = {__Pyx_NAMESTR("take_2d_axis0_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__147; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int32_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3134 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3135 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3137 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3160 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3161 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3162 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3163 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3164 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3166 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3167 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3171 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_287take_2d_axis0_int64_int64 = {__Pyx_NAMESTR("take_2d_axis0_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int64_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__148; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __pyx_t_5numpy_int64_t *__pyx_v_v; + __pyx_t_5numpy_int64_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int64_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3179 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3180 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3182 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3190 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(int64_t) and + * sizeof(int64_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3191 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int64_t) and # <<<<<<<<<<<<<< + * sizeof(int64_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int64_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3192 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int64_t) and + * sizeof(int64_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3194 + * sizeof(int64_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3195 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3196 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3197 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3198 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3200 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(int64_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":3201 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(int64_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":3202 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(int64_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":3203 + * o = &out[i, 0] + * memmove(o, v, (sizeof(int64_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3205 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3206 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3207 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3208 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3209 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3211 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3212 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":3171 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3216 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_289take_2d_axis0_int64_float64 = {__Pyx_NAMESTR("take_2d_axis0_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__149; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int64_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3224 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3225 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3227 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3250 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3251 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3252 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3253 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3254 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3256 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3257 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3216 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3261 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_291take_2d_axis0_float32_float32 = {__Pyx_NAMESTR("take_2d_axis0_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_float32_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__150; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float32_t __pyx_v_fv; + __pyx_t_5numpy_float32_t *__pyx_v_v; + __pyx_t_5numpy_float32_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float32_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_float32_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3269 + * float32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3270 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3272 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3280 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(float32_t) and + * sizeof(float32_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3281 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(float32_t) and # <<<<<<<<<<<<<< + * sizeof(float32_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3282 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(float32_t) and + * sizeof(float32_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_float32_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3284 + * sizeof(float32_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3285 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3286 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3287 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3288 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3290 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(float32_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":3291 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(float32_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":3292 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(float32_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_float32_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":3293 + * o = &out[i, 0] + * memmove(o, v, (sizeof(float32_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3295 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3296 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3297 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3298 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3299 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3301 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3302 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":3261 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3306 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_293take_2d_axis0_float32_float64 = {__Pyx_NAMESTR("take_2d_axis0_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_float32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__151; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_float32_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3314 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3315 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3317 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3340 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3341 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3342 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3343 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3344 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3346 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3347 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3306 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3351 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_295take_2d_axis0_float64_float64 = {__Pyx_NAMESTR("take_2d_axis0_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_float64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__152; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __pyx_t_5numpy_float64_t *__pyx_v_v; + __pyx_t_5numpy_float64_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_float64_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3359 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3360 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3362 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3370 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(float64_t) and + * sizeof(float64_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3371 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(float64_t) and # <<<<<<<<<<<<<< + * sizeof(float64_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3372 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(float64_t) and + * sizeof(float64_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3374 + * sizeof(float64_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3375 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3376 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3377 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3378 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3380 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(float64_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":3381 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(float64_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":3382 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(float64_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":3383 + * o = &out[i, 0] + * memmove(o, v, (sizeof(float64_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3385 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3386 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3387 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3388 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3389 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3391 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3392 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":3351 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3396 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_297take_2d_axis0_object_object = {__Pyx_NAMESTR("take_2d_axis0_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_object_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__153; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject **__pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_object_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3404 + * object fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3405 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3407 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":3430 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3431 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_2 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3432 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_3 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3433 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_4 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3434 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_6 = __pyx_v_j; + __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_5 * __pyx_v_out.strides[0]) ) + __pyx_t_6 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_7); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_7); + *__pyx_t_7 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_7); + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3436 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_4 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3437 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_idx; + __pyx_t_10 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_9 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) )); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_DECREF(*__pyx_t_7); + *__pyx_t_7 = __pyx_t_8; + __Pyx_GIVEREF(*__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3396 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3442 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_299take_2d_axis1_bool_bool = {__Pyx_NAMESTR("take_2d_axis1_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_bool_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__154; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3444; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_uint8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_uint8_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_bool_bool", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3450 + * uint8_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3451 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3453 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3454 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3456 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3458 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3459 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3460 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3461 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3462 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3464 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3442 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3468 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_301take_2d_axis1_bool_object = {__Pyx_NAMESTR("take_2d_axis1_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_bool_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__155; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_bool_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3476 + * object fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3477 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3479 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3480 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3482 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":3484 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3485 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_6 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3486 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_7 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3487 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3488 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = True if values[i, idx] > 0 else False + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_8 * __pyx_v_out.strides[0]) ) + __pyx_t_9 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3490 + * out[i, j] = fv + * else: + * out[i, j] = True if values[i, idx] > 0 else False # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + if ((((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))) > 0) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3468 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3494 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_303take_2d_axis1_int8_int8 = {__Pyx_NAMESTR("take_2d_axis1_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__156; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3496; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int8_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int8", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3502 + * int8_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3503 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3505 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3506 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3508 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3510 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3511 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3512 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3513 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3514 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3516 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3494 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3520 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_305take_2d_axis1_int8_int32 = {__Pyx_NAMESTR("take_2d_axis1_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__157; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3522; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3528 + * int32_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3529 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3531 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3532 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3534 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3536 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3537 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3538 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3539 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3540 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3542 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3520 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3546 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_307take_2d_axis1_int8_int64 = {__Pyx_NAMESTR("take_2d_axis1_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__158; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3554 + * int64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3555 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3557 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3558 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3560 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3562 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3563 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3564 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3565 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3566 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3568 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3546 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_309take_2d_axis1_int8_float64 = {__Pyx_NAMESTR("take_2d_axis1_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int8_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__159; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int8_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3580 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3581 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3583 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3584 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3586 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3588 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3589 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3590 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3591 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3592 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3594 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_311take_2d_axis1_int16_int16 = {__Pyx_NAMESTR("take_2d_axis1_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__160; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int16_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int16_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int16", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3606 + * int16_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3607 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3609 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3610 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3612 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3614 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3615 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3616 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3617 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3618 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3620 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3624 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_313take_2d_axis1_int16_int32 = {__Pyx_NAMESTR("take_2d_axis1_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__161; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3632 + * int32_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3633 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3635 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3636 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3638 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3640 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3641 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3642 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3643 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3644 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3646 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3624 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3650 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_315take_2d_axis1_int16_int64 = {__Pyx_NAMESTR("take_2d_axis1_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__162; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3652; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3658 + * int64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3659 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3661 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3662 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3664 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3666 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3667 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3668 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3669 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3670 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3672 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3650 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_317take_2d_axis1_int16_float64 = {__Pyx_NAMESTR("take_2d_axis1_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int16_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__163; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int16_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3684 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3685 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3687 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3688 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3690 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3692 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3693 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3694 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3695 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3696 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3698 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3702 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_319take_2d_axis1_int32_int32 = {__Pyx_NAMESTR("take_2d_axis1_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int32_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__164; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int32_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3710 + * int32_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3711 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3713 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3714 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3716 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3718 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3719 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3720 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3721 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3722 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3724 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3702 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3728 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_321take_2d_axis1_int32_int64 = {__Pyx_NAMESTR("take_2d_axis1_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int32_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__165; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int32_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3736 + * int64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3737 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3739 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3740 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3742 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3744 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3745 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3746 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3747 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3748 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3750 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3728 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3754 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_323take_2d_axis1_int32_float64 = {__Pyx_NAMESTR("take_2d_axis1_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__166; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int32_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3762 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3763 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3765 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3766 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3768 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3770 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3771 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3772 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3773 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3774 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3776 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3754 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3780 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_325take_2d_axis1_int64_int64 = {__Pyx_NAMESTR("take_2d_axis1_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int64_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__167; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3782; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int64_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3788 + * int64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3789 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3791 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3792 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3794 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3796 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3797 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3798 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3799 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3800 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3802 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3780 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3806 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_327take_2d_axis1_int64_float64 = {__Pyx_NAMESTR("take_2d_axis1_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__168; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3808; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int64_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3814 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3815 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3817 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3818 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3820 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3822 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3823 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3824 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3825 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3826 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3828 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3806 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3832 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_329take_2d_axis1_float32_float32 = {__Pyx_NAMESTR("take_2d_axis1_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_float32_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__169; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_float32_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3840 + * float32_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3841 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3843 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3844 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3846 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3848 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3849 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3850 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3851 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3852 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3854 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3832 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3858 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_331take_2d_axis1_float32_float64 = {__Pyx_NAMESTR("take_2d_axis1_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_float32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__170; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_float32_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3866 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3867 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3869 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3870 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3872 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3874 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3875 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3876 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3877 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3878 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3880 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3858 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3884 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_333take_2d_axis1_float64_float64 = {__Pyx_NAMESTR("take_2d_axis1_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_float64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__171; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3886; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_float64_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3892 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3893 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3895 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3896 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3898 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3900 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3901 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3902 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3903 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3904 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3906 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3884 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_335take_2d_axis1_object_object = {__Pyx_NAMESTR("take_2d_axis1_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_object_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__172; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3912; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_object_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3918 + * object fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_object, (int (*)(char *, PyObject *)) __pyx_memview_set_object, 1);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3919 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3921 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3922 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3924 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":3926 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3927 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_6 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3928 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_7 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3929 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3930 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_8 * __pyx_v_out.strides[0]) ) + __pyx_t_9 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3932 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_1 = (PyObject *) *((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3937 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[uint8_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_337take_2d_multi_bool_bool = {__Pyx_NAMESTR("take_2d_multi_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_bool_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__173; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_uint8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_bool_bool", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":3943 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * uint8_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":3944 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * uint8_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":3947 + * uint8_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":3948 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":3950 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":3951 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3952 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3953 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":3954 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3955 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3957 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3958 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":3959 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3961 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3937 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[uint8_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3965 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_339take_2d_multi_bool_object = {__Pyx_NAMESTR("take_2d_multi_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_bool_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__174; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_bool_object", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":3971 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * object fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":3972 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * object fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":3975 + * object fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":3976 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":3978 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":3979 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3980 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3981 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_6 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":3982 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3983 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3985 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3986 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":3987 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = True if values[idx, idx1[j]] > 0 else False + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3989 + * out[i, j] = fv + * else: + * out[i, j] = True if values[idx, idx1[j]] > 0 else False # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + if ((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)) > 0) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3965 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XDECREF(__pyx_v_fv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3993 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int8_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_341take_2d_multi_int8_int8 = {__Pyx_NAMESTR("take_2d_multi_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int8_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__175; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int8_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int8_int8", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":3999 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int8_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4000 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int8_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4003 + * int8_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4004 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4006 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4007 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4008 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4009 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4010 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4011 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4013 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4014 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4015 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4017 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3993 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int8_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4021 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_343take_2d_multi_int8_int32 = {__Pyx_NAMESTR("take_2d_multi_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int8_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__176; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int32_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int8_int32", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4027 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int32_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4028 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int32_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4031 + * int32_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4032 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4034 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4035 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4036 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4037 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4038 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4039 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4041 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4042 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4043 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4045 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4021 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4049 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_345take_2d_multi_int8_int64 = {__Pyx_NAMESTR("take_2d_multi_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int8_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__177; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int8_int64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4055 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4056 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4059 + * int64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4060 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4062 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4063 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4064 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4065 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4066 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4067 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4069 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4070 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4071 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4073 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4049 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4077 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_347take_2d_multi_int8_float64 = {__Pyx_NAMESTR("take_2d_multi_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int8_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__178; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int8_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4083 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4084 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4087 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4088 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4090 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4091 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4092 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4093 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4094 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4095 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4097 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4098 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4099 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4101 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4077 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4105 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int16_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_349take_2d_multi_int16_int16 = {__Pyx_NAMESTR("take_2d_multi_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int16_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__179; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int16_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int16_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int16_int16", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4111 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int16_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4112 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int16_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4115 + * int16_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4116 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4118 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4119 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4120 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4121 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4122 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4123 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4125 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4126 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4127 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4129 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4105 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int16_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_351take_2d_multi_int16_int32 = {__Pyx_NAMESTR("take_2d_multi_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int16_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__180; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int32_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int16_int32", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4139 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int32_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4140 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int32_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4143 + * int32_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4144 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4146 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4147 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4148 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4149 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4150 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4151 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4153 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4154 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4155 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4157 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4161 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_353take_2d_multi_int16_int64 = {__Pyx_NAMESTR("take_2d_multi_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int16_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__181; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int16_int64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4167 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4168 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4171 + * int64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4172 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4174 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4175 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4176 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4177 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4178 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4179 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4181 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4182 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4183 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4185 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4161 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4189 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_355take_2d_multi_int16_float64 = {__Pyx_NAMESTR("take_2d_multi_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int16_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__182; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int16_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4195 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4196 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4199 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4200 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4202 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4203 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4204 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4205 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4206 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4207 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4209 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4210 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4211 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4213 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4189 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4217 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_357take_2d_multi_int32_int32 = {__Pyx_NAMESTR("take_2d_multi_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int32_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__183; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int32_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int32_int32", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4223 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int32_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4224 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int32_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4227 + * int32_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4228 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4230 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4231 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4232 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4233 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4234 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4235 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4237 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4238 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4239 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4241 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4217 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4245 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_359take_2d_multi_int32_int64 = {__Pyx_NAMESTR("take_2d_multi_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int32_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__184; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int32_int64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4251 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4252 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4255 + * int64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4256 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4258 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4259 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4260 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4261 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4262 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4263 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4265 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4266 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4267 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4269 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4245 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4273 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_361take_2d_multi_int32_float64 = {__Pyx_NAMESTR("take_2d_multi_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__185; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int32_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4279 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4280 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4283 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4284 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4286 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4287 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4288 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4289 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4290 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4291 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4293 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4294 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4295 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4297 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4273 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_363take_2d_multi_int64_int64 = {__Pyx_NAMESTR("take_2d_multi_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int64_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__186; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int64_int64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4307 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4308 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4311 + * int64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4312 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4314 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4315 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4316 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4317 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4318 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4319 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4321 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4322 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4323 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4325 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4329 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_365take_2d_multi_int64_float64 = {__Pyx_NAMESTR("take_2d_multi_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__187; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int64_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4335 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4336 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4339 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4340 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4342 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4343 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4344 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4345 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4346 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4347 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4349 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4350 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4351 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4353 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4329 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4357 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float32_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_367take_2d_multi_float32_float32 = {__Pyx_NAMESTR("take_2d_multi_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_float32_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__188; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float32_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_float32_float32", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4363 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float32_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4364 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float32_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4367 + * float32_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4368 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4370 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4371 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4372 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4373 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4374 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4375 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4377 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4378 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4379 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4381 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4357 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float32_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4385 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_369take_2d_multi_float32_float64 = {__Pyx_NAMESTR("take_2d_multi_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_float32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__189; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_float32_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4391 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4392 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4395 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4396 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4398 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4399 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4400 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4401 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4402 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4403 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4405 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4406 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4407 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4409 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4385 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4413 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_371take_2d_multi_float64_float64 = {__Pyx_NAMESTR("take_2d_multi_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_float64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__190; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_float64_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4419 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4420 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4423 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4424 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4426 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4427 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4428 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4429 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4430 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4431 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4433 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4434 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4435 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4437 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4413 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4441 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_object_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_373take_2d_multi_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_373take_2d_multi_object_object = {__Pyx_NAMESTR("take_2d_multi_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_373take_2d_multi_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_373take_2d_multi_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_object_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__191; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_372take_2d_multi_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_372take_2d_multi_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_object_object", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4447 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * object fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4448 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * object fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4451 + * object fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4452 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4454 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":4455 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4456 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4457 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_6 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":4458 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4459 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4461 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4462 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":4463 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4465 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4441 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_object_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XDECREF(__pyx_v_fv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4470 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float64(ndarray[float64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_375diff_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_375diff_2d_float64 = {__Pyx_NAMESTR("diff_2d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_375diff_2d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_375diff_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_374diff_2d_float64(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_374diff_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_float64", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4476 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4477 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4478 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4479 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4480 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4482 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4483 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4484 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4485 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4487 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4488 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4490 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4491 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4492 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4493 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4495 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4496 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4497 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4499 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4500 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4501 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4502 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4504 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4505 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4507 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4508 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4509 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4510 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4470 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float64(ndarray[float64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4513 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float32(ndarray[float32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_377diff_2d_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_377diff_2d_float32 = {__Pyx_NAMESTR("diff_2d_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_377diff_2d_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_377diff_2d_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_376diff_2d_float32(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_376diff_2d_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_float32", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4519 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4520 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4521 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4522 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4523 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4525 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4526 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4527 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4528 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4530 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4531 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4533 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4534 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4535 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4536 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4538 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4539 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4540 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4542 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4543 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4544 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4545 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4547 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4548 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4550 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4551 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4552 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4553 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4513 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float32(ndarray[float32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4556 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int8(ndarray[int8_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_379diff_2d_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_379diff_2d_int8 = {__Pyx_NAMESTR("diff_2d_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_379diff_2d_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_379diff_2d_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4558; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4558; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_378diff_2d_int8(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_378diff_2d_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_int8", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4562 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4563 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4564 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4565 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4566 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4568 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4569 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4570 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4571 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4573 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4574 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4576 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4577 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4578 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4579 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4581 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4582 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4583 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4585 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4586 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4587 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4588 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4590 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4591 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4593 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4594 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4595 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4596 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4556 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int8(ndarray[int8_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4599 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int16(ndarray[int16_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_381diff_2d_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_381diff_2d_int16 = {__Pyx_NAMESTR("diff_2d_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_381diff_2d_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_381diff_2d_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4601; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4601; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_380diff_2d_int16(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_380diff_2d_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_int16", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4605 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4606 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4607 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4608 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4609 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4611 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4612 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4613 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4614 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4616 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4617 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4619 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4620 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4621 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4622 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4624 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4625 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4626 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4628 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4629 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4630 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4631 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4633 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4634 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4636 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4637 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4638 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4639 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4599 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int16(ndarray[int16_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4642 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int32(ndarray[int32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_383diff_2d_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_383diff_2d_int32 = {__Pyx_NAMESTR("diff_2d_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_383diff_2d_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_383diff_2d_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_382diff_2d_int32(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_382diff_2d_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_int32", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4648 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4649 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4650 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4651 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4652 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4654 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4655 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4656 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4657 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4659 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4660 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4662 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4663 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4664 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4665 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4667 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4668 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4669 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4671 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4672 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4673 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4674 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4676 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4677 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4679 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4680 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4681 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4682 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4642 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int32(ndarray[int32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4685 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int64(ndarray[int64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_385diff_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_385diff_2d_int64 = {__Pyx_NAMESTR("diff_2d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_385diff_2d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_385diff_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_384diff_2d_int64(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_384diff_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_int64", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4691 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4692 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4693 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4694 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4695 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4697 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4698 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4699 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4700 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4702 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4703 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4705 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4706 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4707 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4708 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4710 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4711 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4712 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4714 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4715 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4716 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4717 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4719 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4720 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4722 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4723 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4724 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4725 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4685 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int64(ndarray[int64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4729 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_387group_last_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_386group_last_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_387group_last_float64 = {__Pyx_NAMESTR("group_last_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_387group_last_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_386group_last_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_387group_last_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_386group_last_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_386group_last_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_float64", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4742 + * ndarray[int64_t, ndim=2] nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4743 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":4745 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":4746 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":4748 + * resx = np.empty_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":4750 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4751 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4752 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4753 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":4755 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4756 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4757 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_21 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4760 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * resx[lab, j] = val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4761 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_23 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/src/generated.pyx":4762 + * if val == val: + * nobs[lab, j] += 1 + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":4764 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4765 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4766 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4767 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4769 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.wraparound(False) + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_33 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L16:; + } + } + + /* "pandas/src/generated.pyx":4729 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4772 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_389group_last_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_388group_last_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_389group_last_float32 = {__Pyx_NAMESTR("group_last_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_389group_last_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_388group_last_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_389group_last_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_388group_last_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_388group_last_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_float32", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4785 + * ndarray[int64_t, ndim=2] nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4786 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":4788 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":4789 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":4791 + * resx = np.empty_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":4793 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4794 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4795 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4796 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":4798 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4799 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4800 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_21 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4803 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * resx[lab, j] = val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4804 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_23 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/src/generated.pyx":4805 + * if val == val: + * nobs[lab, j] += 1 + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":4807 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4808 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4809 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4810 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4812 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_33 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L16:; + } + } + + /* "pandas/src/generated.pyx":4772 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4816 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_391group_last_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_390group_last_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_391group_last_bin_float64 = {__Pyx_NAMESTR("group_last_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_391group_last_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_390group_last_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_391group_last_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_390group_last_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_390group_last_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_bin_float64", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4828 + * ndarray[float64_t, ndim=2] resx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":4829 + * + * nobs = np.zeros_like(out) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":4831 + * resx = np.empty_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_5 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":4832 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4834 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":4836 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":4838 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":4839 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":4840 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":4841 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":4843 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4844 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":4845 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4848 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * resx[b, j] = val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":4849 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":4850 + * if val == val: + * nobs[b, j] += 1 + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/src/generated.pyx":4852 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":4853 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":4854 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":4855 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4857 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.wraparound(False) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_34 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L17:; + } + } + + /* "pandas/src/generated.pyx":4816 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4860 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_393group_last_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_392group_last_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_393group_last_bin_float32 = {__Pyx_NAMESTR("group_last_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_393group_last_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_392group_last_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_393group_last_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_392group_last_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_392group_last_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_bin_float32", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4872 + * ndarray[float32_t, ndim=2] resx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":4873 + * + * nobs = np.zeros_like(out) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":4875 + * resx = np.empty_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_5 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":4876 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4878 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":4880 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":4882 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":4883 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":4884 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":4885 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":4887 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4888 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":4889 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4892 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * resx[b, j] = val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":4893 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":4894 + * if val == val: + * nobs[b, j] += 1 + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/src/generated.pyx":4896 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":4897 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":4898 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":4899 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4901 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_34 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L17:; + } + } + + /* "pandas/src/generated.pyx":4860 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4905 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_395group_nth_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_394group_nth_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_395group_nth_float64 = {__Pyx_NAMESTR("group_nth_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_395group_nth_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_394group_nth_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_395group_nth_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_394group_nth_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_394group_nth_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_float64", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4918 + * ndarray[int64_t, ndim=2] nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4919 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":4921 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":4922 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":4924 + * resx = np.empty_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":4926 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4927 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4928 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4929 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":4931 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4932 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4933 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4936 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4937 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if nobs[lab, j] == rank: + * resx[lab, j] = val + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/src/generated.pyx":4938 + * if val == val: + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4939 + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":4941 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4942 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4943 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4944 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4946 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L17:; + } + } + + /* "pandas/src/generated.pyx":4905 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4949 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_397group_nth_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_396group_nth_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_397group_nth_float32 = {__Pyx_NAMESTR("group_nth_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_397group_nth_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_396group_nth_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_397group_nth_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4952; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_396group_nth_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_396group_nth_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_float32", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4962 + * ndarray[int64_t, ndim=2] nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4963 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":4965 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":4966 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":4968 + * resx = np.empty_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":4970 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4971 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4972 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4973 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":4975 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4976 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4977 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4980 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4981 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if nobs[lab, j] == rank: + * resx[lab, j] = val + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/src/generated.pyx":4982 + * if val == val: + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4983 + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":4985 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4986 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4987 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4988 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4990 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L17:; + } + } + + /* "pandas/src/generated.pyx":4949 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4994 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_399group_nth_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_398group_nth_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_399group_nth_bin_float64 = {__Pyx_NAMESTR("group_nth_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_399group_nth_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_398group_nth_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_399group_nth_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_398group_nth_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_398group_nth_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_bin_float64", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5006 + * ndarray[float64_t, ndim=2] resx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5007 + * + * nobs = np.zeros_like(out) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5009 + * resx = np.empty_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5010 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5012 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5014 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5016 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5017 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5018 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5019 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5021 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5022 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5023 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5026 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5027 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if nobs[b, j] == rank: + * resx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5028 + * if val == val: + * nobs[b, j] += 1 + * if nobs[b, j] == rank: # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5029 + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/src/generated.pyx":5031 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5032 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5033 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5034 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5036 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L18:; + } + } + + /* "pandas/src/generated.pyx":4994 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5039 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_401group_nth_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_400group_nth_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_401group_nth_bin_float32 = {__Pyx_NAMESTR("group_nth_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_401group_nth_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_400group_nth_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_401group_nth_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5042; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_400group_nth_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_400group_nth_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_bin_float32", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5051 + * ndarray[float32_t, ndim=2] resx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5052 + * + * nobs = np.zeros_like(out) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5054 + * resx = np.empty_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5055 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5057 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5059 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5061 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5062 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5063 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5064 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5066 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5067 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5068 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5071 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5072 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if nobs[b, j] == rank: + * resx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5073 + * if val == val: + * nobs[b, j] += 1 + * if nobs[b, j] == rank: # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5074 + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/src/generated.pyx":5076 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5077 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5078 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5079 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5081 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L18:; + } + } + + /* "pandas/src/generated.pyx":5039 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5085 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_403group_add_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_402group_add_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_403group_add_float64 = {__Pyx_NAMESTR("group_add_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_403group_add_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_402group_add_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_403group_add_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_add_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_add_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_402group_add_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_402group_add_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_add_float64", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5097 + * ndarray[float64_t, ndim=2] sumx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5098 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5100 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5101 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5103 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5105 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5106 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5107 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5108 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5109 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5111 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5112 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5113 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5116 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5117 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5118 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5120 + * sumx[lab, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5121 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5122 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5123 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5125 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5126 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5129 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5130 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5131 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5133 + * sumx[lab, 0] += val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5134 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5135 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5136 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5138 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_sumx.diminfo[1].strides)); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5085 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_add_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5141 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_405group_add_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_404group_add_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_405group_add_float32 = {__Pyx_NAMESTR("group_add_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_405group_add_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_404group_add_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_405group_add_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_add_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_add_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_404group_add_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_404group_add_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_add_float32", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5153 + * ndarray[float32_t, ndim=2] sumx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5154 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5156 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5157 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5159 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5161 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5162 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5163 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5164 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5165 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5167 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5168 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5169 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5172 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5173 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5174 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5176 + * sumx[lab, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5177 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5178 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5179 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5181 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5182 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5185 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5186 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5187 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5189 + * sumx[lab, 0] += val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5190 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5191 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5192 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5194 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_sumx.diminfo[1].strides)); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5141 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_add_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_407group_add_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_406group_add_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_407group_add_bin_float64 = {__Pyx_NAMESTR("group_add_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_407group_add_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_406group_add_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_407group_add_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_add_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_add_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_406group_add_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_406group_add_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_add_bin_float64", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5210 + * ndarray[float64_t, ndim=2] sumx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5211 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5213 + * sumx = np.zeros_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5214 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5216 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5217 + * else: + * ngroups = len(bins) + 1 + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5219 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5220 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5221 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5222 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5223 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5225 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5226 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5227 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5230 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5231 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5232 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5234 + * sumx[b, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5235 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5236 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5238 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5239 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5242 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5243 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5244 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5246 + * sumx[b, 0] += val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5247 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5248 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5249 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5251 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_sumx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_add_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5254 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_409group_add_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_408group_add_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_409group_add_bin_float32 = {__Pyx_NAMESTR("group_add_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_409group_add_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_408group_add_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_409group_add_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_add_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_add_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_408group_add_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_408group_add_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_add_bin_float32", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5266 + * ndarray[float32_t, ndim=2] sumx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5267 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5269 + * sumx = np.zeros_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5270 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5272 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5273 + * else: + * ngroups = len(bins) + 1 + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5275 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5276 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5277 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5278 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5279 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5281 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5282 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5283 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5286 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5287 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5288 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5290 + * sumx[b, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5291 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5292 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5294 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5295 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5298 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5299 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5300 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5302 + * sumx[b, 0] += val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5303 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5304 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5305 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5307 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_sumx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5254 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_add_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5311 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_411group_prod_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_410group_prod_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_411group_prod_float64 = {__Pyx_NAMESTR("group_prod_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_411group_prod_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_410group_prod_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_411group_prod_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_prod_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_prod_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_410group_prod_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_410group_prod_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_prodx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx; + __Pyx_Buffer __pyx_pybuffer_prodx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_prod_float64", 0); + __pyx_pybuffer_prodx.pybuffer.buf = NULL; + __pyx_pybuffer_prodx.refcount = 0; + __pyx_pybuffernd_prodx.data = NULL; + __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5323 + * ndarray[float64_t, ndim=2] prodx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5324 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5326 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * prodx = np.ones_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5327 + * + * nobs = np.zeros_like(out) + * prodx = np.ones_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_prodx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5329 + * prodx = np.ones_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5331 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5332 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5333 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5334 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5335 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5337 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5338 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5339 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5342 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * prodx[lab, j] *= val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5343 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * prodx[lab, j] *= val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5344 + * if val == val: + * nobs[lab, j] += 1 + * prodx[lab, j] *= val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5346 + * prodx[lab, j] *= val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5347 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5348 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5349 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5351 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5352 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5355 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * prodx[lab, 0] *= val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5356 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * prodx[lab, 0] *= val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5357 + * if val == val: + * nobs[lab, 0] += 1 + * prodx[lab, 0] *= val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5359 + * prodx[lab, 0] *= val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5360 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5361 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5362 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = prodx[i, j] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5364 + * out[i, j] = nan + * else: + * out[i, j] = prodx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_prodx.diminfo[1].strides)); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5311 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_prod_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_prodx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5367 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_413group_prod_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_412group_prod_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_413group_prod_float32 = {__Pyx_NAMESTR("group_prod_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_413group_prod_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_412group_prod_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_413group_prod_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_prod_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_prod_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_412group_prod_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_412group_prod_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_prodx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx; + __Pyx_Buffer __pyx_pybuffer_prodx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_prod_float32", 0); + __pyx_pybuffer_prodx.pybuffer.buf = NULL; + __pyx_pybuffer_prodx.refcount = 0; + __pyx_pybuffernd_prodx.data = NULL; + __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5379 + * ndarray[float32_t, ndim=2] prodx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5380 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5382 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * prodx = np.ones_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5383 + * + * nobs = np.zeros_like(out) + * prodx = np.ones_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_prodx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5385 + * prodx = np.ones_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5387 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5388 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5389 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5390 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5391 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5393 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5394 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5395 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5398 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * prodx[lab, j] *= val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5399 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * prodx[lab, j] *= val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5400 + * if val == val: + * nobs[lab, j] += 1 + * prodx[lab, j] *= val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5402 + * prodx[lab, j] *= val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5403 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5404 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5405 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5407 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5408 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5411 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * prodx[lab, 0] *= val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5412 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * prodx[lab, 0] *= val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5413 + * if val == val: + * nobs[lab, 0] += 1 + * prodx[lab, 0] *= val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5415 + * prodx[lab, 0] *= val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5416 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5417 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5418 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = prodx[i, j] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5420 + * out[i, j] = nan + * else: + * out[i, j] = prodx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_prodx.diminfo[1].strides)); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5367 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_prod_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_prodx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_415group_prod_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_414group_prod_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_415group_prod_bin_float64 = {__Pyx_NAMESTR("group_prod_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_415group_prod_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_414group_prod_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_415group_prod_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_prod_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_prod_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_414group_prod_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_414group_prod_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_prodx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx; + __Pyx_Buffer __pyx_pybuffer_prodx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_prod_bin_float64", 0); + __pyx_pybuffer_prodx.pybuffer.buf = NULL; + __pyx_pybuffer_prodx.refcount = 0; + __pyx_pybuffernd_prodx.data = NULL; + __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5436 + * ndarray[float64_t, ndim=2] prodx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * prodx = np.ones_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5437 + * + * nobs = np.zeros_like(out) + * prodx = np.ones_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_prodx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5439 + * prodx = np.ones_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5440 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5442 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5443 + * else: + * ngroups = len(bins) + 1 + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5445 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5446 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5447 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5448 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5449 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5451 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5452 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5453 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5456 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * prodx[b, j] *= val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5457 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * prodx[b, j] *= val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5458 + * if val == val: + * nobs[b, j] += 1 + * prodx[b, j] *= val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5460 + * prodx[b, j] *= val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5461 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5462 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5464 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5465 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5468 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * prodx[b, 0] *= val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5469 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * prodx[b, 0] *= val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5470 + * if val == val: + * nobs[b, 0] += 1 + * prodx[b, 0] *= val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5472 + * prodx[b, 0] *= val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5473 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5474 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5475 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = prodx[i, j] + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5477 + * out[i, j] = nan + * else: + * out[i, j] = prodx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_prodx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_prod_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_prodx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5480 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_417group_prod_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_416group_prod_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_417group_prod_bin_float32 = {__Pyx_NAMESTR("group_prod_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_417group_prod_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_416group_prod_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_417group_prod_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_prod_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_prod_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_416group_prod_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_416group_prod_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_prodx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx; + __Pyx_Buffer __pyx_pybuffer_prodx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_prod_bin_float32", 0); + __pyx_pybuffer_prodx.pybuffer.buf = NULL; + __pyx_pybuffer_prodx.refcount = 0; + __pyx_pybuffernd_prodx.data = NULL; + __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5492 + * ndarray[float32_t, ndim=2] prodx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * prodx = np.ones_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5493 + * + * nobs = np.zeros_like(out) + * prodx = np.ones_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_prodx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5495 + * prodx = np.ones_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5496 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5498 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5499 + * else: + * ngroups = len(bins) + 1 + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5501 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5502 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5503 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5504 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5505 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5507 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5508 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5509 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5512 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * prodx[b, j] *= val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5513 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * prodx[b, j] *= val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5514 + * if val == val: + * nobs[b, j] += 1 + * prodx[b, j] *= val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5516 + * prodx[b, j] *= val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5517 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5518 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5520 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5521 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5524 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * prodx[b, 0] *= val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5525 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * prodx[b, 0] *= val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5526 + * if val == val: + * nobs[b, 0] += 1 + * prodx[b, 0] *= val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5528 + * prodx[b, 0] *= val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5529 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5530 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5531 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = prodx[i, j] + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5533 + * out[i, j] = nan + * else: + * out[i, j] = prodx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_prodx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5480 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_prod_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_prodx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5537 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_419group_var_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_419group_var_float64 = {__Pyx_NAMESTR("group_var_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_419group_var_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_419group_var_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_var_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_var_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_418group_var_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_418group_var_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_ct; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_sumxx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx; + __Pyx_Buffer __pyx_pybuffer_sumxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + __pyx_t_5numpy_float64_t __pyx_t_46; + __pyx_t_5numpy_float64_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_var_float64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_sumxx.pybuffer.buf = NULL; + __pyx_pybuffer_sumxx.refcount = 0; + __pyx_pybuffernd_sumxx.data = NULL; + __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5546 + * ndarray[float64_t, ndim=2] nobs, sumx, sumxx + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5547 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__200, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5549 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5550 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumxx = np.zeros_like(out) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5551 + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":5553 + * sumxx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5555 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5556 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5558 + * for i in range(N): + * + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5559 + * + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5560 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5562 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5564 + * counts[lab] += 1 + * + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5565 + * + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5568 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5569 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * sumxx[lab, j] += val * val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5570 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * sumxx[lab, j] += val * val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5571 + * nobs[lab, j] += 1 + * sumx[lab, j] += val + * sumxx[lab, j] += val * val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5573 + * sumxx[lab, j] += val * val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5575 + * for i in range(N): + * + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5576 + * + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5577 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5579 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * # not nan + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5580 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5582 + * val = values[i, 0] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5583 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * sumxx[lab, 0] += val * val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5584 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * sumxx[lab, 0] += val * val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5585 + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + * sumxx[lab, 0] += val * val # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5588 + * + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * ct = nobs[i, j] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5589 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * ct = nobs[i, j] + * if ct < 2: + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":5590 + * for i in range(len(counts)): + * for j in range(K): + * ct = nobs[i, j] # <<<<<<<<<<<<<< + * if ct < 2: + * out[i, j] = nan + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5591 + * for j in range(K): + * ct = nobs[i, j] + * if ct < 2: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_3 = ((__pyx_v_ct < 2.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5592 + * ct = nobs[i, j] + * if ct < 2: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5594 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * @cython.wraparound(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + __pyx_t_46 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[1].strides)))); + + /* "pandas/src/generated.pyx":5595 + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + * (ct * ct - ct)) # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_47 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct); + + /* "pandas/src/generated.pyx":5594 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * @cython.wraparound(False) + */ + if (unlikely(__pyx_t_47 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_46 / __pyx_t_47); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5537 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_var_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_sumxx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_421group_var_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_421group_var_float32 = {__Pyx_NAMESTR("group_var_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_421group_var_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_421group_var_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_var_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_var_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_420group_var_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_420group_var_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_ct; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_sumxx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx; + __Pyx_Buffer __pyx_pybuffer_sumxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + __pyx_t_5numpy_float32_t __pyx_t_46; + __pyx_t_5numpy_float32_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_var_float32", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_sumxx.pybuffer.buf = NULL; + __pyx_pybuffer_sumxx.refcount = 0; + __pyx_pybuffernd_sumxx.data = NULL; + __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5607 + * ndarray[float32_t, ndim=2] nobs, sumx, sumxx + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5608 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5610 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5611 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumxx = np.zeros_like(out) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5612 + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":5614 + * sumxx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5616 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5617 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5619 + * for i in range(N): + * + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5620 + * + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5621 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5623 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5625 + * counts[lab] += 1 + * + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5626 + * + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5629 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5630 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * sumxx[lab, j] += val * val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5631 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * sumxx[lab, j] += val * val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5632 + * nobs[lab, j] += 1 + * sumx[lab, j] += val + * sumxx[lab, j] += val * val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5634 + * sumxx[lab, j] += val * val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5636 + * for i in range(N): + * + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5637 + * + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5638 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5640 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * # not nan + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5641 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5643 + * val = values[i, 0] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5644 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * sumxx[lab, 0] += val * val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5645 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * sumxx[lab, 0] += val * val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5646 + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + * sumxx[lab, 0] += val * val # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5649 + * + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * ct = nobs[i, j] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5650 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * ct = nobs[i, j] + * if ct < 2: + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":5651 + * for i in range(len(counts)): + * for j in range(K): + * ct = nobs[i, j] # <<<<<<<<<<<<<< + * if ct < 2: + * out[i, j] = nan + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5652 + * for j in range(K): + * ct = nobs[i, j] + * if ct < 2: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_3 = ((__pyx_v_ct < 2.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5653 + * ct = nobs[i, j] + * if ct < 2: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5655 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + __pyx_t_46 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[1].strides)))); + + /* "pandas/src/generated.pyx":5656 + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + * (ct * ct - ct)) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_47 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct); + + /* "pandas/src/generated.pyx":5655 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * + */ + if (unlikely(__pyx_t_47 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_46 / __pyx_t_47); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_var_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_sumxx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5660 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_423group_var_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_423group_var_bin_float64 = {__Pyx_NAMESTR("group_var_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_423group_var_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_423group_var_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_var_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_var_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_422group_var_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_422group_var_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_ct; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_sumxx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx; + __Pyx_Buffer __pyx_pybuffer_sumxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_float64_t __pyx_t_49; + __pyx_t_5numpy_float64_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_var_bin_float64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_sumxx.pybuffer.buf = NULL; + __pyx_pybuffer_sumxx.refcount = 0; + __pyx_pybuffernd_sumxx.data = NULL; + __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5670 + * ndarray[float64_t, ndim=2] nobs, sumx, sumxx + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5671 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumxx = np.zeros_like(out) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5672 + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":5674 + * sumxx = np.zeros_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5675 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5677 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5679 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5681 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5682 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5683 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5684 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5685 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5687 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5689 + * counts[b] += 1 + * + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5690 + * + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5693 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5694 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * sumxx[b, j] += val * val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5695 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * sumxx[b, j] += val * val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5696 + * nobs[b, j] += 1 + * sumx[b, j] += val + * sumxx[b, j] += val * val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5698 + * sumxx[b, j] += val * val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5699 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5700 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5702 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5703 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5706 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5707 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * sumxx[b, 0] += val * val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5708 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * sumxx[b, 0] += val * val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5709 + * nobs[b, 0] += 1 + * sumx[b, 0] += val + * sumxx[b, 0] += val * val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5711 + * sumxx[b, 0] += val * val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * ct = nobs[i, j] + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5712 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * ct = nobs[i, j] + * if ct < 2: + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":5713 + * for i in range(ngroups): + * for j in range(K): + * ct = nobs[i, j] # <<<<<<<<<<<<<< + * if ct < 2: + * out[i, j] = nan + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5714 + * for j in range(K): + * ct = nobs[i, j] + * if ct < 2: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_16 = ((__pyx_v_ct < 2.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5715 + * ct = nobs[i, j] + * if ct < 2: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5717 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * @cython.wraparound(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + __pyx_t_47 = __pyx_v_i; + __pyx_t_48 = __pyx_v_j; + __pyx_t_49 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_sumx.diminfo[1].strides)))); + + /* "pandas/src/generated.pyx":5718 + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + * (ct * ct - ct)) # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_50 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct); + + /* "pandas/src/generated.pyx":5717 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * @cython.wraparound(False) + */ + if (unlikely(__pyx_t_50 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_51 = __pyx_v_i; + __pyx_t_52 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_49 / __pyx_t_50); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5660 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_var_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_sumxx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_425group_var_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_425group_var_bin_float32 = {__Pyx_NAMESTR("group_var_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_425group_var_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_425group_var_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_var_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_var_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_424group_var_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_424group_var_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_ct; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_sumxx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx; + __Pyx_Buffer __pyx_pybuffer_sumxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_float32_t __pyx_t_49; + __pyx_t_5numpy_float32_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_var_bin_float32", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_sumxx.pybuffer.buf = NULL; + __pyx_pybuffer_sumxx.refcount = 0; + __pyx_pybuffernd_sumxx.data = NULL; + __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5731 + * ndarray[float32_t, ndim=2] nobs, sumx, sumxx + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5732 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumxx = np.zeros_like(out) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5733 + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":5735 + * sumxx = np.zeros_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5736 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5738 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5740 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5742 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5743 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5744 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5745 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5746 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5748 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5750 + * counts[b] += 1 + * + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5751 + * + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5754 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5755 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * sumxx[b, j] += val * val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5756 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * sumxx[b, j] += val * val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5757 + * nobs[b, j] += 1 + * sumx[b, j] += val + * sumxx[b, j] += val * val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5759 + * sumxx[b, j] += val * val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5760 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5761 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5763 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5764 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5767 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5768 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * sumxx[b, 0] += val * val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5769 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * sumxx[b, 0] += val * val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5770 + * nobs[b, 0] += 1 + * sumx[b, 0] += val + * sumxx[b, 0] += val * val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5772 + * sumxx[b, 0] += val * val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * ct = nobs[i, j] + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5773 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * ct = nobs[i, j] + * if ct < 2: + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":5774 + * for i in range(ngroups): + * for j in range(K): + * ct = nobs[i, j] # <<<<<<<<<<<<<< + * if ct < 2: + * out[i, j] = nan + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5775 + * for j in range(K): + * ct = nobs[i, j] + * if ct < 2: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_16 = ((__pyx_v_ct < 2.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5776 + * ct = nobs[i, j] + * if ct < 2: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5778 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + __pyx_t_47 = __pyx_v_i; + __pyx_t_48 = __pyx_v_j; + __pyx_t_49 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_sumx.diminfo[1].strides)))); + + /* "pandas/src/generated.pyx":5779 + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + * (ct * ct - ct)) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_50 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct); + + /* "pandas/src/generated.pyx":5778 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * + */ + if (unlikely(__pyx_t_50 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_51 = __pyx_v_i; + __pyx_t_52 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_49 / __pyx_t_50); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_var_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_sumxx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5783 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_427group_mean_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_427group_mean_float64 = {__Pyx_NAMESTR("group_mean_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_427group_mean_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_427group_mean_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_mean_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_mean_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_426group_mean_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_426group_mean_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_count; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + __pyx_t_5numpy_float64_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_mean_float64", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5792 + * ndarray[float64_t, ndim=2] sumx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5793 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5795 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5796 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5798 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5800 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5801 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5802 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5803 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5804 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5806 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5807 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * # not nan + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5808 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5810 + * val = values[i, j] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5811 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5812 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5814 + * sumx[lab, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5815 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5816 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5817 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5819 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * # not nan + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5820 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5822 + * val = values[i, 0] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5823 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5824 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5826 + * sumx[lab, 0] += val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * count = nobs[i, j] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5827 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * count = nobs[i, j] + * if nobs[i, j] == 0: + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5828 + * for i in range(len(counts)): + * for j in range(K): + * count = nobs[i, j] # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5829 + * for j in range(K): + * count = nobs[i, j] + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5830 + * count = nobs[i, j] + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] / count + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5832 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] / count # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + __pyx_t_40 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[1].strides)); + if (unlikely(__pyx_v_count == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_40 / __pyx_v_count); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5783 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_mean_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5835 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_429group_mean_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_429group_mean_float32 = {__Pyx_NAMESTR("group_mean_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_429group_mean_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_429group_mean_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_mean_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_mean_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_428group_mean_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_428group_mean_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_count; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + __pyx_t_5numpy_float32_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_mean_float32", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5844 + * ndarray[float32_t, ndim=2] sumx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5845 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5847 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5848 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5850 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5852 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5853 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5854 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5855 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5856 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5858 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5859 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * # not nan + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5860 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5862 + * val = values[i, j] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5863 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5864 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5866 + * sumx[lab, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5867 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5868 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5869 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5871 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * # not nan + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5872 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5874 + * val = values[i, 0] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5875 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5876 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5878 + * sumx[lab, 0] += val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * count = nobs[i, j] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5879 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * count = nobs[i, j] + * if nobs[i, j] == 0: + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5880 + * for i in range(len(counts)): + * for j in range(K): + * count = nobs[i, j] # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5881 + * for j in range(K): + * count = nobs[i, j] + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5882 + * count = nobs[i, j] + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] / count + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5884 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] / count # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + __pyx_t_40 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[1].strides)); + if (unlikely(__pyx_v_count == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_40 / __pyx_v_count); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5835 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_mean_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5887 + * + * + * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_431group_mean_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_431group_mean_bin_float64 = {__Pyx_NAMESTR("group_mean_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_431group_mean_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_431group_mean_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_mean_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_mean_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_430group_mean_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_430group_mean_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_count; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + __pyx_t_5numpy_float64_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_mean_bin_float64", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5896 + * ndarray[float64_t, ndim=2] sumx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5897 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5899 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_12; + + /* "pandas/src/generated.pyx":5900 + * + * N, K = ( values).shape + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = (__pyx_t_12 - 1); + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0); + if (__pyx_t_14) { + + /* "pandas/src/generated.pyx":5901 + * N, K = ( values).shape + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_13; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5903 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_13 + 1); + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":5905 + * ngroups = len(bins) + 1 + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5906 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_14 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_14) { + + /* "pandas/src/generated.pyx":5907 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5908 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_14 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_14) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5909 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5911 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5912 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5913 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5916 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5917 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5918 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5920 + * sumx[b, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5921 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_14; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5922 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5924 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5925 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5928 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5929 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + __pyx_t_5 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5930 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + __pyx_t_5 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5932 + * sumx[b, 0] += val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * count = nobs[i, j] + */ + __pyx_t_13 = __pyx_v_ngroups; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5933 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * count = nobs[i, j] + * if nobs[i, j] == 0: + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5934 + * for i in range(ngroups): + * for j in range(K): + * count = nobs[i, j] # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5935 + * for j in range(K): + * count = nobs[i, j] + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5936 + * count = nobs[i, j] + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] / count + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5938 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] / count # <<<<<<<<<<<<<< + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[1].strides)); + if (unlikely(__pyx_v_count == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_43 / __pyx_v_count); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5887 + * + * + * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_mean_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5940 + * out[i, j] = sumx[i, j] / count + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_433group_mean_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_433group_mean_bin_float32 = {__Pyx_NAMESTR("group_mean_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_433group_mean_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_433group_mean_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_mean_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_mean_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_432group_mean_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_432group_mean_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_count; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + __pyx_t_5numpy_float32_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_mean_bin_float32", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5949 + * ndarray[float32_t, ndim=2] sumx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5950 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5952 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_12; + + /* "pandas/src/generated.pyx":5953 + * + * N, K = ( values).shape + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = (__pyx_t_12 - 1); + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0); + if (__pyx_t_14) { + + /* "pandas/src/generated.pyx":5954 + * N, K = ( values).shape + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_13; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5956 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_13 + 1); + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":5958 + * ngroups = len(bins) + 1 + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5959 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_14 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_14) { + + /* "pandas/src/generated.pyx":5960 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5961 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_14 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_14) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5962 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5964 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5965 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5966 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5969 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5970 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5971 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5973 + * sumx[b, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5974 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_14; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5975 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5977 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5978 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5981 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5982 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + __pyx_t_5 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5983 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + __pyx_t_5 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5985 + * sumx[b, 0] += val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * count = nobs[i, j] + */ + __pyx_t_13 = __pyx_v_ngroups; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5986 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * count = nobs[i, j] + * if nobs[i, j] == 0: + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5987 + * for i in range(ngroups): + * for j in range(K): + * count = nobs[i, j] # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5988 + * for j in range(K): + * count = nobs[i, j] + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5989 + * count = nobs[i, j] + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] / count + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5991 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] / count # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[1].strides)); + if (unlikely(__pyx_v_count == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_43 / __pyx_v_count); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5940 + * out[i, j] = sumx[i, j] / count + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_mean_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5995 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_435group_min_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_434group_min_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_435group_min_float64 = {__Pyx_NAMESTR("group_min_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_435group_min_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_434group_min_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_435group_min_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_min_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_min_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_434group_min_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_434group_min_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_minx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minx; + __Pyx_Buffer __pyx_pybuffer_minx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_min_float64", 0); + __pyx_pybuffer_minx.pybuffer.buf = NULL; + __pyx_pybuffer_minx.refcount = 0; + __pyx_pybuffernd_minx.data = NULL; + __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6007 + * ndarray[float64_t, ndim=2] minx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6008 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6010 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * minx = np.empty_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6012 + * nobs = np.zeros_like(out) + * + * minx = np.empty_like(out) # <<<<<<<<<<<<<< + * minx.fill(np.inf) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_minx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6013 + * + * minx = np.empty_like(out) + * minx.fill(np.inf) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":6015 + * minx.fill(np.inf) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6017 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6018 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6019 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6020 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6021 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":6023 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6024 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":6025 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6028 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if val < minx[lab, j]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6029 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if val < minx[lab, j]: + * minx[lab, j] = val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6030 + * if val == val: + * nobs[lab, j] += 1 + * if val < minx[lab, j]: # <<<<<<<<<<<<<< + * minx[lab, j] = val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6031 + * nobs[lab, j] += 1 + * if val < minx[lab, j]: + * minx[lab, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6033 + * minx[lab, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6034 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6035 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6036 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/generated.pyx":6038 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6039 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6042 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6043 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * if val < minx[lab, 0]: + * minx[lab, 0] = val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6044 + * if val == val: + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: # <<<<<<<<<<<<<< + * minx[lab, 0] = val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6045 + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: + * minx[lab, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6047 + * minx[lab, 0] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6048 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":6049 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6050 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = minx[i, j] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6052 + * out[i, j] = nan + * else: + * out[i, j] = minx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_minx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5995 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_min_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_minx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6055 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_437group_min_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_436group_min_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_437group_min_float32 = {__Pyx_NAMESTR("group_min_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_437group_min_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_436group_min_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_437group_min_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_min_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_min_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_436group_min_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_436group_min_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_minx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minx; + __Pyx_Buffer __pyx_pybuffer_minx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_min_float32", 0); + __pyx_pybuffer_minx.pybuffer.buf = NULL; + __pyx_pybuffer_minx.refcount = 0; + __pyx_pybuffernd_minx.data = NULL; + __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6067 + * ndarray[float32_t, ndim=2] minx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6068 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6070 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * minx = np.empty_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6072 + * nobs = np.zeros_like(out) + * + * minx = np.empty_like(out) # <<<<<<<<<<<<<< + * minx.fill(np.inf) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_minx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6073 + * + * minx = np.empty_like(out) + * minx.fill(np.inf) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":6075 + * minx.fill(np.inf) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6077 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6078 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6079 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6080 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6081 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":6083 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6084 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":6085 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6088 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if val < minx[lab, j]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6089 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if val < minx[lab, j]: + * minx[lab, j] = val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6090 + * if val == val: + * nobs[lab, j] += 1 + * if val < minx[lab, j]: # <<<<<<<<<<<<<< + * minx[lab, j] = val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6091 + * nobs[lab, j] += 1 + * if val < minx[lab, j]: + * minx[lab, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6093 + * minx[lab, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6094 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6095 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6096 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/generated.pyx":6098 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6099 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6102 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6103 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * if val < minx[lab, 0]: + * minx[lab, 0] = val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6104 + * if val == val: + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: # <<<<<<<<<<<<<< + * minx[lab, 0] = val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6105 + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: + * minx[lab, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6107 + * minx[lab, 0] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6108 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":6109 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6110 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = minx[i, j] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6112 + * out[i, j] = nan + * else: + * out[i, j] = minx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_minx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":6055 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_min_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_minx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6116 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_439group_min_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_438group_min_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_439group_min_bin_float64 = {__Pyx_NAMESTR("group_min_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_439group_min_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_438group_min_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_439group_min_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_min_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_min_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_438group_min_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_438group_min_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_minx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minx; + __Pyx_Buffer __pyx_pybuffer_minx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_min_bin_float64", 0); + __pyx_pybuffer_minx.pybuffer.buf = NULL; + __pyx_pybuffer_minx.refcount = 0; + __pyx_pybuffernd_minx.data = NULL; + __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6128 + * ndarray[float64_t, ndim=2] minx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * minx = np.empty_like(out) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6130 + * nobs = np.zeros_like(out) + * + * minx = np.empty_like(out) # <<<<<<<<<<<<<< + * minx.fill(np.inf) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_minx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":6131 + * + * minx = np.empty_like(out) + * minx.fill(np.inf) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":6133 + * minx.fill(np.inf) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6134 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6136 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6138 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":6140 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6141 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6142 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6143 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":6144 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6146 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6147 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":6148 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6151 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if val < minx[b, j]: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6152 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if val < minx[b, j]: + * minx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6153 + * if val == val: + * nobs[b, j] += 1 + * if val < minx[b, j]: # <<<<<<<<<<<<<< + * minx[b, j] = val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6154 + * nobs[b, j] += 1 + * if val < minx[b, j]: + * minx[b, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6156 + * minx[b, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6157 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6158 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6160 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6161 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6164 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * if val < minx[b, 0]: + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6165 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * if val < minx[b, 0]: + * minx[b, 0] = val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6166 + * if val == val: + * nobs[b, 0] += 1 + * if val < minx[b, 0]: # <<<<<<<<<<<<<< + * minx[b, 0] = val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + __pyx_t_16 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6167 + * nobs[b, 0] += 1 + * if val < minx[b, 0]: + * minx[b, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6169 + * minx[b, 0] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6170 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":6171 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6172 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = minx[i, j] + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6174 + * out[i, j] = nan + * else: + * out[i, j] = minx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_minx.diminfo[1].strides)); + } + __pyx_L25:; + } + } + + /* "pandas/src/generated.pyx":6116 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_min_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_minx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6177 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_441group_min_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_440group_min_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_441group_min_bin_float32 = {__Pyx_NAMESTR("group_min_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_441group_min_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_440group_min_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_441group_min_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_min_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_min_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_440group_min_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_440group_min_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_minx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minx; + __Pyx_Buffer __pyx_pybuffer_minx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_min_bin_float32", 0); + __pyx_pybuffer_minx.pybuffer.buf = NULL; + __pyx_pybuffer_minx.refcount = 0; + __pyx_pybuffernd_minx.data = NULL; + __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6189 + * ndarray[float32_t, ndim=2] minx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * minx = np.empty_like(out) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6191 + * nobs = np.zeros_like(out) + * + * minx = np.empty_like(out) # <<<<<<<<<<<<<< + * minx.fill(np.inf) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_minx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":6192 + * + * minx = np.empty_like(out) + * minx.fill(np.inf) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":6194 + * minx.fill(np.inf) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6195 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6197 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6199 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":6201 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6202 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6203 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6204 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":6205 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6207 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6208 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":6209 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6212 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if val < minx[b, j]: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6213 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if val < minx[b, j]: + * minx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6214 + * if val == val: + * nobs[b, j] += 1 + * if val < minx[b, j]: # <<<<<<<<<<<<<< + * minx[b, j] = val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6215 + * nobs[b, j] += 1 + * if val < minx[b, j]: + * minx[b, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6217 + * minx[b, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6218 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6219 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6221 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6222 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6225 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * if val < minx[b, 0]: + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6226 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * if val < minx[b, 0]: + * minx[b, 0] = val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6227 + * if val == val: + * nobs[b, 0] += 1 + * if val < minx[b, 0]: # <<<<<<<<<<<<<< + * minx[b, 0] = val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + __pyx_t_16 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6228 + * nobs[b, 0] += 1 + * if val < minx[b, 0]: + * minx[b, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6230 + * minx[b, 0] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6231 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":6232 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6233 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = minx[i, j] + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6235 + * out[i, j] = nan + * else: + * out[i, j] = minx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_minx.diminfo[1].strides)); + } + __pyx_L25:; + } + } + + /* "pandas/src/generated.pyx":6177 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_min_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_minx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6239 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_443group_max_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_442group_max_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_443group_max_float64 = {__Pyx_NAMESTR("group_max_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_443group_max_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_442group_max_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_443group_max_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_max_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_max_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_442group_max_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_442group_max_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_maxx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx; + __Pyx_Buffer __pyx_pybuffer_maxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_max_float64", 0); + __pyx_pybuffer_maxx.pybuffer.buf = NULL; + __pyx_pybuffer_maxx.refcount = 0; + __pyx_pybuffernd_maxx.data = NULL; + __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6251 + * ndarray[float64_t, ndim=2] maxx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6252 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6254 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * maxx = np.empty_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6256 + * nobs = np.zeros_like(out) + * + * maxx = np.empty_like(out) # <<<<<<<<<<<<<< + * maxx.fill(-np.inf) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_maxx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6257 + * + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6259 + * maxx.fill(-np.inf) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6261 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6262 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6263 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6264 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6265 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":6267 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6268 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":6269 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6272 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6273 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if val > maxx[lab, j]: + * maxx[lab, j] = val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6274 + * if val == val: + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: # <<<<<<<<<<<<<< + * maxx[lab, j] = val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6275 + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: + * maxx[lab, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6277 + * maxx[lab, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6278 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6279 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6280 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/generated.pyx":6282 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6283 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6286 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6287 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * if val > maxx[lab, 0]: + * maxx[lab, 0] = val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6288 + * if val == val: + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: # <<<<<<<<<<<<<< + * maxx[lab, 0] = val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6289 + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: + * maxx[lab, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6291 + * maxx[lab, 0] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6292 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":6293 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6294 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = maxx[i, j] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6296 + * out[i, j] = nan + * else: + * out[i, j] = maxx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_maxx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":6239 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_max_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_maxx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6299 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_445group_max_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_444group_max_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_445group_max_float32 = {__Pyx_NAMESTR("group_max_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_445group_max_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_444group_max_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_445group_max_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_max_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_max_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_444group_max_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_444group_max_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_maxx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx; + __Pyx_Buffer __pyx_pybuffer_maxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_max_float32", 0); + __pyx_pybuffer_maxx.pybuffer.buf = NULL; + __pyx_pybuffer_maxx.refcount = 0; + __pyx_pybuffernd_maxx.data = NULL; + __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6311 + * ndarray[float32_t, ndim=2] maxx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6312 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6314 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * maxx = np.empty_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6316 + * nobs = np.zeros_like(out) + * + * maxx = np.empty_like(out) # <<<<<<<<<<<<<< + * maxx.fill(-np.inf) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_maxx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6317 + * + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6319 + * maxx.fill(-np.inf) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6321 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6322 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6323 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6324 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6325 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":6327 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6328 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":6329 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6332 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6333 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if val > maxx[lab, j]: + * maxx[lab, j] = val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6334 + * if val == val: + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: # <<<<<<<<<<<<<< + * maxx[lab, j] = val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6335 + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: + * maxx[lab, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6337 + * maxx[lab, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6338 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6339 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6340 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/generated.pyx":6342 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6343 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6346 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6347 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * if val > maxx[lab, 0]: + * maxx[lab, 0] = val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6348 + * if val == val: + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: # <<<<<<<<<<<<<< + * maxx[lab, 0] = val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6349 + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: + * maxx[lab, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6351 + * maxx[lab, 0] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6352 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":6353 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6354 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = maxx[i, j] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6356 + * out[i, j] = nan + * else: + * out[i, j] = maxx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_maxx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":6299 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_max_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_maxx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6360 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_447group_max_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_446group_max_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_447group_max_bin_float64 = {__Pyx_NAMESTR("group_max_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_447group_max_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_446group_max_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_447group_max_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_max_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_max_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_446group_max_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_446group_max_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_maxx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx; + __Pyx_Buffer __pyx_pybuffer_maxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_max_bin_float64", 0); + __pyx_pybuffer_maxx.pybuffer.buf = NULL; + __pyx_pybuffer_maxx.refcount = 0; + __pyx_pybuffernd_maxx.data = NULL; + __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6372 + * ndarray[float64_t, ndim=2] maxx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6373 + * + * nobs = np.zeros_like(out) + * maxx = np.empty_like(out) # <<<<<<<<<<<<<< + * maxx.fill(-np.inf) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_maxx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":6374 + * nobs = np.zeros_like(out) + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6376 + * maxx.fill(-np.inf) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6377 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6379 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6381 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":6383 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6384 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6385 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6386 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":6387 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6389 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6390 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":6391 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6394 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if val > maxx[b, j]: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6395 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if val > maxx[b, j]: + * maxx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6396 + * if val == val: + * nobs[b, j] += 1 + * if val > maxx[b, j]: # <<<<<<<<<<<<<< + * maxx[b, j] = val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6397 + * nobs[b, j] += 1 + * if val > maxx[b, j]: + * maxx[b, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6399 + * maxx[b, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6400 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6401 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6403 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6404 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6407 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6408 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * if val > maxx[b, 0]: + * maxx[b, 0] = val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6409 + * if val == val: + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: # <<<<<<<<<<<<<< + * maxx[b, 0] = val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + __pyx_t_16 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6410 + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: + * maxx[b, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6412 + * maxx[b, 0] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6413 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":6414 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6415 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = maxx[i, j] + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6417 + * out[i, j] = nan + * else: + * out[i, j] = maxx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_maxx.diminfo[1].strides)); + } + __pyx_L25:; + } + } + + /* "pandas/src/generated.pyx":6360 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_max_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_maxx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6420 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_449group_max_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_448group_max_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_449group_max_bin_float32 = {__Pyx_NAMESTR("group_max_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_449group_max_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_448group_max_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_449group_max_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_max_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_max_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_448group_max_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_448group_max_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_maxx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx; + __Pyx_Buffer __pyx_pybuffer_maxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_max_bin_float32", 0); + __pyx_pybuffer_maxx.pybuffer.buf = NULL; + __pyx_pybuffer_maxx.refcount = 0; + __pyx_pybuffernd_maxx.data = NULL; + __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6432 + * ndarray[float32_t, ndim=2] maxx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6433 + * + * nobs = np.zeros_like(out) + * maxx = np.empty_like(out) # <<<<<<<<<<<<<< + * maxx.fill(-np.inf) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_maxx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":6434 + * nobs = np.zeros_like(out) + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6436 + * maxx.fill(-np.inf) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6437 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6439 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6441 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":6443 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6444 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6445 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6446 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":6447 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6449 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6450 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":6451 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6454 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if val > maxx[b, j]: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6455 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if val > maxx[b, j]: + * maxx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6456 + * if val == val: + * nobs[b, j] += 1 + * if val > maxx[b, j]: # <<<<<<<<<<<<<< + * maxx[b, j] = val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6457 + * nobs[b, j] += 1 + * if val > maxx[b, j]: + * maxx[b, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6459 + * maxx[b, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6460 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6461 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6463 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6464 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6467 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6468 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * if val > maxx[b, 0]: + * maxx[b, 0] = val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6469 + * if val == val: + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: # <<<<<<<<<<<<<< + * maxx[b, 0] = val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + __pyx_t_16 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6470 + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: + * maxx[b, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6472 + * maxx[b, 0] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6473 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":6474 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6475 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = maxx[i, j] + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6477 + * out[i, j] = nan + * else: + * out[i, j] = maxx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_maxx.diminfo[1].strides)); + } + __pyx_L25:; + } + } + + /* "pandas/src/generated.pyx":6420 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_max_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_maxx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6481 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_451group_ohlc_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_450group_ohlc_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_451group_ohlc_float64 = {__Pyx_NAMESTR("group_ohlc_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_451group_ohlc_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_450group_ohlc_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_451group_ohlc_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_ohlc_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_ohlc_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_ohlc_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_450group_ohlc_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_450group_ohlc_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_vopen; + __pyx_t_5numpy_float64_t __pyx_v_vhigh; + __pyx_t_5numpy_float64_t __pyx_v_vlow; + __pyx_t_5numpy_float64_t __pyx_v_vclose; + __pyx_t_5numpy_float64_t __pyx_v_NA; + int __pyx_v_got_first; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + __pyx_t_5numpy_float64_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + long __pyx_t_15; + Py_ssize_t __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + long __pyx_t_19; + Py_ssize_t __pyx_t_20; + long __pyx_t_21; + Py_ssize_t __pyx_t_22; + long __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + long __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + long __pyx_t_38; + Py_ssize_t __pyx_t_39; + long __pyx_t_40; + Py_ssize_t __pyx_t_41; + long __pyx_t_42; + Py_ssize_t __pyx_t_43; + long __pyx_t_44; + Py_ssize_t __pyx_t_45; + long __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_ohlc_float64", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6492 + * float64_t val, count + * float64_t vopen, vhigh, vlow, vclose, NA + * bint got_first = 0 # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_v_got_first = 0; + + /* "pandas/src/generated.pyx":6494 + * bint got_first = 0 + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 - 1); + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6495 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_3; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6497 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_3 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6499 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if out.shape[1] != 4: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_N = __pyx_t_3; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6501 + * N, K = ( values).shape + * + * if out.shape[1] != 4: # <<<<<<<<<<<<<< + * raise ValueError('Output array must have 4 columns') + * + */ + __pyx_t_4 = (((__pyx_v_out->dimensions[1]) != 4) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6502 + * + * if out.shape[1] != 4: + * raise ValueError('Output array must have 4 columns') # <<<<<<<<<<<<<< + * + * NA = np.nan + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6504 + * raise ValueError('Output array must have 4 columns') + * + * NA = np.nan # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_NA = __pyx_t_10; + + /* "pandas/src/generated.pyx":6506 + * NA = np.nan + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * raise NotImplementedError + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6507 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * raise NotImplementedError + * else: + */ + __pyx_t_4 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6508 + * b = 0 + * if K > 1: + * raise NotImplementedError # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/src/generated.pyx":6510 + * raise NotImplementedError + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":6511 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * if not got_first: + * out[b, 0] = NA + */ + while (1) { + __pyx_t_4 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_4; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6512 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: # <<<<<<<<<<<<<< + * out[b, 0] = NA + * out[b, 1] = NA + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6513 + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: + * out[b, 0] = NA # <<<<<<<<<<<<<< + * out[b, 1] = NA + * out[b, 2] = NA + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_15 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6514 + * if not got_first: + * out[b, 0] = NA + * out[b, 1] = NA # <<<<<<<<<<<<<< + * out[b, 2] = NA + * out[b, 3] = NA + */ + __pyx_t_16 = __pyx_v_b; + __pyx_t_17 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6515 + * out[b, 0] = NA + * out[b, 1] = NA + * out[b, 2] = NA # <<<<<<<<<<<<<< + * out[b, 3] = NA + * else: + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_19 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6516 + * out[b, 1] = NA + * out[b, 2] = NA + * out[b, 3] = NA # <<<<<<<<<<<<<< + * else: + * out[b, 0] = vopen + */ + __pyx_t_20 = __pyx_v_b; + __pyx_t_21 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6518 + * out[b, 3] = NA + * else: + * out[b, 0] = vopen # <<<<<<<<<<<<<< + * out[b, 1] = vhigh + * out[b, 2] = vlow + */ + __pyx_t_22 = __pyx_v_b; + __pyx_t_23 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen; + + /* "pandas/src/generated.pyx":6519 + * else: + * out[b, 0] = vopen + * out[b, 1] = vhigh # <<<<<<<<<<<<<< + * out[b, 2] = vlow + * out[b, 3] = vclose + */ + __pyx_t_24 = __pyx_v_b; + __pyx_t_25 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh; + + /* "pandas/src/generated.pyx":6520 + * out[b, 0] = vopen + * out[b, 1] = vhigh + * out[b, 2] = vlow # <<<<<<<<<<<<<< + * out[b, 3] = vclose + * b += 1 + */ + __pyx_t_26 = __pyx_v_b; + __pyx_t_27 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow; + + /* "pandas/src/generated.pyx":6521 + * out[b, 1] = vhigh + * out[b, 2] = vlow + * out[b, 3] = vclose # <<<<<<<<<<<<<< + * b += 1 + * got_first = 0 + */ + __pyx_t_28 = __pyx_v_b; + __pyx_t_29 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":6522 + * out[b, 2] = vlow + * out[b, 3] = vclose + * b += 1 # <<<<<<<<<<<<<< + * got_first = 0 + * + */ + __pyx_v_b = (__pyx_v_b + 1); + + /* "pandas/src/generated.pyx":6523 + * out[b, 3] = vclose + * b += 1 + * got_first = 0 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_got_first = 0; + } + + /* "pandas/src/generated.pyx":6525 + * got_first = 0 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_30 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6526 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6529 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * if not got_first: + * got_first = 1 + */ + __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6530 + * # not nan + * if val == val: + * if not got_first: # <<<<<<<<<<<<<< + * got_first = 1 + * vopen = val + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6531 + * if val == val: + * if not got_first: + * got_first = 1 # <<<<<<<<<<<<<< + * vopen = val + * vlow = val + */ + __pyx_v_got_first = 1; + + /* "pandas/src/generated.pyx":6532 + * if not got_first: + * got_first = 1 + * vopen = val # <<<<<<<<<<<<<< + * vlow = val + * vhigh = val + */ + __pyx_v_vopen = __pyx_v_val; + + /* "pandas/src/generated.pyx":6533 + * got_first = 1 + * vopen = val + * vlow = val # <<<<<<<<<<<<<< + * vhigh = val + * else: + */ + __pyx_v_vlow = __pyx_v_val; + + /* "pandas/src/generated.pyx":6534 + * vopen = val + * vlow = val + * vhigh = val # <<<<<<<<<<<<<< + * else: + * if val < vlow: + */ + __pyx_v_vhigh = __pyx_v_val; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6536 + * vhigh = val + * else: + * if val < vlow: # <<<<<<<<<<<<<< + * vlow = val + * if val > vhigh: + */ + __pyx_t_13 = ((__pyx_v_val < __pyx_v_vlow) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6537 + * else: + * if val < vlow: + * vlow = val # <<<<<<<<<<<<<< + * if val > vhigh: + * vhigh = val + */ + __pyx_v_vlow = __pyx_v_val; + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/src/generated.pyx":6538 + * if val < vlow: + * vlow = val + * if val > vhigh: # <<<<<<<<<<<<<< + * vhigh = val + * vclose = val + */ + __pyx_t_13 = ((__pyx_v_val > __pyx_v_vhigh) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6539 + * vlow = val + * if val > vhigh: + * vhigh = val # <<<<<<<<<<<<<< + * vclose = val + * + */ + __pyx_v_vhigh = __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":6540 + * if val > vhigh: + * vhigh = val + * vclose = val # <<<<<<<<<<<<<< + * + * if not got_first: + */ + __pyx_v_vclose = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/src/generated.pyx":6542 + * vclose = val + * + * if not got_first: # <<<<<<<<<<<<<< + * out[b, 0] = NA + * out[b, 1] = NA + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6543 + * + * if not got_first: + * out[b, 0] = NA # <<<<<<<<<<<<<< + * out[b, 1] = NA + * out[b, 2] = NA + */ + __pyx_t_1 = __pyx_v_b; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6544 + * if not got_first: + * out[b, 0] = NA + * out[b, 1] = NA # <<<<<<<<<<<<<< + * out[b, 2] = NA + * out[b, 3] = NA + */ + __pyx_t_3 = __pyx_v_b; + __pyx_t_34 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6545 + * out[b, 0] = NA + * out[b, 1] = NA + * out[b, 2] = NA # <<<<<<<<<<<<<< + * out[b, 3] = NA + * else: + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6546 + * out[b, 1] = NA + * out[b, 2] = NA + * out[b, 3] = NA # <<<<<<<<<<<<<< + * else: + * out[b, 0] = vopen + */ + __pyx_t_37 = __pyx_v_b; + __pyx_t_38 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6548 + * out[b, 3] = NA + * else: + * out[b, 0] = vopen # <<<<<<<<<<<<<< + * out[b, 1] = vhigh + * out[b, 2] = vlow + */ + __pyx_t_39 = __pyx_v_b; + __pyx_t_40 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen; + + /* "pandas/src/generated.pyx":6549 + * else: + * out[b, 0] = vopen + * out[b, 1] = vhigh # <<<<<<<<<<<<<< + * out[b, 2] = vlow + * out[b, 3] = vclose + */ + __pyx_t_41 = __pyx_v_b; + __pyx_t_42 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh; + + /* "pandas/src/generated.pyx":6550 + * out[b, 0] = vopen + * out[b, 1] = vhigh + * out[b, 2] = vlow # <<<<<<<<<<<<<< + * out[b, 3] = vclose + * @cython.wraparound(False) + */ + __pyx_t_43 = __pyx_v_b; + __pyx_t_44 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow; + + /* "pandas/src/generated.pyx":6551 + * out[b, 1] = vhigh + * out[b, 2] = vlow + * out[b, 3] = vclose # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_45 = __pyx_v_b; + __pyx_t_46 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose; + } + __pyx_L17:; + } + + /* "pandas/src/generated.pyx":6481 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_ohlc_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6554 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_453group_ohlc_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_452group_ohlc_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_453group_ohlc_float32 = {__Pyx_NAMESTR("group_ohlc_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_453group_ohlc_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_452group_ohlc_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_453group_ohlc_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_ohlc_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_ohlc_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_ohlc_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_452group_ohlc_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_452group_ohlc_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_vopen; + __pyx_t_5numpy_float32_t __pyx_v_vhigh; + __pyx_t_5numpy_float32_t __pyx_v_vlow; + __pyx_t_5numpy_float32_t __pyx_v_vclose; + __pyx_t_5numpy_float32_t __pyx_v_NA; + int __pyx_v_got_first; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + __pyx_t_5numpy_float32_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + long __pyx_t_15; + Py_ssize_t __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + long __pyx_t_19; + Py_ssize_t __pyx_t_20; + long __pyx_t_21; + Py_ssize_t __pyx_t_22; + long __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + long __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + long __pyx_t_38; + Py_ssize_t __pyx_t_39; + long __pyx_t_40; + Py_ssize_t __pyx_t_41; + long __pyx_t_42; + Py_ssize_t __pyx_t_43; + long __pyx_t_44; + Py_ssize_t __pyx_t_45; + long __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_ohlc_float32", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6565 + * float32_t val, count + * float32_t vopen, vhigh, vlow, vclose, NA + * bint got_first = 0 # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_v_got_first = 0; + + /* "pandas/src/generated.pyx":6567 + * bint got_first = 0 + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 - 1); + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6568 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_3; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6570 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_3 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6572 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if out.shape[1] != 4: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_N = __pyx_t_3; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6574 + * N, K = ( values).shape + * + * if out.shape[1] != 4: # <<<<<<<<<<<<<< + * raise ValueError('Output array must have 4 columns') + * + */ + __pyx_t_4 = (((__pyx_v_out->dimensions[1]) != 4) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6575 + * + * if out.shape[1] != 4: + * raise ValueError('Output array must have 4 columns') # <<<<<<<<<<<<<< + * + * NA = np.nan + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6577 + * raise ValueError('Output array must have 4 columns') + * + * NA = np.nan # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_10 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_NA = __pyx_t_10; + + /* "pandas/src/generated.pyx":6579 + * NA = np.nan + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * raise NotImplementedError + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6580 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * raise NotImplementedError + * else: + */ + __pyx_t_4 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6581 + * b = 0 + * if K > 1: + * raise NotImplementedError # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/src/generated.pyx":6583 + * raise NotImplementedError + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":6584 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * if not got_first: + * out[b, 0] = NA + */ + while (1) { + __pyx_t_4 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_4; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6585 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: # <<<<<<<<<<<<<< + * out[b, 0] = NA + * out[b, 1] = NA + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6586 + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: + * out[b, 0] = NA # <<<<<<<<<<<<<< + * out[b, 1] = NA + * out[b, 2] = NA + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_15 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6587 + * if not got_first: + * out[b, 0] = NA + * out[b, 1] = NA # <<<<<<<<<<<<<< + * out[b, 2] = NA + * out[b, 3] = NA + */ + __pyx_t_16 = __pyx_v_b; + __pyx_t_17 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6588 + * out[b, 0] = NA + * out[b, 1] = NA + * out[b, 2] = NA # <<<<<<<<<<<<<< + * out[b, 3] = NA + * else: + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_19 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6589 + * out[b, 1] = NA + * out[b, 2] = NA + * out[b, 3] = NA # <<<<<<<<<<<<<< + * else: + * out[b, 0] = vopen + */ + __pyx_t_20 = __pyx_v_b; + __pyx_t_21 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6591 + * out[b, 3] = NA + * else: + * out[b, 0] = vopen # <<<<<<<<<<<<<< + * out[b, 1] = vhigh + * out[b, 2] = vlow + */ + __pyx_t_22 = __pyx_v_b; + __pyx_t_23 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen; + + /* "pandas/src/generated.pyx":6592 + * else: + * out[b, 0] = vopen + * out[b, 1] = vhigh # <<<<<<<<<<<<<< + * out[b, 2] = vlow + * out[b, 3] = vclose + */ + __pyx_t_24 = __pyx_v_b; + __pyx_t_25 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh; + + /* "pandas/src/generated.pyx":6593 + * out[b, 0] = vopen + * out[b, 1] = vhigh + * out[b, 2] = vlow # <<<<<<<<<<<<<< + * out[b, 3] = vclose + * b += 1 + */ + __pyx_t_26 = __pyx_v_b; + __pyx_t_27 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow; + + /* "pandas/src/generated.pyx":6594 + * out[b, 1] = vhigh + * out[b, 2] = vlow + * out[b, 3] = vclose # <<<<<<<<<<<<<< + * b += 1 + * got_first = 0 + */ + __pyx_t_28 = __pyx_v_b; + __pyx_t_29 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":6595 + * out[b, 2] = vlow + * out[b, 3] = vclose + * b += 1 # <<<<<<<<<<<<<< + * got_first = 0 + * + */ + __pyx_v_b = (__pyx_v_b + 1); + + /* "pandas/src/generated.pyx":6596 + * out[b, 3] = vclose + * b += 1 + * got_first = 0 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_got_first = 0; + } + + /* "pandas/src/generated.pyx":6598 + * got_first = 0 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_30 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6599 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6602 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * if not got_first: + * got_first = 1 + */ + __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6603 + * # not nan + * if val == val: + * if not got_first: # <<<<<<<<<<<<<< + * got_first = 1 + * vopen = val + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6604 + * if val == val: + * if not got_first: + * got_first = 1 # <<<<<<<<<<<<<< + * vopen = val + * vlow = val + */ + __pyx_v_got_first = 1; + + /* "pandas/src/generated.pyx":6605 + * if not got_first: + * got_first = 1 + * vopen = val # <<<<<<<<<<<<<< + * vlow = val + * vhigh = val + */ + __pyx_v_vopen = __pyx_v_val; + + /* "pandas/src/generated.pyx":6606 + * got_first = 1 + * vopen = val + * vlow = val # <<<<<<<<<<<<<< + * vhigh = val + * else: + */ + __pyx_v_vlow = __pyx_v_val; + + /* "pandas/src/generated.pyx":6607 + * vopen = val + * vlow = val + * vhigh = val # <<<<<<<<<<<<<< + * else: + * if val < vlow: + */ + __pyx_v_vhigh = __pyx_v_val; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6609 + * vhigh = val + * else: + * if val < vlow: # <<<<<<<<<<<<<< + * vlow = val + * if val > vhigh: + */ + __pyx_t_13 = ((__pyx_v_val < __pyx_v_vlow) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6610 + * else: + * if val < vlow: + * vlow = val # <<<<<<<<<<<<<< + * if val > vhigh: + * vhigh = val + */ + __pyx_v_vlow = __pyx_v_val; + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/src/generated.pyx":6611 + * if val < vlow: + * vlow = val + * if val > vhigh: # <<<<<<<<<<<<<< + * vhigh = val + * vclose = val + */ + __pyx_t_13 = ((__pyx_v_val > __pyx_v_vhigh) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6612 + * vlow = val + * if val > vhigh: + * vhigh = val # <<<<<<<<<<<<<< + * vclose = val + * + */ + __pyx_v_vhigh = __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":6613 + * if val > vhigh: + * vhigh = val + * vclose = val # <<<<<<<<<<<<<< + * + * if not got_first: + */ + __pyx_v_vclose = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/src/generated.pyx":6615 + * vclose = val + * + * if not got_first: # <<<<<<<<<<<<<< + * out[b, 0] = NA + * out[b, 1] = NA + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6616 + * + * if not got_first: + * out[b, 0] = NA # <<<<<<<<<<<<<< + * out[b, 1] = NA + * out[b, 2] = NA + */ + __pyx_t_1 = __pyx_v_b; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6617 + * if not got_first: + * out[b, 0] = NA + * out[b, 1] = NA # <<<<<<<<<<<<<< + * out[b, 2] = NA + * out[b, 3] = NA + */ + __pyx_t_3 = __pyx_v_b; + __pyx_t_34 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6618 + * out[b, 0] = NA + * out[b, 1] = NA + * out[b, 2] = NA # <<<<<<<<<<<<<< + * out[b, 3] = NA + * else: + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6619 + * out[b, 1] = NA + * out[b, 2] = NA + * out[b, 3] = NA # <<<<<<<<<<<<<< + * else: + * out[b, 0] = vopen + */ + __pyx_t_37 = __pyx_v_b; + __pyx_t_38 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6621 + * out[b, 3] = NA + * else: + * out[b, 0] = vopen # <<<<<<<<<<<<<< + * out[b, 1] = vhigh + * out[b, 2] = vlow + */ + __pyx_t_39 = __pyx_v_b; + __pyx_t_40 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen; + + /* "pandas/src/generated.pyx":6622 + * else: + * out[b, 0] = vopen + * out[b, 1] = vhigh # <<<<<<<<<<<<<< + * out[b, 2] = vlow + * out[b, 3] = vclose + */ + __pyx_t_41 = __pyx_v_b; + __pyx_t_42 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh; + + /* "pandas/src/generated.pyx":6623 + * out[b, 0] = vopen + * out[b, 1] = vhigh + * out[b, 2] = vlow # <<<<<<<<<<<<<< + * out[b, 3] = vclose + * + */ + __pyx_t_43 = __pyx_v_b; + __pyx_t_44 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow; + + /* "pandas/src/generated.pyx":6624 + * out[b, 1] = vhigh + * out[b, 2] = vlow + * out[b, 3] = vclose # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_45 = __pyx_v_b; + __pyx_t_46 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose; + } + __pyx_L17:; + } + + /* "pandas/src/generated.pyx":6554 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_ohlc_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6628 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_455group_count_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_454group_count_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_455group_count_float64 = {__Pyx_NAMESTR("group_count_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_455group_count_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_454group_count_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_455group_count_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_454group_count_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_454group_count_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_float64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6637 + * cdef: + * Py_ssize_t i, j, lab + * Py_ssize_t N = values.shape[0], K = values.shape[1] # <<<<<<<<<<<<<< + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + + /* "pandas/src/generated.pyx":6639 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6640 + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * if len(values) != len(labels): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6639 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6642 + * dtype=np.int64) + * + * if len(values) != len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6643 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6645 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6646 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6647 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6648 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":6650 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_11 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6651 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6652 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6655 + * + * # not nan + * nobs[lab, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_9 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_9) { + __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_9; + } + __pyx_t_18 = __pyx_v_lab; + __pyx_t_19 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17; + } + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":6657 + * nobs[lab, j] += val == val and val != iNaT + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6658 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6659 + * for i in range(len(counts)): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6628 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_457group_count_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_456group_count_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_457group_count_float32 = {__Pyx_NAMESTR("group_count_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_457group_count_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_456group_count_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_457group_count_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_456group_count_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_456group_count_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_float32", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6673 + * cdef: + * Py_ssize_t i, j, lab + * Py_ssize_t N = values.shape[0], K = values.shape[1] # <<<<<<<<<<<<<< + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + + /* "pandas/src/generated.pyx":6675 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6676 + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * if len(values) != len(labels): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6675 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6678 + * dtype=np.int64) + * + * if len(values) != len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6679 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6681 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6682 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6683 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6684 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":6686 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_11 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6687 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6688 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6691 + * + * # not nan + * nobs[lab, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_9 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_9) { + __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_9; + } + __pyx_t_18 = __pyx_v_lab; + __pyx_t_19 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17; + } + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":6693 + * nobs[lab, j] += val == val and val != iNaT + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6694 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6695 + * for i in range(len(counts)): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6700 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_459group_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_458group_count_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_459group_count_object = {__Pyx_NAMESTR("group_count_object"), (PyCFunction)__pyx_pw_6pandas_5algos_459group_count_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_458group_count_object)}; +static PyObject *__pyx_pw_6pandas_5algos_459group_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_458group_count_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_458group_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + PyObject **__pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_object", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6709 + * cdef: + * Py_ssize_t i, j, lab + * Py_ssize_t N = values.shape[0], K = values.shape[1] # <<<<<<<<<<<<<< + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + + /* "pandas/src/generated.pyx":6711 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6712 + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * if len(values) != len(labels): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6711 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6714 + * dtype=np.int64) + * + * if len(values) != len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6715 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6717 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6718 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6719 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6720 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":6722 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_11 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6723 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6724 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6727 + * + * # not nan + * nobs[lab, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_16 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_16 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_17 = __pyx_v_lab; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_16; + } + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":6729 + * nobs[lab, j] += val == val and val != iNaT + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6730 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6731 + * for i in range(len(counts)): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_23 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_23); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_23); + *__pyx_t_23 = __pyx_t_4; + __Pyx_GIVEREF(*__pyx_t_23); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + + /* "pandas/src/generated.pyx":6700 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6736 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_461group_count_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_460group_count_int64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_461group_count_int64 = {__Pyx_NAMESTR("group_count_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_461group_count_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_460group_count_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_461group_count_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_460group_count_int64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_460group_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int64_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_int64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6745 + * cdef: + * Py_ssize_t i, j, lab + * Py_ssize_t N = values.shape[0], K = values.shape[1] # <<<<<<<<<<<<<< + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + + /* "pandas/src/generated.pyx":6747 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6748 + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * if len(values) != len(labels): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6747 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6750 + * dtype=np.int64) + * + * if len(values) != len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6751 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6753 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6754 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6755 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6756 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":6758 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_11 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6759 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6760 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6763 + * + * # not nan + * nobs[lab, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_9 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_9) { + __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_9; + } + __pyx_t_18 = __pyx_v_lab; + __pyx_t_19 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17; + } + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":6765 + * nobs[lab, j] += val == val and val != iNaT + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6766 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6767 + * for i in range(len(counts)): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6736 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6773 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_463group_count_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_462group_count_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_463group_count_bin_float64 = {__Pyx_NAMESTR("group_count_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_463group_count_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_462group_count_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_463group_count_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_462group_count_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_462group_count_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_bin_float64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6782 + * cdef: + * Py_ssize_t i, j, ngroups + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 # <<<<<<<<<<<<<< + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6784 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6785 + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6784 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6787 + * dtype=np.int64) + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_8 - 1); + __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N)); + + /* "pandas/src/generated.pyx":6789 + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + * + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6790 + * + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_10) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_10; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6791 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6793 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_14 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6794 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6795 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6798 + * + * # not nan + * nobs[b, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_13 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_13) { + __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_12 = __pyx_t_10; + } else { + __pyx_t_12 = __pyx_t_13; + } + __pyx_t_19 = __pyx_v_b; + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12; + } + } + + /* "pandas/src/generated.pyx":6800 + * nobs[b, j] += val == val and val != iNaT + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = __pyx_v_ngroups; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6801 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6802 + * for i in range(ngroups): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6773 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6807 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_465group_count_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_464group_count_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_465group_count_bin_float32 = {__Pyx_NAMESTR("group_count_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_465group_count_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_464group_count_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_465group_count_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_464group_count_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_464group_count_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_bin_float32", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6816 + * cdef: + * Py_ssize_t i, j, ngroups + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 # <<<<<<<<<<<<<< + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6818 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6819 + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6818 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6821 + * dtype=np.int64) + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_8 - 1); + __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N)); + + /* "pandas/src/generated.pyx":6823 + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + * + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6824 + * + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_10) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_10; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6825 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6827 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_14 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6828 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6829 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6832 + * + * # not nan + * nobs[b, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_13 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_13) { + __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_12 = __pyx_t_10; + } else { + __pyx_t_12 = __pyx_t_13; + } + __pyx_t_19 = __pyx_v_b; + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12; + } + } + + /* "pandas/src/generated.pyx":6834 + * nobs[b, j] += val == val and val != iNaT + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = __pyx_v_ngroups; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6835 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6836 + * for i in range(ngroups): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6807 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6841 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_467group_count_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_466group_count_bin_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_467group_count_bin_object = {__Pyx_NAMESTR("group_count_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_467group_count_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_466group_count_bin_object)}; +static PyObject *__pyx_pw_6pandas_5algos_467group_count_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_bin_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_466group_count_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_466group_count_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_b; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_5numpy_int64_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + PyObject **__pyx_t_26; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_bin_object", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6850 + * cdef: + * Py_ssize_t i, j, ngroups + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 # <<<<<<<<<<<<<< + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6852 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6853 + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6852 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6855 + * dtype=np.int64) + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_8 - 1); + __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N)); + + /* "pandas/src/generated.pyx":6857 + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + * + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6858 + * + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_10) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_10; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6859 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6861 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_14 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6862 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6863 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6866 + * + * # not nan + * nobs[b, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_19 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_20 = __pyx_v_b; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_19; + } + } + + /* "pandas/src/generated.pyx":6868 + * nobs[b, j] += val == val and val != iNaT + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = __pyx_v_ngroups; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6869 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6870 + * for i in range(ngroups): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_4; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + + /* "pandas/src/generated.pyx":6841 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6875 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_469group_count_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_468group_count_bin_int64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_469group_count_bin_int64 = {__Pyx_NAMESTR("group_count_bin_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_469group_count_bin_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_468group_count_bin_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_469group_count_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_bin_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_bin_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_468group_count_bin_int64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_468group_count_bin_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_int64_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_bin_int64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6884 + * cdef: + * Py_ssize_t i, j, ngroups + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 # <<<<<<<<<<<<<< + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6886 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6887 + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6886 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6889 + * dtype=np.int64) + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_8 - 1); + __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N)); + + /* "pandas/src/generated.pyx":6891 + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + * + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6892 + * + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_10) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_10; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6893 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6895 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_14 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6896 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6897 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6900 + * + * # not nan + * nobs[b, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_13 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_13) { + __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_12 = __pyx_t_10; + } else { + __pyx_t_12 = __pyx_t_13; + } + __pyx_t_19 = __pyx_v_b; + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12; + } + } + + /* "pandas/src/generated.pyx":6902 + * nobs[b, j] += val == val and val != iNaT + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = __pyx_v_ngroups; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6903 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6904 + * for i in range(ngroups): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6875 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_bin_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_471left_join_indexer_unique_float64 = {__Pyx_NAMESTR("left_join_indexer_unique_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float64_t __pyx_v_rval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6917 + * float64_t lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":6918 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":6919 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":6920 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":6922 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6923 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":6924 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6925 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":6927 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6928 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6929 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":6930 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":6932 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6934 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6935 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6936 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":6938 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6939 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6940 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":6941 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":6942 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6943 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":6944 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":6945 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0); + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":6946 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6947 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6949 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6950 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":6951 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":6910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6955 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_473left_join_indexer_unique_float32 = {__Pyx_NAMESTR("left_join_indexer_unique_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float32_t __pyx_v_rval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6962 + * float32_t lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":6963 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":6964 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":6965 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":6967 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6968 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":6969 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6970 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":6972 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6973 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6974 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":6975 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":6977 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6979 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6980 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6981 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":6983 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6984 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6985 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":6986 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":6987 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6988 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":6989 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":6990 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0); + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":6991 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6992 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6994 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6995 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":6996 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":6955 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7000 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_475left_join_indexer_unique_object = {__Pyx_NAMESTR("left_join_indexer_unique_object"), (PyCFunction)__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + PyObject *__pyx_v_rval = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7007 + * object lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7008 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7009 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7010 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7012 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7013 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":7014 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7015 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":7017 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7018 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7019 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7020 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":7022 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7024 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = (__pyx_v_i < (__pyx_v_nleft - 1)); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":7025 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7026 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7028 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_19 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":7029 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7030 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7031 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = (__pyx_v_i < (__pyx_v_nleft - 1)); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":7032 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7033 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7034 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7035 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":7036 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7037 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7039 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7040 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":7041 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7000 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF(__pyx_v_rval); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7045 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_477left_join_indexer_unique_int32 = {__Pyx_NAMESTR("left_join_indexer_unique_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int32_t __pyx_v_rval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7052 + * int32_t lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7053 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7054 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7055 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7057 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7058 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":7059 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7060 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":7062 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7063 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7064 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7065 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":7067 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7069 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":7070 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7071 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7073 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":7074 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7075 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7076 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":7077 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7078 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7079 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7080 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0); + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":7081 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7082 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7084 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7085 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":7086 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7045 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7090 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_479left_join_indexer_unique_int64 = {__Pyx_NAMESTR("left_join_indexer_unique_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_rval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7097 + * int64_t lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7098 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7099 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7100 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7102 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7103 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":7104 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7105 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":7107 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7108 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7109 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7110 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":7112 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7114 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":7115 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7116 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7118 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":7119 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7120 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7121 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":7122 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7123 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7124 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7125 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0); + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":7126 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7127 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7129 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7130 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":7131 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7090 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7135 + * + * + * def left_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_481left_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_480left_join_indexer_float64[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_481left_join_indexer_float64 = {__Pyx_NAMESTR("left_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_481left_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_480left_join_indexer_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_481left_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_480left_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_480left_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float64_t __pyx_v_lval; + __pyx_t_5numpy_float64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_float64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7146 + * ndarray[float64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7147 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7149 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7150 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7151 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7152 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7153 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7154 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7155 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7156 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7158 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7159 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7161 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7162 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7163 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7164 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7165 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7167 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7168 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7169 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7170 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7171 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7172 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_9 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7173 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7176 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7177 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7178 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7179 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7181 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7185 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7186 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float64) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7187 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/generated.pyx":7189 + * result = np.empty(count, dtype=np.float64) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7190 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7191 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7192 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_7 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7193 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7194 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7195 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7196 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7197 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7198 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7199 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7200 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7201 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7203 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7204 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7206 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7207 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_26 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7208 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7209 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7210 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7211 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7212 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + __pyx_t_29 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7213 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7215 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7216 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7217 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7218 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7219 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7220 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7221 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7224 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7225 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7226 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7227 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7228 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_35 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7229 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7230 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7232 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7234 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7135 + * + * + * def left_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7237 + * + * + * def left_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_483left_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_482left_join_indexer_float32[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_483left_join_indexer_float32 = {__Pyx_NAMESTR("left_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_483left_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_482left_join_indexer_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_483left_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_482left_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_482left_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float32_t __pyx_v_lval; + __pyx_t_5numpy_float32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_float32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7248 + * ndarray[float32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7249 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7251 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7252 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7253 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7254 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7255 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7256 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7257 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7258 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7260 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7261 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7263 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7264 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7265 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7266 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7267 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7269 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7270 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7271 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7272 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7273 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7274 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_9 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7275 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7278 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7279 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7280 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7281 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7283 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7287 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7288 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float32) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7289 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/generated.pyx":7291 + * result = np.empty(count, dtype=np.float32) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7292 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7293 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7294 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_7 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7295 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7296 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7297 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7298 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7299 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7300 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7301 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7302 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7303 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7305 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7306 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7308 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7309 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_26 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7310 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7311 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7312 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7313 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7314 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + __pyx_t_29 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7315 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7317 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7318 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7319 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7320 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7321 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7322 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7323 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7326 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7327 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7328 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7329 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7330 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_35 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7331 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7332 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7334 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7336 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7237 + * + * + * def left_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7339 + * + * + * def left_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_485left_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_484left_join_indexer_object[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_485left_join_indexer_object = {__Pyx_NAMESTR("left_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_485left_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_484left_join_indexer_object)}; +static PyObject *__pyx_pw_6pandas_5algos_485left_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_484left_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_484left_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + PyObject *__pyx_v_lval = 0; + PyObject *__pyx_v_rval = 0; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + PyObject **__pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_object", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7350 + * ndarray[object] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7351 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7353 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7354 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7355 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7356 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7357 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7358 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7359 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7360 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7362 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":7363 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_5 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":7365 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7366 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7367 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7368 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_2) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_2; + } + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7369 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7371 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7372 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7373 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7374 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_9 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7375 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7376 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7377 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7380 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7381 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7382 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7383 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7385 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7389 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7390 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=object) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7391 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/src/generated.pyx":7393 + * result = np.empty(count, dtype=object) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7394 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7395 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7396 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_9 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7397 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_9 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_9) break; + + /* "pandas/src/generated.pyx":7398 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_9 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7399 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_9 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_9) break; + + /* "pandas/src/generated.pyx":7400 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7401 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7402 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_23 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_24); + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_24); + *__pyx_t_24 = __pyx_t_7; + __Pyx_GIVEREF(*__pyx_t_24); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/generated.pyx":7403 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7404 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7405 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7407 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/src/generated.pyx":7408 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/src/generated.pyx":7410 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7411 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7412 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7413 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_29 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_24); + __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_24); + *__pyx_t_24 = __pyx_v_lval; + __Pyx_GIVEREF(*__pyx_t_24); + + /* "pandas/src/generated.pyx":7414 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7415 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_9 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7416 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_9 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_9) { + __pyx_t_30 = (__pyx_v_j + 1); + __pyx_t_4 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_13 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_8 = __pyx_t_2; + } else { + __pyx_t_8 = __pyx_t_9; + } + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7417 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7419 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7420 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_13); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_13, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7421 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7422 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_8 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7423 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7424 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_32 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_13 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7425 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7428 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7429 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_13 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7430 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7431 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_34 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7432 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_13); + __pyx_t_36 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_24); + __Pyx_INCREF(__pyx_t_13); __Pyx_DECREF(*__pyx_t_24); + *__pyx_t_24 = __pyx_t_13; + __Pyx_GIVEREF(*__pyx_t_24); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7433 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7434 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7436 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7438 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_13, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7339 + * + * + * def left_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_lval); + __Pyx_XDECREF(__pyx_v_rval); + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7441 + * + * + * def left_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_487left_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_486left_join_indexer_int32[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_487left_join_indexer_int32 = {__Pyx_NAMESTR("left_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_487left_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_486left_join_indexer_int32)}; +static PyObject *__pyx_pw_6pandas_5algos_487left_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_486left_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_486left_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int32_t __pyx_v_lval; + __pyx_t_5numpy_int32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_int32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7452 + * ndarray[int32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7453 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7455 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7456 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7457 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7458 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7459 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7460 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7461 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7462 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7464 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7465 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7467 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7468 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7469 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7470 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7471 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7473 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7474 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7475 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7476 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7477 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7478 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_9 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7479 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7482 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7483 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7484 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7485 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7487 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7491 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7492 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int32) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7493 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/generated.pyx":7495 + * result = np.empty(count, dtype=np.int32) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7496 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7497 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7498 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_7 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7499 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7500 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7501 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7502 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7503 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7504 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7505 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7506 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7507 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7509 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7510 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7512 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7513 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_26 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7514 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7515 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7516 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7517 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7518 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + __pyx_t_29 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7519 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7521 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7522 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7523 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7524 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7525 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7526 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7527 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7530 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7531 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7532 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7533 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7534 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_35 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7535 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7536 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7538 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7540 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7441 + * + * + * def left_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7543 + * + * + * def left_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_489left_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_488left_join_indexer_int64[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_489left_join_indexer_int64 = {__Pyx_NAMESTR("left_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_489left_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_488left_join_indexer_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_489left_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_488left_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_488left_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int64_t __pyx_v_lval; + __pyx_t_5numpy_int64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_int64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7554 + * ndarray[int64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7555 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7557 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7558 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7559 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7560 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7561 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7562 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7563 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7564 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7566 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7567 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7569 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7570 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7571 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7572 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7573 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7575 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7576 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7577 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7578 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7579 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7580 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_9 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7581 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7584 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7585 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7586 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7587 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7589 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7593 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7594 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7595 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/generated.pyx":7597 + * result = np.empty(count, dtype=np.int64) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7598 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7599 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7600 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_7 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7601 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7602 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7603 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7604 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7605 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7606 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7607 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7608 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7609 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7611 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7612 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7614 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7615 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_26 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7616 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7617 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7618 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7619 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7620 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + __pyx_t_29 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7621 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7623 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7624 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7625 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7626 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7627 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7628 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7629 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7632 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7633 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7634 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7635 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7636 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_35 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7637 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7638 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7640 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7642 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7543 + * + * + * def left_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7647 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_491outer_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_491outer_join_indexer_float64 = {__Pyx_NAMESTR("outer_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_491outer_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_491outer_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_490outer_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_490outer_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float64_t __pyx_v_lval; + __pyx_t_5numpy_float64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_float64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7655 + * ndarray[float64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7656 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7658 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7659 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7660 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7661 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7662 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":7663 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7664 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7666 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":7667 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7668 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":7669 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7670 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7671 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7672 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7674 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7675 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_3 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7676 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7677 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7678 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7679 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_4 = (__pyx_v_j + 1); + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7680 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7682 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7683 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7684 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7685 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7686 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7687 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7688 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7691 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7692 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7693 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7694 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7696 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7697 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7699 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7700 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":7701 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":7705 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7706 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7707 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7708 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_6 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7709 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":7710 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7711 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7712 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)); + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":7713 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_6 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7714 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":7715 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_26 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7716 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7717 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides)); + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7719 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":7720 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7721 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":7722 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7723 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7724 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7725 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7726 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":7727 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7728 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7729 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":7730 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7731 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7732 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7733 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7734 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7735 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7737 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7738 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_37 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7740 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7741 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_38 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7742 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7743 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7744 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7745 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7746 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + __pyx_t_41 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7747 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7749 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7750 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7751 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":7752 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7753 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7754 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_43 = __pyx_v_j; + __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7755 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7758 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":7759 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7760 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_44 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7761 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7762 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7763 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7764 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7766 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_47 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7767 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7768 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":7769 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7770 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":7772 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7647 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7776 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_493outer_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_493outer_join_indexer_float32 = {__Pyx_NAMESTR("outer_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_493outer_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_493outer_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_492outer_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_492outer_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float32_t __pyx_v_lval; + __pyx_t_5numpy_float32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_float32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7784 + * ndarray[float32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7785 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7787 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7788 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7789 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7790 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7791 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":7792 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7793 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7795 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":7796 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7797 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":7798 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7799 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7800 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7801 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7803 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7804 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_3 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7805 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7806 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7807 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7808 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_4 = (__pyx_v_j + 1); + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7809 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7811 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7812 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7813 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7814 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7815 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7816 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7817 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7820 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7821 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7822 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7823 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7825 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7826 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7828 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7829 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float32) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":7830 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":7834 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7835 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7836 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7837 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_6 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7838 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":7839 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7840 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7841 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)); + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":7842 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_6 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7843 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":7844 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_26 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7845 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7846 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides)); + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7848 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":7849 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7850 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":7851 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7852 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7853 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7854 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7855 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":7856 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7857 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7858 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":7859 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7860 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7861 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7862 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7863 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7864 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7866 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7867 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_37 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7869 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7870 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_38 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7871 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7872 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7873 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7874 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7875 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + __pyx_t_41 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7876 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7878 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7879 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7880 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":7881 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7882 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7883 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_43 = __pyx_v_j; + __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7884 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7887 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":7888 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7889 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_44 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7890 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7891 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7892 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7893 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7895 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_47 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7896 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7897 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":7898 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7899 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":7901 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7776 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7905 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_495outer_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_495outer_join_indexer_object = {__Pyx_NAMESTR("outer_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_495outer_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_495outer_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_494outer_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_494outer_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + PyObject *__pyx_v_lval = 0; + PyObject *__pyx_v_rval = 0; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + PyObject **__pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_object", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7913 + * ndarray[object] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7914 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7916 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7917 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7918 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7919 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7920 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":7921 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7922 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7924 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":7925 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7926 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":7927 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7928 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7929 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7930 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7932 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":7933 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":7934 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7935 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7936 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7937 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_2; + } + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7938 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7940 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7941 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7942 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7943 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_8 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7944 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7945 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_10 = __pyx_v_j; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7946 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7949 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7950 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7951 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7952 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7954 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7955 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7957 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7958 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=object) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":7959 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7963 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7964 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7965 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7966 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_8 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7967 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":7968 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7969 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7970 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_25 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_6; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":7971 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_8 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7972 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":7973 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7974 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_28 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7975 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_30 = __pyx_v_i; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_6; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7977 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":7978 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_8 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7979 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_8 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_8) break; + + /* "pandas/src/generated.pyx":7980 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7981 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7982 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_32 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_6; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7983 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7984 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":7985 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7986 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_8 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7987 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_8 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_8) break; + + /* "pandas/src/generated.pyx":7988 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7989 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_34 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7990 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_36 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_6; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7991 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7992 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7993 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7995 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7996 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_38 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7998 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7999 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8000 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8001 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_41 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_v_lval; + __Pyx_GIVEREF(*__pyx_t_26); + + /* "pandas/src/generated.pyx":8002 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8003 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_8 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":8004 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_8 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_8) { + __pyx_t_42 = (__pyx_v_j + 1); + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __pyx_t_2; + } else { + __pyx_t_7 = __pyx_t_8; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8005 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8007 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8008 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_12 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_12); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_12, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8009 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":8010 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8011 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8012 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_44 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8013 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8016 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":8017 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8018 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8019 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8020 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_47 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_v_lval; + __Pyx_GIVEREF(*__pyx_t_26); + + /* "pandas/src/generated.pyx":8021 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8022 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8024 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8025 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8026 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_50 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_v_rval); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_v_rval; + __Pyx_GIVEREF(*__pyx_t_26); + + /* "pandas/src/generated.pyx":8027 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8028 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8030 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7905 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_lval); + __Pyx_XDECREF(__pyx_v_rval); + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8034 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_497outer_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_497outer_join_indexer_int32 = {__Pyx_NAMESTR("outer_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_497outer_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_497outer_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_496outer_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_496outer_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int32_t __pyx_v_lval; + __pyx_t_5numpy_int32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_int32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8042 + * ndarray[int32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8043 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8045 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8046 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8047 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8048 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8049 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":8050 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8051 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8053 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":8054 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8055 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":8056 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8057 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8058 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":8059 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8061 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8062 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_3 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8063 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8064 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8065 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8066 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_4 = (__pyx_v_j + 1); + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8067 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8069 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8070 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8071 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8072 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8073 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8074 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8075 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8078 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8079 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8080 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8081 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8083 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8084 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8086 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8087 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int32) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8088 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8092 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8093 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8094 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8095 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_6 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8096 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":8097 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8098 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8099 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)); + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":8100 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_6 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8101 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":8102 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_26 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8103 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8104 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides)); + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8106 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":8107 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8108 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":8109 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8110 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8111 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8112 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8113 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":8114 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":8115 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8116 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":8117 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8118 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8119 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8120 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8121 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":8122 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":8124 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8125 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_37 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8127 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8128 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_38 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8129 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8130 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":8131 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8132 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8133 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + __pyx_t_41 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8134 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8136 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8137 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8138 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":8139 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8140 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8141 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_43 = __pyx_v_j; + __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8142 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8145 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":8146 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8147 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_44 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8148 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8149 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":8150 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8151 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8153 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_47 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8154 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8155 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8156 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8157 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8159 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8034 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_499outer_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_499outer_join_indexer_int64 = {__Pyx_NAMESTR("outer_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_499outer_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_499outer_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_498outer_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_498outer_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int64_t __pyx_v_lval; + __pyx_t_5numpy_int64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_int64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8171 + * ndarray[int64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8172 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8174 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8175 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8176 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8177 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8178 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":8179 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8180 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8182 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":8183 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8184 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":8185 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8186 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8187 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":8188 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8190 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8191 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_3 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8192 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8193 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8194 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8195 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_4 = (__pyx_v_j + 1); + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8196 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8198 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8199 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8200 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8201 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8202 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8203 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8204 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8207 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8208 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8209 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8210 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8212 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8213 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8215 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8216 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8217 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8221 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8222 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8223 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8224 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_6 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8225 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":8226 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8227 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8228 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)); + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":8229 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_6 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8230 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":8231 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_26 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8232 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8233 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides)); + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8235 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":8236 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8237 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":8238 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8239 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8240 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8241 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8242 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":8243 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":8244 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8245 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":8246 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8247 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8248 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8249 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8250 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":8251 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":8253 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8254 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_37 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8256 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8257 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_38 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8258 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8259 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":8260 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8261 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8262 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + __pyx_t_41 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8263 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8265 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8266 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8267 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":8268 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8269 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8270 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_43 = __pyx_v_j; + __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8271 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8274 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":8275 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8276 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_44 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8277 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8278 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":8279 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8280 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8282 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_47 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8283 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8284 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8285 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8286 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8288 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8293 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_501inner_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_500inner_join_indexer_float64[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_501inner_join_indexer_float64 = {__Pyx_NAMESTR("inner_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_501inner_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_500inner_join_indexer_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_501inner_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_500inner_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_500inner_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float64_t __pyx_v_lval; + __pyx_t_5numpy_float64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_float64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8304 + * ndarray[float64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8305 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8307 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8308 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8309 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8310 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8311 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8312 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8313 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8314 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8315 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8317 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8318 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_5 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8319 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8320 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8321 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8322 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8323 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8325 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8326 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8327 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8328 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8329 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8330 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8331 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8334 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8335 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8336 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8338 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8342 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8343 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8344 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8346 + * result = np.empty(count, dtype=np.float64) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8347 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8348 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8349 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8350 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8351 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8352 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8353 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8354 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8356 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8357 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8358 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8359 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8360 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8361 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8362 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8363 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8364 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_25 = (__pyx_v_j + 1); + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8365 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8367 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8368 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8369 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8370 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8371 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8372 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8373 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8376 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8377 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8378 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8380 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8382 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8293 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8386 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_503inner_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_502inner_join_indexer_float32[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_503inner_join_indexer_float32 = {__Pyx_NAMESTR("inner_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_503inner_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_502inner_join_indexer_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_503inner_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_502inner_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_502inner_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float32_t __pyx_v_lval; + __pyx_t_5numpy_float32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_float32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8397 + * ndarray[float32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8398 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8400 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8401 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8402 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8403 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8404 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8405 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8406 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8407 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8408 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8410 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8411 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_5 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8412 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8413 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8414 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8415 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8416 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8418 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8419 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8420 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8421 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8422 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8423 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8424 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8427 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8428 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8429 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8431 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8435 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8436 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float32) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8437 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8439 + * result = np.empty(count, dtype=np.float32) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8440 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8441 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8442 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8443 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8444 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8445 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8446 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8447 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8449 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8450 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8451 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8452 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8453 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8454 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8455 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8456 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8457 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_25 = (__pyx_v_j + 1); + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8458 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8460 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8461 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8462 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8463 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8464 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8465 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8466 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8469 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8470 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8471 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8473 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8475 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8386 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8479 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_505inner_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_504inner_join_indexer_object[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_505inner_join_indexer_object = {__Pyx_NAMESTR("inner_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_505inner_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_504inner_join_indexer_object)}; +static PyObject *__pyx_pw_6pandas_5algos_505inner_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_504inner_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_504inner_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + PyObject *__pyx_v_lval = 0; + PyObject *__pyx_v_rval = 0; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + PyObject **__pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_object", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8490 + * ndarray[object] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8491 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8493 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8494 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8495 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8496 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8497 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8498 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8499 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8500 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8501 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8503 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":8504 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_6 = __pyx_v_j; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":8505 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8506 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8507 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8508 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_4) { + __pyx_t_7 = (__pyx_v_j + 1); + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_5, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8509 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8511 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8512 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8513 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8514 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8515 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8516 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_10 = __pyx_v_j; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8517 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8520 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8521 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8522 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8524 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8528 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8529 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=object) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8530 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":8532 + * result = np.empty(count, dtype=object) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8533 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8534 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8535 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8536 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8537 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8538 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8539 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8540 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8542 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":8543 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":8544 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8545 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8546 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8547 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_25); + __Pyx_INCREF(__pyx_v_rval); __Pyx_DECREF(*__pyx_t_25); + *__pyx_t_25 = __pyx_v_rval; + __Pyx_GIVEREF(*__pyx_t_25); + + /* "pandas/src/generated.pyx":8548 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8549 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8550 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_2) { + __pyx_t_26 = (__pyx_v_j + 1); + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_8, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8551 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8553 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8554 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_12 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_12); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_12, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8555 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8556 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8557 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8558 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8559 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8562 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8563 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8564 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8566 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8568 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8479 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_lval); + __Pyx_XDECREF(__pyx_v_rval); + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_507inner_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_506inner_join_indexer_int32[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_507inner_join_indexer_int32 = {__Pyx_NAMESTR("inner_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_507inner_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_506inner_join_indexer_int32)}; +static PyObject *__pyx_pw_6pandas_5algos_507inner_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_506inner_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_506inner_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int32_t __pyx_v_lval; + __pyx_t_5numpy_int32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_int32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8583 + * ndarray[int32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8584 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8586 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8587 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8588 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8589 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8590 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8591 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8592 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8593 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8594 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8596 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8597 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_5 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8598 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8599 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8600 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8601 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8602 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8604 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8605 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8606 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8607 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8608 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8609 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8610 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8613 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8614 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8615 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8617 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8621 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8622 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int32) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8623 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8625 + * result = np.empty(count, dtype=np.int32) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8626 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8627 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8628 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8629 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8630 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8631 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8632 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8633 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8635 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8636 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8637 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8638 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8639 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8640 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8641 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8642 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8643 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_25 = (__pyx_v_j + 1); + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8644 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8646 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8647 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8648 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8649 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8650 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8651 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8652 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8655 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8656 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8657 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8659 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8661 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8665 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_509inner_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_508inner_join_indexer_int64[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_509inner_join_indexer_int64 = {__Pyx_NAMESTR("inner_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_509inner_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_508inner_join_indexer_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_509inner_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_508inner_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_508inner_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int64_t __pyx_v_lval; + __pyx_t_5numpy_int64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_int64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8676 + * ndarray[int64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8677 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8679 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8680 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8681 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8682 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8683 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8684 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8685 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8686 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8687 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8689 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8690 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_5 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8691 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8692 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8693 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8694 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8695 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8697 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8698 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8699 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8700 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8701 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8702 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8703 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8706 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8707 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8708 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8710 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8714 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8715 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8716 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8718 + * result = np.empty(count, dtype=np.int64) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8719 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8720 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8721 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8722 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8723 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8724 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8725 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8726 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8728 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8729 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8730 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8731 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8732 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8733 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8734 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8735 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8736 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_25 = (__pyx_v_j + 1); + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8737 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8739 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8740 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8741 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8742 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8743 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8744 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8745 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8748 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8749 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8750 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8752 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8754 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8665 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_result; + char *__pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_to_dts", 0); + __Pyx_INCREF(__pyx_v_val); + + /* "datetime.pxd":130 + * cdef char *tmp + * + * if PyUnicode_Check(val): # <<<<<<<<<<<<<< + * val = PyUnicode_AsASCIIString(val); + * + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":131 + * + * if PyUnicode_Check(val): + * val = PyUnicode_AsASCIIString(val); # <<<<<<<<<<<<<< + * + * tmp = val + */ + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "datetime.pxd":133 + * val = PyUnicode_AsASCIIString(val); + * + * tmp = val # <<<<<<<<<<<<<< + * result = _cstring_to_dts(tmp, len(val), dts) + * + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmp = __pyx_t_3; + + /* "datetime.pxd":134 + * + * tmp = val + * result = _cstring_to_dts(tmp, len(val), dts) # <<<<<<<<<<<<<< + * + * if result == -1: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts); + + /* "datetime.pxd":136 + * result = _cstring_to_dts(tmp, len(val), dts) + * + * if result == -1: # <<<<<<<<<<<<<< + * raise ValueError('Unable to parse %s' % str(val)) + * + */ + __pyx_t_1 = ((__pyx_v_result == -1) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":137 + * + * if result == -1: + * raise ValueError('Unable to parse %s' % str(val)) # <<<<<<<<<<<<<< + * + * cdef inline int _cstring_to_dts(char *val, int length, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("datetime._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts) { + npy_bool __pyx_v_islocal; + npy_bool __pyx_v_special; + PANDAS_DATETIMEUNIT __pyx_v_out_bestunit; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cstring_to_dts", 0); + + /* "datetime.pxd":146 + * int result + * + * result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns, # <<<<<<<<<<<<<< + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + */ + __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special)); + + /* "datetime.pxd":149 + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime64_to_datetime", 0); + + /* "datetime.pxd":154 + * cdef inline object _datetime64_to_datetime(int64_t val): + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * return _dts_to_pydatetime(&dts) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "datetime.pxd":155 + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * return _dts_to_pydatetime(&dts) # <<<<<<<<<<<<<< + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dts_to_pydatetime", 0); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_XDECREF(__pyx_r); + + /* "datetime.pxd":160 + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + */ + __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0); + + /* "datetime.pxd":163 + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":164 + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":165 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":166 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) # <<<<<<<<<<<<<< + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + */ + __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val); + + /* "datetime.pxd":167 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) # <<<<<<<<<<<<<< + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + */ + __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val); + + /* "datetime.pxd":168 + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) # <<<<<<<<<<<<<< + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + */ + __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val); + + /* "datetime.pxd":169 + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val); + + /* "datetime.pxd":170 + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":171 + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _dtlike_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + npy_int64 __pyx_t_2; + npy_int32 __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dtlike_to_datetime64", 0); + + /* "datetime.pxd":175 + * cdef inline int64_t _dtlike_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = val.year # <<<<<<<<<<<<<< + * dts.month = val.month + * dts.day = val.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->year = __pyx_t_2; + + /* "datetime.pxd":176 + * pandas_datetimestruct *dts): + * dts.year = val.year + * dts.month = val.month # <<<<<<<<<<<<<< + * dts.day = val.day + * dts.hour = val.hour + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->month = __pyx_t_3; + + /* "datetime.pxd":177 + * dts.year = val.year + * dts.month = val.month + * dts.day = val.day # <<<<<<<<<<<<<< + * dts.hour = val.hour + * dts.min = val.minute + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->day = __pyx_t_3; + + /* "datetime.pxd":178 + * dts.month = val.month + * dts.day = val.day + * dts.hour = val.hour # <<<<<<<<<<<<<< + * dts.min = val.minute + * dts.sec = val.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->hour = __pyx_t_3; + + /* "datetime.pxd":179 + * dts.day = val.day + * dts.hour = val.hour + * dts.min = val.minute # <<<<<<<<<<<<<< + * dts.sec = val.second + * dts.us = val.microsecond + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->min = __pyx_t_3; + + /* "datetime.pxd":180 + * dts.hour = val.hour + * dts.min = val.minute + * dts.sec = val.second # <<<<<<<<<<<<<< + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->sec = __pyx_t_3; + + /* "datetime.pxd":181 + * dts.min = val.minute + * dts.sec = val.second + * dts.us = val.microsecond # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->us = __pyx_t_3; + + /* "datetime.pxd":182 + * dts.sec = val.second + * dts.us = val.microsecond + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":183 + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _date_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_to_datetime64", 0); + + /* "datetime.pxd":187 + * cdef inline int64_t _date_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":188 + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":189 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":190 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->hour = 0; + __pyx_v_dts->min = 0; + __pyx_v_dts->sec = 0; + __pyx_v_dts->us = 0; + + /* "datetime.pxd":191 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":192 + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__219, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + + /* "View.MemoryView":117 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":123 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize + * + */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":124 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":126 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":127 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__222, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":129 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":130 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if isinstance(format, unicode): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__223, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":132 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if isinstance(format, unicode): # <<<<<<<<<<<<<< + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyUnicode_Check(__pyx_v_format); + __pyx_t_4 = (__pyx_t_2 != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":133 + * + * if isinstance(format, unicode): + * format = (format).encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + if (unlikely(__pyx_v_format == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyUnicode_AsASCIIString(((PyObject*)__pyx_v_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "View.MemoryView":134 + * if isinstance(format, unicode): + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":135 + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->format = __pyx_t_5; + + /* "View.MemoryView":138 + * + * + * self._shape = PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * + */ + __pyx_v_self->_shape = ((Py_ssize_t *)PyMem_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + + /* "View.MemoryView":139 + * + * self._shape = PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: + */ + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + + /* "View.MemoryView":141 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":142 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__224, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":145 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_6 = 0; + __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_dim = __pyx_t_8; + __pyx_v_idx = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":146 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":147 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_7 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":148 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< + * + * cdef char order + */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":151 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":152 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":153 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + goto __pyx_L10; + } + + /* "View.MemoryView":154 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":155 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":156 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + goto __pyx_L10; + } + /*else*/ { + + /* "View.MemoryView":158 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L10:; + + /* "View.MemoryView":160 + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + * + * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< + * itemsize, self.ndim, order) + * + */ + __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); + + /* "View.MemoryView":163 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":164 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":165 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":168 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":169 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":170 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":172 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":173 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":174 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":175 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":176 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":179 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":180 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":181 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":182 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + goto __pyx_L3; + } + + /* "View.MemoryView":183 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":184 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":185 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":186 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":187 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":188 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":189 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":190 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":191 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":192 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":193 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":194 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":196 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":197 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":199 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":201 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":179 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":205 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":206 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":207 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + goto __pyx_L3; + } + + /* "View.MemoryView":208 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":209 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":210 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":212 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyMem_Free(self._shape) + * + */ + free(__pyx_v_self->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":213 + * self._strides, self.ndim, False) + * free(self.data) + * PyMem_Free(self._shape) # <<<<<<<<<<<<<< + * + * property memview: + */ + PyMem_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":205 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":217 + * property memview: + * @cname('get_memview') + * def __get__(self): # <<<<<<<<<<<<<< + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + */ + +/* Python wrapper */ +static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/ +static PyObject *get_memview(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":219 + * def __get__(self): + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":220 + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":217 + * property memview: + * @cname('get_memview') + * def __get__(self): # <<<<<<<<<<<<<< + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":223 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":224 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":223 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":226 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":227 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":226 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":229 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":230 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":229 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":234 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":238 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":239 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":241 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":242 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":241 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":243 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":245 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":234 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":271 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":272 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":271 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":273 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":274 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":273 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":288 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":290 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset + * + */ + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + + /* "View.MemoryView":294 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":296 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":297 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p + */ + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":299 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview') + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":288 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":317 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":318 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":319 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":320 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type))); + if (!(__pyx_t_1 != 0)) { + __pyx_t_2 = (__pyx_v_obj != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "View.MemoryView":321 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":322 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_3 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":323 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + + /* "View.MemoryView":324 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * self.lock = PyThread_allocate_lock() + */ + Py_INCREF(Py_None); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":326 + * Py_INCREF(Py_None) + * + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock == NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":327 + * + * self.lock = PyThread_allocate_lock() + * if self.lock == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_3 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":328 + * self.lock = PyThread_allocate_lock() + * if self.lock == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":330 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = self.view.format == b'O' + * else: + */ + __pyx_t_3 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":331 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_3; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":333 + * self.dtype_is_object = self.view.format == b'O' + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L6:; + + /* "View.MemoryView":335 + * self.dtype_is_object = dtype_is_object + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":337 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(memoryview self): + */ + __pyx_v_self->typeinfo = NULL; + + /* "View.MemoryView":317 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":339 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":340 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":341 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * + * if self.lock != NULL: + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":343 + * __Pyx_ReleaseBuffer(&self.view) + * + * if self.lock != NULL: # <<<<<<<<<<<<<< + * PyThread_free_lock(self.lock) + * + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":344 + * + * if self.lock != NULL: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":339 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":346 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":348 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * + * for dim, idx in enumerate(index): + */ + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + + /* "View.MemoryView":350 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_v_index) || PyTuple_CheckExact(__pyx_v_index)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":351 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":353 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":346 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":356 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":357 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":358 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + } + + /* "View.MemoryView":360 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":363 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + + /* "View.MemoryView":364 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":366 + * return memview_slice(self, indices) + * else: + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) + * + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":367 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":356 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":369 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":370 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":372 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":373 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":374 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":375 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":377 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":379 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":369 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":381 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":382 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type)); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":384 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":385 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":384 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":386 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":387 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":389 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":381 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":391 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":395 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":396 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":397 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":395 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":391 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":399 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[128]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + char const *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":401 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":406 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): + */ + __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + + /* "View.MemoryView":408 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":409 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":410 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":411 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":412 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":414 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":416 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":417 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":418 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + goto __pyx_L8; + } + /*else*/ { + + /* "View.MemoryView":420 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":424 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":425 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":426 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":429 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":399 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":431 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":432 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":433 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":431 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":435 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":438 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":441 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":442 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":443 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + } + /*else:*/ { + + /* "View.MemoryView":447 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + __pyx_t_7 = strlen(__pyx_v_self->view.format); + __pyx_t_8 = ((__pyx_t_7 == 1) != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":448 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L6_except_return; + } + + /* "View.MemoryView":449 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "View.MemoryView":444 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":445 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__227, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L10_try_end:; + } + + /* "View.MemoryView":435 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":451 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + char *__pyx_t_10; + char *__pyx_t_11; + char *__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":454 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":459 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":460 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":462 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":464 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_7 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_8 = __pyx_v_bytesvalue; + __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8); + __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8)); + for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) { + __pyx_t_9 = __pyx_t_12; + __pyx_v_c = (__pyx_t_9[0]); + + /* "View.MemoryView":465 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_7; + + /* "View.MemoryView":464 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_7 = (__pyx_t_7 + 1); + + /* "View.MemoryView":465 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "View.MemoryView":451 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":468 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":469 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":470 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":472 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":474 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":475 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":477 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":479 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":480 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":482 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":484 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":485 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":487 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":489 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":490 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":491 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":492 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":493 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":494 + * info.len = self.view.len + * info.readonly = 0 + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":468 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":501 + * property T: + * @cname('__pyx_memoryview_transpose') + * def __get__(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":502 + * @cname('__pyx_memoryview_transpose') + * def __get__(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":503 + * def __get__(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":504 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * property base: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":501 + * property T: + * @cname('__pyx_memoryview_transpose') + * def __get__(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":508 + * property base: + * @cname('__pyx_memoryview__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":509 + * @cname('__pyx_memoryview__get__base') + * def __get__(self): + * return self.obj # <<<<<<<<<<<<<< + * + * property shape: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":508 + * property base: + * @cname('__pyx_memoryview__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":513 + * property shape: + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): # <<<<<<<<<<<<<< + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":514 + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property strides: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_self->view.ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "View.MemoryView":513 + * property shape: + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): # <<<<<<<<<<<<<< + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":518 + * property strides: + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":519 + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":521 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__228, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":523 + * raise ValueError("Buffer view does not expose strides") + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property suboffsets: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_self->view.ndim; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":518 + * property strides: + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":527 + * property suboffsets: + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":528 + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return [-1] * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":529 + * def __get__(self): + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_neg_1); + PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + } + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":531 + * return [-1] * self.view.ndim + * + * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property ndim: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_self->view.ndim; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":527 + * property suboffsets: + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":535 + * property ndim: + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":536 + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * property itemsize: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":535 + * property ndim: + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":540 + * property itemsize: + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":541 + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * property nbytes: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":540 + * property itemsize: + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":545 + * property nbytes: + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":546 + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * property size: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":545 + * property nbytes: + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":550 + * property size: + * @cname('__pyx_memoryview_get_size') + * def __get__(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":551 + * @cname('__pyx_memoryview_get_size') + * def __get__(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":552 + * def __get__(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.shape: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":554 + * result = 1 + * + * for length in self.shape: # <<<<<<<<<<<<<< + * result *= length + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":555 + * + * for length in self.shape: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":557 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":559 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":550 + * property size: + * @cname('__pyx_memoryview_get_size') + * def __get__(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":561 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":562 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< + * + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + } + + /* "View.MemoryView":565 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":567 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":568 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":569 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":568 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":567 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":571 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":572 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":571 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":575 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":578 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":579 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<< + * + * def is_f_contig(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":575 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":581 + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":584 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":585 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":581 + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":587 + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":589 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &mslice) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + + /* "View.MemoryView":591 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":592 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":597 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":587 + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":599 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":601 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &src) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + + /* "View.MemoryView":603 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":604 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":609 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":599 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":613 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":614 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":615 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":616 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":613 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":619 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":620 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":619 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":622 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":627 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":628 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":630 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":632 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":633 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":634 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":635 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_tup) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":636 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":637 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":638 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__229, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_9, __pyx_temp, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "View.MemoryView":639 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":641 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__230, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_L7:; + + /* "View.MemoryView":642 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":644 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + __pyx_t_1 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_1 = ((!(__Pyx_PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_11 = __pyx_t_1; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + + /* "View.MemoryView":645 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":647 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + if (!__pyx_v_have_slices) { + __pyx_t_11 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_v_have_slices; + } + __pyx_v_have_slices = __pyx_t_2; + + /* "View.MemoryView":648 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":650 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":651 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_2 = (__pyx_v_nslices != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":652 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__231, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":654 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_2) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_9 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_9 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":622 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":656 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(ndim): + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":658 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * cdef int i + * for i in range(ndim): # <<<<<<<<<<<<<< + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":659 + * cdef int i + * for i in range(ndim): + * if suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":660 + * for i in range(ndim): + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + + /* "View.MemoryView":656 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(ndim): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":667 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":668 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":675 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":679 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "View.MemoryView":681 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":682 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":683 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":685 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":686 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":692 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data + * + */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; + + /* "View.MemoryView":693 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; + + /* "View.MemoryView":698 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":699 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":703 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (PyList_CheckExact(__pyx_v_indices) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":704 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (__Pyx_PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":708 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":705 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + + /* "View.MemoryView":711 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":712 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":713 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":714 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1; + + /* "View.MemoryView":715 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":717 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_12 = __pyx_int_0; + } else { + __pyx_t_12 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":718 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_9 = __pyx_int_0; + } else { + __pyx_t_9 = __pyx_t_12; + __pyx_t_12 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":719 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_12 = __pyx_int_0; + } else { + __pyx_t_12 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":721 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":722 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":723 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":725 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":731 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":733 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":734 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":735 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "View.MemoryView":736 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "View.MemoryView":734 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":739 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":740 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":739 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":667 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":764 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":784 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":786 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":787 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":788 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":789 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":792 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + __pyx_t_2 = (__pyx_v_have_step != 0); + if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_step < 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_v_negative_step = __pyx_t_4; + + /* "View.MemoryView":794 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + if ((__pyx_v_have_step != 0)) { + __pyx_t_4 = (__pyx_v_step == 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = (__pyx_v_have_step != 0); + } + if (__pyx_t_2) { + + /* "View.MemoryView":795 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + + /* "View.MemoryView":798 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":799 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":800 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":801 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":802 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "View.MemoryView":803 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":804 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":805 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + goto __pyx_L10; + } + /*else*/ { + + /* "View.MemoryView":807 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_start = __pyx_v_shape; + } + __pyx_L10:; + goto __pyx_L8; + } + __pyx_L8:; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":809 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":810 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + goto __pyx_L11; + } + /*else*/ { + + /* "View.MemoryView":812 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + __pyx_v_start = 0; + } + __pyx_L11:; + } + __pyx_L7:; + + /* "View.MemoryView":814 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":815 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":816 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":817 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":818 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + + /* "View.MemoryView":819 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":820 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + /*else*/ { + + /* "View.MemoryView":822 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":823 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1; + goto __pyx_L15; + } + /*else*/ { + + /* "View.MemoryView":825 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L15:; + } + __pyx_L12:; + + /* "View.MemoryView":827 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + goto __pyx_L16; + } + __pyx_L16:; + + /* "View.MemoryView":832 + * + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + * + * if (stop - start) - step * new_shape: + */ + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + + /* "View.MemoryView":834 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":835 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "View.MemoryView":837 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + goto __pyx_L18; + } + __pyx_L18:; + + /* "View.MemoryView":841 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":842 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":843 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; + + /* "View.MemoryView":846 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":847 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + goto __pyx_L19; + } + /*else*/ { + + /* "View.MemoryView":849 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L19:; + + /* "View.MemoryView":851 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":854 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + goto __pyx_L22; + } + /*else*/ { + + /* "View.MemoryView":856 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L22:; + goto __pyx_L21; + } + /*else*/ { + + /* "View.MemoryView":859 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L21:; + goto __pyx_L20; + } + __pyx_L20:; + + /* "View.MemoryView":861 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":764 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":867 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":869 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1; + + /* "View.MemoryView":870 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":873 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":874 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":875 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":877 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":878 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":879 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":880 + * stride = view.strides[dim] + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + * + * if index < 0: + */ + __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + goto __pyx_L4; + } + __pyx_L4:; + } + __pyx_L3:; + + /* "View.MemoryView":882 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":883 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":884 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":885 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "View.MemoryView":887 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":888 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":890 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":891 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":892 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + * + * return resultp + */ + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + goto __pyx_L8; + } + __pyx_L8:; + + /* "View.MemoryView":894 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":867 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":900 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":901 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":903 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * + */ + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; + + /* "View.MemoryView":904 + * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; + + /* "View.MemoryView":908 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":909 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":910 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":911 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":913 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_6 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_6) { + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "View.MemoryView":914 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "View.MemoryView":916 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":900 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":933 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":934 + * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + + /* "View.MemoryView":933 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":936 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":937 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":938 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":940 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_vtabptr_memoryview->convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":936 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":942 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":943 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":944 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":946 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * property base: + */ + __pyx_t_3 = __pyx_vtabptr_memoryview->assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":942 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":950 + * property base: + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":951 + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":950 + * property base: + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":957 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":966 + * cdef int i + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":967 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "View.MemoryView":972 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":974 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; + + /* "View.MemoryView":975 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":977 + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< + * result.typeinfo = memviewslice.memview.typeinfo + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":978 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":980 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":981 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":982 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":983 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":984 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":986 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":988 + * result.flags = PyBUF_RECORDS + * + * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< + * result.view.strides = result.from_slice.strides + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + + /* "View.MemoryView":989 + * + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * + */ + __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + + /* "View.MemoryView":990 + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":992 + * result.view.suboffsets = result.from_slice.suboffsets + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for i in range(ndim): + * result.view.len *= result.view.shape[i] + */ + __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_6; + + /* "View.MemoryView":993 + * + * result.view.len = result.view.itemsize + * for i in range(ndim): # <<<<<<<<<<<<<< + * result.view.len *= result.view.shape[i] + * + */ + __pyx_t_7 = __pyx_v_ndim; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":994 + * result.view.len = result.view.itemsize + * for i in range(ndim): + * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<< + * + * result.to_object_func = to_object_func + */ + __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i])); + } + + /* "View.MemoryView":996 + * result.view.len *= result.view.shape[i] + * + * result.to_object_func = to_object_func # <<<<<<<<<<<<<< + * result.to_dtype_func = to_dtype_func + * + */ + __pyx_v_result->to_object_func = __pyx_v_to_object_func; + + /* "View.MemoryView":997 + * + * result.to_object_func = to_object_func + * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; + + /* "View.MemoryView":999 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":957 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1002 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1005 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1006 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1007 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1009 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1010 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1002 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1013 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1017 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1018 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1019 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1021 + * suboffsets = memview.view.suboffsets + * + * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< + * dst.data = memview.view.buf + * + */ + __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + + /* "View.MemoryView":1022 + * + * dst.memview = <__pyx_memoryview *> memview + * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * + * for dim in range(memview.view.ndim): + */ + __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + + /* "View.MemoryView":1024 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1025 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1026 + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< + * if suboffsets == NULL: + * dst.suboffsets[dim] = -1 + */ + (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + + /* "View.MemoryView":1027 + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: # <<<<<<<<<<<<<< + * dst.suboffsets[dim] = -1 + * else: + */ + __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1028 + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: + * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[dim] = suboffsets[dim] + */ + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":1030 + * dst.suboffsets[dim] = -1 + * else: + * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object') + */ + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]); + } + __pyx_L5:; + } + + /* "View.MemoryView":1013 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1033 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1036 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1037 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1033 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1040 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1047 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1048 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1049 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1051 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1052 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1054 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1056 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1040 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1062 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1063 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1064 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1066 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1062 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1069 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1074 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1075 + * cdef int i + * cdef Py_ssize_t c_stride = 0 + * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_f_stride = 0; + + /* "View.MemoryView":1077 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1078 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1079 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1080 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1082 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1083 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1084 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1085 + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + */ + goto __pyx_L7_break; + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1087 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1088 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1090 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1069 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1093 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1100 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1101 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1102 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1103 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1105 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1106 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_1 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1107 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_3 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_3) { + __pyx_t_3 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_4 = (__pyx_t_3 != 0); + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (__pyx_t_2) { + + /* "View.MemoryView":1108 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":1110 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + __pyx_t_5 = __pyx_v_dst_extent; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1111 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1112 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1113 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1115 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + __pyx_t_5 = __pyx_v_dst_extent; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1116 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1120 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1121 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1093 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1123 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1126 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1123 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1130 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1133 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1135 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1136 + * + * for i in range(ndim): + * size *= src.shape[i] # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); + } + + /* "View.MemoryView":1138 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1130 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1141 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1150 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1151 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1152 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1153 + * for idx in range(ndim): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1155 + * stride = stride * shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1156 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1157 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1159 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1141 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1162 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1173 + * cdef void *result + * + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef size_t size = slice_get_size(src, ndim) + * + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1174 + * + * cdef size_t itemsize = src.memview.view.itemsize + * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + * + * result = malloc(size) + */ + __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + + /* "View.MemoryView":1176 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1177 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1178 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1181 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1182 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1183 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1184 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1185 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1; + } + + /* "View.MemoryView":1187 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1191 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1192 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1193 + * for i in range(ndim): + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + * + * if slice_is_contig(src, order, ndim): + */ + (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "View.MemoryView":1195 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1196 + * + * if slice_is_contig(src, order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + goto __pyx_L9; + } + /*else*/ { + + /* "View.MemoryView":1198 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1200 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1162 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1205 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1208 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1207 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1205 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1211 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1212 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyUnicode_Format(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1211 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1215 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1216 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1217 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "View.MemoryView":1219 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":1215 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1222 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1230 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1231 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1233 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1234 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1235 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1238 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1239 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + goto __pyx_L3; + } + + /* "View.MemoryView":1240 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1241 + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + * + * cdef int ndim = max(src_ndim, dst_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1243 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1245 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1246 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1247 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1248 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1249 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":1251 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L7:; + goto __pyx_L6; + } + __pyx_L6:; + + /* "View.MemoryView":1253 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1254 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "View.MemoryView":1256 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(&src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1258 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1259 + * + * if not slice_is_contig(&src, order, ndim): + * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + goto __pyx_L10; + } + __pyx_L10:; + + /* "View.MemoryView":1261 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1262 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":1264 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1267 + * + * + * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1268 + * + * if slice_is_contig(&src, 'C', ndim): + * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(&src, 'F', ndim): + * direct_copy = slice_is_contig(&dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim); + goto __pyx_L12; + } + + /* "View.MemoryView":1269 + * if slice_is_contig(&src, 'C', ndim): + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(&dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1270 + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): + * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim); + goto __pyx_L12; + } + __pyx_L12:; + + /* "View.MemoryView":1272 + * direct_copy = slice_is_contig(&dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1274 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1275 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1276 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1277 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1278 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "View.MemoryView":1280 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1283 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1284 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L14; + } + __pyx_L14:; + + /* "View.MemoryView":1286 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1287 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1288 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1290 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1291 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1222 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1294 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + + /* "View.MemoryView":1298 + * int ndim_other) nogil: + * cdef int i + * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + + /* "View.MemoryView":1300 + * cdef int offset = ndim_other - ndim + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1301 + * + * for i in range(ndim - 1, -1, -1): + * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<< + * slice.strides[i + offset] = slice.strides[i] + * slice.suboffsets[i + offset] = slice.suboffsets[i] + */ + (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]); + + /* "View.MemoryView":1302 + * for i in range(ndim - 1, -1, -1): + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<< + * slice.suboffsets[i + offset] = slice.suboffsets[i] + * + */ + (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]); + + /* "View.MemoryView":1303 + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] + * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1305 + * slice.suboffsets[i + offset] = slice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1306 + * + * for i in range(offset): + * slice.shape[i] = 1 # <<<<<<<<<<<<<< + * slice.strides[i] = slice.strides[0] + * slice.suboffsets[i] = -1 + */ + (__pyx_v_slice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1307 + * for i in range(offset): + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<< + * slice.suboffsets[i] = -1 + * + */ + (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]); + + /* "View.MemoryView":1308 + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] + * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1; + } + + /* "View.MemoryView":1294 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1316 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { + int __pyx_t_1; + + /* "View.MemoryView":1320 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1321 + * + * if dtype_is_object: + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< + * dst.strides, ndim, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1316 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + + /* function exit code */ +} + +/* "View.MemoryView":1325 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1328 + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1325 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1331 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1335 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1337 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1338 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":1340 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":1342 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1345 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1331 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1351 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1354 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1355 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1357 + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1351 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1365 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1366 + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] + * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_extent = (__pyx_v_shape[0]); + + /* "View.MemoryView":1368 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1369 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1370 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1371 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1373 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1374 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1376 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +static PyObject *__pyx_tp_new_6pandas_5algos_Node(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_5algos_Node *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5algos_Node *)o); + p->next = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->width = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5algos_Node(PyObject *o) { + struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_Node *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->next); + Py_CLEAR(p->width); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_5algos_Node(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_Node *)o; + if (p->next) { + e = (*v)(p->next, a); if (e) return e; + } + if (p->width) { + e = (*v)(p->width, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5algos_Node(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_Node *)o; + tmp = ((PyObject*)p->next); + p->next = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->width); + p->width = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_5algos_4Node_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5algos_4Node_5value_1__get__(o); +} + +static int __pyx_setprop_6pandas_5algos_4Node_value(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_5algos_4Node_5value_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_5algos_4Node_next(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5algos_4Node_4next_1__get__(o); +} + +static int __pyx_setprop_6pandas_5algos_4Node_next(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_5algos_4Node_4next_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_5algos_4Node_4next_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_5algos_4Node_width(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5algos_4Node_5width_1__get__(o); +} + +static int __pyx_setprop_6pandas_5algos_4Node_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_5algos_4Node_5width_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_5algos_4Node_5width_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_5algos_Node[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_5algos_Node[] = { + {(char *)"value", __pyx_getprop_6pandas_5algos_4Node_value, __pyx_setprop_6pandas_5algos_4Node_value, 0, 0}, + {(char *)"next", __pyx_getprop_6pandas_5algos_4Node_next, __pyx_setprop_6pandas_5algos_4Node_next, 0, 0}, + {(char *)"width", __pyx_getprop_6pandas_5algos_4Node_width, __pyx_setprop_6pandas_5algos_4Node_width, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5algos_Node = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.Node"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5algos_Node), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5algos_Node, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5algos_Node, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5algos_Node, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5algos_Node, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_5algos_Node, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_5algos_4Node_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5algos_Node, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist __pyx_vtable_6pandas_5algos_IndexableSkiplist; + +static PyObject *__pyx_tp_new_6pandas_5algos_IndexableSkiplist(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_5algos_IndexableSkiplist; + p->head = ((struct __pyx_obj_6pandas_5algos_Node *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5algos_IndexableSkiplist(PyObject *o) { + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->head); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_5algos_IndexableSkiplist(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o; + if (p->head) { + e = (*v)(((PyObject*)p->head), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5algos_IndexableSkiplist(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o; + tmp = ((PyObject*)p->head); + p->head = ((struct __pyx_obj_6pandas_5algos_Node *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +static PyObject *__pyx_sq_item_6pandas_5algos_IndexableSkiplist(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static PyMethodDef __pyx_methods_6pandas_5algos_IndexableSkiplist[] = { + {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("remove"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_IndexableSkiplist = { + __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_6pandas_5algos_IndexableSkiplist, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_IndexableSkiplist = { + __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__, /*mp_length*/ + __pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_5algos_IndexableSkiplist = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.IndexableSkiplist"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5algos_IndexableSkiplist), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5algos_IndexableSkiplist, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_IndexableSkiplist, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_IndexableSkiplist, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Sorted collection supporting O(lg n) insertion, removal, and\n lookup by rank.\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_5algos_IndexableSkiplist, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5algos_IndexableSkiplist, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5algos_IndexableSkiplist, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_5algos_17IndexableSkiplist_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5algos_IndexableSkiplist, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_array___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return get_memview(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_array_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.array"), /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.Enum"), /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryview___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_transpose(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview__get__base(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_shape(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_strides(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_suboffsets(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_ndim(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_itemsize(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_nbytes(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_size(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.memoryview"), /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryviewslice___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryviewslice__get__base(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos._memoryviewslice"), /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Internal class for passing memoryview slices to Python"), /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("ensure_platform_int"), (PyCFunction)__pyx_pw_6pandas_5algos_87ensure_platform_int, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_89ensure_float64, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_91ensure_float32, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_93ensure_int8, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_95ensure_int16, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_97ensure_int32, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_99ensure_int64, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_object"), (PyCFunction)__pyx_pw_6pandas_5algos_101ensure_object, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_indices_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_103map_indices_float64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_102map_indices_float64)}, + {__Pyx_NAMESTR("map_indices_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_105map_indices_float32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_104map_indices_float32)}, + {__Pyx_NAMESTR("map_indices_object"), (PyCFunction)__pyx_pw_6pandas_5algos_107map_indices_object, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_106map_indices_object)}, + {__Pyx_NAMESTR("map_indices_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_109map_indices_int32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_108map_indices_int32)}, + {__Pyx_NAMESTR("map_indices_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_111map_indices_int64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_110map_indices_int64)}, + {__Pyx_NAMESTR("map_indices_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_113map_indices_bool, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_112map_indices_bool)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("algos"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_at_least_d_arguments, __pyx_k_Expected_at_least_d_arguments, sizeof(__pyx_k_Expected_at_least_d_arguments), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_n_s_Infinity, __pyx_k_Infinity, sizeof(__pyx_k_Infinity), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_k_Invalid_min_periods_size_d_great, sizeof(__pyx_k_Invalid_min_periods_size_d_great), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_window_size_d, __pyx_k_Invalid_window_size_d, sizeof(__pyx_k_Invalid_window_size_d), 0, 0, 1, 0}, + {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_kp_s_Limit_must_be_non_negative, __pyx_k_Limit_must_be_non_negative, sizeof(__pyx_k_Limit_must_be_non_negative), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 1, 1}, + {&__pyx_n_s_NIL, __pyx_k_NIL, sizeof(__pyx_k_NIL), 0, 0, 1, 1}, + {&__pyx_n_s_NINF, __pyx_k_NINF, sizeof(__pyx_k_NINF), 0, 0, 1, 1}, + {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1}, + {&__pyx_n_s_NegInfinity, __pyx_k_NegInfinity, sizeof(__pyx_k_NegInfinity), 0, 0, 1, 1}, + {&__pyx_kp_s_No_matching_signature_found, __pyx_k_No_matching_signature_found, sizeof(__pyx_k_No_matching_signature_found), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_kp_s_Not_Found, __pyx_k_Not_Found, sizeof(__pyx_k_Not_Found), 0, 0, 1, 0}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_array_must_have_4_columns, __pyx_k_Output_array_must_have_4_columns, sizeof(__pyx_k_Output_array_must_have_4_columns), 0, 0, 1, 0}, + {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 0}, + {&__pyx_kp_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_adj, __pyx_k_adj, sizeof(__pyx_k_adj), 0, 0, 1, 1}, + {&__pyx_n_s_adjust, __pyx_k_adjust, sizeof(__pyx_k_adjust), 0, 0, 1, 1}, + {&__pyx_n_s_ai, __pyx_k_ai, sizeof(__pyx_k_ai), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_aold, __pyx_k_aold, sizeof(__pyx_k_aold), 0, 0, 1, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, + {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, + {&__pyx_n_s_argsorted, __pyx_k_argsorted, sizeof(__pyx_k_argsorted), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_bool, __pyx_k_arrmap_bool, sizeof(__pyx_k_arrmap_bool), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_float32, __pyx_k_arrmap_float32, sizeof(__pyx_k_arrmap_float32), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_float64, __pyx_k_arrmap_float64, sizeof(__pyx_k_arrmap_float64), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_int32, __pyx_k_arrmap_int32, sizeof(__pyx_k_arrmap_int32), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_int64, __pyx_k_arrmap_int64, sizeof(__pyx_k_arrmap_int64), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_object, __pyx_k_arrmap_object, sizeof(__pyx_k_arrmap_object), 0, 0, 1, 1}, + {&__pyx_n_s_as, __pyx_k_as, sizeof(__pyx_k_as), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, + {&__pyx_n_s_ascending, __pyx_k_ascending, sizeof(__pyx_k_ascending), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_average, __pyx_k_average, sizeof(__pyx_k_average), 0, 0, 1, 1}, + {&__pyx_n_s_avg, __pyx_k_avg, sizeof(__pyx_k_avg), 0, 0, 1, 1}, + {&__pyx_n_s_avg_wgt, __pyx_k_avg_wgt, sizeof(__pyx_k_avg_wgt), 0, 0, 1, 1}, + {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_bool, __pyx_k_backfill_2d_inplace_bool, sizeof(__pyx_k_backfill_2d_inplace_bool), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_float32, __pyx_k_backfill_2d_inplace_float32, sizeof(__pyx_k_backfill_2d_inplace_float32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_float64, __pyx_k_backfill_2d_inplace_float64, sizeof(__pyx_k_backfill_2d_inplace_float64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_int32, __pyx_k_backfill_2d_inplace_int32, sizeof(__pyx_k_backfill_2d_inplace_int32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_int64, __pyx_k_backfill_2d_inplace_int64, sizeof(__pyx_k_backfill_2d_inplace_int64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_object, __pyx_k_backfill_2d_inplace_object, sizeof(__pyx_k_backfill_2d_inplace_object), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_bool, __pyx_k_backfill_bool, sizeof(__pyx_k_backfill_bool), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_float32, __pyx_k_backfill_float32, sizeof(__pyx_k_backfill_float32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_float64, __pyx_k_backfill_float64, sizeof(__pyx_k_backfill_float64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_bool, __pyx_k_backfill_inplace_bool, sizeof(__pyx_k_backfill_inplace_bool), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_float32, __pyx_k_backfill_inplace_float32, sizeof(__pyx_k_backfill_inplace_float32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_float64, __pyx_k_backfill_inplace_float64, sizeof(__pyx_k_backfill_inplace_float64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_int32, __pyx_k_backfill_inplace_int32, sizeof(__pyx_k_backfill_inplace_int32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_int64, __pyx_k_backfill_inplace_int64, sizeof(__pyx_k_backfill_inplace_int64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_object, __pyx_k_backfill_inplace_object, sizeof(__pyx_k_backfill_inplace_object), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_int32, __pyx_k_backfill_int32, sizeof(__pyx_k_backfill_int32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_int64, __pyx_k_backfill_int64, sizeof(__pyx_k_backfill_int64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_object, __pyx_k_backfill_object, sizeof(__pyx_k_backfill_object), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_bins, __pyx_k_bins, sizeof(__pyx_k_bins), 0, 0, 1, 1}, + {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, + {&__pyx_n_s_bufarr, __pyx_k_bufarr, sizeof(__pyx_k_bufarr), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_c_contiguous, __pyx_k_c_contiguous, sizeof(__pyx_k_c_contiguous), 0, 0, 1, 1}, + {&__pyx_n_s_check_minp, __pyx_k_check_minp, sizeof(__pyx_k_check_minp), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cmp, __pyx_k_cmp, sizeof(__pyx_k_cmp), 0, 0, 1, 1}, + {&__pyx_n_s_com, __pyx_k_com, sizeof(__pyx_k_com), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1}, + {&__pyx_n_s_counts_2, __pyx_k_counts_2, sizeof(__pyx_k_counts_2), 0, 0, 1, 1}, + {&__pyx_n_s_cov, __pyx_k_cov, sizeof(__pyx_k_cov), 0, 0, 1, 1}, + {&__pyx_n_s_ct, __pyx_k_ct, sizeof(__pyx_k_ct), 0, 0, 1, 1}, + {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_ddof, __pyx_k_ddof, sizeof(__pyx_k_ddof), 0, 0, 1, 1}, + {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1}, + {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1}, + {&__pyx_n_s_dense, __pyx_k_dense, sizeof(__pyx_k_dense), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_float32, __pyx_k_diff_2d_float32, sizeof(__pyx_k_diff_2d_float32), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_float64, __pyx_k_diff_2d_float64, sizeof(__pyx_k_diff_2d_float64), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_int16, __pyx_k_diff_2d_int16, sizeof(__pyx_k_diff_2d_int16), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_int32, __pyx_k_diff_2d_int32, sizeof(__pyx_k_diff_2d_int32), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_int64, __pyx_k_diff_2d_int64, sizeof(__pyx_k_diff_2d_int64), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_int8, __pyx_k_diff_2d_int8, sizeof(__pyx_k_diff_2d_int8), 0, 0, 1, 1}, + {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1}, + {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, + {&__pyx_n_s_divisor, __pyx_k_divisor, sizeof(__pyx_k_divisor), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_dups, __pyx_k_dups, sizeof(__pyx_k_dups), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_empty_like, __pyx_k_empty_like, sizeof(__pyx_k_empty_like), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_ewma, __pyx_k_ewma, sizeof(__pyx_k_ewma), 0, 0, 1, 1}, + {&__pyx_n_s_expected_size, __pyx_k_expected_size, sizeof(__pyx_k_expected_size), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 1}, + {&__pyx_n_s_f_contiguous, __pyx_k_f_contiguous, sizeof(__pyx_k_f_contiguous), 0, 0, 1, 1}, + {&__pyx_n_s_ffill_by_group, __pyx_k_ffill_by_group, sizeof(__pyx_k_ffill_by_group), 0, 0, 1, 1}, + {&__pyx_n_s_ffill_indexer, __pyx_k_ffill_indexer, sizeof(__pyx_k_ffill_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, + {&__pyx_n_s_fill_count, __pyx_k_fill_count, sizeof(__pyx_k_fill_count), 0, 0, 1, 1}, + {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1}, + {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, + {&__pyx_kp_s_first_not_supported_for_non_nume, __pyx_k_first_not_supported_for_non_nume, sizeof(__pyx_k_first_not_supported_for_non_nume), 0, 0, 1, 0}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_float32_t, __pyx_k_float32_t, sizeof(__pyx_k_float32_t), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_float64_t, __pyx_k_float64_t, sizeof(__pyx_k_float64_t), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_full_outer_join, __pyx_k_full_outer_join, sizeof(__pyx_k_full_outer_join), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_fv, __pyx_k_fv, sizeof(__pyx_k_fv), 0, 0, 1, 1}, + {&__pyx_n_s_ge, __pyx_k_ge, sizeof(__pyx_k_ge), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_result_indexer, __pyx_k_get_result_indexer, sizeof(__pyx_k_get_result_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_gid, __pyx_k_gid, sizeof(__pyx_k_gid), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_got_first, __pyx_k_got_first, sizeof(__pyx_k_got_first), 0, 0, 1, 1}, + {&__pyx_n_s_group_add_bin_float32, __pyx_k_group_add_bin_float32, sizeof(__pyx_k_group_add_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_add_bin_float64, __pyx_k_group_add_bin_float64, sizeof(__pyx_k_group_add_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_add_float32, __pyx_k_group_add_float32, sizeof(__pyx_k_group_add_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_add_float64, __pyx_k_group_add_float64, sizeof(__pyx_k_group_add_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_bin_float32, __pyx_k_group_count_bin_float32, sizeof(__pyx_k_group_count_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_bin_float64, __pyx_k_group_count_bin_float64, sizeof(__pyx_k_group_count_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_bin_int64, __pyx_k_group_count_bin_int64, sizeof(__pyx_k_group_count_bin_int64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_bin_object, __pyx_k_group_count_bin_object, sizeof(__pyx_k_group_count_bin_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_float32, __pyx_k_group_count_float32, sizeof(__pyx_k_group_count_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_float64, __pyx_k_group_count_float64, sizeof(__pyx_k_group_count_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_int64, __pyx_k_group_count_int64, sizeof(__pyx_k_group_count_int64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_object, __pyx_k_group_count_object, sizeof(__pyx_k_group_count_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_ids, __pyx_k_group_ids, sizeof(__pyx_k_group_ids), 0, 0, 1, 1}, + {&__pyx_n_s_group_labels, __pyx_k_group_labels, sizeof(__pyx_k_group_labels), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_bin_float32, __pyx_k_group_last_bin_float32, sizeof(__pyx_k_group_last_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_bin_float64, __pyx_k_group_last_bin_float64, sizeof(__pyx_k_group_last_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_bin_object, __pyx_k_group_last_bin_object, sizeof(__pyx_k_group_last_bin_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_float32, __pyx_k_group_last_float32, sizeof(__pyx_k_group_last_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_float64, __pyx_k_group_last_float64, sizeof(__pyx_k_group_last_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_object, __pyx_k_group_last_object, sizeof(__pyx_k_group_last_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_max_bin_float32, __pyx_k_group_max_bin_float32, sizeof(__pyx_k_group_max_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_max_bin_float64, __pyx_k_group_max_bin_float64, sizeof(__pyx_k_group_max_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_max_float32, __pyx_k_group_max_float32, sizeof(__pyx_k_group_max_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_max_float64, __pyx_k_group_max_float64, sizeof(__pyx_k_group_max_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_mean_bin_float32, __pyx_k_group_mean_bin_float32, sizeof(__pyx_k_group_mean_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_mean_bin_float64, __pyx_k_group_mean_bin_float64, sizeof(__pyx_k_group_mean_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_mean_float32, __pyx_k_group_mean_float32, sizeof(__pyx_k_group_mean_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_mean_float64, __pyx_k_group_mean_float64, sizeof(__pyx_k_group_mean_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_median, __pyx_k_group_median, sizeof(__pyx_k_group_median), 0, 0, 1, 1}, + {&__pyx_n_s_group_min_bin_float32, __pyx_k_group_min_bin_float32, sizeof(__pyx_k_group_min_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_min_bin_float64, __pyx_k_group_min_bin_float64, sizeof(__pyx_k_group_min_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_min_float32, __pyx_k_group_min_float32, sizeof(__pyx_k_group_min_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_min_float64, __pyx_k_group_min_float64, sizeof(__pyx_k_group_min_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_bin_float32, __pyx_k_group_nth_bin_float32, sizeof(__pyx_k_group_nth_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_bin_float64, __pyx_k_group_nth_bin_float64, sizeof(__pyx_k_group_nth_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_bin_object, __pyx_k_group_nth_bin_object, sizeof(__pyx_k_group_nth_bin_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_float32, __pyx_k_group_nth_float32, sizeof(__pyx_k_group_nth_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_float64, __pyx_k_group_nth_float64, sizeof(__pyx_k_group_nth_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_object, __pyx_k_group_nth_object, sizeof(__pyx_k_group_nth_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_ohlc_float32, __pyx_k_group_ohlc_float32, sizeof(__pyx_k_group_ohlc_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_ohlc_float64, __pyx_k_group_ohlc_float64, sizeof(__pyx_k_group_ohlc_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_prod_bin_float32, __pyx_k_group_prod_bin_float32, sizeof(__pyx_k_group_prod_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_prod_bin_float64, __pyx_k_group_prod_bin_float64, sizeof(__pyx_k_group_prod_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_prod_float32, __pyx_k_group_prod_float32, sizeof(__pyx_k_group_prod_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_prod_float64, __pyx_k_group_prod_float64, sizeof(__pyx_k_group_prod_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_var_bin_float32, __pyx_k_group_var_bin_float32, sizeof(__pyx_k_group_var_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_var_bin_float64, __pyx_k_group_var_bin_float64, sizeof(__pyx_k_group_var_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_var_float32, __pyx_k_group_var_float32, sizeof(__pyx_k_group_var_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_var_float64, __pyx_k_group_var_float64, sizeof(__pyx_k_group_var_float64), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_bool, __pyx_k_groupby_bool, sizeof(__pyx_k_groupby_bool), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_float32, __pyx_k_groupby_float32, sizeof(__pyx_k_groupby_float32), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_float64, __pyx_k_groupby_float64, sizeof(__pyx_k_groupby_float64), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_indices, __pyx_k_groupby_indices, sizeof(__pyx_k_groupby_indices), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_int32, __pyx_k_groupby_int32, sizeof(__pyx_k_groupby_int32), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_int64, __pyx_k_groupby_int64, sizeof(__pyx_k_groupby_int64), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_object, __pyx_k_groupby_object, sizeof(__pyx_k_groupby_object), 0, 0, 1, 1}, + {&__pyx_n_s_groupsort_indexer, __pyx_k_groupsort_indexer, sizeof(__pyx_k_groupsort_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_gt, __pyx_k_gt, sizeof(__pyx_k_gt), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i0, __pyx_k_i0, sizeof(__pyx_k_i0), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_ids, __pyx_k_ids, sizeof(__pyx_k_ids), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_idx0, __pyx_k_idx0, sizeof(__pyx_k_idx0), 0, 0, 1, 1}, + {&__pyx_n_s_idx1, __pyx_k_idx1, sizeof(__pyx_k_idx1), 0, 0, 1, 1}, + {&__pyx_n_s_iinfo, __pyx_k_iinfo, sizeof(__pyx_k_iinfo), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_in_arr, __pyx_k_in_arr, sizeof(__pyx_k_in_arr), 0, 0, 1, 1}, + {&__pyx_n_s_in_i, __pyx_k_in_i, sizeof(__pyx_k_in_i), 0, 0, 1, 1}, + {&__pyx_n_s_in_k, __pyx_k_in_k, sizeof(__pyx_k_in_k), 0, 0, 1, 1}, + {&__pyx_n_s_in_n, __pyx_k_in_n, sizeof(__pyx_k_in_n), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_indexer, __pyx_k_indexer, sizeof(__pyx_k_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_infs, __pyx_k_infs, sizeof(__pyx_k_infs), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join, __pyx_k_inner_join, sizeof(__pyx_k_inner_join), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_float32, __pyx_k_inner_join_indexer_float32, sizeof(__pyx_k_inner_join_indexer_float32), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_float64, __pyx_k_inner_join_indexer_float64, sizeof(__pyx_k_inner_join_indexer_float64), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_int32, __pyx_k_inner_join_indexer_int32, sizeof(__pyx_k_inner_join_indexer_int32), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_int64, __pyx_k_inner_join_indexer_int64, sizeof(__pyx_k_inner_join_indexer_int64), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_object, __pyx_k_inner_join_indexer_object, sizeof(__pyx_k_inner_join_indexer_object), 0, 0, 1, 1}, + {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1}, + {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1}, + {&__pyx_n_s_int16_t, __pyx_k_int16_t, sizeof(__pyx_k_int16_t), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int32_t, __pyx_k_int32_t, sizeof(__pyx_k_int32_t), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int64_t, __pyx_k_int64_t, sizeof(__pyx_k_int64_t), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_int8_t, __pyx_k_int8_t, sizeof(__pyx_k_int8_t), 0, 0, 1, 1}, + {&__pyx_n_s_is_lexsorted, __pyx_k_is_lexsorted, sizeof(__pyx_k_is_lexsorted), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_bool, __pyx_k_is_monotonic_bool, sizeof(__pyx_k_is_monotonic_bool), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_float32, __pyx_k_is_monotonic_float32, sizeof(__pyx_k_is_monotonic_float32), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_float64, __pyx_k_is_monotonic_float64, sizeof(__pyx_k_is_monotonic_float64), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_int32, __pyx_k_is_monotonic_int32, sizeof(__pyx_k_is_monotonic_int32), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_int64, __pyx_k_is_monotonic_int64, sizeof(__pyx_k_is_monotonic_int64), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_object, __pyx_k_is_monotonic_object, sizeof(__pyx_k_is_monotonic_object), 0, 0, 1, 1}, + {&__pyx_n_s_is_unique, __pyx_k_is_unique, sizeof(__pyx_k_is_unique), 0, 0, 1, 1}, + {&__pyx_n_s_isfinite, __pyx_k_isfinite, sizeof(__pyx_k_isfinite), 0, 0, 1, 1}, + {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj, __pyx_k_isnullobj, sizeof(__pyx_k_isnullobj), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj2d, __pyx_k_isnullobj2d, sizeof(__pyx_k_isnullobj2d), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_keep, __pyx_k_keep, sizeof(__pyx_k_keep), 0, 0, 1, 1}, + {&__pyx_n_s_keep_na, __pyx_k_keep_na, sizeof(__pyx_k_keep_na), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, + {&__pyx_n_s_kth_smallest, __pyx_k_kth_smallest, sizeof(__pyx_k_kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lab, __pyx_k_lab, sizeof(__pyx_k_lab), 0, 0, 1, 1}, + {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, + {&__pyx_n_s_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, + {&__pyx_n_s_last_obs, __pyx_k_last_obs, sizeof(__pyx_k_last_obs), 0, 0, 1, 1}, + {&__pyx_n_s_lc, __pyx_k_lc, sizeof(__pyx_k_lc), 0, 0, 1, 1}, + {&__pyx_n_s_le, __pyx_k_le, sizeof(__pyx_k_le), 0, 0, 1, 1}, + {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, + {&__pyx_n_s_left_count, __pyx_k_left_count, sizeof(__pyx_k_left_count), 0, 0, 1, 1}, + {&__pyx_n_s_left_indexer, __pyx_k_left_indexer, sizeof(__pyx_k_left_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_float32, __pyx_k_left_join_indexer_float32, sizeof(__pyx_k_left_join_indexer_float32), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_float64, __pyx_k_left_join_indexer_float64, sizeof(__pyx_k_left_join_indexer_float64), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_int32, __pyx_k_left_join_indexer_int32, sizeof(__pyx_k_left_join_indexer_int32), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_int64, __pyx_k_left_join_indexer_int64, sizeof(__pyx_k_left_join_indexer_int64), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_object, __pyx_k_left_join_indexer_object, sizeof(__pyx_k_left_join_indexer_object), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_float32, __pyx_k_left_join_indexer_unique_float32, sizeof(__pyx_k_left_join_indexer_unique_float32), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_float64, __pyx_k_left_join_indexer_unique_float64, sizeof(__pyx_k_left_join_indexer_unique_float64), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_int32, __pyx_k_left_join_indexer_unique_int32, sizeof(__pyx_k_left_join_indexer_unique_int32), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_int64, __pyx_k_left_join_indexer_unique_int64, sizeof(__pyx_k_left_join_indexer_unique_int64), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_object, __pyx_k_left_join_indexer_unique_object, sizeof(__pyx_k_left_join_indexer_unique_object), 0, 0, 1, 1}, + {&__pyx_n_s_left_outer_join, __pyx_k_left_outer_join, sizeof(__pyx_k_left_outer_join), 0, 0, 1, 1}, + {&__pyx_n_s_left_pos, __pyx_k_left_pos, sizeof(__pyx_k_left_pos), 0, 0, 1, 1}, + {&__pyx_n_s_left_sorter, __pyx_k_left_sorter, sizeof(__pyx_k_left_sorter), 0, 0, 1, 1}, + {&__pyx_kp_s_len_index_len_labels, __pyx_k_len_index_len_labels, sizeof(__pyx_k_len_index_len_labels), 0, 0, 1, 0}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1}, + {&__pyx_n_s_lim, __pyx_k_lim, sizeof(__pyx_k_lim), 0, 0, 1, 1}, + {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1}, + {&__pyx_n_s_lindexer, __pyx_k_lindexer, sizeof(__pyx_k_lindexer), 0, 0, 1, 1}, + {&__pyx_n_s_list_of_arrays, __pyx_k_list_of_arrays, sizeof(__pyx_k_list_of_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1}, + {&__pyx_n_s_lt, __pyx_k_lt, sizeof(__pyx_k_lt), 0, 0, 1, 1}, + {&__pyx_n_s_lval, __pyx_k_lval, sizeof(__pyx_k_lval), 0, 0, 1, 1}, + {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_maskedx, __pyx_k_maskedx, sizeof(__pyx_k_maskedx), 0, 0, 1, 1}, + {&__pyx_n_s_maskedy, __pyx_k_maskedy, sizeof(__pyx_k_maskedy), 0, 0, 1, 1}, + {&__pyx_n_s_mat, __pyx_k_mat, sizeof(__pyx_k_mat), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_max_group, __pyx_k_max_group, sizeof(__pyx_k_max_group), 0, 0, 1, 1}, + {&__pyx_n_s_max_groups, __pyx_k_max_groups, sizeof(__pyx_k_max_groups), 0, 0, 1, 1}, + {&__pyx_n_s_max_subseq, __pyx_k_max_subseq, sizeof(__pyx_k_max_subseq), 0, 0, 1, 1}, + {&__pyx_n_s_maxx, __pyx_k_maxx, sizeof(__pyx_k_maxx), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_objects, __pyx_k_maybe_convert_objects, sizeof(__pyx_k_maybe_convert_objects), 0, 0, 1, 1}, + {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1}, + {&__pyx_n_s_mean_x, __pyx_k_mean_x, sizeof(__pyx_k_mean_x), 0, 0, 1, 1}, + {&__pyx_n_s_meanx, __pyx_k_meanx, sizeof(__pyx_k_meanx), 0, 0, 1, 1}, + {&__pyx_n_s_meany, __pyx_k_meany, sizeof(__pyx_k_meany), 0, 0, 1, 1}, + {&__pyx_n_s_median, __pyx_k_median, sizeof(__pyx_k_median), 0, 0, 1, 1}, + {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mergesort, __pyx_k_mergesort, sizeof(__pyx_k_mergesort), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, + {&__pyx_n_s_midpoint, __pyx_k_midpoint, sizeof(__pyx_k_midpoint), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_kp_s_min_periods_d_must_be_window_d, __pyx_k_min_periods_d_must_be_window_d, sizeof(__pyx_k_min_periods_d_must_be_window_d), 0, 0, 1, 0}, + {&__pyx_kp_s_min_periods_must_be_0, __pyx_k_min_periods_must_be_0, sizeof(__pyx_k_min_periods_must_be_0), 0, 0, 1, 0}, + {&__pyx_n_s_min_subseq, __pyx_k_min_subseq, sizeof(__pyx_k_min_subseq), 0, 0, 1, 1}, + {&__pyx_n_s_minp, __pyx_k_minp, sizeof(__pyx_k_minp), 0, 0, 1, 1}, + {&__pyx_n_s_minpair, __pyx_k_minpair, sizeof(__pyx_k_minpair), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_minx, __pyx_k_minx, sizeof(__pyx_k_minx), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_n0, __pyx_k_n0, sizeof(__pyx_k_n0), 0, 0, 1, 1}, + {&__pyx_n_s_na_option, __pyx_k_na_option, sizeof(__pyx_k_na_option), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_n_s_nan_value, __pyx_k_nan_value, sizeof(__pyx_k_nan_value), 0, 0, 1, 1}, + {&__pyx_n_s_nancorr, __pyx_k_nancorr, sizeof(__pyx_k_nancorr), 0, 0, 1, 1}, + {&__pyx_n_s_nancorr_spearman, __pyx_k_nancorr_spearman, sizeof(__pyx_k_nancorr_spearman), 0, 0, 1, 1}, + {&__pyx_n_s_nbins, __pyx_k_nbins, sizeof(__pyx_k_nbins), 0, 0, 1, 1}, + {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, + {&__pyx_n_s_neg_ct, __pyx_k_neg_ct, sizeof(__pyx_k_neg_ct), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_neww, __pyx_k_neww, sizeof(__pyx_k_neww), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_ngroups, __pyx_k_ngroups, sizeof(__pyx_k_ngroups), 0, 0, 1, 1}, + {&__pyx_n_s_nleft, __pyx_k_nleft, sizeof(__pyx_k_nleft), 0, 0, 1, 1}, + {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1}, + {&__pyx_n_s_nobs, __pyx_k_nobs, sizeof(__pyx_k_nobs), 0, 0, 1, 1}, + {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_nright, __pyx_k_nright, sizeof(__pyx_k_nright), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1}, + {&__pyx_n_s_oldbuf, __pyx_k_oldbuf, sizeof(__pyx_k_oldbuf), 0, 0, 1, 1}, + {&__pyx_n_s_oldw, __pyx_k_oldw, sizeof(__pyx_k_oldw), 0, 0, 1, 1}, + {&__pyx_n_s_ones_like, __pyx_k_ones_like, sizeof(__pyx_k_ones_like), 0, 0, 1, 1}, + {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_float32, __pyx_k_outer_join_indexer_float32, sizeof(__pyx_k_outer_join_indexer_float32), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_float64, __pyx_k_outer_join_indexer_float64, sizeof(__pyx_k_outer_join_indexer_float64), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_int32, __pyx_k_outer_join_indexer_int32, sizeof(__pyx_k_outer_join_indexer_int32), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_int64, __pyx_k_outer_join_indexer_int64, sizeof(__pyx_k_outer_join_indexer_int64), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_object, __pyx_k_outer_join_indexer_object, sizeof(__pyx_k_outer_join_indexer_object), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_bool, __pyx_k_pad_2d_inplace_bool, sizeof(__pyx_k_pad_2d_inplace_bool), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_float32, __pyx_k_pad_2d_inplace_float32, sizeof(__pyx_k_pad_2d_inplace_float32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_float64, __pyx_k_pad_2d_inplace_float64, sizeof(__pyx_k_pad_2d_inplace_float64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_int32, __pyx_k_pad_2d_inplace_int32, sizeof(__pyx_k_pad_2d_inplace_int32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_int64, __pyx_k_pad_2d_inplace_int64, sizeof(__pyx_k_pad_2d_inplace_int64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_object, __pyx_k_pad_2d_inplace_object, sizeof(__pyx_k_pad_2d_inplace_object), 0, 0, 1, 1}, + {&__pyx_n_s_pad_bool, __pyx_k_pad_bool, sizeof(__pyx_k_pad_bool), 0, 0, 1, 1}, + {&__pyx_n_s_pad_float32, __pyx_k_pad_float32, sizeof(__pyx_k_pad_float32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_float64, __pyx_k_pad_float64, sizeof(__pyx_k_pad_float64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_bool, __pyx_k_pad_inplace_bool, sizeof(__pyx_k_pad_inplace_bool), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_float32, __pyx_k_pad_inplace_float32, sizeof(__pyx_k_pad_inplace_float32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_float64, __pyx_k_pad_inplace_float64, sizeof(__pyx_k_pad_inplace_float64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_int32, __pyx_k_pad_inplace_int32, sizeof(__pyx_k_pad_inplace_int32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_int64, __pyx_k_pad_inplace_int64, sizeof(__pyx_k_pad_inplace_int64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_object, __pyx_k_pad_inplace_object, sizeof(__pyx_k_pad_inplace_object), 0, 0, 1, 1}, + {&__pyx_n_s_pad_int32, __pyx_k_pad_int32, sizeof(__pyx_k_pad_int32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_int64, __pyx_k_pad_int64, sizeof(__pyx_k_pad_int64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_object, __pyx_k_pad_object, sizeof(__pyx_k_pad_object), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_algos, __pyx_k_pandas_algos, sizeof(__pyx_k_pandas_algos), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_lib, __pyx_k_pandas_lib, sizeof(__pyx_k_pandas_lib), 0, 0, 1, 1}, + {&__pyx_kp_s_pandas_src_generated_pyx, __pyx_k_pandas_src_generated_pyx, sizeof(__pyx_k_pandas_src_generated_pyx), 0, 0, 1, 0}, + {&__pyx_kp_s_pandas_src_join_pyx, __pyx_k_pandas_src_join_pyx, sizeof(__pyx_k_pandas_src_join_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_pct, __pyx_k_pct, sizeof(__pyx_k_pct), 0, 0, 1, 1}, + {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1}, + {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1}, + {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_prev, __pyx_k_prev, sizeof(__pyx_k_prev), 0, 0, 1, 1}, + {&__pyx_n_s_prodx, __pyx_k_prodx, sizeof(__pyx_k_prodx), 0, 0, 1, 1}, + {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_putmask, __pyx_k_putmask, sizeof(__pyx_k_putmask), 0, 0, 1, 1}, + {&__pyx_n_s_pydatetime, __pyx_k_pydatetime, sizeof(__pyx_k_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_0kth_smallest, __pyx_k_pyx_fuse_0kth_smallest, sizeof(__pyx_k_pyx_fuse_0kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_0median, __pyx_k_pyx_fuse_0median, sizeof(__pyx_k_pyx_fuse_0median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_1kth_smallest, __pyx_k_pyx_fuse_1kth_smallest, sizeof(__pyx_k_pyx_fuse_1kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_1median, __pyx_k_pyx_fuse_1median, sizeof(__pyx_k_pyx_fuse_1median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_2kth_smallest, __pyx_k_pyx_fuse_2kth_smallest, sizeof(__pyx_k_pyx_fuse_2kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_2median, __pyx_k_pyx_fuse_2median, sizeof(__pyx_k_pyx_fuse_2median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_3kth_smallest, __pyx_k_pyx_fuse_3kth_smallest, sizeof(__pyx_k_pyx_fuse_3kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_3median, __pyx_k_pyx_fuse_3median, sizeof(__pyx_k_pyx_fuse_3median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_4kth_smallest, __pyx_k_pyx_fuse_4kth_smallest, sizeof(__pyx_k_pyx_fuse_4kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_4median, __pyx_k_pyx_fuse_4median, sizeof(__pyx_k_pyx_fuse_4median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_5kth_smallest, __pyx_k_pyx_fuse_5kth_smallest, sizeof(__pyx_k_pyx_fuse_5kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_5median, __pyx_k_pyx_fuse_5median, sizeof(__pyx_k_pyx_fuse_5median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_6kth_smallest, __pyx_k_pyx_fuse_6kth_smallest, sizeof(__pyx_k_pyx_fuse_6kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_6median, __pyx_k_pyx_fuse_6median, sizeof(__pyx_k_pyx_fuse_6median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_7kth_smallest, __pyx_k_pyx_fuse_7kth_smallest, sizeof(__pyx_k_pyx_fuse_7kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_7median, __pyx_k_pyx_fuse_7median, sizeof(__pyx_k_pyx_fuse_7median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_8kth_smallest, __pyx_k_pyx_fuse_8kth_smallest, sizeof(__pyx_k_pyx_fuse_8kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_8median, __pyx_k_pyx_fuse_8median, sizeof(__pyx_k_pyx_fuse_8median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_9kth_smallest, __pyx_k_pyx_fuse_9kth_smallest, sizeof(__pyx_k_pyx_fuse_9kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_9median, __pyx_k_pyx_fuse_9median, sizeof(__pyx_k_pyx_fuse_9median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_quantile, __pyx_k_quantile, sizeof(__pyx_k_quantile), 0, 0, 1, 1}, + {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1}, + {&__pyx_n_s_rank_1d_float64, __pyx_k_rank_1d_float64, sizeof(__pyx_k_rank_1d_float64), 0, 0, 1, 1}, + {&__pyx_n_s_rank_1d_generic, __pyx_k_rank_1d_generic, sizeof(__pyx_k_rank_1d_generic), 0, 0, 1, 1}, + {&__pyx_n_s_rank_1d_int64, __pyx_k_rank_1d_int64, sizeof(__pyx_k_rank_1d_int64), 0, 0, 1, 1}, + {&__pyx_n_s_rank_2d_float64, __pyx_k_rank_2d_float64, sizeof(__pyx_k_rank_2d_float64), 0, 0, 1, 1}, + {&__pyx_n_s_rank_2d_generic, __pyx_k_rank_2d_generic, sizeof(__pyx_k_rank_2d_generic), 0, 0, 1, 1}, + {&__pyx_n_s_rank_2d_int64, __pyx_k_rank_2d_int64, sizeof(__pyx_k_rank_2d_int64), 0, 0, 1, 1}, + {&__pyx_n_s_ranks, __pyx_k_ranks, sizeof(__pyx_k_ranks), 0, 0, 1, 1}, + {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1}, + {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, + {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_resx, __pyx_k_resx, sizeof(__pyx_k_resx), 0, 0, 1, 1}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_retry, __pyx_k_retry, sizeof(__pyx_k_retry), 0, 0, 1, 1}, + {&__pyx_n_s_return_false, __pyx_k_return_false, sizeof(__pyx_k_return_false), 0, 0, 1, 1}, + {&__pyx_n_s_return_true, __pyx_k_return_true, sizeof(__pyx_k_return_true), 0, 0, 1, 1}, + {&__pyx_n_s_rev, __pyx_k_rev, sizeof(__pyx_k_rev), 0, 0, 1, 1}, + {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_right_count, __pyx_k_right_count, sizeof(__pyx_k_right_count), 0, 0, 1, 1}, + {&__pyx_n_s_right_indexer, __pyx_k_right_indexer, sizeof(__pyx_k_right_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_right_pos, __pyx_k_right_pos, sizeof(__pyx_k_right_pos), 0, 0, 1, 1}, + {&__pyx_n_s_right_sorter, __pyx_k_right_sorter, sizeof(__pyx_k_right_sorter), 0, 0, 1, 1}, + {&__pyx_n_s_rindexer, __pyx_k_rindexer, sizeof(__pyx_k_rindexer), 0, 0, 1, 1}, + {&__pyx_n_s_ring, __pyx_k_ring, sizeof(__pyx_k_ring), 0, 0, 1, 1}, + {&__pyx_n_s_roll_generic, __pyx_k_roll_generic, sizeof(__pyx_k_roll_generic), 0, 0, 1, 1}, + {&__pyx_n_s_roll_kurt, __pyx_k_roll_kurt, sizeof(__pyx_k_roll_kurt), 0, 0, 1, 1}, + {&__pyx_n_s_roll_max, __pyx_k_roll_max, sizeof(__pyx_k_roll_max), 0, 0, 1, 1}, + {&__pyx_n_s_roll_max2, __pyx_k_roll_max2, sizeof(__pyx_k_roll_max2), 0, 0, 1, 1}, + {&__pyx_n_s_roll_mean, __pyx_k_roll_mean, sizeof(__pyx_k_roll_mean), 0, 0, 1, 1}, + {&__pyx_n_s_roll_median_c, __pyx_k_roll_median_c, sizeof(__pyx_k_roll_median_c), 0, 0, 1, 1}, + {&__pyx_n_s_roll_median_cython, __pyx_k_roll_median_cython, sizeof(__pyx_k_roll_median_cython), 0, 0, 1, 1}, + {&__pyx_n_s_roll_min, __pyx_k_roll_min, sizeof(__pyx_k_roll_min), 0, 0, 1, 1}, + {&__pyx_n_s_roll_min2, __pyx_k_roll_min2, sizeof(__pyx_k_roll_min2), 0, 0, 1, 1}, + {&__pyx_n_s_roll_quantile, __pyx_k_roll_quantile, sizeof(__pyx_k_roll_quantile), 0, 0, 1, 1}, + {&__pyx_n_s_roll_skew, __pyx_k_roll_skew, sizeof(__pyx_k_roll_skew), 0, 0, 1, 1}, + {&__pyx_n_s_roll_sum, __pyx_k_roll_sum, sizeof(__pyx_k_roll_sum), 0, 0, 1, 1}, + {&__pyx_n_s_roll_var, __pyx_k_roll_var, sizeof(__pyx_k_roll_var), 0, 0, 1, 1}, + {&__pyx_n_s_roll_window, __pyx_k_roll_window, sizeof(__pyx_k_roll_window), 0, 0, 1, 1}, + {&__pyx_n_s_rval, __pyx_k_rval, sizeof(__pyx_k_rval), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_skiplist, __pyx_k_skiplist, sizeof(__pyx_k_skiplist), 0, 0, 1, 1}, + {&__pyx_n_s_sl, __pyx_k_sl, sizeof(__pyx_k_sl), 0, 0, 1, 1}, + {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, + {&__pyx_n_s_sorted_data, __pyx_k_sorted_data, sizeof(__pyx_k_sorted_data), 0, 0, 1, 1}, + {&__pyx_n_s_sorter, __pyx_k_sorter, sizeof(__pyx_k_sorter), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_ssqdm_x, __pyx_k_ssqdm_x, sizeof(__pyx_k_ssqdm_x), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_sum_ranks, __pyx_k_sum_ranks, sizeof(__pyx_k_sum_ranks), 0, 0, 1, 1}, + {&__pyx_n_s_sum_x, __pyx_k_sum_x, sizeof(__pyx_k_sum_x), 0, 0, 1, 1}, + {&__pyx_n_s_sumx, __pyx_k_sumx, sizeof(__pyx_k_sumx), 0, 0, 1, 1}, + {&__pyx_n_s_sumxx, __pyx_k_sumxx, sizeof(__pyx_k_sumxx), 0, 0, 1, 1}, + {&__pyx_n_s_sumy, __pyx_k_sumy, sizeof(__pyx_k_sumy), 0, 0, 1, 1}, + {&__pyx_n_s_sumyy, __pyx_k_sumyy, sizeof(__pyx_k_sumyy), 0, 0, 1, 1}, + {&__pyx_n_s_sx, __pyx_k_sx, sizeof(__pyx_k_sx), 0, 0, 1, 1}, + {&__pyx_n_s_sy, __pyx_k_sy, sizeof(__pyx_k_sy), 0, 0, 1, 1}, + {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_bool_bool, __pyx_k_take_1d_bool_bool, sizeof(__pyx_k_take_1d_bool_bool), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_bool_object, __pyx_k_take_1d_bool_object, sizeof(__pyx_k_take_1d_bool_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_float32_float32, __pyx_k_take_1d_float32_float32, sizeof(__pyx_k_take_1d_float32_float32), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_float32_float64, __pyx_k_take_1d_float32_float64, sizeof(__pyx_k_take_1d_float32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_float64_float64, __pyx_k_take_1d_float64_float64, sizeof(__pyx_k_take_1d_float64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int16_float64, __pyx_k_take_1d_int16_float64, sizeof(__pyx_k_take_1d_int16_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int16_int16, __pyx_k_take_1d_int16_int16, sizeof(__pyx_k_take_1d_int16_int16), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int16_int32, __pyx_k_take_1d_int16_int32, sizeof(__pyx_k_take_1d_int16_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int16_int64, __pyx_k_take_1d_int16_int64, sizeof(__pyx_k_take_1d_int16_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int32_float64, __pyx_k_take_1d_int32_float64, sizeof(__pyx_k_take_1d_int32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int32_int32, __pyx_k_take_1d_int32_int32, sizeof(__pyx_k_take_1d_int32_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int32_int64, __pyx_k_take_1d_int32_int64, sizeof(__pyx_k_take_1d_int32_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int64_float64, __pyx_k_take_1d_int64_float64, sizeof(__pyx_k_take_1d_int64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int64_int64, __pyx_k_take_1d_int64_int64, sizeof(__pyx_k_take_1d_int64_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int8_float64, __pyx_k_take_1d_int8_float64, sizeof(__pyx_k_take_1d_int8_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int8_int32, __pyx_k_take_1d_int8_int32, sizeof(__pyx_k_take_1d_int8_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int8_int64, __pyx_k_take_1d_int8_int64, sizeof(__pyx_k_take_1d_int8_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int8_int8, __pyx_k_take_1d_int8_int8, sizeof(__pyx_k_take_1d_int8_int8), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_object_object, __pyx_k_take_1d_object_object, sizeof(__pyx_k_take_1d_object_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_bool_bool, __pyx_k_take_2d_axis0_bool_bool, sizeof(__pyx_k_take_2d_axis0_bool_bool), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_bool_object, __pyx_k_take_2d_axis0_bool_object, sizeof(__pyx_k_take_2d_axis0_bool_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_float32_float32, __pyx_k_take_2d_axis0_float32_float32, sizeof(__pyx_k_take_2d_axis0_float32_float32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_float32_float64, __pyx_k_take_2d_axis0_float32_float64, sizeof(__pyx_k_take_2d_axis0_float32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_float64_float64, __pyx_k_take_2d_axis0_float64_float64, sizeof(__pyx_k_take_2d_axis0_float64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int16_float64, __pyx_k_take_2d_axis0_int16_float64, sizeof(__pyx_k_take_2d_axis0_int16_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int16_int16, __pyx_k_take_2d_axis0_int16_int16, sizeof(__pyx_k_take_2d_axis0_int16_int16), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int16_int32, __pyx_k_take_2d_axis0_int16_int32, sizeof(__pyx_k_take_2d_axis0_int16_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int16_int64, __pyx_k_take_2d_axis0_int16_int64, sizeof(__pyx_k_take_2d_axis0_int16_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int32_float64, __pyx_k_take_2d_axis0_int32_float64, sizeof(__pyx_k_take_2d_axis0_int32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int32_int32, __pyx_k_take_2d_axis0_int32_int32, sizeof(__pyx_k_take_2d_axis0_int32_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int32_int64, __pyx_k_take_2d_axis0_int32_int64, sizeof(__pyx_k_take_2d_axis0_int32_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int64_float64, __pyx_k_take_2d_axis0_int64_float64, sizeof(__pyx_k_take_2d_axis0_int64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int64_int64, __pyx_k_take_2d_axis0_int64_int64, sizeof(__pyx_k_take_2d_axis0_int64_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int8_float64, __pyx_k_take_2d_axis0_int8_float64, sizeof(__pyx_k_take_2d_axis0_int8_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int8_int32, __pyx_k_take_2d_axis0_int8_int32, sizeof(__pyx_k_take_2d_axis0_int8_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int8_int64, __pyx_k_take_2d_axis0_int8_int64, sizeof(__pyx_k_take_2d_axis0_int8_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int8_int8, __pyx_k_take_2d_axis0_int8_int8, sizeof(__pyx_k_take_2d_axis0_int8_int8), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_object_object, __pyx_k_take_2d_axis0_object_object, sizeof(__pyx_k_take_2d_axis0_object_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_bool_bool, __pyx_k_take_2d_axis1_bool_bool, sizeof(__pyx_k_take_2d_axis1_bool_bool), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_bool_object, __pyx_k_take_2d_axis1_bool_object, sizeof(__pyx_k_take_2d_axis1_bool_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_float32_float32, __pyx_k_take_2d_axis1_float32_float32, sizeof(__pyx_k_take_2d_axis1_float32_float32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_float32_float64, __pyx_k_take_2d_axis1_float32_float64, sizeof(__pyx_k_take_2d_axis1_float32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_float64_float64, __pyx_k_take_2d_axis1_float64_float64, sizeof(__pyx_k_take_2d_axis1_float64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int16_float64, __pyx_k_take_2d_axis1_int16_float64, sizeof(__pyx_k_take_2d_axis1_int16_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int16_int16, __pyx_k_take_2d_axis1_int16_int16, sizeof(__pyx_k_take_2d_axis1_int16_int16), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int16_int32, __pyx_k_take_2d_axis1_int16_int32, sizeof(__pyx_k_take_2d_axis1_int16_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int16_int64, __pyx_k_take_2d_axis1_int16_int64, sizeof(__pyx_k_take_2d_axis1_int16_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int32_float64, __pyx_k_take_2d_axis1_int32_float64, sizeof(__pyx_k_take_2d_axis1_int32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int32_int32, __pyx_k_take_2d_axis1_int32_int32, sizeof(__pyx_k_take_2d_axis1_int32_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int32_int64, __pyx_k_take_2d_axis1_int32_int64, sizeof(__pyx_k_take_2d_axis1_int32_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int64_float64, __pyx_k_take_2d_axis1_int64_float64, sizeof(__pyx_k_take_2d_axis1_int64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int64_int64, __pyx_k_take_2d_axis1_int64_int64, sizeof(__pyx_k_take_2d_axis1_int64_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int8_float64, __pyx_k_take_2d_axis1_int8_float64, sizeof(__pyx_k_take_2d_axis1_int8_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int8_int32, __pyx_k_take_2d_axis1_int8_int32, sizeof(__pyx_k_take_2d_axis1_int8_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int8_int64, __pyx_k_take_2d_axis1_int8_int64, sizeof(__pyx_k_take_2d_axis1_int8_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int8_int8, __pyx_k_take_2d_axis1_int8_int8, sizeof(__pyx_k_take_2d_axis1_int8_int8), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_object_object, __pyx_k_take_2d_axis1_object_object, sizeof(__pyx_k_take_2d_axis1_object_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_bool_bool, __pyx_k_take_2d_multi_bool_bool, sizeof(__pyx_k_take_2d_multi_bool_bool), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_bool_object, __pyx_k_take_2d_multi_bool_object, sizeof(__pyx_k_take_2d_multi_bool_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_float32_float32, __pyx_k_take_2d_multi_float32_float32, sizeof(__pyx_k_take_2d_multi_float32_float32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_float32_float64, __pyx_k_take_2d_multi_float32_float64, sizeof(__pyx_k_take_2d_multi_float32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_float64_float64, __pyx_k_take_2d_multi_float64_float64, sizeof(__pyx_k_take_2d_multi_float64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int16_float64, __pyx_k_take_2d_multi_int16_float64, sizeof(__pyx_k_take_2d_multi_int16_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int16_int16, __pyx_k_take_2d_multi_int16_int16, sizeof(__pyx_k_take_2d_multi_int16_int16), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int16_int32, __pyx_k_take_2d_multi_int16_int32, sizeof(__pyx_k_take_2d_multi_int16_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int16_int64, __pyx_k_take_2d_multi_int16_int64, sizeof(__pyx_k_take_2d_multi_int16_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int32_float64, __pyx_k_take_2d_multi_int32_float64, sizeof(__pyx_k_take_2d_multi_int32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int32_int32, __pyx_k_take_2d_multi_int32_int32, sizeof(__pyx_k_take_2d_multi_int32_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int32_int64, __pyx_k_take_2d_multi_int32_int64, sizeof(__pyx_k_take_2d_multi_int32_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int64_float64, __pyx_k_take_2d_multi_int64_float64, sizeof(__pyx_k_take_2d_multi_int64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int64_int64, __pyx_k_take_2d_multi_int64_int64, sizeof(__pyx_k_take_2d_multi_int64_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int8_float64, __pyx_k_take_2d_multi_int8_float64, sizeof(__pyx_k_take_2d_multi_int8_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int8_int32, __pyx_k_take_2d_multi_int8_int32, sizeof(__pyx_k_take_2d_multi_int8_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int8_int64, __pyx_k_take_2d_multi_int8_int64, sizeof(__pyx_k_take_2d_multi_int8_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int8_int8, __pyx_k_take_2d_multi_int8_int8, sizeof(__pyx_k_take_2d_multi_int8_int8), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_object_object, __pyx_k_take_2d_multi_object_object, sizeof(__pyx_k_take_2d_multi_object_object), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_tiebreak, __pyx_k_tiebreak, sizeof(__pyx_k_tiebreak), 0, 0, 1, 1}, + {&__pyx_n_s_tiebreakers, __pyx_k_tiebreakers, sizeof(__pyx_k_tiebreakers), 0, 0, 1, 1}, + {&__pyx_n_s_ties_method, __pyx_k_ties_method, sizeof(__pyx_k_ties_method), 0, 0, 1, 1}, + {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1}, + {&__pyx_n_s_tot_wgt, __pyx_k_tot_wgt, sizeof(__pyx_k_tot_wgt), 0, 0, 1, 1}, + {&__pyx_n_s_total_tie_count, __pyx_k_total_tie_count, sizeof(__pyx_k_total_tie_count), 0, 0, 1, 1}, + {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, + {&__pyx_n_s_uint16_t, __pyx_k_uint16_t, sizeof(__pyx_k_uint16_t), 0, 0, 1, 1}, + {&__pyx_n_s_uint32_t, __pyx_k_uint32_t, sizeof(__pyx_k_uint32_t), 0, 0, 1, 1}, + {&__pyx_n_s_uint64_t, __pyx_k_uint64_t, sizeof(__pyx_k_uint64_t), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_n_s_uint8_t, __pyx_k_uint8_t, sizeof(__pyx_k_uint8_t), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_val_in, __pyx_k_val_in, sizeof(__pyx_k_val_in), 0, 0, 1, 1}, + {&__pyx_n_s_val_win, __pyx_k_val_win, sizeof(__pyx_k_val_win), 0, 0, 1, 1}, + {&__pyx_n_s_valid_locs, __pyx_k_valid_locs, sizeof(__pyx_k_valid_locs), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_vclose, __pyx_k_vclose, sizeof(__pyx_k_vclose), 0, 0, 1, 1}, + {&__pyx_n_s_vecs, __pyx_k_vecs, sizeof(__pyx_k_vecs), 0, 0, 1, 1}, + {&__pyx_n_s_vhigh, __pyx_k_vhigh, sizeof(__pyx_k_vhigh), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_vlow, __pyx_k_vlow, sizeof(__pyx_k_vlow), 0, 0, 1, 1}, + {&__pyx_n_s_vopen, __pyx_k_vopen, sizeof(__pyx_k_vopen), 0, 0, 1, 1}, + {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1}, + {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_n_s_weights, __pyx_k_weights, sizeof(__pyx_k_weights), 0, 0, 1, 1}, + {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1}, + {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, + {&__pyx_n_s_win, __pyx_k_win, sizeof(__pyx_k_win), 0, 0, 1, 1}, + {&__pyx_n_s_win_i, __pyx_k_win_i, sizeof(__pyx_k_win_i), 0, 0, 1, 1}, + {&__pyx_n_s_win_k, __pyx_k_win_k, sizeof(__pyx_k_win_k), 0, 0, 1, 1}, + {&__pyx_n_s_win_n, __pyx_k_win_n, sizeof(__pyx_k_win_n), 0, 0, 1, 1}, + {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xi, __pyx_k_xi, sizeof(__pyx_k_xi), 0, 0, 1, 1}, + {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, + {&__pyx_n_s_xx, __pyx_k_xx, sizeof(__pyx_k_xx), 0, 0, 1, 1}, + {&__pyx_n_s_xxx, __pyx_k_xxx, sizeof(__pyx_k_xxx), 0, 0, 1, 1}, + {&__pyx_n_s_xxxx, __pyx_k_xxxx, sizeof(__pyx_k_xxxx), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {&__pyx_n_s_yi, __pyx_k_yi, sizeof(__pyx_k_yi), 0, 0, 1, 1}, + {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {&__pyx_n_s_zeros_like, __pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION >= 3 + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/src/skiplist.pyx":138 + * + * if value != ( ( ( chain[0]).next)[0]).value: + * raise KeyError('Not Found') # <<<<<<<<<<<<<< + * + * # remove one link at each level + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Not_Found); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/algos.pyx":192 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_slice__2 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); + + /* "pandas/algos.pyx":195 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/algos.pyx":264 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_slice__4 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + + /* "pandas/algos.pyx":267 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/algos.pyx":344 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/algos.pyx":347 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_float64(values, _as) + */ + __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__7); + __Pyx_GIVEREF(__pyx_slice__7); + __pyx_slice__8 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__8); + __Pyx_GIVEREF(__pyx_slice__8); + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_slice__7, __pyx_slice__8); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/algos.pyx":350 + * + * values = _take_2d_float64(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "pandas/algos.pyx":386 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__11); + __Pyx_GIVEREF(__pyx_slice__11); + + /* "pandas/algos.pyx":424 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/algos.pyx":427 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_int64(values, _as) + */ + __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__13); + __Pyx_GIVEREF(__pyx_slice__13); + __pyx_slice__14 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__14); + __Pyx_GIVEREF(__pyx_slice__14); + __pyx_tuple__15 = PyTuple_Pack(2, __pyx_slice__13, __pyx_slice__14); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/algos.pyx":430 + * + * values = _take_2d_int64(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "pandas/algos.pyx":463 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__17); + __Pyx_GIVEREF(__pyx_slice__17); + + /* "pandas/algos.pyx":495 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "pandas/algos.pyx":524 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_slice__19 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__19); + __Pyx_GIVEREF(__pyx_slice__19); + + /* "pandas/algos.pyx":527 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * sum_ranks += i + 1 + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "pandas/algos.pyx":548 + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for non-numeric data') # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_first_not_supported_for_non_nume); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "pandas/algos.pyx":618 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "pandas/algos.pyx":633 + * + * try: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * except TypeError: + * values = in_arr + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "pandas/algos.pyx":647 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_object(values, _as) + */ + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + __pyx_slice__25 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + __pyx_tuple__26 = PyTuple_Pack(2, __pyx_slice__24, __pyx_slice__25); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "pandas/algos.pyx":650 + * + * values = _take_2d_object(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "pandas/algos.pyx":676 + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for ' # <<<<<<<<<<<<<< + * 'non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_first_not_supported_for_non_nume); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/algos.pyx":684 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + + /* "pandas/algos.pyx":724 + * minp = 1 + * elif minp < 0: + * raise ValueError('min_periods must be >= 0') # <<<<<<<<<<<<<< + * return minp + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_min_periods_must_be_0); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_i, __pyx_n_s_u); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s__32); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__34); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_i, __pyx_n_s_u); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s__32); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s__34); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "pandas/algos.pyx":851 + * + * if len(arr) == 0: + * return (-1,-1,None) # <<<<<<<<<<<<<< + * + * m = arr[0] + */ + __pyx_tuple__43 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "pandas/algos.pyx":1711 + * cdef double_t _get_min(object skiplist, int nobs, int minp): + * if nobs >= minp: + * return skiplist.get(0) # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "pandas/algos.pyx":1770 + * + * if not input.flags.c_contiguous: + * input = input.copy('C') # <<<<<<<<<<<<<< + * + * buf = input.data + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "pandas/algos.pyx":2222 + * + * indexer, _counts = groupsort_indexer(labels, ngroups) + * counts[:] = _counts[1:] # <<<<<<<<<<<<<< + * + * data = np.empty((K, N), dtype=np.float64) + */ + __pyx_slice__46 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__46); + __Pyx_GIVEREF(__pyx_slice__46); + __pyx_slice__47 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__47); + __Pyx_GIVEREF(__pyx_slice__47); + + /* "pandas/src/join.pyx":193 + * # length-0 case + * res = np.empty(len(indexer), dtype=np.int64) + * res.fill(-1) # <<<<<<<<<<<<<< + * + * return res + */ + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "pandas/src/join.pyx":229 + * + * last_obs = np.empty(max_group, dtype=np.int64) + * last_obs.fill(-1) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + + /* "pandas/src/generated.pyx":269 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + + /* "pandas/src/generated.pyx":275 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "pandas/src/generated.pyx":330 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + + /* "pandas/src/generated.pyx":336 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + + /* "pandas/src/generated.pyx":391 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + + /* "pandas/src/generated.pyx":397 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "pandas/src/generated.pyx":452 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "pandas/src/generated.pyx":458 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "pandas/src/generated.pyx":513 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "pandas/src/generated.pyx":519 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "pandas/src/generated.pyx":574 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "pandas/src/generated.pyx":580 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "pandas/src/generated.pyx":636 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "pandas/src/generated.pyx":642 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + + /* "pandas/src/generated.pyx":698 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + + /* "pandas/src/generated.pyx":704 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "pandas/src/generated.pyx":760 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "pandas/src/generated.pyx":766 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "pandas/src/generated.pyx":822 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "pandas/src/generated.pyx":828 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "pandas/src/generated.pyx":884 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "pandas/src/generated.pyx":890 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "pandas/src/generated.pyx":946 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "pandas/src/generated.pyx":952 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "pandas/src/generated.pyx":1016 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + + /* "pandas/src/generated.pyx":1049 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + + /* "pandas/src/generated.pyx":1082 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + + /* "pandas/src/generated.pyx":1115 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + + /* "pandas/src/generated.pyx":1148 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + + /* "pandas/src/generated.pyx":1181 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + + /* "pandas/src/generated.pyx":1215 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + + /* "pandas/src/generated.pyx":1247 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + + /* "pandas/src/generated.pyx":1279 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + + /* "pandas/src/generated.pyx":1311 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + + /* "pandas/src/generated.pyx":1343 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + + /* "pandas/src/generated.pyx":1375 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + + /* "pandas/src/generated.pyx":1408 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + + /* "pandas/src/generated.pyx":1442 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + + /* "pandas/src/generated.pyx":1476 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + + /* "pandas/src/generated.pyx":1510 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + + /* "pandas/src/generated.pyx":1544 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + + /* "pandas/src/generated.pyx":1578 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + + /* "pandas/src/generated.pyx":1613 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + + /* "pandas/src/generated.pyx":1647 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + + /* "pandas/src/generated.pyx":1681 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + + /* "pandas/src/generated.pyx":1715 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + + /* "pandas/src/generated.pyx":1749 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + + /* "pandas/src/generated.pyx":1783 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + + /* "pandas/src/generated.pyx":1815 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__98 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + + /* "pandas/src/generated.pyx":1821 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__99 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + + /* "pandas/src/generated.pyx":1842 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__100 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + + /* "pandas/src/generated.pyx":1848 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__101 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + + /* "pandas/src/generated.pyx":1869 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__102 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + + /* "pandas/src/generated.pyx":1875 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__103 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + + /* "pandas/src/generated.pyx":1896 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__104 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + + /* "pandas/src/generated.pyx":1902 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__105 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + + /* "pandas/src/generated.pyx":1923 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__106 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + + /* "pandas/src/generated.pyx":1929 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__107 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + + /* "pandas/src/generated.pyx":1950 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__108 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + + /* "pandas/src/generated.pyx":1956 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__109 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__109); + __Pyx_GIVEREF(__pyx_tuple__109); + + /* "pandas/src/generated.pyx":1973 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + + /* "pandas/src/generated.pyx":2001 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + + /* "pandas/src/generated.pyx":2029 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + + /* "pandas/src/generated.pyx":2057 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__113); + __Pyx_GIVEREF(__pyx_tuple__113); + + /* "pandas/src/generated.pyx":2085 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + + /* "pandas/src/generated.pyx":2113 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + + /* "pandas/src/generated.pyx":4743 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__192)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__192); + __Pyx_GIVEREF(__pyx_tuple__192); + + /* "pandas/src/generated.pyx":4786 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__193); + __Pyx_GIVEREF(__pyx_tuple__193); + + /* "pandas/src/generated.pyx":4919 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__194)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__194); + __Pyx_GIVEREF(__pyx_tuple__194); + + /* "pandas/src/generated.pyx":4963 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__195); + __Pyx_GIVEREF(__pyx_tuple__195); + + /* "pandas/src/generated.pyx":5098 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__196); + __Pyx_GIVEREF(__pyx_tuple__196); + + /* "pandas/src/generated.pyx":5154 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__197)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__197); + __Pyx_GIVEREF(__pyx_tuple__197); + + /* "pandas/src/generated.pyx":5324 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__198); + __Pyx_GIVEREF(__pyx_tuple__198); + + /* "pandas/src/generated.pyx":5380 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__199); + __Pyx_GIVEREF(__pyx_tuple__199); + + /* "pandas/src/generated.pyx":5547 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__200 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__200)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__200); + __Pyx_GIVEREF(__pyx_tuple__200); + + /* "pandas/src/generated.pyx":5608 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + + /* "pandas/src/generated.pyx":5793 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__202)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__202); + __Pyx_GIVEREF(__pyx_tuple__202); + + /* "pandas/src/generated.pyx":5845 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__203 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__203); + __Pyx_GIVEREF(__pyx_tuple__203); + + /* "pandas/src/generated.pyx":6008 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__204 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__204)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__204); + __Pyx_GIVEREF(__pyx_tuple__204); + + /* "pandas/src/generated.pyx":6068 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__205); + __Pyx_GIVEREF(__pyx_tuple__205); + + /* "pandas/src/generated.pyx":6252 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__206)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__206); + __Pyx_GIVEREF(__pyx_tuple__206); + + /* "pandas/src/generated.pyx":6312 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__207); + __Pyx_GIVEREF(__pyx_tuple__207); + + /* "pandas/src/generated.pyx":6502 + * + * if out.shape[1] != 4: + * raise ValueError('Output array must have 4 columns') # <<<<<<<<<<<<<< + * + * NA = np.nan + */ + __pyx_tuple__208 = PyTuple_Pack(1, __pyx_kp_s_Output_array_must_have_4_columns); if (unlikely(!__pyx_tuple__208)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__208); + __Pyx_GIVEREF(__pyx_tuple__208); + + /* "pandas/src/generated.pyx":6575 + * + * if out.shape[1] != 4: + * raise ValueError('Output array must have 4 columns') # <<<<<<<<<<<<<< + * + * NA = np.nan + */ + __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s_Output_array_must_have_4_columns); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__209); + __Pyx_GIVEREF(__pyx_tuple__209); + + /* "pandas/src/generated.pyx":6643 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__210)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__210); + __Pyx_GIVEREF(__pyx_tuple__210); + + /* "pandas/src/generated.pyx":6679 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__211); + __Pyx_GIVEREF(__pyx_tuple__211); + + /* "pandas/src/generated.pyx":6715 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__212)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__212); + __Pyx_GIVEREF(__pyx_tuple__212); + + /* "pandas/src/generated.pyx":6751 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__213); + __Pyx_GIVEREF(__pyx_tuple__213); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__214 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__214)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__214); + __Pyx_GIVEREF(__pyx_tuple__214); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__215); + __Pyx_GIVEREF(__pyx_tuple__215); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__216 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__216)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__216); + __Pyx_GIVEREF(__pyx_tuple__216); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__217 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__217); + __Pyx_GIVEREF(__pyx_tuple__217); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__218 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__218)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__218); + __Pyx_GIVEREF(__pyx_tuple__218); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__219 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__219)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__219); + __Pyx_GIVEREF(__pyx_tuple__219); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__220)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__220); + __Pyx_GIVEREF(__pyx_tuple__220); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__221)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__221); + __Pyx_GIVEREF(__pyx_tuple__221); + + /* "View.MemoryView":127 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__222)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__222); + __Pyx_GIVEREF(__pyx_tuple__222); + + /* "View.MemoryView":130 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if isinstance(format, unicode): + */ + __pyx_tuple__223 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__223)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__223); + __Pyx_GIVEREF(__pyx_tuple__223); + + /* "View.MemoryView":142 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__224 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__224)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__224); + __Pyx_GIVEREF(__pyx_tuple__224); + + /* "View.MemoryView":170 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__225 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__225)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__225); + __Pyx_GIVEREF(__pyx_tuple__225); + + /* "View.MemoryView":186 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__226 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__226)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__226); + __Pyx_GIVEREF(__pyx_tuple__226); + + /* "View.MemoryView":445 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__227)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__227); + __Pyx_GIVEREF(__pyx_tuple__227); + + /* "View.MemoryView":521 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) + */ + __pyx_tuple__228 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__228)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__228); + __Pyx_GIVEREF(__pyx_tuple__228); + + /* "View.MemoryView":638 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_tuple__229 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__229)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__229); + __Pyx_GIVEREF(__pyx_tuple__229); + + /* "View.MemoryView":641 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_tuple__230 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__230)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__230); + __Pyx_GIVEREF(__pyx_tuple__230); + + /* "View.MemoryView":652 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_tuple__231 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__231)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__231); + __Pyx_GIVEREF(__pyx_tuple__231); + + /* "View.MemoryView":660 + * for i in range(ndim): + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__232)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__232); + __Pyx_GIVEREF(__pyx_tuple__232); + + /* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + __pyx_tuple__233 = PyTuple_Pack(22, __pyx_n_s_in_arr, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_sorted_data, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as); if (unlikely(!__pyx_tuple__233)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__233); + __Pyx_GIVEREF(__pyx_tuple__233); + __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(5, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_float64, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + __pyx_tuple__235 = PyTuple_Pack(19, __pyx_n_s_in_arr, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_sorted_data, __pyx_n_s_values, __pyx_n_s_ranks, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__235)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__235); + __Pyx_GIVEREF(__pyx_tuple__235); + __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_int64, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_tuple__237 = PyTuple_Pack(23, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__237)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__237); + __Pyx_GIVEREF(__pyx_tuple__237); + __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(6, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_float64, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_tuple__239 = PyTuple_Pack(21, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_argsorted, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__239)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__239); + __Pyx_GIVEREF(__pyx_tuple__239); + __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(6, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_int64, 393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_tuple__241 = PyTuple_Pack(24, __pyx_n_s_in_arr, __pyx_n_s_retry, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_sorted_data, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as, __pyx_n_s_valid_locs); if (unlikely(!__pyx_tuple__241)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__241); + __Pyx_GIVEREF(__pyx_tuple__241); + __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(6, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_generic, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_tuple__243 = PyTuple_Pack(25, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_infs, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as); if (unlikely(!__pyx_tuple__243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__243); + __Pyx_GIVEREF(__pyx_tuple__243); + __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(6, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_generic, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":715 + * # - + * + * def _check_minp(win, minp, N): # <<<<<<<<<<<<<< + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + */ + __pyx_tuple__245 = PyTuple_Pack(3, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_N); if (unlikely(!__pyx_tuple__245)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__245); + __Pyx_GIVEREF(__pyx_tuple__245); + __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_check_minp, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + __pyx_tuple__247 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_k); if (unlikely(!__pyx_tuple__247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__247); + __Pyx_GIVEREF(__pyx_tuple__247); + __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pyx_fuse_0kth_smallest, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + __pyx_tuple__249 = PyTuple_Pack(2, __pyx_n_s_arr, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__249)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__249); + __Pyx_GIVEREF(__pyx_tuple__249); + __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pyx_fuse_0median, 823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":843 + * # -------------- Min, Max subsequence + * + * def max_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n + */ + __pyx_tuple__251 = PyTuple_Pack(8, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_s, __pyx_n_s_e, __pyx_n_s_T, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_S); if (unlikely(!__pyx_tuple__251)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__251); + __Pyx_GIVEREF(__pyx_tuple__251); + __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_max_subseq, 843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":871 + * return (s, e, m) + * + * def min_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s, e + */ + __pyx_tuple__253 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_s, __pyx_n_s_e, __pyx_n_s_m); if (unlikely(!__pyx_tuple__253)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__253); + __Pyx_GIVEREF(__pyx_tuple__253); + __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_min_subseq, 871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":883 + * # Rolling sum + * + * def roll_sum(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + */ + __pyx_tuple__255 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_sum_x, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__255); + __Pyx_GIVEREF(__pyx_tuple__255); + __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_sum, 883, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":925 + * # Rolling mean + * + * def roll_mean(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef: + */ + __pyx_tuple__257 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_result, __pyx_n_s_sum_x, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_neg_ct, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__257)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__257); + __Pyx_GIVEREF(__pyx_tuple__257); + __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_mean, 925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":982 + * # Exponentially weighted moving average + * + * def ewma(ndarray[double_t] input, double_t com, int adjust): # <<<<<<<<<<<<<< + * ''' + * Compute exponentially-weighted moving average using center-of-mass. + */ + __pyx_tuple__259 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_com, __pyx_n_s_adjust, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_neww, __pyx_n_s_oldw, __pyx_n_s_adj, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__259)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__259); + __Pyx_GIVEREF(__pyx_tuple__259); + __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ewma, 982, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1044 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + __pyx_tuple__261 = PyTuple_Pack(21, __pyx_n_s_mat, __pyx_n_s_cov, __pyx_n_s_minp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_result, __pyx_n_s_mask, __pyx_n_s_nobs, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_sumx, __pyx_n_s_sumy, __pyx_n_s_sumxx, __pyx_n_s_sumyy, __pyx_n_s_meanx, __pyx_n_s_meany, __pyx_n_s_divisor); if (unlikely(!__pyx_tuple__261)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__261); + __Pyx_GIVEREF(__pyx_tuple__261); + __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(3, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_nancorr, 1044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1103 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + __pyx_tuple__263 = PyTuple_Pack(20, __pyx_n_s_mat, __pyx_n_s_minp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_result, __pyx_n_s_maskedx, __pyx_n_s_maskedy, __pyx_n_s_mask, __pyx_n_s_nobs, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_sumx, __pyx_n_s_sumxx, __pyx_n_s_sumyy, __pyx_n_s_mean, __pyx_n_s_divisor); if (unlikely(!__pyx_tuple__263)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__263); + __Pyx_GIVEREF(__pyx_tuple__263); + __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_nancorr_spearman, 1103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1164 + * # Rolling variance + * + * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1): # <<<<<<<<<<<<<< + * """ + * Numerically stable implementation using Welford's method. + */ + __pyx_tuple__265 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_ddof, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_mean_x, __pyx_n_s_ssqdm_x, __pyx_n_s_nobs, __pyx_n_s_delta, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__265)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__265); + __Pyx_GIVEREF(__pyx_tuple__265); + __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_var, 1164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1253 + * # Rolling skewness + * + * def roll_skew(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + */ + __pyx_tuple__267 = PyTuple_Pack(16, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_x, __pyx_n_s_xx, __pyx_n_s_xxx, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_R); if (unlikely(!__pyx_tuple__267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__267); + __Pyx_GIVEREF(__pyx_tuple__267); + __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_skew, 1253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1317 + * + * + * def roll_kurt(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef double val, prev + */ + __pyx_tuple__269 = PyTuple_Pack(19, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_x, __pyx_n_s_xx, __pyx_n_s_xxx, __pyx_n_s_xxxx, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_D, __pyx_n_s_R, __pyx_n_s_K); if (unlikely(!__pyx_tuple__269)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__269); + __Pyx_GIVEREF(__pyx_tuple__269); + __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_kurt, 1317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1437 + * from skiplist cimport * + * + * def roll_median_c(ndarray[float64_t] arg, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, res, prev + * cdef: + */ + __pyx_tuple__271 = PyTuple_Pack(13, __pyx_n_s_arg, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_res, __pyx_n_s_prev, __pyx_n_s_ret, __pyx_n_s_sl, __pyx_n_s_midpoint, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__271)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__271); + __Pyx_GIVEREF(__pyx_tuple__271); + __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_median_c, 1437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1492 + * return output + * + * def roll_median_cython(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_tuple__273 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__273); + __Pyx_GIVEREF(__pyx_tuple__273); + __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_median_cython, 1492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1528 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_max2(ndarray[float64_t] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + __pyx_tuple__275 = PyTuple_Pack(15, __pyx_n_s_a, __pyx_n_s_window, __pyx_n_s_minp, __pyx_n_s_ai, __pyx_n_s_aold, __pyx_n_s_count, __pyx_n_s_ring, __pyx_n_s_minpair, __pyx_n_s_end, __pyx_n_s_last, __pyx_n_s_i0, __pyx_n_s_dim, __pyx_n_s_n0, __pyx_n_s_dims, __pyx_n_s_y); if (unlikely(!__pyx_tuple__275)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__275); + __Pyx_GIVEREF(__pyx_tuple__275); + __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_max2, 1528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1608 + * return y + * + * def roll_max(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_tuple__277 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__277)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__277); + __Pyx_GIVEREF(__pyx_tuple__277); + __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_max, 1608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1621 + * return NaN + * + * def roll_min(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_tuple__279 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__279)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__279); + __Pyx_GIVEREF(__pyx_tuple__279); + __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_min, 1621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1629 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + __pyx_tuple__281 = PyTuple_Pack(15, __pyx_n_s_a, __pyx_n_s_window, __pyx_n_s_minp, __pyx_n_s_ai, __pyx_n_s_aold, __pyx_n_s_count, __pyx_n_s_ring, __pyx_n_s_minpair, __pyx_n_s_end, __pyx_n_s_last, __pyx_n_s_i0, __pyx_n_s_dim, __pyx_n_s_n0, __pyx_n_s_dims, __pyx_n_s_y); if (unlikely(!__pyx_tuple__281)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__281); + __Pyx_GIVEREF(__pyx_tuple__281); + __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_min2, 1629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1715 + * return NaN + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, double quantile): + * ''' + */ + __pyx_tuple__283 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_quantile, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_midpoint, __pyx_n_s_skiplist, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__283)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__283); + __Pyx_GIVEREF(__pyx_tuple__283); + __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_quantile, 1715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1762 + * return output + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, object func, object args, object kwargs): + * cdef ndarray[double_t] output, counts, bufarr + */ + __pyx_tuple__285 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_func, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_output, __pyx_n_s_counts, __pyx_n_s_bufarr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_buf, __pyx_n_s_oldbuf); if (unlikely(!__pyx_tuple__285)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__285); + __Pyx_GIVEREF(__pyx_tuple__285); + __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_generic, 1762, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + __pyx_tuple__287 = PyTuple_Pack(18, __pyx_n_s_input, __pyx_n_s_weights, __pyx_n_s_minp, __pyx_n_s_avg, __pyx_n_s_avg_wgt, __pyx_n_s_output, __pyx_n_s_tot_wgt, __pyx_n_s_counts, __pyx_n_s_in_i, __pyx_n_s_win_i, __pyx_n_s_win_n, __pyx_n_s_win_k, __pyx_n_s_in_n, __pyx_n_s_in_k, __pyx_n_s_val_in, __pyx_n_s_val_win, __pyx_n_s_c, __pyx_n_s_w); if (unlikely(!__pyx_tuple__287)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__287); + __Pyx_GIVEREF(__pyx_tuple__287); + __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_window, 1806, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1879 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + __pyx_tuple__289 = PyTuple_Pack(9, __pyx_n_s_list_of_arrays, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nlevels, __pyx_n_s_k, __pyx_n_s_cur, __pyx_n_s_pre, __pyx_n_s_arr, __pyx_n_s_vecs); if (unlikely(!__pyx_tuple__289)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__289); + __Pyx_GIVEREF(__pyx_tuple__289); + __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_lexsorted, 1879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1912 + * + * @cython.boundscheck(False) + * def groupby_indices(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__291 = PyTuple_Pack(13, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_labels, __pyx_n_s_counts, __pyx_n_s_arr, __pyx_n_s_seen, __pyx_n_s_loc, __pyx_n_s_ids, __pyx_n_s_val, __pyx_n_s_k, __pyx_n_s_vecs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__291)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__291); + __Pyx_GIVEREF(__pyx_tuple__291); + __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_groupby_indices, 1912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1949 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_labels(ndarray[object] values): # <<<<<<<<<<<<<< + * ''' + * Compute label vector from input values and associated useful data + */ + __pyx_tuple__293 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_labels, __pyx_n_s_counts, __pyx_n_s_ids, __pyx_n_s_reverse, __pyx_n_s_idx, __pyx_n_s_val, __pyx_n_s_count); if (unlikely(!__pyx_tuple__293)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__293); + __Pyx_GIVEREF(__pyx_tuple__293); + __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_labels, 1949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1991 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, loc, label, n + */ + __pyx_tuple__295 = PyTuple_Pack(9, __pyx_n_s_index, __pyx_n_s_ngroups, __pyx_n_s_i, __pyx_n_s_loc, __pyx_n_s_label, __pyx_n_s_n, __pyx_n_s_counts, __pyx_n_s_where, __pyx_n_s_result); if (unlikely(!__pyx_tuple__295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__295); + __Pyx_GIVEREF(__pyx_tuple__295); + __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_groupsort_indexer, 1991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2022 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__297 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_nobs, __pyx_n_s_resx); if (unlikely(!__pyx_tuple__297)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__297); + __Pyx_GIVEREF(__pyx_tuple__297); + __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_nth_object, 2022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2066 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__299 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__299)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__299); + __Pyx_GIVEREF(__pyx_tuple__299); + __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_nth_bin_object, 2066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2114 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__301 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__301)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__301); + __Pyx_GIVEREF(__pyx_tuple__301); + __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_last_object, 2114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2156 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__303 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__303)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__303); + __Pyx_GIVEREF(__pyx_tuple__303); + __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_last_bin_object, 2156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2206 + * # median + * + * def group_median(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__305 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_size, __pyx_n_s_counts_2, __pyx_n_s_data, __pyx_n_s_ptr, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__305); + __Pyx_GIVEREF(__pyx_tuple__305); + __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_median, 2206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":1 + * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + __pyx_tuple__307 = PyTuple_Pack(20, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_loc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_position, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__307)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__307); + __Pyx_GIVEREF(__pyx_tuple__307); + __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(3, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_inner_join, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + __pyx_tuple__309 = PyTuple_Pack(22, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_sort, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_rev, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_loc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_position, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__309)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__309); + __Pyx_GIVEREF(__pyx_tuple__309); + __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(4, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_left_outer_join, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":120 + * + * + * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + __pyx_tuple__311 = PyTuple_Pack(19, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_offset, __pyx_n_s_position); if (unlikely(!__pyx_tuple__311)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__311); + __Pyx_GIVEREF(__pyx_tuple__311); + __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_full_outer_join, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":184 + * + * + * def _get_result_indexer(sorter, indexer): # <<<<<<<<<<<<<< + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + */ + __pyx_tuple__313 = PyTuple_Pack(3, __pyx_n_s_sorter, __pyx_n_s_indexer, __pyx_n_s_res); if (unlikely(!__pyx_tuple__313)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__313); + __Pyx_GIVEREF(__pyx_tuple__313); + __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_get_result_indexer, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":199 + * + * + * def ffill_indexer(ndarray[int64_t] indexer): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indexer) + */ + __pyx_tuple__315 = PyTuple_Pack(6, __pyx_n_s_indexer, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val, __pyx_n_s_last_obs); if (unlikely(!__pyx_tuple__315)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__315); + __Pyx_GIVEREF(__pyx_tuple__315); + __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_ffill_indexer, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":219 + * + * + * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids, # <<<<<<<<<<<<<< + * int64_t max_group): + * cdef: + */ + __pyx_tuple__317 = PyTuple_Pack(9, __pyx_n_s_indexer, __pyx_n_s_group_ids, __pyx_n_s_max_group, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_last_obs, __pyx_n_s_gid, __pyx_n_s_val); if (unlikely(!__pyx_tuple__317)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__317); + __Pyx_GIVEREF(__pyx_tuple__317); + __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_ffill_by_group, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":41 + * import_ufunc() + * + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num # <<<<<<<<<<<<<< + * + * cpdef ensure_platform_int(object arr): + */ + __pyx_tuple__319 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__319)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__319); + __Pyx_GIVEREF(__pyx_tuple__319); + + /* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__320 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__320)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__320); + __Pyx_GIVEREF(__pyx_tuple__320); + __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_float64, 259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__322 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__322)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__322); + __Pyx_GIVEREF(__pyx_tuple__322); + __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_float32, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__324 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__324)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__324); + __Pyx_GIVEREF(__pyx_tuple__324); + __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__324, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_object, 381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__326 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__326)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__326); + __Pyx_GIVEREF(__pyx_tuple__326); + __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_int32, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__328 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__328)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__328); + __Pyx_GIVEREF(__pyx_tuple__328); + __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_int64, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__330 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__330)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__330); + __Pyx_GIVEREF(__pyx_tuple__330); + __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_bool, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__332 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__332)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__332); + __Pyx_GIVEREF(__pyx_tuple__332); + __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_float64, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__334 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__334)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__334); + __Pyx_GIVEREF(__pyx_tuple__334); + __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_float32, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__336 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__336)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__336); + __Pyx_GIVEREF(__pyx_tuple__336); + __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_object, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__338 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__338)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__338); + __Pyx_GIVEREF(__pyx_tuple__338); + __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_int32, 812, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__340 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__340)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__340); + __Pyx_GIVEREF(__pyx_tuple__340); + __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_int64, 874, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__342 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__342)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__342); + __Pyx_GIVEREF(__pyx_tuple__342); + __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_bool, 936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__344 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__344)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__344); + __Pyx_GIVEREF(__pyx_tuple__344); + __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_float64, 999, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__346 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__346)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__346); + __Pyx_GIVEREF(__pyx_tuple__346); + __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__346, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_float32, 1032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__348 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__348)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__348); + __Pyx_GIVEREF(__pyx_tuple__348); + __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__348, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_object, 1065, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__350 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__350)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__350); + __Pyx_GIVEREF(__pyx_tuple__350); + __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_int32, 1098, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__352 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__352)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__352); + __Pyx_GIVEREF(__pyx_tuple__352); + __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__352, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_int64, 1131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__354 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__354)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__354); + __Pyx_GIVEREF(__pyx_tuple__354); + __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__354, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_bool, 1164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__356 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__356)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__356); + __Pyx_GIVEREF(__pyx_tuple__356); + __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_float64, 1198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__358 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__358)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__358); + __Pyx_GIVEREF(__pyx_tuple__358); + __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_float32, 1230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__360 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__360)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__360); + __Pyx_GIVEREF(__pyx_tuple__360); + __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_object, 1262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__362 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__362)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__362); + __Pyx_GIVEREF(__pyx_tuple__362); + __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_int32, 1294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__364 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__364)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__364); + __Pyx_GIVEREF(__pyx_tuple__364); + __pyx_codeobj__365 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__364, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_int64, 1326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__365)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__366 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__366)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__366); + __Pyx_GIVEREF(__pyx_tuple__366); + __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__366, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_bool, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__368 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__368)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__368); + __Pyx_GIVEREF(__pyx_tuple__368); + __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_float64, 1391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__370 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__370)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__370); + __Pyx_GIVEREF(__pyx_tuple__370); + __pyx_codeobj__371 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__370, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_float32, 1425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__371)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__372 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__372)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__372); + __Pyx_GIVEREF(__pyx_tuple__372); + __pyx_codeobj__373 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__372, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_object, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__373)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__374 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__374)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__374); + __Pyx_GIVEREF(__pyx_tuple__374); + __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_int32, 1493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__376 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__376)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__376); + __Pyx_GIVEREF(__pyx_tuple__376); + __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_int64, 1527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__378 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__378)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__378); + __Pyx_GIVEREF(__pyx_tuple__378); + __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_bool, 1561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__380 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__380)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__380); + __Pyx_GIVEREF(__pyx_tuple__380); + __pyx_codeobj__381 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_float64, 1596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__381)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__382 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__382)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__382); + __Pyx_GIVEREF(__pyx_tuple__382); + __pyx_codeobj__383 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__382, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_float32, 1630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__383)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__384 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__384)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__384); + __Pyx_GIVEREF(__pyx_tuple__384); + __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__384, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_object, 1664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__386 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__386)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__386); + __Pyx_GIVEREF(__pyx_tuple__386); + __pyx_codeobj__387 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__386, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_int32, 1698, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__387)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__388 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__388)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__388); + __Pyx_GIVEREF(__pyx_tuple__388); + __pyx_codeobj__389 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__388, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_int64, 1732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__389)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__390 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__390)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__390); + __Pyx_GIVEREF(__pyx_tuple__390); + __pyx_codeobj__391 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__390, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_bool, 1766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__391)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1801 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float64(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__392 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__392)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__392); + __Pyx_GIVEREF(__pyx_tuple__392); + __pyx_codeobj__393 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__392, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_float64, 1801, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__393)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1828 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float32(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__394 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__394)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__394); + __Pyx_GIVEREF(__pyx_tuple__394); + __pyx_codeobj__395 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__394, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_float32, 1828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__395)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1855 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_object(ndarray[object] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__396 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__396)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__396); + __Pyx_GIVEREF(__pyx_tuple__396); + __pyx_codeobj__397 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__396, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_object, 1855, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__397)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1882 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int32(ndarray[int32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__398 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__398)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__398); + __Pyx_GIVEREF(__pyx_tuple__398); + __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__398, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_int32, 1882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1909 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int64(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__400 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__400)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__400); + __Pyx_GIVEREF(__pyx_tuple__400); + __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__400, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_int64, 1909, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_bool(ndarray[uint8_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__402 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__402)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__402); + __Pyx_GIVEREF(__pyx_tuple__402); + __pyx_codeobj__403 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__402, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_bool, 1936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__403)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1964 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__404 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__404)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__404); + __Pyx_GIVEREF(__pyx_tuple__404); + __pyx_codeobj__405 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__404, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_float64, 1964, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__405)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1992 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__406 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__406)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__406); + __Pyx_GIVEREF(__pyx_tuple__406); + __pyx_codeobj__407 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__406, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_float32, 1992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__407)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2020 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__408 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__408)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__408); + __Pyx_GIVEREF(__pyx_tuple__408); + __pyx_codeobj__409 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__408, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_object, 2020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__409)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2048 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__410 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__410)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__410); + __Pyx_GIVEREF(__pyx_tuple__410); + __pyx_codeobj__411 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__410, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_int32, 2048, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__411)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2076 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__412 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__412)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__412); + __Pyx_GIVEREF(__pyx_tuple__412); + __pyx_codeobj__413 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__412, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_int64, 2076, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__413)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2104 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__414 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__414)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__414); + __Pyx_GIVEREF(__pyx_tuple__414); + __pyx_codeobj__415 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__414, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_bool, 2104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__415)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__416 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__416)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__416); + __Pyx_GIVEREF(__pyx_tuple__416); + __pyx_codeobj__417 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__416, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_float64, 2133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__417)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__418 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__418)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__418); + __Pyx_GIVEREF(__pyx_tuple__418); + __pyx_codeobj__419 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__418, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_float32, 2148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__419)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__420 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__420)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__420); + __Pyx_GIVEREF(__pyx_tuple__420); + __pyx_codeobj__421 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__420, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_object, 2163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__421)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2178 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__422 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__422)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__422); + __Pyx_GIVEREF(__pyx_tuple__422); + __pyx_codeobj__423 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__422, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_int32, 2178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__423)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2193 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__424 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__424)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__424); + __Pyx_GIVEREF(__pyx_tuple__424); + __pyx_codeobj__425 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__424, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_int64, 2193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__425)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2208 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__426 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__426)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__426); + __Pyx_GIVEREF(__pyx_tuple__426); + __pyx_codeobj__427 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__426, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_bool, 2208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__427)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2223 + * + * @cython.wraparound(False) + * def take_1d_bool_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + */ + __pyx_tuple__428 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__428)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__428); + __Pyx_GIVEREF(__pyx_tuple__428); + __pyx_codeobj__429 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__428, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_bool_bool, 2223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__429)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2242 + * + * @cython.wraparound(False) + * def take_1d_bool_object(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + __pyx_tuple__430 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__430)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__430); + __Pyx_GIVEREF(__pyx_tuple__430); + __pyx_codeobj__431 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__430, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_bool_object, 2242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__431)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2261 + * + * @cython.wraparound(False) + * def take_1d_int8_int8(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + */ + __pyx_tuple__432 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__432)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__432); + __Pyx_GIVEREF(__pyx_tuple__432); + __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int8, 2261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2280 + * + * @cython.wraparound(False) + * def take_1d_int8_int32(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_tuple__434 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__434)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__434); + __Pyx_GIVEREF(__pyx_tuple__434); + __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int32, 2280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2299 + * + * @cython.wraparound(False) + * def take_1d_int8_int64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_tuple__436 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__436)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__436); + __Pyx_GIVEREF(__pyx_tuple__436); + __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__436, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int64, 2299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2318 + * + * @cython.wraparound(False) + * def take_1d_int8_float64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__438 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__438)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__438); + __Pyx_GIVEREF(__pyx_tuple__438); + __pyx_codeobj__439 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__438, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_float64, 2318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__439)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2337 + * + * @cython.wraparound(False) + * def take_1d_int16_int16(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + */ + __pyx_tuple__440 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__440)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__440); + __Pyx_GIVEREF(__pyx_tuple__440); + __pyx_codeobj__441 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__440, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int16, 2337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__441)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2356 + * + * @cython.wraparound(False) + * def take_1d_int16_int32(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_tuple__442 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__442)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__442); + __Pyx_GIVEREF(__pyx_tuple__442); + __pyx_codeobj__443 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__442, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int32, 2356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__443)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2375 + * + * @cython.wraparound(False) + * def take_1d_int16_int64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_tuple__444 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__444)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__444); + __Pyx_GIVEREF(__pyx_tuple__444); + __pyx_codeobj__445 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__444, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int64, 2375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__445)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2394 + * + * @cython.wraparound(False) + * def take_1d_int16_float64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__446 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__446)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__446); + __Pyx_GIVEREF(__pyx_tuple__446); + __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_float64, 2394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2413 + * + * @cython.wraparound(False) + * def take_1d_int32_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_tuple__448 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__448)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__448); + __Pyx_GIVEREF(__pyx_tuple__448); + __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_int32, 2413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2432 + * + * @cython.wraparound(False) + * def take_1d_int32_int64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_tuple__450 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__450)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__450); + __Pyx_GIVEREF(__pyx_tuple__450); + __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__450, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_int64, 2432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2451 + * + * @cython.wraparound(False) + * def take_1d_int32_float64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__452 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__452)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__452); + __Pyx_GIVEREF(__pyx_tuple__452); + __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__452, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_float64, 2451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2470 + * + * @cython.wraparound(False) + * def take_1d_int64_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_tuple__454 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__454)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__454); + __Pyx_GIVEREF(__pyx_tuple__454); + __pyx_codeobj__455 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__454, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int64_int64, 2470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__455)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2489 + * + * @cython.wraparound(False) + * def take_1d_int64_float64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__456 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__456)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__456); + __Pyx_GIVEREF(__pyx_tuple__456); + __pyx_codeobj__457 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__456, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int64_float64, 2489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__457)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2508 + * + * @cython.wraparound(False) + * def take_1d_float32_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + */ + __pyx_tuple__458 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__458)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__458); + __Pyx_GIVEREF(__pyx_tuple__458); + __pyx_codeobj__459 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__458, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float32_float32, 2508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__459)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2527 + * + * @cython.wraparound(False) + * def take_1d_float32_float64(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__460 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__460)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__460); + __Pyx_GIVEREF(__pyx_tuple__460); + __pyx_codeobj__461 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__460, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float32_float64, 2527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__461)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2546 + * + * @cython.wraparound(False) + * def take_1d_float64_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__462 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__462)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__462); + __Pyx_GIVEREF(__pyx_tuple__462); + __pyx_codeobj__463 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__462, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float64_float64, 2546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__463)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2565 + * + * @cython.wraparound(False) + * def take_1d_object_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + __pyx_tuple__464 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__464)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__464); + __Pyx_GIVEREF(__pyx_tuple__464); + __pyx_codeobj__465 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__464, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_object_object, 2565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__465)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2586 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + __pyx_tuple__466 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__466)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__466); + __Pyx_GIVEREF(__pyx_tuple__466); + __pyx_codeobj__467 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__466, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_bool_bool, 2586, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__467)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2631 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_tuple__468 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__468)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__468); + __Pyx_GIVEREF(__pyx_tuple__468); + __pyx_codeobj__469 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__468, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_bool_object, 2631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__469)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + __pyx_tuple__470 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__470)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__470); + __Pyx_GIVEREF(__pyx_tuple__470); + __pyx_codeobj__471 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__470, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int8, 2676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__471)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__472 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__472)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__472); + __Pyx_GIVEREF(__pyx_tuple__472); + __pyx_codeobj__473 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__472, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int32, 2721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__473)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2766 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__474 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__474)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__474); + __Pyx_GIVEREF(__pyx_tuple__474); + __pyx_codeobj__475 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__474, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int64, 2766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__475)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2811 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__476 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__476)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__476); + __Pyx_GIVEREF(__pyx_tuple__476); + __pyx_codeobj__477 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__476, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_float64, 2811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__477)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2856 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + __pyx_tuple__478 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__478)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__478); + __Pyx_GIVEREF(__pyx_tuple__478); + __pyx_codeobj__479 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__478, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int16, 2856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__479)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2901 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__480 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__480)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__480); + __Pyx_GIVEREF(__pyx_tuple__480); + __pyx_codeobj__481 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__480, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int32, 2901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__481)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2946 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__482 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__482)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__482); + __Pyx_GIVEREF(__pyx_tuple__482); + __pyx_codeobj__483 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__482, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int64, 2946, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__483)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2991 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__484 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__484)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__484); + __Pyx_GIVEREF(__pyx_tuple__484); + __pyx_codeobj__485 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__484, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_float64, 2991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__485)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3036 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__486 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__486)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__486); + __Pyx_GIVEREF(__pyx_tuple__486); + __pyx_codeobj__487 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__486, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_int32, 3036, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__487)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3081 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__488 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__488)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__488); + __Pyx_GIVEREF(__pyx_tuple__488); + __pyx_codeobj__489 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__488, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_int64, 3081, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__489)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__490 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__490)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__490); + __Pyx_GIVEREF(__pyx_tuple__490); + __pyx_codeobj__491 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__490, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_float64, 3126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__491)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3171 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__492 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__492)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__492); + __Pyx_GIVEREF(__pyx_tuple__492); + __pyx_codeobj__493 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__492, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int64_int64, 3171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__493)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3216 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__494 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__494)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__494); + __Pyx_GIVEREF(__pyx_tuple__494); + __pyx_codeobj__495 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__494, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int64_float64, 3216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__495)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3261 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + __pyx_tuple__496 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__496)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__496); + __Pyx_GIVEREF(__pyx_tuple__496); + __pyx_codeobj__497 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__496, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float32_float32, 3261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__497)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3306 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__498 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__498)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__498); + __Pyx_GIVEREF(__pyx_tuple__498); + __pyx_codeobj__499 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__498, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float32_float64, 3306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__499)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3351 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__500 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__500)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__500); + __Pyx_GIVEREF(__pyx_tuple__500); + __pyx_codeobj__501 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__500, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float64_float64, 3351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__501)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3396 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_tuple__502 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__502)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__502); + __Pyx_GIVEREF(__pyx_tuple__502); + __pyx_codeobj__503 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__502, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_object_object, 3396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__503)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3442 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + __pyx_tuple__504 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__504)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__504); + __Pyx_GIVEREF(__pyx_tuple__504); + __pyx_codeobj__505 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__504, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_bool_bool, 3442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__505)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3468 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_tuple__506 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__506)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__506); + __Pyx_GIVEREF(__pyx_tuple__506); + __pyx_codeobj__507 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__506, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_bool_object, 3468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__507)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3494 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + __pyx_tuple__508 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__508)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__508); + __Pyx_GIVEREF(__pyx_tuple__508); + __pyx_codeobj__509 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__508, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int8, 3494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__509)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3520 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__510 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__510)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__510); + __Pyx_GIVEREF(__pyx_tuple__510); + __pyx_codeobj__511 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__510, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int32, 3520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__511)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3546 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__512 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__512)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__512); + __Pyx_GIVEREF(__pyx_tuple__512); + __pyx_codeobj__513 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__512, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int64, 3546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__513)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__514 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__514)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__514); + __Pyx_GIVEREF(__pyx_tuple__514); + __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_float64, 3572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + __pyx_tuple__516 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__516)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__516); + __Pyx_GIVEREF(__pyx_tuple__516); + __pyx_codeobj__517 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__516, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int16, 3598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__517)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3624 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__518 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__518)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__518); + __Pyx_GIVEREF(__pyx_tuple__518); + __pyx_codeobj__519 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__518, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int32, 3624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__519)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3650 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__520 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__520)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__520); + __Pyx_GIVEREF(__pyx_tuple__520); + __pyx_codeobj__521 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__520, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int64, 3650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__521)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__522 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__522)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__522); + __Pyx_GIVEREF(__pyx_tuple__522); + __pyx_codeobj__523 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_float64, 3676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__523)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3702 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__524 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__524)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__524); + __Pyx_GIVEREF(__pyx_tuple__524); + __pyx_codeobj__525 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__524, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_int32, 3702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__525)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3728 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__526 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__526)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__526); + __Pyx_GIVEREF(__pyx_tuple__526); + __pyx_codeobj__527 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__526, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_int64, 3728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__527)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3754 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__528 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__528)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__528); + __Pyx_GIVEREF(__pyx_tuple__528); + __pyx_codeobj__529 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__528, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_float64, 3754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__529)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3780 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__530 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__530)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__530); + __Pyx_GIVEREF(__pyx_tuple__530); + __pyx_codeobj__531 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__530, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int64_int64, 3780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__531)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3806 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__532 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__532)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__532); + __Pyx_GIVEREF(__pyx_tuple__532); + __pyx_codeobj__533 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__532, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int64_float64, 3806, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__533)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3832 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + __pyx_tuple__534 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__534)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__534); + __Pyx_GIVEREF(__pyx_tuple__534); + __pyx_codeobj__535 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__534, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float32_float32, 3832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__535)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3858 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__536 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__536)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__536); + __Pyx_GIVEREF(__pyx_tuple__536); + __pyx_codeobj__537 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__536, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float32_float64, 3858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__537)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3884 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__538 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__538)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__538); + __Pyx_GIVEREF(__pyx_tuple__538); + __pyx_codeobj__539 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__538, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float64_float64, 3884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__539)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_tuple__540 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__540)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__540); + __Pyx_GIVEREF(__pyx_tuple__540); + __pyx_codeobj__541 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__540, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_object_object, 3910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__541)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3937 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[uint8_t, ndim=2] out, + */ + __pyx_tuple__542 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__542)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__542); + __Pyx_GIVEREF(__pyx_tuple__542); + __pyx_codeobj__543 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__542, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_bool_bool, 3937, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__543)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3965 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + __pyx_tuple__544 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__544)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__544); + __Pyx_GIVEREF(__pyx_tuple__544); + __pyx_codeobj__545 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__544, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_bool_object, 3965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__545)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3993 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int8_t, ndim=2] out, + */ + __pyx_tuple__546 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__546)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__546); + __Pyx_GIVEREF(__pyx_tuple__546); + __pyx_codeobj__547 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__546, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int8, 3993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__547)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4021 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_tuple__548 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__548)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__548); + __Pyx_GIVEREF(__pyx_tuple__548); + __pyx_codeobj__549 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__548, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int32, 4021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__549)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4049 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_tuple__550 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__550)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__550); + __Pyx_GIVEREF(__pyx_tuple__550); + __pyx_codeobj__551 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__550, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int64, 4049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__551)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4077 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__552 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__552)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__552); + __Pyx_GIVEREF(__pyx_tuple__552); + __pyx_codeobj__553 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__552, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_float64, 4077, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__553)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4105 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int16_t, ndim=2] out, + */ + __pyx_tuple__554 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__554)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__554); + __Pyx_GIVEREF(__pyx_tuple__554); + __pyx_codeobj__555 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__554, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int16, 4105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__555)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_tuple__556 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__556)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__556); + __Pyx_GIVEREF(__pyx_tuple__556); + __pyx_codeobj__557 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__556, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int32, 4133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__557)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4161 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_tuple__558 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__558)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__558); + __Pyx_GIVEREF(__pyx_tuple__558); + __pyx_codeobj__559 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__558, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int64, 4161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__559)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4189 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__560 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__560)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__560); + __Pyx_GIVEREF(__pyx_tuple__560); + __pyx_codeobj__561 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__560, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_float64, 4189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__561)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4217 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_tuple__562 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__562)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__562); + __Pyx_GIVEREF(__pyx_tuple__562); + __pyx_codeobj__563 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__562, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_int32, 4217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__563)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4245 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_tuple__564 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__564)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__564); + __Pyx_GIVEREF(__pyx_tuple__564); + __pyx_codeobj__565 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__564, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_int64, 4245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__565)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4273 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__566 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__566)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__566); + __Pyx_GIVEREF(__pyx_tuple__566); + __pyx_codeobj__567 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__566, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_float64, 4273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__567)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_tuple__568 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__568)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__568); + __Pyx_GIVEREF(__pyx_tuple__568); + __pyx_codeobj__569 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__568, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int64_int64, 4301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__569)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4329 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__570 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__570)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__570); + __Pyx_GIVEREF(__pyx_tuple__570); + __pyx_codeobj__571 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__570, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int64_float64, 4329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__571)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4357 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float32_t, ndim=2] out, + */ + __pyx_tuple__572 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__572)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__572); + __Pyx_GIVEREF(__pyx_tuple__572); + __pyx_codeobj__573 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__572, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float32_float32, 4357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__573)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4385 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__574 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__574)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__574); + __Pyx_GIVEREF(__pyx_tuple__574); + __pyx_codeobj__575 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__574, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float32_float64, 4385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__575)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4413 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__576 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__576)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__576); + __Pyx_GIVEREF(__pyx_tuple__576); + __pyx_codeobj__577 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__576, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float64_float64, 4413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__577)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4441 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_object_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + __pyx_tuple__578 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__578)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__578); + __Pyx_GIVEREF(__pyx_tuple__578); + __pyx_codeobj__579 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__578, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_object_object, 4441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__579)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4470 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float64(ndarray[float64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__580 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__580)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__580); + __Pyx_GIVEREF(__pyx_tuple__580); + __pyx_codeobj__581 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__580, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_float64, 4470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__581)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4513 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float32(ndarray[float32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__582 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__582)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__582); + __Pyx_GIVEREF(__pyx_tuple__582); + __pyx_codeobj__583 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__582, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_float32, 4513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__583)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4556 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int8(ndarray[int8_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__584 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__584)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__584); + __Pyx_GIVEREF(__pyx_tuple__584); + __pyx_codeobj__585 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__584, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int8, 4556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__585)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4599 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int16(ndarray[int16_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__586 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__586)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__586); + __Pyx_GIVEREF(__pyx_tuple__586); + __pyx_codeobj__587 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__586, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int16, 4599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__587)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4642 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int32(ndarray[int32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__588 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__588)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__588); + __Pyx_GIVEREF(__pyx_tuple__588); + __pyx_codeobj__589 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__588, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int32, 4642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__589)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4685 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int64(ndarray[int64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__590 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__590)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__590); + __Pyx_GIVEREF(__pyx_tuple__590); + __pyx_codeobj__591 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__590, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int64, 4685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__591)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4729 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__592 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__592)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__592); + __Pyx_GIVEREF(__pyx_tuple__592); + __pyx_codeobj__593 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__592, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_float64, 4729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__593)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4772 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__594 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__594)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__594); + __Pyx_GIVEREF(__pyx_tuple__594); + __pyx_codeobj__595 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__594, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_float32, 4772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__595)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4816 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__596 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__596)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__596); + __Pyx_GIVEREF(__pyx_tuple__596); + __pyx_codeobj__597 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__596, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_float64, 4816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__597)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4860 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__598 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__598)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__598); + __Pyx_GIVEREF(__pyx_tuple__598); + __pyx_codeobj__599 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__598, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_float32, 4860, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__599)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4905 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__600 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__600)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__600); + __Pyx_GIVEREF(__pyx_tuple__600); + __pyx_codeobj__601 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__600, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_float64, 4905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__601)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4949 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__602 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__602)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__602); + __Pyx_GIVEREF(__pyx_tuple__602); + __pyx_codeobj__603 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__602, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_float32, 4949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__603)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4994 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__604 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__604)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__604); + __Pyx_GIVEREF(__pyx_tuple__604); + __pyx_codeobj__605 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__604, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_float64, 4994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__605)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5039 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__606 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__606)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__606); + __Pyx_GIVEREF(__pyx_tuple__606); + __pyx_codeobj__607 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__606, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_float32, 5039, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__607)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5085 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__608 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__608)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__608); + __Pyx_GIVEREF(__pyx_tuple__608); + __pyx_codeobj__609 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__608, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_float64, 5085, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__609)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5141 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__610 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__610)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__610); + __Pyx_GIVEREF(__pyx_tuple__610); + __pyx_codeobj__611 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__610, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_float32, 5141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__611)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__612 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_nbins, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__612)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__612); + __Pyx_GIVEREF(__pyx_tuple__612); + __pyx_codeobj__613 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__612, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_bin_float64, 5198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__613)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5254 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__614 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_nbins, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__614)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__614); + __Pyx_GIVEREF(__pyx_tuple__614); + __pyx_codeobj__615 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__614, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_bin_float32, 5254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__615)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5311 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__616 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__616)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__616); + __Pyx_GIVEREF(__pyx_tuple__616); + __pyx_codeobj__617 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__616, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_float64, 5311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__617)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5367 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__618 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__618)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__618); + __Pyx_GIVEREF(__pyx_tuple__618); + __pyx_codeobj__619 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__618, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_float32, 5367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__619)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__620 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__620)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__620); + __Pyx_GIVEREF(__pyx_tuple__620); + __pyx_codeobj__621 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__620, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_bin_float64, 5424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__621)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5480 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__622 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__622)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__622); + __Pyx_GIVEREF(__pyx_tuple__622); + __pyx_codeobj__623 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__622, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_bin_float32, 5480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__623)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5537 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__624 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__624)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__624); + __Pyx_GIVEREF(__pyx_tuple__624); + __pyx_codeobj__625 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__624, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_float64, 5537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__625)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__626 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__626)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__626); + __Pyx_GIVEREF(__pyx_tuple__626); + __pyx_codeobj__627 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__626, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_float32, 5598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__627)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5660 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__628 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__628)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__628); + __Pyx_GIVEREF(__pyx_tuple__628); + __pyx_codeobj__629 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__628, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_bin_float64, 5660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__629)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__630 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__630)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__630); + __Pyx_GIVEREF(__pyx_tuple__630); + __pyx_codeobj__631 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__630, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_bin_float32, 5721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__631)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5783 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__632 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__632)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__632); + __Pyx_GIVEREF(__pyx_tuple__632); + __pyx_codeobj__633 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__632, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_float64, 5783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__633)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5835 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__634 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__634)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__634); + __Pyx_GIVEREF(__pyx_tuple__634); + __pyx_codeobj__635 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__634, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_float32, 5835, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__635)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5887 + * + * + * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__636 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__636)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__636); + __Pyx_GIVEREF(__pyx_tuple__636); + __pyx_codeobj__637 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__636, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_bin_float64, 5887, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__637)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5940 + * out[i, j] = sumx[i, j] / count + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__638 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__638)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__638); + __Pyx_GIVEREF(__pyx_tuple__638); + __pyx_codeobj__639 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__638, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_bin_float32, 5940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__639)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5995 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__640 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__640)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__640); + __Pyx_GIVEREF(__pyx_tuple__640); + __pyx_codeobj__641 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__640, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_float64, 5995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__641)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6055 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__642 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__642)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__642); + __Pyx_GIVEREF(__pyx_tuple__642); + __pyx_codeobj__643 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__642, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_float32, 6055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__643)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6116 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__644 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__644)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__644); + __Pyx_GIVEREF(__pyx_tuple__644); + __pyx_codeobj__645 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__644, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_float64, 6116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__645)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6177 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__646 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__646)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__646); + __Pyx_GIVEREF(__pyx_tuple__646); + __pyx_codeobj__647 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__646, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_float32, 6177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__647)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6239 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__648 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__648)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__648); + __Pyx_GIVEREF(__pyx_tuple__648); + __pyx_codeobj__649 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__648, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_float64, 6239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__649)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6299 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__650 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__650)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__650); + __Pyx_GIVEREF(__pyx_tuple__650); + __pyx_codeobj__651 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__650, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_float32, 6299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__651)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6360 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__652 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__652)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__652); + __Pyx_GIVEREF(__pyx_tuple__652); + __pyx_codeobj__653 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__652, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_float64, 6360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__653)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6420 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__654 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__654)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__654); + __Pyx_GIVEREF(__pyx_tuple__654); + __pyx_codeobj__655 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__654, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_float32, 6420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__655)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6481 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__656 = PyTuple_Pack(18, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_vopen, __pyx_n_s_vhigh, __pyx_n_s_vlow, __pyx_n_s_vclose, __pyx_n_s_NA, __pyx_n_s_got_first); if (unlikely(!__pyx_tuple__656)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__656); + __Pyx_GIVEREF(__pyx_tuple__656); + __pyx_codeobj__657 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__656, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_ohlc_float64, 6481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__657)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6554 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__658 = PyTuple_Pack(18, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_vopen, __pyx_n_s_vhigh, __pyx_n_s_vlow, __pyx_n_s_vclose, __pyx_n_s_NA, __pyx_n_s_got_first); if (unlikely(!__pyx_tuple__658)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__658); + __Pyx_GIVEREF(__pyx_tuple__658); + __pyx_codeobj__659 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__658, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_ohlc_float32, 6554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__659)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6628 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__660 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__660)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__660); + __Pyx_GIVEREF(__pyx_tuple__660); + __pyx_codeobj__661 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__660, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_float64, 6628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__661)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__662 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__662)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__662); + __Pyx_GIVEREF(__pyx_tuple__662); + __pyx_codeobj__663 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__662, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_float32, 6664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__663)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6700 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__664 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__664)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__664); + __Pyx_GIVEREF(__pyx_tuple__664); + __pyx_codeobj__665 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__664, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_object, 6700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__665)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6736 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + __pyx_tuple__666 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__666)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__666); + __Pyx_GIVEREF(__pyx_tuple__666); + __pyx_codeobj__667 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__666, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_int64, 6736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__667)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6773 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__668 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__668)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__668); + __Pyx_GIVEREF(__pyx_tuple__668); + __pyx_codeobj__669 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__668, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_float64, 6773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__669)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6807 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__670 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__670)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__670); + __Pyx_GIVEREF(__pyx_tuple__670); + __pyx_codeobj__671 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__670, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_float32, 6807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__671)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6841 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__672 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__672)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__672); + __Pyx_GIVEREF(__pyx_tuple__672); + __pyx_codeobj__673 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__672, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_object, 6841, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__673)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6875 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + __pyx_tuple__674 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__674)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__674); + __Pyx_GIVEREF(__pyx_tuple__674); + __pyx_codeobj__675 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__674, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_int64, 6875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__675)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + __pyx_tuple__676 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__676)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__676); + __Pyx_GIVEREF(__pyx_tuple__676); + __pyx_codeobj__677 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__676, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_float64, 6910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__677)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6955 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + __pyx_tuple__678 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__678)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__678); + __Pyx_GIVEREF(__pyx_tuple__678); + __pyx_codeobj__679 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__678, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_float32, 6955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__679)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7000 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + __pyx_tuple__680 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__680)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__680); + __Pyx_GIVEREF(__pyx_tuple__680); + __pyx_codeobj__681 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__680, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_object, 7000, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__681)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7045 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + __pyx_tuple__682 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__682)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__682); + __Pyx_GIVEREF(__pyx_tuple__682); + __pyx_codeobj__683 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__682, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_int32, 7045, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__683)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7090 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + __pyx_tuple__684 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__684)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__684); + __Pyx_GIVEREF(__pyx_tuple__684); + __pyx_codeobj__685 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__684, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_int64, 7090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__685)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7135 + * + * + * def left_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + __pyx_tuple__686 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__686)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__686); + __Pyx_GIVEREF(__pyx_tuple__686); + __pyx_codeobj__687 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__686, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_float64, 7135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__687)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7237 + * + * + * def left_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + __pyx_tuple__688 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__688)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__688); + __Pyx_GIVEREF(__pyx_tuple__688); + __pyx_codeobj__689 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__688, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_float32, 7237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__689)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7339 + * + * + * def left_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + __pyx_tuple__690 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__690)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__690); + __Pyx_GIVEREF(__pyx_tuple__690); + __pyx_codeobj__691 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__690, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_object, 7339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__691)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7441 + * + * + * def left_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + __pyx_tuple__692 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__692)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__692); + __Pyx_GIVEREF(__pyx_tuple__692); + __pyx_codeobj__693 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__692, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_int32, 7441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__693)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7543 + * + * + * def left_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + __pyx_tuple__694 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__694)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__694); + __Pyx_GIVEREF(__pyx_tuple__694); + __pyx_codeobj__695 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__694, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_int64, 7543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__695)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7647 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + __pyx_tuple__696 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__696)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__696); + __Pyx_GIVEREF(__pyx_tuple__696); + __pyx_codeobj__697 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__696, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_float64, 7647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__697)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7776 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + __pyx_tuple__698 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__698)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__698); + __Pyx_GIVEREF(__pyx_tuple__698); + __pyx_codeobj__699 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__698, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_float32, 7776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__699)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7905 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + __pyx_tuple__700 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__700)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__700); + __Pyx_GIVEREF(__pyx_tuple__700); + __pyx_codeobj__701 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__700, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_object, 7905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__701)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8034 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + __pyx_tuple__702 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__702)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__702); + __Pyx_GIVEREF(__pyx_tuple__702); + __pyx_codeobj__703 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__702, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_int32, 8034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__703)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + __pyx_tuple__704 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__704)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__704); + __Pyx_GIVEREF(__pyx_tuple__704); + __pyx_codeobj__705 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__704, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_int64, 8163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__705)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8293 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + __pyx_tuple__706 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__706)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__706); + __Pyx_GIVEREF(__pyx_tuple__706); + __pyx_codeobj__707 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__706, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_float64, 8293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__707)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8386 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + __pyx_tuple__708 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__708)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__708); + __Pyx_GIVEREF(__pyx_tuple__708); + __pyx_codeobj__709 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__708, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_float32, 8386, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__709)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8479 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + __pyx_tuple__710 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__710)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__710); + __Pyx_GIVEREF(__pyx_tuple__710); + __pyx_codeobj__711 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__710, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_object, 8479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__711)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + __pyx_tuple__712 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__712)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__712); + __Pyx_GIVEREF(__pyx_tuple__712); + __pyx_codeobj__713 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__712, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_int32, 8572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__713)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8665 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + __pyx_tuple__714 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__714)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__714); + __Pyx_GIVEREF(__pyx_tuple__714); + __pyx_codeobj__715 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__714, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_int64, 8665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__715)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":276 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__716 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__716)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__716); + __Pyx_GIVEREF(__pyx_tuple__716); + + /* "View.MemoryView":277 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__717 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__717)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__717); + __Pyx_GIVEREF(__pyx_tuple__717); + + /* "View.MemoryView":278 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__718 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__718)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__718); + __Pyx_GIVEREF(__pyx_tuple__718); + + /* "View.MemoryView":281 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__719 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__719)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__719); + __Pyx_GIVEREF(__pyx_tuple__719); + + /* "View.MemoryView":282 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__720 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__720)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__720); + __Pyx_GIVEREF(__pyx_tuple__720); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initalgos(void); /*proto*/ +PyMODINIT_FUNC initalgos(void) +#else +PyMODINIT_FUNC PyInit_algos(void); /*proto*/ +PyMODINIT_FUNC PyInit_algos(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_int8_t __pyx_t_4; + __pyx_t_5numpy_int16_t __pyx_t_5; + __pyx_t_5numpy_int32_t __pyx_t_6; + __pyx_t_5numpy_int64_t __pyx_t_7; + __pyx_t_5numpy_float16_t __pyx_t_8; + __pyx_t_5numpy_float32_t __pyx_t_9; + __pyx_t_5numpy_float64_t __pyx_t_10; + double __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_algos(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("algos"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__algos) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.algos")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.algos", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6pandas_5algos_Node) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5algos_Node.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Node", (PyObject *)&__pyx_type_6pandas_5algos_Node) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5algos_Node = &__pyx_type_6pandas_5algos_Node; + __pyx_vtabptr_6pandas_5algos_IndexableSkiplist = &__pyx_vtable_6pandas_5algos_IndexableSkiplist; + __pyx_vtable_6pandas_5algos_IndexableSkiplist.get = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_get; + __pyx_vtable_6pandas_5algos_IndexableSkiplist.insert = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_insert; + __pyx_vtable_6pandas_5algos_IndexableSkiplist.remove = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_remove; + if (PyType_Ready(&__pyx_type_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5algos_IndexableSkiplist.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5algos_IndexableSkiplist.tp_dict, __pyx_vtabptr_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "IndexableSkiplist", (PyObject *)&__pyx_type_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5algos_IndexableSkiplist = &__pyx_type_6pandas_5algos_IndexableSkiplist; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_array.tp_print = 0; + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_MemviewEnum.tp_print = 0; + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/algos.pyx":3 + * from numpy cimport * + * cimport numpy as np + * import numpy as np # <<<<<<<<<<<<<< + * + * cimport cython + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":7 + * cimport cython + * + * import_array() # <<<<<<<<<<<<<< + * + * cdef float64_t FP_ERR = 1e-13 + */ + import_array(); + + /* "pandas/algos.pyx":9 + * import_array() + * + * cdef float64_t FP_ERR = 1e-13 # <<<<<<<<<<<<<< + * cdef float64_t REL_TOL = 1e-07 + * + */ + __pyx_v_6pandas_5algos_FP_ERR = 1e-13; + + /* "pandas/algos.pyx":10 + * + * cdef float64_t FP_ERR = 1e-13 + * cdef float64_t REL_TOL = 1e-07 # <<<<<<<<<<<<<< + * + * cimport util + */ + __pyx_v_6pandas_5algos_REL_TOL = 1e-07; + + /* "pandas/algos.pyx":27 + * uint32_t, uint64_t, float16_t, float32_t, float64_t) + * + * int8 = np.dtype(np.int8) # <<<<<<<<<<<<<< + * int16 = np.dtype(np.int16) + * int32 = np.dtype(np.int32) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_int8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":28 + * + * int8 = np.dtype(np.int8) + * int16 = np.dtype(np.int16) # <<<<<<<<<<<<<< + * int32 = np.dtype(np.int32) + * int64 = np.dtype(np.int64) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_int16, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":29 + * int8 = np.dtype(np.int8) + * int16 = np.dtype(np.int16) + * int32 = np.dtype(np.int32) # <<<<<<<<<<<<<< + * int64 = np.dtype(np.int64) + * float16 = np.dtype(np.float16) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_int32, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":30 + * int16 = np.dtype(np.int16) + * int32 = np.dtype(np.int32) + * int64 = np.dtype(np.int64) # <<<<<<<<<<<<<< + * float16 = np.dtype(np.float16) + * float32 = np.dtype(np.float32) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_int64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":31 + * int32 = np.dtype(np.int32) + * int64 = np.dtype(np.int64) + * float16 = np.dtype(np.float16) # <<<<<<<<<<<<<< + * float32 = np.dtype(np.float32) + * float64 = np.dtype(np.float64) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_float16, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":32 + * int64 = np.dtype(np.int64) + * float16 = np.dtype(np.float16) + * float32 = np.dtype(np.float32) # <<<<<<<<<<<<<< + * float64 = np.dtype(np.float64) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_float32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":33 + * float16 = np.dtype(np.float16) + * float32 = np.dtype(np.float32) + * float64 = np.dtype(np.float64) # <<<<<<<<<<<<<< + * + * cdef np.int8_t MINint8 = np.iinfo(np.int8).min + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_float64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":35 + * float64 = np.dtype(np.float64) + * + * cdef np.int8_t MINint8 = np.iinfo(np.int8).min # <<<<<<<<<<<<<< + * cdef np.int16_t MINint16 = np.iinfo(np.int16).min + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_int8(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINint8 = __pyx_t_4; + + /* "pandas/algos.pyx":36 + * + * cdef np.int8_t MINint8 = np.iinfo(np.int8).min + * cdef np.int16_t MINint16 = np.iinfo(np.int16).min # <<<<<<<<<<<<<< + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_t_2); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINint16 = __pyx_t_5; + + /* "pandas/algos.pyx":37 + * cdef np.int8_t MINint8 = np.iinfo(np.int8).min + * cdef np.int16_t MINint16 = np.iinfo(np.int16).min + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min # <<<<<<<<<<<<<< + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min + * cdef np.float16_t MINfloat16 = np.NINF + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINint32 = __pyx_t_6; + + /* "pandas/algos.pyx":38 + * cdef np.int16_t MINint16 = np.iinfo(np.int16).min + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min # <<<<<<<<<<<<<< + * cdef np.float16_t MINfloat16 = np.NINF + * cdef np.float32_t MINfloat32 = np.NINF + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINint64 = __pyx_t_7; + + /* "pandas/algos.pyx":39 + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min + * cdef np.float16_t MINfloat16 = np.NINF # <<<<<<<<<<<<<< + * cdef np.float32_t MINfloat32 = np.NINF + * cdef np.float64_t MINfloat64 = np.NINF + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NINF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_8 == (npy_float16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MINfloat16 = __pyx_t_8; + + /* "pandas/algos.pyx":40 + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min + * cdef np.float16_t MINfloat16 = np.NINF + * cdef np.float32_t MINfloat32 = np.NINF # <<<<<<<<<<<<<< + * cdef np.float64_t MINfloat64 = np.NINF + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NINF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_9 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINfloat32 = __pyx_t_9; + + /* "pandas/algos.pyx":41 + * cdef np.float16_t MINfloat16 = np.NINF + * cdef np.float32_t MINfloat32 = np.NINF + * cdef np.float64_t MINfloat64 = np.NINF # <<<<<<<<<<<<<< + * + * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NINF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MINfloat64 = __pyx_t_10; + + /* "pandas/algos.pyx":43 + * cdef np.float64_t MINfloat64 = np.NINF + * + * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max # <<<<<<<<<<<<<< + * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXint8 = __pyx_t_4; + + /* "pandas/algos.pyx":44 + * + * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max + * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max # <<<<<<<<<<<<<< + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXint16 = __pyx_t_5; + + /* "pandas/algos.pyx":45 + * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max + * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max # <<<<<<<<<<<<<< + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max + * cdef np.float16_t MAXfloat16 = np.inf + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXint32 = __pyx_t_6; + + /* "pandas/algos.pyx":46 + * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max # <<<<<<<<<<<<<< + * cdef np.float16_t MAXfloat16 = np.inf + * cdef np.float32_t MAXfloat32 = np.inf + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXint64 = __pyx_t_7; + + /* "pandas/algos.pyx":47 + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max + * cdef np.float16_t MAXfloat16 = np.inf # <<<<<<<<<<<<<< + * cdef np.float32_t MAXfloat32 = np.inf + * cdef np.float64_t MAXfloat64 = np.inf + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (npy_float16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MAXfloat16 = __pyx_t_8; + + /* "pandas/algos.pyx":48 + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max + * cdef np.float16_t MAXfloat16 = np.inf + * cdef np.float32_t MAXfloat32 = np.inf # <<<<<<<<<<<<<< + * cdef np.float64_t MAXfloat64 = np.inf + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_9 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXfloat32 = __pyx_t_9; + + /* "pandas/algos.pyx":49 + * cdef np.float16_t MAXfloat16 = np.inf + * cdef np.float32_t MAXfloat32 = np.inf + * cdef np.float64_t MAXfloat64 = np.inf # <<<<<<<<<<<<<< + * + * cdef double NaN = np.NaN + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MAXfloat64 = __pyx_t_10; + + /* "pandas/algos.pyx":51 + * cdef np.float64_t MAXfloat64 = np.inf + * + * cdef double NaN = np.NaN # <<<<<<<<<<<<<< + * cdef double nan = NaN + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_NaN = ((double)__pyx_t_11); + + /* "pandas/algos.pyx":52 + * + * cdef double NaN = np.NaN + * cdef double nan = NaN # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6pandas_5algos_nan = __pyx_v_6pandas_5algos_NaN; + + /* "pandas/algos.pyx":64 + * int signbit(double) + * + * from pandas import lib # <<<<<<<<<<<<<< + * + * include "skiplist.pyx" + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_lib); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_lib); + __Pyx_GIVEREF(__pyx_n_s_lib); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":23 + * cimport numpy as np + * from numpy cimport * + * import numpy as np # <<<<<<<<<<<<<< + * + * from random import random + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":25 + * import numpy as np + * + * from random import random # <<<<<<<<<<<<<< + * + * # initialize numpy + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_random); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_random); + __Pyx_GIVEREF(__pyx_n_s_random); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":28 + * + * # initialize numpy + * import_array() # <<<<<<<<<<<<<< + * + * # TODO: optimize this, make less messy + */ + import_array(); + + /* "pandas/src/skiplist.pyx":44 + * + * # Singleton terminator node + * NIL = Node(np.inf, [], []) # <<<<<<<<<<<<<< + * + * cdef class IndexableSkiplist: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NIL, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":70 + * + * cdef: + * int TIEBREAK_AVERAGE = 0 # <<<<<<<<<<<<<< + * int TIEBREAK_MIN = 1 + * int TIEBREAK_MAX = 2 + */ + __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE = 0; + + /* "pandas/algos.pyx":71 + * cdef: + * int TIEBREAK_AVERAGE = 0 + * int TIEBREAK_MIN = 1 # <<<<<<<<<<<<<< + * int TIEBREAK_MAX = 2 + * int TIEBREAK_FIRST = 3 + */ + __pyx_v_6pandas_5algos_TIEBREAK_MIN = 1; + + /* "pandas/algos.pyx":72 + * int TIEBREAK_AVERAGE = 0 + * int TIEBREAK_MIN = 1 + * int TIEBREAK_MAX = 2 # <<<<<<<<<<<<<< + * int TIEBREAK_FIRST = 3 + * int TIEBREAK_FIRST_DESCENDING = 4 + */ + __pyx_v_6pandas_5algos_TIEBREAK_MAX = 2; + + /* "pandas/algos.pyx":73 + * int TIEBREAK_MIN = 1 + * int TIEBREAK_MAX = 2 + * int TIEBREAK_FIRST = 3 # <<<<<<<<<<<<<< + * int TIEBREAK_FIRST_DESCENDING = 4 + * int TIEBREAK_DENSE = 5 + */ + __pyx_v_6pandas_5algos_TIEBREAK_FIRST = 3; + + /* "pandas/algos.pyx":74 + * int TIEBREAK_MAX = 2 + * int TIEBREAK_FIRST = 3 + * int TIEBREAK_FIRST_DESCENDING = 4 # <<<<<<<<<<<<<< + * int TIEBREAK_DENSE = 5 + * + */ + __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING = 4; + + /* "pandas/algos.pyx":75 + * int TIEBREAK_FIRST = 3 + * int TIEBREAK_FIRST_DESCENDING = 4 + * int TIEBREAK_DENSE = 5 # <<<<<<<<<<<<<< + * + * tiebreakers = { + */ + __pyx_v_6pandas_5algos_TIEBREAK_DENSE = 5; + + /* "pandas/algos.pyx":77 + * int TIEBREAK_DENSE = 5 + * + * tiebreakers = { # <<<<<<<<<<<<<< + * 'average' : TIEBREAK_AVERAGE, + * 'min' : TIEBREAK_MIN, + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/algos.pyx":78 + * + * tiebreakers = { + * 'average' : TIEBREAK_AVERAGE, # <<<<<<<<<<<<<< + * 'min' : TIEBREAK_MIN, + * 'max' : TIEBREAK_MAX, + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_AVERAGE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_average, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":79 + * tiebreakers = { + * 'average' : TIEBREAK_AVERAGE, + * 'min' : TIEBREAK_MIN, # <<<<<<<<<<<<<< + * 'max' : TIEBREAK_MAX, + * 'first' : TIEBREAK_FIRST, + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_MIN); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":80 + * 'average' : TIEBREAK_AVERAGE, + * 'min' : TIEBREAK_MIN, + * 'max' : TIEBREAK_MAX, # <<<<<<<<<<<<<< + * 'first' : TIEBREAK_FIRST, + * 'dense' : TIEBREAK_DENSE, + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_MAX); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_max, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":81 + * 'min' : TIEBREAK_MIN, + * 'max' : TIEBREAK_MAX, + * 'first' : TIEBREAK_FIRST, # <<<<<<<<<<<<<< + * 'dense' : TIEBREAK_DENSE, + * } + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_FIRST); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_first, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":82 + * 'max' : TIEBREAK_MAX, + * 'first' : TIEBREAK_FIRST, + * 'dense' : TIEBREAK_DENSE, # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_DENSE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dense, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tiebreakers, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_1rank_1d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_float64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_3rank_1d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_int64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_5rank_2d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_float64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_7rank_2d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_int64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_9rank_1d_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_generic, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":565 + * return left != right + * + * _return_false = lambda self, other: False # <<<<<<<<<<<<<< + * _return_true = lambda self, other: True + * + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5algos_510lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_false, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":566 + * + * _return_false = lambda self, other: False + * _return_true = lambda self, other: True # <<<<<<<<<<<<<< + * + * class Infinity(object): + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5algos_511lambda2, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_true, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":568 + * _return_true = lambda self, other: True + * + * class Infinity(object): # <<<<<<<<<<<<<< + * + * __lt__ = _return_false + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __pyx_t_3, __pyx_n_s_Infinity, __pyx_n_s_Infinity, (PyObject *) NULL, __pyx_n_s_pandas_algos, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/algos.pyx":570 + * class Infinity(object): + * + * __lt__ = _return_false # <<<<<<<<<<<<<< + * __le__ = _return_false + * __eq__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_lt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":571 + * + * __lt__ = _return_false + * __le__ = _return_false # <<<<<<<<<<<<<< + * __eq__ = _return_false + * __ne__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_le, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":572 + * __lt__ = _return_false + * __le__ = _return_false + * __eq__ = _return_false # <<<<<<<<<<<<<< + * __ne__ = _return_true + * __gt__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_eq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":573 + * __le__ = _return_false + * __eq__ = _return_false + * __ne__ = _return_true # <<<<<<<<<<<<<< + * __gt__ = _return_true + * __ge__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ne, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":574 + * __eq__ = _return_false + * __ne__ = _return_true + * __gt__ = _return_true # <<<<<<<<<<<<<< + * __ge__ = _return_true + * __cmp__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_gt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":575 + * __ne__ = _return_true + * __gt__ = _return_true + * __ge__ = _return_true # <<<<<<<<<<<<<< + * __cmp__ = _return_false + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ge, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":576 + * __gt__ = _return_true + * __ge__ = _return_true + * __cmp__ = _return_false # <<<<<<<<<<<<<< + * + * class NegInfinity(object): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_cmp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":568 + * _return_true = lambda self, other: True + * + * class Infinity(object): # <<<<<<<<<<<<<< + * + * __lt__ = _return_false + */ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_Infinity, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Infinity, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":578 + * __cmp__ = _return_false + * + * class NegInfinity(object): # <<<<<<<<<<<<<< + * + * __lt__ = _return_true + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __pyx_t_3, __pyx_n_s_NegInfinity, __pyx_n_s_NegInfinity, (PyObject *) NULL, __pyx_n_s_pandas_algos, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/algos.pyx":580 + * class NegInfinity(object): + * + * __lt__ = _return_true # <<<<<<<<<<<<<< + * __le__ = _return_true + * __eq__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_lt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":581 + * + * __lt__ = _return_true + * __le__ = _return_true # <<<<<<<<<<<<<< + * __eq__ = _return_false + * __ne__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_le, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":582 + * __lt__ = _return_true + * __le__ = _return_true + * __eq__ = _return_false # <<<<<<<<<<<<<< + * __ne__ = _return_true + * __gt__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_eq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":583 + * __le__ = _return_true + * __eq__ = _return_false + * __ne__ = _return_true # <<<<<<<<<<<<<< + * __gt__ = _return_false + * __ge__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ne, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":584 + * __eq__ = _return_false + * __ne__ = _return_true + * __gt__ = _return_false # <<<<<<<<<<<<<< + * __ge__ = _return_false + * __cmp__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_gt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":585 + * __ne__ = _return_true + * __gt__ = _return_false + * __ge__ = _return_false # <<<<<<<<<<<<<< + * __cmp__ = _return_true + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ge, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":586 + * __gt__ = _return_false + * __ge__ = _return_false + * __cmp__ = _return_true # <<<<<<<<<<<<<< + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_cmp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":578 + * __cmp__ = _return_false + * + * class NegInfinity(object): # <<<<<<<<<<<<<< + * + * __lt__ = _return_true + */ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_NegInfinity, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NegInfinity, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_11rank_2d_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_generic, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":715 + * # - + * + * def _check_minp(win, minp, N): # <<<<<<<<<<<<<< + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_13_check_minp, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_minp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_6pandas_5algos_513__pyx_fuse_0kth_smallest, 0, __pyx_n_s_pyx_fuse_0kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_6pandas_5algos_515__pyx_fuse_1kth_smallest, 0, __pyx_n_s_pyx_fuse_1kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_6pandas_5algos_517__pyx_fuse_2kth_smallest, 0, __pyx_n_s_pyx_fuse_2kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_6pandas_5algos_519__pyx_fuse_3kth_smallest, 0, __pyx_n_s_pyx_fuse_3kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_6pandas_5algos_521__pyx_fuse_4kth_smallest, 0, __pyx_n_s_pyx_fuse_4kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_6pandas_5algos_523__pyx_fuse_5kth_smallest, 0, __pyx_n_s_pyx_fuse_5kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_6pandas_5algos_525__pyx_fuse_6kth_smallest, 0, __pyx_n_s_pyx_fuse_6kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_6pandas_5algos_527__pyx_fuse_7kth_smallest, 0, __pyx_n_s_pyx_fuse_7kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_6pandas_5algos_529__pyx_fuse_8kth_smallest, 0, __pyx_n_s_pyx_fuse_8kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_6pandas_5algos_531__pyx_fuse_9kth_smallest, 0, __pyx_n_s_pyx_fuse_9kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6pandas_5algos_15kth_smallest, 0, __pyx_n_s_kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + ((__pyx_FusedFunctionObject *) __pyx_t_12)->__signatures__ = __pyx_t_3; + __Pyx_GIVEREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_kth_smallest, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_6pandas_5algos_535__pyx_fuse_0median, 0, __pyx_n_s_pyx_fuse_0median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_6pandas_5algos_537__pyx_fuse_1median, 0, __pyx_n_s_pyx_fuse_1median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_6pandas_5algos_539__pyx_fuse_2median, 0, __pyx_n_s_pyx_fuse_2median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_6pandas_5algos_541__pyx_fuse_3median, 0, __pyx_n_s_pyx_fuse_3median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_6pandas_5algos_543__pyx_fuse_4median, 0, __pyx_n_s_pyx_fuse_4median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_6pandas_5algos_545__pyx_fuse_5median, 0, __pyx_n_s_pyx_fuse_5median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_6pandas_5algos_547__pyx_fuse_6median, 0, __pyx_n_s_pyx_fuse_6median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_6pandas_5algos_549__pyx_fuse_7median, 0, __pyx_n_s_pyx_fuse_7median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_6pandas_5algos_551__pyx_fuse_8median, 0, __pyx_n_s_pyx_fuse_8median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_6pandas_5algos_553__pyx_fuse_9median, 0, __pyx_n_s_pyx_fuse_9median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6pandas_5algos_17median, 0, __pyx_n_s_median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_median, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":843 + * # -------------- Min, Max subsequence + * + * def max_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_19max_subseq, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_max_subseq, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":871 + * return (s, e, m) + * + * def min_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s, e + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_21min_subseq, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_subseq, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":883 + * # Rolling sum + * + * def roll_sum(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_23roll_sum, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_sum, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":925 + * # Rolling mean + * + * def roll_mean(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_25roll_mean, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_mean, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":982 + * # Exponentially weighted moving average + * + * def ewma(ndarray[double_t] input, double_t com, int adjust): # <<<<<<<<<<<<<< + * ''' + * Compute exponentially-weighted moving average using center-of-mass. + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_27ewma, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ewma, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1044 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_29nancorr, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nancorr, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1103 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_31nancorr_spearman, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nancorr_spearman, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1164 + * # Rolling variance + * + * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1): # <<<<<<<<<<<<<< + * """ + * Numerically stable implementation using Welford's method. + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_33roll_var, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_var, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1253 + * # Rolling skewness + * + * def roll_skew(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_35roll_skew, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_skew, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1317 + * + * + * def roll_kurt(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef double val, prev + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_37roll_kurt, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_kurt, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1437 + * from skiplist cimport * + * + * def roll_median_c(ndarray[float64_t] arg, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, res, prev + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_39roll_median_c, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_median_c, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1492 + * return output + * + * def roll_median_cython(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_41roll_median_cython, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_median_cython, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1528 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_max2(ndarray[float64_t] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_43roll_max2, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_max2, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1608 + * return y + * + * def roll_max(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_45roll_max, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_max, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1621 + * return NaN + * + * def roll_min(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_47roll_min, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_min, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1629 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_49roll_min2, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_min2, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1715 + * return NaN + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, double quantile): + * ''' + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_51roll_quantile, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_quantile, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1762 + * return output + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, object func, object args, object kwargs): + * cdef ndarray[double_t] output, counts, bufarr + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_53roll_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_generic, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_55roll_window, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_window, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1879 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_57is_lexsorted, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_lexsorted, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1912 + * + * @cython.boundscheck(False) + * def groupby_indices(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_59groupby_indices, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_indices, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1949 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_labels(ndarray[object] values): # <<<<<<<<<<<<<< + * ''' + * Compute label vector from input values and associated useful data + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_61group_labels, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_labels, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1991 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, loc, label, n + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_63groupsort_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupsort_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2022 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_65group_nth_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2066 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_67group_nth_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2114 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_69group_last_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2156 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_71group_last_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2206 + * # median + * + * def group_median(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_73group_median, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_median, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":1 + * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_75inner_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_77left_outer_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_outer_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":120 + * + * + * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_79full_outer_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_full_outer_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":184 + * + * + * def _get_result_indexer(sorter, indexer): # <<<<<<<<<<<<<< + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_81_get_result_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_result_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":199 + * + * + * def ffill_indexer(ndarray[int64_t] indexer): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indexer) + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_83ffill_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ffill_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":219 + * + * + * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids, # <<<<<<<<<<<<<< + * int64_t max_group): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_85ffill_by_group, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ffill_by_group, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":17 + * cimport cpython + * + * import numpy as np # <<<<<<<<<<<<<< + * isnan = np.isnan + * + */ + __pyx_t_13 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":18 + * + * import numpy as np + * isnan = np.isnan # <<<<<<<<<<<<<< + * + * from datetime import datetime as pydatetime + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_isnan); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnan, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":20 + * isnan = np.isnan + * + * from datetime import datetime as pydatetime # <<<<<<<<<<<<<< + * + * # this is our datetime.pxd + */ + __pyx_t_14 = PyList_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_14, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_13 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_14, -1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_ImportFrom(__pyx_t_13, __pyx_n_s_datetime); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydatetime, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":32 + * from util cimport is_array, _checknull, _checknan, get_nat + * + * cdef int64_t iNaT = get_nat() # <<<<<<<<<<<<<< + * + * # import datetime C API + */ + __pyx_v_6pandas_5algos_iNaT = get_nat(); + + /* "pandas/src/generated.pyx":35 + * + * # import datetime C API + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * # initialize numpy + */ + PyDateTime_IMPORT; + + /* "pandas/src/generated.pyx":38 + * + * # initialize numpy + * import_array() # <<<<<<<<<<<<<< + * import_ufunc() + * + */ + import_array(); + + /* "pandas/src/generated.pyx":39 + * # initialize numpy + * import_array() + * import_ufunc() # <<<<<<<<<<<<<< + * + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num + */ + import_ufunc(); + + /* "pandas/src/generated.pyx":41 + * import_ufunc() + * + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num # <<<<<<<<<<<<<< + * + * cpdef ensure_platform_int(object arr): + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_arange); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__319, __pyx_t_13); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_17 = ((PyArrayObject *)__pyx_t_16)->descr->type_num; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_6pandas_5algos_PLATFORM_INT = __pyx_t_17; + + /* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_115pad_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_117pad_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_119pad_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_121pad_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_123pad_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_125pad_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_127backfill_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_129backfill_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_131backfill_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_133backfill_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_135backfill_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_137backfill_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_139pad_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_141pad_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_143pad_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_145pad_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_147pad_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_149pad_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_151backfill_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_153backfill_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_155backfill_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_157backfill_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_159backfill_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_161backfill_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_163pad_2d_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_165pad_2d_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_167pad_2d_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_169pad_2d_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_171pad_2d_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_173pad_2d_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_175backfill_2d_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_177backfill_2d_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_179backfill_2d_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_181backfill_2d_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_183backfill_2d_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_185backfill_2d_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1801 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float64(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_187is_monotonic_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1828 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float32(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_189is_monotonic_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1855 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_object(ndarray[object] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_191is_monotonic_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1882 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int32(ndarray[int32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_193is_monotonic_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1909 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int64(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_195is_monotonic_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_bool(ndarray[uint8_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_197is_monotonic_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1964 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_199groupby_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1992 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_201groupby_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2020 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_203groupby_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2048 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_205groupby_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2076 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_207groupby_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2104 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_209groupby_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_211arrmap_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_213arrmap_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_215arrmap_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2178 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_217arrmap_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2193 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_219arrmap_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2208 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_221arrmap_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2226 + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__116 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2223 + * + * @cython.wraparound(False) + * def take_1d_bool_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_223take_1d_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_bool_bool, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2245 + * ndarray[int64_t] indexer, + * ndarray[object] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__117 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2242 + * + * @cython.wraparound(False) + * def take_1d_bool_object(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_225take_1d_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_bool_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2264 + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__118 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2261 + * + * @cython.wraparound(False) + * def take_1d_int8_int8(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_227take_1d_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int8, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2283 + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__119 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2280 + * + * @cython.wraparound(False) + * def take_1d_int8_int32(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_229take_1d_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2302 + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__120 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2299 + * + * @cython.wraparound(False) + * def take_1d_int8_int64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_231take_1d_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2321 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__121 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2318 + * + * @cython.wraparound(False) + * def take_1d_int8_float64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_233take_1d_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2340 + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__122 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2337 + * + * @cython.wraparound(False) + * def take_1d_int16_int16(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_235take_1d_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int16, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2359 + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__123 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2356 + * + * @cython.wraparound(False) + * def take_1d_int16_int32(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_237take_1d_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2378 + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__124 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2375 + * + * @cython.wraparound(False) + * def take_1d_int16_int64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_239take_1d_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2397 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__125 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2394 + * + * @cython.wraparound(False) + * def take_1d_int16_float64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_241take_1d_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2416 + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__126 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2413 + * + * @cython.wraparound(False) + * def take_1d_int32_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_243take_1d_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2435 + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__127 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2432 + * + * @cython.wraparound(False) + * def take_1d_int32_int64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_245take_1d_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2454 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__128 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2451 + * + * @cython.wraparound(False) + * def take_1d_int32_float64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_247take_1d_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2473 + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__129 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2470 + * + * @cython.wraparound(False) + * def take_1d_int64_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_249take_1d_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int64_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2492 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__130 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2489 + * + * @cython.wraparound(False) + * def take_1d_int64_float64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_251take_1d_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2511 + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__131 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2508 + * + * @cython.wraparound(False) + * def take_1d_float32_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_253take_1d_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float32_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2530 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__132 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2527 + * + * @cython.wraparound(False) + * def take_1d_float32_float64(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_255take_1d_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2549 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__133 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2546 + * + * @cython.wraparound(False) + * def take_1d_float64_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_257take_1d_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2568 + * ndarray[int64_t] indexer, + * ndarray[object] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__134 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2565 + * + * @cython.wraparound(False) + * def take_1d_object_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_259take_1d_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_object_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2589 + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__135 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2586 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_261take_2d_axis0_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_bool_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2634 + * ndarray[int64_t] indexer, + * object[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__136 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2631 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_263take_2d_axis0_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_bool_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2679 + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__137 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_265take_2d_axis0_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2724 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__138 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_267take_2d_axis0_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2769 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__139 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2766 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_269take_2d_axis0_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2814 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__140 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2811 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_271take_2d_axis0_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2859 + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__141 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2856 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_273take_2d_axis0_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2904 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__142 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2901 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_275take_2d_axis0_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2949 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__143 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2946 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_277take_2d_axis0_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2994 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__144 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2991 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_279take_2d_axis0_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3039 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__145 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3036 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_281take_2d_axis0_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3084 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__146 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3081 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_283take_2d_axis0_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3129 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__147 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_285take_2d_axis0_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3174 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__148 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3171 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_287take_2d_axis0_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int64_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3219 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__149 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3216 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_289take_2d_axis0_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3264 + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__150 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3261 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_291take_2d_axis0_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float32_float32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3309 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__151 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3306 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_293take_2d_axis0_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3354 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__152 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3351 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_295take_2d_axis0_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3399 + * ndarray[int64_t] indexer, + * object[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__153 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3396 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_297take_2d_axis0_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_object_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3445 + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__154 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3442 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_299take_2d_axis1_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_bool_bool, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3471 + * ndarray[int64_t] indexer, + * object[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__155 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3468 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_301take_2d_axis1_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_bool_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3497 + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__156 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3494 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_303take_2d_axis1_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int8, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3523 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__157 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3520 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_305take_2d_axis1_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3549 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__158 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3546 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_307take_2d_axis1_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3575 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__159 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_309take_2d_axis1_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3601 + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__160 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_311take_2d_axis1_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int16, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3627 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__161 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3624 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_313take_2d_axis1_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3653 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__162 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3650 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_315take_2d_axis1_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3679 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__163 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_317take_2d_axis1_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3705 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__164 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3702 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_319take_2d_axis1_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3731 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__165 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3728 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_321take_2d_axis1_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3757 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__166 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3754 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_323take_2d_axis1_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3783 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__167 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3780 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_325take_2d_axis1_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int64_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3809 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__168 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3806 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_327take_2d_axis1_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3835 + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__169 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3832 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_329take_2d_axis1_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float32_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3861 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__170 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3858 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_331take_2d_axis1_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3887 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__171 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3884 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_333take_2d_axis1_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3913 + * ndarray[int64_t] indexer, + * object[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__172 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_335take_2d_axis1_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_object_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3940 + * indexer, + * ndarray[uint8_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__173 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3937 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[uint8_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_337take_2d_multi_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_bool_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3968 + * indexer, + * ndarray[object, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__174 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3965 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_339take_2d_multi_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_bool_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3996 + * indexer, + * ndarray[int8_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__175 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3993 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int8_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_341take_2d_multi_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4024 + * indexer, + * ndarray[int32_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__176 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4021 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_343take_2d_multi_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4052 + * indexer, + * ndarray[int64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__177 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4049 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_345take_2d_multi_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4080 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__178 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4077 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_347take_2d_multi_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4108 + * indexer, + * ndarray[int16_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__179 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4105 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int16_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_349take_2d_multi_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4136 + * indexer, + * ndarray[int32_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__180 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_351take_2d_multi_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4164 + * indexer, + * ndarray[int64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__181 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4161 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_353take_2d_multi_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4192 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__182 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4189 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_355take_2d_multi_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4220 + * indexer, + * ndarray[int32_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__183 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4217 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_357take_2d_multi_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4248 + * indexer, + * ndarray[int64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__184 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4245 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_359take_2d_multi_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4276 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__185 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4273 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_361take_2d_multi_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4304 + * indexer, + * ndarray[int64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__186 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_363take_2d_multi_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int64_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4332 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__187 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4329 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_365take_2d_multi_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4360 + * indexer, + * ndarray[float32_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__188 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4357 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float32_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_367take_2d_multi_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float32_float32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4388 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__189 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4385 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_369take_2d_multi_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4416 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__190 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4413 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_371take_2d_multi_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4444 + * indexer, + * ndarray[object, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__191 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4441 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_object_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_373take_2d_multi_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_object_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4470 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float64(ndarray[float64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_375diff_2d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4513 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float32(ndarray[float32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_377diff_2d_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4556 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int8(ndarray[int8_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_379diff_2d_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4599 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int16(ndarray[int16_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_381diff_2d_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4642 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int32(ndarray[int32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_383diff_2d_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4685 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int64(ndarray[int64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_385diff_2d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4729 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_387group_last_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4772 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_389group_last_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4816 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_391group_last_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4860 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_393group_last_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4905 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_395group_nth_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4949 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_397group_nth_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4994 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_399group_nth_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5039 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_401group_nth_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5085 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_403group_add_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5141 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_405group_add_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_407group_add_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5254 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_409group_add_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5311 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_411group_prod_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5367 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_413group_prod_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_415group_prod_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5480 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_417group_prod_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5537 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_419group_var_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_421group_var_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5660 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_423group_var_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_425group_var_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5783 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_427group_mean_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5835 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_429group_mean_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5887 + * + * + * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_431group_mean_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5940 + * out[i, j] = sumx[i, j] / count + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_433group_mean_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5995 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_435group_min_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6055 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_437group_min_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6116 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_439group_min_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6177 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_441group_min_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6239 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_443group_max_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6299 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_445group_max_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6360 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_447group_max_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6420 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_449group_max_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6481 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_451group_ohlc_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_ohlc_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6554 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_453group_ohlc_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_ohlc_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6628 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_455group_count_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_457group_count_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6700 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_459group_count_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6736 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_461group_count_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6773 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_463group_count_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6807 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_465group_count_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6841 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_467group_count_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6875 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_469group_count_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_471left_join_indexer_unique_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6955 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_473left_join_indexer_unique_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7000 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_475left_join_indexer_unique_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7045 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_477left_join_indexer_unique_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7090 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_479left_join_indexer_unique_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7135 + * + * + * def left_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_481left_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7237 + * + * + * def left_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_483left_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7339 + * + * + * def left_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_485left_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7441 + * + * + * def left_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_487left_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7543 + * + * + * def left_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_489left_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7647 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_491outer_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7776 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_493outer_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7905 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_495outer_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8034 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_497outer_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_499outer_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8293 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_501inner_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8386 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_503inner_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8479 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_505inner_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_507inner_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8665 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_509inner_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/algos.pyx":1 + * from numpy cimport * # <<<<<<<<<<<<<< + * cimport numpy as np + * import numpy as np + */ + __pyx_t_16 = PyDict_New(); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "View.MemoryView":203 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":276 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__716, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":277 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__717, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":278 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__718, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":281 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__719, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":282 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__720, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":496 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":953 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "__pyxutil":2 + * + * cdef extern from *: # <<<<<<<<<<<<<< + * void __pyx_PyErr_Clear "PyErr_Clear" () + * __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(object) + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.algos", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.algos"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (!buf) { + PyErr_SetString(PyExc_ValueError, + "buf is NULL."); + goto fail; + } else if (memviewslice->memview || memviewslice->data) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; + va_start(vargs, fmt); +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; /* allow uninitialized memoryview assignment */ + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) { + __pyx_t_5numpy_int64_t q = a / b; + __pyx_t_5numpy_int64_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { + long r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_ass_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_ass_slice(obj, cstart, cstop, value); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_ass_subscript)) +#endif + { + int result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_ass_subscript(obj, py_slice, value); +#else + result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object does not support slice %.10s", + Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); +bad: + return -1; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + length = strlen(cstring); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyObject * +__pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, + PyObject *qualname, PyObject *self, + PyObject *module, PyObject *globals, + PyObject *code) +{ + __pyx_FusedFunctionObject *fusedfunc = + (__pyx_FusedFunctionObject *) __Pyx_CyFunction_New(type, ml, flags, qualname, + self, module, globals, code); + if (!fusedfunc) + return NULL; + fusedfunc->__signatures__ = NULL; + fusedfunc->type = NULL; + fusedfunc->self = NULL; + return (PyObject *) fusedfunc; +} +static void __pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject *self) { + __pyx_FusedFunction_clear(self); + __pyx_FusedFunctionType->tp_free((PyObject *) self); +} +static int +__pyx_FusedFunction_traverse(__pyx_FusedFunctionObject *self, + visitproc visit, + void *arg) +{ + Py_VISIT(self->self); + Py_VISIT(self->type); + Py_VISIT(self->__signatures__); + return __Pyx_CyFunction_traverse((__pyx_CyFunctionObject *) self, visit, arg); +} +static int +__pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self) +{ + Py_CLEAR(self->self); + Py_CLEAR(self->type); + Py_CLEAR(self->__signatures__); + return __Pyx_CyFunction_clear((__pyx_CyFunctionObject *) self); +} +static PyObject * +__pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type) +{ + __pyx_FusedFunctionObject *func, *meth; + func = (__pyx_FusedFunctionObject *) self; + if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(self); + return self; + } + if (obj == Py_None) + obj = NULL; + meth = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_NewEx( + ((PyCFunctionObject *) func)->m_ml, + ((__pyx_CyFunctionObject *) func)->flags, + ((__pyx_CyFunctionObject *) func)->func_qualname, + ((__pyx_CyFunctionObject *) func)->func_closure, + ((PyCFunctionObject *) func)->m_module, + ((__pyx_CyFunctionObject *) func)->func_globals, + ((__pyx_CyFunctionObject *) func)->func_code); + if (!meth) + return NULL; + Py_XINCREF(func->func.func_classobj); + meth->func.func_classobj = func->func.func_classobj; + Py_XINCREF(func->__signatures__); + meth->__signatures__ = func->__signatures__; + Py_XINCREF(type); + meth->type = type; + Py_XINCREF(func->func.defaults_tuple); + meth->func.defaults_tuple = func->func.defaults_tuple; + if (func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD) + obj = type; + Py_XINCREF(obj); + meth->self = obj; + return (PyObject *) meth; +} +static PyObject * +_obj_to_str(PyObject *obj) +{ + if (PyType_Check(obj)) + return PyObject_GetAttr(obj, __pyx_n_s_name_2); + else + return PyObject_Str(obj); +} +static PyObject * +__pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx) +{ + PyObject *signature = NULL; + PyObject *unbound_result_func; + PyObject *result_func = NULL; + if (self->__signatures__ == NULL) { + PyErr_SetString(PyExc_TypeError, "Function is not fused"); + return NULL; + } + if (PyTuple_Check(idx)) { + PyObject *list = PyList_New(0); + Py_ssize_t n = PyTuple_GET_SIZE(idx); + PyObject *string = NULL; + PyObject *sep = NULL; + int i; + if (!list) + return NULL; + for (i = 0; i < n; i++) { + PyObject *item = PyTuple_GET_ITEM(idx, i); + string = _obj_to_str(item); + if (!string || PyList_Append(list, string) < 0) + goto __pyx_err; + Py_DECREF(string); + } + sep = PyUnicode_FromString("|"); + if (sep) + signature = PyUnicode_Join(sep, list); +__pyx_err: +; + Py_DECREF(list); + Py_XDECREF(sep); + } else { + signature = _obj_to_str(idx); + } + if (!signature) + return NULL; + unbound_result_func = PyObject_GetItem(self->__signatures__, signature); + if (unbound_result_func) { + if (self->self || self->type) { + __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func; + Py_CLEAR(unbound->func.func_classobj); + Py_XINCREF(self->func.func_classobj); + unbound->func.func_classobj = self->func.func_classobj; + result_func = __pyx_FusedFunction_descr_get(unbound_result_func, + self->self, self->type); + } else { + result_func = unbound_result_func; + Py_INCREF(result_func); + } + } + Py_DECREF(signature); + Py_XDECREF(unbound_result_func); + return result_func; +} +static PyObject * +__pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + PyObject *result; + int static_specialized = (cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD && + !((__pyx_FusedFunctionObject *) func)->__signatures__); + if (cyfunc->flags & __Pyx_CYFUNCTION_CCLASS && !static_specialized) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + PyObject *m_self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (!new_args) + return NULL; + self = PyTuple_GetItem(args, 0); + if (!self) + return NULL; + m_self = cyfunc->func.m_self; + cyfunc->func.m_self = self; + result = __Pyx_CyFunction_Call(func, new_args, kw); + cyfunc->func.m_self = m_self; + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +/* Note: the 'self' from method binding is passed in in the args tuple, + whereas PyCFunctionObject's m_self is passed in as the first + argument to the C function. For extension methods we need + to pass 'self' as 'm_self' and not as the first element of the + args tuple. +*/ +static PyObject * +__pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw) +{ + __pyx_FusedFunctionObject *binding_func = (__pyx_FusedFunctionObject *) func; + Py_ssize_t argc = PyTuple_GET_SIZE(args); + PyObject *new_args = NULL; + __pyx_FusedFunctionObject *new_func = NULL; + PyObject *result = NULL; + PyObject *self = NULL; + int is_staticmethod = binding_func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD; + int is_classmethod = binding_func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD; + if (binding_func->self) { + Py_ssize_t i; + new_args = PyTuple_New(argc + 1); + if (!new_args) + return NULL; + self = binding_func->self; + Py_INCREF(self); + PyTuple_SET_ITEM(new_args, 0, self); + for (i = 0; i < argc; i++) { + PyObject *item = PyTuple_GET_ITEM(args, i); + Py_INCREF(item); + PyTuple_SET_ITEM(new_args, i + 1, item); + } + args = new_args; + } else if (binding_func->type) { + if (argc < 1) { + PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given."); + return NULL; + } + self = PyTuple_GET_ITEM(args, 0); + } + if (self && !is_classmethod && !is_staticmethod && + !PyObject_IsInstance(self, binding_func->type)) { + PyErr_Format(PyExc_TypeError, + "First argument should be of type %.200s, got %.200s.", + ((PyTypeObject *) binding_func->type)->tp_name, + self->ob_type->tp_name); + goto __pyx_err; + } + if (binding_func->__signatures__) { + PyObject *tup = PyTuple_Pack(4, binding_func->__signatures__, args, + kw == NULL ? Py_None : kw, + binding_func->func.defaults_tuple); + if (!tup) + goto __pyx_err; + new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL); + Py_DECREF(tup); + if (!new_func) + goto __pyx_err; + Py_XINCREF(binding_func->func.func_classobj); + Py_CLEAR(new_func->func.func_classobj); + new_func->func.func_classobj = binding_func->func.func_classobj; + func = (PyObject *) new_func; + } + result = __pyx_FusedFunction_callfunction(func, args, kw); +__pyx_err: + Py_XDECREF(new_args); + Py_XDECREF((PyObject *) new_func); + return result; +} +static PyMemberDef __pyx_FusedFunction_members[] = { + {(char *) "__signatures__", + T_OBJECT, + offsetof(__pyx_FusedFunctionObject, __signatures__), + READONLY, + __Pyx_DOCSTR(0)}, + {0, 0, 0, 0, 0}, +}; +static PyMappingMethods __pyx_FusedFunction_mapping_methods = { + 0, + (binaryfunc) __pyx_FusedFunction_getitem, + 0, +}; +static PyTypeObject __pyx_FusedFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("fused_cython_function"), /*tp_name*/ + sizeof(__pyx_FusedFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __pyx_FusedFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + &__pyx_FusedFunction_mapping_methods, /*tp_as_mapping*/ + 0, /*tp_hash*/ + (ternaryfunc) __pyx_FusedFunction_call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __pyx_FusedFunction_traverse, /*tp_traverse*/ + (inquiry) __pyx_FusedFunction_clear,/*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + __pyx_FusedFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + &__pyx_CyFunctionType_type, /*tp_base*/ + 0, /*tp_dict*/ + __pyx_FusedFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __pyx_FusedFunction_init(void) { + __pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type); + if (__pyx_FusedFunctionType == NULL) { + return -1; + } + return 0; +} + +static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (buf->strides[dim] != sizeof(void *)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (buf->strides[dim] != buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (stride < buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (spec & (__Pyx_MEMVIEW_PTR)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (buf->suboffsets) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (buf->suboffsets && buf->suboffsets[dim] >= 0) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) + { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (buf->ndim != ndim) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned) buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (!__pyx_check_strides(buf, i, ndim, spec)) + goto fail; + if (!__pyx_check_suboffsets(buf, i, ndim, spec)) + goto fail; + } + if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *x) { + const npy_int8 neg_one = (npy_int8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int8"); + return (npy_int8) -1; + } + return (npy_int8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int8"); + return (npy_int8) -1; + } + if (sizeof(npy_int8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int8) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, long, PyLong_AsLong) + } else if (sizeof(npy_int8) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int8 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int8) -1; + } + } else { + npy_int8 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int8) -1; + val = __Pyx_PyInt_As_npy_int8(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int16 __Pyx_PyInt_As_npy_int16(PyObject *x) { + const npy_int16 neg_one = (npy_int16) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int16) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int16"); + return (npy_int16) -1; + } + return (npy_int16) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int16)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int16) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int16"); + return (npy_int16) -1; + } + if (sizeof(npy_int16) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int16)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int16) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int16) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int16) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, long, PyLong_AsLong) + } else if (sizeof(npy_int16) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int16 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int16) -1; + } + } else { + npy_int16 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int16) -1; + val = __Pyx_PyInt_As_npy_int16(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_object(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_object, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(char) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(char) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong) + } else if (sizeof(char) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(char, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) { + const char neg_one = (char) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(char) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(char) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(char) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(char) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(char) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(char), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value) { + const npy_int8 neg_one = (npy_int8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int8) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int8) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int8) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int8) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int8), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int8_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int8(*(__pyx_t_5numpy_int8_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int8_t value = __Pyx_PyInt_As_npy_int8(obj); + if ((value == (npy_int8)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int8_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int16(npy_int16 value) { + const npy_int16 neg_one = (npy_int16) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int16) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int16) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int16) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int16) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int16), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int16_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int16(*(__pyx_t_5numpy_int16_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int16_t value = __Pyx_PyInt_As_npy_int16(obj); + if ((value == (npy_int16)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int16_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int32(*(__pyx_t_5numpy_int32_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int32_t value = __Pyx_PyInt_As_npy_int32(obj); + if ((value == (npy_int32)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int32_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj); + if ((value == (npy_int64)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int64_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint8) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint8) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint8) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint8), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + return (npy_uint8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong) + } else if (sizeof(npy_uint8) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint8 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint8) -1; + } + } else { + npy_uint8 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj); + if ((value == (npy_uint8)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint8_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint16(npy_uint16 value) { + const npy_uint16 neg_one = (npy_uint16) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint16) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint16) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint16) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint16) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint16) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint16), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint16 __Pyx_PyInt_As_npy_uint16(PyObject *x) { + const npy_uint16 neg_one = (npy_uint16) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint16) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint16"); + return (npy_uint16) -1; + } + return (npy_uint16) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint16)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint16) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint16"); + return (npy_uint16) -1; + } + if (sizeof(npy_uint16) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint16) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint16)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint16) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint16) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint16) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, long, PyLong_AsLong) + } else if (sizeof(npy_uint16) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint16 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint16) -1; + } + } else { + npy_uint16 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint16) -1; + val = __Pyx_PyInt_As_npy_uint16(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint16_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint16(*(__pyx_t_5numpy_uint16_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_uint16_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint16_t value = __Pyx_PyInt_As_npy_uint16(obj); + if ((value == (npy_uint16)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint16_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value) { + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint32), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint32"); + return (npy_uint32) -1; + } + return (npy_uint32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint32"); + return (npy_uint32) -1; + } + if (sizeof(npy_uint32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyLong_AsLong) + } else if (sizeof(npy_uint32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint32) -1; + } + } else { + npy_uint32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint32) -1; + val = __Pyx_PyInt_As_npy_uint32(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint32_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint32(*(__pyx_t_5numpy_uint32_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint32_t value = __Pyx_PyInt_As_npy_uint32(obj); + if ((value == (npy_uint32)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint32_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint64), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; + } + return (npy_uint64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; + } + if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyLong_AsLong) + } else if (sizeof(npy_uint64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint64) -1; + } + } else { + npy_uint64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint64) -1; + val = __Pyx_PyInt_As_npy_uint64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint64(*(__pyx_t_5numpy_uint64_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint64_t value = __Pyx_PyInt_As_npy_uint64(obj); + if ((value == (npy_uint64)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint64_t *) itemp = value; + return 1; +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float32_t(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float32_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_float32_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_float32_t value = __pyx_PyFloat_AsFloat(obj); + if ((value == (npy_float32)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_float32_t *) itemp = value; + return 1; +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj); + if ((value == (npy_float64)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_float64_t *) itemp = value; + return 1; +} + +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +static PyObject *__pyx_memview_get_object(const char *itemp) { + PyObject *result = *(PyObject **) itemp; + Py_INCREF(result); + return result; +} +static int __pyx_memview_set_object(const char *itemp, PyObject *obj) { + Py_INCREF(obj); + Py_DECREF(*(PyObject **) itemp); + *(PyObject **) itemp = obj; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(Py_intptr_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(Py_intptr_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), + little, !is_unsigned); + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs->memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize) + return 0; + itemsize *= mvs->shape[index]; + } + return 1; +} + +static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0) + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files/pandas/hashtable.c b/cythonized-files/pandas/hashtable.c new file mode 100644 index 00000000..dcbc1729 --- /dev/null +++ b/cythonized-files/pandas/hashtable.c @@ -0,0 +1,25417 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__hashtable +#define __PYX_HAVE_API__pandas__hashtable +#include "string.h" +#include "stdio.h" +#include "pythread.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "khash_python.h" +#include "numpy_helper.h" +#include "datetime.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "hashtable.pyx", + "util.pxd", + "numpy.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_9hashtable_HashTable; +struct __pyx_obj_6pandas_9hashtable_Int64HashTable; +struct __pyx_obj_6pandas_9hashtable_Float64HashTable; +struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable; +struct __pyx_obj_6pandas_9hashtable_ObjectVector; +struct __pyx_obj_6pandas_9hashtable_Int64Vector; +struct __pyx_obj_6pandas_9hashtable_Float64Vector; +struct __pyx_obj_6pandas_9hashtable_StringHashTable; +struct __pyx_obj_6pandas_9hashtable_Int32HashTable; +struct __pyx_obj_6pandas_9hashtable_Factorizer; +struct __pyx_obj_6pandas_9hashtable_Int64Factorizer; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "pandas/hashtable.pxd":5 + * # prototypes for sharing + * + * cdef class HashTable: # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6pandas_9hashtable_HashTable { + PyObject_HEAD +}; + + +/* "pandas/hashtable.pxd":8 + * pass + * + * cdef class Int64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int64_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Int64HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *__pyx_vtab; + kh_int64_t *table; +}; + + +/* "pandas/hashtable.pxd":14 + * cpdef set_item(self, int64_t key, Py_ssize_t val) + * + * cdef class Float64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_float64_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Float64HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *__pyx_vtab; + kh_float64_t *table; +}; + + +/* "pandas/hashtable.pxd":20 + * cpdef set_item(self, float64_t key, Py_ssize_t val) + * + * cdef class PyObjectHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_pymap_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *__pyx_vtab; + kh_pymap_t *table; +}; + + +/* "pandas/hashtable.pyx":51 + * cdef size_t _INIT_VEC_CAP = 32 + * + * cdef class ObjectVector: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_obj_6pandas_9hashtable_ObjectVector { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_9hashtable_ObjectVector *__pyx_vtab; + size_t n; + size_t m; + PyArrayObject *ao; + PyObject **data; +}; + + +/* "pandas/hashtable.pyx":83 + * + * + * cdef class Int64Vector: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_obj_6pandas_9hashtable_Int64Vector { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_9hashtable_Int64Vector *__pyx_vtab; + size_t n; + size_t m; + PyArrayObject *ao; + __pyx_t_5numpy_int64_t *data; +}; + + +/* "pandas/hashtable.pyx":113 + * self.n += 1 + * + * cdef class Float64Vector: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_obj_6pandas_9hashtable_Float64Vector { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_9hashtable_Float64Vector *__pyx_vtab; + size_t n; + size_t m; + PyArrayObject *ao; + __pyx_t_5numpy_float64_t *data; +}; + + +/* "pandas/hashtable.pyx":148 + * + * + * cdef class StringHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_str_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_StringHashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable *__pyx_vtab; + kh_str_t *table; +}; + + +/* "pandas/hashtable.pyx":263 + * return reverse, labels + * + * cdef class Int32HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int32_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Int32HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable *__pyx_vtab; + kh_int32_t *table; +}; + + +/* "pandas/hashtable.pyx":846 + * + * + * cdef class Factorizer: # <<<<<<<<<<<<<< + * cdef public PyObjectHashTable table + * cdef public ObjectVector uniques + */ +struct __pyx_obj_6pandas_9hashtable_Factorizer { + PyObject_HEAD + struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *table; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *uniques; + Py_ssize_t count; +}; + + +/* "pandas/hashtable.pyx":885 + * + * + * cdef class Int64Factorizer: # <<<<<<<<<<<<<< + * cdef public Int64HashTable table + * cdef public Int64Vector uniques + */ +struct __pyx_obj_6pandas_9hashtable_Int64Factorizer { + PyObject_HEAD + struct __pyx_obj_6pandas_9hashtable_Int64HashTable *table; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *uniques; + Py_ssize_t count; +}; + + + +/* "pandas/hashtable.pyx":362 + * return reverse, labels + * + * cdef class Int64HashTable: #(HashTable): # <<<<<<<<<<<<<< + * # cdef kh_int64_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *__pyx_vtabptr_6pandas_9hashtable_Int64HashTable; + + +/* "pandas/hashtable.pyx":540 + * + * + * cdef class Float64HashTable(HashTable): # <<<<<<<<<<<<<< + * def __cinit__(self, size_hint=1): + * self.table = kh_init_float64() + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *__pyx_vtabptr_6pandas_9hashtable_Float64HashTable; + + +/* "pandas/hashtable.pyx":670 + * na_sentinel = object + * + * cdef class PyObjectHashTable(HashTable): # <<<<<<<<<<<<<< + * # cdef kh_pymap_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *__pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable; + + +/* "pandas/hashtable.pyx":51 + * cdef size_t _INIT_VEC_CAP = 32 + * + * cdef class ObjectVector: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_ObjectVector { + PyObject *(*append)(struct __pyx_obj_6pandas_9hashtable_ObjectVector *, PyObject *); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_ObjectVector *__pyx_vtabptr_6pandas_9hashtable_ObjectVector; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_12ObjectVector_append(struct __pyx_obj_6pandas_9hashtable_ObjectVector *, PyObject *); + + +/* "pandas/hashtable.pyx":83 + * + * + * cdef class Int64Vector: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Int64Vector { + PyObject *(*append)(struct __pyx_obj_6pandas_9hashtable_Int64Vector *, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64Vector *__pyx_vtabptr_6pandas_9hashtable_Int64Vector; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_11Int64Vector_append(struct __pyx_obj_6pandas_9hashtable_Int64Vector *, __pyx_t_5numpy_int64_t); + + +/* "pandas/hashtable.pyx":113 + * self.n += 1 + * + * cdef class Float64Vector: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Float64Vector { + PyObject *(*append)(struct __pyx_obj_6pandas_9hashtable_Float64Vector *, __pyx_t_5numpy_float64_t); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64Vector *__pyx_vtabptr_6pandas_9hashtable_Float64Vector; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_13Float64Vector_append(struct __pyx_obj_6pandas_9hashtable_Float64Vector *, __pyx_t_5numpy_float64_t); + + +/* "pandas/hashtable.pyx":148 + * + * + * cdef class StringHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_str_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable { + int (*check_type)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *); + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable *__pyx_vtabptr_6pandas_9hashtable_StringHashTable; +static CYTHON_INLINE int __pyx_f_6pandas_9hashtable_15StringHashTable_check_type(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *); + + +/* "pandas/hashtable.pyx":263 + * return reverse, labels + * + * cdef class Int32HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int32_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable { + int (*check_type)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, PyObject *); + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, __pyx_t_5numpy_int32_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, __pyx_t_5numpy_int32_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable *__pyx_vtabptr_6pandas_9hashtable_Int32HashTable; +static CYTHON_INLINE int __pyx_f_6pandas_9hashtable_14Int32HashTable_check_type(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, PyObject *); +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*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); /*proto*/ + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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 CYTHON_INLINE 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); + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* 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); + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'util' */ +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'pandas.hashtable' */ +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int64HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Float64HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_PyObjectHashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_ObjectVector = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int64Vector = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Float64Vector = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_StringHashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int32HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Factorizer = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int64Factorizer = 0; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_9hashtable_iNaT; +static size_t __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; +static PyObject *__pyx_f_6pandas_9hashtable_build_count_table_int64(PyArrayObject *, kh_int64_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_value_count_int64(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_build_count_table_object(PyArrayObject *, PyArrayObject *, kh_pymap_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_value_count_object(PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +#define __Pyx_MODULE_NAME "pandas.hashtable" +int __pyx_module_is_main_pandas__hashtable = 0; + +/* Implementation of 'pandas.hashtable' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_pf_6pandas_9hashtable_list_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static int __pyx_pf_6pandas_9hashtable_12ObjectVector___cinit__(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_12ObjectVector_2__len__(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_12ObjectVector_4to_array(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_11Int64Vector___cinit__(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_11Int64Vector_2__len__(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_11Int64Vector_4to_array(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_13Float64Vector___cinit__(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_13Float64Vector_2__len__(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_13Float64Vector_4to_array(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15StringHashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, int __pyx_v_size_hint); /* proto */ +static void __pyx_pf_6pandas_9hashtable_15StringHashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_4get_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_6get_iter_test(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_iterations); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_8set_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_10get_indexer(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_12unique(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_14factorize(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_6pandas_9hashtable_14Int32HashTable___init__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static int __pyx_pf_6pandas_9hashtable_14Int32HashTable_2__cinit__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self); /* proto */ +static void __pyx_pf_6pandas_9hashtable_14Int32HashTable_4__dealloc__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_6get_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_8get_iter_test(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_iterations); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_10set_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_12map_locations(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_14lookup(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_16factorize(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_6pandas_9hashtable_14Int64HashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static void __pyx_pf_6pandas_9hashtable_14Int64HashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_14Int64HashTable_4__contains__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_14Int64HashTable_6__len__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_8get_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_10get_iter_test(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_iterations); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_12set_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_14map(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_keys, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_20factorize(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_22get_labels(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, CYTHON_UNUSED Py_ssize_t __pyx_v_na_sentinel); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_24get_labels_groupby(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_26unique(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_6pandas_9hashtable_16Float64HashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_16Float64HashTable_2__len__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_4get_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_6set_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static void __pyx_pf_6pandas_9hashtable_16Float64HashTable_8__dealloc__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_16Float64HashTable_10__contains__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_12factorize(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_14get_labels(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_20unique(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_6pandas_9hashtable_17PyObjectHashTable___init__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static void __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_4__len__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_6__contains__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_8destroy(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_10get_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_12get_iter_test(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_iterations); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_14set_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_20lookup2(CYTHON_UNUSED struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_22unique(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_24get_labels(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer___init__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_2get_count(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_4factorize(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_sort, PyObject *__pyx_v_na_sentinel); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_6unique(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_5table___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5table_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5table_4__del__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_7uniques___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_4__del__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_5count___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5count_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer___init__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_2get_count(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_4factorize(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_sort, PyObject *__pyx_v_na_sentinel); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_4__del__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_4__del__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_2value_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_4value_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_6mode_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_8mode_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_9hashtable_HashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64HashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Float64HashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_PyObjectHashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_ObjectVector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64Vector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Float64Vector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_StringHashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int32HashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Factorizer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64Factorizer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_int[] = "int_"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_put[] = "put"; +static char __pyx_k_ret[] = "ret"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_ONAN[] = "ONAN"; +static char __pyx_k_clip[] = "clip"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mask[] = "mask"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_sort[] = "sort"; +static char __pyx_k_take[] = "take"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_count[] = "count"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_modes[] = "modes"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_table[] = "table"; +static char __pyx_k_zeros[] = "zeros"; +static char __pyx_k_arange[] = "arange"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_resize[] = "resize"; +static char __pyx_k_unique[] = "unique"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_argsort[] = "argsort"; +static char __pyx_k_destroy[] = "destroy"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_max_val[] = "max_val"; +static char __pyx_k_uniques[] = "uniques"; +static char __pyx_k_KeyError[] = "KeyError"; +static char __pyx_k_get_item[] = "get_item"; +static char __pyx_k_object_2[] = "object_"; +static char __pyx_k_set_item[] = "set_item"; +static char __pyx_k_to_array[] = "to_array"; +static char __pyx_k_max_count[] = "max_count"; +static char __pyx_k_size_hint[] = "size_hint"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_get_labels[] = "get_labels"; +static char __pyx_k_iterations[] = "iterations"; +static char __pyx_k_mode_int64[] = "mode_int64"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_count_prior[] = "count_prior"; +static char __pyx_k_mode_object[] = "mode_object"; +static char __pyx_k_na_sentinel[] = "na_sentinel"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_pandas_hashtable[] = "pandas.hashtable"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_list_to_object_array[] = "list_to_object_array"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_Factorizer_factorize_line_859[] = "Factorizer.factorize (line 859)"; +static char __pyx_k_Factorize_values_with_nans_repl[] = "\n Factorize values with nans replaced by na_sentinel\n >>> factorize(np.array([1,2,np.nan], dtype='O'), na_sentinel=20)\n array([ 0, 1, 20])\n "; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/hashtable.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_kp_u_Factorize_values_with_nans_repl; +static PyObject *__pyx_kp_u_Factorizer_factorize_line_859; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_ONAN; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_arange; +static PyObject *__pyx_n_s_argsort; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_clip; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_count_prior; +static PyObject *__pyx_n_s_destroy; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_get_item; +static PyObject *__pyx_n_s_get_labels; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_int; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_iterations; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_list_to_object_array; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mask; +static PyObject *__pyx_n_s_max_count; +static PyObject *__pyx_n_s_max_val; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_mode_int64; +static PyObject *__pyx_n_s_mode_object; +static PyObject *__pyx_n_s_modes; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_na_sentinel; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_object_2; +static PyObject *__pyx_n_s_pandas_hashtable; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_resize; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_set_item; +static PyObject *__pyx_n_s_size_hint; +static PyObject *__pyx_n_s_sort; +static PyObject *__pyx_n_s_table; +static PyObject *__pyx_n_s_take; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_to_array; +static PyObject *__pyx_n_s_unique; +static PyObject *__pyx_n_s_uniques; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; + +/* "pandas/hashtable.pyx":31 + * + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_1list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6pandas_9hashtable_list_to_object_array[] = "\n Convert list to object ndarray. Seriously can't believe I had to write this\n function\n "; +static PyMethodDef __pyx_mdef_6pandas_9hashtable_1list_to_object_array = {__Pyx_NAMESTR("list_to_object_array"), (PyCFunction)__pyx_pw_6pandas_9hashtable_1list_to_object_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_9hashtable_list_to_object_array)}; +static PyObject *__pyx_pw_6pandas_9hashtable_1list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_to_object_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_list_to_object_array(__pyx_self, ((PyObject*)__pyx_v_obj)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_list_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_arr = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject **__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_to_object_array", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + + /* "pandas/hashtable.pyx":40 + * ndarray[object] arr + * + * n = len(obj) # <<<<<<<<<<<<<< + * arr = np.empty(n, dtype=object) + * + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":41 + * + * n = len(obj) + * arr = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_arr = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":43 + * arr = np.empty(n, dtype=object) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * arr[i] = obj[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/hashtable.pyx":44 + * + * for i from 0 <= i < n: + * arr[i] = obj[i] # <<<<<<<<<<<<<< + * + * return arr + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_12); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_12); + *__pyx_t_12 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/hashtable.pyx":46 + * arr[i] = obj[i] + * + * return arr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":31 + * + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.list_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":58 + * PyObject **data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_12ObjectVector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_12ObjectVector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_9hashtable_12ObjectVector___cinit__(((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_12ObjectVector___cinit__(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":59 + * + * def __cinit__(self): + * self.n = 0 # <<<<<<<<<<<<<< + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=object) + */ + __pyx_v_self->n = 0; + + /* "pandas/hashtable.pyx":60 + * def __cinit__(self): + * self.n = 0 + * self.m = _INIT_VEC_CAP # <<<<<<<<<<<<<< + * self.ao = np.empty(_INIT_VEC_CAP, dtype=object) + * self.data = self.ao.data + */ + __pyx_v_self->m = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + + /* "pandas/hashtable.pyx":61 + * self.n = 0 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=object) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_6pandas_9hashtable__INIT_VEC_CAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->ao); + __Pyx_DECREF(((PyObject *)__pyx_v_self->ao)); + __pyx_v_self->ao = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/hashtable.pyx":62 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=object) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_v_self->data = ((PyObject **)__pyx_v_self->ao->data); + + /* "pandas/hashtable.pyx":58 + * PyObject **data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.hashtable.ObjectVector.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":64 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_12ObjectVector_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_12ObjectVector_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_12ObjectVector_2__len__(((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_12ObjectVector_2__len__(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":65 + * + * def __len__(self): + * return self.n # <<<<<<<<<<<<<< + * + * def to_array(self): + */ + __pyx_r = __pyx_v_self->n; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":64 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":67 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_12ObjectVector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_12ObjectVector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_12ObjectVector_4to_array(((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_12ObjectVector_4to_array(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_array", 0); + + /* "pandas/hashtable.pyx":68 + * + * def to_array(self): + * self.ao.resize(self.n) # <<<<<<<<<<<<<< + * self.m = self.n + * return self.ao + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":69 + * def to_array(self): + * self.ao.resize(self.n) + * self.m = self.n # <<<<<<<<<<<<<< + * return self.ao + * + */ + __pyx_t_4 = __pyx_v_self->n; + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":70 + * self.ao.resize(self.n) + * self.m = self.n + * return self.ao # <<<<<<<<<<<<<< + * + * cdef inline append(self, object o): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->ao)); + __pyx_r = ((PyObject *)__pyx_v_self->ao); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":67 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.ObjectVector.to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":72 + * return self.ao + * + * cdef inline append(self, object o): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_12ObjectVector_append(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "pandas/hashtable.pyx":73 + * + * cdef inline append(self, object o): + * if self.n == self.m: # <<<<<<<<<<<<<< + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + */ + __pyx_t_1 = ((__pyx_v_self->n == __pyx_v_self->m) != 0); + if (__pyx_t_1) { + + /* "pandas/hashtable.pyx":74 + * cdef inline append(self, object o): + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) # <<<<<<<<<<<<<< + * self.ao.resize(self.m) + * self.data = self.ao.data + */ + __pyx_t_2 = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + __pyx_t_3 = (__pyx_v_self->m * 2); + if (((__pyx_t_2 > __pyx_t_3) != 0)) { + __pyx_t_4 = __pyx_t_2; + } else { + __pyx_t_4 = __pyx_t_3; + } + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":75 + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_self->m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":76 + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * Py_INCREF(o) + */ + __pyx_v_self->data = ((PyObject **)__pyx_v_self->ao->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":78 + * self.data = self.ao.data + * + * Py_INCREF(o) # <<<<<<<<<<<<<< + * self.data[self.n] = o + * self.n += 1 + */ + Py_INCREF(__pyx_v_o); + + /* "pandas/hashtable.pyx":79 + * + * Py_INCREF(o) + * self.data[self.n] = o # <<<<<<<<<<<<<< + * self.n += 1 + * + */ + (__pyx_v_self->data[__pyx_v_self->n]) = ((PyObject *)__pyx_v_o); + + /* "pandas/hashtable.pyx":80 + * Py_INCREF(o) + * self.data[self.n] = o + * self.n += 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->n = (__pyx_v_self->n + 1); + + /* "pandas/hashtable.pyx":72 + * return self.ao + * + * cdef inline append(self, object o): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.hashtable.ObjectVector.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":90 + * int64_t *data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_11Int64Vector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_11Int64Vector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_9hashtable_11Int64Vector___cinit__(((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_11Int64Vector___cinit__(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":91 + * + * def __cinit__(self): + * self.n = 0 # <<<<<<<<<<<<<< + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.int64) + */ + __pyx_v_self->n = 0; + + /* "pandas/hashtable.pyx":92 + * def __cinit__(self): + * self.n = 0 + * self.m = _INIT_VEC_CAP # <<<<<<<<<<<<<< + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.int64) + * self.data = self.ao.data + */ + __pyx_v_self->m = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + + /* "pandas/hashtable.pyx":93 + * self.n = 0 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.int64) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_6pandas_9hashtable__INIT_VEC_CAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->ao); + __Pyx_DECREF(((PyObject *)__pyx_v_self->ao)); + __pyx_v_self->ao = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":94 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.int64) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_v_self->data = ((__pyx_t_5numpy_int64_t *)__pyx_v_self->ao->data); + + /* "pandas/hashtable.pyx":90 + * int64_t *data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.hashtable.Int64Vector.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":96 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_11Int64Vector_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_11Int64Vector_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_11Int64Vector_2__len__(((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_11Int64Vector_2__len__(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":97 + * + * def __len__(self): + * return self.n # <<<<<<<<<<<<<< + * + * def to_array(self): + */ + __pyx_r = __pyx_v_self->n; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":96 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":99 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_11Int64Vector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_11Int64Vector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_11Int64Vector_4to_array(((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_11Int64Vector_4to_array(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_array", 0); + + /* "pandas/hashtable.pyx":100 + * + * def to_array(self): + * self.ao.resize(self.n) # <<<<<<<<<<<<<< + * self.m = self.n + * return self.ao + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":101 + * def to_array(self): + * self.ao.resize(self.n) + * self.m = self.n # <<<<<<<<<<<<<< + * return self.ao + * + */ + __pyx_t_4 = __pyx_v_self->n; + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":102 + * self.ao.resize(self.n) + * self.m = self.n + * return self.ao # <<<<<<<<<<<<<< + * + * cdef inline append(self, int64_t x): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->ao)); + __pyx_r = ((PyObject *)__pyx_v_self->ao); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":99 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Int64Vector.to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":104 + * return self.ao + * + * cdef inline append(self, int64_t x): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_11Int64Vector_append(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "pandas/hashtable.pyx":105 + * + * cdef inline append(self, int64_t x): + * if self.n == self.m: # <<<<<<<<<<<<<< + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + */ + __pyx_t_1 = ((__pyx_v_self->n == __pyx_v_self->m) != 0); + if (__pyx_t_1) { + + /* "pandas/hashtable.pyx":106 + * cdef inline append(self, int64_t x): + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) # <<<<<<<<<<<<<< + * self.ao.resize(self.m) + * self.data = self.ao.data + */ + __pyx_t_2 = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + __pyx_t_3 = (__pyx_v_self->m * 2); + if (((__pyx_t_2 > __pyx_t_3) != 0)) { + __pyx_t_4 = __pyx_t_2; + } else { + __pyx_t_4 = __pyx_t_3; + } + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":107 + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_self->m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":108 + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * self.data[self.n] = x + */ + __pyx_v_self->data = ((__pyx_t_5numpy_int64_t *)__pyx_v_self->ao->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":110 + * self.data = self.ao.data + * + * self.data[self.n] = x # <<<<<<<<<<<<<< + * self.n += 1 + * + */ + (__pyx_v_self->data[__pyx_v_self->n]) = __pyx_v_x; + + /* "pandas/hashtable.pyx":111 + * + * self.data[self.n] = x + * self.n += 1 # <<<<<<<<<<<<<< + * + * cdef class Float64Vector: + */ + __pyx_v_self->n = (__pyx_v_self->n + 1); + + /* "pandas/hashtable.pyx":104 + * return self.ao + * + * cdef inline append(self, int64_t x): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.hashtable.Int64Vector.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":120 + * float64_t *data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_13Float64Vector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_13Float64Vector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_9hashtable_13Float64Vector___cinit__(((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_13Float64Vector___cinit__(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":121 + * + * def __cinit__(self): + * self.n = 0 # <<<<<<<<<<<<<< + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.float64) + */ + __pyx_v_self->n = 0; + + /* "pandas/hashtable.pyx":122 + * def __cinit__(self): + * self.n = 0 + * self.m = _INIT_VEC_CAP # <<<<<<<<<<<<<< + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.float64) + * self.data = self.ao.data + */ + __pyx_v_self->m = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + + /* "pandas/hashtable.pyx":123 + * self.n = 0 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.float64) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_6pandas_9hashtable__INIT_VEC_CAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->ao); + __Pyx_DECREF(((PyObject *)__pyx_v_self->ao)); + __pyx_v_self->ao = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":124 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.float64) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_v_self->data = ((__pyx_t_5numpy_float64_t *)__pyx_v_self->ao->data); + + /* "pandas/hashtable.pyx":120 + * float64_t *data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.hashtable.Float64Vector.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":126 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_13Float64Vector_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_13Float64Vector_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_13Float64Vector_2__len__(((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_13Float64Vector_2__len__(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":127 + * + * def __len__(self): + * return self.n # <<<<<<<<<<<<<< + * + * def to_array(self): + */ + __pyx_r = __pyx_v_self->n; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":126 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":129 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_13Float64Vector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_13Float64Vector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_13Float64Vector_4to_array(((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_13Float64Vector_4to_array(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_array", 0); + + /* "pandas/hashtable.pyx":130 + * + * def to_array(self): + * self.ao.resize(self.n) # <<<<<<<<<<<<<< + * self.m = self.n + * return self.ao + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":131 + * def to_array(self): + * self.ao.resize(self.n) + * self.m = self.n # <<<<<<<<<<<<<< + * return self.ao + * + */ + __pyx_t_4 = __pyx_v_self->n; + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":132 + * self.ao.resize(self.n) + * self.m = self.n + * return self.ao # <<<<<<<<<<<<<< + * + * cdef inline append(self, float64_t x): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->ao)); + __pyx_r = ((PyObject *)__pyx_v_self->ao); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":129 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Float64Vector.to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":134 + * return self.ao + * + * cdef inline append(self, float64_t x): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_13Float64Vector_append(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "pandas/hashtable.pyx":135 + * + * cdef inline append(self, float64_t x): + * if self.n == self.m: # <<<<<<<<<<<<<< + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + */ + __pyx_t_1 = ((__pyx_v_self->n == __pyx_v_self->m) != 0); + if (__pyx_t_1) { + + /* "pandas/hashtable.pyx":136 + * cdef inline append(self, float64_t x): + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) # <<<<<<<<<<<<<< + * self.ao.resize(self.m) + * self.data = self.ao.data + */ + __pyx_t_2 = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + __pyx_t_3 = (__pyx_v_self->m * 2); + if (((__pyx_t_2 > __pyx_t_3) != 0)) { + __pyx_t_4 = __pyx_t_2; + } else { + __pyx_t_4 = __pyx_t_3; + } + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":137 + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_self->m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":138 + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * self.data[self.n] = x + */ + __pyx_v_self->data = ((__pyx_t_5numpy_float64_t *)__pyx_v_self->ao->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":140 + * self.data = self.ao.data + * + * self.data[self.n] = x # <<<<<<<<<<<<<< + * self.n += 1 + * + */ + (__pyx_v_self->data[__pyx_v_self->n]) = __pyx_v_x; + + /* "pandas/hashtable.pyx":141 + * + * self.data[self.n] = x + * self.n += 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->n = (__pyx_v_self->n + 1); + + /* "pandas/hashtable.pyx":134 + * return self.ao + * + * cdef inline append(self, float64_t x): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.hashtable.Float64Vector.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":151 + * cdef kh_str_t *table + * + * def __cinit__(self, int size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_str() + * if size_hint is not None: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15StringHashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15StringHashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_size_hint; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_size_hint = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_size_hint == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_size_hint = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable___cinit__(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15StringHashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, int __pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":152 + * + * def __cinit__(self, int size_hint=1): + * self.table = kh_init_str() # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_str(self.table, size_hint) + */ + __pyx_v_self->table = kh_init_str(); + + /* "pandas/hashtable.pyx":153 + * def __cinit__(self, int size_hint=1): + * self.table = kh_init_str() + * if size_hint is not None: # <<<<<<<<<<<<<< + * kh_resize_str(self.table, size_hint) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size_hint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/hashtable.pyx":154 + * self.table = kh_init_str() + * if size_hint is not None: + * kh_resize_str(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + kh_resize_str(__pyx_v_self->table, __pyx_v_size_hint); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":151 + * cdef kh_str_t *table + * + * def __cinit__(self, int size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_str() + * if size_hint is not None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":156 + * kh_resize_str(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_str(self.table) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_15StringHashTable_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_15StringHashTable_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_15StringHashTable_2__dealloc__(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_15StringHashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":157 + * + * def __dealloc__(self): + * kh_destroy_str(self.table) # <<<<<<<<<<<<<< + * + * cdef inline int check_type(self, object val): + */ + kh_destroy_str(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":156 + * kh_resize_str(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_str(self.table) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":159 + * kh_destroy_str(self.table) + * + * cdef inline int check_type(self, object val): # <<<<<<<<<<<<<< + * return util.is_string_object(val) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_9hashtable_15StringHashTable_check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_type", 0); + + /* "pandas/hashtable.pyx":160 + * + * cdef inline int check_type(self, object val): + * return util.is_string_object(val) # <<<<<<<<<<<<<< + * + * cpdef get_item(self, object val): + */ + __pyx_r = is_string_object(__pyx_v_val); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":159 + * kh_destroy_str(self.table) + * + * cdef inline int check_type(self, object val): # <<<<<<<<<<<<<< + * return util.is_string_object(val) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":162 + * return util.is_string_object(val) + * + * cpdef get_item(self, object val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_str(self.table, util.get_c_string(val)) + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_15StringHashTable_get_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":164 + * cpdef get_item(self, object val): + * cdef khiter_t k + * k = kh_get_str(self.table, util.get_c_string(val)) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_str(__pyx_v_self->table, get_c_string(__pyx_v_val)); + + /* "pandas/hashtable.pyx":165 + * cdef khiter_t k + * k = kh_get_str(self.table, util.get_c_string(val)) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":166 + * k = kh_get_str(self.table, util.get_c_string(val)) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":168 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_iter_test(self, object key, Py_ssize_t iterations): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":162 + * return util.is_string_object(val) + * + * cpdef get_item(self, object val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_str(self.table, util.get_c_string(val)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_4get_item(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_4get_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":170 + * raise KeyError(val) + * + * def get_iter_test(self, object key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val + * for i in range(iterations): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_7get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_7get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + Py_ssize_t __pyx_v_iterations; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_iter_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_iterations,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iterations)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_iter_test") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_6get_iter_test(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_iterations); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_6get_iter_test(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_iterations) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_val; + khint_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_iter_test", 0); + + /* "pandas/hashtable.pyx":172 + * def get_iter_test(self, object key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val + * for i in range(iterations): # <<<<<<<<<<<<<< + * k = kh_get_str(self.table, util.get_c_string(key)) + * if k != self.table.n_buckets: + */ + __pyx_t_1 = __pyx_v_iterations; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":173 + * cdef Py_ssize_t i, val + * for i in range(iterations): + * k = kh_get_str(self.table, util.get_c_string(key)) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * val = self.table.vals[k] + */ + __pyx_v_k = kh_get_str(__pyx_v_self->table, get_c_string(__pyx_v_key)); + + /* "pandas/hashtable.pyx":174 + * for i in range(iterations): + * k = kh_get_str(self.table, util.get_c_string(key)) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * val = self.table.vals[k] + * + */ + __pyx_t_3 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_3) { + + /* "pandas/hashtable.pyx":175 + * k = kh_get_str(self.table, util.get_c_string(key)) + * if k != self.table.n_buckets: + * val = self.table.vals[k] # <<<<<<<<<<<<<< + * + * cpdef set_item(self, object key, Py_ssize_t val): + */ + __pyx_v_val = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":170 + * raise KeyError(val) + * + * def get_iter_test(self, object key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val + * for i in range(iterations): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":177 + * val = self.table.vals[k] + * + * cpdef set_item(self, object key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_15StringHashTable_set_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + char *__pyx_v_buf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + kh_cstr_t __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":180 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * char* buf + * + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":183 + * char* buf + * + * buf = util.get_c_string(key) # <<<<<<<<<<<<<< + * + * k = kh_put_str(self.table, buf, &ret) + */ + __pyx_v_buf = get_c_string(__pyx_v_key); + + /* "pandas/hashtable.pyx":185 + * buf = util.get_c_string(key) + * + * k = kh_put_str(self.table, buf, &ret) # <<<<<<<<<<<<<< + * self.table.keys[k] = key + * if kh_exist_str(self.table, k): + */ + __pyx_v_k = kh_put_str(__pyx_v_self->table, __pyx_v_buf, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":186 + * + * k = kh_put_str(self.table, buf, &ret) + * self.table.keys[k] = key # <<<<<<<<<<<<<< + * if kh_exist_str(self.table, k): + * self.table.vals[k] = val + */ + __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((__pyx_t_4 == (kh_cstr_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_t_4; + + /* "pandas/hashtable.pyx":187 + * k = kh_put_str(self.table, buf, &ret) + * self.table.keys[k] = key + * if kh_exist_str(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_5 = (kh_exist_str(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":188 + * self.table.keys[k] = key + * if kh_exist_str(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/hashtable.pyx":190 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def get_indexer(self, ndarray[object] values): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":177 + * val = self.table.vals[k] + * + * cpdef set_item(self, object key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_8set_item(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_8set_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":192 + * raise KeyError(key) + * + * def get_indexer(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_11get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_11get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indexer (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_10get_indexer(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_10get_indexer(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + char *__pyx_v_buf; + __pyx_t_5numpy_int64_t *__pyx_v_resbuf; + khiter_t __pyx_v_k; + kh_str_t *__pyx_v_table; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + kh_str_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_indexer", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":194 + * def get_indexer(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * char *buf + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":195 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * char *buf + * int64_t *resbuf = labels.data + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":197 + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * char *buf + * int64_t *resbuf = labels.data # <<<<<<<<<<<<<< + * khiter_t k + * kh_str_t *table = self.table + */ + __pyx_v_resbuf = ((__pyx_t_5numpy_int64_t *)__pyx_v_labels->data); + + /* "pandas/hashtable.pyx":199 + * int64_t *resbuf = labels.data + * khiter_t k + * kh_str_t *table = self.table # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_8 = __pyx_v_self->table; + __pyx_v_table = __pyx_t_8; + + /* "pandas/hashtable.pyx":201 + * kh_str_t *table = self.table + * + * for i in range(n): # <<<<<<<<<<<<<< + * buf = util.get_c_string(values[i]) + * k = kh_get_str(table, buf) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/hashtable.pyx":202 + * + * for i in range(n): + * buf = util.get_c_string(values[i]) # <<<<<<<<<<<<<< + * k = kh_get_str(table, buf) + * if k != table.n_buckets: + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_v_buf = get_c_string(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":203 + * for i in range(n): + * buf = util.get_c_string(values[i]) + * k = kh_get_str(table, buf) # <<<<<<<<<<<<<< + * if k != table.n_buckets: + * resbuf[i] = table.vals[k] + */ + __pyx_v_k = kh_get_str(__pyx_v_table, __pyx_v_buf); + + /* "pandas/hashtable.pyx":204 + * buf = util.get_c_string(values[i]) + * k = kh_get_str(table, buf) + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * resbuf[i] = table.vals[k] + * else: + */ + __pyx_t_12 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_12) { + + /* "pandas/hashtable.pyx":205 + * k = kh_get_str(table, buf) + * if k != table.n_buckets: + * resbuf[i] = table.vals[k] # <<<<<<<<<<<<<< + * else: + * resbuf[i] = -1 + */ + (__pyx_v_resbuf[__pyx_v_i]) = (__pyx_v_table->vals[__pyx_v_k]); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":207 + * resbuf[i] = table.vals[k] + * else: + * resbuf[i] = -1 # <<<<<<<<<<<<<< + * return labels + * + */ + (__pyx_v_resbuf[__pyx_v_i]) = -1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":208 + * else: + * resbuf[i] = -1 + * return labels # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + __pyx_r = ((PyObject *)__pyx_v_labels); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":192 + * raise KeyError(key) + * + * def get_indexer(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":210 + * return labels + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_13unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_13unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_12unique(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_12unique(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + char *__pyx_v_buf; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":212 + * def unique(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":213 + * cdef: + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":214 + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * char *buf + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":218 + * char *buf + * khiter_t k + * ObjectVector uniques = ObjectVector() # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_ObjectVector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":220 + * ObjectVector uniques = ObjectVector() + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * buf = util.get_c_string(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/hashtable.pyx":221 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":222 + * for i in range(n): + * val = values[i] + * buf = util.get_c_string(val) # <<<<<<<<<<<<<< + * k = kh_get_str(self.table, buf) + * if k == self.table.n_buckets: + */ + __pyx_v_buf = get_c_string(__pyx_v_val); + + /* "pandas/hashtable.pyx":223 + * val = values[i] + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) # <<<<<<<<<<<<<< + * if k == self.table.n_buckets: + * k = kh_put_str(self.table, buf, &ret) + */ + __pyx_v_k = kh_get_str(__pyx_v_self->table, __pyx_v_buf); + + /* "pandas/hashtable.pyx":224 + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) + * if k == self.table.n_buckets: # <<<<<<<<<<<<<< + * k = kh_put_str(self.table, buf, &ret) + * # print 'putting %s, %s' % (val, count) + */ + __pyx_t_6 = ((__pyx_v_k == __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":225 + * k = kh_get_str(self.table, buf) + * if k == self.table.n_buckets: + * k = kh_put_str(self.table, buf, &ret) # <<<<<<<<<<<<<< + * # print 'putting %s, %s' % (val, count) + * count += 1 + */ + __pyx_v_k = kh_put_str(__pyx_v_self->table, __pyx_v_buf, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":227 + * k = kh_put_str(self.table, buf, &ret) + * # print 'putting %s, %s' % (val, count) + * count += 1 # <<<<<<<<<<<<<< + * uniques.append(val) + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/hashtable.pyx":228 + * # print 'putting %s, %s' % (val, count) + * count += 1 + * uniques.append(val) # <<<<<<<<<<<<<< + * + * # return None + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_12ObjectVector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":231 + * + * # return None + * return uniques.to_array() # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":210 + * return labels + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":233 + * return uniques.to_array() + * + * def factorize(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_15factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_15factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_14factorize(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_14factorize(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + PyObject *__pyx_v_reverse = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + char *__pyx_v_buf; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":235 + * def factorize(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":236 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * dict reverse = {} + * Py_ssize_t idx, count = 0 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":237 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_reverse = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":238 + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":239 + * dict reverse = {} + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * char *buf + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":244 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * buf = util.get_c_string(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":245 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":246 + * for i in range(n): + * val = values[i] + * buf = util.get_c_string(val) # <<<<<<<<<<<<<< + * k = kh_get_str(self.table, buf) + * if k != self.table.n_buckets: + */ + __pyx_v_buf = get_c_string(__pyx_v_val); + + /* "pandas/hashtable.pyx":247 + * val = values[i] + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_str(__pyx_v_self->table, __pyx_v_buf); + + /* "pandas/hashtable.pyx":248 + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":249 + * k = kh_get_str(self.table, buf) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":250 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_str(self.table, buf, &ret) + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":252 + * labels[i] = idx + * else: + * k = kh_put_str(self.table, buf, &ret) # <<<<<<<<<<<<<< + * # print 'putting %s, %s' % (val, count) + * + */ + __pyx_v_k = kh_put_str(__pyx_v_self->table, __pyx_v_buf, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":255 + * # print 'putting %s, %s' % (val, count) + * + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * reverse[count] = val + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":256 + * + * self.table.vals[k] = count + * reverse[count] = val # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyDict_SetItem(__pyx_v_reverse, __pyx_t_6, __pyx_v_val) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":257 + * self.table.vals[k] = count + * reverse[count] = val + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":258 + * reverse[count] = val + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * # return None + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":261 + * + * # return None + * return reverse, labels # <<<<<<<<<<<<<< + * + * cdef class Int32HashTable(HashTable): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":233 + * return uniques.to_array() + * + * def factorize(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_reverse); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":266 + * cdef kh_int32_t *table + * + * def __init__(self, size_hint=1): # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_int32(self.table, size_hint) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_14Int32HashTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_14Int32HashTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable___init__(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_14Int32HashTable___init__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + khint_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/hashtable.pyx":267 + * + * def __init__(self, size_hint=1): + * if size_hint is not None: # <<<<<<<<<<<<<< + * kh_resize_int32(self.table, size_hint) + * + */ + __pyx_t_1 = (__pyx_v_size_hint != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/hashtable.pyx":268 + * def __init__(self, size_hint=1): + * if size_hint is not None: + * kh_resize_int32(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __cinit__(self): + */ + __pyx_t_3 = __Pyx_PyInt_As_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_3 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + kh_resize_int32(__pyx_v_self->table, __pyx_t_3); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":266 + * cdef kh_int32_t *table + * + * def __init__(self, size_hint=1): # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_int32(self.table, size_hint) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":270 + * kh_resize_int32(self.table, size_hint) + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.table = kh_init_int32() + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_14Int32HashTable_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_14Int32HashTable_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_2__cinit__(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_14Int32HashTable_2__cinit__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":271 + * + * def __cinit__(self): + * self.table = kh_init_int32() # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->table = kh_init_int32(); + + /* "pandas/hashtable.pyx":270 + * kh_resize_int32(self.table, size_hint) + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.table = kh_init_int32() + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":273 + * self.table = kh_init_int32() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_int32(self.table) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_14Int32HashTable_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_14Int32HashTable_5__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_14Int32HashTable_4__dealloc__(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_14Int32HashTable_4__dealloc__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":274 + * + * def __dealloc__(self): + * kh_destroy_int32(self.table) # <<<<<<<<<<<<<< + * + * cdef inline int check_type(self, object val): + */ + kh_destroy_int32(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":273 + * self.table = kh_init_int32() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_int32(self.table) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":276 + * kh_destroy_int32(self.table) + * + * cdef inline int check_type(self, object val): # <<<<<<<<<<<<<< + * return util.is_string_object(val) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_9hashtable_14Int32HashTable_check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_type", 0); + + /* "pandas/hashtable.pyx":277 + * + * cdef inline int check_type(self, object val): + * return util.is_string_object(val) # <<<<<<<<<<<<<< + * + * cpdef get_item(self, int32_t val): + */ + __pyx_r = is_string_object(__pyx_v_val); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":276 + * kh_destroy_int32(self.table) + * + * cdef inline int check_type(self, object val): # <<<<<<<<<<<<<< + * return util.is_string_object(val) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":279 + * return util.is_string_object(val) + * + * cpdef get_item(self, int32_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int32(self.table, val) + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_14Int32HashTable_get_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":281 + * cpdef get_item(self, int32_t val): + * cdef khiter_t k + * k = kh_get_int32(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":282 + * cdef khiter_t k + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":283 + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":285 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":279 + * return util.is_string_object(val) + * + * cpdef get_item(self, int32_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int32(self.table, val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + assert(__pyx_arg_val); { + __pyx_v_val = __Pyx_PyInt_As_npy_int32(__pyx_arg_val); if (unlikely((__pyx_v_val == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_6get_item(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), ((__pyx_t_5numpy_int32_t)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_6get_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":287 + * raise KeyError(val) + * + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_9get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_9get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_key; + Py_ssize_t __pyx_v_iterations; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_iter_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_iterations,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iterations)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_iter_test") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __Pyx_PyInt_As_npy_int32(values[0]); if (unlikely((__pyx_v_key == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_8get_iter_test(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_iterations); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_8get_iter_test(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_iterations) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_val; + khint_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_iter_test", 0); + + /* "pandas/hashtable.pyx":288 + * + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val=0 # <<<<<<<<<<<<<< + * for i in range(iterations): + * k = kh_get_int32(self.table, val) + */ + __pyx_v_val = 0; + + /* "pandas/hashtable.pyx":289 + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): # <<<<<<<<<<<<<< + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_1 = __pyx_v_iterations; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":290 + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + * k = kh_get_int32(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * val = self.table.vals[k] + */ + __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":291 + * for i in range(iterations): + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * val = self.table.vals[k] + * + */ + __pyx_t_3 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_3) { + + /* "pandas/hashtable.pyx":292 + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + * val = self.table.vals[k] # <<<<<<<<<<<<<< + * + * cpdef set_item(self, int32_t key, Py_ssize_t val): + */ + __pyx_v_val = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":287 + * raise KeyError(val) + * + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":294 + * val = self.table.vals[k] + * + * cpdef set_item(self, int32_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_14Int32HashTable_set_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":297 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * + * k = kh_put_int32(self.table, key, &ret) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":299 + * int ret = 0 + * + * k = kh_put_int32(self.table, key, &ret) # <<<<<<<<<<<<<< + * self.table.keys[k] = key + * if kh_exist_int32(self.table, k): + */ + __pyx_v_k = kh_put_int32(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":300 + * + * k = kh_put_int32(self.table, key, &ret) + * self.table.keys[k] = key # <<<<<<<<<<<<<< + * if kh_exist_int32(self.table, k): + * self.table.vals[k] = val + */ + (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_v_key; + + /* "pandas/hashtable.pyx":301 + * k = kh_put_int32(self.table, key, &ret) + * self.table.keys[k] = key + * if kh_exist_int32(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_5 = (kh_exist_int32(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":302 + * self.table.keys[k] = key + * if kh_exist_int32(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/hashtable.pyx":304 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def map_locations(self, ndarray[int32_t] values): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":294 + * val = self.table.vals[k] + * + * cpdef set_item(self, int32_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int32_t __pyx_v_key; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __Pyx_PyInt_As_npy_int32(values[0]); if (unlikely((__pyx_v_key == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_10set_item(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_10set_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":306 + * raise KeyError(key) + * + * def map_locations(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_13map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_13map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_locations (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_12map_locations(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_12map_locations(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + __pyx_t_5numpy_int32_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_locations", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":308 + * def map_locations(self, ndarray[int32_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int32_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":309 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int32_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":313 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_put_int32(self.table, val, &ret) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":314 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_put_int32(self.table, val, &ret) + * self.table.vals[k] = i + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":315 + * for i in range(n): + * val = values[i] + * k = kh_put_int32(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = i + * + */ + __pyx_v_k = kh_put_int32(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":316 + * val = values[i] + * k = kh_put_int32(self.table, val, &ret) + * self.table.vals[k] = i # <<<<<<<<<<<<<< + * + * def lookup(self, ndarray[int32_t] values): + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_i; + } + + /* "pandas/hashtable.pyx":306 + * raise KeyError(key) + * + * def map_locations(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":318 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_15lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_15lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_14lookup(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_14lookup(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + __pyx_t_5numpy_int32_t __pyx_v_val; + khiter_t __pyx_v_k; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":320 + * def lookup(self, ndarray[int32_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int32_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":321 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int32_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":324 + * int32_t val + * khiter_t k + * ndarray[int32_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":326 + * ndarray[int32_t] locs = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int32(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":327 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":328 + * for i in range(n): + * val = values[i] + * k = kh_get_int32(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] + */ + __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":329 + * val = values[i] + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * locs[i] = self.table.vals[k] + * else: + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":330 + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * locs[i] = -1 + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides) = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":332 + * locs[i] = self.table.vals[k] + * else: + * locs[i] = -1 # <<<<<<<<<<<<<< + * + * return locs + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_locs.diminfo[0].strides) = -1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":334 + * locs[i] = -1 + * + * return locs # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[int32_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":318 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":336 + * return locs + * + * def factorize(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_17factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_17factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_16factorize(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_16factorize(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + PyObject *__pyx_v_reverse = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_int32_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":338 + * def factorize(self, ndarray[int32_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":339 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * dict reverse = {} + * Py_ssize_t idx, count = 0 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":340 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_reverse = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":341 + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * int32_t val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":342 + * dict reverse = {} + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * int32_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":346 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int32(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":347 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":348 + * for i in range(n): + * val = values[i] + * k = kh_get_int32(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":349 + * val = values[i] + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":350 + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":351 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_int32(self.table, val, &ret) + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":353 + * labels[i] = idx + * else: + * k = kh_put_int32(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * reverse[count] = val + */ + __pyx_v_k = kh_put_int32(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":354 + * else: + * k = kh_put_int32(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * reverse[count] = val + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":355 + * k = kh_put_int32(self.table, val, &ret) + * self.table.vals[k] = count + * reverse[count] = val # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_v_reverse, __pyx_t_2, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":356 + * self.table.vals[k] = count + * reverse[count] = val + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":357 + * reverse[count] = val + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * # return None + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":360 + * + * # return None + * return reverse, labels # <<<<<<<<<<<<<< + * + * cdef class Int64HashTable: #(HashTable): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":336 + * return locs + * + * def factorize(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_reverse); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":365 + * # cdef kh_int64_t *table + * + * def __cinit__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_int64() + * if size_hint is not None: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_14Int64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_14Int64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable___cinit__(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_14Int64HashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + khint_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":366 + * + * def __cinit__(self, size_hint=1): + * self.table = kh_init_int64() # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_int64(self.table, size_hint) + */ + __pyx_v_self->table = kh_init_int64(); + + /* "pandas/hashtable.pyx":367 + * def __cinit__(self, size_hint=1): + * self.table = kh_init_int64() + * if size_hint is not None: # <<<<<<<<<<<<<< + * kh_resize_int64(self.table, size_hint) + * + */ + __pyx_t_1 = (__pyx_v_size_hint != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/hashtable.pyx":368 + * self.table = kh_init_int64() + * if size_hint is not None: + * kh_resize_int64(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_3 = __Pyx_PyInt_As_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_3 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + kh_resize_int64(__pyx_v_self->table, __pyx_t_3); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":365 + * # cdef kh_int64_t *table + * + * def __cinit__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_int64() + * if size_hint is not None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":370 + * kh_resize_int64(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_int64(self.table) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_14Int64HashTable_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_14Int64HashTable_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_14Int64HashTable_2__dealloc__(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_14Int64HashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":371 + * + * def __dealloc__(self): + * kh_destroy_int64(self.table) # <<<<<<<<<<<<<< + * + * def __contains__(self, object key): + */ + kh_destroy_int64(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":370 + * kh_resize_int64(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_int64(self.table) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":373 + * kh_destroy_int64(self.table) + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int64(self.table, key) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_14Int64HashTable_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_14Int64HashTable_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_4__contains__(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_14Int64HashTable_4__contains__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyObject *__pyx_v_key) { + khiter_t __pyx_v_k; + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_int64_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + + /* "pandas/hashtable.pyx":375 + * def __contains__(self, object key): + * cdef khiter_t k + * k = kh_get_int64(self.table, key) # <<<<<<<<<<<<<< + * return k != self.table.n_buckets + * + */ + __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_key); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_t_1); + + /* "pandas/hashtable.pyx":376 + * cdef khiter_t k + * k = kh_get_int64(self.table, key) + * return k != self.table.n_buckets # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_r = (__pyx_v_k != __pyx_v_self->table->n_buckets); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":373 + * kh_destroy_int64(self.table) + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int64(self.table, key) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":378 + * return k != self.table.n_buckets + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_14Int64HashTable_7__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_14Int64HashTable_7__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_6__len__(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_14Int64HashTable_6__len__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":379 + * + * def __len__(self): + * return self.table.size # <<<<<<<<<<<<<< + * + * cpdef get_item(self, int64_t val): + */ + __pyx_r = __pyx_v_self->table->size; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":378 + * return k != self.table.n_buckets + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":381 + * return self.table.size + * + * cpdef get_item(self, int64_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int64(self.table, val) + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_14Int64HashTable_get_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":383 + * cpdef get_item(self, int64_t val): + * cdef khiter_t k + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":384 + * cdef khiter_t k + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":385 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":387 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":381 + * return self.table.size + * + * cpdef get_item(self, int64_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int64(self.table, val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + assert(__pyx_arg_val); { + __pyx_v_val = __Pyx_PyInt_As_npy_int64(__pyx_arg_val); if (unlikely((__pyx_v_val == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_8get_item(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((__pyx_t_5numpy_int64_t)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_8get_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":389 + * raise KeyError(val) + * + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_11get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_11get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_key; + Py_ssize_t __pyx_v_iterations; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_iter_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_iterations,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iterations)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_iter_test") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_key == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_10get_iter_test(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_iterations); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_10get_iter_test(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_iterations) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_val; + khint_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_iter_test", 0); + + /* "pandas/hashtable.pyx":390 + * + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val=0 # <<<<<<<<<<<<<< + * for i in range(iterations): + * k = kh_get_int64(self.table, val) + */ + __pyx_v_val = 0; + + /* "pandas/hashtable.pyx":391 + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): # <<<<<<<<<<<<<< + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_1 = __pyx_v_iterations; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":392 + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * val = self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":393 + * for i in range(iterations): + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * val = self.table.vals[k] + * + */ + __pyx_t_3 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_3) { + + /* "pandas/hashtable.pyx":394 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * val = self.table.vals[k] # <<<<<<<<<<<<<< + * + * cpdef set_item(self, int64_t key, Py_ssize_t val): + */ + __pyx_v_val = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":389 + * raise KeyError(val) + * + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":396 + * val = self.table.vals[k] + * + * cpdef set_item(self, int64_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_14Int64HashTable_set_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":399 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * + * k = kh_put_int64(self.table, key, &ret) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":401 + * int ret = 0 + * + * k = kh_put_int64(self.table, key, &ret) # <<<<<<<<<<<<<< + * self.table.keys[k] = key + * if kh_exist_int64(self.table, k): + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":402 + * + * k = kh_put_int64(self.table, key, &ret) + * self.table.keys[k] = key # <<<<<<<<<<<<<< + * if kh_exist_int64(self.table, k): + * self.table.vals[k] = val + */ + (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_v_key; + + /* "pandas/hashtable.pyx":403 + * k = kh_put_int64(self.table, key, &ret) + * self.table.keys[k] = key + * if kh_exist_int64(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_5 = (kh_exist_int64(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":404 + * self.table.keys[k] = key + * if kh_exist_int64(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/hashtable.pyx":406 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def map(self, ndarray[int64_t] keys, ndarray[int64_t] values): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":396 + * val = self.table.vals[k] + * + * cpdef set_item(self, int64_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_key; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_key == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_12set_item(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_12set_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":408 + * raise KeyError(key) + * + * def map(self, ndarray[int64_t] keys, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_15map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_15map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_keys = 0; + PyArrayObject *__pyx_v_values = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_keys,&__pyx_n_s_values,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_keys = ((PyArrayObject *)values[0]); + __pyx_v_values = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_14map(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_keys, __pyx_v_values); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_14map(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_keys, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_key; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_keys; + __Pyx_Buffer __pyx_pybuffer_keys; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map", 0); + __pyx_pybuffer_keys.pybuffer.buf = NULL; + __pyx_pybuffer_keys.refcount = 0; + __pyx_pybuffernd_keys.data = NULL; + __pyx_pybuffernd_keys.rcbuffer = &__pyx_pybuffer_keys; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":410 + * def map(self, ndarray[int64_t] keys, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t key + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":411 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t key + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":415 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * key = keys[i] + * k = kh_put_int64(self.table, key, &ret) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":416 + * + * for i in range(n): + * key = keys[i] # <<<<<<<<<<<<<< + * k = kh_put_int64(self.table, key, &ret) + * self.table.vals[k] = values[i] + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_keys.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_keys.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_key = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_keys.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_keys.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":417 + * for i in range(n): + * key = keys[i] + * k = kh_put_int64(self.table, key, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = values[i] + * + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":418 + * key = keys[i] + * k = kh_put_int64(self.table, key, &ret) + * self.table.vals[k] = values[i] # <<<<<<<<<<<<<< + * + * def map_locations(self, ndarray[int64_t] values): + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + (__pyx_v_self->table->vals[__pyx_v_k]) = ((Py_ssize_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_values.diminfo[0].strides))); + } + + /* "pandas/hashtable.pyx":408 + * raise KeyError(key) + * + * def map(self, ndarray[int64_t] keys, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_keys.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_keys.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":420 + * self.table.vals[k] = values[i] + * + * def map_locations(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_locations (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_16map_locations(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_locations", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":422 + * def map_locations(self, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":423 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":427 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_put_int64(self.table, val, &ret) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":428 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = i + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":429 + * for i in range(n): + * val = values[i] + * k = kh_put_int64(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = i + * + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":430 + * val = values[i] + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = i # <<<<<<<<<<<<<< + * + * def lookup(self, ndarray[int64_t] values): + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_i; + } + + /* "pandas/hashtable.pyx":420 + * self.table.vals[k] = values[i] + * + * def map_locations(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":432 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_18lookup(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":434 + * def lookup(self, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":435 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":438 + * int64_t val + * khiter_t k + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":440 + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int64(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":441 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":442 + * for i in range(n): + * val = values[i] + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":443 + * val = values[i] + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * locs[i] = self.table.vals[k] + * else: + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":444 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * locs[i] = -1 + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides) = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":446 + * locs[i] = self.table.vals[k] + * else: + * locs[i] = -1 # <<<<<<<<<<<<<< + * + * return locs + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_locs.diminfo[0].strides) = -1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":448 + * locs[i] = -1 + * + * return locs # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":432 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":450 + * return locs + * + * def factorize(self, ndarray[object] values): # <<<<<<<<<<<<<< + * reverse = {} + * labels = self.get_labels(values, reverse, 0) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_21factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_21factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_20factorize(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_20factorize(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + PyObject *__pyx_v_reverse = NULL; + PyObject *__pyx_v_labels = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":451 + * + * def factorize(self, ndarray[object] values): + * reverse = {} # <<<<<<<<<<<<<< + * labels = self.get_labels(values, reverse, 0) + * return reverse, labels + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_reverse = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":452 + * def factorize(self, ndarray[object] values): + * reverse = {} + * labels = self.get_labels(values, reverse, 0) # <<<<<<<<<<<<<< + * return reverse, labels + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_labels = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/hashtable.pyx":453 + * reverse = {} + * labels = self.get_labels(values, reverse, 0) + * return reverse, labels # <<<<<<<<<<<<<< + * + * def get_labels(self, ndarray[int64_t] values, Int64Vector uniques, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(__pyx_v_labels); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":450 + * return locs + * + * def factorize(self, ndarray[object] values): # <<<<<<<<<<<<<< + * reverse = {} + * labels = self.get_labels(values, reverse, 0) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_reverse); + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":455 + * return reverse, labels + * + * def get_labels(self, ndarray[int64_t] values, Int64Vector uniques, # <<<<<<<<<<<<<< + * Py_ssize_t count_prior, Py_ssize_t na_sentinel): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_23get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_23get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques = 0; + Py_ssize_t __pyx_v_count_prior; + CYTHON_UNUSED Py_ssize_t __pyx_v_na_sentinel; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_labels (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_uniques,&__pyx_n_s_count_prior,&__pyx_n_s_na_sentinel,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_uniques)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_prior)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_labels") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)values[1]); + __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_na_sentinel = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_na_sentinel == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), __pyx_ptype_6pandas_9hashtable_Int64Vector, 1, "uniques", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_22get_labels(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_values, __pyx_v_uniques, __pyx_v_count_prior, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_22get_labels(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, CYTHON_UNUSED Py_ssize_t __pyx_v_na_sentinel) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_labels", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":458 + * Py_ssize_t count_prior, Py_ssize_t na_sentinel): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":460 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t val + */ + __pyx_v_count = __pyx_v_count_prior; + + /* "pandas/hashtable.pyx":461 + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":465 + * khiter_t k + * + * labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":467 + * labels = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int64(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/hashtable.pyx":468 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":469 + * for i in range(n): + * val = values[i] + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":470 + * val = values[i] + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_14 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":471 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":472 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_int64(self.table, val, &ret) + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":474 + * labels[i] = idx + * else: + * k = kh_put_int64(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * uniques.append(val) + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":475 + * else: + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * uniques.append(val) + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":476 + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = count + * uniques.append(val) # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __pyx_f_6pandas_9hashtable_11Int64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":477 + * self.table.vals[k] = count + * uniques.append(val) + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":478 + * uniques.append(val) + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * return labels + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":480 + * count += 1 + * + * return labels # <<<<<<<<<<<<<< + * + * def get_labels_groupby(self, ndarray[int64_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + __pyx_r = ((PyObject *)__pyx_v_labels); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":455 + * return reverse, labels + * + * def get_labels(self, ndarray[int64_t] values, Int64Vector uniques, # <<<<<<<<<<<<<< + * Py_ssize_t count_prior, Py_ssize_t na_sentinel): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":482 + * return labels + * + * def get_labels_groupby(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_25get_labels_groupby(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_25get_labels_groupby(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_labels_groupby (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_24get_labels_groupby(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_24get_labels_groupby(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques = 0; + PyObject *__pyx_v_arr_uniques = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_labels_groupby", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":484 + * def get_labels_groupby(self, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels + * Py_ssize_t idx, count = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":486 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":487 + * ndarray[int64_t] labels + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":490 + * int64_t val + * khiter_t k + * Int64Vector uniques = Int64Vector() # <<<<<<<<<<<<<< + * + * labels = np.empty(n, dtype=np.int64) + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Int64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":492 + * Int64Vector uniques = Int64Vector() + * + * labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":494 + * labels = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/hashtable.pyx":495 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * # specific for groupby + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":498 + * + * # specific for groupby + * if val < 0: # <<<<<<<<<<<<<< + * labels[i] = -1 + * continue + */ + __pyx_t_14 = ((__pyx_v_val < 0) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":499 + * # specific for groupby + * if val < 0: + * labels[i] = -1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides) = -1; + + /* "pandas/hashtable.pyx":500 + * if val < 0: + * labels[i] = -1 + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_int64(self.table, val) + */ + goto __pyx_L3_continue; + } + + /* "pandas/hashtable.pyx":502 + * continue + * + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":503 + * + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_14 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":504 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":505 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_int64(self.table, val, &ret) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":507 + * labels[i] = idx + * else: + * k = kh_put_int64(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * uniques.append(val) + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":508 + * else: + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * uniques.append(val) + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":509 + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = count + * uniques.append(val) # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __pyx_f_6pandas_9hashtable_11Int64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":510 + * self.table.vals[k] = count + * uniques.append(val) + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":511 + * uniques.append(val) + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * arr_uniques = uniques.to_array() + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":513 + * count += 1 + * + * arr_uniques = uniques.to_array() # <<<<<<<<<<<<<< + * + * return labels, arr_uniques + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_arr_uniques = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":515 + * arr_uniques = uniques.to_array() + * + * return labels, arr_uniques # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[int64_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + __Pyx_INCREF(__pyx_v_arr_uniques); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_arr_uniques); + __Pyx_GIVEREF(__pyx_v_arr_uniques); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":482 + * return labels + * + * def get_labels_groupby(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_labels_groupby", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_arr_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":517 + * return labels, arr_uniques + * + * def unique(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_27unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_27unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_26unique(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_26unique(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":519 + * def unique(self, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":520 + * cdef: + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * ndarray result + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":521 + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * ndarray result + * int64_t val + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":525 + * int64_t val + * khiter_t k + * Int64Vector uniques = Int64Vector() # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Int64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":527 + * Int64Vector uniques = Int64Vector() + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int64(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/hashtable.pyx":528 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(self.table, val) + * if k == self.table.n_buckets: + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":529 + * for i in range(n): + * val = values[i] + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k == self.table.n_buckets: + * k = kh_put_int64(self.table, val, &ret) + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":530 + * val = values[i] + * k = kh_get_int64(self.table, val) + * if k == self.table.n_buckets: # <<<<<<<<<<<<<< + * k = kh_put_int64(self.table, val, &ret) + * uniques.append(val) + */ + __pyx_t_6 = ((__pyx_v_k == __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":531 + * k = kh_get_int64(self.table, val) + * if k == self.table.n_buckets: + * k = kh_put_int64(self.table, val, &ret) # <<<<<<<<<<<<<< + * uniques.append(val) + * count += 1 + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":532 + * if k == self.table.n_buckets: + * k = kh_put_int64(self.table, val, &ret) + * uniques.append(val) # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_11Int64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":533 + * k = kh_put_int64(self.table, val, &ret) + * uniques.append(val) + * count += 1 # <<<<<<<<<<<<<< + * + * result = uniques.to_array() + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":535 + * count += 1 + * + * result = uniques.to_array() # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/hashtable.pyx":537 + * result = uniques.to_array() + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":517 + * return labels, arr_uniques + * + * def unique(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":541 + * + * cdef class Float64HashTable(HashTable): + * def __cinit__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_float64() + * if size_hint is not None: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_16Float64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_16Float64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable___cinit__(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_16Float64HashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + khint_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":542 + * cdef class Float64HashTable(HashTable): + * def __cinit__(self, size_hint=1): + * self.table = kh_init_float64() # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_float64(self.table, size_hint) + */ + __pyx_v_self->table = kh_init_float64(); + + /* "pandas/hashtable.pyx":543 + * def __cinit__(self, size_hint=1): + * self.table = kh_init_float64() + * if size_hint is not None: # <<<<<<<<<<<<<< + * kh_resize_float64(self.table, size_hint) + * + */ + __pyx_t_1 = (__pyx_v_size_hint != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/hashtable.pyx":544 + * self.table = kh_init_float64() + * if size_hint is not None: + * kh_resize_float64(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_t_3 = __Pyx_PyInt_As_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_3 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + kh_resize_float64(__pyx_v_self->table, __pyx_t_3); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":541 + * + * cdef class Float64HashTable(HashTable): + * def __cinit__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_float64() + * if size_hint is not None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":546 + * kh_resize_float64(self.table, size_hint) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_16Float64HashTable_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_16Float64HashTable_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_2__len__(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_16Float64HashTable_2__len__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":547 + * + * def __len__(self): + * return self.table.size # <<<<<<<<<<<<<< + * + * cpdef get_item(self, float64_t val): + */ + __pyx_r = __pyx_v_self->table->size; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":546 + * kh_resize_float64(self.table, size_hint) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":549 + * return self.table.size + * + * cpdef get_item(self, float64_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_float64(self.table, val) + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_16Float64HashTable_get_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":551 + * cpdef get_item(self, float64_t val): + * cdef khiter_t k + * k = kh_get_float64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":552 + * cdef khiter_t k + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":553 + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":555 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * cpdef set_item(self, float64_t key, Py_ssize_t val): + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":549 + * return self.table.size + * + * cpdef get_item(self, float64_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_float64(self.table, val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + assert(__pyx_arg_val); { + __pyx_v_val = __pyx_PyFloat_AsDouble(__pyx_arg_val); if (unlikely((__pyx_v_val == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_4get_item(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_4get_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":557 + * raise KeyError(val) + * + * cpdef set_item(self, float64_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_16Float64HashTable_set_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":560 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * + * k = kh_put_float64(self.table, key, &ret) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":562 + * int ret = 0 + * + * k = kh_put_float64(self.table, key, &ret) # <<<<<<<<<<<<<< + * self.table.keys[k] = key + * if kh_exist_float64(self.table, k): + */ + __pyx_v_k = kh_put_float64(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":563 + * + * k = kh_put_float64(self.table, key, &ret) + * self.table.keys[k] = key # <<<<<<<<<<<<<< + * if kh_exist_float64(self.table, k): + * self.table.vals[k] = val + */ + (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_v_key; + + /* "pandas/hashtable.pyx":564 + * k = kh_put_float64(self.table, key, &ret) + * self.table.keys[k] = key + * if kh_exist_float64(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_5 = (kh_exist_float64(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":565 + * self.table.keys[k] = key + * if kh_exist_float64(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/hashtable.pyx":567 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":557 + * raise KeyError(val) + * + * cpdef set_item(self, float64_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_float64_t __pyx_v_key; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_key == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_6set_item(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_6set_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":569 + * raise KeyError(key) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_float64(self.table) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_16Float64HashTable_9__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_16Float64HashTable_9__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_16Float64HashTable_8__dealloc__(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_16Float64HashTable_8__dealloc__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":570 + * + * def __dealloc__(self): + * kh_destroy_float64(self.table) # <<<<<<<<<<<<<< + * + * def __contains__(self, object key): + */ + kh_destroy_float64(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":569 + * raise KeyError(key) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_float64(self.table) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":572 + * kh_destroy_float64(self.table) + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_float64(self.table, key) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_16Float64HashTable_11__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_16Float64HashTable_11__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_10__contains__(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_16Float64HashTable_10__contains__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyObject *__pyx_v_key) { + khiter_t __pyx_v_k; + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_float64_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + + /* "pandas/hashtable.pyx":574 + * def __contains__(self, object key): + * cdef khiter_t k + * k = kh_get_float64(self.table, key) # <<<<<<<<<<<<<< + * return k != self.table.n_buckets + * + */ + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_key); if (unlikely((__pyx_t_1 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_t_1); + + /* "pandas/hashtable.pyx":575 + * cdef khiter_t k + * k = kh_get_float64(self.table, key) + * return k != self.table.n_buckets # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[float64_t] values): + */ + __pyx_r = (__pyx_v_k != __pyx_v_self->table->n_buckets); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":572 + * kh_destroy_float64(self.table) + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_float64(self.table, key) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":577 + * return k != self.table.n_buckets + * + * def factorize(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * uniques = Float64Vector() + * labels = self.get_labels(values, uniques, 0, -1) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_13factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_13factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_12factorize(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_12factorize(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques = NULL; + PyObject *__pyx_v_labels = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":578 + * + * def factorize(self, ndarray[float64_t] values): + * uniques = Float64Vector() # <<<<<<<<<<<<<< + * labels = self.get_labels(values, uniques, 0, -1) + * return uniques.to_array(), labels + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Float64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":579 + * def factorize(self, ndarray[float64_t] values): + * uniques = Float64Vector() + * labels = self.get_labels(values, uniques, 0, -1) # <<<<<<<<<<<<<< + * return uniques.to_array(), labels + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_uniques)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_uniques)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_uniques)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_labels = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/hashtable.pyx":580 + * uniques = Float64Vector() + * labels = self.get_labels(values, uniques, 0, -1) + * return uniques.to_array(), labels # <<<<<<<<<<<<<< + * + * def get_labels(self, ndarray[float64_t] values, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_labels); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":577 + * return k != self.table.n_buckets + * + * def factorize(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * uniques = Float64Vector() + * labels = self.get_labels(values, uniques, 0, -1) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":582 + * return uniques.to_array(), labels + * + * def get_labels(self, ndarray[float64_t] values, # <<<<<<<<<<<<<< + * Float64Vector uniques, + * Py_ssize_t count_prior, int64_t na_sentinel): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_15get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_15get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques = 0; + Py_ssize_t __pyx_v_count_prior; + __pyx_t_5numpy_int64_t __pyx_v_na_sentinel; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_labels (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_uniques,&__pyx_n_s_count_prior,&__pyx_n_s_na_sentinel,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_uniques)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_prior)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_labels") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)values[1]); + __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_na_sentinel = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_na_sentinel == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), __pyx_ptype_6pandas_9hashtable_Float64Vector, 1, "uniques", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_14get_labels(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), __pyx_v_values, __pyx_v_uniques, __pyx_v_count_prior, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_14get_labels(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_float64_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_labels", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":586 + * Py_ssize_t count_prior, int64_t na_sentinel): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":588 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior # <<<<<<<<<<<<<< + * int ret = 0 + * float64_t val + */ + __pyx_v_count = __pyx_v_count_prior; + + /* "pandas/hashtable.pyx":589 + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + * int ret = 0 # <<<<<<<<<<<<<< + * float64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":593 + * khiter_t k + * + * labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":595 + * labels = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/hashtable.pyx":596 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * if val != val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":598 + * val = values[i] + * + * if val != val: # <<<<<<<<<<<<<< + * labels[i] = na_sentinel + * continue + */ + __pyx_t_14 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":599 + * + * if val != val: + * labels[i] = na_sentinel # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_na_sentinel; + + /* "pandas/hashtable.pyx":600 + * if val != val: + * labels[i] = na_sentinel + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_float64(self.table, val) + */ + goto __pyx_L3_continue; + } + + /* "pandas/hashtable.pyx":602 + * continue + * + * k = kh_get_float64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":603 + * + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_14 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":604 + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":605 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_float64(self.table, val, &ret) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":607 + * labels[i] = idx + * else: + * k = kh_put_float64(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * uniques.append(val) + */ + __pyx_v_k = kh_put_float64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":608 + * else: + * k = kh_put_float64(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * uniques.append(val) + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":609 + * k = kh_put_float64(self.table, val, &ret) + * self.table.vals[k] = count + * uniques.append(val) # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __pyx_f_6pandas_9hashtable_13Float64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":610 + * self.table.vals[k] = count + * uniques.append(val) + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":611 + * uniques.append(val) + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * return labels + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":613 + * count += 1 + * + * return labels # <<<<<<<<<<<<<< + * + * def map_locations(self, ndarray[float64_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + __pyx_r = ((PyObject *)__pyx_v_labels); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":582 + * return uniques.to_array(), labels + * + * def get_labels(self, ndarray[float64_t] values, # <<<<<<<<<<<<<< + * Float64Vector uniques, + * Py_ssize_t count_prior, int64_t na_sentinel): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":615 + * return labels + * + * def map_locations(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_locations (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_16map_locations(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_locations", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":617 + * def map_locations(self, ndarray[float64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * khiter_t k + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":618 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":621 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * k = kh_put_float64(self.table, values[i], &ret) + * self.table.vals[k] = i + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":622 + * + * for i in range(n): + * k = kh_put_float64(self.table, values[i], &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = i + * + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_k = kh_put_float64(__pyx_v_self->table, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides)), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":623 + * for i in range(n): + * k = kh_put_float64(self.table, values[i], &ret) + * self.table.vals[k] = i # <<<<<<<<<<<<<< + * + * def lookup(self, ndarray[float64_t] values): + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_i; + } + + /* "pandas/hashtable.pyx":615 + * return labels + * + * def map_locations(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":625 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_18lookup(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + __pyx_t_5numpy_float64_t __pyx_v_val; + khiter_t __pyx_v_k; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":627 + * def lookup(self, ndarray[float64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * float64_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":628 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * float64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":631 + * float64_t val + * khiter_t k + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":633 + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_float64(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":634 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":635 + * for i in range(n): + * val = values[i] + * k = kh_get_float64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] + */ + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":636 + * val = values[i] + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * locs[i] = self.table.vals[k] + * else: + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":637 + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * locs[i] = -1 + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides) = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":639 + * locs[i] = self.table.vals[k] + * else: + * locs[i] = -1 # <<<<<<<<<<<<<< + * + * return locs + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_locs.diminfo[0].strides) = -1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":641 + * locs[i] = -1 + * + * return locs # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[float64_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":625 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":643 + * return locs + * + * def unique(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_21unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_21unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_20unique(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_20unique(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_float64_t __pyx_v_val; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques = 0; + int __pyx_v_seen_na; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + __pyx_t_5numpy_float64_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":645 + * def unique(self, ndarray[float64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":646 + * cdef: + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * float64_t val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":647 + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * float64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":650 + * float64_t val + * khiter_t k + * Float64Vector uniques = Float64Vector() # <<<<<<<<<<<<<< + * bint seen_na = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Float64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":651 + * khiter_t k + * Float64Vector uniques = Float64Vector() + * bint seen_na = 0 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_seen_na = 0; + + /* "pandas/hashtable.pyx":653 + * bint seen_na = 0 + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/hashtable.pyx":654 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":656 + * val = values[i] + * + * if val == val: # <<<<<<<<<<<<<< + * k = kh_get_float64(self.table, val) + * if k == self.table.n_buckets: + */ + __pyx_t_6 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":657 + * + * if val == val: + * k = kh_get_float64(self.table, val) # <<<<<<<<<<<<<< + * if k == self.table.n_buckets: + * k = kh_put_float64(self.table, val, &ret) + */ + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":658 + * if val == val: + * k = kh_get_float64(self.table, val) + * if k == self.table.n_buckets: # <<<<<<<<<<<<<< + * k = kh_put_float64(self.table, val, &ret) + * uniques.append(val) + */ + __pyx_t_6 = ((__pyx_v_k == __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":659 + * k = kh_get_float64(self.table, val) + * if k == self.table.n_buckets: + * k = kh_put_float64(self.table, val, &ret) # <<<<<<<<<<<<<< + * uniques.append(val) + * count += 1 + */ + __pyx_v_k = kh_put_float64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":660 + * if k == self.table.n_buckets: + * k = kh_put_float64(self.table, val, &ret) + * uniques.append(val) # <<<<<<<<<<<<<< + * count += 1 + * elif not seen_na: + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_13Float64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":661 + * k = kh_put_float64(self.table, val, &ret) + * uniques.append(val) + * count += 1 # <<<<<<<<<<<<<< + * elif not seen_na: + * seen_na = 1 + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + + /* "pandas/hashtable.pyx":662 + * uniques.append(val) + * count += 1 + * elif not seen_na: # <<<<<<<<<<<<<< + * seen_na = 1 + * uniques.append(ONAN) + */ + __pyx_t_6 = ((!(__pyx_v_seen_na != 0)) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":663 + * count += 1 + * elif not seen_na: + * seen_na = 1 # <<<<<<<<<<<<<< + * uniques.append(ONAN) + * + */ + __pyx_v_seen_na = 1; + + /* "pandas/hashtable.pyx":664 + * elif not seen_na: + * seen_na = 1 + * uniques.append(ONAN) # <<<<<<<<<<<<<< + * + * return uniques.to_array() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ONAN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_f_6pandas_9hashtable_13Float64Vector_append(__pyx_v_uniques, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":666 + * uniques.append(ONAN) + * + * return uniques.to_array() # <<<<<<<<<<<<<< + * + * na_sentinel = object + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":643 + * return locs + * + * def unique(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":673 + * # cdef kh_pymap_t *table + * + * def __init__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_pymap() + * kh_resize_pymap(self.table, size_hint) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable___init__(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_17PyObjectHashTable___init__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + khint_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/hashtable.pyx":674 + * + * def __init__(self, size_hint=1): + * self.table = kh_init_pymap() # <<<<<<<<<<<<<< + * kh_resize_pymap(self.table, size_hint) + * + */ + __pyx_v_self->table = kh_init_pymap(); + + /* "pandas/hashtable.pyx":675 + * def __init__(self, size_hint=1): + * self.table = kh_init_pymap() + * kh_resize_pymap(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_1 = __Pyx_PyInt_As_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_1 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + kh_resize_pymap(__pyx_v_self->table, __pyx_t_1); + + /* "pandas/hashtable.pyx":673 + * # cdef kh_pymap_t *table + * + * def __init__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_pymap() + * kh_resize_pymap(self.table, size_hint) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":677 + * kh_resize_pymap(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.table is not NULL: + * self.destroy() + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_2__dealloc__(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":678 + * + * def __dealloc__(self): + * if self.table is not NULL: # <<<<<<<<<<<<<< + * self.destroy() + * + */ + __pyx_t_1 = ((__pyx_v_self->table != NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/hashtable.pyx":679 + * def __dealloc__(self): + * if self.table is not NULL: + * self.destroy() # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":677 + * kh_resize_pymap(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.table is not NULL: + * self.destroy() + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("pandas.hashtable.PyObjectHashTable.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":681 + * self.destroy() + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_5__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_5__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_4__len__(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_4__len__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":682 + * + * def __len__(self): + * return self.table.size # <<<<<<<<<<<<<< + * + * def __contains__(self, object key): + */ + __pyx_r = __pyx_v_self->table->size; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":681 + * self.destroy() + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":684 + * return self.table.size + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * hash(key) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_6__contains__(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_6__contains__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key) { + khiter_t __pyx_v_k; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_hash_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + __Pyx_INCREF(__pyx_v_key); + + /* "pandas/hashtable.pyx":686 + * def __contains__(self, object key): + * cdef khiter_t k + * hash(key) # <<<<<<<<<<<<<< + * if key != key or key is None: + * key = na_sentinel + */ + __pyx_t_1 = PyObject_Hash(__pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":687 + * cdef khiter_t k + * hash(key) + * if key != key or key is None: # <<<<<<<<<<<<<< + * key = na_sentinel + * k = kh_get_pymap(self.table, key) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_v_key, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) { + __pyx_t_4 = (__pyx_v_key == Py_None); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":688 + * hash(key) + * if key != key or key is None: + * key = na_sentinel # <<<<<<<<<<<<<< + * k = kh_get_pymap(self.table, key) + * return k != self.table.n_buckets + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":689 + * if key != key or key is None: + * key = na_sentinel + * k = kh_get_pymap(self.table, key) # <<<<<<<<<<<<<< + * return k != self.table.n_buckets + * + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_key)); + + /* "pandas/hashtable.pyx":690 + * key = na_sentinel + * k = kh_get_pymap(self.table, key) + * return k != self.table.n_buckets # <<<<<<<<<<<<<< + * + * def destroy(self): + */ + __pyx_r = (__pyx_v_k != __pyx_v_self->table->n_buckets); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":684 + * return self.table.size + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * hash(key) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":692 + * return k != self.table.n_buckets + * + * def destroy(self): # <<<<<<<<<<<<<< + * kh_destroy_pymap(self.table) + * self.table = NULL + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_9destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_9destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_8destroy(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_8destroy(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy", 0); + + /* "pandas/hashtable.pyx":693 + * + * def destroy(self): + * kh_destroy_pymap(self.table) # <<<<<<<<<<<<<< + * self.table = NULL + * + */ + kh_destroy_pymap(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":694 + * def destroy(self): + * kh_destroy_pymap(self.table) + * self.table = NULL # <<<<<<<<<<<<<< + * + * cpdef get_item(self, object val): + */ + __pyx_v_self->table = NULL; + + /* "pandas/hashtable.pyx":692 + * return k != self.table.n_buckets + * + * def destroy(self): # <<<<<<<<<<<<<< + * kh_destroy_pymap(self.table) + * self.table = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":696 + * self.table = NULL + * + * cpdef get_item(self, object val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * if val != val or val is None: + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_17PyObjectHashTable_get_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_INCREF(__pyx_v_val); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":698 + * cpdef get_item(self, object val): + * cdef khiter_t k + * if val != val or val is None: # <<<<<<<<<<<<<< + * val = na_sentinel + * k = kh_get_pymap(self.table, val) + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_4) { + __pyx_t_5 = (__pyx_v_val == Py_None); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":699 + * cdef khiter_t k + * if val != val or val is None: + * val = na_sentinel # <<<<<<<<<<<<<< + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":700 + * if val != val or val is None: + * val = na_sentinel + * k = kh_get_pymap(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":701 + * val = na_sentinel + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_6 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":702 + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":704 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_iter_test(self, object key, Py_ssize_t iterations): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":696 + * self.table = NULL + * + * cpdef get_item(self, object val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * if val != val or val is None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_10get_item(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_10get_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":706 + * raise KeyError(val) + * + * def get_iter_test(self, object key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val + * if key != key or key is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_13get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_13get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + Py_ssize_t __pyx_v_iterations; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_iter_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_iterations,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iterations)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_iter_test") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_12get_iter_test(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_iterations); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_12get_iter_test(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_iterations) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_val; + khint_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_iter_test", 0); + __Pyx_INCREF(__pyx_v_key); + + /* "pandas/hashtable.pyx":708 + * def get_iter_test(self, object key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val + * if key != key or key is None: # <<<<<<<<<<<<<< + * key = na_sentinel + * for i in range(iterations): + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_v_key, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __pyx_t_3 = (__pyx_v_key == Py_None); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":709 + * cdef Py_ssize_t i, val + * if key != key or key is None: + * key = na_sentinel # <<<<<<<<<<<<<< + * for i in range(iterations): + * k = kh_get_pymap(self.table, key) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":710 + * if key != key or key is None: + * key = na_sentinel + * for i in range(iterations): # <<<<<<<<<<<<<< + * k = kh_get_pymap(self.table, key) + * if k != self.table.n_buckets: + */ + __pyx_t_5 = __pyx_v_iterations; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/hashtable.pyx":711 + * key = na_sentinel + * for i in range(iterations): + * k = kh_get_pymap(self.table, key) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * val = self.table.vals[k] + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_key)); + + /* "pandas/hashtable.pyx":712 + * for i in range(iterations): + * k = kh_get_pymap(self.table, key) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * val = self.table.vals[k] + * + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":713 + * k = kh_get_pymap(self.table, key) + * if k != self.table.n_buckets: + * val = self.table.vals[k] # <<<<<<<<<<<<<< + * + * cpdef set_item(self, object key, Py_ssize_t val): + */ + __pyx_v_val = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L6; + } + __pyx_L6:; + } + + /* "pandas/hashtable.pyx":706 + * raise KeyError(val) + * + * def get_iter_test(self, object key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val + * if key != key or key is None: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":715 + * val = self.table.vals[k] + * + * cpdef set_item(self, object key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_17PyObjectHashTable_set_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_hash_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_INCREF(__pyx_v_key); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":718 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * char* buf + * + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":721 + * char* buf + * + * hash(key) # <<<<<<<<<<<<<< + * if key != key or key is None: + * key = na_sentinel + */ + __pyx_t_4 = PyObject_Hash(__pyx_v_key); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":722 + * + * hash(key) + * if key != key or key is None: # <<<<<<<<<<<<<< + * key = na_sentinel + * k = kh_put_pymap(self.table, key, &ret) + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_v_key, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_5) { + __pyx_t_6 = (__pyx_v_key == Py_None); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_5; + } + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":723 + * hash(key) + * if key != key or key is None: + * key = na_sentinel # <<<<<<<<<<<<<< + * k = kh_put_pymap(self.table, key, &ret) + * # self.table.keys[k] = key + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":724 + * if key != key or key is None: + * key = na_sentinel + * k = kh_put_pymap(self.table, key, &ret) # <<<<<<<<<<<<<< + * # self.table.keys[k] = key + * if kh_exist_pymap(self.table, k): + */ + __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_key), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":726 + * k = kh_put_pymap(self.table, key, &ret) + * # self.table.keys[k] = key + * if kh_exist_pymap(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_7 = (kh_exist_pymap(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":727 + * # self.table.keys[k] = key + * if kh_exist_pymap(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/hashtable.pyx":729 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def map_locations(self, ndarray[object] values): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + + /* "pandas/hashtable.pyx":715 + * val = self.table.vals[k] + * + * cpdef set_item(self, object key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_14set_item(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_14set_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":731 + * raise KeyError(key) + * + * def map_locations(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_locations (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_16map_locations(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_hash_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_locations", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":733 + * def map_locations(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":734 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":738 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * hash(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":739 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * hash(val) + * if val != val or val is None: + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/hashtable.pyx":740 + * for i in range(n): + * val = values[i] + * hash(val) # <<<<<<<<<<<<<< + * if val != val or val is None: + * val = na_sentinel + */ + __pyx_t_6 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":741 + * val = values[i] + * hash(val) + * if val != val or val is None: # <<<<<<<<<<<<<< + * val = na_sentinel + * + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_7) { + __pyx_t_8 = (__pyx_v_val == Py_None); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":742 + * hash(val) + * if val != val or val is None: + * val = na_sentinel # <<<<<<<<<<<<<< + * + * k = kh_put_pymap(self.table, val, &ret) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/hashtable.pyx":744 + * val = na_sentinel + * + * k = kh_put_pymap(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = i + * + */ + __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":745 + * + * k = kh_put_pymap(self.table, val, &ret) + * self.table.vals[k] = i # <<<<<<<<<<<<<< + * + * def lookup(self, ndarray[object] values): + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_i; + } + + /* "pandas/hashtable.pyx":731 + * raise KeyError(key) + * + * def map_locations(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":747 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_18lookup(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + khiter_t __pyx_v_k; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_hash_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":749 + * def lookup(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":750 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":753 + * object val + * khiter_t k + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":755 + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * hash(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":756 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * hash(val) + * if val != val or val is None: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":757 + * for i in range(n): + * val = values[i] + * hash(val) # <<<<<<<<<<<<<< + * if val != val or val is None: + * val = na_sentinel + */ + __pyx_t_11 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":758 + * val = values[i] + * hash(val) + * if val != val or val is None: # <<<<<<<<<<<<<< + * val = na_sentinel + * + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_12) { + __pyx_t_13 = (__pyx_v_val == Py_None); + __pyx_t_14 = __pyx_t_13; + } else { + __pyx_t_14 = __pyx_t_12; + } + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":759 + * hash(val) + * if val != val or val is None: + * val = na_sentinel # <<<<<<<<<<<<<< + * + * k = kh_get_pymap(self.table, val) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/hashtable.pyx":761 + * val = na_sentinel + * + * k = kh_get_pymap(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":762 + * + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * locs[i] = self.table.vals[k] + * else: + */ + __pyx_t_14 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":763 + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * locs[i] = -1 + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_locs.diminfo[0].strides) = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":765 + * locs[i] = self.table.vals[k] + * else: + * locs[i] = -1 # <<<<<<<<<<<<<< + * + * return locs + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_locs.diminfo[0].strides) = -1; + } + __pyx_L6:; + } + + /* "pandas/hashtable.pyx":767 + * locs[i] = -1 + * + * return locs # <<<<<<<<<<<<<< + * + * def lookup2(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":747 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":769 + * return locs + * + * def lookup2(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_21lookup2(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_21lookup2(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup2 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_20lookup2(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_20lookup2(CYTHON_UNUSED struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup2", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":771 + * def lookup2(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":772 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":776 + * khiter_t k + * long hval + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * # for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":783 + * # k = kh_get_pymap(self.table, val) + * + * return locs # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":769 + * return locs + * + * def lookup2(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.lookup2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":785 + * return locs + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_23unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_23unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_22unique(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_22unique(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_result = 0; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques = 0; + int __pyx_v_seen_na; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_hash_t __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":787 + * def unique(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":788 + * cdef: + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":789 + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * ndarray result + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":793 + * ndarray result + * khiter_t k + * ObjectVector uniques = ObjectVector() # <<<<<<<<<<<<<< + * bint seen_na = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_ObjectVector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":794 + * khiter_t k + * ObjectVector uniques = ObjectVector() + * bint seen_na = 0 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_seen_na = 0; + + /* "pandas/hashtable.pyx":796 + * bint seen_na = 0 + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * hash(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/hashtable.pyx":797 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * hash(val) + * if not _checknan(val): + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":798 + * for i in range(n): + * val = values[i] + * hash(val) # <<<<<<<<<<<<<< + * if not _checknan(val): + * k = kh_get_pymap(self.table, val) + */ + __pyx_t_6 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":799 + * val = values[i] + * hash(val) + * if not _checknan(val): # <<<<<<<<<<<<<< + * k = kh_get_pymap(self.table, val) + * if k == self.table.n_buckets: + */ + __pyx_t_7 = ((!(__pyx_f_4util__checknan(__pyx_v_val) != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":800 + * hash(val) + * if not _checknan(val): + * k = kh_get_pymap(self.table, val) # <<<<<<<<<<<<<< + * if k == self.table.n_buckets: + * k = kh_put_pymap(self.table, val, &ret) + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":801 + * if not _checknan(val): + * k = kh_get_pymap(self.table, val) + * if k == self.table.n_buckets: # <<<<<<<<<<<<<< + * k = kh_put_pymap(self.table, val, &ret) + * uniques.append(val) + */ + __pyx_t_7 = ((__pyx_v_k == __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":802 + * k = kh_get_pymap(self.table, val) + * if k == self.table.n_buckets: + * k = kh_put_pymap(self.table, val, &ret) # <<<<<<<<<<<<<< + * uniques.append(val) + * elif not seen_na: + */ + __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":803 + * if k == self.table.n_buckets: + * k = kh_put_pymap(self.table, val, &ret) + * uniques.append(val) # <<<<<<<<<<<<<< + * elif not seen_na: + * seen_na = 1 + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_12ObjectVector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + + /* "pandas/hashtable.pyx":804 + * k = kh_put_pymap(self.table, val, &ret) + * uniques.append(val) + * elif not seen_na: # <<<<<<<<<<<<<< + * seen_na = 1 + * uniques.append(ONAN) + */ + __pyx_t_7 = ((!(__pyx_v_seen_na != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":805 + * uniques.append(val) + * elif not seen_na: + * seen_na = 1 # <<<<<<<<<<<<<< + * uniques.append(ONAN) + * + */ + __pyx_v_seen_na = 1; + + /* "pandas/hashtable.pyx":806 + * elif not seen_na: + * seen_na = 1 + * uniques.append(ONAN) # <<<<<<<<<<<<<< + * + * result = uniques.to_array() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ONAN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __pyx_f_6pandas_9hashtable_12ObjectVector_append(__pyx_v_uniques, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":808 + * uniques.append(ONAN) + * + * result = uniques.to_array() # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":810 + * result = uniques.to_array() + * + * return result # <<<<<<<<<<<<<< + * + * def get_labels(self, ndarray[object] values, ObjectVector uniques, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":785 + * return locs + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":812 + * return result + * + * def get_labels(self, ndarray[object] values, ObjectVector uniques, # <<<<<<<<<<<<<< + * Py_ssize_t count_prior, int64_t na_sentinel): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_25get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_25get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques = 0; + Py_ssize_t __pyx_v_count_prior; + __pyx_t_5numpy_int64_t __pyx_v_na_sentinel; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_labels (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_uniques,&__pyx_n_s_count_prior,&__pyx_n_s_na_sentinel,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_uniques)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_prior)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_labels") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)values[1]); + __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_na_sentinel = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_na_sentinel == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), __pyx_ptype_6pandas_9hashtable_ObjectVector, 1, "uniques", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_24get_labels(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), __pyx_v_values, __pyx_v_uniques, __pyx_v_count_prior, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_24get_labels(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_hash_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_labels", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":815 + * Py_ssize_t count_prior, int64_t na_sentinel): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":817 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_v_count = __pyx_v_count_prior; + + /* "pandas/hashtable.pyx":818 + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":822 + * khiter_t k + * + * labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":824 + * labels = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * hash(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/hashtable.pyx":825 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * hash(val) + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":826 + * for i in range(n): + * val = values[i] + * hash(val) # <<<<<<<<<<<<<< + * + * if val != val or val is None: + */ + __pyx_t_14 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":828 + * hash(val) + * + * if val != val or val is None: # <<<<<<<<<<<<<< + * labels[i] = na_sentinel + * continue + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_15) { + __pyx_t_16 = (__pyx_v_val == Py_None); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_15; + } + if (__pyx_t_17) { + + /* "pandas/hashtable.pyx":829 + * + * if val != val or val is None: + * labels[i] = na_sentinel # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_na_sentinel; + + /* "pandas/hashtable.pyx":830 + * if val != val or val is None: + * labels[i] = na_sentinel + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_pymap(self.table, val) + */ + goto __pyx_L3_continue; + } + + /* "pandas/hashtable.pyx":832 + * continue + * + * k = kh_get_pymap(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":833 + * + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_17 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_17) { + + /* "pandas/hashtable.pyx":834 + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":835 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_pymap(self.table, val, &ret) + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":837 + * labels[i] = idx + * else: + * k = kh_put_pymap(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * uniques.append(val) + */ + __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":838 + * else: + * k = kh_put_pymap(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * uniques.append(val) + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":839 + * k = kh_put_pymap(self.table, val, &ret) + * self.table.vals[k] = count + * uniques.append(val) # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __pyx_f_6pandas_9hashtable_12ObjectVector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":840 + * self.table.vals[k] = count + * uniques.append(val) + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":841 + * uniques.append(val) + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * return labels + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":843 + * count += 1 + * + * return labels # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + __pyx_r = ((PyObject *)__pyx_v_labels); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":812 + * return result + * + * def get_labels(self, ndarray[object] values, ObjectVector uniques, # <<<<<<<<<<<<<< + * Py_ssize_t count_prior, int64_t na_sentinel): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":851 + * cdef public Py_ssize_t count + * + * def __init__(self, size_hint): # <<<<<<<<<<<<<< + * self.table = PyObjectHashTable(size_hint) + * self.uniques = ObjectVector() + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer___init__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer___init__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/hashtable.pyx":852 + * + * def __init__(self, size_hint): + * self.table = PyObjectHashTable(size_hint) # <<<<<<<<<<<<<< + * self.uniques = ObjectVector() + * self.count = 0 + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_size_hint); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size_hint); + __Pyx_GIVEREF(__pyx_v_size_hint); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_PyObjectHashTable)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":853 + * def __init__(self, size_hint): + * self.table = PyObjectHashTable(size_hint) + * self.uniques = ObjectVector() # <<<<<<<<<<<<<< + * self.count = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_ObjectVector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":854 + * self.table = PyObjectHashTable(size_hint) + * self.uniques = ObjectVector() + * self.count = 0 # <<<<<<<<<<<<<< + * + * def get_count(self): + */ + __pyx_v_self->count = 0; + + /* "pandas/hashtable.pyx":851 + * cdef public Py_ssize_t count + * + * def __init__(self, size_hint): # <<<<<<<<<<<<<< + * self.table = PyObjectHashTable(size_hint) + * self.uniques = ObjectVector() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":856 + * self.count = 0 + * + * def get_count(self): # <<<<<<<<<<<<<< + * return self.count + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_3get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_3get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_count (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_2get_count(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_2get_count(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_count", 0); + + /* "pandas/hashtable.pyx":857 + * + * def get_count(self): + * return self.count # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":856 + * self.count = 0 + * + * def get_count(self): # <<<<<<<<<<<<<< + * return self.count + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":859 + * return self.count + * + * def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1): # <<<<<<<<<<<<<< + * """ + * Factorize values with nans replaced by na_sentinel + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_9hashtable_10Factorizer_4factorize[] = "\n Factorize values with nans replaced by na_sentinel\n >>> factorize(np.array([1,2,np.nan], dtype='O'), na_sentinel=20)\n array([ 0, 1, 20])\n "; +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_sort = 0; + PyObject *__pyx_v_na_sentinel = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_sort,&__pyx_n_s_na_sentinel,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)__pyx_int_neg_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sort); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_sort = values[1]; + __pyx_v_na_sentinel = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("factorize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_4factorize(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), __pyx_v_values, __pyx_v_sort, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_4factorize(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_sort, PyObject *__pyx_v_na_sentinel) { + PyObject *__pyx_v_labels = NULL; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_v_sorter = NULL; + PyObject *__pyx_v_reverse_indexer = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":865 + * array([ 0, 1, 20]) + * """ + * labels = self.table.get_labels(values, self.uniques, # <<<<<<<<<<<<<< + * self.count, na_sentinel) + * mask = (labels == na_sentinel) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->table), __pyx_n_s_get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/hashtable.pyx":866 + * """ + * labels = self.table.get_labels(values, self.uniques, + * self.count, na_sentinel) # <<<<<<<<<<<<<< + * mask = (labels == na_sentinel) + * # sort on + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/hashtable.pyx":865 + * array([ 0, 1, 20]) + * """ + * labels = self.table.get_labels(values, self.uniques, # <<<<<<<<<<<<<< + * self.count, na_sentinel) + * mask = (labels == na_sentinel) + */ + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->uniques)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->uniques)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->uniques)); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_na_sentinel); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_na_sentinel); + __Pyx_GIVEREF(__pyx_v_na_sentinel); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_labels = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":867 + * labels = self.table.get_labels(values, self.uniques, + * self.count, na_sentinel) + * mask = (labels == na_sentinel) # <<<<<<<<<<<<<< + * # sort on + * if sort: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_labels, __pyx_v_na_sentinel, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_mask = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":869 + * mask = (labels == na_sentinel) + * # sort on + * if sort: # <<<<<<<<<<<<<< + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":870 + * # sort on + * if sort: + * if labels.dtype != np.int_: # <<<<<<<<<<<<<< + * labels = labels.astype(np.int_) + * sorter = self.uniques.to_array().argsort() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":871 + * if sort: + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) # <<<<<<<<<<<<<< + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/hashtable.pyx":872 + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) + * sorter = self.uniques.to_array().argsort() # <<<<<<<<<<<<<< + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_sorter = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":873 + * labels = labels.astype(np.int_) + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) # <<<<<<<<<<<<<< + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * labels = reverse_indexer.take(labels, mode='clip') + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_reverse_indexer = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/hashtable.pyx":874 + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) # <<<<<<<<<<<<<< + * labels = reverse_indexer.take(labels, mode='clip') + * labels[mask] = na_sentinel + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse_indexer, __pyx_n_s_put); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_sorter); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sorter); + __Pyx_GIVEREF(__pyx_v_sorter); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":875 + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * labels = reverse_indexer.take(labels, mode='clip') # <<<<<<<<<<<<<< + * labels[mask] = na_sentinel + * self.count = len(self.uniques) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse_indexer, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_labels); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_s_clip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/hashtable.pyx":876 + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * labels = reverse_indexer.take(labels, mode='clip') + * labels[mask] = na_sentinel # <<<<<<<<<<<<<< + * self.count = len(self.uniques) + * return labels + */ + if (unlikely(PyObject_SetItem(__pyx_v_labels, __pyx_v_mask, __pyx_v_na_sentinel) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":877 + * labels = reverse_indexer.take(labels, mode='clip') + * labels[mask] = na_sentinel + * self.count = len(self.uniques) # <<<<<<<<<<<<<< + * return labels + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->uniques); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->count = __pyx_t_5; + + /* "pandas/hashtable.pyx":878 + * labels[mask] = na_sentinel + * self.count = len(self.uniques) + * return labels # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_labels); + __pyx_r = __pyx_v_labels; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":859 + * return self.count + * + * def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1): # <<<<<<<<<<<<<< + * """ + * Factorize values with nans replaced by na_sentinel + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v_sorter); + __Pyx_XDECREF(__pyx_v_reverse_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":880 + * return labels + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * # just for fun + * return self.table.unique(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_7unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_7unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_6unique(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_6unique(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":882 + * def unique(self, ndarray[object] values): + * # just for fun + * return self.table.unique(values) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->table), __pyx_n_s_unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":880 + * return labels + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * # just for fun + * return self.table.unique(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Factorizer.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":847 + * + * cdef class Factorizer: + * cdef public PyObjectHashTable table # <<<<<<<<<<<<<< + * cdef public ObjectVector uniques + * cdef public Py_ssize_t count + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5table_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5table_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5table___get__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_5table___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->table)); + __pyx_r = ((PyObject *)__pyx_v_self->table); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5table_2__set__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5table_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_9hashtable_PyObjectHashTable))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5table_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5table_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5table_4__del__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5table_4__del__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":848 + * cdef class Factorizer: + * cdef public PyObjectHashTable table + * cdef public ObjectVector uniques # <<<<<<<<<<<<<< + * cdef public Py_ssize_t count + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques___get__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_7uniques___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_r = ((PyObject *)__pyx_v_self->uniques); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_2__set__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_9hashtable_ObjectVector))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.uniques.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_4__del__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_4__del__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":849 + * cdef public PyObjectHashTable table + * cdef public ObjectVector uniques + * cdef public Py_ssize_t count # <<<<<<<<<<<<<< + * + * def __init__(self, size_hint): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5count_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5count_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5count___get__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_5count___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5count_2__set__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5count_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->count = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Factorizer.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":890 + * cdef public Py_ssize_t count + * + * def __init__(self, size_hint): # <<<<<<<<<<<<<< + * self.table = Int64HashTable(size_hint) + * self.uniques = Int64Vector() + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer___init__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer___init__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/hashtable.pyx":891 + * + * def __init__(self, size_hint): + * self.table = Int64HashTable(size_hint) # <<<<<<<<<<<<<< + * self.uniques = Int64Vector() + * self.count = 0 + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_size_hint); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size_hint); + __Pyx_GIVEREF(__pyx_v_size_hint); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Int64HashTable)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":892 + * def __init__(self, size_hint): + * self.table = Int64HashTable(size_hint) + * self.uniques = Int64Vector() # <<<<<<<<<<<<<< + * self.count = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Int64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":893 + * self.table = Int64HashTable(size_hint) + * self.uniques = Int64Vector() + * self.count = 0 # <<<<<<<<<<<<<< + * + * def get_count(self): + */ + __pyx_v_self->count = 0; + + /* "pandas/hashtable.pyx":890 + * cdef public Py_ssize_t count + * + * def __init__(self, size_hint): # <<<<<<<<<<<<<< + * self.table = Int64HashTable(size_hint) + * self.uniques = Int64Vector() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":895 + * self.count = 0 + * + * def get_count(self): # <<<<<<<<<<<<<< + * return self.count + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_3get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_3get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_count (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_2get_count(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_2get_count(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_count", 0); + + /* "pandas/hashtable.pyx":896 + * + * def get_count(self): + * return self.count # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[int64_t] values, sort=False, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":895 + * self.count = 0 + * + * def get_count(self): # <<<<<<<<<<<<<< + * return self.count + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":898 + * return self.count + * + * def factorize(self, ndarray[int64_t] values, sort=False, # <<<<<<<<<<<<<< + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_sort = 0; + PyObject *__pyx_v_na_sentinel = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_sort,&__pyx_n_s_na_sentinel,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)__pyx_int_neg_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sort); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_sort = values[1]; + __pyx_v_na_sentinel = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("factorize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_4factorize(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), __pyx_v_values, __pyx_v_sort, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_4factorize(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_sort, PyObject *__pyx_v_na_sentinel) { + PyObject *__pyx_v_labels = NULL; + PyObject *__pyx_v_sorter = NULL; + PyObject *__pyx_v_reverse_indexer = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":900 + * def factorize(self, ndarray[int64_t] values, sort=False, + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, # <<<<<<<<<<<<<< + * self.count, na_sentinel) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->table), __pyx_n_s_get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/hashtable.pyx":901 + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, + * self.count, na_sentinel) # <<<<<<<<<<<<<< + * + * # sort on + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/hashtable.pyx":900 + * def factorize(self, ndarray[int64_t] values, sort=False, + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, # <<<<<<<<<<<<<< + * self.count, na_sentinel) + * + */ + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->uniques)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->uniques)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->uniques)); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_na_sentinel); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_na_sentinel); + __Pyx_GIVEREF(__pyx_v_na_sentinel); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_labels = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":904 + * + * # sort on + * if sort: # <<<<<<<<<<<<<< + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":905 + * # sort on + * if sort: + * if labels.dtype != np.int_: # <<<<<<<<<<<<<< + * labels = labels.astype(np.int_) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":906 + * if sort: + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) # <<<<<<<<<<<<<< + * + * sorter = self.uniques.to_array().argsort() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/hashtable.pyx":908 + * labels = labels.astype(np.int_) + * + * sorter = self.uniques.to_array().argsort() # <<<<<<<<<<<<<< + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_sorter = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":909 + * + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) # <<<<<<<<<<<<<< + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_reverse_indexer = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/hashtable.pyx":910 + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) # <<<<<<<<<<<<<< + * + * labels = reverse_indexer.take(labels) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse_indexer, __pyx_n_s_put); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_sorter); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sorter); + __Pyx_GIVEREF(__pyx_v_sorter); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":912 + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * + * labels = reverse_indexer.take(labels) # <<<<<<<<<<<<<< + * + * self.count = len(self.uniques) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse_indexer, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_labels); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":914 + * labels = reverse_indexer.take(labels) + * + * self.count = len(self.uniques) # <<<<<<<<<<<<<< + * return labels + * + */ + __pyx_t_7 = ((PyObject *)__pyx_v_self->uniques); + __Pyx_INCREF(__pyx_t_7); + __pyx_t_5 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_self->count = __pyx_t_5; + + /* "pandas/hashtable.pyx":915 + * + * self.count = len(self.uniques) + * return labels # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_labels); + __pyx_r = __pyx_v_labels; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":898 + * return self.count + * + * def factorize(self, ndarray[int64_t] values, sort=False, # <<<<<<<<<<<<<< + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_sorter); + __Pyx_XDECREF(__pyx_v_reverse_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":886 + * + * cdef class Int64Factorizer: + * cdef public Int64HashTable table # <<<<<<<<<<<<<< + * cdef public Int64Vector uniques + * cdef public Py_ssize_t count + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table___get__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->table)); + __pyx_r = ((PyObject *)__pyx_v_self->table); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_2__set__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_9hashtable_Int64HashTable))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_4__del__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_4__del__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":887 + * cdef class Int64Factorizer: + * cdef public Int64HashTable table + * cdef public Int64Vector uniques # <<<<<<<<<<<<<< + * cdef public Py_ssize_t count + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques___get__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_r = ((PyObject *)__pyx_v_self->uniques); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_2__set__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_9hashtable_Int64Vector))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.uniques.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_4__del__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_4__del__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":888 + * cdef public Int64HashTable table + * cdef public Int64Vector uniques + * cdef public Py_ssize_t count # <<<<<<<<<<<<<< + * + * def __init__(self, size_hint): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count___get__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count_2__set__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->count = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":918 + * + * + * cdef build_count_table_int64(ndarray[int64_t] values, kh_int64_t *table): # <<<<<<<<<<<<<< + * cdef: + * int k + */ + +static PyObject *__pyx_f_6pandas_9hashtable_build_count_table_int64(PyArrayObject *__pyx_v_values, kh_int64_t *__pyx_v_table) { + int __pyx_v_k; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + PyObject *__pyx_v_val = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("build_count_table_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":921 + * cdef: + * int k + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":922 + * int k + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * + * kh_resize_int64(table, n) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":924 + * int ret = 0 + * + * kh_resize_int64(table, n) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + kh_resize_int64(__pyx_v_table, __pyx_v_n); + + /* "pandas/hashtable.pyx":926 + * kh_resize_int64(table, n) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int64(table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":927 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(table, val) + * if k != table.n_buckets: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":928 + * for i in range(n): + * val = values[i] + * k = kh_get_int64(table, val) # <<<<<<<<<<<<<< + * if k != table.n_buckets: + * table.vals[k] += 1 + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_get_int64(__pyx_v_table, __pyx_t_6); + + /* "pandas/hashtable.pyx":929 + * val = values[i] + * k = kh_get_int64(table, val) + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * table.vals[k] += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":930 + * k = kh_get_int64(table, val) + * if k != table.n_buckets: + * table.vals[k] += 1 # <<<<<<<<<<<<<< + * else: + * k = kh_put_int64(table, val, &ret) + */ + __pyx_t_4 = __pyx_v_k; + (__pyx_v_table->vals[__pyx_t_4]) = ((__pyx_v_table->vals[__pyx_t_4]) + 1); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":932 + * table.vals[k] += 1 + * else: + * k = kh_put_int64(table, val, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = 1 + * + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_put_int64(__pyx_v_table, __pyx_t_6, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":933 + * else: + * k = kh_put_int64(table, val, &ret) + * table.vals[k] = 1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_table->vals[__pyx_v_k]) = 1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":918 + * + * + * cdef build_count_table_int64(ndarray[int64_t] values, kh_int64_t *table): # <<<<<<<<<<<<<< + * cdef: + * int k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.build_count_table_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":936 + * + * + * cpdef value_count_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_3value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_value_count_int64(PyArrayObject *__pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + kh_int64_t *__pyx_v_table; + CYTHON_UNUSED int __pyx_v_ret; + int __pyx_v_k; + PyObject *__pyx_v_result_keys = NULL; + PyObject *__pyx_v_result_counts = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + khint_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("value_count_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":940 + * Py_ssize_t i + * kh_int64_t *table + * int ret = 0 # <<<<<<<<<<<<<< + * int k + * + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":943 + * int k + * + * table = kh_init_int64() # <<<<<<<<<<<<<< + * build_count_table_int64(values, table) + * + */ + __pyx_v_table = kh_init_int64(); + + /* "pandas/hashtable.pyx":944 + * + * table = kh_init_int64() + * build_count_table_int64(values, table) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = __pyx_f_6pandas_9hashtable_build_count_table_int64(((PyArrayObject *)__pyx_v_values), __pyx_v_table); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":946 + * build_count_table_int64(values, table) + * + * i = 0 # <<<<<<<<<<<<<< + * result_keys = np.empty(table.n_occupied, dtype=np.int64) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + */ + __pyx_v_i = 0; + + /* "pandas/hashtable.pyx":947 + * + * i = 0 + * result_keys = np.empty(table.n_occupied, dtype=np.int64) # <<<<<<<<<<<<<< + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result_keys = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":948 + * i = 0 + * result_keys = np.empty(table.n_occupied, dtype=np.int64) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) # <<<<<<<<<<<<<< + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result_counts = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/hashtable.pyx":949 + * result_keys = np.empty(table.n_occupied, dtype=np.int64) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): # <<<<<<<<<<<<<< + * if kh_exist_int64(table, k): + * result_keys[i] = table.keys[k] + */ + __pyx_t_6 = __pyx_v_table->n_buckets; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_k = __pyx_t_7; + + /* "pandas/hashtable.pyx":950 + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): # <<<<<<<<<<<<<< + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] + */ + __pyx_t_8 = (kh_exist_int64(__pyx_v_table, __pyx_v_k) != 0); + if (__pyx_t_8) { + + /* "pandas/hashtable.pyx":951 + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): + * result_keys[i] = table.keys[k] # <<<<<<<<<<<<<< + * result_counts[i] = table.vals[k] + * i += 1 + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((__pyx_v_table->keys[__pyx_v_k])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_SetItemInt(__pyx_v_result_keys, __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/hashtable.pyx":952 + * if kh_exist_int64(table, k): + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] # <<<<<<<<<<<<<< + * i += 1 + * kh_destroy_int64(table) + */ + __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_SetItemInt(__pyx_v_result_counts, __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/hashtable.pyx":953 + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] + * i += 1 # <<<<<<<<<<<<<< + * kh_destroy_int64(table) + * + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":954 + * result_counts[i] = table.vals[k] + * i += 1 + * kh_destroy_int64(table) # <<<<<<<<<<<<<< + * + * return result_keys, result_counts + */ + kh_destroy_int64(__pyx_v_table); + + /* "pandas/hashtable.pyx":956 + * kh_destroy_int64(table) + * + * return result_keys, result_counts # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result_keys); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result_keys); + __Pyx_GIVEREF(__pyx_v_result_keys); + __Pyx_INCREF(__pyx_v_result_counts); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_result_counts); + __Pyx_GIVEREF(__pyx_v_result_counts); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":936 + * + * + * cpdef value_count_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.value_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result_keys); + __Pyx_XDECREF(__pyx_v_result_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_3value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_3value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("value_count_int64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_2value_count_int64(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_2value_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("value_count_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_9hashtable_value_count_int64(__pyx_v_values, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.value_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":959 + * + * + * cdef build_count_table_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * kh_pymap_t *table): + */ + +static PyObject *__pyx_f_6pandas_9hashtable_build_count_table_object(PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, kh_pymap_t *__pyx_v_table) { + int __pyx_v_k; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + PyObject *__pyx_v_val = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("build_count_table_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":964 + * cdef: + * int k + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":965 + * int k + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * + * kh_resize_pymap(table, n // 10) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":967 + * int ret = 0 + * + * kh_resize_pymap(table, n // 10) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + kh_resize_pymap(__pyx_v_table, __Pyx_div_Py_ssize_t(__pyx_v_n, 10)); + + /* "pandas/hashtable.pyx":969 + * kh_resize_pymap(table, n // 10) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":970 + * + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":971 + * for i in range(n): + * if mask[i]: + * continue # <<<<<<<<<<<<<< + * + * val = values[i] + */ + goto __pyx_L3_continue; + } + + /* "pandas/hashtable.pyx":973 + * continue + * + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_pymap(table, val) + * if k != table.n_buckets: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":974 + * + * val = values[i] + * k = kh_get_pymap(table, val) # <<<<<<<<<<<<<< + * if k != table.n_buckets: + * table.vals[k] += 1 + */ + __pyx_v_k = kh_get_pymap(__pyx_v_table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":975 + * val = values[i] + * k = kh_get_pymap(table, val) + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * table.vals[k] += 1 + * else: + */ + __pyx_t_5 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":976 + * k = kh_get_pymap(table, val) + * if k != table.n_buckets: + * table.vals[k] += 1 # <<<<<<<<<<<<<< + * else: + * k = kh_put_pymap(table, val, &ret) + */ + __pyx_t_4 = __pyx_v_k; + (__pyx_v_table->vals[__pyx_t_4]) = ((__pyx_v_table->vals[__pyx_t_4]) + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":978 + * table.vals[k] += 1 + * else: + * k = kh_put_pymap(table, val, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = 1 + * + */ + __pyx_v_k = kh_put_pymap(__pyx_v_table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":979 + * else: + * k = kh_put_pymap(table, val, &ret) + * table.vals[k] = 1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_table->vals[__pyx_v_k]) = 1; + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":959 + * + * + * cdef build_count_table_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * kh_pymap_t *table): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.build_count_table_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":982 + * + * + * cpdef value_count_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_5value_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_value_count_object(PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + kh_pymap_t *__pyx_v_table; + int __pyx_v_k; + PyObject *__pyx_v_result_keys = NULL; + PyObject *__pyx_v_result_counts = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + khint_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("value_count_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":985 + * ndarray[uint8_t, cast=True] mask): + * cdef: + * Py_ssize_t i = len(values) # <<<<<<<<<<<<<< + * kh_pymap_t *table + * int k + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = __pyx_t_1; + + /* "pandas/hashtable.pyx":989 + * int k + * + * table = kh_init_pymap() # <<<<<<<<<<<<<< + * build_count_table_object(values, mask, table) + * + */ + __pyx_v_table = kh_init_pymap(); + + /* "pandas/hashtable.pyx":990 + * + * table = kh_init_pymap() + * build_count_table_object(values, mask, table) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_build_count_table_object(((PyArrayObject *)__pyx_v_values), ((PyArrayObject *)__pyx_v_mask), __pyx_v_table); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":992 + * build_count_table_object(values, mask, table) + * + * i = 0 # <<<<<<<<<<<<<< + * result_keys = np.empty(table.n_occupied, dtype=object) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + */ + __pyx_v_i = 0; + + /* "pandas/hashtable.pyx":993 + * + * i = 0 + * result_keys = np.empty(table.n_occupied, dtype=object) # <<<<<<<<<<<<<< + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result_keys = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":994 + * i = 0 + * result_keys = np.empty(table.n_occupied, dtype=object) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) # <<<<<<<<<<<<<< + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result_counts = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":995 + * result_keys = np.empty(table.n_occupied, dtype=object) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): # <<<<<<<<<<<<<< + * if kh_exist_pymap(table, k): + * result_keys[i] = table.keys[k] + */ + __pyx_t_7 = __pyx_v_table->n_buckets; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_k = __pyx_t_8; + + /* "pandas/hashtable.pyx":996 + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): # <<<<<<<<<<<<<< + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] + */ + __pyx_t_9 = (kh_exist_pymap(__pyx_v_table, __pyx_v_k) != 0); + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":997 + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): + * result_keys[i] = table.keys[k] # <<<<<<<<<<<<<< + * result_counts[i] = table.vals[k] + * i += 1 + */ + __pyx_t_6 = ((PyObject *)(__pyx_v_table->keys[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_v_result_keys, __pyx_v_i, __pyx_t_6, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":998 + * if kh_exist_pymap(table, k): + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] # <<<<<<<<<<<<<< + * i += 1 + * kh_destroy_pymap(table) + */ + __pyx_t_6 = __Pyx_PyInt_FromSize_t((__pyx_v_table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_v_result_counts, __pyx_v_i, __pyx_t_6, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":999 + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] + * i += 1 # <<<<<<<<<<<<<< + * kh_destroy_pymap(table) + * + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":1000 + * result_counts[i] = table.vals[k] + * i += 1 + * kh_destroy_pymap(table) # <<<<<<<<<<<<<< + * + * return result_keys, result_counts + */ + kh_destroy_pymap(__pyx_v_table); + + /* "pandas/hashtable.pyx":1002 + * kh_destroy_pymap(table) + * + * return result_keys, result_counts # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result_keys); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result_keys); + __Pyx_GIVEREF(__pyx_v_result_keys); + __Pyx_INCREF(__pyx_v_result_counts); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_result_counts); + __Pyx_GIVEREF(__pyx_v_result_counts); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":982 + * + * + * cpdef value_count_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.value_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result_keys); + __Pyx_XDECREF(__pyx_v_result_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_5value_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_5value_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("value_count_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("value_count_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "value_count_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("value_count_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.value_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_4value_count_object(__pyx_self, __pyx_v_values, __pyx_v_mask); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_4value_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("value_count_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_9hashtable_value_count_object(__pyx_v_values, __pyx_v_mask, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.value_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":1005 + * + * + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): # <<<<<<<<<<<<<< + * cdef: + * int count, max_count = 2 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_7mode_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_9hashtable_7mode_object = {__Pyx_NAMESTR("mode_object"), (PyCFunction)__pyx_pw_6pandas_9hashtable_7mode_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_9hashtable_7mode_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mode_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("mode_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mode_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.mode_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_6mode_object(__pyx_self, __pyx_v_values, __pyx_v_mask); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_6mode_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask) { + int __pyx_v_count; + int __pyx_v_max_count; + int __pyx_v_j; + int __pyx_v_k; + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + kh_pymap_t *__pyx_v_table; + CYTHON_UNUSED int __pyx_v_ret; + PyObject *__pyx_v_modes = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + khint_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mode_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":1007 + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): + * cdef: + * int count, max_count = 2 # <<<<<<<<<<<<<< + * int j = -1 # so you can do += + * int k + */ + __pyx_v_max_count = 2; + + /* "pandas/hashtable.pyx":1008 + * cdef: + * int count, max_count = 2 + * int j = -1 # so you can do += # <<<<<<<<<<<<<< + * int k + * Py_ssize_t i, n = len(values) + */ + __pyx_v_j = -1; + + /* "pandas/hashtable.pyx":1010 + * int j = -1 # so you can do += + * int k + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * kh_pymap_t *table + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":1012 + * Py_ssize_t i, n = len(values) + * kh_pymap_t *table + * int ret = 0 # <<<<<<<<<<<<<< + * + * table = kh_init_pymap() + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":1014 + * int ret = 0 + * + * table = kh_init_pymap() # <<<<<<<<<<<<<< + * build_count_table_object(values, mask, table) + * + */ + __pyx_v_table = kh_init_pymap(); + + /* "pandas/hashtable.pyx":1015 + * + * table = kh_init_pymap() + * build_count_table_object(values, mask, table) # <<<<<<<<<<<<<< + * + * modes = np.empty(table.n_buckets, dtype=np.object_) + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_build_count_table_object(((PyArrayObject *)__pyx_v_values), ((PyArrayObject *)__pyx_v_mask), __pyx_v_table); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":1017 + * build_count_table_object(values, mask, table) + * + * modes = np.empty(table.n_buckets, dtype=np.object_) # <<<<<<<<<<<<<< + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_buckets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_modes = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":1018 + * + * modes = np.empty(table.n_buckets, dtype=np.object_) + * for k in range(table.n_buckets): # <<<<<<<<<<<<<< + * if kh_exist_pymap(table, k): + * count = table.vals[k] + */ + __pyx_t_7 = __pyx_v_table->n_buckets; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_k = __pyx_t_8; + + /* "pandas/hashtable.pyx":1019 + * modes = np.empty(table.n_buckets, dtype=np.object_) + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): # <<<<<<<<<<<<<< + * count = table.vals[k] + * + */ + __pyx_t_9 = (kh_exist_pymap(__pyx_v_table, __pyx_v_k) != 0); + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":1020 + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): + * count = table.vals[k] # <<<<<<<<<<<<<< + * + * if count == max_count: + */ + __pyx_v_count = (__pyx_v_table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":1022 + * count = table.vals[k] + * + * if count == max_count: # <<<<<<<<<<<<<< + * j += 1 + * elif count > max_count: + */ + __pyx_t_9 = ((__pyx_v_count == __pyx_v_max_count) != 0); + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":1023 + * + * if count == max_count: + * j += 1 # <<<<<<<<<<<<<< + * elif count > max_count: + * max_count = count + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L6; + } + + /* "pandas/hashtable.pyx":1024 + * if count == max_count: + * j += 1 + * elif count > max_count: # <<<<<<<<<<<<<< + * max_count = count + * j = 0 + */ + __pyx_t_9 = ((__pyx_v_count > __pyx_v_max_count) != 0); + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":1025 + * j += 1 + * elif count > max_count: + * max_count = count # <<<<<<<<<<<<<< + * j = 0 + * else: + */ + __pyx_v_max_count = __pyx_v_count; + + /* "pandas/hashtable.pyx":1026 + * elif count > max_count: + * max_count = count + * j = 0 # <<<<<<<<<<<<<< + * else: + * continue + */ + __pyx_v_j = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":1028 + * j = 0 + * else: + * continue # <<<<<<<<<<<<<< + * modes[j] = table.keys[k] + * + */ + goto __pyx_L3_continue; + } + __pyx_L6:; + + /* "pandas/hashtable.pyx":1029 + * else: + * continue + * modes[j] = table.keys[k] # <<<<<<<<<<<<<< + * + * kh_destroy_pymap(table) + */ + __pyx_t_6 = ((PyObject *)(__pyx_v_table->keys[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_v_modes, __pyx_v_j, __pyx_t_6, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":1031 + * modes[j] = table.keys[k] + * + * kh_destroy_pymap(table) # <<<<<<<<<<<<<< + * + * return modes[:j+1] + */ + kh_destroy_pymap(__pyx_v_table); + + /* "pandas/hashtable.pyx":1033 + * kh_destroy_pymap(table) + * + * return modes[:j+1] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_modes, 0, (__pyx_v_j + 1), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":1005 + * + * + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): # <<<<<<<<<<<<<< + * cdef: + * int count, max_count = 2 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.mode_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_modes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":1036 + * + * + * def mode_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * int val, max_val = 2 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_9mode_int64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_9hashtable_9mode_int64 = {__Pyx_NAMESTR("mode_int64"), (PyCFunction)__pyx_pw_6pandas_9hashtable_9mode_int64, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_9hashtable_9mode_int64(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mode_int64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_8mode_int64(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_8mode_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_val; + int __pyx_v_max_val; + int __pyx_v_j; + int __pyx_v_k; + kh_int64_t *__pyx_v_table; + CYTHON_UNUSED PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_modes = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + khint_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mode_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":1038 + * def mode_int64(ndarray[int64_t] values): + * cdef: + * int val, max_val = 2 # <<<<<<<<<<<<<< + * int j = -1 # so you can do += + * int k + */ + __pyx_v_max_val = 2; + + /* "pandas/hashtable.pyx":1039 + * cdef: + * int val, max_val = 2 + * int j = -1 # so you can do += # <<<<<<<<<<<<<< + * int k + * kh_int64_t *table + */ + __pyx_v_j = -1; + + /* "pandas/hashtable.pyx":1042 + * int k + * kh_int64_t *table + * list uniques = [] # <<<<<<<<<<<<<< + * + * table = kh_init_int64() + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_uniques = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":1044 + * list uniques = [] + * + * table = kh_init_int64() # <<<<<<<<<<<<<< + * + * build_count_table_int64(values, table) + */ + __pyx_v_table = kh_init_int64(); + + /* "pandas/hashtable.pyx":1046 + * table = kh_init_int64() + * + * build_count_table_int64(values, table) # <<<<<<<<<<<<<< + * + * modes = np.empty(table.n_buckets, dtype=np.int64) + */ + __pyx_t_1 = __pyx_f_6pandas_9hashtable_build_count_table_int64(((PyArrayObject *)__pyx_v_values), __pyx_v_table); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":1048 + * build_count_table_int64(values, table) + * + * modes = np.empty(table.n_buckets, dtype=np.int64) # <<<<<<<<<<<<<< + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_buckets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_modes = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":1049 + * + * modes = np.empty(table.n_buckets, dtype=np.int64) + * for k in range(table.n_buckets): # <<<<<<<<<<<<<< + * if kh_exist_int64(table, k): + * val = table.vals[k] + */ + __pyx_t_6 = __pyx_v_table->n_buckets; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_k = __pyx_t_7; + + /* "pandas/hashtable.pyx":1050 + * modes = np.empty(table.n_buckets, dtype=np.int64) + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): # <<<<<<<<<<<<<< + * val = table.vals[k] + * + */ + __pyx_t_8 = (kh_exist_int64(__pyx_v_table, __pyx_v_k) != 0); + if (__pyx_t_8) { + + /* "pandas/hashtable.pyx":1051 + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): + * val = table.vals[k] # <<<<<<<<<<<<<< + * + * if val == max_val: + */ + __pyx_v_val = (__pyx_v_table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":1053 + * val = table.vals[k] + * + * if val == max_val: # <<<<<<<<<<<<<< + * j += 1 + * elif val > max_val: + */ + __pyx_t_8 = ((__pyx_v_val == __pyx_v_max_val) != 0); + if (__pyx_t_8) { + + /* "pandas/hashtable.pyx":1054 + * + * if val == max_val: + * j += 1 # <<<<<<<<<<<<<< + * elif val > max_val: + * max_val = val + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L6; + } + + /* "pandas/hashtable.pyx":1055 + * if val == max_val: + * j += 1 + * elif val > max_val: # <<<<<<<<<<<<<< + * max_val = val + * j = 0 + */ + __pyx_t_8 = ((__pyx_v_val > __pyx_v_max_val) != 0); + if (__pyx_t_8) { + + /* "pandas/hashtable.pyx":1056 + * j += 1 + * elif val > max_val: + * max_val = val # <<<<<<<<<<<<<< + * j = 0 + * else: + */ + __pyx_v_max_val = __pyx_v_val; + + /* "pandas/hashtable.pyx":1057 + * elif val > max_val: + * max_val = val + * j = 0 # <<<<<<<<<<<<<< + * else: + * continue + */ + __pyx_v_j = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":1059 + * j = 0 + * else: + * continue # <<<<<<<<<<<<<< + * modes[j] = table.keys[k] + * + */ + goto __pyx_L3_continue; + } + __pyx_L6:; + + /* "pandas/hashtable.pyx":1060 + * else: + * continue + * modes[j] = table.keys[k] # <<<<<<<<<<<<<< + * + * kh_destroy_int64(table) + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((__pyx_v_table->keys[__pyx_v_k])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_SetItemInt(__pyx_v_modes, __pyx_v_j, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":1062 + * modes[j] = table.keys[k] + * + * kh_destroy_int64(table) # <<<<<<<<<<<<<< + * + * return modes[:j+1] + */ + kh_destroy_int64(__pyx_v_table); + + /* "pandas/hashtable.pyx":1064 + * kh_destroy_int64(table) + * + * return modes[:j+1] # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_modes, 0, (__pyx_v_j + 1), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":1036 + * + * + * def mode_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * int val, max_val = 2 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.mode_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_modes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6pandas_9hashtable_HashTable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_HashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyTypeObject __pyx_type_6pandas_9hashtable_HashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.HashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_HashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_HashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_HashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable __pyx_vtable_6pandas_9hashtable_Int64HashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64HashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Int64HashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Int64HashTable; + if (unlikely(__pyx_pw_6pandas_9hashtable_14Int64HashTable_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Int64HashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_14Int64HashTable_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Int64HashTable[] = { + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_11get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_15map, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_17map_locations, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_19lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_21factorize, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_23get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_labels_groupby"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_25get_labels_groupby, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_27unique, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Int64HashTable = { + __pyx_pw_6pandas_9hashtable_14Int64HashTable_7__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_9hashtable_14Int64HashTable_5__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Int64HashTable = { + __pyx_pw_6pandas_9hashtable_14Int64HashTable_7__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Int64HashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Int64HashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Int64HashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Int64HashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_Int64HashTable, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Int64HashTable, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Int64HashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Int64HashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable __pyx_vtable_6pandas_9hashtable_Float64HashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Float64HashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Float64HashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Float64HashTable; + if (unlikely(__pyx_pw_6pandas_9hashtable_16Float64HashTable_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Float64HashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_16Float64HashTable_9__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Float64HashTable[] = { + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_13factorize, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_15get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_17map_locations, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_19lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_21unique, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Float64HashTable = { + __pyx_pw_6pandas_9hashtable_16Float64HashTable_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_9hashtable_16Float64HashTable_11__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Float64HashTable = { + __pyx_pw_6pandas_9hashtable_16Float64HashTable_3__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Float64HashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Float64HashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Float64HashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Float64HashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_Float64HashTable, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Float64HashTable, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Float64HashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Float64HashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable __pyx_vtable_6pandas_9hashtable_PyObjectHashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_PyObjectHashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable; + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_PyObjectHashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_PyObjectHashTable[] = { + {__Pyx_NAMESTR("destroy"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_9destroy, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_13get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_17map_locations, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_19lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup2"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_21lookup2, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_23unique, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_25get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_PyObjectHashTable = { + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_5__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_7__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_PyObjectHashTable = { + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_5__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_PyObjectHashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.PyObjectHashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_PyObjectHashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_PyObjectHashTable, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_PyObjectHashTable, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_PyObjectHashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_PyObjectHashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_ObjectVector __pyx_vtable_6pandas_9hashtable_ObjectVector; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_ObjectVector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_ObjectVector *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_ObjectVector; + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_9hashtable_12ObjectVector_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_ObjectVector(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_ObjectVector *p = (struct __pyx_obj_6pandas_9hashtable_ObjectVector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->ao); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_ObjectVector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *p = (struct __pyx_obj_6pandas_9hashtable_ObjectVector *)o; + if (p->ao) { + e = (*v)(((PyObject*)p->ao), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_ObjectVector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *p = (struct __pyx_obj_6pandas_9hashtable_ObjectVector *)o; + tmp = ((PyObject*)p->ao); + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_ObjectVector[] = { + {__Pyx_NAMESTR("to_array"), (PyCFunction)__pyx_pw_6pandas_9hashtable_12ObjectVector_5to_array, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_ObjectVector = { + __pyx_pw_6pandas_9hashtable_12ObjectVector_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_ObjectVector = { + __pyx_pw_6pandas_9hashtable_12ObjectVector_3__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_ObjectVector = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.ObjectVector"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_ObjectVector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_ObjectVector, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_ObjectVector, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_ObjectVector, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_ObjectVector, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_ObjectVector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_ObjectVector, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_ObjectVector, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64Vector __pyx_vtable_6pandas_9hashtable_Int64Vector; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64Vector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Int64Vector *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Int64Vector; + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_9hashtable_11Int64Vector_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Int64Vector(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_Int64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Int64Vector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->ao); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_Int64Vector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Int64Vector *)o; + if (p->ao) { + e = (*v)(((PyObject*)p->ao), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_Int64Vector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Int64Vector *)o; + tmp = ((PyObject*)p->ao); + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Int64Vector[] = { + {__Pyx_NAMESTR("to_array"), (PyCFunction)__pyx_pw_6pandas_9hashtable_11Int64Vector_5to_array, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Int64Vector = { + __pyx_pw_6pandas_9hashtable_11Int64Vector_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Int64Vector = { + __pyx_pw_6pandas_9hashtable_11Int64Vector_3__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Int64Vector = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Int64Vector"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Int64Vector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Int64Vector, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_Int64Vector, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Int64Vector, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_Int64Vector, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_Int64Vector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Int64Vector, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Int64Vector, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64Vector __pyx_vtable_6pandas_9hashtable_Float64Vector; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Float64Vector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Float64Vector *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Float64Vector; + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_9hashtable_13Float64Vector_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Float64Vector(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_Float64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Float64Vector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->ao); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_Float64Vector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_Float64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Float64Vector *)o; + if (p->ao) { + e = (*v)(((PyObject*)p->ao), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_Float64Vector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_Float64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Float64Vector *)o; + tmp = ((PyObject*)p->ao); + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Float64Vector[] = { + {__Pyx_NAMESTR("to_array"), (PyCFunction)__pyx_pw_6pandas_9hashtable_13Float64Vector_5to_array, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Float64Vector = { + __pyx_pw_6pandas_9hashtable_13Float64Vector_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Float64Vector = { + __pyx_pw_6pandas_9hashtable_13Float64Vector_3__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Float64Vector = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Float64Vector"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Float64Vector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Float64Vector, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_Float64Vector, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Float64Vector, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_Float64Vector, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_Float64Vector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Float64Vector, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Float64Vector, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable __pyx_vtable_6pandas_9hashtable_StringHashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_StringHashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_StringHashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_StringHashTable; + if (unlikely(__pyx_pw_6pandas_9hashtable_15StringHashTable_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_StringHashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_15StringHashTable_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_StringHashTable[] = { + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_7get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_11get_indexer, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_13unique, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_15factorize, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_StringHashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.StringHashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_StringHashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_StringHashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_StringHashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_StringHashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable __pyx_vtable_6pandas_9hashtable_Int32HashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int32HashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Int32HashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Int32HashTable; + if (unlikely(__pyx_pw_6pandas_9hashtable_14Int32HashTable_3__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Int32HashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_14Int32HashTable_5__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Int32HashTable[] = { + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_9get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_13map_locations, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_15lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_17factorize, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Int32HashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Int32HashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Int32HashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Int32HashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Int32HashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_9hashtable_14Int32HashTable_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Int32HashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Factorizer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Factorizer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Factorizer *)o); + p->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)Py_None); Py_INCREF(Py_None); + p->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Factorizer(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Factorizer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->table); + Py_CLEAR(p->uniques); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_Factorizer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Factorizer *)o; + if (p->table) { + e = (*v)(((PyObject*)p->table), a); if (e) return e; + } + if (p->uniques) { + e = (*v)(((PyObject*)p->uniques), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_Factorizer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Factorizer *)o; + tmp = ((PyObject*)p->table); + p->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->uniques); + p->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_10Factorizer_table(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5table_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_10Factorizer_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5table_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5table_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_10Factorizer_uniques(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_10Factorizer_uniques(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_10Factorizer_count(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5count_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_10Factorizer_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5count_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Factorizer[] = { + {__Pyx_NAMESTR("get_count"), (PyCFunction)__pyx_pw_6pandas_9hashtable_10Factorizer_3get_count, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_10Factorizer_5factorize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_9hashtable_10Factorizer_4factorize)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_10Factorizer_7unique, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_9hashtable_Factorizer[] = { + {(char *)"table", __pyx_getprop_6pandas_9hashtable_10Factorizer_table, __pyx_setprop_6pandas_9hashtable_10Factorizer_table, 0, 0}, + {(char *)"uniques", __pyx_getprop_6pandas_9hashtable_10Factorizer_uniques, __pyx_setprop_6pandas_9hashtable_10Factorizer_uniques, 0, 0}, + {(char *)"count", __pyx_getprop_6pandas_9hashtable_10Factorizer_count, __pyx_setprop_6pandas_9hashtable_10Factorizer_count, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Factorizer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Factorizer"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Factorizer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Factorizer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_Factorizer, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_Factorizer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Factorizer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_9hashtable_Factorizer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_9hashtable_10Factorizer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Factorizer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64Factorizer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)o); + p->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)Py_None); Py_INCREF(Py_None); + p->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Int64Factorizer(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->table); + Py_CLEAR(p->uniques); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_Int64Factorizer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)o; + if (p->table) { + e = (*v)(((PyObject*)p->table), a); if (e) return e; + } + if (p->uniques) { + e = (*v)(((PyObject*)p->uniques), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_Int64Factorizer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)o; + tmp = ((PyObject*)p->table); + p->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->uniques); + p->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_15Int64Factorizer_table(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_15Int64Factorizer_uniques(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_uniques(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_15Int64Factorizer_count(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Int64Factorizer[] = { + {__Pyx_NAMESTR("get_count"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15Int64Factorizer_3get_count, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5factorize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_9hashtable_Int64Factorizer[] = { + {(char *)"table", __pyx_getprop_6pandas_9hashtable_15Int64Factorizer_table, __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_table, 0, 0}, + {(char *)"uniques", __pyx_getprop_6pandas_9hashtable_15Int64Factorizer_uniques, __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_uniques, 0, 0}, + {(char *)"count", __pyx_getprop_6pandas_9hashtable_15Int64Factorizer_count, __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_count, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Int64Factorizer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Int64Factorizer"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Int64Factorizer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_Int64Factorizer, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_Int64Factorizer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Int64Factorizer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_9hashtable_Int64Factorizer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_9hashtable_15Int64Factorizer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Int64Factorizer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("value_count_int64"), (PyCFunction)__pyx_pw_6pandas_9hashtable_3value_count_int64, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("value_count_object"), (PyCFunction)__pyx_pw_6pandas_9hashtable_5value_count_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("hashtable"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_Factorize_values_with_nans_repl, __pyx_k_Factorize_values_with_nans_repl, sizeof(__pyx_k_Factorize_values_with_nans_repl), 0, 1, 0, 0}, + {&__pyx_kp_u_Factorizer_factorize_line_859, __pyx_k_Factorizer_factorize_line_859, sizeof(__pyx_k_Factorizer_factorize_line_859), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_ONAN, __pyx_k_ONAN, sizeof(__pyx_k_ONAN), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, + {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_count_prior, __pyx_k_count_prior, sizeof(__pyx_k_count_prior), 0, 0, 1, 1}, + {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_get_item, __pyx_k_get_item, sizeof(__pyx_k_get_item), 0, 0, 1, 1}, + {&__pyx_n_s_get_labels, __pyx_k_get_labels, sizeof(__pyx_k_get_labels), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_iterations, __pyx_k_iterations, sizeof(__pyx_k_iterations), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_list_to_object_array, __pyx_k_list_to_object_array, sizeof(__pyx_k_list_to_object_array), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_max_count, __pyx_k_max_count, sizeof(__pyx_k_max_count), 0, 0, 1, 1}, + {&__pyx_n_s_max_val, __pyx_k_max_val, sizeof(__pyx_k_max_val), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_mode_int64, __pyx_k_mode_int64, sizeof(__pyx_k_mode_int64), 0, 0, 1, 1}, + {&__pyx_n_s_mode_object, __pyx_k_mode_object, sizeof(__pyx_k_mode_object), 0, 0, 1, 1}, + {&__pyx_n_s_modes, __pyx_k_modes, sizeof(__pyx_k_modes), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_na_sentinel, __pyx_k_na_sentinel, sizeof(__pyx_k_na_sentinel), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_hashtable, __pyx_k_pandas_hashtable, sizeof(__pyx_k_pandas_hashtable), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_set_item, __pyx_k_set_item, sizeof(__pyx_k_set_item), 0, 0, 1, 1}, + {&__pyx_n_s_size_hint, __pyx_k_size_hint, sizeof(__pyx_k_size_hint), 0, 0, 1, 1}, + {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, + {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, + {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_to_array, __pyx_k_to_array, sizeof(__pyx_k_to_array), 0, 0, 1, 1}, + {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1}, + {&__pyx_n_s_uniques, __pyx_k_uniques, sizeof(__pyx_k_uniques), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/hashtable.pyx":31 + * + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_list_to_object_array, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":1005 + * + * + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): # <<<<<<<<<<<<<< + * cdef: + * int count, max_count = 2 + */ + __pyx_tuple__11 = PyTuple_Pack(11, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_count, __pyx_n_s_max_count, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_table, __pyx_n_s_ret, __pyx_n_s_modes); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_mode_object, 1005, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":1036 + * + * + * def mode_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * int val, max_val = 2 + */ + __pyx_tuple__13 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_max_val, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_table, __pyx_n_s_uniques, __pyx_n_s_modes); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_mode_int64, 1036, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC inithashtable(void); /*proto*/ +PyMODINIT_FUNC inithashtable(void) +#else +PyMODINIT_FUNC PyInit_hashtable(void); /*proto*/ +PyMODINIT_FUNC PyInit_hashtable(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_hashtable(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("hashtable"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__hashtable) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.hashtable")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.hashtable", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_HashTable.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "HashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_HashTable = &__pyx_type_6pandas_9hashtable_HashTable; + __pyx_vtabptr_6pandas_9hashtable_Int64HashTable = &__pyx_vtable_6pandas_9hashtable_Int64HashTable; + __pyx_vtable_6pandas_9hashtable_Int64HashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_14Int64HashTable_get_item; + __pyx_vtable_6pandas_9hashtable_Int64HashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_14Int64HashTable_set_item; + __pyx_type_6pandas_9hashtable_Int64HashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Int64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Int64HashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Int64HashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Int64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Int64HashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_Int64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int64HashTable = &__pyx_type_6pandas_9hashtable_Int64HashTable; + __pyx_vtabptr_6pandas_9hashtable_Float64HashTable = &__pyx_vtable_6pandas_9hashtable_Float64HashTable; + __pyx_vtable_6pandas_9hashtable_Float64HashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_16Float64HashTable_get_item; + __pyx_vtable_6pandas_9hashtable_Float64HashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_16Float64HashTable_set_item; + __pyx_type_6pandas_9hashtable_Float64HashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Float64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Float64HashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Float64HashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Float64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Float64HashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_Float64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Float64HashTable = &__pyx_type_6pandas_9hashtable_Float64HashTable; + __pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable = &__pyx_vtable_6pandas_9hashtable_PyObjectHashTable; + __pyx_vtable_6pandas_9hashtable_PyObjectHashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_17PyObjectHashTable_get_item; + __pyx_vtable_6pandas_9hashtable_PyObjectHashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_17PyObjectHashTable_set_item; + __pyx_type_6pandas_9hashtable_PyObjectHashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_PyObjectHashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_PyObjectHashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "PyObjectHashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_PyObjectHashTable = &__pyx_type_6pandas_9hashtable_PyObjectHashTable; + __pyx_vtabptr_6pandas_9hashtable_ObjectVector = &__pyx_vtable_6pandas_9hashtable_ObjectVector; + __pyx_vtable_6pandas_9hashtable_ObjectVector.append = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_ObjectVector *, PyObject *))__pyx_f_6pandas_9hashtable_12ObjectVector_append; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_ObjectVector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_ObjectVector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_ObjectVector.tp_dict, __pyx_vtabptr_6pandas_9hashtable_ObjectVector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ObjectVector", (PyObject *)&__pyx_type_6pandas_9hashtable_ObjectVector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_ObjectVector = &__pyx_type_6pandas_9hashtable_ObjectVector; + __pyx_vtabptr_6pandas_9hashtable_Int64Vector = &__pyx_vtable_6pandas_9hashtable_Int64Vector; + __pyx_vtable_6pandas_9hashtable_Int64Vector.append = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int64Vector *, __pyx_t_5numpy_int64_t))__pyx_f_6pandas_9hashtable_11Int64Vector_append; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Int64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Int64Vector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Int64Vector.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Int64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Int64Vector", (PyObject *)&__pyx_type_6pandas_9hashtable_Int64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int64Vector = &__pyx_type_6pandas_9hashtable_Int64Vector; + __pyx_vtabptr_6pandas_9hashtable_Float64Vector = &__pyx_vtable_6pandas_9hashtable_Float64Vector; + __pyx_vtable_6pandas_9hashtable_Float64Vector.append = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Float64Vector *, __pyx_t_5numpy_float64_t))__pyx_f_6pandas_9hashtable_13Float64Vector_append; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Float64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Float64Vector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Float64Vector.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Float64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Float64Vector", (PyObject *)&__pyx_type_6pandas_9hashtable_Float64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Float64Vector = &__pyx_type_6pandas_9hashtable_Float64Vector; + __pyx_vtabptr_6pandas_9hashtable_StringHashTable = &__pyx_vtable_6pandas_9hashtable_StringHashTable; + __pyx_vtable_6pandas_9hashtable_StringHashTable.check_type = (int (*)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *))__pyx_f_6pandas_9hashtable_15StringHashTable_check_type; + __pyx_vtable_6pandas_9hashtable_StringHashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_15StringHashTable_get_item; + __pyx_vtable_6pandas_9hashtable_StringHashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_15StringHashTable_set_item; + __pyx_type_6pandas_9hashtable_StringHashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_StringHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_StringHashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_StringHashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_StringHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "StringHashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_StringHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_StringHashTable = &__pyx_type_6pandas_9hashtable_StringHashTable; + __pyx_vtabptr_6pandas_9hashtable_Int32HashTable = &__pyx_vtable_6pandas_9hashtable_Int32HashTable; + __pyx_vtable_6pandas_9hashtable_Int32HashTable.check_type = (int (*)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, PyObject *))__pyx_f_6pandas_9hashtable_14Int32HashTable_check_type; + __pyx_vtable_6pandas_9hashtable_Int32HashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, __pyx_t_5numpy_int32_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_14Int32HashTable_get_item; + __pyx_vtable_6pandas_9hashtable_Int32HashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, __pyx_t_5numpy_int32_t, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_14Int32HashTable_set_item; + __pyx_type_6pandas_9hashtable_Int32HashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Int32HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Int32HashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Int32HashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Int32HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Int32HashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_Int32HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int32HashTable = &__pyx_type_6pandas_9hashtable_Int32HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Factorizer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Factorizer.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Factorizer", (PyObject *)&__pyx_type_6pandas_9hashtable_Factorizer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Factorizer = &__pyx_type_6pandas_9hashtable_Factorizer; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Int64Factorizer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Int64Factorizer.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Int64Factorizer", (PyObject *)&__pyx_type_6pandas_9hashtable_Int64Factorizer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int64Factorizer = &__pyx_type_6pandas_9hashtable_Int64Factorizer; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/hashtable.pyx":9 + * cimport util + * + * import numpy as np # <<<<<<<<<<<<<< + * + * ONAN = np.nan + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":11 + * import numpy as np + * + * ONAN = np.nan # <<<<<<<<<<<<<< + * + * cimport cython + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ONAN, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":16 + * cimport numpy as cnp + * + * cnp.import_array() # <<<<<<<<<<<<<< + * cnp.import_ufunc() + * + */ + import_array(); + + /* "pandas/hashtable.pyx":17 + * + * cnp.import_array() + * cnp.import_ufunc() # <<<<<<<<<<<<<< + * + * cdef int64_t iNaT = util.get_nat() + */ + import_ufunc(); + + /* "pandas/hashtable.pyx":19 + * cnp.import_ufunc() + * + * cdef int64_t iNaT = util.get_nat() # <<<<<<<<<<<<<< + * + * cdef extern from "datetime.h": + */ + __pyx_v_6pandas_9hashtable_iNaT = get_nat(); + + /* "pandas/hashtable.pyx":25 + * void PyDateTime_IMPORT() + * + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + PyDateTime_IMPORT; + + /* "pandas/hashtable.pyx":31 + * + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_9hashtable_1list_to_object_array, NULL, __pyx_n_s_pandas_hashtable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_to_object_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":49 + * + * + * cdef size_t _INIT_VEC_CAP = 32 # <<<<<<<<<<<<<< + * + * cdef class ObjectVector: + */ + __pyx_v_6pandas_9hashtable__INIT_VEC_CAP = 32; + + /* "pandas/hashtable.pyx":668 + * return uniques.to_array() + * + * na_sentinel = object # <<<<<<<<<<<<<< + * + * cdef class PyObjectHashTable(HashTable): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_na_sentinel, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":1005 + * + * + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): # <<<<<<<<<<<<<< + * cdef: + * int count, max_count = 2 + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_9hashtable_7mode_object, NULL, __pyx_n_s_pandas_hashtable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_object, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":1036 + * + * + * def mode_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * int val, max_val = 2 + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_9hashtable_9mode_int64, NULL, __pyx_n_s_pandas_hashtable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_int64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":1 + * from cpython cimport PyObject, Py_INCREF, PyList_Check, PyTuple_Check # <<<<<<<<<<<<<< + * + * from khash cimport * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Factorizer_factorize_line_859, __pyx_kp_u_Factorize_values_with_nans_repl) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.hashtable", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.hashtable"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint32"); + return (npy_uint32) -1; + } + return (npy_uint32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint32"); + return (npy_uint32) -1; + } + if (sizeof(npy_uint32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyLong_AsLong) + } else if (sizeof(npy_uint32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint32) -1; + } + } else { + npy_uint32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint32) -1; + val = __Pyx_PyInt_As_npy_uint32(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value) { + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint32), + little, !is_unsigned); + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files/pandas/index.c b/cythonized-files/pandas/index.c new file mode 100644 index 00000000..7d16b267 --- /dev/null +++ b/cythonized-files/pandas/index.c @@ -0,0 +1,19179 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__index +#define __PYX_HAVE_API__pandas__index +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "numpy_helper.h" +#include "khash_python.h" +#include "headers/stdint.h" +#include "datetime.h" +#include "datetime_helper.h" +#include "numpy/ndarrayobject.h" +#include "numpy/npy_common.h" +#include "datetime/np_datetime.h" +#include "datetime/np_datetime_strings.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "index.pyx", + "datetime.pxd", + "numpy.pxd", + "util.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", + "hashtable.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_9hashtable_HashTable; +struct __pyx_obj_6pandas_9hashtable_Int64HashTable; +struct __pyx_obj_6pandas_9hashtable_Float64HashTable; +struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable; +struct __pyx_obj_6pandas_5index_IndexEngine; +struct __pyx_obj_6pandas_5index_Int64Engine; +struct __pyx_obj_6pandas_5index_Float64Engine; +struct __pyx_obj_6pandas_5index_ObjectEngine; +struct __pyx_obj_6pandas_5index_DatetimeEngine; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "hashtable.pxd":5 + * # prototypes for sharing + * + * cdef class HashTable: # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6pandas_9hashtable_HashTable { + PyObject_HEAD +}; + + +/* "hashtable.pxd":8 + * pass + * + * cdef class Int64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int64_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Int64HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *__pyx_vtab; + kh_int64_t *table; +}; + + +/* "hashtable.pxd":14 + * cpdef set_item(self, int64_t key, Py_ssize_t val) + * + * cdef class Float64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_float64_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Float64HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *__pyx_vtab; + kh_float64_t *table; +}; + + +/* "hashtable.pxd":20 + * cpdef set_item(self, float64_t key, Py_ssize_t val) + * + * cdef class PyObjectHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_pymap_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *__pyx_vtab; + kh_pymap_t *table; +}; + + +/* "pandas/index.pyx":70 + * + * + * cdef class IndexEngine: # <<<<<<<<<<<<<< + * + * cdef readonly: + */ +struct __pyx_obj_6pandas_5index_IndexEngine { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_5index_IndexEngine *__pyx_vtab; + PyObject *vgetter; + struct __pyx_obj_6pandas_9hashtable_HashTable *mapping; + int over_size_threshold; + int unique; + int monotonic; + int initialized; + int monotonic_check; + int unique_check; +}; + + +/* "pandas/index.pyx":335 + * return result[0:count], missing[0:count_missing] + * + * cdef class Int64Engine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ +struct __pyx_obj_6pandas_5index_Int64Engine { + struct __pyx_obj_6pandas_5index_IndexEngine __pyx_base; +}; + + +/* "pandas/index.pyx":396 + * return result + * + * cdef class Float64Engine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ +struct __pyx_obj_6pandas_5index_Float64Engine { + struct __pyx_obj_6pandas_5index_IndexEngine __pyx_base; +}; + + +/* "pandas/index.pyx":482 + * } + * + * cdef class ObjectEngine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ +struct __pyx_obj_6pandas_5index_ObjectEngine { + struct __pyx_obj_6pandas_5index_IndexEngine __pyx_base; +}; + + +/* "pandas/index.pyx":499 + * + * + * cdef class DatetimeEngine(Int64Engine): # <<<<<<<<<<<<<< + * + * def __contains__(self, object val): + */ +struct __pyx_obj_6pandas_5index_DatetimeEngine { + struct __pyx_obj_6pandas_5index_Int64Engine __pyx_base; +}; + + + +/* "hashtable.pxd":8 + * pass + * + * cdef class Int64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int64_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *__pyx_vtabptr_6pandas_9hashtable_Int64HashTable; + + +/* "hashtable.pxd":14 + * cpdef set_item(self, int64_t key, Py_ssize_t val) + * + * cdef class Float64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_float64_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *__pyx_vtabptr_6pandas_9hashtable_Float64HashTable; + + +/* "hashtable.pxd":20 + * cpdef set_item(self, float64_t key, Py_ssize_t val) + * + * cdef class PyObjectHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_pymap_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *__pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable; + + +/* "pandas/index.pyx":70 + * + * + * cdef class IndexEngine: # <<<<<<<<<<<<<< + * + * cdef readonly: + */ + +struct __pyx_vtabstruct_6pandas_5index_IndexEngine { + PyObject *(*get_value)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*set_value)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyArrayObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*get_loc)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_get_loc_duplicates)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); + PyObject *(*_maybe_get_bool_indexer)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); + PyObject *(*_do_monotonic_check)(struct __pyx_obj_6pandas_5index_IndexEngine *); + PyObject *(*_get_index_values)(struct __pyx_obj_6pandas_5index_IndexEngine *); + PyObject *(*_do_unique_check)(struct __pyx_obj_6pandas_5index_IndexEngine *); + PyObject *(*_make_hash_table)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); + PyObject *(*_check_type)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); + PyObject *(*_ensure_mapping_populated)(struct __pyx_obj_6pandas_5index_IndexEngine *); + PyObject *(*initialize)(struct __pyx_obj_6pandas_5index_IndexEngine *); +}; +static struct __pyx_vtabstruct_6pandas_5index_IndexEngine *__pyx_vtabptr_6pandas_5index_IndexEngine; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__do_monotonic_check(struct __pyx_obj_6pandas_5index_IndexEngine *); +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__do_unique_check(struct __pyx_obj_6pandas_5index_IndexEngine *); +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(struct __pyx_obj_6pandas_5index_IndexEngine *); + + +/* "pandas/index.pyx":335 + * return result[0:count], missing[0:count_missing] + * + * cdef class Int64Engine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ + +struct __pyx_vtabstruct_6pandas_5index_Int64Engine { + struct __pyx_vtabstruct_6pandas_5index_IndexEngine __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_5index_Int64Engine *__pyx_vtabptr_6pandas_5index_Int64Engine; + + +/* "pandas/index.pyx":396 + * return result + * + * cdef class Float64Engine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ + +struct __pyx_vtabstruct_6pandas_5index_Float64Engine { + struct __pyx_vtabstruct_6pandas_5index_IndexEngine __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_5index_Float64Engine *__pyx_vtabptr_6pandas_5index_Float64Engine; + + +/* "pandas/index.pyx":482 + * } + * + * cdef class ObjectEngine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ + +struct __pyx_vtabstruct_6pandas_5index_ObjectEngine { + struct __pyx_vtabstruct_6pandas_5index_IndexEngine __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_5index_ObjectEngine *__pyx_vtabptr_6pandas_5index_ObjectEngine; + + +/* "pandas/index.pyx":499 + * + * + * cdef class DatetimeEngine(Int64Engine): # <<<<<<<<<<<<<< + * + * def __contains__(self, object val): + */ + +struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine { + struct __pyx_vtabstruct_6pandas_5index_Int64Engine __pyx_base; + PyObject *(*_date_check_type)(struct __pyx_obj_6pandas_5index_DatetimeEngine *, PyObject *); +}; +static struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *__pyx_vtabptr_6pandas_5index_DatetimeEngine; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_14DatetimeEngine__date_check_type(struct __pyx_obj_6pandas_5index_DatetimeEngine *, PyObject *); +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +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); + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static void* __Pyx_GetVtable(PyObject *dict); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'util' */ +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *, PyObject *, PyObject *); /*proto*/ + +/* Module declarations from 'pandas.tslib' */ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'pandas.hashtable' */ +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int64HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Float64HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_PyObjectHashTable = 0; + +/* Module declarations from 'datetime' */ + +/* Module declarations from 'datetime' */ +static PyTypeObject *__pyx_ptype_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0; +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *, pandas_datetimestruct *); /*proto*/ + +/* Module declarations from 'pandas.index' */ +static PyTypeObject *__pyx_ptype_6pandas_5index_IndexEngine = 0; +static PyTypeObject *__pyx_ptype_6pandas_5index_Int64Engine = 0; +static PyTypeObject *__pyx_ptype_6pandas_5index_Float64Engine = 0; +static PyTypeObject *__pyx_ptype_6pandas_5index_ObjectEngine = 0; +static PyTypeObject *__pyx_ptype_6pandas_5index_DatetimeEngine = 0; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5index_iNaT; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_is_definitely_invalid_key(PyObject *); /*proto*/ +static Py_ssize_t __pyx_f_6pandas_5index__bin_search(PyArrayObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_convert_scalar(PyArrayObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index__to_i8(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5index__is_utc(PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +#define __Pyx_MODULE_NAME "pandas.index" +int __pyx_module_is_main_pandas__index = 0; + +/* Implementation of 'pandas.index' */ +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_pf_6pandas_5index_get_value_at(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_2set_value_at(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_val); /* proto */ +static int __pyx_pf_6pandas_5index_11IndexEngine___init__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_vgetter, PyObject *__pyx_v_n); /* proto */ +static int __pyx_pf_6pandas_5index_11IndexEngine_2__contains__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_4get_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_6set_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_8get_loc(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_9is_unique___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_12is_monotonic___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_10_call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_12clear_mapping(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_14get_indexer(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_16get_indexer_non_unique(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_targets); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_7vgetter___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_7mapping___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_19over_size_threshold___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static int __pyx_pf_6pandas_5index_14DatetimeEngine___contains__(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_2_call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_4get_loc(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_6get_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_8get_pad_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_10get_backfill_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_4convert_scalar(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_5index_IndexEngine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5index_Int64Engine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5index_Float64Engine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5index_ObjectEngine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5index_DatetimeEngine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_i4[] = "i4"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_UTC[] = "UTC"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_loc[] = "loc"; +static char __pyx_k_utc[] = "utc"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_bool[] = "bool_"; +static char __pyx_k_data[] = "_data"; +static char __pyx_k_hash[] = "_hash"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_left[] = "left"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_pytz[] = "pytz"; +static char __pyx_k_side[] = "side"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_type[] = "type"; +static char __pyx_k_view[] = "view"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_M8_ns[] = "M8[ns]"; +static char __pyx_k_algos[] = "algos"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_limit[] = "limit"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_other[] = "other"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_right[] = "right"; +static char __pyx_k_tslib[] = "tslib"; +static char __pyx_k_tzutc[] = "tzutc"; +static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_du_utc[] = "_du_utc"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_lookup[] = "lookup"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_pandas[] = "pandas"; +static char __pyx_k_repeat[] = "repeat"; +static char __pyx_k_resize[] = "resize"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_tzinfo[] = "tzinfo"; +static char __pyx_k_asarray[] = "asarray"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_get_loc[] = "get_loc"; +static char __pyx_k_integer[] = "integer"; +static char __pyx_k_ndarray[] = "ndarray"; +static char __pyx_k_vgetter[] = "vgetter"; +static char __pyx_k_KeyError[] = "KeyError"; +static char __pyx_k_get_item[] = "get_item"; +static char __pyx_k_Timestamp[] = "Timestamp"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_get_value[] = "get_value"; +static char __pyx_k_hashtable[] = "hashtable"; +static char __pyx_k_have_pytz[] = "have_pytz"; +static char __pyx_k_is_unique[] = "is_unique"; +static char __pyx_k_pad_int64[] = "pad_int64"; +static char __pyx_k_set_value[] = "set_value"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_pad_object[] = "pad_object"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_ImportError[] = "ImportError"; +static char __pyx_k_SIZE_CUTOFF[] = "_SIZE_CUTOFF"; +static char __pyx_k_dateutil_tz[] = "dateutil.tz"; +static char __pyx_k_microsecond[] = "microsecond"; +static char __pyx_k_pad_float64[] = "pad_float64"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_ensure_int64[] = "ensure_int64"; +static char __pyx_k_get_value_at[] = "get_value_at"; +static char __pyx_k_is_monotonic[] = "is_monotonic"; +static char __pyx_k_pandas_index[] = "pandas.index"; +static char __pyx_k_pandas_tslib[] = "pandas.tslib"; +static char __pyx_k_searchsorted[] = "searchsorted"; +static char __pyx_k_set_value_at[] = "set_value_at"; +static char __pyx_k_get_utcoffset[] = "_get_utcoffset"; +static char __pyx_k_map_locations[] = "map_locations"; +static char __pyx_k_pad_functions[] = "_pad_functions"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_AttributeError[] = "AttributeError"; +static char __pyx_k_Int64HashTable[] = "Int64HashTable"; +static char __pyx_k_backfill_int64[] = "backfill_int64"; +static char __pyx_k_call_monotonic[] = "_call_monotonic"; +static char __pyx_k_ensure_float64[] = "ensure_float64"; +static char __pyx_k_backfill_object[] = "backfill_object"; +static char __pyx_k_Float64HashTable[] = "Float64HashTable"; +static char __pyx_k_backfill_float64[] = "backfill_float64"; +static char __pyx_k_PyObjectHashTable[] = "PyObjectHashTable"; +static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_backfill_functions[] = "_backfill_functions"; +static char __pyx_k_is_monotonic_int64[] = "is_monotonic_int64"; +static char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_is_monotonic_object[] = "is_monotonic_object"; +static char __pyx_k_delta_to_nanoseconds[] = "_delta_to_nanoseconds"; +static char __pyx_k_is_monotonic_float64[] = "is_monotonic_float64"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/index.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_Cannot_assign_nan_to_integer_ser[] = "Cannot assign nan to integer series"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Cannot_assign_nan_to_integer_ser; +static PyObject *__pyx_n_s_Float64HashTable; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_n_s_Int64HashTable; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_kp_s_M8_ns; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_s_PyObjectHashTable; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_SIZE_CUTOFF; +static PyObject *__pyx_n_s_Timestamp; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_UTC; +static PyObject *__pyx_kp_s_Unable_to_parse_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_algos; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_backfill_float64; +static PyObject *__pyx_n_s_backfill_functions; +static PyObject *__pyx_n_s_backfill_int64; +static PyObject *__pyx_n_s_backfill_object; +static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_call_monotonic; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_dateutil_tz; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_delta_to_nanoseconds; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_du_utc; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_ensure_float64; +static PyObject *__pyx_n_s_ensure_int64; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_get_item; +static PyObject *__pyx_n_s_get_loc; +static PyObject *__pyx_n_s_get_utcoffset; +static PyObject *__pyx_n_s_get_value; +static PyObject *__pyx_n_s_get_value_at; +static PyObject *__pyx_n_s_hash; +static PyObject *__pyx_n_s_hashtable; +static PyObject *__pyx_n_s_have_pytz; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_i4; +static PyObject *__pyx_n_s_i8; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_integer; +static PyObject *__pyx_n_s_is_monotonic; +static PyObject *__pyx_n_s_is_monotonic_float64; +static PyObject *__pyx_n_s_is_monotonic_int64; +static PyObject *__pyx_n_s_is_monotonic_object; +static PyObject *__pyx_n_s_is_unique; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_left; +static PyObject *__pyx_n_s_limit; +static PyObject *__pyx_n_s_loc; +static PyObject *__pyx_n_s_lookup; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_map_locations; +static PyObject *__pyx_n_s_microsecond; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_ndarray; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_other; +static PyObject *__pyx_n_s_pad_float64; +static PyObject *__pyx_n_s_pad_functions; +static PyObject *__pyx_n_s_pad_int64; +static PyObject *__pyx_n_s_pad_object; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_pandas_index; +static PyObject *__pyx_n_s_pandas_tslib; +static PyObject *__pyx_n_s_pytz; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_repeat; +static PyObject *__pyx_n_s_resize; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_searchsorted; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_set_value; +static PyObject *__pyx_n_s_set_value_at; +static PyObject *__pyx_n_s_side; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_tslib; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_tzinfo; +static PyObject *__pyx_n_s_tzutc; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_utc; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_vgetter; +static PyObject *__pyx_n_s_view; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_1000000; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; + +/* "pandas/index.pyx":46 + * + * + * cdef inline is_definitely_invalid_key(object val): # <<<<<<<<<<<<<< + * if PyTuple_Check(val): + * try: + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_is_definitely_invalid_key(PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_hash_t __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_definitely_invalid_key", 0); + + /* "pandas/index.pyx":47 + * + * cdef inline is_definitely_invalid_key(object val): + * if PyTuple_Check(val): # <<<<<<<<<<<<<< + * try: + * hash(val) + */ + __pyx_t_1 = (PyTuple_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":48 + * cdef inline is_definitely_invalid_key(object val): + * if PyTuple_Check(val): + * try: # <<<<<<<<<<<<<< + * hash(val) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/index.pyx":49 + * if PyTuple_Check(val): + * try: + * hash(val) # <<<<<<<<<<<<<< + * except TypeError: + * return True + */ + __pyx_t_5 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + + /* "pandas/index.pyx":50 + * try: + * hash(val) + * except TypeError: # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_6) { + __Pyx_AddTraceback("pandas.index.is_definitely_invalid_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/index.pyx":51 + * hash(val) + * except TypeError: + * return True # <<<<<<<<<<<<<< + * + * # we have a _data, means we are a NDFrame + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":54 + * + * # we have a _data, means we are a NDFrame + * return (PySlice_Check(val) or cnp.PyArray_Check(val) # <<<<<<<<<<<<<< + * or PyList_Check(val) or hasattr(val,'_data')) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_PyInt_From_int(PySlice_Check(__pyx_v_val)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/index.pyx":55 + * # we have a _data, means we are a NDFrame + * return (PySlice_Check(val) or cnp.PyArray_Check(val) + * or PyList_Check(val) or hasattr(val,'_data')) # <<<<<<<<<<<<<< + * + * def get_value_at(ndarray arr, object loc): + */ + __pyx_t_1 = PyArray_Check(__pyx_v_val); + if (!__pyx_t_1) { + __pyx_t_10 = PyList_Check(__pyx_v_val); + if (!__pyx_t_10) { + __pyx_t_11 = PyObject_HasAttr(__pyx_v_val, __pyx_n_s_data); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_t_11; + } else { + __pyx_t_12 = __pyx_t_10; + } + __pyx_t_10 = __pyx_t_12; + } else { + __pyx_t_10 = __pyx_t_1; + } + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":46 + * + * + * cdef inline is_definitely_invalid_key(object val): # <<<<<<<<<<<<<< + * if PyTuple_Check(val): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.index.is_definitely_invalid_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":57 + * or PyList_Check(val) or hasattr(val,'_data')) + * + * def get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_1get_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5index_1get_value_at = {__Pyx_NAMESTR("get_value_at"), (PyCFunction)__pyx_pw_6pandas_5index_1get_value_at, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5index_1get_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_loc = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_value_at (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_loc,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_value_at", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_value_at") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_loc = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_value_at", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_get_value_at(__pyx_self, __pyx_v_arr, __pyx_v_loc); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_get_value_at(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + + /* "pandas/index.pyx":58 + * + * def get_value_at(ndarray arr, object loc): + * if arr.descr.type_num == NPY_DATETIME: # <<<<<<<<<<<<<< + * return Timestamp(util.get_value_at(arr, loc)) + * return util.get_value_at(arr, loc) + */ + __pyx_t_1 = ((__pyx_v_arr->descr->type_num == NPY_DATETIME) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":59 + * def get_value_at(ndarray arr, object loc): + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) # <<<<<<<<<<<<<< + * return util.get_value_at(arr, loc) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":60 + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + * return util.get_value_at(arr, loc) # <<<<<<<<<<<<<< + * + * def set_value_at(ndarray arr, object loc, object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":57 + * or PyList_Check(val) or hasattr(val,'_data')) + * + * def get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":62 + * return util.get_value_at(arr, loc) + * + * def set_value_at(ndarray arr, object loc, object val): # <<<<<<<<<<<<<< + * return util.set_value_at(arr, loc, val) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_3set_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5index_3set_value_at = {__Pyx_NAMESTR("set_value_at"), (PyCFunction)__pyx_pw_6pandas_5index_3set_value_at, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5index_3set_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_loc = 0; + PyObject *__pyx_v_val = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_value_at (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_loc,&__pyx_n_s_val,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_value_at") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_loc = values[1]; + __pyx_v_val = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_2set_value_at(__pyx_self, __pyx_v_arr, __pyx_v_loc, __pyx_v_val); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_2set_value_at(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + + /* "pandas/index.pyx":63 + * + * def set_value_at(ndarray arr, object loc, object val): + * return util.set_value_at(arr, loc, val) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_4util_set_value_at(__pyx_v_arr, __pyx_v_loc, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":62 + * return util.get_value_at(arr, loc) + * + * def set_value_at(ndarray arr, object loc, object val): # <<<<<<<<<<<<<< + * return util.set_value_at(arr, loc, val) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":81 + * bint initialized, monotonic_check, unique_check + * + * def __init__(self, vgetter, n): # <<<<<<<<<<<<<< + * self.vgetter = vgetter + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5index_11IndexEngine_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_5index_11IndexEngine_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_vgetter = 0; + PyObject *__pyx_v_n = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vgetter,&__pyx_n_s_n,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vgetter)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_vgetter = values[0]; + __pyx_v_n = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine___init__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_vgetter, __pyx_v_n); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5index_11IndexEngine___init__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_vgetter, PyObject *__pyx_v_n) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/index.pyx":82 + * + * def __init__(self, vgetter, n): + * self.vgetter = vgetter # <<<<<<<<<<<<<< + * + * self.over_size_threshold = n >= _SIZE_CUTOFF + */ + __Pyx_INCREF(__pyx_v_vgetter); + __Pyx_GIVEREF(__pyx_v_vgetter); + __Pyx_GOTREF(__pyx_v_self->vgetter); + __Pyx_DECREF(__pyx_v_self->vgetter); + __pyx_v_self->vgetter = __pyx_v_vgetter; + + /* "pandas/index.pyx":84 + * self.vgetter = vgetter + * + * self.over_size_threshold = n >= _SIZE_CUTOFF # <<<<<<<<<<<<<< + * + * self.initialized = 0 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SIZE_CUTOFF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->over_size_threshold = __pyx_t_3; + + /* "pandas/index.pyx":86 + * self.over_size_threshold = n >= _SIZE_CUTOFF + * + * self.initialized = 0 # <<<<<<<<<<<<<< + * self.monotonic_check = 0 + * + */ + __pyx_v_self->initialized = 0; + + /* "pandas/index.pyx":87 + * + * self.initialized = 0 + * self.monotonic_check = 0 # <<<<<<<<<<<<<< + * + * self.unique = 0 + */ + __pyx_v_self->monotonic_check = 0; + + /* "pandas/index.pyx":89 + * self.monotonic_check = 0 + * + * self.unique = 0 # <<<<<<<<<<<<<< + * self.monotonic = 0 + * + */ + __pyx_v_self->unique = 0; + + /* "pandas/index.pyx":90 + * + * self.unique = 0 + * self.monotonic = 0 # <<<<<<<<<<<<<< + * + * def __contains__(self, object val): + */ + __pyx_v_self->monotonic = 0; + + /* "pandas/index.pyx":81 + * bint initialized, monotonic_check, unique_check + * + * def __init__(self, vgetter, n): # <<<<<<<<<<<<<< + * self.vgetter = vgetter + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.IndexEngine.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":92 + * self.monotonic = 0 + * + * def __contains__(self, object val): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * hash(val) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5index_11IndexEngine_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static int __pyx_pw_6pandas_5index_11IndexEngine_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_2__contains__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5index_11IndexEngine_2__contains__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_hash_t __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + + /* "pandas/index.pyx":93 + * + * def __contains__(self, object val): + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * hash(val) + * return val in self.mapping + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":94 + * def __contains__(self, object val): + * self._ensure_mapping_populated() + * hash(val) # <<<<<<<<<<<<<< + * return val in self.mapping + * + */ + __pyx_t_2 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":95 + * self._ensure_mapping_populated() + * hash(val) + * return val in self.mapping # <<<<<<<<<<<<<< + * + * cpdef get_value(self, ndarray arr, object key): + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_val, ((PyObject *)__pyx_v_self->mapping), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/index.pyx":92 + * self.monotonic = 0 + * + * def __contains__(self, object val): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * hash(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":97 + * return val in self.mapping + * + * cpdef get_value(self, ndarray arr, object key): # <<<<<<<<<<<<<< + * ''' + * arr : 1-dimensional ndarray + */ + +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_5get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_11IndexEngine_get_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, int __pyx_skip_dispatch) { + PyObject *__pyx_v_loc = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_5get_value)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_arr)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/index.pyx":105 + * void* data_ptr + * + * loc = self.get_loc(key) # <<<<<<<<<<<<<< + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): + * return arr[loc] + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_loc(__pyx_v_self, __pyx_v_key, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_loc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":106 + * + * loc = self.get_loc(key) + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): # <<<<<<<<<<<<<< + * return arr[loc] + * else: + */ + if (!(PySlice_Check(__pyx_v_loc) != 0)) { + __pyx_t_4 = PyArray_Check(__pyx_v_loc); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = (PySlice_Check(__pyx_v_loc) != 0); + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":107 + * loc = self.get_loc(key) + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): + * return arr[loc] # <<<<<<<<<<<<<< + * else: + * if arr.descr.type_num == NPY_DATETIME: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_v_loc); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/index.pyx":109 + * return arr[loc] + * else: + * if arr.descr.type_num == NPY_DATETIME: # <<<<<<<<<<<<<< + * return Timestamp(util.get_value_at(arr, loc)) + * return util.get_value_at(arr, loc) + */ + __pyx_t_5 = ((__pyx_v_arr->descr->type_num == NPY_DATETIME) != 0); + if (__pyx_t_5) { + + /* "pandas/index.pyx":110 + * else: + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) # <<<<<<<<<<<<<< + * return util.get_value_at(arr, loc) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":111 + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + * return util.get_value_at(arr, loc) # <<<<<<<<<<<<<< + * + * cpdef set_value(self, ndarray arr, object key, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":97 + * return val in self.mapping + * + * cpdef get_value(self, ndarray arr, object key): # <<<<<<<<<<<<<< + * ''' + * arr : 1-dimensional ndarray + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_5get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5index_11IndexEngine_4get_value[] = "\n arr : 1-dimensional ndarray\n "; +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_5get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_value (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_key,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_key = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_4get_value(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_arr, __pyx_v_key); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_4get_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_value(__pyx_v_self, __pyx_v_arr, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":113 + * return util.get_value_at(arr, loc) + * + * cpdef set_value(self, ndarray arr, object key, object value): # <<<<<<<<<<<<<< + * ''' + * arr : 1-dimensional ndarray + */ + +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_11IndexEngine_set_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch) { + PyObject *__pyx_v_loc = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value", 0); + __Pyx_INCREF(__pyx_v_value); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_7set_value)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_arr)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/index.pyx":121 + * void* data_ptr + * + * loc = self.get_loc(key) # <<<<<<<<<<<<<< + * value = convert_scalar(arr, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_loc(__pyx_v_self, __pyx_v_key, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_loc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":122 + * + * loc = self.get_loc(key) + * value = convert_scalar(arr, value) # <<<<<<<<<<<<<< + * + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): + */ + __pyx_t_1 = __pyx_f_6pandas_5index_convert_scalar(__pyx_v_arr, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":124 + * value = convert_scalar(arr, value) + * + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): # <<<<<<<<<<<<<< + * arr[loc] = value + * else: + */ + if (!(PySlice_Check(__pyx_v_loc) != 0)) { + __pyx_t_4 = PyArray_Check(__pyx_v_loc); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = (PySlice_Check(__pyx_v_loc) != 0); + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":125 + * + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): + * arr[loc] = value # <<<<<<<<<<<<<< + * else: + * util.set_value_at(arr, loc, value) + */ + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_arr), __pyx_v_loc, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/index.pyx":127 + * arr[loc] = value + * else: + * util.set_value_at(arr, loc, value) # <<<<<<<<<<<<<< + * + * cpdef get_loc(self, object val): + */ + __pyx_t_1 = __pyx_f_4util_set_value_at(__pyx_v_arr, __pyx_v_loc, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "pandas/index.pyx":113 + * return util.get_value_at(arr, loc) + * + * cpdef set_value(self, ndarray arr, object key, object value): # <<<<<<<<<<<<<< + * ''' + * arr : 1-dimensional ndarray + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5index_11IndexEngine_6set_value[] = "\n arr : 1-dimensional ndarray\n "; +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_value (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_key,&__pyx_n_s_value,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_6set_value(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_arr, __pyx_v_key, __pyx_v_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_6set_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->set_value(__pyx_v_self, __pyx_v_arr, __pyx_v_key, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":129 + * util.set_value_at(arr, loc, value) + * + * cpdef get_loc(self, object val): # <<<<<<<<<<<<<< + * if is_definitely_invalid_key(val): + * raise TypeError + */ + +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_11IndexEngine_get_loc(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) { + PyObject *__pyx_v_values = NULL; + Py_ssize_t __pyx_v_loc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_loc", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_9get_loc)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/index.pyx":130 + * + * cpdef get_loc(self, object val): + * if is_definitely_invalid_key(val): # <<<<<<<<<<<<<< + * raise TypeError + * + */ + __pyx_t_1 = __pyx_f_6pandas_5index_is_definitely_invalid_key(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "pandas/index.pyx":131 + * cpdef get_loc(self, object val): + * if is_definitely_invalid_key(val): + * raise TypeError # <<<<<<<<<<<<<< + * + * if self.over_size_threshold and self.is_monotonic: + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":133 + * raise TypeError + * + * if self.over_size_threshold and self.is_monotonic: # <<<<<<<<<<<<<< + * if not self.is_unique: + * return self._get_loc_duplicates(val) + */ + __pyx_t_4 = __pyx_v_self->over_size_threshold; + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/index.pyx":134 + * + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = ((!__pyx_t_6) != 0); + if (__pyx_t_4) { + + /* "pandas/index.pyx":135 + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * values = self._get_index_values() + * loc = _bin_search(values, val) # .searchsorted(val, side='left') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":136 + * if not self.is_unique: + * return self._get_loc_duplicates(val) + * values = self._get_index_values() # <<<<<<<<<<<<<< + * loc = _bin_search(values, val) # .searchsorted(val, side='left') + * if util.get_value_at(values, loc) != val: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":137 + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + * loc = _bin_search(values, val) # .searchsorted(val, side='left') # <<<<<<<<<<<<<< + * if util.get_value_at(values, loc) != val: + * raise KeyError(val) + */ + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_6pandas_5index__bin_search(((PyArrayObject *)__pyx_v_values), __pyx_v_val); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_loc = __pyx_t_7; + + /* "pandas/index.pyx":138 + * values = self._get_index_values() + * loc = _bin_search(values, val) # .searchsorted(val, side='left') + * if util.get_value_at(values, loc) != val: # <<<<<<<<<<<<<< + * raise KeyError(val) + * return loc + */ + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_v_values), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "pandas/index.pyx":139 + * loc = _bin_search(values, val) # .searchsorted(val, side='left') + * if util.get_value_at(values, loc) != val: + * raise KeyError(val) # <<<<<<<<<<<<<< + * return loc + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":140 + * if util.get_value_at(values, loc) != val: + * raise KeyError(val) + * return loc # <<<<<<<<<<<<<< + * + * self._ensure_mapping_populated() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":142 + * return loc + * + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * if not self.unique: + * return self._get_loc_duplicates(val) + */ + __pyx_t_3 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/index.pyx":143 + * + * self._ensure_mapping_populated() + * if not self.unique: # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * + */ + __pyx_t_4 = ((!(__pyx_v_self->unique != 0)) != 0); + if (__pyx_t_4) { + + /* "pandas/index.pyx":144 + * self._ensure_mapping_populated() + * if not self.unique: + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * + * self._check_type(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":146 + * return self._get_loc_duplicates(val) + * + * self._check_type(val) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_check_type(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/index.pyx":148 + * self._check_type(val) + * + * try: # <<<<<<<<<<<<<< + * return self.mapping.get_item(val) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/index.pyx":149 + * + * try: + * return self.mapping.get_item(val) # <<<<<<<<<<<<<< + * except TypeError: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->mapping), __pyx_n_s_get_item); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L12_try_return; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":150 + * try: + * return self.mapping.get_item(val) + * except TypeError: # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_11) { + __Pyx_AddTraceback("pandas.index.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/index.pyx":151 + * return self.mapping.get_item(val) + * except TypeError: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * cdef inline _get_loc_duplicates(self, object val): + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_Raise(__pyx_t_13, 0, 0, 0); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L12_try_return:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L0; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L15_try_end:; + } + + /* "pandas/index.pyx":129 + * util.set_value_at(arr, loc, value) + * + * cpdef get_loc(self, object val): # <<<<<<<<<<<<<< + * if is_definitely_invalid_key(val): + * raise TypeError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_loc (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_8get_loc(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_8get_loc(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_loc", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_loc(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":153 + * raise KeyError(val) + * + * cdef inline _get_loc_duplicates(self, object val): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t diff + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + Py_ssize_t __pyx_v_diff; + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_left = NULL; + PyObject *__pyx_v_right = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_loc_duplicates", 0); + + /* "pandas/index.pyx":157 + * Py_ssize_t diff + * + * if self.is_monotonic: # <<<<<<<<<<<<<< + * values = self._get_index_values() + * left = values.searchsorted(val, side='left') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/index.pyx":158 + * + * if self.is_monotonic: + * values = self._get_index_values() # <<<<<<<<<<<<<< + * left = values.searchsorted(val, side='left') + * right = values.searchsorted(val, side='right') + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":159 + * if self.is_monotonic: + * values = self._get_index_values() + * left = values.searchsorted(val, side='left') # <<<<<<<<<<<<<< + * right = values.searchsorted(val, side='right') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_side, __pyx_n_s_left) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_left = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/index.pyx":160 + * values = self._get_index_values() + * left = values.searchsorted(val, side='left') + * right = values.searchsorted(val, side='right') # <<<<<<<<<<<<<< + * + * diff = right - left + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_right = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":162 + * right = values.searchsorted(val, side='right') + * + * diff = right - left # <<<<<<<<<<<<<< + * if diff == 0: + * raise KeyError(val) + */ + __pyx_t_1 = PyNumber_Subtract(__pyx_v_right, __pyx_v_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_diff = __pyx_t_6; + + /* "pandas/index.pyx":165 + * if diff == 0: + * raise KeyError(val) + * elif diff == 1: # <<<<<<<<<<<<<< + * return left + * else: + */ + switch (__pyx_v_diff) { + + /* "pandas/index.pyx":163 + * + * diff = right - left + * if diff == 0: # <<<<<<<<<<<<<< + * raise KeyError(val) + * elif diff == 1: + */ + case 0: + + /* "pandas/index.pyx":164 + * diff = right - left + * if diff == 0: + * raise KeyError(val) # <<<<<<<<<<<<<< + * elif diff == 1: + * return left + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + + /* "pandas/index.pyx":165 + * if diff == 0: + * raise KeyError(val) + * elif diff == 1: # <<<<<<<<<<<<<< + * return left + * else: + */ + case 1: + + /* "pandas/index.pyx":166 + * raise KeyError(val) + * elif diff == 1: + * return left # <<<<<<<<<<<<<< + * else: + * return slice(left, right) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_left); + __pyx_r = __pyx_v_left; + goto __pyx_L0; + break; + default: + + /* "pandas/index.pyx":168 + * return left + * else: + * return slice(left, right) # <<<<<<<<<<<<<< + * else: + * return self._maybe_get_bool_indexer(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_left); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_left); + __Pyx_GIVEREF(__pyx_v_left); + __Pyx_INCREF(__pyx_v_right); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_right); + __Pyx_GIVEREF(__pyx_v_right); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + break; + } + } + /*else*/ { + + /* "pandas/index.pyx":170 + * return slice(left, right) + * else: + * return self._maybe_get_bool_indexer(val) # <<<<<<<<<<<<<< + * + * cdef _maybe_get_bool_indexer(self, object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_maybe_get_bool_indexer(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":153 + * raise KeyError(val) + * + * cdef inline _get_loc_duplicates(self, object val): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t diff + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.index.IndexEngine._get_loc_duplicates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_left); + __Pyx_XDECREF(__pyx_v_right); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":172 + * return self._maybe_get_bool_indexer(val) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t] indexer + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine__maybe_get_bool_indexer(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_values = 0; + int __pyx_v_count; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_last_true; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_get_bool_indexer", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + + /* "pandas/index.pyx":176 + * ndarray[uint8_t] indexer + * ndarray[object] values + * int count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, n + * int last_true + */ + __pyx_v_count = 0; + + /* "pandas/index.pyx":180 + * int last_true + * + * values = self._get_index_values() # <<<<<<<<<<<<<< + * n = len(values) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":181 + * + * values = self._get_index_values() + * n = len(values) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool) + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_7; + + /* "pandas/index.pyx":183 + * n = len(values) + * + * result = np.empty(n, dtype=bool) # <<<<<<<<<<<<<< + * indexer = result.view(np.uint8) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; + + /* "pandas/index.pyx":184 + * + * result = np.empty(n, dtype=bool) + * indexer = result.view(np.uint8) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/index.pyx":186 + * indexer = result.view(np.uint8) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if values[i] == val: + * count += 1 + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/index.pyx":187 + * + * for i in range(n): + * if values[i] == val: # <<<<<<<<<<<<<< + * count += 1 + * indexer[i] = 1 + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_9); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_14) { + + /* "pandas/index.pyx":188 + * for i in range(n): + * if values[i] == val: + * count += 1 # <<<<<<<<<<<<<< + * indexer[i] = 1 + * last_true = i + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/index.pyx":189 + * if values[i] == val: + * count += 1 + * indexer[i] = 1 # <<<<<<<<<<<<<< + * last_true = i + * else: + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides) = 1; + + /* "pandas/index.pyx":190 + * count += 1 + * indexer[i] = 1 + * last_true = i # <<<<<<<<<<<<<< + * else: + * indexer[i] = 0 + */ + __pyx_v_last_true = __pyx_v_i; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/index.pyx":192 + * last_true = i + * else: + * indexer[i] = 0 # <<<<<<<<<<<<<< + * + * if count == 0: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = 0; + } + __pyx_L5:; + } + + /* "pandas/index.pyx":194 + * indexer[i] = 0 + * + * if count == 0: # <<<<<<<<<<<<<< + * raise KeyError(val) + * if count == 1: + */ + __pyx_t_14 = ((__pyx_v_count == 0) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":195 + * + * if count == 0: + * raise KeyError(val) # <<<<<<<<<<<<<< + * if count == 1: + * return last_true + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":196 + * if count == 0: + * raise KeyError(val) + * if count == 1: # <<<<<<<<<<<<<< + * return last_true + * + */ + __pyx_t_14 = ((__pyx_v_count == 1) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":197 + * raise KeyError(val) + * if count == 1: + * return last_true # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_last_true); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":199 + * return last_true + * + * return result # <<<<<<<<<<<<<< + * + * property is_unique: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/index.pyx":172 + * return self._maybe_get_bool_indexer(val) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t] indexer + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.index.IndexEngine._maybe_get_bool_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":203 + * property is_unique: + * + * def __get__(self): # <<<<<<<<<<<<<< + * if not self.unique_check: + * self._do_unique_check() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9is_unique_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9is_unique_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_9is_unique___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_9is_unique___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/index.pyx":204 + * + * def __get__(self): + * if not self.unique_check: # <<<<<<<<<<<<<< + * self._do_unique_check() + * + */ + __pyx_t_1 = ((!(__pyx_v_self->unique_check != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":205 + * def __get__(self): + * if not self.unique_check: + * self._do_unique_check() # <<<<<<<<<<<<<< + * + * return self.unique == 1 + */ + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__do_unique_check(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":207 + * self._do_unique_check() + * + * return self.unique == 1 # <<<<<<<<<<<<<< + * + * property is_monotonic: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->unique == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":203 + * property is_unique: + * + * def __get__(self): # <<<<<<<<<<<<<< + * if not self.unique_check: + * self._do_unique_check() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.IndexEngine.is_unique.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":211 + * property is_monotonic: + * + * def __get__(self): # <<<<<<<<<<<<<< + * if not self.monotonic_check: + * self._do_monotonic_check() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_12is_monotonic_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_12is_monotonic_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_12is_monotonic___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_12is_monotonic___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/index.pyx":212 + * + * def __get__(self): + * if not self.monotonic_check: # <<<<<<<<<<<<<< + * self._do_monotonic_check() + * + */ + __pyx_t_1 = ((!(__pyx_v_self->monotonic_check != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":213 + * def __get__(self): + * if not self.monotonic_check: + * self._do_monotonic_check() # <<<<<<<<<<<<<< + * + * return self.monotonic == 1 + */ + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__do_monotonic_check(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":215 + * self._do_monotonic_check() + * + * return self.monotonic == 1 # <<<<<<<<<<<<<< + * + * cdef inline _do_monotonic_check(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->monotonic == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":211 + * property is_monotonic: + * + * def __get__(self): # <<<<<<<<<<<<<< + * if not self.monotonic_check: + * self._do_monotonic_check() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.IndexEngine.is_monotonic.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":217 + * return self.monotonic == 1 + * + * cdef inline _do_monotonic_check(self): # <<<<<<<<<<<<<< + * try: + * values = self._get_index_values() + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__do_monotonic_check(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_unique = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_do_monotonic_check", 0); + + /* "pandas/index.pyx":218 + * + * cdef inline _do_monotonic_check(self): + * try: # <<<<<<<<<<<<<< + * values = self._get_index_values() + * self.monotonic, unique = self._call_monotonic(values) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/index.pyx":219 + * cdef inline _do_monotonic_check(self): + * try: + * values = self._get_index_values() # <<<<<<<<<<<<<< + * self.monotonic, unique = self._call_monotonic(values) + * + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_values = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/index.pyx":220 + * try: + * values = self._get_index_values() + * self.monotonic, unique = self._call_monotonic(values) # <<<<<<<<<<<<<< + * + * if unique is not None: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_call_monotonic); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_unpacking_done; + __pyx_L11_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L12_unpacking_done:; + } + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->monotonic = __pyx_t_9; + __pyx_v_unique = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/index.pyx":222 + * self.monotonic, unique = self._call_monotonic(values) + * + * if unique is not None: # <<<<<<<<<<<<<< + * self.unique = unique + * self.unique_check = 1 + */ + __pyx_t_9 = (__pyx_v_unique != Py_None); + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "pandas/index.pyx":223 + * + * if unique is not None: + * self.unique = unique # <<<<<<<<<<<<<< + * self.unique_check = 1 + * + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_unique); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_self->unique = __pyx_t_10; + + /* "pandas/index.pyx":224 + * if unique is not None: + * self.unique = unique + * self.unique_check = 1 # <<<<<<<<<<<<<< + * + * except TypeError: + */ + __pyx_v_self->unique_check = 1; + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/index.pyx":226 + * self.unique_check = 1 + * + * except TypeError: # <<<<<<<<<<<<<< + * self.monotonic = 0 + * self.monotonic_check = 1 + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_11) { + __Pyx_AddTraceback("pandas.index.IndexEngine._do_monotonic_check", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/index.pyx":227 + * + * except TypeError: + * self.monotonic = 0 # <<<<<<<<<<<<<< + * self.monotonic_check = 1 + * + */ + __pyx_v_self->monotonic = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/index.pyx":228 + * except TypeError: + * self.monotonic = 0 + * self.monotonic_check = 1 # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ + __pyx_v_self->monotonic_check = 1; + + /* "pandas/index.pyx":217 + * return self.monotonic == 1 + * + * cdef inline _do_monotonic_check(self): # <<<<<<<<<<<<<< + * try: + * values = self._get_index_values() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.index.IndexEngine._do_monotonic_check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_unique); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":230 + * self.monotonic_check = 1 + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return self.vgetter() + * + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine__get_index_values(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_index_values", 0); + + /* "pandas/index.pyx":231 + * + * cdef _get_index_values(self): + * return self.vgetter() # <<<<<<<<<<<<<< + * + * cdef inline _do_unique_check(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->vgetter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":230 + * self.monotonic_check = 1 + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return self.vgetter() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":233 + * return self.vgetter() + * + * cdef inline _do_unique_check(self): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__do_unique_check(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_do_unique_check", 0); + + /* "pandas/index.pyx":234 + * + * cdef inline _do_unique_check(self): + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":233 + * return self.vgetter() + * + * cdef inline _do_unique_check(self): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine._do_unique_check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":236 + * self._ensure_mapping_populated() + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_11_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_11_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_10_call_monotonic(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_10_call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":237 + * + * def _call_monotonic(self, values): + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":236 + * self._ensure_mapping_populated() + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":239 + * raise NotImplementedError + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine__make_hash_table(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_n) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_hash_table", 0); + + /* "pandas/index.pyx":240 + * + * cdef _make_hash_table(self, n): + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef _check_type(self, object val): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":239 + * raise NotImplementedError + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":242 + * raise NotImplementedError + * + * cdef _check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine__check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_hash_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_type", 0); + + /* "pandas/index.pyx":243 + * + * cdef _check_type(self, object val): + * hash(val) # <<<<<<<<<<<<<< + * + * cdef inline _ensure_mapping_populated(self): + */ + __pyx_t_1 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":242 + * raise NotImplementedError + * + * cdef _check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine._check_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":245 + * hash(val) + * + * cdef inline _ensure_mapping_populated(self): # <<<<<<<<<<<<<< + * if not self.initialized: + * self.initialize() + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ensure_mapping_populated", 0); + + /* "pandas/index.pyx":246 + * + * cdef inline _ensure_mapping_populated(self): + * if not self.initialized: # <<<<<<<<<<<<<< + * self.initialize() + * + */ + __pyx_t_1 = ((!(__pyx_v_self->initialized != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":247 + * cdef inline _ensure_mapping_populated(self): + * if not self.initialized: + * self.initialize() # <<<<<<<<<<<<<< + * + * cdef initialize(self): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->initialize(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":245 + * hash(val) + * + * cdef inline _ensure_mapping_populated(self): # <<<<<<<<<<<<<< + * if not self.initialized: + * self.initialize() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.IndexEngine._ensure_mapping_populated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":249 + * self.initialize() + * + * cdef initialize(self): # <<<<<<<<<<<<<< + * values = self._get_index_values() + * + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine_initialize(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("initialize", 0); + + /* "pandas/index.pyx":250 + * + * cdef initialize(self): + * values = self._get_index_values() # <<<<<<<<<<<<<< + * + * self.mapping = self._make_hash_table(len(values)) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":252 + * values = self._get_index_values() + * + * self.mapping = self._make_hash_table(len(values)) # <<<<<<<<<<<<<< + * self.mapping.map_locations(values) + * + */ + __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_make_hash_table(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_9hashtable_HashTable))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->mapping); + __Pyx_DECREF(((PyObject *)__pyx_v_self->mapping)); + __pyx_v_self->mapping = ((struct __pyx_obj_6pandas_9hashtable_HashTable *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":253 + * + * self.mapping = self._make_hash_table(len(values)) + * self.mapping.map_locations(values) # <<<<<<<<<<<<<< + * + * if len(self.mapping) == len(values): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->mapping), __pyx_n_s_map_locations); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/index.pyx":255 + * self.mapping.map_locations(values) + * + * if len(self.mapping) == len(values): # <<<<<<<<<<<<<< + * self.unique = 1 + * self.unique_check = 1 + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->mapping); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((__pyx_t_2 == __pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "pandas/index.pyx":256 + * + * if len(self.mapping) == len(values): + * self.unique = 1 # <<<<<<<<<<<<<< + * self.unique_check = 1 + * + */ + __pyx_v_self->unique = 1; + + /* "pandas/index.pyx":257 + * if len(self.mapping) == len(values): + * self.unique = 1 + * self.unique_check = 1 # <<<<<<<<<<<<<< + * + * self.initialized = 1 + */ + __pyx_v_self->unique_check = 1; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":259 + * self.unique_check = 1 + * + * self.initialized = 1 # <<<<<<<<<<<<<< + * + * def clear_mapping(self): + */ + __pyx_v_self->initialized = 1; + + /* "pandas/index.pyx":249 + * self.initialize() + * + * cdef initialize(self): # <<<<<<<<<<<<<< + * values = self._get_index_values() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.IndexEngine.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":261 + * self.initialized = 1 + * + * def clear_mapping(self): # <<<<<<<<<<<<<< + * self.mapping = None + * self.initialized = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_13clear_mapping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_13clear_mapping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear_mapping (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_12clear_mapping(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_12clear_mapping(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear_mapping", 0); + + /* "pandas/index.pyx":262 + * + * def clear_mapping(self): + * self.mapping = None # <<<<<<<<<<<<<< + * self.initialized = 0 + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->mapping); + __Pyx_DECREF(((PyObject *)__pyx_v_self->mapping)); + __pyx_v_self->mapping = ((struct __pyx_obj_6pandas_9hashtable_HashTable *)Py_None); + + /* "pandas/index.pyx":263 + * def clear_mapping(self): + * self.mapping = None + * self.initialized = 0 # <<<<<<<<<<<<<< + * + * def get_indexer(self, values): + */ + __pyx_v_self->initialized = 0; + + /* "pandas/index.pyx":261 + * self.initialized = 1 + * + * def clear_mapping(self): # <<<<<<<<<<<<<< + * self.mapping = None + * self.initialized = 0 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":265 + * self.initialized = 0 + * + * def get_indexer(self, values): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * return self.mapping.lookup(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_15get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_15get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indexer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_14get_indexer(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_14get_indexer(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_indexer", 0); + + /* "pandas/index.pyx":266 + * + * def get_indexer(self, values): + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * return self.mapping.lookup(values) + * + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":267 + * def get_indexer(self, values): + * self._ensure_mapping_populated() + * return self.mapping.lookup(values) # <<<<<<<<<<<<<< + * + * def get_indexer_non_unique(self, targets): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->mapping), __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":265 + * self.initialized = 0 + * + * def get_indexer(self, values): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * return self.mapping.lookup(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":269 + * return self.mapping.lookup(values) + * + * def get_indexer_non_unique(self, targets): # <<<<<<<<<<<<<< + * """ return an indexer suitable for takng from a non unique index + * return the labels in the same order ast the target + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_17get_indexer_non_unique(PyObject *__pyx_v_self, PyObject *__pyx_v_targets); /*proto*/ +static char __pyx_doc_6pandas_5index_11IndexEngine_16get_indexer_non_unique[] = " return an indexer suitable for takng from a non unique index\n return the labels in the same order ast the target\n and a missing indexer into the targets (which correspond\n to the -1 indicies in the results "; +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_17get_indexer_non_unique(PyObject *__pyx_v_self, PyObject *__pyx_v_targets) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indexer_non_unique (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_16get_indexer_non_unique(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_targets)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_16get_indexer_non_unique(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_targets) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_missing = 0; + PyObject *__pyx_v_stargets = 0; + PyObject *__pyx_v_d = 0; + PyObject *__pyx_v_val = 0; + int __pyx_v_count; + int __pyx_v_count_missing; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_n_t; + Py_ssize_t __pyx_v_n_alloc; + CYTHON_UNUSED PyObject *__pyx_v_members = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_missing; + __Pyx_Buffer __pyx_pybuffer_missing; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject *(*__pyx_t_17)(PyObject *); + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + int __pyx_t_20; + int __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_indexer_non_unique", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_missing.pybuffer.buf = NULL; + __pyx_pybuffer_missing.refcount = 0; + __pyx_pybuffernd_missing.data = NULL; + __pyx_pybuffernd_missing.rcbuffer = &__pyx_pybuffer_missing; + + /* "pandas/index.pyx":279 + * ndarray[int64_t] result, missing + * set stargets + * dict d = {} # <<<<<<<<<<<<<< + * object val + * int count = 0, count_missing = 0 + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_d = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":281 + * dict d = {} + * object val + * int count = 0, count_missing = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, j, n, n_t, n_alloc + * + */ + __pyx_v_count = 0; + __pyx_v_count_missing = 0; + + /* "pandas/index.pyx":284 + * Py_ssize_t i, j, n, n_t, n_alloc + * + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * values = self._get_index_values() + * stargets = set(targets) + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":285 + * + * self._ensure_mapping_populated() + * values = self._get_index_values() # <<<<<<<<<<<<<< + * stargets = set(targets) + * n = len(values) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_values = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":286 + * self._ensure_mapping_populated() + * values = self._get_index_values() + * stargets = set(targets) # <<<<<<<<<<<<<< + * n = len(values) + * n_t = len(targets) + */ + __pyx_t_1 = PySet_New(__pyx_v_targets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_stargets = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":287 + * values = self._get_index_values() + * stargets = set(targets) + * n = len(values) # <<<<<<<<<<<<<< + * n_t = len(targets) + * if n > 10000: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/index.pyx":288 + * stargets = set(targets) + * n = len(values) + * n_t = len(targets) # <<<<<<<<<<<<<< + * if n > 10000: + * n_alloc = 10000 + */ + __pyx_t_2 = PyObject_Length(__pyx_v_targets); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n_t = __pyx_t_2; + + /* "pandas/index.pyx":289 + * n = len(values) + * n_t = len(targets) + * if n > 10000: # <<<<<<<<<<<<<< + * n_alloc = 10000 + * else: + */ + __pyx_t_3 = ((__pyx_v_n > 10000) != 0); + if (__pyx_t_3) { + + /* "pandas/index.pyx":290 + * n_t = len(targets) + * if n > 10000: + * n_alloc = 10000 # <<<<<<<<<<<<<< + * else: + * n_alloc = n + */ + __pyx_v_n_alloc = 10000; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/index.pyx":292 + * n_alloc = 10000 + * else: + * n_alloc = n # <<<<<<<<<<<<<< + * + * result = np.empty(n_alloc, dtype=np.int64) + */ + __pyx_v_n_alloc = __pyx_v_n; + } + __pyx_L3:; + + /* "pandas/index.pyx":294 + * n_alloc = n + * + * result = np.empty(n_alloc, dtype=np.int64) # <<<<<<<<<<<<<< + * missing = np.empty(n_t, dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_alloc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/index.pyx":295 + * + * result = np.empty(n_alloc, dtype=np.int64) + * missing = np.empty(n_t, dtype=np.int64) # <<<<<<<<<<<<<< + * + * # form the set of the results (like ismember) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n_t); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_missing.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_missing.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_missing.rcbuffer->pybuffer, (PyObject*)__pyx_v_missing, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + } + } + __pyx_pybuffernd_missing.diminfo[0].strides = __pyx_pybuffernd_missing.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_missing.diminfo[0].shape = __pyx_pybuffernd_missing.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_missing = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/index.pyx":298 + * + * # form the set of the results (like ismember) + * members = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i in range(n): + * val = util.get_value_1d(values, i) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_members = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/index.pyx":299 + * # form the set of the results (like ismember) + * members = np.empty(n, dtype=np.uint8) + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(values, i) + * if val in stargets: + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/index.pyx":300 + * members = np.empty(n, dtype=np.uint8) + * for i in range(n): + * val = util.get_value_1d(values, i) # <<<<<<<<<<<<<< + * if val in stargets: + * if val not in d: + */ + __pyx_t_4 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/index.pyx":301 + * for i in range(n): + * val = util.get_value_1d(values, i) + * if val in stargets: # <<<<<<<<<<<<<< + * if val not in d: + * d[val] = [] + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_stargets, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (__pyx_t_3 != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":302 + * val = util.get_value_1d(values, i) + * if val in stargets: + * if val not in d: # <<<<<<<<<<<<<< + * d[val] = [] + * d[val].append(i) + */ + __pyx_t_14 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_d, Py_NE)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__pyx_t_14 != 0); + if (__pyx_t_3) { + + /* "pandas/index.pyx":303 + * if val in stargets: + * if val not in d: + * d[val] = [] # <<<<<<<<<<<<<< + * d[val].append(i) + * + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_v_val, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/index.pyx":304 + * if val not in d: + * d[val] = [] + * d[val].append(i) # <<<<<<<<<<<<<< + * + * for i in range(n_t): + */ + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_d, __pyx_v_val); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_6); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + __pyx_L6:; + } + + /* "pandas/index.pyx":306 + * d[val].append(i) + * + * for i in range(n_t): # <<<<<<<<<<<<<< + * + * val = util.get_value_1d(targets, i) + */ + __pyx_t_2 = __pyx_v_n_t; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/index.pyx":308 + * for i in range(n_t): + * + * val = util.get_value_1d(targets, i) # <<<<<<<<<<<<<< + * + * # found + */ + if (!(likely(((__pyx_v_targets) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_targets, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = get_value_1d(((PyArrayObject *)__pyx_v_targets), __pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/index.pyx":311 + * + * # found + * if val in d: # <<<<<<<<<<<<<< + * for j in d[val]: + * + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_d, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (__pyx_t_3 != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":312 + * # found + * if val in d: + * for j in d[val]: # <<<<<<<<<<<<<< + * + * # realloc if needed + */ + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_d, __pyx_v_val); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + } else { + __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_17(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_j = __pyx_t_18; + + /* "pandas/index.pyx":315 + * + * # realloc if needed + * if count >= n_alloc: # <<<<<<<<<<<<<< + * n_alloc += 10000 + * result = np.resize(result, n_alloc) + */ + __pyx_t_14 = ((__pyx_v_count >= __pyx_v_n_alloc) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":316 + * # realloc if needed + * if count >= n_alloc: + * n_alloc += 10000 # <<<<<<<<<<<<<< + * result = np.resize(result, n_alloc) + * + */ + __pyx_v_n_alloc = (__pyx_v_n_alloc + 10000); + + /* "pandas/index.pyx":317 + * if count >= n_alloc: + * n_alloc += 10000 + * result = np.resize(result, n_alloc) # <<<<<<<<<<<<<< + * + * result[count] = j + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n_alloc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_6)); + __pyx_t_6 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/index.pyx":319 + * result = np.resize(result, n_alloc) + * + * result[count] = j # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_9 = __pyx_v_count; + __pyx_t_19 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/index.pyx":320 + * + * result[count] = j + * count += 1 # <<<<<<<<<<<<<< + * + * # value not found + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/index.pyx":325 + * else: + * + * if count >= n_alloc: # <<<<<<<<<<<<<< + * n_alloc += 10000 + * result = np.resize(result, n_alloc) + */ + __pyx_t_14 = ((__pyx_v_count >= __pyx_v_n_alloc) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":326 + * + * if count >= n_alloc: + * n_alloc += 10000 # <<<<<<<<<<<<<< + * result = np.resize(result, n_alloc) + * result[count] = -1 + */ + __pyx_v_n_alloc = (__pyx_v_n_alloc + 10000); + + /* "pandas/index.pyx":327 + * if count >= n_alloc: + * n_alloc += 10000 + * result = np.resize(result, n_alloc) # <<<<<<<<<<<<<< + * result[count] = -1 + * count += 1 + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_alloc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_19 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/index.pyx":328 + * n_alloc += 10000 + * result = np.resize(result, n_alloc) + * result[count] = -1 # <<<<<<<<<<<<<< + * count += 1 + * missing[count_missing] = i + */ + __pyx_t_19 = __pyx_v_count; + __pyx_t_20 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_20 = 0; + if (unlikely(__pyx_t_20 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_20); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = -1; + + /* "pandas/index.pyx":329 + * result = np.resize(result, n_alloc) + * result[count] = -1 + * count += 1 # <<<<<<<<<<<<<< + * missing[count_missing] = i + * count_missing += 1 + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/index.pyx":330 + * result[count] = -1 + * count += 1 + * missing[count_missing] = i # <<<<<<<<<<<<<< + * count_missing += 1 + * + */ + __pyx_t_20 = __pyx_v_count_missing; + __pyx_t_21 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_missing.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_missing.diminfo[0].shape)) __pyx_t_21 = 0; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_missing.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_missing.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/index.pyx":331 + * count += 1 + * missing[count_missing] = i + * count_missing += 1 # <<<<<<<<<<<<<< + * + * return result[0:count], missing[0:count_missing] + */ + __pyx_v_count_missing = (__pyx_v_count_missing + 1); + } + __pyx_L10:; + } + + /* "pandas/index.pyx":333 + * count_missing += 1 + * + * return result[0:count], missing[0:count_missing] # <<<<<<<<<<<<<< + * + * cdef class Int64Engine(IndexEngine): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_result), 0, __pyx_v_count, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_missing), 0, __pyx_v_count_missing, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":269 + * return self.mapping.lookup(values) + * + * def get_indexer_non_unique(self, targets): # <<<<<<<<<<<<<< + * """ return an indexer suitable for takng from a non unique index + * return the labels in the same order ast the target + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_missing.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.index.IndexEngine.get_indexer_non_unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_missing.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_missing); + __Pyx_XDECREF(__pyx_v_stargets); + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":73 + * + * cdef readonly: + * object vgetter # <<<<<<<<<<<<<< + * HashTable mapping + * bint over_size_threshold + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7vgetter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7vgetter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_7vgetter___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_7vgetter___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->vgetter); + __pyx_r = __pyx_v_self->vgetter; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":74 + * cdef readonly: + * object vgetter + * HashTable mapping # <<<<<<<<<<<<<< + * bint over_size_threshold + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7mapping_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7mapping_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_7mapping___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_7mapping___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->mapping)); + __pyx_r = ((PyObject *)__pyx_v_self->mapping); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":75 + * object vgetter + * HashTable mapping + * bint over_size_threshold # <<<<<<<<<<<<<< + * + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_19over_size_threshold_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_19over_size_threshold_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_19over_size_threshold___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_19over_size_threshold___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->over_size_threshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.over_size_threshold.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":337 + * cdef class Int64Engine(IndexEngine): + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return algos.ensure_int64(self.vgetter()) + * + */ + +static PyObject *__pyx_f_6pandas_5index_11Int64Engine__get_index_values(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_index_values", 0); + + /* "pandas/index.pyx":338 + * + * cdef _get_index_values(self): + * return algos.ensure_int64(self.vgetter()) # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ensure_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.vgetter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":337 + * cdef class Int64Engine(IndexEngine): + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return algos.ensure_int64(self.vgetter()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Int64Engine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":340 + * return algos.ensure_int64(self.vgetter()) + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.Int64HashTable(n) + * + */ + +static PyObject *__pyx_f_6pandas_5index_11Int64Engine__make_hash_table(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_n) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_hash_table", 0); + + /* "pandas/index.pyx":341 + * + * cdef _make_hash_table(self, n): + * return _hash.Int64HashTable(n) # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Int64HashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":340 + * return algos.ensure_int64(self.vgetter()) + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.Int64HashTable(n) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Int64Engine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":343 + * return _hash.Int64HashTable(n) + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_int64(values) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11Int64Engine__call_monotonic(((struct __pyx_obj_6pandas_5index_Int64Engine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":344 + * + * def _call_monotonic(self, values): + * return algos.is_monotonic_int64(values) # <<<<<<<<<<<<<< + * + * def get_pad_indexer(self, other, limit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_monotonic_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":343 + * return _hash.Int64HashTable(n) + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_int64(values) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Int64Engine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":346 + * return algos.is_monotonic_int64(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pad_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.Int64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_11Int64Engine_2get_pad_indexer(((struct __pyx_obj_6pandas_5index_Int64Engine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_pad_indexer", 0); + + /* "pandas/index.pyx":347 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pad_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Int64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":348 + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * def get_backfill_indexer(self, other, limit=None): + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":347 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":346 + * return algos.is_monotonic_int64(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Int64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":350 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_backfill_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.Int64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_11Int64Engine_4get_backfill_indexer(((struct __pyx_obj_6pandas_5index_Int64Engine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_backfill_indexer", 0); + + /* "pandas/index.pyx":351 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Int64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":352 + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * cdef _check_type(self, object val): + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":351 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":350 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Int64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":354 + * limit=limit) + * + * cdef _check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * if util.is_bool_object(val): + */ + +static PyObject *__pyx_f_6pandas_5index_11Int64Engine__check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_hash_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_type", 0); + + /* "pandas/index.pyx":355 + * + * cdef _check_type(self, object val): + * hash(val) # <<<<<<<<<<<<<< + * if util.is_bool_object(val): + * raise KeyError(val) + */ + __pyx_t_1 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":356 + * cdef _check_type(self, object val): + * hash(val) + * if util.is_bool_object(val): # <<<<<<<<<<<<<< + * raise KeyError(val) + * elif util.is_float_object(val): + */ + __pyx_t_2 = (is_bool_object(__pyx_v_val) != 0); + if (__pyx_t_2) { + + /* "pandas/index.pyx":357 + * hash(val) + * if util.is_bool_object(val): + * raise KeyError(val) # <<<<<<<<<<<<<< + * elif util.is_float_object(val): + * raise KeyError(val) + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":358 + * if util.is_bool_object(val): + * raise KeyError(val) + * elif util.is_float_object(val): # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_2 = (is_float_object(__pyx_v_val) != 0); + if (__pyx_t_2) { + + /* "pandas/index.pyx":359 + * raise KeyError(val) + * elif util.is_float_object(val): + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * cdef _maybe_get_bool_indexer(self, object val): + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":354 + * limit=limit) + * + * cdef _check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * if util.is_bool_object(val): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Int64Engine._check_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":361 + * raise KeyError(val) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t, cast=True] indexer + */ + +static PyObject *__pyx_f_6pandas_5index_11Int64Engine__maybe_get_bool_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_val) { + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_values = 0; + int __pyx_v_count; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_ival; + int __pyx_v_last_true; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_4; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyArrayObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_get_bool_indexer", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + + /* "pandas/index.pyx":365 + * ndarray[uint8_t, cast=True] indexer + * ndarray[int64_t] values + * int count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, n + * int64_t ival + */ + __pyx_v_count = 0; + + /* "pandas/index.pyx":370 + * int last_true + * + * if not util.is_integer_object(val): # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_1 = ((!(is_integer_object(__pyx_v_val) != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":371 + * + * if not util.is_integer_object(val): + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * ival = val + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":373 + * raise KeyError(val) + * + * ival = val # <<<<<<<<<<<<<< + * + * values = self._get_index_values() + */ + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_4 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ival = __pyx_t_4; + + /* "pandas/index.pyx":375 + * ival = val + * + * values = self._get_index_values() # <<<<<<<<<<<<<< + * n = len(values) + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_Int64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":376 + * + * values = self._get_index_values() + * n = len(values) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool) + */ + __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_10; + + /* "pandas/index.pyx":378 + * n = len(values) + * + * result = np.empty(n, dtype=bool) # <<<<<<<<<<<<<< + * indexer = result.view(np.uint8) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/index.pyx":379 + * + * result = np.empty(n, dtype=bool) + * indexer = result.view(np.uint8) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/index.pyx":381 + * indexer = result.view(np.uint8) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if values[i] == val: + * count += 1 + */ + __pyx_t_10 = __pyx_v_n; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/index.pyx":382 + * + * for i in range(n): + * if values[i] == val: # <<<<<<<<<<<<<< + * count += 1 + * indexer[i] = 1 + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_11, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/index.pyx":383 + * for i in range(n): + * if values[i] == val: + * count += 1 # <<<<<<<<<<<<<< + * indexer[i] = 1 + * last_true = i + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/index.pyx":384 + * if values[i] == val: + * count += 1 + * indexer[i] = 1 # <<<<<<<<<<<<<< + * last_true = i + * else: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = 1; + + /* "pandas/index.pyx":385 + * count += 1 + * indexer[i] = 1 + * last_true = i # <<<<<<<<<<<<<< + * else: + * indexer[i] = 0 + */ + __pyx_v_last_true = __pyx_v_i; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/index.pyx":387 + * last_true = i + * else: + * indexer[i] = 0 # <<<<<<<<<<<<<< + * + * if count == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = 0; + } + __pyx_L6:; + } + + /* "pandas/index.pyx":389 + * indexer[i] = 0 + * + * if count == 0: # <<<<<<<<<<<<<< + * raise KeyError(val) + * if count == 1: + */ + __pyx_t_1 = ((__pyx_v_count == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":390 + * + * if count == 0: + * raise KeyError(val) # <<<<<<<<<<<<<< + * if count == 1: + * return last_true + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":391 + * if count == 0: + * raise KeyError(val) + * if count == 1: # <<<<<<<<<<<<<< + * return last_true + * + */ + __pyx_t_1 = ((__pyx_v_count == 1) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":392 + * raise KeyError(val) + * if count == 1: + * return last_true # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_last_true); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":394 + * return last_true + * + * return result # <<<<<<<<<<<<<< + * + * cdef class Float64Engine(IndexEngine): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/index.pyx":361 + * raise KeyError(val) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t, cast=True] indexer + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.index.Int64Engine._maybe_get_bool_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":398 + * cdef class Float64Engine(IndexEngine): + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.Float64HashTable(n) + * + */ + +static PyObject *__pyx_f_6pandas_5index_13Float64Engine__make_hash_table(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_n) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_hash_table", 0); + + /* "pandas/index.pyx":399 + * + * cdef _make_hash_table(self, n): + * return _hash.Float64HashTable(n) # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Float64HashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":398 + * cdef class Float64Engine(IndexEngine): + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.Float64HashTable(n) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Float64Engine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":401 + * return _hash.Float64HashTable(n) + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return algos.ensure_float64(self.vgetter()) + * + */ + +static PyObject *__pyx_f_6pandas_5index_13Float64Engine__get_index_values(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_index_values", 0); + + /* "pandas/index.pyx":402 + * + * cdef _get_index_values(self): + * return algos.ensure_float64(self.vgetter()) # <<<<<<<<<<<<<< + * + * cdef _maybe_get_bool_indexer(self, object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ensure_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.vgetter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":401 + * return _hash.Float64HashTable(n) + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return algos.ensure_float64(self.vgetter()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Float64Engine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":404 + * return algos.ensure_float64(self.vgetter()) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t] indexer + */ + +static PyObject *__pyx_f_6pandas_5index_13Float64Engine__maybe_get_bool_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_val) { + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_values = 0; + int __pyx_v_count; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_last_true; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_get_bool_indexer", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + + /* "pandas/index.pyx":408 + * ndarray[uint8_t] indexer + * ndarray[float64_t] values + * int count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, n + * int last_true + */ + __pyx_v_count = 0; + + /* "pandas/index.pyx":412 + * int last_true + * + * values = self._get_index_values() # <<<<<<<<<<<<<< + * n = len(values) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Float64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":413 + * + * values = self._get_index_values() + * n = len(values) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool) + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_7; + + /* "pandas/index.pyx":415 + * n = len(values) + * + * result = np.empty(n, dtype=bool) # <<<<<<<<<<<<<< + * indexer = result.view(np.uint8) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; + + /* "pandas/index.pyx":416 + * + * result = np.empty(n, dtype=bool) + * indexer = result.view(np.uint8) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/index.pyx":418 + * indexer = result.view(np.uint8) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if values[i] == val: + * count += 1 + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/index.pyx":419 + * + * for i in range(n): + * if values[i] == val: # <<<<<<<<<<<<<< + * count += 1 + * indexer[i] = 1 + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_14) { + + /* "pandas/index.pyx":420 + * for i in range(n): + * if values[i] == val: + * count += 1 # <<<<<<<<<<<<<< + * indexer[i] = 1 + * last_true = i + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/index.pyx":421 + * if values[i] == val: + * count += 1 + * indexer[i] = 1 # <<<<<<<<<<<<<< + * last_true = i + * else: + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides) = 1; + + /* "pandas/index.pyx":422 + * count += 1 + * indexer[i] = 1 + * last_true = i # <<<<<<<<<<<<<< + * else: + * indexer[i] = 0 + */ + __pyx_v_last_true = __pyx_v_i; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/index.pyx":424 + * last_true = i + * else: + * indexer[i] = 0 # <<<<<<<<<<<<<< + * + * if count == 0: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = 0; + } + __pyx_L5:; + } + + /* "pandas/index.pyx":426 + * indexer[i] = 0 + * + * if count == 0: # <<<<<<<<<<<<<< + * raise KeyError(val) + * if count == 1: + */ + __pyx_t_14 = ((__pyx_v_count == 0) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":427 + * + * if count == 0: + * raise KeyError(val) # <<<<<<<<<<<<<< + * if count == 1: + * return last_true + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":428 + * if count == 0: + * raise KeyError(val) + * if count == 1: # <<<<<<<<<<<<<< + * return last_true + * + */ + __pyx_t_14 = ((__pyx_v_count == 1) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":429 + * raise KeyError(val) + * if count == 1: + * return last_true # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_last_true); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":431 + * return last_true + * + * return result # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/index.pyx":404 + * return algos.ensure_float64(self.vgetter()) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t] indexer + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.index.Float64Engine._maybe_get_bool_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":433 + * return result + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_float64(values) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_13Float64Engine__call_monotonic(((struct __pyx_obj_6pandas_5index_Float64Engine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":434 + * + * def _call_monotonic(self, values): + * return algos.is_monotonic_float64(values) # <<<<<<<<<<<<<< + * + * def get_pad_indexer(self, other, limit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_monotonic_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":433 + * return result + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_float64(values) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Float64Engine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":436 + * return algos.is_monotonic_float64(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_float64(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pad_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.Float64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_13Float64Engine_2get_pad_indexer(((struct __pyx_obj_6pandas_5index_Float64Engine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_pad_indexer", 0); + + /* "pandas/index.pyx":437 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_float64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pad_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Float64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":438 + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_float64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * def get_backfill_indexer(self, other, limit=None): + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":437 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_float64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":436 + * return algos.is_monotonic_float64(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_float64(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Float64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":440 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_float64(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_backfill_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.Float64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_13Float64Engine_4get_backfill_indexer(((struct __pyx_obj_6pandas_5index_Float64Engine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_backfill_indexer", 0); + + /* "pandas/index.pyx":441 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_float64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Float64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":442 + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_float64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":441 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_float64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":440 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_float64(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Float64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":445 + * + * + * cdef Py_ssize_t _bin_search(ndarray values, object val) except -1: # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t mid, lo = 0, hi = len(values) - 1 + */ + +static Py_ssize_t __pyx_f_6pandas_5index__bin_search(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val) { + Py_ssize_t __pyx_v_mid; + Py_ssize_t __pyx_v_lo; + Py_ssize_t __pyx_v_hi; + PyObject *__pyx_v_pval = 0; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_bin_search", 0); + + /* "pandas/index.pyx":447 + * cdef Py_ssize_t _bin_search(ndarray values, object val) except -1: + * cdef: + * Py_ssize_t mid, lo = 0, hi = len(values) - 1 # <<<<<<<<<<<<<< + * object pval + * + */ + __pyx_v_lo = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_hi = (__pyx_t_1 - 1); + + /* "pandas/index.pyx":450 + * object pval + * + * if hi >= 0 and val > util.get_value_at(values, hi): # <<<<<<<<<<<<<< + * return len(values) + * + */ + __pyx_t_2 = (__pyx_v_hi >= 0); + if (__pyx_t_2) { + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_hi); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_f_4util_get_value_at(__pyx_v_values, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/index.pyx":451 + * + * if hi >= 0 and val > util.get_value_at(values, hi): + * return len(values) # <<<<<<<<<<<<<< + * + * while lo < hi: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_1; + goto __pyx_L0; + } + + /* "pandas/index.pyx":453 + * return len(values) + * + * while lo < hi: # <<<<<<<<<<<<<< + * mid = (lo + hi) // 2 + * pval = util.get_value_at(values, mid) + */ + while (1) { + __pyx_t_6 = ((__pyx_v_lo < __pyx_v_hi) != 0); + if (!__pyx_t_6) break; + + /* "pandas/index.pyx":454 + * + * while lo < hi: + * mid = (lo + hi) // 2 # <<<<<<<<<<<<<< + * pval = util.get_value_at(values, mid) + * if val < pval: + */ + __pyx_v_mid = __Pyx_div_Py_ssize_t((__pyx_v_lo + __pyx_v_hi), 2); + + /* "pandas/index.pyx":455 + * while lo < hi: + * mid = (lo + hi) // 2 + * pval = util.get_value_at(values, mid) # <<<<<<<<<<<<<< + * if val < pval: + * hi = mid + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_mid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_f_4util_get_value_at(__pyx_v_values, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_pval, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/index.pyx":456 + * mid = (lo + hi) // 2 + * pval = util.get_value_at(values, mid) + * if val < pval: # <<<<<<<<<<<<<< + * hi = mid + * elif val > pval: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_pval, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "pandas/index.pyx":457 + * pval = util.get_value_at(values, mid) + * if val < pval: + * hi = mid # <<<<<<<<<<<<<< + * elif val > pval: + * lo = mid + 1 + */ + __pyx_v_hi = __pyx_v_mid; + goto __pyx_L6; + } + + /* "pandas/index.pyx":458 + * if val < pval: + * hi = mid + * elif val > pval: # <<<<<<<<<<<<<< + * lo = mid + 1 + * else: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_pval, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "pandas/index.pyx":459 + * hi = mid + * elif val > pval: + * lo = mid + 1 # <<<<<<<<<<<<<< + * else: + * while mid > 0 and val == util.get_value_at(values, mid - 1): + */ + __pyx_v_lo = (__pyx_v_mid + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/index.pyx":461 + * lo = mid + 1 + * else: + * while mid > 0 and val == util.get_value_at(values, mid - 1): # <<<<<<<<<<<<<< + * mid -= 1 + * return mid + */ + while (1) { + __pyx_t_6 = (__pyx_v_mid > 0); + if (__pyx_t_6) { + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_mid - 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_values, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (!__pyx_t_5) break; + + /* "pandas/index.pyx":462 + * else: + * while mid > 0 and val == util.get_value_at(values, mid - 1): + * mid -= 1 # <<<<<<<<<<<<<< + * return mid + * + */ + __pyx_v_mid = (__pyx_v_mid - 1); + } + + /* "pandas/index.pyx":463 + * while mid > 0 and val == util.get_value_at(values, mid - 1): + * mid -= 1 + * return mid # <<<<<<<<<<<<<< + * + * if val <= util.get_value_at(values, mid): + */ + __pyx_r = __pyx_v_mid; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/index.pyx":465 + * return mid + * + * if val <= util.get_value_at(values, mid): # <<<<<<<<<<<<<< + * return mid + * else: + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_mid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_values, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "pandas/index.pyx":466 + * + * if val <= util.get_value_at(values, mid): + * return mid # <<<<<<<<<<<<<< + * else: + * return mid + 1 + */ + __pyx_r = __pyx_v_mid; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/index.pyx":468 + * return mid + * else: + * return mid + 1 # <<<<<<<<<<<<<< + * + * _pad_functions = { + */ + __pyx_r = (__pyx_v_mid + 1); + goto __pyx_L0; + } + + /* "pandas/index.pyx":445 + * + * + * cdef Py_ssize_t _bin_search(ndarray values, object val) except -1: # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t mid, lo = 0, hi = len(values) - 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index._bin_search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_pval); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":484 + * cdef class ObjectEngine(IndexEngine): + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.PyObjectHashTable(n) + * + */ + +static PyObject *__pyx_f_6pandas_5index_12ObjectEngine__make_hash_table(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_n) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_hash_table", 0); + + /* "pandas/index.pyx":485 + * + * cdef _make_hash_table(self, n): + * return _hash.PyObjectHashTable(n) # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PyObjectHashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":484 + * cdef class ObjectEngine(IndexEngine): + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.PyObjectHashTable(n) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.ObjectEngine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":487 + * return _hash.PyObjectHashTable(n) + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_object(values) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_12ObjectEngine__call_monotonic(((struct __pyx_obj_6pandas_5index_ObjectEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":488 + * + * def _call_monotonic(self, values): + * return algos.is_monotonic_object(values) # <<<<<<<<<<<<<< + * + * def get_pad_indexer(self, other, limit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_monotonic_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":487 + * return _hash.PyObjectHashTable(n) + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_object(values) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.ObjectEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":490 + * return algos.is_monotonic_object(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_object(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pad_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.ObjectEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_12ObjectEngine_2get_pad_indexer(((struct __pyx_obj_6pandas_5index_ObjectEngine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_pad_indexer", 0); + + /* "pandas/index.pyx":491 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_object(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pad_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_ObjectEngine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":492 + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_object(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * def get_backfill_indexer(self, other, limit=None): + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":491 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_object(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":490 + * return algos.is_monotonic_object(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_object(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.ObjectEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":494 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_object(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_backfill_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.ObjectEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_12ObjectEngine_4get_backfill_indexer(((struct __pyx_obj_6pandas_5index_ObjectEngine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_backfill_indexer", 0); + + /* "pandas/index.pyx":495 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_object(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_ObjectEngine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":496 + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_object(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":495 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_object(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":494 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_object(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.ObjectEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":501 + * cdef class DatetimeEngine(Int64Engine): + * + * def __contains__(self, object val): # <<<<<<<<<<<<<< + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5index_14DatetimeEngine_1__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static int __pyx_pw_6pandas_5index_14DatetimeEngine_1__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine___contains__(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5index_14DatetimeEngine___contains__(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_conv = NULL; + PyObject *__pyx_v_loc = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + + /* "pandas/index.pyx":502 + * + * def __contains__(self, object val): + * if self.over_size_threshold and self.is_monotonic: # <<<<<<<<<<<<<< + * if not self.is_unique: + * return self._get_loc_duplicates(val) + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.over_size_threshold; + if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monotonic); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_1; + } + if (__pyx_t_4) { + + /* "pandas/index.pyx":503 + * def __contains__(self, object val): + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_unique); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = ((!__pyx_t_4) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":504 + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * values = self._get_index_values() + * conv = _to_i8(val) + */ + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/index.pyx":505 + * if not self.is_unique: + * return self._get_loc_duplicates(val) + * values = self._get_index_values() # <<<<<<<<<<<<<< + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_values = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/index.pyx":506 + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + * conv = _to_i8(val) # <<<<<<<<<<<<<< + * loc = values.searchsorted(conv, side='left') + * return util.get_value_at(values, loc) == conv + */ + __pyx_t_2 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_conv = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/index.pyx":507 + * values = self._get_index_values() + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') # <<<<<<<<<<<<<< + * return util.get_value_at(values, loc) == conv + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_conv); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_conv); + __Pyx_GIVEREF(__pyx_v_conv); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_side, __pyx_n_s_left) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_loc = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/index.pyx":508 + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') + * return util.get_value_at(values, loc) == conv # <<<<<<<<<<<<<< + * + * self._ensure_mapping_populated() + */ + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_v_values), __pyx_v_loc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_conv, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/index.pyx":510 + * return util.get_value_at(values, loc) == conv + * + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * return _to_i8(val) in self.mapping + * + */ + __pyx_t_7 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":511 + * + * self._ensure_mapping_populated() + * return _to_i8(val) in self.mapping # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ + __pyx_t_7 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_t_7, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "pandas/index.pyx":501 + * cdef class DatetimeEngine(Int64Engine): + * + * def __contains__(self, object val): # <<<<<<<<<<<<<< + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_conv); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":513 + * return _to_i8(val) in self.mapping + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return self.vgetter().view('i8') + * + */ + +static PyObject *__pyx_f_6pandas_5index_14DatetimeEngine__get_index_values(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_index_values", 0); + + /* "pandas/index.pyx":514 + * + * cdef _get_index_values(self): + * return self.vgetter().view('i8') # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.__pyx_base.vgetter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":513 + * return _to_i8(val) in self.mapping + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return self.vgetter().view('i8') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.DatetimeEngine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":516 + * return self.vgetter().view('i8') + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_int64(values) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_3_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_3_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_2_call_monotonic(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_2_call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":517 + * + * def _call_monotonic(self, values): + * return algos.is_monotonic_int64(values) # <<<<<<<<<<<<<< + * + * cpdef get_loc(self, object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_monotonic_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":516 + * return self.vgetter().view('i8') + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_int64(values) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.DatetimeEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":519 + * return algos.is_monotonic_int64(values) + * + * cpdef get_loc(self, object val): # <<<<<<<<<<<<<< + * if is_definitely_invalid_key(val): + * raise TypeError + */ + +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_14DatetimeEngine_get_loc(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_conv = NULL; + PyObject *__pyx_v_loc = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_loc", 0); + __Pyx_INCREF(__pyx_v_val); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/index.pyx":520 + * + * cpdef get_loc(self, object val): + * if is_definitely_invalid_key(val): # <<<<<<<<<<<<<< + * raise TypeError + * + */ + __pyx_t_1 = __pyx_f_6pandas_5index_is_definitely_invalid_key(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "pandas/index.pyx":521 + * cpdef get_loc(self, object val): + * if is_definitely_invalid_key(val): + * raise TypeError # <<<<<<<<<<<<<< + * + * # Welcome to the spaghetti factory + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":525 + * # Welcome to the spaghetti factory + * + * if self.over_size_threshold and self.is_monotonic: # <<<<<<<<<<<<<< + * if not self.is_unique: + * val = _to_i8(val) + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.over_size_threshold; + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/index.pyx":526 + * + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: # <<<<<<<<<<<<<< + * val = _to_i8(val) + * return self._get_loc_duplicates(val) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = ((!__pyx_t_6) != 0); + if (__pyx_t_4) { + + /* "pandas/index.pyx":527 + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + * val = _to_i8(val) # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + */ + __pyx_t_1 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":528 + * if not self.is_unique: + * val = _to_i8(val) + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * values = self._get_index_values() + * conv = _to_i8(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":529 + * val = _to_i8(val) + * return self._get_loc_duplicates(val) + * values = self._get_index_values() # <<<<<<<<<<<<<< + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":530 + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + * conv = _to_i8(val) # <<<<<<<<<<<<<< + * loc = values.searchsorted(conv, side='left') + * if loc == len(values) or util.get_value_at(values, loc) != conv: + */ + __pyx_t_1 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_conv = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":531 + * values = self._get_index_values() + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') # <<<<<<<<<<<<<< + * if loc == len(values) or util.get_value_at(values, loc) != conv: + * raise KeyError(val) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_conv); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_conv); + __Pyx_GIVEREF(__pyx_v_conv); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_side, __pyx_n_s_left) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_loc = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/index.pyx":532 + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') + * if loc == len(values) or util.get_value_at(values, loc) != conv: # <<<<<<<<<<<<<< + * raise KeyError(val) + * return loc + */ + __pyx_t_8 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_loc, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_4) { + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_v_values), __pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_v_conv, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_4; + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":533 + * loc = values.searchsorted(conv, side='left') + * if loc == len(values) or util.get_value_at(values, loc) != conv: + * raise KeyError(val) # <<<<<<<<<<<<<< + * return loc + * + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":534 + * if loc == len(values) or util.get_value_at(values, loc) != conv: + * raise KeyError(val) + * return loc # <<<<<<<<<<<<<< + * + * self._ensure_mapping_populated() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_loc); + __pyx_r = __pyx_v_loc; + goto __pyx_L0; + } + + /* "pandas/index.pyx":536 + * return loc + * + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * if not self.unique: + * val = _to_i8(val) + */ + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":537 + * + * self._ensure_mapping_populated() + * if not self.unique: # <<<<<<<<<<<<<< + * val = _to_i8(val) + * return self._get_loc_duplicates(val) + */ + __pyx_t_5 = ((!(__pyx_v_self->__pyx_base.__pyx_base.unique != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/index.pyx":538 + * self._ensure_mapping_populated() + * if not self.unique: + * val = _to_i8(val) # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * + */ + __pyx_t_2 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/index.pyx":539 + * if not self.unique: + * val = _to_i8(val) + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":541 + * return self._get_loc_duplicates(val) + * + * try: # <<<<<<<<<<<<<< + * return self.mapping.get_item(val.value) + * except KeyError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "pandas/index.pyx":542 + * + * try: + * return self.mapping.get_item(val.value) # <<<<<<<<<<<<<< + * except KeyError: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), __pyx_n_s_get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L12_try_return; + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":543 + * try: + * return self.mapping.get_item(val.value) + * except KeyError: # <<<<<<<<<<<<<< + * raise KeyError(val) + * except AttributeError: + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/index.pyx":544 + * return self.mapping.get_item(val.value) + * except KeyError: + * raise KeyError(val) # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_13, 0, 0, 0); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L9_exception_handled; + } + + /* "pandas/index.pyx":545 + * except KeyError: + * raise KeyError(val) + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_12) { + PyErr_Restore(0,0,0); + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L1_error; + __pyx_L12_try_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L0; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L15_try_end:; + } + + /* "pandas/index.pyx":548 + * pass + * + * try: # <<<<<<<<<<<<<< + * val = _to_i8(val) + * return self.mapping.get_item(val) + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/index.pyx":549 + * + * try: + * val = _to_i8(val) # <<<<<<<<<<<<<< + * return self.mapping.get_item(val) + * except TypeError: + */ + __pyx_t_2 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/index.pyx":550 + * try: + * val = _to_i8(val) + * return self.mapping.get_item(val) # <<<<<<<<<<<<<< + * except TypeError: + * self._date_check_type(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), __pyx_n_s_get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L22_try_return; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":551 + * val = _to_i8(val) + * return self.mapping.get_item(val) + * except TypeError: # <<<<<<<<<<<<<< + * self._date_check_type(val) + * raise KeyError(val) + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/index.pyx":552 + * return self.mapping.get_item(val) + * except TypeError: + * self._date_check_type(val) # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_13 = __pyx_f_6pandas_5index_14DatetimeEngine__date_check_type(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/index.pyx":553 + * except TypeError: + * self._date_check_type(val) + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * cdef inline _date_check_type(self, object val): + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L19_exception_handled; + } + goto __pyx_L20_except_error; + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L22_try_return:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L0; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + __pyx_L25_try_end:; + } + + /* "pandas/index.pyx":519 + * return algos.is_monotonic_int64(values) + * + * cpdef get_loc(self, object val): # <<<<<<<<<<<<<< + * if is_definitely_invalid_key(val): + * raise TypeError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_conv); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_loc (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_4get_loc(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_4get_loc(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_loc", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.get_loc(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":555 + * raise KeyError(val) + * + * cdef inline _date_check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * if not util.is_integer_object(val): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_14DatetimeEngine__date_check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_hash_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_check_type", 0); + + /* "pandas/index.pyx":556 + * + * cdef inline _date_check_type(self, object val): + * hash(val) # <<<<<<<<<<<<<< + * if not util.is_integer_object(val): + * raise KeyError(val) + */ + __pyx_t_1 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":557 + * cdef inline _date_check_type(self, object val): + * hash(val) + * if not util.is_integer_object(val): # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_2 = ((!(is_integer_object(__pyx_v_val) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/index.pyx":558 + * hash(val) + * if not util.is_integer_object(val): + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_indexer(self, values): + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":555 + * raise KeyError(val) + * + * cdef inline _date_check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * if not util.is_integer_object(val): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.DatetimeEngine._date_check_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":560 + * raise KeyError(val) + * + * def get_indexer(self, values): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_7get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_7get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indexer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_6get_indexer(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_6get_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_indexer", 0); + __Pyx_INCREF(__pyx_v_values); + + /* "pandas/index.pyx":561 + * + * def get_indexer(self, values): + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":562 + * def get_indexer(self, values): + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': # <<<<<<<<<<<<<< + * return np.repeat(-1, len(values)).astype('i4') + * values = np.asarray(values).view('i8') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_M8_ns, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/index.pyx":563 + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') # <<<<<<<<<<<<<< + * values = np.asarray(values).view('i8') + * return self.mapping.lookup(values) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":564 + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') + * values = np.asarray(values).view('i8') # <<<<<<<<<<<<<< + * return self.mapping.lookup(values) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":565 + * return np.repeat(-1, len(values)).astype('i4') + * values = np.asarray(values).view('i8') + * return self.mapping.lookup(values) # <<<<<<<<<<<<<< + * + * def get_pad_indexer(self, other, limit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":560 + * raise KeyError(val) + * + * def get_indexer(self, values): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":567 + * return self.mapping.lookup(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_9get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_9get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pad_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_8get_pad_indexer(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_8get_pad_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_pad_indexer", 0); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/index.pyx":568 + * + * def get_pad_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': # <<<<<<<<<<<<<< + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_M8_ns, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/index.pyx":569 + * def get_pad_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') # <<<<<<<<<<<<<< + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_Length(__pyx_v_other); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":570 + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') # <<<<<<<<<<<<<< + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":571 + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pad_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/index.pyx":572 + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * def get_backfill_indexer(self, other, limit=None): + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":571 + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":567 + * return self.mapping.lookup(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":574 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_11get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_11get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_backfill_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_10get_backfill_indexer(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_10get_backfill_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_backfill_indexer", 0); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/index.pyx":575 + * + * def get_backfill_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': # <<<<<<<<<<<<<< + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_M8_ns, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/index.pyx":576 + * def get_backfill_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') # <<<<<<<<<<<<<< + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_Length(__pyx_v_other); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":577 + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') # <<<<<<<<<<<<<< + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":578 + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_backfill_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/index.pyx":579 + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":578 + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":574 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":582 + * + * + * cpdef convert_scalar(ndarray arr, object value): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * if isinstance(value,np.ndarray): + */ + +static PyObject *__pyx_pw_6pandas_5index_5convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_convert_scalar(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_scalar", 0); + + /* "pandas/index.pyx":583 + * + * cpdef convert_scalar(ndarray arr, object value): + * if arr.descr.type_num == NPY_DATETIME: # <<<<<<<<<<<<<< + * if isinstance(value,np.ndarray): + * pass + */ + __pyx_t_1 = ((__pyx_v_arr->descr->type_num == NPY_DATETIME) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":584 + * cpdef convert_scalar(ndarray arr, object value): + * if arr.descr.type_num == NPY_DATETIME: + * if isinstance(value,np.ndarray): # <<<<<<<<<<<<<< + * pass + * elif isinstance(value, Timestamp): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_value, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + goto __pyx_L4; + } + + /* "pandas/index.pyx":586 + * if isinstance(value,np.ndarray): + * pass + * elif isinstance(value, Timestamp): # <<<<<<<<<<<<<< + * return value.value + * elif value is None or value != value: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_IsInstance(__pyx_v_value, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":587 + * pass + * elif isinstance(value, Timestamp): + * return value.value # <<<<<<<<<<<<<< + * elif value is None or value != value: + * return iNaT + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":588 + * elif isinstance(value, Timestamp): + * return value.value + * elif value is None or value != value: # <<<<<<<<<<<<<< + * return iNaT + * else: + */ + __pyx_t_1 = (__pyx_v_value == Py_None); + if (!__pyx_t_1) { + __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_v_value, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":589 + * return value.value + * elif value is None or value != value: + * return iNaT # <<<<<<<<<<<<<< + * else: + * return Timestamp(value).value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5index_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/index.pyx":591 + * return iNaT + * else: + * return Timestamp(value).value # <<<<<<<<<<<<<< + * + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":593 + * return Timestamp(value).value + * + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): # <<<<<<<<<<<<<< + * if util.is_float_object(value) and value != value: + * raise ValueError('Cannot assign nan to integer series') + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_3 = 0; + __pyx_t_7 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_6, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":594 + * + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): + * if util.is_float_object(value) and value != value: # <<<<<<<<<<<<<< + * raise ValueError('Cannot assign nan to integer series') + * + */ + if ((is_float_object(__pyx_v_value) != 0)) { + __pyx_t_2 = PyObject_RichCompare(__pyx_v_value, __pyx_v_value, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __pyx_t_1; + } else { + __pyx_t_5 = (is_float_object(__pyx_v_value) != 0); + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":595 + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): + * if util.is_float_object(value) and value != value: + * raise ValueError('Cannot assign nan to integer series') # <<<<<<<<<<<<<< + * + * return value + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/index.pyx":597 + * raise ValueError('Cannot assign nan to integer series') + * + * return value # <<<<<<<<<<<<<< + * + * cdef inline _to_i8(object val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + goto __pyx_L0; + + /* "pandas/index.pyx":582 + * + * + * cpdef convert_scalar(ndarray arr, object value): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * if isinstance(value,np.ndarray): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.index.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_5convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_5convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_scalar (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_value,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("convert_scalar", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert_scalar") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_value = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("convert_scalar", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_4convert_scalar(__pyx_self, __pyx_v_arr, __pyx_v_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_4convert_scalar(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_scalar", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5index_convert_scalar(__pyx_v_arr, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":599 + * return value + * + * cdef inline _to_i8(object val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * try: + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index__to_i8(PyObject *__pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_v_tzinfo = NULL; + PyObject *__pyx_v_ival = NULL; + PyObject *__pyx_v_offset = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_to_i8", 0); + + /* "pandas/index.pyx":601 + * cdef inline _to_i8(object val): + * cdef pandas_datetimestruct dts + * try: # <<<<<<<<<<<<<< + * return val.value + * except AttributeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/index.pyx":602 + * cdef pandas_datetimestruct dts + * try: + * return val.value # <<<<<<<<<<<<<< + * except AttributeError: + * if util.is_datetime64_object(val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/index.pyx":603 + * try: + * return val.value + * except AttributeError: # <<<<<<<<<<<<<< + * if util.is_datetime64_object(val): + * return get_datetime64_value(val) + */ + __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_5) { + __Pyx_AddTraceback("pandas.index._to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/index.pyx":604 + * return val.value + * except AttributeError: + * if util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * return get_datetime64_value(val) + * elif PyDateTime_Check(val): + */ + __pyx_t_8 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_8) { + + /* "pandas/index.pyx":605 + * except AttributeError: + * if util.is_datetime64_object(val): + * return get_datetime64_value(val) # <<<<<<<<<<<<<< + * elif PyDateTime_Check(val): + * tzinfo = getattr(val, 'tzinfo', None) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(get_datetime64_value(__pyx_v_val)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + } + + /* "pandas/index.pyx":606 + * if util.is_datetime64_object(val): + * return get_datetime64_value(val) + * elif PyDateTime_Check(val): # <<<<<<<<<<<<<< + * tzinfo = getattr(val, 'tzinfo', None) + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. + */ + __pyx_t_8 = (PyDateTime_Check(__pyx_v_val) != 0); + if (__pyx_t_8) { + + /* "pandas/index.pyx":607 + * return get_datetime64_value(val) + * elif PyDateTime_Check(val): + * tzinfo = getattr(val, 'tzinfo', None) # <<<<<<<<<<<<<< + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. + * if tzinfo is not None and not _is_utc(tzinfo): + */ + __pyx_t_9 = __Pyx_GetAttr3(__pyx_v_val, __pyx_n_s_tzinfo, Py_None); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_tzinfo = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/index.pyx":608 + * elif PyDateTime_Check(val): + * tzinfo = getattr(val, 'tzinfo', None) + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. # <<<<<<<<<<<<<< + * if tzinfo is not None and not _is_utc(tzinfo): + * offset = tslib._get_utcoffset(tzinfo, val) + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_f_8datetime__pydatetime_to_dts(__pyx_v_val, (&__pyx_v_dts))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_ival = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/index.pyx":609 + * tzinfo = getattr(val, 'tzinfo', None) + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. + * if tzinfo is not None and not _is_utc(tzinfo): # <<<<<<<<<<<<<< + * offset = tslib._get_utcoffset(tzinfo, val) + * ival -= tslib._delta_to_nanoseconds(offset) + */ + __pyx_t_8 = (__pyx_v_tzinfo != Py_None); + if ((__pyx_t_8 != 0)) { + __pyx_t_10 = ((!(__pyx_f_6pandas_5index__is_utc(__pyx_v_tzinfo) != 0)) != 0); + __pyx_t_11 = __pyx_t_10; + } else { + __pyx_t_11 = (__pyx_t_8 != 0); + } + if (__pyx_t_11) { + + /* "pandas/index.pyx":610 + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. + * if tzinfo is not None and not _is_utc(tzinfo): + * offset = tslib._get_utcoffset(tzinfo, val) # <<<<<<<<<<<<<< + * ival -= tslib._delta_to_nanoseconds(offset) + * return ival + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_get_utcoffset); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_tzinfo); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_tzinfo); + __Pyx_GIVEREF(__pyx_v_tzinfo); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_offset = __pyx_t_13; + __pyx_t_13 = 0; + + /* "pandas/index.pyx":611 + * if tzinfo is not None and not _is_utc(tzinfo): + * offset = tslib._get_utcoffset(tzinfo, val) + * ival -= tslib._delta_to_nanoseconds(offset) # <<<<<<<<<<<<<< + * return ival + * return val + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_tslib); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_offset); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_offset); + __Pyx_GIVEREF(__pyx_v_offset); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_InPlaceSubtract(__pyx_v_ival, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_ival, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/index.pyx":612 + * offset = tslib._get_utcoffset(tzinfo, val) + * ival -= tslib._delta_to_nanoseconds(offset) + * return ival # <<<<<<<<<<<<<< + * return val + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ival); + __pyx_r = __pyx_v_ival; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + } + + /* "pandas/index.pyx":613 + * ival -= tslib._delta_to_nanoseconds(offset) + * return ival + * return val # <<<<<<<<<<<<<< + * + * cdef inline bint _is_utc(object tz): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_val); + __pyx_r = __pyx_v_val; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/index.pyx":599 + * return value + * + * cdef inline _to_i8(object val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.index._to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tzinfo); + __Pyx_XDECREF(__pyx_v_ival); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":615 + * return val + * + * cdef inline bint _is_utc(object tz): # <<<<<<<<<<<<<< + * return tz is UTC or isinstance(tz, _du_utc) + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5index__is_utc(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_utc", 0); + + /* "pandas/index.pyx":616 + * + * cdef inline bint _is_utc(object tz): + * return tz is UTC or isinstance(tz, _du_utc) # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UTC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_v_tz == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_du_utc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_r = __pyx_t_4; + goto __pyx_L0; + + /* "pandas/index.pyx":615 + * return val + * + * cdef inline bint _is_utc(object tz): # <<<<<<<<<<<<<< + * return tz is UTC or isinstance(tz, _du_utc) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("pandas.index._is_utc", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_result; + char *__pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_to_dts", 0); + __Pyx_INCREF(__pyx_v_val); + + /* "datetime.pxd":130 + * cdef char *tmp + * + * if PyUnicode_Check(val): # <<<<<<<<<<<<<< + * val = PyUnicode_AsASCIIString(val); + * + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":131 + * + * if PyUnicode_Check(val): + * val = PyUnicode_AsASCIIString(val); # <<<<<<<<<<<<<< + * + * tmp = val + */ + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "datetime.pxd":133 + * val = PyUnicode_AsASCIIString(val); + * + * tmp = val # <<<<<<<<<<<<<< + * result = _cstring_to_dts(tmp, len(val), dts) + * + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmp = __pyx_t_3; + + /* "datetime.pxd":134 + * + * tmp = val + * result = _cstring_to_dts(tmp, len(val), dts) # <<<<<<<<<<<<<< + * + * if result == -1: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts); + + /* "datetime.pxd":136 + * result = _cstring_to_dts(tmp, len(val), dts) + * + * if result == -1: # <<<<<<<<<<<<<< + * raise ValueError('Unable to parse %s' % str(val)) + * + */ + __pyx_t_1 = ((__pyx_v_result == -1) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":137 + * + * if result == -1: + * raise ValueError('Unable to parse %s' % str(val)) # <<<<<<<<<<<<<< + * + * cdef inline int _cstring_to_dts(char *val, int length, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("datetime._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts) { + npy_bool __pyx_v_islocal; + npy_bool __pyx_v_special; + PANDAS_DATETIMEUNIT __pyx_v_out_bestunit; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cstring_to_dts", 0); + + /* "datetime.pxd":146 + * int result + * + * result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns, # <<<<<<<<<<<<<< + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + */ + __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special)); + + /* "datetime.pxd":149 + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime64_to_datetime", 0); + + /* "datetime.pxd":154 + * cdef inline object _datetime64_to_datetime(int64_t val): + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * return _dts_to_pydatetime(&dts) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "datetime.pxd":155 + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * return _dts_to_pydatetime(&dts) # <<<<<<<<<<<<<< + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dts_to_pydatetime", 0); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_XDECREF(__pyx_r); + + /* "datetime.pxd":160 + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + */ + __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0); + + /* "datetime.pxd":163 + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":164 + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":165 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":166 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) # <<<<<<<<<<<<<< + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + */ + __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val); + + /* "datetime.pxd":167 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) # <<<<<<<<<<<<<< + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + */ + __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val); + + /* "datetime.pxd":168 + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) # <<<<<<<<<<<<<< + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + */ + __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val); + + /* "datetime.pxd":169 + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val); + + /* "datetime.pxd":170 + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":171 + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _dtlike_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + npy_int64 __pyx_t_2; + npy_int32 __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dtlike_to_datetime64", 0); + + /* "datetime.pxd":175 + * cdef inline int64_t _dtlike_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = val.year # <<<<<<<<<<<<<< + * dts.month = val.month + * dts.day = val.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->year = __pyx_t_2; + + /* "datetime.pxd":176 + * pandas_datetimestruct *dts): + * dts.year = val.year + * dts.month = val.month # <<<<<<<<<<<<<< + * dts.day = val.day + * dts.hour = val.hour + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->month = __pyx_t_3; + + /* "datetime.pxd":177 + * dts.year = val.year + * dts.month = val.month + * dts.day = val.day # <<<<<<<<<<<<<< + * dts.hour = val.hour + * dts.min = val.minute + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->day = __pyx_t_3; + + /* "datetime.pxd":178 + * dts.month = val.month + * dts.day = val.day + * dts.hour = val.hour # <<<<<<<<<<<<<< + * dts.min = val.minute + * dts.sec = val.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->hour = __pyx_t_3; + + /* "datetime.pxd":179 + * dts.day = val.day + * dts.hour = val.hour + * dts.min = val.minute # <<<<<<<<<<<<<< + * dts.sec = val.second + * dts.us = val.microsecond + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->min = __pyx_t_3; + + /* "datetime.pxd":180 + * dts.hour = val.hour + * dts.min = val.minute + * dts.sec = val.second # <<<<<<<<<<<<<< + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->sec = __pyx_t_3; + + /* "datetime.pxd":181 + * dts.min = val.minute + * dts.sec = val.second + * dts.us = val.microsecond # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->us = __pyx_t_3; + + /* "datetime.pxd":182 + * dts.sec = val.second + * dts.us = val.microsecond + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":183 + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _date_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_to_datetime64", 0); + + /* "datetime.pxd":187 + * cdef inline int64_t _date_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":188 + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":189 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":190 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->hour = 0; + __pyx_v_dts->min = 0; + __pyx_v_dts->sec = 0; + __pyx_v_dts->us = 0; + + /* "datetime.pxd":191 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":192 + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6pandas_5index_IndexEngine __pyx_vtable_6pandas_5index_IndexEngine; + +static PyObject *__pyx_tp_new_6pandas_5index_IndexEngine(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_5index_IndexEngine *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_IndexEngine *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_5index_IndexEngine; + p->vgetter = Py_None; Py_INCREF(Py_None); + p->mapping = ((struct __pyx_obj_6pandas_9hashtable_HashTable *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5index_IndexEngine(PyObject *o) { + struct __pyx_obj_6pandas_5index_IndexEngine *p = (struct __pyx_obj_6pandas_5index_IndexEngine *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->vgetter); + Py_CLEAR(p->mapping); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_5index_IndexEngine(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5index_IndexEngine *p = (struct __pyx_obj_6pandas_5index_IndexEngine *)o; + if (p->vgetter) { + e = (*v)(p->vgetter, a); if (e) return e; + } + if (p->mapping) { + e = (*v)(((PyObject*)p->mapping), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5index_IndexEngine(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5index_IndexEngine *p = (struct __pyx_obj_6pandas_5index_IndexEngine *)o; + tmp = ((PyObject*)p->vgetter); + p->vgetter = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->mapping); + p->mapping = ((struct __pyx_obj_6pandas_9hashtable_HashTable *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_is_unique(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_9is_unique_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_is_monotonic(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_12is_monotonic_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_vgetter(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_7vgetter_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_mapping(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_7mapping_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_over_size_threshold(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_19over_size_threshold_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_5index_IndexEngine[] = { + {__Pyx_NAMESTR("get_value"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_5get_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5index_11IndexEngine_4get_value)}, + {__Pyx_NAMESTR("set_value"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_7set_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5index_11IndexEngine_6set_value)}, + {__Pyx_NAMESTR("get_loc"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_9get_loc, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_11_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("clear_mapping"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_13clear_mapping, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_15get_indexer, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_indexer_non_unique"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_17get_indexer_non_unique, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5index_11IndexEngine_16get_indexer_non_unique)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_5index_IndexEngine[] = { + {(char *)"is_unique", __pyx_getprop_6pandas_5index_11IndexEngine_is_unique, 0, 0, 0}, + {(char *)"is_monotonic", __pyx_getprop_6pandas_5index_11IndexEngine_is_monotonic, 0, 0, 0}, + {(char *)"vgetter", __pyx_getprop_6pandas_5index_11IndexEngine_vgetter, 0, 0, 0}, + {(char *)"mapping", __pyx_getprop_6pandas_5index_11IndexEngine_mapping, 0, 0, 0}, + {(char *)"over_size_threshold", __pyx_getprop_6pandas_5index_11IndexEngine_over_size_threshold, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_IndexEngine = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_5index_11IndexEngine_3__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyTypeObject __pyx_type_6pandas_5index_IndexEngine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.IndexEngine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_IndexEngine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_IndexEngine, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_IndexEngine, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_5index_IndexEngine, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_IndexEngine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5index_Int64Engine __pyx_vtable_6pandas_5index_Int64Engine; + +static PyObject *__pyx_tp_new_6pandas_5index_Int64Engine(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5index_Int64Engine *p; + PyObject *o = __pyx_tp_new_6pandas_5index_IndexEngine(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_Int64Engine *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5index_IndexEngine*)__pyx_vtabptr_6pandas_5index_Int64Engine; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5index_Int64Engine[] = { + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_11Int64Engine_1_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_11Int64Engine_3get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_11Int64Engine_5get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5index_Int64Engine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.Int64Engine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_Int64Engine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_Int64Engine, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_Int64Engine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5index_Float64Engine __pyx_vtable_6pandas_5index_Float64Engine; + +static PyObject *__pyx_tp_new_6pandas_5index_Float64Engine(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5index_Float64Engine *p; + PyObject *o = __pyx_tp_new_6pandas_5index_IndexEngine(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_Float64Engine *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5index_IndexEngine*)__pyx_vtabptr_6pandas_5index_Float64Engine; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5index_Float64Engine[] = { + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_13Float64Engine_1_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_13Float64Engine_3get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_13Float64Engine_5get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5index_Float64Engine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.Float64Engine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_Float64Engine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_Float64Engine, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_Float64Engine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5index_ObjectEngine __pyx_vtable_6pandas_5index_ObjectEngine; + +static PyObject *__pyx_tp_new_6pandas_5index_ObjectEngine(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5index_ObjectEngine *p; + PyObject *o = __pyx_tp_new_6pandas_5index_IndexEngine(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_ObjectEngine *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5index_IndexEngine*)__pyx_vtabptr_6pandas_5index_ObjectEngine; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5index_ObjectEngine[] = { + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_12ObjectEngine_1_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_12ObjectEngine_3get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_12ObjectEngine_5get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5index_ObjectEngine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.ObjectEngine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_ObjectEngine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_ObjectEngine, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_ObjectEngine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine __pyx_vtable_6pandas_5index_DatetimeEngine; + +static PyObject *__pyx_tp_new_6pandas_5index_DatetimeEngine(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5index_DatetimeEngine *p; + PyObject *o = __pyx_tp_new_6pandas_5index_Int64Engine(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_DatetimeEngine *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5index_IndexEngine*)__pyx_vtabptr_6pandas_5index_DatetimeEngine; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5index_DatetimeEngine[] = { + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_3_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_loc"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_7get_indexer, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_9get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_11get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_DatetimeEngine = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_5index_14DatetimeEngine_1__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyTypeObject __pyx_type_6pandas_5index_DatetimeEngine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.DatetimeEngine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_DatetimeEngine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_DatetimeEngine, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_DatetimeEngine, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_DatetimeEngine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("convert_scalar"), (PyCFunction)__pyx_pw_6pandas_5index_5convert_scalar, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("index"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Cannot_assign_nan_to_integer_ser, __pyx_k_Cannot_assign_nan_to_integer_ser, sizeof(__pyx_k_Cannot_assign_nan_to_integer_ser), 0, 0, 1, 0}, + {&__pyx_n_s_Float64HashTable, __pyx_k_Float64HashTable, sizeof(__pyx_k_Float64HashTable), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_n_s_Int64HashTable, __pyx_k_Int64HashTable, sizeof(__pyx_k_Int64HashTable), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_kp_s_M8_ns, __pyx_k_M8_ns, sizeof(__pyx_k_M8_ns), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_PyObjectHashTable, __pyx_k_PyObjectHashTable, sizeof(__pyx_k_PyObjectHashTable), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_SIZE_CUTOFF, __pyx_k_SIZE_CUTOFF, sizeof(__pyx_k_SIZE_CUTOFF), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_algos, __pyx_k_algos, sizeof(__pyx_k_algos), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_float64, __pyx_k_backfill_float64, sizeof(__pyx_k_backfill_float64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_functions, __pyx_k_backfill_functions, sizeof(__pyx_k_backfill_functions), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_int64, __pyx_k_backfill_int64, sizeof(__pyx_k_backfill_int64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_object, __pyx_k_backfill_object, sizeof(__pyx_k_backfill_object), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_call_monotonic, __pyx_k_call_monotonic, sizeof(__pyx_k_call_monotonic), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tz, __pyx_k_dateutil_tz, sizeof(__pyx_k_dateutil_tz), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_delta_to_nanoseconds, __pyx_k_delta_to_nanoseconds, sizeof(__pyx_k_delta_to_nanoseconds), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_du_utc, __pyx_k_du_utc, sizeof(__pyx_k_du_utc), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_ensure_float64, __pyx_k_ensure_float64, sizeof(__pyx_k_ensure_float64), 0, 0, 1, 1}, + {&__pyx_n_s_ensure_int64, __pyx_k_ensure_int64, sizeof(__pyx_k_ensure_int64), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_get_item, __pyx_k_get_item, sizeof(__pyx_k_get_item), 0, 0, 1, 1}, + {&__pyx_n_s_get_loc, __pyx_k_get_loc, sizeof(__pyx_k_get_loc), 0, 0, 1, 1}, + {&__pyx_n_s_get_utcoffset, __pyx_k_get_utcoffset, sizeof(__pyx_k_get_utcoffset), 0, 0, 1, 1}, + {&__pyx_n_s_get_value, __pyx_k_get_value, sizeof(__pyx_k_get_value), 0, 0, 1, 1}, + {&__pyx_n_s_get_value_at, __pyx_k_get_value_at, sizeof(__pyx_k_get_value_at), 0, 0, 1, 1}, + {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1}, + {&__pyx_n_s_hashtable, __pyx_k_hashtable, sizeof(__pyx_k_hashtable), 0, 0, 1, 1}, + {&__pyx_n_s_have_pytz, __pyx_k_have_pytz, sizeof(__pyx_k_have_pytz), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic, __pyx_k_is_monotonic, sizeof(__pyx_k_is_monotonic), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_float64, __pyx_k_is_monotonic_float64, sizeof(__pyx_k_is_monotonic_float64), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_int64, __pyx_k_is_monotonic_int64, sizeof(__pyx_k_is_monotonic_int64), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_object, __pyx_k_is_monotonic_object, sizeof(__pyx_k_is_monotonic_object), 0, 0, 1, 1}, + {&__pyx_n_s_is_unique, __pyx_k_is_unique, sizeof(__pyx_k_is_unique), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, + {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1}, + {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_map_locations, __pyx_k_map_locations, sizeof(__pyx_k_map_locations), 0, 0, 1, 1}, + {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_pad_float64, __pyx_k_pad_float64, sizeof(__pyx_k_pad_float64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_functions, __pyx_k_pad_functions, sizeof(__pyx_k_pad_functions), 0, 0, 1, 1}, + {&__pyx_n_s_pad_int64, __pyx_k_pad_int64, sizeof(__pyx_k_pad_int64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_object, __pyx_k_pad_object, sizeof(__pyx_k_pad_object), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_index, __pyx_k_pandas_index, sizeof(__pyx_k_pandas_index), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_tslib, __pyx_k_pandas_tslib, sizeof(__pyx_k_pandas_tslib), 0, 0, 1, 1}, + {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, + {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_searchsorted, __pyx_k_searchsorted, sizeof(__pyx_k_searchsorted), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_set_value, __pyx_k_set_value, sizeof(__pyx_k_set_value), 0, 0, 1, 1}, + {&__pyx_n_s_set_value_at, __pyx_k_set_value_at, sizeof(__pyx_k_set_value_at), 0, 0, 1, 1}, + {&__pyx_n_s_side, __pyx_k_side, sizeof(__pyx_k_side), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_tslib, __pyx_k_tslib, sizeof(__pyx_k_tslib), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1}, + {&__pyx_n_s_tzutc, __pyx_k_tzutc, sizeof(__pyx_k_tzutc), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_vgetter, __pyx_k_vgetter, sizeof(__pyx_k_vgetter), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/index.pyx":514 + * + * cdef _get_index_values(self): + * return self.vgetter().view('i8') # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/index.pyx":563 + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') # <<<<<<<<<<<<<< + * values = np.asarray(values).view('i8') + * return self.mapping.lookup(values) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/index.pyx":564 + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') + * values = np.asarray(values).view('i8') # <<<<<<<<<<<<<< + * return self.mapping.lookup(values) + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/index.pyx":569 + * def get_pad_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') # <<<<<<<<<<<<<< + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/index.pyx":570 + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') # <<<<<<<<<<<<<< + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/index.pyx":576 + * def get_backfill_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') # <<<<<<<<<<<<<< + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/index.pyx":577 + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') # <<<<<<<<<<<<<< + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/index.pyx":595 + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): + * if util.is_float_object(value) and value != value: + * raise ValueError('Cannot assign nan to integer series') # <<<<<<<<<<<<<< + * + * return value + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_nan_to_integer_ser); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_arr, __pyx_n_s_loc); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_value_at, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":62 + * return util.get_value_at(arr, loc) + * + * def set_value_at(ndarray arr, object loc, object val): # <<<<<<<<<<<<<< + * return util.set_value_at(arr, loc, val) + * + */ + __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_arr, __pyx_n_s_loc, __pyx_n_s_val); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_set_value_at, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initindex(void); /*proto*/ +PyMODINIT_FUNC initindex(void) +#else +PyMODINIT_FUNC PyInit_index(void); /*proto*/ +PyMODINIT_FUNC PyInit_index(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_index(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("index"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__index) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.index")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.index", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_6pandas_5index_IndexEngine = &__pyx_vtable_6pandas_5index_IndexEngine; + __pyx_vtable_6pandas_5index_IndexEngine.get_value = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5index_11IndexEngine_get_value; + __pyx_vtable_6pandas_5index_IndexEngine.set_value = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyArrayObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5index_11IndexEngine_set_value; + __pyx_vtable_6pandas_5index_IndexEngine.get_loc = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5index_11IndexEngine_get_loc; + __pyx_vtable_6pandas_5index_IndexEngine._get_loc_duplicates = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates; + __pyx_vtable_6pandas_5index_IndexEngine._maybe_get_bool_indexer = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11IndexEngine__maybe_get_bool_indexer; + __pyx_vtable_6pandas_5index_IndexEngine._do_monotonic_check = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine__do_monotonic_check; + __pyx_vtable_6pandas_5index_IndexEngine._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine__get_index_values; + __pyx_vtable_6pandas_5index_IndexEngine._do_unique_check = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine__do_unique_check; + __pyx_vtable_6pandas_5index_IndexEngine._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11IndexEngine__make_hash_table; + __pyx_vtable_6pandas_5index_IndexEngine._check_type = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11IndexEngine__check_type; + __pyx_vtable_6pandas_5index_IndexEngine._ensure_mapping_populated = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated; + __pyx_vtable_6pandas_5index_IndexEngine.initialize = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine_initialize; + if (PyType_Ready(&__pyx_type_6pandas_5index_IndexEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_IndexEngine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_IndexEngine.tp_dict, __pyx_vtabptr_6pandas_5index_IndexEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "IndexEngine", (PyObject *)&__pyx_type_6pandas_5index_IndexEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_IndexEngine = &__pyx_type_6pandas_5index_IndexEngine; + __pyx_vtabptr_6pandas_5index_Int64Engine = &__pyx_vtable_6pandas_5index_Int64Engine; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base = *__pyx_vtabptr_6pandas_5index_IndexEngine; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base._maybe_get_bool_indexer = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11Int64Engine__maybe_get_bool_indexer; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11Int64Engine__get_index_values; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11Int64Engine__make_hash_table; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base._check_type = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11Int64Engine__check_type; + __pyx_type_6pandas_5index_Int64Engine.tp_base = __pyx_ptype_6pandas_5index_IndexEngine; + if (PyType_Ready(&__pyx_type_6pandas_5index_Int64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_Int64Engine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_Int64Engine.tp_dict, __pyx_vtabptr_6pandas_5index_Int64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Int64Engine", (PyObject *)&__pyx_type_6pandas_5index_Int64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_Int64Engine = &__pyx_type_6pandas_5index_Int64Engine; + __pyx_vtabptr_6pandas_5index_Float64Engine = &__pyx_vtable_6pandas_5index_Float64Engine; + __pyx_vtable_6pandas_5index_Float64Engine.__pyx_base = *__pyx_vtabptr_6pandas_5index_IndexEngine; + __pyx_vtable_6pandas_5index_Float64Engine.__pyx_base._maybe_get_bool_indexer = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_13Float64Engine__maybe_get_bool_indexer; + __pyx_vtable_6pandas_5index_Float64Engine.__pyx_base._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_13Float64Engine__get_index_values; + __pyx_vtable_6pandas_5index_Float64Engine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_13Float64Engine__make_hash_table; + __pyx_type_6pandas_5index_Float64Engine.tp_base = __pyx_ptype_6pandas_5index_IndexEngine; + if (PyType_Ready(&__pyx_type_6pandas_5index_Float64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_Float64Engine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_Float64Engine.tp_dict, __pyx_vtabptr_6pandas_5index_Float64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Float64Engine", (PyObject *)&__pyx_type_6pandas_5index_Float64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_Float64Engine = &__pyx_type_6pandas_5index_Float64Engine; + __pyx_vtabptr_6pandas_5index_ObjectEngine = &__pyx_vtable_6pandas_5index_ObjectEngine; + __pyx_vtable_6pandas_5index_ObjectEngine.__pyx_base = *__pyx_vtabptr_6pandas_5index_IndexEngine; + __pyx_vtable_6pandas_5index_ObjectEngine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_12ObjectEngine__make_hash_table; + __pyx_type_6pandas_5index_ObjectEngine.tp_base = __pyx_ptype_6pandas_5index_IndexEngine; + if (PyType_Ready(&__pyx_type_6pandas_5index_ObjectEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_ObjectEngine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_ObjectEngine.tp_dict, __pyx_vtabptr_6pandas_5index_ObjectEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ObjectEngine", (PyObject *)&__pyx_type_6pandas_5index_ObjectEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_ObjectEngine = &__pyx_type_6pandas_5index_ObjectEngine; + __pyx_vtabptr_6pandas_5index_DatetimeEngine = &__pyx_vtable_6pandas_5index_DatetimeEngine; + __pyx_vtable_6pandas_5index_DatetimeEngine.__pyx_base = *__pyx_vtabptr_6pandas_5index_Int64Engine; + __pyx_vtable_6pandas_5index_DatetimeEngine.__pyx_base.__pyx_base.get_loc = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5index_14DatetimeEngine_get_loc; + __pyx_vtable_6pandas_5index_DatetimeEngine.__pyx_base.__pyx_base._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_14DatetimeEngine__get_index_values; + __pyx_vtable_6pandas_5index_DatetimeEngine._date_check_type = (PyObject *(*)(struct __pyx_obj_6pandas_5index_DatetimeEngine *, PyObject *))__pyx_f_6pandas_5index_14DatetimeEngine__date_check_type; + __pyx_type_6pandas_5index_DatetimeEngine.tp_base = __pyx_ptype_6pandas_5index_Int64Engine; + if (PyType_Ready(&__pyx_type_6pandas_5index_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_DatetimeEngine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_DatetimeEngine.tp_dict, __pyx_vtabptr_6pandas_5index_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DatetimeEngine", (PyObject *)&__pyx_type_6pandas_5index_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_DatetimeEngine = &__pyx_type_6pandas_5index_DatetimeEngine; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_HashTable = __Pyx_ImportType("pandas.hashtable", "HashTable", sizeof(struct __pyx_obj_6pandas_9hashtable_HashTable), 1); if (unlikely(!__pyx_ptype_6pandas_9hashtable_HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int64HashTable = __Pyx_ImportType("pandas.hashtable", "Int64HashTable", sizeof(struct __pyx_obj_6pandas_9hashtable_Int64HashTable), 1); if (unlikely(!__pyx_ptype_6pandas_9hashtable_Int64HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_6pandas_9hashtable_Int64HashTable = (struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable*)__Pyx_GetVtable(__pyx_ptype_6pandas_9hashtable_Int64HashTable->tp_dict); if (unlikely(!__pyx_vtabptr_6pandas_9hashtable_Int64HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Float64HashTable = __Pyx_ImportType("pandas.hashtable", "Float64HashTable", sizeof(struct __pyx_obj_6pandas_9hashtable_Float64HashTable), 1); if (unlikely(!__pyx_ptype_6pandas_9hashtable_Float64HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_6pandas_9hashtable_Float64HashTable = (struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable*)__Pyx_GetVtable(__pyx_ptype_6pandas_9hashtable_Float64HashTable->tp_dict); if (unlikely(!__pyx_vtabptr_6pandas_9hashtable_Float64HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_PyObjectHashTable = __Pyx_ImportType("pandas.hashtable", "PyObjectHashTable", sizeof(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable), 1); if (unlikely(!__pyx_ptype_6pandas_9hashtable_PyObjectHashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable = (struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable*)__Pyx_GetVtable(__pyx_ptype_6pandas_9hashtable_PyObjectHashTable->tp_dict); if (unlikely(!__pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/index.pyx":9 + * cimport numpy as cnp + * + * cnp.import_array() # <<<<<<<<<<<<<< + * cnp.import_ufunc() + * + */ + import_array(); + + /* "pandas/index.pyx":10 + * + * cnp.import_array() + * cnp.import_ufunc() # <<<<<<<<<<<<<< + * + * cimport util + */ + import_ufunc(); + + /* "pandas/index.pyx":14 + * cimport util + * + * import numpy as np # <<<<<<<<<<<<<< + * + * cimport tslib + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":18 + * cimport tslib + * from hashtable cimport * + * from pandas import algos, tslib, hashtable as _hash # <<<<<<<<<<<<<< + * from pandas.tslib import Timestamp + * + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_algos); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_algos); + __Pyx_GIVEREF(__pyx_n_s_algos); + __Pyx_INCREF(__pyx_n_s_tslib); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_tslib); + __Pyx_GIVEREF(__pyx_n_s_tslib); + __Pyx_INCREF(__pyx_n_s_hashtable); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_hashtable); + __Pyx_GIVEREF(__pyx_n_s_hashtable); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_algos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tslib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_hashtable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hash, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":19 + * from hashtable cimport * + * from pandas import algos, tslib, hashtable as _hash + * from pandas.tslib import Timestamp # <<<<<<<<<<<<<< + * + * from datetime cimport (get_datetime64_value, _pydatetime_to_dts, + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Timestamp); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Timestamp); + __Pyx_GIVEREF(__pyx_n_s_Timestamp); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_tslib, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":30 + * void PyDateTime_IMPORT() + * + * cdef int64_t iNaT = util.get_nat() # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_v_6pandas_5index_iNaT = get_nat(); + + /* "pandas/index.pyx":32 + * cdef int64_t iNaT = util.get_nat() + * + * try: # <<<<<<<<<<<<<< + * from dateutil.tz import tzutc as _du_utc + * import pytz + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "pandas/index.pyx":33 + * + * try: + * from dateutil.tz import tzutc as _du_utc # <<<<<<<<<<<<<< + * import pytz + * UTC = pytz.utc + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_tzutc); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_tzutc); + __Pyx_GIVEREF(__pyx_n_s_tzutc); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_dateutil_tz, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzutc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_du_utc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":34 + * try: + * from dateutil.tz import tzutc as _du_utc + * import pytz # <<<<<<<<<<<<<< + * UTC = pytz.utc + * have_pytz = True + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":35 + * from dateutil.tz import tzutc as _du_utc + * import pytz + * UTC = pytz.utc # <<<<<<<<<<<<<< + * have_pytz = True + * except ImportError: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_utc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTC, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":36 + * import pytz + * UTC = pytz.utc + * have_pytz = True # <<<<<<<<<<<<<< + * except ImportError: + * have_pytz = False + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_pytz, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":37 + * UTC = pytz.utc + * have_pytz = True + * except ImportError: # <<<<<<<<<<<<<< + * have_pytz = False + * + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_6) { + __Pyx_AddTraceback("pandas.index", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/index.pyx":38 + * have_pytz = True + * except ImportError: + * have_pytz = False # <<<<<<<<<<<<<< + * + * PyDateTime_IMPORT + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_pytz, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L9_try_end:; + } + + /* "pandas/index.pyx":40 + * have_pytz = False + * + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + PyDateTime_IMPORT; + + /* "pandas/index.pyx":57 + * or PyList_Check(val) or hasattr(val,'_data')) + * + * def get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + */ + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5index_1get_value_at, NULL, __pyx_n_s_pandas_index); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_value_at, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":62 + * return util.get_value_at(arr, loc) + * + * def set_value_at(ndarray arr, object loc, object val): # <<<<<<<<<<<<<< + * return util.set_value_at(arr, loc, val) + * + */ + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5index_3set_value_at, NULL, __pyx_n_s_pandas_index); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_value_at, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":67 + * + * # Don't populate hash tables in monotonic indexes larger than this + * _SIZE_CUTOFF = 1000000 # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIZE_CUTOFF, __pyx_int_1000000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":470 + * return mid + 1 + * + * _pad_functions = { # <<<<<<<<<<<<<< + * 'object' : algos.pad_object, + * 'int64' : algos.pad_int64, + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/index.pyx":471 + * + * _pad_functions = { + * 'object' : algos.pad_object, # <<<<<<<<<<<<<< + * 'int64' : algos.pad_int64, + * 'float64' : algos.pad_float64 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pad_object); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_object, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":472 + * _pad_functions = { + * 'object' : algos.pad_object, + * 'int64' : algos.pad_int64, # <<<<<<<<<<<<<< + * 'float64' : algos.pad_float64 + * } + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pad_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":473 + * 'object' : algos.pad_object, + * 'int64' : algos.pad_int64, + * 'float64' : algos.pad_float64 # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pad_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_float64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_functions, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":476 + * } + * + * _backfill_functions = { # <<<<<<<<<<<<<< + * 'object': algos.backfill_object, + * 'int64': algos.backfill_int64, + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/index.pyx":477 + * + * _backfill_functions = { + * 'object': algos.backfill_object, # <<<<<<<<<<<<<< + * 'int64': algos.backfill_int64, + * 'float64': algos.backfill_float64 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_object, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":478 + * _backfill_functions = { + * 'object': algos.backfill_object, + * 'int64': algos.backfill_int64, # <<<<<<<<<<<<<< + * 'float64': algos.backfill_float64 + * } + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_backfill_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":479 + * 'object': algos.backfill_object, + * 'int64': algos.backfill_int64, + * 'float64': algos.backfill_float64 # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_float64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_functions, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":1 + * from numpy cimport ndarray # <<<<<<<<<<<<<< + * + * from numpy cimport (float64_t, int32_t, int64_t, uint8_t, + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.index", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.index"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files/pandas/lib.c b/cythonized-files/pandas/lib.c new file mode 100644 index 00000000..bdc2f3be --- /dev/null +++ b/cythonized-files/pandas/lib.c @@ -0,0 +1,81711 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__lib +#define __PYX_HAVE_API__pandas__lib +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "headers/stdint.h" +#include "datetime.h" +#include "datetime_helper.h" +#include "numpy/ndarrayobject.h" +#include "numpy_helper.h" +#include "numpy/npy_common.h" +#include "datetime/np_datetime.h" +#include "datetime/np_datetime_strings.h" +#include "math.h" +#include "parse_helper.h" +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "lib.pyx", + "reduce.pyx", + "inference.pyx", + "properties.pyx", + "datetime.pxd", + "numpy.pxd", + "util.pxd", + "stringsource", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; + +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && MSC_VER + #include + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using MSVC atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview) \ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview) \ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#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 + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; + +/* "pandas/lib.pyx":53 + * cdef int64_t NPY_NAT = util.get_nat() + * + * ctypedef unsigned char UChar # <<<<<<<<<<<<<< + * + * cimport util + */ +typedef unsigned char __pyx_t_6pandas_3lib_UChar; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_3lib__PandasNull; +struct __pyx_obj_6pandas_3lib_BlockPlacement; +struct __pyx_obj_6pandas_3lib_Reducer; +struct __pyx_obj_6pandas_3lib_SeriesBinGrouper; +struct __pyx_obj_6pandas_3lib_SeriesGrouper; +struct __pyx_obj_6pandas_3lib_Slider; +struct __pyx_obj_6pandas_3lib_BlockSlider; +struct __pyx_obj_6pandas_3lib_cache_readonly; +struct __pyx_obj_6pandas_3lib_AxisProperty; +struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers; +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr; +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates; +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex; +struct __pyx_opt_args_6pandas_3lib_slice_len; + +/* "pandas/lib.pyx":1443 + * + * + * cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX): # <<<<<<<<<<<<<< + * """ + * Get (start, stop, step, length) tuple for a slice. + */ +struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex { + int __pyx_n; + Py_ssize_t objlen; +}; + +/* "pandas/lib.pyx":1462 + * + * + * cpdef Py_ssize_t slice_len(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX) except -1: # <<<<<<<<<<<<<< + * """ + * Get length of a bounded slice. + */ +struct __pyx_opt_args_6pandas_3lib_slice_len { + int __pyx_n; + Py_ssize_t objlen; +}; + +/* "pandas/lib.pyx":1119 + * return counts + * + * cdef class _PandasNull: # <<<<<<<<<<<<<< + * + * def __richcmp__(_PandasNull self, object other, int op): + */ +struct __pyx_obj_6pandas_3lib__PandasNull { + PyObject_HEAD +}; + + +/* "pandas/lib.pyx":1519 + * + * + * cdef class BlockPlacement: # <<<<<<<<<<<<<< + * # __slots__ = '_as_slice', '_as_array', '_len' + * cdef slice _as_slice + */ +struct __pyx_obj_6pandas_3lib_BlockPlacement { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *__pyx_vtab; + PyObject *_as_slice; + PyObject *_as_array; + int _has_slice; + int _has_array; + int _is_known_slice_like; +}; + + +/* "pandas/src/reduce.pyx":9 + * is_numpy_prior_1_6_2 = LooseVersion(np.__version__) < '1.6.2' + * + * cdef class Reducer: # <<<<<<<<<<<<<< + * ''' + * Performs generic reduction operation on a C or Fortran-contiguous ndarray + */ +struct __pyx_obj_6pandas_3lib_Reducer { + PyObject_HEAD + Py_ssize_t increment; + Py_ssize_t chunksize; + Py_ssize_t nresults; + PyObject *arr; + PyObject *dummy; + PyObject *f; + PyObject *labels; + PyObject *typ; + PyObject *index; +}; + + +/* "pandas/src/reduce.pyx":157 + * + * + * cdef class SeriesBinGrouper: # <<<<<<<<<<<<<< + * ''' + * Performs grouping operation according to bin edges, rather than labels + */ +struct __pyx_obj_6pandas_3lib_SeriesBinGrouper { + PyObject_HEAD + Py_ssize_t nresults; + Py_ssize_t ngroups; + int passed_dummy; + PyObject *arr; + PyObject *index; + PyObject *dummy_arr; + PyObject *dummy_index; + PyObject *values; + PyObject *f; + PyObject *bins; + PyObject *typ; + PyObject *name; +}; + + +/* "pandas/src/reduce.pyx":285 + * + * + * cdef class SeriesGrouper: # <<<<<<<<<<<<<< + * ''' + * Performs generic grouping operation while avoiding ndarray construction + */ +struct __pyx_obj_6pandas_3lib_SeriesGrouper { + PyObject_HEAD + Py_ssize_t nresults; + Py_ssize_t ngroups; + int passed_dummy; + PyObject *arr; + PyObject *index; + PyObject *dummy_arr; + PyObject *dummy_index; + PyObject *f; + PyObject *labels; + PyObject *values; + PyObject *typ; + PyObject *name; +}; + + +/* "pandas/src/reduce.pyx":426 + * return res + * + * cdef class Slider: # <<<<<<<<<<<<<< + * ''' + * Only handles contiguous data for now + */ +struct __pyx_obj_6pandas_3lib_Slider { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_3lib_Slider *__pyx_vtab; + PyArrayObject *values; + PyArrayObject *buf; + Py_ssize_t stride; + Py_ssize_t orig_len; + Py_ssize_t orig_stride; + char *orig_data; +}; + + +/* "pandas/src/reduce.pyx":529 + * return results, mutated + * + * cdef class BlockSlider: # <<<<<<<<<<<<<< + * ''' + * Only capable of sliding on axis=0 + */ +struct __pyx_obj_6pandas_3lib_BlockSlider { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *__pyx_vtab; + PyObject *frame; + PyObject *dummy; + int nblocks; + struct __pyx_obj_6pandas_3lib_Slider *idx_slider; + PyObject *blocks; + char **base_ptrs; +}; + + +/* "pandas/src/properties.pyx":4 + * + * + * cdef class cache_readonly(object): # <<<<<<<<<<<<<< + * + * cdef readonly: + */ +struct __pyx_obj_6pandas_3lib_cache_readonly { + PyObject_HEAD + PyObject *func; + PyObject *name; + PyObject *allow_setting; +}; + + +/* "pandas/src/properties.pyx":53 + * PyDict_SetItem(cache, self.name, value) + * + * cdef class AxisProperty(object): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t axis + */ +struct __pyx_obj_6pandas_3lib_AxisProperty { + PyObject_HEAD + Py_ssize_t axis; +}; + + +/* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ +struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers { + PyObject_HEAD + PyObject *__pyx_v_blkno; + __Pyx_memviewslice __pyx_v_blknos; + __pyx_t_5numpy_int64_t __pyx_v_cur_blkno; + Py_ssize_t __pyx_v_diff; + PyObject *__pyx_v_genexpr; + int __pyx_v_group; + PyObject *__pyx_v_group_dict; + PyObject *__pyx_v_group_order; + PyObject *__pyx_v_group_slices; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __Pyx_memviewslice __pyx_v_res_view; + PyObject *__pyx_v_result; + PyObject *__pyx_v_slices; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + PyObject *__pyx_v_tot_len; + Py_ssize_t __pyx_t_0; + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; +}; + + +/* "pandas/lib.pyx":1345 + * yield blkno, slice(slices[0][0], slices[0][1]) + * else: + * tot_len = sum(stop - start for start, stop in slices) # <<<<<<<<<<<<<< + * result = np.empty(tot_len, dtype=np.int64) + * res_view = result + */ +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr { + PyObject_HEAD + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *__pyx_outer_scope; + PyObject *__pyx_v_start; + PyObject *__pyx_v_stop; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; + PyObject *(*__pyx_t_2)(PyObject *); +}; + + +/* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates { + PyObject_HEAD + PyObject *__pyx_v_dayfirst; + PyObject *__pyx_v_default; + PyObject *__pyx_v_parse; +}; + + +/* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time { + PyObject_HEAD + PyObject *__pyx_v_date; + PyObject *__pyx_v_dayfirst; + PyObject *__pyx_v_default; + PyObject *__pyx_v_parse; + PyObject *__pyx_v_time; +}; + + +/* "View.MemoryView":99 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":269 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":302 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":922 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "pandas/lib.pyx":1519 + * + * + * cdef class BlockPlacement: # <<<<<<<<<<<<<< + * # __slots__ = '_as_slice', '_as_array', '_len' + * cdef slice _as_slice + */ + +struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement { + PyObject *(*iadd)(struct __pyx_obj_6pandas_3lib_BlockPlacement *, PyObject *); + struct __pyx_obj_6pandas_3lib_BlockPlacement *(*copy)(struct __pyx_obj_6pandas_3lib_BlockPlacement *); + PyObject *(*_ensure_has_slice)(struct __pyx_obj_6pandas_3lib_BlockPlacement *); +}; +static struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *__pyx_vtabptr_6pandas_3lib_BlockPlacement; + + +/* "pandas/src/reduce.pyx":426 + * return res + * + * cdef class Slider: # <<<<<<<<<<<<<< + * ''' + * Only handles contiguous data for now + */ + +struct __pyx_vtabstruct_6pandas_3lib_Slider { + PyObject *(*advance)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch); + PyObject *(*move)(struct __pyx_obj_6pandas_3lib_Slider *, int, int); + PyObject *(*set_length)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch); + PyObject *(*reset)(struct __pyx_obj_6pandas_3lib_Slider *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_3lib_Slider *__pyx_vtabptr_6pandas_3lib_Slider; + + +/* "pandas/src/reduce.pyx":529 + * return results, mutated + * + * cdef class BlockSlider: # <<<<<<<<<<<<<< + * ''' + * Only capable of sliding on axis=0 + */ + +struct __pyx_vtabstruct_6pandas_3lib_BlockSlider { + PyObject *(*move)(struct __pyx_obj_6pandas_3lib_BlockSlider *, int, int, int __pyx_skip_dispatch); + PyObject *(*reset)(struct __pyx_obj_6pandas_3lib_BlockSlider *); +}; +static struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *__pyx_vtabptr_6pandas_3lib_BlockSlider; + + +/* "View.MemoryView":302 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":922 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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 CYTHON_INLINE 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); + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE int __Pyx_mod_int(int, int); /* proto */ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +#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); + +static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +#else +#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#endif + +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); + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +#if CYTHON_COMPILING_IN_CPYTHON +#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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) + +static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ +#if CYTHON_COMPILING_IN_PYPY +#define __Pyx_PyObject_AsDouble(obj) \ +(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \ + likely(PyInt_CheckExact(obj)) ? \ + PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) +#else +#define __Pyx_PyObject_AsDouble(obj) \ +((likely(PyFloat_CheckExact(obj))) ? \ + PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +#endif + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_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 { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +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(void); + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + 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 +} + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); /*proto*/ + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_object(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); + +static PyObject *__pyx_memview_get_object(const char *itemp); /* proto */ +static int __pyx_memview_set_object(const char *itemp, PyObject *obj); /* proto */ + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, + char order, int ndim); + +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +#define __Pyx_Generator_USED +#include +#include +typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *); +typedef struct { + PyObject_HEAD + __pyx_generator_body_t body; + PyObject *closure; + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + int resume_label; + char is_running; +} __pyx_GeneratorObject; +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure); +static int __pyx_Generator_init(void); +static int __Pyx_Generator_clear(PyObject* self); +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) +#endif + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython.view' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'datetime' */ + +/* Module declarations from 'datetime' */ +static PyTypeObject *__pyx_ptype_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0; +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/ + +/* Module declarations from 'pandas.tslib' */ +static PyObject *(*__pyx_f_6pandas_5tslib_convert_to_tsobject)(PyObject *, PyObject *, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_6pandas_5tslib_convert_to_timedelta64)(PyObject *, PyObject *, PyObject *); /*proto*/ + +/* Module declarations from 'util' */ +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *); /*proto*/ + +/* Module declarations from 'pandas.lib' */ +static PyTypeObject *__pyx_ptype_6pandas_3lib__PandasNull = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_BlockPlacement = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_Reducer = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_SeriesBinGrouper = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_SeriesGrouper = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_Slider = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_BlockSlider = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_cache_readonly = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_AxisProperty = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct__get_blkno_indexers = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct_1_genexpr = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct_2_try_parse_dates = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static double __pyx_v_6pandas_3lib_NaN; +static double __pyx_v_6pandas_3lib_nan; +static double __pyx_v_6pandas_3lib_NAN; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_3lib_NPY_NAT; +static int __pyx_v_6pandas_3lib__EPOCH_ORD; +static double __pyx_v_6pandas_3lib_INF; +static double __pyx_v_6pandas_3lib_NEGINF; +static double __pyx_v_6pandas_3lib_fINT64_MAX; +static double __pyx_v_6pandas_3lib_fINT64_MIN; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static PyObject *__pyx_f_6pandas_3lib_map_indices_list(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_gmtime(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_to_datetime(__pyx_t_5numpy_int64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_to_timestamp(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_get_timedelta64_value(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_checknull(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_checknull_old(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_3lib_astype_str(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_indexer_as_slice(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_slice_canonize(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_slice_get_indices_ex(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex *__pyx_optional_args); /*proto*/ +static Py_ssize_t __pyx_f_6pandas_3lib_slice_len(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_slice_len *__pyx_optional_args); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__extract_result(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_null_datetimelike(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_datetime(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_date(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_time(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_timedelta(PyObject *); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 }; +#define __Pyx_MODULE_NAME "pandas.lib" +int __pyx_module_is_main_pandas__lib = 0; + +/* Implementation of 'pandas.lib' */ +static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_sum; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_OverflowError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_xrange; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_pf_6pandas_3lib_values_from_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_2map_indices_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_4ismember_nans(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr, PyObject *__pyx_v_values, int __pyx_v_hasnans); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_6ismember(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_8to_datetime(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_timestamp); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_10to_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dt); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_12array_to_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14time64_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16checknull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_18checknull_old(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_20isscalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_22isnullobj(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_24isnullobj_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_26isnullobj2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_28isnullobj_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_30isnullobj2d_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_32list_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_34fast_unique(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_36fast_unique_multiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_38fast_unique_multiple_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lists); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_40fast_unique_multiple_list_gen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gen); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_42dicts_to_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dicts, PyObject *__pyx_v_columns); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_44fast_zip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ndarrays); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_46get_reverse_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, Py_ssize_t __pyx_v_length); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_48has_infs_f4(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_50has_infs_f8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_52convert_timestamps(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_54maybe_indices_to_slice(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_56maybe_booleans_to_slice(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_58scalar_compare(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val, PyObject *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_60vec_compare(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, PyObject *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_62scalar_binop(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val, PyObject *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_64vec_binop(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, PyObject *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_66astype_intsafe(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_new_dtype); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_68astype_str(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_70clean_index_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_72max_len_string_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_74string_array_replace_from_nan_rep(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_nan_rep, PyObject *__pyx_v_replace); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_76write_csv_rows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_data_index, int __pyx_v_nlevels, PyObject *__pyx_v_cols, PyObject *__pyx_v_writer); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_78arrmap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_80is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_82generate_bins_dt64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_binner, PyObject *__pyx_v_closed, int __pyx_v_hasnans); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_84row_bool_subset(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_86row_bool_subset_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_88group_count(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, Py_ssize_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_90lookup_values(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_mapping); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_92count_level_1d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_max_bin); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_94count_level_2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_max_bin); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11_PandasNull___richcmp__(CYTHON_UNUSED struct __pyx_obj_6pandas_3lib__PandasNull *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ +static Py_hash_t __pyx_pf_6pandas_3lib_11_PandasNull_2__hash__(CYTHON_UNUSED struct __pyx_obj_6pandas_3lib__PandasNull *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_96fast_zip_fillna(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ndarrays, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_98duplicated(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_take_last); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_100generate_slices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_ngroups); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_102indices_fast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_keys, PyObject *__pyx_v_sorted_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_18get_blkno_indexers_genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_104get_blkno_indexers(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_blknos, int __pyx_v_group); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_107indexer_as_slice(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_vals); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_109slice_canonize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_111slice_get_indices_ex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, Py_ssize_t __pyx_v_objlen); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_113slice_len(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, Py_ssize_t __pyx_v_objlen); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_115slice_getitem(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, PyObject *__pyx_v_ind); /* proto */ +static int __pyx_pf_6pandas_3lib_14BlockPlacement___init__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_2__unicode__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_3lib_14BlockPlacement_4__len__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_6__iter__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_8as_slice(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_10indexer(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_12isin(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_14as_array(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_16is_slice_like(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_18__getitem__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_20delete(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_22append(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_others); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_24add(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_26sub(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static int __pyx_pf_6pandas_3lib_7Reducer___init__(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_f, PyObject *__pyx_v_axis, PyObject *__pyx_v_dummy, PyObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_2_check_dummy(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_4get_result(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_6_get_result_array(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_res); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_series, PyObject *__pyx_v_f, PyObject *__pyx_v_bins, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_2_check_dummy(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4get_result(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_6_get_result_array(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_res); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper___init__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_series, PyObject *__pyx_v_f, PyObject *__pyx_v_labels, Py_ssize_t __pyx_v_ngroups, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_2_check_dummy(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_4get_result(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6_get_result_array(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_res); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6values___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3typ___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_4name___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_6Slider___init__(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, PyObject *__pyx_v_values, PyObject *__pyx_v_buf); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_6Slider_2advance(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_6Slider_4set_length(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_length); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_6Slider_6reset(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_117apply_frame_axis0(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frame, PyObject *__pyx_v_f, PyObject *__pyx_v_names, PyArrayObject *__pyx_v_starts, PyArrayObject *__pyx_v_ends); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider___init__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_frame); /* proto */ +static void __pyx_pf_6pandas_3lib_11BlockSlider_2__dealloc__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_4move(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, int __pyx_v_start, int __pyx_v_end); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_5frame___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_5frame_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_5frame_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_5dummy___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_7nblocks___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_7nblocks_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_6blocks___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_119reduce(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_f, PyObject *__pyx_v_axis, PyObject *__pyx_v_dummy, PyObject *__pyx_v_labels); /* proto */ +static int __pyx_pf_6pandas_3lib_14cache_readonly___init__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_allow_setting); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_2__call__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_func, CYTHON_UNUSED PyObject *__pyx_v_doc); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4__get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_typ); /* proto */ +static int __pyx_pf_6pandas_3lib_14cache_readonly_6__set__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4func___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_13allow_setting___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_12AxisProperty___init__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_12AxisProperty_2__get__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_type); /* proto */ +static int __pyx_pf_6pandas_3lib_12AxisProperty_4__set__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_121is_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_123is_integer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_125is_bool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_127is_complex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_129infer_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_131infer_dtype_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_133is_possible_datetimelike_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_135is_bool_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_137is_integer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_139is_integer_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_141is_integer_float_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_143is_float_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_145is_string_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_147is_unicode_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_149is_datetime_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_151is_datetime64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_153is_timedelta_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_155is_timedelta64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_157is_timedelta_or_timedelta64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_159is_date_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_161is_time_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_163is_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_165is_period_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_167maybe_convert_numeric(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyObject *__pyx_v_na_values, int __pyx_v_convert_empty, int __pyx_v_coerce_numeric); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_169maybe_convert_objects(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_objects, int __pyx_v_try_float, int __pyx_v_safe, int __pyx_v_convert_datetime, int __pyx_v_convert_timedelta); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_171convert_sql_column(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_15try_parse_dates_parse_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_173try_parse_dates(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_parser, PyObject *__pyx_v_dayfirst, PyObject *__pyx_v_default); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_2parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_175try_parse_date_and_time(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dates, PyArrayObject *__pyx_v_times, PyObject *__pyx_v_date_parser, PyObject *__pyx_v_time_parser, PyObject *__pyx_v_dayfirst, PyObject *__pyx_v_default); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_177try_parse_year_month_day(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_years, PyArrayObject *__pyx_v_months, PyArrayObject *__pyx_v_days); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_179try_parse_datetime_components(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_years, PyArrayObject *__pyx_v_months, PyArrayObject *__pyx_v_days, PyArrayObject *__pyx_v_hours, PyArrayObject *__pyx_v_minutes, PyArrayObject *__pyx_v_seconds); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_181sanitize_objects(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_na_values, PyObject *__pyx_v_convert_empty); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_183maybe_convert_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_true_values, PyObject *__pyx_v_false_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_185map_infer_mask(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_f, PyArrayObject *__pyx_v_mask, int __pyx_v_convert); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_187map_infer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_f, int __pyx_v_convert); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_189to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rows); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_191tuples_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tuples); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_193to_object_array_tuples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rows); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_195fast_multiget(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping, PyArrayObject *__pyx_v_keys, PyObject *__pyx_v_default); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6pandas_3lib__PandasNull(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_BlockPlacement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_Reducer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_SeriesBinGrouper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_SeriesGrouper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_Slider(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_BlockSlider(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_cache_readonly(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_AxisProperty(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_C[] = "C"; +static char __pyx_k_F[] = "F"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_M[] = "M"; +static char __pyx_k_N[] = "N"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_S[] = "S"; +static char __pyx_k_U[] = "U"; +static char __pyx_k_W[] = "W"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_c[] = "c"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_m[] = "m"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_o[] = "o"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_s[] = "s"; +static char __pyx_k_t[] = "t"; +static char __pyx_k_u[] = "u"; +static char __pyx_k_v[] = "v"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_bc[] = "bc"; +static char __pyx_k_eq[] = "eq"; +static char __pyx_k_f8[] = "f8"; +static char __pyx_k_ge[] = "ge"; +static char __pyx_k_gt[] = "gt"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_id[] = "id"; +static char __pyx_k_it[] = "it"; +static char __pyx_k_le[] = "le"; +static char __pyx_k_lt[] = "lt"; +static char __pyx_k_ne[] = "ne"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_ns[] = "ns"; +static char __pyx_k_op[] = "op"; +static char __pyx_k_u1[] = "u1"; +static char __pyx_k_vc[] = "vc"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k_NaT[] = "NaT"; +static char __pyx_k__46[] = "."; +static char __pyx_k__49[] = ""; +static char __pyx_k_add[] = "add"; +static char __pyx_k_any[] = "any"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_buf[] = "buf"; +static char __pyx_k_c16[] = "c16"; +static char __pyx_k_col[] = "col"; +static char __pyx_k_cur[] = "cur"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_doc[] = "doc"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_gen[] = "gen"; +static char __pyx_k_gin[] = "gin"; +static char __pyx_k_idx[] = "idx"; +static char __pyx_k_ind[] = "ind"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_lab[] = "lab"; +static char __pyx_k_len[] = "__len__"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_now[] = "now"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_out[] = "out"; +static char __pyx_k_pos[] = "pos"; +static char __pyx_k_pre[] = "pre"; +static char __pyx_k_row[] = "row"; +static char __pyx_k_s_r[] = "%s(%r)"; +static char __pyx_k_slc[] = "slc"; +static char __pyx_k_sum[] = "sum"; +static char __pyx_k_tmp[] = "tmp"; +static char __pyx_k_tup[] = "tup"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_TRUE[] = "TRUE"; +static char __pyx_k_True[] = "True"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_axes[] = "axes"; +static char __pyx_k_axis[] = "axis"; +static char __pyx_k_base[] = "base"; +static char __pyx_k_bins[] = "bins"; +static char __pyx_k_bool[] = "bool_"; +static char __pyx_k_cols[] = "cols"; +static char __pyx_k_copy[] = "copy"; +static char __pyx_k_data[] = "data"; +static char __pyx_k_date[] = "date"; +static char __pyx_k_days[] = "days"; +static char __pyx_k_diff[] = "diff"; +static char __pyx_k_ends[] = "ends"; +static char __pyx_k_fill[] = "fill"; +static char __pyx_k_flag[] = "flag"; +static char __pyx_k_fnan[] = "fnan"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_fval[] = "fval"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_iNaT[] = "iNaT"; +static char __pyx_k_int8[] = "int8"; +static char __pyx_k_ints[] = "ints"; +static char __pyx_k_isin[] = "isin"; +static char __pyx_k_item[] = "item"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_kind[] = "kind"; +static char __pyx_k_left[] = "left"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mask[] = "mask"; +static char __pyx_k_memo[] = "memo"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_move[] = "move"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_ndim[] = "ndim"; +static char __pyx_k_onan[] = "onan"; +static char __pyx_k_pack[] = "pack"; +static char __pyx_k_rows[] = "rows"; +static char __pyx_k_safe[] = "safe"; +static char __pyx_k_secs[] = "secs"; +static char __pyx_k_seen[] = "seen"; +static char __pyx_k_send[] = "send"; +static char __pyx_k_size[] = "size"; +static char __pyx_k_step[] = "step"; +static char __pyx_k_stop[] = "stop"; +static char __pyx_k_stub[] = "stub"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_time[] = "time"; +static char __pyx_k_true[] = "true"; +static char __pyx_k_type[] = "type"; +static char __pyx_k_vecs[] = "vecs"; +static char __pyx_k_view[] = "view"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_1_6_2[] = "1.6.2"; +static char __pyx_k_FALSE[] = "FALSE"; +static char __pyx_k_False[] = "False"; +static char __pyx_k_H_M_S[] = "%H:%M:%S"; +static char __pyx_k_M8_ns[] = "M8[ns]"; +static char __pyx_k_arobj[] = "arobj"; +static char __pyx_k_blkno[] = "blkno"; +static char __pyx_k_block[] = "_block"; +static char __pyx_k_bools[] = "bools"; +static char __pyx_k_cache[] = "_cache"; +static char __pyx_k_chunk[] = "chunk"; +static char __pyx_k_class[] = "__class__"; +static char __pyx_k_close[] = "close"; +static char __pyx_k_dates[] = "dates"; +static char __pyx_k_dicts[] = "dicts"; +static char __pyx_k_doc_2[] = "__doc__"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_dummy[] = "dummy"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_error[] = "error"; +static char __pyx_k_false[] = "false"; +static char __pyx_k_flags[] = "flags"; +static char __pyx_k_frame[] = "frame"; +static char __pyx_k_group[] = "group"; +static char __pyx_k_hours[] = "hours"; +static char __pyx_k_index[] = "index"; +static char __pyx_k_int16[] = "int16"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_isnan[] = "isnan"; +static char __pyx_k_l_bin[] = "l_bin"; +static char __pyx_k_lists[] = "lists"; +static char __pyx_k_m8_ns[] = "m8[ns]"; +static char __pyx_k_m_d_Y[] = "%m/%d/%Y"; +static char __pyx_k_mixed[] = "mixed"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_names[] = "names"; +static char __pyx_k_ncols[] = "ncols"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_parse[] = "parse"; +static char __pyx_k_piece[] = "piece"; +static char __pyx_k_r_bin[] = "r_bin"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_ravel[] = "ravel"; +static char __pyx_k_reset[] = "reset"; +static char __pyx_k_right[] = "right"; +static char __pyx_k_s_len[] = "s_len"; +static char __pyx_k_shape[] = "shape"; +static char __pyx_k_slobj[] = "slobj"; +static char __pyx_k_start[] = "start"; +static char __pyx_k_table[] = "table"; +static char __pyx_k_throw[] = "throw"; +static char __pyx_k_times[] = "times"; +static char __pyx_k_tslib[] = "tslib"; +static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_years[] = "years"; +static char __pyx_k_zeros[] = "zeros"; +static char __pyx_k_Period[] = "Period"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_arange[] = "arange"; +static char __pyx_k_arrays[] = "arrays"; +static char __pyx_k_arrmap[] = "arrmap"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_binner[] = "binner"; +static char __pyx_k_blknos[] = "blknos"; +static char __pyx_k_blocks[] = "blocks"; +static char __pyx_k_bool_2[] = "bool"; +static char __pyx_k_closed[] = "closed"; +static char __pyx_k_counts[] = "counts"; +static char __pyx_k_data_2[] = "_data"; +static char __pyx_k_delete[] = "delete"; +static char __pyx_k_engine[] = "_engine"; +static char __pyx_k_floats[] = "floats"; +static char __pyx_k_format[] = "format"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_insert[] = "insert"; +static char __pyx_k_labels[] = "labels"; +static char __pyx_k_lenbin[] = "lenbin"; +static char __pyx_k_length[] = "length"; +static char __pyx_k_lenidx[] = "lenidx"; +static char __pyx_k_micros[] = "micros"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_months[] = "months"; +static char __pyx_k_name_2[] = "name"; +static char __pyx_k_neginf[] = "neginf"; +static char __pyx_k_objbuf[] = "objbuf"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_objlen[] = "objlen"; +static char __pyx_k_output[] = "output"; +static char __pyx_k_pandas[] = "pandas"; +static char __pyx_k_parser[] = "parser"; +static char __pyx_k_period[] = "period"; +static char __pyx_k_pydate[] = "pydate"; +static char __pyx_k_reduce[] = "reduce"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_s_step[] = "s_step"; +static char __pyx_k_s_stop[] = "s_stop"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_series[] = "series"; +static char __pyx_k_slices[] = "slices"; +static char __pyx_k_slider[] = "slider"; +static char __pyx_k_starts[] = "starts"; +static char __pyx_k_status[] = "status"; +static char __pyx_k_string[] = "string"; +static char __pyx_k_struct[] = "struct"; +static char __pyx_k_tuples[] = "tuples"; +static char __pyx_k_uint16[] = "uint16"; +static char __pyx_k_uint32[] = "uint32"; +static char __pyx_k_uint64[] = "uint64"; +static char __pyx_k_unpack[] = "unpack"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_writer[] = "writer"; +static char __pyx_k_xrange[] = "xrange"; +static char __pyx_k_advance[] = "advance"; +static char __pyx_k_boolean[] = "boolean"; +static char __pyx_k_cache_2[] = "cache"; +static char __pyx_k_columns[] = "columns"; +static char __pyx_k_complex[] = "complex"; +static char __pyx_k_convert[] = "convert"; +static char __pyx_k_default[] = "default"; +static char __pyx_k_float16[] = "float16"; +static char __pyx_k_float32[] = "float32"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_fortran[] = "fortran"; +static char __pyx_k_genexpr[] = "genexpr"; +static char __pyx_k_hasnans[] = "hasnans"; +static char __pyx_k_ind_len[] = "ind_len"; +static char __pyx_k_index_2[] = "_index"; +static char __pyx_k_indexer[] = "indexer"; +static char __pyx_k_indices[] = "indices"; +static char __pyx_k_integer[] = "integer"; +static char __pyx_k_is_bool[] = "is_bool"; +static char __pyx_k_mapping[] = "mapping"; +static char __pyx_k_max_bin[] = "max_bin"; +static char __pyx_k_memview[] = "memview"; +static char __pyx_k_minutes[] = "minutes"; +static char __pyx_k_mutated[] = "mutated"; +static char __pyx_k_nan_rep[] = "nan_rep"; +static char __pyx_k_ngroups[] = "ngroups"; +static char __pyx_k_nlevels[] = "nlevels"; +static char __pyx_k_objects[] = "objects"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_putmask[] = "putmask"; +static char __pyx_k_reducer[] = "reducer"; +static char __pyx_k_replace[] = "replace"; +static char __pyx_k_require[] = "require"; +static char __pyx_k_results[] = "results"; +static char __pyx_k_s_start[] = "s_start"; +static char __pyx_k_seconds[] = "seconds"; +static char __pyx_k_setattr[] = "__setattr__"; +static char __pyx_k_started[] = "started"; +static char __pyx_k_strides[] = "strides"; +static char __pyx_k_tot_len[] = "tot_len"; +static char __pyx_k_unicode[] = "unicode"; +static char __pyx_k_uniques[] = "uniques"; +static char __pyx_k_version[] = "__version__"; +static char __pyx_k_Ellipsis[] = "Ellipsis"; +static char __pyx_k_TYPE_MAP[] = "_TYPE_MAP"; +static char __pyx_k_as_array[] = "as_array"; +static char __pyx_k_as_slice[] = "as_slice"; +static char __pyx_k_datetime[] = "datetime"; +static char __pyx_k_dayfirst[] = "dayfirst"; +static char __pyx_k_fast_zip[] = "fast_zip"; +static char __pyx_k_finished[] = "finished"; +static char __pyx_k_float128[] = "float128"; +static char __pyx_k_floating[] = "floating"; +static char __pyx_k_ind_step[] = "ind_step"; +static char __pyx_k_ind_stop[] = "ind_stop"; +static char __pyx_k_is_float[] = "is_float"; +static char __pyx_k_ismember[] = "ismember"; +static char __pyx_k_isscalar[] = "isscalar"; +static char __pyx_k_itemsize[] = "itemsize"; +static char __pyx_k_na_count[] = "na_count"; +static char __pyx_k_ndarrays[] = "ndarrays"; +static char __pyx_k_object_2[] = "object_"; +static char __pyx_k_operator[] = "operator"; +static char __pyx_k_property[] = "property"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_res_view[] = "res_view"; +static char __pyx_k_seen_int[] = "seen_int"; +static char __pyx_k_set_axis[] = "_set_axis"; +static char __pyx_k_string_2[] = "string_"; +static char __pyx_k_strptime[] = "strptime"; +static char __pyx_k_val_kind[] = "val_kind"; +static char __pyx_k_val_name[] = "val_name"; +static char __pyx_k_values_2[] = "_values"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_Timestamp[] = "Timestamp"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_complexes[] = "complexes"; +static char __pyx_k_converted[] = "converted"; +static char __pyx_k_cur_blkno[] = "cur_blkno"; +static char __pyx_k_datetimes[] = "datetimes"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_ind_start[] = "ind_start"; +static char __pyx_k_is_period[] = "is_period"; +static char __pyx_k_isnullobj[] = "isnullobj"; +static char __pyx_k_map_infer[] = "map_infer"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_na_values[] = "na_values"; +static char __pyx_k_nat_count[] = "nat_count"; +static char __pyx_k_new_dtype[] = "new_dtype"; +static char __pyx_k_seen_bool[] = "seen_bool"; +static char __pyx_k_seen_null[] = "seen_null"; +static char __pyx_k_take_last[] = "take_last"; +static char __pyx_k_timedelta[] = "timedelta"; +static char __pyx_k_toordinal[] = "toordinal"; +static char __pyx_k_true_vals[] = "true_vals"; +static char __pyx_k_try_float[] = "try_float"; +static char __pyx_k_unicode_2[] = "unicode_"; +static char __pyx_k_vec_binop[] = "vec_binop"; +static char __pyx_k_writerows[] = "writerows"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_Int64Index[] = "Int64Index"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_all_arrays[] = "all_arrays"; +static char __pyx_k_complex128[] = "complex128"; +static char __pyx_k_complex256[] = "complex256"; +static char __pyx_k_contiguous[] = "contiguous"; +static char __pyx_k_data_index[] = "data_index"; +static char __pyx_k_datetime64[] = "datetime64"; +static char __pyx_k_duplicated[] = "duplicated"; +static char __pyx_k_false_vals[] = "false_vals"; +static char __pyx_k_fill_value[] = "fill_value"; +static char __pyx_k_float_secs[] = "float_secs"; +static char __pyx_k_get_result[] = "get_result"; +static char __pyx_k_get_values[] = "get_values"; +static char __pyx_k_group_dict[] = "group_dict"; +static char __pyx_k_group_size[] = "group_size"; +static char __pyx_k_idatetimes[] = "idatetimes"; +static char __pyx_k_is_complex[] = "is_complex"; +static char __pyx_k_is_integer[] = "is_integer"; +static char __pyx_k_item_cache[] = "_item_cache"; +static char __pyx_k_null_count[] = "null_count"; +static char __pyx_k_pandas_lib[] = "pandas.lib"; +static char __pyx_k_parse_date[] = "parse_date"; +static char __pyx_k_parse_time[] = "parse_time"; +static char __pyx_k_pydatetime[] = "pydatetime"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_seen_float[] = "seen_float"; +static char __pyx_k_set_length[] = "set_length"; +static char __pyx_k_timedeltas[] = "timedeltas"; +static char __pyx_k_ImportError[] = "ImportError"; +static char __pyx_k_MemoryError[] = "MemoryError"; +static char __pyx_k_check_dummy[] = "_check_dummy"; +static char __pyx_k_concatenate[] = "concatenate"; +static char __pyx_k_date_parser[] = "date_parser"; +static char __pyx_k_fast_unique[] = "fast_unique"; +static char __pyx_k_group_count[] = "group_count"; +static char __pyx_k_group_order[] = "group_order"; +static char __pyx_k_has_infs_f4[] = "has_infs_f4"; +static char __pyx_k_has_infs_f8[] = "has_infs_f8"; +static char __pyx_k_infer_dtype[] = "infer_dtype"; +static char __pyx_k_is_datelike[] = "is_datelike"; +static char __pyx_k_isnullobj2d[] = "isnullobj2d"; +static char __pyx_k_itimedeltas[] = "itimedeltas"; +static char __pyx_k_microsecond[] = "microsecond"; +static char __pyx_k_pandas_null[] = "pandas_null"; +static char __pyx_k_rev_indexer[] = "rev_indexer"; +static char __pyx_k_seen_object[] = "seen_object"; +static char __pyx_k_time_parser[] = "time_parser"; +static char __pyx_k_timedelta64[] = "timedelta64"; +static char __pyx_k_true_values[] = "true_values"; +static char __pyx_k_vec_compare[] = "vec_compare"; +static char __pyx_k_InvalidApply[] = "InvalidApply"; +static char __pyx_k_LooseVersion[] = "LooseVersion"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_c_contiguous[] = "c_contiguous"; +static char __pyx_k_f_contiguous[] = "f_contiguous"; +static char __pyx_k_false_values[] = "false_values"; +static char __pyx_k_group_slices[] = "group_slices"; +static char __pyx_k_indices_fast[] = "indices_fast"; +static char __pyx_k_is_lexsorted[] = "is_lexsorted"; +static char __pyx_k_item_cache_2[] = "item_cache"; +static char __pyx_k_requirements[] = "requirements"; +static char __pyx_k_right_closed[] = "right_closed"; +static char __pyx_k_scalar_binop[] = "scalar_binop"; +static char __pyx_k_seen_complex[] = "seen_complex"; +static char __pyx_k_seen_numeric[] = "seen_numeric"; +static char __pyx_k_shape_before[] = "shape_before"; +static char __pyx_k_OverflowError[] = "OverflowError"; +static char __pyx_k_allow_setting[] = "allow_setting"; +static char __pyx_k_clear_mapping[] = "clear_mapping"; +static char __pyx_k_convert_empty[] = "convert_empty"; +static char __pyx_k_datetime64_ns[] = "datetime64[ns]"; +static char __pyx_k_fast_multiget[] = "fast_multiget"; +static char __pyx_k_fromtimestamp[] = "fromtimestamp"; +static char __pyx_k_is_bool_array[] = "is_bool_array"; +static char __pyx_k_is_date_array[] = "is_date_array"; +static char __pyx_k_is_slice_like[] = "is_slice_like"; +static char __pyx_k_is_time_array[] = "is_time_array"; +static char __pyx_k_ismember_nans[] = "ismember_nans"; +static char __pyx_k_isnullobj_old[] = "isnullobj_old"; +static char __pyx_k_lookup_values[] = "lookup_values"; +static char __pyx_k_mixed_integer[] = "mixed-integer"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_seen_datetime[] = "seen_datetime"; +static char __pyx_k_slice_getitem[] = "slice_getitem"; +static char __pyx_k_sorted_labels[] = "sorted_labels"; +static char __pyx_k_AttributeError[] = "AttributeError"; +static char __pyx_k_Not_slice_like[] = "Not slice-like"; +static char __pyx_k_astype_intsafe[] = "astype_intsafe"; +static char __pyx_k_coerce_numeric[] = "coerce_numeric"; +static char __pyx_k_count_level_1d[] = "count_level_1d"; +static char __pyx_k_count_level_2d[] = "count_level_2d"; +static char __pyx_k_dicts_to_array[] = "dicts_to_array"; +static char __pyx_k_is_float_array[] = "is_float_array"; +static char __pyx_k_list_of_arrays[] = "list_of_arrays"; +static char __pyx_k_map_infer_mask[] = "map_infer_mask"; +static char __pyx_k_scalar_compare[] = "scalar_compare"; +static char __pyx_k_seen_timedelta[] = "seen_timedelta"; +static char __pyx_k_timedelta64_ns[] = "timedelta64[ns]"; +static char __pyx_k_write_csv_rows[] = "write_csv_rows"; +static char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static char __pyx_k_dateutil_parser[] = "dateutil.parser"; +static char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static char __pyx_k_fast_zip_fillna[] = "fast_zip_fillna"; +static char __pyx_k_generate_slices[] = "generate_slices"; +static char __pyx_k_is_period_array[] = "is_period_array"; +static char __pyx_k_is_string_array[] = "is_string_array"; +static char __pyx_k_isnullobj2d_old[] = "isnullobj2d_old"; +static char __pyx_k_row_bool_subset[] = "row_bool_subset"; +static char __pyx_k_to_object_array[] = "to_object_array"; +static char __pyx_k_try_parse_dates[] = "try_parse_dates"; +static char __pyx_k_unbounded_slice[] = "unbounded slice"; +static char __pyx_k_clean_index_list[] = "clean_index_list"; +static char __pyx_k_convert_datetime[] = "convert_datetime"; +static char __pyx_k_get_result_array[] = "_get_result_array"; +static char __pyx_k_infer_dtype_list[] = "infer_dtype_list"; +static char __pyx_k_is_integer_array[] = "is_integer_array"; +static char __pyx_k_is_unicode_array[] = "is_unicode_array"; +static char __pyx_k_repr_timedelta64[] = "repr_timedelta64"; +static char __pyx_k_sanitize_objects[] = "sanitize_objects"; +static char __pyx_k_utcfromtimestamp[] = "utcfromtimestamp"; +static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s"; +static char __pyx_k_apply_frame_axis0[] = "apply_frame_axis0"; +static char __pyx_k_convert_timedelta[] = "convert_timedelta"; +static char __pyx_k_distutils_version[] = "distutils.version"; +static char __pyx_k_is_datetime_array[] = "is_datetime_array"; +static char __pyx_k_pandas_core_index[] = "pandas.core.index"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_slc_must_be_slice[] = "slc must be slice"; +static char __pyx_k_array_to_timestamp[] = "array_to_timestamp"; +static char __pyx_k_convert_sql_column[] = "convert_sql_column"; +static char __pyx_k_convert_timestamps[] = "convert_timestamps"; +static char __pyx_k_generate_bins_dt64[] = "generate_bins_dt64"; +static char __pyx_k_get_blkno_indexers[] = "get_blkno_indexers"; +static char __pyx_k_is_timedelta_array[] = "is_timedelta_array"; +static char __pyx_k_maybe_convert_bool[] = "maybe_convert_bool"; +static char __pyx_k_strided_and_direct[] = ""; +static char __pyx_k_time64_to_datetime[] = "time64_to_datetime"; +static char __pyx_k_values_from_object[] = "values_from_object"; +static char __pyx_k_Cannot_use_shortcut[] = "Cannot use shortcut"; +static char __pyx_k_get_reverse_indexer[] = "get_reverse_indexer"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_is_datetime64_array[] = "is_datetime64_array"; +static char __pyx_k_mixed_integer_float[] = "mixed-integer-float"; +static char __pyx_k_fast_unique_multiple[] = "fast_unique_multiple"; +static char __pyx_k_is_numpy_prior_1_6_2[] = "is_numpy_prior_1_6_2"; +static char __pyx_k_is_timedelta64_array[] = "is_timedelta64_array"; +static char __pyx_k_list_to_object_array[] = "list_to_object_array"; +static char __pyx_k_max_len_string_array[] = "max_len_string_array"; +static char __pyx_k_strided_and_indirect[] = ""; +static char __pyx_k_vals_must_be_ndarray[] = "vals must be ndarray"; +static char __pyx_k_Unrecognized_operator[] = "Unrecognized operator"; +static char __pyx_k_contiguous_and_direct[] = ""; +static char __pyx_k_has_complex_internals[] = "_has_complex_internals"; +static char __pyx_k_maybe_convert_numeric[] = "maybe_convert_numeric"; +static char __pyx_k_maybe_convert_objects[] = "maybe_convert_objects"; +static char __pyx_k_pandas_src_reduce_pyx[] = "pandas/src/reduce.pyx"; +static char __pyx_k_pandas_tseries_period[] = "pandas.tseries.period"; +static char __pyx_k_slc_should_be_a_slice[] = "slc should be a slice"; +static char __pyx_k_MemoryView_of_r_object[] = ""; +static char __pyx_k_is_integer_float_array[] = "is_integer_float_array"; +static char __pyx_k_maybe_indices_to_slice[] = "maybe_indices_to_slice"; +static char __pyx_k_row_bool_subset_object[] = "row_bool_subset_object"; +static char __pyx_k_to_object_array_tuples[] = "to_object_array_tuples"; +static char __pyx_k_tuples_to_object_array[] = "tuples_to_object_array"; +static char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static char __pyx_k_cannot_set_values_for_s[] = "cannot set values for [%s]"; +static char __pyx_k_contiguous_and_indirect[] = ""; +static char __pyx_k_maybe_booleans_to_slice[] = "maybe_booleans_to_slice"; +static char __pyx_k_try_parse_date_and_time[] = "try_parse_date_and_time"; +static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static char __pyx_k_Empty_string_encountered[] = "Empty string encountered"; +static char __pyx_k_function_does_not_reduce[] = "function does not reduce"; +static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)"; +static char __pyx_k_pandas_src_inference_pyx[] = "pandas/src/inference.pyx"; +static char __pyx_k_try_parse_year_month_day[] = "try_parse_year_month_day"; +static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct"; +static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static char __pyx_k_fast_unique_multiple_list[] = "fast_unique_multiple_list"; +static char __pyx_k_iadd_causes_length_change[] = "iadd causes length change"; +static char __pyx_k_slice_step_cannot_be_zero[] = "slice step cannot be zero"; +static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)"; +static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)"; +static char __pyx_k_Values_falls_after_last_bin[] = "Values falls after last bin"; +static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_Dummy_array_must_be_length_d[] = "Dummy array must be length %d"; +static char __pyx_k_Let_this_error_raise_above_us[] = "Let this error raise above us"; +static char __pyx_k_Values_falls_before_first_bin[] = "Values falls before first bin"; +static char __pyx_k_fast_unique_multiple_list_gen[] = "fast_unique_multiple_list_gen"; +static char __pyx_k_try_parse_dates_locals_lambda[] = "try_parse_dates.."; +static char __pyx_k_try_parse_datetime_components[] = "try_parse_datetime_components"; +static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static char __pyx_k_Dummy_array_must_be_same_dtype[] = "Dummy array must be same dtype"; +static char __pyx_k_Function_unsafe_for_fast_apply[] = "Function unsafe for fast apply"; +static char __pyx_k_all_arrays_must_be_same_length[] = "all arrays must be same length"; +static char __pyx_k_is_possible_datetimelike_array[] = "is_possible_datetimelike_array"; +static char __pyx_k_strided_and_direct_or_indirect[] = ""; +static char __pyx_k_Arrays_were_different_lengths_d[] = "Arrays were different lengths: %d vs %d"; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/lib.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; +static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static char __pyx_k_Cannot_modify_frame_index_intern[] = "Cannot modify frame index internals"; +static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions"; +static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static char __pyx_k_Invalid_length_for_values_or_for[] = "Invalid length for values or for binner"; +static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static char __pyx_k_Length_of_all_datetime_component[] = "Length of all datetime components must be equal"; +static char __pyx_k_Length_of_dates_and_times_must_b[] = "Length of dates and times must be equal"; +static char __pyx_k_Length_of_years_months_days_must[] = "Length of years/months/days must all be equal"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static char __pyx_k_is_timedelta_or_timedelta64_arra[] = "is_timedelta_or_timedelta64_array"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_string_array_replace_from_nan_re[] = "string_array_replace_from_nan_rep"; +static char __pyx_k_try_parse_date_and_time_locals_l[] = "try_parse_date_and_time.."; +static char __pyx_k_try_parse_date_and_time_locals_p[] = "try_parse_date_and_time..parse_date"; +static char __pyx_k_try_parse_dates_locals_parse_dat[] = "try_parse_dates..parse_date"; +static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static char __pyx_k_try_parse_date_and_time_locals_p_2[] = "try_parse_date_and_time..parse_time"; +static PyObject *__pyx_kp_s_1_6_2; +static PyObject *__pyx_kp_s_Arrays_were_different_lengths_d; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_n_s_C; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_kp_s_Cannot_modify_frame_index_intern; +static PyObject *__pyx_kp_s_Cannot_use_shortcut; +static PyObject *__pyx_kp_s_Dummy_array_must_be_length_d; +static PyObject *__pyx_kp_s_Dummy_array_must_be_same_dtype; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_kp_s_Empty_string_encountered; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_F; +static PyObject *__pyx_n_s_FALSE; +static PyObject *__pyx_n_s_False; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_kp_s_Function_unsafe_for_fast_apply; +static PyObject *__pyx_kp_s_H_M_S; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_n_s_Int64Index; +static PyObject *__pyx_n_s_InvalidApply; +static PyObject *__pyx_kp_s_Invalid_length_for_values_or_for; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_kp_s_Length_of_all_datetime_component; +static PyObject *__pyx_kp_s_Length_of_dates_and_times_must_b; +static PyObject *__pyx_kp_s_Length_of_years_months_days_must; +static PyObject *__pyx_kp_s_Let_this_error_raise_above_us; +static PyObject *__pyx_n_s_LooseVersion; +static PyObject *__pyx_n_s_M; +static PyObject *__pyx_kp_s_M8_ns; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_N; +static PyObject *__pyx_n_s_NaN; +static PyObject *__pyx_n_s_NaT; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_kp_s_Not_slice_like; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_n_s_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_OverflowError; +static PyObject *__pyx_n_s_Period; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_S; +static PyObject *__pyx_n_s_TRUE; +static PyObject *__pyx_n_s_TYPE_MAP; +static PyObject *__pyx_n_s_Timestamp; +static PyObject *__pyx_n_s_True; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_U; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_kp_s_Unable_to_parse_s; +static PyObject *__pyx_kp_s_Unrecognized_operator; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s_Values_falls_after_last_bin; +static PyObject *__pyx_kp_s_Values_falls_before_first_bin; +static PyObject *__pyx_n_s_W; +static PyObject *__pyx_kp_s__46; +static PyObject *__pyx_kp_s__49; +static PyObject *__pyx_n_s_add; +static PyObject *__pyx_n_s_advance; +static PyObject *__pyx_n_s_all_arrays; +static PyObject *__pyx_kp_s_all_arrays_must_be_same_length; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_allow_setting; +static PyObject *__pyx_n_s_any; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_apply_frame_axis0; +static PyObject *__pyx_n_s_arange; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_arobj; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_array_to_timestamp; +static PyObject *__pyx_n_s_arrays; +static PyObject *__pyx_n_s_arrmap; +static PyObject *__pyx_n_s_as_array; +static PyObject *__pyx_n_s_as_slice; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_astype_intsafe; +static PyObject *__pyx_n_s_axes; +static PyObject *__pyx_n_s_axis; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_bc; +static PyObject *__pyx_n_s_binner; +static PyObject *__pyx_n_s_bins; +static PyObject *__pyx_n_s_blkno; +static PyObject *__pyx_n_s_blknos; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_blocks; +static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_bool_2; +static PyObject *__pyx_n_s_boolean; +static PyObject *__pyx_n_s_bools; +static PyObject *__pyx_n_s_buf; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_c16; +static PyObject *__pyx_n_s_c_contiguous; +static PyObject *__pyx_n_s_cache; +static PyObject *__pyx_n_s_cache_2; +static PyObject *__pyx_kp_s_cannot_set_values_for_s; +static PyObject *__pyx_n_s_check_dummy; +static PyObject *__pyx_n_s_chunk; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_clean_index_list; +static PyObject *__pyx_n_s_clear_mapping; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_closed; +static PyObject *__pyx_n_s_coerce_numeric; +static PyObject *__pyx_n_s_col; +static PyObject *__pyx_n_s_cols; +static PyObject *__pyx_n_s_columns; +static PyObject *__pyx_n_s_complex; +static PyObject *__pyx_n_s_complex128; +static PyObject *__pyx_n_s_complex256; +static PyObject *__pyx_n_s_complexes; +static PyObject *__pyx_n_s_concatenate; +static PyObject *__pyx_n_s_contiguous; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_convert; +static PyObject *__pyx_n_s_convert_datetime; +static PyObject *__pyx_n_s_convert_empty; +static PyObject *__pyx_n_s_convert_sql_column; +static PyObject *__pyx_n_s_convert_timedelta; +static PyObject *__pyx_n_s_convert_timestamps; +static PyObject *__pyx_n_s_converted; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_count_level_1d; +static PyObject *__pyx_n_s_count_level_2d; +static PyObject *__pyx_n_s_counts; +static PyObject *__pyx_n_s_cur; +static PyObject *__pyx_n_s_cur_blkno; +static PyObject *__pyx_n_s_d; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_data_2; +static PyObject *__pyx_n_s_data_index; +static PyObject *__pyx_n_s_date; +static PyObject *__pyx_n_s_date_parser; +static PyObject *__pyx_n_s_dates; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_datetime64; +static PyObject *__pyx_kp_s_datetime64_ns; +static PyObject *__pyx_n_s_datetimes; +static PyObject *__pyx_n_s_dateutil_parser; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_dayfirst; +static PyObject *__pyx_n_s_days; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_n_s_delete; +static PyObject *__pyx_n_s_dicts; +static PyObject *__pyx_n_s_dicts_to_array; +static PyObject *__pyx_n_s_diff; +static PyObject *__pyx_n_s_distutils_version; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_doc_2; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_dummy; +static PyObject *__pyx_n_s_duplicated; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_ends; +static PyObject *__pyx_n_s_engine; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_eq; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_f8; +static PyObject *__pyx_n_s_f_contiguous; +static PyObject *__pyx_n_s_false; +static PyObject *__pyx_n_s_false_vals; +static PyObject *__pyx_n_s_false_values; +static PyObject *__pyx_n_s_fast_multiget; +static PyObject *__pyx_n_s_fast_unique; +static PyObject *__pyx_n_s_fast_unique_multiple; +static PyObject *__pyx_n_s_fast_unique_multiple_list; +static PyObject *__pyx_n_s_fast_unique_multiple_list_gen; +static PyObject *__pyx_n_s_fast_zip; +static PyObject *__pyx_n_s_fast_zip_fillna; +static PyObject *__pyx_n_s_fill; +static PyObject *__pyx_n_s_fill_value; +static PyObject *__pyx_n_s_finished; +static PyObject *__pyx_n_s_flag; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float128; +static PyObject *__pyx_n_s_float16; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_float_secs; +static PyObject *__pyx_n_s_floating; +static PyObject *__pyx_n_s_floats; +static PyObject *__pyx_n_s_fnan; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_frame; +static PyObject *__pyx_n_s_fromtimestamp; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_kp_s_function_does_not_reduce; +static PyObject *__pyx_n_s_fval; +static PyObject *__pyx_n_s_ge; +static PyObject *__pyx_n_s_gen; +static PyObject *__pyx_n_s_generate_bins_dt64; +static PyObject *__pyx_n_s_generate_slices; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_get_blkno_indexers; +static PyObject *__pyx_n_s_get_result; +static PyObject *__pyx_n_s_get_result_array; +static PyObject *__pyx_n_s_get_reverse_indexer; +static PyObject *__pyx_n_s_get_values; +static PyObject *__pyx_n_s_gin; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_group; +static PyObject *__pyx_n_s_group_count; +static PyObject *__pyx_n_s_group_dict; +static PyObject *__pyx_n_s_group_order; +static PyObject *__pyx_n_s_group_size; +static PyObject *__pyx_n_s_group_slices; +static PyObject *__pyx_n_s_gt; +static PyObject *__pyx_n_s_has_complex_internals; +static PyObject *__pyx_n_s_has_infs_f4; +static PyObject *__pyx_n_s_has_infs_f8; +static PyObject *__pyx_n_s_hasnans; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_hours; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_i8; +static PyObject *__pyx_n_s_iNaT; +static PyObject *__pyx_kp_s_iadd_causes_length_change; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_idatetimes; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_ind; +static PyObject *__pyx_n_s_ind_len; +static PyObject *__pyx_n_s_ind_start; +static PyObject *__pyx_n_s_ind_step; +static PyObject *__pyx_n_s_ind_stop; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_n_s_index_2; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_indexer; +static PyObject *__pyx_n_s_indices; +static PyObject *__pyx_n_s_indices_fast; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_infer_dtype; +static PyObject *__pyx_n_s_infer_dtype_list; +static PyObject *__pyx_n_s_insert; +static PyObject *__pyx_n_s_int16; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_integer; +static PyObject *__pyx_n_s_ints; +static PyObject *__pyx_n_s_is_bool; +static PyObject *__pyx_n_s_is_bool_array; +static PyObject *__pyx_n_s_is_complex; +static PyObject *__pyx_n_s_is_date_array; +static PyObject *__pyx_n_s_is_datelike; +static PyObject *__pyx_n_s_is_datetime64_array; +static PyObject *__pyx_n_s_is_datetime_array; +static PyObject *__pyx_n_s_is_float; +static PyObject *__pyx_n_s_is_float_array; +static PyObject *__pyx_n_s_is_integer; +static PyObject *__pyx_n_s_is_integer_array; +static PyObject *__pyx_n_s_is_integer_float_array; +static PyObject *__pyx_n_s_is_lexsorted; +static PyObject *__pyx_n_s_is_numpy_prior_1_6_2; +static PyObject *__pyx_n_s_is_period; +static PyObject *__pyx_n_s_is_period_array; +static PyObject *__pyx_n_s_is_possible_datetimelike_array; +static PyObject *__pyx_n_s_is_slice_like; +static PyObject *__pyx_n_s_is_string_array; +static PyObject *__pyx_n_s_is_time_array; +static PyObject *__pyx_n_s_is_timedelta64_array; +static PyObject *__pyx_n_s_is_timedelta_array; +static PyObject *__pyx_n_s_is_timedelta_or_timedelta64_arra; +static PyObject *__pyx_n_s_is_unicode_array; +static PyObject *__pyx_n_s_isin; +static PyObject *__pyx_n_s_ismember; +static PyObject *__pyx_n_s_ismember_nans; +static PyObject *__pyx_n_s_isnan; +static PyObject *__pyx_n_s_isnullobj; +static PyObject *__pyx_n_s_isnullobj2d; +static PyObject *__pyx_n_s_isnullobj2d_old; +static PyObject *__pyx_n_s_isnullobj_old; +static PyObject *__pyx_n_s_isscalar; +static PyObject *__pyx_n_s_it; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_item_cache; +static PyObject *__pyx_n_s_item_cache_2; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_itimedeltas; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_kind; +static PyObject *__pyx_n_s_l; +static PyObject *__pyx_n_s_l_bin; +static PyObject *__pyx_n_s_lab; +static PyObject *__pyx_n_s_labels; +static PyObject *__pyx_n_s_le; +static PyObject *__pyx_n_s_left; +static PyObject *__pyx_n_s_len; +static PyObject *__pyx_n_s_lenbin; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_lenidx; +static PyObject *__pyx_n_s_list_of_arrays; +static PyObject *__pyx_n_s_list_to_object_array; +static PyObject *__pyx_n_s_lists; +static PyObject *__pyx_n_s_lookup_values; +static PyObject *__pyx_n_s_lt; +static PyObject *__pyx_n_s_m; +static PyObject *__pyx_kp_s_m8_ns; +static PyObject *__pyx_kp_s_m_d_Y; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_map_infer; +static PyObject *__pyx_n_s_map_infer_mask; +static PyObject *__pyx_n_s_mapping; +static PyObject *__pyx_n_s_mask; +static PyObject *__pyx_n_s_max_bin; +static PyObject *__pyx_n_s_max_len_string_array; +static PyObject *__pyx_n_s_maybe_booleans_to_slice; +static PyObject *__pyx_n_s_maybe_convert_bool; +static PyObject *__pyx_n_s_maybe_convert_numeric; +static PyObject *__pyx_n_s_maybe_convert_objects; +static PyObject *__pyx_n_s_maybe_indices_to_slice; +static PyObject *__pyx_n_s_memo; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_micros; +static PyObject *__pyx_n_s_microsecond; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_minutes; +static PyObject *__pyx_n_s_mixed; +static PyObject *__pyx_kp_s_mixed_integer; +static PyObject *__pyx_kp_s_mixed_integer_float; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_months; +static PyObject *__pyx_n_s_move; +static PyObject *__pyx_n_s_mutated; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_na_count; +static PyObject *__pyx_n_s_na_values; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_names; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_n_s_nan_rep; +static PyObject *__pyx_n_s_nat_count; +static PyObject *__pyx_n_s_ncols; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndarrays; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_ne; +static PyObject *__pyx_n_s_neginf; +static PyObject *__pyx_n_s_new_dtype; +static PyObject *__pyx_n_s_ngroups; +static PyObject *__pyx_n_s_nlevels; +static PyObject *__pyx_n_s_now; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_ns; +static PyObject *__pyx_n_s_null_count; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_o; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_objbuf; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_object_2; +static PyObject *__pyx_n_s_objects; +static PyObject *__pyx_n_s_objlen; +static PyObject *__pyx_n_s_onan; +static PyObject *__pyx_n_s_op; +static PyObject *__pyx_n_s_operator; +static PyObject *__pyx_n_s_out; +static PyObject *__pyx_n_s_output; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_pandas_core_index; +static PyObject *__pyx_n_s_pandas_lib; +static PyObject *__pyx_n_s_pandas_null; +static PyObject *__pyx_kp_s_pandas_src_inference_pyx; +static PyObject *__pyx_kp_s_pandas_src_reduce_pyx; +static PyObject *__pyx_n_s_pandas_tseries_period; +static PyObject *__pyx_n_s_parse; +static PyObject *__pyx_n_s_parse_date; +static PyObject *__pyx_n_s_parse_time; +static PyObject *__pyx_n_s_parser; +static PyObject *__pyx_n_s_period; +static PyObject *__pyx_n_s_piece; +static PyObject *__pyx_n_s_pos; +static PyObject *__pyx_n_s_pre; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_property; +static PyObject *__pyx_n_s_putmask; +static PyObject *__pyx_n_s_pydate; +static PyObject *__pyx_n_s_pydatetime; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_r_bin; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_ravel; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reducer; +static PyObject *__pyx_n_s_replace; +static PyObject *__pyx_n_s_repr_timedelta64; +static PyObject *__pyx_n_s_require; +static PyObject *__pyx_n_s_requirements; +static PyObject *__pyx_n_s_res_view; +static PyObject *__pyx_n_s_reset; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_results; +static PyObject *__pyx_n_s_rev_indexer; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_right_closed; +static PyObject *__pyx_n_s_row; +static PyObject *__pyx_n_s_row_bool_subset; +static PyObject *__pyx_n_s_row_bool_subset_object; +static PyObject *__pyx_n_s_rows; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_n_s_s_len; +static PyObject *__pyx_kp_s_s_r; +static PyObject *__pyx_n_s_s_start; +static PyObject *__pyx_n_s_s_step; +static PyObject *__pyx_n_s_s_stop; +static PyObject *__pyx_n_s_safe; +static PyObject *__pyx_n_s_sanitize_objects; +static PyObject *__pyx_n_s_scalar_binop; +static PyObject *__pyx_n_s_scalar_compare; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_seconds; +static PyObject *__pyx_n_s_secs; +static PyObject *__pyx_n_s_seen; +static PyObject *__pyx_n_s_seen_bool; +static PyObject *__pyx_n_s_seen_complex; +static PyObject *__pyx_n_s_seen_datetime; +static PyObject *__pyx_n_s_seen_float; +static PyObject *__pyx_n_s_seen_int; +static PyObject *__pyx_n_s_seen_null; +static PyObject *__pyx_n_s_seen_numeric; +static PyObject *__pyx_n_s_seen_object; +static PyObject *__pyx_n_s_seen_timedelta; +static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_series; +static PyObject *__pyx_n_s_set_axis; +static PyObject *__pyx_n_s_set_length; +static PyObject *__pyx_n_s_setattr; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_shape_before; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_slc; +static PyObject *__pyx_kp_s_slc_must_be_slice; +static PyObject *__pyx_kp_s_slc_should_be_a_slice; +static PyObject *__pyx_n_s_slice_getitem; +static PyObject *__pyx_kp_s_slice_step_cannot_be_zero; +static PyObject *__pyx_n_s_slices; +static PyObject *__pyx_n_s_slider; +static PyObject *__pyx_n_s_slobj; +static PyObject *__pyx_n_s_sorted_labels; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_started; +static PyObject *__pyx_n_s_starts; +static PyObject *__pyx_n_s_status; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_n_s_strides; +static PyObject *__pyx_n_s_string; +static PyObject *__pyx_n_s_string_2; +static PyObject *__pyx_n_s_string_array_replace_from_nan_re; +static PyObject *__pyx_n_s_strptime; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_stub; +static PyObject *__pyx_n_s_sum; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_table; +static PyObject *__pyx_n_s_take_last; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_time64_to_datetime; +static PyObject *__pyx_n_s_time_parser; +static PyObject *__pyx_n_s_timedelta; +static PyObject *__pyx_n_s_timedelta64; +static PyObject *__pyx_kp_s_timedelta64_ns; +static PyObject *__pyx_n_s_timedeltas; +static PyObject *__pyx_n_s_times; +static PyObject *__pyx_n_s_tmp; +static PyObject *__pyx_n_s_to_object_array; +static PyObject *__pyx_n_s_to_object_array_tuples; +static PyObject *__pyx_n_s_toordinal; +static PyObject *__pyx_n_s_tot_len; +static PyObject *__pyx_n_s_true; +static PyObject *__pyx_n_s_true_vals; +static PyObject *__pyx_n_s_true_values; +static PyObject *__pyx_n_s_try_float; +static PyObject *__pyx_n_s_try_parse_date_and_time; +static PyObject *__pyx_n_s_try_parse_date_and_time_locals_l; +static PyObject *__pyx_n_s_try_parse_date_and_time_locals_p; +static PyObject *__pyx_n_s_try_parse_date_and_time_locals_p_2; +static PyObject *__pyx_n_s_try_parse_dates; +static PyObject *__pyx_n_s_try_parse_dates_locals_lambda; +static PyObject *__pyx_n_s_try_parse_dates_locals_parse_dat; +static PyObject *__pyx_n_s_try_parse_datetime_components; +static PyObject *__pyx_n_s_try_parse_year_month_day; +static PyObject *__pyx_n_s_tslib; +static PyObject *__pyx_n_s_tup; +static PyObject *__pyx_n_s_tuples; +static PyObject *__pyx_n_s_tuples_to_object_array; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_u; +static PyObject *__pyx_n_s_u1; +static PyObject *__pyx_n_s_uint16; +static PyObject *__pyx_n_s_uint32; +static PyObject *__pyx_n_s_uint64; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_kp_s_unbounded_slice; +static PyObject *__pyx_n_s_unicode; +static PyObject *__pyx_n_s_unicode_2; +static PyObject *__pyx_n_s_uniques; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_utcfromtimestamp; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_val_kind; +static PyObject *__pyx_n_s_val_name; +static PyObject *__pyx_kp_s_vals_must_be_ndarray; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_values_2; +static PyObject *__pyx_n_s_values_from_object; +static PyObject *__pyx_n_s_vc; +static PyObject *__pyx_n_s_vec_binop; +static PyObject *__pyx_n_s_vec_compare; +static PyObject *__pyx_n_s_vecs; +static PyObject *__pyx_n_s_version; +static PyObject *__pyx_n_s_view; +static PyObject *__pyx_n_s_write_csv_rows; +static PyObject *__pyx_n_s_writer; +static PyObject *__pyx_n_s_writerows; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xrange; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_n_s_years; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_k__10; +static Py_ssize_t __pyx_k__17; +static Py_ssize_t __pyx_k__19; +static PyObject *__pyx_k__57; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__40; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__100; +static PyObject *__pyx_tuple__102; +static PyObject *__pyx_tuple__104; +static PyObject *__pyx_tuple__106; +static PyObject *__pyx_tuple__108; +static PyObject *__pyx_tuple__110; +static PyObject *__pyx_tuple__112; +static PyObject *__pyx_tuple__114; +static PyObject *__pyx_tuple__116; +static PyObject *__pyx_tuple__118; +static PyObject *__pyx_tuple__120; +static PyObject *__pyx_tuple__122; +static PyObject *__pyx_tuple__124; +static PyObject *__pyx_tuple__126; +static PyObject *__pyx_tuple__128; +static PyObject *__pyx_tuple__130; +static PyObject *__pyx_tuple__132; +static PyObject *__pyx_tuple__134; +static PyObject *__pyx_tuple__136; +static PyObject *__pyx_tuple__138; +static PyObject *__pyx_tuple__140; +static PyObject *__pyx_tuple__142; +static PyObject *__pyx_tuple__144; +static PyObject *__pyx_tuple__146; +static PyObject *__pyx_tuple__148; +static PyObject *__pyx_tuple__150; +static PyObject *__pyx_tuple__152; +static PyObject *__pyx_tuple__154; +static PyObject *__pyx_tuple__156; +static PyObject *__pyx_tuple__158; +static PyObject *__pyx_tuple__160; +static PyObject *__pyx_tuple__162; +static PyObject *__pyx_tuple__164; +static PyObject *__pyx_tuple__166; +static PyObject *__pyx_tuple__168; +static PyObject *__pyx_tuple__170; +static PyObject *__pyx_tuple__172; +static PyObject *__pyx_tuple__174; +static PyObject *__pyx_tuple__176; +static PyObject *__pyx_tuple__178; +static PyObject *__pyx_tuple__180; +static PyObject *__pyx_tuple__182; +static PyObject *__pyx_tuple__184; +static PyObject *__pyx_tuple__186; +static PyObject *__pyx_tuple__188; +static PyObject *__pyx_tuple__190; +static PyObject *__pyx_tuple__192; +static PyObject *__pyx_tuple__194; +static PyObject *__pyx_tuple__196; +static PyObject *__pyx_tuple__198; +static PyObject *__pyx_tuple__200; +static PyObject *__pyx_tuple__202; +static PyObject *__pyx_tuple__204; +static PyObject *__pyx_tuple__206; +static PyObject *__pyx_tuple__208; +static PyObject *__pyx_tuple__210; +static PyObject *__pyx_tuple__212; +static PyObject *__pyx_tuple__214; +static PyObject *__pyx_tuple__216; +static PyObject *__pyx_tuple__218; +static PyObject *__pyx_tuple__220; +static PyObject *__pyx_tuple__222; +static PyObject *__pyx_tuple__224; +static PyObject *__pyx_tuple__226; +static PyObject *__pyx_tuple__228; +static PyObject *__pyx_tuple__230; +static PyObject *__pyx_tuple__232; +static PyObject *__pyx_tuple__234; +static PyObject *__pyx_tuple__236; +static PyObject *__pyx_tuple__238; +static PyObject *__pyx_tuple__240; +static PyObject *__pyx_tuple__242; +static PyObject *__pyx_tuple__244; +static PyObject *__pyx_tuple__246; +static PyObject *__pyx_tuple__248; +static PyObject *__pyx_tuple__250; +static PyObject *__pyx_tuple__252; +static PyObject *__pyx_tuple__254; +static PyObject *__pyx_tuple__255; +static PyObject *__pyx_tuple__256; +static PyObject *__pyx_tuple__257; +static PyObject *__pyx_tuple__258; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__79; +static PyObject *__pyx_codeobj__81; +static PyObject *__pyx_codeobj__83; +static PyObject *__pyx_codeobj__85; +static PyObject *__pyx_codeobj__87; +static PyObject *__pyx_codeobj__89; +static PyObject *__pyx_codeobj__91; +static PyObject *__pyx_codeobj__93; +static PyObject *__pyx_codeobj__95; +static PyObject *__pyx_codeobj__97; +static PyObject *__pyx_codeobj__99; +static PyObject *__pyx_codeobj__101; +static PyObject *__pyx_codeobj__103; +static PyObject *__pyx_codeobj__105; +static PyObject *__pyx_codeobj__107; +static PyObject *__pyx_codeobj__109; +static PyObject *__pyx_codeobj__111; +static PyObject *__pyx_codeobj__113; +static PyObject *__pyx_codeobj__115; +static PyObject *__pyx_codeobj__117; +static PyObject *__pyx_codeobj__119; +static PyObject *__pyx_codeobj__121; +static PyObject *__pyx_codeobj__123; +static PyObject *__pyx_codeobj__125; +static PyObject *__pyx_codeobj__127; +static PyObject *__pyx_codeobj__129; +static PyObject *__pyx_codeobj__131; +static PyObject *__pyx_codeobj__133; +static PyObject *__pyx_codeobj__135; +static PyObject *__pyx_codeobj__137; +static PyObject *__pyx_codeobj__139; +static PyObject *__pyx_codeobj__141; +static PyObject *__pyx_codeobj__143; +static PyObject *__pyx_codeobj__145; +static PyObject *__pyx_codeobj__147; +static PyObject *__pyx_codeobj__149; +static PyObject *__pyx_codeobj__151; +static PyObject *__pyx_codeobj__153; +static PyObject *__pyx_codeobj__155; +static PyObject *__pyx_codeobj__157; +static PyObject *__pyx_codeobj__159; +static PyObject *__pyx_codeobj__161; +static PyObject *__pyx_codeobj__163; +static PyObject *__pyx_codeobj__165; +static PyObject *__pyx_codeobj__167; +static PyObject *__pyx_codeobj__169; +static PyObject *__pyx_codeobj__171; +static PyObject *__pyx_codeobj__173; +static PyObject *__pyx_codeobj__175; +static PyObject *__pyx_codeobj__177; +static PyObject *__pyx_codeobj__179; +static PyObject *__pyx_codeobj__181; +static PyObject *__pyx_codeobj__183; +static PyObject *__pyx_codeobj__185; +static PyObject *__pyx_codeobj__187; +static PyObject *__pyx_codeobj__189; +static PyObject *__pyx_codeobj__191; +static PyObject *__pyx_codeobj__193; +static PyObject *__pyx_codeobj__195; +static PyObject *__pyx_codeobj__197; +static PyObject *__pyx_codeobj__199; +static PyObject *__pyx_codeobj__201; +static PyObject *__pyx_codeobj__203; +static PyObject *__pyx_codeobj__205; +static PyObject *__pyx_codeobj__207; +static PyObject *__pyx_codeobj__209; +static PyObject *__pyx_codeobj__211; +static PyObject *__pyx_codeobj__213; +static PyObject *__pyx_codeobj__215; +static PyObject *__pyx_codeobj__217; +static PyObject *__pyx_codeobj__219; +static PyObject *__pyx_codeobj__221; +static PyObject *__pyx_codeobj__223; +static PyObject *__pyx_codeobj__225; +static PyObject *__pyx_codeobj__227; +static PyObject *__pyx_codeobj__229; +static PyObject *__pyx_codeobj__231; +static PyObject *__pyx_codeobj__233; +static PyObject *__pyx_codeobj__235; +static PyObject *__pyx_codeobj__237; +static PyObject *__pyx_codeobj__239; +static PyObject *__pyx_codeobj__241; +static PyObject *__pyx_codeobj__243; +static PyObject *__pyx_codeobj__245; +static PyObject *__pyx_codeobj__247; +static PyObject *__pyx_codeobj__249; +static PyObject *__pyx_codeobj__251; +static PyObject *__pyx_codeobj__253; + +/* "pandas/lib.pyx":75 + * import_ufunc() + * + * def values_from_object(object o): # <<<<<<<<<<<<<< + * """ return my values or the object if we are say an ndarray """ + * cdef f + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_1values_from_object(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/ +static char __pyx_doc_6pandas_3lib_values_from_object[] = " return my values or the object if we are say an ndarray "; +static PyMethodDef __pyx_mdef_6pandas_3lib_1values_from_object = {__Pyx_NAMESTR("values_from_object"), (PyCFunction)__pyx_pw_6pandas_3lib_1values_from_object, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_values_from_object)}; +static PyObject *__pyx_pw_6pandas_3lib_1values_from_object(PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("values_from_object (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_values_from_object(__pyx_self, ((PyObject *)__pyx_v_o)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_values_from_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_v_f = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("values_from_object", 0); + __Pyx_INCREF(__pyx_v_o); + + /* "pandas/lib.pyx":79 + * cdef f + * + * f = getattr(o, 'get_values', None) # <<<<<<<<<<<<<< + * if f is not None: + * o = f() + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_o, __pyx_n_s_get_values, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_f = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":80 + * + * f = getattr(o, 'get_values', None) + * if f is not None: # <<<<<<<<<<<<<< + * o = f() + * + */ + __pyx_t_2 = (__pyx_v_f != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":81 + * f = getattr(o, 'get_values', None) + * if f is not None: + * o = f() # <<<<<<<<<<<<<< + * + * return o + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_o, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":83 + * o = f() + * + * return o # <<<<<<<<<<<<<< + * + * cpdef map_indices_list(list index): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_o); + __pyx_r = __pyx_v_o; + goto __pyx_L0; + + /* "pandas/lib.pyx":75 + * import_ufunc() + * + * def values_from_object(object o): # <<<<<<<<<<<<<< + * """ return my values or the object if we are say an ndarray """ + * cdef f + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.values_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":85 + * return o + * + * cpdef map_indices_list(list index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_3lib_3map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_map_indices_list(PyObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_list", 0); + + /* "pandas/lib.pyx":96 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":98 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < length: + */ + if (unlikely(__pyx_v_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(__pyx_v_index); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/lib.pyx":100 + * length = len(index) + * + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/lib.pyx":101 + * + * for i from 0 <= i < length: + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_index, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_3, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/lib.pyx":103 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/lib.pyx":85 + * return o + * + * cpdef map_indices_list(list index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.map_indices_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_3map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_3lib_2map_indices_list[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_3lib_3map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_list (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyList_Type), 1, "index", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_2map_indices_list(__pyx_self, ((PyObject*)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_2map_indices_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_list", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_map_indices_list(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.map_indices_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":109 + * + * + * def ismember_nans(float64_t[:] arr, set values, bint hasnans): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_5ismember_nans(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_5ismember_nans = {__Pyx_NAMESTR("ismember_nans"), (PyCFunction)__pyx_pw_6pandas_3lib_5ismember_nans, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_5ismember_nans(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_values = 0; + int __pyx_v_hasnans; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ismember_nans (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_values,&__pyx_n_s_hasnans,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ismember_nans", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hasnans)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ismember_nans", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ismember_nans") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_values = ((PyObject*)values[1]); + __pyx_v_hasnans = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_hasnans == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ismember_nans", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.ismember_nans", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PySet_Type), 1, "values", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_4ismember_nans(__pyx_self, __pyx_v_arr, __pyx_v_values, __pyx_v_hasnans); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_4ismember_nans(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr, PyObject *__pyx_v_values, int __pyx_v_hasnans) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_float64_t __pyx_v_val; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + __pyx_t_5numpy_uint8_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ismember_nans", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":115 + * float64_t val + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":116 + * + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i in range(n): + * val = arr[i] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":117 + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * result[i] = val in values or hasnans and isnan(val) + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":118 + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * result[i] = val in values or hasnans and isnan(val) + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_v_arr.shape[0]; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_v_arr.shape[0])) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_arr.data + __pyx_t_13 * __pyx_v_arr.strides[0]) ))); + + /* "pandas/lib.pyx":119 + * for i in range(n): + * val = arr[i] + * result[i] = val in values or hasnans and isnan(val) # <<<<<<<<<<<<<< + * + * return result.view(np.bool_) + */ + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = (__Pyx_PySequence_Contains(__pyx_t_6, __pyx_v_values, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_14); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_14) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_hasnans); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_14) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_5 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_15 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_15 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + } + + /* "pandas/lib.pyx":121 + * result[i] = val in values or hasnans and isnan(val) + * + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":109 + * + * + * def ismember_nans(float64_t[:] arr, set values, bint hasnans): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.ismember_nans", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":124 + * + * + * def ismember(ndarray arr, set values): # <<<<<<<<<<<<<< + * ''' + * Checks whether + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_7ismember(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_6ismember[] = "\n Checks whether\n\n Parameters\n ----------\n arr : ndarray\n values : set\n\n Returns\n -------\n ismember : ndarray (boolean dtype)\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_7ismember = {__Pyx_NAMESTR("ismember"), (PyCFunction)__pyx_pw_6pandas_3lib_7ismember, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_6ismember)}; +static PyObject *__pyx_pw_6pandas_3lib_7ismember(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_values = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ismember (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_values,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ismember", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ismember") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_values = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ismember", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.ismember", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PySet_Type), 1, "values", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_6ismember(__pyx_self, __pyx_v_arr, __pyx_v_values); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_6ismember(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ismember", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":142 + * object val + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":143 + * + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i in range(n): + * val = util.get_value_at(arr, i) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":144 + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_at(arr, i) + * result[i] = val in values + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":145 + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): + * val = util.get_value_at(arr, i) # <<<<<<<<<<<<<< + * result[i] = val in values + * + */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":146 + * for i in range(n): + * val = util.get_value_at(arr, i) + * result[i] = val in values # <<<<<<<<<<<<<< + * + * return result.view(np.bool_) + */ + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_values, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_13; + } + + /* "pandas/lib.pyx":148 + * result[i] = val in values + * + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":124 + * + * + * def ismember(ndarray arr, set values): # <<<<<<<<<<<<<< + * ''' + * Checks whether + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.ismember", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":157 + * from datetime import date as pydate + * + * cdef inline int64_t gmtime(object date): # <<<<<<<<<<<<<< + * cdef int y, m, d, h, mn, s, days + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_gmtime(PyObject *__pyx_v_date) { + int __pyx_v_y; + int __pyx_v_m; + int __pyx_v_d; + int __pyx_v_h; + int __pyx_v_mn; + int __pyx_v_s; + int __pyx_v_days; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("gmtime", 0); + + /* "pandas/lib.pyx":160 + * cdef int y, m, d, h, mn, s, days + * + * y = PyDateTime_GET_YEAR(date) # <<<<<<<<<<<<<< + * m = PyDateTime_GET_MONTH(date) + * d = PyDateTime_GET_DAY(date) + */ + if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_y = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_date)); + + /* "pandas/lib.pyx":161 + * + * y = PyDateTime_GET_YEAR(date) + * m = PyDateTime_GET_MONTH(date) # <<<<<<<<<<<<<< + * d = PyDateTime_GET_DAY(date) + * h = PyDateTime_DATE_GET_HOUR(date) + */ + if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_m = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_date)); + + /* "pandas/lib.pyx":162 + * y = PyDateTime_GET_YEAR(date) + * m = PyDateTime_GET_MONTH(date) + * d = PyDateTime_GET_DAY(date) # <<<<<<<<<<<<<< + * h = PyDateTime_DATE_GET_HOUR(date) + * mn = PyDateTime_DATE_GET_MINUTE(date) + */ + if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_d = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_date)); + + /* "pandas/lib.pyx":163 + * m = PyDateTime_GET_MONTH(date) + * d = PyDateTime_GET_DAY(date) + * h = PyDateTime_DATE_GET_HOUR(date) # <<<<<<<<<<<<<< + * mn = PyDateTime_DATE_GET_MINUTE(date) + * s = PyDateTime_DATE_GET_SECOND(date) + */ + __pyx_v_h = PyDateTime_DATE_GET_HOUR(__pyx_v_date); + + /* "pandas/lib.pyx":164 + * d = PyDateTime_GET_DAY(date) + * h = PyDateTime_DATE_GET_HOUR(date) + * mn = PyDateTime_DATE_GET_MINUTE(date) # <<<<<<<<<<<<<< + * s = PyDateTime_DATE_GET_SECOND(date) + * + */ + __pyx_v_mn = PyDateTime_DATE_GET_MINUTE(__pyx_v_date); + + /* "pandas/lib.pyx":165 + * h = PyDateTime_DATE_GET_HOUR(date) + * mn = PyDateTime_DATE_GET_MINUTE(date) + * s = PyDateTime_DATE_GET_SECOND(date) # <<<<<<<<<<<<<< + * + * days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1 + */ + __pyx_v_s = PyDateTime_DATE_GET_SECOND(__pyx_v_date); + + /* "pandas/lib.pyx":167 + * s = PyDateTime_DATE_GET_SECOND(date) + * + * days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1 # <<<<<<<<<<<<<< + * return (( (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000 + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_6pandas_3lib__EPOCH_ORD); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_d); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_days = __pyx_t_5; + + /* "pandas/lib.pyx":168 + * + * days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1 + * return (( (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000 # <<<<<<<<<<<<<< + * + * cpdef object to_datetime(int64_t timestamp): + */ + __pyx_r = (((((__pyx_t_5numpy_int64_t)((((__pyx_v_days * 24) + __pyx_v_h) * 60) + __pyx_v_mn)) * 60) + __pyx_v_s) * 1000); + goto __pyx_L0; + + /* "pandas/lib.pyx":157 + * from datetime import date as pydate + * + * cdef inline int64_t gmtime(object date): # <<<<<<<<<<<<<< + * cdef int y, m, d, h, mn, s, days + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.lib.gmtime", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":170 + * return (( (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000 + * + * cpdef object to_datetime(int64_t timestamp): # <<<<<<<<<<<<<< + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) + * + */ + +static PyObject *__pyx_pw_6pandas_3lib_9to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_timestamp, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_datetime", 0); + + /* "pandas/lib.pyx":171 + * + * cpdef object to_datetime(int64_t timestamp): + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) # <<<<<<<<<<<<<< + * + * cpdef object to_timestamp(object dt): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydatetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_utcfromtimestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_timestamp / 1000.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":170 + * return (( (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000 + * + * cpdef object to_datetime(int64_t timestamp): # <<<<<<<<<<<<<< + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_9to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_9to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp) { + __pyx_t_5numpy_int64_t __pyx_v_timestamp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_datetime (wrapper)", 0); + assert(__pyx_arg_timestamp); { + __pyx_v_timestamp = __Pyx_PyInt_As_npy_int64(__pyx_arg_timestamp); if (unlikely((__pyx_v_timestamp == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_8to_datetime(__pyx_self, ((__pyx_t_5numpy_int64_t)__pyx_v_timestamp)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_8to_datetime(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_timestamp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_datetime", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_to_datetime(__pyx_v_timestamp, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":173 + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) + * + * cpdef object to_timestamp(object dt): # <<<<<<<<<<<<<< + * return gmtime(dt) + * + */ + +static PyObject *__pyx_pw_6pandas_3lib_11to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_to_timestamp(PyObject *__pyx_v_dt, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_timestamp", 0); + + /* "pandas/lib.pyx":174 + * + * cpdef object to_timestamp(object dt): + * return gmtime(dt) # <<<<<<<<<<<<<< + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_f_6pandas_3lib_gmtime(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":173 + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) + * + * cpdef object to_timestamp(object dt): # <<<<<<<<<<<<<< + * return gmtime(dt) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_timestamp (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_10to_timestamp(__pyx_self, ((PyObject *)__pyx_v_dt)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_10to_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dt) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_timestamp", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_to_timestamp(__pyx_v_dt, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":176 + * return gmtime(dt) + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[int64_t, ndim=1] result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13array_to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_13array_to_timestamp = {__Pyx_NAMESTR("array_to_timestamp"), (PyCFunction)__pyx_pw_6pandas_3lib_13array_to_timestamp, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_13array_to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("array_to_timestamp (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_12array_to_timestamp(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_12array_to_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + int __pyx_v_i; + int __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_to_timestamp", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":180 + * cdef ndarray[int64_t, ndim=1] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.int64) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":181 + * + * n = len(arr) + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":183 + * result = np.empty(n, dtype=np.int64) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = gmtime(arr[i]) + * + */ + __pyx_t_8 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) { + + /* "pandas/lib.pyx":184 + * + * for i from 0 <= i < n: + * result[i] = gmtime(arr[i]) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_3lib_gmtime(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "pandas/lib.pyx":186 + * result[i] = gmtime(arr[i]) + * + * return result # <<<<<<<<<<<<<< + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":176 + * return gmtime(dt) + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[int64_t, ndim=1] result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.array_to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":188 + * return result + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[object, ndim=1] result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_15time64_to_datetime(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_15time64_to_datetime = {__Pyx_NAMESTR("time64_to_datetime"), (PyCFunction)__pyx_pw_6pandas_3lib_15time64_to_datetime, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_15time64_to_datetime(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time64_to_datetime (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_14time64_to_datetime(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14time64_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + int __pyx_v_i; + int __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + PyObject **__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("time64_to_datetime", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":192 + * cdef ndarray[object, ndim=1] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=object) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":193 + * + * n = len(arr) + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":195 + * result = np.empty(n, dtype=object) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = to_datetime(arr[i]) + * + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":196 + * + * for i from 0 <= i < n: + * result[i] = to_datetime(arr[i]) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __pyx_f_6pandas_3lib_to_datetime((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)), 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_14); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_14); + *__pyx_t_14 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_14); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/lib.pyx":198 + * result[i] = to_datetime(arr[i]) + * + * return result # <<<<<<<<<<<<<< + * + * cdef inline int64_t get_timedelta64_value(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":188 + * return result + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[object, ndim=1] result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.time64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":200 + * return result + * + * cdef inline int64_t get_timedelta64_value(val): # <<<<<<<<<<<<<< + * return val.view('i8') + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_get_timedelta64_value(PyObject *__pyx_v_val) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_timedelta64_value", 0); + + /* "pandas/lib.pyx":201 + * + * cdef inline int64_t get_timedelta64_value(val): + * return val.view('i8') # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/lib.pyx":200 + * return result + * + * cdef inline int64_t get_timedelta64_value(val): # <<<<<<<<<<<<<< + * return val.view('i8') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.lib.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":209 + * cdef double NEGINF = -INF + * + * cpdef checknull(object val): # <<<<<<<<<<<<<< + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val # and val != INF and val != NEGINF + */ + +static PyObject *__pyx_pw_6pandas_3lib_17checknull(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_checknull(PyObject *__pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("checknull", 0); + + /* "pandas/lib.pyx":210 + * + * cpdef checknull(object val): + * if util.is_float_object(val) or util.is_complex_object(val): # <<<<<<<<<<<<<< + * return val != val # and val != INF and val != NEGINF + * elif util.is_datetime64_object(val): + */ + __pyx_t_1 = (is_float_object(__pyx_v_val) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = (is_complex_object(__pyx_v_val) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/lib.pyx":211 + * cpdef checknull(object val): + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val # and val != INF and val != NEGINF # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":212 + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val # and val != INF and val != NEGINF + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: + */ + __pyx_t_3 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":213 + * return val != val # and val != INF and val != NEGINF + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT # <<<<<<<<<<<<<< + * elif val is NaT: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong((get_datetime64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":214 + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: # <<<<<<<<<<<<<< + * return True + * elif util.is_timedelta64_object(val): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_val == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":215 + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: + * return True # <<<<<<<<<<<<<< + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":216 + * elif val is NaT: + * return True + * elif util.is_timedelta64_object(val): # <<<<<<<<<<<<<< + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): + */ + __pyx_t_1 = (is_timedelta64_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":217 + * return True + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT # <<<<<<<<<<<<<< + * elif is_array(val): + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_f_6pandas_3lib_get_timedelta64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":218 + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): # <<<<<<<<<<<<<< + * return False + * else: + */ + __pyx_t_4 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "pandas/lib.pyx":219 + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): + * return False # <<<<<<<<<<<<<< + * else: + * return _checknull(val) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":221 + * return False + * else: + * return _checknull(val) # <<<<<<<<<<<<<< + * + * cpdef checknull_old(object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_f_4util__checknull(__pyx_v_val)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":209 + * cdef double NEGINF = -INF + * + * cpdef checknull(object val): # <<<<<<<<<<<<<< + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val # and val != INF and val != NEGINF + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_17checknull(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_17checknull(PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("checknull (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16checknull(__pyx_self, ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16checknull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("checknull", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_checknull(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":223 + * return _checknull(val) + * + * cpdef checknull_old(object val): # <<<<<<<<<<<<<< + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val or val == INF or val == NEGINF + */ + +static PyObject *__pyx_pw_6pandas_3lib_19checknull_old(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_checknull_old(PyObject *__pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("checknull_old", 0); + + /* "pandas/lib.pyx":224 + * + * cpdef checknull_old(object val): + * if util.is_float_object(val) or util.is_complex_object(val): # <<<<<<<<<<<<<< + * return val != val or val == INF or val == NEGINF + * elif util.is_datetime64_object(val): + */ + __pyx_t_1 = (is_float_object(__pyx_v_val) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = (is_complex_object(__pyx_v_val) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/lib.pyx":225 + * cpdef checknull_old(object val): + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_3) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_6pandas_3lib_INF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_val, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_3) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_6pandas_3lib_NEGINF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_5 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __pyx_t_6 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":226 + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val or val == INF or val == NEGINF + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: + */ + __pyx_t_3 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":227 + * return val != val or val == INF or val == NEGINF + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT # <<<<<<<<<<<<<< + * elif val is NaT: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong((get_datetime64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":228 + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: # <<<<<<<<<<<<<< + * return True + * elif util.is_timedelta64_object(val): + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__pyx_v_val == __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":229 + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: + * return True # <<<<<<<<<<<<<< + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":230 + * elif val is NaT: + * return True + * elif util.is_timedelta64_object(val): # <<<<<<<<<<<<<< + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): + */ + __pyx_t_1 = (is_timedelta64_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":231 + * return True + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT # <<<<<<<<<<<<<< + * elif is_array(val): + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong((__pyx_f_6pandas_3lib_get_timedelta64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":232 + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): # <<<<<<<<<<<<<< + * return False + * else: + */ + __pyx_t_6 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_1) { + + /* "pandas/lib.pyx":233 + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): + * return False # <<<<<<<<<<<<<< + * else: + * return util._checknull(val) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":235 + * return False + * else: + * return util._checknull(val) # <<<<<<<<<<<<<< + * + * def isscalar(object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_f_4util__checknull(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":223 + * return _checknull(val) + * + * cpdef checknull_old(object val): # <<<<<<<<<<<<<< + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val or val == INF or val == NEGINF + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_19checknull_old(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_19checknull_old(PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("checknull_old (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_18checknull_old(__pyx_self, ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_18checknull_old(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("checknull_old", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_checknull_old(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":237 + * return util._checknull(val) + * + * def isscalar(object val): # <<<<<<<<<<<<<< + * return np.isscalar(val) or val is None or PyDateTime_Check(val) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_21isscalar(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_21isscalar = {__Pyx_NAMESTR("isscalar"), (PyCFunction)__pyx_pw_6pandas_3lib_21isscalar, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_21isscalar(PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isscalar (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_20isscalar(__pyx_self, ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_20isscalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isscalar", 0); + + /* "pandas/lib.pyx":238 + * + * def isscalar(object val): + * return np.isscalar(val) or val is None or PyDateTime_Check(val) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = (__pyx_v_val == Py_None); + if (!__pyx_t_4) { + __pyx_t_5 = PyDateTime_Check(__pyx_v_val); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":237 + * return util._checknull(val) + * + * def isscalar(object val): # <<<<<<<<<<<<<< + * return np.isscalar(val) or val is None or PyDateTime_Check(val) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.isscalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":243 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23isnullobj(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23isnullobj = {__Pyx_NAMESTR("isnullobj"), (PyCFunction)__pyx_pw_6pandas_3lib_23isnullobj, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23isnullobj(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_22isnullobj(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_22isnullobj(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_arobj = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":248 + * cdef ndarray[uint8_t] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":249 + * + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * arobj = arr[i] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":250 + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * arobj = arr[i] + * result[i] = arobj is NaT or _checknull(arobj) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":251 + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + * arobj = arr[i] # <<<<<<<<<<<<<< + * result[i] = arobj is NaT or _checknull(arobj) + * return result.view(np.bool_) + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_arobj, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":252 + * for i from 0 <= i < n: + * arobj = arr[i] + * result[i] = arobj is NaT or _checknull(arobj) # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = (__pyx_v_arobj == __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_13) { + __pyx_t_14 = __pyx_f_4util__checknull(__pyx_v_arobj); + __pyx_t_15 = __pyx_t_14; + } else { + __pyx_t_15 = __pyx_t_13; + } + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + } + + /* "pandas/lib.pyx":253 + * arobj = arr[i] + * result[i] = arobj is NaT or _checknull(arobj) + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":243 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_arobj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":257 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_25isnullobj_old(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_25isnullobj_old = {__Pyx_NAMESTR("isnullobj_old"), (PyCFunction)__pyx_pw_6pandas_3lib_25isnullobj_old, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_25isnullobj_old(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj_old (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_24isnullobj_old(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_24isnullobj_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj_old", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":262 + * cdef ndarray[uint8_t] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":263 + * + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":264 + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = util._checknull_old(arr[i]) + * return result.view(np.bool_) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":265 + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_13 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_4util__checknull_old(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "pandas/lib.pyx":266 + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":257 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":271 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_27isnullobj2d(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_27isnullobj2d = {__Pyx_NAMESTR("isnullobj2d"), (PyCFunction)__pyx_pw_6pandas_3lib_27isnullobj2d, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_27isnullobj2d(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj2d (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_26isnullobj2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_26isnullobj2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_m; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj2d", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + + /* "pandas/lib.pyx":276 + * cdef ndarray[uint8_t, ndim=2] result + * + * n, m = ( arr).shape # <<<<<<<<<<<<<< + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_m = __pyx_t_7; + + /* "pandas/lib.pyx":277 + * + * n, m = ( arr).shape + * result = np.zeros((n, m), dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * for j from 0 <= j < m: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":278 + * n, m = ( arr).shape + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < m: + * val = arr[i, j] + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":279 + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: + * for j from 0 <= j < m: # <<<<<<<<<<<<<< + * val = arr[i, j] + * if checknull(val): + */ + __pyx_t_6 = __pyx_v_m; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/lib.pyx":280 + * for i from 0 <= i < n: + * for j from 0 <= j < m: + * val = arr[i, j] # <<<<<<<<<<<<<< + * if checknull(val): + * result[i, j] = 1 + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_arr.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":281 + * for j from 0 <= j < m: + * val = arr[i, j] + * if checknull(val): # <<<<<<<<<<<<<< + * result[i, j] = 1 + * return result.view(np.bool_) + */ + __pyx_t_8 = __pyx_f_6pandas_3lib_checknull(__pyx_v_val, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_16) { + + /* "pandas/lib.pyx":282 + * val = arr[i, j] + * if checknull(val): + * result[i, j] = 1 # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_result.diminfo[1].strides) = 1; + goto __pyx_L9; + } + __pyx_L9:; + } + } + + /* "pandas/lib.pyx":283 + * if checknull(val): + * result[i, j] = 1 + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":271 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj2d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":287 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_29isnullobj_old(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_29isnullobj_old = {__Pyx_NAMESTR("isnullobj_old"), (PyCFunction)__pyx_pw_6pandas_3lib_29isnullobj_old, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_29isnullobj_old(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj_old (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_28isnullobj_old(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_28isnullobj_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj_old", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":292 + * cdef ndarray[uint8_t] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":293 + * + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":294 + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = util._checknull_old(arr[i]) + * return result.view(np.bool_) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":295 + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_13 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_4util__checknull_old(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "pandas/lib.pyx":296 + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":287 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d_old(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_31isnullobj2d_old(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_31isnullobj2d_old = {__Pyx_NAMESTR("isnullobj2d_old"), (PyCFunction)__pyx_pw_6pandas_3lib_31isnullobj2d_old, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_31isnullobj2d_old(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj2d_old (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_30isnullobj2d_old(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_30isnullobj2d_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_m; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj2d_old", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + + /* "pandas/lib.pyx":306 + * cdef ndarray[uint8_t, ndim=2] result + * + * n, m = ( arr).shape # <<<<<<<<<<<<<< + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_m = __pyx_t_7; + + /* "pandas/lib.pyx":307 + * + * n, m = ( arr).shape + * result = np.zeros((n, m), dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * for j from 0 <= j < m: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":308 + * n, m = ( arr).shape + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < m: + * val = arr[i, j] + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":309 + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: + * for j from 0 <= j < m: # <<<<<<<<<<<<<< + * val = arr[i, j] + * if checknull_old(val): + */ + __pyx_t_6 = __pyx_v_m; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/lib.pyx":310 + * for i from 0 <= i < n: + * for j from 0 <= j < m: + * val = arr[i, j] # <<<<<<<<<<<<<< + * if checknull_old(val): + * result[i, j] = 1 + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_arr.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":311 + * for j from 0 <= j < m: + * val = arr[i, j] + * if checknull_old(val): # <<<<<<<<<<<<<< + * result[i, j] = 1 + * return result.view(np.bool_) + */ + __pyx_t_8 = __pyx_f_6pandas_3lib_checknull_old(__pyx_v_val, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_16) { + + /* "pandas/lib.pyx":312 + * val = arr[i, j] + * if checknull_old(val): + * result[i, j] = 1 # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_result.diminfo[1].strides) = 1; + goto __pyx_L9; + } + __pyx_L9:; + } + } + + /* "pandas/lib.pyx":313 + * if checknull_old(val): + * result[i, j] = 1 + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * def list_to_object_array(list obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d_old(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj2d_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":315 + * return result.view(np.bool_) + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_33list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6pandas_3lib_32list_to_object_array[] = "\n Convert list to object ndarray. Seriously can't believe I had to write this\n function\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_33list_to_object_array = {__Pyx_NAMESTR("list_to_object_array"), (PyCFunction)__pyx_pw_6pandas_3lib_33list_to_object_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_32list_to_object_array)}; +static PyObject *__pyx_pw_6pandas_3lib_33list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_to_object_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_32list_to_object_array(__pyx_self, ((PyObject*)__pyx_v_obj)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_32list_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_arr = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject **__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_to_object_array", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + + /* "pandas/lib.pyx":324 + * ndarray[object] arr + * + * n = len(obj) # <<<<<<<<<<<<<< + * arr = np.empty(n, dtype=object) + * + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":325 + * + * n = len(obj) + * arr = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_arr = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":327 + * arr = np.empty(n, dtype=object) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * arr[i] = obj[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":328 + * + * for i from 0 <= i < n: + * arr[i] = obj[i] # <<<<<<<<<<<<<< + * + * return arr + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_12); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_12); + *__pyx_t_12 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/lib.pyx":330 + * arr[i] = obj[i] + * + * return arr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/lib.pyx":315 + * return result.view(np.bool_) + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.list_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":335 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_35fast_unique(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_35fast_unique = {__Pyx_NAMESTR("fast_unique"), (PyCFunction)__pyx_pw_6pandas_3lib_35fast_unique, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_35fast_unique(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_34fast_unique(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_34fast_unique(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_table = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_stub = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":337 + * def fast_unique(ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * list uniques = [] + * dict table = {} + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":338 + * cdef: + * Py_ssize_t i, n = len(values) + * list uniques = [] # <<<<<<<<<<<<<< + * dict table = {} + * object val, stub = 0 + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":339 + * Py_ssize_t i, n = len(values) + * list uniques = [] + * dict table = {} # <<<<<<<<<<<<<< + * object val, stub = 0 + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_table = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":340 + * list uniques = [] + * dict table = {} + * object val, stub = 0 # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_stub = __pyx_int_0; + + /* "pandas/lib.pyx":342 + * object val, stub = 0 + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = values[i] + * if val not in table: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":343 + * + * for i from 0 <= i < n: + * val = values[i] # <<<<<<<<<<<<<< + * if val not in table: + * table[val] = stub + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":344 + * for i from 0 <= i < n: + * val = values[i] + * if val not in table: # <<<<<<<<<<<<<< + * table[val] = stub + * uniques.append(val) + */ + __pyx_t_4 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_table, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":345 + * val = values[i] + * if val not in table: + * table[val] = stub # <<<<<<<<<<<<<< + * uniques.append(val) + * try: + */ + if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_v_val, __pyx_v_stub) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":346 + * if val not in table: + * table[val] = stub + * uniques.append(val) # <<<<<<<<<<<<<< + * try: + * uniques.sort() + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":347 + * table[val] = stub + * uniques.append(val) + * try: # <<<<<<<<<<<<<< + * uniques.sort() + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/lib.pyx":348 + * uniques.append(val) + * try: + * uniques.sort() # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_6 = PyList_Sort(__pyx_v_uniques); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":349 + * try: + * uniques.sort() + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L13_try_end:; + } + + /* "pandas/lib.pyx":352 + * pass + * + * return uniques # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_uniques); + __pyx_r = __pyx_v_uniques; + goto __pyx_L0; + + /* "pandas/lib.pyx":335 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_table); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_stub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":356 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple(list arrays): # <<<<<<<<<<<<<< + * cdef: + * ndarray[object] buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_37fast_unique_multiple(PyObject *__pyx_self, PyObject *__pyx_v_arrays); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_37fast_unique_multiple = {__Pyx_NAMESTR("fast_unique_multiple"), (PyCFunction)__pyx_pw_6pandas_3lib_37fast_unique_multiple, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_37fast_unique_multiple(PyObject *__pyx_self, PyObject *__pyx_v_arrays) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_unique_multiple (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arrays), (&PyList_Type), 1, "arrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_36fast_unique_multiple(__pyx_self, ((PyObject*)__pyx_v_arrays)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_36fast_unique_multiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays) { + PyArrayObject *__pyx_v_buf = 0; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_table = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_stub = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_buf; + __Pyx_Buffer __pyx_pybuffer_buf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_unique_multiple", 0); + __pyx_pybuffer_buf.pybuffer.buf = NULL; + __pyx_pybuffer_buf.refcount = 0; + __pyx_pybuffernd_buf.data = NULL; + __pyx_pybuffernd_buf.rcbuffer = &__pyx_pybuffer_buf; + + /* "pandas/lib.pyx":359 + * cdef: + * ndarray[object] buf + * Py_ssize_t k = len(arrays) # <<<<<<<<<<<<<< + * Py_ssize_t i, j, n + * list uniques = [] + */ + if (unlikely(__pyx_v_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":361 + * Py_ssize_t k = len(arrays) + * Py_ssize_t i, j, n + * list uniques = [] # <<<<<<<<<<<<<< + * dict table = {} + * object val, stub = 0 + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":362 + * Py_ssize_t i, j, n + * list uniques = [] + * dict table = {} # <<<<<<<<<<<<<< + * object val, stub = 0 + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_table = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":363 + * list uniques = [] + * dict table = {} + * object val, stub = 0 # <<<<<<<<<<<<<< + * + * for i from 0 <= i < k: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_stub = __pyx_int_0; + + /* "pandas/lib.pyx":365 + * object val, stub = 0 + * + * for i from 0 <= i < k: # <<<<<<<<<<<<<< + * buf = arrays[i] + * n = len(buf) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":366 + * + * for i from 0 <= i < k: + * buf = arrays[i] # <<<<<<<<<<<<<< + * n = len(buf) + * for j from 0 <= j < n: + */ + if (unlikely(__pyx_v_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buf.rcbuffer->pybuffer, (PyObject*)__pyx_v_buf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_buf.diminfo[0].strides = __pyx_pybuffernd_buf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buf.diminfo[0].shape = __pyx_pybuffernd_buf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_XDECREF_SET(__pyx_v_buf, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":367 + * for i from 0 <= i < k: + * buf = arrays[i] + * n = len(buf) # <<<<<<<<<<<<<< + * for j from 0 <= j < n: + * val = buf[j] + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_buf)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_7; + + /* "pandas/lib.pyx":368 + * buf = arrays[i] + * n = len(buf) + * for j from 0 <= j < n: # <<<<<<<<<<<<<< + * val = buf[j] + * if val not in table: + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/lib.pyx":369 + * n = len(buf) + * for j from 0 <= j < n: + * val = buf[j] # <<<<<<<<<<<<<< + * if val not in table: + * table[val] = stub + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_buf.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_buf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":370 + * for j from 0 <= j < n: + * val = buf[j] + * if val not in table: # <<<<<<<<<<<<<< + * table[val] = stub + * uniques.append(val) + */ + __pyx_t_9 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_table, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "pandas/lib.pyx":371 + * val = buf[j] + * if val not in table: + * table[val] = stub # <<<<<<<<<<<<<< + * uniques.append(val) + * try: + */ + if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_v_val, __pyx_v_stub) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":372 + * if val not in table: + * table[val] = stub + * uniques.append(val) # <<<<<<<<<<<<<< + * try: + * uniques.sort() + */ + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + __pyx_L7:; + } + } + + /* "pandas/lib.pyx":373 + * table[val] = stub + * uniques.append(val) + * try: # <<<<<<<<<<<<<< + * uniques.sort() + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/lib.pyx":374 + * uniques.append(val) + * try: + * uniques.sort() # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_11 = PyList_Sort(__pyx_v_uniques); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":375 + * try: + * uniques.sort() + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_3) { + PyErr_Restore(0,0,0); + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_L15_try_end:; + } + + /* "pandas/lib.pyx":378 + * pass + * + * return uniques # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_uniques); + __pyx_r = __pyx_v_uniques; + goto __pyx_L0; + + /* "pandas/lib.pyx":356 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple(list arrays): # <<<<<<<<<<<<<< + * cdef: + * ndarray[object] buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_unique_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_buf); + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_table); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_stub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":382 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list(list lists): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_39fast_unique_multiple_list(PyObject *__pyx_self, PyObject *__pyx_v_lists); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_39fast_unique_multiple_list = {__Pyx_NAMESTR("fast_unique_multiple_list"), (PyCFunction)__pyx_pw_6pandas_3lib_39fast_unique_multiple_list, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_39fast_unique_multiple_list(PyObject *__pyx_self, PyObject *__pyx_v_lists) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_unique_multiple_list (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lists), (&PyList_Type), 1, "lists", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_38fast_unique_multiple_list(__pyx_self, ((PyObject*)__pyx_v_lists)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_38fast_unique_multiple_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lists) { + PyObject *__pyx_v_buf = 0; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_table = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_stub = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_unique_multiple_list", 0); + + /* "pandas/lib.pyx":385 + * cdef: + * list buf + * Py_ssize_t k = len(lists) # <<<<<<<<<<<<<< + * Py_ssize_t i, j, n + * list uniques = [] + */ + if (unlikely(__pyx_v_lists == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_lists); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":387 + * Py_ssize_t k = len(lists) + * Py_ssize_t i, j, n + * list uniques = [] # <<<<<<<<<<<<<< + * dict table = {} + * object val, stub = 0 + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":388 + * Py_ssize_t i, j, n + * list uniques = [] + * dict table = {} # <<<<<<<<<<<<<< + * object val, stub = 0 + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_table = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":389 + * list uniques = [] + * dict table = {} + * object val, stub = 0 # <<<<<<<<<<<<<< + * + * for i from 0 <= i < k: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_stub = __pyx_int_0; + + /* "pandas/lib.pyx":391 + * object val, stub = 0 + * + * for i from 0 <= i < k: # <<<<<<<<<<<<<< + * buf = lists[i] + * n = len(buf) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":392 + * + * for i from 0 <= i < k: + * buf = lists[i] # <<<<<<<<<<<<<< + * n = len(buf) + * for j from 0 <= j < n: + */ + if (unlikely(__pyx_v_lists == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(PyList_CheckExact(PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i)))||((PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_buf, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":393 + * for i from 0 <= i < k: + * buf = lists[i] + * n = len(buf) # <<<<<<<<<<<<<< + * for j from 0 <= j < n: + * val = buf[j] + */ + if (unlikely(__pyx_v_buf == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_buf); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/lib.pyx":394 + * buf = lists[i] + * n = len(buf) + * for j from 0 <= j < n: # <<<<<<<<<<<<<< + * val = buf[j] + * if val not in table: + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { + + /* "pandas/lib.pyx":395 + * n = len(buf) + * for j from 0 <= j < n: + * val = buf[j] # <<<<<<<<<<<<<< + * if val not in table: + * table[val] = stub + */ + if (unlikely(__pyx_v_buf == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_buf, __pyx_v_j); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":396 + * for j from 0 <= j < n: + * val = buf[j] + * if val not in table: # <<<<<<<<<<<<<< + * table[val] = stub + * uniques.append(val) + */ + __pyx_t_4 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_table, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":397 + * val = buf[j] + * if val not in table: + * table[val] = stub # <<<<<<<<<<<<<< + * uniques.append(val) + * try: + */ + if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_v_val, __pyx_v_stub) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":398 + * if val not in table: + * table[val] = stub + * uniques.append(val) # <<<<<<<<<<<<<< + * try: + * uniques.sort() + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + __pyx_L7:; + } + } + + /* "pandas/lib.pyx":399 + * table[val] = stub + * uniques.append(val) + * try: # <<<<<<<<<<<<<< + * uniques.sort() + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/lib.pyx":400 + * uniques.append(val) + * try: + * uniques.sort() # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_6 = PyList_Sort(__pyx_v_uniques); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":401 + * try: + * uniques.sort() + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L15_try_end:; + } + + /* "pandas/lib.pyx":404 + * pass + * + * return uniques # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_uniques); + __pyx_r = __pyx_v_uniques; + goto __pyx_L0; + + /* "pandas/lib.pyx":382 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list(list lists): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.fast_unique_multiple_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_table); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_stub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":408 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list_gen(object gen): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_41fast_unique_multiple_list_gen(PyObject *__pyx_self, PyObject *__pyx_v_gen); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_41fast_unique_multiple_list_gen = {__Pyx_NAMESTR("fast_unique_multiple_list_gen"), (PyCFunction)__pyx_pw_6pandas_3lib_41fast_unique_multiple_list_gen, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_41fast_unique_multiple_list_gen(PyObject *__pyx_self, PyObject *__pyx_v_gen) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_unique_multiple_list_gen (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_40fast_unique_multiple_list_gen(__pyx_self, ((PyObject *)__pyx_v_gen)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_40fast_unique_multiple_list_gen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gen) { + PyObject *__pyx_v_buf = 0; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_table = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_stub = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_unique_multiple_list_gen", 0); + + /* "pandas/lib.pyx":412 + * list buf + * Py_ssize_t j, n + * list uniques = [] # <<<<<<<<<<<<<< + * dict table = {} + * object val, stub = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_uniques = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":413 + * Py_ssize_t j, n + * list uniques = [] + * dict table = {} # <<<<<<<<<<<<<< + * object val, stub = 0 + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_table = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":414 + * list uniques = [] + * dict table = {} + * object val, stub = 0 # <<<<<<<<<<<<<< + * + * for buf in gen: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_stub = __pyx_int_0; + + /* "pandas/lib.pyx":416 + * object val, stub = 0 + * + * for buf in gen: # <<<<<<<<<<<<<< + * n = len(buf) + * for j from 0 <= j < n: + */ + if (PyList_CheckExact(__pyx_v_gen) || PyTuple_CheckExact(__pyx_v_gen)) { + __pyx_t_1 = __pyx_v_gen; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_gen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_buf, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/lib.pyx":417 + * + * for buf in gen: + * n = len(buf) # <<<<<<<<<<<<<< + * for j from 0 <= j < n: + * val = buf[j] + */ + if (unlikely(__pyx_v_buf == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_buf); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_5; + + /* "pandas/lib.pyx":418 + * for buf in gen: + * n = len(buf) + * for j from 0 <= j < n: # <<<<<<<<<<<<<< + * val = buf[j] + * if val not in table: + */ + __pyx_t_5 = __pyx_v_n; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/lib.pyx":419 + * n = len(buf) + * for j from 0 <= j < n: + * val = buf[j] # <<<<<<<<<<<<<< + * if val not in table: + * table[val] = stub + */ + if (unlikely(__pyx_v_buf == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_ITEM(__pyx_v_buf, __pyx_v_j); + __Pyx_INCREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/lib.pyx":420 + * for j from 0 <= j < n: + * val = buf[j] + * if val not in table: # <<<<<<<<<<<<<< + * table[val] = stub + * uniques.append(val) + */ + __pyx_t_6 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_table, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + + /* "pandas/lib.pyx":421 + * val = buf[j] + * if val not in table: + * table[val] = stub # <<<<<<<<<<<<<< + * uniques.append(val) + * + */ + if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_v_val, __pyx_v_stub) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":422 + * if val not in table: + * table[val] = stub + * uniques.append(val) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + __pyx_L7:; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/lib.pyx":424 + * uniques.append(val) + * + * try: # <<<<<<<<<<<<<< + * uniques.sort() + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "pandas/lib.pyx":425 + * + * try: + * uniques.sort() # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_8 = PyList_Sort(__pyx_v_uniques); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/lib.pyx":426 + * try: + * uniques.sort() + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + PyErr_Restore(0,0,0); + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L1_error; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L15_try_end:; + } + + /* "pandas/lib.pyx":429 + * pass + * + * return uniques # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_uniques); + __pyx_r = __pyx_v_uniques; + goto __pyx_L0; + + /* "pandas/lib.pyx":408 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list_gen(object gen): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.fast_unique_multiple_list_gen", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_table); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_stub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":433 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def dicts_to_array(list dicts, list columns): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_43dicts_to_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_43dicts_to_array = {__Pyx_NAMESTR("dicts_to_array"), (PyCFunction)__pyx_pw_6pandas_3lib_43dicts_to_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_43dicts_to_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dicts = 0; + PyObject *__pyx_v_columns = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dicts_to_array (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dicts,&__pyx_n_s_columns,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dicts)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("dicts_to_array", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dicts_to_array") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_dicts = ((PyObject*)values[0]); + __pyx_v_columns = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dicts_to_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.dicts_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dicts), (&PyList_Type), 1, "dicts", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_columns), (&PyList_Type), 1, "columns", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_42dicts_to_array(__pyx_self, __pyx_v_dicts, __pyx_v_columns); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_42dicts_to_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dicts, PyObject *__pyx_v_columns) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_row = 0; + PyObject *__pyx_v_col = 0; + PyObject *__pyx_v_onan = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject **__pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dicts_to_array", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":438 + * ndarray[object, ndim=2] result + * dict row + * object col, onan = np.nan # <<<<<<<<<<<<<< + * + * k = len(columns) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_onan = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":440 + * object col, onan = np.nan + * + * k = len(columns) # <<<<<<<<<<<<<< + * n = len(dicts) + * + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_3; + + /* "pandas/lib.pyx":441 + * + * k = len(columns) + * n = len(dicts) # <<<<<<<<<<<<<< + * + * result = np.empty((n, k), dtype='O') + */ + if (unlikely(__pyx_v_dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_dicts); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/lib.pyx":443 + * n = len(dicts) + * + * result = np.empty((n, k), dtype='O') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":445 + * result = np.empty((n, k), dtype='O') + * + * for i in range(n): # <<<<<<<<<<<<<< + * row = dicts[i] + * for j in range(k): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_3; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/lib.pyx":446 + * + * for i in range(n): + * row = dicts[i] # <<<<<<<<<<<<<< + * for j in range(k): + * col = columns[j] + */ + if (unlikely(__pyx_v_dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(PyDict_CheckExact(PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i)))||((PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":447 + * for i in range(n): + * row = dicts[i] + * for j in range(k): # <<<<<<<<<<<<<< + * col = columns[j] + * if col in row: + */ + __pyx_t_12 = __pyx_v_k; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/lib.pyx":448 + * row = dicts[i] + * for j in range(k): + * col = columns[j] # <<<<<<<<<<<<<< + * if col in row: + * result[i, j] = row[col] + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_columns, __pyx_v_j); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":449 + * for j in range(k): + * col = columns[j] + * if col in row: # <<<<<<<<<<<<<< + * result[i, j] = row[col] + * else: + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (__Pyx_PyDict_Contains(__pyx_v_col, __pyx_v_row, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = (__pyx_t_14 != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":450 + * col = columns[j] + * if col in row: + * result[i, j] = row[col] # <<<<<<<<<<<<<< + * else: + * result[i, j] = onan + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_row, __pyx_v_col); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/lib.pyx":452 + * result[i, j] = row[col] + * else: + * result[i, j] = onan # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_v_onan); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_v_onan; + __Pyx_GIVEREF(*__pyx_t_18); + } + __pyx_L7:; + } + } + + /* "pandas/lib.pyx":454 + * result[i, j] = onan + * + * return result # <<<<<<<<<<<<<< + * + * def fast_zip(list ndarrays): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":433 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def dicts_to_array(list dicts, list columns): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.dicts_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XDECREF(__pyx_v_col); + __Pyx_XDECREF(__pyx_v_onan); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":456 + * return result + * + * def fast_zip(list ndarrays): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_45fast_zip(PyObject *__pyx_self, PyObject *__pyx_v_ndarrays); /*proto*/ +static char __pyx_doc_6pandas_3lib_44fast_zip[] = "\n For zipping multiple ndarrays into an ndarray of tuples\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_45fast_zip = {__Pyx_NAMESTR("fast_zip"), (PyCFunction)__pyx_pw_6pandas_3lib_45fast_zip, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_44fast_zip)}; +static PyObject *__pyx_pw_6pandas_3lib_45fast_zip(PyObject *__pyx_self, PyObject *__pyx_v_ndarrays) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_zip (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ndarrays), (&PyList_Type), 1, "ndarrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_44fast_zip(__pyx_self, ((PyObject*)__pyx_v_ndarrays)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_44fast_zip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ndarrays) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayIterObject *__pyx_v_it = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_tup = 0; + PyObject *__pyx_v_arr = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject **__pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_zip", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":466 + * object val, tup + * + * k = len(ndarrays) # <<<<<<<<<<<<<< + * n = len(ndarrays[0]) + * + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_ndarrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":467 + * + * k = len(ndarrays) + * n = len(ndarrays[0]) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=object) + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":469 + * n = len(ndarrays[0]) + * + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * # initialize tuples on first pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":472 + * + * # initialize tuples on first pass + * arr = ndarrays[0] # <<<<<<<<<<<<<< + * it = PyArray_IterNew(arr) + * for i in range(n): + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_arr = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":473 + * # initialize tuples on first pass + * arr = ndarrays[0] + * it = PyArray_IterNew(arr) # <<<<<<<<<<<<<< + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + */ + __pyx_t_5 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_t_5; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_it = ((PyArrayIterObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":474 + * arr = ndarrays[0] + * it = PyArray_IterNew(arr) + * for i in range(n): # <<<<<<<<<<<<<< + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * tup = PyTuple_New(k) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/lib.pyx":475 + * it = PyArray_IterNew(arr) + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) # <<<<<<<<<<<<<< + * tup = PyTuple_New(k) + * + */ + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyArray_GETITEM(((PyArrayObject *)__pyx_v_arr), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":476 + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * tup = PyTuple_New(k) # <<<<<<<<<<<<<< + * + * PyTuple_SET_ITEM(tup, 0, val) + */ + __pyx_t_2 = PyTuple_New(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_tup, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":478 + * tup = PyTuple_New(k) + * + * PyTuple_SET_ITEM(tup, 0, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * result[i] = tup + */ + PyTuple_SET_ITEM(__pyx_v_tup, 0, __pyx_v_val); + + /* "pandas/lib.pyx":479 + * + * PyTuple_SET_ITEM(tup, 0, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * result[i] = tup + * PyArray_ITER_NEXT(it) + */ + Py_INCREF(__pyx_v_val); + + /* "pandas/lib.pyx":480 + * PyTuple_SET_ITEM(tup, 0, val) + * Py_INCREF(val) + * result[i] = tup # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_v_tup); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_v_tup; + __Pyx_GIVEREF(*__pyx_t_13); + + /* "pandas/lib.pyx":481 + * Py_INCREF(val) + * result[i] = tup + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * + * for j in range(1, k): + */ + PyArray_ITER_NEXT(__pyx_v_it); + } + + /* "pandas/lib.pyx":483 + * PyArray_ITER_NEXT(it) + * + * for j in range(1, k): # <<<<<<<<<<<<<< + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_j = __pyx_t_11; + + /* "pandas/lib.pyx":484 + * + * for j in range(1, k): + * arr = ndarrays[j] # <<<<<<<<<<<<<< + * it = PyArray_IterNew(arr) + * if len(arr) != n: + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":485 + * for j in range(1, k): + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) # <<<<<<<<<<<<<< + * if len(arr) != n: + * raise ValueError('all arrays must be same length') + */ + __pyx_t_2 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_it, ((PyArrayIterObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":486 + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) + * if len(arr) != n: # <<<<<<<<<<<<<< + * raise ValueError('all arrays must be same length') + * + */ + __pyx_t_14 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((__pyx_t_14 != __pyx_v_n) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":487 + * it = PyArray_IterNew(arr) + * if len(arr) != n: + * raise ValueError('all arrays must be same length') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":489 + * raise ValueError('all arrays must be same length') + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * PyTuple_SET_ITEM(result[i], j, val) + */ + __pyx_t_14 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_14; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/lib.pyx":490 + * + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) + */ + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyArray_GETITEM(((PyArrayObject *)__pyx_v_arr), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":491 + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * PyTuple_SET_ITEM(result[i], j, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * PyArray_ITER_NEXT(it) + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, __pyx_v_j, __pyx_v_val); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":492 + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * + */ + Py_INCREF(__pyx_v_val); + + /* "pandas/lib.pyx":493 + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * + * return result + */ + PyArray_ITER_NEXT(__pyx_v_it); + } + } + + /* "pandas/lib.pyx":495 + * PyArray_ITER_NEXT(it) + * + * return result # <<<<<<<<<<<<<< + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":456 + * return result + * + * def fast_zip(list ndarrays): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_zip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_it); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":497 + * return result + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): # <<<<<<<<<<<<<< + * """ + * Reverse indexing operation. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_47get_reverse_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_46get_reverse_indexer[] = "\n Reverse indexing operation.\n\n Given `indexer`, make `indexer_inv` of it, such that::\n\n indexer_inv[indexer[x]] = x\n\n .. note:: If indexer is not unique, only first occurrence is accounted.\n\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_47get_reverse_indexer = {__Pyx_NAMESTR("get_reverse_indexer"), (PyCFunction)__pyx_pw_6pandas_3lib_47get_reverse_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_46get_reverse_indexer)}; +static PyObject *__pyx_pw_6pandas_3lib_47get_reverse_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_indexer = 0; + Py_ssize_t __pyx_v_length; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_reverse_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indexer,&__pyx_n_s_length,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_reverse_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reverse_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_indexer = ((PyArrayObject *)values[0]); + __pyx_v_length = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_reverse_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.get_reverse_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_46get_reverse_indexer(__pyx_self, __pyx_v_indexer, __pyx_v_length); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_46get_reverse_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, Py_ssize_t __pyx_v_length) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_rev_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_idx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rev_indexer; + __Pyx_Buffer __pyx_pybuffer_rev_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + __pyx_t_5numpy_int64_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_reverse_indexer", 0); + __pyx_pybuffer_rev_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_rev_indexer.refcount = 0; + __pyx_pybuffernd_rev_indexer.data = NULL; + __pyx_pybuffernd_rev_indexer.rcbuffer = &__pyx_pybuffer_rev_indexer; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":510 + * + * cdef: + * Py_ssize_t i, n = len(indexer) # <<<<<<<<<<<<<< + * ndarray[int64_t] rev_indexer + * int64_t idx + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":514 + * int64_t idx + * + * rev_indexer = np.empty(length, dtype=np.int64) # <<<<<<<<<<<<<< + * rev_indexer.fill(-1) + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rev_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_rev_indexer.diminfo[0].strides = __pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rev_indexer.diminfo[0].shape = __pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_rev_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":515 + * + * rev_indexer = np.empty(length, dtype=np.int64) + * rev_indexer.fill(-1) # <<<<<<<<<<<<<< + * for i in range(n): + * idx = indexer[i] + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rev_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":516 + * rev_indexer = np.empty(length, dtype=np.int64) + * rev_indexer.fill(-1) + * for i in range(n): # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx != -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":517 + * rev_indexer.fill(-1) + * for i in range(n): + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx != -1: + * rev_indexer[idx] = i + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/lib.pyx":518 + * for i in range(n): + * idx = indexer[i] + * if idx != -1: # <<<<<<<<<<<<<< + * rev_indexer[idx] = i + * + */ + __pyx_t_14 = ((__pyx_v_idx != -1) != 0); + if (__pyx_t_14) { + + /* "pandas/lib.pyx":519 + * idx = indexer[i] + * if idx != -1: + * rev_indexer[idx] = i # <<<<<<<<<<<<<< + * + * return rev_indexer + */ + __pyx_t_15 = __pyx_v_idx; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_rev_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_rev_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_rev_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":521 + * rev_indexer[idx] = i + * + * return rev_indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_rev_indexer)); + __pyx_r = ((PyObject *)__pyx_v_rev_indexer); + goto __pyx_L0; + + /* "pandas/lib.pyx":497 + * return result + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): # <<<<<<<<<<<<<< + * """ + * Reverse indexing operation. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.get_reverse_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_rev_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":524 + * + * + * def has_infs_f4(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_49has_infs_f4(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_49has_infs_f4 = {__Pyx_NAMESTR("has_infs_f4"), (PyCFunction)__pyx_pw_6pandas_3lib_49has_infs_f4, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_49has_infs_f4(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("has_infs_f4 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_48has_infs_f4(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_48has_infs_f4(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float32_t __pyx_v_inf; + __pyx_t_5numpy_float32_t __pyx_v_neginf; + __pyx_t_5numpy_float32_t __pyx_v_val; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float32_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("has_infs_f4", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":526 + * def has_infs_f4(ndarray[float32_t] arr): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * float32_t inf, neginf, val + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":529 + * float32_t inf, neginf, val + * + * inf = np.inf # <<<<<<<<<<<<<< + * neginf = -inf + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_inf = __pyx_t_4; + + /* "pandas/lib.pyx":530 + * + * inf = np.inf + * neginf = -inf # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_neginf = (-__pyx_v_inf); + + /* "pandas/lib.pyx":532 + * neginf = -inf + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * if val == inf or val == neginf: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/lib.pyx":533 + * + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * if val == inf or val == neginf: + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/lib.pyx":534 + * for i in range(n): + * val = arr[i] + * if val == inf or val == neginf: # <<<<<<<<<<<<<< + * return True + * return False + */ + __pyx_t_8 = ((__pyx_v_val == __pyx_v_inf) != 0); + if (!__pyx_t_8) { + __pyx_t_9 = ((__pyx_v_val == __pyx_v_neginf) != 0); + __pyx_t_10 = __pyx_t_9; + } else { + __pyx_t_10 = __pyx_t_8; + } + if (__pyx_t_10) { + + /* "pandas/lib.pyx":535 + * val = arr[i] + * if val == inf or val == neginf: + * return True # <<<<<<<<<<<<<< + * return False + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + } + + /* "pandas/lib.pyx":536 + * if val == inf or val == neginf: + * return True + * return False # <<<<<<<<<<<<<< + * + * def has_infs_f8(ndarray[float64_t] arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "pandas/lib.pyx":524 + * + * + * def has_infs_f4(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.has_infs_f4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":538 + * return False + * + * def has_infs_f8(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_51has_infs_f8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_51has_infs_f8 = {__Pyx_NAMESTR("has_infs_f8"), (PyCFunction)__pyx_pw_6pandas_3lib_51has_infs_f8, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_51has_infs_f8(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("has_infs_f8 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_50has_infs_f8(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_50has_infs_f8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t __pyx_v_inf; + __pyx_t_5numpy_float64_t __pyx_v_neginf; + __pyx_t_5numpy_float64_t __pyx_v_val; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("has_infs_f8", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":540 + * def has_infs_f8(ndarray[float64_t] arr): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * float64_t inf, neginf, val + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":543 + * float64_t inf, neginf, val + * + * inf = np.inf # <<<<<<<<<<<<<< + * neginf = -inf + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_inf = __pyx_t_4; + + /* "pandas/lib.pyx":544 + * + * inf = np.inf + * neginf = -inf # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_neginf = (-__pyx_v_inf); + + /* "pandas/lib.pyx":546 + * neginf = -inf + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * if val == inf or val == neginf: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/lib.pyx":547 + * + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * if val == inf or val == neginf: + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/lib.pyx":548 + * for i in range(n): + * val = arr[i] + * if val == inf or val == neginf: # <<<<<<<<<<<<<< + * return True + * return False + */ + __pyx_t_8 = ((__pyx_v_val == __pyx_v_inf) != 0); + if (!__pyx_t_8) { + __pyx_t_9 = ((__pyx_v_val == __pyx_v_neginf) != 0); + __pyx_t_10 = __pyx_t_9; + } else { + __pyx_t_10 = __pyx_t_8; + } + if (__pyx_t_10) { + + /* "pandas/lib.pyx":549 + * val = arr[i] + * if val == inf or val == neginf: + * return True # <<<<<<<<<<<<<< + * return False + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + } + + /* "pandas/lib.pyx":550 + * if val == inf or val == neginf: + * return True + * return False # <<<<<<<<<<<<<< + * + * def convert_timestamps(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "pandas/lib.pyx":538 + * return False + * + * def has_infs_f8(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.has_infs_f8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":552 + * return False + * + * def convert_timestamps(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * object val, f, result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_53convert_timestamps(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_53convert_timestamps = {__Pyx_NAMESTR("convert_timestamps"), (PyCFunction)__pyx_pw_6pandas_3lib_53convert_timestamps, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_53convert_timestamps(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_timestamps (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_52convert_timestamps(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_52convert_timestamps(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_cache = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_datetime = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_timestamps", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/lib.pyx":555 + * cdef: + * object val, f, result + * dict cache = {} # <<<<<<<<<<<<<< + * Py_ssize_t i, n = len(values) + * ndarray[object] out + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cache = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":556 + * object val, f, result + * dict cache = {} + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] out + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":561 + * # for HDFStore, a bit temporary but... + * + * from datetime import datetime # <<<<<<<<<<<<<< + * f = datetime.fromtimestamp + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_datetime = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":562 + * + * from datetime import datetime + * f = datetime.fromtimestamp # <<<<<<<<<<<<<< + * + * out = np.empty(n, dtype='O') + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_f = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":564 + * f = datetime.fromtimestamp + * + * out = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":566 + * out = np.empty(n, dtype='O') + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(values, i) + * if val in cache: + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_2; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/lib.pyx":567 + * + * for i in range(n): + * val = util.get_value_1d(values, i) # <<<<<<<<<<<<<< + * if val in cache: + * out[i] = cache[val] + */ + __pyx_t_5 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":568 + * for i in range(n): + * val = util.get_value_1d(values, i) + * if val in cache: # <<<<<<<<<<<<<< + * out[i] = cache[val] + * else: + */ + __pyx_t_12 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_cache, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":569 + * val = util.get_value_1d(values, i) + * if val in cache: + * out[i] = cache[val] # <<<<<<<<<<<<<< + * else: + * cache[val] = out[i] = f(val) + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_cache, __pyx_v_val); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":571 + * out[i] = cache[val] + * else: + * cache[val] = out[i] = f(val) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(PyDict_SetItem(__pyx_v_cache, __pyx_v_val, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":573 + * cache[val] = out[i] = f(val) + * + * return out # <<<<<<<<<<<<<< + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/lib.pyx":552 + * return False + * + * def convert_timestamps(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * object val, f, result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.convert_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_cache); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XDECREF(__pyx_v_datetime); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":575 + * return out + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indices) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_55maybe_indices_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_55maybe_indices_to_slice = {__Pyx_NAMESTR("maybe_indices_to_slice"), (PyCFunction)__pyx_pw_6pandas_3lib_55maybe_indices_to_slice, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_55maybe_indices_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_indices) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_indices_to_slice (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_54maybe_indices_to_slice(__pyx_self, ((PyArrayObject *)__pyx_v_indices)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_54maybe_indices_to_slice(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + long __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_indices_to_slice", 0); + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":577 + * def maybe_indices_to_slice(ndarray[int64_t] indices): + * cdef: + * Py_ssize_t i, n = len(indices) # <<<<<<<<<<<<<< + * + * if not n or indices[0] < 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indices)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":579 + * Py_ssize_t i, n = len(indices) + * + * if not n or indices[0] < 0: # <<<<<<<<<<<<<< + * return indices + * + */ + __pyx_t_2 = ((!(__pyx_v_n != 0)) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = 0; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indices.diminfo[0].strides)) < 0) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":580 + * + * if not n or indices[0] < 0: + * return indices # <<<<<<<<<<<<<< + * + * for i in range(1, n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + __pyx_r = ((PyObject *)__pyx_v_indices); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":582 + * return indices + * + * for i in range(1, n): # <<<<<<<<<<<<<< + * if indices[i] - indices[i - 1] != 1: + * return indices + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":583 + * + * for i in range(1, n): + * if indices[i] - indices[i - 1] != 1: # <<<<<<<<<<<<<< + * return indices + * return slice(indices[0], indices[n - 1] + 1) + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (__pyx_v_i - 1); + __pyx_t_4 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indices.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indices.diminfo[0].strides))) != 1) != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":584 + * for i in range(1, n): + * if indices[i] - indices[i - 1] != 1: + * return indices # <<<<<<<<<<<<<< + * return slice(indices[0], indices[n - 1] + 1) + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + __pyx_r = ((PyObject *)__pyx_v_indices); + goto __pyx_L0; + } + } + + /* "pandas/lib.pyx":585 + * if indices[i] - indices[i - 1] != 1: + * return indices + * return slice(indices[0], indices[n - 1] + 1) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = 0; + __pyx_t_4 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indices.diminfo[0].strides))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = (__pyx_v_n - 1); + __pyx_t_4 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_PyInt_From_npy_int64(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indices.diminfo[0].strides)) + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":575 + * return out + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indices) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_indices_to_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":588 + * + * + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(mask) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_57maybe_booleans_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_mask); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_57maybe_booleans_to_slice = {__Pyx_NAMESTR("maybe_booleans_to_slice"), (PyCFunction)__pyx_pw_6pandas_3lib_57maybe_booleans_to_slice, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_57maybe_booleans_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_mask) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_booleans_to_slice (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_56maybe_booleans_to_slice(__pyx_self, ((PyArrayObject *)__pyx_v_mask)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_56maybe_booleans_to_slice(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_end; + int __pyx_v_started; + int __pyx_v_finished; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_booleans_to_slice", 0); + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":590 + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): + * cdef: + * Py_ssize_t i, n = len(mask) # <<<<<<<<<<<<<< + * Py_ssize_t start, end + * bint started = 0, finished = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":592 + * Py_ssize_t i, n = len(mask) + * Py_ssize_t start, end + * bint started = 0, finished = 0 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_started = 0; + __pyx_v_finished = 0; + + /* "pandas/lib.pyx":594 + * bint started = 0, finished = 0 + * + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * if finished: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/lib.pyx":595 + * + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * if finished: + * return mask.view(np.bool_) + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":596 + * for i in range(n): + * if mask[i]: + * if finished: # <<<<<<<<<<<<<< + * return mask.view(np.bool_) + * if not started: + */ + __pyx_t_5 = (__pyx_v_finished != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":597 + * if mask[i]: + * if finished: + * return mask.view(np.bool_) # <<<<<<<<<<<<<< + * if not started: + * started = 1 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_bool); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":598 + * if finished: + * return mask.view(np.bool_) + * if not started: # <<<<<<<<<<<<<< + * started = 1 + * start = i + */ + __pyx_t_5 = ((!(__pyx_v_started != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":599 + * return mask.view(np.bool_) + * if not started: + * started = 1 # <<<<<<<<<<<<<< + * start = i + * else: + */ + __pyx_v_started = 1; + + /* "pandas/lib.pyx":600 + * if not started: + * started = 1 + * start = i # <<<<<<<<<<<<<< + * else: + * if finished: + */ + __pyx_v_start = __pyx_v_i; + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":602 + * start = i + * else: + * if finished: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_5 = (__pyx_v_finished != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":603 + * else: + * if finished: + * continue # <<<<<<<<<<<<<< + * + * if started: + */ + goto __pyx_L3_continue; + } + + /* "pandas/lib.pyx":605 + * continue + * + * if started: # <<<<<<<<<<<<<< + * end = i + * finished = 1 + */ + __pyx_t_5 = (__pyx_v_started != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":606 + * + * if started: + * end = i # <<<<<<<<<<<<<< + * finished = 1 + * + */ + __pyx_v_end = __pyx_v_i; + + /* "pandas/lib.pyx":607 + * if started: + * end = i + * finished = 1 # <<<<<<<<<<<<<< + * + * if not started: + */ + __pyx_v_finished = 1; + goto __pyx_L9; + } + __pyx_L9:; + } + __pyx_L5:; + __pyx_L3_continue:; + } + + /* "pandas/lib.pyx":609 + * finished = 1 + * + * if not started: # <<<<<<<<<<<<<< + * return slice(0, 0) + * if not finished: + */ + __pyx_t_5 = ((!(__pyx_v_started != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":610 + * + * if not started: + * return slice(0, 0) # <<<<<<<<<<<<<< + * if not finished: + * return slice(start, None) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":611 + * if not started: + * return slice(0, 0) + * if not finished: # <<<<<<<<<<<<<< + * return slice(start, None) + * else: + */ + __pyx_t_5 = ((!(__pyx_v_finished != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":612 + * return slice(0, 0) + * if not finished: + * return slice(start, None) # <<<<<<<<<<<<<< + * else: + * return slice(start, end) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_7, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":614 + * return slice(start, None) + * else: + * return slice(start, end) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_end); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":588 + * + * + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(mask) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_booleans_to_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":619 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_59scalar_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_59scalar_compare = {__Pyx_NAMESTR("scalar_compare"), (PyCFunction)__pyx_pw_6pandas_3lib_59scalar_compare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_59scalar_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_op = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("scalar_compare (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_val,&__pyx_n_s_op,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scalar_compare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_val = values[1]; + __pyx_v_op = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.scalar_compare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_58scalar_compare(__pyx_self, __pyx_v_values, __pyx_v_val, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_58scalar_compare(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val, PyObject *__pyx_v_op) { + PyObject *__pyx_v_operator = NULL; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_flag; + PyObject *__pyx_v_x = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("scalar_compare", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":620 + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): + * import operator # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_operator = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":622 + * import operator + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] result + * int flag + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":627 + * object x + * + * if op is operator.lt: # <<<<<<<<<<<<<< + * flag = cpython.Py_LT + * elif op is operator.le: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_lt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":628 + * + * if op is operator.lt: + * flag = cpython.Py_LT # <<<<<<<<<<<<<< + * elif op is operator.le: + * flag = cpython.Py_LE + */ + __pyx_v_flag = Py_LT; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":629 + * if op is operator.lt: + * flag = cpython.Py_LT + * elif op is operator.le: # <<<<<<<<<<<<<< + * flag = cpython.Py_LE + * elif op is operator.gt: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_le); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":630 + * flag = cpython.Py_LT + * elif op is operator.le: + * flag = cpython.Py_LE # <<<<<<<<<<<<<< + * elif op is operator.gt: + * flag = cpython.Py_GT + */ + __pyx_v_flag = Py_LE; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":631 + * elif op is operator.le: + * flag = cpython.Py_LE + * elif op is operator.gt: # <<<<<<<<<<<<<< + * flag = cpython.Py_GT + * elif op is operator.ge: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_gt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":632 + * flag = cpython.Py_LE + * elif op is operator.gt: + * flag = cpython.Py_GT # <<<<<<<<<<<<<< + * elif op is operator.ge: + * flag = cpython.Py_GE + */ + __pyx_v_flag = Py_GT; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":633 + * elif op is operator.gt: + * flag = cpython.Py_GT + * elif op is operator.ge: # <<<<<<<<<<<<<< + * flag = cpython.Py_GE + * elif op is operator.eq: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_ge); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":634 + * flag = cpython.Py_GT + * elif op is operator.ge: + * flag = cpython.Py_GE # <<<<<<<<<<<<<< + * elif op is operator.eq: + * flag = cpython.Py_EQ + */ + __pyx_v_flag = Py_GE; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":635 + * elif op is operator.ge: + * flag = cpython.Py_GE + * elif op is operator.eq: # <<<<<<<<<<<<<< + * flag = cpython.Py_EQ + * elif op is operator.ne: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_eq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":636 + * flag = cpython.Py_GE + * elif op is operator.eq: + * flag = cpython.Py_EQ # <<<<<<<<<<<<<< + * elif op is operator.ne: + * flag = cpython.Py_NE + */ + __pyx_v_flag = Py_EQ; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":637 + * elif op is operator.eq: + * flag = cpython.Py_EQ + * elif op is operator.ne: # <<<<<<<<<<<<<< + * flag = cpython.Py_NE + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_ne); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":638 + * flag = cpython.Py_EQ + * elif op is operator.ne: + * flag = cpython.Py_NE # <<<<<<<<<<<<<< + * else: + * raise ValueError('Unrecognized operator') + */ + __pyx_v_flag = Py_NE; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":640 + * flag = cpython.Py_NE + * else: + * raise ValueError('Unrecognized operator') # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool).view(np.uint8) + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/lib.pyx":642 + * raise ValueError('Unrecognized operator') + * + * result = np.empty(n, dtype=bool).view(np.uint8) # <<<<<<<<<<<<<< + * + * if flag == cpython.Py_NE: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":644 + * result = np.empty(n, dtype=bool).view(np.uint8) + * + * if flag == cpython.Py_NE: # <<<<<<<<<<<<<< + * for i in range(n): + * x = values[i] + */ + __pyx_t_3 = ((__pyx_v_flag == Py_NE) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":645 + * + * if flag == cpython.Py_NE: + * for i in range(n): # <<<<<<<<<<<<<< + * x = values[i] + * if _checknull(x): + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/lib.pyx":646 + * if flag == cpython.Py_NE: + * for i in range(n): + * x = values[i] # <<<<<<<<<<<<<< + * if _checknull(x): + * result[i] = True + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":647 + * for i in range(n): + * x = values[i] + * if _checknull(x): # <<<<<<<<<<<<<< + * result[i] = True + * else: + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":648 + * x = values[i] + * if _checknull(x): + * result[i] = True # <<<<<<<<<<<<<< + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) + */ + __pyx_t_15 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/lib.pyx":650 + * result[i] = True + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_3 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_val, __pyx_v_flag); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_3; + } + __pyx_L7:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/lib.pyx":652 + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * x = values[i] + * if _checknull(x): + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/lib.pyx":653 + * else: + * for i in range(n): + * x = values[i] # <<<<<<<<<<<<<< + * if _checknull(x): + * result[i] = False + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":654 + * for i in range(n): + * x = values[i] + * if _checknull(x): # <<<<<<<<<<<<<< + * result[i] = False + * else: + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":655 + * x = values[i] + * if _checknull(x): + * result[i] = False # <<<<<<<<<<<<<< + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) + */ + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/lib.pyx":657 + * result[i] = False + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) # <<<<<<<<<<<<<< + * + * return result.view(bool) + */ + __pyx_t_3 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_val, __pyx_v_flag); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_3; + } + __pyx_L10:; + } + } + __pyx_L4:; + + /* "pandas/lib.pyx":659 + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) + * + * return result.view(bool) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":619 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.scalar_compare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_operator); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":663 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_61vec_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_61vec_compare = {__Pyx_NAMESTR("vec_compare"), (PyCFunction)__pyx_pw_6pandas_3lib_61vec_compare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_61vec_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + PyObject *__pyx_v_op = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vec_compare (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_op,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vec_compare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_op = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.vec_compare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_60vec_compare(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_60vec_compare(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, PyObject *__pyx_v_op) { + PyObject *__pyx_v_operator = NULL; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_flag; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("vec_compare", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":664 + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): + * import operator # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_operator = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":666 + * import operator + * cdef: + * Py_ssize_t i, n = len(left) # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] result + * int flag + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":670 + * int flag + * + * if n != len(right): # <<<<<<<<<<<<<< + * raise ValueError('Arrays were different lengths: %d vs %d' + * % (n, len(right))) + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_v_n != __pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":672 + * if n != len(right): + * raise ValueError('Arrays were different lengths: %d vs %d' + * % (n, len(right))) # <<<<<<<<<<<<<< + * + * if op is operator.lt: + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Arrays_were_different_lengths_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":671 + * + * if n != len(right): + * raise ValueError('Arrays were different lengths: %d vs %d' # <<<<<<<<<<<<<< + * % (n, len(right))) + * + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":674 + * % (n, len(right))) + * + * if op is operator.lt: # <<<<<<<<<<<<<< + * flag = cpython.Py_LT + * elif op is operator.le: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_lt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":675 + * + * if op is operator.lt: + * flag = cpython.Py_LT # <<<<<<<<<<<<<< + * elif op is operator.le: + * flag = cpython.Py_LE + */ + __pyx_v_flag = Py_LT; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":676 + * if op is operator.lt: + * flag = cpython.Py_LT + * elif op is operator.le: # <<<<<<<<<<<<<< + * flag = cpython.Py_LE + * elif op is operator.gt: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_le); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_6 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":677 + * flag = cpython.Py_LT + * elif op is operator.le: + * flag = cpython.Py_LE # <<<<<<<<<<<<<< + * elif op is operator.gt: + * flag = cpython.Py_GT + */ + __pyx_v_flag = Py_LE; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":678 + * elif op is operator.le: + * flag = cpython.Py_LE + * elif op is operator.gt: # <<<<<<<<<<<<<< + * flag = cpython.Py_GT + * elif op is operator.ge: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_gt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":679 + * flag = cpython.Py_LE + * elif op is operator.gt: + * flag = cpython.Py_GT # <<<<<<<<<<<<<< + * elif op is operator.ge: + * flag = cpython.Py_GE + */ + __pyx_v_flag = Py_GT; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":680 + * elif op is operator.gt: + * flag = cpython.Py_GT + * elif op is operator.ge: # <<<<<<<<<<<<<< + * flag = cpython.Py_GE + * elif op is operator.eq: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_ge); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_6 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":681 + * flag = cpython.Py_GT + * elif op is operator.ge: + * flag = cpython.Py_GE # <<<<<<<<<<<<<< + * elif op is operator.eq: + * flag = cpython.Py_EQ + */ + __pyx_v_flag = Py_GE; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":682 + * elif op is operator.ge: + * flag = cpython.Py_GE + * elif op is operator.eq: # <<<<<<<<<<<<<< + * flag = cpython.Py_EQ + * elif op is operator.ne: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_eq); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":683 + * flag = cpython.Py_GE + * elif op is operator.eq: + * flag = cpython.Py_EQ # <<<<<<<<<<<<<< + * elif op is operator.ne: + * flag = cpython.Py_NE + */ + __pyx_v_flag = Py_EQ; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":684 + * elif op is operator.eq: + * flag = cpython.Py_EQ + * elif op is operator.ne: # <<<<<<<<<<<<<< + * flag = cpython.Py_NE + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_ne); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_6 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":685 + * flag = cpython.Py_EQ + * elif op is operator.ne: + * flag = cpython.Py_NE # <<<<<<<<<<<<<< + * else: + * raise ValueError('Unrecognized operator') + */ + __pyx_v_flag = Py_NE; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/lib.pyx":687 + * flag = cpython.Py_NE + * else: + * raise ValueError('Unrecognized operator') # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool).view(np.uint8) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + + /* "pandas/lib.pyx":689 + * raise ValueError('Unrecognized operator') + * + * result = np.empty(n, dtype=bool).view(np.uint8) # <<<<<<<<<<<<<< + * + * if flag == cpython.Py_NE: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":691 + * result = np.empty(n, dtype=bool).view(np.uint8) + * + * if flag == cpython.Py_NE: # <<<<<<<<<<<<<< + * for i in range(n): + * x = left[i] + */ + __pyx_t_3 = ((__pyx_v_flag == Py_NE) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":692 + * + * if flag == cpython.Py_NE: + * for i in range(n): # <<<<<<<<<<<<<< + * x = left[i] + * y = right[i] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/lib.pyx":693 + * if flag == cpython.Py_NE: + * for i in range(n): + * x = left[i] # <<<<<<<<<<<<<< + * y = right[i] + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":694 + * for i in range(n): + * x = left[i] + * y = right[i] # <<<<<<<<<<<<<< + * + * if _checknull(x) or _checknull(y): + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":696 + * y = right[i] + * + * if _checknull(x) or _checknull(y): # <<<<<<<<<<<<<< + * result[i] = True + * else: + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (!__pyx_t_3) { + __pyx_t_6 = (__pyx_f_4util__checknull(__pyx_v_y) != 0); + __pyx_t_16 = __pyx_t_6; + } else { + __pyx_t_16 = __pyx_t_3; + } + if (__pyx_t_16) { + + /* "pandas/lib.pyx":697 + * + * if _checknull(x) or _checknull(y): + * result[i] = True # <<<<<<<<<<<<<< + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/lib.pyx":699 + * result[i] = True + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_16 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_y, __pyx_v_flag); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_16; + } + __pyx_L8:; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":701 + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * x = left[i] + * y = right[i] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/lib.pyx":702 + * else: + * for i in range(n): + * x = left[i] # <<<<<<<<<<<<<< + * y = right[i] + * + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":703 + * for i in range(n): + * x = left[i] + * y = right[i] # <<<<<<<<<<<<<< + * + * if _checknull(x) or _checknull(y): + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":705 + * y = right[i] + * + * if _checknull(x) or _checknull(y): # <<<<<<<<<<<<<< + * result[i] = False + * else: + */ + __pyx_t_16 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (!__pyx_t_16) { + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_y) != 0); + __pyx_t_6 = __pyx_t_3; + } else { + __pyx_t_6 = __pyx_t_16; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":706 + * + * if _checknull(x) or _checknull(y): + * result[i] = False # <<<<<<<<<<<<<< + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) + */ + __pyx_t_21 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/lib.pyx":708 + * result[i] = False + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) # <<<<<<<<<<<<<< + * + * return result.view(bool) + */ + __pyx_t_6 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_y, __pyx_v_flag); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_6; + } + __pyx_L11:; + } + } + __pyx_L5:; + + /* "pandas/lib.pyx":710 + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) + * + * return result.view(bool) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":663 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.vec_compare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_operator); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":715 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_binop(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_63scalar_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_63scalar_binop = {__Pyx_NAMESTR("scalar_binop"), (PyCFunction)__pyx_pw_6pandas_3lib_63scalar_binop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_63scalar_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_op = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("scalar_binop (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_val,&__pyx_n_s_op,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scalar_binop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_val = values[1]; + __pyx_v_op = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.scalar_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_62scalar_binop(__pyx_self, __pyx_v_values, __pyx_v_val, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_62scalar_binop(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val, PyObject *__pyx_v_op) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_x = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("scalar_binop", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":717 + * def scalar_binop(ndarray[object] values, object val, object op): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] result + * object x + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":721 + * object x + * + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * if util._checknull(val): + * result.fill(val) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":722 + * + * result = np.empty(n, dtype=object) + * if util._checknull(val): # <<<<<<<<<<<<<< + * result.fill(val) + * return result + */ + __pyx_t_11 = (__pyx_f_4util__checknull(__pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/lib.pyx":723 + * result = np.empty(n, dtype=object) + * if util._checknull(val): + * result.fill(val) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/lib.pyx":724 + * if util._checknull(val): + * result.fill(val) + * return result # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":726 + * return result + * + * for i in range(n): # <<<<<<<<<<<<<< + * x = values[i] + * if util._checknull(x): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":727 + * + * for i in range(n): + * x = values[i] # <<<<<<<<<<<<<< + * if util._checknull(x): + * result[i] = x + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/lib.pyx":728 + * for i in range(n): + * x = values[i] + * if util._checknull(x): # <<<<<<<<<<<<<< + * result[i] = x + * else: + */ + __pyx_t_11 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (__pyx_t_11) { + + /* "pandas/lib.pyx":729 + * x = values[i] + * if util._checknull(x): + * result[i] = x # <<<<<<<<<<<<<< + * else: + * result[i] = op(x, val) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_x); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_x; + __Pyx_GIVEREF(*__pyx_t_15); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/lib.pyx":731 + * result[i] = x + * else: + * result[i] = op(x, val) # <<<<<<<<<<<<<< + * + * return maybe_convert_bool(result) + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L6:; + } + + /* "pandas/lib.pyx":733 + * result[i] = op(x, val) + * + * return maybe_convert_bool(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":715 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_binop(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.scalar_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":737 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_65vec_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_65vec_binop = {__Pyx_NAMESTR("vec_binop"), (PyCFunction)__pyx_pw_6pandas_3lib_65vec_binop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_65vec_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + PyObject *__pyx_v_op = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vec_binop (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_op,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vec_binop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_op = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_64vec_binop(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_64vec_binop(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, PyObject *__pyx_v_op) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyObject **__pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("vec_binop", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":739 + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): + * cdef: + * Py_ssize_t i, n = len(left) # <<<<<<<<<<<<<< + * ndarray[object] result + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":742 + * ndarray[object] result + * + * if n != len(right): # <<<<<<<<<<<<<< + * raise ValueError('Arrays were different lengths: %d vs %d' + * % (n, len(right))) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_v_n != __pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":744 + * if n != len(right): + * raise ValueError('Arrays were different lengths: %d vs %d' + * % (n, len(right))) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=object) + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Arrays_were_different_lengths_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":743 + * + * if n != len(right): + * raise ValueError('Arrays were different lengths: %d vs %d' # <<<<<<<<<<<<<< + * % (n, len(right))) + * + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":746 + * % (n, len(right))) + * + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":748 + * result = np.empty(n, dtype=object) + * + * for i in range(n): # <<<<<<<<<<<<<< + * x = left[i] + * y = right[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":749 + * + * for i in range(n): + * x = left[i] # <<<<<<<<<<<<<< + * y = right[i] + * try: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":750 + * for i in range(n): + * x = left[i] + * y = right[i] # <<<<<<<<<<<<<< + * try: + * result[i] = op(x, y) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":751 + * x = left[i] + * y = right[i] + * try: # <<<<<<<<<<<<<< + * result[i] = op(x, y) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/lib.pyx":752 + * y = right[i] + * try: + * result[i] = op(x, y) # <<<<<<<<<<<<<< + * except TypeError: + * if util._checknull(x): + */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_y); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_y); + __Pyx_GIVEREF(__pyx_v_y); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_t_4; + __Pyx_GIVEREF(*__pyx_t_16); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/lib.pyx":753 + * try: + * result[i] = op(x, y) + * except TypeError: # <<<<<<<<<<<<<< + * if util._checknull(x): + * result[i] = x + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/lib.pyx":754 + * result[i] = op(x, y) + * except TypeError: + * if util._checknull(x): # <<<<<<<<<<<<<< + * result[i] = x + * elif util._checknull(y): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":755 + * except TypeError: + * if util._checknull(x): + * result[i] = x # <<<<<<<<<<<<<< + * elif util._checknull(y): + * result[i] = y + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_v_x); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_v_x; + __Pyx_GIVEREF(*__pyx_t_16); + goto __pyx_L16; + } + + /* "pandas/lib.pyx":756 + * if util._checknull(x): + * result[i] = x + * elif util._checknull(y): # <<<<<<<<<<<<<< + * result[i] = y + * else: + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_y) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":757 + * result[i] = x + * elif util._checknull(y): + * result[i] = y # <<<<<<<<<<<<<< + * else: + * raise + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_v_y); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_v_y; + __Pyx_GIVEREF(*__pyx_t_16); + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/lib.pyx":759 + * result[i] = y + * else: + * raise # <<<<<<<<<<<<<< + * + * return maybe_convert_bool(result) + */ + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_3); + __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + } + __pyx_L16:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + __pyx_L13_try_end:; + } + } + + /* "pandas/lib.pyx":761 + * raise + * + * return maybe_convert_bool(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_bool); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":737 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":764 + * + * + * def astype_intsafe(ndarray[object] arr, new_dtype): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_67astype_intsafe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_67astype_intsafe = {__Pyx_NAMESTR("astype_intsafe"), (PyCFunction)__pyx_pw_6pandas_3lib_67astype_intsafe, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_67astype_intsafe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_new_dtype = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("astype_intsafe (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_new_dtype,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_dtype)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("astype_intsafe", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "astype_intsafe") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_new_dtype = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("astype_intsafe", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.astype_intsafe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_66astype_intsafe(__pyx_self, __pyx_v_arr, __pyx_v_new_dtype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_66astype_intsafe(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_new_dtype) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_v = 0; + int __pyx_v_is_datelike; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("astype_intsafe", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":766 + * def astype_intsafe(ndarray[object] arr, new_dtype): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * object v + * bint is_datelike + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":772 + * + * # on 32-bit, 1.6.2 numpy M8[ns] is a subdtype of integer, which is weird + * is_datelike = new_dtype in ['M8[ns]','m8[ns]'] # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=new_dtype) + */ + __Pyx_INCREF(__pyx_v_new_dtype); + __pyx_t_2 = __pyx_v_new_dtype; + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_M8_ns, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_3) { + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_m8_ns, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_is_datelike = __pyx_t_5; + + /* "pandas/lib.pyx":774 + * is_datelike = new_dtype in ['M8[ns]','m8[ns]'] + * + * result = np.empty(n, dtype=new_dtype) # <<<<<<<<<<<<<< + * for i in range(n): + * v = arr[i] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_new_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":775 + * + * result = np.empty(n, dtype=new_dtype) + * for i in range(n): # <<<<<<<<<<<<<< + * v = arr[i] + * if is_datelike and checknull(v): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/lib.pyx":776 + * result = np.empty(n, dtype=new_dtype) + * for i in range(n): + * v = arr[i] # <<<<<<<<<<<<<< + * if is_datelike and checknull(v): + * result[i] = NPY_NAT + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":777 + * for i in range(n): + * v = arr[i] + * if is_datelike and checknull(v): # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * else: + */ + __pyx_t_5 = __pyx_v_is_datelike; + if (__pyx_t_5) { + __pyx_t_8 = __pyx_f_6pandas_3lib_checknull(__pyx_v_v, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "pandas/lib.pyx":778 + * v = arr[i] + * if is_datelike and checknull(v): + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * else: + * util.set_value_at(result, i, v) + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_3lib_NPY_NAT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_result), __pyx_v_i, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":780 + * result[i] = NPY_NAT + * else: + * util.set_value_at(result, i, v) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __pyx_f_4util_set_value_at(__pyx_v_result, __pyx_t_8, __pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":782 + * util.set_value_at(result, i, v) + * + * return result # <<<<<<<<<<<<<< + * + * cpdef ndarray[object] astype_str(ndarray arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":764 + * + * + * def astype_intsafe(ndarray[object] arr, new_dtype): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.astype_intsafe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":784 + * return result + * + * cpdef ndarray[object] astype_str(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + +static PyObject *__pyx_pw_6pandas_3lib_69astype_str(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_3lib_astype_str(PyArrayObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("astype_str", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":786 + * cpdef ndarray[object] astype_str(ndarray arr): + * cdef: + * Py_ssize_t i, n = arr.size # <<<<<<<<<<<<<< + * ndarray[object] result = np.empty(n, dtype=object) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":787 + * cdef: + * Py_ssize_t i, n = arr.size + * ndarray[object] result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":789 + * ndarray[object] result = np.empty(n, dtype=object) + * + * for i in range(n): # <<<<<<<<<<<<<< + * util.set_value_at(result, i, str(arr[i])) + * + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_2; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":790 + * + * for i in range(n): + * util.set_value_at(result, i, str(arr[i])) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_f_4util_set_value_at(((PyArrayObject *)__pyx_v_result), __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "pandas/lib.pyx":792 + * util.set_value_at(result, i, str(arr[i])) + * + * return result # <<<<<<<<<<<<<< + * + * def clean_index_list(list obj): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyArrayObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":784 + * return result + * + * cpdef ndarray[object] astype_str(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.astype_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_69astype_str(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_69astype_str(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("astype_str (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_68astype_str(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_68astype_str(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("astype_str", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_3lib_astype_str(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.astype_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":794 + * return result + * + * def clean_index_list(list obj): # <<<<<<<<<<<<<< + * ''' + * Utility used in pandas.core.index._ensure_index + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_71clean_index_list(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6pandas_3lib_70clean_index_list[] = "\n Utility used in pandas.core.index._ensure_index\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_71clean_index_list = {__Pyx_NAMESTR("clean_index_list"), (PyCFunction)__pyx_pw_6pandas_3lib_71clean_index_list, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_70clean_index_list)}; +static PyObject *__pyx_pw_6pandas_3lib_71clean_index_list(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clean_index_list (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_70clean_index_list(__pyx_self, ((PyObject*)__pyx_v_obj)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_70clean_index_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyArrayObject *__pyx_v_converted = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_v = 0; + int __pyx_v_all_arrays; + __Pyx_LocalBuf_ND __pyx_pybuffernd_converted; + __Pyx_Buffer __pyx_pybuffer_converted; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + PyObject **__pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("clean_index_list", 0); + __pyx_pybuffer_converted.pybuffer.buf = NULL; + __pyx_pybuffer_converted.refcount = 0; + __pyx_pybuffernd_converted.data = NULL; + __pyx_pybuffernd_converted.rcbuffer = &__pyx_pybuffer_converted; + + /* "pandas/lib.pyx":800 + * cdef: + * ndarray[object] converted + * Py_ssize_t i, n = len(obj) # <<<<<<<<<<<<<< + * object v + * bint all_arrays = 1 + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":802 + * Py_ssize_t i, n = len(obj) + * object v + * bint all_arrays = 1 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_all_arrays = 1; + + /* "pandas/lib.pyx":804 + * bint all_arrays = 1 + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = obj[i] + * if not (PyList_Check(v) or np.PyArray_Check(v)): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/lib.pyx":805 + * + * for i in range(n): + * v = obj[i] # <<<<<<<<<<<<<< + * if not (PyList_Check(v) or np.PyArray_Check(v)): + * all_arrays = 0 + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":806 + * for i in range(n): + * v = obj[i] + * if not (PyList_Check(v) or np.PyArray_Check(v)): # <<<<<<<<<<<<<< + * all_arrays = 0 + * break + */ + __pyx_t_4 = (PyList_Check(__pyx_v_v) != 0); + if (!__pyx_t_4) { + __pyx_t_5 = (PyArray_Check(__pyx_v_v) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = ((!__pyx_t_6) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":807 + * v = obj[i] + * if not (PyList_Check(v) or np.PyArray_Check(v)): + * all_arrays = 0 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_all_arrays = 0; + + /* "pandas/lib.pyx":808 + * if not (PyList_Check(v) or np.PyArray_Check(v)): + * all_arrays = 0 + * break # <<<<<<<<<<<<<< + * + * if all_arrays: + */ + goto __pyx_L4_break; + } + } + __pyx_L4_break:; + + /* "pandas/lib.pyx":810 + * break + * + * if all_arrays: # <<<<<<<<<<<<<< + * return obj, all_arrays + * + */ + __pyx_t_4 = (__pyx_v_all_arrays != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":811 + * + * if all_arrays: + * return obj, all_arrays # <<<<<<<<<<<<<< + * + * converted = np.empty(n, dtype=object) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_all_arrays); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":813 + * return obj, all_arrays + * + * converted = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * v = obj[i] + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_converted.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_converted.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_converted.rcbuffer->pybuffer, (PyObject*)__pyx_v_converted, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_converted.diminfo[0].strides = __pyx_pybuffernd_converted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_converted.diminfo[0].shape = __pyx_pybuffernd_converted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_converted = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/lib.pyx":814 + * + * converted = np.empty(n, dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * v = obj[i] + * if PyList_Check(v) or np.PyArray_Check(v): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/lib.pyx":815 + * converted = np.empty(n, dtype=object) + * for i in range(n): + * v = obj[i] # <<<<<<<<<<<<<< + * if PyList_Check(v) or np.PyArray_Check(v): + * converted[i] = tuple(v) + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/lib.pyx":816 + * for i in range(n): + * v = obj[i] + * if PyList_Check(v) or np.PyArray_Check(v): # <<<<<<<<<<<<<< + * converted[i] = tuple(v) + * else: + */ + __pyx_t_4 = (PyList_Check(__pyx_v_v) != 0); + if (!__pyx_t_4) { + __pyx_t_6 = (PyArray_Check(__pyx_v_v) != 0); + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_4; + } + if (__pyx_t_5) { + + /* "pandas/lib.pyx":817 + * v = obj[i] + * if PyList_Check(v) or np.PyArray_Check(v): + * converted[i] = tuple(v) # <<<<<<<<<<<<<< + * else: + * converted[i] = v + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_converted.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_converted.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_converted.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_converted.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_t_7; + __Pyx_GIVEREF(*__pyx_t_16); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/lib.pyx":819 + * converted[i] = tuple(v) + * else: + * converted[i] = v # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(converted), 0 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_converted.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_converted.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_converted.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_converted.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_v_v); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_v_v; + __Pyx_GIVEREF(*__pyx_t_16); + } + __pyx_L9:; + } + + /* "pandas/lib.pyx":821 + * converted[i] = v + * + * return maybe_convert_objects(converted), 0 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_converted)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_converted)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_converted)); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_8 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":794 + * return result + * + * def clean_index_list(list obj): # <<<<<<<<<<<<<< + * ''' + * Utility used in pandas.core.index._ensure_index + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_converted.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.clean_index_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_converted.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_converted); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":825 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def max_len_string_array(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * """ return the maximum size of elements in a 1-dim string array """ + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_73max_len_string_array(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_3lib_72max_len_string_array[] = " return the maximum size of elements in a 1-dim string array "; +static PyMethodDef __pyx_mdef_6pandas_3lib_73max_len_string_array = {__Pyx_NAMESTR("max_len_string_array"), (PyCFunction)__pyx_pw_6pandas_3lib_73max_len_string_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_72max_len_string_array)}; +static PyObject *__pyx_pw_6pandas_3lib_73max_len_string_array(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("max_len_string_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_72max_len_string_array(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_72max_len_string_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + int __pyx_v_i; + int __pyx_v_m; + int __pyx_v_l; + PyObject *__pyx_v_length = 0; + PyObject *__pyx_v_v = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("max_len_string_array", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":829 + * cdef: + * int i, m, l + * length = arr.shape[0] # <<<<<<<<<<<<<< + * object v + * + */ + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_arr->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_length = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":832 + * object v + * + * m = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * v = arr[i] + */ + __pyx_v_m = 0; + + /* "pandas/lib.pyx":833 + * + * m = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * v = arr[i] + * if PyString_Check(v) or PyBytes_Check(v): + */ + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_length); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/lib.pyx":834 + * m = 0 + * for i from 0 <= i < length: + * v = arr[i] # <<<<<<<<<<<<<< + * if PyString_Check(v) or PyBytes_Check(v): + * l = len(v) + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":835 + * for i from 0 <= i < length: + * v = arr[i] + * if PyString_Check(v) or PyBytes_Check(v): # <<<<<<<<<<<<<< + * l = len(v) + * + */ + __pyx_t_4 = (PyString_Check(__pyx_v_v) != 0); + if (!__pyx_t_4) { + __pyx_t_5 = (PyBytes_Check(__pyx_v_v) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":836 + * v = arr[i] + * if PyString_Check(v) or PyBytes_Check(v): + * l = len(v) # <<<<<<<<<<<<<< + * + * if l > m: + */ + __pyx_t_7 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_l = __pyx_t_7; + + /* "pandas/lib.pyx":838 + * l = len(v) + * + * if l > m: # <<<<<<<<<<<<<< + * m = l + * + */ + __pyx_t_6 = ((__pyx_v_l > __pyx_v_m) != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":839 + * + * if l > m: + * m = l # <<<<<<<<<<<<<< + * + * return m + */ + __pyx_v_m = __pyx_v_l; + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":841 + * m = l + * + * return m # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":825 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def max_len_string_array(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * """ return the maximum size of elements in a 1-dim string array """ + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.max_len_string_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":845 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def string_array_replace_from_nan_rep(ndarray[object, ndim=1] arr, object nan_rep, object replace = None): # <<<<<<<<<<<<<< + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_75string_array_replace_from_nan_rep(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_74string_array_replace_from_nan_rep[] = " replace the values in the array with replacement if they are nan_rep; return the same array "; +static PyMethodDef __pyx_mdef_6pandas_3lib_75string_array_replace_from_nan_rep = {__Pyx_NAMESTR("string_array_replace_from_nan_rep"), (PyCFunction)__pyx_pw_6pandas_3lib_75string_array_replace_from_nan_rep, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_74string_array_replace_from_nan_rep)}; +static PyObject *__pyx_pw_6pandas_3lib_75string_array_replace_from_nan_rep(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_nan_rep = 0; + PyObject *__pyx_v_replace = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("string_array_replace_from_nan_rep (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_nan_rep,&__pyx_n_s_replace,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nan_rep)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("string_array_replace_from_nan_rep", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_replace); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "string_array_replace_from_nan_rep") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_nan_rep = values[1]; + __pyx_v_replace = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("string_array_replace_from_nan_rep", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.string_array_replace_from_nan_rep", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_74string_array_replace_from_nan_rep(__pyx_self, __pyx_v_arr, __pyx_v_nan_rep, __pyx_v_replace); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_74string_array_replace_from_nan_rep(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_nan_rep, PyObject *__pyx_v_replace) { + int __pyx_v_length; + int __pyx_v_i; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject **__pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("string_array_replace_from_nan_rep", 0); + __Pyx_INCREF(__pyx_v_replace); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":848 + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + * cdef int length = arr.shape[0], i = 0 # <<<<<<<<<<<<<< + * if replace is None: + * replace = np.nan + */ + __pyx_v_length = (__pyx_v_arr->dimensions[0]); + __pyx_v_i = 0; + + /* "pandas/lib.pyx":849 + * + * cdef int length = arr.shape[0], i = 0 + * if replace is None: # <<<<<<<<<<<<<< + * replace = np.nan + * + */ + __pyx_t_1 = (__pyx_v_replace == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":850 + * cdef int length = arr.shape[0], i = 0 + * if replace is None: + * replace = np.nan # <<<<<<<<<<<<<< + * + * for i from 0 <= i < length: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_replace, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":852 + * replace = np.nan + * + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * if arr[i] == nan_rep: + * arr[i] = replace + */ + __pyx_t_5 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { + + /* "pandas/lib.pyx":853 + * + * for i from 0 <= i < length: + * if arr[i] == nan_rep: # <<<<<<<<<<<<<< + * arr[i] = replace + * + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_nan_rep, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/lib.pyx":854 + * for i from 0 <= i < length: + * if arr[i] == nan_rep: + * arr[i] = replace # <<<<<<<<<<<<<< + * + * return arr + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_8); + __Pyx_INCREF(__pyx_v_replace); __Pyx_DECREF(*__pyx_t_8); + *__pyx_t_8 = __pyx_v_replace; + __Pyx_GIVEREF(*__pyx_t_8); + goto __pyx_L6; + } + __pyx_L6:; + } + + /* "pandas/lib.pyx":856 + * arr[i] = replace + * + * return arr # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/lib.pyx":845 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def string_array_replace_from_nan_rep(ndarray[object, ndim=1] arr, object nan_rep, object replace = None): # <<<<<<<<<<<<<< + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.string_array_replace_from_nan_rep", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_replace); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":860 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def write_csv_rows(list data, list data_index, int nlevels, list cols, object writer): # <<<<<<<<<<<<<< + * + * cdef int N, j, i, ncols + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_77write_csv_rows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_77write_csv_rows = {__Pyx_NAMESTR("write_csv_rows"), (PyCFunction)__pyx_pw_6pandas_3lib_77write_csv_rows, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_77write_csv_rows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_data = 0; + PyObject *__pyx_v_data_index = 0; + int __pyx_v_nlevels; + PyObject *__pyx_v_cols = 0; + PyObject *__pyx_v_writer = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_csv_rows (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_data_index,&__pyx_n_s_nlevels,&__pyx_n_s_cols,&__pyx_n_s_writer,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data_index)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nlevels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_writer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_csv_rows") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_data = ((PyObject*)values[0]); + __pyx_v_data_index = ((PyObject*)values[1]); + __pyx_v_nlevels = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nlevels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_cols = ((PyObject*)values[3]); + __pyx_v_writer = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.write_csv_rows", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyList_Type), 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data_index), (&PyList_Type), 1, "data_index", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cols), (&PyList_Type), 1, "cols", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_76write_csv_rows(__pyx_self, __pyx_v_data, __pyx_v_data_index, __pyx_v_nlevels, __pyx_v_cols, __pyx_v_writer); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_76write_csv_rows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_data_index, int __pyx_v_nlevels, PyObject *__pyx_v_cols, PyObject *__pyx_v_writer) { + int __pyx_v_N; + int __pyx_v_j; + int __pyx_v_i; + int __pyx_v_ncols; + PyObject *__pyx_v_rows = 0; + PyObject *__pyx_v_row = NULL; + CYTHON_UNUSED int __pyx_v_x; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write_csv_rows", 0); + + /* "pandas/lib.pyx":867 + * + * # In crude testing, N>100 yields little marginal improvement + * N=100 # <<<<<<<<<<<<<< + * + * # pre-allocate rows + */ + __pyx_v_N = 100; + + /* "pandas/lib.pyx":870 + * + * # pre-allocate rows + * ncols = len(cols) # <<<<<<<<<<<<<< + * rows = [[None]*(nlevels+ncols) for x in range(N)] + * + */ + if (unlikely(__pyx_v_cols == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_cols); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ncols = __pyx_t_1; + + /* "pandas/lib.pyx":871 + * # pre-allocate rows + * ncols = len(cols) + * rows = [[None]*(nlevels+ncols) for x in range(N)] # <<<<<<<<<<<<<< + * + * j = -1 + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_N; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_x = __pyx_t_4; + __pyx_t_5 = PyList_New(1 * (((__pyx_v_nlevels + __pyx_v_ncols)<0) ? 0:(__pyx_v_nlevels + __pyx_v_ncols))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (__pyx_v_nlevels + __pyx_v_ncols); __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_5, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_v_rows = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":873 + * rows = [[None]*(nlevels+ncols) for x in range(N)] + * + * j = -1 # <<<<<<<<<<<<<< + * if nlevels == 1: + * for j in range(len(data_index)): + */ + __pyx_v_j = -1; + + /* "pandas/lib.pyx":874 + * + * j = -1 + * if nlevels == 1: # <<<<<<<<<<<<<< + * for j in range(len(data_index)): + * row = rows[j % N] + */ + __pyx_t_6 = ((__pyx_v_nlevels == 1) != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":875 + * j = -1 + * if nlevels == 1: + * for j in range(len(data_index)): # <<<<<<<<<<<<<< + * row = rows[j % N] + * row[0] = data_index[j] + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_data_index); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_j = __pyx_t_3; + + /* "pandas/lib.pyx":876 + * if nlevels == 1: + * for j in range(len(data_index)): + * row = rows[j % N] # <<<<<<<<<<<<<< + * row[0] = data_index[j] + * for i in range(ncols): + */ + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_mod_int(__pyx_v_j, __pyx_v_N); + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_rows, __pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":877 + * for j in range(len(data_index)): + * row = rows[j % N] + * row[0] = data_index[j] # <<<<<<<<<<<<<< + * for i in range(ncols): + * row[1+i] = data[i][j] + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_data_index, __pyx_v_j); + __Pyx_INCREF(__pyx_t_2); + if (unlikely(__Pyx_SetItemInt(__pyx_v_row, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":878 + * row = rows[j % N] + * row[0] = data_index[j] + * for i in range(ncols): # <<<<<<<<<<<<<< + * row[1+i] = data[i][j] + * + */ + __pyx_t_4 = __pyx_v_ncols; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_4; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":879 + * row[0] = data_index[j] + * for i in range(ncols): + * row[1+i] = data[i][j] # <<<<<<<<<<<<<< + * + * if j >= N-1 and j % N == N-1: + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_data, __pyx_v_i), __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (1 + __pyx_v_i); + if (unlikely(__Pyx_SetItemInt(__pyx_v_row, __pyx_t_8, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "pandas/lib.pyx":881 + * row[1+i] = data[i][j] + * + * if j >= N-1 and j % N == N-1: # <<<<<<<<<<<<<< + * writer.writerows(rows) + * elif nlevels > 1: + */ + __pyx_t_6 = ((__pyx_v_j >= (__pyx_v_N - 1)) != 0); + if (__pyx_t_6) { + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = ((__Pyx_mod_int(__pyx_v_j, __pyx_v_N) == (__pyx_v_N - 1)) != 0); + __pyx_t_10 = __pyx_t_9; + } else { + __pyx_t_10 = __pyx_t_6; + } + if (__pyx_t_10) { + + /* "pandas/lib.pyx":882 + * + * if j >= N-1 and j % N == N-1: + * writer.writerows(rows) # <<<<<<<<<<<<<< + * elif nlevels > 1: + * for j in range(len(data_index)): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_writerows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_rows); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_rows); + __Pyx_GIVEREF(__pyx_v_rows); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L10; + } + __pyx_L10:; + } + goto __pyx_L5; + } + + /* "pandas/lib.pyx":883 + * if j >= N-1 and j % N == N-1: + * writer.writerows(rows) + * elif nlevels > 1: # <<<<<<<<<<<<<< + * for j in range(len(data_index)): + * row = rows[j % N] + */ + __pyx_t_10 = ((__pyx_v_nlevels > 1) != 0); + if (__pyx_t_10) { + + /* "pandas/lib.pyx":884 + * writer.writerows(rows) + * elif nlevels > 1: + * for j in range(len(data_index)): # <<<<<<<<<<<<<< + * row = rows[j % N] + * row[:nlevels] = list(data_index[j]) + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_data_index); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_j = __pyx_t_3; + + /* "pandas/lib.pyx":885 + * elif nlevels > 1: + * for j in range(len(data_index)): + * row = rows[j % N] # <<<<<<<<<<<<<< + * row[:nlevels] = list(data_index[j]) + * for i in range(ncols): + */ + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_mod_int(__pyx_v_j, __pyx_v_N); + __pyx_t_11 = PyList_GET_ITEM(__pyx_v_rows, __pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/lib.pyx":886 + * for j in range(len(data_index)): + * row = rows[j % N] + * row[:nlevels] = list(data_index[j]) # <<<<<<<<<<<<<< + * for i in range(ncols): + * row[nlevels+i] = data[i][j] + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_data_index, __pyx_v_j)); + PyTuple_SET_ITEM(__pyx_t_11, 0, PyList_GET_ITEM(__pyx_v_data_index, __pyx_v_j)); + __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_data_index, __pyx_v_j)); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_PyObject_SetSlice(__pyx_v_row, __pyx_t_5, 0, __pyx_v_nlevels, NULL, NULL, NULL, 0, 1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":887 + * row = rows[j % N] + * row[:nlevels] = list(data_index[j]) + * for i in range(ncols): # <<<<<<<<<<<<<< + * row[nlevels+i] = data[i][j] + * + */ + __pyx_t_4 = __pyx_v_ncols; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_4; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":888 + * row[:nlevels] = list(data_index[j]) + * for i in range(ncols): + * row[nlevels+i] = data[i][j] # <<<<<<<<<<<<<< + * + * if j >= N-1 and j % N == N-1: + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_data, __pyx_v_i), __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = (__pyx_v_nlevels + __pyx_v_i); + if (unlikely(__Pyx_SetItemInt(__pyx_v_row, __pyx_t_12, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/lib.pyx":890 + * row[nlevels+i] = data[i][j] + * + * if j >= N-1 and j % N == N-1: # <<<<<<<<<<<<<< + * writer.writerows(rows) + * else: + */ + __pyx_t_10 = ((__pyx_v_j >= (__pyx_v_N - 1)) != 0); + if (__pyx_t_10) { + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__Pyx_mod_int(__pyx_v_j, __pyx_v_N) == (__pyx_v_N - 1)) != 0); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_10; + } + if (__pyx_t_9) { + + /* "pandas/lib.pyx":891 + * + * if j >= N-1 and j % N == N-1: + * writer.writerows(rows) # <<<<<<<<<<<<<< + * else: + * for j in range(len(data_index)): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_writerows); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_rows); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_rows); + __Pyx_GIVEREF(__pyx_v_rows); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L15; + } + __pyx_L15:; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":893 + * writer.writerows(rows) + * else: + * for j in range(len(data_index)): # <<<<<<<<<<<<<< + * row = rows[j % N] + * for i in range(ncols): + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_data_index); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_j = __pyx_t_3; + + /* "pandas/lib.pyx":894 + * else: + * for j in range(len(data_index)): + * row = rows[j % N] # <<<<<<<<<<<<<< + * for i in range(ncols): + * row[i] = data[i][j] + */ + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_mod_int(__pyx_v_j, __pyx_v_N); + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_rows, __pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":895 + * for j in range(len(data_index)): + * row = rows[j % N] + * for i in range(ncols): # <<<<<<<<<<<<<< + * row[i] = data[i][j] + * + */ + __pyx_t_4 = __pyx_v_ncols; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_4; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":896 + * row = rows[j % N] + * for i in range(ncols): + * row[i] = data[i][j] # <<<<<<<<<<<<<< + * + * if j >= N-1 and j % N == N-1: + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_data, __pyx_v_i), __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_SetItemInt(__pyx_v_row, __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "pandas/lib.pyx":898 + * row[i] = data[i][j] + * + * if j >= N-1 and j % N == N-1: # <<<<<<<<<<<<<< + * writer.writerows(rows) + * + */ + __pyx_t_9 = ((__pyx_v_j >= (__pyx_v_N - 1)) != 0); + if (__pyx_t_9) { + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = ((__Pyx_mod_int(__pyx_v_j, __pyx_v_N) == (__pyx_v_N - 1)) != 0); + __pyx_t_6 = __pyx_t_10; + } else { + __pyx_t_6 = __pyx_t_9; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":899 + * + * if j >= N-1 and j % N == N-1: + * writer.writerows(rows) # <<<<<<<<<<<<<< + * + * if j >= 0 and (j < N-1 or (j % N) != N-1 ): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_writerows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_rows); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_rows); + __Pyx_GIVEREF(__pyx_v_rows); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L20; + } + __pyx_L20:; + } + } + __pyx_L5:; + + /* "pandas/lib.pyx":901 + * writer.writerows(rows) + * + * if j >= 0 and (j < N-1 or (j % N) != N-1 ): # <<<<<<<<<<<<<< + * writer.writerows(rows[:((j+1) % N)]) + * + */ + __pyx_t_6 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_6) { + __pyx_t_9 = ((__pyx_v_j < (__pyx_v_N - 1)) != 0); + if (!__pyx_t_9) { + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = ((__Pyx_mod_int(__pyx_v_j, __pyx_v_N) != (__pyx_v_N - 1)) != 0); + __pyx_t_13 = __pyx_t_10; + } else { + __pyx_t_13 = __pyx_t_9; + } + __pyx_t_9 = __pyx_t_13; + } else { + __pyx_t_9 = __pyx_t_6; + } + if (__pyx_t_9) { + + /* "pandas/lib.pyx":902 + * + * if j >= 0 and (j < N-1 or (j % N) != N-1 ): + * writer.writerows(rows[:((j+1) % N)]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_writerows); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = (__pyx_v_j + 1); + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = __Pyx_PyList_GetSlice(__pyx_v_rows, 0, __Pyx_mod_long(__pyx_t_8, __pyx_v_N)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/lib.pyx":860 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def write_csv_rows(list data, list data_index, int nlevels, list cols, object writer): # <<<<<<<<<<<<<< + * + * cdef int N, j, i, ncols + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.lib.write_csv_rows", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rows); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":908 + * + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef int length = index.shape[0] + * cdef int i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_79arrmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_79arrmap = {__Pyx_NAMESTR("arrmap"), (PyCFunction)__pyx_pw_6pandas_3lib_79arrmap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_79arrmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.arrmap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_78arrmap(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_78arrmap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + int __pyx_v_length; + int __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject **__pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":909 + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): + * cdef int length = index.shape[0] # <<<<<<<<<<<<<< + * cdef int i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/lib.pyx":910 + * def arrmap(ndarray[object] index, object func): + * cdef int length = index.shape[0] + * cdef int i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/lib.pyx":912 + * cdef int i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < length: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":914 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":915 + * + * for i from 0 <= i < length: + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_8 = __pyx_v_i; + if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_pybuffernd_index.diminfo[0].shape; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_index.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __pyx_v_i; + if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_pybuffernd_result.diminfo[0].shape; + __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/lib.pyx":917 + * result[i] = func(index[i]) + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":908 + * + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef int length = index.shape[0] + * cdef int i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.arrmap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":921 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_81is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_81is_lexsorted = {__Pyx_NAMESTR("is_lexsorted"), (PyCFunction)__pyx_pw_6pandas_3lib_81is_lexsorted, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_81is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_lexsorted (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_list_of_arrays), (&PyList_Type), 1, "list_of_arrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_80is_lexsorted(__pyx_self, ((PyObject*)__pyx_v_list_of_arrays)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_80is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) { + int __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_nlevels; + __pyx_t_5numpy_int64_t __pyx_v_k; + __pyx_t_5numpy_int64_t __pyx_v_cur; + __pyx_t_5numpy_int64_t __pyx_v_pre; + PyArrayObject *__pyx_v_arr = 0; + __pyx_t_5numpy_int64_t **__pyx_v_vecs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_lexsorted", 0); + + /* "pandas/lib.pyx":928 + * ndarray arr + * + * nlevels = len(list_of_arrays) # <<<<<<<<<<<<<< + * n = len(list_of_arrays[0]) + * + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_list_of_arrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nlevels = __pyx_t_1; + + /* "pandas/lib.pyx":929 + * + * nlevels = len(list_of_arrays) + * n = len(list_of_arrays[0]) # <<<<<<<<<<<<<< + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":931 + * n = len(list_of_arrays[0]) + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) # <<<<<<<<<<<<<< + * for i from 0 <= i < nlevels: + * # vecs[i] = ( list_of_arrays[i]).data + */ + __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_v_nlevels * (sizeof(__pyx_t_5numpy_int64_t *))))); + + /* "pandas/lib.pyx":932 + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) + * for i from 0 <= i < nlevels: # <<<<<<<<<<<<<< + * # vecs[i] = ( list_of_arrays[i]).data + * + */ + __pyx_t_1 = __pyx_v_nlevels; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":935 + * # vecs[i] = ( list_of_arrays[i]).data + * + * arr = list_of_arrays[i] # <<<<<<<<<<<<<< + * vecs[i] = arr.data + * # assume uniqueness?? + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":936 + * + * arr = list_of_arrays[i] + * vecs[i] = arr.data # <<<<<<<<<<<<<< + * # assume uniqueness?? + * + */ + (__pyx_v_vecs[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)__pyx_v_arr->data); + } + + /* "pandas/lib.pyx":939 + * # assume uniqueness?? + * + * for i from 1 <= i < n: # <<<<<<<<<<<<<< + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":940 + * + * for i from 1 <= i < n: + * for k from 0 <= k < nlevels: # <<<<<<<<<<<<<< + * cur = vecs[k][i] + * pre = vecs[k][i-1] + */ + __pyx_t_3 = __pyx_v_nlevels; + for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { + + /* "pandas/lib.pyx":941 + * for i from 1 <= i < n: + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] # <<<<<<<<<<<<<< + * pre = vecs[k][i-1] + * if cur == pre: + */ + __pyx_v_cur = ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_i]); + + /* "pandas/lib.pyx":942 + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] + * pre = vecs[k][i-1] # <<<<<<<<<<<<<< + * if cur == pre: + * continue + */ + __pyx_v_pre = ((__pyx_v_vecs[__pyx_v_k])[(__pyx_v_i - 1)]); + + /* "pandas/lib.pyx":943 + * cur = vecs[k][i] + * pre = vecs[k][i-1] + * if cur == pre: # <<<<<<<<<<<<<< + * continue + * elif cur > pre: + */ + __pyx_t_4 = ((__pyx_v_cur == __pyx_v_pre) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":944 + * pre = vecs[k][i-1] + * if cur == pre: + * continue # <<<<<<<<<<<<<< + * elif cur > pre: + * break + */ + goto __pyx_L7_continue; + } + + /* "pandas/lib.pyx":945 + * if cur == pre: + * continue + * elif cur > pre: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_4 = ((__pyx_v_cur > __pyx_v_pre) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":946 + * continue + * elif cur > pre: + * break # <<<<<<<<<<<<<< + * else: + * return False + */ + goto __pyx_L8_break; + } + /*else*/ { + + /* "pandas/lib.pyx":948 + * break + * else: + * return False # <<<<<<<<<<<<<< + * free(vecs) + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L7_continue:; + } + __pyx_L8_break:; + } + + /* "pandas/lib.pyx":949 + * else: + * return False + * free(vecs) # <<<<<<<<<<<<<< + * return True + * + */ + free(__pyx_v_vecs); + + /* "pandas/lib.pyx":950 + * return False + * free(vecs) + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/lib.pyx":921 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.is_lexsorted", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":960 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner, # <<<<<<<<<<<<<< + * object closed='left', bint hasnans=0): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_83generate_bins_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_82generate_bins_dt64[] = "\n Int64 (datetime64) version of generic python version in groupby.py\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_83generate_bins_dt64 = {__Pyx_NAMESTR("generate_bins_dt64"), (PyCFunction)__pyx_pw_6pandas_3lib_83generate_bins_dt64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_82generate_bins_dt64)}; +static PyObject *__pyx_pw_6pandas_3lib_83generate_bins_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_binner = 0; + PyObject *__pyx_v_closed = 0; + int __pyx_v_hasnans; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("generate_bins_dt64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_binner,&__pyx_n_s_closed,&__pyx_n_s_hasnans,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)__pyx_n_s_left); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_binner)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("generate_bins_dt64", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hasnans); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generate_bins_dt64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_binner = ((PyArrayObject *)values[1]); + __pyx_v_closed = values[2]; + if (values[3]) { + __pyx_v_hasnans = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_hasnans == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_hasnans = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("generate_bins_dt64", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.generate_bins_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_binner), __pyx_ptype_5numpy_ndarray, 1, "binner", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_82generate_bins_dt64(__pyx_self, __pyx_v_values, __pyx_v_binner, __pyx_v_closed, __pyx_v_hasnans); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_82generate_bins_dt64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_binner, PyObject *__pyx_v_closed, int __pyx_v_hasnans) { + Py_ssize_t __pyx_v_lenidx; + Py_ssize_t __pyx_v_lenbin; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_bc; + PyArrayObject *__pyx_v_bins = 0; + __pyx_t_5numpy_int64_t __pyx_v_r_bin; + __pyx_t_5numpy_int64_t __pyx_v_nat_count; + int __pyx_v_right_closed; + PyObject *__pyx_v_mask = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_binner; + __Pyx_Buffer __pyx_pybuffer_binner; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_5; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + long __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("generate_bins_dt64", 0); + __Pyx_INCREF((PyObject *)__pyx_v_values); + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_binner.pybuffer.buf = NULL; + __pyx_pybuffer_binner.refcount = 0; + __pyx_pybuffernd_binner.data = NULL; + __pyx_pybuffernd_binner.rcbuffer = &__pyx_pybuffer_binner; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_binner.rcbuffer->pybuffer, (PyObject*)__pyx_v_binner, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_binner.diminfo[0].strides = __pyx_pybuffernd_binner.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_binner.diminfo[0].shape = __pyx_pybuffernd_binner.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":969 + * ndarray[int64_t] bins + * int64_t l_bin, r_bin, nat_count + * bint right_closed = closed == 'right' # <<<<<<<<<<<<<< + * + * nat_count = 0 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_closed, __pyx_n_s_right, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_right_closed = __pyx_t_2; + + /* "pandas/lib.pyx":971 + * bint right_closed = closed == 'right' + * + * nat_count = 0 # <<<<<<<<<<<<<< + * if hasnans: + * mask = values == iNaT + */ + __pyx_v_nat_count = 0; + + /* "pandas/lib.pyx":972 + * + * nat_count = 0 + * if hasnans: # <<<<<<<<<<<<<< + * mask = values == iNaT + * nat_count = np.sum(mask) + */ + __pyx_t_2 = (__pyx_v_hasnans != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":973 + * nat_count = 0 + * if hasnans: + * mask = values == iNaT # <<<<<<<<<<<<<< + * nat_count = np.sum(mask) + * values = values[~mask] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_values), __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_mask = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":974 + * if hasnans: + * mask = values == iNaT + * nat_count = np.sum(mask) # <<<<<<<<<<<<<< + * values = values[~mask] + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_nat_count = __pyx_t_5; + + /* "pandas/lib.pyx":975 + * mask = values == iNaT + * nat_count = np.sum(mask) + * values = values[~mask] # <<<<<<<<<<<<<< + * + * lenidx = len(values) + */ + __pyx_t_4 = PyNumber_Invert(__pyx_v_mask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_values), __pyx_t_4); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":977 + * values = values[~mask] + * + * lenidx = len(values) # <<<<<<<<<<<<<< + * lenbin = len(binner) + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lenidx = __pyx_t_11; + + /* "pandas/lib.pyx":978 + * + * lenidx = len(values) + * lenbin = len(binner) # <<<<<<<<<<<<<< + * + * if lenidx <= 0 or lenbin <= 0: + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_binner)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lenbin = __pyx_t_11; + + /* "pandas/lib.pyx":980 + * lenbin = len(binner) + * + * if lenidx <= 0 or lenbin <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid length for values or for binner") + * + */ + __pyx_t_2 = ((__pyx_v_lenidx <= 0) != 0); + if (!__pyx_t_2) { + __pyx_t_12 = ((__pyx_v_lenbin <= 0) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_2; + } + if (__pyx_t_13) { + + /* "pandas/lib.pyx":981 + * + * if lenidx <= 0 or lenbin <= 0: + * raise ValueError("Invalid length for values or for binner") # <<<<<<<<<<<<<< + * + * # check binner fits data + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":984 + * + * # check binner fits data + * if values[0] < binner[0]: # <<<<<<<<<<<<<< + * raise ValueError("Values falls before first bin") + * + */ + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_binner.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_binner.diminfo[0].strides))) != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":985 + * # check binner fits data + * if values[0] < binner[0]: + * raise ValueError("Values falls before first bin") # <<<<<<<<<<<<<< + * + * if values[lenidx-1] > binner[lenbin-1]: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":987 + * raise ValueError("Values falls before first bin") + * + * if values[lenidx-1] > binner[lenbin-1]: # <<<<<<<<<<<<<< + * raise ValueError("Values falls after last bin") + * + */ + __pyx_t_11 = (__pyx_v_lenidx - 1); + __pyx_t_16 = (__pyx_v_lenbin - 1); + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_binner.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_binner.diminfo[0].strides))) != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":988 + * + * if values[lenidx-1] > binner[lenbin-1]: + * raise ValueError("Values falls after last bin") # <<<<<<<<<<<<<< + * + * bins = np.empty(lenbin - 1, dtype=np.int64) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":990 + * raise ValueError("Values falls after last bin") + * + * bins = np.empty(lenbin - 1, dtype=np.int64) # <<<<<<<<<<<<<< + * + * j = 0 # index into values + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_lenbin - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_int64); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_bins = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/lib.pyx":992 + * bins = np.empty(lenbin - 1, dtype=np.int64) + * + * j = 0 # index into values # <<<<<<<<<<<<<< + * bc = 0 # bin count + * + */ + __pyx_v_j = 0; + + /* "pandas/lib.pyx":993 + * + * j = 0 # index into values + * bc = 0 # bin count # <<<<<<<<<<<<<< + * + * # linear scan + */ + __pyx_v_bc = 0; + + /* "pandas/lib.pyx":996 + * + * # linear scan + * if right_closed: # <<<<<<<<<<<<<< + * for i in range(0, lenbin - 1): + * r_bin = binner[i+1] + */ + __pyx_t_13 = (__pyx_v_right_closed != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":997 + * # linear scan + * if right_closed: + * for i in range(0, lenbin - 1): # <<<<<<<<<<<<<< + * r_bin = binner[i+1] + * # count values in current bin, advance to next bin + */ + __pyx_t_20 = (__pyx_v_lenbin - 1); + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/lib.pyx":998 + * if right_closed: + * for i in range(0, lenbin - 1): + * r_bin = binner[i+1] # <<<<<<<<<<<<<< + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] <= r_bin: + */ + __pyx_t_22 = (__pyx_v_i + 1); + __pyx_v_r_bin = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_binner.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_binner.diminfo[0].strides)); + + /* "pandas/lib.pyx":1000 + * r_bin = binner[i+1] + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] <= r_bin: # <<<<<<<<<<<<<< + * j += 1 + * bins[bc] = j + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_lenidx) != 0); + if (__pyx_t_13) { + __pyx_t_23 = __pyx_v_j; + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_values.diminfo[0].strides)) <= __pyx_v_r_bin) != 0); + __pyx_t_12 = __pyx_t_2; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/lib.pyx":1001 + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] <= r_bin: + * j += 1 # <<<<<<<<<<<<<< + * bins[bc] = j + * bc += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/lib.pyx":1002 + * while j < lenidx and values[j] <= r_bin: + * j += 1 + * bins[bc] = j # <<<<<<<<<<<<<< + * bc += 1 + * else: + */ + __pyx_t_24 = __pyx_v_bc; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_bins.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/lib.pyx":1003 + * j += 1 + * bins[bc] = j + * bc += 1 # <<<<<<<<<<<<<< + * else: + * for i in range(0, lenbin - 1): + */ + __pyx_v_bc = (__pyx_v_bc + 1); + } + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/lib.pyx":1005 + * bc += 1 + * else: + * for i in range(0, lenbin - 1): # <<<<<<<<<<<<<< + * r_bin = binner[i+1] + * # count values in current bin, advance to next bin + */ + __pyx_t_20 = (__pyx_v_lenbin - 1); + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/lib.pyx":1006 + * else: + * for i in range(0, lenbin - 1): + * r_bin = binner[i+1] # <<<<<<<<<<<<<< + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] < r_bin: + */ + __pyx_t_25 = (__pyx_v_i + 1); + __pyx_v_r_bin = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_binner.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_binner.diminfo[0].strides)); + + /* "pandas/lib.pyx":1008 + * r_bin = binner[i+1] + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] < r_bin: # <<<<<<<<<<<<<< + * j += 1 + * bins[bc] = j + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j < __pyx_v_lenidx) != 0); + if (__pyx_t_12) { + __pyx_t_26 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides)) < __pyx_v_r_bin) != 0); + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_12; + } + if (!__pyx_t_2) break; + + /* "pandas/lib.pyx":1009 + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] < r_bin: + * j += 1 # <<<<<<<<<<<<<< + * bins[bc] = j + * bc += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/lib.pyx":1010 + * while j < lenidx and values[j] < r_bin: + * j += 1 + * bins[bc] = j # <<<<<<<<<<<<<< + * bc += 1 + * + */ + __pyx_t_27 = __pyx_v_bc; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_bins.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/lib.pyx":1011 + * j += 1 + * bins[bc] = j + * bc += 1 # <<<<<<<<<<<<<< + * + * if nat_count > 0: + */ + __pyx_v_bc = (__pyx_v_bc + 1); + } + } + __pyx_L7:; + + /* "pandas/lib.pyx":1013 + * bc += 1 + * + * if nat_count > 0: # <<<<<<<<<<<<<< + * # shift bins by the number of NaT + * bins = bins + nat_count + */ + __pyx_t_2 = ((__pyx_v_nat_count > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1015 + * if nat_count > 0: + * # shift bins by the number of NaT + * bins = bins + nat_count # <<<<<<<<<<<<<< + * bins = np.insert(bins, 0, nat_count) + * + */ + __pyx_t_18 = __Pyx_PyInt_From_npy_int64(__pyx_v_nat_count); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_bins), __pyx_t_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __Pyx_DECREF_SET(__pyx_v_bins, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":1016 + * # shift bins by the number of NaT + * bins = bins + nat_count + * bins = np.insert(bins, 0, nat_count) # <<<<<<<<<<<<<< + * + * return bins + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_insert); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_nat_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_bins)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_bins)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_bins)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __Pyx_DECREF_SET(__pyx_v_bins, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/lib.pyx":1018 + * bins = np.insert(bins, 0, nat_count) + * + * return bins # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_bins)); + __pyx_r = ((PyObject *)__pyx_v_bins); + goto __pyx_L0; + + /* "pandas/lib.pyx":960 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner, # <<<<<<<<<<<<<< + * object closed='left', bint hasnans=0): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_binner.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.generate_bins_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_binner.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_bins); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1025 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_85row_bool_subset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_85row_bool_subset = {__Pyx_NAMESTR("row_bool_subset"), (PyCFunction)__pyx_pw_6pandas_3lib_85row_bool_subset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_85row_bool_subset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("row_bool_subset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("row_bool_subset", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "row_bool_subset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("row_bool_subset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.row_bool_subset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_84row_bool_subset(__pyx_self, __pyx_v_values, __pyx_v_mask); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_84row_bool_subset(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_pos; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("row_bool_subset", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1028 + * ndarray[uint8_t, cast=True] mask): + * cdef: + * Py_ssize_t i, j, n, k, pos = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out + * + */ + __pyx_v_pos = 0; + + /* "pandas/lib.pyx":1031 + * ndarray[float64_t, ndim=2] out + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * assert(n == len(mask)) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_k = __pyx_t_7; + + /* "pandas/lib.pyx":1032 + * + * n, k = ( values).shape + * assert(n == len(mask)) # <<<<<<<<<<<<<< + * + * out = np.empty((mask.sum(), k), dtype=np.float64) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!((__pyx_v_n == __pyx_t_7) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/lib.pyx":1034 + * assert(n == len(mask)) + * + * out = np.empty((mask.sum(), k), dtype=np.float64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":1036 + * out = np.empty((mask.sum(), k), dtype=np.float64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * for j in range(k): + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/lib.pyx":1037 + * + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * for j in range(k): + * out[pos, j] = values[i, j] + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1038 + * for i in range(n): + * if mask[i]: + * for j in range(k): # <<<<<<<<<<<<<< + * out[pos, j] = values[i, j] + * pos += 1 + */ + __pyx_t_16 = __pyx_v_k; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/lib.pyx":1039 + * if mask[i]: + * for j in range(k): + * out[pos, j] = values[i, j] # <<<<<<<<<<<<<< + * pos += 1 + * + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_pos; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + + /* "pandas/lib.pyx":1040 + * for j in range(k): + * out[pos, j] = values[i, j] + * pos += 1 # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_v_pos = (__pyx_v_pos + 1); + goto __pyx_L7; + } + __pyx_L7:; + } + + /* "pandas/lib.pyx":1042 + * pos += 1 + * + * return out # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/lib.pyx":1025 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.row_bool_subset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1046 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_87row_bool_subset_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_87row_bool_subset_object = {__Pyx_NAMESTR("row_bool_subset_object"), (PyCFunction)__pyx_pw_6pandas_3lib_87row_bool_subset_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_87row_bool_subset_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("row_bool_subset_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("row_bool_subset_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "row_bool_subset_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("row_bool_subset_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.row_bool_subset_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_86row_bool_subset_object(__pyx_self, __pyx_v_values, __pyx_v_mask); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_86row_bool_subset_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_pos; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + PyObject **__pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("row_bool_subset_object", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1049 + * ndarray[uint8_t, cast=True] mask): + * cdef: + * Py_ssize_t i, j, n, k, pos = 0 # <<<<<<<<<<<<<< + * ndarray[object, ndim=2] out + * + */ + __pyx_v_pos = 0; + + /* "pandas/lib.pyx":1052 + * ndarray[object, ndim=2] out + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * assert(n == len(mask)) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_k = __pyx_t_7; + + /* "pandas/lib.pyx":1053 + * + * n, k = ( values).shape + * assert(n == len(mask)) # <<<<<<<<<<<<<< + * + * out = np.empty((mask.sum(), k), dtype=object) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!((__pyx_v_n == __pyx_t_7) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/lib.pyx":1055 + * assert(n == len(mask)) + * + * out = np.empty((mask.sum(), k), dtype=object) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1057 + * out = np.empty((mask.sum(), k), dtype=object) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * for j in range(k): + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/lib.pyx":1058 + * + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * for j in range(k): + * out[pos, j] = values[i, j] + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_14) { + + /* "pandas/lib.pyx":1059 + * for i in range(n): + * if mask[i]: + * for j in range(k): # <<<<<<<<<<<<<< + * out[pos, j] = values[i, j] + * pos += 1 + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/lib.pyx":1060 + * if mask[i]: + * for j in range(k): + * out[pos, j] = values[i, j] # <<<<<<<<<<<<<< + * pos += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_19 = __pyx_v_pos; + __pyx_t_20 = __pyx_v_j; + __pyx_t_21 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_21); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_21); + *__pyx_t_21 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_21); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "pandas/lib.pyx":1061 + * for j in range(k): + * out[pos, j] = values[i, j] + * pos += 1 # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_v_pos = (__pyx_v_pos + 1); + goto __pyx_L7; + } + __pyx_L7:; + } + + /* "pandas/lib.pyx":1063 + * pos += 1 + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/lib.pyx":1046 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.row_bool_subset_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1066 + * + * + * def group_count(ndarray[int64_t] values, Py_ssize_t size): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_89group_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_89group_count = {__Pyx_NAMESTR("group_count"), (PyCFunction)__pyx_pw_6pandas_3lib_89group_count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_89group_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + Py_ssize_t __pyx_v_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_size,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.group_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_88group_count(__pyx_self, __pyx_v_values, __pyx_v_size); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_88group_count(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, Py_ssize_t __pyx_v_size) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_counts = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + __pyx_t_5numpy_int64_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1068 + * def group_count(ndarray[int64_t] values, Py_ssize_t size): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] counts + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1071 + * ndarray[int64_t] counts + * + * counts = np.zeros(size, dtype=np.int64) # <<<<<<<<<<<<<< + * for i in range(n): + * counts[values[i]] += 1 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1072 + * + * counts = np.zeros(size, dtype=np.int64) + * for i in range(n): # <<<<<<<<<<<<<< + * counts[values[i]] += 1 + * return counts + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":1073 + * counts = np.zeros(size, dtype=np.int64) + * for i in range(n): + * counts[values[i]] += 1 # <<<<<<<<<<<<<< + * return counts + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides)); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + } + + /* "pandas/lib.pyx":1074 + * for i in range(n): + * counts[values[i]] += 1 + * return counts # <<<<<<<<<<<<<< + * + * def lookup_values(ndarray[object] values, dict mapping): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + __pyx_r = ((PyObject *)__pyx_v_counts); + goto __pyx_L0; + + /* "pandas/lib.pyx":1066 + * + * + * def group_count(ndarray[int64_t] values, Py_ssize_t size): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.group_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1076 + * return counts + * + * def lookup_values(ndarray[object] values, dict mapping): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_91lookup_values(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_91lookup_values = {__Pyx_NAMESTR("lookup_values"), (PyCFunction)__pyx_pw_6pandas_3lib_91lookup_values, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_91lookup_values(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_mapping = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup_values (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mapping,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapping)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("lookup_values", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup_values") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mapping = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lookup_values", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.lookup_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapping), (&PyDict_Type), 1, "mapping", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_90lookup_values(__pyx_self, __pyx_v_values, __pyx_v_mapping); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_90lookup_values(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_mapping) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup_values", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1078 + * def lookup_values(ndarray[object] values, dict mapping): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype='O') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1080 + * Py_ssize_t i, n = len(values) + * + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * for i in range(n): + * result[i] = mapping[values[i]] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1081 + * + * result = np.empty(n, dtype='O') + * for i in range(n): # <<<<<<<<<<<<<< + * result[i] = mapping[values[i]] + * return maybe_convert_objects(result) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/lib.pyx":1082 + * result = np.empty(n, dtype='O') + * for i in range(n): + * result[i] = mapping[values[i]] # <<<<<<<<<<<<<< + * return maybe_convert_objects(result) + * + */ + if (unlikely(__pyx_v_mapping == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_mapping, __pyx_t_5); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_result, __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "pandas/lib.pyx":1083 + * for i in range(n): + * result[i] = mapping[values[i]] + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1076 + * return counts + * + * def lookup_values(ndarray[object] values, dict mapping): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.lookup_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1086 + * + * + * def count_level_1d(ndarray[uint8_t, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_93count_level_1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_93count_level_1d = {__Pyx_NAMESTR("count_level_1d"), (PyCFunction)__pyx_pw_6pandas_3lib_93count_level_1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_93count_level_1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_mask = 0; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_max_bin; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count_level_1d (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,&__pyx_n_s_labels,&__pyx_n_s_max_bin,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_bin)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_level_1d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_mask = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + __pyx_v_max_bin = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_bin == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.count_level_1d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_92count_level_1d(__pyx_self, __pyx_v_mask, __pyx_v_labels, __pyx_v_max_bin); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_92count_level_1d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_max_bin) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_counts = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + __pyx_t_5numpy_int64_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count_level_1d", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1092 + * ndarray[int64_t] counts + * + * counts = np.zeros(max_bin, dtype='i8') # <<<<<<<<<<<<<< + * + * n = len(mask) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_bin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/lib.pyx":1094 + * counts = np.zeros(max_bin, dtype='i8') + * + * n = len(mask) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_10; + + /* "pandas/lib.pyx":1096 + * n = len(mask) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * if mask[i]: + * counts[labels[i]] += 1 + */ + __pyx_t_10 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) { + + /* "pandas/lib.pyx":1097 + * + * for i from 0 <= i < n: + * if mask[i]: # <<<<<<<<<<<<<< + * counts[labels[i]] += 1 + * + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1098 + * for i from 0 <= i < n: + * if mask[i]: + * counts[labels[i]] += 1 # <<<<<<<<<<<<<< + * + * return counts + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides)); + __pyx_t_6 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":1100 + * counts[labels[i]] += 1 + * + * return counts # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + __pyx_r = ((PyObject *)__pyx_v_counts); + goto __pyx_L0; + + /* "pandas/lib.pyx":1086 + * + * + * def count_level_1d(ndarray[uint8_t, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.count_level_1d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1103 + * + * + * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_95count_level_2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_95count_level_2d = {__Pyx_NAMESTR("count_level_2d"), (PyCFunction)__pyx_pw_6pandas_3lib_95count_level_2d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_95count_level_2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_mask = 0; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_max_bin; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count_level_2d (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,&__pyx_n_s_labels,&__pyx_n_s_max_bin,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_bin)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_level_2d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_mask = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + __pyx_v_max_bin = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_bin == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.count_level_2d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_94count_level_2d(__pyx_self, __pyx_v_mask, __pyx_v_labels, __pyx_v_max_bin); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_94count_level_2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_max_bin) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_counts = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + __pyx_t_5numpy_int64_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count_level_2d", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1109 + * ndarray[int64_t, ndim=2] counts + * + * n, k = ( mask).shape # <<<<<<<<<<<<<< + * counts = np.zeros((max_bin, k), dtype='i8') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_k = __pyx_t_7; + + /* "pandas/lib.pyx":1110 + * + * n, k = ( mask).shape + * counts = np.zeros((max_bin, k), dtype='i8') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_bin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_counts.diminfo[1].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_counts.diminfo[1].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1112 + * counts = np.zeros((max_bin, k), dtype='i8') + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * if mask[i, j]: + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":1113 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if mask[i, j]: + * counts[labels[i], j] += 1 + */ + __pyx_t_6 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/lib.pyx":1114 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * if mask[i, j]: # <<<<<<<<<<<<<< + * counts[labels[i], j] += 1 + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_mask.diminfo[1].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_mask.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1115 + * for j from 0 <= j < k: + * if mask[i, j]: + * counts[labels[i], j] += 1 # <<<<<<<<<<<<<< + * + * return counts + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + __pyx_t_18 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[1].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[1].strides) += 1; + goto __pyx_L9; + } + __pyx_L9:; + } + } + + /* "pandas/lib.pyx":1117 + * counts[labels[i], j] += 1 + * + * return counts # <<<<<<<<<<<<<< + * + * cdef class _PandasNull: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + __pyx_r = ((PyObject *)__pyx_v_counts); + goto __pyx_L0; + + /* "pandas/lib.pyx":1103 + * + * + * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.count_level_2d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1121 + * cdef class _PandasNull: + * + * def __richcmp__(_PandasNull self, object other, int op): # <<<<<<<<<<<<<< + * if op == 2: # == + * return isinstance(other, _PandasNull) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11_PandasNull_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11_PandasNull_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_3lib__PandasNull, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_11_PandasNull___richcmp__(((struct __pyx_obj_6pandas_3lib__PandasNull *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11_PandasNull___richcmp__(CYTHON_UNUSED struct __pyx_obj_6pandas_3lib__PandasNull *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__richcmp__", 0); + + /* "pandas/lib.pyx":1124 + * if op == 2: # == + * return isinstance(other, _PandasNull) + * elif op == 3: # != # <<<<<<<<<<<<<< + * return not isinstance(other, _PandasNull) + * else: + */ + switch (__pyx_v_op) { + + /* "pandas/lib.pyx":1122 + * + * def __richcmp__(_PandasNull self, object other, int op): + * if op == 2: # == # <<<<<<<<<<<<<< + * return isinstance(other, _PandasNull) + * elif op == 3: # != + */ + case 2: + + /* "pandas/lib.pyx":1123 + * def __richcmp__(_PandasNull self, object other, int op): + * if op == 2: # == + * return isinstance(other, _PandasNull) # <<<<<<<<<<<<<< + * elif op == 3: # != + * return not isinstance(other, _PandasNull) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull)); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + break; + + /* "pandas/lib.pyx":1124 + * if op == 2: # == + * return isinstance(other, _PandasNull) + * elif op == 3: # != # <<<<<<<<<<<<<< + * return not isinstance(other, _PandasNull) + * else: + */ + case 3: + + /* "pandas/lib.pyx":1125 + * return isinstance(other, _PandasNull) + * elif op == 3: # != + * return not isinstance(other, _PandasNull) # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull)); + __pyx_t_2 = __Pyx_PyBool_FromLong((!(__pyx_t_1 != 0))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + break; + default: + + /* "pandas/lib.pyx":1127 + * return not isinstance(other, _PandasNull) + * else: + * return False # <<<<<<<<<<<<<< + * + * def __hash__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + break; + } + + /* "pandas/lib.pyx":1121 + * cdef class _PandasNull: + * + * def __richcmp__(_PandasNull self, object other, int op): # <<<<<<<<<<<<<< + * if op == 2: # == + * return isinstance(other, _PandasNull) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib._PandasNull.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1129 + * return False + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + +/* Python wrapper */ +static Py_hash_t __pyx_pw_6pandas_3lib_11_PandasNull_3__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_6pandas_3lib_11_PandasNull_3__hash__(PyObject *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11_PandasNull_2__hash__(((struct __pyx_obj_6pandas_3lib__PandasNull *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_hash_t __pyx_pf_6pandas_3lib_11_PandasNull_2__hash__(CYTHON_UNUSED struct __pyx_obj_6pandas_3lib__PandasNull *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "pandas/lib.pyx":1130 + * + * def __hash__(self): + * return 0 # <<<<<<<<<<<<<< + * + * pandas_null = _PandasNull() + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1129 + * return False + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + + /* function exit code */ + __pyx_L0:; + if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1134 + * pandas_null = _PandasNull() + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_97fast_zip_fillna(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_96fast_zip_fillna[] = "\n For zipping multiple ndarrays into an ndarray of tuples\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_97fast_zip_fillna = {__Pyx_NAMESTR("fast_zip_fillna"), (PyCFunction)__pyx_pw_6pandas_3lib_97fast_zip_fillna, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_96fast_zip_fillna)}; +static PyObject *__pyx_pw_6pandas_3lib_97fast_zip_fillna(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ndarrays = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_zip_fillna (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ndarrays,&__pyx_n_s_fill_value,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__10; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ndarrays)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fast_zip_fillna") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ndarrays = ((PyObject*)values[0]); + __pyx_v_fill_value = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fast_zip_fillna", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.fast_zip_fillna", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ndarrays), (&PyList_Type), 1, "ndarrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_96fast_zip_fillna(__pyx_self, __pyx_v_ndarrays, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_96fast_zip_fillna(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ndarrays, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayIterObject *__pyx_v_it = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_tup = 0; + PyObject *__pyx_v_arr = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyObject **__pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_zip_fillna", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":1144 + * object val, tup + * + * k = len(ndarrays) # <<<<<<<<<<<<<< + * n = len(ndarrays[0]) + * + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_ndarrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":1145 + * + * k = len(ndarrays) + * n = len(ndarrays[0]) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=object) + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1147 + * n = len(ndarrays[0]) + * + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * # initialize tuples on first pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1150 + * + * # initialize tuples on first pass + * arr = ndarrays[0] # <<<<<<<<<<<<<< + * it = PyArray_IterNew(arr) + * for i in range(n): + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_arr = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1151 + * # initialize tuples on first pass + * arr = ndarrays[0] + * it = PyArray_IterNew(arr) # <<<<<<<<<<<<<< + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + */ + __pyx_t_5 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_t_5; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_it = ((PyArrayIterObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1152 + * arr = ndarrays[0] + * it = PyArray_IterNew(arr) + * for i in range(n): # <<<<<<<<<<<<<< + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * tup = PyTuple_New(k) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/lib.pyx":1153 + * it = PyArray_IterNew(arr) + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) # <<<<<<<<<<<<<< + * tup = PyTuple_New(k) + * + */ + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyArray_GETITEM(((PyArrayObject *)__pyx_v_arr), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1154 + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * tup = PyTuple_New(k) # <<<<<<<<<<<<<< + * + * if val != val: + */ + __pyx_t_2 = PyTuple_New(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_tup, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1156 + * tup = PyTuple_New(k) + * + * if val != val: # <<<<<<<<<<<<<< + * val = fill_value + * + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1157 + * + * if val != val: + * val = fill_value # <<<<<<<<<<<<<< + * + * PyTuple_SET_ITEM(tup, 0, val) + */ + __Pyx_INCREF(__pyx_v_fill_value); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_v_fill_value); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/lib.pyx":1159 + * val = fill_value + * + * PyTuple_SET_ITEM(tup, 0, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * result[i] = tup + */ + PyTuple_SET_ITEM(__pyx_v_tup, 0, __pyx_v_val); + + /* "pandas/lib.pyx":1160 + * + * PyTuple_SET_ITEM(tup, 0, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * result[i] = tup + * PyArray_ITER_NEXT(it) + */ + Py_INCREF(__pyx_v_val); + + /* "pandas/lib.pyx":1161 + * PyTuple_SET_ITEM(tup, 0, val) + * Py_INCREF(val) + * result[i] = tup # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_14); + __Pyx_INCREF(__pyx_v_tup); __Pyx_DECREF(*__pyx_t_14); + *__pyx_t_14 = __pyx_v_tup; + __Pyx_GIVEREF(*__pyx_t_14); + + /* "pandas/lib.pyx":1162 + * Py_INCREF(val) + * result[i] = tup + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * + * for j in range(1, k): + */ + PyArray_ITER_NEXT(__pyx_v_it); + } + + /* "pandas/lib.pyx":1164 + * PyArray_ITER_NEXT(it) + * + * for j in range(1, k): # <<<<<<<<<<<<<< + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_j = __pyx_t_11; + + /* "pandas/lib.pyx":1165 + * + * for j in range(1, k): + * arr = ndarrays[j] # <<<<<<<<<<<<<< + * it = PyArray_IterNew(arr) + * if len(arr) != n: + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1166 + * for j in range(1, k): + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) # <<<<<<<<<<<<<< + * if len(arr) != n: + * raise ValueError('all arrays must be same length') + */ + __pyx_t_2 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_it, ((PyArrayIterObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1167 + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) + * if len(arr) != n: # <<<<<<<<<<<<<< + * raise ValueError('all arrays must be same length') + * + */ + __pyx_t_15 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((__pyx_t_15 != __pyx_v_n) != 0); + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1168 + * it = PyArray_IterNew(arr) + * if len(arr) != n: + * raise ValueError('all arrays must be same length') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1170 + * raise ValueError('all arrays must be same length') + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * if val != val: + */ + __pyx_t_15 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/lib.pyx":1171 + * + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) # <<<<<<<<<<<<<< + * if val != val: + * val = fill_value + */ + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyArray_GETITEM(((PyArrayObject *)__pyx_v_arr), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1172 + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * if val != val: # <<<<<<<<<<<<<< + * val = fill_value + * + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1173 + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * if val != val: + * val = fill_value # <<<<<<<<<<<<<< + * + * PyTuple_SET_ITEM(result[i], j, val) + */ + __Pyx_INCREF(__pyx_v_fill_value); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_v_fill_value); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/lib.pyx":1175 + * val = fill_value + * + * PyTuple_SET_ITEM(result[i], j, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * PyArray_ITER_NEXT(it) + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, __pyx_v_j, __pyx_v_val); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1176 + * + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * + */ + Py_INCREF(__pyx_v_val); + + /* "pandas/lib.pyx":1177 + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * + * return result + */ + PyArray_ITER_NEXT(__pyx_v_it); + } + } + + /* "pandas/lib.pyx":1179 + * PyArray_ITER_NEXT(it) + * + * return result # <<<<<<<<<<<<<< + * + * def duplicated(ndarray[object] values, take_last=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":1134 + * pandas_null = _PandasNull() + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_zip_fillna", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_it); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1181 + * return result + * + * def duplicated(ndarray[object] values, take_last=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_99duplicated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_99duplicated = {__Pyx_NAMESTR("duplicated"), (PyCFunction)__pyx_pw_6pandas_3lib_99duplicated, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_99duplicated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_take_last = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("duplicated (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_take_last,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_take_last); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "duplicated") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_take_last = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("duplicated", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.duplicated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_98duplicated(__pyx_self, __pyx_v_values, __pyx_v_take_last); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_98duplicated(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_take_last) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_seen = 0; + PyObject *__pyx_v_row = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("duplicated", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1184 + * cdef: + * Py_ssize_t i, n + * dict seen = {} # <<<<<<<<<<<<<< + * object row + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_seen = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1187 + * object row + * + * n = len(values) # <<<<<<<<<<<<<< + * cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8) + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":1188 + * + * n = len(values) + * cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * + * if take_last: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1190 + * cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8) + * + * if take_last: # <<<<<<<<<<<<<< + * for i from n > i >= 0: + * row = values[i] + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_take_last); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_8) { + + /* "pandas/lib.pyx":1191 + * + * if take_last: + * for i from n > i >= 0: # <<<<<<<<<<<<<< + * row = values[i] + * + */ + for (__pyx_v_i = __pyx_v_n-1; __pyx_v_i >= 0; __pyx_v_i--) { + + /* "pandas/lib.pyx":1192 + * if take_last: + * for i from n > i >= 0: + * row = values[i] # <<<<<<<<<<<<<< + * + * if row in seen: + */ + __pyx_t_2 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_2 < 0) { + __pyx_t_2 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_2 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1194 + * row = values[i] + * + * if row in seen: # <<<<<<<<<<<<<< + * result[i] = 1 + * else: + */ + __pyx_t_8 = (__Pyx_PyDict_Contains(__pyx_v_row, __pyx_v_seen, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_8 != 0); + if (__pyx_t_10) { + + /* "pandas/lib.pyx":1195 + * + * if row in seen: + * result[i] = 1 # <<<<<<<<<<<<<< + * else: + * seen[row] = None + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/lib.pyx":1197 + * result[i] = 1 + * else: + * seen[row] = None # <<<<<<<<<<<<<< + * result[i] = 0 + * else: + */ + if (unlikely(PyDict_SetItem(__pyx_v_seen, __pyx_v_row, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1198 + * else: + * seen[row] = None + * result[i] = 0 # <<<<<<<<<<<<<< + * else: + * for i from 0 <= i < n: + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + } + __pyx_L6:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1200 + * result[i] = 0 + * else: + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * row = values[i] + * if row in seen: + */ + __pyx_t_13 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { + + /* "pandas/lib.pyx":1201 + * else: + * for i from 0 <= i < n: + * row = values[i] # <<<<<<<<<<<<<< + * if row in seen: + * result[i] = 1 + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1202 + * for i from 0 <= i < n: + * row = values[i] + * if row in seen: # <<<<<<<<<<<<<< + * result[i] = 1 + * else: + */ + __pyx_t_10 = (__Pyx_PyDict_Contains(__pyx_v_row, __pyx_v_seen, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_10 != 0); + if (__pyx_t_8) { + + /* "pandas/lib.pyx":1203 + * row = values[i] + * if row in seen: + * result[i] = 1 # <<<<<<<<<<<<<< + * else: + * seen[row] = None + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/lib.pyx":1205 + * result[i] = 1 + * else: + * seen[row] = None # <<<<<<<<<<<<<< + * result[i] = 0 + * + */ + if (unlikely(PyDict_SetItem(__pyx_v_seen, __pyx_v_row, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1206 + * else: + * seen[row] = None + * result[i] = 0 # <<<<<<<<<<<<<< + * + * return result.view(np.bool_) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + } + __pyx_L9:; + } + } + __pyx_L3:; + + /* "pandas/lib.pyx":1208 + * result[i] = 0 + * + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1181 + * return result + * + * def duplicated(ndarray[object] values, take_last=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.duplicated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_seen); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1210 + * return result.view(np.bool_) + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, group_size, n, lab, start + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_101generate_slices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_101generate_slices = {__Pyx_NAMESTR("generate_slices"), (PyCFunction)__pyx_pw_6pandas_3lib_101generate_slices, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_101generate_slices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_ngroups; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("generate_slices (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_labels,&__pyx_n_s_ngroups,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ngroups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("generate_slices", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generate_slices") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_labels = ((PyArrayObject *)values[0]); + __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("generate_slices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.generate_slices", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_100generate_slices(__pyx_self, __pyx_v_labels, __pyx_v_ngroups); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_100generate_slices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_ngroups) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_group_size; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_start; + PyArrayObject *__pyx_v_starts = 0; + PyObject *__pyx_v_ends = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_starts; + __Pyx_Buffer __pyx_pybuffer_starts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("generate_slices", 0); + __pyx_pybuffer_starts.pybuffer.buf = NULL; + __pyx_pybuffer_starts.refcount = 0; + __pyx_pybuffernd_starts.data = NULL; + __pyx_pybuffernd_starts.rcbuffer = &__pyx_pybuffer_starts; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1216 + * ndarray[int64_t] starts + * + * n = len(labels) # <<<<<<<<<<<<<< + * + * starts = np.zeros(ngroups, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1218 + * n = len(labels) + * + * starts = np.zeros(ngroups, dtype=np.int64) # <<<<<<<<<<<<<< + * ends = np.zeros(ngroups, dtype=np.int64) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_starts.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_starts.rcbuffer->pybuffer, (PyObject*)__pyx_v_starts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_starts.diminfo[0].strides = __pyx_pybuffernd_starts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_starts.diminfo[0].shape = __pyx_pybuffernd_starts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_starts = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1219 + * + * starts = np.zeros(ngroups, dtype=np.int64) + * ends = np.zeros(ngroups, dtype=np.int64) # <<<<<<<<<<<<<< + * + * start = 0 + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_ends = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1221 + * ends = np.zeros(ngroups, dtype=np.int64) + * + * start = 0 # <<<<<<<<<<<<<< + * group_size = 0 + * for i in range(n): + */ + __pyx_v_start = 0; + + /* "pandas/lib.pyx":1222 + * + * start = 0 + * group_size = 0 # <<<<<<<<<<<<<< + * for i in range(n): + * group_size += 1 + */ + __pyx_v_group_size = 0; + + /* "pandas/lib.pyx":1223 + * start = 0 + * group_size = 0 + * for i in range(n): # <<<<<<<<<<<<<< + * group_size += 1 + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":1224 + * group_size = 0 + * for i in range(n): + * group_size += 1 # <<<<<<<<<<<<<< + * lab = labels[i] + * if i == n - 1 or lab != labels[i + 1]: + */ + __pyx_v_group_size = (__pyx_v_group_size + 1); + + /* "pandas/lib.pyx":1225 + * for i in range(n): + * group_size += 1 + * lab = labels[i] # <<<<<<<<<<<<<< + * if i == n - 1 or lab != labels[i + 1]: + * starts[lab] = start + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/lib.pyx":1226 + * group_size += 1 + * lab = labels[i] + * if i == n - 1 or lab != labels[i + 1]: # <<<<<<<<<<<<<< + * starts[lab] = start + * ends[lab] = start + group_size + */ + __pyx_t_14 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0); + if (!__pyx_t_14) { + __pyx_t_15 = (__pyx_v_i + 1); + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_lab != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (__pyx_t_17) { + + /* "pandas/lib.pyx":1227 + * lab = labels[i] + * if i == n - 1 or lab != labels[i + 1]: + * starts[lab] = start # <<<<<<<<<<<<<< + * ends[lab] = start + group_size + * start += group_size + */ + __pyx_t_18 = __pyx_v_lab; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_starts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_starts.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_starts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_starts.diminfo[0].strides) = __pyx_v_start; + + /* "pandas/lib.pyx":1228 + * if i == n - 1 or lab != labels[i + 1]: + * starts[lab] = start + * ends[lab] = start + group_size # <<<<<<<<<<<<<< + * start += group_size + * group_size = 0 + */ + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_start + __pyx_v_group_size)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_SetItemInt(__pyx_v_ends, __pyx_v_lab, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1229 + * starts[lab] = start + * ends[lab] = start + group_size + * start += group_size # <<<<<<<<<<<<<< + * group_size = 0 + * + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_group_size); + + /* "pandas/lib.pyx":1230 + * ends[lab] = start + group_size + * start += group_size + * group_size = 0 # <<<<<<<<<<<<<< + * + * return starts, ends + */ + __pyx_v_group_size = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":1232 + * group_size = 0 + * + * return starts, ends # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_starts)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_starts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_starts)); + __Pyx_INCREF(__pyx_v_ends); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ends); + __Pyx_GIVEREF(__pyx_v_ends); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1210 + * return result.view(np.bool_) + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, group_size, n, lab, start + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.generate_slices", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_starts); + __Pyx_XDECREF(__pyx_v_ends); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1235 + * + * + * def indices_fast(object index, ndarray[int64_t] labels, list keys, # <<<<<<<<<<<<<< + * list sorted_labels): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_103indices_fast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_103indices_fast = {__Pyx_NAMESTR("indices_fast"), (PyCFunction)__pyx_pw_6pandas_3lib_103indices_fast, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_103indices_fast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + PyObject *__pyx_v_keys = 0; + PyObject *__pyx_v_sorted_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("indices_fast (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,&__pyx_n_s_keys,&__pyx_n_s_sorted_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sorted_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "indices_fast") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_index = values[0]; + __pyx_v_labels = ((PyArrayObject *)values[1]); + __pyx_v_keys = ((PyObject*)values[2]); + __pyx_v_sorted_labels = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.indices_fast", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sorted_labels), (&PyList_Type), 1, "sorted_labels", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_102indices_fast(__pyx_self, __pyx_v_index, __pyx_v_labels, __pyx_v_keys, __pyx_v_sorted_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_102indices_fast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_keys, PyObject *__pyx_v_sorted_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_cur; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_tup = 0; + PyObject *__pyx_v_val = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + long __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("indices_fast", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1238 + * list sorted_labels): + * cdef: + * Py_ssize_t i, j, k, lab, cur, start, n = len(labels) # <<<<<<<<<<<<<< + * dict result = {} + * object tup + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1239 + * cdef: + * Py_ssize_t i, j, k, lab, cur, start, n = len(labels) + * dict result = {} # <<<<<<<<<<<<<< + * object tup + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1242 + * object tup + * + * k = len(keys) # <<<<<<<<<<<<<< + * + * if n == 0: + */ + if (unlikely(__pyx_v_keys == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":1244 + * k = len(keys) + * + * if n == 0: # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1245 + * + * if n == 0: + * return result # <<<<<<<<<<<<<< + * + * start = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1247 + * return result + * + * start = 0 # <<<<<<<<<<<<<< + * cur = labels[0] + * for i in range(1, n): + */ + __pyx_v_start = 0; + + /* "pandas/lib.pyx":1248 + * + * start = 0 + * cur = labels[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * lab = labels[i] + */ + __pyx_t_4 = 0; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/lib.pyx":1249 + * start = 0 + * cur = labels[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * lab = labels[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/lib.pyx":1250 + * cur = labels[0] + * for i in range(1, n): + * lab = labels[i] # <<<<<<<<<<<<<< + * + * if lab != cur: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/lib.pyx":1252 + * lab = labels[i] + * + * if lab != cur: # <<<<<<<<<<<<<< + * if lab != -1: + * tup = PyTuple_New(k) + */ + __pyx_t_3 = ((__pyx_v_lab != __pyx_v_cur) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1253 + * + * if lab != cur: + * if lab != -1: # <<<<<<<<<<<<<< + * tup = PyTuple_New(k) + * for j in range(k): + */ + __pyx_t_3 = ((__pyx_v_lab != -1) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1254 + * if lab != cur: + * if lab != -1: + * tup = PyTuple_New(k) # <<<<<<<<<<<<<< + * for j in range(k): + * val = util.get_value_at(keys[j], + */ + __pyx_t_2 = PyTuple_New(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_tup, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1255 + * if lab != -1: + * tup = PyTuple_New(k) + * for j in range(k): # <<<<<<<<<<<<<< + * val = util.get_value_at(keys[j], + * sorted_labels[j][i-1]) + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_j = __pyx_t_9; + + /* "pandas/lib.pyx":1256 + * tup = PyTuple_New(k) + * for j in range(k): + * val = util.get_value_at(keys[j], # <<<<<<<<<<<<<< + * sorted_labels[j][i-1]) + * PyTuple_SET_ITEM(tup, j, val) + */ + if (unlikely(__pyx_v_keys == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_keys, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1257 + * for j in range(k): + * val = util.get_value_at(keys[j], + * sorted_labels[j][i-1]) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) + */ + if (unlikely(__pyx_v_sorted_labels == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_sorted_labels, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = (__pyx_v_i - 1); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_10, __pyx_t_11, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/lib.pyx":1256 + * tup = PyTuple_New(k) + * for j in range(k): + * val = util.get_value_at(keys[j], # <<<<<<<<<<<<<< + * sorted_labels[j][i-1]) + * PyTuple_SET_ITEM(tup, j, val) + */ + __pyx_t_10 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_2), __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/lib.pyx":1258 + * val = util.get_value_at(keys[j], + * sorted_labels[j][i-1]) + * PyTuple_SET_ITEM(tup, j, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * + */ + PyTuple_SET_ITEM(__pyx_v_tup, __pyx_v_j, __pyx_v_val); + + /* "pandas/lib.pyx":1259 + * sorted_labels[j][i-1]) + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * + * result[tup] = index[start:i] + */ + Py_INCREF(__pyx_v_val); + } + + /* "pandas/lib.pyx":1261 + * Py_INCREF(val) + * + * result[tup] = index[start:i] # <<<<<<<<<<<<<< + * start = i + * cur = lab + */ + __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_index, __pyx_v_start, __pyx_v_i, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_tup, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/lib.pyx":1262 + * + * result[tup] = index[start:i] + * start = i # <<<<<<<<<<<<<< + * cur = lab + * + */ + __pyx_v_start = __pyx_v_i; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/lib.pyx":1263 + * result[tup] = index[start:i] + * start = i + * cur = lab # <<<<<<<<<<<<<< + * + * tup = PyTuple_New(k) + */ + __pyx_v_cur = __pyx_v_lab; + } + + /* "pandas/lib.pyx":1265 + * cur = lab + * + * tup = PyTuple_New(k) # <<<<<<<<<<<<<< + * for j in range(k): + * val = util.get_value_at(keys[j], + */ + __pyx_t_10 = PyTuple_New(__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_XDECREF_SET(__pyx_v_tup, __pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/lib.pyx":1266 + * + * tup = PyTuple_New(k) + * for j in range(k): # <<<<<<<<<<<<<< + * val = util.get_value_at(keys[j], + * sorted_labels[j][n - 1]) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/lib.pyx":1267 + * tup = PyTuple_New(k) + * for j in range(k): + * val = util.get_value_at(keys[j], # <<<<<<<<<<<<<< + * sorted_labels[j][n - 1]) + * PyTuple_SET_ITEM(tup, j, val) + */ + if (unlikely(__pyx_v_keys == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_keys, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1268 + * for j in range(k): + * val = util.get_value_at(keys[j], + * sorted_labels[j][n - 1]) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) + */ + if (unlikely(__pyx_v_sorted_labels == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_sorted_labels, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = (__pyx_v_n - 1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_12, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/lib.pyx":1267 + * tup = PyTuple_New(k) + * for j in range(k): + * val = util.get_value_at(keys[j], # <<<<<<<<<<<<<< + * sorted_labels[j][n - 1]) + * PyTuple_SET_ITEM(tup, j, val) + */ + __pyx_t_12 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_10), __pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/lib.pyx":1269 + * val = util.get_value_at(keys[j], + * sorted_labels[j][n - 1]) + * PyTuple_SET_ITEM(tup, j, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * result[tup] = index[start:] + */ + PyTuple_SET_ITEM(__pyx_v_tup, __pyx_v_j, __pyx_v_val); + + /* "pandas/lib.pyx":1270 + * sorted_labels[j][n - 1]) + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * result[tup] = index[start:] + * + */ + Py_INCREF(__pyx_v_val); + } + + /* "pandas/lib.pyx":1271 + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) + * result[tup] = index[start:] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_index, __pyx_v_start, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_tup, __pyx_t_12) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/lib.pyx":1273 + * result[tup] = index[start:] + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/lib.pyx":1235 + * + * + * def indices_fast(object index, ndarray[int64_t] labels, list keys, # <<<<<<<<<<<<<< + * list sorted_labels): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.indices_fast", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_6pandas_3lib_106generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + +/* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_105get_blkno_indexers(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_104get_blkno_indexers[] = "\n Enumerate contiguous runs of integers in ndarray.\n\n Iterate over elements of `blknos` yielding ``(blkno, slice(start, stop))``\n pairs for each contiguous run found.\n\n If `group` is True and there is more than one run for a certain blkno,\n ``(blkno, array)`` with an array containing positions of all elements equal\n to blkno.\n\n Returns\n -------\n iter : iterator of (int, slice or array)\n\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_105get_blkno_indexers = {__Pyx_NAMESTR("get_blkno_indexers"), (PyCFunction)__pyx_pw_6pandas_3lib_105get_blkno_indexers, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_104get_blkno_indexers)}; +static PyObject *__pyx_pw_6pandas_3lib_105get_blkno_indexers(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_blknos = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_group; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_blkno_indexers (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_blknos,&__pyx_n_s_group,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blknos)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_group); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_blkno_indexers") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_blknos = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_blknos.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[1]) { + __pyx_v_group = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_group == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_group = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_blkno_indexers", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.get_blkno_indexers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_104get_blkno_indexers(__pyx_self, __pyx_v_blknos, __pyx_v_group); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_6pandas_3lib_18get_blkno_indexers_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + +/* "pandas/lib.pyx":1345 + * yield blkno, slice(slices[0][0], slices[0][1]) + * else: + * tot_len = sum(stop - start for start, stop in slices) # <<<<<<<<<<<<<< + * result = np.empty(tot_len, dtype=np.int64) + * res_view = result + */ + +static PyObject *__pyx_pf_6pandas_3lib_18get_blkno_indexers_genexpr(PyObject *__pyx_self) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_genexpr(__pyx_ptype_6pandas_3lib___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *) __pyx_self; + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6pandas_3lib_18get_blkno_indexers_2generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.get_blkno_indexers.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6pandas_3lib_18get_blkno_indexers_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L8_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices)) { __Pyx_RaiseClosureNameError("slices"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_start); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_start, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_stop); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_stop, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_4 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop, __pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L8_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return NULL; +} + +/* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + +static PyObject *__pyx_pf_6pandas_3lib_104get_blkno_indexers(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_blknos, int __pyx_v_group) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_blkno_indexers", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)__pyx_tp_new_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(__pyx_ptype_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_blknos = __pyx_v_blknos; + __pyx_cur_scope->__pyx_v_group = __pyx_v_group; + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6pandas_3lib_106generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.get_blkno_indexers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_blknos, 1); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6pandas_3lib_106generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *__pyx_cur_scope = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *(*__pyx_t_18)(PyObject *); + PyObject *(*__pyx_t_19)(PyObject *); + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L9_resume_from_yield; + case 2: goto __pyx_L10_resume_from_yield; + case 3: goto __pyx_L19_resume_from_yield; + case 4: goto __pyx_L26_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1304 + * int64_t[:] res_view + * + * n = blknos.shape[0] # <<<<<<<<<<<<<< + * + * if n > 0: + */ + __pyx_cur_scope->__pyx_v_n = (__pyx_cur_scope->__pyx_v_blknos.shape[0]); + + /* "pandas/lib.pyx":1306 + * n = blknos.shape[0] + * + * if n > 0: # <<<<<<<<<<<<<< + * start = 0 + * cur_blkno = blknos[start] + */ + __pyx_t_1 = ((__pyx_cur_scope->__pyx_v_n > 0) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1307 + * + * if n > 0: + * start = 0 # <<<<<<<<<<<<<< + * cur_blkno = blknos[start] + * + */ + __pyx_cur_scope->__pyx_v_start = 0; + + /* "pandas/lib.pyx":1308 + * if n > 0: + * start = 0 + * cur_blkno = blknos[start] # <<<<<<<<<<<<<< + * + * if group == False: + */ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_start; + __pyx_cur_scope->__pyx_v_cur_blkno = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_2 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))); + + /* "pandas/lib.pyx":1310 + * cur_blkno = blknos[start] + * + * if group == False: # <<<<<<<<<<<<<< + * for i in range(1, n): + * if blknos[i] != cur_blkno: + */ + __pyx_t_1 = ((__pyx_cur_scope->__pyx_v_group == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1311 + * + * if group == False: + * for i in range(1, n): # <<<<<<<<<<<<<< + * if blknos[i] != cur_blkno: + * yield cur_blkno, slice(start, i) + */ + __pyx_t_3 = __pyx_cur_scope->__pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_cur_scope->__pyx_v_i = __pyx_t_4; + + /* "pandas/lib.pyx":1312 + * if group == False: + * for i in range(1, n): + * if blknos[i] != cur_blkno: # <<<<<<<<<<<<<< + * yield cur_blkno, slice(start, i) + * + */ + __pyx_t_5 = __pyx_cur_scope->__pyx_v_i; + __pyx_t_1 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_5 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))) != __pyx_cur_scope->__pyx_v_cur_blkno) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1313 + * for i in range(1, n): + * if blknos[i] != cur_blkno: + * yield cur_blkno, slice(start, i) # <<<<<<<<<<<<<< + * + * start = i + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_6 = 0; + __pyx_t_8 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_3; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_4; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_5; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L9_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_4 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_3; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1315 + * yield cur_blkno, slice(start, i) + * + * start = i # <<<<<<<<<<<<<< + * cur_blkno = blknos[i] + * + */ + __pyx_cur_scope->__pyx_v_start = __pyx_cur_scope->__pyx_v_i; + + /* "pandas/lib.pyx":1316 + * + * start = i + * cur_blkno = blknos[i] # <<<<<<<<<<<<<< + * + * yield cur_blkno, slice(start, n) + */ + __pyx_t_10 = __pyx_cur_scope->__pyx_v_i; + __pyx_cur_scope->__pyx_v_cur_blkno = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_10 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))); + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "pandas/lib.pyx":1318 + * cur_blkno = blknos[i] + * + * yield cur_blkno, slice(start, n) # <<<<<<<<<<<<<< + * else: + * group_order = [] + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_8 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_9 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_10; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 2; + return __pyx_r; + __pyx_L10_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_10 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":1320 + * yield cur_blkno, slice(start, n) + * else: + * group_order = [] # <<<<<<<<<<<<<< + * group_dict = {} + * + */ + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_cur_scope->__pyx_v_group_order = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1321 + * else: + * group_order = [] + * group_dict = {} # <<<<<<<<<<<<<< + * + * for i in range(1, n): + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_cur_scope->__pyx_v_group_dict = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1323 + * group_dict = {} + * + * for i in range(1, n): # <<<<<<<<<<<<<< + * if blknos[i] != cur_blkno: + * if cur_blkno not in group_dict: + */ + __pyx_t_3 = __pyx_cur_scope->__pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_cur_scope->__pyx_v_i = __pyx_t_4; + + /* "pandas/lib.pyx":1324 + * + * for i in range(1, n): + * if blknos[i] != cur_blkno: # <<<<<<<<<<<<<< + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) + */ + __pyx_t_11 = __pyx_cur_scope->__pyx_v_i; + __pyx_t_1 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_11 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))) != __pyx_cur_scope->__pyx_v_cur_blkno) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1325 + * for i in range(1, n): + * if blknos[i] != cur_blkno: + * if cur_blkno not in group_dict: # <<<<<<<<<<<<<< + * group_order.append(cur_blkno) + * group_dict[cur_blkno] = [(start, i)] + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__Pyx_PyDict_Contains(__pyx_t_7, __pyx_cur_scope->__pyx_v_group_dict, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = (__pyx_t_1 != 0); + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1326 + * if blknos[i] != cur_blkno: + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) # <<<<<<<<<<<<<< + * group_dict[cur_blkno] = [(start, i)] + * else: + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_group_order, __pyx_t_7); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1327 + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) + * group_dict[cur_blkno] = [(start, i)] # <<<<<<<<<<<<<< + * else: + * group_dict[cur_blkno].append((start, i)) + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_t_9, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/lib.pyx":1329 + * group_dict[cur_blkno] = [(start, i)] + * else: + * group_dict[cur_blkno].append((start, i)) # <<<<<<<<<<<<<< + * + * start = i + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_t_6); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_9, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_L14:; + + /* "pandas/lib.pyx":1331 + * group_dict[cur_blkno].append((start, i)) + * + * start = i # <<<<<<<<<<<<<< + * cur_blkno = blknos[i] + * + */ + __pyx_cur_scope->__pyx_v_start = __pyx_cur_scope->__pyx_v_i; + + /* "pandas/lib.pyx":1332 + * + * start = i + * cur_blkno = blknos[i] # <<<<<<<<<<<<<< + * + * if cur_blkno not in group_dict: + */ + __pyx_t_14 = __pyx_cur_scope->__pyx_v_i; + __pyx_cur_scope->__pyx_v_cur_blkno = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_14 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))); + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/lib.pyx":1334 + * cur_blkno = blknos[i] + * + * if cur_blkno not in group_dict: # <<<<<<<<<<<<<< + * group_order.append(cur_blkno) + * group_dict[cur_blkno] = [(start, n)] + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = (__Pyx_PyDict_Contains(__pyx_t_8, __pyx_cur_scope->__pyx_v_group_dict, Py_NE)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = (__pyx_t_12 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1335 + * + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) # <<<<<<<<<<<<<< + * group_dict[cur_blkno] = [(start, n)] + * else: + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_group_order, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/lib.pyx":1336 + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) + * group_dict[cur_blkno] = [(start, n)] # <<<<<<<<<<<<<< + * else: + * group_dict[cur_blkno].append((start, n)) + */ + __pyx_t_8 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_t_7, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/lib.pyx":1338 + * group_dict[cur_blkno] = [(start, n)] + * else: + * group_dict[cur_blkno].append((start, n)) # <<<<<<<<<<<<<< + * + * for blkno in group_order: + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_t_9); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_6); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_L15:; + + /* "pandas/lib.pyx":1340 + * group_dict[cur_blkno].append((start, n)) + * + * for blkno in group_order: # <<<<<<<<<<<<<< + * slices = group_dict[blkno] + * if len(slices) == 1: + */ + __pyx_t_6 = __pyx_cur_scope->__pyx_v_group_order; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_blkno); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_blkno, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1341 + * + * for blkno in group_order: + * slices = group_dict[blkno] # <<<<<<<<<<<<<< + * if len(slices) == 1: + * yield blkno, slice(slices[0][0], slices[0][1]) + */ + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_cur_scope->__pyx_v_blkno); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_slices); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_slices, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1342 + * for blkno in group_order: + * slices = group_dict[blkno] + * if len(slices) == 1: # <<<<<<<<<<<<<< + * yield blkno, slice(slices[0][0], slices[0][1]) + * else: + */ + __pyx_t_7 = __pyx_cur_scope->__pyx_v_slices; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_4 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = ((__pyx_t_4 == 1) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1343 + * slices = group_dict[blkno] + * if len(slices) == 1: + * yield blkno, slice(slices[0][0], slices[0][1]) # <<<<<<<<<<<<<< + * else: + * tot_len = sum(stop - start for start, stop in slices) + */ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_slices, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_slices, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_blkno); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_blkno); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_blkno); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_3; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; + __Pyx_XGIVEREF(__pyx_t_6); + __pyx_cur_scope->__pyx_t_4 = __pyx_t_6; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; + __pyx_cur_scope->__pyx_t_6 = __pyx_t_14; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 3; + return __pyx_r; + __pyx_L19_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = 0; + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; + __pyx_t_14 = __pyx_cur_scope->__pyx_t_6; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/lib.pyx":1345 + * yield blkno, slice(slices[0][0], slices[0][1]) + * else: + * tot_len = sum(stop - start for start, stop in slices) # <<<<<<<<<<<<<< + * result = np.empty(tot_len, dtype=np.int64) + * res_view = result + */ + __pyx_t_7 = __pyx_pf_6pandas_3lib_18get_blkno_indexers_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tot_len); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tot_len, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1346 + * else: + * tot_len = sum(stop - start for start, stop in slices) + * result = np.empty(tot_len, dtype=np.int64) # <<<<<<<<<<<<<< + * res_view = result + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tot_len); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_tot_len); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tot_len); + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int64); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_result); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_result, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/lib.pyx":1347 + * tot_len = sum(stop - start for start, stop in slices) + * result = np.empty(tot_len, dtype=np.int64) + * res_view = result # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_cur_scope->__pyx_v_result); + if (unlikely(!__pyx_t_17.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_res_view, 1); + __pyx_cur_scope->__pyx_v_res_view = __pyx_t_17; + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; + + /* "pandas/lib.pyx":1349 + * res_view = result + * + * i = 0 # <<<<<<<<<<<<<< + * for start, stop in slices: + * for diff in range(start, stop): + */ + __pyx_cur_scope->__pyx_v_i = 0; + + /* "pandas/lib.pyx":1350 + * + * i = 0 + * for start, stop in slices: # <<<<<<<<<<<<<< + * for diff in range(start, stop): + * res_view[i] = diff + */ + if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_slices) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_slices)) { + __pyx_t_16 = __pyx_cur_scope->__pyx_v_slices; __Pyx_INCREF(__pyx_t_16); __pyx_t_4 = 0; + __pyx_t_18 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_slices); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = Py_TYPE(__pyx_t_16)->tp_iternext; + } + for (;;) { + if (!__pyx_t_18 && PyList_CheckExact(__pyx_t_16)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_16)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_18 && PyTuple_CheckExact(__pyx_t_16)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_16)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_18(__pyx_t_16); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { + PyObject* sequence = __pyx_t_8; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_7 = PyList_GET_ITEM(sequence, 0); + __pyx_t_9 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_9); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_15 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_19 = Py_TYPE(__pyx_t_15)->tp_iternext; + index = 0; __pyx_t_7 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_9 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_9)) goto __pyx_L22_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L23_unpacking_done; + __pyx_L22_unpacking_failed:; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L23_unpacking_done:; + } + __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_cur_scope->__pyx_v_start = __pyx_t_20; + __pyx_cur_scope->__pyx_v_stop = __pyx_t_21; + + /* "pandas/lib.pyx":1351 + * i = 0 + * for start, stop in slices: + * for diff in range(start, stop): # <<<<<<<<<<<<<< + * res_view[i] = diff + * i += 1 + */ + __pyx_t_21 = __pyx_cur_scope->__pyx_v_stop; + for (__pyx_t_20 = __pyx_cur_scope->__pyx_v_start; __pyx_t_20 < __pyx_t_21; __pyx_t_20+=1) { + __pyx_cur_scope->__pyx_v_diff = __pyx_t_20; + + /* "pandas/lib.pyx":1352 + * for start, stop in slices: + * for diff in range(start, stop): + * res_view[i] = diff # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_22 = __pyx_cur_scope->__pyx_v_i; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_res_view.data + __pyx_t_22 * __pyx_cur_scope->__pyx_v_res_view.strides[0]) )) = __pyx_cur_scope->__pyx_v_diff; + + /* "pandas/lib.pyx":1353 + * for diff in range(start, stop): + * res_view[i] = diff + * i += 1 # <<<<<<<<<<<<<< + * + * yield blkno, result + */ + __pyx_cur_scope->__pyx_v_i = (__pyx_cur_scope->__pyx_v_i + 1); + } + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/lib.pyx":1355 + * i += 1 + * + * yield blkno, result # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_blkno); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_cur_scope->__pyx_v_blkno); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_blkno); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_result); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_result); + __pyx_r = __pyx_t_16; + __pyx_t_16 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_3; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; + __Pyx_XGIVEREF(__pyx_t_6); + __pyx_cur_scope->__pyx_t_4 = __pyx_t_6; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; + __pyx_cur_scope->__pyx_t_6 = __pyx_t_14; + __pyx_cur_scope->__pyx_t_7 = __pyx_t_22; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 4; + return __pyx_r; + __pyx_L26_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = 0; + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; + __pyx_t_14 = __pyx_cur_scope->__pyx_t_6; + __pyx_t_22 = __pyx_cur_scope->__pyx_t_7; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L18:; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_L5:; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __Pyx_AddTraceback("get_blkno_indexers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return NULL; +} + +/* "pandas/lib.pyx":1360 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef slice indexer_as_slice(int64_t[:] vals): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, start, stop + */ + +static PyObject *__pyx_pw_6pandas_3lib_108indexer_as_slice(PyObject *__pyx_self, PyObject *__pyx_arg_vals); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_indexer_as_slice(__Pyx_memviewslice __pyx_v_vals, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __pyx_t_5numpy_int64_t __pyx_v_d; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("indexer_as_slice", 0); + + /* "pandas/lib.pyx":1365 + * int64_t d + * + * if vals is None: # <<<<<<<<<<<<<< + * raise TypeError("vals must be ndarray") + * + */ + __pyx_t_1 = ((((PyObject *) __pyx_v_vals.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1366 + * + * if vals is None: + * raise TypeError("vals must be ndarray") # <<<<<<<<<<<<<< + * + * n = vals.shape[0] + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1368 + * raise TypeError("vals must be ndarray") + * + * n = vals.shape[0] # <<<<<<<<<<<<<< + * + * if n == 0 or vals[0] < 0: + */ + __pyx_v_n = (__pyx_v_vals.shape[0]); + + /* "pandas/lib.pyx":1370 + * n = vals.shape[0] + * + * if n == 0 or vals[0] < 0: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_1) { + __pyx_t_3 = 0; + __pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_3 * __pyx_v_vals.strides[0]) ))) < 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/lib.pyx":1371 + * + * if n == 0 or vals[0] < 0: + * return None # <<<<<<<<<<<<<< + * + * if n == 1: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = ((PyObject*)Py_None); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1373 + * return None + * + * if n == 1: # <<<<<<<<<<<<<< + * return slice(vals[0], vals[0] + 1, 1) + * + */ + __pyx_t_5 = ((__pyx_v_n == 1) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":1374 + * + * if n == 1: + * return slice(vals[0], vals[0] + 1, 1) # <<<<<<<<<<<<<< + * + * if vals[1] < 0: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_6 * __pyx_v_vals.strides[0]) )))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_7 * __pyx_v_vals.strides[0]) ))) + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(PySlice_Check(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1376 + * return slice(vals[0], vals[0] + 1, 1) + * + * if vals[1] < 0: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_10 = 1; + __pyx_t_5 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_10 * __pyx_v_vals.strides[0]) ))) < 0) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":1377 + * + * if vals[1] < 0: + * return None # <<<<<<<<<<<<<< + * + * # n > 2 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = ((PyObject*)Py_None); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1380 + * + * # n > 2 + * d = vals[1] - vals[0] # <<<<<<<<<<<<<< + * + * if d == 0: + */ + __pyx_t_11 = 1; + __pyx_t_12 = 0; + __pyx_v_d = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_11 * __pyx_v_vals.strides[0]) ))) - (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_12 * __pyx_v_vals.strides[0]) )))); + + /* "pandas/lib.pyx":1382 + * d = vals[1] - vals[0] + * + * if d == 0: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_5 = ((__pyx_v_d == 0) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":1383 + * + * if d == 0: + * return None # <<<<<<<<<<<<<< + * + * for i in range(2, n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = ((PyObject*)Py_None); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1385 + * return None + * + * for i in range(2, n): # <<<<<<<<<<<<<< + * if vals[i] < 0 or vals[i] - vals[i-1] != d: + * return None + */ + __pyx_t_13 = __pyx_v_n; + for (__pyx_t_14 = 2; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/lib.pyx":1386 + * + * for i in range(2, n): + * if vals[i] < 0 or vals[i] - vals[i-1] != d: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_5 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_15 * __pyx_v_vals.strides[0]) ))) < 0) != 0); + if (!__pyx_t_5) { + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = (__pyx_v_i - 1); + __pyx_t_1 = ((((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_16 * __pyx_v_vals.strides[0]) ))) - (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_17 * __pyx_v_vals.strides[0]) )))) != __pyx_v_d) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1387 + * for i in range(2, n): + * if vals[i] < 0 or vals[i] - vals[i-1] != d: + * return None # <<<<<<<<<<<<<< + * + * start = vals[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = ((PyObject*)Py_None); + goto __pyx_L0; + } + } + + /* "pandas/lib.pyx":1389 + * return None + * + * start = vals[0] # <<<<<<<<<<<<<< + * stop = start + n * d + * if stop < 0 and d < 0: + */ + __pyx_t_13 = 0; + __pyx_v_start = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_13 * __pyx_v_vals.strides[0]) ))); + + /* "pandas/lib.pyx":1390 + * + * start = vals[0] + * stop = start + n * d # <<<<<<<<<<<<<< + * if stop < 0 and d < 0: + * return slice(start, None, d) + */ + __pyx_v_stop = (__pyx_v_start + (__pyx_v_n * __pyx_v_d)); + + /* "pandas/lib.pyx":1391 + * start = vals[0] + * stop = start + n * d + * if stop < 0 and d < 0: # <<<<<<<<<<<<<< + * return slice(start, None, d) + * else: + */ + __pyx_t_4 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_4) { + __pyx_t_5 = ((__pyx_v_d < 0) != 0); + __pyx_t_1 = __pyx_t_5; + } else { + __pyx_t_1 = __pyx_t_4; + } + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1392 + * stop = start + n * d + * if stop < 0 and d < 0: + * return slice(start, None, d) # <<<<<<<<<<<<<< + * else: + * return slice(start, stop, d) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_d); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PySlice_Check(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1394 + * return slice(start, None, d) + * else: + * return slice(start, stop, d) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_d); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_9 = 0; + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (!(likely(PySlice_Check(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1360 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef slice indexer_as_slice(int64_t[:] vals): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, start, stop + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_AddTraceback("pandas.lib.indexer_as_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_108indexer_as_slice(PyObject *__pyx_self, PyObject *__pyx_arg_vals); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_108indexer_as_slice(PyObject *__pyx_self, PyObject *__pyx_arg_vals) { + __Pyx_memviewslice __pyx_v_vals = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("indexer_as_slice (wrapper)", 0); + assert(__pyx_arg_vals); { + __pyx_v_vals = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_arg_vals); if (unlikely(!__pyx_v_vals.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.indexer_as_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_107indexer_as_slice(__pyx_self, __pyx_v_vals); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_107indexer_as_slice(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_vals) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("indexer_as_slice", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_vals.memview)) { __Pyx_RaiseUnboundLocalError("vals"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __pyx_f_6pandas_3lib_indexer_as_slice(__pyx_v_vals, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.indexer_as_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_vals, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1397 + * + * + * cpdef slice_canonize(slice s): # <<<<<<<<<<<<<< + * """ + * Convert slice to canonical bounded form. + */ + +static PyObject *__pyx_pw_6pandas_3lib_110slice_canonize(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_slice_canonize(PyObject *__pyx_v_s, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_canonize", 0); + + /* "pandas/lib.pyx":1404 + * Py_ssize_t start, stop, step, length + * + * if s.step is None: # <<<<<<<<<<<<<< + * step = 1 + * else: + */ + __pyx_t_1 = (((PySliceObject*)__pyx_v_s)->step == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1405 + * + * if s.step is None: + * step = 1 # <<<<<<<<<<<<<< + * else: + * step = s.step + */ + __pyx_v_step = 1; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1407 + * step = 1 + * else: + * step = s.step # <<<<<<<<<<<<<< + * if step == 0: + * raise ValueError("slice step cannot be zero") + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->step); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_step = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1408 + * else: + * step = s.step + * if step == 0: # <<<<<<<<<<<<<< + * raise ValueError("slice step cannot be zero") + * + */ + __pyx_t_2 = ((__pyx_v_step == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1409 + * step = s.step + * if step == 0: + * raise ValueError("slice step cannot be zero") # <<<<<<<<<<<<<< + * + * if step > 0: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L3:; + + /* "pandas/lib.pyx":1411 + * raise ValueError("slice step cannot be zero") + * + * if step > 0: # <<<<<<<<<<<<<< + * if s.stop is None: + * raise ValueError("unbounded slice") + */ + __pyx_t_2 = ((__pyx_v_step > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1412 + * + * if step > 0: + * if s.stop is None: # <<<<<<<<<<<<<< + * raise ValueError("unbounded slice") + * + */ + __pyx_t_2 = (((PySliceObject*)__pyx_v_s)->stop == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1413 + * if step > 0: + * if s.stop is None: + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * stop = s.stop + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1415 + * raise ValueError("unbounded slice") + * + * stop = s.stop # <<<<<<<<<<<<<< + * if s.start is None: + * start = 0 + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->stop); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_stop = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1416 + * + * stop = s.stop + * if s.start is None: # <<<<<<<<<<<<<< + * start = 0 + * else: + */ + __pyx_t_1 = (((PySliceObject*)__pyx_v_s)->start == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1417 + * stop = s.stop + * if s.start is None: + * start = 0 # <<<<<<<<<<<<<< + * else: + * start = s.start + */ + __pyx_v_start = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/lib.pyx":1419 + * start = 0 + * else: + * start = s.start # <<<<<<<<<<<<<< + * if start > stop: + * start = stop + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->start); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_start = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1420 + * else: + * start = s.start + * if start > stop: # <<<<<<<<<<<<<< + * start = stop + * elif step < 0: + */ + __pyx_t_2 = ((__pyx_v_start > __pyx_v_stop) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1421 + * start = s.start + * if start > stop: + * start = stop # <<<<<<<<<<<<<< + * elif step < 0: + * if s.start is None: + */ + __pyx_v_start = __pyx_v_stop; + goto __pyx_L8; + } + __pyx_L8:; + } + __pyx_L7:; + goto __pyx_L5; + } + + /* "pandas/lib.pyx":1422 + * if start > stop: + * start = stop + * elif step < 0: # <<<<<<<<<<<<<< + * if s.start is None: + * raise ValueError("unbounded slice") + */ + __pyx_t_2 = ((__pyx_v_step < 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1423 + * start = stop + * elif step < 0: + * if s.start is None: # <<<<<<<<<<<<<< + * raise ValueError("unbounded slice") + * + */ + __pyx_t_2 = (((PySliceObject*)__pyx_v_s)->start == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1424 + * elif step < 0: + * if s.start is None: + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * start = s.start + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1426 + * raise ValueError("unbounded slice") + * + * start = s.start # <<<<<<<<<<<<<< + * if s.stop is None: + * stop = -1 + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->start); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_start = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1427 + * + * start = s.start + * if s.stop is None: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + __pyx_t_1 = (((PySliceObject*)__pyx_v_s)->stop == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1428 + * start = s.start + * if s.stop is None: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = s.stop + */ + __pyx_v_stop = -1; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/lib.pyx":1430 + * stop = -1 + * else: + * stop = s.stop # <<<<<<<<<<<<<< + * if stop > start: + * stop = start + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->stop); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_stop = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1431 + * else: + * stop = s.stop + * if stop > start: # <<<<<<<<<<<<<< + * stop = start + * + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_start) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1432 + * stop = s.stop + * if stop > start: + * stop = start # <<<<<<<<<<<<<< + * + * if start < 0 or (stop < 0 and s.stop is not None): + */ + __pyx_v_stop = __pyx_v_start; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/lib.pyx":1434 + * stop = start + * + * if start < 0 or (stop < 0 and s.stop is not None): # <<<<<<<<<<<<<< + * raise ValueError("unbounded slice") + * + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (!__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_1) { + __pyx_t_5 = (((PySliceObject*)__pyx_v_s)->stop != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + } else { + __pyx_t_6 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_6; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1435 + * + * if start < 0 or (stop < 0 and s.stop is not None): + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * if stop < 0: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1437 + * raise ValueError("unbounded slice") + * + * if stop < 0: # <<<<<<<<<<<<<< + * return slice(start, None, step) + * else: + */ + __pyx_t_1 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1438 + * + * if stop < 0: + * return slice(start, None, step) # <<<<<<<<<<<<<< + * else: + * return slice(start, stop, step) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 1, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1440 + * return slice(start, None, step) + * else: + * return slice(start, stop, step) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1397 + * + * + * cpdef slice_canonize(slice s): # <<<<<<<<<<<<<< + * """ + * Convert slice to canonical bounded form. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.lib.slice_canonize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_110slice_canonize(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static char __pyx_doc_6pandas_3lib_109slice_canonize[] = "\n Convert slice to canonical bounded form.\n "; +static PyObject *__pyx_pw_6pandas_3lib_110slice_canonize(PyObject *__pyx_self, PyObject *__pyx_v_s) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("slice_canonize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PySlice_Type), 1, "s", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_109slice_canonize(__pyx_self, ((PyObject*)__pyx_v_s)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_109slice_canonize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_canonize", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_canonize(__pyx_v_s, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.slice_canonize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1443 + * + * + * cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX): # <<<<<<<<<<<<<< + * """ + * Get (start, stop, step, length) tuple for a slice. + */ + +static PyObject *__pyx_pw_6pandas_3lib_112slice_get_indices_ex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_slice_get_indices_ex(PyObject *__pyx_v_slc, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex *__pyx_optional_args) { + Py_ssize_t __pyx_v_objlen = __pyx_k__17; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_get_indices_ex", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_objlen = __pyx_optional_args->objlen; + } + } + + /* "pandas/lib.pyx":1454 + * Py_ssize_t start, stop, step, length + * + * if slc is None: # <<<<<<<<<<<<<< + * raise TypeError("slc should be a slice") + * + */ + __pyx_t_1 = (__pyx_v_slc == ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1455 + * + * if slc is None: + * raise TypeError("slc should be a slice") # <<<<<<<<<<<<<< + * + * PySlice_GetIndicesEx(slc, objlen, + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1457 + * raise TypeError("slc should be a slice") + * + * PySlice_GetIndicesEx(slc, objlen, # <<<<<<<<<<<<<< + * &start, &stop, &step, &length) + * return start, stop, step, length + */ + __pyx_t_4 = PySlice_GetIndicesEx(((PySliceObject *)__pyx_v_slc), __pyx_v_objlen, (&__pyx_v_start), (&__pyx_v_stop), (&__pyx_v_step), (&__pyx_v_length)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1459 + * PySlice_GetIndicesEx(slc, objlen, + * &start, &stop, &step, &length) + * return start, stop, step, length # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1443 + * + * + * cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX): # <<<<<<<<<<<<<< + * """ + * Get (start, stop, step, length) tuple for a slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.lib.slice_get_indices_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_112slice_get_indices_ex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_111slice_get_indices_ex[] = "\n Get (start, stop, step, length) tuple for a slice.\n\n If `objlen` is not specified, slice must be bounded, otherwise the result\n will be wrong.\n\n "; +static PyObject *__pyx_pw_6pandas_3lib_112slice_get_indices_ex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_slc = 0; + Py_ssize_t __pyx_v_objlen; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("slice_get_indices_ex (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_slc,&__pyx_n_s_objlen,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_objlen); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice_get_indices_ex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_slc = ((PyObject*)values[0]); + if (values[1]) { + __pyx_v_objlen = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_objlen == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_objlen = __pyx_k__17; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("slice_get_indices_ex", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.slice_get_indices_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slc), (&PySlice_Type), 1, "slc", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_111slice_get_indices_ex(__pyx_self, __pyx_v_slc, __pyx_v_objlen); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_111slice_get_indices_ex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, Py_ssize_t __pyx_v_objlen) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_get_indices_ex", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.objlen = __pyx_v_objlen; + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(__pyx_v_slc, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.slice_get_indices_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1462 + * + * + * cpdef Py_ssize_t slice_len(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX) except -1: # <<<<<<<<<<<<<< + * """ + * Get length of a bounded slice. + */ + +static PyObject *__pyx_pw_6pandas_3lib_114slice_len(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static Py_ssize_t __pyx_f_6pandas_3lib_slice_len(PyObject *__pyx_v_slc, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_slice_len *__pyx_optional_args) { + Py_ssize_t __pyx_v_objlen = __pyx_k__19; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_len", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_objlen = __pyx_optional_args->objlen; + } + } + + /* "pandas/lib.pyx":1477 + * Py_ssize_t start, stop, step, length + * + * if slc is None: # <<<<<<<<<<<<<< + * raise TypeError("slc must be slice") + * + */ + __pyx_t_1 = (__pyx_v_slc == ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1478 + * + * if slc is None: + * raise TypeError("slc must be slice") # <<<<<<<<<<<<<< + * + * PySlice_GetIndicesEx(slc, objlen, + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1480 + * raise TypeError("slc must be slice") + * + * PySlice_GetIndicesEx(slc, objlen, # <<<<<<<<<<<<<< + * &start, &stop, &step, &length) + * + */ + __pyx_t_4 = PySlice_GetIndicesEx(((PySliceObject *)__pyx_v_slc), __pyx_v_objlen, (&__pyx_v_start), (&__pyx_v_stop), (&__pyx_v_step), (&__pyx_v_length)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1483 + * &start, &stop, &step, &length) + * + * return length # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_length; + goto __pyx_L0; + + /* "pandas/lib.pyx":1462 + * + * + * cpdef Py_ssize_t slice_len(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX) except -1: # <<<<<<<<<<<<<< + * """ + * Get length of a bounded slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.slice_len", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_114slice_len(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_113slice_len[] = "\n Get length of a bounded slice.\n\n The slice must not have any \"open\" bounds that would create dependency on\n container size, i.e.:\n - if ``s.step is None or s.step > 0``, ``s.stop`` is not ``None``\n - if ``s.step < 0``, ``s.start`` is not ``None``\n\n Otherwise, the result is unreliable.\n\n "; +static PyObject *__pyx_pw_6pandas_3lib_114slice_len(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_slc = 0; + Py_ssize_t __pyx_v_objlen; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("slice_len (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_slc,&__pyx_n_s_objlen,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_objlen); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice_len") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_slc = ((PyObject*)values[0]); + if (values[1]) { + __pyx_v_objlen = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_objlen == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_objlen = __pyx_k__19; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("slice_len", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.slice_len", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slc), (&PySlice_Type), 1, "slc", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_113slice_len(__pyx_self, __pyx_v_slc, __pyx_v_objlen); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_113slice_len(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, Py_ssize_t __pyx_v_objlen) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + struct __pyx_opt_args_6pandas_3lib_slice_len __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_len", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.objlen = __pyx_v_objlen; + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_len(__pyx_v_slc, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.slice_len", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1486 + * + * + * def slice_getitem(slice slc not None, ind): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s_start, s_stop, s_step, s_len + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_116slice_getitem(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_116slice_getitem = {__Pyx_NAMESTR("slice_getitem"), (PyCFunction)__pyx_pw_6pandas_3lib_116slice_getitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_116slice_getitem(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_slc = 0; + PyObject *__pyx_v_ind = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("slice_getitem (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_slc,&__pyx_n_s_ind,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("slice_getitem", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice_getitem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_slc = ((PyObject*)values[0]); + __pyx_v_ind = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("slice_getitem", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.slice_getitem", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slc), (&PySlice_Type), 0, "slc", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_115slice_getitem(__pyx_self, __pyx_v_slc, __pyx_v_ind); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_115slice_getitem(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, PyObject *__pyx_v_ind) { + Py_ssize_t __pyx_v_s_start; + Py_ssize_t __pyx_v_s_stop; + Py_ssize_t __pyx_v_s_step; + Py_ssize_t __pyx_v_s_len; + Py_ssize_t __pyx_v_ind_start; + Py_ssize_t __pyx_v_ind_stop; + Py_ssize_t __pyx_v_ind_step; + Py_ssize_t __pyx_v_ind_len; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex __pyx_t_14; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_getitem", 0); + + /* "pandas/lib.pyx":1491 + * Py_ssize_t ind_start, ind_stop, ind_step, ind_len + * + * s_start, s_stop, s_step, s_len = slice_get_indices_ex(slc) # <<<<<<<<<<<<<< + * + * if isinstance(ind, slice): + */ + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(__pyx_v_slc, 0, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_5 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_s_start = __pyx_t_8; + __pyx_v_s_stop = __pyx_t_9; + __pyx_v_s_step = __pyx_t_10; + __pyx_v_s_len = __pyx_t_11; + + /* "pandas/lib.pyx":1493 + * s_start, s_stop, s_step, s_len = slice_get_indices_ex(slc) + * + * if isinstance(ind, slice): # <<<<<<<<<<<<<< + * ind_start, ind_stop, ind_step, ind_len = slice_get_indices_ex(ind, + * s_len) + */ + __pyx_t_12 = PySlice_Check(__pyx_v_ind); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":1494 + * + * if isinstance(ind, slice): + * ind_start, ind_stop, ind_step, ind_len = slice_get_indices_ex(ind, # <<<<<<<<<<<<<< + * s_len) + * + */ + if (!(likely(PySlice_Check(__pyx_v_ind))||((__pyx_v_ind) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_v_ind)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1495 + * if isinstance(ind, slice): + * ind_start, ind_stop, ind_step, ind_len = slice_get_indices_ex(ind, + * s_len) # <<<<<<<<<<<<<< + * + * if ind_step > 0 and ind_len == s_len: + */ + __pyx_t_14.__pyx_n = 1; + __pyx_t_14.objlen = __pyx_v_s_len; + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(((PyObject*)__pyx_v_ind), 0, &__pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_2}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_2}; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + + /* "pandas/lib.pyx":1494 + * + * if isinstance(ind, slice): + * ind_start, ind_stop, ind_step, ind_len = slice_get_indices_ex(ind, # <<<<<<<<<<<<<< + * s_len) + * + */ + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ind_start = __pyx_t_11; + __pyx_v_ind_stop = __pyx_t_10; + __pyx_v_ind_step = __pyx_t_9; + __pyx_v_ind_len = __pyx_t_8; + + /* "pandas/lib.pyx":1497 + * s_len) + * + * if ind_step > 0 and ind_len == s_len: # <<<<<<<<<<<<<< + * # short-cut for no-op slice + * if ind_len == s_len: + */ + __pyx_t_13 = ((__pyx_v_ind_step > 0) != 0); + if (__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_ind_len == __pyx_v_s_len) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_13; + } + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1499 + * if ind_step > 0 and ind_len == s_len: + * # short-cut for no-op slice + * if ind_len == s_len: # <<<<<<<<<<<<<< + * return slc + * + */ + __pyx_t_15 = ((__pyx_v_ind_len == __pyx_v_s_len) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1500 + * # short-cut for no-op slice + * if ind_len == s_len: + * return slc # <<<<<<<<<<<<<< + * + * if ind_step < 0: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_slc); + __pyx_r = __pyx_v_slc; + goto __pyx_L0; + } + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/lib.pyx":1502 + * return slc + * + * if ind_step < 0: # <<<<<<<<<<<<<< + * s_start = s_stop - s_step + * ind_step = -ind_step + */ + __pyx_t_15 = ((__pyx_v_ind_step < 0) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1503 + * + * if ind_step < 0: + * s_start = s_stop - s_step # <<<<<<<<<<<<<< + * ind_step = -ind_step + * + */ + __pyx_v_s_start = (__pyx_v_s_stop - __pyx_v_s_step); + + /* "pandas/lib.pyx":1504 + * if ind_step < 0: + * s_start = s_stop - s_step + * ind_step = -ind_step # <<<<<<<<<<<<<< + * + * s_step *= ind_step + */ + __pyx_v_ind_step = (-__pyx_v_ind_step); + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/lib.pyx":1506 + * ind_step = -ind_step + * + * s_step *= ind_step # <<<<<<<<<<<<<< + * s_stop = s_start + ind_stop * s_step + * s_start = s_start + ind_start * s_step + */ + __pyx_v_s_step = (__pyx_v_s_step * __pyx_v_ind_step); + + /* "pandas/lib.pyx":1507 + * + * s_step *= ind_step + * s_stop = s_start + ind_stop * s_step # <<<<<<<<<<<<<< + * s_start = s_start + ind_start * s_step + * + */ + __pyx_v_s_stop = (__pyx_v_s_start + (__pyx_v_ind_stop * __pyx_v_s_step)); + + /* "pandas/lib.pyx":1508 + * s_step *= ind_step + * s_stop = s_start + ind_stop * s_step + * s_start = s_start + ind_start * s_step # <<<<<<<<<<<<<< + * + * if s_step < 0 and s_stop < 0: + */ + __pyx_v_s_start = (__pyx_v_s_start + (__pyx_v_ind_start * __pyx_v_s_step)); + + /* "pandas/lib.pyx":1510 + * s_start = s_start + ind_start * s_step + * + * if s_step < 0 and s_stop < 0: # <<<<<<<<<<<<<< + * return slice(s_start, None, s_step) + * else: + */ + __pyx_t_15 = ((__pyx_v_s_step < 0) != 0); + if (__pyx_t_15) { + __pyx_t_13 = ((__pyx_v_s_stop < 0) != 0); + __pyx_t_12 = __pyx_t_13; + } else { + __pyx_t_12 = __pyx_t_15; + } + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1511 + * + * if s_step < 0 and s_stop < 0: + * return slice(s_start, None, s_step) # <<<<<<<<<<<<<< + * else: + * return slice(s_start, s_stop, s_step) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_s_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s_step); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1513 + * return slice(s_start, None, s_step) + * else: + * return slice(s_start, s_stop, s_step) # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_s_stop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_s_step); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/lib.pyx":1516 + * + * else: + * return np.arange(s_start, s_stop, s_step, dtype=np.int64)[ind] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_s_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_s_stop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s_step); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ind); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1486 + * + * + * def slice_getitem(slice slc not None, ind): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s_start, s_stop, s_step, s_len + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.slice_getitem", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1526 + * cdef bint _has_slice, _has_array, _is_known_slice_like + * + * def __init__(self, val): # <<<<<<<<<<<<<< + * cdef slice slc + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_14BlockPlacement_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_14BlockPlacement_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_val = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_val = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement___init__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_14BlockPlacement___init__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_v_slc = 0; + PyObject *__pyx_v_arr = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/lib.pyx":1529 + * cdef slice slc + * + * self._has_slice = False # <<<<<<<<<<<<<< + * self._has_array = False + * + */ + __pyx_v_self->_has_slice = 0; + + /* "pandas/lib.pyx":1530 + * + * self._has_slice = False + * self._has_array = False # <<<<<<<<<<<<<< + * + * if isinstance(val, slice): + */ + __pyx_v_self->_has_array = 0; + + /* "pandas/lib.pyx":1532 + * self._has_array = False + * + * if isinstance(val, slice): # <<<<<<<<<<<<<< + * slc = slice_canonize(val) + * + */ + __pyx_t_1 = PySlice_Check(__pyx_v_val); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1533 + * + * if isinstance(val, slice): + * slc = slice_canonize(val) # <<<<<<<<<<<<<< + * + * if slc.start != slc.stop: + */ + if (!(likely(PySlice_Check(__pyx_v_val))||((__pyx_v_val) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_v_val)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_6pandas_3lib_slice_canonize(((PyObject*)__pyx_v_val), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PySlice_Check(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_slc = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":1535 + * slc = slice_canonize(val) + * + * if slc.start != slc.stop: # <<<<<<<<<<<<<< + * self._as_slice = slc + * self._has_slice = True + */ + __pyx_t_3 = PyObject_RichCompare(((PySliceObject*)__pyx_v_slc)->start, ((PySliceObject*)__pyx_v_slc)->stop, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1536 + * + * if slc.start != slc.stop: + * self._as_slice = slc # <<<<<<<<<<<<<< + * self._has_slice = True + * else: + */ + __Pyx_INCREF(__pyx_v_slc); + __Pyx_GIVEREF(__pyx_v_slc); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = __pyx_v_slc; + + /* "pandas/lib.pyx":1537 + * if slc.start != slc.stop: + * self._as_slice = slc + * self._has_slice = True # <<<<<<<<<<<<<< + * else: + * arr = np.empty(0, dtype=np.int64) + */ + __pyx_v_self->_has_slice = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/lib.pyx":1539 + * self._has_slice = True + * else: + * arr = np.empty(0, dtype=np.int64) # <<<<<<<<<<<<<< + * self._as_array = arr + * self._has_array = True + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__21, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1540 + * else: + * arr = np.empty(0, dtype=np.int64) + * self._as_array = arr # <<<<<<<<<<<<<< + * self._has_array = True + * else: + */ + __Pyx_INCREF(__pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = __pyx_v_arr; + + /* "pandas/lib.pyx":1541 + * arr = np.empty(0, dtype=np.int64) + * self._as_array = arr + * self._has_array = True # <<<<<<<<<<<<<< + * else: + * # Cython memoryview interface requires ndarray to be writeable. + */ + __pyx_v_self->_has_array = 1; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1544 + * else: + * # Cython memoryview interface requires ndarray to be writeable. + * arr = np.require(val, dtype=np.int64, requirements='W') # <<<<<<<<<<<<<< + * assert arr.ndim == 1 + * self._as_array = arr + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_require); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_requirements, __pyx_n_s_W) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_arr = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1545 + * # Cython memoryview interface requires ndarray to be writeable. + * arr = np.require(val, dtype=np.int64, requirements='W') + * assert arr.ndim == 1 # <<<<<<<<<<<<<< + * self._as_array = arr + * self._has_array = True + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/lib.pyx":1546 + * arr = np.require(val, dtype=np.int64, requirements='W') + * assert arr.ndim == 1 + * self._as_array = arr # <<<<<<<<<<<<<< + * self._has_array = True + * + */ + __Pyx_INCREF(__pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = __pyx_v_arr; + + /* "pandas/lib.pyx":1547 + * assert arr.ndim == 1 + * self._as_array = arr + * self._has_array = True # <<<<<<<<<<<<<< + * + * def __unicode__(self): + */ + __pyx_v_self->_has_array = 1; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1526 + * cdef bint _has_slice, _has_array, _is_known_slice_like + * + * def __init__(self, val): # <<<<<<<<<<<<<< + * cdef slice slc + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_slc); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1549 + * self._has_array = True + * + * def __unicode__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_3__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_3__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_2__unicode__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_2__unicode__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__unicode__", 0); + + /* "pandas/lib.pyx":1550 + * + * def __unicode__(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * v = self._as_slice + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1551 + * def __unicode__(self): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * v = self._as_slice + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1552 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * v = self._as_slice # <<<<<<<<<<<<<< + * else: + * v = self._as_array + */ + __pyx_t_1 = __pyx_v_self->_as_slice; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_v = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1554 + * v = self._as_slice + * else: + * v = self._as_array # <<<<<<<<<<<<<< + * + * return '%s(%r)' % (self.__class__.__name__, v) + */ + __pyx_t_1 = __pyx_v_self->_as_array; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_v = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1556 + * v = self._as_array + * + * return '%s(%r)' % (self.__class__.__name__, v) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1549 + * self._has_array = True + * + * def __unicode__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1558 + * return '%s(%r)' % (self.__class__.__name__, v) + * + * def __len__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_3lib_14BlockPlacement_5__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_3lib_14BlockPlacement_5__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_4__len__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_3lib_14BlockPlacement_4__len__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/lib.pyx":1559 + * + * def __len__(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * return slice_len(s) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1560 + * def __len__(self): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * return slice_len(s) + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1561 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * return slice_len(s) # <<<<<<<<<<<<<< + * else: + * return len(self._as_array) + */ + __pyx_t_4 = __pyx_f_6pandas_3lib_slice_len(__pyx_v_s, 0, NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_4; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1563 + * return slice_len(s) + * else: + * return len(self._as_array) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_1 = __pyx_v_self->_as_array; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1558 + * return '%s(%r)' % (self.__class__.__name__, v) + * + * def __len__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1565 + * return len(self._as_array) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t start, stop, step, _ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_7__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_7__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_6__iter__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_6__iter__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + CYTHON_UNUSED Py_ssize_t __pyx_v__; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "pandas/lib.pyx":1566 + * + * def __iter__(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step, _ + * if s is not None: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1568 + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t start, stop, step, _ + * if s is not None: # <<<<<<<<<<<<<< + * start, stop, step, _ = slice_get_indices_ex(s) + * return iter(range(start, stop, step)) + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1569 + * cdef Py_ssize_t start, stop, step, _ + * if s is not None: + * start, stop, step, _ = slice_get_indices_ex(s) # <<<<<<<<<<<<<< + * return iter(range(start, stop, step)) + * else: + */ + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(__pyx_v_s, 0, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = PyList_GET_ITEM(sequence, 2); + __pyx_t_7 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; + __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_start = __pyx_t_10; + __pyx_v_stop = __pyx_t_11; + __pyx_v_step = __pyx_t_12; + __pyx_v__ = __pyx_t_13; + + /* "pandas/lib.pyx":1570 + * if s is not None: + * start, stop, step, _ = slice_get_indices_ex(s) + * return iter(range(start, stop, step)) # <<<<<<<<<<<<<< + * else: + * return iter(self._as_array) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1572 + * return iter(range(start, stop, step)) + * else: + * return iter(self._as_array) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __pyx_v_self->_as_array; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1565 + * return len(self._as_array) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t start, stop, step, _ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1575 + * + * @property + * def as_slice(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_9as_slice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_9as_slice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("as_slice (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_8as_slice(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_8as_slice(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("as_slice", 0); + + /* "pandas/lib.pyx":1576 + * @property + * def as_slice(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is None: + * raise TypeError('Not slice-like') + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1577 + * def as_slice(self): + * cdef slice s = self._ensure_has_slice() + * if s is None: # <<<<<<<<<<<<<< + * raise TypeError('Not slice-like') + * else: + */ + __pyx_t_2 = (__pyx_v_s == ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1578 + * cdef slice s = self._ensure_has_slice() + * if s is None: + * raise TypeError('Not slice-like') # <<<<<<<<<<<<<< + * else: + * return s + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/lib.pyx":1580 + * raise TypeError('Not slice-like') + * else: + * return s # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1575 + * + * @property + * def as_slice(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.as_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1583 + * + * @property + * def indexer(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_11indexer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_11indexer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("indexer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_10indexer(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_10indexer(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("indexer", 0); + + /* "pandas/lib.pyx":1584 + * @property + * def indexer(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * return s + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1585 + * def indexer(self): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * return s + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1586 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * return s # <<<<<<<<<<<<<< + * else: + * return self._as_array + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1588 + * return s + * else: + * return self._as_array # <<<<<<<<<<<<<< + * + * def isin(self, arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_as_array); + __pyx_r = __pyx_v_self->_as_array; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1583 + * + * @property + * def indexer(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1590 + * return self._as_array + * + * def isin(self, arr): # <<<<<<<<<<<<<< + * from pandas.core.index import Int64Index + * return Int64Index(self.as_array, copy=False).isin(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_13isin(PyObject *__pyx_v_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_13isin(PyObject *__pyx_v_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isin (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_12isin(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_12isin(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_v_Int64Index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isin", 0); + + /* "pandas/lib.pyx":1591 + * + * def isin(self, arr): + * from pandas.core.index import Int64Index # <<<<<<<<<<<<<< + * return Int64Index(self.as_array, copy=False).isin(arr) + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Int64Index); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Int64Index); + __Pyx_GIVEREF(__pyx_n_s_Int64Index); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas_core_index, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Int64Index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_Int64Index = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1592 + * def isin(self, arr): + * from pandas.core.index import Int64Index + * return Int64Index(self.as_array, copy=False).isin(arr) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_Int64Index, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1590 + * return self._as_array + * + * def isin(self, arr): # <<<<<<<<<<<<<< + * from pandas.core.index import Int64Index + * return Int64Index(self.as_array, copy=False).isin(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.isin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Int64Index); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1595 + * + * @property + * def as_array(self): # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_15as_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_15as_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("as_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_14as_array(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_14as_array(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + CYTHON_UNUSED Py_ssize_t __pyx_v__; + PyObject *__pyx_v_step = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("as_array", 0); + + /* "pandas/lib.pyx":1597 + * def as_array(self): + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: # <<<<<<<<<<<<<< + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) + * self._as_array = np.arange(start, stop, step, + */ + __pyx_t_1 = ((!(__pyx_v_self->_has_array != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1598 + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) # <<<<<<<<<<<<<< + * self._as_array = np.arange(start, stop, step, + * dtype=np.int64) + */ + __pyx_t_2 = __pyx_v_self->_as_slice; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_f_6pandas_3lib_slice_get_indices_ex(((PyObject*)__pyx_t_2), 0, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = PyList_GET_ITEM(sequence, 2); + __pyx_t_6 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_start = __pyx_t_9; + __pyx_v_stop = __pyx_t_10; + __pyx_v_step = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v__ = __pyx_t_11; + + /* "pandas/lib.pyx":1599 + * if not self._has_array: + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) + * self._as_array = np.arange(start, stop, step, # <<<<<<<<<<<<<< + * dtype=np.int64) + * self._has_array = True + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_step); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_step); + __Pyx_GIVEREF(__pyx_v_step); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/lib.pyx":1600 + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) + * self._as_array = np.arange(start, stop, step, + * dtype=np.int64) # <<<<<<<<<<<<<< + * self._has_array = True + * return self._as_array + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1599 + * if not self._has_array: + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) + * self._as_array = np.arange(start, stop, step, # <<<<<<<<<<<<<< + * dtype=np.int64) + * self._has_array = True + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1601 + * self._as_array = np.arange(start, stop, step, + * dtype=np.int64) + * self._has_array = True # <<<<<<<<<<<<<< + * return self._as_array + * + */ + __pyx_v_self->_has_array = 1; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1602 + * dtype=np.int64) + * self._has_array = True + * return self._as_array # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_as_array); + __pyx_r = __pyx_v_self->_as_array; + goto __pyx_L0; + + /* "pandas/lib.pyx":1595 + * + * @property + * def as_array(self): # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.as_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_step); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1605 + * + * @property + * def is_slice_like(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * return s is not None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_17is_slice_like(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_17is_slice_like(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_slice_like (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_16is_slice_like(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_16is_slice_like(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice_like", 0); + + /* "pandas/lib.pyx":1606 + * @property + * def is_slice_like(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * return s is not None + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1607 + * def is_slice_like(self): + * cdef slice s = self._ensure_has_slice() + * return s is not None # <<<<<<<<<<<<<< + * + * def __getitem__(self, loc): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1605 + * + * @property + * def is_slice_like(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * return s is not None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.is_slice_like", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1609 + * return s is not None + * + * def __getitem__(self, loc): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_19__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_19__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_18__getitem__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_18__getitem__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_loc) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "pandas/lib.pyx":1610 + * + * def __getitem__(self, loc): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * val = slice_getitem(s, loc) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1611 + * def __getitem__(self, loc): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * val = slice_getitem(s, loc) + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1612 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * val = slice_getitem(s, loc) # <<<<<<<<<<<<<< + * else: + * val = self._as_array[loc] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_slice_getitem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __Pyx_INCREF(__pyx_v_loc); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_loc); + __Pyx_GIVEREF(__pyx_v_loc); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_val = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1614 + * val = slice_getitem(s, loc) + * else: + * val = self._as_array[loc] # <<<<<<<<<<<<<< + * + * if not isinstance(val, slice) and val.ndim == 0: + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_self->_as_array, __pyx_v_loc); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_val = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1616 + * val = self._as_array[loc] + * + * if not isinstance(val, slice) and val.ndim == 0: # <<<<<<<<<<<<<< + * return val + * + */ + __pyx_t_3 = PySlice_Check(__pyx_v_val); + __pyx_t_2 = (!(__pyx_t_3 != 0)); + if (__pyx_t_2) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __pyx_t_3; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":1617 + * + * if not isinstance(val, slice) and val.ndim == 0: + * return val # <<<<<<<<<<<<<< + * + * return BlockPlacement(val) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_val); + __pyx_r = __pyx_v_val; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1619 + * return val + * + * return BlockPlacement(val) # <<<<<<<<<<<<<< + * + * def delete(self, loc): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1609 + * return s is not None + * + * def __getitem__(self, loc): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1621 + * return BlockPlacement(val) + * + * def delete(self, loc): # <<<<<<<<<<<<<< + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_21delete(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_21delete(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("delete (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_20delete(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_20delete(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("delete", 0); + + /* "pandas/lib.pyx":1622 + * + * def delete(self, loc): + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) # <<<<<<<<<<<<<< + * + * def append(self, others): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_delete); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_loc); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_loc); + __Pyx_GIVEREF(__pyx_v_loc); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1621 + * return BlockPlacement(val) + * + * def delete(self, loc): # <<<<<<<<<<<<<< + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1624 + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) + * + * def append(self, others): # <<<<<<<<<<<<<< + * if len(others) == 0: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_23append(PyObject *__pyx_v_self, PyObject *__pyx_v_others); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_23append(PyObject *__pyx_v_self, PyObject *__pyx_v_others) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("append (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_22append(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_others)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_22append(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_others) { + PyObject *__pyx_v_o = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "pandas/lib.pyx":1625 + * + * def append(self, others): + * if len(others) == 0: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = PyObject_Length(__pyx_v_others); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_t_1 == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1626 + * def append(self, others): + * if len(others) == 0: + * return self # <<<<<<<<<<<<<< + * + * return BlockPlacement(np.concatenate([self.as_array] + + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1628 + * return self + * + * return BlockPlacement(np.concatenate([self.as_array] + # <<<<<<<<<<<<<< + * [o.as_array for o in others])) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":1629 + * + * return BlockPlacement(np.concatenate([self.as_array] + + * [o.as_array for o in others])) # <<<<<<<<<<<<<< + * + * cdef iadd(self, other): + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyList_CheckExact(__pyx_v_others) || PyTuple_CheckExact(__pyx_v_others)) { + __pyx_t_6 = __pyx_v_others; __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_others); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + } + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_7(__pyx_t_6); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_as_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1628 + * return self + * + * return BlockPlacement(np.concatenate([self.as_array] + # <<<<<<<<<<<<<< + * [o.as_array for o in others])) + * + */ + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1624 + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) + * + * def append(self, others): # <<<<<<<<<<<<<< + * if len(others) == 0: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1631 + * [o.as_array for o in others])) + * + * cdef iadd(self, other): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t other_int, start, stop, step, l + */ + +static PyObject *__pyx_f_6pandas_3lib_14BlockPlacement_iadd(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_s = 0; + Py_ssize_t __pyx_v_other_int; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + CYTHON_UNUSED Py_ssize_t __pyx_v_l; + PyObject *__pyx_v_newarr = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("iadd", 0); + + /* "pandas/lib.pyx":1632 + * + * cdef iadd(self, other): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * cdef Py_ssize_t other_int, start, stop, step, l + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1635 + * cdef Py_ssize_t other_int, start, stop, step, l + * + * if isinstance(other, int) and s is not None: # <<<<<<<<<<<<<< + * other_int = other + * + */ + __pyx_t_2 = PyInt_Check(__pyx_v_other); + if ((__pyx_t_2 != 0)) { + __pyx_t_3 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_4 = (__pyx_t_3 != 0); + } else { + __pyx_t_4 = (__pyx_t_2 != 0); + } + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1636 + * + * if isinstance(other, int) and s is not None: + * other_int = other # <<<<<<<<<<<<<< + * + * if other_int == 0: + */ + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_other); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_other_int = ((Py_ssize_t)__pyx_t_5); + + /* "pandas/lib.pyx":1638 + * other_int = other + * + * if other_int == 0: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_4 = ((__pyx_v_other_int == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1639 + * + * if other_int == 0: + * return self # <<<<<<<<<<<<<< + * + * start, stop, step, l = slice_get_indices_ex(s) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1641 + * return self + * + * start, stop, step, l = slice_get_indices_ex(s) # <<<<<<<<<<<<<< + * start += other_int + * stop += other_int + */ + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(__pyx_v_s, 0, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_8 = PyList_GET_ITEM(sequence, 2); + __pyx_t_9 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_start = __pyx_t_5; + __pyx_v_stop = __pyx_t_12; + __pyx_v_step = __pyx_t_13; + __pyx_v_l = __pyx_t_14; + + /* "pandas/lib.pyx":1642 + * + * start, stop, step, l = slice_get_indices_ex(s) + * start += other_int # <<<<<<<<<<<<<< + * stop += other_int + * + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_other_int); + + /* "pandas/lib.pyx":1643 + * start, stop, step, l = slice_get_indices_ex(s) + * start += other_int + * stop += other_int # <<<<<<<<<<<<<< + * + * if ((step > 0 and start < 0) or + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_other_int); + + /* "pandas/lib.pyx":1645 + * stop += other_int + * + * if ((step > 0 and start < 0) or # <<<<<<<<<<<<<< + * (step < 0 and stop < step)): + * raise ValueError("iadd causes length change") + */ + __pyx_t_4 = ((__pyx_v_step > 0) != 0); + if (__pyx_t_4) { + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (!__pyx_t_3) { + + /* "pandas/lib.pyx":1646 + * + * if ((step > 0 and start < 0) or + * (step < 0 and stop < step)): # <<<<<<<<<<<<<< + * raise ValueError("iadd causes length change") + * + */ + __pyx_t_4 = ((__pyx_v_step < 0) != 0); + if (__pyx_t_4) { + __pyx_t_2 = ((__pyx_v_stop < __pyx_v_step) != 0); + __pyx_t_15 = __pyx_t_2; + } else { + __pyx_t_15 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_15; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1647 + * if ((step > 0 and start < 0) or + * (step < 0 and stop < step)): + * raise ValueError("iadd causes length change") # <<<<<<<<<<<<<< + * + * if stop < 0: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1649 + * raise ValueError("iadd causes length change") + * + * if stop < 0: # <<<<<<<<<<<<<< + * self._as_slice = slice(start, None, step) + * else: + */ + __pyx_t_4 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1650 + * + * if stop < 0: + * self._as_slice = slice(start, None, step) # <<<<<<<<<<<<<< + * else: + * self._as_slice = slice(start, stop, step) + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 1, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_1 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(PySlice_Check(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/lib.pyx":1652 + * self._as_slice = slice(start, None, step) + * else: + * self._as_slice = slice(start, stop, step) # <<<<<<<<<<<<<< + * + * self._has_array = False + */ + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(PySlice_Check(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L8:; + + /* "pandas/lib.pyx":1654 + * self._as_slice = slice(start, stop, step) + * + * self._has_array = False # <<<<<<<<<<<<<< + * self._as_array = None + * else: + */ + __pyx_v_self->_has_array = 0; + + /* "pandas/lib.pyx":1655 + * + * self._has_array = False + * self._as_array = None # <<<<<<<<<<<<<< + * else: + * newarr = self.as_array + other + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = Py_None; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1657 + * self._as_array = None + * else: + * newarr = self.as_array + other # <<<<<<<<<<<<<< + * if (newarr < 0).any(): + * raise ValueError("iadd causes length change") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_other); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_newarr = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1658 + * else: + * newarr = self.as_array + other + * if (newarr < 0).any(): # <<<<<<<<<<<<<< + * raise ValueError("iadd causes length change") + * + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_newarr, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1659 + * newarr = self.as_array + other + * if (newarr < 0).any(): + * raise ValueError("iadd causes length change") # <<<<<<<<<<<<<< + * + * self._as_array = newarr + */ + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1661 + * raise ValueError("iadd causes length change") + * + * self._as_array = newarr # <<<<<<<<<<<<<< + * self._has_array = True + * self._has_slice = False + */ + __Pyx_INCREF(__pyx_v_newarr); + __Pyx_GIVEREF(__pyx_v_newarr); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = __pyx_v_newarr; + + /* "pandas/lib.pyx":1662 + * + * self._as_array = newarr + * self._has_array = True # <<<<<<<<<<<<<< + * self._has_slice = False + * self._as_slice = None + */ + __pyx_v_self->_has_array = 1; + + /* "pandas/lib.pyx":1663 + * self._as_array = newarr + * self._has_array = True + * self._has_slice = False # <<<<<<<<<<<<<< + * self._as_slice = None + * + */ + __pyx_v_self->_has_slice = 0; + + /* "pandas/lib.pyx":1664 + * self._has_array = True + * self._has_slice = False + * self._as_slice = None # <<<<<<<<<<<<<< + * + * return self + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = ((PyObject*)Py_None); + } + __pyx_L3:; + + /* "pandas/lib.pyx":1666 + * self._as_slice = None + * + * return self # <<<<<<<<<<<<<< + * + * cdef BlockPlacement copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/lib.pyx":1631 + * [o.as_array for o in others])) + * + * cdef iadd(self, other): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t other_int, start, stop, step, l + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.iadd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_newarr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1668 + * return self + * + * cdef BlockPlacement copy(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +static struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_f_6pandas_3lib_14BlockPlacement_copy(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "pandas/lib.pyx":1669 + * + * cdef BlockPlacement copy(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * return BlockPlacement(s) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1670 + * cdef BlockPlacement copy(self): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * return BlockPlacement(s) + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1671 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * return BlockPlacement(s) # <<<<<<<<<<<<<< + * else: + * return BlockPlacement(self._as_array) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1673 + * return BlockPlacement(s) + * else: + * return BlockPlacement(self._as_array) # <<<<<<<<<<<<<< + * + * def add(self, other): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->_as_array); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_as_array); + __Pyx_GIVEREF(__pyx_v_self->_as_array); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1668 + * return self + * + * cdef BlockPlacement copy(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1675 + * return BlockPlacement(self._as_array) + * + * def add(self, other): # <<<<<<<<<<<<<< + * return self.copy().iadd(other) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_25add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_25add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("add (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_24add(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_24add(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("add", 0); + + /* "pandas/lib.pyx":1676 + * + * def add(self, other): + * return self.copy().iadd(other) # <<<<<<<<<<<<<< + * + * def sub(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->copy(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_t_1)->__pyx_vtab)->iadd(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_t_1), __pyx_v_other); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1675 + * return BlockPlacement(self._as_array) + * + * def add(self, other): # <<<<<<<<<<<<<< + * return self.copy().iadd(other) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1678 + * return self.copy().iadd(other) + * + * def sub(self, other): # <<<<<<<<<<<<<< + * return self.add(-other) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_27sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_27sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sub (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_26sub(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_26sub(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sub", 0); + + /* "pandas/lib.pyx":1679 + * + * def sub(self, other): + * return self.add(-other) # <<<<<<<<<<<<<< + * + * cdef slice _ensure_has_slice(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Negative(__pyx_v_other); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1678 + * return self.copy().iadd(other) + * + * def sub(self, other): # <<<<<<<<<<<<<< + * return self.add(-other) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1681 + * return self.add(-other) + * + * cdef slice _ensure_has_slice(self): # <<<<<<<<<<<<<< + * if not self._has_slice: + * self._as_slice = indexer_as_slice(self._as_array) + */ + +static PyObject *__pyx_f_6pandas_3lib_14BlockPlacement__ensure_has_slice(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ensure_has_slice", 0); + + /* "pandas/lib.pyx":1682 + * + * cdef slice _ensure_has_slice(self): + * if not self._has_slice: # <<<<<<<<<<<<<< + * self._as_slice = indexer_as_slice(self._as_array) + * self._has_slice = True + */ + __pyx_t_1 = ((!(__pyx_v_self->_has_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1683 + * cdef slice _ensure_has_slice(self): + * if not self._has_slice: + * self._as_slice = indexer_as_slice(self._as_array) # <<<<<<<<<<<<<< + * self._has_slice = True + * return self._as_slice + */ + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_self->_as_array); + if (unlikely(!__pyx_t_2.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_6pandas_3lib_indexer_as_slice(__pyx_t_2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":1684 + * if not self._has_slice: + * self._as_slice = indexer_as_slice(self._as_array) + * self._has_slice = True # <<<<<<<<<<<<<< + * return self._as_slice + * + */ + __pyx_v_self->_has_slice = 1; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1685 + * self._as_slice = indexer_as_slice(self._as_array) + * self._has_slice = True + * return self._as_slice # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_as_slice); + __pyx_r = __pyx_v_self->_as_slice; + goto __pyx_L0; + + /* "pandas/lib.pyx":1681 + * return self.add(-other) + * + * cdef slice _ensure_has_slice(self): # <<<<<<<<<<<<<< + * if not self._has_slice: + * self._as_slice = indexer_as_slice(self._as_array) + */ + + /* function exit code */ + __pyx_L1_error:; + __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockPlacement._ensure_has_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":18 + * object arr, dummy, f, labels, typ, index + * + * def __init__(self, object arr, object f, axis=1, dummy=None, # <<<<<<<<<<<<<< + * labels=None): + * n, k = arr.shape + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_7Reducer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_7Reducer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_arr = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_dummy = 0; + PyObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_f,&__pyx_n_s_axis,&__pyx_n_s_dummy,&__pyx_n_s_labels,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)__pyx_int_1); + values[3] = ((PyObject *)Py_None); + + /* "pandas/src/reduce.pyx":19 + * + * def __init__(self, object arr, object f, axis=1, dummy=None, + * labels=None): # <<<<<<<<<<<<<< + * n, k = arr.shape + * + */ + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = values[0]; + __pyx_v_f = values[1]; + __pyx_v_axis = values[2]; + __pyx_v_dummy = values[3]; + __pyx_v_labels = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Reducer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_7Reducer___init__(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self), __pyx_v_arr, __pyx_v_f, __pyx_v_axis, __pyx_v_dummy, __pyx_v_labels); + + /* "pandas/src/reduce.pyx":18 + * object arr, dummy, f, labels, typ, index + * + * def __init__(self, object arr, object f, axis=1, dummy=None, # <<<<<<<<<<<<<< + * labels=None): + * n, k = arr.shape + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_7Reducer___init__(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_f, PyObject *__pyx_v_axis, PyObject *__pyx_v_dummy, PyObject *__pyx_v_labels) { + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_index = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_arr); + + /* "pandas/src/reduce.pyx":20 + * def __init__(self, object arr, object f, axis=1, dummy=None, + * labels=None): + * n, k = arr.shape # <<<<<<<<<<<<<< + * + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_v_n = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_k = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":22 + * n, k = arr.shape + * + * if axis == 0: # <<<<<<<<<<<<<< + * if not arr.flags.f_contiguous: + * arr = arr.copy('F') + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "pandas/src/reduce.pyx":23 + * + * if axis == 0: + * if not arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * arr = arr.copy('F') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "pandas/src/reduce.pyx":24 + * if axis == 0: + * if not arr.flags.f_contiguous: + * arr = arr.copy('F') # <<<<<<<<<<<<<< + * + * self.nresults = k + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/reduce.pyx":26 + * arr = arr.copy('F') + * + * self.nresults = k # <<<<<<<<<<<<<< + * self.chunksize = n + * self.increment = n * arr.dtype.itemsize + */ + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->nresults = __pyx_t_8; + + /* "pandas/src/reduce.pyx":27 + * + * self.nresults = k + * self.chunksize = n # <<<<<<<<<<<<<< + * self.increment = n * arr.dtype.itemsize + * else: + */ + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->chunksize = __pyx_t_8; + + /* "pandas/src/reduce.pyx":28 + * self.nresults = k + * self.chunksize = n + * self.increment = n * arr.dtype.itemsize # <<<<<<<<<<<<<< + * else: + * if not arr.flags.c_contiguous: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->increment = __pyx_t_8; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":30 + * self.increment = n * arr.dtype.itemsize + * else: + * if not arr.flags.c_contiguous: # <<<<<<<<<<<<<< + * arr = arr.copy('C') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((!__pyx_t_7) != 0); + if (__pyx_t_6) { + + /* "pandas/src/reduce.pyx":31 + * else: + * if not arr.flags.c_contiguous: + * arr = arr.copy('C') # <<<<<<<<<<<<<< + * + * self.nresults = n + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/src/reduce.pyx":33 + * arr = arr.copy('C') + * + * self.nresults = n # <<<<<<<<<<<<<< + * self.chunksize = k + * self.increment = k * arr.dtype.itemsize + */ + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->nresults = __pyx_t_8; + + /* "pandas/src/reduce.pyx":34 + * + * self.nresults = n + * self.chunksize = k # <<<<<<<<<<<<<< + * self.increment = k * arr.dtype.itemsize + * + */ + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->chunksize = __pyx_t_8; + + /* "pandas/src/reduce.pyx":35 + * self.nresults = n + * self.chunksize = k + * self.increment = k * arr.dtype.itemsize # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_k, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->increment = __pyx_t_8; + } + __pyx_L5:; + + /* "pandas/src/reduce.pyx":38 + * + * + * self.f = f # <<<<<<<<<<<<<< + * self.arr = arr + * self.typ = None + */ + __Pyx_INCREF(__pyx_v_f); + __Pyx_GIVEREF(__pyx_v_f); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_f; + + /* "pandas/src/reduce.pyx":39 + * + * self.f = f + * self.arr = arr # <<<<<<<<<<<<<< + * self.typ = None + * self.labels = labels + */ + __Pyx_INCREF(__pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_arr; + + /* "pandas/src/reduce.pyx":40 + * self.f = f + * self.arr = arr + * self.typ = None # <<<<<<<<<<<<<< + * self.labels = labels + * self.dummy, index = self._check_dummy(dummy=dummy) + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = Py_None; + + /* "pandas/src/reduce.pyx":41 + * self.arr = arr + * self.typ = None + * self.labels = labels # <<<<<<<<<<<<<< + * self.dummy, index = self._check_dummy(dummy=dummy) + * + */ + __Pyx_INCREF(__pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = __pyx_v_labels; + + /* "pandas/src/reduce.pyx":42 + * self.typ = None + * self.labels = labels + * self.dummy, index = self._check_dummy(dummy=dummy) # <<<<<<<<<<<<<< + * + * self.labels = labels + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_dummy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dummy, __pyx_v_dummy) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L9_unpacking_done:; + } + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->dummy); + __Pyx_DECREF(__pyx_v_self->dummy); + __pyx_v_self->dummy = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_index = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":44 + * self.dummy, index = self._check_dummy(dummy=dummy) + * + * self.labels = labels # <<<<<<<<<<<<<< + * self.index = index + * + */ + __Pyx_INCREF(__pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = __pyx_v_labels; + + /* "pandas/src/reduce.pyx":45 + * + * self.labels = labels + * self.index = index # <<<<<<<<<<<<<< + * + * def _check_dummy(self, dummy=None): + */ + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_v_index; + + /* "pandas/src/reduce.pyx":18 + * object arr, dummy, f, labels, typ, index + * + * def __init__(self, object arr, object f, axis=1, dummy=None, # <<<<<<<<<<<<<< + * labels=None): + * n, k = arr.shape + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.Reducer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":47 + * self.index = index + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * cdef object index + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_dummy (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dummy,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_dummy") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dummy = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Reducer._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_7Reducer_2_check_dummy(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self), __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_2_check_dummy(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_dummy) { + PyObject *__pyx_v_index = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_dummy", 0); + __Pyx_INCREF(__pyx_v_dummy); + + /* "pandas/src/reduce.pyx":50 + * cdef object index + * + * if dummy is None: # <<<<<<<<<<<<<< + * dummy = np.empty(self.chunksize, dtype=self.arr.dtype) + * index = None + */ + __pyx_t_1 = (__pyx_v_dummy == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":51 + * + * if dummy is None: + * dummy = np.empty(self.chunksize, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->chunksize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_dummy, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/reduce.pyx":52 + * if dummy is None: + * dummy = np.empty(self.chunksize, dtype=self.arr.dtype) + * index = None # <<<<<<<<<<<<<< + * + * # our ref is stolen later since we are creating this array + */ + __Pyx_INCREF(Py_None); + __pyx_v_index = Py_None; + + /* "pandas/src/reduce.pyx":56 + * # our ref is stolen later since we are creating this array + * # in cython, so increment first + * Py_INCREF(dummy) # <<<<<<<<<<<<<< + * else: + * # we passed a series-like + */ + Py_INCREF(__pyx_v_dummy); + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":59 + * else: + * # we passed a series-like + * if hasattr(dummy,'values'): # <<<<<<<<<<<<<< + * + * self.typ = type(dummy) + */ + __pyx_t_2 = PyObject_HasAttr(__pyx_v_dummy, __pyx_n_s_values); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":61 + * if hasattr(dummy,'values'): + * + * self.typ = type(dummy) # <<<<<<<<<<<<<< + * index = getattr(dummy,'index',None) + * dummy = dummy.values + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_dummy))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_dummy))); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = ((PyObject *)Py_TYPE(__pyx_v_dummy)); + + /* "pandas/src/reduce.pyx":62 + * + * self.typ = type(dummy) + * index = getattr(dummy,'index',None) # <<<<<<<<<<<<<< + * dummy = dummy.values + * + */ + __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_dummy, __pyx_n_s_index, Py_None); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_index = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/src/reduce.pyx":63 + * self.typ = type(dummy) + * index = getattr(dummy,'index',None) + * dummy = dummy.values # <<<<<<<<<<<<<< + * + * if dummy.dtype != self.arr.dtype: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_dummy, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/reduce.pyx":65 + * dummy = dummy.values + * + * if dummy.dtype != self.arr.dtype: # <<<<<<<<<<<<<< + * raise ValueError('Dummy array must be same dtype') + * if len(dummy) != self.chunksize: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":66 + * + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if len(dummy) != self.chunksize: + * raise ValueError('Dummy array must be length %d' % + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":67 + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + * if len(dummy) != self.chunksize: # <<<<<<<<<<<<<< + * raise ValueError('Dummy array must be length %d' % + * self.chunksize) + */ + __pyx_t_7 = PyObject_Length(__pyx_v_dummy); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((__pyx_t_7 != __pyx_v_self->chunksize) != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":69 + * if len(dummy) != self.chunksize: + * raise ValueError('Dummy array must be length %d' % + * self.chunksize) # <<<<<<<<<<<<<< + * + * return dummy, index + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->chunksize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/src/reduce.pyx":68 + * raise ValueError('Dummy array must be same dtype') + * if len(dummy) != self.chunksize: + * raise ValueError('Dummy array must be length %d' % # <<<<<<<<<<<<<< + * self.chunksize) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Dummy_array_must_be_length_d, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":71 + * self.chunksize) + * + * return dummy, index # <<<<<<<<<<<<<< + * + * def get_result(self): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_index)) { __Pyx_RaiseUnboundLocalError("index"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_dummy); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy); + __Pyx_GIVEREF(__pyx_v_dummy); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":47 + * self.index = index + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * cdef object index + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.Reducer._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_dummy); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":73 + * return dummy, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * char* dummy_buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_result (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_7Reducer_4get_result(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_4get_result(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self) { + char *__pyx_v_dummy_buf; + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_chunk = 0; + Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_incr; + PyArrayIterObject *__pyx_v_it = 0; + PyObject *__pyx_v_res = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_labels = 0; + PyObject *__pyx_v_index = 0; + PyObject *__pyx_v_cached_typ = 0; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char *__pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + char const *__pyx_t_17; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_result", 0); + + /* "pandas/src/reduce.pyx":80 + * flatiter it + * object res, name, labels, index + * object cached_typ = None # <<<<<<<<<<<<<< + * + * arr = self.arr + */ + __Pyx_INCREF(Py_None); + __pyx_v_cached_typ = Py_None; + + /* "pandas/src/reduce.pyx":82 + * object cached_typ = None + * + * arr = self.arr # <<<<<<<<<<<<<< + * chunk = self.dummy + * dummy_buf = chunk.data + */ + if (!(likely(((__pyx_v_self->arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_self->arr; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":83 + * + * arr = self.arr + * chunk = self.dummy # <<<<<<<<<<<<<< + * dummy_buf = chunk.data + * chunk.data = arr.data + */ + if (!(likely(((__pyx_v_self->dummy) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->dummy, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_self->dummy; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_chunk = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":84 + * arr = self.arr + * chunk = self.dummy + * dummy_buf = chunk.data # <<<<<<<<<<<<<< + * chunk.data = arr.data + * labels = self.labels + */ + __pyx_t_2 = __pyx_v_chunk->data; + __pyx_v_dummy_buf = __pyx_t_2; + + /* "pandas/src/reduce.pyx":85 + * chunk = self.dummy + * dummy_buf = chunk.data + * chunk.data = arr.data # <<<<<<<<<<<<<< + * labels = self.labels + * index = self.index + */ + __pyx_t_2 = __pyx_v_arr->data; + __pyx_v_chunk->data = __pyx_t_2; + + /* "pandas/src/reduce.pyx":86 + * dummy_buf = chunk.data + * chunk.data = arr.data + * labels = self.labels # <<<<<<<<<<<<<< + * index = self.index + * incr = self.increment + */ + __pyx_t_1 = __pyx_v_self->labels; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_labels = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":87 + * chunk.data = arr.data + * labels = self.labels + * index = self.index # <<<<<<<<<<<<<< + * incr = self.increment + * + */ + __pyx_t_1 = __pyx_v_self->index; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_index = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":88 + * labels = self.labels + * index = self.index + * incr = self.increment # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_3 = __pyx_v_self->increment; + __pyx_v_incr = __pyx_t_3; + + /* "pandas/src/reduce.pyx":90 + * incr = self.increment + * + * try: # <<<<<<<<<<<<<< + * for i in range(self.nresults): + * + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/src/reduce.pyx":91 + * + * try: + * for i in range(self.nresults): # <<<<<<<<<<<<<< + * + * if labels is not None: + */ + __pyx_t_3 = __pyx_v_self->nresults; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/reduce.pyx":93 + * for i in range(self.nresults): + * + * if labels is not None: # <<<<<<<<<<<<<< + * name = util.get_value_at(labels, i) + * else: + */ + __pyx_t_8 = (__pyx_v_labels != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":94 + * + * if labels is not None: + * name = util.get_value_at(labels, i) # <<<<<<<<<<<<<< + * else: + * name = None + */ + if (!(likely(((__pyx_v_labels) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_labels, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_v_labels), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_10); + __pyx_t_10 = 0; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":96 + * name = util.get_value_at(labels, i) + * else: + * name = None # <<<<<<<<<<<<<< + * + * # create the cached type + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_name, Py_None); + } + __pyx_L16:; + + /* "pandas/src/reduce.pyx":100 + * # create the cached type + * # each time just reassign the data + * if i == 0: # <<<<<<<<<<<<<< + * + * if self.typ is not None: + */ + __pyx_t_9 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":102 + * if i == 0: + * + * if self.typ is not None: # <<<<<<<<<<<<<< + * + * # recreate with the index if supplied + */ + __pyx_t_9 = (__pyx_v_self->typ != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "pandas/src/reduce.pyx":105 + * + * # recreate with the index if supplied + * if index is not None: # <<<<<<<<<<<<<< + * + * cached_typ = self.typ(chunk, index=index, name=name) + */ + __pyx_t_8 = (__pyx_v_index != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":107 + * if index is not None: + * + * cached_typ = self.typ(chunk, index=index, name=name) # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_chunk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk)); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, __pyx_v_index) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_v_self->typ, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_cached_typ, __pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":112 + * + * # use the passsed typ, sans index + * cached_typ = self.typ(chunk, name=name) # <<<<<<<<<<<<<< + * + * # use the cached_typ if possible + */ + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_chunk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk)); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_self->typ, __pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_cached_typ, __pyx_t_10); + __pyx_t_10 = 0; + } + __pyx_L19:; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/reduce.pyx":115 + * + * # use the cached_typ if possible + * if cached_typ is not None: # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ._data._block, 'values', chunk) + * object.__setattr__(cached_typ, 'name', name) + */ + __pyx_t_9 = (__pyx_v_cached_typ != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "pandas/src/reduce.pyx":116 + * # use the cached_typ if possible + * if cached_typ is not None: + * object.__setattr__(cached_typ._data._block, 'values', chunk) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, 'name', name) + * res = self.f(cached_typ) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cached_typ, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_block); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __Pyx_INCREF(__pyx_n_s_values); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_values); + __Pyx_GIVEREF(__pyx_n_s_values); + __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_chunk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk)); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "pandas/src/reduce.pyx":117 + * if cached_typ is not None: + * object.__setattr__(cached_typ._data._block, 'values', chunk) + * object.__setattr__(cached_typ, 'name', name) # <<<<<<<<<<<<<< + * res = self.f(cached_typ) + * else: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_name_2); + __Pyx_GIVEREF(__pyx_n_s_name_2); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/src/reduce.pyx":118 + * object.__setattr__(cached_typ._data._block, 'values', chunk) + * object.__setattr__(cached_typ, 'name', name) + * res = self.f(cached_typ) # <<<<<<<<<<<<<< + * else: + * res = self.f(chunk) + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->f, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":120 + * res = self.f(cached_typ) + * else: + * res = self.f(chunk) # <<<<<<<<<<<<<< + * + * if hasattr(res,'values'): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chunk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk)); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_self->f, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_10); + __pyx_t_10 = 0; + } + __pyx_L20:; + + /* "pandas/src/reduce.pyx":122 + * res = self.f(chunk) + * + * if hasattr(res,'values'): # <<<<<<<<<<<<<< + * res = res.values + * + */ + __pyx_t_8 = PyObject_HasAttr(__pyx_v_res, __pyx_n_s_values); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":123 + * + * if hasattr(res,'values'): + * res = res.values # <<<<<<<<<<<<<< + * + * if i == 0: + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_values); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_10); + __pyx_t_10 = 0; + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/src/reduce.pyx":125 + * res = res.values + * + * if i == 0: # <<<<<<<<<<<<<< + * result = self._get_result_array(res) + * it = PyArray_IterNew(result) + */ + __pyx_t_9 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":126 + * + * if i == 0: + * result = self._get_result_array(res) # <<<<<<<<<<<<<< + * it = PyArray_IterNew(result) + * + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_result_array); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_11)); + __pyx_t_11 = 0; + + /* "pandas/src/reduce.pyx":127 + * if i == 0: + * result = self._get_result_array(res) + * it = PyArray_IterNew(result) # <<<<<<<<<<<<<< + * + * PyArray_SETITEM(result, PyArray_ITER_DATA(it), res) + */ + __pyx_t_11 = PyArray_IterNew(((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __pyx_t_11; + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_v_it, ((PyArrayIterObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L22; + } + __pyx_L22:; + + /* "pandas/src/reduce.pyx":129 + * it = PyArray_IterNew(result) + * + * PyArray_SETITEM(result, PyArray_ITER_DATA(it), res) # <<<<<<<<<<<<<< + * chunk.data = chunk.data + self.increment + * PyArray_ITER_NEXT(it) + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } + if (unlikely(!__pyx_v_it)) { __Pyx_RaiseUnboundLocalError("it"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } + PyArray_SETITEM(__pyx_v_result, PyArray_ITER_DATA(__pyx_v_it), __pyx_v_res); + + /* "pandas/src/reduce.pyx":130 + * + * PyArray_SETITEM(result, PyArray_ITER_DATA(it), res) + * chunk.data = chunk.data + self.increment # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * except Exception, e: + */ + __pyx_v_chunk->data = (__pyx_v_chunk->data + __pyx_v_self->increment); + + /* "pandas/src/reduce.pyx":131 + * PyArray_SETITEM(result, PyArray_ITER_DATA(it), res) + * chunk.data = chunk.data + self.increment + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * except Exception, e: + * if hasattr(e, 'args'): + */ + if (unlikely(!__pyx_v_it)) { __Pyx_RaiseUnboundLocalError("it"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } + PyArray_ITER_NEXT(__pyx_v_it); + } + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":132 + * chunk.data = chunk.data + self.increment + * PyArray_ITER_NEXT(it) + * except Exception, e: # <<<<<<<<<<<<<< + * if hasattr(e, 'args'): + * e.args = e.args + (i,) + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.lib.Reducer.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_e = __pyx_t_11; + + /* "pandas/src/reduce.pyx":133 + * PyArray_ITER_NEXT(it) + * except Exception, e: + * if hasattr(e, 'args'): # <<<<<<<<<<<<<< + * e.args = e.args + (i,) + * raise + */ + __pyx_t_9 = PyObject_HasAttr(__pyx_v_e, __pyx_n_s_args); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "pandas/src/reduce.pyx":134 + * except Exception, e: + * if hasattr(e, 'args'): + * e.args = e.args + (i,) # <<<<<<<<<<<<<< + * raise + * finally: + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyNumber_Add(__pyx_t_13, __pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_e, __pyx_n_s_args, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L25; + } + __pyx_L25:; + + /* "pandas/src/reduce.pyx":135 + * if hasattr(e, 'args'): + * e.args = e.args + (i,) + * raise # <<<<<<<<<<<<<< + * finally: + * # so we don't free the wrong memory + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_11, __pyx_t_10); + __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L4_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L13_try_end:; + } + } + + /* "pandas/src/reduce.pyx":138 + * finally: + * # so we don't free the wrong memory + * chunk.data = dummy_buf # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_v_chunk->data = __pyx_v_dummy_buf; + goto __pyx_L5; + } + /*exception exit:*/{ + __pyx_L4_error:; + __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __pyx_t_12 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename; + { + __pyx_v_chunk->data = __pyx_v_dummy_buf; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; + __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "pandas/src/reduce.pyx":140 + * chunk.data = dummy_buf + * + * if result.dtype == np.object_: # <<<<<<<<<<<<<< + * result = maybe_convert_objects(result) + * + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_8) { + + /* "pandas/src/reduce.pyx":141 + * + * if result.dtype == np.object_: + * result = maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_10)); + __pyx_t_10 = 0; + goto __pyx_L28; + } + __pyx_L28:; + + /* "pandas/src/reduce.pyx":143 + * result = maybe_convert_objects(result) + * + * return result # <<<<<<<<<<<<<< + * + * def _get_result_array(self, object res): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":73 + * return dummy, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * char* dummy_buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("pandas.lib.Reducer.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_chunk); + __Pyx_XDECREF((PyObject *)__pyx_v_it); + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_cached_typ); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":145 + * return result + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_result_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_7Reducer_6_get_result_array(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self), ((PyObject *)__pyx_v_res)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_6_get_result_array(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_result_array", 0); + + /* "pandas/src/reduce.pyx":146 + * + * def _get_result_array(self, object res): + * try: # <<<<<<<<<<<<<< + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy))) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/reduce.pyx":147 + * def _get_result_array(self, object res): + * try: + * assert(not isinstance(res, np.ndarray)) # <<<<<<<<<<<<<< + * assert(not (isinstance(res, list) and len(res) == len(self.dummy))) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_res, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + if (unlikely(!((!(__pyx_t_4 != 0)) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":148 + * try: + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy))) # <<<<<<<<<<<<<< + * + * result = np.empty(self.nresults, dtype='O') + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyList_Check(__pyx_v_res); + if ((__pyx_t_4 != 0)) { + __pyx_t_5 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __pyx_v_self->dummy; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = ((__pyx_t_5 == __pyx_t_7) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = (__pyx_t_4 != 0); + } + if (unlikely(!((!__pyx_t_9) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":150 + * assert(not (isinstance(res, list) and len(res) == len(self.dummy))) + * + * result = np.empty(self.nresults, dtype='O') # <<<<<<<<<<<<<< + * result[0] = res + * except Exception: + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->nresults); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":151 + * + * result = np.empty(self.nresults, dtype='O') + * result[0] = res # <<<<<<<<<<<<<< + * except Exception: + * raise ValueError('function does not reduce') + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_result, 0, __pyx_v_res, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":152 + * result = np.empty(self.nresults, dtype='O') + * result[0] = res + * except Exception: # <<<<<<<<<<<<<< + * raise ValueError('function does not reduce') + * return result + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("pandas.lib.Reducer._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_6, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/src/reduce.pyx":153 + * result[0] = res + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/reduce.pyx":154 + * except Exception: + * raise ValueError('function does not reduce') + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":145 + * return result + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("pandas.lib.Reducer._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":168 + * object arr, index, dummy_arr, dummy_index, values, f, bins, typ, name + * + * def __init__(self, object series, object f, object bins, object dummy): # <<<<<<<<<<<<<< + * n = len(series) + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_series = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_bins = 0; + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_series,&__pyx_n_s_f,&__pyx_n_s_bins,&__pyx_n_s_dummy,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_series)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_series = values[0]; + __pyx_v_f = values[1]; + __pyx_v_bins = values[2]; + __pyx_v_dummy = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), __pyx_v_series, __pyx_v_f, __pyx_v_bins, __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_series, PyObject *__pyx_v_f, PyObject *__pyx_v_bins, PyObject *__pyx_v_dummy) { + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_values = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/reduce.pyx":169 + * + * def __init__(self, object series, object f, object bins, object dummy): + * n = len(series) # <<<<<<<<<<<<<< + * + * self.bins = bins + */ + __pyx_t_1 = PyObject_Length(__pyx_v_series); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/reduce.pyx":171 + * n = len(series) + * + * self.bins = bins # <<<<<<<<<<<<<< + * self.f = f + * + */ + __Pyx_INCREF(__pyx_v_bins); + __Pyx_GIVEREF(__pyx_v_bins); + __Pyx_GOTREF(__pyx_v_self->bins); + __Pyx_DECREF(__pyx_v_self->bins); + __pyx_v_self->bins = __pyx_v_bins; + + /* "pandas/src/reduce.pyx":172 + * + * self.bins = bins + * self.f = f # <<<<<<<<<<<<<< + * + * values = series.values + */ + __Pyx_INCREF(__pyx_v_f); + __Pyx_GIVEREF(__pyx_v_f); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_f; + + /* "pandas/src/reduce.pyx":174 + * self.f = f + * + * values = series.values # <<<<<<<<<<<<<< + * if not values.flags.c_contiguous: + * values = values.copy('C') + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_values = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":175 + * + * values = series.values + * if not values.flags.c_contiguous: # <<<<<<<<<<<<<< + * values = values.copy('C') + * self.arr = values + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "pandas/src/reduce.pyx":176 + * values = series.values + * if not values.flags.c_contiguous: + * values = values.copy('C') # <<<<<<<<<<<<<< + * self.arr = values + * self.index = series.index + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":177 + * if not values.flags.c_contiguous: + * values = values.copy('C') + * self.arr = values # <<<<<<<<<<<<<< + * self.index = series.index + * self.typ = type(series) + */ + __Pyx_INCREF(__pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_values; + + /* "pandas/src/reduce.pyx":178 + * values = values.copy('C') + * self.arr = values + * self.index = series.index # <<<<<<<<<<<<<< + * self.typ = type(series) + * self.name = getattr(series,'name',None) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":179 + * self.arr = values + * self.index = series.index + * self.typ = type(series) # <<<<<<<<<<<<<< + * self.name = getattr(series,'name',None) + * + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_series))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_series))); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = ((PyObject *)Py_TYPE(__pyx_v_series)); + + /* "pandas/src/reduce.pyx":180 + * self.index = series.index + * self.typ = type(series) + * self.name = getattr(series,'name',None) # <<<<<<<<<<<<<< + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_series, __pyx_n_s_name_2, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":182 + * self.name = getattr(series,'name',None) + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) # <<<<<<<<<<<<<< + * self.passed_dummy = dummy is not None + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_dummy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_dummy); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy); + __Pyx_GIVEREF(__pyx_v_dummy); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":183 + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + * self.passed_dummy = dummy is not None # <<<<<<<<<<<<<< + * + * # kludge for #1688 + */ + __pyx_t_5 = (__pyx_v_dummy != Py_None); + __pyx_v_self->passed_dummy = __pyx_t_5; + + /* "pandas/src/reduce.pyx":186 + * + * # kludge for #1688 + * if len(bins) > 0 and bins[-1] == len(series): # <<<<<<<<<<<<<< + * self.ngroups = len(bins) + * else: + */ + __pyx_t_1 = PyObject_Length(__pyx_v_bins); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_1 > 0); + if (__pyx_t_5) { + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_bins, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_Length(__pyx_v_series); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __pyx_t_4; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":187 + * # kludge for #1688 + * if len(bins) > 0 and bins[-1] == len(series): + * self.ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * self.ngroups = len(bins) + 1 + */ + __pyx_t_1 = PyObject_Length(__pyx_v_bins); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->ngroups = __pyx_t_1; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":189 + * self.ngroups = len(bins) + * else: + * self.ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * def _check_dummy(self, dummy=None): + */ + __pyx_t_1 = PyObject_Length(__pyx_v_bins); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->ngroups = (__pyx_t_1 + 1); + } + __pyx_L6:; + + /* "pandas/src/reduce.pyx":168 + * object arr, index, dummy_arr, dummy_index, values, f, bins, typ, name + * + * def __init__(self, object series, object f, object bins, object dummy): # <<<<<<<<<<<<<< + * n = len(series) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":191 + * self.ngroups = len(bins) + 1 + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_dummy (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dummy,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_dummy") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dummy = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_2_check_dummy(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_2_check_dummy(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_dummy) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_dummy", 0); + + /* "pandas/src/reduce.pyx":192 + * + * def _check_dummy(self, dummy=None): + * if dummy is None: # <<<<<<<<<<<<<< + * values = np.empty(0, dtype=self.arr.dtype) + * index = None + */ + __pyx_t_1 = (__pyx_v_dummy == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":193 + * def _check_dummy(self, dummy=None): + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__30, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":194 + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + * index = None # <<<<<<<<<<<<<< + * else: + * values = dummy.values + */ + __Pyx_INCREF(Py_None); + __pyx_v_index = Py_None; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":196 + * index = None + * else: + * values = dummy.values # <<<<<<<<<<<<<< + * if values.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":197 + * else: + * values = dummy.values + * if values.dtype != self.arr.dtype: # <<<<<<<<<<<<<< + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":198 + * values = dummy.values + * if values.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":199 + * if values.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: # <<<<<<<<<<<<<< + * values = values.copy() + * index = dummy.index + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((!__pyx_t_2) != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":200 + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: + * values = values.copy() # <<<<<<<<<<<<<< + * index = dummy.index + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/reduce.pyx":201 + * if not values.flags.contiguous: + * values = values.copy() + * index = dummy.index # <<<<<<<<<<<<<< + * + * return values, index + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_index = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":203 + * index = dummy.index + * + * return values, index # <<<<<<<<<<<<<< + * + * def get_result(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":191 + * self.ngroups = len(bins) + 1 + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":205 + * return values, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr, result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_result (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4get_result(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4get_result(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_counts = 0; + Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_group_size; + PyObject *__pyx_v_res = 0; + int __pyx_v_initialized; + struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_vslider = 0; + struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_islider = 0; + PyObject *__pyx_v_gin = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_cached_typ = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + __pyx_t_5numpy_int64_t __pyx_t_12; + long __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + int __pyx_t_20; + char const *__pyx_t_21; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_result", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + + /* "pandas/src/reduce.pyx":211 + * Py_ssize_t i, n, group_size + * object res + * bint initialized = 0 # <<<<<<<<<<<<<< + * Slider vslider, islider + * object gin, typ, name + */ + __pyx_v_initialized = 0; + + /* "pandas/src/reduce.pyx":214 + * Slider vslider, islider + * object gin, typ, name + * object cached_typ = None # <<<<<<<<<<<<<< + * + * counts = np.zeros(self.ngroups, dtype=np.int64) + */ + __Pyx_INCREF(Py_None); + __pyx_v_cached_typ = Py_None; + + /* "pandas/src/reduce.pyx":216 + * object cached_typ = None + * + * counts = np.zeros(self.ngroups, dtype=np.int64) # <<<<<<<<<<<<<< + * + * if self.ngroups > 0: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->ngroups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":218 + * counts = np.zeros(self.ngroups, dtype=np.int64) + * + * if self.ngroups > 0: # <<<<<<<<<<<<<< + * counts[0] = self.bins[0] + * for i in range(1, self.ngroups): + */ + __pyx_t_11 = ((__pyx_v_self->ngroups > 0) != 0); + if (__pyx_t_11) { + + /* "pandas/src/reduce.pyx":219 + * + * if self.ngroups > 0: + * counts[0] = self.bins[0] # <<<<<<<<<<<<<< + * for i in range(1, self.ngroups): + * if i == self.ngroups - 1: + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->bins, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = 0; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_t_12; + + /* "pandas/src/reduce.pyx":220 + * if self.ngroups > 0: + * counts[0] = self.bins[0] + * for i in range(1, self.ngroups): # <<<<<<<<<<<<<< + * if i == self.ngroups - 1: + * counts[i] = len(self.arr) - self.bins[i-1] + */ + __pyx_t_14 = __pyx_v_self->ngroups; + for (__pyx_t_15 = 1; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/src/reduce.pyx":221 + * counts[0] = self.bins[0] + * for i in range(1, self.ngroups): + * if i == self.ngroups - 1: # <<<<<<<<<<<<<< + * counts[i] = len(self.arr) - self.bins[i-1] + * else: + */ + __pyx_t_11 = ((__pyx_v_i == (__pyx_v_self->ngroups - 1)) != 0); + if (__pyx_t_11) { + + /* "pandas/src/reduce.pyx":222 + * for i in range(1, self.ngroups): + * if i == self.ngroups - 1: + * counts[i] = len(self.arr) - self.bins[i-1] # <<<<<<<<<<<<<< + * else: + * counts[i] = self.bins[i] - self.bins[i-1] + */ + __pyx_t_5 = __pyx_v_self->arr; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_16 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = (__pyx_v_i - 1); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->bins, __pyx_t_16, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_t_12; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":224 + * counts[i] = len(self.arr) - self.bins[i-1] + * else: + * counts[i] = self.bins[i] - self.bins[i-1] # <<<<<<<<<<<<<< + * + * group_size = 0 + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->bins, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = (__pyx_v_i - 1); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->bins, __pyx_t_17, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_t_12; + } + __pyx_L6:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":226 + * counts[i] = self.bins[i] - self.bins[i-1] + * + * group_size = 0 # <<<<<<<<<<<<<< + * n = len(self.arr) + * name = self.name + */ + __pyx_v_group_size = 0; + + /* "pandas/src/reduce.pyx":227 + * + * group_size = 0 + * n = len(self.arr) # <<<<<<<<<<<<<< + * name = self.name + * + */ + __pyx_t_5 = __pyx_v_self->arr; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_14 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_n = __pyx_t_14; + + /* "pandas/src/reduce.pyx":228 + * group_size = 0 + * n = len(self.arr) + * name = self.name # <<<<<<<<<<<<<< + * + * vslider = Slider(self.arr, self.dummy_arr) + */ + __pyx_t_5 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_5); + __pyx_v_name = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":230 + * name = self.name + * + * vslider = Slider(self.arr, self.dummy_arr) # <<<<<<<<<<<<<< + * islider = Slider(self.index, self.dummy_index) + * + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self->arr); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->arr); + __Pyx_GIVEREF(__pyx_v_self->arr); + __Pyx_INCREF(__pyx_v_self->dummy_arr); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->dummy_arr); + __Pyx_GIVEREF(__pyx_v_self->dummy_arr); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_vslider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":231 + * + * vslider = Slider(self.arr, self.dummy_arr) + * islider = Slider(self.index, self.dummy_index) # <<<<<<<<<<<<<< + * + * gin = self.dummy_index._engine + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->index); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->index); + __Pyx_GIVEREF(__pyx_v_self->index); + __Pyx_INCREF(__pyx_v_self->dummy_index); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->dummy_index); + __Pyx_GIVEREF(__pyx_v_self->dummy_index); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_islider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":233 + * islider = Slider(self.index, self.dummy_index) + * + * gin = self.dummy_index._engine # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dummy_index, __pyx_n_s_engine); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_gin = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":235 + * gin = self.dummy_index._engine + * + * try: # <<<<<<<<<<<<<< + * for i in range(self.ngroups): + * group_size = counts[i] + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/reduce.pyx":236 + * + * try: + * for i in range(self.ngroups): # <<<<<<<<<<<<<< + * group_size = counts[i] + * + */ + __pyx_t_14 = __pyx_v_self->ngroups; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/src/reduce.pyx":237 + * try: + * for i in range(self.ngroups): + * group_size = counts[i] # <<<<<<<<<<<<<< + * + * islider.set_length(group_size) + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + } + __pyx_v_group_size = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides)); + + /* "pandas/src/reduce.pyx":239 + * group_size = counts[i] + * + * islider.set_length(group_size) # <<<<<<<<<<<<<< + * vslider.set_length(group_size) + * + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->set_length(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":240 + * + * islider.set_length(group_size) + * vslider.set_length(group_size) # <<<<<<<<<<<<<< + * + * if cached_typ is None: + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->set_length(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":242 + * vslider.set_length(group_size) + * + * if cached_typ is None: # <<<<<<<<<<<<<< + * cached_typ = self.typ(vslider.buf, index=islider.buf, + * name=name) + */ + __pyx_t_11 = (__pyx_v_cached_typ == Py_None); + __pyx_t_19 = (__pyx_t_11 != 0); + if (__pyx_t_19) { + + /* "pandas/src/reduce.pyx":243 + * + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, # <<<<<<<<<<<<<< + * name=name) + * else: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_vslider->buf)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_vslider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vslider->buf)); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, ((PyObject *)__pyx_v_islider->buf)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + + /* "pandas/src/reduce.pyx":244 + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, + * name=name) # <<<<<<<<<<<<<< + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + + /* "pandas/src/reduce.pyx":243 + * + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, # <<<<<<<<<<<<<< + * name=name) + * else: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_self->typ, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_cached_typ, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":246 + * name=name) + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, '_index', islider.buf) + * object.__setattr__(cached_typ, 'name', name) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cached_typ, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_block); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_values); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_values); + __Pyx_GIVEREF(__pyx_n_s_values); + __Pyx_INCREF(((PyObject *)__pyx_v_vslider->buf)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_vslider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vslider->buf)); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":247 + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + * object.__setattr__(cached_typ, '_index', islider.buf) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, 'name', name) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_index_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_index_2); + __Pyx_GIVEREF(__pyx_n_s_index_2); + __Pyx_INCREF(((PyObject *)__pyx_v_islider->buf)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_islider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_islider->buf)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":248 + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + * object.__setattr__(cached_typ, '_index', islider.buf) + * object.__setattr__(cached_typ, 'name', name) # <<<<<<<<<<<<<< + * + * res = self.f(cached_typ) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_name_2); + __Pyx_GIVEREF(__pyx_n_s_name_2); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L20:; + + /* "pandas/src/reduce.pyx":250 + * object.__setattr__(cached_typ, 'name', name) + * + * res = self.f(cached_typ) # <<<<<<<<<<<<<< + * res = _extract_result(res) + * if not initialized: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":251 + * + * res = self.f(cached_typ) + * res = _extract_result(res) # <<<<<<<<<<<<<< + * if not initialized: + * result = self._get_result_array(res) + */ + __pyx_t_1 = __pyx_f_6pandas_3lib__extract_result(__pyx_v_res); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":252 + * res = self.f(cached_typ) + * res = _extract_result(res) + * if not initialized: # <<<<<<<<<<<<<< + * result = self._get_result_array(res) + * initialized = 1 + */ + __pyx_t_19 = ((!(__pyx_v_initialized != 0)) != 0); + if (__pyx_t_19) { + + /* "pandas/src/reduce.pyx":253 + * res = _extract_result(res) + * if not initialized: + * result = self._get_result_array(res) # <<<<<<<<<<<<<< + * initialized = 1 + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_result_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":254 + * if not initialized: + * result = self._get_result_array(res) + * initialized = 1 # <<<<<<<<<<<<<< + * + * util.assign_value_1d(result, i, res) + */ + __pyx_v_initialized = 1; + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/src/reduce.pyx":256 + * initialized = 1 + * + * util.assign_value_1d(result, i, res) # <<<<<<<<<<<<<< + * + * islider.advance(group_size) + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L10_error;} } + __pyx_t_7 = assign_value_1d(__pyx_v_result, __pyx_v_i, __pyx_v_res); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + + /* "pandas/src/reduce.pyx":258 + * util.assign_value_1d(result, i, res) + * + * islider.advance(group_size) # <<<<<<<<<<<<<< + * vslider.advance(group_size) + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":259 + * + * islider.advance(group_size) + * vslider.advance(group_size) # <<<<<<<<<<<<<< + * + * gin.clear_mapping() + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":261 + * vslider.advance(group_size) + * + * gin.clear_mapping() # <<<<<<<<<<<<<< + * except: + * raise + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gin, __pyx_n_s_clear_mapping); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L17_try_end; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":262 + * + * gin.clear_mapping() + * except: # <<<<<<<<<<<<<< + * raise + * finally: + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/reduce.pyx":263 + * gin.clear_mapping() + * except: + * raise # <<<<<<<<<<<<<< + * finally: + * # so we don't free the wrong memory + */ + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_3, __pyx_t_1); + __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L11_exception_handled; + } + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L8_error; + __pyx_L11_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L17_try_end:; + } + } + + /* "pandas/src/reduce.pyx":266 + * finally: + * # so we don't free the wrong memory + * islider.reset() # <<<<<<<<<<<<<< + * vslider.reset() + * + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->reset(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":267 + * # so we don't free the wrong memory + * islider.reset() + * vslider.reset() # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->reset(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L9; + } + /*exception exit:*/{ + __pyx_L8_error:; + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __Pyx_XGOTREF(__pyx_t_24); + __pyx_t_7 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; + { + + /* "pandas/src/reduce.pyx":266 + * finally: + * # so we don't free the wrong memory + * islider.reset() # <<<<<<<<<<<<<< + * vslider.reset() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->reset(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L25_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":267 + * # so we don't free the wrong memory + * islider.reset() + * vslider.reset() # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->reset(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L25_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_24); + __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); + } + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; + goto __pyx_L1_error; + __pyx_L25_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_24); + __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; + goto __pyx_L1_error; + } + __pyx_L9:; + } + + /* "pandas/src/reduce.pyx":269 + * vslider.reset() + * + * if result.dtype == np.object_: # <<<<<<<<<<<<<< + * result = maybe_convert_objects(result) + * + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_19) { + + /* "pandas/src/reduce.pyx":270 + * + * if result.dtype == np.object_: + * result = maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * return result, counts + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L26; + } + __pyx_L26:; + + /* "pandas/src/reduce.pyx":272 + * result = maybe_convert_objects(result) + * + * return result, counts # <<<<<<<<<<<<<< + * + * def _get_result_array(self, object res): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_counts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_counts)); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":205 + * return values, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr, result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF((PyObject *)__pyx_v_vslider); + __Pyx_XDECREF((PyObject *)__pyx_v_islider); + __Pyx_XDECREF(__pyx_v_gin); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_cached_typ); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":274 + * return result, counts + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_result_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6_get_result_array(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_res)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_6_get_result_array(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_result_array", 0); + + /* "pandas/src/reduce.pyx":275 + * + * def _get_result_array(self, object res): + * try: # <<<<<<<<<<<<<< + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/reduce.pyx":276 + * def _get_result_array(self, object res): + * try: + * assert(not isinstance(res, np.ndarray)) # <<<<<<<<<<<<<< + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_res, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + if (unlikely(!((!(__pyx_t_4 != 0)) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":277 + * try: + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) # <<<<<<<<<<<<<< + * + * result = np.empty(self.ngroups, dtype='O') + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyList_Check(__pyx_v_res); + if ((__pyx_t_4 != 0)) { + __pyx_t_5 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __pyx_v_self->dummy_arr; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = ((__pyx_t_5 == __pyx_t_7) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = (__pyx_t_4 != 0); + } + if (unlikely(!((!__pyx_t_9) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":279 + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + * + * result = np.empty(self.ngroups, dtype='O') # <<<<<<<<<<<<<< + * except Exception: + * raise ValueError('function does not reduce') + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->ngroups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":280 + * + * result = np.empty(self.ngroups, dtype='O') + * except Exception: # <<<<<<<<<<<<<< + * raise ValueError('function does not reduce') + * return result + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_6, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/src/reduce.pyx":281 + * result = np.empty(self.ngroups, dtype='O') + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/reduce.pyx":282 + * except Exception: + * raise ValueError('function does not reduce') + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":274 + * return result, counts + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":166 + * + * cdef public: + * object arr, index, dummy_arr, dummy_index, values, f, bins, typ, name # <<<<<<<<<<<<<< + * + * def __init__(self, object series, object f, object bins, object dummy): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->arr); + __pyx_r = __pyx_v_self->arr; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->index); + __pyx_r = __pyx_v_self->index; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy_arr); + __pyx_r = __pyx_v_self->dummy_arr; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy_index); + __pyx_r = __pyx_v_self->dummy_index; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->values); + __pyx_r = __pyx_v_self->values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->f); + __pyx_r = __pyx_v_self->f; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->bins); + __pyx_r = __pyx_v_self->bins; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->bins); + __Pyx_DECREF(__pyx_v_self->bins); + __pyx_v_self->bins = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->bins); + __Pyx_DECREF(__pyx_v_self->bins); + __pyx_v_self->bins = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->typ); + __pyx_r = __pyx_v_self->typ; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":297 + * object arr, index, dummy_arr, dummy_index, f, labels, values, typ, name + * + * def __init__(self, object series, object f, object labels, # <<<<<<<<<<<<<< + * Py_ssize_t ngroups, object dummy): + * n = len(series) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_series = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_ngroups; + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_series,&__pyx_n_s_f,&__pyx_n_s_labels,&__pyx_n_s_ngroups,&__pyx_n_s_dummy,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_series)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ngroups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_series = values[0]; + __pyx_v_f = values[1]; + __pyx_v_labels = values[2]; + __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_dummy = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.SeriesGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper___init__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), __pyx_v_series, __pyx_v_f, __pyx_v_labels, __pyx_v_ngroups, __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper___init__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_series, PyObject *__pyx_v_f, PyObject *__pyx_v_labels, Py_ssize_t __pyx_v_ngroups, PyObject *__pyx_v_dummy) { + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_values = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/reduce.pyx":299 + * def __init__(self, object series, object f, object labels, + * Py_ssize_t ngroups, object dummy): + * n = len(series) # <<<<<<<<<<<<<< + * + * self.labels = labels + */ + __pyx_t_1 = PyObject_Length(__pyx_v_series); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/reduce.pyx":301 + * n = len(series) + * + * self.labels = labels # <<<<<<<<<<<<<< + * self.f = f + * + */ + __Pyx_INCREF(__pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = __pyx_v_labels; + + /* "pandas/src/reduce.pyx":302 + * + * self.labels = labels + * self.f = f # <<<<<<<<<<<<<< + * + * values = series.values + */ + __Pyx_INCREF(__pyx_v_f); + __Pyx_GIVEREF(__pyx_v_f); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_f; + + /* "pandas/src/reduce.pyx":304 + * self.f = f + * + * values = series.values # <<<<<<<<<<<<<< + * if not values.flags.c_contiguous: + * values = values.copy('C') + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_values = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":305 + * + * values = series.values + * if not values.flags.c_contiguous: # <<<<<<<<<<<<<< + * values = values.copy('C') + * self.arr = values + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "pandas/src/reduce.pyx":306 + * values = series.values + * if not values.flags.c_contiguous: + * values = values.copy('C') # <<<<<<<<<<<<<< + * self.arr = values + * self.index = series.index + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":307 + * if not values.flags.c_contiguous: + * values = values.copy('C') + * self.arr = values # <<<<<<<<<<<<<< + * self.index = series.index + * self.typ = type(series) + */ + __Pyx_INCREF(__pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_values; + + /* "pandas/src/reduce.pyx":308 + * values = values.copy('C') + * self.arr = values + * self.index = series.index # <<<<<<<<<<<<<< + * self.typ = type(series) + * self.name = getattr(series,'name',None) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":309 + * self.arr = values + * self.index = series.index + * self.typ = type(series) # <<<<<<<<<<<<<< + * self.name = getattr(series,'name',None) + * + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_series))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_series))); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = ((PyObject *)Py_TYPE(__pyx_v_series)); + + /* "pandas/src/reduce.pyx":310 + * self.index = series.index + * self.typ = type(series) + * self.name = getattr(series,'name',None) # <<<<<<<<<<<<<< + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_series, __pyx_n_s_name_2, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":312 + * self.name = getattr(series,'name',None) + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) # <<<<<<<<<<<<<< + * self.passed_dummy = dummy is not None + * self.ngroups = ngroups + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_dummy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_dummy); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy); + __Pyx_GIVEREF(__pyx_v_dummy); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":313 + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + * self.passed_dummy = dummy is not None # <<<<<<<<<<<<<< + * self.ngroups = ngroups + * + */ + __pyx_t_5 = (__pyx_v_dummy != Py_None); + __pyx_v_self->passed_dummy = __pyx_t_5; + + /* "pandas/src/reduce.pyx":314 + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + * self.passed_dummy = dummy is not None + * self.ngroups = ngroups # <<<<<<<<<<<<<< + * + * def _check_dummy(self, dummy=None): + */ + __pyx_v_self->ngroups = __pyx_v_ngroups; + + /* "pandas/src/reduce.pyx":297 + * object arr, index, dummy_arr, dummy_index, f, labels, values, typ, name + * + * def __init__(self, object series, object f, object labels, # <<<<<<<<<<<<<< + * Py_ssize_t ngroups, object dummy): + * n = len(series) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.SeriesGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":316 + * self.ngroups = ngroups + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_dummy (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dummy,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_dummy") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dummy = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.SeriesGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_2_check_dummy(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_2_check_dummy(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_dummy) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_dummy", 0); + + /* "pandas/src/reduce.pyx":317 + * + * def _check_dummy(self, dummy=None): + * if dummy is None: # <<<<<<<<<<<<<< + * values = np.empty(0, dtype=self.arr.dtype) + * index = None + */ + __pyx_t_1 = (__pyx_v_dummy == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":318 + * def _check_dummy(self, dummy=None): + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__34, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":319 + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + * index = None # <<<<<<<<<<<<<< + * else: + * values = dummy.values + */ + __Pyx_INCREF(Py_None); + __pyx_v_index = Py_None; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":321 + * index = None + * else: + * values = dummy.values # <<<<<<<<<<<<<< + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":322 + * else: + * values = dummy.values + * if dummy.dtype != self.arr.dtype: # <<<<<<<<<<<<<< + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":323 + * values = dummy.values + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":324 + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: # <<<<<<<<<<<<<< + * values = values.copy() + * index = dummy.index + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((!__pyx_t_2) != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":325 + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: + * values = values.copy() # <<<<<<<<<<<<<< + * index = dummy.index + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/reduce.pyx":326 + * if not values.flags.contiguous: + * values = values.copy() + * index = dummy.index # <<<<<<<<<<<<<< + * + * return values, index + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_index = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":328 + * index = dummy.index + * + * return values, index # <<<<<<<<<<<<<< + * + * def get_result(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":316 + * self.ngroups = ngroups + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.SeriesGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":330 + * return values, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr, result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_result (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_4get_result(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_4get_result(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_labels = 0; + PyArrayObject *__pyx_v_counts = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_group_size; + Py_ssize_t __pyx_v_lab; + PyObject *__pyx_v_res = 0; + int __pyx_v_initialized; + struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_vslider = 0; + struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_islider = 0; + PyObject *__pyx_v_gin = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_cached_typ = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + char const *__pyx_t_20; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_result", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + + /* "pandas/src/reduce.pyx":336 + * Py_ssize_t i, n, group_size, lab + * object res + * bint initialized = 0 # <<<<<<<<<<<<<< + * Slider vslider, islider + * object gin, typ, name + */ + __pyx_v_initialized = 0; + + /* "pandas/src/reduce.pyx":339 + * Slider vslider, islider + * object gin, typ, name + * object cached_typ = None # <<<<<<<<<<<<<< + * + * labels = self.labels + */ + __Pyx_INCREF(Py_None); + __pyx_v_cached_typ = Py_None; + + /* "pandas/src/reduce.pyx":341 + * object cached_typ = None + * + * labels = self.labels # <<<<<<<<<<<<<< + * counts = np.zeros(self.ngroups, dtype=np.int64) + * group_size = 0 + */ + if (!(likely(((__pyx_v_self->labels) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->labels, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_self->labels; + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_labels = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":342 + * + * labels = self.labels + * counts = np.zeros(self.ngroups, dtype=np.int64) # <<<<<<<<<<<<<< + * group_size = 0 + * n = len(self.arr) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->ngroups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":343 + * labels = self.labels + * counts = np.zeros(self.ngroups, dtype=np.int64) + * group_size = 0 # <<<<<<<<<<<<<< + * n = len(self.arr) + * name = self.name + */ + __pyx_v_group_size = 0; + + /* "pandas/src/reduce.pyx":344 + * counts = np.zeros(self.ngroups, dtype=np.int64) + * group_size = 0 + * n = len(self.arr) # <<<<<<<<<<<<<< + * name = self.name + * + */ + __pyx_t_9 = __pyx_v_self->arr; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_11 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_n = __pyx_t_11; + + /* "pandas/src/reduce.pyx":345 + * group_size = 0 + * n = len(self.arr) + * name = self.name # <<<<<<<<<<<<<< + * + * vslider = Slider(self.arr, self.dummy_arr) + */ + __pyx_t_9 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_9); + __pyx_v_name = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":347 + * name = self.name + * + * vslider = Slider(self.arr, self.dummy_arr) # <<<<<<<<<<<<<< + * islider = Slider(self.index, self.dummy_index) + * + */ + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_self->arr); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_self->arr); + __Pyx_GIVEREF(__pyx_v_self->arr); + __Pyx_INCREF(__pyx_v_self->dummy_arr); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_self->dummy_arr); + __Pyx_GIVEREF(__pyx_v_self->dummy_arr); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_vslider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":348 + * + * vslider = Slider(self.arr, self.dummy_arr) + * islider = Slider(self.index, self.dummy_index) # <<<<<<<<<<<<<< + * + * gin = self.dummy_index._engine + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->index); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->index); + __Pyx_GIVEREF(__pyx_v_self->index); + __Pyx_INCREF(__pyx_v_self->dummy_index); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->dummy_index); + __Pyx_GIVEREF(__pyx_v_self->dummy_index); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_islider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":350 + * islider = Slider(self.index, self.dummy_index) + * + * gin = self.dummy_index._engine # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dummy_index, __pyx_n_s_engine); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_gin = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":352 + * gin = self.dummy_index._engine + * + * try: # <<<<<<<<<<<<<< + * for i in range(n): + * group_size += 1 + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "pandas/src/reduce.pyx":353 + * + * try: + * for i in range(n): # <<<<<<<<<<<<<< + * group_size += 1 + * + */ + __pyx_t_11 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/reduce.pyx":354 + * try: + * for i in range(n): + * group_size += 1 # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_v_group_size = (__pyx_v_group_size + 1); + + /* "pandas/src/reduce.pyx":356 + * group_size += 1 + * + * lab = labels[i] # <<<<<<<<<<<<<< + * + * if i == n - 1 or lab != labels[i + 1]: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_2 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/reduce.pyx":358 + * lab = labels[i] + * + * if i == n - 1 or lab != labels[i + 1]: # <<<<<<<<<<<<<< + * if lab == -1: + * islider.advance(group_size) + */ + __pyx_t_14 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0); + if (!__pyx_t_14) { + __pyx_t_15 = (__pyx_v_i + 1); + __pyx_t_2 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_16 = ((__pyx_v_lab != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (__pyx_t_17) { + + /* "pandas/src/reduce.pyx":359 + * + * if i == n - 1 or lab != labels[i + 1]: + * if lab == -1: # <<<<<<<<<<<<<< + * islider.advance(group_size) + * vslider.advance(group_size) + */ + __pyx_t_17 = ((__pyx_v_lab == -1) != 0); + if (__pyx_t_17) { + + /* "pandas/src/reduce.pyx":360 + * if i == n - 1 or lab != labels[i + 1]: + * if lab == -1: + * islider.advance(group_size) # <<<<<<<<<<<<<< + * vslider.advance(group_size) + * group_size = 0 + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":361 + * if lab == -1: + * islider.advance(group_size) + * vslider.advance(group_size) # <<<<<<<<<<<<<< + * group_size = 0 + * continue + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":362 + * islider.advance(group_size) + * vslider.advance(group_size) + * group_size = 0 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_group_size = 0; + + /* "pandas/src/reduce.pyx":363 + * vslider.advance(group_size) + * group_size = 0 + * continue # <<<<<<<<<<<<<< + * + * islider.set_length(group_size) + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/reduce.pyx":365 + * continue + * + * islider.set_length(group_size) # <<<<<<<<<<<<<< + * vslider.set_length(group_size) + * + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->set_length(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":366 + * + * islider.set_length(group_size) + * vslider.set_length(group_size) # <<<<<<<<<<<<<< + * + * if cached_typ is None: + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->set_length(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":368 + * vslider.set_length(group_size) + * + * if cached_typ is None: # <<<<<<<<<<<<<< + * cached_typ = self.typ(vslider.buf, index=islider.buf, + * name=name) + */ + __pyx_t_17 = (__pyx_v_cached_typ == Py_None); + __pyx_t_14 = (__pyx_t_17 != 0); + if (__pyx_t_14) { + + /* "pandas/src/reduce.pyx":369 + * + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, # <<<<<<<<<<<<<< + * name=name) + * else: + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_vslider->buf)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_vslider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vslider->buf)); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, ((PyObject *)__pyx_v_islider->buf)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + + /* "pandas/src/reduce.pyx":370 + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, + * name=name) # <<<<<<<<<<<<<< + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + + /* "pandas/src/reduce.pyx":369 + * + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, # <<<<<<<<<<<<<< + * name=name) + * else: + */ + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_self->typ, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_cached_typ, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":372 + * name=name) + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, '_index', islider.buf) + * object.__setattr__(cached_typ, 'name', name) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cached_typ, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_block); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_s_values); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_values); + __Pyx_GIVEREF(__pyx_n_s_values); + __Pyx_INCREF(((PyObject *)__pyx_v_vslider->buf)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_vslider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vslider->buf)); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":373 + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + * object.__setattr__(cached_typ, '_index', islider.buf) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, 'name', name) + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_index_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_index_2); + __Pyx_GIVEREF(__pyx_n_s_index_2); + __Pyx_INCREF(((PyObject *)__pyx_v_islider->buf)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_islider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_islider->buf)); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/reduce.pyx":374 + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + * object.__setattr__(cached_typ, '_index', islider.buf) + * object.__setattr__(cached_typ, 'name', name) # <<<<<<<<<<<<<< + * + * res = self.f(cached_typ) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_name_2); + __Pyx_GIVEREF(__pyx_n_s_name_2); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_L18:; + + /* "pandas/src/reduce.pyx":376 + * object.__setattr__(cached_typ, 'name', name) + * + * res = self.f(cached_typ) # <<<<<<<<<<<<<< + * res = _extract_result(res) + * if not initialized: + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->f, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":377 + * + * res = self.f(cached_typ) + * res = _extract_result(res) # <<<<<<<<<<<<<< + * if not initialized: + * result = self._get_result_array(res) + */ + __pyx_t_1 = __pyx_f_6pandas_3lib__extract_result(__pyx_v_res); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":378 + * res = self.f(cached_typ) + * res = _extract_result(res) + * if not initialized: # <<<<<<<<<<<<<< + * result = self._get_result_array(res) + * initialized = 1 + */ + __pyx_t_14 = ((!(__pyx_v_initialized != 0)) != 0); + if (__pyx_t_14) { + + /* "pandas/src/reduce.pyx":379 + * res = _extract_result(res) + * if not initialized: + * result = self._get_result_array(res) # <<<<<<<<<<<<<< + * initialized = 1 + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_result_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_7)); + __pyx_t_7 = 0; + + /* "pandas/src/reduce.pyx":380 + * if not initialized: + * result = self._get_result_array(res) + * initialized = 1 # <<<<<<<<<<<<<< + * + * util.assign_value_1d(result, lab, res) + */ + __pyx_v_initialized = 1; + goto __pyx_L19; + } + __pyx_L19:; + + /* "pandas/src/reduce.pyx":382 + * initialized = 1 + * + * util.assign_value_1d(result, lab, res) # <<<<<<<<<<<<<< + * counts[lab] = group_size + * islider.advance(group_size) + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } + __pyx_t_2 = assign_value_1d(__pyx_v_result, __pyx_v_lab, __pyx_v_res); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + + /* "pandas/src/reduce.pyx":383 + * + * util.assign_value_1d(result, lab, res) + * counts[lab] = group_size # <<<<<<<<<<<<<< + * islider.advance(group_size) + * vslider.advance(group_size) + */ + __pyx_t_18 = __pyx_v_lab; + __pyx_t_2 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_group_size; + + /* "pandas/src/reduce.pyx":384 + * util.assign_value_1d(result, lab, res) + * counts[lab] = group_size + * islider.advance(group_size) # <<<<<<<<<<<<<< + * vslider.advance(group_size) + * + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/reduce.pyx":385 + * counts[lab] = group_size + * islider.advance(group_size) + * vslider.advance(group_size) # <<<<<<<<<<<<<< + * + * group_size = 0 + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/reduce.pyx":387 + * vslider.advance(group_size) + * + * group_size = 0 # <<<<<<<<<<<<<< + * + * gin.clear_mapping() + */ + __pyx_v_group_size = 0; + + /* "pandas/src/reduce.pyx":389 + * group_size = 0 + * + * gin.clear_mapping() # <<<<<<<<<<<<<< + * + * except: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gin, __pyx_n_s_clear_mapping); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L14_continue:; + } + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":391 + * gin.clear_mapping() + * + * except: # <<<<<<<<<<<<<< + * raise + * finally: + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.lib.SeriesGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_7, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/reduce.pyx":392 + * + * except: + * raise # <<<<<<<<<<<<<< + * finally: + * # so we don't free the wrong memory + */ + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_7, __pyx_t_1); + __pyx_t_9 = 0; __pyx_t_7 = 0; __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L7_exception_handled; + } + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L4_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L13_try_end:; + } + } + + /* "pandas/src/reduce.pyx":395 + * finally: + * # so we don't free the wrong memory + * islider.reset() # <<<<<<<<<<<<<< + * vslider.reset() + * + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->reset(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":396 + * # so we don't free the wrong memory + * islider.reset() + * vslider.reset() # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->reset(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5; + } + /*exception exit:*/{ + __pyx_L4_error:; + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __pyx_t_2 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; + { + + /* "pandas/src/reduce.pyx":395 + * finally: + * # so we don't free the wrong memory + * islider.reset() # <<<<<<<<<<<<<< + * vslider.reset() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->reset(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L23_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":396 + * # so we don't free the wrong memory + * islider.reset() + * vslider.reset() # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->reset(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L23_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_3); + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; + goto __pyx_L1_error; + __pyx_L23_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "pandas/src/reduce.pyx":398 + * vslider.reset() + * + * if result.dtype == np.object_: # <<<<<<<<<<<<<< + * result = maybe_convert_objects(result) + * + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_object_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_14) { + + /* "pandas/src/reduce.pyx":399 + * + * if result.dtype == np.object_: + * result = maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * return result, counts + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L24; + } + __pyx_L24:; + + /* "pandas/src/reduce.pyx":401 + * result = maybe_convert_objects(result) + * + * return result, counts # <<<<<<<<<<<<<< + * + * def _get_result_array(self, object res): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_counts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_counts)); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":330 + * return values, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr, result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.SeriesGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF((PyObject *)__pyx_v_vslider); + __Pyx_XDECREF((PyObject *)__pyx_v_islider); + __Pyx_XDECREF(__pyx_v_gin); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_cached_typ); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":403 + * return result, counts + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_result_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6_get_result_array(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_res)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6_get_result_array(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_result_array", 0); + + /* "pandas/src/reduce.pyx":404 + * + * def _get_result_array(self, object res): + * try: # <<<<<<<<<<<<<< + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/reduce.pyx":405 + * def _get_result_array(self, object res): + * try: + * assert(not isinstance(res, np.ndarray)) # <<<<<<<<<<<<<< + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_res, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + if (unlikely(!((!(__pyx_t_4 != 0)) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":406 + * try: + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) # <<<<<<<<<<<<<< + * + * result = np.empty(self.ngroups, dtype='O') + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyList_Check(__pyx_v_res); + if ((__pyx_t_4 != 0)) { + __pyx_t_5 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __pyx_v_self->dummy_arr; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = ((__pyx_t_5 == __pyx_t_7) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = (__pyx_t_4 != 0); + } + if (unlikely(!((!__pyx_t_9) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":408 + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + * + * result = np.empty(self.ngroups, dtype='O') # <<<<<<<<<<<<<< + * except Exception: + * raise ValueError('function does not reduce') + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->ngroups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":409 + * + * result = np.empty(self.ngroups, dtype='O') + * except Exception: # <<<<<<<<<<<<<< + * raise ValueError('function does not reduce') + * return result + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("pandas.lib.SeriesGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_6, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/src/reduce.pyx":410 + * result = np.empty(self.ngroups, dtype='O') + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/reduce.pyx":411 + * except Exception: + * raise ValueError('function does not reduce') + * return result # <<<<<<<<<<<<<< + * + * cdef inline _extract_result(object res): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":403 + * return result, counts + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("pandas.lib.SeriesGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":295 + * + * cdef public: + * object arr, index, dummy_arr, dummy_index, f, labels, values, typ, name # <<<<<<<<<<<<<< + * + * def __init__(self, object series, object f, object labels, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->arr); + __pyx_r = __pyx_v_self->arr; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_5index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_5index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->index); + __pyx_r = __pyx_v_self->index; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy_arr); + __pyx_r = __pyx_v_self->dummy_arr; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy_index); + __pyx_r = __pyx_v_self->dummy_index; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_1f_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_1f_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->f); + __pyx_r = __pyx_v_self->f; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->labels); + __pyx_r = __pyx_v_self->labels; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_6values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_6values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6values___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6values___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->values); + __pyx_r = __pyx_v_self->values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3typ___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->typ); + __pyx_r = __pyx_v_self->typ; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_4name_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_4name___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_4name___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":413 + * return result + * + * cdef inline _extract_result(object res): # <<<<<<<<<<<<<< + * ''' extract the result object, it might be a 0-dim ndarray + * or a len-1 0-dim, or a scalar ''' + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__extract_result(PyObject *__pyx_v_res) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_extract_result", 0); + __Pyx_INCREF(__pyx_v_res); + + /* "pandas/src/reduce.pyx":416 + * ''' extract the result object, it might be a 0-dim ndarray + * or a len-1 0-dim, or a scalar ''' + * if hasattr(res,'values'): # <<<<<<<<<<<<<< + * res = res.values + * if not np.isscalar(res): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_res, __pyx_n_s_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":417 + * or a len-1 0-dim, or a scalar ''' + * if hasattr(res,'values'): + * res = res.values # <<<<<<<<<<<<<< + * if not np.isscalar(res): + * if isinstance(res, np.ndarray): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":418 + * if hasattr(res,'values'): + * res = res.values + * if not np.isscalar(res): # <<<<<<<<<<<<<< + * if isinstance(res, np.ndarray): + * if res.ndim == 0: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = ((!__pyx_t_2) != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":419 + * res = res.values + * if not np.isscalar(res): + * if isinstance(res, np.ndarray): # <<<<<<<<<<<<<< + * if res.ndim == 0: + * res = res.item() + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_res, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":420 + * if not np.isscalar(res): + * if isinstance(res, np.ndarray): + * if res.ndim == 0: # <<<<<<<<<<<<<< + * res = res.item() + * elif res.ndim == 1 and len(res) == 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":421 + * if isinstance(res, np.ndarray): + * if res.ndim == 0: + * res = res.item() # <<<<<<<<<<<<<< + * elif res.ndim == 1 and len(res) == 1: + * res = res[0] + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_item); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L6; + } + + /* "pandas/src/reduce.pyx":422 + * if res.ndim == 0: + * res = res.item() + * elif res.ndim == 1 and len(res) == 1: # <<<<<<<<<<<<<< + * res = res[0] + * return res + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_6 == 1); + __pyx_t_7 = __pyx_t_1; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/reduce.pyx":423 + * res = res.item() + * elif res.ndim == 1 and len(res) == 1: + * res = res[0] # <<<<<<<<<<<<<< + * return res + * + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/reduce.pyx":424 + * elif res.ndim == 1 and len(res) == 1: + * res = res[0] + * return res # <<<<<<<<<<<<<< + * + * cdef class Slider: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":413 + * return result + * + * cdef inline _extract_result(object res): # <<<<<<<<<<<<<< + * ''' extract the result object, it might be a 0-dim ndarray + * or a len-1 0-dim, or a scalar ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib._extract_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":435 + * char *orig_data + * + * def __init__(self, object values, object buf): # <<<<<<<<<<<<<< + * assert(values.ndim == 1) + * if not values.flags.contiguous: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_6Slider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_6Slider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_values = 0; + PyObject *__pyx_v_buf = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_buf,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = values[0]; + __pyx_v_buf = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Slider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_6Slider___init__(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), __pyx_v_values, __pyx_v_buf); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_6Slider___init__(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, PyObject *__pyx_v_values, PyObject *__pyx_v_buf) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_values); + + /* "pandas/src/reduce.pyx":436 + * + * def __init__(self, object values, object buf): + * assert(values.ndim == 1) # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":437 + * def __init__(self, object values, object buf): + * assert(values.ndim == 1) + * if not values.flags.contiguous: # <<<<<<<<<<<<<< + * values = values.copy() + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/src/reduce.pyx":438 + * assert(values.ndim == 1) + * if not values.flags.contiguous: + * values = values.copy() # <<<<<<<<<<<<<< + * + * assert(values.dtype == buf.dtype) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":440 + * values = values.copy() + * + * assert(values.dtype == buf.dtype) # <<<<<<<<<<<<<< + * self.values = values + * self.buf = buf + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":441 + * + * assert(values.dtype == buf.dtype) + * self.values = values # <<<<<<<<<<<<<< + * self.buf = buf + * self.stride = values.strides[0] + */ + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_v_values; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(((PyObject *)__pyx_v_self->values)); + __pyx_v_self->values = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":442 + * assert(values.dtype == buf.dtype) + * self.values = values + * self.buf = buf # <<<<<<<<<<<<<< + * self.stride = values.strides[0] + * + */ + if (!(likely(((__pyx_v_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_buf, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_v_buf; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->buf); + __Pyx_DECREF(((PyObject *)__pyx_v_self->buf)); + __pyx_v_self->buf = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":443 + * self.values = values + * self.buf = buf + * self.stride = values.strides[0] # <<<<<<<<<<<<<< + * + * self.orig_data = self.buf.data + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->stride = __pyx_t_6; + + /* "pandas/src/reduce.pyx":445 + * self.stride = values.strides[0] + * + * self.orig_data = self.buf.data # <<<<<<<<<<<<<< + * self.orig_len = self.buf.shape[0] + * self.orig_stride = self.buf.strides[0] + */ + __pyx_t_7 = __pyx_v_self->buf->data; + __pyx_v_self->orig_data = __pyx_t_7; + + /* "pandas/src/reduce.pyx":446 + * + * self.orig_data = self.buf.data + * self.orig_len = self.buf.shape[0] # <<<<<<<<<<<<<< + * self.orig_stride = self.buf.strides[0] + * + */ + __pyx_v_self->orig_len = (__pyx_v_self->buf->dimensions[0]); + + /* "pandas/src/reduce.pyx":447 + * self.orig_data = self.buf.data + * self.orig_len = self.buf.shape[0] + * self.orig_stride = self.buf.strides[0] # <<<<<<<<<<<<<< + * + * self.buf.data = self.values.data + */ + __pyx_v_self->orig_stride = (__pyx_v_self->buf->strides[0]); + + /* "pandas/src/reduce.pyx":449 + * self.orig_stride = self.buf.strides[0] + * + * self.buf.data = self.values.data # <<<<<<<<<<<<<< + * self.buf.strides[0] = self.stride + * + */ + __pyx_t_7 = __pyx_v_self->values->data; + __pyx_v_self->buf->data = __pyx_t_7; + + /* "pandas/src/reduce.pyx":450 + * + * self.buf.data = self.values.data + * self.buf.strides[0] = self.stride # <<<<<<<<<<<<<< + * + * cpdef advance(self, Py_ssize_t k): + */ + __pyx_t_6 = __pyx_v_self->stride; + (__pyx_v_self->buf->strides[0]) = __pyx_t_6; + + /* "pandas/src/reduce.pyx":435 + * char *orig_data + * + * def __init__(self, object values, object buf): # <<<<<<<<<<<<<< + * assert(values.ndim == 1) + * if not values.flags.contiguous: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.Slider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":452 + * self.buf.strides[0] = self.stride + * + * cpdef advance(self, Py_ssize_t k): # <<<<<<<<<<<<<< + * self.buf.data = self.buf.data + self.stride * k + * + */ + +static PyObject *__pyx_pw_6pandas_3lib_6Slider_3advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_6Slider_advance(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_k, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("advance", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_3advance)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/reduce.pyx":453 + * + * cpdef advance(self, Py_ssize_t k): + * self.buf.data = self.buf.data + self.stride * k # <<<<<<<<<<<<<< + * + * cdef move(self, int start, int end): + */ + __pyx_v_self->buf->data = (((char *)__pyx_v_self->buf->data) + (__pyx_v_self->stride * __pyx_v_k)); + + /* "pandas/src/reduce.pyx":452 + * self.buf.strides[0] = self.stride + * + * cpdef advance(self, Py_ssize_t k): # <<<<<<<<<<<<<< + * self.buf.data = self.buf.data + self.stride * k + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_3advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_3advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) { + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("advance (wrapper)", 0); + assert(__pyx_arg_k); { + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(__pyx_arg_k); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_6Slider_2advance(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), ((Py_ssize_t)__pyx_v_k)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_6Slider_2advance(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("advance", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->__pyx_vtab)->advance(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":455 + * self.buf.data = self.buf.data + self.stride * k + * + * cdef move(self, int start, int end): # <<<<<<<<<<<<<< + * ''' + * For slicing + */ + +static PyObject *__pyx_f_6pandas_3lib_6Slider_move(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, int __pyx_v_start, int __pyx_v_end) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("move", 0); + + /* "pandas/src/reduce.pyx":459 + * For slicing + * ''' + * self.buf.data = self.values.data + self.stride * start # <<<<<<<<<<<<<< + * self.buf.shape[0] = end - start + * + */ + __pyx_v_self->buf->data = (__pyx_v_self->values->data + (__pyx_v_self->stride * __pyx_v_start)); + + /* "pandas/src/reduce.pyx":460 + * ''' + * self.buf.data = self.values.data + self.stride * start + * self.buf.shape[0] = end - start # <<<<<<<<<<<<<< + * + * cpdef set_length(self, Py_ssize_t length): + */ + (__pyx_v_self->buf->dimensions[0]) = (__pyx_v_end - __pyx_v_start); + + /* "pandas/src/reduce.pyx":455 + * self.buf.data = self.buf.data + self.stride * k + * + * cdef move(self, int start, int end): # <<<<<<<<<<<<<< + * ''' + * For slicing + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":462 + * self.buf.shape[0] = end - start + * + * cpdef set_length(self, Py_ssize_t length): # <<<<<<<<<<<<<< + * self.buf.shape[0] = length + * + */ + +static PyObject *__pyx_pw_6pandas_3lib_6Slider_5set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_6Slider_set_length(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_length, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_length", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_5set_length)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/reduce.pyx":463 + * + * cpdef set_length(self, Py_ssize_t length): + * self.buf.shape[0] = length # <<<<<<<<<<<<<< + * + * cpdef reset(self): + */ + (__pyx_v_self->buf->dimensions[0]) = __pyx_v_length; + + /* "pandas/src/reduce.pyx":462 + * self.buf.shape[0] = end - start + * + * cpdef set_length(self, Py_ssize_t length): # <<<<<<<<<<<<<< + * self.buf.shape[0] = length + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_5set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_5set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length) { + Py_ssize_t __pyx_v_length; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_length (wrapper)", 0); + assert(__pyx_arg_length); { + __pyx_v_length = __Pyx_PyIndex_AsSsize_t(__pyx_arg_length); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_6Slider_4set_length(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), ((Py_ssize_t)__pyx_v_length)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_6Slider_4set_length(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_length) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_length", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->__pyx_vtab)->set_length(__pyx_v_self, __pyx_v_length, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":465 + * self.buf.shape[0] = length + * + * cpdef reset(self): # <<<<<<<<<<<<<< + * self.buf.shape[0] = self.orig_len + * self.buf.data = self.orig_data + */ + +static PyObject *__pyx_pw_6pandas_3lib_6Slider_7reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_6Slider_reset(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + char *__pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reset", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_7reset)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/reduce.pyx":466 + * + * cpdef reset(self): + * self.buf.shape[0] = self.orig_len # <<<<<<<<<<<<<< + * self.buf.data = self.orig_data + * self.buf.strides[0] = self.orig_stride + */ + __pyx_t_3 = __pyx_v_self->orig_len; + (__pyx_v_self->buf->dimensions[0]) = __pyx_t_3; + + /* "pandas/src/reduce.pyx":467 + * cpdef reset(self): + * self.buf.shape[0] = self.orig_len + * self.buf.data = self.orig_data # <<<<<<<<<<<<<< + * self.buf.strides[0] = self.orig_stride + * + */ + __pyx_t_4 = __pyx_v_self->orig_data; + __pyx_v_self->buf->data = __pyx_t_4; + + /* "pandas/src/reduce.pyx":468 + * self.buf.shape[0] = self.orig_len + * self.buf.data = self.orig_data + * self.buf.strides[0] = self.orig_stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_v_self->orig_stride; + (__pyx_v_self->buf->strides[0]) = __pyx_t_3; + + /* "pandas/src/reduce.pyx":465 + * self.buf.shape[0] = length + * + * cpdef reset(self): # <<<<<<<<<<<<<< + * self.buf.shape[0] = self.orig_len + * self.buf.data = self.orig_data + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.Slider.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_7reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_7reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_6Slider_6reset(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_6Slider_6reset(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reset", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->__pyx_vtab)->reset(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.Slider.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":474 + * pass + * + * def apply_frame_axis0(object frame, object f, object names, # <<<<<<<<<<<<<< + * ndarray[int64_t] starts, ndarray[int64_t] ends): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_118apply_frame_axis0(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_118apply_frame_axis0 = {__Pyx_NAMESTR("apply_frame_axis0"), (PyCFunction)__pyx_pw_6pandas_3lib_118apply_frame_axis0, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_118apply_frame_axis0(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_frame = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_names = 0; + PyArrayObject *__pyx_v_starts = 0; + PyArrayObject *__pyx_v_ends = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("apply_frame_axis0 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frame,&__pyx_n_s_f,&__pyx_n_s_names,&__pyx_n_s_starts,&__pyx_n_s_ends,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_names)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_starts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, 3); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ends)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, 4); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_frame_axis0") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_frame = values[0]; + __pyx_v_f = values[1]; + __pyx_v_names = values[2]; + __pyx_v_starts = ((PyArrayObject *)values[3]); + __pyx_v_ends = ((PyArrayObject *)values[4]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.apply_frame_axis0", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_starts), __pyx_ptype_5numpy_ndarray, 1, "starts", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ends), __pyx_ptype_5numpy_ndarray, 1, "ends", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_117apply_frame_axis0(__pyx_self, __pyx_v_frame, __pyx_v_f, __pyx_v_names, __pyx_v_starts, __pyx_v_ends); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_117apply_frame_axis0(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frame, PyObject *__pyx_v_f, PyObject *__pyx_v_names, PyArrayObject *__pyx_v_starts, PyArrayObject *__pyx_v_ends) { + struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_slider = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_results = 0; + PyObject *__pyx_v_piece = 0; + PyObject *__pyx_v_item_cache = 0; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_shape_before = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_mutated; + PyObject *__pyx_v_gin = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ends; + __Pyx_Buffer __pyx_pybuffer_ends; + __Pyx_LocalBuf_ND __pyx_pybuffernd_starts; + __Pyx_Buffer __pyx_pybuffer_starts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + long __pyx_t_5; + int __pyx_t_6; + long __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + int __pyx_t_19; + char const *__pyx_t_20; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("apply_frame_axis0", 0); + __pyx_pybuffer_starts.pybuffer.buf = NULL; + __pyx_pybuffer_starts.refcount = 0; + __pyx_pybuffernd_starts.data = NULL; + __pyx_pybuffernd_starts.rcbuffer = &__pyx_pybuffer_starts; + __pyx_pybuffer_ends.pybuffer.buf = NULL; + __pyx_pybuffer_ends.refcount = 0; + __pyx_pybuffernd_ends.data = NULL; + __pyx_pybuffernd_ends.rcbuffer = &__pyx_pybuffer_ends; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_starts.rcbuffer->pybuffer, (PyObject*)__pyx_v_starts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_starts.diminfo[0].strides = __pyx_pybuffernd_starts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_starts.diminfo[0].shape = __pyx_pybuffernd_starts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ends.rcbuffer->pybuffer, (PyObject*)__pyx_v_ends, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_ends.diminfo[0].strides = __pyx_pybuffernd_ends.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ends.diminfo[0].shape = __pyx_pybuffernd_ends.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/reduce.pyx":478 + * cdef: + * BlockSlider slider + * Py_ssize_t i, n = len(starts) # <<<<<<<<<<<<<< + * list results + * object piece + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_starts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/reduce.pyx":483 + * dict item_cache + * + * if frame.index._has_complex_internals: # <<<<<<<<<<<<<< + * raise InvalidApply('Cannot modify frame index internals') + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_has_complex_internals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/src/reduce.pyx":484 + * + * if frame.index._has_complex_internals: + * raise InvalidApply('Cannot modify frame index internals') # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidApply); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":487 + * + * + * results = [] # <<<<<<<<<<<<<< + * + * # Need to infer if our low-level mucking is going to cause a segfault + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_results = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":490 + * + * # Need to infer if our low-level mucking is going to cause a segfault + * if n > 0: # <<<<<<<<<<<<<< + * chunk = frame[starts[0]:ends[0]] + * shape_before = chunk.shape + */ + __pyx_t_4 = ((__pyx_v_n > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/src/reduce.pyx":491 + * # Need to infer if our low-level mucking is going to cause a segfault + * if n > 0: + * chunk = frame[starts[0]:ends[0]] # <<<<<<<<<<<<<< + * shape_before = chunk.shape + * try: + */ + __pyx_t_5 = 0; + __pyx_t_6 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_starts.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_starts.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_t_6 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_ends.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ends.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_frame, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_starts.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_starts.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ends.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_ends.diminfo[0].strides)), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_chunk = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":492 + * if n > 0: + * chunk = frame[starts[0]:ends[0]] + * shape_before = chunk.shape # <<<<<<<<<<<<<< + * try: + * result = f(chunk) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_shape_before = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":493 + * chunk = frame[starts[0]:ends[0]] + * shape_before = chunk.shape + * try: # <<<<<<<<<<<<<< + * result = f(chunk) + * if result is chunk: + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/src/reduce.pyx":494 + * shape_before = chunk.shape + * try: + * result = f(chunk) # <<<<<<<<<<<<<< + * if result is chunk: + * raise InvalidApply('Function unsafe for fast apply') + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":495 + * try: + * result = f(chunk) + * if result is chunk: # <<<<<<<<<<<<<< + * raise InvalidApply('Function unsafe for fast apply') + * except: + */ + __pyx_t_4 = (__pyx_v_result == __pyx_v_chunk); + __pyx_t_11 = (__pyx_t_4 != 0); + if (__pyx_t_11) { + + /* "pandas/src/reduce.pyx":496 + * result = f(chunk) + * if result is chunk: + * raise InvalidApply('Function unsafe for fast apply') # <<<<<<<<<<<<<< + * except: + * raise InvalidApply('Let this error raise above us') + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidApply); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + } + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":497 + * if result is chunk: + * raise InvalidApply('Function unsafe for fast apply') + * except: # <<<<<<<<<<<<<< + * raise InvalidApply('Let this error raise above us') + * + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.lib.apply_frame_axis0", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_12); + + /* "pandas/src/reduce.pyx":498 + * raise InvalidApply('Function unsafe for fast apply') + * except: + * raise InvalidApply('Let this error raise above us') # <<<<<<<<<<<<<< + * + * slider = BlockSlider(frame) + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidApply); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L12_try_end:; + } + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/reduce.pyx":500 + * raise InvalidApply('Let this error raise above us') + * + * slider = BlockSlider(frame) # <<<<<<<<<<<<<< + * + * mutated = False + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_frame); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_frame); + __Pyx_GIVEREF(__pyx_v_frame); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockSlider)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_slider = ((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":502 + * slider = BlockSlider(frame) + * + * mutated = False # <<<<<<<<<<<<<< + * item_cache = slider.dummy._item_cache + * gin = slider.dummy.index._engine # f7u12 + */ + __pyx_v_mutated = 0; + + /* "pandas/src/reduce.pyx":503 + * + * mutated = False + * item_cache = slider.dummy._item_cache # <<<<<<<<<<<<<< + * gin = slider.dummy.index._engine # f7u12 + * try: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_slider->dummy, __pyx_n_s_item_cache); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_item_cache = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":504 + * mutated = False + * item_cache = slider.dummy._item_cache + * gin = slider.dummy.index._engine # f7u12 # <<<<<<<<<<<<<< + * try: + * for i in range(n): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_slider->dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_engine); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_gin = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":505 + * item_cache = slider.dummy._item_cache + * gin = slider.dummy.index._engine # f7u12 + * try: # <<<<<<<<<<<<<< + * for i in range(n): + * slider.move(starts[i], ends[i]) + */ + /*try:*/ { + + /* "pandas/src/reduce.pyx":506 + * gin = slider.dummy.index._engine # f7u12 + * try: + * for i in range(n): # <<<<<<<<<<<<<< + * slider.move(starts[i], ends[i]) + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/src/reduce.pyx":507 + * try: + * for i in range(n): + * slider.move(starts[i], ends[i]) # <<<<<<<<<<<<<< + * + * item_cache.clear() # ugh + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_starts.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_starts.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_ends.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ends.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + __pyx_t_12 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *)__pyx_v_slider->__pyx_vtab)->move(__pyx_v_slider, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_starts.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_starts.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ends.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ends.diminfo[0].strides)), 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":509 + * slider.move(starts[i], ends[i]) + * + * item_cache.clear() # ugh # <<<<<<<<<<<<<< + * gin.clear_mapping() + * + */ + if (unlikely(__pyx_v_item_cache == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "clear"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + __pyx_t_18 = __Pyx_PyDict_Clear(__pyx_v_item_cache); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + + /* "pandas/src/reduce.pyx":510 + * + * item_cache.clear() # ugh + * gin.clear_mapping() # <<<<<<<<<<<<<< + * + * object.__setattr__(slider.dummy, 'name', names[i]) + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_gin, __pyx_n_s_clear_mapping); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":512 + * gin.clear_mapping() + * + * object.__setattr__(slider.dummy, 'name', names[i]) # <<<<<<<<<<<<<< + * piece = f(slider.dummy) + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L17_error;}; + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_slider->dummy); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_slider->dummy); + __Pyx_GIVEREF(__pyx_v_slider->dummy); + __Pyx_INCREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_name_2); + __Pyx_GIVEREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":513 + * + * object.__setattr__(slider.dummy, 'name', names[i]) + * piece = f(slider.dummy) # <<<<<<<<<<<<<< + * + * # I'm paying the price for index-sharing, ugh + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_slider->dummy); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_slider->dummy); + __Pyx_GIVEREF(__pyx_v_slider->dummy); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":516 + * + * # I'm paying the price for index-sharing, ugh + * try: # <<<<<<<<<<<<<< + * if piece.index is slider.dummy.index: + * piece = piece.copy() + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/reduce.pyx":517 + * # I'm paying the price for index-sharing, ugh + * try: + * if piece.index is slider.dummy.index: # <<<<<<<<<<<<<< + * piece = piece.copy() + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_piece, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L21_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_slider->dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L21_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = (__pyx_t_2 == __pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = (__pyx_t_11 != 0); + if (__pyx_t_4) { + + /* "pandas/src/reduce.pyx":518 + * try: + * if piece.index is slider.dummy.index: + * piece = piece.copy() # <<<<<<<<<<<<<< + * else: + * mutated = True + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_piece, __pyx_n_s_copy); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L21_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L21_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_piece, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L29; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":520 + * piece = piece.copy() + * else: + * mutated = True # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_v_mutated = 1; + } + __pyx_L29:; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L28_try_end; + __pyx_L21_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":521 + * else: + * mutated = True + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * results.append(piece) + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_6) { + PyErr_Restore(0,0,0); + goto __pyx_L22_exception_handled; + } + goto __pyx_L23_except_error; + __pyx_L23_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L17_error; + __pyx_L22_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L28_try_end:; + } + + /* "pandas/src/reduce.pyx":523 + * except AttributeError: + * pass + * results.append(piece) # <<<<<<<<<<<<<< + * finally: + * slider.reset() + */ + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_piece); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + } + + /* "pandas/src/reduce.pyx":525 + * results.append(piece) + * finally: + * slider.reset() # <<<<<<<<<<<<<< + * + * return results, mutated + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *)__pyx_v_slider->__pyx_vtab)->reset(__pyx_v_slider); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L18; + } + /*exception exit:*/{ + __pyx_L17_error:; + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __pyx_t_6 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; + { + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *)__pyx_v_slider->__pyx_vtab)->reset(__pyx_v_slider); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L31_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; + goto __pyx_L1_error; + __pyx_L31_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + goto __pyx_L1_error; + } + __pyx_L18:; + } + + /* "pandas/src/reduce.pyx":527 + * slider.reset() + * + * return results, mutated # <<<<<<<<<<<<<< + * + * cdef class BlockSlider: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_mutated); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_results); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_results); + __Pyx_GIVEREF(__pyx_v_results); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":474 + * pass + * + * def apply_frame_axis0(object frame, object f, object names, # <<<<<<<<<<<<<< + * ndarray[int64_t] starts, ndarray[int64_t] ends): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ends.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.apply_frame_axis0", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ends.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_slider); + __Pyx_XDECREF(__pyx_v_results); + __Pyx_XDECREF(__pyx_v_piece); + __Pyx_XDECREF(__pyx_v_item_cache); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_shape_before); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_gin); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":543 + * char **base_ptrs + * + * def __init__(self, frame): # <<<<<<<<<<<<<< + * self.frame = frame + * self.dummy = frame[:0] + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_frame = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frame,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_frame = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.BlockSlider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider___init__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), __pyx_v_frame); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider___init__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_frame) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_block = NULL; + PyObject *__pyx_v_b = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/reduce.pyx":544 + * + * def __init__(self, frame): + * self.frame = frame # <<<<<<<<<<<<<< + * self.dummy = frame[:0] + * + */ + __Pyx_INCREF(__pyx_v_frame); + __Pyx_GIVEREF(__pyx_v_frame); + __Pyx_GOTREF(__pyx_v_self->frame); + __Pyx_DECREF(__pyx_v_self->frame); + __pyx_v_self->frame = __pyx_v_frame; + + /* "pandas/src/reduce.pyx":545 + * def __init__(self, frame): + * self.frame = frame + * self.dummy = frame[:0] # <<<<<<<<<<<<<< + * + * self.blocks = [b.values for b in self.dummy._data.blocks] + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_frame, 0, 0, NULL, NULL, &__pyx_slice__40, 0, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->dummy); + __Pyx_DECREF(__pyx_v_self->dummy); + __pyx_v_self->dummy = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":547 + * self.dummy = frame[:0] + * + * self.blocks = [b.values for b in self.dummy._data.blocks] # <<<<<<<<<<<<<< + * + * for x in self.blocks: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dummy, __pyx_n_s_data_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_blocks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->blocks); + __Pyx_DECREF(__pyx_v_self->blocks); + __pyx_v_self->blocks = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":549 + * self.blocks = [b.values for b in self.dummy._data.blocks] + * + * for x in self.blocks: # <<<<<<<<<<<<<< + * util.set_array_not_contiguous(x) + * + */ + if (unlikely(__pyx_v_self->blocks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_self->blocks; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":550 + * + * for x in self.blocks: + * util.set_array_not_contiguous(x) # <<<<<<<<<<<<<< + * + * self.nblocks = len(self.blocks) + */ + if (!(likely(((__pyx_v_x) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + set_array_not_contiguous(((PyArrayObject *)__pyx_v_x)); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":552 + * util.set_array_not_contiguous(x) + * + * self.nblocks = len(self.blocks) # <<<<<<<<<<<<<< + * self.idx_slider = Slider(self.frame.index, self.dummy.index) + * + */ + __pyx_t_1 = __pyx_v_self->blocks; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->nblocks = __pyx_t_4; + + /* "pandas/src/reduce.pyx":553 + * + * self.nblocks = len(self.blocks) + * self.idx_slider = Slider(self.frame.index, self.dummy.index) # <<<<<<<<<<<<<< + * + * self.base_ptrs = malloc(sizeof(char*) * len(self.blocks)) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frame, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->idx_slider); + __Pyx_DECREF(((PyObject *)__pyx_v_self->idx_slider)); + __pyx_v_self->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":555 + * self.idx_slider = Slider(self.frame.index, self.dummy.index) + * + * self.base_ptrs = malloc(sizeof(char*) * len(self.blocks)) # <<<<<<<<<<<<<< + * for i, block in enumerate(self.blocks): + * self.base_ptrs[i] = ( block).data + */ + __pyx_t_2 = __pyx_v_self->blocks; + __Pyx_INCREF(__pyx_t_2); + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->base_ptrs = ((char **)malloc(((sizeof(char *)) * __pyx_t_4))); + + /* "pandas/src/reduce.pyx":556 + * + * self.base_ptrs = malloc(sizeof(char*) * len(self.blocks)) + * for i, block in enumerate(self.blocks): # <<<<<<<<<<<<<< + * self.base_ptrs[i] = ( block).data + * + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_2 = __pyx_int_0; + __pyx_t_3 = __pyx_v_self->blocks; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_block, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":557 + * self.base_ptrs = malloc(sizeof(char*) * len(self.blocks)) + * for i, block in enumerate(self.blocks): + * self.base_ptrs[i] = ( block).data # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_6 = ((PyArrayObject *)__pyx_v_block)->data; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (__pyx_v_self->base_ptrs[__pyx_t_7]) = __pyx_t_6; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":543 + * char **base_ptrs + * + * def __init__(self, frame): # <<<<<<<<<<<<<< + * self.frame = frame + * self.dummy = frame[:0] + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockSlider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_block); + __Pyx_XDECREF(__pyx_v_b); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":559 + * self.base_ptrs[i] = ( block).data + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.base_ptrs) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_3lib_11BlockSlider_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_3lib_11BlockSlider_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_3lib_11BlockSlider_2__dealloc__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_3lib_11BlockSlider_2__dealloc__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/src/reduce.pyx":560 + * + * def __dealloc__(self): + * free(self.base_ptrs) # <<<<<<<<<<<<<< + * + * cpdef move(self, int start, int end): + */ + free(__pyx_v_self->base_ptrs); + + /* "pandas/src/reduce.pyx":559 + * self.base_ptrs[i] = ( block).data + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.base_ptrs) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/src/reduce.pyx":562 + * free(self.base_ptrs) + * + * cpdef move(self, int start, int end): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr + */ + +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_11BlockSlider_move(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, int __pyx_v_start, int __pyx_v_end, int __pyx_skip_dispatch) { + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("move", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_move); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_3lib_11BlockSlider_5move)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/reduce.pyx":567 + * + * # move blocks + * for i in range(self.nblocks): # <<<<<<<<<<<<<< + * arr = self.blocks[i] + * + */ + __pyx_t_5 = __pyx_v_self->nblocks; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/reduce.pyx":568 + * # move blocks + * for i in range(self.nblocks): + * arr = self.blocks[i] # <<<<<<<<<<<<<< + * + * # axis=1 is the frame's axis=0 + */ + if (unlikely(__pyx_v_self->blocks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->blocks, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":571 + * + * # axis=1 is the frame's axis=0 + * arr.data = self.base_ptrs[i] + arr.strides[1] * start # <<<<<<<<<<<<<< + * arr.shape[1] = end - start + * + */ + __pyx_v_arr->data = ((__pyx_v_self->base_ptrs[__pyx_v_i]) + ((__pyx_v_arr->strides[1]) * __pyx_v_start)); + + /* "pandas/src/reduce.pyx":572 + * # axis=1 is the frame's axis=0 + * arr.data = self.base_ptrs[i] + arr.strides[1] * start + * arr.shape[1] = end - start # <<<<<<<<<<<<<< + * + * self.idx_slider.move(start, end) + */ + (__pyx_v_arr->dimensions[1]) = (__pyx_v_end - __pyx_v_start); + } + + /* "pandas/src/reduce.pyx":574 + * arr.shape[1] = end - start + * + * self.idx_slider.move(start, end) # <<<<<<<<<<<<<< + * + * cdef reset(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->idx_slider->__pyx_vtab)->move(__pyx_v_self->idx_slider, __pyx_v_start, __pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":562 + * free(self.base_ptrs) + * + * cpdef move(self, int start, int end): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.BlockSlider.move", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_start; + int __pyx_v_end; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("move (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_end,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("move", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "move") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_start = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_end = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("move", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.BlockSlider.move", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_4move(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), __pyx_v_start, __pyx_v_end); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_4move(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, int __pyx_v_start, int __pyx_v_end) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("move", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *)__pyx_v_self->__pyx_vtab)->move(__pyx_v_self, __pyx_v_start, __pyx_v_end, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockSlider.move", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":576 + * self.idx_slider.move(start, end) + * + * cdef reset(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr + */ + +static PyObject *__pyx_f_6pandas_3lib_11BlockSlider_reset(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reset", 0); + + /* "pandas/src/reduce.pyx":581 + * + * # move blocks + * for i in range(self.nblocks): # <<<<<<<<<<<<<< + * arr = self.blocks[i] + * + */ + __pyx_t_1 = __pyx_v_self->nblocks; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/reduce.pyx":582 + * # move blocks + * for i in range(self.nblocks): + * arr = self.blocks[i] # <<<<<<<<<<<<<< + * + * # axis=1 is the frame's axis=0 + */ + if (unlikely(__pyx_v_self->blocks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->blocks, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":585 + * + * # axis=1 is the frame's axis=0 + * arr.data = self.base_ptrs[i] # <<<<<<<<<<<<<< + * arr.shape[1] = 0 + * + */ + __pyx_v_arr->data = (__pyx_v_self->base_ptrs[__pyx_v_i]); + + /* "pandas/src/reduce.pyx":586 + * # axis=1 is the frame's axis=0 + * arr.data = self.base_ptrs[i] + * arr.shape[1] = 0 # <<<<<<<<<<<<<< + * + * self.idx_slider.reset() + */ + (__pyx_v_arr->dimensions[1]) = 0; + } + + /* "pandas/src/reduce.pyx":588 + * arr.shape[1] = 0 + * + * self.idx_slider.reset() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->idx_slider->__pyx_vtab)->reset(__pyx_v_self->idx_slider, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":576 + * self.idx_slider.move(start, end) + * + * cdef reset(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockSlider.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":535 + * + * cdef public: + * object frame, dummy # <<<<<<<<<<<<<< + * int nblocks + * Slider idx_slider + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5frame_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5frame_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5frame___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_5frame___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->frame); + __pyx_r = __pyx_v_self->frame; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5frame_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5frame_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5frame_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_5frame_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->frame); + __Pyx_DECREF(__pyx_v_self->frame); + __pyx_v_self->frame = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5frame_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5frame_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5frame_4__del__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_5frame_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->frame); + __Pyx_DECREF(__pyx_v_self->frame); + __pyx_v_self->frame = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5dummy_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5dummy_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5dummy___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_5dummy___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy); + __pyx_r = __pyx_v_self->dummy; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy); + __Pyx_DECREF(__pyx_v_self->dummy); + __pyx_v_self->dummy = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_4__del__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy); + __Pyx_DECREF(__pyx_v_self->dummy); + __pyx_v_self->dummy = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":536 + * cdef public: + * object frame, dummy + * int nblocks # <<<<<<<<<<<<<< + * Slider idx_slider + * list blocks + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_7nblocks___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_7nblocks___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nblocks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockSlider.nblocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_7nblocks_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_7nblocks_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->nblocks = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.BlockSlider.nblocks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":537 + * object frame, dummy + * int nblocks + * Slider idx_slider # <<<<<<<<<<<<<< + * list blocks + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->idx_slider)); + __pyx_r = ((PyObject *)__pyx_v_self->idx_slider); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_3lib_Slider))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->idx_slider); + __Pyx_DECREF(((PyObject *)__pyx_v_self->idx_slider)); + __pyx_v_self->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockSlider.idx_slider.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_4__del__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->idx_slider); + __Pyx_DECREF(((PyObject *)__pyx_v_self->idx_slider)); + __pyx_v_self->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":538 + * int nblocks + * Slider idx_slider + * list blocks # <<<<<<<<<<<<<< + * + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_6blocks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_6blocks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_6blocks___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_6blocks___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->blocks); + __pyx_r = __pyx_v_self->blocks; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->blocks); + __Pyx_DECREF(__pyx_v_self->blocks); + __pyx_v_self->blocks = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockSlider.blocks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_4__del__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->blocks); + __Pyx_DECREF(__pyx_v_self->blocks); + __pyx_v_self->blocks = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":591 + * + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): # <<<<<<<<<<<<<< + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_120reduce(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_120reduce = {__Pyx_NAMESTR("reduce"), (PyCFunction)__pyx_pw_6pandas_3lib_120reduce, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_120reduce(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_arr = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_dummy = 0; + PyObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reduce (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_f,&__pyx_n_s_axis,&__pyx_n_s_dummy,&__pyx_n_s_labels,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)__pyx_int_0); + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reduce", 0, 2, 5, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduce") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = values[0]; + __pyx_v_f = values[1]; + __pyx_v_axis = values[2]; + __pyx_v_dummy = values[3]; + __pyx_v_labels = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("reduce", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.reduce", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_119reduce(__pyx_self, __pyx_v_arr, __pyx_v_f, __pyx_v_axis, __pyx_v_dummy, __pyx_v_labels); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_119reduce(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_f, PyObject *__pyx_v_axis, PyObject *__pyx_v_dummy, PyObject *__pyx_v_labels) { + struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_reducer = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reduce", 0); + + /* "pandas/src/reduce.pyx":592 + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): + * if labels._has_complex_internals: # <<<<<<<<<<<<<< + * raise Exception('Cannot use shortcut') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_has_complex_internals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":593 + * def reduce(arr, f, axis=0, dummy=None, labels=None): + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') # <<<<<<<<<<<<<< + * + * reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels) + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":595 + * raise Exception('Cannot use shortcut') + * + * reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels) # <<<<<<<<<<<<<< + * return reducer.get_result() + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_INCREF(__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_f); + __Pyx_GIVEREF(__pyx_v_f); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_v_axis) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dummy, __pyx_v_dummy) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_labels, __pyx_v_labels) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Reducer)), __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_reducer = ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/reduce.pyx":596 + * + * reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels) + * return reducer.get_result() # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_reducer), __pyx_n_s_get_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":591 + * + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): # <<<<<<<<<<<<<< + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.reduce", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_reducer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":9 + * object func, name, allow_setting + * + * def __init__(self, func=None, allow_setting=False): # <<<<<<<<<<<<<< + * if func is not None: + * self.func = func + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_14cache_readonly_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_14cache_readonly_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_allow_setting = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_allow_setting,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allow_setting); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_allow_setting = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.cache_readonly.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly___init__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self), __pyx_v_func, __pyx_v_allow_setting); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_14cache_readonly___init__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_allow_setting) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/properties.pyx":10 + * + * def __init__(self, func=None, allow_setting=False): + * if func is not None: # <<<<<<<<<<<<<< + * self.func = func + * self.name = func.__name__ + */ + __pyx_t_1 = (__pyx_v_func != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/properties.pyx":11 + * def __init__(self, func=None, allow_setting=False): + * if func is not None: + * self.func = func # <<<<<<<<<<<<<< + * self.name = func.__name__ + * self.allow_setting = allow_setting + */ + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = __pyx_v_func; + + /* "pandas/src/properties.pyx":12 + * if func is not None: + * self.func = func + * self.name = func.__name__ # <<<<<<<<<<<<<< + * self.allow_setting = allow_setting + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/properties.pyx":13 + * self.func = func + * self.name = func.__name__ + * self.allow_setting = allow_setting # <<<<<<<<<<<<<< + * + * def __call__(self, func, doc=None): + */ + __Pyx_INCREF(__pyx_v_allow_setting); + __Pyx_GIVEREF(__pyx_v_allow_setting); + __Pyx_GOTREF(__pyx_v_self->allow_setting); + __Pyx_DECREF(__pyx_v_self->allow_setting); + __pyx_v_self->allow_setting = __pyx_v_allow_setting; + + /* "pandas/src/properties.pyx":9 + * object func, name, allow_setting + * + * def __init__(self, func=None, allow_setting=False): # <<<<<<<<<<<<<< + * if func is not None: + * self.func = func + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.cache_readonly.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":15 + * self.allow_setting = allow_setting + * + * def __call__(self, func, doc=None): # <<<<<<<<<<<<<< + * self.func = func + * self.name = func.__name__ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + CYTHON_UNUSED PyObject *__pyx_v_doc = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_doc,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_doc); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_doc = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.cache_readonly.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_2__call__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self), __pyx_v_func, __pyx_v_doc); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_2__call__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_func, CYTHON_UNUSED PyObject *__pyx_v_doc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "pandas/src/properties.pyx":16 + * + * def __call__(self, func, doc=None): + * self.func = func # <<<<<<<<<<<<<< + * self.name = func.__name__ + * return self + */ + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = __pyx_v_func; + + /* "pandas/src/properties.pyx":17 + * def __call__(self, func, doc=None): + * self.func = func + * self.name = func.__name__ # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/properties.pyx":18 + * self.func = func + * self.name = func.__name__ + * return self # <<<<<<<<<<<<<< + * + * def __get__(self, obj, typ): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/src/properties.pyx":15 + * self.allow_setting = allow_setting + * + * def __call__(self, func, doc=None): # <<<<<<<<<<<<<< + * self.func = func + * self.name = func.__name__ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.cache_readonly.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":20 + * return self + * + * def __get__(self, obj, typ): # <<<<<<<<<<<<<< + * # Get the cache or set a default one if needed + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_5__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_typ); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_5__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_typ) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_4__get__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_typ)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4__get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_typ) { + PyObject *__pyx_v_cache = NULL; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/src/properties.pyx":23 + * # Get the cache or set a default one if needed + * + * cache = getattr(obj, '_cache', None) # <<<<<<<<<<<<<< + * if cache is None: + * try: + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_s_cache, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cache = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/properties.pyx":24 + * + * cache = getattr(obj, '_cache', None) + * if cache is None: # <<<<<<<<<<<<<< + * try: + * cache = obj._cache = {} + */ + __pyx_t_2 = (__pyx_v_cache == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/properties.pyx":25 + * cache = getattr(obj, '_cache', None) + * if cache is None: + * try: # <<<<<<<<<<<<<< + * cache = obj._cache = {} + * except (AttributeError): + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/src/properties.pyx":26 + * if cache is None: + * try: + * cache = obj._cache = {} # <<<<<<<<<<<<<< + * except (AttributeError): + * return + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_cache, __pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_cache, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/properties.pyx":27 + * try: + * cache = obj._cache = {} + * except (AttributeError): # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.cache_readonly.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/src/properties.pyx":28 + * cache = obj._cache = {} + * except (AttributeError): + * return # <<<<<<<<<<<<<< + * + * if PyDict_Contains(cache, self.name): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/properties.pyx":30 + * return + * + * if PyDict_Contains(cache, self.name): # <<<<<<<<<<<<<< + * # not necessary to Py_INCREF + * val = PyDict_GetItem(cache, self.name) + */ + __pyx_t_9 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_7 = PyDict_Contains(__pyx_v_cache, __pyx_t_9); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/src/properties.pyx":32 + * if PyDict_Contains(cache, self.name): + * # not necessary to Py_INCREF + * val = PyDict_GetItem(cache, self.name) # <<<<<<<<<<<<<< + * else: + * val = self.func(obj) + */ + __pyx_t_9 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = PyDict_GetItem(__pyx_v_cache, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = ((PyObject *)__pyx_t_10); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_val = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/src/properties.pyx":34 + * val = PyDict_GetItem(cache, self.name) + * else: + * val = self.func(obj) # <<<<<<<<<<<<<< + * PyDict_SetItem(cache, self.name, val) + * return val + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_self->func, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_val = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/src/properties.pyx":35 + * else: + * val = self.func(obj) + * PyDict_SetItem(cache, self.name, val) # <<<<<<<<<<<<<< + * return val + * + */ + __pyx_t_8 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = PyDict_SetItem(__pyx_v_cache, __pyx_t_8, __pyx_v_val); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_L14:; + + /* "pandas/src/properties.pyx":36 + * val = self.func(obj) + * PyDict_SetItem(cache, self.name, val) + * return val # <<<<<<<<<<<<<< + * + * def __set__(self, obj, value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_val); + __pyx_r = __pyx_v_val; + goto __pyx_L0; + + /* "pandas/src/properties.pyx":20 + * return self + * + * def __get__(self, obj, typ): # <<<<<<<<<<<<<< + * # Get the cache or set a default one if needed + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.lib.cache_readonly.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cache); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":38 + * return val + * + * def __set__(self, obj, value): # <<<<<<<<<<<<<< + * + * if not self.allow_setting: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_14cache_readonly_7__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_14cache_readonly_7__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_6__set__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_14cache_readonly_6__set__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { + PyObject *__pyx_v_cache = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "pandas/src/properties.pyx":40 + * def __set__(self, obj, value): + * + * if not self.allow_setting: # <<<<<<<<<<<<<< + * raise Exception("cannot set values for [%s]" % self.name) + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->allow_setting); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "pandas/src/properties.pyx":41 + * + * if not self.allow_setting: + * raise Exception("cannot set values for [%s]" % self.name) # <<<<<<<<<<<<<< + * + * # Get the cache or set a default one if needed + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_cannot_set_values_for_s, __pyx_v_self->name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/properties.pyx":44 + * + * # Get the cache or set a default one if needed + * cache = getattr(obj, '_cache', None) # <<<<<<<<<<<<<< + * if cache is None: + * try: + */ + __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_s_cache, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_cache = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/properties.pyx":45 + * # Get the cache or set a default one if needed + * cache = getattr(obj, '_cache', None) + * if cache is None: # <<<<<<<<<<<<<< + * try: + * cache = obj._cache = {} + */ + __pyx_t_2 = (__pyx_v_cache == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/properties.pyx":46 + * cache = getattr(obj, '_cache', None) + * if cache is None: + * try: # <<<<<<<<<<<<<< + * cache = obj._cache = {} + * except (AttributeError): + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/src/properties.pyx":47 + * if cache is None: + * try: + * cache = obj._cache = {} # <<<<<<<<<<<<<< + * except (AttributeError): + * return + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_cache, __pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_cache, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/properties.pyx":48 + * try: + * cache = obj._cache = {} + * except (AttributeError): # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.lib.cache_readonly.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/src/properties.pyx":49 + * cache = obj._cache = {} + * except (AttributeError): + * return # <<<<<<<<<<<<<< + * + * PyDict_SetItem(cache, self.name, value) + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L8_except_return; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_exception_handled; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L8_except_return:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L0; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L12_try_end:; + } + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/properties.pyx":51 + * return + * + * PyDict_SetItem(cache, self.name, value) # <<<<<<<<<<<<<< + * + * cdef class AxisProperty(object): + */ + __pyx_t_9 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = PyDict_SetItem(__pyx_v_cache, __pyx_t_9, __pyx_v_value); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/properties.pyx":38 + * return val + * + * def __set__(self, obj, value): # <<<<<<<<<<<<<< + * + * if not self.allow_setting: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.lib.cache_readonly.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cache); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":7 + * + * cdef readonly: + * object func, name, allow_setting # <<<<<<<<<<<<<< + * + * def __init__(self, func=None, allow_setting=False): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_4func_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_4func_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_4func___get__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4func___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->func); + __pyx_r = __pyx_v_self->func; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_4name_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_13allow_setting_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_13allow_setting_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_13allow_setting___get__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_13allow_setting___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->allow_setting); + __pyx_r = __pyx_v_self->allow_setting; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":57 + * Py_ssize_t axis + * + * def __init__(self, axis=0): # <<<<<<<<<<<<<< + * self.axis = axis + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_12AxisProperty_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_12AxisProperty_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_axis = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_axis,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_axis = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.AxisProperty.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_12AxisProperty___init__(((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self), __pyx_v_axis); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_12AxisProperty___init__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_axis) { + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/properties.pyx":58 + * + * def __init__(self, axis=0): + * self.axis = axis # <<<<<<<<<<<<<< + * + * def __get__(self, obj, type): + */ + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_axis); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->axis = __pyx_t_1; + + /* "pandas/src/properties.pyx":57 + * Py_ssize_t axis + * + * def __init__(self, axis=0): # <<<<<<<<<<<<<< + * self.axis = axis + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.AxisProperty.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":60 + * self.axis = axis + * + * def __get__(self, obj, type): # <<<<<<<<<<<<<< + * cdef list axes = obj._data.axes + * return axes[self.axis] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_12AxisProperty_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_12AxisProperty_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_12AxisProperty_2__get__(((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_type)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_12AxisProperty_2__get__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_type) { + PyObject *__pyx_v_axes = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/src/properties.pyx":61 + * + * def __get__(self, obj, type): + * cdef list axes = obj._data.axes # <<<<<<<<<<<<<< + * return axes[self.axis] + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_axes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_axes = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/properties.pyx":62 + * def __get__(self, obj, type): + * cdef list axes = obj._data.axes + * return axes[self.axis] # <<<<<<<<<<<<<< + * + * def __set__(self, obj, value): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_axes == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_axes, __pyx_v_self->axis, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/properties.pyx":60 + * self.axis = axis + * + * def __get__(self, obj, type): # <<<<<<<<<<<<<< + * cdef list axes = obj._data.axes + * return axes[self.axis] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.AxisProperty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_axes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":64 + * return axes[self.axis] + * + * def __set__(self, obj, value): # <<<<<<<<<<<<<< + * obj._set_axis(self.axis, value) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_12AxisProperty_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_12AxisProperty_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_12AxisProperty_4__set__(((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_12AxisProperty_4__set__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "pandas/src/properties.pyx":65 + * + * def __set__(self, obj, value): + * obj._set_axis(self.axis, value) # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_set_axis); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->axis); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/properties.pyx":64 + * return axes[self.axis] + * + * def __set__(self, obj, value): # <<<<<<<<<<<<<< + * obj._set_axis(self.axis, value) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.AxisProperty.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":7 + * + * # core.common import for fast inference checks + * def is_float(object obj): # <<<<<<<<<<<<<< + * return util.is_float_object(obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_122is_float(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_122is_float = {__Pyx_NAMESTR("is_float"), (PyCFunction)__pyx_pw_6pandas_3lib_122is_float, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_122is_float(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_float (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_121is_float(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_121is_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_float", 0); + + /* "pandas/src/inference.pyx":8 + * # core.common import for fast inference checks + * def is_float(object obj): + * return util.is_float_object(obj) # <<<<<<<<<<<<<< + * + * def is_integer(object obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_float_object(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":7 + * + * # core.common import for fast inference checks + * def is_float(object obj): # <<<<<<<<<<<<<< + * return util.is_float_object(obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_float", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":10 + * return util.is_float_object(obj) + * + * def is_integer(object obj): # <<<<<<<<<<<<<< + * return util.is_integer_object(obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_124is_integer(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_124is_integer = {__Pyx_NAMESTR("is_integer"), (PyCFunction)__pyx_pw_6pandas_3lib_124is_integer, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_124is_integer(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_integer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_123is_integer(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_123is_integer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_integer", 0); + + /* "pandas/src/inference.pyx":11 + * + * def is_integer(object obj): + * return util.is_integer_object(obj) # <<<<<<<<<<<<<< + * + * def is_bool(object obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_integer_object(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":10 + * return util.is_float_object(obj) + * + * def is_integer(object obj): # <<<<<<<<<<<<<< + * return util.is_integer_object(obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":13 + * return util.is_integer_object(obj) + * + * def is_bool(object obj): # <<<<<<<<<<<<<< + * return util.is_bool_object(obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_126is_bool(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_126is_bool = {__Pyx_NAMESTR("is_bool"), (PyCFunction)__pyx_pw_6pandas_3lib_126is_bool, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_126is_bool(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_bool (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_125is_bool(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_125is_bool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_bool", 0); + + /* "pandas/src/inference.pyx":14 + * + * def is_bool(object obj): + * return util.is_bool_object(obj) # <<<<<<<<<<<<<< + * + * def is_complex(object obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_bool_object(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":13 + * return util.is_integer_object(obj) + * + * def is_bool(object obj): # <<<<<<<<<<<<<< + * return util.is_bool_object(obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":16 + * return util.is_bool_object(obj) + * + * def is_complex(object obj): # <<<<<<<<<<<<<< + * return util.is_complex_object(obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_128is_complex(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_128is_complex = {__Pyx_NAMESTR("is_complex"), (PyCFunction)__pyx_pw_6pandas_3lib_128is_complex, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_128is_complex(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_complex (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_127is_complex(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_127is_complex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_complex", 0); + + /* "pandas/src/inference.pyx":17 + * + * def is_complex(object obj): + * return util.is_complex_object(obj) # <<<<<<<<<<<<<< + * + * _TYPE_MAP = { + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_complex_object(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":16 + * return util.is_bool_object(obj) + * + * def is_complex(object obj): # <<<<<<<<<<<<<< + * return util.is_complex_object(obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_complex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":64 + * pass + * + * def infer_dtype(object _values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_130infer_dtype(PyObject *__pyx_self, PyObject *__pyx_v__values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_130infer_dtype = {__Pyx_NAMESTR("infer_dtype"), (PyCFunction)__pyx_pw_6pandas_3lib_130infer_dtype, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_130infer_dtype(PyObject *__pyx_self, PyObject *__pyx_v__values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("infer_dtype (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_129infer_dtype(__pyx_self, ((PyObject *)__pyx_v__values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_129infer_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_val_name = NULL; + PyObject *__pyx_v_val_kind = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("infer_dtype", 0); + __Pyx_INCREF(__pyx_v__values); + + /* "pandas/src/inference.pyx":70 + * ndarray values + * + * if isinstance(_values, np.ndarray): # <<<<<<<<<<<<<< + * values = _values + * elif hasattr(_values,'values'): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v__values, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":71 + * + * if isinstance(_values, np.ndarray): + * values = _values # <<<<<<<<<<<<<< + * elif hasattr(_values,'values'): + * values = _values.values + */ + if (!(likely(((__pyx_v__values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v__values; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_values = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + + /* "pandas/src/inference.pyx":72 + * if isinstance(_values, np.ndarray): + * values = _values + * elif hasattr(_values,'values'): # <<<<<<<<<<<<<< + * values = _values.values + * else: + */ + __pyx_t_2 = PyObject_HasAttr(__pyx_v__values, __pyx_n_s_values); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":73 + * values = _values + * elif hasattr(_values,'values'): + * values = _values.values # <<<<<<<<<<<<<< + * else: + * if not isinstance(_values, list): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__values, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_values = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/inference.pyx":75 + * values = _values.values + * else: + * if not isinstance(_values, list): # <<<<<<<<<<<<<< + * _values = list(_values) + * values = list_to_object_array(_values) + */ + __pyx_t_1 = PyList_Check(__pyx_v__values); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":76 + * else: + * if not isinstance(_values, list): + * _values = list(_values) # <<<<<<<<<<<<<< + * values = list_to_object_array(_values) + * + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__values); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__values); + __Pyx_GIVEREF(__pyx_v__values); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v__values, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":77 + * if not isinstance(_values, list): + * _values = list(_values) + * values = list_to_object_array(_values) # <<<<<<<<<<<<<< + * + * values = getattr(values, 'values', values) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_to_object_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__values); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__values); + __Pyx_GIVEREF(__pyx_v__values); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_values = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L3:; + + /* "pandas/src/inference.pyx":79 + * values = list_to_object_array(_values) + * + * values = getattr(values, 'values', values) # <<<<<<<<<<<<<< + * + * val_name = values.dtype.name + */ + __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_values), __pyx_n_s_values, ((PyObject *)__pyx_v_values)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":81 + * values = getattr(values, 'values', values) + * + * val_name = values.dtype.name # <<<<<<<<<<<<<< + * if val_name in _TYPE_MAP: + * return _TYPE_MAP[val_name] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_val_name = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":82 + * + * val_name = values.dtype.name + * if val_name in _TYPE_MAP: # <<<<<<<<<<<<<< + * return _TYPE_MAP[val_name] + * val_kind = values.dtype.kind + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_val_name, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":83 + * val_name = values.dtype.name + * if val_name in _TYPE_MAP: + * return _TYPE_MAP[val_name] # <<<<<<<<<<<<<< + * val_kind = values.dtype.kind + * if val_kind in _TYPE_MAP: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetItem(__pyx_t_3, __pyx_v_val_name); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":84 + * if val_name in _TYPE_MAP: + * return _TYPE_MAP[val_name] + * val_kind = values.dtype.kind # <<<<<<<<<<<<<< + * if val_kind in _TYPE_MAP: + * return _TYPE_MAP[val_kind] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_val_kind = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":85 + * return _TYPE_MAP[val_name] + * val_kind = values.dtype.kind + * if val_kind in _TYPE_MAP: # <<<<<<<<<<<<<< + * return _TYPE_MAP[val_kind] + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_val_kind, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":86 + * val_kind = values.dtype.kind + * if val_kind in _TYPE_MAP: + * return _TYPE_MAP[val_kind] # <<<<<<<<<<<<<< + * + * if values.dtype != np.object_: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetItem(__pyx_t_3, __pyx_v_val_kind); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":88 + * return _TYPE_MAP[val_kind] + * + * if values.dtype != np.object_: # <<<<<<<<<<<<<< + * values = values.astype('O') + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":89 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/src/inference.pyx":91 + * values = values.astype('O') + * + * n = len(values) # <<<<<<<<<<<<<< + * if n == 0: + * return 'empty' + */ + __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_6; + + /* "pandas/src/inference.pyx":92 + * + * n = len(values) + * if n == 0: # <<<<<<<<<<<<<< + * return 'empty' + * + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":93 + * n = len(values) + * if n == 0: + * return 'empty' # <<<<<<<<<<<<<< + * + * # make contiguous + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_empty); + __pyx_r = __pyx_n_s_empty; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":96 + * + * # make contiguous + * values = values.ravel() # <<<<<<<<<<<<<< + * + * # try to use a valid value + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":99 + * + * # try to use a valid value + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(values, i) + * if not is_null_datetimelike(val): + */ + __pyx_t_6 = __pyx_v_n; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/inference.pyx":100 + * # try to use a valid value + * for i in range(n): + * val = util.get_value_1d(values, i) # <<<<<<<<<<<<<< + * if not is_null_datetimelike(val): + * break + */ + __pyx_t_3 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":101 + * for i in range(n): + * val = util.get_value_1d(values, i) + * if not is_null_datetimelike(val): # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_val) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":102 + * val = util.get_value_1d(values, i) + * if not is_null_datetimelike(val): + * break # <<<<<<<<<<<<<< + * + * if util.is_datetime64_object(val) or val is NaT: + */ + goto __pyx_L10_break; + } + } + __pyx_L10_break:; + + /* "pandas/src/inference.pyx":104 + * break + * + * if util.is_datetime64_object(val) or val is NaT: # <<<<<<<<<<<<<< + * if is_datetime64_array(values): + * return 'datetime64' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (!(is_datetime64_object(__pyx_v_val) != 0)) { + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__pyx_v_val == __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_2; + } else { + __pyx_t_1 = (is_datetime64_object(__pyx_v_val) != 0); + } + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":105 + * + * if util.is_datetime64_object(val) or val is NaT: + * if is_datetime64_array(values): # <<<<<<<<<<<<<< + * return 'datetime64' + * elif is_timedelta_or_timedelta64_array(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_datetime64_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":106 + * if util.is_datetime64_object(val) or val is NaT: + * if is_datetime64_array(values): + * return 'datetime64' # <<<<<<<<<<<<<< + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_datetime64); + __pyx_r = __pyx_n_s_datetime64; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":107 + * if is_datetime64_array(values): + * return 'datetime64' + * elif is_timedelta_or_timedelta64_array(values): # <<<<<<<<<<<<<< + * return 'timedelta' + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_timedelta_or_timedelta64_arra); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":108 + * return 'datetime64' + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' # <<<<<<<<<<<<<< + * + * elif util.is_integer_object(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_timedelta); + __pyx_r = __pyx_n_s_timedelta; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":110 + * return 'timedelta' + * + * elif util.is_integer_object(val): # <<<<<<<<<<<<<< + * # a timedelta will show true here as well + * if is_timedelta(val): + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (is_integer_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":112 + * elif util.is_integer_object(val): + * # a timedelta will show true here as well + * if is_timedelta(val): # <<<<<<<<<<<<<< + * if is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":113 + * # a timedelta will show true here as well + * if is_timedelta(val): + * if is_timedelta_or_timedelta64_array(values): # <<<<<<<<<<<<<< + * return 'timedelta' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_timedelta_or_timedelta64_arra); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":114 + * if is_timedelta(val): + * if is_timedelta_or_timedelta64_array(values): + * return 'timedelta' # <<<<<<<<<<<<<< + * + * if is_integer_array(values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_timedelta); + __pyx_r = __pyx_n_s_timedelta; + goto __pyx_L0; + } + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/inference.pyx":116 + * return 'timedelta' + * + * if is_integer_array(values): # <<<<<<<<<<<<<< + * return 'integer' + * elif is_integer_float_array(values): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_integer_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":117 + * + * if is_integer_array(values): + * return 'integer' # <<<<<<<<<<<<<< + * elif is_integer_float_array(values): + * return 'mixed-integer-float' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_integer); + __pyx_r = __pyx_n_s_integer; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":118 + * if is_integer_array(values): + * return 'integer' + * elif is_integer_float_array(values): # <<<<<<<<<<<<<< + * return 'mixed-integer-float' + * elif is_timedelta_or_timedelta64_array(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_integer_float_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":119 + * return 'integer' + * elif is_integer_float_array(values): + * return 'mixed-integer-float' # <<<<<<<<<<<<<< + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_mixed_integer_float); + __pyx_r = __pyx_kp_s_mixed_integer_float; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":120 + * elif is_integer_float_array(values): + * return 'mixed-integer-float' + * elif is_timedelta_or_timedelta64_array(values): # <<<<<<<<<<<<<< + * return 'timedelta' + * return 'mixed-integer' + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_timedelta_or_timedelta64_arra); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":121 + * return 'mixed-integer-float' + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' # <<<<<<<<<<<<<< + * return 'mixed-integer' + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_timedelta); + __pyx_r = __pyx_n_s_timedelta; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":122 + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + * return 'mixed-integer' # <<<<<<<<<<<<<< + * + * elif is_datetime(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_mixed_integer); + __pyx_r = __pyx_kp_s_mixed_integer; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":124 + * return 'mixed-integer' + * + * elif is_datetime(val): # <<<<<<<<<<<<<< + * if is_datetime_array(values): + * return 'datetime' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_datetime(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":125 + * + * elif is_datetime(val): + * if is_datetime_array(values): # <<<<<<<<<<<<<< + * return 'datetime' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_datetime_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":126 + * elif is_datetime(val): + * if is_datetime_array(values): + * return 'datetime' # <<<<<<<<<<<<<< + * + * elif is_date(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_datetime); + __pyx_r = __pyx_n_s_datetime; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":128 + * return 'datetime' + * + * elif is_date(val): # <<<<<<<<<<<<<< + * if is_date_array(values): + * return 'date' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_date(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":129 + * + * elif is_date(val): + * if is_date_array(values): # <<<<<<<<<<<<<< + * return 'date' + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_date_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":130 + * elif is_date(val): + * if is_date_array(values): + * return 'date' # <<<<<<<<<<<<<< + * + * elif is_time(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_date); + __pyx_r = __pyx_n_s_date; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":132 + * return 'date' + * + * elif is_time(val): # <<<<<<<<<<<<<< + * if is_time_array(values): + * return 'time' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_time(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":133 + * + * elif is_time(val): + * if is_time_array(values): # <<<<<<<<<<<<<< + * return 'time' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_time_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":134 + * elif is_time(val): + * if is_time_array(values): + * return 'time' # <<<<<<<<<<<<<< + * + * elif util.is_float_object(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_time); + __pyx_r = __pyx_n_s_time; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":136 + * return 'time' + * + * elif util.is_float_object(val): # <<<<<<<<<<<<<< + * if is_float_array(values): + * return 'floating' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (is_float_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":137 + * + * elif util.is_float_object(val): + * if is_float_array(values): # <<<<<<<<<<<<<< + * return 'floating' + * elif is_integer_float_array(values): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_float_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":138 + * elif util.is_float_object(val): + * if is_float_array(values): + * return 'floating' # <<<<<<<<<<<<<< + * elif is_integer_float_array(values): + * return 'mixed-integer-float' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_floating); + __pyx_r = __pyx_n_s_floating; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":139 + * if is_float_array(values): + * return 'floating' + * elif is_integer_float_array(values): # <<<<<<<<<<<<<< + * return 'mixed-integer-float' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_integer_float_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":140 + * return 'floating' + * elif is_integer_float_array(values): + * return 'mixed-integer-float' # <<<<<<<<<<<<<< + * + * elif util.is_bool_object(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_mixed_integer_float); + __pyx_r = __pyx_kp_s_mixed_integer_float; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":142 + * return 'mixed-integer-float' + * + * elif util.is_bool_object(val): # <<<<<<<<<<<<<< + * if is_bool_array(values): + * return 'boolean' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (is_bool_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":143 + * + * elif util.is_bool_object(val): + * if is_bool_array(values): # <<<<<<<<<<<<<< + * return 'boolean' + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_bool_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":144 + * elif util.is_bool_object(val): + * if is_bool_array(values): + * return 'boolean' # <<<<<<<<<<<<<< + * + * elif PyString_Check(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_boolean); + __pyx_r = __pyx_n_s_boolean; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":146 + * return 'boolean' + * + * elif PyString_Check(val): # <<<<<<<<<<<<<< + * if is_string_array(values): + * return 'string' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (PyString_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":147 + * + * elif PyString_Check(val): + * if is_string_array(values): # <<<<<<<<<<<<<< + * return 'string' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_string_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":148 + * elif PyString_Check(val): + * if is_string_array(values): + * return 'string' # <<<<<<<<<<<<<< + * + * elif PyUnicode_Check(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_string); + __pyx_r = __pyx_n_s_string; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":150 + * return 'string' + * + * elif PyUnicode_Check(val): # <<<<<<<<<<<<<< + * if is_unicode_array(values): + * return 'unicode' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":151 + * + * elif PyUnicode_Check(val): + * if is_unicode_array(values): # <<<<<<<<<<<<<< + * return 'unicode' + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_unicode_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":152 + * elif PyUnicode_Check(val): + * if is_unicode_array(values): + * return 'unicode' # <<<<<<<<<<<<<< + * + * elif is_timedelta(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_unicode); + __pyx_r = __pyx_n_s_unicode; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":154 + * return 'unicode' + * + * elif is_timedelta(val): # <<<<<<<<<<<<<< + * if is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":155 + * + * elif is_timedelta(val): + * if is_timedelta_or_timedelta64_array(values): # <<<<<<<<<<<<<< + * return 'timedelta' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_timedelta_or_timedelta64_arra); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":156 + * elif is_timedelta(val): + * if is_timedelta_or_timedelta64_array(values): + * return 'timedelta' # <<<<<<<<<<<<<< + * + * elif is_period(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_timedelta); + __pyx_r = __pyx_n_s_timedelta; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":158 + * return 'timedelta' + * + * elif is_period(val): # <<<<<<<<<<<<<< + * if is_period_array(values): + * return 'period' + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_period); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":159 + * + * elif is_period(val): + * if is_period_array(values): # <<<<<<<<<<<<<< + * return 'period' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_period_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":160 + * elif is_period(val): + * if is_period_array(values): + * return 'period' # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_period); + __pyx_r = __pyx_n_s_period; + goto __pyx_L0; + } + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/inference.pyx":162 + * return 'period' + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(values, i) + * if util.is_integer_object(val): + */ + __pyx_t_6 = __pyx_v_n; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/inference.pyx":163 + * + * for i in range(n): + * val = util.get_value_1d(values, i) # <<<<<<<<<<<<<< + * if util.is_integer_object(val): + * return 'mixed-integer' + */ + __pyx_t_5 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":164 + * for i in range(n): + * val = util.get_value_1d(values, i) + * if util.is_integer_object(val): # <<<<<<<<<<<<<< + * return 'mixed-integer' + * + */ + __pyx_t_1 = (is_integer_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":165 + * val = util.get_value_1d(values, i) + * if util.is_integer_object(val): + * return 'mixed-integer' # <<<<<<<<<<<<<< + * + * return 'mixed' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_mixed_integer); + __pyx_r = __pyx_kp_s_mixed_integer; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":167 + * return 'mixed-integer' + * + * return 'mixed' # <<<<<<<<<<<<<< + * + * def infer_dtype_list(list values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_mixed); + __pyx_r = __pyx_n_s_mixed; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":64 + * pass + * + * def infer_dtype(object _values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v_val_name); + __Pyx_XDECREF(__pyx_v_val_kind); + __Pyx_XDECREF(__pyx_v__values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":169 + * return 'mixed' + * + * def infer_dtype_list(list values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_132infer_dtype_list(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_132infer_dtype_list = {__Pyx_NAMESTR("infer_dtype_list"), (PyCFunction)__pyx_pw_6pandas_3lib_132infer_dtype_list, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_132infer_dtype_list(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("infer_dtype_list (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PyList_Type), 1, "values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_131infer_dtype_list(__pyx_self, ((PyObject*)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_131infer_dtype_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("infer_dtype_list", 0); + + /* "pandas/src/inference.pyx":171 + * def infer_dtype_list(list values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * pass + * + */ + if (unlikely(__pyx_v_values == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":169 + * return 'mixed' + * + * def infer_dtype_list(list values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.infer_dtype_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":175 + * + * + * def is_possible_datetimelike_array(object arr): # <<<<<<<<<<<<<< + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_134is_possible_datetimelike_array(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_134is_possible_datetimelike_array = {__Pyx_NAMESTR("is_possible_datetimelike_array"), (PyCFunction)__pyx_pw_6pandas_3lib_134is_possible_datetimelike_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_134is_possible_datetimelike_array(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_possible_datetimelike_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_133is_possible_datetimelike_array(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_133is_possible_datetimelike_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_seen_timedelta; + int __pyx_v_seen_datetime; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_possible_datetimelike_array", 0); + + /* "pandas/src/inference.pyx":178 + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * bint seen_timedelta = 0, seen_datetime = 0 + * object v + */ + __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":179 + * cdef: + * Py_ssize_t i, n = len(arr) + * bint seen_timedelta = 0, seen_datetime = 0 # <<<<<<<<<<<<<< + * object v + * + */ + __pyx_v_seen_timedelta = 0; + __pyx_v_seen_datetime = 0; + + /* "pandas/src/inference.pyx":182 + * object v + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = arr[i] + * if util.is_string_object(v): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/inference.pyx":183 + * + * for i in range(n): + * v = arr[i] # <<<<<<<<<<<<<< + * if util.is_string_object(v): + * continue + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":184 + * for i in range(n): + * v = arr[i] + * if util.is_string_object(v): # <<<<<<<<<<<<<< + * continue + * elif util._checknull(v): + */ + __pyx_t_4 = (is_string_object(__pyx_v_v) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":185 + * v = arr[i] + * if util.is_string_object(v): + * continue # <<<<<<<<<<<<<< + * elif util._checknull(v): + * continue + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/inference.pyx":186 + * if util.is_string_object(v): + * continue + * elif util._checknull(v): # <<<<<<<<<<<<<< + * continue + * elif is_datetime(v): + */ + __pyx_t_4 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":187 + * continue + * elif util._checknull(v): + * continue # <<<<<<<<<<<<<< + * elif is_datetime(v): + * seen_datetime=1 + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/inference.pyx":188 + * elif util._checknull(v): + * continue + * elif is_datetime(v): # <<<<<<<<<<<<<< + * seen_datetime=1 + * elif is_timedelta(v): + */ + __pyx_t_4 = (__pyx_f_6pandas_3lib_is_datetime(__pyx_v_v) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":189 + * continue + * elif is_datetime(v): + * seen_datetime=1 # <<<<<<<<<<<<<< + * elif is_timedelta(v): + * seen_timedelta=1 + */ + __pyx_v_seen_datetime = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":190 + * elif is_datetime(v): + * seen_datetime=1 + * elif is_timedelta(v): # <<<<<<<<<<<<<< + * seen_timedelta=1 + * else: + */ + __pyx_t_4 = (__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_v) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":191 + * seen_datetime=1 + * elif is_timedelta(v): + * seen_timedelta=1 # <<<<<<<<<<<<<< + * else: + * return False + */ + __pyx_v_seen_timedelta = 1; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/inference.pyx":193 + * seen_timedelta=1 + * else: + * return False # <<<<<<<<<<<<<< + * return seen_datetime or seen_timedelta + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L5:; + __pyx_L3_continue:; + } + + /* "pandas/src/inference.pyx":194 + * else: + * return False + * return seen_datetime or seen_timedelta # <<<<<<<<<<<<<< + * + * cdef inline bint is_null_datetimelike(v): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_seen_datetime) { + __pyx_t_4 = __pyx_v_seen_timedelta; + } else { + __pyx_t_4 = __pyx_v_seen_datetime; + } + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":175 + * + * + * def is_possible_datetimelike_array(object arr): # <<<<<<<<<<<<<< + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.is_possible_datetimelike_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":196 + * return seen_datetime or seen_timedelta + * + * cdef inline bint is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # determine if we have a null for a timedelta/datetime (or integer versions)x + * if util._checknull(v): + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_null_datetimelike(PyObject *__pyx_v_v) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_null_datetimelike", 0); + + /* "pandas/src/inference.pyx":198 + * cdef inline bint is_null_datetimelike(v): + * # determine if we have a null for a timedelta/datetime (or integer versions)x + * if util._checknull(v): # <<<<<<<<<<<<<< + * return True + * elif util.is_timedelta64_object(v): + */ + __pyx_t_1 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":199 + * # determine if we have a null for a timedelta/datetime (or integer versions)x + * if util._checknull(v): + * return True # <<<<<<<<<<<<<< + * elif util.is_timedelta64_object(v): + * return v.view('int64') == iNaT + */ + __pyx_r = 1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":200 + * if util._checknull(v): + * return True + * elif util.is_timedelta64_object(v): # <<<<<<<<<<<<<< + * return v.view('int64') == iNaT + * elif util.is_datetime64_object(v): + */ + __pyx_t_1 = (is_timedelta64_object(__pyx_v_v) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":201 + * return True + * elif util.is_timedelta64_object(v): + * return v.view('int64') == iNaT # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":202 + * elif util.is_timedelta64_object(v): + * return v.view('int64') == iNaT + * elif util.is_datetime64_object(v): # <<<<<<<<<<<<<< + * return v.view('int64') == iNaT + * elif util.is_integer_object(v): + */ + __pyx_t_1 = (is_datetime64_object(__pyx_v_v) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":203 + * return v.view('int64') == iNaT + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT # <<<<<<<<<<<<<< + * elif util.is_integer_object(v): + * return v == iNaT + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":204 + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT + * elif util.is_integer_object(v): # <<<<<<<<<<<<<< + * return v == iNaT + * elif v is NaT: + */ + __pyx_t_1 = (is_integer_object(__pyx_v_v) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":205 + * return v.view('int64') == iNaT + * elif util.is_integer_object(v): + * return v == iNaT # <<<<<<<<<<<<<< + * elif v is NaT: + * return True + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_v, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":206 + * elif util.is_integer_object(v): + * return v == iNaT + * elif v is NaT: # <<<<<<<<<<<<<< + * return True + * return False + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__pyx_v_v == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + /* "pandas/src/inference.pyx":207 + * return v == iNaT + * elif v is NaT: + * return True # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_r = 1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":208 + * elif v is NaT: + * return True + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint is_datetime(object o): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":196 + * return seen_datetime or seen_timedelta + * + * cdef inline bint is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # determine if we have a null for a timedelta/datetime (or integer versions)x + * if util._checknull(v): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.lib.is_null_datetimelike", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":210 + * return False + * + * cdef inline bint is_datetime(object o): # <<<<<<<<<<<<<< + * return PyDateTime_Check(o) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_datetime(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime", 0); + + /* "pandas/src/inference.pyx":211 + * + * cdef inline bint is_datetime(object o): + * return PyDateTime_Check(o) # <<<<<<<<<<<<<< + * + * cdef inline bint is_date(object o): + */ + __pyx_r = PyDateTime_Check(__pyx_v_o); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":210 + * return False + * + * cdef inline bint is_datetime(object o): # <<<<<<<<<<<<<< + * return PyDateTime_Check(o) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":213 + * return PyDateTime_Check(o) + * + * cdef inline bint is_date(object o): # <<<<<<<<<<<<<< + * return PyDate_Check(o) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_date(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_date", 0); + + /* "pandas/src/inference.pyx":214 + * + * cdef inline bint is_date(object o): + * return PyDate_Check(o) # <<<<<<<<<<<<<< + * + * cdef inline bint is_time(object o): + */ + __pyx_r = PyDate_Check(__pyx_v_o); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":213 + * return PyDateTime_Check(o) + * + * cdef inline bint is_date(object o): # <<<<<<<<<<<<<< + * return PyDate_Check(o) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":216 + * return PyDate_Check(o) + * + * cdef inline bint is_time(object o): # <<<<<<<<<<<<<< + * return PyTime_Check(o) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_time(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_time", 0); + + /* "pandas/src/inference.pyx":217 + * + * cdef inline bint is_time(object o): + * return PyTime_Check(o) # <<<<<<<<<<<<<< + * + * cdef inline bint is_timedelta(object o): + */ + __pyx_r = PyTime_Check(__pyx_v_o); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":216 + * return PyDate_Check(o) + * + * cdef inline bint is_time(object o): # <<<<<<<<<<<<<< + * return PyTime_Check(o) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":219 + * return PyTime_Check(o) + * + * cdef inline bint is_timedelta(object o): # <<<<<<<<<<<<<< + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_timedelta(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta", 0); + + /* "pandas/src/inference.pyx":220 + * + * cdef inline bint is_timedelta(object o): + * return PyDelta_Check(o) or util.is_timedelta64_object(o) # <<<<<<<<<<<<<< + * + * def is_bool_array(ndarray values): + */ + __pyx_t_1 = __Pyx_PyBool_FromLong(PyDelta_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_From_int(is_timedelta64_object(__pyx_v_o)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":219 + * return PyTime_Check(o) + * + * cdef inline bint is_timedelta(object o): # <<<<<<<<<<<<<< + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.lib.is_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":222 + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + * def is_bool_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_136is_bool_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_136is_bool_array = {__Pyx_NAMESTR("is_bool_array"), (PyCFunction)__pyx_pw_6pandas_3lib_136is_bool_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_136is_bool_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_bool_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_135is_bool_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_135is_bool_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_bool_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":224 + * def is_bool_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":228 + * object obj + * + * if issubclass(values.dtype.type, np.bool_): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":229 + * + * if issubclass(values.dtype.type, np.bool_): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":230 + * if issubclass(values.dtype.type, np.bool_): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":231 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":233 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":234 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":236 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not util.is_bool_object(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":237 + * + * for i in range(n): + * if not util.is_bool_object(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = ((!(is_bool_object(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":238 + * for i in range(n): + * if not util.is_bool_object(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":239 + * if not util.is_bool_object(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":241 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_integer(object o): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":222 + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + * def is_bool_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_bool_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":243 + * return False + * + * def is_integer(object o): # <<<<<<<<<<<<<< + * return util.is_integer_object(o) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_138is_integer(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_138is_integer = {__Pyx_NAMESTR("is_integer"), (PyCFunction)__pyx_pw_6pandas_3lib_138is_integer, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_138is_integer(PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_integer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_137is_integer(__pyx_self, ((PyObject *)__pyx_v_o)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_137is_integer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_integer", 0); + + /* "pandas/src/inference.pyx":244 + * + * def is_integer(object o): + * return util.is_integer_object(o) # <<<<<<<<<<<<<< + * + * def is_integer_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_integer_object(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":243 + * return False + * + * def is_integer(object o): # <<<<<<<<<<<<<< + * return util.is_integer_object(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":246 + * return util.is_integer_object(o) + * + * def is_integer_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_140is_integer_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_140is_integer_array = {__Pyx_NAMESTR("is_integer_array"), (PyCFunction)__pyx_pw_6pandas_3lib_140is_integer_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_140is_integer_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_integer_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_139is_integer_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_139is_integer_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_integer_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":248 + * def is_integer_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":252 + * object obj + * + * if issubclass(values.dtype.type, np.integer): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":253 + * + * if issubclass(values.dtype.type, np.integer): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":254 + * if issubclass(values.dtype.type, np.integer): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":255 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":257 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":258 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":260 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not util.is_integer_object(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":261 + * + * for i in range(n): + * if not util.is_integer_object(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = ((!(is_integer_object(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":262 + * for i in range(n): + * if not util.is_integer_object(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":263 + * if not util.is_integer_object(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":265 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_integer_float_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":246 + * return util.is_integer_object(o) + * + * def is_integer_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_integer_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":267 + * return False + * + * def is_integer_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_142is_integer_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_142is_integer_float_array = {__Pyx_NAMESTR("is_integer_float_array"), (PyCFunction)__pyx_pw_6pandas_3lib_142is_integer_float_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_142is_integer_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_integer_float_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_141is_integer_float_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_141is_integer_float_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_integer_float_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":269 + * def is_integer_float_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":273 + * object obj + * + * if issubclass(values.dtype.type, np.integer): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":274 + * + * if issubclass(values.dtype.type, np.integer): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":275 + * if issubclass(values.dtype.type, np.integer): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":276 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":278 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":279 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":281 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not (util.is_integer_object(objbuf[i]) or + * util.is_float_object(objbuf[i])): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":282 + * + * for i in range(n): + * if not (util.is_integer_object(objbuf[i]) or # <<<<<<<<<<<<<< + * util.is_float_object(objbuf[i])): + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = (is_integer_object(__pyx_t_3) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) { + + /* "pandas/src/inference.pyx":283 + * for i in range(n): + * if not (util.is_integer_object(objbuf[i]) or + * util.is_float_object(objbuf[i])): # <<<<<<<<<<<<<< + * + * return False + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_5 = (is_float_object(__pyx_t_3) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_14 = __pyx_t_5; + } else { + __pyx_t_14 = __pyx_t_6; + } + + /* "pandas/src/inference.pyx":282 + * + * for i in range(n): + * if not (util.is_integer_object(objbuf[i]) or # <<<<<<<<<<<<<< + * util.is_float_object(objbuf[i])): + * + */ + __pyx_t_6 = ((!__pyx_t_14) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":285 + * util.is_float_object(objbuf[i])): + * + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":286 + * + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":288 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_float_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":267 + * return False + * + * def is_integer_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_integer_float_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":290 + * return False + * + * def is_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_144is_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_144is_float_array = {__Pyx_NAMESTR("is_float_array"), (PyCFunction)__pyx_pw_6pandas_3lib_144is_float_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_144is_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_float_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_143is_float_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_143is_float_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_float_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":292 + * def is_float_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":296 + * object obj + * + * if issubclass(values.dtype.type, np.floating): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_floating); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":297 + * + * if issubclass(values.dtype.type, np.floating): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":298 + * if issubclass(values.dtype.type, np.floating): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":299 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":301 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":302 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":304 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not util.is_float_object(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":305 + * + * for i in range(n): + * if not util.is_float_object(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = ((!(is_float_object(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":306 + * for i in range(n): + * if not util.is_float_object(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":307 + * if not util.is_float_object(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":309 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_string_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":290 + * return False + * + * def is_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_float_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":311 + * return False + * + * def is_string_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_146is_string_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_146is_string_array = {__Pyx_NAMESTR("is_string_array"), (PyCFunction)__pyx_pw_6pandas_3lib_146is_string_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_146is_string_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_string_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_145is_string_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_145is_string_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_string_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":313 + * def is_string_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":317 + * object obj + * + * if issubclass(values.dtype.type, (np.string_, np.unicode_)): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_string_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unicode_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":318 + * + * if issubclass(values.dtype.type, (np.string_, np.unicode_)): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":319 + * if issubclass(values.dtype.type, (np.string_, np.unicode_)): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":320 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":322 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_7 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":323 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":325 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not PyString_Check(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/inference.pyx":326 + * + * for i in range(n): + * if not PyString_Check(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_7 = ((!(PyString_Check(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":327 + * for i in range(n): + * if not PyString_Check(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":328 + * if not PyString_Check(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":330 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_unicode_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":311 + * return False + * + * def is_string_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_string_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":332 + * return False + * + * def is_unicode_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_148is_unicode_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_148is_unicode_array = {__Pyx_NAMESTR("is_unicode_array"), (PyCFunction)__pyx_pw_6pandas_3lib_148is_unicode_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_148is_unicode_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_unicode_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_147is_unicode_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_147is_unicode_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_unicode_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":334 + * def is_unicode_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":338 + * object obj + * + * if issubclass(values.dtype.type, np.unicode_): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unicode_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":339 + * + * if issubclass(values.dtype.type, np.unicode_): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":340 + * if issubclass(values.dtype.type, np.unicode_): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":341 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":343 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":344 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":346 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not PyUnicode_Check(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":347 + * + * for i in range(n): + * if not PyUnicode_Check(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = ((!(PyUnicode_Check(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":348 + * for i in range(n): + * if not PyUnicode_Check(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":349 + * if not PyUnicode_Check(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":351 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":332 + * return False + * + * def is_unicode_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_unicode_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":354 + * + * + * def is_datetime_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_150is_datetime_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_150is_datetime_array = {__Pyx_NAMESTR("is_datetime_array"), (PyCFunction)__pyx_pw_6pandas_3lib_150is_datetime_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_150is_datetime_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_149is_datetime_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_149is_datetime_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_datetime_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":355 + * + * def is_datetime_array(ndarray[object] values): + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":357 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":358 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * # return False for all nulls + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":361 + * + * # return False for all nulls + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":362 + * # return False for all nulls + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":363 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":365 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not is_datetime(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":366 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not is_datetime(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":367 + * if util._checknull(v): + * null_count += 1 + * elif not is_datetime(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_datetime(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":368 + * null_count += 1 + * elif not is_datetime(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":369 + * elif not is_datetime(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_datetime64_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":354 + * + * + * def is_datetime_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_datetime_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":371 + * return null_count != n + * + * def is_datetime64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_152is_datetime64_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_152is_datetime64_array = {__Pyx_NAMESTR("is_datetime64_array"), (PyCFunction)__pyx_pw_6pandas_3lib_152is_datetime64_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_152is_datetime64_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_151is_datetime64_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_151is_datetime64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_datetime64_array", 0); + + /* "pandas/src/inference.pyx":372 + * + * def is_datetime64_array(ndarray values): + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":374 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":375 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * # return False for all nulls + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":378 + * + * # return False for all nulls + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":379 + * # return False for all nulls + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_values), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":380 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":382 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not util.is_datetime64_object(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":383 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not util.is_datetime64_object(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":384 + * if util._checknull(v): + * null_count += 1 + * elif not util.is_datetime64_object(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(is_datetime64_object(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":385 + * null_count += 1 + * elif not util.is_datetime64_object(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":386 + * elif not util.is_datetime64_object(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_timedelta_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":371 + * return null_count != n + * + * def is_datetime64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.is_datetime64_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":388 + * return null_count != n + * + * def is_timedelta_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_154is_timedelta_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_154is_timedelta_array = {__Pyx_NAMESTR("is_timedelta_array"), (PyCFunction)__pyx_pw_6pandas_3lib_154is_timedelta_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_154is_timedelta_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_153is_timedelta_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_153is_timedelta_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta_array", 0); + + /* "pandas/src/inference.pyx":389 + * + * def is_timedelta_array(ndarray values): + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":391 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":392 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * v = values[i] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":393 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":394 + * return False + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_values), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":395 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":397 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not PyDelta_Check(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":398 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not PyDelta_Check(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":399 + * if util._checknull(v): + * null_count += 1 + * elif not PyDelta_Check(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(PyDelta_Check(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":400 + * null_count += 1 + * elif not PyDelta_Check(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":401 + * elif not PyDelta_Check(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_timedelta64_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":388 + * return null_count != n + * + * def is_timedelta_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.is_timedelta_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":403 + * return null_count != n + * + * def is_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_156is_timedelta64_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_156is_timedelta64_array = {__Pyx_NAMESTR("is_timedelta64_array"), (PyCFunction)__pyx_pw_6pandas_3lib_156is_timedelta64_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_156is_timedelta64_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta64_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_155is_timedelta64_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_155is_timedelta64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta64_array", 0); + + /* "pandas/src/inference.pyx":404 + * + * def is_timedelta64_array(ndarray values): + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":406 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":407 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * v = values[i] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":408 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":409 + * return False + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_values), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":410 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":412 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not util.is_timedelta64_object(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":413 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not util.is_timedelta64_object(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":414 + * if util._checknull(v): + * null_count += 1 + * elif not util.is_timedelta64_object(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(is_timedelta64_object(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":415 + * null_count += 1 + * elif not util.is_timedelta64_object(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":416 + * elif not util.is_timedelta64_object(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_timedelta_or_timedelta64_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":403 + * return null_count != n + * + * def is_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.is_timedelta64_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":418 + * return null_count != n + * + * def is_timedelta_or_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_158is_timedelta_or_timedelta64_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static char __pyx_doc_6pandas_3lib_157is_timedelta_or_timedelta64_array[] = " infer with timedeltas and/or nat/none "; +static PyMethodDef __pyx_mdef_6pandas_3lib_158is_timedelta_or_timedelta64_array = {__Pyx_NAMESTR("is_timedelta_or_timedelta64_array"), (PyCFunction)__pyx_pw_6pandas_3lib_158is_timedelta_or_timedelta64_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_157is_timedelta_or_timedelta64_array)}; +static PyObject *__pyx_pw_6pandas_3lib_158is_timedelta_or_timedelta64_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta_or_timedelta64_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_157is_timedelta_or_timedelta64_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_157is_timedelta_or_timedelta64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta_or_timedelta64_array", 0); + + /* "pandas/src/inference.pyx":420 + * def is_timedelta_or_timedelta64_array(ndarray values): + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":422 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":423 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * v = values[i] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":424 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":425 + * return False + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_values), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":426 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":428 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not is_timedelta(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":429 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not is_timedelta(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":430 + * if util._checknull(v): + * null_count += 1 + * elif not is_timedelta(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":431 + * null_count += 1 + * elif not is_timedelta(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":432 + * elif not is_timedelta(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_date_array(ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":418 + * return null_count != n + * + * def is_timedelta_or_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.is_timedelta_or_timedelta64_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":434 + * return null_count != n + * + * def is_date_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_160is_date_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_160is_date_array = {__Pyx_NAMESTR("is_date_array"), (PyCFunction)__pyx_pw_6pandas_3lib_160is_date_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_160is_date_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_date_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_159is_date_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_159is_date_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_n; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_date_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":435 + * + * def is_date_array(ndarray[object] values): + * cdef int i, n = len(values) # <<<<<<<<<<<<<< + * if n == 0: + * return False + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":436 + * def is_date_array(ndarray[object] values): + * cdef int i, n = len(values) + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":437 + * cdef int i, n = len(values) + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * if not is_date(values[i]): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":438 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * if not is_date(values[i]): + * return False + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":439 + * return False + * for i in range(n): + * if not is_date(values[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_date(__pyx_t_5) != 0)) != 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":440 + * for i in range(n): + * if not is_date(values[i]): + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":441 + * if not is_date(values[i]): + * return False + * return True # <<<<<<<<<<<<<< + * + * def is_time_array(ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":434 + * return null_count != n + * + * def is_date_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_date_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":443 + * return True + * + * def is_time_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_162is_time_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_162is_time_array = {__Pyx_NAMESTR("is_time_array"), (PyCFunction)__pyx_pw_6pandas_3lib_162is_time_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_162is_time_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_time_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_161is_time_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_161is_time_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_n; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_time_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":444 + * + * def is_time_array(ndarray[object] values): + * cdef int i, n = len(values) # <<<<<<<<<<<<<< + * if n == 0: + * return False + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":445 + * def is_time_array(ndarray[object] values): + * cdef int i, n = len(values) + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":446 + * cdef int i, n = len(values) + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * if not is_time(values[i]): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":447 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * if not is_time(values[i]): + * return False + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":448 + * return False + * for i in range(n): + * if not is_time(values[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_time(__pyx_t_5) != 0)) != 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":449 + * for i in range(n): + * if not is_time(values[i]): + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":450 + * if not is_time(values[i]): + * return False + * return True # <<<<<<<<<<<<<< + * + * def is_period(object o): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":443 + * return True + * + * def is_time_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_time_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":452 + * return True + * + * def is_period(object o): # <<<<<<<<<<<<<< + * from pandas import Period + * return isinstance(o,Period) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_164is_period(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_164is_period = {__Pyx_NAMESTR("is_period"), (PyCFunction)__pyx_pw_6pandas_3lib_164is_period, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_164is_period(PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_period (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_163is_period(__pyx_self, ((PyObject *)__pyx_v_o)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_163is_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_v_Period = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_period", 0); + + /* "pandas/src/inference.pyx":453 + * + * def is_period(object o): + * from pandas import Period # <<<<<<<<<<<<<< + * return isinstance(o,Period) + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Period); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Period); + __Pyx_GIVEREF(__pyx_n_s_Period); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Period); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_Period = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":454 + * def is_period(object o): + * from pandas import Period + * return isinstance(o,Period) # <<<<<<<<<<<<<< + * + * def is_period_array(ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_o, __pyx_v_Period); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":452 + * return True + * + * def is_period(object o): # <<<<<<<<<<<<<< + * from pandas import Period + * return isinstance(o,Period) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.is_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Period); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":456 + * return isinstance(o,Period) + * + * def is_period_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * from pandas.tseries.period import Period + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_166is_period_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_166is_period_array = {__Pyx_NAMESTR("is_period_array"), (PyCFunction)__pyx_pw_6pandas_3lib_166is_period_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_166is_period_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_period_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_165is_period_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_165is_period_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_n; + PyObject *__pyx_v_Period = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_period_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":457 + * + * def is_period_array(ndarray[object] values): + * cdef int i, n = len(values) # <<<<<<<<<<<<<< + * from pandas.tseries.period import Period + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":458 + * def is_period_array(ndarray[object] values): + * cdef int i, n = len(values) + * from pandas.tseries.period import Period # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Period); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Period); + __Pyx_GIVEREF(__pyx_n_s_Period); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pandas_tseries_period, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Period); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_Period = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":460 + * from pandas.tseries.period import Period + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":461 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * if not isinstance(values[i], Period): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":462 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * if not isinstance(values[i], Period): + * return False + */ + __pyx_t_5 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/inference.pyx":463 + * return False + * for i in range(n): + * if not isinstance(values[i], Period): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_4 = PyObject_IsInstance(__pyx_t_3, __pyx_v_Period); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/inference.pyx":464 + * for i in range(n): + * if not isinstance(values[i], Period): + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":465 + * if not isinstance(values[i], Period): + * return False + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":456 + * return isinstance(o,Period) + * + * def is_period_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * from pandas.tseries.period import Period + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_period_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_Period); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_168maybe_convert_numeric(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_167maybe_convert_numeric[] = "\n Type inference function-- convert strings to numeric (potentially) and\n convert to proper dtype array\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_168maybe_convert_numeric = {__Pyx_NAMESTR("maybe_convert_numeric"), (PyCFunction)__pyx_pw_6pandas_3lib_168maybe_convert_numeric, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_167maybe_convert_numeric)}; +static PyObject *__pyx_pw_6pandas_3lib_168maybe_convert_numeric(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_na_values = 0; + int __pyx_v_convert_empty; + int __pyx_v_coerce_numeric; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_convert_numeric (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_na_values,&__pyx_n_s_convert_empty,&__pyx_n_s_coerce_numeric,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("maybe_convert_numeric", 0, 2, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert_empty); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce_numeric); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maybe_convert_numeric") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_ds_object(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_na_values = ((PyObject*)values[1]); + if (values[2]) { + __pyx_v_convert_empty = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_convert_empty == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + + /* "pandas/src/inference.pyx":476 + * + * def maybe_convert_numeric(object[:] values, set na_values, + * bint convert_empty=True, bint coerce_numeric=False): # <<<<<<<<<<<<<< + * ''' + * Type inference function-- convert strings to numeric (potentially) and + */ + __pyx_v_convert_empty = ((int)1); + } + if (values[3]) { + __pyx_v_coerce_numeric = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_coerce_numeric == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_coerce_numeric = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("maybe_convert_numeric", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_na_values), (&PySet_Type), 1, "na_values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_167maybe_convert_numeric(__pyx_self, __pyx_v_values, __pyx_v_na_values, __pyx_v_convert_empty, __pyx_v_coerce_numeric); + + /* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_167maybe_convert_numeric(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyObject *__pyx_v_na_values, int __pyx_v_convert_empty, int __pyx_v_coerce_numeric) { + CYTHON_UNUSED int __pyx_v_status; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_floats = 0; + PyArrayObject *__pyx_v_complexes = 0; + PyArrayObject *__pyx_v_ints = 0; + PyArrayObject *__pyx_v_bools = 0; + int __pyx_v_seen_float; + int __pyx_v_seen_complex; + int __pyx_v_seen_int; + int __pyx_v_seen_bool; + PyObject *__pyx_v_val = 0; + __pyx_t_5numpy_float64_t __pyx_v_fval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bools; + __Pyx_Buffer __pyx_pybuffer_bools; + __Pyx_LocalBuf_ND __pyx_pybuffernd_complexes; + __Pyx_Buffer __pyx_pybuffer_complexes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_floats; + __Pyx_Buffer __pyx_pybuffer_floats; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ints; + __Pyx_Buffer __pyx_pybuffer_ints; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + __pyx_t_5numpy_float64_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_double_complex __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + __pyx_t_5numpy_int64_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_uint8_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + int __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + PyObject *__pyx_t_34 = NULL; + PyObject *__pyx_t_35 = NULL; + PyObject *__pyx_t_36 = NULL; + Py_ssize_t __pyx_t_37; + int __pyx_t_38; + PyObject *__pyx_t_39 = NULL; + PyObject *__pyx_t_40 = NULL; + PyObject *__pyx_t_41 = NULL; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_convert_numeric", 0); + __pyx_pybuffer_floats.pybuffer.buf = NULL; + __pyx_pybuffer_floats.refcount = 0; + __pyx_pybuffernd_floats.data = NULL; + __pyx_pybuffernd_floats.rcbuffer = &__pyx_pybuffer_floats; + __pyx_pybuffer_complexes.pybuffer.buf = NULL; + __pyx_pybuffer_complexes.refcount = 0; + __pyx_pybuffernd_complexes.data = NULL; + __pyx_pybuffernd_complexes.rcbuffer = &__pyx_pybuffer_complexes; + __pyx_pybuffer_ints.pybuffer.buf = NULL; + __pyx_pybuffer_ints.refcount = 0; + __pyx_pybuffernd_ints.data = NULL; + __pyx_pybuffernd_ints.rcbuffer = &__pyx_pybuffer_ints; + __pyx_pybuffer_bools.pybuffer.buf = NULL; + __pyx_pybuffer_bools.refcount = 0; + __pyx_pybuffernd_bools.data = NULL; + __pyx_pybuffernd_bools.rcbuffer = &__pyx_pybuffer_bools; + + /* "pandas/src/inference.pyx":483 + * cdef: + * int status + * Py_ssize_t i, n = values.size # <<<<<<<<<<<<<< + * ndarray[float64_t] floats = np.empty(n, dtype='f8') + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 1, (PyObject *(*)(char *)) __pyx_memview_get_object, (int (*)(char *, PyObject *)) __pyx_memview_set_object, 1);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/src/inference.pyx":484 + * int status + * Py_ssize_t i, n = values.size + * ndarray[float64_t] floats = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') + * ndarray[int64_t] ints = np.empty(n, dtype='i8') + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_floats.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_floats = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_floats.diminfo[0].strides = __pyx_pybuffernd_floats.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_floats.diminfo[0].shape = __pyx_pybuffernd_floats.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_floats = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":485 + * Py_ssize_t i, n = values.size + * ndarray[float64_t] floats = np.empty(n, dtype='f8') + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') # <<<<<<<<<<<<<< + * ndarray[int64_t] ints = np.empty(n, dtype='i8') + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_c16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_complexes = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_complexes.diminfo[0].strides = __pyx_pybuffernd_complexes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_complexes.diminfo[0].shape = __pyx_pybuffernd_complexes.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_complexes = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/inference.pyx":486 + * ndarray[float64_t] floats = np.empty(n, dtype='f8') + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') + * ndarray[int64_t] ints = np.empty(n, dtype='i8') # <<<<<<<<<<<<<< + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') + * bint seen_float = False + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ints.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_ints = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_ints.diminfo[0].strides = __pyx_pybuffernd_ints.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ints.diminfo[0].shape = __pyx_pybuffernd_ints.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_8 = 0; + __pyx_v_ints = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":487 + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') + * ndarray[int64_t] ints = np.empty(n, dtype='i8') + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') # <<<<<<<<<<<<<< + * bint seen_float = False + * bint seen_complex = False + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bools.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_bools = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_bools.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_bools.diminfo[0].strides = __pyx_pybuffernd_bools.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bools.diminfo[0].shape = __pyx_pybuffernd_bools.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_9 = 0; + __pyx_v_bools = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":488 + * ndarray[int64_t] ints = np.empty(n, dtype='i8') + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') + * bint seen_float = False # <<<<<<<<<<<<<< + * bint seen_complex = False + * bint seen_int = False + */ + __pyx_v_seen_float = 0; + + /* "pandas/src/inference.pyx":489 + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') + * bint seen_float = False + * bint seen_complex = False # <<<<<<<<<<<<<< + * bint seen_int = False + * bint seen_bool = False + */ + __pyx_v_seen_complex = 0; + + /* "pandas/src/inference.pyx":490 + * bint seen_float = False + * bint seen_complex = False + * bint seen_int = False # <<<<<<<<<<<<<< + * bint seen_bool = False + * object val + */ + __pyx_v_seen_int = 0; + + /* "pandas/src/inference.pyx":491 + * bint seen_complex = False + * bint seen_int = False + * bint seen_bool = False # <<<<<<<<<<<<<< + * object val + * float64_t fval + */ + __pyx_v_seen_bool = 0; + + /* "pandas/src/inference.pyx":495 + * float64_t fval + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_3; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/inference.pyx":496 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * if val in na_values: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_v_values.shape[0]; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_v_values.shape[0])) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *((PyObject * *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) )); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":498 + * val = values[i] + * + * if val in na_values: # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = nan + * seen_float = True + */ + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_na_values, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":499 + * + * if val in na_values: + * floats[i] = complexes[i] = nan # <<<<<<<<<<<<<< + * seen_float = True + * elif util.is_float_object(val): + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_6pandas_3lib_nan; + __pyx_t_16 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0); + + /* "pandas/src/inference.pyx":500 + * if val in na_values: + * floats[i] = complexes[i] = nan + * seen_float = True # <<<<<<<<<<<<<< + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val + */ + __pyx_v_seen_float = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":501 + * floats[i] = complexes[i] = nan + * seen_float = True + * elif util.is_float_object(val): # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = val + * seen_float = True + */ + __pyx_t_14 = (is_float_object(__pyx_v_val) != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":502 + * seen_float = True + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val # <<<<<<<<<<<<<< + * seen_float = True + * elif util.is_integer_object(val): + */ + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_17 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_17; + __pyx_t_19 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_19; + + /* "pandas/src/inference.pyx":503 + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val + * seen_float = True # <<<<<<<<<<<<<< + * elif util.is_integer_object(val): + * floats[i] = ints[i] = val + */ + __pyx_v_seen_float = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":504 + * floats[i] = complexes[i] = val + * seen_float = True + * elif util.is_integer_object(val): # <<<<<<<<<<<<<< + * floats[i] = ints[i] = val + * seen_int = True + */ + __pyx_t_14 = (is_integer_object(__pyx_v_val) != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":505 + * seen_float = True + * elif util.is_integer_object(val): + * floats[i] = ints[i] = val # <<<<<<<<<<<<<< + * seen_int = True + * elif util.is_bool_object(val): + */ + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_17 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_17; + __pyx_t_22 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_22 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ints.diminfo[0].strides) = __pyx_t_22; + + /* "pandas/src/inference.pyx":506 + * elif util.is_integer_object(val): + * floats[i] = ints[i] = val + * seen_int = True # <<<<<<<<<<<<<< + * elif util.is_bool_object(val): + * floats[i] = ints[i] = bools[i] = val + */ + __pyx_v_seen_int = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":507 + * floats[i] = ints[i] = val + * seen_int = True + * elif util.is_bool_object(val): # <<<<<<<<<<<<<< + * floats[i] = ints[i] = bools[i] = val + * seen_bool = True + */ + __pyx_t_14 = (is_bool_object(__pyx_v_val) != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":508 + * seen_int = True + * elif util.is_bool_object(val): + * floats[i] = ints[i] = bools[i] = val # <<<<<<<<<<<<<< + * seen_bool = True + * elif val is None: + */ + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_17 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_17; + __pyx_t_22 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_22 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_25 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ints.diminfo[0].strides) = __pyx_t_22; + __pyx_t_26 = __Pyx_PyInt_As_npy_uint8(__pyx_v_val); if (unlikely((__pyx_t_26 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_bools.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_bools.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_bools.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_bools.diminfo[0].strides) = __pyx_t_26; + + /* "pandas/src/inference.pyx":509 + * elif util.is_bool_object(val): + * floats[i] = ints[i] = bools[i] = val + * seen_bool = True # <<<<<<<<<<<<<< + * elif val is None: + * floats[i] = complexes[i] = nan + */ + __pyx_v_seen_bool = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":510 + * floats[i] = ints[i] = bools[i] = val + * seen_bool = True + * elif val is None: # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = nan + * seen_float = True + */ + __pyx_t_14 = (__pyx_v_val == Py_None); + __pyx_t_13 = (__pyx_t_14 != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":511 + * seen_bool = True + * elif val is None: + * floats[i] = complexes[i] = nan # <<<<<<<<<<<<<< + * seen_float = True + * elif hasattr(val, '__len__') and len(val) == 0: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_6pandas_3lib_nan; + __pyx_t_29 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0); + + /* "pandas/src/inference.pyx":512 + * elif val is None: + * floats[i] = complexes[i] = nan + * seen_float = True # <<<<<<<<<<<<<< + * elif hasattr(val, '__len__') and len(val) == 0: + * if convert_empty or coerce_numeric: + */ + __pyx_v_seen_float = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":513 + * floats[i] = complexes[i] = nan + * seen_float = True + * elif hasattr(val, '__len__') and len(val) == 0: # <<<<<<<<<<<<<< + * if convert_empty or coerce_numeric: + * floats[i] = complexes[i] = nan + */ + __pyx_t_13 = PyObject_HasAttr(__pyx_v_val, __pyx_n_s_len); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if ((__pyx_t_13 != 0)) { + __pyx_t_30 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((__pyx_t_30 == 0) != 0); + __pyx_t_31 = __pyx_t_14; + } else { + __pyx_t_31 = (__pyx_t_13 != 0); + } + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":514 + * seen_float = True + * elif hasattr(val, '__len__') and len(val) == 0: + * if convert_empty or coerce_numeric: # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = nan + * seen_float = True + */ + if (!(__pyx_v_convert_empty != 0)) { + __pyx_t_31 = (__pyx_v_coerce_numeric != 0); + } else { + __pyx_t_31 = (__pyx_v_convert_empty != 0); + } + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":515 + * elif hasattr(val, '__len__') and len(val) == 0: + * if convert_empty or coerce_numeric: + * floats[i] = complexes[i] = nan # <<<<<<<<<<<<<< + * seen_float = True + * else: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_6pandas_3lib_nan; + __pyx_t_32 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0); + + /* "pandas/src/inference.pyx":516 + * if convert_empty or coerce_numeric: + * floats[i] = complexes[i] = nan + * seen_float = True # <<<<<<<<<<<<<< + * else: + * raise ValueError('Empty string encountered') + */ + __pyx_v_seen_float = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/inference.pyx":518 + * seen_float = True + * else: + * raise ValueError('Empty string encountered') # <<<<<<<<<<<<<< + * elif util.is_complex_object(val): + * complexes[i] = val + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L6:; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":519 + * else: + * raise ValueError('Empty string encountered') + * elif util.is_complex_object(val): # <<<<<<<<<<<<<< + * complexes[i] = val + * seen_complex = True + */ + __pyx_t_31 = (is_complex_object(__pyx_v_val) != 0); + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":520 + * raise ValueError('Empty string encountered') + * elif util.is_complex_object(val): + * complexes[i] = val # <<<<<<<<<<<<<< + * seen_complex = True + * else: + */ + __pyx_t_19 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_33 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_19; + + /* "pandas/src/inference.pyx":521 + * elif util.is_complex_object(val): + * complexes[i] = val + * seen_complex = True # <<<<<<<<<<<<<< + * else: + * try: + */ + __pyx_v_seen_complex = 1; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/inference.pyx":523 + * seen_complex = True + * else: + * try: # <<<<<<<<<<<<<< + * status = floatify(val, &fval) + * floats[i] = fval + */ + { + __Pyx_ExceptionSave(&__pyx_t_34, &__pyx_t_35, &__pyx_t_36); + __Pyx_XGOTREF(__pyx_t_34); + __Pyx_XGOTREF(__pyx_t_35); + __Pyx_XGOTREF(__pyx_t_36); + /*try:*/ { + + /* "pandas/src/inference.pyx":524 + * else: + * try: + * status = floatify(val, &fval) # <<<<<<<<<<<<<< + * floats[i] = fval + * if not seen_float: + */ + __pyx_t_12 = floatify(__pyx_v_val, (&__pyx_v_fval)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_v_status = __pyx_t_12; + + /* "pandas/src/inference.pyx":525 + * try: + * status = floatify(val, &fval) + * floats[i] = fval # <<<<<<<<<<<<<< + * if not seen_float: + * if '.' in val or fval == INF or fval == NEGINF: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_fval; + + /* "pandas/src/inference.pyx":526 + * status = floatify(val, &fval) + * floats[i] = fval + * if not seen_float: # <<<<<<<<<<<<<< + * if '.' in val or fval == INF or fval == NEGINF: + * seen_float = True + */ + __pyx_t_31 = ((!(__pyx_v_seen_float != 0)) != 0); + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":527 + * floats[i] = fval + * if not seen_float: + * if '.' in val or fval == INF or fval == NEGINF: # <<<<<<<<<<<<<< + * seen_float = True + * elif 'inf' in val: # special case to handle +/-inf + */ + __pyx_t_31 = (__Pyx_PySequence_Contains(__pyx_kp_s__46, __pyx_v_val, Py_EQ)); if (unlikely(__pyx_t_31 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + if (!(__pyx_t_31 != 0)) { + __pyx_t_13 = ((__pyx_v_fval == __pyx_v_6pandas_3lib_INF) != 0); + if (!__pyx_t_13) { + __pyx_t_14 = ((__pyx_v_fval == __pyx_v_6pandas_3lib_NEGINF) != 0); + __pyx_t_38 = __pyx_t_14; + } else { + __pyx_t_38 = __pyx_t_13; + } + __pyx_t_13 = __pyx_t_38; + } else { + __pyx_t_13 = (__pyx_t_31 != 0); + } + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":528 + * if not seen_float: + * if '.' in val or fval == INF or fval == NEGINF: + * seen_float = True # <<<<<<<<<<<<<< + * elif 'inf' in val: # special case to handle +/-inf + * seen_float = True + */ + __pyx_v_seen_float = 1; + goto __pyx_L16; + } + + /* "pandas/src/inference.pyx":529 + * if '.' in val or fval == INF or fval == NEGINF: + * seen_float = True + * elif 'inf' in val: # special case to handle +/-inf # <<<<<<<<<<<<<< + * seen_float = True + * elif fval < fINT64_MAX and fval > fINT64_MIN: + */ + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_n_s_inf, __pyx_v_val, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_31 = (__pyx_t_13 != 0); + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":530 + * seen_float = True + * elif 'inf' in val: # special case to handle +/-inf + * seen_float = True # <<<<<<<<<<<<<< + * elif fval < fINT64_MAX and fval > fINT64_MIN: + * try: + */ + __pyx_v_seen_float = 1; + goto __pyx_L16; + } + + /* "pandas/src/inference.pyx":531 + * elif 'inf' in val: # special case to handle +/-inf + * seen_float = True + * elif fval < fINT64_MAX and fval > fINT64_MIN: # <<<<<<<<<<<<<< + * try: + * ints[i] = int(val) + */ + __pyx_t_31 = ((__pyx_v_fval < __pyx_v_6pandas_3lib_fINT64_MAX) != 0); + if (__pyx_t_31) { + __pyx_t_13 = ((__pyx_v_fval > __pyx_v_6pandas_3lib_fINT64_MIN) != 0); + __pyx_t_38 = __pyx_t_13; + } else { + __pyx_t_38 = __pyx_t_31; + } + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":532 + * seen_float = True + * elif fval < fINT64_MAX and fval > fINT64_MIN: + * try: # <<<<<<<<<<<<<< + * ints[i] = int(val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_39, &__pyx_t_40, &__pyx_t_41); + __Pyx_XGOTREF(__pyx_t_39); + __Pyx_XGOTREF(__pyx_t_40); + __Pyx_XGOTREF(__pyx_t_41); + /*try:*/ { + + /* "pandas/src/inference.pyx":533 + * elif fval < fINT64_MAX and fval > fINT64_MIN: + * try: + * ints[i] = int(val) # <<<<<<<<<<<<<< + * except ValueError: + * ints[i] = fval + */ + __pyx_t_5 = PyNumber_Int(__pyx_v_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_22 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_22 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_42 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_ints.diminfo[0].strides) = __pyx_t_22; + } + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_XDECREF(__pyx_t_40); __pyx_t_40 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":534 + * try: + * ints[i] = int(val) + * except ValueError: # <<<<<<<<<<<<<< + * ints[i] = fval + * else: + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":535 + * ints[i] = int(val) + * except ValueError: + * ints[i] = fval # <<<<<<<<<<<<<< + * else: + * seen_float = True + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_43 < 0) { + __pyx_t_43 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_43 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_ints.diminfo[0].strides) = ((__pyx_t_5numpy_int64_t)__pyx_v_fval); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L18_exception_handled; + } + goto __pyx_L19_except_error; + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_41); + __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_40, __pyx_t_41); + goto __pyx_L7_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_41); + __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_40, __pyx_t_41); + __pyx_L24_try_end:; + } + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/inference.pyx":537 + * ints[i] = fval + * else: + * seen_float = True # <<<<<<<<<<<<<< + * except: + * if not coerce_numeric: + */ + __pyx_v_seen_float = 1; + } + __pyx_L16:; + goto __pyx_L15; + } + __pyx_L15:; + } + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0; + __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":538 + * else: + * seen_float = True + * except: # <<<<<<<<<<<<<< + * if not coerce_numeric: + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/src/inference.pyx":539 + * seen_float = True + * except: + * if not coerce_numeric: # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_38 = ((!(__pyx_v_coerce_numeric != 0)) != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":540 + * except: + * if not coerce_numeric: + * raise # <<<<<<<<<<<<<< + * + * floats[i] = nan + */ + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_2, __pyx_t_5); + __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + } + + /* "pandas/src/inference.pyx":542 + * raise + * + * floats[i] = nan # <<<<<<<<<<<<<< + * seen_float = True + * + */ + __pyx_t_44 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_6pandas_3lib_nan; + + /* "pandas/src/inference.pyx":543 + * + * floats[i] = nan + * seen_float = True # <<<<<<<<<<<<<< + * + * if seen_complex: + */ + __pyx_v_seen_float = 1; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + __Pyx_XGIVEREF(__pyx_t_34); + __Pyx_XGIVEREF(__pyx_t_35); + __Pyx_XGIVEREF(__pyx_t_36); + __Pyx_ExceptionReset(__pyx_t_34, __pyx_t_35, __pyx_t_36); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_34); + __Pyx_XGIVEREF(__pyx_t_35); + __Pyx_XGIVEREF(__pyx_t_36); + __Pyx_ExceptionReset(__pyx_t_34, __pyx_t_35, __pyx_t_36); + __pyx_L14_try_end:; + } + } + __pyx_L5:; + } + + /* "pandas/src/inference.pyx":545 + * seen_float = True + * + * if seen_complex: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float: + */ + __pyx_t_38 = (__pyx_v_seen_complex != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":546 + * + * if seen_complex: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float: + * return floats + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":547 + * if seen_complex: + * return complexes + * elif seen_float: # <<<<<<<<<<<<<< + * return floats + * elif seen_int: + */ + __pyx_t_38 = (__pyx_v_seen_float != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":548 + * return complexes + * elif seen_float: + * return floats # <<<<<<<<<<<<<< + * elif seen_int: + * return ints + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":549 + * elif seen_float: + * return floats + * elif seen_int: # <<<<<<<<<<<<<< + * return ints + * elif seen_bool: + */ + __pyx_t_38 = (__pyx_v_seen_int != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":550 + * return floats + * elif seen_int: + * return ints # <<<<<<<<<<<<<< + * elif seen_bool: + * return bools.view(np.bool_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ints)); + __pyx_r = ((PyObject *)__pyx_v_ints); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":551 + * elif seen_int: + * return ints + * elif seen_bool: # <<<<<<<<<<<<<< + * return bools.view(np.bool_) + * return ints + */ + __pyx_t_38 = (__pyx_v_seen_bool != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":552 + * return ints + * elif seen_bool: + * return bools.view(np.bool_) # <<<<<<<<<<<<<< + * return ints + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bools), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":553 + * elif seen_bool: + * return bools.view(np.bool_) + * return ints # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ints)); + __pyx_r = ((PyObject *)__pyx_v_ints); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_floats); + __Pyx_XDECREF((PyObject *)__pyx_v_complexes); + __Pyx_XDECREF((PyObject *)__pyx_v_ints); + __Pyx_XDECREF((PyObject *)__pyx_v_bools); + __Pyx_XDECREF(__pyx_v_val); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":556 + * + * + * def maybe_convert_objects(ndarray[object] objects, bint try_float=0, # <<<<<<<<<<<<<< + * bint safe=0, bint convert_datetime=0, + * bint convert_timedelta=0): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_170maybe_convert_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_169maybe_convert_objects[] = "\n Type inference function-- convert object array to proper dtype\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_170maybe_convert_objects = {__Pyx_NAMESTR("maybe_convert_objects"), (PyCFunction)__pyx_pw_6pandas_3lib_170maybe_convert_objects, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_169maybe_convert_objects)}; +static PyObject *__pyx_pw_6pandas_3lib_170maybe_convert_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_objects = 0; + int __pyx_v_try_float; + int __pyx_v_safe; + int __pyx_v_convert_datetime; + int __pyx_v_convert_timedelta; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_convert_objects (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_try_float,&__pyx_n_s_safe,&__pyx_n_s_convert_datetime,&__pyx_n_s_convert_timedelta,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_try_float); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_safe); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert_datetime); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert_timedelta); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maybe_convert_objects") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_objects = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_try_float = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_try_float == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_try_float = ((int)0); + } + if (values[2]) { + __pyx_v_safe = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_safe = ((int)0); + } + if (values[3]) { + __pyx_v_convert_datetime = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_convert_datetime == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_convert_datetime = ((int)0); + } + if (values[4]) { + __pyx_v_convert_timedelta = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_convert_timedelta == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_convert_timedelta = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("maybe_convert_objects", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_objects), __pyx_ptype_5numpy_ndarray, 1, "objects", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_169maybe_convert_objects(__pyx_self, __pyx_v_objects, __pyx_v_try_float, __pyx_v_safe, __pyx_v_convert_datetime, __pyx_v_convert_timedelta); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_169maybe_convert_objects(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_objects, int __pyx_v_try_float, int __pyx_v_safe, int __pyx_v_convert_datetime, int __pyx_v_convert_timedelta) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_floats = 0; + PyArrayObject *__pyx_v_complexes = 0; + PyArrayObject *__pyx_v_ints = 0; + PyArrayObject *__pyx_v_bools = 0; + PyArrayObject *__pyx_v_idatetimes = 0; + PyArrayObject *__pyx_v_itimedeltas = 0; + int __pyx_v_seen_float; + int __pyx_v_seen_complex; + int __pyx_v_seen_datetime; + int __pyx_v_seen_timedelta; + int __pyx_v_seen_int; + int __pyx_v_seen_bool; + int __pyx_v_seen_object; + int __pyx_v_seen_null; + int __pyx_v_seen_numeric; + PyObject *__pyx_v_val = 0; + CYTHON_UNUSED PyObject *__pyx_v_onan = 0; + __pyx_t_5numpy_float64_t __pyx_v_fnan; + PyObject *__pyx_v_datetimes = NULL; + PyObject *__pyx_v_timedeltas = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bools; + __Pyx_Buffer __pyx_pybuffer_bools; + __Pyx_LocalBuf_ND __pyx_pybuffernd_complexes; + __Pyx_Buffer __pyx_pybuffer_complexes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_floats; + __Pyx_Buffer __pyx_pybuffer_floats; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idatetimes; + __Pyx_Buffer __pyx_pybuffer_idatetimes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ints; + __Pyx_Buffer __pyx_pybuffer_ints; + __Pyx_LocalBuf_ND __pyx_pybuffernd_itimedeltas; + __Pyx_Buffer __pyx_pybuffer_itimedeltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objects; + __Pyx_Buffer __pyx_pybuffer_objects; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + PyArrayObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyArrayObject *__pyx_t_16 = NULL; + PyArrayObject *__pyx_t_17 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + __pyx_t_5numpy_uint8_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_double_complex __pyx_t_26; + Py_ssize_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + double __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + int __pyx_t_39; + int __pyx_t_40; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_convert_objects", 0); + __pyx_pybuffer_floats.pybuffer.buf = NULL; + __pyx_pybuffer_floats.refcount = 0; + __pyx_pybuffernd_floats.data = NULL; + __pyx_pybuffernd_floats.rcbuffer = &__pyx_pybuffer_floats; + __pyx_pybuffer_complexes.pybuffer.buf = NULL; + __pyx_pybuffer_complexes.refcount = 0; + __pyx_pybuffernd_complexes.data = NULL; + __pyx_pybuffernd_complexes.rcbuffer = &__pyx_pybuffer_complexes; + __pyx_pybuffer_ints.pybuffer.buf = NULL; + __pyx_pybuffer_ints.refcount = 0; + __pyx_pybuffernd_ints.data = NULL; + __pyx_pybuffernd_ints.rcbuffer = &__pyx_pybuffer_ints; + __pyx_pybuffer_bools.pybuffer.buf = NULL; + __pyx_pybuffer_bools.refcount = 0; + __pyx_pybuffernd_bools.data = NULL; + __pyx_pybuffernd_bools.rcbuffer = &__pyx_pybuffer_bools; + __pyx_pybuffer_idatetimes.pybuffer.buf = NULL; + __pyx_pybuffer_idatetimes.refcount = 0; + __pyx_pybuffernd_idatetimes.data = NULL; + __pyx_pybuffernd_idatetimes.rcbuffer = &__pyx_pybuffer_idatetimes; + __pyx_pybuffer_itimedeltas.pybuffer.buf = NULL; + __pyx_pybuffer_itimedeltas.refcount = 0; + __pyx_pybuffernd_itimedeltas.data = NULL; + __pyx_pybuffernd_itimedeltas.rcbuffer = &__pyx_pybuffer_itimedeltas; + __pyx_pybuffer_objects.pybuffer.buf = NULL; + __pyx_pybuffer_objects.refcount = 0; + __pyx_pybuffernd_objects.data = NULL; + __pyx_pybuffernd_objects.rcbuffer = &__pyx_pybuffer_objects; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objects.rcbuffer->pybuffer, (PyObject*)__pyx_v_objects, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_objects.diminfo[0].strides = __pyx_pybuffernd_objects.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objects.diminfo[0].shape = __pyx_pybuffernd_objects.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":570 + * ndarray[int64_t] idatetimes + * ndarray[int64_t] itimedeltas + * bint seen_float = 0 # <<<<<<<<<<<<<< + * bint seen_complex = 0 + * bint seen_datetime = 0 + */ + __pyx_v_seen_float = 0; + + /* "pandas/src/inference.pyx":571 + * ndarray[int64_t] itimedeltas + * bint seen_float = 0 + * bint seen_complex = 0 # <<<<<<<<<<<<<< + * bint seen_datetime = 0 + * bint seen_timedelta = 0 + */ + __pyx_v_seen_complex = 0; + + /* "pandas/src/inference.pyx":572 + * bint seen_float = 0 + * bint seen_complex = 0 + * bint seen_datetime = 0 # <<<<<<<<<<<<<< + * bint seen_timedelta = 0 + * bint seen_int = 0 + */ + __pyx_v_seen_datetime = 0; + + /* "pandas/src/inference.pyx":573 + * bint seen_complex = 0 + * bint seen_datetime = 0 + * bint seen_timedelta = 0 # <<<<<<<<<<<<<< + * bint seen_int = 0 + * bint seen_bool = 0 + */ + __pyx_v_seen_timedelta = 0; + + /* "pandas/src/inference.pyx":574 + * bint seen_datetime = 0 + * bint seen_timedelta = 0 + * bint seen_int = 0 # <<<<<<<<<<<<<< + * bint seen_bool = 0 + * bint seen_object = 0 + */ + __pyx_v_seen_int = 0; + + /* "pandas/src/inference.pyx":575 + * bint seen_timedelta = 0 + * bint seen_int = 0 + * bint seen_bool = 0 # <<<<<<<<<<<<<< + * bint seen_object = 0 + * bint seen_null = 0 + */ + __pyx_v_seen_bool = 0; + + /* "pandas/src/inference.pyx":576 + * bint seen_int = 0 + * bint seen_bool = 0 + * bint seen_object = 0 # <<<<<<<<<<<<<< + * bint seen_null = 0 + * bint seen_numeric = 0 + */ + __pyx_v_seen_object = 0; + + /* "pandas/src/inference.pyx":577 + * bint seen_bool = 0 + * bint seen_object = 0 + * bint seen_null = 0 # <<<<<<<<<<<<<< + * bint seen_numeric = 0 + * object val, onan + */ + __pyx_v_seen_null = 0; + + /* "pandas/src/inference.pyx":578 + * bint seen_object = 0 + * bint seen_null = 0 + * bint seen_numeric = 0 # <<<<<<<<<<<<<< + * object val, onan + * float64_t fval, fnan + */ + __pyx_v_seen_numeric = 0; + + /* "pandas/src/inference.pyx":582 + * float64_t fval, fnan + * + * n = len(objects) # <<<<<<<<<<<<<< + * + * floats = np.empty(n, dtype='f8') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_objects)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":584 + * n = len(objects) + * + * floats = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * complexes = np.empty(n, dtype='c16') + * ints = np.empty(n, dtype='i8') + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_floats.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_floats.rcbuffer->pybuffer, (PyObject*)__pyx_v_floats, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_floats.diminfo[0].strides = __pyx_pybuffernd_floats.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_floats.diminfo[0].shape = __pyx_pybuffernd_floats.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_floats = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":585 + * + * floats = np.empty(n, dtype='f8') + * complexes = np.empty(n, dtype='c16') # <<<<<<<<<<<<<< + * ints = np.empty(n, dtype='i8') + * bools = np.empty(n, dtype=np.uint8) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_c16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer, (PyObject*)__pyx_v_complexes, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_complexes.diminfo[0].strides = __pyx_pybuffernd_complexes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_complexes.diminfo[0].shape = __pyx_pybuffernd_complexes.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_complexes = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":586 + * floats = np.empty(n, dtype='f8') + * complexes = np.empty(n, dtype='c16') + * ints = np.empty(n, dtype='i8') # <<<<<<<<<<<<<< + * bools = np.empty(n, dtype=np.uint8) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ints.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ints.rcbuffer->pybuffer, (PyObject*)__pyx_v_ints, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_ints.diminfo[0].strides = __pyx_pybuffernd_ints.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ints.diminfo[0].shape = __pyx_pybuffernd_ints.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_ints = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":587 + * complexes = np.empty(n, dtype='c16') + * ints = np.empty(n, dtype='i8') + * bools = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * + * if convert_datetime: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bools.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bools.rcbuffer->pybuffer, (PyObject*)__pyx_v_bools, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_bools.diminfo[0].strides = __pyx_pybuffernd_bools.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bools.diminfo[0].shape = __pyx_pybuffernd_bools.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_bools = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/inference.pyx":589 + * bools = np.empty(n, dtype=np.uint8) + * + * if convert_datetime: # <<<<<<<<<<<<<< + * datetimes = np.empty(n, dtype='M8[ns]') + * idatetimes = datetimes.view(np.int64) + */ + __pyx_t_15 = (__pyx_v_convert_datetime != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":590 + * + * if convert_datetime: + * datetimes = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * idatetimes = datetimes.view(np.int64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_datetimes = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":591 + * if convert_datetime: + * datetimes = np.empty(n, dtype='M8[ns]') + * idatetimes = datetimes.view(np.int64) # <<<<<<<<<<<<<< + * + * if convert_timedelta: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetimes, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer, (PyObject*)__pyx_v_idatetimes, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_idatetimes.diminfo[0].strides = __pyx_pybuffernd_idatetimes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idatetimes.diminfo[0].shape = __pyx_pybuffernd_idatetimes.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = 0; + __pyx_v_idatetimes = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/inference.pyx":593 + * idatetimes = datetimes.view(np.int64) + * + * if convert_timedelta: # <<<<<<<<<<<<<< + * timedeltas = np.empty(n, dtype='m8[ns]') + * itimedeltas = timedeltas.view(np.int64) + */ + __pyx_t_15 = (__pyx_v_convert_timedelta != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":594 + * + * if convert_timedelta: + * timedeltas = np.empty(n, dtype='m8[ns]') # <<<<<<<<<<<<<< + * itimedeltas = timedeltas.view(np.int64) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_kp_s_m8_ns) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_timedeltas = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":595 + * if convert_timedelta: + * timedeltas = np.empty(n, dtype='m8[ns]') + * itimedeltas = timedeltas.view(np.int64) # <<<<<<<<<<<<<< + * + * onan = np.nan + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timedeltas, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_itimedeltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_itimedeltas.diminfo[0].strides = __pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_itimedeltas.diminfo[0].shape = __pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = 0; + __pyx_v_itimedeltas = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":597 + * itimedeltas = timedeltas.view(np.int64) + * + * onan = np.nan # <<<<<<<<<<<<<< + * fnan = np.nan + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_onan = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":598 + * + * onan = np.nan + * fnan = np.nan # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_18 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_fnan = __pyx_t_18; + + /* "pandas/src/inference.pyx":600 + * fnan = np.nan + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = objects[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":601 + * + * for i from 0 <= i < n: + * val = objects[i] # <<<<<<<<<<<<<< + * + * if val is None: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_objects.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_objects.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objects.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_objects.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":603 + * val = objects[i] + * + * if val is None: # <<<<<<<<<<<<<< + * seen_null = 1 + * floats[i] = complexes[i] = fnan + */ + __pyx_t_15 = (__pyx_v_val == Py_None); + __pyx_t_20 = (__pyx_t_15 != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":604 + * + * if val is None: + * seen_null = 1 # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = fnan + * elif util.is_bool_object(val): + */ + __pyx_v_seen_null = 1; + + /* "pandas/src/inference.pyx":605 + * if val is None: + * seen_null = 1 + * floats[i] = complexes[i] = fnan # <<<<<<<<<<<<<< + * elif util.is_bool_object(val): + * seen_bool = 1 + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_fnan; + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(__pyx_v_fnan, 0); + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":606 + * seen_null = 1 + * floats[i] = complexes[i] = fnan + * elif util.is_bool_object(val): # <<<<<<<<<<<<<< + * seen_bool = 1 + * bools[i] = val + */ + __pyx_t_20 = (is_bool_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":607 + * floats[i] = complexes[i] = fnan + * elif util.is_bool_object(val): + * seen_bool = 1 # <<<<<<<<<<<<<< + * bools[i] = val + * elif util.is_float_object(val): + */ + __pyx_v_seen_bool = 1; + + /* "pandas/src/inference.pyx":608 + * elif util.is_bool_object(val): + * seen_bool = 1 + * bools[i] = val # <<<<<<<<<<<<<< + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val + */ + __pyx_t_23 = __Pyx_PyInt_As_npy_uint8(__pyx_v_val); if (unlikely((__pyx_t_23 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_bools.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_bools.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_bools.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_bools.diminfo[0].strides) = __pyx_t_23; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":609 + * seen_bool = 1 + * bools[i] = val + * elif util.is_float_object(val): # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = val + * seen_float = 1 + */ + __pyx_t_20 = (is_float_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":610 + * bools[i] = val + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val # <<<<<<<<<<<<<< + * seen_float = 1 + * elif util.is_datetime64_object(val): + */ + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_18 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_25 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_18; + __pyx_t_26 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_26; + + /* "pandas/src/inference.pyx":611 + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val + * seen_float = 1 # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * if convert_datetime: + */ + __pyx_v_seen_float = 1; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":612 + * floats[i] = complexes[i] = val + * seen_float = 1 + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * if convert_datetime: + * idatetimes[i] = convert_to_tsobject(val, None, None).value + */ + __pyx_t_20 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":613 + * seen_float = 1 + * elif util.is_datetime64_object(val): + * if convert_datetime: # <<<<<<<<<<<<<< + * idatetimes[i] = convert_to_tsobject(val, None, None).value + * seen_datetime = 1 + */ + __pyx_t_20 = (__pyx_v_convert_datetime != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":614 + * elif util.is_datetime64_object(val): + * if convert_datetime: + * idatetimes[i] = convert_to_tsobject(val, None, None).value # <<<<<<<<<<<<<< + * seen_datetime = 1 + * else: + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_val, Py_None, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_28 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_idatetimes.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_idatetimes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idatetimes.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_idatetimes.diminfo[0].strides) = __pyx_t_28; + + /* "pandas/src/inference.pyx":615 + * if convert_datetime: + * idatetimes[i] = convert_to_tsobject(val, None, None).value + * seen_datetime = 1 # <<<<<<<<<<<<<< + * else: + * seen_object = 1 + */ + __pyx_v_seen_datetime = 1; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/inference.pyx":617 + * seen_datetime = 1 + * else: + * seen_object = 1 # <<<<<<<<<<<<<< + * # objects[i] = val.astype('O') + * break + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":619 + * seen_object = 1 + * # objects[i] = val.astype('O') + * break # <<<<<<<<<<<<<< + * elif is_timedelta(val): + * if convert_timedelta: + */ + goto __pyx_L6_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":620 + * # objects[i] = val.astype('O') + * break + * elif is_timedelta(val): # <<<<<<<<<<<<<< + * if convert_timedelta: + * itimedeltas[i] = convert_to_timedelta64(val, 'ns', False) + */ + __pyx_t_20 = (__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":621 + * break + * elif is_timedelta(val): + * if convert_timedelta: # <<<<<<<<<<<<<< + * itimedeltas[i] = convert_to_timedelta64(val, 'ns', False) + * seen_timedelta = 1 + */ + __pyx_t_20 = (__pyx_v_convert_timedelta != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":622 + * elif is_timedelta(val): + * if convert_timedelta: + * itimedeltas[i] = convert_to_timedelta64(val, 'ns', False) # <<<<<<<<<<<<<< + * seen_timedelta = 1 + * else: + */ + __pyx_t_4 = __pyx_f_6pandas_5tslib_convert_to_timedelta64(__pyx_v_val, __pyx_n_s_ns, Py_False); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_28 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_30 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_itimedeltas.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_itimedeltas.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_itimedeltas.diminfo[0].strides) = __pyx_t_28; + + /* "pandas/src/inference.pyx":623 + * if convert_timedelta: + * itimedeltas[i] = convert_to_timedelta64(val, 'ns', False) + * seen_timedelta = 1 # <<<<<<<<<<<<<< + * else: + * seen_object = 1 + */ + __pyx_v_seen_timedelta = 1; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/inference.pyx":625 + * seen_timedelta = 1 + * else: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * elif util.is_integer_object(val): + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":626 + * else: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * elif util.is_integer_object(val): + * seen_int = 1 + */ + goto __pyx_L6_break; + } + __pyx_L9:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":627 + * seen_object = 1 + * break + * elif util.is_integer_object(val): # <<<<<<<<<<<<<< + * seen_int = 1 + * floats[i] = val + */ + __pyx_t_20 = (is_integer_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":628 + * break + * elif util.is_integer_object(val): + * seen_int = 1 # <<<<<<<<<<<<<< + * floats[i] = val + * complexes[i] = val + */ + __pyx_v_seen_int = 1; + + /* "pandas/src/inference.pyx":629 + * elif util.is_integer_object(val): + * seen_int = 1 + * floats[i] = val # <<<<<<<<<<<<<< + * complexes[i] = val + * if not seen_null: + */ + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_18 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_31 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_floats.diminfo[0].strides) = ((__pyx_t_5numpy_float64_t)__pyx_t_18); + + /* "pandas/src/inference.pyx":630 + * seen_int = 1 + * floats[i] = val + * complexes[i] = val # <<<<<<<<<<<<<< + * if not seen_null: + * try: + */ + __pyx_t_26 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_32 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(((double)__Pyx_CREAL(__pyx_t_26)), ((double)__Pyx_CIMAG(__pyx_t_26))); + + /* "pandas/src/inference.pyx":631 + * floats[i] = val + * complexes[i] = val + * if not seen_null: # <<<<<<<<<<<<<< + * try: + * ints[i] = val + */ + __pyx_t_20 = ((!(__pyx_v_seen_null != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":632 + * complexes[i] = val + * if not seen_null: + * try: # <<<<<<<<<<<<<< + * ints[i] = val + * except OverflowError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/src/inference.pyx":633 + * if not seen_null: + * try: + * ints[i] = val # <<<<<<<<<<<<<< + * except OverflowError: + * seen_object = 1 + */ + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_28 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __pyx_t_33 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_ints.diminfo[0].strides) = __pyx_t_28; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L18_try_end; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":634 + * try: + * ints[i] = val + * except OverflowError: # <<<<<<<<<<<<<< + * seen_object = 1 + * break + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/src/inference.pyx":635 + * ints[i] = val + * except OverflowError: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * elif util.is_complex_object(val): + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":636 + * except OverflowError: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * elif util.is_complex_object(val): + * complexes[i] = val + */ + goto __pyx_L19_except_break; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L12_exception_handled; + __pyx_L19_except_break:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L16_try_break; + } + goto __pyx_L13_except_error; + __pyx_L13_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L16_try_break:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L6_break; + __pyx_L12_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L18_try_end:; + } + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":637 + * seen_object = 1 + * break + * elif util.is_complex_object(val): # <<<<<<<<<<<<<< + * complexes[i] = val + * seen_complex = 1 + */ + __pyx_t_20 = (is_complex_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":638 + * break + * elif util.is_complex_object(val): + * complexes[i] = val # <<<<<<<<<<<<<< + * seen_complex = 1 + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): + */ + __pyx_t_26 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_34 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_26; + + /* "pandas/src/inference.pyx":639 + * elif util.is_complex_object(val): + * complexes[i] = val + * seen_complex = 1 # <<<<<<<<<<<<<< + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): + * if convert_datetime: + */ + __pyx_v_seen_complex = 1; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":640 + * complexes[i] = val + * seen_complex = 1 + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * if convert_datetime: + * seen_datetime = 1 + */ + __pyx_t_20 = PyDateTime_Check(__pyx_v_val); + if (!__pyx_t_20) { + __pyx_t_15 = (is_datetime64_object(__pyx_v_val) != 0); + } else { + __pyx_t_15 = __pyx_t_20; + } + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":641 + * seen_complex = 1 + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): + * if convert_datetime: # <<<<<<<<<<<<<< + * seen_datetime = 1 + * idatetimes[i] = convert_to_tsobject(val, None, None).value + */ + __pyx_t_15 = (__pyx_v_convert_datetime != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":642 + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): + * if convert_datetime: + * seen_datetime = 1 # <<<<<<<<<<<<<< + * idatetimes[i] = convert_to_tsobject(val, None, None).value + * else: + */ + __pyx_v_seen_datetime = 1; + + /* "pandas/src/inference.pyx":643 + * if convert_datetime: + * seen_datetime = 1 + * idatetimes[i] = convert_to_tsobject(val, None, None).value # <<<<<<<<<<<<<< + * else: + * seen_object = 1 + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_val, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_28 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_35 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_idatetimes.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_idatetimes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idatetimes.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_idatetimes.diminfo[0].strides) = __pyx_t_28; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/inference.pyx":645 + * idatetimes[i] = convert_to_tsobject(val, None, None).value + * else: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * elif try_float and not util.is_string_object(val): + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":646 + * else: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * elif try_float and not util.is_string_object(val): + * # this will convert Decimal objects + */ + goto __pyx_L6_break; + } + __pyx_L21:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":647 + * seen_object = 1 + * break + * elif try_float and not util.is_string_object(val): # <<<<<<<<<<<<<< + * # this will convert Decimal objects + * try: + */ + if ((__pyx_v_try_float != 0)) { + __pyx_t_15 = ((!(is_string_object(__pyx_v_val) != 0)) != 0); + __pyx_t_20 = __pyx_t_15; + } else { + __pyx_t_20 = (__pyx_v_try_float != 0); + } + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":649 + * elif try_float and not util.is_string_object(val): + * # this will convert Decimal objects + * try: # <<<<<<<<<<<<<< + * floats[i] = float(val) + * complexes[i] = complex(val) + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/inference.pyx":650 + * # this will convert Decimal objects + * try: + * floats[i] = float(val) # <<<<<<<<<<<<<< + * complexes[i] = complex(val) + * seen_float = 1 + */ + __pyx_t_36 = __Pyx_PyObject_AsDouble(__pyx_v_val); if (unlikely(__pyx_t_36 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_37 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_36; + + /* "pandas/src/inference.pyx":651 + * try: + * floats[i] = float(val) + * complexes[i] = complex(val) # <<<<<<<<<<<<<< + * seen_float = 1 + * except Exception: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyComplex_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_26 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_38 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_26; + + /* "pandas/src/inference.pyx":652 + * floats[i] = float(val) + * complexes[i] = complex(val) + * seen_float = 1 # <<<<<<<<<<<<<< + * except Exception: + * seen_object = 1 + */ + __pyx_v_seen_float = 1; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":653 + * complexes[i] = complex(val) + * seen_float = 1 + * except Exception: # <<<<<<<<<<<<<< + * seen_object = 1 + * break + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":654 + * seen_float = 1 + * except Exception: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":655 + * except Exception: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * else: + * seen_object = 1 + */ + goto __pyx_L30_except_break; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L23_exception_handled; + __pyx_L30_except_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L27_try_break; + } + goto __pyx_L24_except_error; + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L27_try_break:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L6_break; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L29_try_end:; + } + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/inference.pyx":657 + * break + * else: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":658 + * else: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * + * seen_numeric = seen_complex or seen_float or seen_int + */ + goto __pyx_L6_break; + } + __pyx_L7:; + } + __pyx_L6_break:; + + /* "pandas/src/inference.pyx":660 + * break + * + * seen_numeric = seen_complex or seen_float or seen_int # <<<<<<<<<<<<<< + * + * if not seen_object: + */ + if (!__pyx_v_seen_complex) { + if (!__pyx_v_seen_float) { + __pyx_t_20 = __pyx_v_seen_int; + } else { + __pyx_t_20 = __pyx_v_seen_float; + } + __pyx_t_15 = __pyx_t_20; + } else { + __pyx_t_15 = __pyx_v_seen_complex; + } + __pyx_v_seen_numeric = __pyx_t_15; + + /* "pandas/src/inference.pyx":662 + * seen_numeric = seen_complex or seen_float or seen_int + * + * if not seen_object: # <<<<<<<<<<<<<< + * + * if not safe: + */ + __pyx_t_15 = ((!(__pyx_v_seen_object != 0)) != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":664 + * if not seen_object: + * + * if not safe: # <<<<<<<<<<<<<< + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: + */ + __pyx_t_15 = ((!(__pyx_v_safe != 0)) != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":665 + * + * if not safe: + * if seen_null: # <<<<<<<<<<<<<< + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: + */ + __pyx_t_15 = (__pyx_v_seen_null != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":666 + * if not safe: + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: # <<<<<<<<<<<<<< + * if seen_complex: + * return complexes + */ + __pyx_t_15 = ((!(__pyx_v_seen_bool != 0)) != 0); + if (__pyx_t_15) { + __pyx_t_20 = ((!(__pyx_v_seen_datetime != 0)) != 0); + if (__pyx_t_20) { + __pyx_t_39 = ((!(__pyx_v_seen_timedelta != 0)) != 0); + __pyx_t_40 = __pyx_t_39; + } else { + __pyx_t_40 = __pyx_t_20; + } + __pyx_t_20 = __pyx_t_40; + } else { + __pyx_t_20 = __pyx_t_15; + } + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":667 + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float or seen_int: + */ + __pyx_t_20 = (__pyx_v_seen_complex != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":668 + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float or seen_int: + * return floats + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":669 + * if seen_complex: + * return complexes + * elif seen_float or seen_int: # <<<<<<<<<<<<<< + * return floats + * else: + */ + if (!(__pyx_v_seen_float != 0)) { + __pyx_t_20 = (__pyx_v_seen_int != 0); + } else { + __pyx_t_20 = (__pyx_v_seen_float != 0); + } + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":670 + * return complexes + * elif seen_float or seen_int: + * return floats # <<<<<<<<<<<<<< + * else: + * if not seen_bool: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + goto __pyx_L35; + } + __pyx_L35:; + goto __pyx_L34; + } + /*else*/ { + + /* "pandas/src/inference.pyx":672 + * return floats + * else: + * if not seen_bool: # <<<<<<<<<<<<<< + * if seen_datetime: + * if not seen_numeric: + */ + __pyx_t_20 = ((!(__pyx_v_seen_bool != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":673 + * else: + * if not seen_bool: + * if seen_datetime: # <<<<<<<<<<<<<< + * if not seen_numeric: + * return datetimes + */ + __pyx_t_20 = (__pyx_v_seen_datetime != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":674 + * if not seen_bool: + * if seen_datetime: + * if not seen_numeric: # <<<<<<<<<<<<<< + * return datetimes + * elif seen_timedelta: + */ + __pyx_t_20 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":675 + * if seen_datetime: + * if not seen_numeric: + * return datetimes # <<<<<<<<<<<<<< + * elif seen_timedelta: + * if not seen_numeric: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_datetimes)) { __Pyx_RaiseUnboundLocalError("datetimes"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_datetimes); + __pyx_r = __pyx_v_datetimes; + goto __pyx_L0; + } + goto __pyx_L38; + } + + /* "pandas/src/inference.pyx":676 + * if not seen_numeric: + * return datetimes + * elif seen_timedelta: # <<<<<<<<<<<<<< + * if not seen_numeric: + * return timedeltas + */ + __pyx_t_20 = (__pyx_v_seen_timedelta != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":677 + * return datetimes + * elif seen_timedelta: + * if not seen_numeric: # <<<<<<<<<<<<<< + * return timedeltas + * else: + */ + __pyx_t_20 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":678 + * elif seen_timedelta: + * if not seen_numeric: + * return timedeltas # <<<<<<<<<<<<<< + * else: + * if seen_complex: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_timedeltas)) { __Pyx_RaiseUnboundLocalError("timedeltas"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_timedeltas); + __pyx_r = __pyx_v_timedeltas; + goto __pyx_L0; + } + goto __pyx_L38; + } + /*else*/ { + + /* "pandas/src/inference.pyx":680 + * return timedeltas + * else: + * if seen_complex: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float: + */ + __pyx_t_20 = (__pyx_v_seen_complex != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":681 + * else: + * if seen_complex: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float: + * return floats + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":682 + * if seen_complex: + * return complexes + * elif seen_float: # <<<<<<<<<<<<<< + * return floats + * elif seen_int: + */ + __pyx_t_20 = (__pyx_v_seen_float != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":683 + * return complexes + * elif seen_float: + * return floats # <<<<<<<<<<<<<< + * elif seen_int: + * return ints + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":684 + * elif seen_float: + * return floats + * elif seen_int: # <<<<<<<<<<<<<< + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + */ + __pyx_t_20 = (__pyx_v_seen_int != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":685 + * return floats + * elif seen_int: + * return ints # <<<<<<<<<<<<<< + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + * return bools.view(np.bool_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ints)); + __pyx_r = ((PyObject *)__pyx_v_ints); + goto __pyx_L0; + } + } + __pyx_L38:; + goto __pyx_L37; + } + + /* "pandas/src/inference.pyx":686 + * elif seen_int: + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: # <<<<<<<<<<<<<< + * return bools.view(np.bool_) + * + */ + __pyx_t_20 = ((!(__pyx_v_seen_datetime != 0)) != 0); + if (__pyx_t_20) { + __pyx_t_15 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_15) { + __pyx_t_40 = ((!(__pyx_v_seen_timedelta != 0)) != 0); + __pyx_t_39 = __pyx_t_40; + } else { + __pyx_t_39 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_39; + } else { + __pyx_t_15 = __pyx_t_20; + } + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":687 + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + * return bools.view(np.bool_) # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bools), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + __pyx_L37:; + } + __pyx_L34:; + goto __pyx_L33; + } + /*else*/ { + + /* "pandas/src/inference.pyx":691 + * else: + * # don't cast int to float, etc. + * if seen_null: # <<<<<<<<<<<<<< + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: + */ + __pyx_t_15 = (__pyx_v_seen_null != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":692 + * # don't cast int to float, etc. + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: # <<<<<<<<<<<<<< + * if seen_complex: + * if not seen_int: + */ + __pyx_t_15 = ((!(__pyx_v_seen_bool != 0)) != 0); + if (__pyx_t_15) { + __pyx_t_20 = ((!(__pyx_v_seen_datetime != 0)) != 0); + if (__pyx_t_20) { + __pyx_t_39 = ((!(__pyx_v_seen_timedelta != 0)) != 0); + __pyx_t_40 = __pyx_t_39; + } else { + __pyx_t_40 = __pyx_t_20; + } + __pyx_t_20 = __pyx_t_40; + } else { + __pyx_t_20 = __pyx_t_15; + } + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":693 + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: # <<<<<<<<<<<<<< + * if not seen_int: + * return complexes + */ + __pyx_t_20 = (__pyx_v_seen_complex != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":694 + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: + * if not seen_int: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float: + */ + __pyx_t_20 = ((!(__pyx_v_seen_int != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":695 + * if seen_complex: + * if not seen_int: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float: + * if not seen_int: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + goto __pyx_L44; + } + + /* "pandas/src/inference.pyx":696 + * if not seen_int: + * return complexes + * elif seen_float: # <<<<<<<<<<<<<< + * if not seen_int: + * return floats + */ + __pyx_t_20 = (__pyx_v_seen_float != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":697 + * return complexes + * elif seen_float: + * if not seen_int: # <<<<<<<<<<<<<< + * return floats + * else: + */ + __pyx_t_20 = ((!(__pyx_v_seen_int != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":698 + * elif seen_float: + * if not seen_int: + * return floats # <<<<<<<<<<<<<< + * else: + * if not seen_bool: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + goto __pyx_L44; + } + __pyx_L44:; + goto __pyx_L43; + } + __pyx_L43:; + goto __pyx_L42; + } + /*else*/ { + + /* "pandas/src/inference.pyx":700 + * return floats + * else: + * if not seen_bool: # <<<<<<<<<<<<<< + * if seen_datetime: + * if not seen_numeric: + */ + __pyx_t_20 = ((!(__pyx_v_seen_bool != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":701 + * else: + * if not seen_bool: + * if seen_datetime: # <<<<<<<<<<<<<< + * if not seen_numeric: + * return datetimes + */ + __pyx_t_20 = (__pyx_v_seen_datetime != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":702 + * if not seen_bool: + * if seen_datetime: + * if not seen_numeric: # <<<<<<<<<<<<<< + * return datetimes + * elif seen_timedelta: + */ + __pyx_t_20 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":703 + * if seen_datetime: + * if not seen_numeric: + * return datetimes # <<<<<<<<<<<<<< + * elif seen_timedelta: + * if not seen_numeric: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_datetimes)) { __Pyx_RaiseUnboundLocalError("datetimes"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_datetimes); + __pyx_r = __pyx_v_datetimes; + goto __pyx_L0; + } + goto __pyx_L48; + } + + /* "pandas/src/inference.pyx":704 + * if not seen_numeric: + * return datetimes + * elif seen_timedelta: # <<<<<<<<<<<<<< + * if not seen_numeric: + * return timedeltas + */ + __pyx_t_20 = (__pyx_v_seen_timedelta != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":705 + * return datetimes + * elif seen_timedelta: + * if not seen_numeric: # <<<<<<<<<<<<<< + * return timedeltas + * else: + */ + __pyx_t_20 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":706 + * elif seen_timedelta: + * if not seen_numeric: + * return timedeltas # <<<<<<<<<<<<<< + * else: + * if seen_complex: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_timedeltas)) { __Pyx_RaiseUnboundLocalError("timedeltas"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_timedeltas); + __pyx_r = __pyx_v_timedeltas; + goto __pyx_L0; + } + goto __pyx_L48; + } + /*else*/ { + + /* "pandas/src/inference.pyx":708 + * return timedeltas + * else: + * if seen_complex: # <<<<<<<<<<<<<< + * if not seen_int: + * return complexes + */ + __pyx_t_20 = (__pyx_v_seen_complex != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":709 + * else: + * if seen_complex: + * if not seen_int: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float: + */ + __pyx_t_20 = ((!(__pyx_v_seen_int != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":710 + * if seen_complex: + * if not seen_int: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float: + * if not seen_int: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + goto __pyx_L51; + } + + /* "pandas/src/inference.pyx":711 + * if not seen_int: + * return complexes + * elif seen_float: # <<<<<<<<<<<<<< + * if not seen_int: + * return floats + */ + __pyx_t_20 = (__pyx_v_seen_float != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":712 + * return complexes + * elif seen_float: + * if not seen_int: # <<<<<<<<<<<<<< + * return floats + * elif seen_int: + */ + __pyx_t_20 = ((!(__pyx_v_seen_int != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":713 + * elif seen_float: + * if not seen_int: + * return floats # <<<<<<<<<<<<<< + * elif seen_int: + * return ints + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + goto __pyx_L51; + } + + /* "pandas/src/inference.pyx":714 + * if not seen_int: + * return floats + * elif seen_int: # <<<<<<<<<<<<<< + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + */ + __pyx_t_20 = (__pyx_v_seen_int != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":715 + * return floats + * elif seen_int: + * return ints # <<<<<<<<<<<<<< + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + * return bools.view(np.bool_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ints)); + __pyx_r = ((PyObject *)__pyx_v_ints); + goto __pyx_L0; + } + __pyx_L51:; + } + __pyx_L48:; + goto __pyx_L47; + } + + /* "pandas/src/inference.pyx":716 + * elif seen_int: + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: # <<<<<<<<<<<<<< + * return bools.view(np.bool_) + * + */ + __pyx_t_20 = ((!(__pyx_v_seen_datetime != 0)) != 0); + if (__pyx_t_20) { + __pyx_t_15 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_15) { + __pyx_t_40 = ((!(__pyx_v_seen_timedelta != 0)) != 0); + __pyx_t_39 = __pyx_t_40; + } else { + __pyx_t_39 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_39; + } else { + __pyx_t_15 = __pyx_t_20; + } + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":717 + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + * return bools.view(np.bool_) # <<<<<<<<<<<<<< + * + * return objects + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bools), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + __pyx_L47:; + } + __pyx_L42:; + } + __pyx_L33:; + goto __pyx_L32; + } + __pyx_L32:; + + /* "pandas/src/inference.pyx":719 + * return bools.view(np.bool_) + * + * return objects # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_objects)); + __pyx_r = ((PyObject *)__pyx_v_objects); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":556 + * + * + * def maybe_convert_objects(ndarray[object] objects, bint try_float=0, # <<<<<<<<<<<<<< + * bint safe=0, bint convert_datetime=0, + * bint convert_timedelta=0): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objects.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objects.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_floats); + __Pyx_XDECREF((PyObject *)__pyx_v_complexes); + __Pyx_XDECREF((PyObject *)__pyx_v_ints); + __Pyx_XDECREF((PyObject *)__pyx_v_bools); + __Pyx_XDECREF((PyObject *)__pyx_v_idatetimes); + __Pyx_XDECREF((PyObject *)__pyx_v_itimedeltas); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_onan); + __Pyx_XDECREF(__pyx_v_datetimes); + __Pyx_XDECREF(__pyx_v_timedeltas); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":722 + * + * + * def convert_sql_column(x): # <<<<<<<<<<<<<< + * return maybe_convert_objects(x, try_float=1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_172convert_sql_column(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_172convert_sql_column = {__Pyx_NAMESTR("convert_sql_column"), (PyCFunction)__pyx_pw_6pandas_3lib_172convert_sql_column, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_172convert_sql_column(PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_sql_column (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_171convert_sql_column(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_171convert_sql_column(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_sql_column", 0); + + /* "pandas/src/inference.pyx":723 + * + * def convert_sql_column(x): + * return maybe_convert_objects(x, try_float=1) # <<<<<<<<<<<<<< + * + * def try_parse_dates(ndarray[object] values, parser=None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_try_float, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":722 + * + * + * def convert_sql_column(x): # <<<<<<<<<<<<<< + * return maybe_convert_objects(x, try_float=1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.convert_sql_column", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_174try_parse_dates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_174try_parse_dates = {__Pyx_NAMESTR("try_parse_dates"), (PyCFunction)__pyx_pw_6pandas_3lib_174try_parse_dates, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_174try_parse_dates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_parser = 0; + PyObject *__pyx_v_dayfirst = 0; + PyObject *__pyx_v_default = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("try_parse_dates (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_parser,&__pyx_n_s_dayfirst,&__pyx_n_s_default,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + + /* "pandas/src/inference.pyx":726 + * + * def try_parse_dates(ndarray[object] values, parser=None, + * dayfirst=False,default=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dayfirst); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "try_parse_dates") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_parser = values[1]; + __pyx_v_dayfirst = values[2]; + __pyx_v_default = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("try_parse_dates", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_173try_parse_dates(__pyx_self, __pyx_v_values, __pyx_v_parser, __pyx_v_dayfirst, __pyx_v_default); + + /* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":743 + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return datetime.strptime(s, '%m/%d/%Y') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_15try_parse_dates_1parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_15try_parse_dates_1parse_date = {__Pyx_NAMESTR("parse_date"), (PyCFunction)__pyx_pw_6pandas_3lib_15try_parse_dates_1parse_date, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_15try_parse_dates_1parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parse_date (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_15try_parse_dates_parse_date(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_15try_parse_dates_parse_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_date", 0); + + /* "pandas/src/inference.pyx":744 + * except ImportError: # pragma: no cover + * def parse_date(s): + * try: # <<<<<<<<<<<<<< + * return datetime.strptime(s, '%m/%d/%Y') + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/inference.pyx":745 + * def parse_date(s): + * try: + * return datetime.strptime(s, '%m/%d/%Y') # <<<<<<<<<<<<<< + * except Exception: + * return s + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __Pyx_INCREF(__pyx_kp_s_m_d_Y); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_m_d_Y); + __Pyx_GIVEREF(__pyx_kp_s_m_d_Y); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":746 + * try: + * return datetime.strptime(s, '%m/%d/%Y') + * except Exception: # <<<<<<<<<<<<<< + * return s + * # EAFP here + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_dates.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":747 + * return datetime.strptime(s, '%m/%d/%Y') + * except Exception: + * return s # <<<<<<<<<<<<<< + * # EAFP here + * try: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/inference.pyx":743 + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return datetime.strptime(s, '%m/%d/%Y') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.try_parse_dates.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":741 + * try: + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_date(s): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_15try_parse_dates_2lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_15try_parse_dates_2lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_6pandas_3lib_15try_parse_dates_2lambda1, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_15try_parse_dates_2lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lambda1", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_v_dayfirst)) { __Pyx_RaiseClosureNameError("dayfirst"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dayfirst, __pyx_cur_scope->__pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_default)) { __Pyx_RaiseClosureNameError("default"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_cur_scope->__pyx_v_default) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_parse, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.try_parse_dates.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + +static PyObject *__pyx_pf_6pandas_3lib_173try_parse_dates(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_parser, PyObject *__pyx_v_dayfirst, PyObject *__pyx_v_default) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *__pyx_cur_scope; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_date = NULL; + PyObject *__pyx_v_parse_date = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("try_parse_dates", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)__pyx_tp_new_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(__pyx_ptype_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_dayfirst = __pyx_v_dayfirst; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dayfirst); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dayfirst); + __pyx_cur_scope->__pyx_v_default = __pyx_v_default; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":731 + * ndarray[object] result + * + * n = len(values) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":732 + * + * n = len(values) + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * if parser is None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":734 + * result = np.empty(n, dtype='O') + * + * if parser is None: # <<<<<<<<<<<<<< + * if default is None: # GH2618 + * date=datetime.now() + */ + __pyx_t_11 = (__pyx_v_parser == Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":735 + * + * if parser is None: + * if default is None: # GH2618 # <<<<<<<<<<<<<< + * date=datetime.now() + * default=datetime(date.year,date.month,1) + */ + __pyx_t_12 = (__pyx_cur_scope->__pyx_v_default == Py_None); + __pyx_t_11 = (__pyx_t_12 != 0); + if (__pyx_t_11) { + + /* "pandas/src/inference.pyx":736 + * if parser is None: + * if default is None: # GH2618 + * date=datetime.now() # <<<<<<<<<<<<<< + * default=datetime(date.year,date.month,1) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_now); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_date = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":737 + * if default is None: # GH2618 + * date=datetime.now() + * default=datetime(date.year,date.month,1) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_default); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_default, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":739 + * default=datetime(date.year,date.month,1) + * + * try: # <<<<<<<<<<<<<< + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/inference.pyx":740 + * + * try: + * from dateutil.parser import parse # <<<<<<<<<<<<<< + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_parse); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_parse); + __Pyx_GIVEREF(__pyx_n_s_parse); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_dateutil_parser, __pyx_t_5, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_parse); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_cur_scope->__pyx_v_parse = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":741 + * try: + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_date(s): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_15try_parse_dates_2lambda1, 0, __pyx_n_s_try_parse_dates_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_parse_date = __pyx_t_4; + __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":742 + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover # <<<<<<<<<<<<<< + * def parse_date(s): + * try: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/src/inference.pyx":743 + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return datetime.strptime(s, '%m/%d/%Y') + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_15try_parse_dates_1parse_date, 0, __pyx_n_s_try_parse_dates_locals_parse_dat, NULL, __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_parse_date, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L6_exception_handled; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L12_try_end:; + } + + /* "pandas/src/inference.pyx":749 + * return s + * # EAFP here + * try: # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * if values[i] == '': + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/src/inference.pyx":750 + * # EAFP here + * try: + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * if values[i] == '': + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":751 + * try: + * for i from 0 <= i < n: + * if values[i] == '': # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__49, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_11) { + + /* "pandas/src/inference.pyx":752 + * for i from 0 <= i < n: + * if values[i] == '': + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * result[i] = parse_date(values[i]) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/inference.pyx":754 + * result[i] = np.nan + * else: + * result[i] = parse_date(values[i]) # <<<<<<<<<<<<<< + * except Exception: + * # failed + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_parse_date, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L25:; + } + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L22_try_end; + __pyx_L15_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":755 + * else: + * result[i] = parse_date(values[i]) + * except Exception: # <<<<<<<<<<<<<< + * # failed + * return values + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":757 + * except Exception: + * # failed + * return values # <<<<<<<<<<<<<< + * else: + * parse_date = parser + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_r = ((PyObject *)__pyx_v_values); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_except_return; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L16_exception_handled; + } + goto __pyx_L17_except_error; + __pyx_L17_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L18_except_return:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L0; + __pyx_L16_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L22_try_end:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/inference.pyx":759 + * return values + * else: + * parse_date = parser # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_INCREF(__pyx_v_parser); + __pyx_v_parse_date = __pyx_v_parser; + + /* "pandas/src/inference.pyx":761 + * parse_date = parser + * + * try: # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * if values[i] == '': + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/inference.pyx":762 + * + * try: + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * if values[i] == '': + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":763 + * try: + * for i from 0 <= i < n: + * if values[i] == '': # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + } + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__49, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_11) { + + /* "pandas/src/inference.pyx":764 + * for i from 0 <= i < n: + * if values[i] == '': + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * result[i] = parse_date(values[i]) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L38; + } + /*else*/ { + + /* "pandas/src/inference.pyx":766 + * result[i] = np.nan + * else: + * result[i] = parse_date(values[i]) # <<<<<<<<<<<<<< + * except Exception: + * # raise if passed parser and it failed + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_parse_date, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L38:; + } + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L35_try_end; + __pyx_L28_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":767 + * else: + * result[i] = parse_date(values[i]) + * except Exception: # <<<<<<<<<<<<<< + * # raise if passed parser and it failed + * raise + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/src/inference.pyx":769 + * except Exception: + * # raise if passed parser and it failed + * raise # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_2, __pyx_t_4, __pyx_t_5); + __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L29_exception_handled; + } + goto __pyx_L30_except_error; + __pyx_L30_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L29_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L35_try_end:; + } + } + __pyx_L3:; + + /* "pandas/src/inference.pyx":771 + * raise + * + * return result # <<<<<<<<<<<<<< + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_date); + __Pyx_XDECREF(__pyx_v_parse_date); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_176try_parse_date_and_time(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_176try_parse_date_and_time = {__Pyx_NAMESTR("try_parse_date_and_time"), (PyCFunction)__pyx_pw_6pandas_3lib_176try_parse_date_and_time, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_176try_parse_date_and_time(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_dates = 0; + PyArrayObject *__pyx_v_times = 0; + PyObject *__pyx_v_date_parser = 0; + PyObject *__pyx_v_time_parser = 0; + PyObject *__pyx_v_dayfirst = 0; + PyObject *__pyx_v_default = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("try_parse_date_and_time (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dates,&__pyx_n_s_times,&__pyx_n_s_date_parser,&__pyx_n_s_time_parser,&__pyx_n_s_dayfirst,&__pyx_n_s_default,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + + /* "pandas/src/inference.pyx":774 + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, + * date_parser=None, time_parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)Py_None); + + /* "pandas/src/inference.pyx":775 + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + values[4] = ((PyObject *)Py_False); + values[5] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dates)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_times)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_date_and_time", 0, 2, 6, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_date_parser); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_time_parser); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dayfirst); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "try_parse_date_and_time") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dates = ((PyArrayObject *)values[0]); + __pyx_v_times = ((PyArrayObject *)values[1]); + __pyx_v_date_parser = values[2]; + __pyx_v_time_parser = values[3]; + __pyx_v_dayfirst = values[4]; + __pyx_v_default = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("try_parse_date_and_time", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dates), __pyx_ptype_5numpy_ndarray, 1, "dates", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_times), __pyx_ptype_5numpy_ndarray, 1, "times", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_175try_parse_date_and_time(__pyx_self, __pyx_v_dates, __pyx_v_times, __pyx_v_date_parser, __pyx_v_time_parser, __pyx_v_dayfirst, __pyx_v_default); + + /* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":796 + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return date.strptime(s, '%m/%d/%Y') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_1parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_1parse_date = {__Pyx_NAMESTR("parse_date"), (PyCFunction)__pyx_pw_6pandas_3lib_23try_parse_date_and_time_1parse_date, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_1parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parse_date (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_date", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "pandas/src/inference.pyx":797 + * except ImportError: # pragma: no cover + * def parse_date(s): + * try: # <<<<<<<<<<<<<< + * return date.strptime(s, '%m/%d/%Y') + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/inference.pyx":798 + * def parse_date(s): + * try: + * return date.strptime(s, '%m/%d/%Y') # <<<<<<<<<<<<<< + * except Exception: + * return s + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_date)) { __Pyx_RaiseClosureNameError("date"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_date, __pyx_n_s_strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __Pyx_INCREF(__pyx_kp_s_m_d_Y); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_m_d_Y); + __Pyx_GIVEREF(__pyx_kp_s_m_d_Y); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":799 + * try: + * return date.strptime(s, '%m/%d/%Y') + * except Exception: # <<<<<<<<<<<<<< + * return s + * else: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":800 + * return date.strptime(s, '%m/%d/%Y') + * except Exception: + * return s # <<<<<<<<<<<<<< + * else: + * parse_date = date_parser + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/inference.pyx":796 + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return date.strptime(s, '%m/%d/%Y') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":809 + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + * def parse_time(s): # <<<<<<<<<<<<<< + * try: + * return time.strptime(s, '%H:%M:%S') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_3parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_3parse_time = {__Pyx_NAMESTR("parse_time"), (PyCFunction)__pyx_pw_6pandas_3lib_23try_parse_date_and_time_3parse_time, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_3parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parse_time (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_23try_parse_date_and_time_2parse_time(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_2parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_time", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "pandas/src/inference.pyx":810 + * except ImportError: # pragma: no cover + * def parse_time(s): + * try: # <<<<<<<<<<<<<< + * return time.strptime(s, '%H:%M:%S') + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/inference.pyx":811 + * def parse_time(s): + * try: + * return time.strptime(s, '%H:%M:%S') # <<<<<<<<<<<<<< + * except Exception: + * return s + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_time)) { __Pyx_RaiseClosureNameError("time"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_time, __pyx_n_s_strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __Pyx_INCREF(__pyx_kp_s_H_M_S); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_H_M_S); + __Pyx_GIVEREF(__pyx_kp_s_H_M_S); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":812 + * try: + * return time.strptime(s, '%H:%M:%S') + * except Exception: # <<<<<<<<<<<<<< + * return s + * + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":813 + * return time.strptime(s, '%H:%M:%S') + * except Exception: + * return s # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/inference.pyx":809 + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + * def parse_time(s): # <<<<<<<<<<<<<< + * try: + * return time.strptime(s, '%H:%M:%S') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":794 + * try: + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_date(s): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_4lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_4lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_pw_6pandas_3lib_23try_parse_date_and_time_4lambda2, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_4lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lambda2", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_v_dayfirst)) { __Pyx_RaiseClosureNameError("dayfirst"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dayfirst, __pyx_cur_scope->__pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_default)) { __Pyx_RaiseClosureNameError("default"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_cur_scope->__pyx_v_default) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_parse, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":807 + * try: + * from dateutil.parser import parse + * parse_time = lambda x: parse(x) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_time(s): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_5lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_5lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_pw_6pandas_3lib_23try_parse_date_and_time_5lambda3, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_5lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lambda3", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_parse, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + +static PyObject *__pyx_pf_6pandas_3lib_175try_parse_date_and_time(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dates, PyArrayObject *__pyx_v_times, PyObject *__pyx_v_date_parser, PyObject *__pyx_v_time_parser, PyObject *__pyx_v_dayfirst, PyObject *__pyx_v_default) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_datetime = NULL; + CYTHON_UNUSED PyObject *__pyx_v_timedelta = NULL; + PyObject *__pyx_v_parse_date = NULL; + PyObject *__pyx_v_parse_time = NULL; + PyObject *__pyx_v_d = NULL; + PyObject *__pyx_v_t = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dates; + __Pyx_Buffer __pyx_pybuffer_dates; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_times; + __Pyx_Buffer __pyx_pybuffer_times; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + PyObject **__pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("try_parse_date_and_time", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)__pyx_tp_new_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(__pyx_ptype_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_dayfirst = __pyx_v_dayfirst; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dayfirst); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dayfirst); + __pyx_cur_scope->__pyx_v_default = __pyx_v_default; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_dates.pybuffer.buf = NULL; + __pyx_pybuffer_dates.refcount = 0; + __pyx_pybuffernd_dates.data = NULL; + __pyx_pybuffernd_dates.rcbuffer = &__pyx_pybuffer_dates; + __pyx_pybuffer_times.pybuffer.buf = NULL; + __pyx_pybuffer_times.refcount = 0; + __pyx_pybuffernd_times.data = NULL; + __pyx_pybuffernd_times.rcbuffer = &__pyx_pybuffer_times; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dates.rcbuffer->pybuffer, (PyObject*)__pyx_v_dates, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dates.diminfo[0].strides = __pyx_pybuffernd_dates.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dates.diminfo[0].shape = __pyx_pybuffernd_dates.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_times.rcbuffer->pybuffer, (PyObject*)__pyx_v_times, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_times.diminfo[0].strides = __pyx_pybuffernd_times.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_times.diminfo[0].shape = __pyx_pybuffernd_times.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":780 + * ndarray[object] result + * + * from datetime import date, time, datetime, timedelta # <<<<<<<<<<<<<< + * + * n = len(dates) + */ + __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_date); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_date); + __Pyx_GIVEREF(__pyx_n_s_date); + __Pyx_INCREF(__pyx_n_s_time); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_time); + __Pyx_GIVEREF(__pyx_n_s_time); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __Pyx_INCREF(__pyx_n_s_timedelta); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_timedelta); + __Pyx_GIVEREF(__pyx_n_s_timedelta); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_date = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_time = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_datetime = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_timedelta = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":782 + * from datetime import date, time, datetime, timedelta + * + * n = len(dates) # <<<<<<<<<<<<<< + * if len(times) != n: + * raise ValueError('Length of dates and times must be equal') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_dates)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/src/inference.pyx":783 + * + * n = len(dates) + * if len(times) != n: # <<<<<<<<<<<<<< + * raise ValueError('Length of dates and times must be equal') + * result = np.empty(n, dtype='O') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_times)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":784 + * n = len(dates) + * if len(times) != n: + * raise ValueError('Length of dates and times must be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/inference.pyx":785 + * if len(times) != n: + * raise ValueError('Length of dates and times must be equal') + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * if date_parser is None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":787 + * result = np.empty(n, dtype='O') + * + * if date_parser is None: # <<<<<<<<<<<<<< + * if default is None: # GH2618 + * date=datetime.now() + */ + __pyx_t_4 = (__pyx_v_date_parser == Py_None); + __pyx_t_12 = (__pyx_t_4 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":788 + * + * if date_parser is None: + * if default is None: # GH2618 # <<<<<<<<<<<<<< + * date=datetime.now() + * default=datetime(date.year,date.month,1) + */ + __pyx_t_12 = (__pyx_cur_scope->__pyx_v_default == Py_None); + __pyx_t_4 = (__pyx_t_12 != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":789 + * if date_parser is None: + * if default is None: # GH2618 + * date=datetime.now() # <<<<<<<<<<<<<< + * default=datetime(date.year,date.month,1) + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_now); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_date); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_date, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":790 + * if default is None: # GH2618 + * date=datetime.now() + * default=datetime(date.year,date.month,1) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_date, __pyx_n_s_year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_date, __pyx_n_s_month); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_datetime, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_default); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_default, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/inference.pyx":792 + * default=datetime(date.year,date.month,1) + * + * try: # <<<<<<<<<<<<<< + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/src/inference.pyx":793 + * + * try: + * from dateutil.parser import parse # <<<<<<<<<<<<<< + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + */ + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_parse); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_parse); + __Pyx_GIVEREF(__pyx_n_s_parse); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_dateutil_parser, __pyx_t_6, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_parse); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_cur_scope->__pyx_v_parse = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":794 + * try: + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_date(s): + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_4lambda2, 0, __pyx_n_s_try_parse_date_and_time_locals_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_parse_date = __pyx_t_5; + __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":795 + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover # <<<<<<<<<<<<<< + * def parse_date(s): + * try: + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/src/inference.pyx":796 + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return date.strptime(s, '%m/%d/%Y') + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_1parse_date, 0, __pyx_n_s_try_parse_date_and_time_locals_p, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_parse_date, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + __pyx_L13_try_end:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/inference.pyx":802 + * return s + * else: + * parse_date = date_parser # <<<<<<<<<<<<<< + * + * if time_parser is None: + */ + __Pyx_INCREF(__pyx_v_date_parser); + __pyx_v_parse_date = __pyx_v_date_parser; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":804 + * parse_date = date_parser + * + * if time_parser is None: # <<<<<<<<<<<<<< + * try: + * from dateutil.parser import parse + */ + __pyx_t_4 = (__pyx_v_time_parser == Py_None); + __pyx_t_12 = (__pyx_t_4 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":805 + * + * if time_parser is None: + * try: # <<<<<<<<<<<<<< + * from dateutil.parser import parse + * parse_time = lambda x: parse(x) + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "pandas/src/inference.pyx":806 + * if time_parser is None: + * try: + * from dateutil.parser import parse # <<<<<<<<<<<<<< + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_parse); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_parse); + __Pyx_GIVEREF(__pyx_n_s_parse); + __pyx_t_6 = __Pyx_Import(__pyx_n_s_dateutil_parser, __pyx_t_2, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_parse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_parse); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_parse, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":807 + * try: + * from dateutil.parser import parse + * parse_time = lambda x: parse(x) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_time(s): + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_5lambda3, 0, __pyx_n_s_try_parse_date_and_time_locals_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_parse_time = __pyx_t_6; + __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":808 + * from dateutil.parser import parse + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover # <<<<<<<<<<<<<< + * def parse_time(s): + * try: + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/src/inference.pyx":809 + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + * def parse_time(s): # <<<<<<<<<<<<<< + * try: + * return time.strptime(s, '%H:%M:%S') + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_3parse_time, 0, __pyx_n_s_try_parse_date_and_time_locals_p_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_parse_time, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_exception_handled; + } + goto __pyx_L19_except_error; + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L1_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L24_try_end:; + } + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/inference.pyx":816 + * + * else: + * parse_time = time_parser # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_INCREF(__pyx_v_time_parser); + __pyx_v_parse_time = __pyx_v_time_parser; + } + __pyx_L16:; + + /* "pandas/src/inference.pyx":818 + * parse_time = time_parser + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * d = parse_date(str(dates[i])) + * t = parse_time(str(times[i])) + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":819 + * + * for i from 0 <= i < n: + * d = parse_date(str(dates[i])) # <<<<<<<<<<<<<< + * t = parse_time(str(times[i])) + * result[i] = datetime(d.year, d.month, d.day, + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_dates.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dates.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_dates.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_dates.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_parse_date, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":820 + * for i from 0 <= i < n: + * d = parse_date(str(dates[i])) + * t = parse_time(str(times[i])) # <<<<<<<<<<<<<< + * result[i] = datetime(d.year, d.month, d.day, + * t.hour, t.minute, t.second) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_times.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_times.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_times.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_times.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_parse_time, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":821 + * d = parse_date(str(dates[i])) + * t = parse_time(str(times[i])) + * result[i] = datetime(d.year, d.month, d.day, # <<<<<<<<<<<<<< + * t.hour, t.minute, t.second) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_year); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/src/inference.pyx":822 + * t = parse_time(str(times[i])) + * result[i] = datetime(d.year, d.month, d.day, + * t.hour, t.minute, t.second) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_minute); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_second); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + + /* "pandas/src/inference.pyx":821 + * d = parse_date(str(dates[i])) + * t = parse_time(str(times[i])) + * result[i] = datetime(d.year, d.month, d.day, # <<<<<<<<<<<<<< + * t.hour, t.minute, t.second) + * + */ + __pyx_t_17 = PyTuple_New(6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_5 = 0; + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_1 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_v_datetime, __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_19); + __Pyx_INCREF(__pyx_t_16); __Pyx_DECREF(*__pyx_t_19); + *__pyx_t_19 = __pyx_t_16; + __Pyx_GIVEREF(*__pyx_t_19); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + + /* "pandas/src/inference.pyx":824 + * t.hour, t.minute, t.second) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dates.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_times.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dates.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_times.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_datetime); + __Pyx_XDECREF(__pyx_v_timedelta); + __Pyx_XDECREF(__pyx_v_parse_date); + __Pyx_XDECREF(__pyx_v_parse_time); + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":827 + * + * + * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months, # <<<<<<<<<<<<<< + * ndarray[object] days): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_178try_parse_year_month_day(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_178try_parse_year_month_day = {__Pyx_NAMESTR("try_parse_year_month_day"), (PyCFunction)__pyx_pw_6pandas_3lib_178try_parse_year_month_day, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_178try_parse_year_month_day(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_years = 0; + PyArrayObject *__pyx_v_months = 0; + PyArrayObject *__pyx_v_days = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("try_parse_year_month_day (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_years,&__pyx_n_s_months,&__pyx_n_s_days,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_years)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_months)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_days)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "try_parse_year_month_day") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_years = ((PyArrayObject *)values[0]); + __pyx_v_months = ((PyArrayObject *)values[1]); + __pyx_v_days = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.try_parse_year_month_day", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_years), __pyx_ptype_5numpy_ndarray, 1, "years", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_months), __pyx_ptype_5numpy_ndarray, 1, "months", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_days), __pyx_ptype_5numpy_ndarray, 1, "days", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_177try_parse_year_month_day(__pyx_self, __pyx_v_years, __pyx_v_months, __pyx_v_days); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_177try_parse_year_month_day(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_years, PyArrayObject *__pyx_v_months, PyArrayObject *__pyx_v_days) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_datetime = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_days; + __Pyx_Buffer __pyx_pybuffer_days; + __Pyx_LocalBuf_ND __pyx_pybuffernd_months; + __Pyx_Buffer __pyx_pybuffer_months; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_years; + __Pyx_Buffer __pyx_pybuffer_years; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject **__pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("try_parse_year_month_day", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_years.pybuffer.buf = NULL; + __pyx_pybuffer_years.refcount = 0; + __pyx_pybuffernd_years.data = NULL; + __pyx_pybuffernd_years.rcbuffer = &__pyx_pybuffer_years; + __pyx_pybuffer_months.pybuffer.buf = NULL; + __pyx_pybuffer_months.refcount = 0; + __pyx_pybuffernd_months.data = NULL; + __pyx_pybuffernd_months.rcbuffer = &__pyx_pybuffer_months; + __pyx_pybuffer_days.pybuffer.buf = NULL; + __pyx_pybuffer_days.refcount = 0; + __pyx_pybuffernd_days.data = NULL; + __pyx_pybuffernd_days.rcbuffer = &__pyx_pybuffer_days; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_years.rcbuffer->pybuffer, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_years.diminfo[0].strides = __pyx_pybuffernd_years.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_years.diminfo[0].shape = __pyx_pybuffernd_years.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_months.rcbuffer->pybuffer, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_months.diminfo[0].strides = __pyx_pybuffernd_months.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_months.diminfo[0].shape = __pyx_pybuffernd_months.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_days.rcbuffer->pybuffer, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_days.diminfo[0].strides = __pyx_pybuffernd_days.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_days.diminfo[0].shape = __pyx_pybuffernd_days.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":833 + * ndarray[object] result + * + * from datetime import datetime # <<<<<<<<<<<<<< + * + * n = len(years) + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_datetime = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":835 + * from datetime import datetime + * + * n = len(years) # <<<<<<<<<<<<<< + * if len(months) != n or len(days) != n: + * raise ValueError('Length of years/months/days must all be equal') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_years)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/src/inference.pyx":836 + * + * n = len(years) + * if len(months) != n or len(days) != n: # <<<<<<<<<<<<<< + * raise ValueError('Length of years/months/days must all be equal') + * result = np.empty(n, dtype='O') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_months)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_4) { + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_days)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_3 != __pyx_v_n) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":837 + * n = len(years) + * if len(months) != n or len(days) != n: + * raise ValueError('Length of years/months/days must all be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/inference.pyx":838 + * if len(months) != n or len(days) != n: + * raise ValueError('Length of years/months/days must all be equal') + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/inference.pyx":840 + * result = np.empty(n, dtype='O') + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i])) + * + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":841 + * + * for i from 0 <= i < n: + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i])) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_years.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_years.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_years.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_years.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_2 = PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_months.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_months.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_months.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_months.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_7 = PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_days.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_days.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_days.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_days.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_1 = PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_7 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_datetime, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_18); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/inference.pyx":843 + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i])) + * + * return result # <<<<<<<<<<<<<< + * + * def try_parse_datetime_components(ndarray[object] years, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":827 + * + * + * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months, # <<<<<<<<<<<<<< + * ndarray[object] days): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.try_parse_year_month_day", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_datetime); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":845 + * return result + * + * def try_parse_datetime_components(ndarray[object] years, # <<<<<<<<<<<<<< + * ndarray[object] months, + * ndarray[object] days, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_180try_parse_datetime_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_180try_parse_datetime_components = {__Pyx_NAMESTR("try_parse_datetime_components"), (PyCFunction)__pyx_pw_6pandas_3lib_180try_parse_datetime_components, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_180try_parse_datetime_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_years = 0; + PyArrayObject *__pyx_v_months = 0; + PyArrayObject *__pyx_v_days = 0; + PyArrayObject *__pyx_v_hours = 0; + PyArrayObject *__pyx_v_minutes = 0; + PyArrayObject *__pyx_v_seconds = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("try_parse_datetime_components (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_years,&__pyx_n_s_months,&__pyx_n_s_days,&__pyx_n_s_hours,&__pyx_n_s_minutes,&__pyx_n_s_seconds,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_years)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_months)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_days)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hours)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minutes)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seconds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 5); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "try_parse_datetime_components") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_years = ((PyArrayObject *)values[0]); + __pyx_v_months = ((PyArrayObject *)values[1]); + __pyx_v_days = ((PyArrayObject *)values[2]); + __pyx_v_hours = ((PyArrayObject *)values[3]); + __pyx_v_minutes = ((PyArrayObject *)values[4]); + __pyx_v_seconds = ((PyArrayObject *)values[5]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.try_parse_datetime_components", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_years), __pyx_ptype_5numpy_ndarray, 1, "years", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_months), __pyx_ptype_5numpy_ndarray, 1, "months", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_days), __pyx_ptype_5numpy_ndarray, 1, "days", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hours), __pyx_ptype_5numpy_ndarray, 1, "hours", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_minutes), __pyx_ptype_5numpy_ndarray, 1, "minutes", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seconds), __pyx_ptype_5numpy_ndarray, 1, "seconds", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_179try_parse_datetime_components(__pyx_self, __pyx_v_years, __pyx_v_months, __pyx_v_days, __pyx_v_hours, __pyx_v_minutes, __pyx_v_seconds); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_179try_parse_datetime_components(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_years, PyArrayObject *__pyx_v_months, PyArrayObject *__pyx_v_days, PyArrayObject *__pyx_v_hours, PyArrayObject *__pyx_v_minutes, PyArrayObject *__pyx_v_seconds) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_secs; + double __pyx_v_float_secs; + double __pyx_v_micros; + PyObject *__pyx_v_datetime = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_days; + __Pyx_Buffer __pyx_pybuffer_days; + __Pyx_LocalBuf_ND __pyx_pybuffernd_hours; + __Pyx_Buffer __pyx_pybuffer_hours; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minutes; + __Pyx_Buffer __pyx_pybuffer_minutes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_months; + __Pyx_Buffer __pyx_pybuffer_months; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_seconds; + __Pyx_Buffer __pyx_pybuffer_seconds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_years; + __Pyx_Buffer __pyx_pybuffer_years; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + double __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + PyObject *__pyx_t_23 = NULL; + Py_ssize_t __pyx_t_24; + PyObject *__pyx_t_25 = NULL; + PyObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + Py_ssize_t __pyx_t_28; + PyObject **__pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("try_parse_datetime_components", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_years.pybuffer.buf = NULL; + __pyx_pybuffer_years.refcount = 0; + __pyx_pybuffernd_years.data = NULL; + __pyx_pybuffernd_years.rcbuffer = &__pyx_pybuffer_years; + __pyx_pybuffer_months.pybuffer.buf = NULL; + __pyx_pybuffer_months.refcount = 0; + __pyx_pybuffernd_months.data = NULL; + __pyx_pybuffernd_months.rcbuffer = &__pyx_pybuffer_months; + __pyx_pybuffer_days.pybuffer.buf = NULL; + __pyx_pybuffer_days.refcount = 0; + __pyx_pybuffernd_days.data = NULL; + __pyx_pybuffernd_days.rcbuffer = &__pyx_pybuffer_days; + __pyx_pybuffer_hours.pybuffer.buf = NULL; + __pyx_pybuffer_hours.refcount = 0; + __pyx_pybuffernd_hours.data = NULL; + __pyx_pybuffernd_hours.rcbuffer = &__pyx_pybuffer_hours; + __pyx_pybuffer_minutes.pybuffer.buf = NULL; + __pyx_pybuffer_minutes.refcount = 0; + __pyx_pybuffernd_minutes.data = NULL; + __pyx_pybuffernd_minutes.rcbuffer = &__pyx_pybuffer_minutes; + __pyx_pybuffer_seconds.pybuffer.buf = NULL; + __pyx_pybuffer_seconds.refcount = 0; + __pyx_pybuffernd_seconds.data = NULL; + __pyx_pybuffernd_seconds.rcbuffer = &__pyx_pybuffer_seconds; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_years.rcbuffer->pybuffer, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_years.diminfo[0].strides = __pyx_pybuffernd_years.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_years.diminfo[0].shape = __pyx_pybuffernd_years.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_months.rcbuffer->pybuffer, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_months.diminfo[0].strides = __pyx_pybuffernd_months.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_months.diminfo[0].shape = __pyx_pybuffernd_months.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_days.rcbuffer->pybuffer, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_days.diminfo[0].strides = __pyx_pybuffernd_days.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_days.diminfo[0].shape = __pyx_pybuffernd_days.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hours.rcbuffer->pybuffer, (PyObject*)__pyx_v_hours, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_hours.diminfo[0].strides = __pyx_pybuffernd_hours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hours.diminfo[0].shape = __pyx_pybuffernd_hours.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer, (PyObject*)__pyx_v_minutes, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_minutes.diminfo[0].strides = __pyx_pybuffernd_minutes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minutes.diminfo[0].shape = __pyx_pybuffernd_minutes.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer, (PyObject*)__pyx_v_seconds, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_seconds.diminfo[0].strides = __pyx_pybuffernd_seconds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_seconds.diminfo[0].shape = __pyx_pybuffernd_seconds.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":859 + * double micros + * + * from datetime import datetime # <<<<<<<<<<<<<< + * + * n = len(years) + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_datetime = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":861 + * from datetime import datetime + * + * n = len(years) # <<<<<<<<<<<<<< + * if (len(months) != n or len(days) != n or len(hours) != n or + * len(minutes) != n or len(seconds) != n): + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_years)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/src/inference.pyx":862 + * + * n = len(years) + * if (len(months) != n or len(days) != n or len(hours) != n or # <<<<<<<<<<<<<< + * len(minutes) != n or len(seconds) != n): + * raise ValueError('Length of all datetime components must be equal') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_months)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_4) { + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_days)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_5) { + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_hours)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_6) { + + /* "pandas/src/inference.pyx":863 + * n = len(years) + * if (len(months) != n or len(days) != n or len(hours) != n or + * len(minutes) != n or len(seconds) != n): # <<<<<<<<<<<<<< + * raise ValueError('Length of all datetime components must be equal') + * result = np.empty(n, dtype='O') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_minutes)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_7) { + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_seconds)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((__pyx_t_3 != __pyx_v_n) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + __pyx_t_7 = __pyx_t_9; + } else { + __pyx_t_7 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_7; + } else { + __pyx_t_6 = __pyx_t_5; + } + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_4; + } + if (__pyx_t_5) { + + /* "pandas/src/inference.pyx":864 + * if (len(months) != n or len(days) != n or len(hours) != n or + * len(minutes) != n or len(seconds) != n): + * raise ValueError('Length of all datetime components must be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/inference.pyx":865 + * len(minutes) != n or len(seconds) != n): + * raise ValueError('Length of all datetime components must be equal') + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/inference.pyx":867 + * result = np.empty(n, dtype='O') + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * float_secs = float(seconds[i]) + * secs = int(float_secs) + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":868 + * + * for i from 0 <= i < n: + * float_secs = float(seconds[i]) # <<<<<<<<<<<<<< + * secs = int(float_secs) + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_seconds.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_seconds.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_seconds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_seconds.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_18 = __Pyx_PyObject_AsDouble(__pyx_t_11); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_float_secs = __pyx_t_18; + + /* "pandas/src/inference.pyx":869 + * for i from 0 <= i < n: + * float_secs = float(seconds[i]) + * secs = int(float_secs) # <<<<<<<<<<<<<< + * + * micros = float_secs - secs + */ + __pyx_v_secs = ((int)__pyx_v_float_secs); + + /* "pandas/src/inference.pyx":871 + * secs = int(float_secs) + * + * micros = float_secs - secs # <<<<<<<<<<<<<< + * if micros > 0: + * micros = micros * 1000000 + */ + __pyx_v_micros = (__pyx_v_float_secs - __pyx_v_secs); + + /* "pandas/src/inference.pyx":872 + * + * micros = float_secs - secs + * if micros > 0: # <<<<<<<<<<<<<< + * micros = micros * 1000000 + * + */ + __pyx_t_5 = ((__pyx_v_micros > 0.0) != 0); + if (__pyx_t_5) { + + /* "pandas/src/inference.pyx":873 + * micros = float_secs - secs + * if micros > 0: + * micros = micros * 1000000 # <<<<<<<<<<<<<< + * + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), + */ + __pyx_v_micros = (__pyx_v_micros * 1000000.0); + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/inference.pyx":875 + * micros = micros * 1000000 + * + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), # <<<<<<<<<<<<<< + * int(hours[i]), int(minutes[i]), secs, + * int(micros)) + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_years.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_years.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_years.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_years.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_2 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_20 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_months.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_months.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_months.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_months.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_10 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_days.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_days.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_days.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_days.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_1 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "pandas/src/inference.pyx":876 + * + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), + * int(hours[i]), int(minutes[i]), secs, # <<<<<<<<<<<<<< + * int(micros)) + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_hours.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_hours.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_hours.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_hours.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_23 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_23); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_24 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_minutes.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_minutes.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_minutes.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_minutes.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_25 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_25); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_secs); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/src/inference.pyx":877 + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), + * int(hours[i]), int(minutes[i]), secs, + * int(micros)) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_26 = PyFloat_FromDouble(__pyx_v_micros); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_26); + __pyx_t_27 = PyTuple_New(1); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_27); + PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_26); + __Pyx_GIVEREF(__pyx_t_26); + __pyx_t_26 = 0; + __pyx_t_26 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_27, NULL); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_26); + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /* "pandas/src/inference.pyx":875 + * micros = micros * 1000000 + * + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), # <<<<<<<<<<<<<< + * int(hours[i]), int(minutes[i]), secs, + * int(micros)) + */ + __pyx_t_27 = PyTuple_New(7); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_27); + PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_27, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_27, 3, __pyx_t_23); + __Pyx_GIVEREF(__pyx_t_23); + PyTuple_SET_ITEM(__pyx_t_27, 4, __pyx_t_25); + __Pyx_GIVEREF(__pyx_t_25); + PyTuple_SET_ITEM(__pyx_t_27, 5, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_27, 6, __pyx_t_26); + __Pyx_GIVEREF(__pyx_t_26); + __pyx_t_2 = 0; + __pyx_t_10 = 0; + __pyx_t_1 = 0; + __pyx_t_23 = 0; + __pyx_t_25 = 0; + __pyx_t_11 = 0; + __pyx_t_26 = 0; + __pyx_t_26 = __Pyx_PyObject_Call(__pyx_v_datetime, __pyx_t_27, NULL); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_26); + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + __pyx_t_28 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_29); + __Pyx_INCREF(__pyx_t_26); __Pyx_DECREF(*__pyx_t_29); + *__pyx_t_29 = __pyx_t_26; + __Pyx_GIVEREF(*__pyx_t_29); + __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; + } + + /* "pandas/src/inference.pyx":879 + * int(micros)) + * + * return result # <<<<<<<<<<<<<< + * + * def sanitize_objects(ndarray[object] values, set na_values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":845 + * return result + * + * def try_parse_datetime_components(ndarray[object] years, # <<<<<<<<<<<<<< + * ndarray[object] months, + * ndarray[object] days, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_XDECREF(__pyx_t_25); + __Pyx_XDECREF(__pyx_t_26); + __Pyx_XDECREF(__pyx_t_27); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.try_parse_datetime_components", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_datetime); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_182sanitize_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_182sanitize_objects = {__Pyx_NAMESTR("sanitize_objects"), (PyCFunction)__pyx_pw_6pandas_3lib_182sanitize_objects, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_182sanitize_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_na_values = 0; + PyObject *__pyx_v_convert_empty = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sanitize_objects (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_na_values,&__pyx_n_s_convert_empty,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/inference.pyx":882 + * + * def sanitize_objects(ndarray[object] values, set na_values, + * convert_empty=True): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + values[2] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sanitize_objects", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert_empty); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sanitize_objects") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_na_values = ((PyObject*)values[1]); + __pyx_v_convert_empty = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sanitize_objects", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.sanitize_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_na_values), (&PySet_Type), 1, "na_values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_181sanitize_objects(__pyx_self, __pyx_v_values, __pyx_v_na_values, __pyx_v_convert_empty); + + /* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_181sanitize_objects(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_na_values, PyObject *__pyx_v_convert_empty) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_onan = 0; + Py_ssize_t __pyx_v_na_count; + PyObject *__pyx_v_memo = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sanitize_objects", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":886 + * Py_ssize_t i, n + * object val, onan + * Py_ssize_t na_count = 0 # <<<<<<<<<<<<<< + * dict memo = {} + * + */ + __pyx_v_na_count = 0; + + /* "pandas/src/inference.pyx":887 + * object val, onan + * Py_ssize_t na_count = 0 + * dict memo = {} # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_memo = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/inference.pyx":889 + * dict memo = {} + * + * n = len(values) # <<<<<<<<<<<<<< + * onan = np.nan + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/inference.pyx":890 + * + * n = len(values) + * onan = np.nan # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_onan = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":892 + * onan = np.nan + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = values[i] + * if (convert_empty and val == '') or (val in na_values): + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":893 + * + * for i from 0 <= i < n: + * val = values[i] # <<<<<<<<<<<<<< + * if (convert_empty and val == '') or (val in na_values): + * values[i] = onan + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":894 + * for i from 0 <= i < n: + * val = values[i] + * if (convert_empty and val == '') or (val in na_values): # <<<<<<<<<<<<<< + * values[i] = onan + * na_count += 1 + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_convert_empty); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_val, __pyx_kp_s__49, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (!__pyx_t_8) { + __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_na_values, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_8; + } + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":895 + * val = values[i] + * if (convert_empty and val == '') or (val in na_values): + * values[i] = onan # <<<<<<<<<<<<<< + * na_count += 1 + * elif val in memo: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_onan); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_onan; + __Pyx_GIVEREF(*__pyx_t_10); + + /* "pandas/src/inference.pyx":896 + * if (convert_empty and val == '') or (val in na_values): + * values[i] = onan + * na_count += 1 # <<<<<<<<<<<<<< + * elif val in memo: + * values[i] = memo[val] + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":897 + * values[i] = onan + * na_count += 1 + * elif val in memo: # <<<<<<<<<<<<<< + * values[i] = memo[val] + * else: + */ + __pyx_t_7 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_memo, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "pandas/src/inference.pyx":898 + * na_count += 1 + * elif val in memo: + * values[i] = memo[val] # <<<<<<<<<<<<<< + * else: + * memo[val] = val + */ + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_memo, __pyx_v_val); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/inference.pyx":900 + * values[i] = memo[val] + * else: + * memo[val] = val # <<<<<<<<<<<<<< + * + * return na_count + */ + if (unlikely(PyDict_SetItem(__pyx_v_memo, __pyx_v_val, __pyx_v_val) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + } + + /* "pandas/src/inference.pyx":902 + * memo[val] = val + * + * return na_count # <<<<<<<<<<<<<< + * + * def maybe_convert_bool(ndarray[object] arr, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_na_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.sanitize_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_onan); + __Pyx_XDECREF(__pyx_v_memo); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_184maybe_convert_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_184maybe_convert_bool = {__Pyx_NAMESTR("maybe_convert_bool"), (PyCFunction)__pyx_pw_6pandas_3lib_184maybe_convert_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_184maybe_convert_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_true_values = 0; + PyObject *__pyx_v_false_values = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_convert_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_true_values,&__pyx_n_s_false_values,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/inference.pyx":905 + * + * def maybe_convert_bool(ndarray[object] arr, + * true_values=None, false_values=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_true_values); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_false_values); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maybe_convert_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_true_values = values[1]; + __pyx_v_false_values = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("maybe_convert_bool", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.maybe_convert_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_183maybe_convert_bool(__pyx_self, __pyx_v_arr, __pyx_v_true_values, __pyx_v_false_values); + + /* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_183maybe_convert_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_true_values, PyObject *__pyx_v_false_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_true_vals = 0; + PyObject *__pyx_v_false_vals = 0; + int __pyx_v_na_count; + PyObject *__pyx_v_mask = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + PyArrayObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_convert_bool", 0); + __Pyx_INCREF((PyObject *)__pyx_v_arr); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":911 + * object val + * set true_vals, false_vals + * int na_count = 0 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_na_count = 0; + + /* "pandas/src/inference.pyx":913 + * int na_count = 0 + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.uint8) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":914 + * + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * + * # the defaults + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":917 + * + * # the defaults + * true_vals = set(('True', 'TRUE', 'true')) # <<<<<<<<<<<<<< + * false_vals = set(('False', 'FALSE', 'false')) + * + */ + __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PySet_Add(__pyx_t_6, __pyx_n_s_True) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_6, __pyx_n_s_TRUE) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_6, __pyx_n_s_true) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_true_vals = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":918 + * # the defaults + * true_vals = set(('True', 'TRUE', 'true')) + * false_vals = set(('False', 'FALSE', 'false')) # <<<<<<<<<<<<<< + * + * if true_values is not None: + */ + __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PySet_Add(__pyx_t_6, __pyx_n_s_False) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_6, __pyx_n_s_FALSE) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_6, __pyx_n_s_false) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_false_vals = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":920 + * false_vals = set(('False', 'FALSE', 'false')) + * + * if true_values is not None: # <<<<<<<<<<<<<< + * true_vals = true_vals | set(true_values) + * + */ + __pyx_t_12 = (__pyx_v_true_values != Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":921 + * + * if true_values is not None: + * true_vals = true_vals | set(true_values) # <<<<<<<<<<<<<< + * + * if false_values is not None: + */ + __pyx_t_6 = PySet_New(__pyx_v_true_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyNumber_Or(__pyx_v_true_vals, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_true_vals, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/inference.pyx":923 + * true_vals = true_vals | set(true_values) + * + * if false_values is not None: # <<<<<<<<<<<<<< + * false_vals = false_vals | set(false_values) + * + */ + __pyx_t_13 = (__pyx_v_false_values != Py_None); + __pyx_t_12 = (__pyx_t_13 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":924 + * + * if false_values is not None: + * false_vals = false_vals | set(false_values) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = PySet_New(__pyx_v_false_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyNumber_Or(__pyx_v_false_vals, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_false_vals, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":926 + * false_vals = false_vals | set(false_values) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = arr[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":927 + * + * for i from 0 <= i < n: + * val = arr[i] # <<<<<<<<<<<<<< + * + * if cpython.PyBool_Check(val): + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":929 + * val = arr[i] + * + * if cpython.PyBool_Check(val): # <<<<<<<<<<<<<< + * if val is True: + * result[i] = 1 + */ + __pyx_t_12 = (PyBool_Check(__pyx_v_val) != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":930 + * + * if cpython.PyBool_Check(val): + * if val is True: # <<<<<<<<<<<<<< + * result[i] = 1 + * else: + */ + __pyx_t_12 = (__pyx_v_val == Py_True); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":931 + * if cpython.PyBool_Check(val): + * if val is True: + * result[i] = 1 # <<<<<<<<<<<<<< + * else: + * result[i] = 0 + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/inference.pyx":933 + * result[i] = 1 + * else: + * result[i] = 0 # <<<<<<<<<<<<<< + * elif val in true_vals: + * result[i] = 1 + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":934 + * else: + * result[i] = 0 + * elif val in true_vals: # <<<<<<<<<<<<<< + * result[i] = 1 + * elif val in false_vals: + */ + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_true_vals, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (__pyx_t_13 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":935 + * result[i] = 0 + * elif val in true_vals: + * result[i] = 1 # <<<<<<<<<<<<<< + * elif val in false_vals: + * result[i] = 0 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":936 + * elif val in true_vals: + * result[i] = 1 + * elif val in false_vals: # <<<<<<<<<<<<<< + * result[i] = 0 + * elif PyFloat_Check(val): + */ + __pyx_t_12 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_false_vals, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":937 + * result[i] = 1 + * elif val in false_vals: + * result[i] = 0 # <<<<<<<<<<<<<< + * elif PyFloat_Check(val): + * result[i] = UINT8_MAX + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":938 + * elif val in false_vals: + * result[i] = 0 + * elif PyFloat_Check(val): # <<<<<<<<<<<<<< + * result[i] = UINT8_MAX + * na_count += 1 + */ + __pyx_t_13 = (PyFloat_Check(__pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":939 + * result[i] = 0 + * elif PyFloat_Check(val): + * result[i] = UINT8_MAX # <<<<<<<<<<<<<< + * na_count += 1 + * else: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = UINT8_MAX; + + /* "pandas/src/inference.pyx":940 + * elif PyFloat_Check(val): + * result[i] = UINT8_MAX + * na_count += 1 # <<<<<<<<<<<<<< + * else: + * return arr + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/inference.pyx":942 + * na_count += 1 + * else: + * return arr # <<<<<<<<<<<<<< + * + * if na_count > 0: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + } + __pyx_L7:; + } + + /* "pandas/src/inference.pyx":944 + * return arr + * + * if na_count > 0: # <<<<<<<<<<<<<< + * mask = result == UINT8_MAX + * arr = result.view(np.bool_).astype(object) + */ + __pyx_t_13 = ((__pyx_v_na_count > 0) != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":945 + * + * if na_count > 0: + * mask = result == UINT8_MAX # <<<<<<<<<<<<<< + * arr = result.view(np.bool_).astype(object) + * np.putmask(arr, mask, np.nan) + */ + __pyx_t_6 = __Pyx_PyInt_From_int(UINT8_MAX); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_result), __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_mask = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":946 + * if na_count > 0: + * mask = result == UINT8_MAX + * arr = result.view(np.bool_).astype(object) # <<<<<<<<<<<<<< + * np.putmask(arr, mask, np.nan) + * return arr + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_20 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":947 + * mask = result == UINT8_MAX + * arr = result.view(np.bool_).astype(object) + * np.putmask(arr, mask, np.nan) # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_arr)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":948 + * arr = result.view(np.bool_).astype(object) + * np.putmask(arr, mask, np.nan) + * return arr # <<<<<<<<<<<<<< + * else: + * return result.view(np.bool_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":950 + * return arr + * else: + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_convert_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_true_vals); + __Pyx_XDECREF(__pyx_v_false_vals); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":953 + * + * + * def map_infer_mask(ndarray arr, object f, ndarray[uint8_t] mask, # <<<<<<<<<<<<<< + * bint convert=1): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_186map_infer_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_185map_infer_mask[] = "\n Substitute for np.vectorize with pandas-friendly dtype inference\n\n Parameters\n ----------\n arr : ndarray\n f : function\n\n Returns\n -------\n mapped : ndarray\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_186map_infer_mask = {__Pyx_NAMESTR("map_infer_mask"), (PyCFunction)__pyx_pw_6pandas_3lib_186map_infer_mask, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_185map_infer_mask)}; +static PyObject *__pyx_pw_6pandas_3lib_186map_infer_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_f = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_v_convert; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_infer_mask (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_f,&__pyx_n_s_mask,&__pyx_n_s_convert,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_infer_mask", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_infer_mask", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_infer_mask") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_f = values[1]; + __pyx_v_mask = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_convert = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_convert == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_convert = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_infer_mask", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.map_infer_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_185map_infer_mask(__pyx_self, __pyx_v_arr, __pyx_v_f, __pyx_v_mask, __pyx_v_convert); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_185map_infer_mask(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_f, PyArrayObject *__pyx_v_mask, int __pyx_v_convert) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject **__pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_infer_mask", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":972 + * object val + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=object) + * for i in range(n): + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":973 + * + * n = len(arr) + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * if mask[i]: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":974 + * n = len(arr) + * result = np.empty(n, dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * val = util.get_value_at(arr, i) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":975 + * result = np.empty(n, dtype=object) + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * val = util.get_value_at(arr, i) + * else: + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":976 + * for i in range(n): + * if mask[i]: + * val = util.get_value_at(arr, i) # <<<<<<<<<<<<<< + * else: + * val = f(util.get_value_at(arr, i)) + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/inference.pyx":978 + * val = util.get_value_at(arr, i) + * else: + * val = f(util.get_value_at(arr, i)) # <<<<<<<<<<<<<< + * + * # unbox 0-dim arrays, GH #690 + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":981 + * + * # unbox 0-dim arrays, GH #690 + * if is_array(val) and PyArray_NDIM(val) == 0: # <<<<<<<<<<<<<< + * # is there a faster way to unbox? + * val = val.item() + */ + __pyx_t_5 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_13) { + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (PyArray_NDIM(((PyArrayObject *)__pyx_v_val)) == 0); + __pyx_t_15 = __pyx_t_14; + } else { + __pyx_t_15 = __pyx_t_13; + } + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":983 + * if is_array(val) and PyArray_NDIM(val) == 0: + * # is there a faster way to unbox? + * val = val.item() # <<<<<<<<<<<<<< + * + * result[i] = val + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L6; + } + __pyx_L6:; + } + __pyx_L5:; + + /* "pandas/src/inference.pyx":985 + * val = val.item() + * + * result[i] = val # <<<<<<<<<<<<<< + * + * if convert: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_17); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_17); + *__pyx_t_17 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_17); + } + + /* "pandas/src/inference.pyx":987 + * result[i] = val + * + * if convert: # <<<<<<<<<<<<<< + * return maybe_convert_objects(result, + * try_float=0, + */ + __pyx_t_15 = (__pyx_v_convert != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":988 + * + * if convert: + * return maybe_convert_objects(result, # <<<<<<<<<<<<<< + * try_float=0, + * convert_datetime=0, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_try_float, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_convert_datetime, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_convert_timedelta, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":993 + * convert_timedelta=0) + * + * return result # <<<<<<<<<<<<<< + * + * def map_infer(ndarray arr, object f, bint convert=1): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":953 + * + * + * def map_infer_mask(ndarray arr, object f, ndarray[uint8_t] mask, # <<<<<<<<<<<<<< + * bint convert=1): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.map_infer_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":995 + * return result + * + * def map_infer(ndarray arr, object f, bint convert=1): # <<<<<<<<<<<<<< + * ''' + * Substitute for np.vectorize with pandas-friendly dtype inference + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_188map_infer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_187map_infer[] = "\n Substitute for np.vectorize with pandas-friendly dtype inference\n\n Parameters\n ----------\n arr : ndarray\n f : function\n\n Returns\n -------\n mapped : ndarray\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_188map_infer = {__Pyx_NAMESTR("map_infer"), (PyCFunction)__pyx_pw_6pandas_3lib_188map_infer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_187map_infer)}; +static PyObject *__pyx_pw_6pandas_3lib_188map_infer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_f = 0; + int __pyx_v_convert; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_infer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_f,&__pyx_n_s_convert,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_infer", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_infer") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_f = values[1]; + if (values[2]) { + __pyx_v_convert = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_convert == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_convert = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_infer", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.map_infer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_187map_infer(__pyx_self, __pyx_v_arr, __pyx_v_f, __pyx_v_convert); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_187map_infer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_f, int __pyx_v_convert) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyObject **__pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_infer", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/src/inference.pyx":1013 + * object val + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=object) + * for i in range(n): + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1014 + * + * n = len(arr) + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * val = f(util.get_value_at(arr, i)) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1015 + * n = len(arr) + * result = np.empty(n, dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * val = f(util.get_value_at(arr, i)) + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":1016 + * result = np.empty(n, dtype=object) + * for i in range(n): + * val = f(util.get_value_at(arr, i)) # <<<<<<<<<<<<<< + * + * # unbox 0-dim arrays, GH #690 + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1019 + * + * # unbox 0-dim arrays, GH #690 + * if is_array(val) and PyArray_NDIM(val) == 0: # <<<<<<<<<<<<<< + * # is there a faster way to unbox? + * val = val.item() + */ + __pyx_t_2 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_12) { + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (PyArray_NDIM(((PyArrayObject *)__pyx_v_val)) == 0); + __pyx_t_14 = __pyx_t_13; + } else { + __pyx_t_14 = __pyx_t_12; + } + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":1021 + * if is_array(val) and PyArray_NDIM(val) == 0: + * # is there a faster way to unbox? + * val = val.item() # <<<<<<<<<<<<<< + * + * result[i] = val + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/inference.pyx":1023 + * val = val.item() + * + * result[i] = val # <<<<<<<<<<<<<< + * + * if convert: + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_16); + } + + /* "pandas/src/inference.pyx":1025 + * result[i] = val + * + * if convert: # <<<<<<<<<<<<<< + * return maybe_convert_objects(result, + * try_float=0, + */ + __pyx_t_14 = (__pyx_v_convert != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":1026 + * + * if convert: + * return maybe_convert_objects(result, # <<<<<<<<<<<<<< + * try_float=0, + * convert_datetime=0, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_try_float, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_convert_datetime, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_convert_timedelta, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":1031 + * convert_timedelta=0) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":995 + * return result + * + * def map_infer(ndarray arr, object f, bint convert=1): # <<<<<<<<<<<<<< + * ''' + * Substitute for np.vectorize with pandas-friendly dtype inference + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.map_infer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":1034 + * + * + * def to_object_array(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_190to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_rows); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_190to_object_array = {__Pyx_NAMESTR("to_object_array"), (PyCFunction)__pyx_pw_6pandas_3lib_190to_object_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_190to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_rows) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_object_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rows), (&PyList_Type), 1, "rows", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_189to_object_array(__pyx_self, ((PyObject*)__pyx_v_rows)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_189to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rows) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_tmp; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_row = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_object_array", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/src/inference.pyx":1040 + * list row + * + * n = len(rows) # <<<<<<<<<<<<<< + * + * k = 0 + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_rows); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1042 + * n = len(rows) + * + * k = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * tmp = len(rows[i]) + */ + __pyx_v_k = 0; + + /* "pandas/src/inference.pyx":1043 + * + * k = 0 + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * tmp = len(rows[i]) + * if tmp > k: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":1044 + * k = 0 + * for i from 0 <= i < n: + * tmp = len(rows[i]) # <<<<<<<<<<<<<< + * if tmp > k: + * k = tmp + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tmp = __pyx_t_3; + + /* "pandas/src/inference.pyx":1045 + * for i from 0 <= i < n: + * tmp = len(rows[i]) + * if tmp > k: # <<<<<<<<<<<<<< + * k = tmp + * + */ + __pyx_t_4 = ((__pyx_v_tmp > __pyx_v_k) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":1046 + * tmp = len(rows[i]) + * if tmp > k: + * k = tmp # <<<<<<<<<<<<<< + * + * result = np.empty((n, k), dtype=object) + */ + __pyx_v_k = __pyx_v_tmp; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/src/inference.pyx":1048 + * k = tmp + * + * result = np.empty((n, k), dtype=object) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1050 + * result = np.empty((n, k), dtype=object) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * row = rows[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":1051 + * + * for i from 0 <= i < n: + * row = rows[i] # <<<<<<<<<<<<<< + * + * for j from 0 <= j < len(row): + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1053 + * row = rows[i] + * + * for j from 0 <= j < len(row): # <<<<<<<<<<<<<< + * result[i, j] = row[j] + * + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_row); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { + + /* "pandas/src/inference.pyx":1054 + * + * for j from 0 <= j < len(row): + * result[i, j] = row[j] # <<<<<<<<<<<<<< + * + * return result + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_row, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + + /* "pandas/src/inference.pyx":1056 + * result[i, j] = row[j] + * + * return result # <<<<<<<<<<<<<< + * + * def tuples_to_object_array(ndarray[object] tuples): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":1034 + * + * + * def to_object_array(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":1058 + * return result + * + * def tuples_to_object_array(ndarray[object] tuples): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_192tuples_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_tuples); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_192tuples_to_object_array = {__Pyx_NAMESTR("tuples_to_object_array"), (PyCFunction)__pyx_pw_6pandas_3lib_192tuples_to_object_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_192tuples_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_tuples) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tuples_to_object_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tuples), __pyx_ptype_5numpy_ndarray, 1, "tuples", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_191tuples_to_object_array(__pyx_self, ((PyArrayObject *)__pyx_v_tuples)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_191tuples_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tuples) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_tup = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_tuples; + __Pyx_Buffer __pyx_pybuffer_tuples; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + long __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject **__pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tuples_to_object_array", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_tuples.pybuffer.buf = NULL; + __pyx_pybuffer_tuples.refcount = 0; + __pyx_pybuffernd_tuples.data = NULL; + __pyx_pybuffernd_tuples.rcbuffer = &__pyx_pybuffer_tuples; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tuples.rcbuffer->pybuffer, (PyObject*)__pyx_v_tuples, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_tuples.diminfo[0].strides = __pyx_pybuffernd_tuples.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tuples.diminfo[0].shape = __pyx_pybuffernd_tuples.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":1064 + * tuple tup + * + * n = len(tuples) # <<<<<<<<<<<<<< + * k = len(tuples[0]) + * result = np.empty((n, k), dtype=object) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_tuples)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1065 + * + * n = len(tuples) + * k = len(tuples[0]) # <<<<<<<<<<<<<< + * result = np.empty((n, k), dtype=object) + * for i in range(n): + */ + __pyx_t_3 = 0; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_tuples.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_tuples.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_tuples.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_tuples.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_k = __pyx_t_1; + + /* "pandas/src/inference.pyx":1066 + * n = len(tuples) + * k = len(tuples[0]) + * result = np.empty((n, k), dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * tup = tuples[i] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1067 + * k = len(tuples[0]) + * result = np.empty((n, k), dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * tup = tuples[i] + * for j in range(k): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/inference.pyx":1068 + * result = np.empty((n, k), dtype=object) + * for i in range(n): + * tup = tuples[i] # <<<<<<<<<<<<<< + * for j in range(k): + * result[i, j] = tup[j] + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_tuples.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_tuples.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_tuples.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_tuples.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_tup, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1069 + * for i in range(n): + * tup = tuples[i] + * for j in range(k): # <<<<<<<<<<<<<< + * result[i, j] = tup[j] + * + */ + __pyx_t_14 = __pyx_v_k; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; + + /* "pandas/src/inference.pyx":1070 + * tup = tuples[i] + * for j in range(k): + * result[i, j] = tup[j] # <<<<<<<<<<<<<< + * + * return result + */ + if (unlikely(__pyx_v_tup == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_tup, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_4 = 1; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_4 = 1; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + + /* "pandas/src/inference.pyx":1072 + * result[i, j] = tup[j] + * + * return result # <<<<<<<<<<<<<< + * + * def to_object_array_tuples(list rows): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":1058 + * return result + * + * def tuples_to_object_array(ndarray[object] tuples): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tuples.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.tuples_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tuples.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":1074 + * return result + * + * def to_object_array_tuples(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_194to_object_array_tuples(PyObject *__pyx_self, PyObject *__pyx_v_rows); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_194to_object_array_tuples = {__Pyx_NAMESTR("to_object_array_tuples"), (PyCFunction)__pyx_pw_6pandas_3lib_194to_object_array_tuples, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_194to_object_array_tuples(PyObject *__pyx_self, PyObject *__pyx_v_rows) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_object_array_tuples (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rows), (&PyList_Type), 1, "rows", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_193to_object_array_tuples(__pyx_self, ((PyObject*)__pyx_v_rows)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_193to_object_array_tuples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rows) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_tmp; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_row = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyObject **__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_object_array_tuples", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/src/inference.pyx":1080 + * tuple row + * + * n = len(rows) # <<<<<<<<<<<<<< + * + * k = 0 + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_rows); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1082 + * n = len(rows) + * + * k = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * tmp = len(rows[i]) + */ + __pyx_v_k = 0; + + /* "pandas/src/inference.pyx":1083 + * + * k = 0 + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * tmp = len(rows[i]) + * if tmp > k: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":1084 + * k = 0 + * for i from 0 <= i < n: + * tmp = len(rows[i]) # <<<<<<<<<<<<<< + * if tmp > k: + * k = tmp + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tmp = __pyx_t_3; + + /* "pandas/src/inference.pyx":1085 + * for i from 0 <= i < n: + * tmp = len(rows[i]) + * if tmp > k: # <<<<<<<<<<<<<< + * k = tmp + * + */ + __pyx_t_4 = ((__pyx_v_tmp > __pyx_v_k) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":1086 + * tmp = len(rows[i]) + * if tmp > k: + * k = tmp # <<<<<<<<<<<<<< + * + * result = np.empty((n, k), dtype=object) + */ + __pyx_v_k = __pyx_v_tmp; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/src/inference.pyx":1088 + * k = tmp + * + * result = np.empty((n, k), dtype=object) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1090 + * result = np.empty((n, k), dtype=object) + * + * try: # <<<<<<<<<<<<<< + * for i in range(n): + * row = rows[i] + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/src/inference.pyx":1091 + * + * try: + * for i in range(n): # <<<<<<<<<<<<<< + * row = rows[i] + * for j from 0 <= j < len(row): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/inference.pyx":1092 + * try: + * for i in range(n): + * row = rows[i] # <<<<<<<<<<<<<< + * for j from 0 <= j < len(row): + * result[i, j] = row[j] + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1093 + * for i in range(n): + * row = rows[i] + * for j from 0 <= j < len(row): # <<<<<<<<<<<<<< + * result[i, j] = row[j] + * except Exception: + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_13 = PyTuple_GET_SIZE(__pyx_v_row); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_13; __pyx_v_j++) { + + /* "pandas/src/inference.pyx":1094 + * row = rows[i] + * for j from 0 <= j < len(row): + * result[i, j] = row[j] # <<<<<<<<<<<<<< + * except Exception: + * # upcast any subclasses to tuple + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_row, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_16); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1095 + * for j from 0 <= j < len(row): + * result[i, j] = row[j] + * except Exception: # <<<<<<<<<<<<<< + * # upcast any subclasses to tuple + * for i in range(n): + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("pandas.lib.to_object_array_tuples", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/src/inference.pyx":1097 + * except Exception: + * # upcast any subclasses to tuple + * for i in range(n): # <<<<<<<<<<<<<< + * row = tuple(rows[i]) + * for j from 0 <= j < len(row): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/inference.pyx":1098 + * # upcast any subclasses to tuple + * for i in range(n): + * row = tuple(rows[i]) # <<<<<<<<<<<<<< + * for j from 0 <= j < len(row): + * result[i, j] = row[j] + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1099 + * for i in range(n): + * row = tuple(rows[i]) + * for j from 0 <= j < len(row): # <<<<<<<<<<<<<< + * result[i, j] = row[j] + * + */ + __pyx_t_13 = PyTuple_GET_SIZE(__pyx_v_row); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_13; __pyx_v_j++) { + + /* "pandas/src/inference.pyx":1100 + * row = tuple(rows[i]) + * for j from 0 <= j < len(row): + * result[i, j] = row[j] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_row, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10); + __pyx_L13_try_end:; + } + + /* "pandas/src/inference.pyx":1102 + * result[i, j] = row[j] + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":1074 + * return result + * + * def to_object_array_tuples(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_17); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.to_object_array_tuples", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":1105 + * + * + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(keys) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_196fast_multiget(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_196fast_multiget = {__Pyx_NAMESTR("fast_multiget"), (PyCFunction)__pyx_pw_6pandas_3lib_196fast_multiget, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_196fast_multiget(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_mapping = 0; + PyArrayObject *__pyx_v_keys = 0; + PyObject *__pyx_v_default = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_multiget (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping,&__pyx_n_s_keys,&__pyx_n_s_default,0}; + PyObject* values[3] = {0,0,0}; + values[2] = __pyx_k__57; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapping)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fast_multiget", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fast_multiget") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_mapping = ((PyObject*)values[0]); + __pyx_v_keys = ((PyArrayObject *)values[1]); + __pyx_v_default = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fast_multiget", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.fast_multiget", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapping), (&PyDict_Type), 1, "mapping", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_195fast_multiget(__pyx_self, __pyx_v_mapping, __pyx_v_keys, __pyx_v_default); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_195fast_multiget(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping, PyArrayObject *__pyx_v_keys, PyObject *__pyx_v_default) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + PyObject **__pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_multiget", 0); + __Pyx_INCREF((PyObject *)__pyx_v_keys); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + + /* "pandas/src/inference.pyx":1107 + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): + * cdef: + * Py_ssize_t i, n = len(keys) # <<<<<<<<<<<<<< + * object val + * ndarray[object] output = np.empty(n, dtype='O') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_keys)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1109 + * Py_ssize_t i, n = len(keys) + * object val + * ndarray[object] output = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1111 + * ndarray[object] output = np.empty(n, dtype='O') + * + * if n == 0: # <<<<<<<<<<<<<< + * # kludge, for Series + * return np.empty(0, dtype='f8') + */ + __pyx_t_7 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":1113 + * if n == 0: + * # kludge, for Series + * return np.empty(0, dtype='f8') # <<<<<<<<<<<<<< + * + * keys = getattr(keys, 'values', keys) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__58, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":1115 + * return np.empty(0, dtype='f8') + * + * keys = getattr(keys, 'values', keys) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_keys), __pyx_n_s_values, ((PyObject *)__pyx_v_keys)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_keys, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":1117 + * keys = getattr(keys, 'values', keys) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(keys, i) + * if val in mapping: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/inference.pyx":1118 + * + * for i in range(n): + * val = util.get_value_1d(keys, i) # <<<<<<<<<<<<<< + * if val in mapping: + * output[i] = mapping[val] + */ + __pyx_t_4 = get_value_1d(__pyx_v_keys, __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":1119 + * for i in range(n): + * val = util.get_value_1d(keys, i) + * if val in mapping: # <<<<<<<<<<<<<< + * output[i] = mapping[val] + * else: + */ + if (unlikely(__pyx_v_mapping == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_mapping, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_7 != 0); + if (__pyx_t_9) { + + /* "pandas/src/inference.pyx":1120 + * val = util.get_value_1d(keys, i) + * if val in mapping: + * output[i] = mapping[val] # <<<<<<<<<<<<<< + * else: + * output[i] = default + */ + if (unlikely(__pyx_v_mapping == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_mapping, __pyx_v_val); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_output.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_12); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_12); + *__pyx_t_12 = __pyx_t_4; + __Pyx_GIVEREF(*__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/inference.pyx":1122 + * output[i] = mapping[val] + * else: + * output[i] = default # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(output) + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_output.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_12); + __Pyx_INCREF(__pyx_v_default); __Pyx_DECREF(*__pyx_t_12); + *__pyx_t_12 = __pyx_v_default; + __Pyx_GIVEREF(*__pyx_t_12); + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":1124 + * output[i] = default + * + * return maybe_convert_objects(output) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_output)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_output)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":1105 + * + * + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(keys) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_multiget", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XDECREF((PyObject *)__pyx_v_keys); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_result; + char *__pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_to_dts", 0); + __Pyx_INCREF(__pyx_v_val); + + /* "datetime.pxd":130 + * cdef char *tmp + * + * if PyUnicode_Check(val): # <<<<<<<<<<<<<< + * val = PyUnicode_AsASCIIString(val); + * + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":131 + * + * if PyUnicode_Check(val): + * val = PyUnicode_AsASCIIString(val); # <<<<<<<<<<<<<< + * + * tmp = val + */ + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "datetime.pxd":133 + * val = PyUnicode_AsASCIIString(val); + * + * tmp = val # <<<<<<<<<<<<<< + * result = _cstring_to_dts(tmp, len(val), dts) + * + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmp = __pyx_t_3; + + /* "datetime.pxd":134 + * + * tmp = val + * result = _cstring_to_dts(tmp, len(val), dts) # <<<<<<<<<<<<<< + * + * if result == -1: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts); + + /* "datetime.pxd":136 + * result = _cstring_to_dts(tmp, len(val), dts) + * + * if result == -1: # <<<<<<<<<<<<<< + * raise ValueError('Unable to parse %s' % str(val)) + * + */ + __pyx_t_1 = ((__pyx_v_result == -1) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":137 + * + * if result == -1: + * raise ValueError('Unable to parse %s' % str(val)) # <<<<<<<<<<<<<< + * + * cdef inline int _cstring_to_dts(char *val, int length, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("datetime._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts) { + npy_bool __pyx_v_islocal; + npy_bool __pyx_v_special; + PANDAS_DATETIMEUNIT __pyx_v_out_bestunit; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cstring_to_dts", 0); + + /* "datetime.pxd":146 + * int result + * + * result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns, # <<<<<<<<<<<<<< + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + */ + __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special)); + + /* "datetime.pxd":149 + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime64_to_datetime", 0); + + /* "datetime.pxd":154 + * cdef inline object _datetime64_to_datetime(int64_t val): + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * return _dts_to_pydatetime(&dts) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "datetime.pxd":155 + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * return _dts_to_pydatetime(&dts) # <<<<<<<<<<<<<< + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dts_to_pydatetime", 0); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_XDECREF(__pyx_r); + + /* "datetime.pxd":160 + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + */ + __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0); + + /* "datetime.pxd":163 + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":164 + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":165 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":166 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) # <<<<<<<<<<<<<< + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + */ + __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val); + + /* "datetime.pxd":167 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) # <<<<<<<<<<<<<< + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + */ + __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val); + + /* "datetime.pxd":168 + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) # <<<<<<<<<<<<<< + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + */ + __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val); + + /* "datetime.pxd":169 + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val); + + /* "datetime.pxd":170 + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":171 + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _dtlike_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + npy_int64 __pyx_t_2; + npy_int32 __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dtlike_to_datetime64", 0); + + /* "datetime.pxd":175 + * cdef inline int64_t _dtlike_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = val.year # <<<<<<<<<<<<<< + * dts.month = val.month + * dts.day = val.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->year = __pyx_t_2; + + /* "datetime.pxd":176 + * pandas_datetimestruct *dts): + * dts.year = val.year + * dts.month = val.month # <<<<<<<<<<<<<< + * dts.day = val.day + * dts.hour = val.hour + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->month = __pyx_t_3; + + /* "datetime.pxd":177 + * dts.year = val.year + * dts.month = val.month + * dts.day = val.day # <<<<<<<<<<<<<< + * dts.hour = val.hour + * dts.min = val.minute + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->day = __pyx_t_3; + + /* "datetime.pxd":178 + * dts.month = val.month + * dts.day = val.day + * dts.hour = val.hour # <<<<<<<<<<<<<< + * dts.min = val.minute + * dts.sec = val.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->hour = __pyx_t_3; + + /* "datetime.pxd":179 + * dts.day = val.day + * dts.hour = val.hour + * dts.min = val.minute # <<<<<<<<<<<<<< + * dts.sec = val.second + * dts.us = val.microsecond + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->min = __pyx_t_3; + + /* "datetime.pxd":180 + * dts.hour = val.hour + * dts.min = val.minute + * dts.sec = val.second # <<<<<<<<<<<<<< + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->sec = __pyx_t_3; + + /* "datetime.pxd":181 + * dts.min = val.minute + * dts.sec = val.second + * dts.us = val.microsecond # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->us = __pyx_t_3; + + /* "datetime.pxd":182 + * dts.sec = val.second + * dts.us = val.microsecond + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":183 + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _date_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_to_datetime64", 0); + + /* "datetime.pxd":187 + * cdef inline int64_t _date_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":188 + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":189 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":190 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->hour = 0; + __pyx_v_dts->min = 0; + __pyx_v_dts->sec = 0; + __pyx_v_dts->us = 0; + + /* "datetime.pxd":191 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":192 + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + + /* "View.MemoryView":117 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":123 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize + * + */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":124 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":126 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":127 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":129 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":130 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if isinstance(format, unicode): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":132 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if isinstance(format, unicode): # <<<<<<<<<<<<<< + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyUnicode_Check(__pyx_v_format); + __pyx_t_4 = (__pyx_t_2 != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":133 + * + * if isinstance(format, unicode): + * format = (format).encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + if (unlikely(__pyx_v_format == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyUnicode_AsASCIIString(((PyObject*)__pyx_v_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "View.MemoryView":134 + * if isinstance(format, unicode): + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":135 + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->format = __pyx_t_5; + + /* "View.MemoryView":138 + * + * + * self._shape = PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * + */ + __pyx_v_self->_shape = ((Py_ssize_t *)PyMem_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + + /* "View.MemoryView":139 + * + * self._shape = PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: + */ + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + + /* "View.MemoryView":141 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":142 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":145 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_6 = 0; + __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_dim = __pyx_t_8; + __pyx_v_idx = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":146 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":147 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_7 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":148 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< + * + * cdef char order + */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":151 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":152 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":153 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + goto __pyx_L10; + } + + /* "View.MemoryView":154 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":155 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":156 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + goto __pyx_L10; + } + /*else*/ { + + /* "View.MemoryView":158 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L10:; + + /* "View.MemoryView":160 + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + * + * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< + * itemsize, self.ndim, order) + * + */ + __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); + + /* "View.MemoryView":163 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":164 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":165 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":168 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":169 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":170 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":172 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":173 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":174 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":175 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":176 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":179 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":180 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":181 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":182 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + goto __pyx_L3; + } + + /* "View.MemoryView":183 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":184 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":185 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":186 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":187 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":188 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":189 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":190 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":191 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":192 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":193 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":194 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":196 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":197 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":199 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":201 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":179 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":205 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":206 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":207 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + goto __pyx_L3; + } + + /* "View.MemoryView":208 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":209 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":210 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":212 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyMem_Free(self._shape) + * + */ + free(__pyx_v_self->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":213 + * self._strides, self.ndim, False) + * free(self.data) + * PyMem_Free(self._shape) # <<<<<<<<<<<<<< + * + * property memview: + */ + PyMem_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":205 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":217 + * property memview: + * @cname('get_memview') + * def __get__(self): # <<<<<<<<<<<<<< + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + */ + +/* Python wrapper */ +static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/ +static PyObject *get_memview(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":219 + * def __get__(self): + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":220 + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":217 + * property memview: + * @cname('get_memview') + * def __get__(self): # <<<<<<<<<<<<<< + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":223 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":224 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":223 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":226 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":227 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":226 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":229 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":230 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":229 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":234 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":238 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":239 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":241 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":242 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":241 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":243 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":245 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":234 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":271 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":272 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":271 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":273 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":274 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":273 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":288 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":290 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset + * + */ + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + + /* "View.MemoryView":294 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":296 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":297 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p + */ + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":299 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview') + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":288 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":317 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":318 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":319 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":320 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type))); + if (!(__pyx_t_1 != 0)) { + __pyx_t_2 = (__pyx_v_obj != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "View.MemoryView":321 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":322 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_3 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":323 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + + /* "View.MemoryView":324 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * self.lock = PyThread_allocate_lock() + */ + Py_INCREF(Py_None); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":326 + * Py_INCREF(Py_None) + * + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock == NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":327 + * + * self.lock = PyThread_allocate_lock() + * if self.lock == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_3 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":328 + * self.lock = PyThread_allocate_lock() + * if self.lock == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":330 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = self.view.format == b'O' + * else: + */ + __pyx_t_3 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":331 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_3; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":333 + * self.dtype_is_object = self.view.format == b'O' + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L6:; + + /* "View.MemoryView":335 + * self.dtype_is_object = dtype_is_object + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":337 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(memoryview self): + */ + __pyx_v_self->typeinfo = NULL; + + /* "View.MemoryView":317 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":339 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":340 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":341 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * + * if self.lock != NULL: + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":343 + * __Pyx_ReleaseBuffer(&self.view) + * + * if self.lock != NULL: # <<<<<<<<<<<<<< + * PyThread_free_lock(self.lock) + * + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":344 + * + * if self.lock != NULL: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":339 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":346 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":348 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * + * for dim, idx in enumerate(index): + */ + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + + /* "View.MemoryView":350 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_v_index) || PyTuple_CheckExact(__pyx_v_index)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":351 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":353 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":346 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":356 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":357 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":358 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + } + + /* "View.MemoryView":360 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":363 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + + /* "View.MemoryView":364 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":366 + * return memview_slice(self, indices) + * else: + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) + * + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":367 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":356 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":369 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":370 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":372 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":373 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":374 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":375 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":377 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":379 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":369 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":381 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":382 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type)); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":384 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":385 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":384 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":386 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":387 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":389 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":381 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":391 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":395 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":396 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":397 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":395 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":391 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":399 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[128]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + char const *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":401 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":406 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): + */ + __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + + /* "View.MemoryView":408 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":409 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":410 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":411 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":412 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":414 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":416 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":417 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":418 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + goto __pyx_L8; + } + /*else*/ { + + /* "View.MemoryView":420 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":424 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":425 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":426 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":429 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":399 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":431 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":432 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":433 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":431 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":435 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":438 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":441 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":442 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":443 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + } + /*else:*/ { + + /* "View.MemoryView":447 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + __pyx_t_7 = strlen(__pyx_v_self->view.format); + __pyx_t_8 = ((__pyx_t_7 == 1) != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":448 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L6_except_return; + } + + /* "View.MemoryView":449 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "View.MemoryView":444 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":445 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L10_try_end:; + } + + /* "View.MemoryView":435 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":451 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + char *__pyx_t_10; + char *__pyx_t_11; + char *__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":454 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":459 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":460 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":462 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":464 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_7 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_8 = __pyx_v_bytesvalue; + __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8); + __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8)); + for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) { + __pyx_t_9 = __pyx_t_12; + __pyx_v_c = (__pyx_t_9[0]); + + /* "View.MemoryView":465 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_7; + + /* "View.MemoryView":464 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_7 = (__pyx_t_7 + 1); + + /* "View.MemoryView":465 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "View.MemoryView":451 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":468 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":469 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":470 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":472 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":474 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":475 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":477 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":479 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":480 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":482 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":484 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":485 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":487 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":489 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":490 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":491 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":492 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":493 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":494 + * info.len = self.view.len + * info.readonly = 0 + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":468 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":501 + * property T: + * @cname('__pyx_memoryview_transpose') + * def __get__(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":502 + * @cname('__pyx_memoryview_transpose') + * def __get__(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":503 + * def __get__(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":504 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * property base: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":501 + * property T: + * @cname('__pyx_memoryview_transpose') + * def __get__(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":508 + * property base: + * @cname('__pyx_memoryview__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":509 + * @cname('__pyx_memoryview__get__base') + * def __get__(self): + * return self.obj # <<<<<<<<<<<<<< + * + * property shape: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":508 + * property base: + * @cname('__pyx_memoryview__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":513 + * property shape: + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): # <<<<<<<<<<<<<< + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":514 + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property strides: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_self->view.ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "View.MemoryView":513 + * property shape: + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): # <<<<<<<<<<<<<< + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":518 + * property strides: + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":519 + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":521 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":523 + * raise ValueError("Buffer view does not expose strides") + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property suboffsets: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_self->view.ndim; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":518 + * property strides: + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":527 + * property suboffsets: + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":528 + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return [-1] * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":529 + * def __get__(self): + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_neg_1); + PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + } + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":531 + * return [-1] * self.view.ndim + * + * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property ndim: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_self->view.ndim; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":527 + * property suboffsets: + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":535 + * property ndim: + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":536 + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * property itemsize: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":535 + * property ndim: + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":540 + * property itemsize: + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":541 + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * property nbytes: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":540 + * property itemsize: + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":545 + * property nbytes: + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":546 + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * property size: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":545 + * property nbytes: + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":550 + * property size: + * @cname('__pyx_memoryview_get_size') + * def __get__(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":551 + * @cname('__pyx_memoryview_get_size') + * def __get__(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":552 + * def __get__(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.shape: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":554 + * result = 1 + * + * for length in self.shape: # <<<<<<<<<<<<<< + * result *= length + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":555 + * + * for length in self.shape: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":557 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":559 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":550 + * property size: + * @cname('__pyx_memoryview_get_size') + * def __get__(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":561 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":562 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< + * + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + } + + /* "View.MemoryView":565 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":567 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":568 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":569 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":568 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":567 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":571 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":572 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":571 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":575 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":578 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":579 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<< + * + * def is_f_contig(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":575 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":581 + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":584 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":585 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":581 + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":587 + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":589 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &mslice) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + + /* "View.MemoryView":591 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":592 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":597 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":587 + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":599 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":601 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &src) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + + /* "View.MemoryView":603 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":604 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":609 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":599 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":613 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":614 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":615 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":616 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":613 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":619 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":620 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":619 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":622 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":627 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":628 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":630 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":632 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":633 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":634 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":635 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_tup) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":636 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":637 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":638 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_9, __pyx_temp, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "View.MemoryView":639 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":641 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_L7:; + + /* "View.MemoryView":642 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":644 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + __pyx_t_1 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_1 = ((!(__Pyx_PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_11 = __pyx_t_1; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + + /* "View.MemoryView":645 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":647 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + if (!__pyx_v_have_slices) { + __pyx_t_11 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_v_have_slices; + } + __pyx_v_have_slices = __pyx_t_2; + + /* "View.MemoryView":648 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":650 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":651 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_2 = (__pyx_v_nslices != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":652 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":654 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_2) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_9 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_9 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":622 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":656 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(ndim): + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":658 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * cdef int i + * for i in range(ndim): # <<<<<<<<<<<<<< + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":659 + * cdef int i + * for i in range(ndim): + * if suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":660 + * for i in range(ndim): + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + + /* "View.MemoryView":656 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(ndim): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":667 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":668 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":675 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":679 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "View.MemoryView":681 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":682 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":683 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":685 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":686 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":692 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data + * + */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; + + /* "View.MemoryView":693 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; + + /* "View.MemoryView":698 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":699 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":703 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (PyList_CheckExact(__pyx_v_indices) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":704 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (__Pyx_PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":708 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":705 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + + /* "View.MemoryView":711 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":712 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":713 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":714 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1; + + /* "View.MemoryView":715 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":717 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_12 = __pyx_int_0; + } else { + __pyx_t_12 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":718 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_9 = __pyx_int_0; + } else { + __pyx_t_9 = __pyx_t_12; + __pyx_t_12 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":719 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_12 = __pyx_int_0; + } else { + __pyx_t_12 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":721 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":722 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":723 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":725 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":731 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":733 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":734 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":735 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "View.MemoryView":736 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "View.MemoryView":734 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":739 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":740 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":739 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":667 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":764 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":784 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":786 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":787 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":788 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":789 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":792 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + __pyx_t_2 = (__pyx_v_have_step != 0); + if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_step < 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_v_negative_step = __pyx_t_4; + + /* "View.MemoryView":794 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + if ((__pyx_v_have_step != 0)) { + __pyx_t_4 = (__pyx_v_step == 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = (__pyx_v_have_step != 0); + } + if (__pyx_t_2) { + + /* "View.MemoryView":795 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + + /* "View.MemoryView":798 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":799 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":800 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":801 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":802 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "View.MemoryView":803 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":804 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":805 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + goto __pyx_L10; + } + /*else*/ { + + /* "View.MemoryView":807 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_start = __pyx_v_shape; + } + __pyx_L10:; + goto __pyx_L8; + } + __pyx_L8:; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":809 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":810 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + goto __pyx_L11; + } + /*else*/ { + + /* "View.MemoryView":812 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + __pyx_v_start = 0; + } + __pyx_L11:; + } + __pyx_L7:; + + /* "View.MemoryView":814 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":815 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":816 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":817 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":818 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + + /* "View.MemoryView":819 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":820 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + /*else*/ { + + /* "View.MemoryView":822 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":823 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1; + goto __pyx_L15; + } + /*else*/ { + + /* "View.MemoryView":825 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L15:; + } + __pyx_L12:; + + /* "View.MemoryView":827 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + goto __pyx_L16; + } + __pyx_L16:; + + /* "View.MemoryView":832 + * + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + * + * if (stop - start) - step * new_shape: + */ + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + + /* "View.MemoryView":834 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":835 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "View.MemoryView":837 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + goto __pyx_L18; + } + __pyx_L18:; + + /* "View.MemoryView":841 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":842 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":843 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; + + /* "View.MemoryView":846 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":847 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + goto __pyx_L19; + } + /*else*/ { + + /* "View.MemoryView":849 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L19:; + + /* "View.MemoryView":851 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":854 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + goto __pyx_L22; + } + /*else*/ { + + /* "View.MemoryView":856 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L22:; + goto __pyx_L21; + } + /*else*/ { + + /* "View.MemoryView":859 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L21:; + goto __pyx_L20; + } + __pyx_L20:; + + /* "View.MemoryView":861 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":764 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":867 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":869 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1; + + /* "View.MemoryView":870 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":873 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":874 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":875 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":877 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":878 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":879 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":880 + * stride = view.strides[dim] + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + * + * if index < 0: + */ + __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + goto __pyx_L4; + } + __pyx_L4:; + } + __pyx_L3:; + + /* "View.MemoryView":882 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":883 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":884 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":885 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "View.MemoryView":887 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":888 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":890 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":891 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":892 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + * + * return resultp + */ + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + goto __pyx_L8; + } + __pyx_L8:; + + /* "View.MemoryView":894 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":867 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":900 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":901 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":903 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * + */ + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; + + /* "View.MemoryView":904 + * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; + + /* "View.MemoryView":908 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":909 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":910 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":911 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":913 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_6 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_6) { + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "View.MemoryView":914 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "View.MemoryView":916 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":900 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":933 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":934 + * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + + /* "View.MemoryView":933 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":936 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":937 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":938 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":940 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_vtabptr_memoryview->convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":936 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":942 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":943 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":944 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":946 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * property base: + */ + __pyx_t_3 = __pyx_vtabptr_memoryview->assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":942 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":950 + * property base: + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":951 + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":950 + * property base: + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":957 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":966 + * cdef int i + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":967 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "View.MemoryView":972 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":974 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; + + /* "View.MemoryView":975 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":977 + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< + * result.typeinfo = memviewslice.memview.typeinfo + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":978 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":980 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":981 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":982 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":983 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":984 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":986 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":988 + * result.flags = PyBUF_RECORDS + * + * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< + * result.view.strides = result.from_slice.strides + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + + /* "View.MemoryView":989 + * + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * + */ + __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + + /* "View.MemoryView":990 + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":992 + * result.view.suboffsets = result.from_slice.suboffsets + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for i in range(ndim): + * result.view.len *= result.view.shape[i] + */ + __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_6; + + /* "View.MemoryView":993 + * + * result.view.len = result.view.itemsize + * for i in range(ndim): # <<<<<<<<<<<<<< + * result.view.len *= result.view.shape[i] + * + */ + __pyx_t_7 = __pyx_v_ndim; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":994 + * result.view.len = result.view.itemsize + * for i in range(ndim): + * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<< + * + * result.to_object_func = to_object_func + */ + __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i])); + } + + /* "View.MemoryView":996 + * result.view.len *= result.view.shape[i] + * + * result.to_object_func = to_object_func # <<<<<<<<<<<<<< + * result.to_dtype_func = to_dtype_func + * + */ + __pyx_v_result->to_object_func = __pyx_v_to_object_func; + + /* "View.MemoryView":997 + * + * result.to_object_func = to_object_func + * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; + + /* "View.MemoryView":999 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":957 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1002 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1005 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1006 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1007 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1009 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1010 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1002 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1013 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1017 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1018 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1019 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1021 + * suboffsets = memview.view.suboffsets + * + * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< + * dst.data = memview.view.buf + * + */ + __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + + /* "View.MemoryView":1022 + * + * dst.memview = <__pyx_memoryview *> memview + * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * + * for dim in range(memview.view.ndim): + */ + __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + + /* "View.MemoryView":1024 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1025 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1026 + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< + * if suboffsets == NULL: + * dst.suboffsets[dim] = -1 + */ + (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + + /* "View.MemoryView":1027 + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: # <<<<<<<<<<<<<< + * dst.suboffsets[dim] = -1 + * else: + */ + __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1028 + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: + * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[dim] = suboffsets[dim] + */ + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":1030 + * dst.suboffsets[dim] = -1 + * else: + * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object') + */ + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]); + } + __pyx_L5:; + } + + /* "View.MemoryView":1013 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1033 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1036 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1037 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1033 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1040 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1047 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1048 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1049 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1051 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1052 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1054 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1056 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1040 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1062 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1063 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1064 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1066 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1062 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1069 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1074 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1075 + * cdef int i + * cdef Py_ssize_t c_stride = 0 + * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_f_stride = 0; + + /* "View.MemoryView":1077 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1078 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1079 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1080 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1082 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1083 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1084 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1085 + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + */ + goto __pyx_L7_break; + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1087 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1088 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1090 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1069 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1093 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1100 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1101 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1102 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1103 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1105 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1106 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_1 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1107 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_3 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_3) { + __pyx_t_3 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_4 = (__pyx_t_3 != 0); + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (__pyx_t_2) { + + /* "View.MemoryView":1108 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":1110 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + __pyx_t_5 = __pyx_v_dst_extent; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1111 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1112 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1113 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1115 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + __pyx_t_5 = __pyx_v_dst_extent; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1116 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1120 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1121 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1093 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1123 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1126 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1123 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1130 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1133 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1135 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1136 + * + * for i in range(ndim): + * size *= src.shape[i] # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); + } + + /* "View.MemoryView":1138 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1130 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1141 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1150 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1151 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1152 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1153 + * for idx in range(ndim): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1155 + * stride = stride * shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1156 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1157 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1159 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1141 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1162 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1173 + * cdef void *result + * + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef size_t size = slice_get_size(src, ndim) + * + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1174 + * + * cdef size_t itemsize = src.memview.view.itemsize + * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + * + * result = malloc(size) + */ + __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + + /* "View.MemoryView":1176 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1177 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1178 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1181 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1182 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1183 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1184 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1185 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1; + } + + /* "View.MemoryView":1187 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1191 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1192 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1193 + * for i in range(ndim): + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + * + * if slice_is_contig(src, order, ndim): + */ + (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "View.MemoryView":1195 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1196 + * + * if slice_is_contig(src, order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + goto __pyx_L9; + } + /*else*/ { + + /* "View.MemoryView":1198 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1200 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1162 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1205 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1208 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1207 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1205 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1211 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1212 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyUnicode_Format(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1211 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1215 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1216 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1217 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "View.MemoryView":1219 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":1215 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1222 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1230 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1231 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1233 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1234 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1235 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1238 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1239 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + goto __pyx_L3; + } + + /* "View.MemoryView":1240 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1241 + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + * + * cdef int ndim = max(src_ndim, dst_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1243 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1245 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1246 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1247 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1248 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1249 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":1251 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L7:; + goto __pyx_L6; + } + __pyx_L6:; + + /* "View.MemoryView":1253 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1254 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "View.MemoryView":1256 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(&src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1258 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1259 + * + * if not slice_is_contig(&src, order, ndim): + * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + goto __pyx_L10; + } + __pyx_L10:; + + /* "View.MemoryView":1261 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1262 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":1264 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1267 + * + * + * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1268 + * + * if slice_is_contig(&src, 'C', ndim): + * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(&src, 'F', ndim): + * direct_copy = slice_is_contig(&dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim); + goto __pyx_L12; + } + + /* "View.MemoryView":1269 + * if slice_is_contig(&src, 'C', ndim): + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(&dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1270 + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): + * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim); + goto __pyx_L12; + } + __pyx_L12:; + + /* "View.MemoryView":1272 + * direct_copy = slice_is_contig(&dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1274 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1275 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1276 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1277 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1278 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "View.MemoryView":1280 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1283 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1284 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L14; + } + __pyx_L14:; + + /* "View.MemoryView":1286 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1287 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1288 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1290 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1291 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1222 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1294 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + + /* "View.MemoryView":1298 + * int ndim_other) nogil: + * cdef int i + * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + + /* "View.MemoryView":1300 + * cdef int offset = ndim_other - ndim + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1301 + * + * for i in range(ndim - 1, -1, -1): + * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<< + * slice.strides[i + offset] = slice.strides[i] + * slice.suboffsets[i + offset] = slice.suboffsets[i] + */ + (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]); + + /* "View.MemoryView":1302 + * for i in range(ndim - 1, -1, -1): + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<< + * slice.suboffsets[i + offset] = slice.suboffsets[i] + * + */ + (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]); + + /* "View.MemoryView":1303 + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] + * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1305 + * slice.suboffsets[i + offset] = slice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1306 + * + * for i in range(offset): + * slice.shape[i] = 1 # <<<<<<<<<<<<<< + * slice.strides[i] = slice.strides[0] + * slice.suboffsets[i] = -1 + */ + (__pyx_v_slice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1307 + * for i in range(offset): + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<< + * slice.suboffsets[i] = -1 + * + */ + (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]); + + /* "View.MemoryView":1308 + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] + * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1; + } + + /* "View.MemoryView":1294 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1316 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { + int __pyx_t_1; + + /* "View.MemoryView":1320 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1321 + * + * if dtype_is_object: + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< + * dst.strides, ndim, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1316 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + + /* function exit code */ +} + +/* "View.MemoryView":1325 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1328 + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1325 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1331 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1335 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1337 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1338 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":1340 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":1342 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1345 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1331 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1351 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1354 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1355 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1357 + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1351 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1365 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1366 + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] + * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_extent = (__pyx_v_shape[0]); + + /* "View.MemoryView":1368 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1369 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1370 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1371 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1373 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1374 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1376 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +static PyObject *__pyx_tp_new_6pandas_3lib__PandasNull(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib__PandasNull(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6pandas_3lib__PandasNull[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib__PandasNull = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib._PandasNull"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib__PandasNull), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib__PandasNull, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + __pyx_pw_6pandas_3lib_11_PandasNull_3__hash__, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + __pyx_pw_6pandas_3lib_11_PandasNull_1__richcmp__, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib__PandasNull, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib__PandasNull, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement __pyx_vtable_6pandas_3lib_BlockPlacement; + +static PyObject *__pyx_tp_new_6pandas_3lib_BlockPlacement(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_BlockPlacement *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_BlockPlacement *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_BlockPlacement; + p->_as_slice = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_as_array = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_BlockPlacement(PyObject *o) { + struct __pyx_obj_6pandas_3lib_BlockPlacement *p = (struct __pyx_obj_6pandas_3lib_BlockPlacement *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_as_slice); + Py_CLEAR(p->_as_array); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_BlockPlacement(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_BlockPlacement *p = (struct __pyx_obj_6pandas_3lib_BlockPlacement *)o; + if (p->_as_slice) { + e = (*v)(p->_as_slice, a); if (e) return e; + } + if (p->_as_array) { + e = (*v)(p->_as_array, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_BlockPlacement(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_BlockPlacement *p = (struct __pyx_obj_6pandas_3lib_BlockPlacement *)o; + tmp = ((PyObject*)p->_as_slice); + p->_as_slice = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_as_array); + p->_as_array = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +static PyObject *__pyx_sq_item_6pandas_3lib_BlockPlacement(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static PyMethodDef __pyx_methods_6pandas_3lib_BlockPlacement[] = { + {__Pyx_NAMESTR("__unicode__"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_3__unicode__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("as_slice"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_9as_slice, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("indexer"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_11indexer, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("isin"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_13isin, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("as_array"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_15as_array, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("is_slice_like"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_17is_slice_like, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("delete"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_21delete, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_23append, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_25add, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sub"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_27sub, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_BlockPlacement = { + __pyx_pw_6pandas_3lib_14BlockPlacement_5__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_6pandas_3lib_BlockPlacement, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_BlockPlacement = { + __pyx_pw_6pandas_3lib_14BlockPlacement_5__len__, /*mp_length*/ + __pyx_pw_6pandas_3lib_14BlockPlacement_19__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_3lib_BlockPlacement = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.BlockPlacement"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_BlockPlacement), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_BlockPlacement, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_BlockPlacement, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_BlockPlacement, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_BlockPlacement, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_BlockPlacement, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6pandas_3lib_14BlockPlacement_7__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_BlockPlacement, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_14BlockPlacement_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_BlockPlacement, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_Reducer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_Reducer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_Reducer *)o); + p->arr = Py_None; Py_INCREF(Py_None); + p->dummy = Py_None; Py_INCREF(Py_None); + p->f = Py_None; Py_INCREF(Py_None); + p->labels = Py_None; Py_INCREF(Py_None); + p->typ = Py_None; Py_INCREF(Py_None); + p->index = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_Reducer(PyObject *o) { + struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arr); + Py_CLEAR(p->dummy); + Py_CLEAR(p->f); + Py_CLEAR(p->labels); + Py_CLEAR(p->typ); + Py_CLEAR(p->index); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_Reducer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o; + if (p->arr) { + e = (*v)(p->arr, a); if (e) return e; + } + if (p->dummy) { + e = (*v)(p->dummy, a); if (e) return e; + } + if (p->f) { + e = (*v)(p->f, a); if (e) return e; + } + if (p->labels) { + e = (*v)(p->labels, a); if (e) return e; + } + if (p->typ) { + e = (*v)(p->typ, a); if (e) return e; + } + if (p->index) { + e = (*v)(p->index, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_Reducer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o; + tmp = ((PyObject*)p->arr); + p->arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy); + p->dummy = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f); + p->f = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->labels); + p->labels = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->typ); + p->typ = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->index); + p->index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_3lib_Reducer[] = { + {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pw_6pandas_3lib_7Reducer_3_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pw_6pandas_3lib_7Reducer_5get_result, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pw_6pandas_3lib_7Reducer_7_get_result_array, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_Reducer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.Reducer"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_Reducer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_Reducer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Performs generic reduction operation on a C or Fortran-contiguous ndarray\n while avoiding ndarray construction overhead\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_Reducer, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_Reducer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_Reducer, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_7Reducer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_Reducer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_SeriesBinGrouper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o); + p->arr = Py_None; Py_INCREF(Py_None); + p->index = Py_None; Py_INCREF(Py_None); + p->dummy_arr = Py_None; Py_INCREF(Py_None); + p->dummy_index = Py_None; Py_INCREF(Py_None); + p->values = Py_None; Py_INCREF(Py_None); + p->f = Py_None; Py_INCREF(Py_None); + p->bins = Py_None; Py_INCREF(Py_None); + p->typ = Py_None; Py_INCREF(Py_None); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_SeriesBinGrouper(PyObject *o) { + struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arr); + Py_CLEAR(p->index); + Py_CLEAR(p->dummy_arr); + Py_CLEAR(p->dummy_index); + Py_CLEAR(p->values); + Py_CLEAR(p->f); + Py_CLEAR(p->bins); + Py_CLEAR(p->typ); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_SeriesBinGrouper(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o; + if (p->arr) { + e = (*v)(p->arr, a); if (e) return e; + } + if (p->index) { + e = (*v)(p->index, a); if (e) return e; + } + if (p->dummy_arr) { + e = (*v)(p->dummy_arr, a); if (e) return e; + } + if (p->dummy_index) { + e = (*v)(p->dummy_index, a); if (e) return e; + } + if (p->values) { + e = (*v)(p->values, a); if (e) return e; + } + if (p->f) { + e = (*v)(p->f, a); if (e) return e; + } + if (p->bins) { + e = (*v)(p->bins, a); if (e) return e; + } + if (p->typ) { + e = (*v)(p->typ, a); if (e) return e; + } + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_SeriesBinGrouper(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o; + tmp = ((PyObject*)p->arr); + p->arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->index); + p->index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy_arr); + p->dummy_arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy_index); + p->dummy_index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->values); + p->values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f); + p->f = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->bins); + p->bins = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->typ); + p->typ = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_arr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_arr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy_arr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy_arr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_f(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_bins(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_bins(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_typ(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_typ(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_3lib_SeriesBinGrouper[] = { + {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5get_result, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pw_6pandas_3lib_16SeriesBinGrouper_7_get_result_array, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_3lib_SeriesBinGrouper[] = { + {(char *)"arr", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_arr, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_arr, 0, 0}, + {(char *)"index", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_index, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_index, 0, 0}, + {(char *)"dummy_arr", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy_arr, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy_arr, 0, 0}, + {(char *)"dummy_index", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy_index, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy_index, 0, 0}, + {(char *)"values", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_values, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_values, 0, 0}, + {(char *)"f", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_f, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_f, 0, 0}, + {(char *)"bins", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_bins, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_bins, 0, 0}, + {(char *)"typ", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_typ, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_typ, 0, 0}, + {(char *)"name", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_name, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_name, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_SeriesBinGrouper = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.SeriesBinGrouper"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_SeriesBinGrouper, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Performs grouping operation according to bin edges, rather than labels\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_SeriesBinGrouper, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_SeriesBinGrouper, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_SeriesBinGrouper, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_3lib_SeriesBinGrouper, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_SeriesBinGrouper, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_SeriesGrouper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_SeriesGrouper *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o); + p->arr = Py_None; Py_INCREF(Py_None); + p->index = Py_None; Py_INCREF(Py_None); + p->dummy_arr = Py_None; Py_INCREF(Py_None); + p->dummy_index = Py_None; Py_INCREF(Py_None); + p->f = Py_None; Py_INCREF(Py_None); + p->labels = Py_None; Py_INCREF(Py_None); + p->values = Py_None; Py_INCREF(Py_None); + p->typ = Py_None; Py_INCREF(Py_None); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_SeriesGrouper(PyObject *o) { + struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arr); + Py_CLEAR(p->index); + Py_CLEAR(p->dummy_arr); + Py_CLEAR(p->dummy_index); + Py_CLEAR(p->f); + Py_CLEAR(p->labels); + Py_CLEAR(p->values); + Py_CLEAR(p->typ); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_SeriesGrouper(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o; + if (p->arr) { + e = (*v)(p->arr, a); if (e) return e; + } + if (p->index) { + e = (*v)(p->index, a); if (e) return e; + } + if (p->dummy_arr) { + e = (*v)(p->dummy_arr, a); if (e) return e; + } + if (p->dummy_index) { + e = (*v)(p->dummy_index, a); if (e) return e; + } + if (p->f) { + e = (*v)(p->f, a); if (e) return e; + } + if (p->labels) { + e = (*v)(p->labels, a); if (e) return e; + } + if (p->values) { + e = (*v)(p->values, a); if (e) return e; + } + if (p->typ) { + e = (*v)(p->typ, a); if (e) return e; + } + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_SeriesGrouper(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o; + tmp = ((PyObject*)p->arr); + p->arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->index); + p->index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy_arr); + p->dummy_arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy_index); + p->dummy_index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f); + p->f = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->labels); + p->labels = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->values); + p->values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->typ); + p->typ = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_arr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_arr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy_arr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy_arr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_f(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_labels(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_labels(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_typ(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_typ(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_3lib_SeriesGrouper[] = { + {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pw_6pandas_3lib_13SeriesGrouper_3_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pw_6pandas_3lib_13SeriesGrouper_5get_result, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pw_6pandas_3lib_13SeriesGrouper_7_get_result_array, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_3lib_SeriesGrouper[] = { + {(char *)"arr", __pyx_getprop_6pandas_3lib_13SeriesGrouper_arr, __pyx_setprop_6pandas_3lib_13SeriesGrouper_arr, 0, 0}, + {(char *)"index", __pyx_getprop_6pandas_3lib_13SeriesGrouper_index, __pyx_setprop_6pandas_3lib_13SeriesGrouper_index, 0, 0}, + {(char *)"dummy_arr", __pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy_arr, __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy_arr, 0, 0}, + {(char *)"dummy_index", __pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy_index, __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy_index, 0, 0}, + {(char *)"f", __pyx_getprop_6pandas_3lib_13SeriesGrouper_f, __pyx_setprop_6pandas_3lib_13SeriesGrouper_f, 0, 0}, + {(char *)"labels", __pyx_getprop_6pandas_3lib_13SeriesGrouper_labels, __pyx_setprop_6pandas_3lib_13SeriesGrouper_labels, 0, 0}, + {(char *)"values", __pyx_getprop_6pandas_3lib_13SeriesGrouper_values, __pyx_setprop_6pandas_3lib_13SeriesGrouper_values, 0, 0}, + {(char *)"typ", __pyx_getprop_6pandas_3lib_13SeriesGrouper_typ, __pyx_setprop_6pandas_3lib_13SeriesGrouper_typ, 0, 0}, + {(char *)"name", __pyx_getprop_6pandas_3lib_13SeriesGrouper_name, __pyx_setprop_6pandas_3lib_13SeriesGrouper_name, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_SeriesGrouper = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.SeriesGrouper"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_SeriesGrouper), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_SeriesGrouper, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Performs generic grouping operation while avoiding ndarray construction\n overhead\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_SeriesGrouper, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_SeriesGrouper, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_SeriesGrouper, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_3lib_SeriesGrouper, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_13SeriesGrouper_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_SeriesGrouper, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_3lib_Slider __pyx_vtable_6pandas_3lib_Slider; + +static PyObject *__pyx_tp_new_6pandas_3lib_Slider(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_Slider *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_Slider *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_Slider; + p->values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->buf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_Slider(PyObject *o) { + struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->values); + Py_CLEAR(p->buf); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_Slider(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o; + if (p->values) { + e = (*v)(((PyObject*)p->values), a); if (e) return e; + } + if (p->buf) { + e = (*v)(((PyObject*)p->buf), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_Slider(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o; + tmp = ((PyObject*)p->values); + p->values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->buf); + p->buf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_3lib_Slider[] = { + {__Pyx_NAMESTR("advance"), (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_3advance, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_length"), (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_5set_length, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_7reset, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_Slider = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.Slider"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_Slider), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_Slider, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Only handles contiguous data for now\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_Slider, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_Slider, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_Slider, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_6Slider_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_Slider, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_3lib_BlockSlider __pyx_vtable_6pandas_3lib_BlockSlider; + +static PyObject *__pyx_tp_new_6pandas_3lib_BlockSlider(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_BlockSlider *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_BlockSlider *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_BlockSlider; + p->frame = Py_None; Py_INCREF(Py_None); + p->dummy = Py_None; Py_INCREF(Py_None); + p->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)Py_None); Py_INCREF(Py_None); + p->blocks = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_BlockSlider(PyObject *o) { + struct __pyx_obj_6pandas_3lib_BlockSlider *p = (struct __pyx_obj_6pandas_3lib_BlockSlider *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_3lib_11BlockSlider_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->frame); + Py_CLEAR(p->dummy); + Py_CLEAR(p->idx_slider); + Py_CLEAR(p->blocks); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_BlockSlider(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_BlockSlider *p = (struct __pyx_obj_6pandas_3lib_BlockSlider *)o; + if (p->frame) { + e = (*v)(p->frame, a); if (e) return e; + } + if (p->dummy) { + e = (*v)(p->dummy, a); if (e) return e; + } + if (p->idx_slider) { + e = (*v)(((PyObject*)p->idx_slider), a); if (e) return e; + } + if (p->blocks) { + e = (*v)(p->blocks, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_BlockSlider(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_BlockSlider *p = (struct __pyx_obj_6pandas_3lib_BlockSlider *)o; + tmp = ((PyObject*)p->frame); + p->frame = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy); + p->dummy = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->idx_slider); + p->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->blocks); + p->blocks = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_frame(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_5frame_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_frame(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_5frame_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_11BlockSlider_5frame_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_dummy(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_dummy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_nblocks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_nblocks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_idx_slider(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_idx_slider(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_blocks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_blocks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_3lib_BlockSlider[] = { + {__Pyx_NAMESTR("move"), (PyCFunction)__pyx_pw_6pandas_3lib_11BlockSlider_5move, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_3lib_BlockSlider[] = { + {(char *)"frame", __pyx_getprop_6pandas_3lib_11BlockSlider_frame, __pyx_setprop_6pandas_3lib_11BlockSlider_frame, 0, 0}, + {(char *)"dummy", __pyx_getprop_6pandas_3lib_11BlockSlider_dummy, __pyx_setprop_6pandas_3lib_11BlockSlider_dummy, 0, 0}, + {(char *)"nblocks", __pyx_getprop_6pandas_3lib_11BlockSlider_nblocks, __pyx_setprop_6pandas_3lib_11BlockSlider_nblocks, 0, 0}, + {(char *)"idx_slider", __pyx_getprop_6pandas_3lib_11BlockSlider_idx_slider, __pyx_setprop_6pandas_3lib_11BlockSlider_idx_slider, 0, 0}, + {(char *)"blocks", __pyx_getprop_6pandas_3lib_11BlockSlider_blocks, __pyx_setprop_6pandas_3lib_11BlockSlider_blocks, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_BlockSlider = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.BlockSlider"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_BlockSlider), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_BlockSlider, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Only capable of sliding on axis=0\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_BlockSlider, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_BlockSlider, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_BlockSlider, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_3lib_BlockSlider, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_11BlockSlider_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_BlockSlider, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_cache_readonly(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_cache_readonly *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)o); + p->func = Py_None; Py_INCREF(Py_None); + p->name = Py_None; Py_INCREF(Py_None); + p->allow_setting = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_cache_readonly(PyObject *o) { + struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->func); + Py_CLEAR(p->name); + Py_CLEAR(p->allow_setting); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_cache_readonly(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o; + if (p->func) { + e = (*v)(p->func, a); if (e) return e; + } + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + if (p->allow_setting) { + e = (*v)(p->allow_setting, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_cache_readonly(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o; + tmp = ((PyObject*)p->func); + p->func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->allow_setting); + p->allow_setting = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_tp_descr_get_6pandas_3lib_cache_readonly(PyObject *o, PyObject *i, PyObject *c) { + PyObject *r = 0; + if (!i) i = Py_None; + if (!c) c = Py_None; + r = __pyx_pw_6pandas_3lib_14cache_readonly_5__get__(o, i, c); + return r; +} + +static int __pyx_tp_descr_set_6pandas_3lib_cache_readonly(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_pw_6pandas_3lib_14cache_readonly_7__set__(o, i, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__delete__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_14cache_readonly_func(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_14cache_readonly_4func_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_3lib_14cache_readonly_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_14cache_readonly_4name_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_3lib_14cache_readonly_allow_setting(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_14cache_readonly_13allow_setting_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_3lib_cache_readonly[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_3lib_cache_readonly[] = { + {(char *)"func", __pyx_getprop_6pandas_3lib_14cache_readonly_func, 0, 0, 0}, + {(char *)"name", __pyx_getprop_6pandas_3lib_14cache_readonly_name, 0, 0, 0}, + {(char *)"allow_setting", __pyx_getprop_6pandas_3lib_14cache_readonly_allow_setting, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_cache_readonly = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.cache_readonly"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_cache_readonly), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_cache_readonly, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6pandas_3lib_14cache_readonly_3__call__, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_cache_readonly, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_cache_readonly, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_cache_readonly, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_3lib_cache_readonly, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __pyx_tp_descr_get_6pandas_3lib_cache_readonly, /*tp_descr_get*/ + __pyx_tp_descr_set_6pandas_3lib_cache_readonly, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_14cache_readonly_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_cache_readonly, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_AxisProperty(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_AxisProperty(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_tp_descr_get_6pandas_3lib_AxisProperty(PyObject *o, PyObject *i, PyObject *c) { + PyObject *r = 0; + if (!i) i = Py_None; + if (!c) c = Py_None; + r = __pyx_pw_6pandas_3lib_12AxisProperty_3__get__(o, i, c); + return r; +} + +static int __pyx_tp_descr_set_6pandas_3lib_AxisProperty(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_pw_6pandas_3lib_12AxisProperty_5__set__(o, i, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__delete__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6pandas_3lib_AxisProperty[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_AxisProperty = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.AxisProperty"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_AxisProperty), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_AxisProperty, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_AxisProperty, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __pyx_tp_descr_get_6pandas_3lib_AxisProperty, /*tp_descr_get*/ + __pyx_tp_descr_set_6pandas_3lib_AxisProperty, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_12AxisProperty_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_AxisProperty, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *__pyx_freelist_6pandas_3lib___pyx_scope_struct__get_blkno_indexers[8]; +static int __pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers = 0; + +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *p; + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers)))) { + o = (PyObject*)__pyx_freelist_6pandas_3lib___pyx_scope_struct__get_blkno_indexers[--__pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + p = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o); + p->__pyx_v_blknos.data = NULL; + p->__pyx_v_blknos.memview = NULL; + p->__pyx_v_res_view.data = NULL; + p->__pyx_v_res_view.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyObject *o) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_blkno); + Py_CLEAR(p->__pyx_v_genexpr); + Py_CLEAR(p->__pyx_v_group_dict); + Py_CLEAR(p->__pyx_v_group_order); + Py_CLEAR(p->__pyx_v_group_slices); + Py_CLEAR(p->__pyx_v_result); + Py_CLEAR(p->__pyx_v_slices); + Py_CLEAR(p->__pyx_v_tot_len); + Py_CLEAR(p->__pyx_t_4); + __PYX_XDEC_MEMVIEW(&p->__pyx_v_blknos, 1); + __PYX_XDEC_MEMVIEW(&p->__pyx_v_res_view, 1); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers)))) { + __pyx_freelist_6pandas_3lib___pyx_scope_struct__get_blkno_indexers[__pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers++] = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o; + if (p->__pyx_v_blkno) { + e = (*v)(p->__pyx_v_blkno, a); if (e) return e; + } + if (p->__pyx_v_genexpr) { + e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; + } + if (p->__pyx_v_group_dict) { + e = (*v)(p->__pyx_v_group_dict, a); if (e) return e; + } + if (p->__pyx_v_group_order) { + e = (*v)(p->__pyx_v_group_order, a); if (e) return e; + } + if (p->__pyx_v_group_slices) { + e = (*v)(p->__pyx_v_group_slices, a); if (e) return e; + } + if (p->__pyx_v_result) { + e = (*v)(p->__pyx_v_result, a); if (e) return e; + } + if (p->__pyx_v_slices) { + e = (*v)(p->__pyx_v_slices, a); if (e) return e; + } + if (p->__pyx_v_tot_len) { + e = (*v)(p->__pyx_v_tot_len, a); if (e) return e; + } + if (p->__pyx_t_4) { + e = (*v)(p->__pyx_t_4, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o; + tmp = ((PyObject*)p->__pyx_v_blkno); + p->__pyx_v_blkno = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_genexpr); + p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_group_dict); + p->__pyx_v_group_dict = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_group_order); + p->__pyx_v_group_order = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_group_slices); + p->__pyx_v_group_slices = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_result); + p->__pyx_v_result = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_slices); + p->__pyx_v_slices = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_tot_len); + p->__pyx_v_tot_len = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_4); + p->__pyx_t_4 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct__get_blkno_indexers = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct__get_blkno_indexers"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *__pyx_freelist_6pandas_3lib___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_6pandas_3lib___pyx_scope_struct_1_genexpr[--__pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_start); + Py_CLEAR(p->__pyx_v_stop); + Py_CLEAR(p->__pyx_t_0); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_6pandas_3lib___pyx_scope_struct_1_genexpr[__pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_start) { + e = (*v)(p->__pyx_v_start, a); if (e) return e; + } + if (p->__pyx_v_stop) { + e = (*v)(p->__pyx_v_stop, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_1_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_start); + p->__pyx_v_start = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_stop); + p->__pyx_v_stop = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct_1_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_1_genexpr, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *__pyx_freelist_6pandas_3lib___pyx_scope_struct_2_try_parse_dates[8]; +static int __pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates = 0; + +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates)))) { + o = (PyObject*)__pyx_freelist_6pandas_3lib___pyx_scope_struct_2_try_parse_dates[--__pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyObject *o) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_dayfirst); + Py_CLEAR(p->__pyx_v_default); + Py_CLEAR(p->__pyx_v_parse); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates)))) { + __pyx_freelist_6pandas_3lib___pyx_scope_struct_2_try_parse_dates[__pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates++] = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)o; + if (p->__pyx_v_dayfirst) { + e = (*v)(p->__pyx_v_dayfirst, a); if (e) return e; + } + if (p->__pyx_v_default) { + e = (*v)(p->__pyx_v_default, a); if (e) return e; + } + if (p->__pyx_v_parse) { + e = (*v)(p->__pyx_v_parse, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)o; + tmp = ((PyObject*)p->__pyx_v_dayfirst); + p->__pyx_v_dayfirst = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_default); + p->__pyx_v_default = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_parse); + p->__pyx_v_parse = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct_2_try_parse_dates = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct_2_try_parse_dates"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_freelist_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time[8]; +static int __pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time = 0; + +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time)))) { + o = (PyObject*)__pyx_freelist_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time[--__pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyObject *o) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_date); + Py_CLEAR(p->__pyx_v_dayfirst); + Py_CLEAR(p->__pyx_v_default); + Py_CLEAR(p->__pyx_v_parse); + Py_CLEAR(p->__pyx_v_time); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time)))) { + __pyx_freelist_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time[__pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time++] = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)o; + if (p->__pyx_v_date) { + e = (*v)(p->__pyx_v_date, a); if (e) return e; + } + if (p->__pyx_v_dayfirst) { + e = (*v)(p->__pyx_v_dayfirst, a); if (e) return e; + } + if (p->__pyx_v_default) { + e = (*v)(p->__pyx_v_default, a); if (e) return e; + } + if (p->__pyx_v_parse) { + e = (*v)(p->__pyx_v_parse, a); if (e) return e; + } + if (p->__pyx_v_time) { + e = (*v)(p->__pyx_v_time, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)o; + tmp = ((PyObject*)p->__pyx_v_date); + p->__pyx_v_date = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_dayfirst); + p->__pyx_v_dayfirst = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_default); + p->__pyx_v_default = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_parse); + p->__pyx_v_parse = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_time); + p->__pyx_v_time = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct_3_try_parse_date_and_time"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_array___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return get_memview(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_array_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.array"), /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.Enum"), /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryview___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_transpose(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview__get__base(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_shape(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_strides(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_suboffsets(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_ndim(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_itemsize(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_nbytes(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_size(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.memoryview"), /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryviewslice___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryviewslice__get__base(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib._memoryviewslice"), /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Internal class for passing memoryview slices to Python"), /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("map_indices_list"), (PyCFunction)__pyx_pw_6pandas_3lib_3map_indices_list, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_2map_indices_list)}, + {__Pyx_NAMESTR("to_datetime"), (PyCFunction)__pyx_pw_6pandas_3lib_9to_datetime, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_timestamp"), (PyCFunction)__pyx_pw_6pandas_3lib_11to_timestamp, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("checknull"), (PyCFunction)__pyx_pw_6pandas_3lib_17checknull, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("checknull_old"), (PyCFunction)__pyx_pw_6pandas_3lib_19checknull_old, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("astype_str"), (PyCFunction)__pyx_pw_6pandas_3lib_69astype_str, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("indexer_as_slice"), (PyCFunction)__pyx_pw_6pandas_3lib_108indexer_as_slice, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("slice_canonize"), (PyCFunction)__pyx_pw_6pandas_3lib_110slice_canonize, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_109slice_canonize)}, + {__Pyx_NAMESTR("slice_get_indices_ex"), (PyCFunction)__pyx_pw_6pandas_3lib_112slice_get_indices_ex, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_111slice_get_indices_ex)}, + {__Pyx_NAMESTR("slice_len"), (PyCFunction)__pyx_pw_6pandas_3lib_114slice_len, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_113slice_len)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("lib"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_1_6_2, __pyx_k_1_6_2, sizeof(__pyx_k_1_6_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Arrays_were_different_lengths_d, __pyx_k_Arrays_were_different_lengths_d, sizeof(__pyx_k_Arrays_were_different_lengths_d), 0, 0, 1, 0}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_modify_frame_index_intern, __pyx_k_Cannot_modify_frame_index_intern, sizeof(__pyx_k_Cannot_modify_frame_index_intern), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_use_shortcut, __pyx_k_Cannot_use_shortcut, sizeof(__pyx_k_Cannot_use_shortcut), 0, 0, 1, 0}, + {&__pyx_kp_s_Dummy_array_must_be_length_d, __pyx_k_Dummy_array_must_be_length_d, sizeof(__pyx_k_Dummy_array_must_be_length_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Dummy_array_must_be_same_dtype, __pyx_k_Dummy_array_must_be_same_dtype, sizeof(__pyx_k_Dummy_array_must_be_same_dtype), 0, 0, 1, 0}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_kp_s_Empty_string_encountered, __pyx_k_Empty_string_encountered, sizeof(__pyx_k_Empty_string_encountered), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1}, + {&__pyx_n_s_FALSE, __pyx_k_FALSE, sizeof(__pyx_k_FALSE), 0, 0, 1, 1}, + {&__pyx_n_s_False, __pyx_k_False, sizeof(__pyx_k_False), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Function_unsafe_for_fast_apply, __pyx_k_Function_unsafe_for_fast_apply, sizeof(__pyx_k_Function_unsafe_for_fast_apply), 0, 0, 1, 0}, + {&__pyx_kp_s_H_M_S, __pyx_k_H_M_S, sizeof(__pyx_k_H_M_S), 0, 0, 1, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_n_s_Int64Index, __pyx_k_Int64Index, sizeof(__pyx_k_Int64Index), 0, 0, 1, 1}, + {&__pyx_n_s_InvalidApply, __pyx_k_InvalidApply, sizeof(__pyx_k_InvalidApply), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_length_for_values_or_for, __pyx_k_Invalid_length_for_values_or_for, sizeof(__pyx_k_Invalid_length_for_values_or_for), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Length_of_all_datetime_component, __pyx_k_Length_of_all_datetime_component, sizeof(__pyx_k_Length_of_all_datetime_component), 0, 0, 1, 0}, + {&__pyx_kp_s_Length_of_dates_and_times_must_b, __pyx_k_Length_of_dates_and_times_must_b, sizeof(__pyx_k_Length_of_dates_and_times_must_b), 0, 0, 1, 0}, + {&__pyx_kp_s_Length_of_years_months_days_must, __pyx_k_Length_of_years_months_days_must, sizeof(__pyx_k_Length_of_years_months_days_must), 0, 0, 1, 0}, + {&__pyx_kp_s_Let_this_error_raise_above_us, __pyx_k_Let_this_error_raise_above_us, sizeof(__pyx_k_Let_this_error_raise_above_us), 0, 0, 1, 0}, + {&__pyx_n_s_LooseVersion, __pyx_k_LooseVersion, sizeof(__pyx_k_LooseVersion), 0, 0, 1, 1}, + {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1}, + {&__pyx_kp_s_M8_ns, __pyx_k_M8_ns, sizeof(__pyx_k_M8_ns), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1}, + {&__pyx_n_s_NaT, __pyx_k_NaT, sizeof(__pyx_k_NaT), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_kp_s_Not_slice_like, __pyx_k_Not_slice_like, sizeof(__pyx_k_Not_slice_like), 0, 0, 1, 0}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, + {&__pyx_n_s_Period, __pyx_k_Period, sizeof(__pyx_k_Period), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_n_s_TRUE, __pyx_k_TRUE, sizeof(__pyx_k_TRUE), 0, 0, 1, 1}, + {&__pyx_n_s_TYPE_MAP, __pyx_k_TYPE_MAP, sizeof(__pyx_k_TYPE_MAP), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_True, __pyx_k_True, sizeof(__pyx_k_True), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_operator, __pyx_k_Unrecognized_operator, sizeof(__pyx_k_Unrecognized_operator), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_Values_falls_after_last_bin, __pyx_k_Values_falls_after_last_bin, sizeof(__pyx_k_Values_falls_after_last_bin), 0, 0, 1, 0}, + {&__pyx_kp_s_Values_falls_before_first_bin, __pyx_k_Values_falls_before_first_bin, sizeof(__pyx_k_Values_falls_before_first_bin), 0, 0, 1, 0}, + {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1}, + {&__pyx_kp_s__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 0, 1, 0}, + {&__pyx_kp_s__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 0, 1, 0}, + {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, + {&__pyx_n_s_advance, __pyx_k_advance, sizeof(__pyx_k_advance), 0, 0, 1, 1}, + {&__pyx_n_s_all_arrays, __pyx_k_all_arrays, sizeof(__pyx_k_all_arrays), 0, 0, 1, 1}, + {&__pyx_kp_s_all_arrays_must_be_same_length, __pyx_k_all_arrays_must_be_same_length, sizeof(__pyx_k_all_arrays_must_be_same_length), 0, 0, 1, 0}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_allow_setting, __pyx_k_allow_setting, sizeof(__pyx_k_allow_setting), 0, 0, 1, 1}, + {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_apply_frame_axis0, __pyx_k_apply_frame_axis0, sizeof(__pyx_k_apply_frame_axis0), 0, 0, 1, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_arobj, __pyx_k_arobj, sizeof(__pyx_k_arobj), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_array_to_timestamp, __pyx_k_array_to_timestamp, sizeof(__pyx_k_array_to_timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_arrays, __pyx_k_arrays, sizeof(__pyx_k_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap, __pyx_k_arrmap, sizeof(__pyx_k_arrmap), 0, 0, 1, 1}, + {&__pyx_n_s_as_array, __pyx_k_as_array, sizeof(__pyx_k_as_array), 0, 0, 1, 1}, + {&__pyx_n_s_as_slice, __pyx_k_as_slice, sizeof(__pyx_k_as_slice), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_astype_intsafe, __pyx_k_astype_intsafe, sizeof(__pyx_k_astype_intsafe), 0, 0, 1, 1}, + {&__pyx_n_s_axes, __pyx_k_axes, sizeof(__pyx_k_axes), 0, 0, 1, 1}, + {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_bc, __pyx_k_bc, sizeof(__pyx_k_bc), 0, 0, 1, 1}, + {&__pyx_n_s_binner, __pyx_k_binner, sizeof(__pyx_k_binner), 0, 0, 1, 1}, + {&__pyx_n_s_bins, __pyx_k_bins, sizeof(__pyx_k_bins), 0, 0, 1, 1}, + {&__pyx_n_s_blkno, __pyx_k_blkno, sizeof(__pyx_k_blkno), 0, 0, 1, 1}, + {&__pyx_n_s_blknos, __pyx_k_blknos, sizeof(__pyx_k_blknos), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_blocks, __pyx_k_blocks, sizeof(__pyx_k_blocks), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_bool_2, __pyx_k_bool_2, sizeof(__pyx_k_bool_2), 0, 0, 1, 1}, + {&__pyx_n_s_boolean, __pyx_k_boolean, sizeof(__pyx_k_boolean), 0, 0, 1, 1}, + {&__pyx_n_s_bools, __pyx_k_bools, sizeof(__pyx_k_bools), 0, 0, 1, 1}, + {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_c16, __pyx_k_c16, sizeof(__pyx_k_c16), 0, 0, 1, 1}, + {&__pyx_n_s_c_contiguous, __pyx_k_c_contiguous, sizeof(__pyx_k_c_contiguous), 0, 0, 1, 1}, + {&__pyx_n_s_cache, __pyx_k_cache, sizeof(__pyx_k_cache), 0, 0, 1, 1}, + {&__pyx_n_s_cache_2, __pyx_k_cache_2, sizeof(__pyx_k_cache_2), 0, 0, 1, 1}, + {&__pyx_kp_s_cannot_set_values_for_s, __pyx_k_cannot_set_values_for_s, sizeof(__pyx_k_cannot_set_values_for_s), 0, 0, 1, 0}, + {&__pyx_n_s_check_dummy, __pyx_k_check_dummy, sizeof(__pyx_k_check_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_clean_index_list, __pyx_k_clean_index_list, sizeof(__pyx_k_clean_index_list), 0, 0, 1, 1}, + {&__pyx_n_s_clear_mapping, __pyx_k_clear_mapping, sizeof(__pyx_k_clear_mapping), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, + {&__pyx_n_s_coerce_numeric, __pyx_k_coerce_numeric, sizeof(__pyx_k_coerce_numeric), 0, 0, 1, 1}, + {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1}, + {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1}, + {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1}, + {&__pyx_n_s_complex, __pyx_k_complex, sizeof(__pyx_k_complex), 0, 0, 1, 1}, + {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1}, + {&__pyx_n_s_complex256, __pyx_k_complex256, sizeof(__pyx_k_complex256), 0, 0, 1, 1}, + {&__pyx_n_s_complexes, __pyx_k_complexes, sizeof(__pyx_k_complexes), 0, 0, 1, 1}, + {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, + {&__pyx_n_s_contiguous, __pyx_k_contiguous, sizeof(__pyx_k_contiguous), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, + {&__pyx_n_s_convert_datetime, __pyx_k_convert_datetime, sizeof(__pyx_k_convert_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_convert_empty, __pyx_k_convert_empty, sizeof(__pyx_k_convert_empty), 0, 0, 1, 1}, + {&__pyx_n_s_convert_sql_column, __pyx_k_convert_sql_column, sizeof(__pyx_k_convert_sql_column), 0, 0, 1, 1}, + {&__pyx_n_s_convert_timedelta, __pyx_k_convert_timedelta, sizeof(__pyx_k_convert_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_convert_timestamps, __pyx_k_convert_timestamps, sizeof(__pyx_k_convert_timestamps), 0, 0, 1, 1}, + {&__pyx_n_s_converted, __pyx_k_converted, sizeof(__pyx_k_converted), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_count_level_1d, __pyx_k_count_level_1d, sizeof(__pyx_k_count_level_1d), 0, 0, 1, 1}, + {&__pyx_n_s_count_level_2d, __pyx_k_count_level_2d, sizeof(__pyx_k_count_level_2d), 0, 0, 1, 1}, + {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1}, + {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1}, + {&__pyx_n_s_cur_blkno, __pyx_k_cur_blkno, sizeof(__pyx_k_cur_blkno), 0, 0, 1, 1}, + {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_data_2, __pyx_k_data_2, sizeof(__pyx_k_data_2), 0, 0, 1, 1}, + {&__pyx_n_s_data_index, __pyx_k_data_index, sizeof(__pyx_k_data_index), 0, 0, 1, 1}, + {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, + {&__pyx_n_s_date_parser, __pyx_k_date_parser, sizeof(__pyx_k_date_parser), 0, 0, 1, 1}, + {&__pyx_n_s_dates, __pyx_k_dates, sizeof(__pyx_k_dates), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_datetime64, __pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 0, 1, 1}, + {&__pyx_kp_s_datetime64_ns, __pyx_k_datetime64_ns, sizeof(__pyx_k_datetime64_ns), 0, 0, 1, 0}, + {&__pyx_n_s_datetimes, __pyx_k_datetimes, sizeof(__pyx_k_datetimes), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_parser, __pyx_k_dateutil_parser, sizeof(__pyx_k_dateutil_parser), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_dayfirst, __pyx_k_dayfirst, sizeof(__pyx_k_dayfirst), 0, 0, 1, 1}, + {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1}, + {&__pyx_n_s_dicts, __pyx_k_dicts, sizeof(__pyx_k_dicts), 0, 0, 1, 1}, + {&__pyx_n_s_dicts_to_array, __pyx_k_dicts_to_array, sizeof(__pyx_k_dicts_to_array), 0, 0, 1, 1}, + {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, + {&__pyx_n_s_distutils_version, __pyx_k_distutils_version, sizeof(__pyx_k_distutils_version), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_doc_2, __pyx_k_doc_2, sizeof(__pyx_k_doc_2), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_dummy, __pyx_k_dummy, sizeof(__pyx_k_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_duplicated, __pyx_k_duplicated, sizeof(__pyx_k_duplicated), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_ends, __pyx_k_ends, sizeof(__pyx_k_ends), 0, 0, 1, 1}, + {&__pyx_n_s_engine, __pyx_k_engine, sizeof(__pyx_k_engine), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 1}, + {&__pyx_n_s_f_contiguous, __pyx_k_f_contiguous, sizeof(__pyx_k_f_contiguous), 0, 0, 1, 1}, + {&__pyx_n_s_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 1, 1}, + {&__pyx_n_s_false_vals, __pyx_k_false_vals, sizeof(__pyx_k_false_vals), 0, 0, 1, 1}, + {&__pyx_n_s_false_values, __pyx_k_false_values, sizeof(__pyx_k_false_values), 0, 0, 1, 1}, + {&__pyx_n_s_fast_multiget, __pyx_k_fast_multiget, sizeof(__pyx_k_fast_multiget), 0, 0, 1, 1}, + {&__pyx_n_s_fast_unique, __pyx_k_fast_unique, sizeof(__pyx_k_fast_unique), 0, 0, 1, 1}, + {&__pyx_n_s_fast_unique_multiple, __pyx_k_fast_unique_multiple, sizeof(__pyx_k_fast_unique_multiple), 0, 0, 1, 1}, + {&__pyx_n_s_fast_unique_multiple_list, __pyx_k_fast_unique_multiple_list, sizeof(__pyx_k_fast_unique_multiple_list), 0, 0, 1, 1}, + {&__pyx_n_s_fast_unique_multiple_list_gen, __pyx_k_fast_unique_multiple_list_gen, sizeof(__pyx_k_fast_unique_multiple_list_gen), 0, 0, 1, 1}, + {&__pyx_n_s_fast_zip, __pyx_k_fast_zip, sizeof(__pyx_k_fast_zip), 0, 0, 1, 1}, + {&__pyx_n_s_fast_zip_fillna, __pyx_k_fast_zip_fillna, sizeof(__pyx_k_fast_zip_fillna), 0, 0, 1, 1}, + {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, + {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1}, + {&__pyx_n_s_finished, __pyx_k_finished, sizeof(__pyx_k_finished), 0, 0, 1, 1}, + {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 1, 1}, + {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_float_secs, __pyx_k_float_secs, sizeof(__pyx_k_float_secs), 0, 0, 1, 1}, + {&__pyx_n_s_floating, __pyx_k_floating, sizeof(__pyx_k_floating), 0, 0, 1, 1}, + {&__pyx_n_s_floats, __pyx_k_floats, sizeof(__pyx_k_floats), 0, 0, 1, 1}, + {&__pyx_n_s_fnan, __pyx_k_fnan, sizeof(__pyx_k_fnan), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1}, + {&__pyx_n_s_fromtimestamp, __pyx_k_fromtimestamp, sizeof(__pyx_k_fromtimestamp), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_kp_s_function_does_not_reduce, __pyx_k_function_does_not_reduce, sizeof(__pyx_k_function_does_not_reduce), 0, 0, 1, 0}, + {&__pyx_n_s_fval, __pyx_k_fval, sizeof(__pyx_k_fval), 0, 0, 1, 1}, + {&__pyx_n_s_ge, __pyx_k_ge, sizeof(__pyx_k_ge), 0, 0, 1, 1}, + {&__pyx_n_s_gen, __pyx_k_gen, sizeof(__pyx_k_gen), 0, 0, 1, 1}, + {&__pyx_n_s_generate_bins_dt64, __pyx_k_generate_bins_dt64, sizeof(__pyx_k_generate_bins_dt64), 0, 0, 1, 1}, + {&__pyx_n_s_generate_slices, __pyx_k_generate_slices, sizeof(__pyx_k_generate_slices), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get_blkno_indexers, __pyx_k_get_blkno_indexers, sizeof(__pyx_k_get_blkno_indexers), 0, 0, 1, 1}, + {&__pyx_n_s_get_result, __pyx_k_get_result, sizeof(__pyx_k_get_result), 0, 0, 1, 1}, + {&__pyx_n_s_get_result_array, __pyx_k_get_result_array, sizeof(__pyx_k_get_result_array), 0, 0, 1, 1}, + {&__pyx_n_s_get_reverse_indexer, __pyx_k_get_reverse_indexer, sizeof(__pyx_k_get_reverse_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_get_values, __pyx_k_get_values, sizeof(__pyx_k_get_values), 0, 0, 1, 1}, + {&__pyx_n_s_gin, __pyx_k_gin, sizeof(__pyx_k_gin), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, + {&__pyx_n_s_group_count, __pyx_k_group_count, sizeof(__pyx_k_group_count), 0, 0, 1, 1}, + {&__pyx_n_s_group_dict, __pyx_k_group_dict, sizeof(__pyx_k_group_dict), 0, 0, 1, 1}, + {&__pyx_n_s_group_order, __pyx_k_group_order, sizeof(__pyx_k_group_order), 0, 0, 1, 1}, + {&__pyx_n_s_group_size, __pyx_k_group_size, sizeof(__pyx_k_group_size), 0, 0, 1, 1}, + {&__pyx_n_s_group_slices, __pyx_k_group_slices, sizeof(__pyx_k_group_slices), 0, 0, 1, 1}, + {&__pyx_n_s_gt, __pyx_k_gt, sizeof(__pyx_k_gt), 0, 0, 1, 1}, + {&__pyx_n_s_has_complex_internals, __pyx_k_has_complex_internals, sizeof(__pyx_k_has_complex_internals), 0, 0, 1, 1}, + {&__pyx_n_s_has_infs_f4, __pyx_k_has_infs_f4, sizeof(__pyx_k_has_infs_f4), 0, 0, 1, 1}, + {&__pyx_n_s_has_infs_f8, __pyx_k_has_infs_f8, sizeof(__pyx_k_has_infs_f8), 0, 0, 1, 1}, + {&__pyx_n_s_hasnans, __pyx_k_hasnans, sizeof(__pyx_k_hasnans), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_n_s_iNaT, __pyx_k_iNaT, sizeof(__pyx_k_iNaT), 0, 0, 1, 1}, + {&__pyx_kp_s_iadd_causes_length_change, __pyx_k_iadd_causes_length_change, sizeof(__pyx_k_iadd_causes_length_change), 0, 0, 1, 0}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_idatetimes, __pyx_k_idatetimes, sizeof(__pyx_k_idatetimes), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1}, + {&__pyx_n_s_ind_len, __pyx_k_ind_len, sizeof(__pyx_k_ind_len), 0, 0, 1, 1}, + {&__pyx_n_s_ind_start, __pyx_k_ind_start, sizeof(__pyx_k_ind_start), 0, 0, 1, 1}, + {&__pyx_n_s_ind_step, __pyx_k_ind_step, sizeof(__pyx_k_ind_step), 0, 0, 1, 1}, + {&__pyx_n_s_ind_stop, __pyx_k_ind_stop, sizeof(__pyx_k_ind_stop), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_index_2, __pyx_k_index_2, sizeof(__pyx_k_index_2), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_indexer, __pyx_k_indexer, sizeof(__pyx_k_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, + {&__pyx_n_s_indices_fast, __pyx_k_indices_fast, sizeof(__pyx_k_indices_fast), 0, 0, 1, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_infer_dtype, __pyx_k_infer_dtype, sizeof(__pyx_k_infer_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_infer_dtype_list, __pyx_k_infer_dtype_list, sizeof(__pyx_k_infer_dtype_list), 0, 0, 1, 1}, + {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, + {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, + {&__pyx_n_s_ints, __pyx_k_ints, sizeof(__pyx_k_ints), 0, 0, 1, 1}, + {&__pyx_n_s_is_bool, __pyx_k_is_bool, sizeof(__pyx_k_is_bool), 0, 0, 1, 1}, + {&__pyx_n_s_is_bool_array, __pyx_k_is_bool_array, sizeof(__pyx_k_is_bool_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_complex, __pyx_k_is_complex, sizeof(__pyx_k_is_complex), 0, 0, 1, 1}, + {&__pyx_n_s_is_date_array, __pyx_k_is_date_array, sizeof(__pyx_k_is_date_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_datelike, __pyx_k_is_datelike, sizeof(__pyx_k_is_datelike), 0, 0, 1, 1}, + {&__pyx_n_s_is_datetime64_array, __pyx_k_is_datetime64_array, sizeof(__pyx_k_is_datetime64_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_datetime_array, __pyx_k_is_datetime_array, sizeof(__pyx_k_is_datetime_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_float, __pyx_k_is_float, sizeof(__pyx_k_is_float), 0, 0, 1, 1}, + {&__pyx_n_s_is_float_array, __pyx_k_is_float_array, sizeof(__pyx_k_is_float_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_integer, __pyx_k_is_integer, sizeof(__pyx_k_is_integer), 0, 0, 1, 1}, + {&__pyx_n_s_is_integer_array, __pyx_k_is_integer_array, sizeof(__pyx_k_is_integer_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_integer_float_array, __pyx_k_is_integer_float_array, sizeof(__pyx_k_is_integer_float_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_lexsorted, __pyx_k_is_lexsorted, sizeof(__pyx_k_is_lexsorted), 0, 0, 1, 1}, + {&__pyx_n_s_is_numpy_prior_1_6_2, __pyx_k_is_numpy_prior_1_6_2, sizeof(__pyx_k_is_numpy_prior_1_6_2), 0, 0, 1, 1}, + {&__pyx_n_s_is_period, __pyx_k_is_period, sizeof(__pyx_k_is_period), 0, 0, 1, 1}, + {&__pyx_n_s_is_period_array, __pyx_k_is_period_array, sizeof(__pyx_k_is_period_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_possible_datetimelike_array, __pyx_k_is_possible_datetimelike_array, sizeof(__pyx_k_is_possible_datetimelike_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_slice_like, __pyx_k_is_slice_like, sizeof(__pyx_k_is_slice_like), 0, 0, 1, 1}, + {&__pyx_n_s_is_string_array, __pyx_k_is_string_array, sizeof(__pyx_k_is_string_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_time_array, __pyx_k_is_time_array, sizeof(__pyx_k_is_time_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_timedelta64_array, __pyx_k_is_timedelta64_array, sizeof(__pyx_k_is_timedelta64_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_timedelta_array, __pyx_k_is_timedelta_array, sizeof(__pyx_k_is_timedelta_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_timedelta_or_timedelta64_arra, __pyx_k_is_timedelta_or_timedelta64_arra, sizeof(__pyx_k_is_timedelta_or_timedelta64_arra), 0, 0, 1, 1}, + {&__pyx_n_s_is_unicode_array, __pyx_k_is_unicode_array, sizeof(__pyx_k_is_unicode_array), 0, 0, 1, 1}, + {&__pyx_n_s_isin, __pyx_k_isin, sizeof(__pyx_k_isin), 0, 0, 1, 1}, + {&__pyx_n_s_ismember, __pyx_k_ismember, sizeof(__pyx_k_ismember), 0, 0, 1, 1}, + {&__pyx_n_s_ismember_nans, __pyx_k_ismember_nans, sizeof(__pyx_k_ismember_nans), 0, 0, 1, 1}, + {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj, __pyx_k_isnullobj, sizeof(__pyx_k_isnullobj), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj2d, __pyx_k_isnullobj2d, sizeof(__pyx_k_isnullobj2d), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj2d_old, __pyx_k_isnullobj2d_old, sizeof(__pyx_k_isnullobj2d_old), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj_old, __pyx_k_isnullobj_old, sizeof(__pyx_k_isnullobj_old), 0, 0, 1, 1}, + {&__pyx_n_s_isscalar, __pyx_k_isscalar, sizeof(__pyx_k_isscalar), 0, 0, 1, 1}, + {&__pyx_n_s_it, __pyx_k_it, sizeof(__pyx_k_it), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_item_cache, __pyx_k_item_cache, sizeof(__pyx_k_item_cache), 0, 0, 1, 1}, + {&__pyx_n_s_item_cache_2, __pyx_k_item_cache_2, sizeof(__pyx_k_item_cache_2), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_itimedeltas, __pyx_k_itimedeltas, sizeof(__pyx_k_itimedeltas), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, + {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, + {&__pyx_n_s_l_bin, __pyx_k_l_bin, sizeof(__pyx_k_l_bin), 0, 0, 1, 1}, + {&__pyx_n_s_lab, __pyx_k_lab, sizeof(__pyx_k_lab), 0, 0, 1, 1}, + {&__pyx_n_s_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1}, + {&__pyx_n_s_le, __pyx_k_le, sizeof(__pyx_k_le), 0, 0, 1, 1}, + {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, + {&__pyx_n_s_lenbin, __pyx_k_lenbin, sizeof(__pyx_k_lenbin), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lenidx, __pyx_k_lenidx, sizeof(__pyx_k_lenidx), 0, 0, 1, 1}, + {&__pyx_n_s_list_of_arrays, __pyx_k_list_of_arrays, sizeof(__pyx_k_list_of_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_list_to_object_array, __pyx_k_list_to_object_array, sizeof(__pyx_k_list_to_object_array), 0, 0, 1, 1}, + {&__pyx_n_s_lists, __pyx_k_lists, sizeof(__pyx_k_lists), 0, 0, 1, 1}, + {&__pyx_n_s_lookup_values, __pyx_k_lookup_values, sizeof(__pyx_k_lookup_values), 0, 0, 1, 1}, + {&__pyx_n_s_lt, __pyx_k_lt, sizeof(__pyx_k_lt), 0, 0, 1, 1}, + {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, + {&__pyx_kp_s_m8_ns, __pyx_k_m8_ns, sizeof(__pyx_k_m8_ns), 0, 0, 1, 0}, + {&__pyx_kp_s_m_d_Y, __pyx_k_m_d_Y, sizeof(__pyx_k_m_d_Y), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_map_infer, __pyx_k_map_infer, sizeof(__pyx_k_map_infer), 0, 0, 1, 1}, + {&__pyx_n_s_map_infer_mask, __pyx_k_map_infer_mask, sizeof(__pyx_k_map_infer_mask), 0, 0, 1, 1}, + {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_max_bin, __pyx_k_max_bin, sizeof(__pyx_k_max_bin), 0, 0, 1, 1}, + {&__pyx_n_s_max_len_string_array, __pyx_k_max_len_string_array, sizeof(__pyx_k_max_len_string_array), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_booleans_to_slice, __pyx_k_maybe_booleans_to_slice, sizeof(__pyx_k_maybe_booleans_to_slice), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_bool, __pyx_k_maybe_convert_bool, sizeof(__pyx_k_maybe_convert_bool), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_numeric, __pyx_k_maybe_convert_numeric, sizeof(__pyx_k_maybe_convert_numeric), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_objects, __pyx_k_maybe_convert_objects, sizeof(__pyx_k_maybe_convert_objects), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_indices_to_slice, __pyx_k_maybe_indices_to_slice, sizeof(__pyx_k_maybe_indices_to_slice), 0, 0, 1, 1}, + {&__pyx_n_s_memo, __pyx_k_memo, sizeof(__pyx_k_memo), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_micros, __pyx_k_micros, sizeof(__pyx_k_micros), 0, 0, 1, 1}, + {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1}, + {&__pyx_n_s_mixed, __pyx_k_mixed, sizeof(__pyx_k_mixed), 0, 0, 1, 1}, + {&__pyx_kp_s_mixed_integer, __pyx_k_mixed_integer, sizeof(__pyx_k_mixed_integer), 0, 0, 1, 0}, + {&__pyx_kp_s_mixed_integer_float, __pyx_k_mixed_integer_float, sizeof(__pyx_k_mixed_integer_float), 0, 0, 1, 0}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_months, __pyx_k_months, sizeof(__pyx_k_months), 0, 0, 1, 1}, + {&__pyx_n_s_move, __pyx_k_move, sizeof(__pyx_k_move), 0, 0, 1, 1}, + {&__pyx_n_s_mutated, __pyx_k_mutated, sizeof(__pyx_k_mutated), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_na_count, __pyx_k_na_count, sizeof(__pyx_k_na_count), 0, 0, 1, 1}, + {&__pyx_n_s_na_values, __pyx_k_na_values, sizeof(__pyx_k_na_values), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_n_s_nan_rep, __pyx_k_nan_rep, sizeof(__pyx_k_nan_rep), 0, 0, 1, 1}, + {&__pyx_n_s_nat_count, __pyx_k_nat_count, sizeof(__pyx_k_nat_count), 0, 0, 1, 1}, + {&__pyx_n_s_ncols, __pyx_k_ncols, sizeof(__pyx_k_ncols), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndarrays, __pyx_k_ndarrays, sizeof(__pyx_k_ndarrays), 0, 0, 1, 1}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, + {&__pyx_n_s_neginf, __pyx_k_neginf, sizeof(__pyx_k_neginf), 0, 0, 1, 1}, + {&__pyx_n_s_new_dtype, __pyx_k_new_dtype, sizeof(__pyx_k_new_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_ngroups, __pyx_k_ngroups, sizeof(__pyx_k_ngroups), 0, 0, 1, 1}, + {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1}, + {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1}, + {&__pyx_n_s_null_count, __pyx_k_null_count, sizeof(__pyx_k_null_count), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_objbuf, __pyx_k_objbuf, sizeof(__pyx_k_objbuf), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1}, + {&__pyx_n_s_objects, __pyx_k_objects, sizeof(__pyx_k_objects), 0, 0, 1, 1}, + {&__pyx_n_s_objlen, __pyx_k_objlen, sizeof(__pyx_k_objlen), 0, 0, 1, 1}, + {&__pyx_n_s_onan, __pyx_k_onan, sizeof(__pyx_k_onan), 0, 0, 1, 1}, + {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1}, + {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, + {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_core_index, __pyx_k_pandas_core_index, sizeof(__pyx_k_pandas_core_index), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_lib, __pyx_k_pandas_lib, sizeof(__pyx_k_pandas_lib), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_null, __pyx_k_pandas_null, sizeof(__pyx_k_pandas_null), 0, 0, 1, 1}, + {&__pyx_kp_s_pandas_src_inference_pyx, __pyx_k_pandas_src_inference_pyx, sizeof(__pyx_k_pandas_src_inference_pyx), 0, 0, 1, 0}, + {&__pyx_kp_s_pandas_src_reduce_pyx, __pyx_k_pandas_src_reduce_pyx, sizeof(__pyx_k_pandas_src_reduce_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_pandas_tseries_period, __pyx_k_pandas_tseries_period, sizeof(__pyx_k_pandas_tseries_period), 0, 0, 1, 1}, + {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1}, + {&__pyx_n_s_parse_date, __pyx_k_parse_date, sizeof(__pyx_k_parse_date), 0, 0, 1, 1}, + {&__pyx_n_s_parse_time, __pyx_k_parse_time, sizeof(__pyx_k_parse_time), 0, 0, 1, 1}, + {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1}, + {&__pyx_n_s_period, __pyx_k_period, sizeof(__pyx_k_period), 0, 0, 1, 1}, + {&__pyx_n_s_piece, __pyx_k_piece, sizeof(__pyx_k_piece), 0, 0, 1, 1}, + {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, + {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_putmask, __pyx_k_putmask, sizeof(__pyx_k_putmask), 0, 0, 1, 1}, + {&__pyx_n_s_pydate, __pyx_k_pydate, sizeof(__pyx_k_pydate), 0, 0, 1, 1}, + {&__pyx_n_s_pydatetime, __pyx_k_pydatetime, sizeof(__pyx_k_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_r_bin, __pyx_k_r_bin, sizeof(__pyx_k_r_bin), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reducer, __pyx_k_reducer, sizeof(__pyx_k_reducer), 0, 0, 1, 1}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_repr_timedelta64, __pyx_k_repr_timedelta64, sizeof(__pyx_k_repr_timedelta64), 0, 0, 1, 1}, + {&__pyx_n_s_require, __pyx_k_require, sizeof(__pyx_k_require), 0, 0, 1, 1}, + {&__pyx_n_s_requirements, __pyx_k_requirements, sizeof(__pyx_k_requirements), 0, 0, 1, 1}, + {&__pyx_n_s_res_view, __pyx_k_res_view, sizeof(__pyx_k_res_view), 0, 0, 1, 1}, + {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1}, + {&__pyx_n_s_rev_indexer, __pyx_k_rev_indexer, sizeof(__pyx_k_rev_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_right_closed, __pyx_k_right_closed, sizeof(__pyx_k_right_closed), 0, 0, 1, 1}, + {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, + {&__pyx_n_s_row_bool_subset, __pyx_k_row_bool_subset, sizeof(__pyx_k_row_bool_subset), 0, 0, 1, 1}, + {&__pyx_n_s_row_bool_subset_object, __pyx_k_row_bool_subset_object, sizeof(__pyx_k_row_bool_subset_object), 0, 0, 1, 1}, + {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_n_s_s_len, __pyx_k_s_len, sizeof(__pyx_k_s_len), 0, 0, 1, 1}, + {&__pyx_kp_s_s_r, __pyx_k_s_r, sizeof(__pyx_k_s_r), 0, 0, 1, 0}, + {&__pyx_n_s_s_start, __pyx_k_s_start, sizeof(__pyx_k_s_start), 0, 0, 1, 1}, + {&__pyx_n_s_s_step, __pyx_k_s_step, sizeof(__pyx_k_s_step), 0, 0, 1, 1}, + {&__pyx_n_s_s_stop, __pyx_k_s_stop, sizeof(__pyx_k_s_stop), 0, 0, 1, 1}, + {&__pyx_n_s_safe, __pyx_k_safe, sizeof(__pyx_k_safe), 0, 0, 1, 1}, + {&__pyx_n_s_sanitize_objects, __pyx_k_sanitize_objects, sizeof(__pyx_k_sanitize_objects), 0, 0, 1, 1}, + {&__pyx_n_s_scalar_binop, __pyx_k_scalar_binop, sizeof(__pyx_k_scalar_binop), 0, 0, 1, 1}, + {&__pyx_n_s_scalar_compare, __pyx_k_scalar_compare, sizeof(__pyx_k_scalar_compare), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_secs, __pyx_k_secs, sizeof(__pyx_k_secs), 0, 0, 1, 1}, + {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1}, + {&__pyx_n_s_seen_bool, __pyx_k_seen_bool, sizeof(__pyx_k_seen_bool), 0, 0, 1, 1}, + {&__pyx_n_s_seen_complex, __pyx_k_seen_complex, sizeof(__pyx_k_seen_complex), 0, 0, 1, 1}, + {&__pyx_n_s_seen_datetime, __pyx_k_seen_datetime, sizeof(__pyx_k_seen_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_seen_float, __pyx_k_seen_float, sizeof(__pyx_k_seen_float), 0, 0, 1, 1}, + {&__pyx_n_s_seen_int, __pyx_k_seen_int, sizeof(__pyx_k_seen_int), 0, 0, 1, 1}, + {&__pyx_n_s_seen_null, __pyx_k_seen_null, sizeof(__pyx_k_seen_null), 0, 0, 1, 1}, + {&__pyx_n_s_seen_numeric, __pyx_k_seen_numeric, sizeof(__pyx_k_seen_numeric), 0, 0, 1, 1}, + {&__pyx_n_s_seen_object, __pyx_k_seen_object, sizeof(__pyx_k_seen_object), 0, 0, 1, 1}, + {&__pyx_n_s_seen_timedelta, __pyx_k_seen_timedelta, sizeof(__pyx_k_seen_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_series, __pyx_k_series, sizeof(__pyx_k_series), 0, 0, 1, 1}, + {&__pyx_n_s_set_axis, __pyx_k_set_axis, sizeof(__pyx_k_set_axis), 0, 0, 1, 1}, + {&__pyx_n_s_set_length, __pyx_k_set_length, sizeof(__pyx_k_set_length), 0, 0, 1, 1}, + {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_shape_before, __pyx_k_shape_before, sizeof(__pyx_k_shape_before), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_slc, __pyx_k_slc, sizeof(__pyx_k_slc), 0, 0, 1, 1}, + {&__pyx_kp_s_slc_must_be_slice, __pyx_k_slc_must_be_slice, sizeof(__pyx_k_slc_must_be_slice), 0, 0, 1, 0}, + {&__pyx_kp_s_slc_should_be_a_slice, __pyx_k_slc_should_be_a_slice, sizeof(__pyx_k_slc_should_be_a_slice), 0, 0, 1, 0}, + {&__pyx_n_s_slice_getitem, __pyx_k_slice_getitem, sizeof(__pyx_k_slice_getitem), 0, 0, 1, 1}, + {&__pyx_kp_s_slice_step_cannot_be_zero, __pyx_k_slice_step_cannot_be_zero, sizeof(__pyx_k_slice_step_cannot_be_zero), 0, 0, 1, 0}, + {&__pyx_n_s_slices, __pyx_k_slices, sizeof(__pyx_k_slices), 0, 0, 1, 1}, + {&__pyx_n_s_slider, __pyx_k_slider, sizeof(__pyx_k_slider), 0, 0, 1, 1}, + {&__pyx_n_s_slobj, __pyx_k_slobj, sizeof(__pyx_k_slobj), 0, 0, 1, 1}, + {&__pyx_n_s_sorted_labels, __pyx_k_sorted_labels, sizeof(__pyx_k_sorted_labels), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_started, __pyx_k_started, sizeof(__pyx_k_started), 0, 0, 1, 1}, + {&__pyx_n_s_starts, __pyx_k_starts, sizeof(__pyx_k_starts), 0, 0, 1, 1}, + {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, + {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1}, + {&__pyx_n_s_string_2, __pyx_k_string_2, sizeof(__pyx_k_string_2), 0, 0, 1, 1}, + {&__pyx_n_s_string_array_replace_from_nan_re, __pyx_k_string_array_replace_from_nan_re, sizeof(__pyx_k_string_array_replace_from_nan_re), 0, 0, 1, 1}, + {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_stub, __pyx_k_stub, sizeof(__pyx_k_stub), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, + {&__pyx_n_s_take_last, __pyx_k_take_last, sizeof(__pyx_k_take_last), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_time64_to_datetime, __pyx_k_time64_to_datetime, sizeof(__pyx_k_time64_to_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_time_parser, __pyx_k_time_parser, sizeof(__pyx_k_time_parser), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta64, __pyx_k_timedelta64, sizeof(__pyx_k_timedelta64), 0, 0, 1, 1}, + {&__pyx_kp_s_timedelta64_ns, __pyx_k_timedelta64_ns, sizeof(__pyx_k_timedelta64_ns), 0, 0, 1, 0}, + {&__pyx_n_s_timedeltas, __pyx_k_timedeltas, sizeof(__pyx_k_timedeltas), 0, 0, 1, 1}, + {&__pyx_n_s_times, __pyx_k_times, sizeof(__pyx_k_times), 0, 0, 1, 1}, + {&__pyx_n_s_tmp, __pyx_k_tmp, sizeof(__pyx_k_tmp), 0, 0, 1, 1}, + {&__pyx_n_s_to_object_array, __pyx_k_to_object_array, sizeof(__pyx_k_to_object_array), 0, 0, 1, 1}, + {&__pyx_n_s_to_object_array_tuples, __pyx_k_to_object_array_tuples, sizeof(__pyx_k_to_object_array_tuples), 0, 0, 1, 1}, + {&__pyx_n_s_toordinal, __pyx_k_toordinal, sizeof(__pyx_k_toordinal), 0, 0, 1, 1}, + {&__pyx_n_s_tot_len, __pyx_k_tot_len, sizeof(__pyx_k_tot_len), 0, 0, 1, 1}, + {&__pyx_n_s_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 1, 1}, + {&__pyx_n_s_true_vals, __pyx_k_true_vals, sizeof(__pyx_k_true_vals), 0, 0, 1, 1}, + {&__pyx_n_s_true_values, __pyx_k_true_values, sizeof(__pyx_k_true_values), 0, 0, 1, 1}, + {&__pyx_n_s_try_float, __pyx_k_try_float, sizeof(__pyx_k_try_float), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_date_and_time, __pyx_k_try_parse_date_and_time, sizeof(__pyx_k_try_parse_date_and_time), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_date_and_time_locals_l, __pyx_k_try_parse_date_and_time_locals_l, sizeof(__pyx_k_try_parse_date_and_time_locals_l), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_date_and_time_locals_p, __pyx_k_try_parse_date_and_time_locals_p, sizeof(__pyx_k_try_parse_date_and_time_locals_p), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_date_and_time_locals_p_2, __pyx_k_try_parse_date_and_time_locals_p_2, sizeof(__pyx_k_try_parse_date_and_time_locals_p_2), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_dates, __pyx_k_try_parse_dates, sizeof(__pyx_k_try_parse_dates), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_dates_locals_lambda, __pyx_k_try_parse_dates_locals_lambda, sizeof(__pyx_k_try_parse_dates_locals_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_dates_locals_parse_dat, __pyx_k_try_parse_dates_locals_parse_dat, sizeof(__pyx_k_try_parse_dates_locals_parse_dat), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_datetime_components, __pyx_k_try_parse_datetime_components, sizeof(__pyx_k_try_parse_datetime_components), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_year_month_day, __pyx_k_try_parse_year_month_day, sizeof(__pyx_k_try_parse_year_month_day), 0, 0, 1, 1}, + {&__pyx_n_s_tslib, __pyx_k_tslib, sizeof(__pyx_k_tslib), 0, 0, 1, 1}, + {&__pyx_n_s_tup, __pyx_k_tup, sizeof(__pyx_k_tup), 0, 0, 1, 1}, + {&__pyx_n_s_tuples, __pyx_k_tuples, sizeof(__pyx_k_tuples), 0, 0, 1, 1}, + {&__pyx_n_s_tuples_to_object_array, __pyx_k_tuples_to_object_array, sizeof(__pyx_k_tuples_to_object_array), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, + {&__pyx_n_s_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 0, 1, 1}, + {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1}, + {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1}, + {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_kp_s_unbounded_slice, __pyx_k_unbounded_slice, sizeof(__pyx_k_unbounded_slice), 0, 0, 1, 0}, + {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_unicode_2, __pyx_k_unicode_2, sizeof(__pyx_k_unicode_2), 0, 0, 1, 1}, + {&__pyx_n_s_uniques, __pyx_k_uniques, sizeof(__pyx_k_uniques), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_utcfromtimestamp, __pyx_k_utcfromtimestamp, sizeof(__pyx_k_utcfromtimestamp), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_val_kind, __pyx_k_val_kind, sizeof(__pyx_k_val_kind), 0, 0, 1, 1}, + {&__pyx_n_s_val_name, __pyx_k_val_name, sizeof(__pyx_k_val_name), 0, 0, 1, 1}, + {&__pyx_kp_s_vals_must_be_ndarray, __pyx_k_vals_must_be_ndarray, sizeof(__pyx_k_vals_must_be_ndarray), 0, 0, 1, 0}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_values_2, __pyx_k_values_2, sizeof(__pyx_k_values_2), 0, 0, 1, 1}, + {&__pyx_n_s_values_from_object, __pyx_k_values_from_object, sizeof(__pyx_k_values_from_object), 0, 0, 1, 1}, + {&__pyx_n_s_vc, __pyx_k_vc, sizeof(__pyx_k_vc), 0, 0, 1, 1}, + {&__pyx_n_s_vec_binop, __pyx_k_vec_binop, sizeof(__pyx_k_vec_binop), 0, 0, 1, 1}, + {&__pyx_n_s_vec_compare, __pyx_k_vec_compare, sizeof(__pyx_k_vec_compare), 0, 0, 1, 1}, + {&__pyx_n_s_vecs, __pyx_k_vecs, sizeof(__pyx_k_vecs), 0, 0, 1, 1}, + {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_write_csv_rows, __pyx_k_write_csv_rows, sizeof(__pyx_k_write_csv_rows), 0, 0, 1, 1}, + {&__pyx_n_s_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 0, 1, 1}, + {&__pyx_n_s_writerows, __pyx_k_writerows, sizeof(__pyx_k_writerows), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {&__pyx_n_s_years, __pyx_k_years, sizeof(__pyx_k_years), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION >= 3 + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/lib.pyx":201 + * + * cdef inline int64_t get_timedelta64_value(val): + * return val.view('i8') # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/lib.pyx":487 + * it = PyArray_IterNew(arr) + * if len(arr) != n: + * raise ValueError('all arrays must be same length') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_all_arrays_must_be_same_length); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/lib.pyx":515 + * + * rev_indexer = np.empty(length, dtype=np.int64) + * rev_indexer.fill(-1) # <<<<<<<<<<<<<< + * for i in range(n): + * idx = indexer[i] + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/lib.pyx":610 + * + * if not started: + * return slice(0, 0) # <<<<<<<<<<<<<< + * if not finished: + * return slice(start, None) + */ + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/lib.pyx":640 + * flag = cpython.Py_NE + * else: + * raise ValueError('Unrecognized operator') # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool).view(np.uint8) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Unrecognized_operator); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/lib.pyx":687 + * flag = cpython.Py_NE + * else: + * raise ValueError('Unrecognized operator') # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool).view(np.uint8) + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Unrecognized_operator); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/lib.pyx":981 + * + * if lenidx <= 0 or lenbin <= 0: + * raise ValueError("Invalid length for values or for binner") # <<<<<<<<<<<<<< + * + * # check binner fits data + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Invalid_length_for_values_or_for); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/lib.pyx":985 + * # check binner fits data + * if values[0] < binner[0]: + * raise ValueError("Values falls before first bin") # <<<<<<<<<<<<<< + * + * if values[lenidx-1] > binner[lenbin-1]: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Values_falls_before_first_bin); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/lib.pyx":988 + * + * if values[lenidx-1] > binner[lenbin-1]: + * raise ValueError("Values falls after last bin") # <<<<<<<<<<<<<< + * + * bins = np.empty(lenbin - 1, dtype=np.int64) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Values_falls_after_last_bin); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/lib.pyx":1168 + * it = PyArray_IterNew(arr) + * if len(arr) != n: + * raise ValueError('all arrays must be same length') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_all_arrays_must_be_same_length); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "pandas/lib.pyx":1366 + * + * if vals is None: + * raise TypeError("vals must be ndarray") # <<<<<<<<<<<<<< + * + * n = vals.shape[0] + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_vals_must_be_ndarray); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/lib.pyx":1409 + * step = s.step + * if step == 0: + * raise ValueError("slice step cannot be zero") # <<<<<<<<<<<<<< + * + * if step > 0: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_slice_step_cannot_be_zero); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/lib.pyx":1413 + * if step > 0: + * if s.stop is None: + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * stop = s.stop + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unbounded_slice); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "pandas/lib.pyx":1424 + * elif step < 0: + * if s.start is None: + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * start = s.start + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unbounded_slice); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/lib.pyx":1435 + * + * if start < 0 or (stop < 0 and s.stop is not None): + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * if stop < 0: + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unbounded_slice); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "pandas/lib.pyx":1455 + * + * if slc is None: + * raise TypeError("slc should be a slice") # <<<<<<<<<<<<<< + * + * PySlice_GetIndicesEx(slc, objlen, + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_slc_should_be_a_slice); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "pandas/lib.pyx":1478 + * + * if slc is None: + * raise TypeError("slc must be slice") # <<<<<<<<<<<<<< + * + * PySlice_GetIndicesEx(slc, objlen, + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_slc_must_be_slice); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "pandas/lib.pyx":1539 + * self._has_slice = True + * else: + * arr = np.empty(0, dtype=np.int64) # <<<<<<<<<<<<<< + * self._as_array = arr + * self._has_array = True + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "pandas/lib.pyx":1578 + * cdef slice s = self._ensure_has_slice() + * if s is None: + * raise TypeError('Not slice-like') # <<<<<<<<<<<<<< + * else: + * return s + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Not_slice_like); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "pandas/lib.pyx":1647 + * if ((step > 0 and start < 0) or + * (step < 0 and stop < step)): + * raise ValueError("iadd causes length change") # <<<<<<<<<<<<<< + * + * if stop < 0: + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_iadd_causes_length_change); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "pandas/lib.pyx":1659 + * newarr = self.as_array + other + * if (newarr < 0).any(): + * raise ValueError("iadd causes length change") # <<<<<<<<<<<<<< + * + * self._as_array = newarr + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_iadd_causes_length_change); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "pandas/src/reduce.pyx":24 + * if axis == 0: + * if not arr.flags.f_contiguous: + * arr = arr.copy('F') # <<<<<<<<<<<<<< + * + * self.nresults = k + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_F); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "pandas/src/reduce.pyx":31 + * else: + * if not arr.flags.c_contiguous: + * arr = arr.copy('C') # <<<<<<<<<<<<<< + * + * self.nresults = n + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "pandas/src/reduce.pyx":66 + * + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if len(dummy) != self.chunksize: + * raise ValueError('Dummy array must be length %d' % + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Dummy_array_must_be_same_dtype); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "pandas/src/reduce.pyx":153 + * result[0] = res + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_function_does_not_reduce); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/src/reduce.pyx":176 + * values = series.values + * if not values.flags.c_contiguous: + * values = values.copy('C') # <<<<<<<<<<<<<< + * self.arr = values + * self.index = series.index + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "pandas/src/reduce.pyx":193 + * def _check_dummy(self, dummy=None): + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * else: + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "pandas/src/reduce.pyx":198 + * values = dummy.values + * if values.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Dummy_array_must_be_same_dtype); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "pandas/src/reduce.pyx":281 + * result = np.empty(self.ngroups, dtype='O') + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_function_does_not_reduce); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "pandas/src/reduce.pyx":306 + * values = series.values + * if not values.flags.c_contiguous: + * values = values.copy('C') # <<<<<<<<<<<<<< + * self.arr = values + * self.index = series.index + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "pandas/src/reduce.pyx":318 + * def _check_dummy(self, dummy=None): + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * else: + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "pandas/src/reduce.pyx":323 + * values = dummy.values + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Dummy_array_must_be_same_dtype); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "pandas/src/reduce.pyx":410 + * result = np.empty(self.ngroups, dtype='O') + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_function_does_not_reduce); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "pandas/src/reduce.pyx":484 + * + * if frame.index._has_complex_internals: + * raise InvalidApply('Cannot modify frame index internals') # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Cannot_modify_frame_index_intern); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "pandas/src/reduce.pyx":496 + * result = f(chunk) + * if result is chunk: + * raise InvalidApply('Function unsafe for fast apply') # <<<<<<<<<<<<<< + * except: + * raise InvalidApply('Let this error raise above us') + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Function_unsafe_for_fast_apply); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "pandas/src/reduce.pyx":498 + * raise InvalidApply('Function unsafe for fast apply') + * except: + * raise InvalidApply('Let this error raise above us') # <<<<<<<<<<<<<< + * + * slider = BlockSlider(frame) + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Let_this_error_raise_above_us); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "pandas/src/reduce.pyx":545 + * def __init__(self, frame): + * self.frame = frame + * self.dummy = frame[:0] # <<<<<<<<<<<<<< + * + * self.blocks = [b.values for b in self.dummy._data.blocks] + */ + __pyx_slice__40 = PySlice_New(Py_None, __pyx_int_0, Py_None); if (unlikely(!__pyx_slice__40)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__40); + __Pyx_GIVEREF(__pyx_slice__40); + + /* "pandas/src/reduce.pyx":593 + * def reduce(arr, f, axis=0, dummy=None, labels=None): + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') # <<<<<<<<<<<<<< + * + * reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels) + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Cannot_use_shortcut); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "pandas/src/inference.pyx":89 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "pandas/src/inference.pyx":201 + * return True + * elif util.is_timedelta64_object(v): + * return v.view('int64') == iNaT # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "pandas/src/inference.pyx":203 + * return v.view('int64') == iNaT + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT # <<<<<<<<<<<<<< + * elif util.is_integer_object(v): + * return v == iNaT + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "pandas/src/inference.pyx":518 + * seen_float = True + * else: + * raise ValueError('Empty string encountered') # <<<<<<<<<<<<<< + * elif util.is_complex_object(val): + * complexes[i] = val + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Empty_string_encountered); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "pandas/src/inference.pyx":743 + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return datetime.strptime(s, '%m/%d/%Y') + */ + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_parse_date, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":784 + * n = len(dates) + * if len(times) != n: + * raise ValueError('Length of dates and times must be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Length_of_dates_and_times_must_b); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + + /* "pandas/src/inference.pyx":796 + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return date.strptime(s, '%m/%d/%Y') + */ + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_parse_date, 796, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":809 + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + * def parse_time(s): # <<<<<<<<<<<<<< + * try: + * return time.strptime(s, '%H:%M:%S') + */ + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_parse_time, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":837 + * n = len(years) + * if len(months) != n or len(days) != n: + * raise ValueError('Length of years/months/days must all be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Length_of_years_months_days_must); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "pandas/src/inference.pyx":864 + * if (len(months) != n or len(days) != n or len(hours) != n or + * len(minutes) != n or len(seconds) != n): + * raise ValueError('Length of all datetime components must be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Length_of_all_datetime_component); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "pandas/src/inference.pyx":1113 + * if n == 0: + * # kludge, for Series + * return np.empty(0, dtype='f8') # <<<<<<<<<<<<<< + * + * keys = getattr(keys, 'values', keys) + */ + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "View.MemoryView":127 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "View.MemoryView":130 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if isinstance(format, unicode): + */ + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "View.MemoryView":142 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "View.MemoryView":170 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "View.MemoryView":186 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "View.MemoryView":445 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "View.MemoryView":521 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "View.MemoryView":638 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_tuple__74 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + + /* "View.MemoryView":641 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_tuple__75 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + + /* "View.MemoryView":652 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_tuple__76 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + + /* "View.MemoryView":660 + * for i in range(ndim): + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + + /* "pandas/lib.pyx":75 + * import_ufunc() + * + * def values_from_object(object o): # <<<<<<<<<<<<<< + * """ return my values or the object if we are say an ndarray """ + * cdef f + */ + __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_o, __pyx_n_s_f); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_values_from_object, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":109 + * + * + * def ismember_nans(float64_t[:] arr, set values, bint hasnans): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_tuple__80 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_values, __pyx_n_s_hasnans, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ismember_nans, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":124 + * + * + * def ismember(ndarray arr, set values): # <<<<<<<<<<<<<< + * ''' + * Checks whether + */ + __pyx_tuple__82 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ismember, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":176 + * return gmtime(dt) + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[int64_t, ndim=1] result + */ + __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_array_to_timestamp, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":188 + * return result + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[object, ndim=1] result + */ + __pyx_tuple__86 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_time64_to_datetime, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":237 + * return util._checknull(val) + * + * def isscalar(object val): # <<<<<<<<<<<<<< + * return np.isscalar(val) or val is None or PyDateTime_Check(val) + * + */ + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_val); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isscalar, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":243 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_tuple__90 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_result, __pyx_n_s_arobj); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":257 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_tuple__92 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_result); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj_old, 257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":271 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + __pyx_tuple__94 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_val, __pyx_n_s_result); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj2d, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":287 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_tuple__96 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_result); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj_old, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d_old(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + __pyx_tuple__98 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_val, __pyx_n_s_result); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj2d_old, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":315 + * return result.view(np.bool_) + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + __pyx_tuple__100 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_list_to_object_array, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":335 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__102 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_uniques, __pyx_n_s_table, __pyx_n_s_val, __pyx_n_s_stub); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_unique, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":356 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple(list arrays): # <<<<<<<<<<<<<< + * cdef: + * ndarray[object] buf + */ + __pyx_tuple__104 = PyTuple_Pack(10, __pyx_n_s_arrays, __pyx_n_s_buf, __pyx_n_s_k, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_uniques, __pyx_n_s_table, __pyx_n_s_val, __pyx_n_s_stub); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_unique_multiple, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":382 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list(list lists): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + __pyx_tuple__106 = PyTuple_Pack(10, __pyx_n_s_lists, __pyx_n_s_buf, __pyx_n_s_k, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_uniques, __pyx_n_s_table, __pyx_n_s_val, __pyx_n_s_stub); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_unique_multiple_list, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":408 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list_gen(object gen): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + __pyx_tuple__108 = PyTuple_Pack(8, __pyx_n_s_gen, __pyx_n_s_buf, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_uniques, __pyx_n_s_table, __pyx_n_s_val, __pyx_n_s_stub); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_unique_multiple_list_gen, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":433 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def dicts_to_array(list dicts, list columns): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n + */ + __pyx_tuple__110 = PyTuple_Pack(10, __pyx_n_s_dicts, __pyx_n_s_columns, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_row, __pyx_n_s_col, __pyx_n_s_onan); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dicts_to_array, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":456 + * return result + * + * def fast_zip(list ndarrays): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + __pyx_tuple__112 = PyTuple_Pack(10, __pyx_n_s_ndarrays, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_it, __pyx_n_s_val, __pyx_n_s_tup, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_zip, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":497 + * return result + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): # <<<<<<<<<<<<<< + * """ + * Reverse indexing operation. + */ + __pyx_tuple__114 = PyTuple_Pack(6, __pyx_n_s_indexer, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_rev_indexer, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_reverse_indexer, 497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":524 + * + * + * def has_infs_f4(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__116 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_inf, __pyx_n_s_neginf, __pyx_n_s_val); if (unlikely(!__pyx_tuple__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_has_infs_f4, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":538 + * return False + * + * def has_infs_f8(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__118 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_inf, __pyx_n_s_neginf, __pyx_n_s_val); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_has_infs_f8, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":552 + * return False + * + * def convert_timestamps(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * object val, f, result + */ + __pyx_tuple__120 = PyTuple_Pack(9, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_f, __pyx_n_s_result, __pyx_n_s_cache_2, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_out, __pyx_n_s_datetime); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_convert_timestamps, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":575 + * return out + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indices) + */ + __pyx_tuple__122 = PyTuple_Pack(3, __pyx_n_s_indices, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_maybe_indices_to_slice, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":588 + * + * + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(mask) + */ + __pyx_tuple__124 = PyTuple_Pack(7, __pyx_n_s_mask, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_started, __pyx_n_s_finished); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_maybe_booleans_to_slice, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":619 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + __pyx_tuple__126 = PyTuple_Pack(9, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_op, __pyx_n_s_operator, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_flag, __pyx_n_s_x); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_scalar_compare, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":663 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + __pyx_tuple__128 = PyTuple_Pack(10, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_op, __pyx_n_s_operator, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_flag, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__128); + __Pyx_GIVEREF(__pyx_tuple__128); + __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_vec_compare, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":715 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_binop(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__130 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_op, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_scalar_binop, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":737 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + __pyx_tuple__132 = PyTuple_Pack(8, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_op, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_vec_binop, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":764 + * + * + * def astype_intsafe(ndarray[object] arr, new_dtype): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__134 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_new_dtype, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_v, __pyx_n_s_is_datelike, __pyx_n_s_result); if (unlikely(!__pyx_tuple__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__134); + __Pyx_GIVEREF(__pyx_tuple__134); + __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_astype_intsafe, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":794 + * return result + * + * def clean_index_list(list obj): # <<<<<<<<<<<<<< + * ''' + * Utility used in pandas.core.index._ensure_index + */ + __pyx_tuple__136 = PyTuple_Pack(6, __pyx_n_s_obj, __pyx_n_s_converted, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_v, __pyx_n_s_all_arrays); if (unlikely(!__pyx_tuple__136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__136); + __Pyx_GIVEREF(__pyx_tuple__136); + __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_clean_index_list, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":825 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def max_len_string_array(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * """ return the maximum size of elements in a 1-dim string array """ + * cdef: + */ + __pyx_tuple__138 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_m, __pyx_n_s_l, __pyx_n_s_length, __pyx_n_s_v); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__138); + __Pyx_GIVEREF(__pyx_tuple__138); + __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_max_len_string_array, 825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":845 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def string_array_replace_from_nan_rep(ndarray[object, ndim=1] arr, object nan_rep, object replace = None): # <<<<<<<<<<<<<< + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + */ + __pyx_tuple__140 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_nan_rep, __pyx_n_s_replace, __pyx_n_s_length, __pyx_n_s_i); if (unlikely(!__pyx_tuple__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__140); + __Pyx_GIVEREF(__pyx_tuple__140); + __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_string_array_replace_from_nan_re, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":860 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def write_csv_rows(list data, list data_index, int nlevels, list cols, object writer): # <<<<<<<<<<<<<< + * + * cdef int N, j, i, ncols + */ + __pyx_tuple__142 = PyTuple_Pack(13, __pyx_n_s_data, __pyx_n_s_data_index, __pyx_n_s_nlevels, __pyx_n_s_cols, __pyx_n_s_writer, __pyx_n_s_N, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_ncols, __pyx_n_s_rows, __pyx_n_s_val, __pyx_n_s_row, __pyx_n_s_x); if (unlikely(!__pyx_tuple__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__142); + __Pyx_GIVEREF(__pyx_tuple__142); + __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_write_csv_rows, 860, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":908 + * + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef int length = index.shape[0] + * cdef int i = 0 + */ + __pyx_tuple__144 = PyTuple_Pack(5, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result); if (unlikely(!__pyx_tuple__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__144); + __Pyx_GIVEREF(__pyx_tuple__144); + __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_arrmap, 908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":921 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + __pyx_tuple__146 = PyTuple_Pack(9, __pyx_n_s_list_of_arrays, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nlevels, __pyx_n_s_k, __pyx_n_s_cur, __pyx_n_s_pre, __pyx_n_s_arr, __pyx_n_s_vecs); if (unlikely(!__pyx_tuple__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__146); + __Pyx_GIVEREF(__pyx_tuple__146); + __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_lexsorted, 921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":960 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner, # <<<<<<<<<<<<<< + * object closed='left', bint hasnans=0): + * """ + */ + __pyx_tuple__148 = PyTuple_Pack(16, __pyx_n_s_values, __pyx_n_s_binner, __pyx_n_s_closed, __pyx_n_s_hasnans, __pyx_n_s_lenidx, __pyx_n_s_lenbin, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_bc, __pyx_n_s_vc, __pyx_n_s_bins, __pyx_n_s_l_bin, __pyx_n_s_r_bin, __pyx_n_s_nat_count, __pyx_n_s_right_closed, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__148); + __Pyx_GIVEREF(__pyx_tuple__148); + __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_generate_bins_dt64, 960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1025 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + __pyx_tuple__150 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_pos, __pyx_n_s_out); if (unlikely(!__pyx_tuple__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__150); + __Pyx_GIVEREF(__pyx_tuple__150); + __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_row_bool_subset, 1025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1046 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + __pyx_tuple__152 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_pos, __pyx_n_s_out); if (unlikely(!__pyx_tuple__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__152); + __Pyx_GIVEREF(__pyx_tuple__152); + __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_row_bool_subset_object, 1046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1066 + * + * + * def group_count(ndarray[int64_t] values, Py_ssize_t size): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__154 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_counts); if (unlikely(!__pyx_tuple__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__154); + __Pyx_GIVEREF(__pyx_tuple__154); + __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_count, 1066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1076 + * return counts + * + * def lookup_values(ndarray[object] values, dict mapping): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__156 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_mapping, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__156); + __Pyx_GIVEREF(__pyx_tuple__156); + __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_lookup_values, 1076, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1086 + * + * + * def count_level_1d(ndarray[uint8_t, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + __pyx_tuple__158 = PyTuple_Pack(6, __pyx_n_s_mask, __pyx_n_s_labels, __pyx_n_s_max_bin, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_counts); if (unlikely(!__pyx_tuple__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__158); + __Pyx_GIVEREF(__pyx_tuple__158); + __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_count_level_1d, 1086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1103 + * + * + * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + __pyx_tuple__160 = PyTuple_Pack(8, __pyx_n_s_mask, __pyx_n_s_labels, __pyx_n_s_max_bin, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_counts); if (unlikely(!__pyx_tuple__160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__160); + __Pyx_GIVEREF(__pyx_tuple__160); + __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_count_level_2d, 1103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1134 + * pandas_null = _PandasNull() + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + __pyx_tuple__162 = PyTuple_Pack(11, __pyx_n_s_ndarrays, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_it, __pyx_n_s_val, __pyx_n_s_tup, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__162); + __Pyx_GIVEREF(__pyx_tuple__162); + __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_zip_fillna, 1134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1181 + * return result + * + * def duplicated(ndarray[object] values, take_last=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_tuple__164 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_take_last, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_seen, __pyx_n_s_row, __pyx_n_s_result); if (unlikely(!__pyx_tuple__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__164); + __Pyx_GIVEREF(__pyx_tuple__164); + __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_duplicated, 1181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1210 + * return result.view(np.bool_) + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, group_size, n, lab, start + */ + __pyx_tuple__166 = PyTuple_Pack(10, __pyx_n_s_labels, __pyx_n_s_ngroups, __pyx_n_s_i, __pyx_n_s_group_size, __pyx_n_s_n, __pyx_n_s_lab, __pyx_n_s_start, __pyx_n_s_slobj, __pyx_n_s_starts, __pyx_n_s_ends); if (unlikely(!__pyx_tuple__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__166); + __Pyx_GIVEREF(__pyx_tuple__166); + __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_generate_slices, 1210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1235 + * + * + * def indices_fast(object index, ndarray[int64_t] labels, list keys, # <<<<<<<<<<<<<< + * list sorted_labels): + * cdef: + */ + __pyx_tuple__168 = PyTuple_Pack(14, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_keys, __pyx_n_s_sorted_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_lab, __pyx_n_s_cur, __pyx_n_s_start, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_tup, __pyx_n_s_val); if (unlikely(!__pyx_tuple__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__168); + __Pyx_GIVEREF(__pyx_tuple__168); + __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_indices_fast, 1235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + __pyx_tuple__170 = PyTuple_Pack(18, __pyx_n_s_blknos, __pyx_n_s_group, __pyx_n_s_cur_blkno, __pyx_n_s_i, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_n, __pyx_n_s_diff, __pyx_n_s_group_order, __pyx_n_s_group_slices, __pyx_n_s_res_view, __pyx_n_s_group_dict, __pyx_n_s_blkno, __pyx_n_s_slices, __pyx_n_s_tot_len, __pyx_n_s_result, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__170); + __Pyx_GIVEREF(__pyx_tuple__170); + __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_blkno_indexers, 1278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1486 + * + * + * def slice_getitem(slice slc not None, ind): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s_start, s_stop, s_step, s_len + */ + __pyx_tuple__172 = PyTuple_Pack(10, __pyx_n_s_slc, __pyx_n_s_ind, __pyx_n_s_s_start, __pyx_n_s_s_stop, __pyx_n_s_s_step, __pyx_n_s_s_len, __pyx_n_s_ind_start, __pyx_n_s_ind_stop, __pyx_n_s_ind_step, __pyx_n_s_ind_len); if (unlikely(!__pyx_tuple__172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__172); + __Pyx_GIVEREF(__pyx_tuple__172); + __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_slice_getitem, 1486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/reduce.pyx":474 + * pass + * + * def apply_frame_axis0(object frame, object f, object names, # <<<<<<<<<<<<<< + * ndarray[int64_t] starts, ndarray[int64_t] ends): + * cdef: + */ + __pyx_tuple__174 = PyTuple_Pack(16, __pyx_n_s_frame, __pyx_n_s_f, __pyx_n_s_names, __pyx_n_s_starts, __pyx_n_s_ends, __pyx_n_s_slider, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_results, __pyx_n_s_piece, __pyx_n_s_item_cache_2, __pyx_n_s_chunk, __pyx_n_s_shape_before, __pyx_n_s_result, __pyx_n_s_mutated, __pyx_n_s_gin); if (unlikely(!__pyx_tuple__174)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__174); + __Pyx_GIVEREF(__pyx_tuple__174); + __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_reduce_pyx, __pyx_n_s_apply_frame_axis0, 474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/reduce.pyx":591 + * + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): # <<<<<<<<<<<<<< + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') + */ + __pyx_tuple__176 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_f, __pyx_n_s_axis, __pyx_n_s_dummy, __pyx_n_s_labels, __pyx_n_s_reducer); if (unlikely(!__pyx_tuple__176)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__176); + __Pyx_GIVEREF(__pyx_tuple__176); + __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_reduce_pyx, __pyx_n_s_reduce, 591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":7 + * + * # core.common import for fast inference checks + * def is_float(object obj): # <<<<<<<<<<<<<< + * return util.is_float_object(obj) + * + */ + __pyx_tuple__178 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__178)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__178); + __Pyx_GIVEREF(__pyx_tuple__178); + __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_float, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":10 + * return util.is_float_object(obj) + * + * def is_integer(object obj): # <<<<<<<<<<<<<< + * return util.is_integer_object(obj) + * + */ + __pyx_tuple__180 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__180)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__180); + __Pyx_GIVEREF(__pyx_tuple__180); + __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_integer, 10, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":13 + * return util.is_integer_object(obj) + * + * def is_bool(object obj): # <<<<<<<<<<<<<< + * return util.is_bool_object(obj) + * + */ + __pyx_tuple__182 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__182)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__182); + __Pyx_GIVEREF(__pyx_tuple__182); + __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_bool, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":16 + * return util.is_bool_object(obj) + * + * def is_complex(object obj): # <<<<<<<<<<<<<< + * return util.is_complex_object(obj) + * + */ + __pyx_tuple__184 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__184)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__184); + __Pyx_GIVEREF(__pyx_tuple__184); + __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_complex, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":64 + * pass + * + * def infer_dtype(object _values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_tuple__186 = PyTuple_Pack(7, __pyx_n_s_values_2, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_values, __pyx_n_s_val_name, __pyx_n_s_val_kind); if (unlikely(!__pyx_tuple__186)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__186); + __Pyx_GIVEREF(__pyx_tuple__186); + __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_infer_dtype, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":169 + * return 'mixed' + * + * def infer_dtype_list(list values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__188 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__188)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__188); + __Pyx_GIVEREF(__pyx_tuple__188); + __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_infer_dtype_list, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":175 + * + * + * def is_possible_datetimelike_array(object arr): # <<<<<<<<<<<<<< + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + */ + __pyx_tuple__190 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_seen_timedelta, __pyx_n_s_seen_datetime, __pyx_n_s_v); if (unlikely(!__pyx_tuple__190)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__190); + __Pyx_GIVEREF(__pyx_tuple__190); + __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_possible_datetimelike_array, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":222 + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + * def is_bool_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__192 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__192)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__192); + __Pyx_GIVEREF(__pyx_tuple__192); + __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_bool_array, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":243 + * return False + * + * def is_integer(object o): # <<<<<<<<<<<<<< + * return util.is_integer_object(o) + * + */ + __pyx_tuple__194 = PyTuple_Pack(1, __pyx_n_s_o); if (unlikely(!__pyx_tuple__194)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__194); + __Pyx_GIVEREF(__pyx_tuple__194); + __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_integer, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":246 + * return util.is_integer_object(o) + * + * def is_integer_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__196 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__196); + __Pyx_GIVEREF(__pyx_tuple__196); + __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_integer_array, 246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":267 + * return False + * + * def is_integer_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__198 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__198); + __Pyx_GIVEREF(__pyx_tuple__198); + __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_integer_float_array, 267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":290 + * return False + * + * def is_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__200 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__200)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__200); + __Pyx_GIVEREF(__pyx_tuple__200); + __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_float_array, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":311 + * return False + * + * def is_string_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__202 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__202)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__202); + __Pyx_GIVEREF(__pyx_tuple__202); + __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_string_array, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":332 + * return False + * + * def is_unicode_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__204 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__204)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__204); + __Pyx_GIVEREF(__pyx_tuple__204); + __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_unicode_array, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":354 + * + * + * def is_datetime_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_tuple__206 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__206)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__206); + __Pyx_GIVEREF(__pyx_tuple__206); + __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_datetime_array, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":371 + * return null_count != n + * + * def is_datetime64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_tuple__208 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__208)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__208); + __Pyx_GIVEREF(__pyx_tuple__208); + __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_datetime64_array, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":388 + * return null_count != n + * + * def is_timedelta_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_tuple__210 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__210)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__210); + __Pyx_GIVEREF(__pyx_tuple__210); + __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_timedelta_array, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":403 + * return null_count != n + * + * def is_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_tuple__212 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__212)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__212); + __Pyx_GIVEREF(__pyx_tuple__212); + __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_timedelta64_array, 403, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":418 + * return null_count != n + * + * def is_timedelta_or_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) + */ + __pyx_tuple__214 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__214)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__214); + __Pyx_GIVEREF(__pyx_tuple__214); + __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_timedelta_or_timedelta64_arra, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":434 + * return null_count != n + * + * def is_date_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_tuple__216 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__216)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__216); + __Pyx_GIVEREF(__pyx_tuple__216); + __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_date_array, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":443 + * return True + * + * def is_time_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_tuple__218 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__218)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__218); + __Pyx_GIVEREF(__pyx_tuple__218); + __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_time_array, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":452 + * return True + * + * def is_period(object o): # <<<<<<<<<<<<<< + * from pandas import Period + * return isinstance(o,Period) + */ + __pyx_tuple__220 = PyTuple_Pack(2, __pyx_n_s_o, __pyx_n_s_Period); if (unlikely(!__pyx_tuple__220)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__220); + __Pyx_GIVEREF(__pyx_tuple__220); + __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_period, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":456 + * return isinstance(o,Period) + * + * def is_period_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * from pandas.tseries.period import Period + */ + __pyx_tuple__222 = PyTuple_Pack(4, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_Period); if (unlikely(!__pyx_tuple__222)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__222); + __Pyx_GIVEREF(__pyx_tuple__222); + __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_period_array, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + __pyx_tuple__224 = PyTuple_Pack(17, __pyx_n_s_values, __pyx_n_s_na_values, __pyx_n_s_convert_empty, __pyx_n_s_coerce_numeric, __pyx_n_s_status, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_floats, __pyx_n_s_complexes, __pyx_n_s_ints, __pyx_n_s_bools, __pyx_n_s_seen_float, __pyx_n_s_seen_complex, __pyx_n_s_seen_int, __pyx_n_s_seen_bool, __pyx_n_s_val, __pyx_n_s_fval); if (unlikely(!__pyx_tuple__224)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__224); + __Pyx_GIVEREF(__pyx_tuple__224); + __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_maybe_convert_numeric, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":556 + * + * + * def maybe_convert_objects(ndarray[object] objects, bint try_float=0, # <<<<<<<<<<<<<< + * bint safe=0, bint convert_datetime=0, + * bint convert_timedelta=0): + */ + __pyx_tuple__226 = PyTuple_Pack(28, __pyx_n_s_objects, __pyx_n_s_try_float, __pyx_n_s_safe, __pyx_n_s_convert_datetime, __pyx_n_s_convert_timedelta, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_floats, __pyx_n_s_complexes, __pyx_n_s_ints, __pyx_n_s_bools, __pyx_n_s_idatetimes, __pyx_n_s_itimedeltas, __pyx_n_s_seen_float, __pyx_n_s_seen_complex, __pyx_n_s_seen_datetime, __pyx_n_s_seen_timedelta, __pyx_n_s_seen_int, __pyx_n_s_seen_bool, __pyx_n_s_seen_object, __pyx_n_s_seen_null, __pyx_n_s_seen_numeric, __pyx_n_s_val, __pyx_n_s_onan, __pyx_n_s_fval, __pyx_n_s_fnan, __pyx_n_s_datetimes, __pyx_n_s_timedeltas); if (unlikely(!__pyx_tuple__226)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__226); + __Pyx_GIVEREF(__pyx_tuple__226); + __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(5, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_maybe_convert_objects, 556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":722 + * + * + * def convert_sql_column(x): # <<<<<<<<<<<<<< + * return maybe_convert_objects(x, try_float=1) + * + */ + __pyx_tuple__228 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__228)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__228); + __Pyx_GIVEREF(__pyx_tuple__228); + __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_convert_sql_column, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + __pyx_tuple__230 = PyTuple_Pack(11, __pyx_n_s_values, __pyx_n_s_parser, __pyx_n_s_dayfirst, __pyx_n_s_default, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_date, __pyx_n_s_parse, __pyx_n_s_parse_date, __pyx_n_s_parse_date); if (unlikely(!__pyx_tuple__230)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__230); + __Pyx_GIVEREF(__pyx_tuple__230); + __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_try_parse_dates, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + __pyx_tuple__232 = PyTuple_Pack(20, __pyx_n_s_dates, __pyx_n_s_times, __pyx_n_s_date_parser, __pyx_n_s_time_parser, __pyx_n_s_dayfirst, __pyx_n_s_default, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_date, __pyx_n_s_time, __pyx_n_s_datetime, __pyx_n_s_timedelta, __pyx_n_s_parse, __pyx_n_s_parse_date, __pyx_n_s_parse_date, __pyx_n_s_parse_time, __pyx_n_s_parse_time, __pyx_n_s_d, __pyx_n_s_t); if (unlikely(!__pyx_tuple__232)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__232); + __Pyx_GIVEREF(__pyx_tuple__232); + __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(6, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_try_parse_date_and_time, 773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":827 + * + * + * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months, # <<<<<<<<<<<<<< + * ndarray[object] days): + * cdef: + */ + __pyx_tuple__234 = PyTuple_Pack(7, __pyx_n_s_years, __pyx_n_s_months, __pyx_n_s_days, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_datetime); if (unlikely(!__pyx_tuple__234)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__234); + __Pyx_GIVEREF(__pyx_tuple__234); + __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_try_parse_year_month_day, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":845 + * return result + * + * def try_parse_datetime_components(ndarray[object] years, # <<<<<<<<<<<<<< + * ndarray[object] months, + * ndarray[object] days, + */ + __pyx_tuple__236 = PyTuple_Pack(13, __pyx_n_s_years, __pyx_n_s_months, __pyx_n_s_days, __pyx_n_s_hours, __pyx_n_s_minutes, __pyx_n_s_seconds, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_secs, __pyx_n_s_float_secs, __pyx_n_s_micros, __pyx_n_s_datetime); if (unlikely(!__pyx_tuple__236)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__236); + __Pyx_GIVEREF(__pyx_tuple__236); + __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_try_parse_datetime_components, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + __pyx_tuple__238 = PyTuple_Pack(9, __pyx_n_s_values, __pyx_n_s_na_values, __pyx_n_s_convert_empty, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_onan, __pyx_n_s_na_count, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__238)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__238); + __Pyx_GIVEREF(__pyx_tuple__238); + __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_sanitize_objects, 881, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + __pyx_tuple__240 = PyTuple_Pack(11, __pyx_n_s_arr, __pyx_n_s_true_values, __pyx_n_s_false_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val, __pyx_n_s_true_vals, __pyx_n_s_false_vals, __pyx_n_s_na_count, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__240)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__240); + __Pyx_GIVEREF(__pyx_tuple__240); + __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_maybe_convert_bool, 904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":953 + * + * + * def map_infer_mask(ndarray arr, object f, ndarray[uint8_t] mask, # <<<<<<<<<<<<<< + * bint convert=1): + * ''' + */ + __pyx_tuple__242 = PyTuple_Pack(8, __pyx_n_s_arr, __pyx_n_s_f, __pyx_n_s_mask, __pyx_n_s_convert, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val); if (unlikely(!__pyx_tuple__242)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__242); + __Pyx_GIVEREF(__pyx_tuple__242); + __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_map_infer_mask, 953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":995 + * return result + * + * def map_infer(ndarray arr, object f, bint convert=1): # <<<<<<<<<<<<<< + * ''' + * Substitute for np.vectorize with pandas-friendly dtype inference + */ + __pyx_tuple__244 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_f, __pyx_n_s_convert, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val); if (unlikely(!__pyx_tuple__244)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__244); + __Pyx_GIVEREF(__pyx_tuple__244); + __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_map_infer, 995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":1034 + * + * + * def to_object_array(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_tuple__246 = PyTuple_Pack(8, __pyx_n_s_rows, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_tmp, __pyx_n_s_result, __pyx_n_s_row); if (unlikely(!__pyx_tuple__246)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__246); + __Pyx_GIVEREF(__pyx_tuple__246); + __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_to_object_array, 1034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":1058 + * return result + * + * def tuples_to_object_array(ndarray[object] tuples): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_tuple__248 = PyTuple_Pack(8, __pyx_n_s_tuples, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_tmp, __pyx_n_s_result, __pyx_n_s_tup); if (unlikely(!__pyx_tuple__248)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__248); + __Pyx_GIVEREF(__pyx_tuple__248); + __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__248, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_tuples_to_object_array, 1058, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":1074 + * return result + * + * def to_object_array_tuples(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_tuple__250 = PyTuple_Pack(8, __pyx_n_s_rows, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_tmp, __pyx_n_s_result, __pyx_n_s_row); if (unlikely(!__pyx_tuple__250)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__250); + __Pyx_GIVEREF(__pyx_tuple__250); + __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_to_object_array_tuples, 1074, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":1105 + * + * + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(keys) + */ + __pyx_tuple__252 = PyTuple_Pack(7, __pyx_n_s_mapping, __pyx_n_s_keys, __pyx_n_s_default, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_output); if (unlikely(!__pyx_tuple__252)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__252); + __Pyx_GIVEREF(__pyx_tuple__252); + __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_fast_multiget, 1105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":276 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__254 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__254)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__254); + __Pyx_GIVEREF(__pyx_tuple__254); + + /* "View.MemoryView":277 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__255 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__255)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__255); + __Pyx_GIVEREF(__pyx_tuple__255); + + /* "View.MemoryView":278 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__256 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__256)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__256); + __Pyx_GIVEREF(__pyx_tuple__256); + + /* "View.MemoryView":281 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__257 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__257)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__257); + __Pyx_GIVEREF(__pyx_tuple__257); + + /* "View.MemoryView":282 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__258 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__258)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__258); + __Pyx_GIVEREF(__pyx_tuple__258); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initlib(void); /*proto*/ +PyMODINIT_FUNC initlib(void) +#else +PyMODINIT_FUNC PyInit_lib(void); /*proto*/ +PyMODINIT_FUNC PyInit_lib(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_lib(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("lib"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__lib) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.lib")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.lib", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6pandas_3lib__PandasNull) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib__PandasNull.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "_PandasNull", (PyObject *)&__pyx_type_6pandas_3lib__PandasNull) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib__PandasNull = &__pyx_type_6pandas_3lib__PandasNull; + __pyx_vtabptr_6pandas_3lib_BlockPlacement = &__pyx_vtable_6pandas_3lib_BlockPlacement; + __pyx_vtable_6pandas_3lib_BlockPlacement.iadd = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_BlockPlacement *, PyObject *))__pyx_f_6pandas_3lib_14BlockPlacement_iadd; + __pyx_vtable_6pandas_3lib_BlockPlacement.copy = (struct __pyx_obj_6pandas_3lib_BlockPlacement *(*)(struct __pyx_obj_6pandas_3lib_BlockPlacement *))__pyx_f_6pandas_3lib_14BlockPlacement_copy; + __pyx_vtable_6pandas_3lib_BlockPlacement._ensure_has_slice = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_BlockPlacement *))__pyx_f_6pandas_3lib_14BlockPlacement__ensure_has_slice; + if (PyType_Ready(&__pyx_type_6pandas_3lib_BlockPlacement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_BlockPlacement.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_BlockPlacement.tp_dict, __pyx_vtabptr_6pandas_3lib_BlockPlacement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockPlacement", (PyObject *)&__pyx_type_6pandas_3lib_BlockPlacement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_BlockPlacement = &__pyx_type_6pandas_3lib_BlockPlacement; + if (PyType_Ready(&__pyx_type_6pandas_3lib_Reducer) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_Reducer.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Reducer", (PyObject *)&__pyx_type_6pandas_3lib_Reducer) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_Reducer = &__pyx_type_6pandas_3lib_Reducer; + if (PyType_Ready(&__pyx_type_6pandas_3lib_SeriesBinGrouper) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_SeriesBinGrouper.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "SeriesBinGrouper", (PyObject *)&__pyx_type_6pandas_3lib_SeriesBinGrouper) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_SeriesBinGrouper = &__pyx_type_6pandas_3lib_SeriesBinGrouper; + if (PyType_Ready(&__pyx_type_6pandas_3lib_SeriesGrouper) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_SeriesGrouper.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "SeriesGrouper", (PyObject *)&__pyx_type_6pandas_3lib_SeriesGrouper) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_SeriesGrouper = &__pyx_type_6pandas_3lib_SeriesGrouper; + __pyx_vtabptr_6pandas_3lib_Slider = &__pyx_vtable_6pandas_3lib_Slider; + __pyx_vtable_6pandas_3lib_Slider.advance = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_advance; + __pyx_vtable_6pandas_3lib_Slider.move = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, int, int))__pyx_f_6pandas_3lib_6Slider_move; + __pyx_vtable_6pandas_3lib_Slider.set_length = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_set_length; + __pyx_vtable_6pandas_3lib_Slider.reset = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_reset; + if (PyType_Ready(&__pyx_type_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_Slider.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Slider.tp_dict, __pyx_vtabptr_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Slider", (PyObject *)&__pyx_type_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_Slider = &__pyx_type_6pandas_3lib_Slider; + __pyx_vtabptr_6pandas_3lib_BlockSlider = &__pyx_vtable_6pandas_3lib_BlockSlider; + __pyx_vtable_6pandas_3lib_BlockSlider.move = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_BlockSlider *, int, int, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_11BlockSlider_move; + __pyx_vtable_6pandas_3lib_BlockSlider.reset = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_BlockSlider *))__pyx_f_6pandas_3lib_11BlockSlider_reset; + if (PyType_Ready(&__pyx_type_6pandas_3lib_BlockSlider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_BlockSlider.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_BlockSlider.tp_dict, __pyx_vtabptr_6pandas_3lib_BlockSlider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockSlider", (PyObject *)&__pyx_type_6pandas_3lib_BlockSlider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_BlockSlider = &__pyx_type_6pandas_3lib_BlockSlider; + if (PyType_Ready(&__pyx_type_6pandas_3lib_cache_readonly) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_cache_readonly.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "cache_readonly", (PyObject *)&__pyx_type_6pandas_3lib_cache_readonly) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_cache_readonly = &__pyx_type_6pandas_3lib_cache_readonly; + if (PyType_Ready(&__pyx_type_6pandas_3lib_AxisProperty) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_AxisProperty.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "AxisProperty", (PyObject *)&__pyx_type_6pandas_3lib_AxisProperty) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_AxisProperty = &__pyx_type_6pandas_3lib_AxisProperty; + if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct__get_blkno_indexers) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib___pyx_scope_struct__get_blkno_indexers.tp_print = 0; + __pyx_ptype_6pandas_3lib___pyx_scope_struct__get_blkno_indexers = &__pyx_type_6pandas_3lib___pyx_scope_struct__get_blkno_indexers; + if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib___pyx_scope_struct_1_genexpr.tp_print = 0; + __pyx_ptype_6pandas_3lib___pyx_scope_struct_1_genexpr = &__pyx_type_6pandas_3lib___pyx_scope_struct_1_genexpr; + if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct_2_try_parse_dates) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib___pyx_scope_struct_2_try_parse_dates.tp_print = 0; + __pyx_ptype_6pandas_3lib___pyx_scope_struct_2_try_parse_dates = &__pyx_type_6pandas_3lib___pyx_scope_struct_2_try_parse_dates; + if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time.tp_print = 0; + __pyx_ptype_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time = &__pyx_type_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_array.tp_print = 0; + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_MemviewEnum.tp_print = 0; + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + __pyx_t_1 = __Pyx_ImportModule("pandas.tslib"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ImportFunction(__pyx_t_1, "convert_to_tsobject", (void (**)(void))&__pyx_f_6pandas_5tslib_convert_to_tsobject, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ImportFunction(__pyx_t_1, "convert_to_timedelta64", (void (**)(void))&__pyx_f_6pandas_5tslib_convert_to_timedelta64, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*--- Execution code ---*/ + + /* "pandas/lib.pyx":3 + * cimport numpy as np + * cimport cython + * import numpy as np # <<<<<<<<<<<<<< + * + * from numpy cimport * + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":37 + * cimport cpython + * + * isnan = np.isnan # <<<<<<<<<<<<<< + * cdef double NaN = np.NaN + * cdef double nan = NaN + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isnan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnan, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":38 + * + * isnan = np.isnan + * cdef double NaN = np.NaN # <<<<<<<<<<<<<< + * cdef double nan = NaN + * cdef double NAN = nan + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_3lib_NaN = ((double)__pyx_t_4); + + /* "pandas/lib.pyx":39 + * isnan = np.isnan + * cdef double NaN = np.NaN + * cdef double nan = NaN # <<<<<<<<<<<<<< + * cdef double NAN = nan + * + */ + __pyx_v_6pandas_3lib_nan = __pyx_v_6pandas_3lib_NaN; + + /* "pandas/lib.pyx":40 + * cdef double NaN = np.NaN + * cdef double nan = NaN + * cdef double NAN = nan # <<<<<<<<<<<<<< + * + * from datetime import datetime as pydatetime + */ + __pyx_v_6pandas_3lib_NAN = __pyx_v_6pandas_3lib_nan; + + /* "pandas/lib.pyx":42 + * cdef double NAN = nan + * + * from datetime import datetime as pydatetime # <<<<<<<<<<<<<< + * + * # this is our tseries.pxd + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydatetime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":48 + * + * from tslib cimport convert_to_tsobject, convert_to_timedelta64 + * import tslib # <<<<<<<<<<<<<< + * from tslib import NaT, Timestamp, repr_timedelta64 + * + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_tslib, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tslib, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":49 + * from tslib cimport convert_to_tsobject, convert_to_timedelta64 + * import tslib + * from tslib import NaT, Timestamp, repr_timedelta64 # <<<<<<<<<<<<<< + * + * cdef int64_t NPY_NAT = util.get_nat() + */ + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_NaT); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_NaT); + __Pyx_GIVEREF(__pyx_n_s_NaT); + __Pyx_INCREF(__pyx_n_s_Timestamp); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Timestamp); + __Pyx_GIVEREF(__pyx_n_s_Timestamp); + __Pyx_INCREF(__pyx_n_s_repr_timedelta64); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_repr_timedelta64); + __Pyx_GIVEREF(__pyx_n_s_repr_timedelta64); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_tslib, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_repr_timedelta64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_repr_timedelta64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":51 + * from tslib import NaT, Timestamp, repr_timedelta64 + * + * cdef int64_t NPY_NAT = util.get_nat() # <<<<<<<<<<<<<< + * + * ctypedef unsigned char UChar + */ + __pyx_v_6pandas_3lib_NPY_NAT = get_nat(); + + /* "pandas/lib.pyx":69 + * + * # import datetime C API + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * # initialize numpy + */ + PyDateTime_IMPORT; + + /* "pandas/lib.pyx":72 + * + * # initialize numpy + * import_array() # <<<<<<<<<<<<<< + * import_ufunc() + * + */ + import_array(); + + /* "pandas/lib.pyx":73 + * # initialize numpy + * import_array() + * import_ufunc() # <<<<<<<<<<<<<< + * + * def values_from_object(object o): + */ + import_ufunc(); + + /* "pandas/lib.pyx":75 + * import_ufunc() + * + * def values_from_object(object o): # <<<<<<<<<<<<<< + * """ return my values or the object if we are say an ndarray """ + * cdef f + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_1values_from_object, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_values_from_object, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":109 + * + * + * def ismember_nans(float64_t[:] arr, set values, bint hasnans): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_5ismember_nans, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ismember_nans, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":124 + * + * + * def ismember(ndarray arr, set values): # <<<<<<<<<<<<<< + * ''' + * Checks whether + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_7ismember, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ismember, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":153 + * # datetime / io related + * + * cdef int _EPOCH_ORD = 719163 # <<<<<<<<<<<<<< + * + * from datetime import date as pydate + */ + __pyx_v_6pandas_3lib__EPOCH_ORD = 719163; + + /* "pandas/lib.pyx":155 + * cdef int _EPOCH_ORD = 719163 + * + * from datetime import date as pydate # <<<<<<<<<<<<<< + * + * cdef inline int64_t gmtime(object date): + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_date); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_date); + __Pyx_GIVEREF(__pyx_n_s_date); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydate, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":176 + * return gmtime(dt) + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[int64_t, ndim=1] result + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_13array_to_timestamp, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_to_timestamp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":188 + * return result + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[object, ndim=1] result + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_15time64_to_datetime, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time64_to_datetime, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":206 + * # isnull / notnull related + * + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_3lib_INF = ((double)__pyx_t_4); + + /* "pandas/lib.pyx":207 + * + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * + * cpdef checknull(object val): + */ + __pyx_v_6pandas_3lib_NEGINF = (-__pyx_v_6pandas_3lib_INF); + + /* "pandas/lib.pyx":237 + * return util._checknull(val) + * + * def isscalar(object val): # <<<<<<<<<<<<<< + * return np.isscalar(val) or val is None or PyDateTime_Check(val) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_21isscalar, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isscalar, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":243 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_23isnullobj, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":257 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_25isnullobj_old, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj_old, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":271 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_27isnullobj2d, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj2d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":287 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_29isnullobj_old, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj_old, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d_old(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_31isnullobj2d_old, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj2d_old, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":315 + * return result.view(np.bool_) + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_33list_to_object_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_to_object_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":335 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_35fast_unique, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_unique, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":356 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple(list arrays): # <<<<<<<<<<<<<< + * cdef: + * ndarray[object] buf + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_37fast_unique_multiple, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_unique_multiple, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":382 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list(list lists): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_39fast_unique_multiple_list, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_unique_multiple_list, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":408 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list_gen(object gen): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_41fast_unique_multiple_list_gen, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_unique_multiple_list_gen, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":433 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def dicts_to_array(list dicts, list columns): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_43dicts_to_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dicts_to_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":456 + * return result + * + * def fast_zip(list ndarrays): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_45fast_zip, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_zip, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":497 + * return result + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): # <<<<<<<<<<<<<< + * """ + * Reverse indexing operation. + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_47get_reverse_indexer, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reverse_indexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":524 + * + * + * def has_infs_f4(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_49has_infs_f4, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_infs_f4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":538 + * return False + * + * def has_infs_f8(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_51has_infs_f8, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_infs_f8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":552 + * return False + * + * def convert_timestamps(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * object val, f, result + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_53convert_timestamps, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_timestamps, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":575 + * return out + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indices) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_55maybe_indices_to_slice, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_indices_to_slice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":588 + * + * + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(mask) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_57maybe_booleans_to_slice, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_booleans_to_slice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":619 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_59scalar_compare, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_scalar_compare, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":663 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_61vec_compare, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_vec_compare, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":715 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_binop(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_63scalar_binop, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_scalar_binop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":737 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_65vec_binop, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_vec_binop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":764 + * + * + * def astype_intsafe(ndarray[object] arr, new_dtype): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_67astype_intsafe, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_astype_intsafe, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":794 + * return result + * + * def clean_index_list(list obj): # <<<<<<<<<<<<<< + * ''' + * Utility used in pandas.core.index._ensure_index + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_71clean_index_list, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean_index_list, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":825 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def max_len_string_array(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * """ return the maximum size of elements in a 1-dim string array """ + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_73max_len_string_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_max_len_string_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":845 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def string_array_replace_from_nan_rep(ndarray[object, ndim=1] arr, object nan_rep, object replace = None): # <<<<<<<<<<<<<< + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_75string_array_replace_from_nan_rep, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_array_replace_from_nan_re, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":860 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def write_csv_rows(list data, list data_index, int nlevels, list cols, object writer): # <<<<<<<<<<<<<< + * + * cdef int N, j, i, ncols + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_77write_csv_rows, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_write_csv_rows, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":908 + * + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef int length = index.shape[0] + * cdef int i = 0 + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_79arrmap, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":921 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_81is_lexsorted, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_lexsorted, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":960 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner, # <<<<<<<<<<<<<< + * object closed='left', bint hasnans=0): + * """ + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_83generate_bins_dt64, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_generate_bins_dt64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1025 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_85row_bool_subset, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_row_bool_subset, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1046 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_87row_bool_subset_object, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_row_bool_subset_object, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1066 + * + * + * def group_count(ndarray[int64_t] values, Py_ssize_t size): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_89group_count, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1076 + * return counts + * + * def lookup_values(ndarray[object] values, dict mapping): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_91lookup_values, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookup_values, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1086 + * + * + * def count_level_1d(ndarray[uint8_t, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_93count_level_1d, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_count_level_1d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1103 + * + * + * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_95count_level_2d, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_count_level_2d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1132 + * return 0 + * + * pandas_null = _PandasNull() # <<<<<<<<<<<<<< + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pandas_null, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1134 + * pandas_null = _PandasNull() + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pandas_null); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_k__10 = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_97fast_zip_fillna, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_zip_fillna, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1181 + * return result + * + * def duplicated(ndarray[object] values, take_last=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_99duplicated, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_duplicated, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1210 + * return result.view(np.bool_) + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, group_size, n, lab, start + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_101generate_slices, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_generate_slices, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1235 + * + * + * def indices_fast(object index, ndarray[int64_t] labels, list keys, # <<<<<<<<<<<<<< + * list sorted_labels): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_103indices_fast, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_indices_fast, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_105get_blkno_indexers, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_blkno_indexers, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1443 + * + * + * cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX): # <<<<<<<<<<<<<< + * """ + * Get (start, stop, step, length) tuple for a slice. + */ + __pyx_k__17 = PY_SSIZE_T_MAX; + + /* "pandas/lib.pyx":1462 + * + * + * cpdef Py_ssize_t slice_len(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX) except -1: # <<<<<<<<<<<<<< + * """ + * Get length of a bounded slice. + */ + __pyx_k__19 = PY_SSIZE_T_MAX; + + /* "pandas/lib.pyx":1486 + * + * + * def slice_getitem(slice slc not None, ind): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s_start, s_stop, s_step, s_len + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_116slice_getitem, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_slice_getitem, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1575 + * + * @property + * def as_slice(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is None: + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement, __pyx_n_s_as_slice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/lib.pyx":1574 + * return iter(self._as_array) + * + * @property # <<<<<<<<<<<<<< + * def as_slice(self): + * cdef slice s = self._ensure_has_slice() + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement->tp_dict, __pyx_n_s_as_slice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6pandas_3lib_BlockPlacement); + + /* "pandas/lib.pyx":1583 + * + * @property + * def indexer(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement, __pyx_n_s_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/lib.pyx":1582 + * return s + * + * @property # <<<<<<<<<<<<<< + * def indexer(self): + * cdef slice s = self._ensure_has_slice() + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement->tp_dict, __pyx_n_s_indexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6pandas_3lib_BlockPlacement); + + /* "pandas/lib.pyx":1595 + * + * @property + * def as_array(self): # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement, __pyx_n_s_as_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/lib.pyx":1594 + * return Int64Index(self.as_array, copy=False).isin(arr) + * + * @property # <<<<<<<<<<<<<< + * def as_array(self): + * cdef Py_ssize_t start, stop, end, _ + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement->tp_dict, __pyx_n_s_as_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6pandas_3lib_BlockPlacement); + + /* "pandas/lib.pyx":1605 + * + * @property + * def is_slice_like(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * return s is not None + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement, __pyx_n_s_is_slice_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/lib.pyx":1604 + * return self._as_array + * + * @property # <<<<<<<<<<<<<< + * def is_slice_like(self): + * cdef slice s = self._ensure_has_slice() + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement->tp_dict, __pyx_n_s_is_slice_like, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6pandas_3lib_BlockPlacement); + + /* "pandas/src/reduce.pyx":3 + * #cython=False + * from numpy cimport * + * import numpy as np # <<<<<<<<<<<<<< + * + * from distutils.version import LooseVersion + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":5 + * import numpy as np + * + * from distutils.version import LooseVersion # <<<<<<<<<<<<<< + * + * is_numpy_prior_1_6_2 = LooseVersion(np.__version__) < '1.6.2' + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_LooseVersion); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_LooseVersion); + __Pyx_GIVEREF(__pyx_n_s_LooseVersion); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_distutils_version, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LooseVersion, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":7 + * from distutils.version import LooseVersion + * + * is_numpy_prior_1_6_2 = LooseVersion(np.__version__) < '1.6.2' # <<<<<<<<<<<<<< + * + * cdef class Reducer: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_kp_s_1_6_2, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_numpy_prior_1_6_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":471 + * + * + * class InvalidApply(Exception): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_Exception); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception); + __Pyx_GIVEREF(__pyx_builtin_Exception); + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_n_s_InvalidApply, __pyx_n_s_InvalidApply, (PyObject *) NULL, __pyx_n_s_pandas_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_InvalidApply, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidApply, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":474 + * pass + * + * def apply_frame_axis0(object frame, object f, object names, # <<<<<<<<<<<<<< + * ndarray[int64_t] starts, ndarray[int64_t] ends): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_118apply_frame_axis0, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_frame_axis0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":591 + * + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): # <<<<<<<<<<<<<< + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_120reduce, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":2 + * cimport util + * from tslib import NaT # <<<<<<<<<<<<<< + * from datetime import datetime, timedelta + * iNaT = util.get_nat() + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_NaT); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_NaT); + __Pyx_GIVEREF(__pyx_n_s_NaT); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_tslib, __pyx_t_2, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_NaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":3 + * cimport util + * from tslib import NaT + * from datetime import datetime, timedelta # <<<<<<<<<<<<<< + * iNaT = util.get_nat() + * + */ + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __Pyx_INCREF(__pyx_n_s_timedelta); + PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_timedelta); + __Pyx_GIVEREF(__pyx_n_s_timedelta); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_5, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":4 + * from tslib import NaT + * from datetime import datetime, timedelta + * iNaT = util.get_nat() # <<<<<<<<<<<<<< + * + * # core.common import for fast inference checks + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(get_nat()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_iNaT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":7 + * + * # core.common import for fast inference checks + * def is_float(object obj): # <<<<<<<<<<<<<< + * return util.is_float_object(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_122is_float, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_float, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":10 + * return util.is_float_object(obj) + * + * def is_integer(object obj): # <<<<<<<<<<<<<< + * return util.is_integer_object(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_124is_integer, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":13 + * return util.is_integer_object(obj) + * + * def is_bool(object obj): # <<<<<<<<<<<<<< + * return util.is_bool_object(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_126is_bool, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_bool, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":16 + * return util.is_bool_object(obj) + * + * def is_complex(object obj): # <<<<<<<<<<<<<< + * return util.is_complex_object(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_128is_complex, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_complex, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":19 + * return util.is_complex_object(obj) + * + * _TYPE_MAP = { # <<<<<<<<<<<<<< + * 'int8': 'integer', + * 'int16': 'integer', + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_u, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float32, __pyx_n_s_floating) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float64, __pyx_n_s_floating) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_f, __pyx_n_s_floating) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_complex128, __pyx_n_s_complex) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_c, __pyx_n_s_complex) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_string, __pyx_n_s_string) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_S, __pyx_n_s_string) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_unicode, __pyx_n_s_unicode) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_U, __pyx_n_s_unicode) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bool_2, __pyx_n_s_boolean) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_b, __pyx_n_s_boolean) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_datetime64_ns, __pyx_n_s_datetime64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_M, __pyx_n_s_datetime64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_timedelta64_ns, __pyx_n_s_timedelta64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_m, __pyx_n_s_timedelta64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPE_MAP, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":48 + * + * # types only exist on certain platform + * try: # <<<<<<<<<<<<<< + * np.float128 + * _TYPE_MAP['float128'] = 'floating' + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/src/inference.pyx":49 + * # types only exist on certain platform + * try: + * np.float128 # <<<<<<<<<<<<<< + * _TYPE_MAP['float128'] = 'floating' + * except AttributeError: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float128); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":50 + * try: + * np.float128 + * _TYPE_MAP['float128'] = 'floating' # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_float128, __pyx_n_s_floating) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":51 + * np.float128 + * _TYPE_MAP['float128'] = 'floating' + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * try: + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L9_try_end:; + } + + /* "pandas/src/inference.pyx":53 + * except AttributeError: + * pass + * try: # <<<<<<<<<<<<<< + * np.complex256 + * _TYPE_MAP['complex256'] = 'complex' + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/src/inference.pyx":54 + * pass + * try: + * np.complex256 # <<<<<<<<<<<<<< + * _TYPE_MAP['complex256'] = 'complex' + * except AttributeError: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex256); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":55 + * try: + * np.complex256 + * _TYPE_MAP['complex256'] = 'complex' # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_complex256, __pyx_n_s_complex) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L17_try_end; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":56 + * np.complex256 + * _TYPE_MAP['complex256'] = 'complex' + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * try: + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L11_exception_handled; + } + goto __pyx_L12_except_error; + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L11_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); + __pyx_L17_try_end:; + } + + /* "pandas/src/inference.pyx":58 + * except AttributeError: + * pass + * try: # <<<<<<<<<<<<<< + * np.float16 + * _TYPE_MAP['float16'] = 'floating' + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/src/inference.pyx":59 + * pass + * try: + * np.float16 # <<<<<<<<<<<<<< + * _TYPE_MAP['float16'] = 'floating' + * except AttributeError: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":60 + * try: + * np.float16 + * _TYPE_MAP['float16'] = 'floating' # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_float16, __pyx_n_s_floating) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":61 + * np.float16 + * _TYPE_MAP['float16'] = 'floating' + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L19_exception_handled; + } + goto __pyx_L20_except_error; + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L25_try_end:; + } + + /* "pandas/src/inference.pyx":64 + * pass + * + * def infer_dtype(object _values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_130infer_dtype, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_infer_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":169 + * return 'mixed' + * + * def infer_dtype_list(list values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_132infer_dtype_list, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_infer_dtype_list, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":175 + * + * + * def is_possible_datetimelike_array(object arr): # <<<<<<<<<<<<<< + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_134is_possible_datetimelike_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_possible_datetimelike_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":222 + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + * def is_bool_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_136is_bool_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_bool_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":243 + * return False + * + * def is_integer(object o): # <<<<<<<<<<<<<< + * return util.is_integer_object(o) + * + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_138is_integer, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":246 + * return util.is_integer_object(o) + * + * def is_integer_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_140is_integer_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":267 + * return False + * + * def is_integer_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_142is_integer_float_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer_float_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":290 + * return False + * + * def is_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_144is_float_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_float_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":311 + * return False + * + * def is_string_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_146is_string_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_string_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":332 + * return False + * + * def is_unicode_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_148is_unicode_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_unicode_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":354 + * + * + * def is_datetime_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_150is_datetime_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_datetime_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":371 + * return null_count != n + * + * def is_datetime64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_152is_datetime64_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_datetime64_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":388 + * return null_count != n + * + * def is_timedelta_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_154is_timedelta_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_timedelta_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":403 + * return null_count != n + * + * def is_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_156is_timedelta64_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_timedelta64_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":418 + * return null_count != n + * + * def is_timedelta_or_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_158is_timedelta_or_timedelta64_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_timedelta_or_timedelta64_arra, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":434 + * return null_count != n + * + * def is_date_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_160is_date_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_date_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":443 + * return True + * + * def is_time_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_162is_time_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_time_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":452 + * return True + * + * def is_period(object o): # <<<<<<<<<<<<<< + * from pandas import Period + * return isinstance(o,Period) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_164is_period, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_period, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":456 + * return isinstance(o,Period) + * + * def is_period_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * from pandas.tseries.period import Period + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_166is_period_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_period_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":471 + * inline int floatify(object, double *result) except -1 + * + * cdef double fINT64_MAX = INT64_MAX # <<<<<<<<<<<<<< + * cdef double fINT64_MIN = INT64_MIN + * + */ + __pyx_v_6pandas_3lib_fINT64_MAX = ((double)INT64_MAX); + + /* "pandas/src/inference.pyx":472 + * + * cdef double fINT64_MAX = INT64_MAX + * cdef double fINT64_MIN = INT64_MIN # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6pandas_3lib_fINT64_MIN = ((double)INT64_MIN); + + /* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_168maybe_convert_numeric, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_convert_numeric, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":556 + * + * + * def maybe_convert_objects(ndarray[object] objects, bint try_float=0, # <<<<<<<<<<<<<< + * bint safe=0, bint convert_datetime=0, + * bint convert_timedelta=0): + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_170maybe_convert_objects, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_convert_objects, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":722 + * + * + * def convert_sql_column(x): # <<<<<<<<<<<<<< + * return maybe_convert_objects(x, try_float=1) + * + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_172convert_sql_column, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_sql_column, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_174try_parse_dates, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_parse_dates, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_176try_parse_date_and_time, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_parse_date_and_time, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":827 + * + * + * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months, # <<<<<<<<<<<<<< + * ndarray[object] days): + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_178try_parse_year_month_day, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_parse_year_month_day, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":845 + * return result + * + * def try_parse_datetime_components(ndarray[object] years, # <<<<<<<<<<<<<< + * ndarray[object] months, + * ndarray[object] days, + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_180try_parse_datetime_components, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_parse_datetime_components, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_182sanitize_objects, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sanitize_objects, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_184maybe_convert_bool, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_convert_bool, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":953 + * + * + * def map_infer_mask(ndarray arr, object f, ndarray[uint8_t] mask, # <<<<<<<<<<<<<< + * bint convert=1): + * ''' + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_186map_infer_mask, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_map_infer_mask, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":995 + * return result + * + * def map_infer(ndarray arr, object f, bint convert=1): # <<<<<<<<<<<<<< + * ''' + * Substitute for np.vectorize with pandas-friendly dtype inference + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_188map_infer, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_map_infer, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1034 + * + * + * def to_object_array(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_190to_object_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_object_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1058 + * return result + * + * def tuples_to_object_array(ndarray[object] tuples): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_192tuples_to_object_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tuples_to_object_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1074 + * return result + * + * def to_object_array_tuples(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_194to_object_array_tuples, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_object_array_tuples, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1105 + * + * + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(keys) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_k__57 = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_196fast_multiget, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_multiget, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1 + * cimport numpy as np # <<<<<<<<<<<<<< + * cimport cython + * import numpy as np + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":203 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":276 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__254, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":277 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__255, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":278 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__256, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":281 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__257, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":282 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__258, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":496 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":953 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.lib", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.lib"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (!buf) { + PyErr_SetString(PyExc_ValueError, + "buf is NULL."); + goto fail; + } else if (memviewslice->memview || memviewslice->data) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; + va_start(vargs, fmt); +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; /* allow uninitialized memoryview assignment */ + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +static CYTHON_INLINE int __Pyx_mod_int(int a, int b) { + int r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_ass_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_ass_slice(obj, cstart, cstop, value); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_ass_subscript)) +#endif + { + int result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_ass_subscript(obj, py_slice, value); +#else + result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object does not support slice %.10s", + Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); +bad: + return -1; +} + +static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { + long r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { + Py_ssize_t start = *_start, stop = *_stop, length = *_length; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + else if (stop > length) + stop = length; + *_length = stop - start; + *_start = start; + *_stop = stop; +} +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + PyObject* dest; + Py_ssize_t length = PyList_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (unlikely(length <= 0)) + return PyList_New(0); + dest = PyList_New(length); + if (unlikely(!dest)) + return NULL; + __Pyx_copy_object_array( + ((PyListObject*)src)->ob_item + start, + ((PyListObject*)dest)->ob_item, + length); + return dest; +} +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + PyObject* dest; + Py_ssize_t length = PyTuple_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (unlikely(length <= 0)) + return PyTuple_New(0); + dest = PyTuple_New(length); + if (unlikely(!dest)) + return NULL; + __Pyx_copy_object_array( + ((PyTupleObject*)src)->ob_item + start, + ((PyTupleObject*)dest)->ob_item, + length); + return dest; +} +#endif + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} + +static double __Pyx__PyObject_AsDouble(PyObject* obj) { + PyObject* float_value; +#if CYTHON_COMPILING_IN_PYPY + float_value = PyNumber_Float(obj); +#else + PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; + if (likely(nb) && likely(nb->nb_float)) { + float_value = nb->nb_float(obj); + if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { + PyErr_Format(PyExc_TypeError, + "__float__ returned non-float (type %.200s)", + Py_TYPE(float_value)->tp_name); + Py_DECREF(float_value); + goto bad; + } + } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { +#if PY_MAJOR_VERSION >= 3 + float_value = PyFloat_FromString(obj); +#else + float_value = PyFloat_FromString(obj, 0); +#endif + } else { + PyObject* args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + PyTuple_SET_ITEM(args, 0, obj); + float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); + PyTuple_SET_ITEM(args, 0, 0); + Py_DECREF(args); + } +#endif + if (likely(float_value)) { + double value = PyFloat_AS_DOUBLE(float_value); + Py_DECREF(float_value); + return value; + } +bad: + return (double)-1; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + length = strlen(cstring); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) + result = __Pyx_GetModuleGlobalName(name); + return result; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc_2, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (buf->strides[dim] != sizeof(void *)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (buf->strides[dim] != buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (stride < buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (spec & (__Pyx_MEMVIEW_PTR)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (buf->suboffsets) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (buf->suboffsets && buf->suboffsets[dim] >= 0) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) + { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (buf->ndim != ndim) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned) buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (!__pyx_check_strides(buf, i, ndim, spec)) + goto fail; + if (!__pyx_check_suboffsets(buf, i, ndim, spec)) + goto fail; + } + if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_object(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_object, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj); + if ((value == (npy_float64)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_float64_t *) itemp = value; + return 1; +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + return (npy_uint8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong) + } else if (sizeof(npy_uint8) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint8 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint8) -1; + } + } else { + npy_uint8 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(Py_intptr_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(Py_intptr_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_object(const char *itemp) { + PyObject *result = *(PyObject **) itemp; + Py_INCREF(result); + return result; +} +static int __pyx_memview_set_object(const char *itemp, PyObject *obj) { + Py_INCREF(obj); + Py_DECREF(*(PyObject **) itemp); + *(PyObject **) itemp = obj; + return 1; +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) { + Py_complex cval; +#if CYTHON_COMPILING_IN_CPYTHON + if (PyComplex_CheckExact(o)) + cval = ((PyComplexObject *)o)->cval; + else +#endif + cval = PyComplex_AsCComplex(o); + return __pyx_t_double_complex_from_parts( + (double)cval.real, + (double)cval.imag); +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs->memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize) + return 0; + itemsize *= mvs->shape[index]; + } + return 1; +} + +static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0) + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(char) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(char) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong) + } else if (sizeof(char) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(char, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__Pyx_Generator_Next(PyObject *self); +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Generator_Close(PyObject *self); +static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args); +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (unlikely(et != PyExc_StopIteration) && + unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + if (likely(et == PyExc_StopIteration)) { + if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + ev = Py_None; + } + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = ev; + return 0; + } + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PyObject_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +#endif +static CYTHON_INLINE +void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) { + PyObject *exc_type = self->exc_type; + PyObject *exc_value = self->exc_value; + PyObject *exc_traceback = self->exc_traceback; + self->exc_type = NULL; + self->exc_value = NULL; + self->exc_traceback = NULL; + Py_XDECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_traceback); +} +static CYTHON_INLINE +int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) { + if (unlikely(gen->is_running)) { + PyErr_SetString(PyExc_ValueError, + "generator already executing"); + return 1; + } + return 0; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + PyErr_SetString(PyExc_TypeError, + "can't send non-None value to a " + "just-started generator"); + return NULL; + } + } + if (unlikely(self->resume_label == -1)) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } + if (value) { +#if CYTHON_COMPILING_IN_PYPY +#else + /* Generators always return to their most recent caller, not + * necessarily their creator. */ + if (self->exc_traceback) { + PyThreadState *tstate = PyThreadState_GET(); + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(tstate->frame); + assert(f->f_back == NULL); + f->f_back = tstate->frame; + } +#endif + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); + } else { + __Pyx_Generator_ExceptionClear(self); + } + self->is_running = 1; + retval = self->body((PyObject *) self, value); + self->is_running = 0; + if (retval) { + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); +#if CYTHON_COMPILING_IN_PYPY +#else + /* Don't keep the reference to f_back any longer than necessary. It + * may keep a chain of frames alive or it could create a reference + * cycle. */ + if (self->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + } +#endif + } else { + __Pyx_Generator_ExceptionClear(self); + } + return retval; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Generator_Undelegate(gen); + __Pyx_PyGen_FetchStopIterationValue(&val); + ret = __Pyx_Generator_SendEx(gen, val); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, Py_None); +} +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Send(yf, value); + } else { + if (value == Py_None) + ret = PyIter_Next(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, value); +} +static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Generator_Close(yf); + if (!retval) + return -1; + } else { + PyObject *meth; + gen->is_running = 1; + meth = PyObject_GetAttr(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Close(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + Py_INCREF(yf); + err = __Pyx_Generator_CloseIter(gen, yf); + __Pyx_Generator_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) +#if PY_VERSION_HEX < 0x02050000 + PyErr_SetNone(PyExc_StopIteration); +#else + PyErr_SetNone(PyExc_GeneratorExit); +#endif + retval = __Pyx_Generator_SendEx(gen, NULL); + if (retval) { + Py_DECREF(retval); + PyErr_SetString(PyExc_RuntimeError, + "generator ignored GeneratorExit"); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (!raised_exception + || raised_exception == PyExc_StopIteration +#if PY_VERSION_HEX >= 0x02050000 + || raised_exception == PyExc_GeneratorExit + || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) +#endif + || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) + { + if (raised_exception) PyErr_Clear(); /* ignore these errors */ + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *typ; + PyObject *tb = NULL; + PyObject *val = NULL; + PyObject *yf = gen->yieldfrom; + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) + return NULL; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + Py_INCREF(yf); +#if PY_VERSION_HEX >= 0x02050000 + if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { + int err = __Pyx_Generator_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Generator_Undelegate(gen); + if (err < 0) + return __Pyx_Generator_SendEx(gen, NULL); + goto throw_here; + } +#endif + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Throw(yf, args); + } else { + PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Generator_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + ret = PyObject_CallObject(meth, args); + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Generator_FinishDelegation(gen); + } + return ret; + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Generator_SendEx(gen, NULL); +} +static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + Py_VISIT(gen->exc_type); + Py_VISIT(gen->exc_value); + Py_VISIT(gen->exc_traceback); + return 0; +} +static int __Pyx_Generator_clear(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + Py_CLEAR(gen->exc_type); + Py_CLEAR(gen->exc_value); + Py_CLEAR(gen->exc_traceback); + return 0; +} +static void __Pyx_Generator_dealloc(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label > 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 + if (PyObject_CallFinalizerFromDealloc(self)) +#else + Py_TYPE(gen)->tp_del(self); + if (self->ob_refcnt > 0) +#endif + return; /* resurrected. :( */ + PyObject_GC_UnTrack(self); + } + __Pyx_Generator_clear(self); + PyObject_GC_Del(gen); +} +static void __Pyx_Generator_del(PyObject *self) { + PyObject *res; + PyObject *error_type, *error_value, *error_traceback; + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + if (gen->resume_label <= 0) + return ; +#if PY_VERSION_HEX < 0x030400a1 + assert(self->ob_refcnt == 0); + self->ob_refcnt = 1; +#endif + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); + res = __Pyx_Generator_Close(self); + if (res == NULL) + PyErr_WriteUnraisable(self); + else + Py_DECREF(res); + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if PY_VERSION_HEX < 0x030400a1 + /* Undo the temporary resurrection; can't use DECREF here, it would + * cause a recursive call. + */ + assert(self->ob_refcnt > 0); + if (--self->ob_refcnt == 0) + return; /* this is the normal path out */ + /* close() resurrected it! Make it look like the original Py_DECREF + * never happened. + */ + { + Py_ssize_t refcnt = self->ob_refcnt; + _Py_NewReference(self); + self->ob_refcnt = refcnt; + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(self->ob_type) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so + * we need to undo that. */ + _Py_DEC_REFTOTAL; +#endif + /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object + * chain, so no more to do there. + * If COUNT_ALLOCS, the original decref bumped tp_frees, and + * _Py_NewReference bumped tp_allocs: both of those need to be + * undone. + */ +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", +#if PY_VERSION_HEX >= 0x02060000 + T_BOOL, +#else + T_BYTE, +#endif + offsetof(__pyx_GeneratorObject, is_running), + READONLY, + NULL}, + {0, 0, 0, 0, 0} +}; +static PyMethodDef __pyx_Generator_methods[] = { + {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0}, + {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0}, + {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("generator"), /*tp_name*/ + sizeof(__pyx_GeneratorObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_Generator_traverse, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/ + __pyx_Generator_methods, /*tp_methods*/ + __pyx_Generator_memberlist, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_del*/ +#else + __Pyx_Generator_del, /*tp_del*/ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + __Pyx_Generator_del, /*tp_finalize*/ +#endif +}; +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure) { + __pyx_GeneratorObject *gen = + PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type); + if (gen == NULL) + return NULL; + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + gen->exc_type = NULL; + gen->exc_value = NULL; + gen->exc_traceback = NULL; + gen->gi_weakreflist = NULL; + PyObject_GC_Track(gen); + return gen; +} +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (__pyx_GeneratorType == NULL) { + return -1; + } + return 0; +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3 && PY_MINOR_VERSION==0) + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files/pandas/msgpack.cpp b/cythonized-files/pandas/msgpack.cpp new file mode 100644 index 00000000..096124c6 --- /dev/null +++ b/cythonized-files/pandas/msgpack.cpp @@ -0,0 +1,14209 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__msgpack +#define __PYX_HAVE_API__pandas__msgpack +#include "string.h" +#include "stdio.h" +#include "pythread.h" +#include "stdlib.h" +#include "limits.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "msgpack/unpack.h" +#include "msgpack/pack.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "msgpack.pyx", + "numpy.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_7msgpack_Packer; +struct __pyx_obj_6pandas_7msgpack_Unpacker; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack; +struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack; + +/* "pandas/msgpack.pyx":163 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<< + * cdef long long llval + * cdef unsigned long long ullval + */ +struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack { + int __pyx_n; + int nest_limit; +}; + +/* "pandas/msgpack.pyx":585 + * self.file_like = None + * + * cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<< + * cdef int ret + * cdef object obj + */ +struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack { + int __pyx_n; + int iter; +}; + +/* "pandas/msgpack.pyx":99 + * + * + * cdef class Packer(object): # <<<<<<<<<<<<<< + * """MessagePack Packer + * + */ +struct __pyx_obj_6pandas_7msgpack_Packer { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_7msgpack_Packer *__pyx_vtab; + struct msgpack_packer pk; + PyObject *_default; + PyObject *_bencoding; + PyObject *_berrors; + char *encoding; + char *unicode_errors; + PyBoolObject *use_float; + int autoreset; +}; + + +/* "pandas/msgpack.pyx":421 + * + * + * cdef class Unpacker(object): # <<<<<<<<<<<<<< + * """ + * Streaming unpacker. + */ +struct __pyx_obj_6pandas_7msgpack_Unpacker { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *__pyx_vtab; + template_context ctx; + char *buf; + size_t buf_size; + size_t buf_head; + size_t buf_tail; + PyObject *file_like; + PyObject *file_like_read; + Py_ssize_t read_size; + PyObject *object_hook; + PyObject *encoding; + PyObject *unicode_errors; + size_t max_buffer_size; +}; + + + +/* "pandas/msgpack.pyx":99 + * + * + * cdef class Packer(object): # <<<<<<<<<<<<<< + * """MessagePack Packer + * + */ + +struct __pyx_vtabstruct_6pandas_7msgpack_Packer { + int (*_pack)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack *__pyx_optional_args); + PyObject *(*pack)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*pack_pair)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, PyObject *, int); +}; +static struct __pyx_vtabstruct_6pandas_7msgpack_Packer *__pyx_vtabptr_6pandas_7msgpack_Packer; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_6Packer_pack_pair(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, PyObject *, int); + + +/* "pandas/msgpack.pyx":421 + * + * + * cdef class Unpacker(object): # <<<<<<<<<<<<<< + * """ + * Streaming unpacker. + */ + +struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker { + PyObject *(*append_buffer)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, void *, Py_ssize_t); + PyObject *(*read_from_file)(struct __pyx_obj_6pandas_7msgpack_Unpacker *); + PyObject *(*_unpack)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, execute_fn, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *__pyx_vtabptr_6pandas_7msgpack_Unpacker; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +#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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, + int is_tuple, int has_known_size, int decref_tuple); + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_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 { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +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(void); + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *); + +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'libc.limits' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'pandas.msgpack' */ +static PyTypeObject *__pyx_ptype_6pandas_7msgpack_Packer = 0; +static PyTypeObject *__pyx_ptype_6pandas_7msgpack_Unpacker = 0; +static int __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_init_ctx(template_context *, PyObject *, PyObject *, PyObject *, int, char *, char *); /*proto*/ +#define __Pyx_MODULE_NAME "pandas.msgpack" +int __pyx_module_is_main_pandas__msgpack = 0; + +/* Implementation of 'pandas.msgpack' */ +static PyObject *__pyx_builtin_IOError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_StopIteration; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unpacked, PyObject *__pyx_v_extra); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData_2__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7msgpack_6Packer___cinit__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7msgpack_6Packer_2__init__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float, int __pyx_v_autoreset); /* proto */ +static void __pyx_pf_6pandas_7msgpack_6Packer_4__dealloc__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_6pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_8pack_array_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_10pack_map_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_12pack_map_pairs(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_14reset(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_16bytes(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_pack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_stream, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_2packb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_4unpackb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_packed, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6unpack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook); /* proto */ +static int __pyx_pf_6pandas_7msgpack_8Unpacker___cinit__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self); /* proto */ +static void __pyx_pf_6pandas_7msgpack_8Unpacker_2__dealloc__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7msgpack_8Unpacker_4__init__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_file_like, Py_ssize_t __pyx_v_read_size, int __pyx_v_use_list, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, int __pyx_v_max_buffer_size); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_6feed(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_next_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_8read_bytes(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_10unpack(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_12skip(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_14read_array_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_16read_map_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_18__iter__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_20__next__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_7msgpack_Packer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7msgpack_Unpacker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_o[] = "o"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_buf[] = "buf"; +static char __pyx_k_ctx[] = "ctx"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_off[] = "off"; +static char __pyx_k_ret[] = "ret"; +static char __pyx_k_str[] = "__str__"; +static char __pyx_k_cenc[] = "cenc"; +static char __pyx_k_cerr[] = "cerr"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_pack[] = "pack"; +static char __pyx_k_read[] = "read"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_ascii[] = "ascii"; +static char __pyx_k_extra[] = "extra"; +static char __pyx_k_items[] = "items"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_packb[] = "packb"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_utf_8[] = "utf-8"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_encode[] = "encode"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_packed[] = "packed"; +static char __pyx_k_packer[] = "packer"; +static char __pyx_k_stream[] = "stream"; +static char __pyx_k_strict[] = "strict"; +static char __pyx_k_unpack[] = "unpack"; +static char __pyx_k_IOError[] = "IOError"; +static char __pyx_k_buf_len[] = "buf_len"; +static char __pyx_k_default[] = "default"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_unpackb[] = "unpackb"; +static char __pyx_k_encoding[] = "encoding"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_unpacked[] = "unpacked"; +static char __pyx_k_use_list[] = "use_list"; +static char __pyx_k_ExtraData[] = "ExtraData"; +static char __pyx_k_OutOfData[] = "OutOfData"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_autoreset[] = "autoreset"; +static char __pyx_k_file_like[] = "file_like"; +static char __pyx_k_iteritems[] = "iteritems"; +static char __pyx_k_list_hook[] = "list_hook"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_read_size[] = "read_size"; +static char __pyx_k_BufferFull[] = "BufferFull"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MemoryError[] = "MemoryError"; +static char __pyx_k_object_hook[] = "object_hook"; +static char __pyx_k_write_bytes[] = "write_bytes"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_PackException[] = "PackException"; +static char __pyx_k_StopIteration[] = "StopIteration"; +static char __pyx_k_cannot_pack_s[] = "cannot pack : %s"; +static char __pyx_k_PackValueError[] = "PackValueError"; +static char __pyx_k_pandas_msgpack[] = "pandas.msgpack"; +static char __pyx_k_unicode_errors[] = "unicode_errors"; +static char __pyx_k_ExtraData___str[] = "ExtraData.__str__"; +static char __pyx_k_UnpackException[] = "UnpackException"; +static char __pyx_k_max_buffer_size[] = "max_buffer_size"; +static char __pyx_k_ExtraData___init[] = "ExtraData.__init__"; +static char __pyx_k_UnpackValueError[] = "UnpackValueError"; +static char __pyx_k_use_single_float[] = "use_single_float"; +static char __pyx_k_can_t_serialize_r[] = "can't serialize %r"; +static char __pyx_k_object_pairs_hook[] = "object_pairs_hook"; +static char __pyx_k_Unpack_failed_error_d[] = "Unpack failed: error = %d"; +static char __pyx_k_No_more_data_to_unpack[] = "No more data to unpack."; +static char __pyx_k_recursion_limit_exceeded[] = "recursion limit exceeded."; +static char __pyx_k_default_must_be_a_callable[] = "default must be a callable."; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_list_hook_must_be_a_callable[] = "list_hook must be a callable."; +static char __pyx_k_unpack_b_recieved_extra_data[] = "unpack(b) recieved extra data."; +static char __pyx_k_object_hook_must_be_a_callable[] = "object_hook must be a callable."; +static char __pyx_k_file_like_read_must_be_a_callab[] = "`file_like.read` must be a callable."; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/msgpack.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_unpacker_feed_is_not_be_able_to[] = "unpacker.feed() is not be able to use with `file_like`."; +static char __pyx_k_Can_t_encode_unicode_string_no_e[] = "Can't encode unicode string: no encoding is specified"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_Unable_to_allocate_internal_buff[] = "Unable to allocate internal buffer."; +static char __pyx_k_Unable_to_enlarge_internal_buffe[] = "Unable to enlarge internal buffer."; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_object_pairs_hook_and_object_hoo[] = "object_pairs_hook and object_hook are mutually exclusive."; +static char __pyx_k_object_pairs_hook_must_be_a_call[] = "object_pairs_hook must be a callable."; +static char __pyx_k_read_size_should_be_less_or_equa[] = "read_size should be less or equal to max_buffer_size"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_BufferFull; +static PyObject *__pyx_kp_s_Can_t_encode_unicode_string_no_e; +static PyObject *__pyx_n_s_ExtraData; +static PyObject *__pyx_n_s_ExtraData___init; +static PyObject *__pyx_n_s_ExtraData___str; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_IOError; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_No_more_data_to_unpack; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_OutOfData; +static PyObject *__pyx_n_s_PackException; +static PyObject *__pyx_n_s_PackValueError; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_allocate_internal_buff; +static PyObject *__pyx_kp_s_Unable_to_enlarge_internal_buffe; +static PyObject *__pyx_n_s_UnpackException; +static PyObject *__pyx_n_s_UnpackValueError; +static PyObject *__pyx_kp_s_Unpack_failed_error_d; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_ascii; +static PyObject *__pyx_n_s_autoreset; +static PyObject *__pyx_n_s_buf; +static PyObject *__pyx_n_s_buf_len; +static PyObject *__pyx_kp_s_can_t_serialize_r; +static PyObject *__pyx_kp_s_cannot_pack_s; +static PyObject *__pyx_n_s_cenc; +static PyObject *__pyx_n_s_cerr; +static PyObject *__pyx_n_s_ctx; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_kp_s_default_must_be_a_callable; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_encoding; +static PyObject *__pyx_n_s_extra; +static PyObject *__pyx_n_s_file_like; +static PyObject *__pyx_kp_s_file_like_read_must_be_a_callab; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_iteritems; +static PyObject *__pyx_n_s_list_hook; +static PyObject *__pyx_kp_s_list_hook_must_be_a_callable; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_max_buffer_size; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_o; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object_hook; +static PyObject *__pyx_kp_s_object_hook_must_be_a_callable; +static PyObject *__pyx_n_s_object_pairs_hook; +static PyObject *__pyx_kp_s_object_pairs_hook_and_object_hoo; +static PyObject *__pyx_kp_s_object_pairs_hook_must_be_a_call; +static PyObject *__pyx_n_s_off; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_packb; +static PyObject *__pyx_n_s_packed; +static PyObject *__pyx_n_s_packer; +static PyObject *__pyx_n_s_pandas_msgpack; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_read; +static PyObject *__pyx_n_s_read_size; +static PyObject *__pyx_kp_s_read_size_should_be_less_or_equa; +static PyObject *__pyx_kp_s_recursion_limit_exceeded; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_n_s_stream; +static PyObject *__pyx_n_s_strict; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_unicode_errors; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_kp_s_unpack_b_recieved_extra_data; +static PyObject *__pyx_n_s_unpackb; +static PyObject *__pyx_n_s_unpacked; +static PyObject *__pyx_kp_s_unpacker_feed_is_not_be_able_to; +static PyObject *__pyx_n_s_use_list; +static PyObject *__pyx_n_s_use_single_float; +static PyObject *__pyx_kp_s_utf_8; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_write_bytes; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_15; +static int __pyx_k__5; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; + +/* "pandas/msgpack.pyx":37 + * + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): # <<<<<<<<<<<<<< + * self.unpacked = unpacked + * self.extra = extra + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_9ExtraData___init__[] = "ExtraData.__init__(self, unpacked, extra)"; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_9ExtraData_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_9ExtraData___init__)}; +static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_unpacked = 0; + PyObject *__pyx_v_extra = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unpacked,&__pyx_n_s_extra,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unpacked)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extra)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_unpacked = values[1]; + __pyx_v_extra = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.ExtraData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_9ExtraData___init__(__pyx_self, __pyx_v_self, __pyx_v_unpacked, __pyx_v_extra); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unpacked, PyObject *__pyx_v_extra) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/msgpack.pyx":38 + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): + * self.unpacked = unpacked # <<<<<<<<<<<<<< + * self.extra = extra + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_unpacked, __pyx_v_unpacked) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":39 + * def __init__(self, unpacked, extra): + * self.unpacked = unpacked + * self.extra = extra # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extra, __pyx_v_extra) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":37 + * + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): # <<<<<<<<<<<<<< + * self.unpacked = unpacked + * self.extra = extra + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.msgpack.ExtraData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":41 + * self.extra = extra + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "unpack(b) recieved extra data." + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_9ExtraData_2__str__[] = "ExtraData.__str__(self)"; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_9ExtraData_3__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_9ExtraData_2__str__)}; +static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_9ExtraData_2__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData_2__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__", 0); + + /* "pandas/msgpack.pyx":42 + * + * def __str__(self): + * return "unpack(b) recieved extra data." # <<<<<<<<<<<<<< + * + * class PackException(IOError): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_unpack_b_recieved_extra_data); + __pyx_r = __pyx_kp_s_unpack_b_recieved_extra_data; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":41 + * self.extra = extra + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "unpack(b) recieved extra data." + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":127 + * cdef bint autoreset + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * cdef int buf_size = 1024*1024 + * self.pk.buf = malloc(buf_size); + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7msgpack_6Packer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7msgpack_6Packer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer___cinit__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7msgpack_6Packer___cinit__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { + int __pyx_v_buf_size; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/msgpack.pyx":128 + * + * def __cinit__(self): + * cdef int buf_size = 1024*1024 # <<<<<<<<<<<<<< + * self.pk.buf = malloc(buf_size); + * if self.pk.buf == NULL: + */ + __pyx_v_buf_size = 1048576; + + /* "pandas/msgpack.pyx":129 + * def __cinit__(self): + * cdef int buf_size = 1024*1024 + * self.pk.buf = malloc(buf_size); # <<<<<<<<<<<<<< + * if self.pk.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") + */ + __pyx_v_self->pk.buf = ((char *)malloc(__pyx_v_buf_size)); + + /* "pandas/msgpack.pyx":130 + * cdef int buf_size = 1024*1024 + * self.pk.buf = malloc(buf_size); + * if self.pk.buf == NULL: # <<<<<<<<<<<<<< + * raise MemoryError("Unable to allocate internal buffer.") + * self.pk.buf_size = buf_size + */ + __pyx_t_1 = ((__pyx_v_self->pk.buf == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":131 + * self.pk.buf = malloc(buf_size); + * if self.pk.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<< + * self.pk.buf_size = buf_size + * self.pk.length = 0 + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":132 + * if self.pk.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") + * self.pk.buf_size = buf_size # <<<<<<<<<<<<<< + * self.pk.length = 0 + * + */ + __pyx_v_self->pk.buf_size = __pyx_v_buf_size; + + /* "pandas/msgpack.pyx":133 + * raise MemoryError("Unable to allocate internal buffer.") + * self.pk.buf_size = buf_size + * self.pk.length = 0 # <<<<<<<<<<<<<< + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":127 + * cdef bint autoreset + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * cdef int buf_size = 1024*1024 + * self.pk.buf = malloc(buf_size); + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.msgpack.Packer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":135 + * self.pk.length = 0 + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<< + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7msgpack_6Packer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7msgpack_6Packer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_default = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + PyObject *__pyx_v_use_single_float = 0; + int __pyx_v_autoreset; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_use_single_float,&__pyx_n_s_autoreset,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_kp_s_utf_8); + values[2] = ((PyObject *)__pyx_n_s_strict); + + /* "pandas/msgpack.pyx":136 + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', + * use_single_float=False, bint autoreset=1): # <<<<<<<<<<<<<< + * self.use_float = use_single_float + * self.autoreset = autoreset + */ + values[3] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_single_float); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_autoreset); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_default = values[0]; + __pyx_v_encoding = values[1]; + __pyx_v_unicode_errors = values[2]; + __pyx_v_use_single_float = values[3]; + if (values[4]) { + __pyx_v_autoreset = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_autoreset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_autoreset = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Packer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_2__init__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_use_single_float, __pyx_v_autoreset); + + /* "pandas/msgpack.pyx":135 + * self.pk.length = 0 + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<< + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7msgpack_6Packer_2__init__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float, int __pyx_v_autoreset) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + char *__pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/msgpack.pyx":137 + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float # <<<<<<<<<<<<<< + * self.autoreset = autoreset + * if default is not None: + */ + if (!(likely(((__pyx_v_use_single_float) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_use_single_float, __pyx_ptype_7cpython_4bool_bool))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_use_single_float; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->use_float); + __Pyx_DECREF(((PyObject *)__pyx_v_self->use_float)); + __pyx_v_self->use_float = ((PyBoolObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":138 + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float + * self.autoreset = autoreset # <<<<<<<<<<<<<< + * if default is not None: + * if not PyCallable_Check(default): + */ + __pyx_v_self->autoreset = __pyx_v_autoreset; + + /* "pandas/msgpack.pyx":139 + * self.use_float = use_single_float + * self.autoreset = autoreset + * if default is not None: # <<<<<<<<<<<<<< + * if not PyCallable_Check(default): + * raise TypeError("default must be a callable.") + */ + __pyx_t_2 = (__pyx_v_default != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":140 + * self.autoreset = autoreset + * if default is not None: + * if not PyCallable_Check(default): # <<<<<<<<<<<<<< + * raise TypeError("default must be a callable.") + * self._default = default + */ + __pyx_t_3 = ((!(PyCallable_Check(__pyx_v_default) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":141 + * if default is not None: + * if not PyCallable_Check(default): + * raise TypeError("default must be a callable.") # <<<<<<<<<<<<<< + * self._default = default + * if encoding is None: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":142 + * if not PyCallable_Check(default): + * raise TypeError("default must be a callable.") + * self._default = default # <<<<<<<<<<<<<< + * if encoding is None: + * self.encoding = NULL + */ + __Pyx_INCREF(__pyx_v_default); + __Pyx_GIVEREF(__pyx_v_default); + __Pyx_GOTREF(__pyx_v_self->_default); + __Pyx_DECREF(__pyx_v_self->_default); + __pyx_v_self->_default = __pyx_v_default; + + /* "pandas/msgpack.pyx":143 + * raise TypeError("default must be a callable.") + * self._default = default + * if encoding is None: # <<<<<<<<<<<<<< + * self.encoding = NULL + * self.unicode_errors = NULL + */ + __pyx_t_3 = (__pyx_v_encoding == Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":144 + * self._default = default + * if encoding is None: + * self.encoding = NULL # <<<<<<<<<<<<<< + * self.unicode_errors = NULL + * else: + */ + __pyx_v_self->encoding = NULL; + + /* "pandas/msgpack.pyx":145 + * if encoding is None: + * self.encoding = NULL + * self.unicode_errors = NULL # <<<<<<<<<<<<<< + * else: + * if isinstance(encoding, unicode): + */ + __pyx_v_self->unicode_errors = NULL; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/msgpack.pyx":147 + * self.unicode_errors = NULL + * else: + * if isinstance(encoding, unicode): # <<<<<<<<<<<<<< + * self._bencoding = encoding.encode('ascii') + * else: + */ + __pyx_t_2 = PyUnicode_Check(__pyx_v_encoding); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":148 + * else: + * if isinstance(encoding, unicode): + * self._bencoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * else: + * self._bencoding = encoding + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_bencoding); + __Pyx_DECREF(__pyx_v_self->_bencoding); + __pyx_v_self->_bencoding = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/msgpack.pyx":150 + * self._bencoding = encoding.encode('ascii') + * else: + * self._bencoding = encoding # <<<<<<<<<<<<<< + * self.encoding = PyBytes_AsString(self._bencoding) + * if isinstance(unicode_errors, unicode): + */ + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_GIVEREF(__pyx_v_encoding); + __Pyx_GOTREF(__pyx_v_self->_bencoding); + __Pyx_DECREF(__pyx_v_self->_bencoding); + __pyx_v_self->_bencoding = __pyx_v_encoding; + } + __pyx_L6:; + + /* "pandas/msgpack.pyx":151 + * else: + * self._bencoding = encoding + * self.encoding = PyBytes_AsString(self._bencoding) # <<<<<<<<<<<<<< + * if isinstance(unicode_errors, unicode): + * self._berrors = unicode_errors.encode('ascii') + */ + __pyx_t_4 = __pyx_v_self->_bencoding; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = PyBytes_AsString(__pyx_t_4); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_self->encoding = __pyx_t_5; + + /* "pandas/msgpack.pyx":152 + * self._bencoding = encoding + * self.encoding = PyBytes_AsString(self._bencoding) + * if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<< + * self._berrors = unicode_errors.encode('ascii') + * else: + */ + __pyx_t_3 = PyUnicode_Check(__pyx_v_unicode_errors); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":153 + * self.encoding = PyBytes_AsString(self._bencoding) + * if isinstance(unicode_errors, unicode): + * self._berrors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * else: + * self._berrors = unicode_errors + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_berrors); + __Pyx_DECREF(__pyx_v_self->_berrors); + __pyx_v_self->_berrors = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/msgpack.pyx":155 + * self._berrors = unicode_errors.encode('ascii') + * else: + * self._berrors = unicode_errors # <<<<<<<<<<<<<< + * self.unicode_errors = PyBytes_AsString(self._berrors) + * + */ + __Pyx_INCREF(__pyx_v_unicode_errors); + __Pyx_GIVEREF(__pyx_v_unicode_errors); + __Pyx_GOTREF(__pyx_v_self->_berrors); + __Pyx_DECREF(__pyx_v_self->_berrors); + __pyx_v_self->_berrors = __pyx_v_unicode_errors; + } + __pyx_L7:; + + /* "pandas/msgpack.pyx":156 + * else: + * self._berrors = unicode_errors + * self.unicode_errors = PyBytes_AsString(self._berrors) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_1 = __pyx_v_self->_berrors; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = PyBytes_AsString(__pyx_t_1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->unicode_errors = __pyx_t_5; + } + __pyx_L5:; + + /* "pandas/msgpack.pyx":135 + * self.pk.length = 0 + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<< + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.msgpack.Packer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":158 + * self.unicode_errors = PyBytes_AsString(self._berrors) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.pk.buf); + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_7msgpack_6Packer_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_7msgpack_6Packer_5__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_7msgpack_6Packer_4__dealloc__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_7msgpack_6Packer_4__dealloc__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/msgpack.pyx":159 + * + * def __dealloc__(self): + * free(self.pk.buf); # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + free(__pyx_v_self->pk.buf); + + /* "pandas/msgpack.pyx":158 + * self.unicode_errors = PyBytes_AsString(self._berrors) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.pk.buf); + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/msgpack.pyx":163 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<< + * cdef long long llval + * cdef unsigned long long ullval + */ + +static int __pyx_f_6pandas_7msgpack_6Packer__pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_o, struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack *__pyx_optional_args) { + int __pyx_v_nest_limit = __pyx_k__5; + PY_LONG_LONG __pyx_v_llval; + unsigned PY_LONG_LONG __pyx_v_ullval; + long __pyx_v_longval; + float __pyx_v_fval; + double __pyx_v_dval; + char *__pyx_v_rawval; + int __pyx_v_ret; + PyObject *__pyx_v_d = 0; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + unsigned PY_LONG_LONG __pyx_t_5; + PY_LONG_LONG __pyx_t_6; + long __pyx_t_7; + float __pyx_t_8; + double __pyx_t_9; + char *__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack __pyx_t_16; + PyObject *(*__pyx_t_17)(PyObject *); + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *(*__pyx_t_20)(PyObject *); + int __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pack", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_nest_limit = __pyx_optional_args->nest_limit; + } + } + __Pyx_INCREF(__pyx_v_o); + + /* "pandas/msgpack.pyx":176 + * cdef int n,i + * + * if nest_limit < 0: # <<<<<<<<<<<<<< + * raise PackValueError("recursion limit exceeded.") + * + */ + __pyx_t_1 = ((__pyx_v_nest_limit < 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":177 + * + * if nest_limit < 0: + * raise PackValueError("recursion limit exceeded.") # <<<<<<<<<<<<<< + * + * if o is None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackValueError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":179 + * raise PackValueError("recursion limit exceeded.") + * + * if o is None: # <<<<<<<<<<<<<< + * ret = msgpack_pack_nil(&self.pk) + * elif isinstance(o, bool): + */ + __pyx_t_1 = (__pyx_v_o == Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "pandas/msgpack.pyx":180 + * + * if o is None: + * ret = msgpack_pack_nil(&self.pk) # <<<<<<<<<<<<<< + * elif isinstance(o, bool): + * if o: + */ + __pyx_v_ret = msgpack_pack_nil((&__pyx_v_self->pk)); + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":181 + * if o is None: + * ret = msgpack_pack_nil(&self.pk) + * elif isinstance(o, bool): # <<<<<<<<<<<<<< + * if o: + * ret = msgpack_pack_true(&self.pk) + */ + __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject*)__pyx_ptype_7cpython_4bool_bool)); + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":182 + * ret = msgpack_pack_nil(&self.pk) + * elif isinstance(o, bool): + * if o: # <<<<<<<<<<<<<< + * ret = msgpack_pack_true(&self.pk) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_o); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":183 + * elif isinstance(o, bool): + * if o: + * ret = msgpack_pack_true(&self.pk) # <<<<<<<<<<<<<< + * else: + * ret = msgpack_pack_false(&self.pk) + */ + __pyx_v_ret = msgpack_pack_true((&__pyx_v_self->pk)); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/msgpack.pyx":185 + * ret = msgpack_pack_true(&self.pk) + * else: + * ret = msgpack_pack_false(&self.pk) # <<<<<<<<<<<<<< + * elif PyLong_Check(o): + * if o > 0: + */ + __pyx_v_ret = msgpack_pack_false((&__pyx_v_self->pk)); + } + __pyx_L5:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":186 + * else: + * ret = msgpack_pack_false(&self.pk) + * elif PyLong_Check(o): # <<<<<<<<<<<<<< + * if o > 0: + * ullval = o + */ + __pyx_t_1 = (PyLong_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":187 + * ret = msgpack_pack_false(&self.pk) + * elif PyLong_Check(o): + * if o > 0: # <<<<<<<<<<<<<< + * ullval = o + * ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_o, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":188 + * elif PyLong_Check(o): + * if o > 0: + * ullval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) + * else: + */ + __pyx_t_5 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_o); if (unlikely((__pyx_t_5 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ullval = __pyx_t_5; + + /* "pandas/msgpack.pyx":189 + * if o > 0: + * ullval = o + * ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) # <<<<<<<<<<<<<< + * else: + * llval = o + */ + __pyx_v_ret = msgpack_pack_unsigned_long_long((&__pyx_v_self->pk), __pyx_v_ullval); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/msgpack.pyx":191 + * ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) + * else: + * llval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_long_long(&self.pk, llval) + * elif PyInt_Check(o): + */ + __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_o); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_llval = __pyx_t_6; + + /* "pandas/msgpack.pyx":192 + * else: + * llval = o + * ret = msgpack_pack_long_long(&self.pk, llval) # <<<<<<<<<<<<<< + * elif PyInt_Check(o): + * longval = o + */ + __pyx_v_ret = msgpack_pack_long_long((&__pyx_v_self->pk), __pyx_v_llval); + } + __pyx_L6:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":193 + * llval = o + * ret = msgpack_pack_long_long(&self.pk, llval) + * elif PyInt_Check(o): # <<<<<<<<<<<<<< + * longval = o + * ret = msgpack_pack_long(&self.pk, longval) + */ + __pyx_t_1 = (PyInt_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":194 + * ret = msgpack_pack_long_long(&self.pk, llval) + * elif PyInt_Check(o): + * longval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_long(&self.pk, longval) + * elif PyFloat_Check(o): + */ + __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_v_o); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_longval = __pyx_t_7; + + /* "pandas/msgpack.pyx":195 + * elif PyInt_Check(o): + * longval = o + * ret = msgpack_pack_long(&self.pk, longval) # <<<<<<<<<<<<<< + * elif PyFloat_Check(o): + * if self.use_float: + */ + __pyx_v_ret = msgpack_pack_long((&__pyx_v_self->pk), __pyx_v_longval); + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":196 + * longval = o + * ret = msgpack_pack_long(&self.pk, longval) + * elif PyFloat_Check(o): # <<<<<<<<<<<<<< + * if self.use_float: + * fval = o + */ + __pyx_t_1 = (PyFloat_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":197 + * ret = msgpack_pack_long(&self.pk, longval) + * elif PyFloat_Check(o): + * if self.use_float: # <<<<<<<<<<<<<< + * fval = o + * ret = msgpack_pack_float(&self.pk, fval) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->use_float)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":198 + * elif PyFloat_Check(o): + * if self.use_float: + * fval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_float(&self.pk, fval) + * else: + */ + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_o); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fval = __pyx_t_8; + + /* "pandas/msgpack.pyx":199 + * if self.use_float: + * fval = o + * ret = msgpack_pack_float(&self.pk, fval) # <<<<<<<<<<<<<< + * else: + * dval = o + */ + __pyx_v_ret = msgpack_pack_float((&__pyx_v_self->pk), __pyx_v_fval); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/msgpack.pyx":201 + * ret = msgpack_pack_float(&self.pk, fval) + * else: + * dval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_double(&self.pk, dval) + * elif PyBytes_Check(o): + */ + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_o); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dval = __pyx_t_9; + + /* "pandas/msgpack.pyx":202 + * else: + * dval = o + * ret = msgpack_pack_double(&self.pk, dval) # <<<<<<<<<<<<<< + * elif PyBytes_Check(o): + * rawval = o + */ + __pyx_v_ret = msgpack_pack_double((&__pyx_v_self->pk), __pyx_v_dval); + } + __pyx_L7:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":203 + * dval = o + * ret = msgpack_pack_double(&self.pk, dval) + * elif PyBytes_Check(o): # <<<<<<<<<<<<<< + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) + */ + __pyx_t_1 = (PyBytes_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":204 + * ret = msgpack_pack_double(&self.pk, dval) + * elif PyBytes_Check(o): + * rawval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: + */ + __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_o); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_rawval = __pyx_t_10; + + /* "pandas/msgpack.pyx":205 + * elif PyBytes_Check(o): + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) # <<<<<<<<<<<<<< + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + */ + __pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_raw((&__pyx_v_self->pk), __pyx_t_11); + + /* "pandas/msgpack.pyx":206 + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: # <<<<<<<<<<<<<< + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyUnicode_Check(o): + */ + __pyx_t_1 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":207 + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) # <<<<<<<<<<<<<< + * elif PyUnicode_Check(o): + * if not self.encoding: + */ + __pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_raw_body((&__pyx_v_self->pk), __pyx_v_rawval, __pyx_t_11); + goto __pyx_L8; + } + __pyx_L8:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":208 + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyUnicode_Check(o): # <<<<<<<<<<<<<< + * if not self.encoding: + * raise TypeError("Can't encode unicode string: no encoding is specified") + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":209 + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyUnicode_Check(o): + * if not self.encoding: # <<<<<<<<<<<<<< + * raise TypeError("Can't encode unicode string: no encoding is specified") + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + */ + __pyx_t_1 = ((!(__pyx_v_self->encoding != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":210 + * elif PyUnicode_Check(o): + * if not self.encoding: + * raise TypeError("Can't encode unicode string: no encoding is specified") # <<<<<<<<<<<<<< + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + * rawval = o + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":211 + * if not self.encoding: + * raise TypeError("Can't encode unicode string: no encoding is specified") + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) # <<<<<<<<<<<<<< + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) + */ + __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_o, __pyx_v_self->encoding, __pyx_v_self->unicode_errors); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_o, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/msgpack.pyx":212 + * raise TypeError("Can't encode unicode string: no encoding is specified") + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + * rawval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: + */ + __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_o); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_rawval = __pyx_t_10; + + /* "pandas/msgpack.pyx":213 + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) # <<<<<<<<<<<<<< + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + */ + __pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_raw((&__pyx_v_self->pk), __pyx_t_11); + + /* "pandas/msgpack.pyx":214 + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: # <<<<<<<<<<<<<< + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyDict_CheckExact(o): + */ + __pyx_t_1 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":215 + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) # <<<<<<<<<<<<<< + * elif PyDict_CheckExact(o): + * d = o + */ + __pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_raw_body((&__pyx_v_self->pk), __pyx_v_rawval, __pyx_t_11); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":216 + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyDict_CheckExact(o): # <<<<<<<<<<<<<< + * d = o + * ret = msgpack_pack_map(&self.pk, len(d)) + */ + __pyx_t_1 = (PyDict_CheckExact(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":217 + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyDict_CheckExact(o): + * d = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_map(&self.pk, len(d)) + * if ret == 0: + */ + __pyx_t_3 = __pyx_v_o; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_d = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/msgpack.pyx":218 + * elif PyDict_CheckExact(o): + * d = o + * ret = msgpack_pack_map(&self.pk, len(d)) # <<<<<<<<<<<<<< + * if ret == 0: + * for k, v in d.iteritems(): + */ + if (unlikely(__pyx_v_d == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyDict_Size(__pyx_v_d); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_11); + + /* "pandas/msgpack.pyx":219 + * d = o + * ret = msgpack_pack_map(&self.pk, len(d)) + * if ret == 0: # <<<<<<<<<<<<<< + * for k, v in d.iteritems(): + * ret = self._pack(k, nest_limit-1) + */ + __pyx_t_1 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":220 + * ret = msgpack_pack_map(&self.pk, len(d)) + * if ret == 0: + * for k, v in d.iteritems(): # <<<<<<<<<<<<<< + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break + */ + __pyx_t_11 = 0; + if (unlikely(__pyx_v_d == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_d, 1, __pyx_n_s_iteritems, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_2; + __pyx_t_2 = 0; + while (1) { + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_12, &__pyx_t_11, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/msgpack.pyx":221 + * if ret == 0: + * for k, v in d.iteritems(): + * ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_15 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_16); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_15; + + /* "pandas/msgpack.pyx":222 + * for k, v in d.iteritems(): + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + goto __pyx_L13_break; + } + + /* "pandas/msgpack.pyx":223 + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * elif PyDict_Check(o): + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_15 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_15; + + /* "pandas/msgpack.pyx":224 + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * elif PyDict_Check(o): + * ret = msgpack_pack_map(&self.pk, len(o)) + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + goto __pyx_L13_break; + } + } + __pyx_L13_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":225 + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + * elif PyDict_Check(o): # <<<<<<<<<<<<<< + * ret = msgpack_pack_map(&self.pk, len(o)) + * if ret == 0: + */ + __pyx_t_1 = (PyDict_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":226 + * if ret != 0: break + * elif PyDict_Check(o): + * ret = msgpack_pack_map(&self.pk, len(o)) # <<<<<<<<<<<<<< + * if ret == 0: + * for k, v in o.items(): + */ + __pyx_t_12 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_12); + + /* "pandas/msgpack.pyx":227 + * elif PyDict_Check(o): + * ret = msgpack_pack_map(&self.pk, len(o)) + * if ret == 0: # <<<<<<<<<<<<<< + * for k, v in o.items(): + * ret = self._pack(k, nest_limit-1) + */ + __pyx_t_1 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":228 + * ret = msgpack_pack_map(&self.pk, len(o)) + * if ret == 0: + * for k, v in o.items(): # <<<<<<<<<<<<<< + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_14) || PyTuple_CheckExact(__pyx_t_14)) { + __pyx_t_3 = __pyx_t_14; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0; + __pyx_t_17 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + for (;;) { + if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_14 = __pyx_t_17(__pyx_t_3); + if (unlikely(!__pyx_t_14)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_14); + } + if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { + PyObject* sequence = __pyx_t_14; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_18 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_18); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + #endif + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_19 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_2)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_18); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L20_unpacking_done; + __pyx_L19_unpacking_failed:; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L20_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/msgpack.pyx":229 + * if ret == 0: + * for k, v in o.items(): + * ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_13; + + /* "pandas/msgpack.pyx":230 + * for k, v in o.items(): + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + goto __pyx_L18_break; + } + + /* "pandas/msgpack.pyx":231 + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * elif PyTuple_Check(o) or PyList_Check(o): + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_13; + + /* "pandas/msgpack.pyx":232 + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * elif PyTuple_Check(o) or PyList_Check(o): + * ret = msgpack_pack_array(&self.pk, len(o)) + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + goto __pyx_L18_break; + } + } + __pyx_L18_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L16; + } + __pyx_L16:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":233 + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + * elif PyTuple_Check(o) or PyList_Check(o): # <<<<<<<<<<<<<< + * ret = msgpack_pack_array(&self.pk, len(o)) + * if ret == 0: + */ + __pyx_t_1 = (PyTuple_Check(__pyx_v_o) != 0); + if (!__pyx_t_1) { + __pyx_t_4 = (PyList_Check(__pyx_v_o) != 0); + __pyx_t_21 = __pyx_t_4; + } else { + __pyx_t_21 = __pyx_t_1; + } + if (__pyx_t_21) { + + /* "pandas/msgpack.pyx":234 + * if ret != 0: break + * elif PyTuple_Check(o) or PyList_Check(o): + * ret = msgpack_pack_array(&self.pk, len(o)) # <<<<<<<<<<<<<< + * if ret == 0: + * for v in o: + */ + __pyx_t_12 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_array((&__pyx_v_self->pk), __pyx_t_12); + + /* "pandas/msgpack.pyx":235 + * elif PyTuple_Check(o) or PyList_Check(o): + * ret = msgpack_pack_array(&self.pk, len(o)) + * if ret == 0: # <<<<<<<<<<<<<< + * for v in o: + * ret = self._pack(v, nest_limit-1) + */ + __pyx_t_21 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_21) { + + /* "pandas/msgpack.pyx":236 + * ret = msgpack_pack_array(&self.pk, len(o)) + * if ret == 0: + * for v in o: # <<<<<<<<<<<<<< + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + */ + if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0; + __pyx_t_17 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_14 = __pyx_t_17(__pyx_t_3); + if (unlikely(!__pyx_t_14)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_14); + } + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/msgpack.pyx":237 + * if ret == 0: + * for v in o: + * ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_13; + + /* "pandas/msgpack.pyx":238 + * for v in o: + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * + * elif self._default: + */ + __pyx_t_21 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_21) { + goto __pyx_L25_break; + } + } + __pyx_L25_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L23; + } + __pyx_L23:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":240 + * if ret != 0: break + * + * elif self._default: # <<<<<<<<<<<<<< + * o = self._default(o) + * ret = self._pack(o, nest_limit-1) + */ + __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_v_self->_default); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_21) { + + /* "pandas/msgpack.pyx":241 + * + * elif self._default: + * o = self._default(o) # <<<<<<<<<<<<<< + * ret = self._pack(o, nest_limit-1) + * else: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_v_self->_default, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_o, __pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/msgpack.pyx":242 + * elif self._default: + * o = self._default(o) + * ret = self._pack(o, nest_limit-1) # <<<<<<<<<<<<<< + * else: + * raise TypeError("can't serialize %r" % (o,)) + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_o, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_13; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/msgpack.pyx":244 + * ret = self._pack(o, nest_limit-1) + * else: + * raise TypeError("can't serialize %r" % (o,)) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_can_t_serialize_r, __pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + + /* "pandas/msgpack.pyx":245 + * else: + * raise TypeError("can't serialize %r" % (o,)) + * return ret # <<<<<<<<<<<<<< + * + * cpdef pack(self, object obj): + */ + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":163 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<< + * cdef long long llval + * cdef unsigned long long ullval + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("pandas.msgpack.Packer._pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_o); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":247 + * return ret + * + * cpdef pack(self, object obj): # <<<<<<<<<<<<<< + * cdef int ret + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) + */ + +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ +static PyObject *__pyx_f_6pandas_7msgpack_6Packer_pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { + int __pyx_v_ret; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_7pack)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/msgpack.pyx":249 + * cpdef pack(self, object obj): + * cdef int ret + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) # <<<<<<<<<<<<<< + * if ret == -1: + * raise MemoryError + */ + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.nest_limit = __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT; + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_obj, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_4; + + /* "pandas/msgpack.pyx":250 + * cdef int ret + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) + * if ret == -1: # <<<<<<<<<<<<<< + * raise MemoryError + * elif ret: # should not happen. + */ + __pyx_t_6 = ((__pyx_v_ret == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":251 + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) + * if ret == -1: + * raise MemoryError # <<<<<<<<<<<<<< + * elif ret: # should not happen. + * raise TypeError + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":252 + * if ret == -1: + * raise MemoryError + * elif ret: # should not happen. # <<<<<<<<<<<<<< + * raise TypeError + * if self.autoreset: + */ + __pyx_t_6 = (__pyx_v_ret != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":253 + * raise MemoryError + * elif ret: # should not happen. + * raise TypeError # <<<<<<<<<<<<<< + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":254 + * elif ret: # should not happen. + * raise TypeError + * if self.autoreset: # <<<<<<<<<<<<<< + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + */ + __pyx_t_6 = (__pyx_v_self->autoreset != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":255 + * raise TypeError + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * self.pk.length = 0 + * return buf + */ + __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_buf = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":256 + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 # <<<<<<<<<<<<<< + * return buf + * + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":257 + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + * return buf # <<<<<<<<<<<<<< + * + * def pack_array_header(self, size_t size): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_buf); + __pyx_r = __pyx_v_buf; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":247 + * return ret + * + * cpdef pack(self, object obj): # <<<<<<<<<<<<<< + * cdef int ret + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_6pack[] = "Packer.pack(self, obj)"; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_6pack(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_6pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->pack(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":259 + * return buf + * + * def pack_array_header(self, size_t size): # <<<<<<<<<<<<<< + * cdef int ret = msgpack_pack_array(&self.pk, size) + * if ret == -1: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_9pack_array_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_8pack_array_header[] = "Packer.pack_array_header(self, size_t size)"; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_9pack_array_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size) { + size_t __pyx_v_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack_array_header (wrapper)", 0); + assert(__pyx_arg_size); { + __pyx_v_size = __Pyx_PyInt_As_size_t(__pyx_arg_size); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_8pack_array_header(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((size_t)__pyx_v_size)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_8pack_array_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size) { + int __pyx_v_ret; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack_array_header", 0); + + /* "pandas/msgpack.pyx":260 + * + * def pack_array_header(self, size_t size): + * cdef int ret = msgpack_pack_array(&self.pk, size) # <<<<<<<<<<<<<< + * if ret == -1: + * raise MemoryError + */ + __pyx_v_ret = msgpack_pack_array((&__pyx_v_self->pk), __pyx_v_size); + + /* "pandas/msgpack.pyx":261 + * def pack_array_header(self, size_t size): + * cdef int ret = msgpack_pack_array(&self.pk, size) + * if ret == -1: # <<<<<<<<<<<<<< + * raise MemoryError + * elif ret: # should not happen + */ + __pyx_t_1 = ((__pyx_v_ret == -1) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":262 + * cdef int ret = msgpack_pack_array(&self.pk, size) + * if ret == -1: + * raise MemoryError # <<<<<<<<<<<<<< + * elif ret: # should not happen + * raise TypeError + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":263 + * if ret == -1: + * raise MemoryError + * elif ret: # should not happen # <<<<<<<<<<<<<< + * raise TypeError + * if self.autoreset: + */ + __pyx_t_1 = (__pyx_v_ret != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":264 + * raise MemoryError + * elif ret: # should not happen + * raise TypeError # <<<<<<<<<<<<<< + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":265 + * elif ret: # should not happen + * raise TypeError + * if self.autoreset: # <<<<<<<<<<<<<< + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + */ + __pyx_t_1 = (__pyx_v_self->autoreset != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":266 + * raise TypeError + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * self.pk.length = 0 + * return buf + */ + __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_buf = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":267 + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 # <<<<<<<<<<<<<< + * return buf + * + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":268 + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + * return buf # <<<<<<<<<<<<<< + * + * def pack_map_header(self, size_t size): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_buf); + __pyx_r = __pyx_v_buf; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":259 + * return buf + * + * def pack_array_header(self, size_t size): # <<<<<<<<<<<<<< + * cdef int ret = msgpack_pack_array(&self.pk, size) + * if ret == -1: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":270 + * return buf + * + * def pack_map_header(self, size_t size): # <<<<<<<<<<<<<< + * cdef int ret = msgpack_pack_map(&self.pk, size) + * if ret == -1: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_11pack_map_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_10pack_map_header[] = "Packer.pack_map_header(self, size_t size)"; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_11pack_map_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size) { + size_t __pyx_v_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack_map_header (wrapper)", 0); + assert(__pyx_arg_size); { + __pyx_v_size = __Pyx_PyInt_As_size_t(__pyx_arg_size); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_10pack_map_header(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((size_t)__pyx_v_size)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_10pack_map_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size) { + int __pyx_v_ret; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack_map_header", 0); + + /* "pandas/msgpack.pyx":271 + * + * def pack_map_header(self, size_t size): + * cdef int ret = msgpack_pack_map(&self.pk, size) # <<<<<<<<<<<<<< + * if ret == -1: + * raise MemoryError + */ + __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_v_size); + + /* "pandas/msgpack.pyx":272 + * def pack_map_header(self, size_t size): + * cdef int ret = msgpack_pack_map(&self.pk, size) + * if ret == -1: # <<<<<<<<<<<<<< + * raise MemoryError + * elif ret: # should not happen + */ + __pyx_t_1 = ((__pyx_v_ret == -1) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":273 + * cdef int ret = msgpack_pack_map(&self.pk, size) + * if ret == -1: + * raise MemoryError # <<<<<<<<<<<<<< + * elif ret: # should not happen + * raise TypeError + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":274 + * if ret == -1: + * raise MemoryError + * elif ret: # should not happen # <<<<<<<<<<<<<< + * raise TypeError + * if self.autoreset: + */ + __pyx_t_1 = (__pyx_v_ret != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":275 + * raise MemoryError + * elif ret: # should not happen + * raise TypeError # <<<<<<<<<<<<<< + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":276 + * elif ret: # should not happen + * raise TypeError + * if self.autoreset: # <<<<<<<<<<<<<< + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + */ + __pyx_t_1 = (__pyx_v_self->autoreset != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":277 + * raise TypeError + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * self.pk.length = 0 + * return buf + */ + __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_buf = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":278 + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 # <<<<<<<<<<<<<< + * return buf + * + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":279 + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + * return buf # <<<<<<<<<<<<<< + * + * def pack_map_pairs(self, object pairs): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_buf); + __pyx_r = __pyx_v_buf; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":270 + * return buf + * + * def pack_map_header(self, size_t size): # <<<<<<<<<<<<<< + * cdef int ret = msgpack_pack_map(&self.pk, size) + * if ret == -1: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":281 + * return buf + * + * def pack_map_pairs(self, object pairs): # <<<<<<<<<<<<<< + * """ + * Pack *pairs* as msgpack map type. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_13pack_map_pairs(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_12pack_map_pairs[] = "Packer.pack_map_pairs(self, pairs)\n\n Pack *pairs* as msgpack map type.\n\n *pairs* should sequence of pair.\n (`len(pairs)` and `for k, v in *pairs*:` should be supported.)\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_13pack_map_pairs(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack_map_pairs (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_12pack_map_pairs(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((PyObject *)__pyx_v_pairs)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_12pack_map_pairs(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_pairs) { + int __pyx_v_ret; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack_map_pairs", 0); + + /* "pandas/msgpack.pyx":288 + * (`len(pairs)` and `for k, v in *pairs*:` should be supported.) + * """ + * cdef int ret = msgpack_pack_map(&self.pk, len(pairs)) # <<<<<<<<<<<<<< + * if ret == 0: + * for k, v in pairs: + */ + __pyx_t_1 = PyObject_Length(__pyx_v_pairs); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_1); + + /* "pandas/msgpack.pyx":289 + * """ + * cdef int ret = msgpack_pack_map(&self.pk, len(pairs)) + * if ret == 0: # <<<<<<<<<<<<<< + * for k, v in pairs: + * ret = self._pack(k) + */ + __pyx_t_2 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":290 + * cdef int ret = msgpack_pack_map(&self.pk, len(pairs)) + * if ret == 0: + * for k, v in pairs: # <<<<<<<<<<<<<< + * ret = self._pack(k) + * if ret != 0: break + */ + if (PyList_CheckExact(__pyx_v_pairs) || PyTuple_CheckExact(__pyx_v_pairs)) { + __pyx_t_3 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_3); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/msgpack.pyx":291 + * if ret == 0: + * for k, v in pairs: + * ret = self._pack(k) # <<<<<<<<<<<<<< + * if ret != 0: break + * ret = self._pack(v) + */ + __pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, NULL); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_10; + + /* "pandas/msgpack.pyx":292 + * for k, v in pairs: + * ret = self._pack(k) + * if ret != 0: break # <<<<<<<<<<<<<< + * ret = self._pack(v) + * if ret != 0: break + */ + __pyx_t_2 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_2) { + goto __pyx_L5_break; + } + + /* "pandas/msgpack.pyx":293 + * ret = self._pack(k) + * if ret != 0: break + * ret = self._pack(v) # <<<<<<<<<<<<<< + * if ret != 0: break + * if ret == -1: + */ + __pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, NULL); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_10; + + /* "pandas/msgpack.pyx":294 + * if ret != 0: break + * ret = self._pack(v) + * if ret != 0: break # <<<<<<<<<<<<<< + * if ret == -1: + * raise MemoryError + */ + __pyx_t_2 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_2) { + goto __pyx_L5_break; + } + } + __pyx_L5_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":295 + * ret = self._pack(v) + * if ret != 0: break + * if ret == -1: # <<<<<<<<<<<<<< + * raise MemoryError + * elif ret: # should not happen + */ + __pyx_t_2 = ((__pyx_v_ret == -1) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":296 + * if ret != 0: break + * if ret == -1: + * raise MemoryError # <<<<<<<<<<<<<< + * elif ret: # should not happen + * raise TypeError + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":297 + * if ret == -1: + * raise MemoryError + * elif ret: # should not happen # <<<<<<<<<<<<<< + * raise TypeError + * if self.autoreset: + */ + __pyx_t_2 = (__pyx_v_ret != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":298 + * raise MemoryError + * elif ret: # should not happen + * raise TypeError # <<<<<<<<<<<<<< + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":299 + * elif ret: # should not happen + * raise TypeError + * if self.autoreset: # <<<<<<<<<<<<<< + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + */ + __pyx_t_2 = (__pyx_v_self->autoreset != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":300 + * raise TypeError + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * self.pk.length = 0 + * return buf + */ + __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_buf = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/msgpack.pyx":301 + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 # <<<<<<<<<<<<<< + * return buf + * + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":302 + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + * return buf # <<<<<<<<<<<<<< + * + * def reset(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_buf); + __pyx_r = __pyx_v_buf; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":281 + * return buf + * + * def pack_map_pairs(self, object pairs): # <<<<<<<<<<<<<< + * """ + * Pack *pairs* as msgpack map type. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":304 + * return buf + * + * def reset(self): # <<<<<<<<<<<<<< + * """Clear internal buffer.""" + * self.pk.length = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_14reset[] = "Packer.reset(self)\nClear internal buffer."; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_14reset(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_14reset(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset", 0); + + /* "pandas/msgpack.pyx":306 + * def reset(self): + * """Clear internal buffer.""" + * self.pk.length = 0 # <<<<<<<<<<<<<< + * + * def bytes(self): + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":304 + * return buf + * + * def reset(self): # <<<<<<<<<<<<<< + * """Clear internal buffer.""" + * self.pk.length = 0 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":308 + * self.pk.length = 0 + * + * def bytes(self): # <<<<<<<<<<<<<< + * """Return buffer content.""" + * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_17bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_16bytes[] = "Packer.bytes(self)\nReturn buffer content."; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_17bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("bytes (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_16bytes(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_16bytes(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("bytes", 0); + + /* "pandas/msgpack.pyx":310 + * def bytes(self): + * """Return buffer content.""" + * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":308 + * self.pk.length = 0 + * + * def bytes(self): # <<<<<<<<<<<<<< + * """Return buffer content.""" + * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Packer.bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":313 + * + * + * cdef inline pack_pair(self, object k, object v, int nest_limit): # <<<<<<<<<<<<<< + * ret = self._pack(k, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % k) + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_6Packer_pack_pair(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_k, PyObject *__pyx_v_v, int __pyx_v_nest_limit) { + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack_pair", 0); + + /* "pandas/msgpack.pyx":314 + * + * cdef inline pack_pair(self, object k, object v, int nest_limit): + * ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: raise PackException("cannot pack : %s" % k) + * ret = self._pack(v, nest_limit-1) + */ + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_1; + + /* "pandas/msgpack.pyx":315 + * cdef inline pack_pair(self, object k, object v, int nest_limit): + * ret = self._pack(k, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % k) # <<<<<<<<<<<<<< + * ret = self._pack(v, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % v) + */ + __pyx_t_3 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_cannot_pack_s, __pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":316 + * ret = self._pack(k, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % k) + * ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: raise PackException("cannot pack : %s" % v) + * return ret + */ + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_1; + + /* "pandas/msgpack.pyx":317 + * if ret != 0: raise PackException("cannot pack : %s" % k) + * ret = self._pack(v, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % v) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_3 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_3) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_cannot_pack_s, __pyx_v_v); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":318 + * ret = self._pack(v, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % v) + * return ret # <<<<<<<<<<<<<< + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":313 + * + * + * cdef inline pack_pair(self, object k, object v, int nest_limit): # <<<<<<<<<<<<<< + * ret = self._pack(k, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % k) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_pair", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":320 + * return ret + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<< + * """ + * pack an object `o` and write it to stream).""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_1pack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_pack[] = "pack(o, stream, default=None, encoding='utf-8', unicode_errors='strict')\n\n pack an object `o` and write it to stream)."; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_1pack = {__Pyx_NAMESTR("pack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_1pack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_pack)}; +static PyObject *__pyx_pw_6pandas_7msgpack_1pack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_o = 0; + PyObject *__pyx_v_stream = 0; + PyObject *__pyx_v_default = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_o,&__pyx_n_s_stream,&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)__pyx_kp_s_utf_8); + values[4] = ((PyObject *)__pyx_n_s_strict); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pack", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_o = values[0]; + __pyx_v_stream = values[1]; + __pyx_v_default = values[2]; + __pyx_v_encoding = values[3]; + __pyx_v_unicode_errors = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pack", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_pack(__pyx_self, __pyx_v_o, __pyx_v_stream, __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_pack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_stream, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors) { + struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_packer = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack", 0); + + /* "pandas/msgpack.pyx":323 + * """ + * pack an object `o` and write it to stream).""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors) # <<<<<<<<<<<<<< + * stream.write(packer.pack(o)) + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default, __pyx_v_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7msgpack_Packer)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_packer = ((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":324 + * pack an object `o` and write it to stream).""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors) + * stream.write(packer.pack(o)) # <<<<<<<<<<<<<< + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_packer->__pyx_vtab)->pack(__pyx_v_packer, __pyx_v_o, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":320 + * return ret + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<< + * """ + * pack an object `o` and write it to stream).""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.msgpack.pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_packer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":326 + * stream.write(packer.pack(o)) + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<< + * """ + * pack o and return packed bytes.""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_3packb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_2packb[] = "packb(o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False)\n\n pack o and return packed bytes."; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_3packb = {__Pyx_NAMESTR("packb"), (PyCFunction)__pyx_pw_6pandas_7msgpack_3packb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_2packb)}; +static PyObject *__pyx_pw_6pandas_7msgpack_3packb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_o = 0; + PyObject *__pyx_v_default = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + PyObject *__pyx_v_use_single_float = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("packb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_o,&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_use_single_float,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)__pyx_kp_s_utf_8); + values[3] = ((PyObject *)__pyx_n_s_strict); + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_single_float); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "packb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_o = values[0]; + __pyx_v_default = values[1]; + __pyx_v_encoding = values[2]; + __pyx_v_unicode_errors = values[3]; + __pyx_v_use_single_float = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("packb", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.packb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_2packb(__pyx_self, __pyx_v_o, __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_use_single_float); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_2packb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float) { + struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_packer = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("packb", 0); + + /* "pandas/msgpack.pyx":329 + * """ + * pack o and return packed bytes.""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< + * use_single_float=use_single_float) + * return packer.pack(o) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default, __pyx_v_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":330 + * pack o and return packed bytes.""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, + * use_single_float=use_single_float) # <<<<<<<<<<<<<< + * return packer.pack(o) + * + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_use_single_float, __pyx_v_use_single_float) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":329 + * """ + * pack o and return packed bytes.""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< + * use_single_float=use_single_float) + * return packer.pack(o) + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7msgpack_Packer)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_packer = ((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":331 + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, + * use_single_float=use_single_float) + * return packer.pack(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_packer->__pyx_vtab)->pack(__pyx_v_packer, __pyx_v_o, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":326 + * stream.write(packer.pack(o)) + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<< + * """ + * pack o and return packed bytes.""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.msgpack.packb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_packer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":334 + * + * + * cdef inline init_ctx(template_context *ctx, # <<<<<<<<<<<<<< + * object object_hook, object object_pairs_hook, object list_hook, + * bint use_list, char* encoding, char* unicode_errors): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_init_ctx(template_context *__pyx_v_ctx, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, char *__pyx_v_encoding, char *__pyx_v_unicode_errors) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("init_ctx", 0); + + /* "pandas/msgpack.pyx":337 + * object object_hook, object object_pairs_hook, object list_hook, + * bint use_list, char* encoding, char* unicode_errors): + * template_init(ctx) # <<<<<<<<<<<<<< + * ctx.user.use_list = use_list + * ctx.user.object_hook = ctx.user.list_hook = NULL + */ + template_init(__pyx_v_ctx); + + /* "pandas/msgpack.pyx":338 + * bint use_list, char* encoding, char* unicode_errors): + * template_init(ctx) + * ctx.user.use_list = use_list # <<<<<<<<<<<<<< + * ctx.user.object_hook = ctx.user.list_hook = NULL + * + */ + __pyx_v_ctx->user.use_list = __pyx_v_use_list; + + /* "pandas/msgpack.pyx":339 + * template_init(ctx) + * ctx.user.use_list = use_list + * ctx.user.object_hook = ctx.user.list_hook = NULL # <<<<<<<<<<<<<< + * + * if object_hook is not None and object_pairs_hook is not None: + */ + __pyx_v_ctx->user.object_hook = ((PyObject *)NULL); + __pyx_v_ctx->user.list_hook = ((PyObject *)NULL); + + /* "pandas/msgpack.pyx":341 + * ctx.user.object_hook = ctx.user.list_hook = NULL + * + * if object_hook is not None and object_pairs_hook is not None: # <<<<<<<<<<<<<< + * raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") + * + */ + __pyx_t_1 = (__pyx_v_object_hook != Py_None); + if ((__pyx_t_1 != 0)) { + __pyx_t_2 = (__pyx_v_object_pairs_hook != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":342 + * + * if object_hook is not None and object_pairs_hook is not None: + * raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") # <<<<<<<<<<<<<< + * + * if object_hook is not None: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":344 + * raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") + * + * if object_hook is not None: # <<<<<<<<<<<<<< + * if not PyCallable_Check(object_hook): + * raise TypeError("object_hook must be a callable.") + */ + __pyx_t_3 = (__pyx_v_object_hook != Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":345 + * + * if object_hook is not None: + * if not PyCallable_Check(object_hook): # <<<<<<<<<<<<<< + * raise TypeError("object_hook must be a callable.") + * ctx.user.object_hook = object_hook + */ + __pyx_t_1 = ((!(PyCallable_Check(__pyx_v_object_hook) != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":346 + * if object_hook is not None: + * if not PyCallable_Check(object_hook): + * raise TypeError("object_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.object_hook = object_hook + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":347 + * if not PyCallable_Check(object_hook): + * raise TypeError("object_hook must be a callable.") + * ctx.user.object_hook = object_hook # <<<<<<<<<<<<<< + * + * if object_pairs_hook is None: + */ + __pyx_v_ctx->user.object_hook = ((PyObject *)__pyx_v_object_hook); + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/msgpack.pyx":349 + * ctx.user.object_hook = object_hook + * + * if object_pairs_hook is None: # <<<<<<<<<<<<<< + * ctx.user.has_pairs_hook = False + * else: + */ + __pyx_t_1 = (__pyx_v_object_pairs_hook == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":350 + * + * if object_pairs_hook is None: + * ctx.user.has_pairs_hook = False # <<<<<<<<<<<<<< + * else: + * if not PyCallable_Check(object_pairs_hook): + */ + __pyx_v_ctx->user.has_pairs_hook = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/msgpack.pyx":352 + * ctx.user.has_pairs_hook = False + * else: + * if not PyCallable_Check(object_pairs_hook): # <<<<<<<<<<<<<< + * raise TypeError("object_pairs_hook must be a callable.") + * ctx.user.object_hook = object_pairs_hook + */ + __pyx_t_3 = ((!(PyCallable_Check(__pyx_v_object_pairs_hook) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":353 + * else: + * if not PyCallable_Check(object_pairs_hook): + * raise TypeError("object_pairs_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.object_hook = object_pairs_hook + * ctx.user.has_pairs_hook = True + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":354 + * if not PyCallable_Check(object_pairs_hook): + * raise TypeError("object_pairs_hook must be a callable.") + * ctx.user.object_hook = object_pairs_hook # <<<<<<<<<<<<<< + * ctx.user.has_pairs_hook = True + * + */ + __pyx_v_ctx->user.object_hook = ((PyObject *)__pyx_v_object_pairs_hook); + + /* "pandas/msgpack.pyx":355 + * raise TypeError("object_pairs_hook must be a callable.") + * ctx.user.object_hook = object_pairs_hook + * ctx.user.has_pairs_hook = True # <<<<<<<<<<<<<< + * + * if list_hook is not None: + */ + __pyx_v_ctx->user.has_pairs_hook = 1; + } + __pyx_L6:; + + /* "pandas/msgpack.pyx":357 + * ctx.user.has_pairs_hook = True + * + * if list_hook is not None: # <<<<<<<<<<<<<< + * if not PyCallable_Check(list_hook): + * raise TypeError("list_hook must be a callable.") + */ + __pyx_t_3 = (__pyx_v_list_hook != Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":358 + * + * if list_hook is not None: + * if not PyCallable_Check(list_hook): # <<<<<<<<<<<<<< + * raise TypeError("list_hook must be a callable.") + * ctx.user.list_hook = list_hook + */ + __pyx_t_1 = ((!(PyCallable_Check(__pyx_v_list_hook) != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":359 + * if list_hook is not None: + * if not PyCallable_Check(list_hook): + * raise TypeError("list_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.list_hook = list_hook + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":360 + * if not PyCallable_Check(list_hook): + * raise TypeError("list_hook must be a callable.") + * ctx.user.list_hook = list_hook # <<<<<<<<<<<<<< + * + * ctx.user.encoding = encoding + */ + __pyx_v_ctx->user.list_hook = ((PyObject *)__pyx_v_list_hook); + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/msgpack.pyx":362 + * ctx.user.list_hook = list_hook + * + * ctx.user.encoding = encoding # <<<<<<<<<<<<<< + * ctx.user.unicode_errors = unicode_errors + * + */ + __pyx_v_ctx->user.encoding = __pyx_v_encoding; + + /* "pandas/msgpack.pyx":363 + * + * ctx.user.encoding = encoding + * ctx.user.unicode_errors = unicode_errors # <<<<<<<<<<<<<< + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, + */ + __pyx_v_ctx->user.unicode_errors = __pyx_v_unicode_errors; + + /* "pandas/msgpack.pyx":334 + * + * + * cdef inline init_ctx(template_context *ctx, # <<<<<<<<<<<<<< + * object object_hook, object object_pairs_hook, object list_hook, + * bint use_list, char* encoding, char* unicode_errors): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.msgpack.init_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_5unpackb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_4unpackb[] = "unpackb(packed, object_hook=None, list_hook=None, bool use_list=1, encoding=None, unicode_errors='strict', object_pairs_hook=None)\nUnpack packed_bytes to object. Returns an unpacked object.\n\n Raises `ValueError` when `packed` contains extra bytes.\n "; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_5unpackb = {__Pyx_NAMESTR("unpackb"), (PyCFunction)__pyx_pw_6pandas_7msgpack_5unpackb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_4unpackb)}; +static PyObject *__pyx_pw_6pandas_7msgpack_5unpackb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_packed = 0; + PyObject *__pyx_v_object_hook = 0; + PyObject *__pyx_v_list_hook = 0; + int __pyx_v_use_list; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + PyObject *__pyx_v_object_pairs_hook = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unpackb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_packed,&__pyx_n_s_object_hook,&__pyx_n_s_list_hook,&__pyx_n_s_use_list,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_object_pairs_hook,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + + /* "pandas/msgpack.pyx":366 + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, + * bint use_list=1, encoding=None, unicode_errors="strict", # <<<<<<<<<<<<<< + * object_pairs_hook=None, + * ): + */ + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)__pyx_n_s_strict); + + /* "pandas/msgpack.pyx":367 + * def unpackb(object packed, object object_hook=None, object list_hook=None, + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, # <<<<<<<<<<<<<< + * ): + * """Unpack packed_bytes to object. Returns an unpacked object. + */ + values[6] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_packed)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpackb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_packed = values[0]; + __pyx_v_object_hook = values[1]; + __pyx_v_list_hook = values[2]; + if (values[3]) { + __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_use_list = ((int)1); + } + __pyx_v_encoding = values[4]; + __pyx_v_unicode_errors = values[5]; + __pyx_v_object_pairs_hook = values[6]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("unpackb", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.unpackb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_4unpackb(__pyx_self, __pyx_v_packed, __pyx_v_object_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_object_pairs_hook); + + /* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_4unpackb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_packed, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook) { + template_context __pyx_v_ctx; + size_t __pyx_v_off; + int __pyx_v_ret; + char *__pyx_v_buf; + Py_ssize_t __pyx_v_buf_len; + char *__pyx_v_cenc; + char *__pyx_v_cerr; + PyObject *__pyx_v_obj = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unpackb", 0); + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_INCREF(__pyx_v_unicode_errors); + + /* "pandas/msgpack.pyx":374 + * """ + * cdef template_context ctx + * cdef size_t off = 0 # <<<<<<<<<<<<<< + * cdef int ret + * + */ + __pyx_v_off = 0; + + /* "pandas/msgpack.pyx":379 + * cdef char* buf + * cdef Py_ssize_t buf_len + * cdef char* cenc = NULL # <<<<<<<<<<<<<< + * cdef char* cerr = NULL + * + */ + __pyx_v_cenc = NULL; + + /* "pandas/msgpack.pyx":380 + * cdef Py_ssize_t buf_len + * cdef char* cenc = NULL + * cdef char* cerr = NULL # <<<<<<<<<<<<<< + * + * PyObject_AsReadBuffer(packed, &buf, &buf_len) + */ + __pyx_v_cerr = NULL; + + /* "pandas/msgpack.pyx":382 + * cdef char* cerr = NULL + * + * PyObject_AsReadBuffer(packed, &buf, &buf_len) # <<<<<<<<<<<<<< + * + * if encoding is not None: + */ + __pyx_t_1 = PyObject_AsReadBuffer(__pyx_v_packed, ((const void* *)(&__pyx_v_buf)), (&__pyx_v_buf_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":384 + * PyObject_AsReadBuffer(packed, &buf, &buf_len) + * + * if encoding is not None: # <<<<<<<<<<<<<< + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') + */ + __pyx_t_2 = (__pyx_v_encoding != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":385 + * + * if encoding is not None: + * if isinstance(encoding, unicode): # <<<<<<<<<<<<<< + * encoding = encoding.encode('ascii') + * cenc = PyBytes_AsString(encoding) + */ + __pyx_t_3 = PyUnicode_Check(__pyx_v_encoding); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":386 + * if encoding is not None: + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * cenc = PyBytes_AsString(encoding) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/msgpack.pyx":387 + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') + * cenc = PyBytes_AsString(encoding) # <<<<<<<<<<<<<< + * + * if unicode_errors is not None: + */ + __pyx_t_6 = PyBytes_AsString(__pyx_v_encoding); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_cenc = __pyx_t_6; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":389 + * cenc = PyBytes_AsString(encoding) + * + * if unicode_errors is not None: # <<<<<<<<<<<<<< + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') + */ + __pyx_t_2 = (__pyx_v_unicode_errors != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":390 + * + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<< + * unicode_errors = unicode_errors.encode('ascii') + * cerr = PyBytes_AsString(unicode_errors) + */ + __pyx_t_3 = PyUnicode_Check(__pyx_v_unicode_errors); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":391 + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * cerr = PyBytes_AsString(unicode_errors) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_unicode_errors, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/msgpack.pyx":392 + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') + * cerr = PyBytes_AsString(unicode_errors) # <<<<<<<<<<<<<< + * + * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + */ + __pyx_t_6 = PyBytes_AsString(__pyx_v_unicode_errors); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_cerr = __pyx_t_6; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/msgpack.pyx":394 + * cerr = PyBytes_AsString(unicode_errors) + * + * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) # <<<<<<<<<<<<<< + * ret = template_construct(&ctx, buf, buf_len, &off) + * if ret == 1: + */ + __pyx_t_4 = __pyx_f_6pandas_7msgpack_init_ctx((&__pyx_v_ctx), __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_cenc, __pyx_v_cerr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":395 + * + * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + * ret = template_construct(&ctx, buf, buf_len, &off) # <<<<<<<<<<<<<< + * if ret == 1: + * obj = template_data(&ctx) + */ + __pyx_t_1 = template_construct((&__pyx_v_ctx), __pyx_v_buf, __pyx_v_buf_len, (&__pyx_v_off)); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_1; + + /* "pandas/msgpack.pyx":396 + * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + * ret = template_construct(&ctx, buf, buf_len, &off) + * if ret == 1: # <<<<<<<<<<<<<< + * obj = template_data(&ctx) + * if off < buf_len: + */ + __pyx_t_2 = ((__pyx_v_ret == 1) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":397 + * ret = template_construct(&ctx, buf, buf_len, &off) + * if ret == 1: + * obj = template_data(&ctx) # <<<<<<<<<<<<<< + * if off < buf_len: + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) + */ + __pyx_t_4 = template_data((&__pyx_v_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_obj = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":398 + * if ret == 1: + * obj = template_data(&ctx) + * if off < buf_len: # <<<<<<<<<<<<<< + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) + * return obj + */ + __pyx_t_2 = ((__pyx_v_off < __pyx_v_buf_len) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":399 + * obj = template_data(&ctx) + * if off < buf_len: + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) # <<<<<<<<<<<<<< + * return obj + * elif ret < 0: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ExtraData); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyBytes_FromStringAndSize((__pyx_v_buf + __pyx_v_off), (__pyx_v_buf_len - __pyx_v_off)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":400 + * if off < buf_len: + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) + * return obj # <<<<<<<<<<<<<< + * elif ret < 0: + * raise ValueError("Unpack failed: error = %d" % (ret,)) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":401 + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) + * return obj + * elif ret < 0: # <<<<<<<<<<<<<< + * raise ValueError("Unpack failed: error = %d" % (ret,)) + * else: + */ + __pyx_t_2 = ((__pyx_v_ret < 0) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":402 + * return obj + * elif ret < 0: + * raise ValueError("Unpack failed: error = %d" % (ret,)) # <<<<<<<<<<<<<< + * else: + * raise UnpackValueError + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unpack_failed_error_d, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/msgpack.pyx":404 + * raise ValueError("Unpack failed: error = %d" % (ret,)) + * else: + * raise UnpackValueError # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackValueError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.msgpack.unpackb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XDECREF(__pyx_v_unicode_errors); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_7unpack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6unpack[] = "unpack(stream, object_hook=None, list_hook=None, bool use_list=1, encoding=None, unicode_errors='strict', object_pairs_hook=None)\nUnpack an object from `stream`.\n\n Raises `ValueError` when `stream` has extra bytes.\n "; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_7unpack = {__Pyx_NAMESTR("unpack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_7unpack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6unpack)}; +static PyObject *__pyx_pw_6pandas_7msgpack_7unpack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_stream = 0; + PyObject *__pyx_v_object_hook = 0; + PyObject *__pyx_v_list_hook = 0; + int __pyx_v_use_list; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + PyObject *__pyx_v_object_pairs_hook = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unpack (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_object_hook,&__pyx_n_s_list_hook,&__pyx_n_s_use_list,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_object_pairs_hook,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + + /* "pandas/msgpack.pyx":408 + * + * def unpack(object stream, object object_hook=None, object list_hook=None, + * bint use_list=1, encoding=None, unicode_errors="strict", # <<<<<<<<<<<<<< + * object_pairs_hook=None, + * ): + */ + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)__pyx_n_s_strict); + + /* "pandas/msgpack.pyx":409 + * def unpack(object stream, object object_hook=None, object list_hook=None, + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, # <<<<<<<<<<<<<< + * ): + * """Unpack an object from `stream`. + */ + values[6] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_stream = values[0]; + __pyx_v_object_hook = values[1]; + __pyx_v_list_hook = values[2]; + if (values[3]) { + __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_use_list = ((int)1); + } + __pyx_v_encoding = values[4]; + __pyx_v_unicode_errors = values[5]; + __pyx_v_object_pairs_hook = values[6]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("unpack", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_6unpack(__pyx_self, __pyx_v_stream, __pyx_v_object_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_object_pairs_hook); + + /* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6unpack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unpack", 0); + + /* "pandas/msgpack.pyx":415 + * Raises `ValueError` when `stream` has extra bytes. + * """ + * return unpackb(stream.read(), use_list=use_list, # <<<<<<<<<<<<<< + * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, + * encoding=encoding, unicode_errors=unicode_errors, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unpackb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_use_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_list, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":416 + * """ + * return unpackb(stream.read(), use_list=use_list, + * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, # <<<<<<<<<<<<<< + * encoding=encoding, unicode_errors=unicode_errors, + * ) + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_object_hook, __pyx_v_object_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_object_pairs_hook, __pyx_v_object_pairs_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_list_hook, __pyx_v_list_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":417 + * return unpackb(stream.read(), use_list=use_list, + * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, + * encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< + * ) + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":415 + * Raises `ValueError` when `stream` has extra bytes. + * """ + * return unpackb(stream.read(), use_list=use_list, # <<<<<<<<<<<<<< + * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, + * encoding=encoding, unicode_errors=unicode_errors, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.msgpack.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":478 + * cdef size_t max_buffer_size + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.buf = NULL + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7msgpack_8Unpacker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7msgpack_8Unpacker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker___cinit__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7msgpack_8Unpacker___cinit__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/msgpack.pyx":479 + * + * def __cinit__(self): + * self.buf = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->buf = NULL; + + /* "pandas/msgpack.pyx":478 + * cdef size_t max_buffer_size + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.buf = NULL + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":481 + * self.buf = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.buf) + * self.buf = NULL + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_7msgpack_8Unpacker_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_7msgpack_8Unpacker_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_7msgpack_8Unpacker_2__dealloc__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_7msgpack_8Unpacker_2__dealloc__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/msgpack.pyx":482 + * + * def __dealloc__(self): + * free(self.buf) # <<<<<<<<<<<<<< + * self.buf = NULL + * + */ + free(__pyx_v_self->buf); + + /* "pandas/msgpack.pyx":483 + * def __dealloc__(self): + * free(self.buf) + * self.buf = NULL # <<<<<<<<<<<<<< + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, + */ + __pyx_v_self->buf = NULL; + + /* "pandas/msgpack.pyx":481 + * self.buf = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.buf) + * self.buf = NULL + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/msgpack.pyx":485 + * self.buf = NULL + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<< + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7msgpack_8Unpacker_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7msgpack_8Unpacker_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_like = 0; + Py_ssize_t __pyx_v_read_size; + int __pyx_v_use_list; + PyObject *__pyx_v_object_hook = 0; + PyObject *__pyx_v_object_pairs_hook = 0; + PyObject *__pyx_v_list_hook = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + int __pyx_v_max_buffer_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_like,&__pyx_n_s_read_size,&__pyx_n_s_use_list,&__pyx_n_s_object_hook,&__pyx_n_s_object_pairs_hook,&__pyx_n_s_list_hook,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_max_buffer_size,0}; + PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; + values[0] = ((PyObject *)Py_None); + + /* "pandas/msgpack.pyx":486 + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + * ): + */ + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)Py_None); + + /* "pandas/msgpack.pyx":487 + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, + * encoding=None, unicode_errors='strict', int max_buffer_size=0, # <<<<<<<<<<<<<< + * ): + * cdef char *cenc=NULL, *cerr=NULL + */ + values[6] = ((PyObject *)Py_None); + values[7] = ((PyObject *)__pyx_n_s_strict); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_like); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_read_size); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[6] = value; kw_args--; } + } + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[7] = value; kw_args--; } + } + case 8: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_buffer_size); + if (value) { values[8] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_like = values[0]; + if (values[1]) { + __pyx_v_read_size = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_read_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_read_size = ((Py_ssize_t)0); + } + if (values[2]) { + __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_use_list = ((int)1); + } + __pyx_v_object_hook = values[3]; + __pyx_v_object_pairs_hook = values[4]; + __pyx_v_list_hook = values[5]; + __pyx_v_encoding = values[6]; + __pyx_v_unicode_errors = values[7]; + if (values[8]) { + __pyx_v_max_buffer_size = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_buffer_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_max_buffer_size = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_4__init__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_file_like, __pyx_v_read_size, __pyx_v_use_list, __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_max_buffer_size); + + /* "pandas/msgpack.pyx":485 + * self.buf = NULL + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<< + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7msgpack_8Unpacker_4__init__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_file_like, Py_ssize_t __pyx_v_read_size, int __pyx_v_use_list, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, int __pyx_v_max_buffer_size) { + char *__pyx_v_cenc; + char *__pyx_v_cerr; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + long __pyx_t_3; + int __pyx_t_4; + long __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_INCREF(__pyx_v_unicode_errors); + + /* "pandas/msgpack.pyx":489 + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + * ): + * cdef char *cenc=NULL, *cerr=NULL # <<<<<<<<<<<<<< + * + * self.file_like = file_like + */ + __pyx_v_cenc = NULL; + __pyx_v_cerr = NULL; + + /* "pandas/msgpack.pyx":491 + * cdef char *cenc=NULL, *cerr=NULL + * + * self.file_like = file_like # <<<<<<<<<<<<<< + * if file_like: + * self.file_like_read = file_like.read + */ + __Pyx_INCREF(__pyx_v_file_like); + __Pyx_GIVEREF(__pyx_v_file_like); + __Pyx_GOTREF(__pyx_v_self->file_like); + __Pyx_DECREF(__pyx_v_self->file_like); + __pyx_v_self->file_like = __pyx_v_file_like; + + /* "pandas/msgpack.pyx":492 + * + * self.file_like = file_like + * if file_like: # <<<<<<<<<<<<<< + * self.file_like_read = file_like.read + * if not PyCallable_Check(self.file_like_read): + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_file_like); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":493 + * self.file_like = file_like + * if file_like: + * self.file_like_read = file_like.read # <<<<<<<<<<<<<< + * if not PyCallable_Check(self.file_like_read): + * raise ValueError("`file_like.read` must be a callable.") + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->file_like_read); + __Pyx_DECREF(__pyx_v_self->file_like_read); + __pyx_v_self->file_like_read = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":494 + * if file_like: + * self.file_like_read = file_like.read + * if not PyCallable_Check(self.file_like_read): # <<<<<<<<<<<<<< + * raise ValueError("`file_like.read` must be a callable.") + * if not max_buffer_size: + */ + __pyx_t_2 = __pyx_v_self->file_like_read; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = ((!(PyCallable_Check(__pyx_t_2) != 0)) != 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":495 + * self.file_like_read = file_like.read + * if not PyCallable_Check(self.file_like_read): + * raise ValueError("`file_like.read` must be a callable.") # <<<<<<<<<<<<<< + * if not max_buffer_size: + * max_buffer_size = INT_MAX + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":496 + * if not PyCallable_Check(self.file_like_read): + * raise ValueError("`file_like.read` must be a callable.") + * if not max_buffer_size: # <<<<<<<<<<<<<< + * max_buffer_size = INT_MAX + * if read_size > max_buffer_size: + */ + __pyx_t_1 = ((!(__pyx_v_max_buffer_size != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":497 + * raise ValueError("`file_like.read` must be a callable.") + * if not max_buffer_size: + * max_buffer_size = INT_MAX # <<<<<<<<<<<<<< + * if read_size > max_buffer_size: + * raise ValueError("read_size should be less or equal to max_buffer_size") + */ + __pyx_v_max_buffer_size = INT_MAX; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/msgpack.pyx":498 + * if not max_buffer_size: + * max_buffer_size = INT_MAX + * if read_size > max_buffer_size: # <<<<<<<<<<<<<< + * raise ValueError("read_size should be less or equal to max_buffer_size") + * if not read_size: + */ + __pyx_t_1 = ((__pyx_v_read_size > __pyx_v_max_buffer_size) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":499 + * max_buffer_size = INT_MAX + * if read_size > max_buffer_size: + * raise ValueError("read_size should be less or equal to max_buffer_size") # <<<<<<<<<<<<<< + * if not read_size: + * read_size = min(max_buffer_size, 1024**2) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":500 + * if read_size > max_buffer_size: + * raise ValueError("read_size should be less or equal to max_buffer_size") + * if not read_size: # <<<<<<<<<<<<<< + * read_size = min(max_buffer_size, 1024**2) + * self.max_buffer_size = max_buffer_size + */ + __pyx_t_1 = ((!(__pyx_v_read_size != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":501 + * raise ValueError("read_size should be less or equal to max_buffer_size") + * if not read_size: + * read_size = min(max_buffer_size, 1024**2) # <<<<<<<<<<<<<< + * self.max_buffer_size = max_buffer_size + * self.read_size = read_size + */ + __pyx_t_3 = 1048576; + __pyx_t_4 = __pyx_v_max_buffer_size; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_read_size = __pyx_t_5; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/msgpack.pyx":502 + * if not read_size: + * read_size = min(max_buffer_size, 1024**2) + * self.max_buffer_size = max_buffer_size # <<<<<<<<<<<<<< + * self.read_size = read_size + * self.buf = malloc(read_size) + */ + __pyx_v_self->max_buffer_size = __pyx_v_max_buffer_size; + + /* "pandas/msgpack.pyx":503 + * read_size = min(max_buffer_size, 1024**2) + * self.max_buffer_size = max_buffer_size + * self.read_size = read_size # <<<<<<<<<<<<<< + * self.buf = malloc(read_size) + * if self.buf == NULL: + */ + __pyx_v_self->read_size = __pyx_v_read_size; + + /* "pandas/msgpack.pyx":504 + * self.max_buffer_size = max_buffer_size + * self.read_size = read_size + * self.buf = malloc(read_size) # <<<<<<<<<<<<<< + * if self.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") + */ + __pyx_v_self->buf = ((char *)malloc(__pyx_v_read_size)); + + /* "pandas/msgpack.pyx":505 + * self.read_size = read_size + * self.buf = malloc(read_size) + * if self.buf == NULL: # <<<<<<<<<<<<<< + * raise MemoryError("Unable to allocate internal buffer.") + * self.buf_size = read_size + */ + __pyx_t_1 = ((__pyx_v_self->buf == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":506 + * self.buf = malloc(read_size) + * if self.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<< + * self.buf_size = read_size + * self.buf_head = 0 + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":507 + * if self.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") + * self.buf_size = read_size # <<<<<<<<<<<<<< + * self.buf_head = 0 + * self.buf_tail = 0 + */ + __pyx_v_self->buf_size = __pyx_v_read_size; + + /* "pandas/msgpack.pyx":508 + * raise MemoryError("Unable to allocate internal buffer.") + * self.buf_size = read_size + * self.buf_head = 0 # <<<<<<<<<<<<<< + * self.buf_tail = 0 + * + */ + __pyx_v_self->buf_head = 0; + + /* "pandas/msgpack.pyx":509 + * self.buf_size = read_size + * self.buf_head = 0 + * self.buf_tail = 0 # <<<<<<<<<<<<<< + * + * if encoding is not None: + */ + __pyx_v_self->buf_tail = 0; + + /* "pandas/msgpack.pyx":511 + * self.buf_tail = 0 + * + * if encoding is not None: # <<<<<<<<<<<<<< + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') + */ + __pyx_t_1 = (__pyx_v_encoding != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":512 + * + * if encoding is not None: + * if isinstance(encoding, unicode): # <<<<<<<<<<<<<< + * encoding = encoding.encode('ascii') + * self.encoding = encoding + */ + __pyx_t_6 = PyUnicode_Check(__pyx_v_encoding); + __pyx_t_1 = (__pyx_t_6 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":513 + * if encoding is not None: + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * self.encoding = encoding + * cenc = PyBytes_AsString(encoding) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/msgpack.pyx":514 + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') + * self.encoding = encoding # <<<<<<<<<<<<<< + * cenc = PyBytes_AsString(encoding) + * + */ + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_GIVEREF(__pyx_v_encoding); + __Pyx_GOTREF(__pyx_v_self->encoding); + __Pyx_DECREF(__pyx_v_self->encoding); + __pyx_v_self->encoding = __pyx_v_encoding; + + /* "pandas/msgpack.pyx":515 + * encoding = encoding.encode('ascii') + * self.encoding = encoding + * cenc = PyBytes_AsString(encoding) # <<<<<<<<<<<<<< + * + * if unicode_errors is not None: + */ + __pyx_t_8 = PyBytes_AsString(__pyx_v_encoding); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_cenc = __pyx_t_8; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/msgpack.pyx":517 + * cenc = PyBytes_AsString(encoding) + * + * if unicode_errors is not None: # <<<<<<<<<<<<<< + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') + */ + __pyx_t_1 = (__pyx_v_unicode_errors != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":518 + * + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<< + * unicode_errors = unicode_errors.encode('ascii') + * self.unicode_errors = unicode_errors + */ + __pyx_t_6 = PyUnicode_Check(__pyx_v_unicode_errors); + __pyx_t_1 = (__pyx_t_6 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":519 + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * self.unicode_errors = unicode_errors + * cerr = PyBytes_AsString(unicode_errors) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_unicode_errors, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/msgpack.pyx":520 + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') + * self.unicode_errors = unicode_errors # <<<<<<<<<<<<<< + * cerr = PyBytes_AsString(unicode_errors) + * + */ + __Pyx_INCREF(__pyx_v_unicode_errors); + __Pyx_GIVEREF(__pyx_v_unicode_errors); + __Pyx_GOTREF(__pyx_v_self->unicode_errors); + __Pyx_DECREF(__pyx_v_self->unicode_errors); + __pyx_v_self->unicode_errors = __pyx_v_unicode_errors; + + /* "pandas/msgpack.pyx":521 + * unicode_errors = unicode_errors.encode('ascii') + * self.unicode_errors = unicode_errors + * cerr = PyBytes_AsString(unicode_errors) # <<<<<<<<<<<<<< + * + * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + */ + __pyx_t_8 = PyBytes_AsString(__pyx_v_unicode_errors); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_cerr = __pyx_t_8; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/msgpack.pyx":523 + * cerr = PyBytes_AsString(unicode_errors) + * + * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) # <<<<<<<<<<<<<< + * + * def feed(self, object next_bytes): + */ + __pyx_t_2 = __pyx_f_6pandas_7msgpack_init_ctx((&__pyx_v_self->ctx), __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_cenc, __pyx_v_cerr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":485 + * self.buf = NULL + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<< + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XDECREF(__pyx_v_unicode_errors); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":525 + * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + * + * def feed(self, object next_bytes): # <<<<<<<<<<<<<< + * """Append `next_bytes` to internal buffer.""" + * cdef char* buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_7feed(PyObject *__pyx_v_self, PyObject *__pyx_v_next_bytes); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_6feed[] = "Unpacker.feed(self, next_bytes)\nAppend `next_bytes` to internal buffer."; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_7feed(PyObject *__pyx_v_self, PyObject *__pyx_v_next_bytes) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_6feed(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), ((PyObject *)__pyx_v_next_bytes)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_6feed(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_next_bytes) { + char *__pyx_v_buf; + Py_ssize_t __pyx_v_buf_len; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("feed", 0); + + /* "pandas/msgpack.pyx":529 + * cdef char* buf + * cdef Py_ssize_t buf_len + * if self.file_like is not None: # <<<<<<<<<<<<<< + * raise TypeError( + * "unpacker.feed() is not be able to use with `file_like`.") + */ + __pyx_t_1 = (__pyx_v_self->file_like != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":530 + * cdef Py_ssize_t buf_len + * if self.file_like is not None: + * raise TypeError( # <<<<<<<<<<<<<< + * "unpacker.feed() is not be able to use with `file_like`.") + * PyObject_AsReadBuffer(next_bytes, &buf, &buf_len) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":532 + * raise TypeError( + * "unpacker.feed() is not be able to use with `file_like`.") + * PyObject_AsReadBuffer(next_bytes, &buf, &buf_len) # <<<<<<<<<<<<<< + * self.append_buffer(buf, buf_len) + * + */ + __pyx_t_4 = PyObject_AsReadBuffer(__pyx_v_next_bytes, ((const void* *)(&__pyx_v_buf)), (&__pyx_v_buf_len)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":533 + * "unpacker.feed() is not be able to use with `file_like`.") + * PyObject_AsReadBuffer(next_bytes, &buf, &buf_len) + * self.append_buffer(buf, buf_len) # <<<<<<<<<<<<<< + * + * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->append_buffer(__pyx_v_self, __pyx_v_buf, __pyx_v_buf_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/msgpack.pyx":525 + * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + * + * def feed(self, object next_bytes): # <<<<<<<<<<<<<< + * """Append `next_bytes` to internal buffer.""" + * cdef char* buf + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":535 + * self.append_buffer(buf, buf_len) + * + * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): # <<<<<<<<<<<<<< + * cdef: + * char* buf = self.buf + */ + +static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker_append_buffer(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, void *__pyx_v__buf, Py_ssize_t __pyx_v__buf_len) { + char *__pyx_v_buf; + char *__pyx_v_new_buf; + size_t __pyx_v_head; + size_t __pyx_v_tail; + size_t __pyx_v_buf_size; + size_t __pyx_v_new_size; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + size_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_5; + size_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append_buffer", 0); + + /* "pandas/msgpack.pyx":537 + * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): + * cdef: + * char* buf = self.buf # <<<<<<<<<<<<<< + * char* new_buf + * size_t head = self.buf_head + */ + __pyx_t_1 = __pyx_v_self->buf; + __pyx_v_buf = __pyx_t_1; + + /* "pandas/msgpack.pyx":539 + * char* buf = self.buf + * char* new_buf + * size_t head = self.buf_head # <<<<<<<<<<<<<< + * size_t tail = self.buf_tail + * size_t buf_size = self.buf_size + */ + __pyx_t_2 = __pyx_v_self->buf_head; + __pyx_v_head = __pyx_t_2; + + /* "pandas/msgpack.pyx":540 + * char* new_buf + * size_t head = self.buf_head + * size_t tail = self.buf_tail # <<<<<<<<<<<<<< + * size_t buf_size = self.buf_size + * size_t new_size + */ + __pyx_t_2 = __pyx_v_self->buf_tail; + __pyx_v_tail = __pyx_t_2; + + /* "pandas/msgpack.pyx":541 + * size_t head = self.buf_head + * size_t tail = self.buf_tail + * size_t buf_size = self.buf_size # <<<<<<<<<<<<<< + * size_t new_size + * + */ + __pyx_t_2 = __pyx_v_self->buf_size; + __pyx_v_buf_size = __pyx_t_2; + + /* "pandas/msgpack.pyx":544 + * size_t new_size + * + * if tail + _buf_len > buf_size: # <<<<<<<<<<<<<< + * if ((tail - head) + _buf_len) <= buf_size: + * # move to front. + */ + __pyx_t_3 = (((__pyx_v_tail + __pyx_v__buf_len) > __pyx_v_buf_size) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":545 + * + * if tail + _buf_len > buf_size: + * if ((tail - head) + _buf_len) <= buf_size: # <<<<<<<<<<<<<< + * # move to front. + * memmove(buf, buf + head, tail - head) + */ + __pyx_t_3 = ((((__pyx_v_tail - __pyx_v_head) + __pyx_v__buf_len) <= __pyx_v_buf_size) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":547 + * if ((tail - head) + _buf_len) <= buf_size: + * # move to front. + * memmove(buf, buf + head, tail - head) # <<<<<<<<<<<<<< + * tail -= head + * head = 0 + */ + memmove(__pyx_v_buf, (__pyx_v_buf + __pyx_v_head), (__pyx_v_tail - __pyx_v_head)); + + /* "pandas/msgpack.pyx":548 + * # move to front. + * memmove(buf, buf + head, tail - head) + * tail -= head # <<<<<<<<<<<<<< + * head = 0 + * else: + */ + __pyx_v_tail = (__pyx_v_tail - __pyx_v_head); + + /* "pandas/msgpack.pyx":549 + * memmove(buf, buf + head, tail - head) + * tail -= head + * head = 0 # <<<<<<<<<<<<<< + * else: + * # expand buffer. + */ + __pyx_v_head = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/msgpack.pyx":552 + * else: + * # expand buffer. + * new_size = (tail-head) + _buf_len # <<<<<<<<<<<<<< + * if new_size > self.max_buffer_size: + * raise BufferFull + */ + __pyx_v_new_size = ((__pyx_v_tail - __pyx_v_head) + __pyx_v__buf_len); + + /* "pandas/msgpack.pyx":553 + * # expand buffer. + * new_size = (tail-head) + _buf_len + * if new_size > self.max_buffer_size: # <<<<<<<<<<<<<< + * raise BufferFull + * new_size = min(new_size*2, self.max_buffer_size) + */ + __pyx_t_3 = ((__pyx_v_new_size > __pyx_v_self->max_buffer_size) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":554 + * new_size = (tail-head) + _buf_len + * if new_size > self.max_buffer_size: + * raise BufferFull # <<<<<<<<<<<<<< + * new_size = min(new_size*2, self.max_buffer_size) + * new_buf = malloc(new_size) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferFull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":555 + * if new_size > self.max_buffer_size: + * raise BufferFull + * new_size = min(new_size*2, self.max_buffer_size) # <<<<<<<<<<<<<< + * new_buf = malloc(new_size) + * if new_buf == NULL: + */ + __pyx_t_2 = __pyx_v_self->max_buffer_size; + __pyx_t_5 = (__pyx_v_new_size * 2); + if (((__pyx_t_2 < __pyx_t_5) != 0)) { + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_5; + } + __pyx_v_new_size = __pyx_t_6; + + /* "pandas/msgpack.pyx":556 + * raise BufferFull + * new_size = min(new_size*2, self.max_buffer_size) + * new_buf = malloc(new_size) # <<<<<<<<<<<<<< + * if new_buf == NULL: + * # self.buf still holds old buffer and will be freed during + */ + __pyx_v_new_buf = ((char *)malloc(__pyx_v_new_size)); + + /* "pandas/msgpack.pyx":557 + * new_size = min(new_size*2, self.max_buffer_size) + * new_buf = malloc(new_size) + * if new_buf == NULL: # <<<<<<<<<<<<<< + * # self.buf still holds old buffer and will be freed during + * # obj destruction + */ + __pyx_t_3 = ((__pyx_v_new_buf == NULL) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":560 + * # self.buf still holds old buffer and will be freed during + * # obj destruction + * raise MemoryError("Unable to enlarge internal buffer.") # <<<<<<<<<<<<<< + * memcpy(new_buf, buf + head, tail - head) + * free(buf) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":561 + * # obj destruction + * raise MemoryError("Unable to enlarge internal buffer.") + * memcpy(new_buf, buf + head, tail - head) # <<<<<<<<<<<<<< + * free(buf) + * + */ + memcpy(__pyx_v_new_buf, (__pyx_v_buf + __pyx_v_head), (__pyx_v_tail - __pyx_v_head)); + + /* "pandas/msgpack.pyx":562 + * raise MemoryError("Unable to enlarge internal buffer.") + * memcpy(new_buf, buf + head, tail - head) + * free(buf) # <<<<<<<<<<<<<< + * + * buf = new_buf + */ + free(__pyx_v_buf); + + /* "pandas/msgpack.pyx":564 + * free(buf) + * + * buf = new_buf # <<<<<<<<<<<<<< + * buf_size = new_size + * tail -= head + */ + __pyx_v_buf = __pyx_v_new_buf; + + /* "pandas/msgpack.pyx":565 + * + * buf = new_buf + * buf_size = new_size # <<<<<<<<<<<<<< + * tail -= head + * head = 0 + */ + __pyx_v_buf_size = __pyx_v_new_size; + + /* "pandas/msgpack.pyx":566 + * buf = new_buf + * buf_size = new_size + * tail -= head # <<<<<<<<<<<<<< + * head = 0 + * + */ + __pyx_v_tail = (__pyx_v_tail - __pyx_v_head); + + /* "pandas/msgpack.pyx":567 + * buf_size = new_size + * tail -= head + * head = 0 # <<<<<<<<<<<<<< + * + * memcpy(buf + tail, (_buf), _buf_len) + */ + __pyx_v_head = 0; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":569 + * head = 0 + * + * memcpy(buf + tail, (_buf), _buf_len) # <<<<<<<<<<<<<< + * self.buf = buf + * self.buf_head = head + */ + memcpy((__pyx_v_buf + __pyx_v_tail), ((char *)__pyx_v__buf), __pyx_v__buf_len); + + /* "pandas/msgpack.pyx":570 + * + * memcpy(buf + tail, (_buf), _buf_len) + * self.buf = buf # <<<<<<<<<<<<<< + * self.buf_head = head + * self.buf_size = buf_size + */ + __pyx_v_self->buf = __pyx_v_buf; + + /* "pandas/msgpack.pyx":571 + * memcpy(buf + tail, (_buf), _buf_len) + * self.buf = buf + * self.buf_head = head # <<<<<<<<<<<<<< + * self.buf_size = buf_size + * self.buf_tail = tail + _buf_len + */ + __pyx_v_self->buf_head = __pyx_v_head; + + /* "pandas/msgpack.pyx":572 + * self.buf = buf + * self.buf_head = head + * self.buf_size = buf_size # <<<<<<<<<<<<<< + * self.buf_tail = tail + _buf_len + * + */ + __pyx_v_self->buf_size = __pyx_v_buf_size; + + /* "pandas/msgpack.pyx":573 + * self.buf_head = head + * self.buf_size = buf_size + * self.buf_tail = tail + _buf_len # <<<<<<<<<<<<<< + * + * cdef read_from_file(self): + */ + __pyx_v_self->buf_tail = (__pyx_v_tail + __pyx_v__buf_len); + + /* "pandas/msgpack.pyx":535 + * self.append_buffer(buf, buf_len) + * + * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): # <<<<<<<<<<<<<< + * cdef: + * char* buf = self.buf + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.append_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":575 + * self.buf_tail = tail + _buf_len + * + * cdef read_from_file(self): # <<<<<<<<<<<<<< + * next_bytes = self.file_like_read( + * min(self.read_size, + */ + +static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker_read_from_file(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + PyObject *__pyx_v_next_bytes = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + size_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + size_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_from_file", 0); + + /* "pandas/msgpack.pyx":578 + * next_bytes = self.file_like_read( + * min(self.read_size, + * self.max_buffer_size - (self.buf_tail - self.buf_head) # <<<<<<<<<<<<<< + * )) + * if next_bytes: + */ + __pyx_t_1 = (__pyx_v_self->max_buffer_size - (__pyx_v_self->buf_tail - __pyx_v_self->buf_head)); + + /* "pandas/msgpack.pyx":577 + * cdef read_from_file(self): + * next_bytes = self.file_like_read( + * min(self.read_size, # <<<<<<<<<<<<<< + * self.max_buffer_size - (self.buf_tail - self.buf_head) + * )) + */ + __pyx_t_2 = __pyx_v_self->read_size; + + /* "pandas/msgpack.pyx":578 + * next_bytes = self.file_like_read( + * min(self.read_size, + * self.max_buffer_size - (self.buf_tail - self.buf_head) # <<<<<<<<<<<<<< + * )) + * if next_bytes: + */ + if (((__pyx_t_1 < __pyx_t_2) != 0)) { + __pyx_t_3 = __pyx_t_1; + } else { + __pyx_t_3 = __pyx_t_2; + } + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/msgpack.pyx":576 + * + * cdef read_from_file(self): + * next_bytes = self.file_like_read( # <<<<<<<<<<<<<< + * min(self.read_size, + * self.max_buffer_size - (self.buf_tail - self.buf_head) + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_self->file_like_read, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_next_bytes = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":580 + * self.max_buffer_size - (self.buf_tail - self.buf_head) + * )) + * if next_bytes: # <<<<<<<<<<<<<< + * self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes)) + * else: + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_next_bytes); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":581 + * )) + * if next_bytes: + * self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes)) # <<<<<<<<<<<<<< + * else: + * self.file_like = None + */ + __pyx_t_7 = PyBytes_AsString(__pyx_v_next_bytes); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyBytes_Size(__pyx_v_next_bytes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->append_buffer(__pyx_v_self, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/msgpack.pyx":583 + * self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes)) + * else: + * self.file_like = None # <<<<<<<<<<<<<< + * + * cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->file_like); + __Pyx_DECREF(__pyx_v_self->file_like); + __pyx_v_self->file_like = Py_None; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":575 + * self.buf_tail = tail + _buf_len + * + * cdef read_from_file(self): # <<<<<<<<<<<<<< + * next_bytes = self.file_like_read( + * min(self.read_size, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_next_bytes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":585 + * self.file_like = None + * + * cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<< + * cdef int ret + * cdef object obj + */ + +static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker__unpack(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, execute_fn __pyx_v_execute, PyObject *__pyx_v_write_bytes, struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack *__pyx_optional_args) { + int __pyx_v_iter = ((int)0); + int __pyx_v_ret; + PyObject *__pyx_v_obj = 0; + size_t __pyx_v_prev_head; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + size_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unpack", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_iter = __pyx_optional_args->iter; + } + } + + /* "pandas/msgpack.pyx":589 + * cdef object obj + * cdef size_t prev_head + * while 1: # <<<<<<<<<<<<<< + * prev_head = self.buf_head + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) + */ + while (1) { + + /* "pandas/msgpack.pyx":590 + * cdef size_t prev_head + * while 1: + * prev_head = self.buf_head # <<<<<<<<<<<<<< + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) + * if write_bytes is not None: + */ + __pyx_t_1 = __pyx_v_self->buf_head; + __pyx_v_prev_head = __pyx_t_1; + + /* "pandas/msgpack.pyx":591 + * while 1: + * prev_head = self.buf_head + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) # <<<<<<<<<<<<<< + * if write_bytes is not None: + * write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) + */ + __pyx_t_2 = __pyx_v_execute((&__pyx_v_self->ctx), __pyx_v_self->buf, __pyx_v_self->buf_tail, (&__pyx_v_self->buf_head)); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_2; + + /* "pandas/msgpack.pyx":592 + * prev_head = self.buf_head + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) + * if write_bytes is not None: # <<<<<<<<<<<<<< + * write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) + * + */ + __pyx_t_3 = (__pyx_v_write_bytes != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/msgpack.pyx":593 + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) + * if write_bytes is not None: + * write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) # <<<<<<<<<<<<<< + * + * if ret == 1: + */ + __pyx_t_5 = PyBytes_FromStringAndSize((__pyx_v_self->buf + __pyx_v_prev_head), (__pyx_v_self->buf_head - __pyx_v_prev_head)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_write_bytes, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/msgpack.pyx":599 + * template_init(&self.ctx) + * return obj + * elif ret == 0: # <<<<<<<<<<<<<< + * if self.file_like is not None: + * self.read_from_file() + */ + switch (__pyx_v_ret) { + + /* "pandas/msgpack.pyx":595 + * write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) + * + * if ret == 1: # <<<<<<<<<<<<<< + * obj = template_data(&self.ctx) + * template_init(&self.ctx) + */ + case 1: + + /* "pandas/msgpack.pyx":596 + * + * if ret == 1: + * obj = template_data(&self.ctx) # <<<<<<<<<<<<<< + * template_init(&self.ctx) + * return obj + */ + __pyx_t_5 = template_data((&__pyx_v_self->ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_obj = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/msgpack.pyx":597 + * if ret == 1: + * obj = template_data(&self.ctx) + * template_init(&self.ctx) # <<<<<<<<<<<<<< + * return obj + * elif ret == 0: + */ + template_init((&__pyx_v_self->ctx)); + + /* "pandas/msgpack.pyx":598 + * obj = template_data(&self.ctx) + * template_init(&self.ctx) + * return obj # <<<<<<<<<<<<<< + * elif ret == 0: + * if self.file_like is not None: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + break; + + /* "pandas/msgpack.pyx":599 + * template_init(&self.ctx) + * return obj + * elif ret == 0: # <<<<<<<<<<<<<< + * if self.file_like is not None: + * self.read_from_file() + */ + case 0: + + /* "pandas/msgpack.pyx":600 + * return obj + * elif ret == 0: + * if self.file_like is not None: # <<<<<<<<<<<<<< + * self.read_from_file() + * continue + */ + __pyx_t_4 = (__pyx_v_self->file_like != Py_None); + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":601 + * elif ret == 0: + * if self.file_like is not None: + * self.read_from_file() # <<<<<<<<<<<<<< + * continue + * if iter: + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->read_from_file(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/msgpack.pyx":602 + * if self.file_like is not None: + * self.read_from_file() + * continue # <<<<<<<<<<<<<< + * if iter: + * raise StopIteration("No more data to unpack.") + */ + goto __pyx_L3_continue; + } + + /* "pandas/msgpack.pyx":603 + * self.read_from_file() + * continue + * if iter: # <<<<<<<<<<<<<< + * raise StopIteration("No more data to unpack.") + * else: + */ + __pyx_t_3 = (__pyx_v_iter != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":604 + * continue + * if iter: + * raise StopIteration("No more data to unpack.") # <<<<<<<<<<<<<< + * else: + * raise OutOfData("No more data to unpack.") + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_StopIteration, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/msgpack.pyx":606 + * raise StopIteration("No more data to unpack.") + * else: + * raise OutOfData("No more data to unpack.") # <<<<<<<<<<<<<< + * else: + * raise ValueError("Unpack failed: error = %d" % (ret,)) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfData); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + default: + + /* "pandas/msgpack.pyx":608 + * raise OutOfData("No more data to unpack.") + * else: + * raise ValueError("Unpack failed: error = %d" % (ret,)) # <<<<<<<<<<<<<< + * + * def read_bytes(self, Py_ssize_t nbytes): + */ + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Unpack_failed_error_d, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + __pyx_L3_continue:; + } + + /* "pandas/msgpack.pyx":585 + * self.file_like = None + * + * cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<< + * cdef int ret + * cdef object obj + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.msgpack.Unpacker._unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":610 + * raise ValueError("Unpack failed: error = %d" % (ret,)) + * + * def read_bytes(self, Py_ssize_t nbytes): # <<<<<<<<<<<<<< + * """read a specified number of raw bytes from the stream""" + * cdef size_t nread + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_9read_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_8read_bytes[] = "Unpacker.read_bytes(self, Py_ssize_t nbytes)\nread a specified number of raw bytes from the stream"; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_9read_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes) { + Py_ssize_t __pyx_v_nbytes; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_bytes (wrapper)", 0); + assert(__pyx_arg_nbytes); { + __pyx_v_nbytes = __Pyx_PyIndex_AsSsize_t(__pyx_arg_nbytes); if (unlikely((__pyx_v_nbytes == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_8read_bytes(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), ((Py_ssize_t)__pyx_v_nbytes)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_8read_bytes(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, Py_ssize_t __pyx_v_nbytes) { + size_t __pyx_v_nread; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + size_t __pyx_t_2; + size_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_bytes", 0); + + /* "pandas/msgpack.pyx":613 + * """read a specified number of raw bytes from the stream""" + * cdef size_t nread + * nread = min(self.buf_tail - self.buf_head, nbytes) # <<<<<<<<<<<<<< + * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) + * self.buf_head += nread + */ + __pyx_t_1 = __pyx_v_nbytes; + __pyx_t_2 = (__pyx_v_self->buf_tail - __pyx_v_self->buf_head); + if (((__pyx_t_1 < __pyx_t_2) != 0)) { + __pyx_t_3 = __pyx_t_1; + } else { + __pyx_t_3 = __pyx_t_2; + } + __pyx_v_nread = __pyx_t_3; + + /* "pandas/msgpack.pyx":614 + * cdef size_t nread + * nread = min(self.buf_tail - self.buf_head, nbytes) + * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) # <<<<<<<<<<<<<< + * self.buf_head += nread + * if len(ret) < nbytes and self.file_like is not None: + */ + __pyx_t_4 = PyBytes_FromStringAndSize((__pyx_v_self->buf + __pyx_v_self->buf_head), __pyx_v_nread); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_ret = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":615 + * nread = min(self.buf_tail - self.buf_head, nbytes) + * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) + * self.buf_head += nread # <<<<<<<<<<<<<< + * if len(ret) < nbytes and self.file_like is not None: + * ret += self.file_like.read(nbytes - len(ret)) + */ + __pyx_v_self->buf_head = (__pyx_v_self->buf_head + __pyx_v_nread); + + /* "pandas/msgpack.pyx":616 + * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) + * self.buf_head += nread + * if len(ret) < nbytes and self.file_like is not None: # <<<<<<<<<<<<<< + * ret += self.file_like.read(nbytes - len(ret)) + * return ret + */ + __pyx_t_1 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_1 < __pyx_v_nbytes) != 0); + if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_self->file_like != Py_None); + __pyx_t_7 = (__pyx_t_6 != 0); + } else { + __pyx_t_7 = __pyx_t_5; + } + if (__pyx_t_7) { + + /* "pandas/msgpack.pyx":617 + * self.buf_head += nread + * if len(ret) < nbytes and self.file_like is not None: + * ret += self.file_like.read(nbytes - len(ret)) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->file_like, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromSsize_t((__pyx_v_nbytes - __pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":618 + * if len(ret) < nbytes and self.file_like is not None: + * ret += self.file_like.read(nbytes - len(ret)) + * return ret # <<<<<<<<<<<<<< + * + * def unpack(self, object write_bytes=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":610 + * raise ValueError("Unpack failed: error = %d" % (ret,)) + * + * def read_bytes(self, Py_ssize_t nbytes): # <<<<<<<<<<<<<< + * """read a specified number of raw bytes from the stream""" + * cdef size_t nread + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":620 + * return ret + * + * def unpack(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """ + * unpack one object + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_10unpack[] = "Unpacker.unpack(self, write_bytes=None)\n\n unpack one object\n\n If write_bytes is not None, it will be called with parts of the raw\n message as it is unpacked.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_write_bytes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unpack (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_write_bytes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("unpack", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_10unpack(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_10unpack(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unpack", 0); + + /* "pandas/msgpack.pyx":629 + * Raises `OutOfData` when there are no more bytes to unpack. + * """ + * return self._unpack(template_construct, write_bytes) # <<<<<<<<<<<<<< + * + * def skip(self, object write_bytes=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_construct, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":620 + * return ret + * + * def unpack(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """ + * unpack one object + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":631 + * return self._unpack(template_construct, write_bytes) + * + * def skip(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """ + * read and ignore one object, returning None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_13skip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_12skip[] = "Unpacker.skip(self, write_bytes=None)\n\n read and ignore one object, returning None\n\n If write_bytes is not None, it will be called with parts of the raw\n message as it is unpacked.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_13skip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_write_bytes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("skip (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "skip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_write_bytes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("skip", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.skip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_12skip(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_12skip(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("skip", 0); + + /* "pandas/msgpack.pyx":640 + * Raises `OutOfData` when there are no more bytes to unpack. + * """ + * return self._unpack(template_skip, write_bytes) # <<<<<<<<<<<<<< + * + * def read_array_header(self, object write_bytes=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_skip, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":631 + * return self._unpack(template_construct, write_bytes) + * + * def skip(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """ + * read and ignore one object, returning None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.skip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":642 + * return self._unpack(template_skip, write_bytes) + * + * def read_array_header(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """assuming the next object is an array, return its size n, such that + * the next n unpack() calls will iterate over its contents. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_15read_array_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_14read_array_header[] = "Unpacker.read_array_header(self, write_bytes=None)\nassuming the next object is an array, return its size n, such that\n the next n unpack() calls will iterate over its contents.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_15read_array_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_write_bytes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_array_header (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_array_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_write_bytes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read_array_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_14read_array_header(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_14read_array_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_array_header", 0); + + /* "pandas/msgpack.pyx":648 + * Raises `OutOfData` when there are no more bytes to unpack. + * """ + * return self._unpack(read_array_header, write_bytes) # <<<<<<<<<<<<<< + * + * def read_map_header(self, object write_bytes=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, read_array_header, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":642 + * return self._unpack(template_skip, write_bytes) + * + * def read_array_header(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """assuming the next object is an array, return its size n, such that + * the next n unpack() calls will iterate over its contents. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":650 + * return self._unpack(read_array_header, write_bytes) + * + * def read_map_header(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """assuming the next object is a map, return its size n, such that the + * next n * 2 unpack() calls will iterate over its key-value pairs. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_17read_map_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_16read_map_header[] = "Unpacker.read_map_header(self, write_bytes=None)\nassuming the next object is a map, return its size n, such that the\n next n * 2 unpack() calls will iterate over its key-value pairs.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_17read_map_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_write_bytes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_map_header (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_map_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_write_bytes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read_map_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_16read_map_header(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_16read_map_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_map_header", 0); + + /* "pandas/msgpack.pyx":656 + * Raises `OutOfData` when there are no more bytes to unpack. + * """ + * return self._unpack(read_map_header, write_bytes) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, read_map_header, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":650 + * return self._unpack(read_array_header, write_bytes) + * + * def read_map_header(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """assuming the next object is a map, return its size n, such that the + * next n * 2 unpack() calls will iterate over its key-value pairs. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":658 + * return self._unpack(read_map_header, write_bytes) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_19__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_19__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_18__iter__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_18__iter__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "pandas/msgpack.pyx":659 + * + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/msgpack.pyx":658 + * return self._unpack(read_map_header, write_bytes) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":661 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * return self._unpack(template_construct, None, 1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_21__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_21__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_20__next__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_20__next__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "pandas/msgpack.pyx":662 + * + * def __next__(self): + * return self._unpack(template_construct, None, 1) # <<<<<<<<<<<<<< + * + * # for debug. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.iter = 1; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_construct, Py_None, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":661 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * return self._unpack(template_construct, None, 1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6pandas_7msgpack_Packer __pyx_vtable_6pandas_7msgpack_Packer; + +static PyObject *__pyx_tp_new_6pandas_7msgpack_Packer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_7msgpack_Packer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7msgpack_Packer *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7msgpack_Packer; + p->_default = Py_None; Py_INCREF(Py_None); + p->_bencoding = Py_None; Py_INCREF(Py_None); + p->_berrors = Py_None; Py_INCREF(Py_None); + p->use_float = ((PyBoolObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_7msgpack_6Packer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_7msgpack_Packer(PyObject *o) { + struct __pyx_obj_6pandas_7msgpack_Packer *p = (struct __pyx_obj_6pandas_7msgpack_Packer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_7msgpack_6Packer_5__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->_default); + Py_CLEAR(p->_bencoding); + Py_CLEAR(p->_berrors); + Py_CLEAR(p->use_float); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_7msgpack_Packer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7msgpack_Packer *p = (struct __pyx_obj_6pandas_7msgpack_Packer *)o; + if (p->_default) { + e = (*v)(p->_default, a); if (e) return e; + } + if (p->_bencoding) { + e = (*v)(p->_bencoding, a); if (e) return e; + } + if (p->_berrors) { + e = (*v)(p->_berrors, a); if (e) return e; + } + if (p->use_float) { + e = (*v)(((PyObject*)p->use_float), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7msgpack_Packer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7msgpack_Packer *p = (struct __pyx_obj_6pandas_7msgpack_Packer *)o; + tmp = ((PyObject*)p->_default); + p->_default = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_bencoding); + p->_bencoding = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_berrors); + p->_berrors = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->use_float); + p->use_float = ((PyBoolObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_7msgpack_Packer[] = { + {__Pyx_NAMESTR("pack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_7pack, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_6pack)}, + {__Pyx_NAMESTR("pack_array_header"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_9pack_array_header, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_8pack_array_header)}, + {__Pyx_NAMESTR("pack_map_header"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_11pack_map_header, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_10pack_map_header)}, + {__Pyx_NAMESTR("pack_map_pairs"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_13pack_map_pairs, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_12pack_map_pairs)}, + {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_15reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_14reset)}, + {__Pyx_NAMESTR("bytes"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_17bytes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_16bytes)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7msgpack_Packer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.msgpack.Packer"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7msgpack_Packer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7msgpack_Packer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Packer(default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False, bool autoreset=1)\nMessagePack Packer\n\n usage:\n\n packer = Packer()\n astream.write(packer.pack(a))\n astream.write(packer.pack(b))\n\n Packer's constructor has some keyword arguments:\n\n * *defaut* - Convert user type to builtin type that Packer supports.\n See also simplejson's document.\n * *encoding* - Convert unicode to bytes with this encoding. (default: 'utf-8')\n * *unicode_errors* - Error handler for encoding unicode. (default: 'strict')\n * *use_single_float* - Use single precision float type for float. (default: False)\n * *autoreset* - Reset buffer after each pack and return it's content as `bytes`. (default: True).\n If set this to false, use `bytes()` to get content and `.reset()` to clear buffer.\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7msgpack_Packer, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7msgpack_Packer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7msgpack_Packer, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7msgpack_6Packer_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7msgpack_Packer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker __pyx_vtable_6pandas_7msgpack_Unpacker; + +static PyObject *__pyx_tp_new_6pandas_7msgpack_Unpacker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_7msgpack_Unpacker *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7msgpack_Unpacker *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7msgpack_Unpacker; + p->file_like = Py_None; Py_INCREF(Py_None); + p->file_like_read = Py_None; Py_INCREF(Py_None); + p->object_hook = Py_None; Py_INCREF(Py_None); + p->encoding = Py_None; Py_INCREF(Py_None); + p->unicode_errors = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_7msgpack_8Unpacker_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_7msgpack_Unpacker(PyObject *o) { + struct __pyx_obj_6pandas_7msgpack_Unpacker *p = (struct __pyx_obj_6pandas_7msgpack_Unpacker *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_7msgpack_8Unpacker_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->file_like); + Py_CLEAR(p->file_like_read); + Py_CLEAR(p->object_hook); + Py_CLEAR(p->encoding); + Py_CLEAR(p->unicode_errors); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_7msgpack_Unpacker(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7msgpack_Unpacker *p = (struct __pyx_obj_6pandas_7msgpack_Unpacker *)o; + if (p->file_like) { + e = (*v)(p->file_like, a); if (e) return e; + } + if (p->file_like_read) { + e = (*v)(p->file_like_read, a); if (e) return e; + } + if (p->object_hook) { + e = (*v)(p->object_hook, a); if (e) return e; + } + if (p->encoding) { + e = (*v)(p->encoding, a); if (e) return e; + } + if (p->unicode_errors) { + e = (*v)(p->unicode_errors, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7msgpack_Unpacker(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7msgpack_Unpacker *p = (struct __pyx_obj_6pandas_7msgpack_Unpacker *)o; + tmp = ((PyObject*)p->file_like); + p->file_like = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->file_like_read); + p->file_like_read = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->object_hook); + p->object_hook = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->encoding); + p->encoding = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->unicode_errors); + p->unicode_errors = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_7msgpack_Unpacker[] = { + {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_7feed, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_6feed)}, + {__Pyx_NAMESTR("read_bytes"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_9read_bytes, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_8read_bytes)}, + {__Pyx_NAMESTR("unpack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_11unpack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_10unpack)}, + {__Pyx_NAMESTR("skip"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_13skip, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_12skip)}, + {__Pyx_NAMESTR("read_array_header"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_15read_array_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_14read_array_header)}, + {__Pyx_NAMESTR("read_map_header"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_17read_map_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_16read_map_header)}, + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_21__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7msgpack_Unpacker = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.msgpack.Unpacker"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7msgpack_Unpacker), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7msgpack_Unpacker, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Unpacker(file_like=None, Py_ssize_t read_size=0, bool use_list=1, object_hook=None, object_pairs_hook=None, list_hook=None, encoding=None, unicode_errors='strict', int max_buffer_size=0)\n\n Streaming unpacker.\n\n `file_like` is a file-like object having `.read(n)` method.\n When `Unpacker` initialized with `file_like`, unpacker reads serialized data\n from it and `.feed()` method is not usable.\n\n `read_size` is used as `file_like.read(read_size)`.\n (default: min(1024**2, max_buffer_size))\n\n If `use_list` is true (default), msgpack list is deserialized to Python list.\n Otherwise, it is deserialized to Python tuple.\n\n `object_hook` is same to simplejson. If it is not None, it should be callable\n and Unpacker calls it with a dict argument after deserializing a map.\n\n `object_pairs_hook` is same to simplejson. If it is not None, it should be callable\n and Unpacker calls it with a list of key-value pairs after deserializing a map.\n\n `encoding` is encoding used for decoding msgpack bytes. If it is None (default),\n msgpack bytes is deserialized to Python bytes.\n\n `unicode_errors` is used for decoding bytes.\n\n `max_buffer_size` limits size of data waiting unpacked.\n 0 means system's INT_MAX (default).\n Raises `BufferFull` exception when it is insufficient.\n You shoud set this parameter when unpacking data from untrasted source.\n\n example of streaming deserialize from file-like object::\n\n unpacker = Unpacker(file_like)\n for o in unpacker:\n do_something(o)\n\n example of streaming deserialize from socket::\n\n unpacker = Unpacker()\n while 1:\n buf = sock.recv(1024**2)\n if not buf:\n break\n unpacker.feed(buf)\n for o in unpacker:\n do_something(o)\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7msgpack_Unpacker, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7msgpack_Unpacker, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6pandas_7msgpack_8Unpacker_19__iter__, /*tp_iter*/ + __pyx_pw_6pandas_7msgpack_8Unpacker_21__next__, /*tp_iternext*/ + __pyx_methods_6pandas_7msgpack_Unpacker, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7msgpack_8Unpacker_5__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7msgpack_Unpacker, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("msgpack"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_BufferFull, __pyx_k_BufferFull, sizeof(__pyx_k_BufferFull), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_t_encode_unicode_string_no_e, __pyx_k_Can_t_encode_unicode_string_no_e, sizeof(__pyx_k_Can_t_encode_unicode_string_no_e), 0, 0, 1, 0}, + {&__pyx_n_s_ExtraData, __pyx_k_ExtraData, sizeof(__pyx_k_ExtraData), 0, 0, 1, 1}, + {&__pyx_n_s_ExtraData___init, __pyx_k_ExtraData___init, sizeof(__pyx_k_ExtraData___init), 0, 0, 1, 1}, + {&__pyx_n_s_ExtraData___str, __pyx_k_ExtraData___str, sizeof(__pyx_k_ExtraData___str), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_No_more_data_to_unpack, __pyx_k_No_more_data_to_unpack, sizeof(__pyx_k_No_more_data_to_unpack), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_OutOfData, __pyx_k_OutOfData, sizeof(__pyx_k_OutOfData), 0, 0, 1, 1}, + {&__pyx_n_s_PackException, __pyx_k_PackException, sizeof(__pyx_k_PackException), 0, 0, 1, 1}, + {&__pyx_n_s_PackValueError, __pyx_k_PackValueError, sizeof(__pyx_k_PackValueError), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_allocate_internal_buff, __pyx_k_Unable_to_allocate_internal_buff, sizeof(__pyx_k_Unable_to_allocate_internal_buff), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_enlarge_internal_buffe, __pyx_k_Unable_to_enlarge_internal_buffe, sizeof(__pyx_k_Unable_to_enlarge_internal_buffe), 0, 0, 1, 0}, + {&__pyx_n_s_UnpackException, __pyx_k_UnpackException, sizeof(__pyx_k_UnpackException), 0, 0, 1, 1}, + {&__pyx_n_s_UnpackValueError, __pyx_k_UnpackValueError, sizeof(__pyx_k_UnpackValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unpack_failed_error_d, __pyx_k_Unpack_failed_error_d, sizeof(__pyx_k_Unpack_failed_error_d), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, + {&__pyx_n_s_autoreset, __pyx_k_autoreset, sizeof(__pyx_k_autoreset), 0, 0, 1, 1}, + {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, + {&__pyx_n_s_buf_len, __pyx_k_buf_len, sizeof(__pyx_k_buf_len), 0, 0, 1, 1}, + {&__pyx_kp_s_can_t_serialize_r, __pyx_k_can_t_serialize_r, sizeof(__pyx_k_can_t_serialize_r), 0, 0, 1, 0}, + {&__pyx_kp_s_cannot_pack_s, __pyx_k_cannot_pack_s, sizeof(__pyx_k_cannot_pack_s), 0, 0, 1, 0}, + {&__pyx_n_s_cenc, __pyx_k_cenc, sizeof(__pyx_k_cenc), 0, 0, 1, 1}, + {&__pyx_n_s_cerr, __pyx_k_cerr, sizeof(__pyx_k_cerr), 0, 0, 1, 1}, + {&__pyx_n_s_ctx, __pyx_k_ctx, sizeof(__pyx_k_ctx), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_kp_s_default_must_be_a_callable, __pyx_k_default_must_be_a_callable, sizeof(__pyx_k_default_must_be_a_callable), 0, 0, 1, 0}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_extra, __pyx_k_extra, sizeof(__pyx_k_extra), 0, 0, 1, 1}, + {&__pyx_n_s_file_like, __pyx_k_file_like, sizeof(__pyx_k_file_like), 0, 0, 1, 1}, + {&__pyx_kp_s_file_like_read_must_be_a_callab, __pyx_k_file_like_read_must_be_a_callab, sizeof(__pyx_k_file_like_read_must_be_a_callab), 0, 0, 1, 0}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, + {&__pyx_n_s_list_hook, __pyx_k_list_hook, sizeof(__pyx_k_list_hook), 0, 0, 1, 1}, + {&__pyx_kp_s_list_hook_must_be_a_callable, __pyx_k_list_hook_must_be_a_callable, sizeof(__pyx_k_list_hook_must_be_a_callable), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max_buffer_size, __pyx_k_max_buffer_size, sizeof(__pyx_k_max_buffer_size), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object_hook, __pyx_k_object_hook, sizeof(__pyx_k_object_hook), 0, 0, 1, 1}, + {&__pyx_kp_s_object_hook_must_be_a_callable, __pyx_k_object_hook_must_be_a_callable, sizeof(__pyx_k_object_hook_must_be_a_callable), 0, 0, 1, 0}, + {&__pyx_n_s_object_pairs_hook, __pyx_k_object_pairs_hook, sizeof(__pyx_k_object_pairs_hook), 0, 0, 1, 1}, + {&__pyx_kp_s_object_pairs_hook_and_object_hoo, __pyx_k_object_pairs_hook_and_object_hoo, sizeof(__pyx_k_object_pairs_hook_and_object_hoo), 0, 0, 1, 0}, + {&__pyx_kp_s_object_pairs_hook_must_be_a_call, __pyx_k_object_pairs_hook_must_be_a_call, sizeof(__pyx_k_object_pairs_hook_must_be_a_call), 0, 0, 1, 0}, + {&__pyx_n_s_off, __pyx_k_off, sizeof(__pyx_k_off), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_packb, __pyx_k_packb, sizeof(__pyx_k_packb), 0, 0, 1, 1}, + {&__pyx_n_s_packed, __pyx_k_packed, sizeof(__pyx_k_packed), 0, 0, 1, 1}, + {&__pyx_n_s_packer, __pyx_k_packer, sizeof(__pyx_k_packer), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_msgpack, __pyx_k_pandas_msgpack, sizeof(__pyx_k_pandas_msgpack), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, + {&__pyx_n_s_read_size, __pyx_k_read_size, sizeof(__pyx_k_read_size), 0, 0, 1, 1}, + {&__pyx_kp_s_read_size_should_be_less_or_equa, __pyx_k_read_size_should_be_less_or_equa, sizeof(__pyx_k_read_size_should_be_less_or_equa), 0, 0, 1, 0}, + {&__pyx_kp_s_recursion_limit_exceeded, __pyx_k_recursion_limit_exceeded, sizeof(__pyx_k_recursion_limit_exceeded), 0, 0, 1, 0}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1}, + {&__pyx_n_s_strict, __pyx_k_strict, sizeof(__pyx_k_strict), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_unicode_errors, __pyx_k_unicode_errors, sizeof(__pyx_k_unicode_errors), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_kp_s_unpack_b_recieved_extra_data, __pyx_k_unpack_b_recieved_extra_data, sizeof(__pyx_k_unpack_b_recieved_extra_data), 0, 0, 1, 0}, + {&__pyx_n_s_unpackb, __pyx_k_unpackb, sizeof(__pyx_k_unpackb), 0, 0, 1, 1}, + {&__pyx_n_s_unpacked, __pyx_k_unpacked, sizeof(__pyx_k_unpacked), 0, 0, 1, 1}, + {&__pyx_kp_s_unpacker_feed_is_not_be_able_to, __pyx_k_unpacker_feed_is_not_be_able_to, sizeof(__pyx_k_unpacker_feed_is_not_be_able_to), 0, 0, 1, 0}, + {&__pyx_n_s_use_list, __pyx_k_use_list, sizeof(__pyx_k_use_list), 0, 0, 1, 1}, + {&__pyx_n_s_use_single_float, __pyx_k_use_single_float, sizeof(__pyx_k_use_single_float), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_write_bytes, __pyx_k_write_bytes, sizeof(__pyx_k_write_bytes), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/msgpack.pyx":131 + * self.pk.buf = malloc(buf_size); + * if self.pk.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<< + * self.pk.buf_size = buf_size + * self.pk.length = 0 + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Unable_to_allocate_internal_buff); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/msgpack.pyx":141 + * if default is not None: + * if not PyCallable_Check(default): + * raise TypeError("default must be a callable.") # <<<<<<<<<<<<<< + * self._default = default + * if encoding is None: + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_default_must_be_a_callable); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/msgpack.pyx":148 + * else: + * if isinstance(encoding, unicode): + * self._bencoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * else: + * self._bencoding = encoding + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/msgpack.pyx":153 + * self.encoding = PyBytes_AsString(self._bencoding) + * if isinstance(unicode_errors, unicode): + * self._berrors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * else: + * self._berrors = unicode_errors + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/msgpack.pyx":177 + * + * if nest_limit < 0: + * raise PackValueError("recursion limit exceeded.") # <<<<<<<<<<<<<< + * + * if o is None: + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_recursion_limit_exceeded); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/msgpack.pyx":210 + * elif PyUnicode_Check(o): + * if not self.encoding: + * raise TypeError("Can't encode unicode string: no encoding is specified") # <<<<<<<<<<<<<< + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + * rawval = o + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_t_encode_unicode_string_no_e); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/msgpack.pyx":342 + * + * if object_hook is not None and object_pairs_hook is not None: + * raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") # <<<<<<<<<<<<<< + * + * if object_hook is not None: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_object_pairs_hook_and_object_hoo); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/msgpack.pyx":346 + * if object_hook is not None: + * if not PyCallable_Check(object_hook): + * raise TypeError("object_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.object_hook = object_hook + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_object_hook_must_be_a_callable); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/msgpack.pyx":353 + * else: + * if not PyCallable_Check(object_pairs_hook): + * raise TypeError("object_pairs_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.object_hook = object_pairs_hook + * ctx.user.has_pairs_hook = True + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_object_pairs_hook_must_be_a_call); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "pandas/msgpack.pyx":359 + * if list_hook is not None: + * if not PyCallable_Check(list_hook): + * raise TypeError("list_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.list_hook = list_hook + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_list_hook_must_be_a_callable); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "pandas/msgpack.pyx":386 + * if encoding is not None: + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * cenc = PyBytes_AsString(encoding) + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/msgpack.pyx":391 + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * cerr = PyBytes_AsString(unicode_errors) + * + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/msgpack.pyx":495 + * self.file_like_read = file_like.read + * if not PyCallable_Check(self.file_like_read): + * raise ValueError("`file_like.read` must be a callable.") # <<<<<<<<<<<<<< + * if not max_buffer_size: + * max_buffer_size = INT_MAX + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_file_like_read_must_be_a_callab); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "pandas/msgpack.pyx":499 + * max_buffer_size = INT_MAX + * if read_size > max_buffer_size: + * raise ValueError("read_size should be less or equal to max_buffer_size") # <<<<<<<<<<<<<< + * if not read_size: + * read_size = min(max_buffer_size, 1024**2) + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_read_size_should_be_less_or_equa); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/msgpack.pyx":506 + * self.buf = malloc(read_size) + * if self.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<< + * self.buf_size = read_size + * self.buf_head = 0 + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_allocate_internal_buff); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "pandas/msgpack.pyx":513 + * if encoding is not None: + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * self.encoding = encoding + * cenc = PyBytes_AsString(encoding) + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "pandas/msgpack.pyx":519 + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * self.unicode_errors = unicode_errors + * cerr = PyBytes_AsString(unicode_errors) + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "pandas/msgpack.pyx":530 + * cdef Py_ssize_t buf_len + * if self.file_like is not None: + * raise TypeError( # <<<<<<<<<<<<<< + * "unpacker.feed() is not be able to use with `file_like`.") + * PyObject_AsReadBuffer(next_bytes, &buf, &buf_len) + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unpacker_feed_is_not_be_able_to); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "pandas/msgpack.pyx":560 + * # self.buf still holds old buffer and will be freed during + * # obj destruction + * raise MemoryError("Unable to enlarge internal buffer.") # <<<<<<<<<<<<<< + * memcpy(new_buf, buf + head, tail - head) + * free(buf) + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_enlarge_internal_buffe); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "pandas/msgpack.pyx":604 + * continue + * if iter: + * raise StopIteration("No more data to unpack.") # <<<<<<<<<<<<<< + * else: + * raise OutOfData("No more data to unpack.") + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_No_more_data_to_unpack); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "pandas/msgpack.pyx":606 + * raise StopIteration("No more data to unpack.") + * else: + * raise OutOfData("No more data to unpack.") # <<<<<<<<<<<<<< + * else: + * raise ValueError("Unpack failed: error = %d" % (ret,)) + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_more_data_to_unpack); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/msgpack.pyx":37 + * + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): # <<<<<<<<<<<<<< + * self.unpacked = unpacked + * self.extra = extra + */ + __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_unpacked, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":41 + * self.extra = extra + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "unpack(b) recieved extra data." + * + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_str, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":320 + * return ret + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<< + * """ + * pack an object `o` and write it to stream).""" + */ + __pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_o, __pyx_n_s_stream, __pyx_n_s_default, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_packer); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pack, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":326 + * stream.write(packer.pack(o)) + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<< + * """ + * pack o and return packed bytes.""" + */ + __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_o, __pyx_n_s_default, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_use_single_float, __pyx_n_s_packer); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_packb, 326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + __pyx_tuple__37 = PyTuple_Pack(15, __pyx_n_s_packed, __pyx_n_s_object_hook, __pyx_n_s_list_hook, __pyx_n_s_use_list, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_object_pairs_hook, __pyx_n_s_ctx, __pyx_n_s_off, __pyx_n_s_ret, __pyx_n_s_buf, __pyx_n_s_buf_len, __pyx_n_s_cenc, __pyx_n_s_cerr, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_unpackb, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_s_stream, __pyx_n_s_object_hook, __pyx_n_s_list_hook, __pyx_n_s_use_list, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_object_pairs_hook); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_unpack, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initmsgpack(void); /*proto*/ +PyMODINIT_FUNC initmsgpack(void) +#else +PyMODINIT_FUNC PyInit_msgpack(void); /*proto*/ +PyMODINIT_FUNC PyInit_msgpack(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_msgpack(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("msgpack"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__msgpack) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.msgpack")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.msgpack", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_6pandas_7msgpack_Packer = &__pyx_vtable_6pandas_7msgpack_Packer; + __pyx_vtable_6pandas_7msgpack_Packer._pack = (int (*)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack *__pyx_optional_args))__pyx_f_6pandas_7msgpack_6Packer__pack; + __pyx_vtable_6pandas_7msgpack_Packer.pack = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7msgpack_6Packer_pack; + __pyx_vtable_6pandas_7msgpack_Packer.pack_pair = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, PyObject *, int))__pyx_f_6pandas_7msgpack_6Packer_pack_pair; + if (PyType_Ready(&__pyx_type_6pandas_7msgpack_Packer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7msgpack_Packer.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7msgpack_Packer.tp_dict, __pyx_vtabptr_6pandas_7msgpack_Packer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Packer", (PyObject *)&__pyx_type_6pandas_7msgpack_Packer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7msgpack_Packer = &__pyx_type_6pandas_7msgpack_Packer; + __pyx_vtabptr_6pandas_7msgpack_Unpacker = &__pyx_vtable_6pandas_7msgpack_Unpacker; + __pyx_vtable_6pandas_7msgpack_Unpacker.append_buffer = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, void *, Py_ssize_t))__pyx_f_6pandas_7msgpack_8Unpacker_append_buffer; + __pyx_vtable_6pandas_7msgpack_Unpacker.read_from_file = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Unpacker *))__pyx_f_6pandas_7msgpack_8Unpacker_read_from_file; + __pyx_vtable_6pandas_7msgpack_Unpacker._unpack = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, execute_fn, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack *__pyx_optional_args))__pyx_f_6pandas_7msgpack_8Unpacker__unpack; + if (PyType_Ready(&__pyx_type_6pandas_7msgpack_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7msgpack_Unpacker.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7msgpack_Unpacker.tp_dict, __pyx_vtabptr_6pandas_7msgpack_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Unpacker", (PyObject *)&__pyx_type_6pandas_7msgpack_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7msgpack_Unpacker = &__pyx_type_6pandas_7msgpack_Unpacker; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/msgpack.pyx":17 + * + * import cython + * import numpy as np # <<<<<<<<<<<<<< + * from numpy cimport * + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":20 + * from numpy cimport * + * + * class UnpackException(IOError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_builtin_IOError); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_IOError); + __Pyx_GIVEREF(__pyx_builtin_IOError); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UnpackException, __pyx_n_s_UnpackException, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UnpackException, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnpackException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":24 + * + * + * class BufferFull(UnpackException): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_BufferFull, __pyx_n_s_BufferFull, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BufferFull, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferFull, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":28 + * + * + * class OutOfData(UnpackException): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_OutOfData, __pyx_n_s_OutOfData, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OutOfData, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutOfData, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":32 + * + * + * class UnpackValueError(UnpackException, ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_UnpackValueError, __pyx_n_s_UnpackValueError, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_UnpackValueError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnpackValueError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":36 + * + * + * class ExtraData(ValueError): # <<<<<<<<<<<<<< + * def __init__(self, unpacked, extra): + * self.unpacked = unpacked + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ExtraData, __pyx_n_s_ExtraData, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/msgpack.pyx":37 + * + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): # <<<<<<<<<<<<<< + * self.unpacked = unpacked + * self.extra = extra + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_9ExtraData_1__init__, 0, __pyx_n_s_ExtraData___init, NULL, __pyx_n_s_pandas_msgpack, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":41 + * self.extra = extra + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "unpack(b) recieved extra data." + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_9ExtraData_3__str__, 0, __pyx_n_s_ExtraData___str, NULL, __pyx_n_s_pandas_msgpack, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":36 + * + * + * class ExtraData(ValueError): # <<<<<<<<<<<<<< + * def __init__(self, unpacked, extra): + * self.unpacked = unpacked + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ExtraData, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExtraData, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":44 + * return "unpack(b) recieved extra data." + * + * class PackException(IOError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_IOError); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_IOError); + __Pyx_GIVEREF(__pyx_builtin_IOError); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PackException, __pyx_n_s_PackException, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PackException, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PackException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":47 + * pass + * + * class PackValueError(PackException, ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PackValueError, __pyx_n_s_PackValueError, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PackValueError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PackValueError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":95 + * int msgpack_pack_raw_body(msgpack_packer* pk, char* body, size_t l) + * + * cdef int DEFAULT_RECURSE_LIMIT=511 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT = 511; + + /* "pandas/msgpack.pyx":163 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<< + * cdef long long llval + * cdef unsigned long long ullval + */ + __pyx_k__5 = __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT; + + /* "pandas/msgpack.pyx":320 + * return ret + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<< + * """ + * pack an object `o` and write it to stream).""" + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_1pack, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pack, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":326 + * stream.write(packer.pack(o)) + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<< + * """ + * pack o and return packed bytes.""" + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_3packb, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_packb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_5unpackb, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpackb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_7unpack, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":1 + * # coding: utf-8 # <<<<<<<<<<<<<< + * #cython: embedsignature=True + * #cython: profile=False + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.msgpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.msgpack"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int is_tuple, int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + } else { + if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { + __Pyx_UnpackTupleError(tuple, 2); + goto bad; + } +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); + if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); + if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); + value2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(value1); + Py_INCREF(value2); +#endif + if (decref_tuple) { Py_DECREF(tuple); } + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; +#if !CYTHON_COMPILING_IN_PYPY + if (is_dict) { + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#endif + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(size_t)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (size_t) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(size_t) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(size_t)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(size_t) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(size_t) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong) + } else if (sizeof(size_t) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *x) { + const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned PY_LONG_LONG"); + return (unsigned PY_LONG_LONG) -1; + } + return (unsigned PY_LONG_LONG) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned PY_LONG_LONG"); + return (unsigned PY_LONG_LONG) -1; + } + if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyLong_AsLong) + } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned PY_LONG_LONG val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned PY_LONG_LONG) -1; + } + } else { + unsigned PY_LONG_LONG val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (unsigned PY_LONG_LONG) -1; + val = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) { + const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(PY_LONG_LONG) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to PY_LONG_LONG"); + return (PY_LONG_LONG) -1; + } + return (PY_LONG_LONG) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to PY_LONG_LONG"); + return (PY_LONG_LONG) -1; + } + if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(PY_LONG_LONG) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyLong_AsLong) + } else if (sizeof(PY_LONG_LONG) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + PY_LONG_LONG val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (PY_LONG_LONG) -1; + } + } else { + PY_LONG_LONG val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (PY_LONG_LONG) -1; + val = __Pyx_PyInt_As_PY_LONG_LONG(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files/pandas/parser.c b/cythonized-files/pandas/parser.c new file mode 100644 index 00000000..267fb8ba --- /dev/null +++ b/cythonized-files/pandas/parser.c @@ -0,0 +1,31721 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__parser +#define __PYX_HAVE_API__pandas__parser +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "pythread.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "numpy_helper.h" +#include "khash_python.h" +#include "headers/stdint.h" +#include "headers/portable.h" +#include "parser/tokenizer.h" +#include "parser/io.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "parser.pyx", + "util.pxd", + "numpy.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_6parser_TextReader; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "pandas/parser.pyx":232 + * + * + * cdef class TextReader: # <<<<<<<<<<<<<< + * ''' + * + */ +struct __pyx_obj_6pandas_6parser_TextReader { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_6parser_TextReader *__pyx_vtab; + parser_t *parser; + PyObject *file_handle; + PyObject *na_fvalues; + int na_filter; + int verbose; + int has_usecols; + int has_mi_columns; + int parser_start; + PyObject *clocks; + char *c_encoding; + int leading_cols; + int table_width; + int skip_footer; + int buffer_lines; + PyObject *allow_leading_cols; + PyObject *delimiter; + PyObject *converters; + PyObject *delim_whitespace; + PyObject *na_values; + PyObject *true_values; + PyObject *false_values; + PyObject *memory_map; + PyObject *as_recarray; + PyObject *header; + PyObject *orig_header; + PyObject *names; + PyObject *header_start; + PyObject *header_end; + PyObject *index_col; + PyObject *low_memory; + PyObject *skiprows; + PyObject *compact_ints; + PyObject *use_unsigned; + PyObject *dtype; + PyObject *encoding; + PyObject *compression; + PyObject *mangle_dupe_cols; + PyObject *tupleize_cols; + PyObject *noconvert; + PyObject *usecols; +}; + + + +struct __pyx_vtabstruct_6pandas_6parser_TextReader { + PyObject *(*_make_skiprow_set)(struct __pyx_obj_6pandas_6parser_TextReader *); + PyObject *(*_setup_parser_source)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *); + PyObject *(*_get_header)(struct __pyx_obj_6pandas_6parser_TextReader *); + PyObject *(*_implicit_index_count)(struct __pyx_obj_6pandas_6parser_TextReader *); + PyObject *(*_read_low_memory)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *); + PyObject *(*_tokenize_rows)(struct __pyx_obj_6pandas_6parser_TextReader *, size_t); + PyObject *(*_read_rows)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, int); + PyObject *(*_start_clock)(struct __pyx_obj_6pandas_6parser_TextReader *); + PyObject *(*_end_clock)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *); + PyObject *(*_convert_tokens)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, PyObject *, int, kh_str_t *, PyObject *); + PyObject *(*_convert_with_dtype)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, Py_ssize_t, int, int, int, int, kh_str_t *, PyObject *); + PyObject *(*_string_convert)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, int, kh_str_t *); + PyObject *(*_get_na_list)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, PyObject *); + PyObject *(*_free_na_set)(struct __pyx_obj_6pandas_6parser_TextReader *, kh_str_t *); + PyObject *(*_get_column_name)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, Py_ssize_t); +}; +static struct __pyx_vtabstruct_6pandas_6parser_TextReader *__pyx_vtabptr_6pandas_6parser_TextReader; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_6parser_10TextReader__convert_tokens(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, PyObject *, int, kh_str_t *, PyObject *); +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*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); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/ +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /*proto*/ + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_PyObject_PopIndex(L, ix) (PyList_CheckExact(L) ? \ + __Pyx_PyList_PopIndex(L, ix) : __Pyx__PyObject_PopIndex(L, ix)) +static PyObject* __Pyx_PyList_PopIndex(PyObject* L, Py_ssize_t ix); /*proto*/ +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, Py_ssize_t ix); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +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); + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'util' */ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'pandas.parser' */ +static PyTypeObject *__pyx_ptype_6pandas_6parser_TextReader = 0; +static int __pyx_v_6pandas_6parser_PY3; +static double __pyx_v_6pandas_6parser_INF; +static double __pyx_v_6pandas_6parser_NEGINF; +static PyObject *__pyx_v_6pandas_6parser__true_values = 0; +static PyObject *__pyx_v_6pandas_6parser__false_values = 0; +static char *__pyx_v_6pandas_6parser_cinf; +static char *__pyx_v_6pandas_6parser_cneginf; +static PyObject *__pyx_v_6pandas_6parser_dtype_cast_order = 0; +static PyObject *__pyx_f_6pandas_6parser_asbytes(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__string_box_factorize(parser_t *, int, int, int, int, kh_str_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__string_box_utf8(parser_t *, int, int, int, int, kh_str_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__string_box_decode(parser_t *, int, int, int, int, kh_str_t *, char *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__to_fw_string(parser_t *, int, int, int, size_t); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__try_double(parser_t *, int, int, int, int, kh_str_t *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__try_int64(parser_t *, int, int, int, int, kh_str_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__try_bool(parser_t *, int, int, int, int, kh_str_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__try_bool_flex(parser_t *, int, int, int, int, kh_str_t *, kh_str_t *, kh_str_t *); /*proto*/ +static kh_str_t *__pyx_f_6pandas_6parser_kset_from_list(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser_raise_parser_error(PyObject *, parser_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__apply_converter(PyObject *, parser_t *, int, int, int, char *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__fill_structured_column(char *, char *, int, int, int, int); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +#define __Pyx_MODULE_NAME "pandas.parser" +int __pyx_module_is_main_pandas__parser = 0; + +/* Implementation of 'pandas.parser' */ +static PyObject *__pyx_builtin_NameError; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_ord; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_IOError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_StopIteration; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_RuntimeError; +static int __pyx_pf_6pandas_6parser_10TextReader___cinit__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_delimiter, PyObject *__pyx_v_header, CYTHON_UNUSED PyObject *__pyx_v_header_start, CYTHON_UNUSED PyObject *__pyx_v_header_end, PyObject *__pyx_v_index_col, PyObject *__pyx_v_names, PyObject *__pyx_v_memory_map, PyObject *__pyx_v_tokenize_chunksize, PyObject *__pyx_v_delim_whitespace, PyObject *__pyx_v_compression, PyObject *__pyx_v_converters, PyObject *__pyx_v_as_recarray, PyObject *__pyx_v_skipinitialspace, PyObject *__pyx_v_escapechar, PyObject *__pyx_v_doublequote, PyObject *__pyx_v_quotechar, PyObject *__pyx_v_quoting, PyObject *__pyx_v_lineterminator, PyObject *__pyx_v_encoding, PyObject *__pyx_v_comment, PyObject *__pyx_v_decimal, PyObject *__pyx_v_thousands, PyObject *__pyx_v_dtype, PyObject *__pyx_v_usecols, PyObject *__pyx_v_error_bad_lines, PyObject *__pyx_v_warn_bad_lines, PyObject *__pyx_v_na_filter, PyObject *__pyx_v_na_values, PyObject *__pyx_v_na_fvalues, PyObject *__pyx_v_true_values, PyObject *__pyx_v_false_values, PyObject *__pyx_v_compact_ints, PyObject *__pyx_v_allow_leading_cols, PyObject *__pyx_v_use_unsigned, PyObject *__pyx_v_low_memory, CYTHON_UNUSED PyObject *__pyx_v_buffer_lines, PyObject *__pyx_v_skiprows, PyObject *__pyx_v_skip_footer, PyObject *__pyx_v_verbose, PyObject *__pyx_v_mangle_dupe_cols, PyObject *__pyx_v_tupleize_cols); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_2__init__(CYTHON_UNUSED struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwards); /* proto */ +static void __pyx_pf_6pandas_6parser_10TextReader_4__dealloc__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_6set_error_bad_lines(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, int __pyx_v_status); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8read(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10debug_print(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12set_noconvert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_14remove_noconvert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16_convert_column_data(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_upcast_na, CYTHON_UNUSED PyObject *__pyx_v_footer); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_18_get_converter(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12leading_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12leading_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11table_width___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11table_width_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11skip_footer___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11skip_footer_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12buffer_lines___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12buffer_lines_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9delimiter___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9delimiter_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9delimiter_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10converters___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10converters_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10converters_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9na_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9na_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9na_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11true_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11true_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11true_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12false_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12false_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12false_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10memory_map___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10memory_map_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10memory_map_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11as_recarray___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_6header___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_6header_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_6header_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11orig_header___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11orig_header_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11orig_header_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_5names___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_5names_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_5names_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12header_start___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12header_start_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12header_start_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10header_end___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10header_end_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10header_end_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9index_col___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9index_col_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9index_col_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10low_memory___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10low_memory_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10low_memory_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8skiprows___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_8skiprows_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_8skiprows_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12compact_ints___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12use_unsigned___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_5dtype___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_5dtype_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_5dtype_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8encoding___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_8encoding_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_8encoding_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11compression___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11compression_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11compression_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9noconvert___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9noconvert_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9noconvert_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_7usecols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_7usecols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_7usecols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser__ensure_encoded(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_2_is_file_like(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_4_maybe_upcast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_6downcast_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_use_unsigned); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_8_concatenate_chunks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chunks); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10_compute_na_values(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_12_to_structured_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_names); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_14_maybe_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_6parser_TextReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_[] = ","; +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_M[] = "M"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_S[] = "S"; +static char __pyx_k_U[] = "U"; +static char __pyx_k_a[] = "a"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_c[] = "c"; +static char __pyx_k_d[] = "%d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_u[] = "u"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_NA[] = "NA"; +static char __pyx_k_O8[] = "|O8"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k__3[] = "\""; +static char __pyx_k__4[] = "."; +static char __pyx_k_b1[] = "|b1"; +static char __pyx_k_dt[] = "dt"; +static char __pyx_k_f8[] = "f8"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_io[] = "io"; +static char __pyx_k_mn[] = "mn"; +static char __pyx_k_mx[] = "mx"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_os[] = "os"; +static char __pyx_k_rb[] = "rb"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k_S_d[] = "|S%d"; +static char __pyx_k__16[] = ""; +static char __pyx_k__35[] = " "; +static char __pyx_k__45[] = "*"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_buf[] = "buf"; +static char __pyx_k_bz2[] = "bz2"; +static char __pyx_k_d_2[] = "d"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_lib[] = "lib"; +static char __pyx_k_lst[] = "lst"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_ord[] = "ord"; +static char __pyx_k_pop[] = "pop"; +static char __pyx_k_s_d[] = "%s.%d"; +static char __pyx_k_str[] = "str"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_NA_2[] = "#NA"; +static char __pyx_k_NULL[] = "NULL"; +static char __pyx_k_TRUE[] = "TRUE"; +static char __pyx_k_True[] = "True"; +static char __pyx_k_arrs[] = "arrs"; +static char __pyx_k_bool[] = "bool_"; +static char __pyx_k_f8_2[] = " 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delimiter); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_header); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_header_start); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_header_end); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_col); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_names); + if (value) { values[6] = value; kw_args--; } + } + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_memory_map); + if (value) { values[7] = value; kw_args--; } + } + case 8: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tokenize_chunksize); + if (value) { values[8] = value; kw_args--; } + } + case 9: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delim_whitespace); + if (value) { values[9] = value; kw_args--; } + } + case 10: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression); + if (value) { values[10] = value; kw_args--; } + } + case 11: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_converters); + if (value) { values[11] = value; kw_args--; } + } + case 12: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_as_recarray); + if (value) { values[12] = value; kw_args--; } + } + case 13: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skipinitialspace); + if (value) { values[13] = value; kw_args--; } + } + case 14: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_escapechar); + if (value) { values[14] = value; kw_args--; } + } + case 15: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_doublequote); + if (value) { values[15] = value; kw_args--; } + } + case 16: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_quotechar); + if (value) { values[16] = value; kw_args--; } + } + case 17: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_quoting); + if (value) { values[17] = value; kw_args--; } + } + case 18: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lineterminator); + if (value) { values[18] = value; kw_args--; } + } + case 19: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[19] = value; kw_args--; } + } + case 20: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_comment); + if (value) { values[20] = value; kw_args--; } + } + case 21: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_decimal); + if (value) { values[21] = value; kw_args--; } + } + case 22: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thousands); + if (value) { values[22] = value; kw_args--; } + } + case 23: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); + if (value) { values[23] = value; kw_args--; } + } + case 24: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_usecols); + if (value) { values[24] = value; kw_args--; } + } + case 25: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_error_bad_lines); + if (value) { values[25] = value; kw_args--; } + } + case 26: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_warn_bad_lines); + if (value) { values[26] = value; kw_args--; } + } + case 27: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_filter); + if (value) { values[27] = value; kw_args--; } + } + case 28: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_values); + if (value) { values[28] = value; kw_args--; } + } + case 29: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_fvalues); + if (value) { values[29] = value; kw_args--; } + } + case 30: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_true_values); + if (value) { values[30] = value; kw_args--; } + } + case 31: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_false_values); + if (value) { values[31] = value; kw_args--; } + } + case 32: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compact_ints); + if (value) { values[32] = value; kw_args--; } + } + case 33: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allow_leading_cols); + if (value) { values[33] = value; kw_args--; } + } + case 34: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_unsigned); + if (value) { values[34] = value; kw_args--; } + } + case 35: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low_memory); + if (value) { values[35] = value; kw_args--; } + } + case 36: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer_lines); + if (value) { values[36] = value; kw_args--; } + } + case 37: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skiprows); + if (value) { values[37] = value; kw_args--; } + } + case 38: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip_footer); + if (value) { values[38] = value; kw_args--; } + } + case 39: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verbose); + if (value) { values[39] = value; kw_args--; } + } + case 40: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mangle_dupe_cols); + if (value) { values[40] = value; kw_args--; } + } + case 41: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tupleize_cols); + if (value) { values[41] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 42: values[41] = PyTuple_GET_ITEM(__pyx_args, 41); + case 41: values[40] = PyTuple_GET_ITEM(__pyx_args, 40); + case 40: values[39] = PyTuple_GET_ITEM(__pyx_args, 39); + case 39: values[38] = PyTuple_GET_ITEM(__pyx_args, 38); + case 38: values[37] = PyTuple_GET_ITEM(__pyx_args, 37); + case 37: values[36] = PyTuple_GET_ITEM(__pyx_args, 36); + case 36: values[35] = PyTuple_GET_ITEM(__pyx_args, 35); + case 35: values[34] = PyTuple_GET_ITEM(__pyx_args, 34); + case 34: values[33] = PyTuple_GET_ITEM(__pyx_args, 33); + case 33: values[32] = PyTuple_GET_ITEM(__pyx_args, 32); + case 32: values[31] = PyTuple_GET_ITEM(__pyx_args, 31); + case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30); + case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29); + case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28); + case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27); + case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26); + case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25); + case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24); + case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23); + case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); + case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21); + case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); + case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19); + case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); + case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_source = values[0]; + __pyx_v_delimiter = values[1]; + __pyx_v_header = values[2]; + __pyx_v_header_start = values[3]; + __pyx_v_header_end = values[4]; + __pyx_v_index_col = values[5]; + __pyx_v_names = values[6]; + __pyx_v_memory_map = values[7]; + __pyx_v_tokenize_chunksize = values[8]; + __pyx_v_delim_whitespace = values[9]; + __pyx_v_compression = values[10]; + __pyx_v_converters = values[11]; + __pyx_v_as_recarray = values[12]; + __pyx_v_skipinitialspace = values[13]; + __pyx_v_escapechar = values[14]; + __pyx_v_doublequote = values[15]; + __pyx_v_quotechar = values[16]; + __pyx_v_quoting = values[17]; + __pyx_v_lineterminator = values[18]; + __pyx_v_encoding = values[19]; + __pyx_v_comment = values[20]; + __pyx_v_decimal = values[21]; + __pyx_v_thousands = values[22]; + __pyx_v_dtype = values[23]; + __pyx_v_usecols = values[24]; + __pyx_v_error_bad_lines = values[25]; + __pyx_v_warn_bad_lines = values[26]; + __pyx_v_na_filter = values[27]; + __pyx_v_na_values = values[28]; + __pyx_v_na_fvalues = values[29]; + __pyx_v_true_values = values[30]; + __pyx_v_false_values = values[31]; + __pyx_v_compact_ints = values[32]; + __pyx_v_allow_leading_cols = values[33]; + __pyx_v_use_unsigned = values[34]; + __pyx_v_low_memory = values[35]; + __pyx_v_buffer_lines = values[36]; + __pyx_v_skiprows = values[37]; + __pyx_v_skip_footer = values[38]; + __pyx_v_verbose = values[39]; + __pyx_v_mangle_dupe_cols = values[40]; + __pyx_v_tupleize_cols = values[41]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 42, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader___cinit__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_source, __pyx_v_delimiter, __pyx_v_header, __pyx_v_header_start, __pyx_v_header_end, __pyx_v_index_col, __pyx_v_names, __pyx_v_memory_map, __pyx_v_tokenize_chunksize, __pyx_v_delim_whitespace, __pyx_v_compression, __pyx_v_converters, __pyx_v_as_recarray, __pyx_v_skipinitialspace, __pyx_v_escapechar, __pyx_v_doublequote, __pyx_v_quotechar, __pyx_v_quoting, __pyx_v_lineterminator, __pyx_v_encoding, __pyx_v_comment, __pyx_v_decimal, __pyx_v_thousands, __pyx_v_dtype, __pyx_v_usecols, __pyx_v_error_bad_lines, __pyx_v_warn_bad_lines, __pyx_v_na_filter, __pyx_v_na_values, __pyx_v_na_fvalues, __pyx_v_true_values, __pyx_v_false_values, __pyx_v_compact_ints, __pyx_v_allow_leading_cols, __pyx_v_use_unsigned, __pyx_v_low_memory, __pyx_v_buffer_lines, __pyx_v_skiprows, __pyx_v_skip_footer, __pyx_v_verbose, __pyx_v_mangle_dupe_cols, __pyx_v_tupleize_cols); + + /* "pandas/parser.pyx":266 + * set noconvert, usecols + * + * def __cinit__(self, source, # <<<<<<<<<<<<<< + * delimiter=b',', + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader___cinit__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_delimiter, PyObject *__pyx_v_header, CYTHON_UNUSED PyObject *__pyx_v_header_start, CYTHON_UNUSED PyObject *__pyx_v_header_end, PyObject *__pyx_v_index_col, PyObject *__pyx_v_names, PyObject *__pyx_v_memory_map, PyObject *__pyx_v_tokenize_chunksize, PyObject *__pyx_v_delim_whitespace, PyObject *__pyx_v_compression, PyObject *__pyx_v_converters, PyObject *__pyx_v_as_recarray, PyObject *__pyx_v_skipinitialspace, PyObject *__pyx_v_escapechar, PyObject *__pyx_v_doublequote, PyObject *__pyx_v_quotechar, PyObject *__pyx_v_quoting, PyObject *__pyx_v_lineterminator, PyObject *__pyx_v_encoding, PyObject *__pyx_v_comment, PyObject *__pyx_v_decimal, PyObject *__pyx_v_thousands, PyObject *__pyx_v_dtype, PyObject *__pyx_v_usecols, PyObject *__pyx_v_error_bad_lines, PyObject *__pyx_v_warn_bad_lines, PyObject *__pyx_v_na_filter, PyObject *__pyx_v_na_values, PyObject *__pyx_v_na_fvalues, PyObject *__pyx_v_true_values, PyObject *__pyx_v_false_values, PyObject *__pyx_v_compact_ints, PyObject *__pyx_v_allow_leading_cols, PyObject *__pyx_v_use_unsigned, PyObject *__pyx_v_low_memory, CYTHON_UNUSED PyObject *__pyx_v_buffer_lines, PyObject *__pyx_v_skiprows, PyObject *__pyx_v_skip_footer, PyObject *__pyx_v_verbose, PyObject *__pyx_v_mangle_dupe_cols, PyObject *__pyx_v_tupleize_cols) { + PyObject *__pyx_v_conv = NULL; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + long __pyx_v_heuristic; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + char __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_header); + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_INCREF(__pyx_v_dtype); + __Pyx_INCREF(__pyx_v_na_fvalues); + + /* "pandas/parser.pyx":320 + * tupleize_cols=False): + * + * self.parser = parser_new() # <<<<<<<<<<<<<< + * self.parser.chunksize = tokenize_chunksize + * + */ + __pyx_v_self->parser = parser_new(); + + /* "pandas/parser.pyx":321 + * + * self.parser = parser_new() + * self.parser.chunksize = tokenize_chunksize # <<<<<<<<<<<<<< + * + * self.mangle_dupe_cols=mangle_dupe_cols + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_tokenize_chunksize); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->chunksize = __pyx_t_1; + + /* "pandas/parser.pyx":323 + * self.parser.chunksize = tokenize_chunksize + * + * self.mangle_dupe_cols=mangle_dupe_cols # <<<<<<<<<<<<<< + * self.tupleize_cols=tupleize_cols + * + */ + __Pyx_INCREF(__pyx_v_mangle_dupe_cols); + __Pyx_GIVEREF(__pyx_v_mangle_dupe_cols); + __Pyx_GOTREF(__pyx_v_self->mangle_dupe_cols); + __Pyx_DECREF(__pyx_v_self->mangle_dupe_cols); + __pyx_v_self->mangle_dupe_cols = __pyx_v_mangle_dupe_cols; + + /* "pandas/parser.pyx":324 + * + * self.mangle_dupe_cols=mangle_dupe_cols + * self.tupleize_cols=tupleize_cols # <<<<<<<<<<<<<< + * + * # For timekeeping + */ + __Pyx_INCREF(__pyx_v_tupleize_cols); + __Pyx_GIVEREF(__pyx_v_tupleize_cols); + __Pyx_GOTREF(__pyx_v_self->tupleize_cols); + __Pyx_DECREF(__pyx_v_self->tupleize_cols); + __pyx_v_self->tupleize_cols = __pyx_v_tupleize_cols; + + /* "pandas/parser.pyx":327 + * + * # For timekeeping + * self.clocks = [] # <<<<<<<<<<<<<< + * + * self.compression = compression + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->clocks); + __Pyx_DECREF(__pyx_v_self->clocks); + __pyx_v_self->clocks = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":329 + * self.clocks = [] + * + * self.compression = compression # <<<<<<<<<<<<<< + * self.memory_map = memory_map + * + */ + __Pyx_INCREF(__pyx_v_compression); + __Pyx_GIVEREF(__pyx_v_compression); + __Pyx_GOTREF(__pyx_v_self->compression); + __Pyx_DECREF(__pyx_v_self->compression); + __pyx_v_self->compression = __pyx_v_compression; + + /* "pandas/parser.pyx":330 + * + * self.compression = compression + * self.memory_map = memory_map # <<<<<<<<<<<<<< + * + * self._setup_parser_source(source) + */ + __Pyx_INCREF(__pyx_v_memory_map); + __Pyx_GIVEREF(__pyx_v_memory_map); + __Pyx_GOTREF(__pyx_v_self->memory_map); + __Pyx_DECREF(__pyx_v_self->memory_map); + __pyx_v_self->memory_map = __pyx_v_memory_map; + + /* "pandas/parser.pyx":332 + * self.memory_map = memory_map + * + * self._setup_parser_source(source) # <<<<<<<<<<<<<< + * parser_set_default_options(self.parser) + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_setup_parser_source(__pyx_v_self, __pyx_v_source); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":333 + * + * self._setup_parser_source(source) + * parser_set_default_options(self.parser) # <<<<<<<<<<<<<< + * + * parser_init(self.parser) + */ + parser_set_default_options(__pyx_v_self->parser); + + /* "pandas/parser.pyx":335 + * parser_set_default_options(self.parser) + * + * parser_init(self.parser) # <<<<<<<<<<<<<< + * + * if delim_whitespace: + */ + parser_init(__pyx_v_self->parser); + + /* "pandas/parser.pyx":337 + * parser_init(self.parser) + * + * if delim_whitespace: # <<<<<<<<<<<<<< + * self.parser.delim_whitespace = delim_whitespace + * else: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_delim_whitespace); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/parser.pyx":338 + * + * if delim_whitespace: + * self.parser.delim_whitespace = delim_whitespace # <<<<<<<<<<<<<< + * else: + * if len(delimiter) > 1: + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_delim_whitespace); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->delim_whitespace = __pyx_t_1; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":340 + * self.parser.delim_whitespace = delim_whitespace + * else: + * if len(delimiter) > 1: # <<<<<<<<<<<<<< + * raise ValueError('only length-1 separators excluded right now') + * self.parser.delimiter = ord(delimiter) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_delimiter); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_4 > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":341 + * else: + * if len(delimiter) > 1: + * raise ValueError('only length-1 separators excluded right now') # <<<<<<<<<<<<<< + * self.parser.delimiter = ord(delimiter) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":342 + * if len(delimiter) > 1: + * raise ValueError('only length-1 separators excluded right now') + * self.parser.delimiter = ord(delimiter) # <<<<<<<<<<<<<< + * + * #---------------------------------------- + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_delimiter); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_delimiter); + __Pyx_GIVEREF(__pyx_v_delimiter); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->delimiter = __pyx_t_6; + } + __pyx_L3:; + + /* "pandas/parser.pyx":347 + * # parser options + * + * self.parser.doublequote = doublequote # <<<<<<<<<<<<<< + * self.parser.skipinitialspace = skipinitialspace + * + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_doublequote); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->doublequote = __pyx_t_1; + + /* "pandas/parser.pyx":348 + * + * self.parser.doublequote = doublequote + * self.parser.skipinitialspace = skipinitialspace # <<<<<<<<<<<<<< + * + * if lineterminator is not None: + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_skipinitialspace); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->skipinitialspace = __pyx_t_1; + + /* "pandas/parser.pyx":350 + * self.parser.skipinitialspace = skipinitialspace + * + * if lineterminator is not None: # <<<<<<<<<<<<<< + * if len(lineterminator) != 1: + * raise ValueError('Only length-1 line terminators supported') + */ + __pyx_t_3 = (__pyx_v_lineterminator != Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":351 + * + * if lineterminator is not None: + * if len(lineterminator) != 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 line terminators supported') + * self.parser.lineterminator = ord(lineterminator) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_lineterminator); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_t_4 != 1) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":352 + * if lineterminator is not None: + * if len(lineterminator) != 1: + * raise ValueError('Only length-1 line terminators supported') # <<<<<<<<<<<<<< + * self.parser.lineterminator = ord(lineterminator) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":353 + * if len(lineterminator) != 1: + * raise ValueError('Only length-1 line terminators supported') + * self.parser.lineterminator = ord(lineterminator) # <<<<<<<<<<<<<< + * + * if len(decimal) != 1: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_lineterminator); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_lineterminator); + __Pyx_GIVEREF(__pyx_v_lineterminator); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_2); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->lineterminator = __pyx_t_6; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":355 + * self.parser.lineterminator = ord(lineterminator) + * + * if len(decimal) != 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 decimal markers supported') + * self.parser.decimal = ord(decimal) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_decimal); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_t_4 != 1) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":356 + * + * if len(decimal) != 1: + * raise ValueError('Only length-1 decimal markers supported') # <<<<<<<<<<<<<< + * self.parser.decimal = ord(decimal) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":357 + * if len(decimal) != 1: + * raise ValueError('Only length-1 decimal markers supported') + * self.parser.decimal = ord(decimal) # <<<<<<<<<<<<<< + * + * if thousands is not None: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_decimal); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_decimal); + __Pyx_GIVEREF(__pyx_v_decimal); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->decimal = __pyx_t_6; + + /* "pandas/parser.pyx":359 + * self.parser.decimal = ord(decimal) + * + * if thousands is not None: # <<<<<<<<<<<<<< + * if len(thousands) != 1: + * raise ValueError('Only length-1 thousands markers supported') + */ + __pyx_t_7 = (__pyx_v_thousands != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":360 + * + * if thousands is not None: + * if len(thousands) != 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 thousands markers supported') + * self.parser.thousands = ord(thousands) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_thousands); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_4 != 1) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":361 + * if thousands is not None: + * if len(thousands) != 1: + * raise ValueError('Only length-1 thousands markers supported') # <<<<<<<<<<<<<< + * self.parser.thousands = ord(thousands) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":362 + * if len(thousands) != 1: + * raise ValueError('Only length-1 thousands markers supported') + * self.parser.thousands = ord(thousands) # <<<<<<<<<<<<<< + * + * if escapechar is not None: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_thousands); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_thousands); + __Pyx_GIVEREF(__pyx_v_thousands); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_2); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->thousands = __pyx_t_6; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/parser.pyx":364 + * self.parser.thousands = ord(thousands) + * + * if escapechar is not None: # <<<<<<<<<<<<<< + * if len(escapechar) != 1: + * raise ValueError('Only length-1 escapes supported') + */ + __pyx_t_3 = (__pyx_v_escapechar != Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":365 + * + * if escapechar is not None: + * if len(escapechar) != 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 escapes supported') + * self.parser.escapechar = ord(escapechar) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_escapechar); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_t_4 != 1) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":366 + * if escapechar is not None: + * if len(escapechar) != 1: + * raise ValueError('Only length-1 escapes supported') # <<<<<<<<<<<<<< + * self.parser.escapechar = ord(escapechar) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":367 + * if len(escapechar) != 1: + * raise ValueError('Only length-1 escapes supported') + * self.parser.escapechar = ord(escapechar) # <<<<<<<<<<<<<< + * + * self.parser.quotechar = ord(quotechar) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_escapechar); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_escapechar); + __Pyx_GIVEREF(__pyx_v_escapechar); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->escapechar = __pyx_t_6; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":369 + * self.parser.escapechar = ord(escapechar) + * + * self.parser.quotechar = ord(quotechar) # <<<<<<<<<<<<<< + * self.parser.quoting = quoting + * + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_quotechar); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_quotechar); + __Pyx_GIVEREF(__pyx_v_quotechar); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_2); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->quotechar = __pyx_t_6; + + /* "pandas/parser.pyx":370 + * + * self.parser.quotechar = ord(quotechar) + * self.parser.quoting = quoting # <<<<<<<<<<<<<< + * + * if comment is not None: + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_quoting); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->quoting = __pyx_t_1; + + /* "pandas/parser.pyx":372 + * self.parser.quoting = quoting + * + * if comment is not None: # <<<<<<<<<<<<<< + * if len(comment) > 1: + * raise ValueError('Only length-1 comment characters supported') + */ + __pyx_t_7 = (__pyx_v_comment != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":373 + * + * if comment is not None: + * if len(comment) > 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 comment characters supported') + * self.parser.commentchar = ord(comment) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_comment); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_4 > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":374 + * if comment is not None: + * if len(comment) > 1: + * raise ValueError('Only length-1 comment characters supported') # <<<<<<<<<<<<<< + * self.parser.commentchar = ord(comment) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":375 + * if len(comment) > 1: + * raise ValueError('Only length-1 comment characters supported') + * self.parser.commentchar = ord(comment) # <<<<<<<<<<<<<< + * + * # error handling of bad lines + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_comment); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_comment); + __Pyx_GIVEREF(__pyx_v_comment); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->commentchar = __pyx_t_6; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/parser.pyx":378 + * + * # error handling of bad lines + * self.parser.error_bad_lines = int(error_bad_lines) # <<<<<<<<<<<<<< + * self.parser.warn_bad_lines = int(warn_bad_lines) + * + */ + __pyx_t_5 = PyNumber_Int(__pyx_v_error_bad_lines); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->error_bad_lines = __pyx_t_1; + + /* "pandas/parser.pyx":379 + * # error handling of bad lines + * self.parser.error_bad_lines = int(error_bad_lines) + * self.parser.warn_bad_lines = int(warn_bad_lines) # <<<<<<<<<<<<<< + * + * self.skiprows = skiprows + */ + __pyx_t_5 = PyNumber_Int(__pyx_v_warn_bad_lines); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->warn_bad_lines = __pyx_t_1; + + /* "pandas/parser.pyx":381 + * self.parser.warn_bad_lines = int(warn_bad_lines) + * + * self.skiprows = skiprows # <<<<<<<<<<<<<< + * if skiprows is not None: + * self._make_skiprow_set() + */ + __Pyx_INCREF(__pyx_v_skiprows); + __Pyx_GIVEREF(__pyx_v_skiprows); + __Pyx_GOTREF(__pyx_v_self->skiprows); + __Pyx_DECREF(__pyx_v_self->skiprows); + __pyx_v_self->skiprows = __pyx_v_skiprows; + + /* "pandas/parser.pyx":382 + * + * self.skiprows = skiprows + * if skiprows is not None: # <<<<<<<<<<<<<< + * self._make_skiprow_set() + * + */ + __pyx_t_3 = (__pyx_v_skiprows != Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":383 + * self.skiprows = skiprows + * if skiprows is not None: + * self._make_skiprow_set() # <<<<<<<<<<<<<< + * + * self.skip_footer = skip_footer + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_make_skiprow_set(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/parser.pyx":385 + * self._make_skiprow_set() + * + * self.skip_footer = skip_footer # <<<<<<<<<<<<<< + * + * # suboptimal + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_skip_footer); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->skip_footer = __pyx_t_1; + + /* "pandas/parser.pyx":388 + * + * # suboptimal + * if usecols is not None: # <<<<<<<<<<<<<< + * self.has_usecols = 1 + * self.usecols = set(usecols) + */ + __pyx_t_7 = (__pyx_v_usecols != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":389 + * # suboptimal + * if usecols is not None: + * self.has_usecols = 1 # <<<<<<<<<<<<<< + * self.usecols = set(usecols) + * + */ + __pyx_v_self->has_usecols = 1; + + /* "pandas/parser.pyx":390 + * if usecols is not None: + * self.has_usecols = 1 + * self.usecols = set(usecols) # <<<<<<<<<<<<<< + * + * # XXX + */ + __pyx_t_5 = PySet_New(__pyx_v_usecols); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->usecols); + __Pyx_DECREF(__pyx_v_self->usecols); + __pyx_v_self->usecols = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/parser.pyx":393 + * + * # XXX + * if skip_footer > 0: # <<<<<<<<<<<<<< + * self.parser.error_bad_lines = 0 + * self.parser.warn_bad_lines = 0 + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_skip_footer, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":394 + * # XXX + * if skip_footer > 0: + * self.parser.error_bad_lines = 0 # <<<<<<<<<<<<<< + * self.parser.warn_bad_lines = 0 + * + */ + __pyx_v_self->parser->error_bad_lines = 0; + + /* "pandas/parser.pyx":395 + * if skip_footer > 0: + * self.parser.error_bad_lines = 0 + * self.parser.warn_bad_lines = 0 # <<<<<<<<<<<<<< + * + * self.delimiter = delimiter + */ + __pyx_v_self->parser->warn_bad_lines = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/parser.pyx":397 + * self.parser.warn_bad_lines = 0 + * + * self.delimiter = delimiter # <<<<<<<<<<<<<< + * self.delim_whitespace = delim_whitespace + * + */ + __Pyx_INCREF(__pyx_v_delimiter); + __Pyx_GIVEREF(__pyx_v_delimiter); + __Pyx_GOTREF(__pyx_v_self->delimiter); + __Pyx_DECREF(__pyx_v_self->delimiter); + __pyx_v_self->delimiter = __pyx_v_delimiter; + + /* "pandas/parser.pyx":398 + * + * self.delimiter = delimiter + * self.delim_whitespace = delim_whitespace # <<<<<<<<<<<<<< + * + * self.na_values = na_values + */ + __Pyx_INCREF(__pyx_v_delim_whitespace); + __Pyx_GIVEREF(__pyx_v_delim_whitespace); + __Pyx_GOTREF(__pyx_v_self->delim_whitespace); + __Pyx_DECREF(__pyx_v_self->delim_whitespace); + __pyx_v_self->delim_whitespace = __pyx_v_delim_whitespace; + + /* "pandas/parser.pyx":400 + * self.delim_whitespace = delim_whitespace + * + * self.na_values = na_values # <<<<<<<<<<<<<< + * if na_fvalues is None: + * na_fvalues = set() + */ + __Pyx_INCREF(__pyx_v_na_values); + __Pyx_GIVEREF(__pyx_v_na_values); + __Pyx_GOTREF(__pyx_v_self->na_values); + __Pyx_DECREF(__pyx_v_self->na_values); + __pyx_v_self->na_values = __pyx_v_na_values; + + /* "pandas/parser.pyx":401 + * + * self.na_values = na_values + * if na_fvalues is None: # <<<<<<<<<<<<<< + * na_fvalues = set() + * self.na_fvalues = na_fvalues + */ + __pyx_t_3 = (__pyx_v_na_fvalues == Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":402 + * self.na_values = na_values + * if na_fvalues is None: + * na_fvalues = set() # <<<<<<<<<<<<<< + * self.na_fvalues = na_fvalues + * + */ + __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_na_fvalues, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/parser.pyx":403 + * if na_fvalues is None: + * na_fvalues = set() + * self.na_fvalues = na_fvalues # <<<<<<<<<<<<<< + * + * self.true_values = _maybe_encode(true_values) + */ + __Pyx_INCREF(__pyx_v_na_fvalues); + __Pyx_GIVEREF(__pyx_v_na_fvalues); + __Pyx_GOTREF(__pyx_v_self->na_fvalues); + __Pyx_DECREF(__pyx_v_self->na_fvalues); + __pyx_v_self->na_fvalues = __pyx_v_na_fvalues; + + /* "pandas/parser.pyx":405 + * self.na_fvalues = na_fvalues + * + * self.true_values = _maybe_encode(true_values) # <<<<<<<<<<<<<< + * self.false_values = _maybe_encode(false_values) + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_true_values); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_true_values); + __Pyx_GIVEREF(__pyx_v_true_values); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_v_self->true_values); + __Pyx_DECREF(__pyx_v_self->true_values); + __pyx_v_self->true_values = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/parser.pyx":406 + * + * self.true_values = _maybe_encode(true_values) + * self.false_values = _maybe_encode(false_values) # <<<<<<<<<<<<<< + * + * self.converters = converters + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_encode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_false_values); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_false_values); + __Pyx_GIVEREF(__pyx_v_false_values); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->false_values); + __Pyx_DECREF(__pyx_v_self->false_values); + __pyx_v_self->false_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":408 + * self.false_values = _maybe_encode(false_values) + * + * self.converters = converters # <<<<<<<<<<<<<< + * + * self.na_filter = na_filter + */ + __Pyx_INCREF(__pyx_v_converters); + __Pyx_GIVEREF(__pyx_v_converters); + __Pyx_GOTREF(__pyx_v_self->converters); + __Pyx_DECREF(__pyx_v_self->converters); + __pyx_v_self->converters = __pyx_v_converters; + + /* "pandas/parser.pyx":410 + * self.converters = converters + * + * self.na_filter = na_filter # <<<<<<<<<<<<<< + * self.as_recarray = as_recarray + * + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_na_filter); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->na_filter = __pyx_t_7; + + /* "pandas/parser.pyx":411 + * + * self.na_filter = na_filter + * self.as_recarray = as_recarray # <<<<<<<<<<<<<< + * + * self.compact_ints = compact_ints + */ + __Pyx_INCREF(__pyx_v_as_recarray); + __Pyx_GIVEREF(__pyx_v_as_recarray); + __Pyx_GOTREF(__pyx_v_self->as_recarray); + __Pyx_DECREF(__pyx_v_self->as_recarray); + __pyx_v_self->as_recarray = __pyx_v_as_recarray; + + /* "pandas/parser.pyx":413 + * self.as_recarray = as_recarray + * + * self.compact_ints = compact_ints # <<<<<<<<<<<<<< + * self.use_unsigned = use_unsigned + * + */ + __Pyx_INCREF(__pyx_v_compact_ints); + __Pyx_GIVEREF(__pyx_v_compact_ints); + __Pyx_GOTREF(__pyx_v_self->compact_ints); + __Pyx_DECREF(__pyx_v_self->compact_ints); + __pyx_v_self->compact_ints = __pyx_v_compact_ints; + + /* "pandas/parser.pyx":414 + * + * self.compact_ints = compact_ints + * self.use_unsigned = use_unsigned # <<<<<<<<<<<<<< + * + * self.verbose = verbose + */ + __Pyx_INCREF(__pyx_v_use_unsigned); + __Pyx_GIVEREF(__pyx_v_use_unsigned); + __Pyx_GOTREF(__pyx_v_self->use_unsigned); + __Pyx_DECREF(__pyx_v_self->use_unsigned); + __pyx_v_self->use_unsigned = __pyx_v_use_unsigned; + + /* "pandas/parser.pyx":416 + * self.use_unsigned = use_unsigned + * + * self.verbose = verbose # <<<<<<<<<<<<<< + * self.low_memory = low_memory + * + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->verbose = __pyx_t_7; + + /* "pandas/parser.pyx":417 + * + * self.verbose = verbose + * self.low_memory = low_memory # <<<<<<<<<<<<<< + * + * # encoding + */ + __Pyx_INCREF(__pyx_v_low_memory); + __Pyx_GIVEREF(__pyx_v_low_memory); + __Pyx_GOTREF(__pyx_v_self->low_memory); + __Pyx_DECREF(__pyx_v_self->low_memory); + __pyx_v_self->low_memory = __pyx_v_low_memory; + + /* "pandas/parser.pyx":420 + * + * # encoding + * if encoding is not None: # <<<<<<<<<<<<<< + * if not isinstance(encoding, bytes): + * encoding = encoding.encode('utf-8') + */ + __pyx_t_7 = (__pyx_v_encoding != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":421 + * # encoding + * if encoding is not None: + * if not isinstance(encoding, bytes): # <<<<<<<<<<<<<< + * encoding = encoding.encode('utf-8') + * encoding = encoding.lower() + */ + __pyx_t_3 = PyBytes_Check(__pyx_v_encoding); + __pyx_t_7 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":422 + * if encoding is not None: + * if not isinstance(encoding, bytes): + * encoding = encoding.encode('utf-8') # <<<<<<<<<<<<<< + * encoding = encoding.lower() + * self.c_encoding = encoding + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L19; + } + __pyx_L19:; + + /* "pandas/parser.pyx":423 + * if not isinstance(encoding, bytes): + * encoding = encoding.encode('utf-8') + * encoding = encoding.lower() # <<<<<<<<<<<<<< + * self.c_encoding = encoding + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":424 + * encoding = encoding.encode('utf-8') + * encoding = encoding.lower() + * self.c_encoding = encoding # <<<<<<<<<<<<<< + * else: + * self.c_encoding = NULL + */ + __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_encoding); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->c_encoding = ((char *)__pyx_t_9); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/parser.pyx":426 + * self.c_encoding = encoding + * else: + * self.c_encoding = NULL # <<<<<<<<<<<<<< + * + * self.encoding = encoding + */ + __pyx_v_self->c_encoding = NULL; + } + __pyx_L18:; + + /* "pandas/parser.pyx":428 + * self.c_encoding = NULL + * + * self.encoding = encoding # <<<<<<<<<<<<<< + * + * if isinstance(dtype, dict): + */ + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_GIVEREF(__pyx_v_encoding); + __Pyx_GOTREF(__pyx_v_self->encoding); + __Pyx_DECREF(__pyx_v_self->encoding); + __pyx_v_self->encoding = __pyx_v_encoding; + + /* "pandas/parser.pyx":430 + * self.encoding = encoding + * + * if isinstance(dtype, dict): # <<<<<<<<<<<<<< + * conv = {} + * for k in dtype: + */ + __pyx_t_7 = PyDict_Check(__pyx_v_dtype); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":431 + * + * if isinstance(dtype, dict): + * conv = {} # <<<<<<<<<<<<<< + * for k in dtype: + * v = dtype[k] + */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_conv = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":432 + * if isinstance(dtype, dict): + * conv = {} + * for k in dtype: # <<<<<<<<<<<<<< + * v = dtype[k] + * if isinstance(v, basestring): + */ + if (PyList_CheckExact(__pyx_v_dtype) || PyTuple_CheckExact(__pyx_v_dtype)) { + __pyx_t_5 = __pyx_v_dtype; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + for (;;) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_10(__pyx_t_5); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":433 + * conv = {} + * for k in dtype: + * v = dtype[k] # <<<<<<<<<<<<<< + * if isinstance(v, basestring): + * v = np.dtype(v) + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_dtype, __pyx_v_k); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":434 + * for k in dtype: + * v = dtype[k] + * if isinstance(v, basestring): # <<<<<<<<<<<<<< + * v = np.dtype(v) + * conv[k] = v + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_v, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":435 + * v = dtype[k] + * if isinstance(v, basestring): + * v = np.dtype(v) # <<<<<<<<<<<<<< + * conv[k] = v + * dtype = conv + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L23; + } + __pyx_L23:; + + /* "pandas/parser.pyx":436 + * if isinstance(v, basestring): + * v = np.dtype(v) + * conv[k] = v # <<<<<<<<<<<<<< + * dtype = conv + * elif dtype is not None: + */ + if (unlikely(PyDict_SetItem(__pyx_v_conv, __pyx_v_k, __pyx_v_v) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":437 + * v = np.dtype(v) + * conv[k] = v + * dtype = conv # <<<<<<<<<<<<<< + * elif dtype is not None: + * dtype = np.dtype(dtype) + */ + __Pyx_INCREF(__pyx_v_conv); + __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_v_conv); + goto __pyx_L20; + } + + /* "pandas/parser.pyx":438 + * conv[k] = v + * dtype = conv + * elif dtype is not None: # <<<<<<<<<<<<<< + * dtype = np.dtype(dtype) + * + */ + __pyx_t_7 = (__pyx_v_dtype != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":439 + * dtype = conv + * elif dtype is not None: + * dtype = np.dtype(dtype) # <<<<<<<<<<<<<< + * + * self.dtype = dtype + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dtype); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dtype); + __Pyx_GIVEREF(__pyx_v_dtype); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/parser.pyx":441 + * dtype = np.dtype(dtype) + * + * self.dtype = dtype # <<<<<<<<<<<<<< + * + * # XXX + */ + __Pyx_INCREF(__pyx_v_dtype); + __Pyx_GIVEREF(__pyx_v_dtype); + __Pyx_GOTREF(__pyx_v_self->dtype); + __Pyx_DECREF(__pyx_v_self->dtype); + __pyx_v_self->dtype = __pyx_v_dtype; + + /* "pandas/parser.pyx":444 + * + * # XXX + * self.noconvert = set() # <<<<<<<<<<<<<< + * + * self.index_col = index_col + */ + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->noconvert); + __Pyx_DECREF(__pyx_v_self->noconvert); + __pyx_v_self->noconvert = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":446 + * self.noconvert = set() + * + * self.index_col = index_col # <<<<<<<<<<<<<< + * + * #---------------------------------------- + */ + __Pyx_INCREF(__pyx_v_index_col); + __Pyx_GIVEREF(__pyx_v_index_col); + __Pyx_GOTREF(__pyx_v_self->index_col); + __Pyx_DECREF(__pyx_v_self->index_col); + __pyx_v_self->index_col = __pyx_v_index_col; + + /* "pandas/parser.pyx":451 + * # header stuff + * + * self.allow_leading_cols = allow_leading_cols # <<<<<<<<<<<<<< + * self.leading_cols = 0 + * + */ + __Pyx_INCREF(__pyx_v_allow_leading_cols); + __Pyx_GIVEREF(__pyx_v_allow_leading_cols); + __Pyx_GOTREF(__pyx_v_self->allow_leading_cols); + __Pyx_DECREF(__pyx_v_self->allow_leading_cols); + __pyx_v_self->allow_leading_cols = __pyx_v_allow_leading_cols; + + /* "pandas/parser.pyx":452 + * + * self.allow_leading_cols = allow_leading_cols + * self.leading_cols = 0 # <<<<<<<<<<<<<< + * + * # TODO: no header vs. header is not the first row + */ + __pyx_v_self->leading_cols = 0; + + /* "pandas/parser.pyx":455 + * + * # TODO: no header vs. header is not the first row + * self.has_mi_columns = 0 # <<<<<<<<<<<<<< + * self.orig_header = header + * if header is None: + */ + __pyx_v_self->has_mi_columns = 0; + + /* "pandas/parser.pyx":456 + * # TODO: no header vs. header is not the first row + * self.has_mi_columns = 0 + * self.orig_header = header # <<<<<<<<<<<<<< + * if header is None: + * # sentinel value + */ + __Pyx_INCREF(__pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + __Pyx_GOTREF(__pyx_v_self->orig_header); + __Pyx_DECREF(__pyx_v_self->orig_header); + __pyx_v_self->orig_header = __pyx_v_header; + + /* "pandas/parser.pyx":457 + * self.has_mi_columns = 0 + * self.orig_header = header + * if header is None: # <<<<<<<<<<<<<< + * # sentinel value + * self.parser.header_start = -1 + */ + __pyx_t_3 = (__pyx_v_header == Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":459 + * if header is None: + * # sentinel value + * self.parser.header_start = -1 # <<<<<<<<<<<<<< + * self.parser.header_end = -1 + * self.parser.header = -1 + */ + __pyx_v_self->parser->header_start = -1; + + /* "pandas/parser.pyx":460 + * # sentinel value + * self.parser.header_start = -1 + * self.parser.header_end = -1 # <<<<<<<<<<<<<< + * self.parser.header = -1 + * self.parser_start = 0 + */ + __pyx_v_self->parser->header_end = -1; + + /* "pandas/parser.pyx":461 + * self.parser.header_start = -1 + * self.parser.header_end = -1 + * self.parser.header = -1 # <<<<<<<<<<<<<< + * self.parser_start = 0 + * self.header = [] + */ + __pyx_v_self->parser->header = -1; + + /* "pandas/parser.pyx":462 + * self.parser.header_end = -1 + * self.parser.header = -1 + * self.parser_start = 0 # <<<<<<<<<<<<<< + * self.header = [] + * else: + */ + __pyx_v_self->parser_start = 0; + + /* "pandas/parser.pyx":463 + * self.parser.header = -1 + * self.parser_start = 0 + * self.header = [] # <<<<<<<<<<<<<< + * else: + * if isinstance(header, list) and len(header): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L24; + } + /*else*/ { + + /* "pandas/parser.pyx":465 + * self.header = [] + * else: + * if isinstance(header, list) and len(header): # <<<<<<<<<<<<<< + * # need to artifically skip the final line + * # which is still a header line + */ + __pyx_t_7 = PyList_Check(__pyx_v_header); + if (__pyx_t_7) { + __pyx_t_4 = PyObject_Length(__pyx_v_header); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__pyx_t_4 != 0); + } else { + __pyx_t_3 = __pyx_t_7; + } + if (__pyx_t_3) { + + /* "pandas/parser.pyx":468 + * # need to artifically skip the final line + * # which is still a header line + * header = list(header) # <<<<<<<<<<<<<< + * header.append(header[-1]+1) + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_header); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_header, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":469 + * # which is still a header line + * header = list(header) + * header.append(header[-1]+1) # <<<<<<<<<<<<<< + * + * self.parser.header_start = header[0] + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_header, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_header, __pyx_t_2); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":471 + * header.append(header[-1]+1) + * + * self.parser.header_start = header[0] # <<<<<<<<<<<<<< + * self.parser.header_end = header[-1] + * self.parser.header = header[0] + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->header_start = __pyx_t_1; + + /* "pandas/parser.pyx":472 + * + * self.parser.header_start = header[0] + * self.parser.header_end = header[-1] # <<<<<<<<<<<<<< + * self.parser.header = header[0] + * self.parser_start = header[-1] + 1 + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_header, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->header_end = __pyx_t_1; + + /* "pandas/parser.pyx":473 + * self.parser.header_start = header[0] + * self.parser.header_end = header[-1] + * self.parser.header = header[0] # <<<<<<<<<<<<<< + * self.parser_start = header[-1] + 1 + * self.has_mi_columns = 1 + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->header = __pyx_t_1; + + /* "pandas/parser.pyx":474 + * self.parser.header_end = header[-1] + * self.parser.header = header[0] + * self.parser_start = header[-1] + 1 # <<<<<<<<<<<<<< + * self.has_mi_columns = 1 + * self.header = header + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_header, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser_start = __pyx_t_1; + + /* "pandas/parser.pyx":475 + * self.parser.header = header[0] + * self.parser_start = header[-1] + 1 + * self.has_mi_columns = 1 # <<<<<<<<<<<<<< + * self.header = header + * else: + */ + __pyx_v_self->has_mi_columns = 1; + + /* "pandas/parser.pyx":476 + * self.parser_start = header[-1] + 1 + * self.has_mi_columns = 1 + * self.header = header # <<<<<<<<<<<<<< + * else: + * self.parser.header_start = header + */ + __Pyx_INCREF(__pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_v_header; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/parser.pyx":478 + * self.header = header + * else: + * self.parser.header_start = header # <<<<<<<<<<<<<< + * self.parser.header_end = header + * self.parser.header = header + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_header); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->header_start = __pyx_t_1; + + /* "pandas/parser.pyx":479 + * else: + * self.parser.header_start = header + * self.parser.header_end = header # <<<<<<<<<<<<<< + * self.parser.header = header + * self.parser_start = header + 1 + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_header); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->header_end = __pyx_t_1; + + /* "pandas/parser.pyx":480 + * self.parser.header_start = header + * self.parser.header_end = header + * self.parser.header = header # <<<<<<<<<<<<<< + * self.parser_start = header + 1 + * self.header = [ header ] + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_header); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->header = __pyx_t_1; + + /* "pandas/parser.pyx":481 + * self.parser.header_end = header + * self.parser.header = header + * self.parser_start = header + 1 # <<<<<<<<<<<<<< + * self.header = [ header ] + * + */ + __pyx_t_5 = PyNumber_Add(__pyx_v_header, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser_start = __pyx_t_1; + + /* "pandas/parser.pyx":482 + * self.parser.header = header + * self.parser_start = header + 1 + * self.header = [ header ] # <<<<<<<<<<<<<< + * + * self.names = names + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_header); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L25:; + } + __pyx_L24:; + + /* "pandas/parser.pyx":484 + * self.header = [ header ] + * + * self.names = names # <<<<<<<<<<<<<< + * self.header, self.table_width = self._get_header() + * + */ + __Pyx_INCREF(__pyx_v_names); + __Pyx_GIVEREF(__pyx_v_names); + __Pyx_GOTREF(__pyx_v_self->names); + __Pyx_DECREF(__pyx_v_self->names); + __pyx_v_self->names = __pyx_v_names; + + /* "pandas/parser.pyx":485 + * + * self.names = names + * self.header, self.table_width = self._get_header() # <<<<<<<<<<<<<< + * + * if not self.table_width: + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_get_header(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_11)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L27_unpacking_done; + __pyx_L26_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L27_unpacking_done:; + } + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_self->table_width = __pyx_t_1; + + /* "pandas/parser.pyx":487 + * self.header, self.table_width = self._get_header() + * + * if not self.table_width: # <<<<<<<<<<<<<< + * raise ValueError("No columns to parse from file") + * + */ + __pyx_t_3 = ((!(__pyx_v_self->table_width != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":488 + * + * if not self.table_width: + * raise ValueError("No columns to parse from file") # <<<<<<<<<<<<<< + * + * # compute buffer_lines as function of table width + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":491 + * + * # compute buffer_lines as function of table width + * heuristic = 2**20 // self.table_width # <<<<<<<<<<<<<< + * self.buffer_lines = 1 + * while self.buffer_lines * 2< heuristic: + */ + if (unlikely(__pyx_v_self->table_width == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(long) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_self->table_width == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(1048576))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_heuristic = __Pyx_div_long(1048576, __pyx_v_self->table_width); + + /* "pandas/parser.pyx":492 + * # compute buffer_lines as function of table width + * heuristic = 2**20 // self.table_width + * self.buffer_lines = 1 # <<<<<<<<<<<<<< + * while self.buffer_lines * 2< heuristic: + * self.buffer_lines *= 2 + */ + __pyx_v_self->buffer_lines = 1; + + /* "pandas/parser.pyx":493 + * heuristic = 2**20 // self.table_width + * self.buffer_lines = 1 + * while self.buffer_lines * 2< heuristic: # <<<<<<<<<<<<<< + * self.buffer_lines *= 2 + * + */ + while (1) { + __pyx_t_3 = (((__pyx_v_self->buffer_lines * 2) < __pyx_v_heuristic) != 0); + if (!__pyx_t_3) break; + + /* "pandas/parser.pyx":494 + * self.buffer_lines = 1 + * while self.buffer_lines * 2< heuristic: + * self.buffer_lines *= 2 # <<<<<<<<<<<<<< + * + * def __init__(self, *args, **kwards): + */ + __pyx_v_self->buffer_lines = (__pyx_v_self->buffer_lines * 2); + } + + /* "pandas/parser.pyx":266 + * set noconvert, usecols + * + * def __cinit__(self, source, # <<<<<<<<<<<<<< + * delimiter=b',', + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.parser.TextReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_conv); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_header); + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XDECREF(__pyx_v_dtype); + __Pyx_XDECREF(__pyx_v_na_fvalues); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":496 + * self.buffer_lines *= 2 + * + * def __init__(self, *args, **kwards): # <<<<<<<<<<<<<< + * pass + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_args = 0; + CYTHON_UNUSED PyObject *__pyx_v_kwards = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; + __pyx_v_kwards = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwards)) return -1; + __Pyx_GOTREF(__pyx_v_kwards); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_2__init__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_args, __pyx_v_kwards); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwards); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_2__init__(CYTHON_UNUSED struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwards) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":499 + * pass + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * parser_free(self.parser) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_6parser_10TextReader_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_6parser_10TextReader_5__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_6parser_10TextReader_4__dealloc__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_6parser_10TextReader_4__dealloc__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/parser.pyx":500 + * + * def __dealloc__(self): + * parser_free(self.parser) # <<<<<<<<<<<<<< + * + * def set_error_bad_lines(self, int status): + */ + parser_free(__pyx_v_self->parser); + + /* "pandas/parser.pyx":499 + * pass + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * parser_free(self.parser) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/parser.pyx":502 + * parser_free(self.parser) + * + * def set_error_bad_lines(self, int status): # <<<<<<<<<<<<<< + * self.parser.error_bad_lines = status + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_7set_error_bad_lines(PyObject *__pyx_v_self, PyObject *__pyx_arg_status); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_7set_error_bad_lines(PyObject *__pyx_v_self, PyObject *__pyx_arg_status) { + int __pyx_v_status; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_error_bad_lines (wrapper)", 0); + assert(__pyx_arg_status); { + __pyx_v_status = __Pyx_PyInt_As_int(__pyx_arg_status); if (unlikely((__pyx_v_status == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.set_error_bad_lines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_6set_error_bad_lines(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((int)__pyx_v_status)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_6set_error_bad_lines(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, int __pyx_v_status) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_error_bad_lines", 0); + + /* "pandas/parser.pyx":503 + * + * def set_error_bad_lines(self, int status): + * self.parser.error_bad_lines = status # <<<<<<<<<<<<<< + * + * cdef _make_skiprow_set(self): + */ + __pyx_v_self->parser->error_bad_lines = __pyx_v_status; + + /* "pandas/parser.pyx":502 + * parser_free(self.parser) + * + * def set_error_bad_lines(self, int status): # <<<<<<<<<<<<<< + * self.parser.error_bad_lines = status + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":505 + * self.parser.error_bad_lines = status + * + * cdef _make_skiprow_set(self): # <<<<<<<<<<<<<< + * if isinstance(self.skiprows, (int, np.integer)): + * self.skiprows = range(self.skiprows) + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__make_skiprow_set(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + __pyx_t_5numpy_int64_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_skiprow_set", 0); + + /* "pandas/parser.pyx":506 + * + * cdef _make_skiprow_set(self): + * if isinstance(self.skiprows, (int, np.integer)): # <<<<<<<<<<<<<< + * self.skiprows = range(self.skiprows) + * + */ + __pyx_t_1 = __pyx_v_self->skiprows; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_4 = PyObject_IsInstance(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/parser.pyx":507 + * cdef _make_skiprow_set(self): + * if isinstance(self.skiprows, (int, np.integer)): + * self.skiprows = range(self.skiprows) # <<<<<<<<<<<<<< + * + * for i in self.skiprows: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->skiprows); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->skiprows); + __Pyx_GIVEREF(__pyx_v_self->skiprows); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->skiprows); + __Pyx_DECREF(__pyx_v_self->skiprows); + __pyx_v_self->skiprows = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":509 + * self.skiprows = range(self.skiprows) + * + * for i in self.skiprows: # <<<<<<<<<<<<<< + * parser_add_skiprow(self.parser, i) + * + */ + if (PyList_CheckExact(__pyx_v_self->skiprows) || PyTuple_CheckExact(__pyx_v_self->skiprows)) { + __pyx_t_1 = __pyx_v_self->skiprows; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->skiprows); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_7(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":510 + * + * for i in self.skiprows: + * parser_add_skiprow(self.parser, i) # <<<<<<<<<<<<<< + * + * cdef _setup_parser_source(self, source): + */ + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_i); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + parser_add_skiprow(__pyx_v_self->parser, __pyx_t_8); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":505 + * self.parser.error_bad_lines = status + * + * cdef _make_skiprow_set(self): # <<<<<<<<<<<<<< + * if isinstance(self.skiprows, (int, np.integer)): + * self.skiprows = range(self.skiprows) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.TextReader._make_skiprow_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":512 + * parser_add_skiprow(self.parser, i) + * + * cdef _setup_parser_source(self, source): # <<<<<<<<<<<<<< + * cdef: + * int status + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__setup_parser_source(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_source) { + void *__pyx_v_ptr; + PyObject *__pyx_v_gzip = NULL; + PyObject *__pyx_v_bz2 = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_setup_parser_source", 0); + __Pyx_INCREF(__pyx_v_source); + + /* "pandas/parser.pyx":517 + * void *ptr + * + * self.parser.cb_io = NULL # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = NULL + * + */ + __pyx_v_self->parser->cb_io = NULL; + + /* "pandas/parser.pyx":518 + * + * self.parser.cb_io = NULL + * self.parser.cb_cleanup = NULL # <<<<<<<<<<<<<< + * + * if self.compression: + */ + __pyx_v_self->parser->cb_cleanup = NULL; + + /* "pandas/parser.pyx":520 + * self.parser.cb_cleanup = NULL + * + * if self.compression: # <<<<<<<<<<<<<< + * if self.compression == 'gzip': + * import gzip + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->compression); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":521 + * + * if self.compression: + * if self.compression == 'gzip': # <<<<<<<<<<<<<< + * import gzip + * if isinstance(source, basestring): + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->compression, __pyx_n_s_gzip, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":522 + * if self.compression: + * if self.compression == 'gzip': + * import gzip # <<<<<<<<<<<<<< + * if isinstance(source, basestring): + * source = gzip.GzipFile(source, 'rb') + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gzip, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_gzip = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":523 + * if self.compression == 'gzip': + * import gzip + * if isinstance(source, basestring): # <<<<<<<<<<<<<< + * source = gzip.GzipFile(source, 'rb') + * else: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_source, __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":524 + * import gzip + * if isinstance(source, basestring): + * source = gzip.GzipFile(source, 'rb') # <<<<<<<<<<<<<< + * else: + * source = gzip.GzipFile(fileobj=source) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + __Pyx_INCREF(__pyx_n_s_rb); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_rb); + __Pyx_GIVEREF(__pyx_n_s_rb); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/parser.pyx":526 + * source = gzip.GzipFile(source, 'rb') + * else: + * source = gzip.GzipFile(fileobj=source) # <<<<<<<<<<<<<< + * elif self.compression == 'bz2': + * import bz2 + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fileobj, __pyx_v_source) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L5:; + goto __pyx_L4; + } + + /* "pandas/parser.pyx":527 + * else: + * source = gzip.GzipFile(fileobj=source) + * elif self.compression == 'bz2': # <<<<<<<<<<<<<< + * import bz2 + * if isinstance(source, basestring): + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_self->compression, __pyx_n_s_bz2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/parser.pyx":528 + * source = gzip.GzipFile(fileobj=source) + * elif self.compression == 'bz2': + * import bz2 # <<<<<<<<<<<<<< + * if isinstance(source, basestring): + * source = bz2.BZ2File(source, 'rb') + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_bz2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_bz2 = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":529 + * elif self.compression == 'bz2': + * import bz2 + * if isinstance(source, basestring): # <<<<<<<<<<<<<< + * source = bz2.BZ2File(source, 'rb') + * else: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_source, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":530 + * import bz2 + * if isinstance(source, basestring): + * source = bz2.BZ2File(source, 'rb') # <<<<<<<<<<<<<< + * else: + * raise ValueError('Python cannot read bz2 from open file ' + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_bz2, __pyx_n_s_BZ2File); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + __Pyx_INCREF(__pyx_n_s_rb); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_rb); + __Pyx_GIVEREF(__pyx_n_s_rb); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/parser.pyx":532 + * source = bz2.BZ2File(source, 'rb') + * else: + * raise ValueError('Python cannot read bz2 from open file ' # <<<<<<<<<<<<<< + * 'handle') + * else: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L6:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/parser.pyx":535 + * 'handle') + * else: + * raise ValueError('Unrecognized compression type: %s' % # <<<<<<<<<<<<<< + * self.compression) + * + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_compression_type_s, __pyx_v_self->compression); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":538 + * self.compression) + * + * if isinstance(source, basestring): # <<<<<<<<<<<<<< + * if not isinstance(source, bytes): + * source = source.encode(sys.getfilesystemencoding() or 'utf-8') + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":539 + * + * if isinstance(source, basestring): + * if not isinstance(source, bytes): # <<<<<<<<<<<<<< + * source = source.encode(sys.getfilesystemencoding() or 'utf-8') + * + */ + __pyx_t_3 = PyBytes_Check(__pyx_v_source); + __pyx_t_1 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":540 + * if isinstance(source, basestring): + * if not isinstance(source, bytes): + * source = source.encode(sys.getfilesystemencoding() or 'utf-8') # <<<<<<<<<<<<<< + * + * if self.memory_map: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_s_utf_8); + __pyx_t_2 = __pyx_kp_s_utf_8; + } else { + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/parser.pyx":542 + * source = source.encode(sys.getfilesystemencoding() or 'utf-8') + * + * if self.memory_map: # <<<<<<<<<<<<<< + * ptr = new_mmap(source) + * if ptr == NULL: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->memory_map); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":543 + * + * if self.memory_map: + * ptr = new_mmap(source) # <<<<<<<<<<<<<< + * if ptr == NULL: + * # fall back + */ + __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_source); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ptr = new_mmap(__pyx_t_6); + + /* "pandas/parser.pyx":544 + * if self.memory_map: + * ptr = new_mmap(source) + * if ptr == NULL: # <<<<<<<<<<<<<< + * # fall back + * ptr = new_file_source(source, self.parser.chunksize) + */ + __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":546 + * if ptr == NULL: + * # fall back + * ptr = new_file_source(source, self.parser.chunksize) # <<<<<<<<<<<<<< + * self.parser.cb_io = &buffer_file_bytes + * self.parser.cb_cleanup = &del_file_source + */ + __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_source); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ptr = new_file_source(__pyx_t_6, __pyx_v_self->parser->chunksize); + + /* "pandas/parser.pyx":547 + * # fall back + * ptr = new_file_source(source, self.parser.chunksize) + * self.parser.cb_io = &buffer_file_bytes # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = &del_file_source + * else: + */ + __pyx_v_self->parser->cb_io = (&buffer_file_bytes); + + /* "pandas/parser.pyx":548 + * ptr = new_file_source(source, self.parser.chunksize) + * self.parser.cb_io = &buffer_file_bytes + * self.parser.cb_cleanup = &del_file_source # <<<<<<<<<<<<<< + * else: + * self.parser.cb_io = &buffer_mmap_bytes + */ + __pyx_v_self->parser->cb_cleanup = (&del_file_source); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/parser.pyx":550 + * self.parser.cb_cleanup = &del_file_source + * else: + * self.parser.cb_io = &buffer_mmap_bytes # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = &del_mmap + * else: + */ + __pyx_v_self->parser->cb_io = (&buffer_mmap_bytes); + + /* "pandas/parser.pyx":551 + * else: + * self.parser.cb_io = &buffer_mmap_bytes + * self.parser.cb_cleanup = &del_mmap # <<<<<<<<<<<<<< + * else: + * ptr = new_file_source(source, self.parser.chunksize) + */ + __pyx_v_self->parser->cb_cleanup = (&del_mmap); + } + __pyx_L10:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/parser.pyx":553 + * self.parser.cb_cleanup = &del_mmap + * else: + * ptr = new_file_source(source, self.parser.chunksize) # <<<<<<<<<<<<<< + * self.parser.cb_io = &buffer_file_bytes + * self.parser.cb_cleanup = &del_file_source + */ + __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_source); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ptr = new_file_source(__pyx_t_6, __pyx_v_self->parser->chunksize); + + /* "pandas/parser.pyx":554 + * else: + * ptr = new_file_source(source, self.parser.chunksize) + * self.parser.cb_io = &buffer_file_bytes # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = &del_file_source + * + */ + __pyx_v_self->parser->cb_io = (&buffer_file_bytes); + + /* "pandas/parser.pyx":555 + * ptr = new_file_source(source, self.parser.chunksize) + * self.parser.cb_io = &buffer_file_bytes + * self.parser.cb_cleanup = &del_file_source # <<<<<<<<<<<<<< + * + * if ptr == NULL: + */ + __pyx_v_self->parser->cb_cleanup = (&del_file_source); + } + __pyx_L9:; + + /* "pandas/parser.pyx":557 + * self.parser.cb_cleanup = &del_file_source + * + * if ptr == NULL: # <<<<<<<<<<<<<< + * if not os.path.exists(source): + * raise IOError('File %s does not exist' % source) + */ + __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":558 + * + * if ptr == NULL: + * if not os.path.exists(source): # <<<<<<<<<<<<<< + * raise IOError('File %s does not exist' % source) + * raise IOError('Initializing from file failed') + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = ((!__pyx_t_1) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":559 + * if ptr == NULL: + * if not os.path.exists(source): + * raise IOError('File %s does not exist' % source) # <<<<<<<<<<<<<< + * raise IOError('Initializing from file failed') + * + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_File_s_does_not_exist, __pyx_v_source); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":560 + * if not os.path.exists(source): + * raise IOError('File %s does not exist' % source) + * raise IOError('Initializing from file failed') # <<<<<<<<<<<<<< + * + * self.parser.source = ptr + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":562 + * raise IOError('Initializing from file failed') + * + * self.parser.source = ptr # <<<<<<<<<<<<<< + * + * elif hasattr(source, 'read'): + */ + __pyx_v_self->parser->source = __pyx_v_ptr; + goto __pyx_L7; + } + + /* "pandas/parser.pyx":564 + * self.parser.source = ptr + * + * elif hasattr(source, 'read'): # <<<<<<<<<<<<<< + * # e.g., StringIO + * + */ + __pyx_t_3 = PyObject_HasAttr(__pyx_v_source, __pyx_n_s_read); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":567 + * # e.g., StringIO + * + * ptr = new_rd_source(source) # <<<<<<<<<<<<<< + * if ptr == NULL: + * raise IOError('Initializing parser from file-like ' + */ + __pyx_v_ptr = new_rd_source(__pyx_v_source); + + /* "pandas/parser.pyx":568 + * + * ptr = new_rd_source(source) + * if ptr == NULL: # <<<<<<<<<<<<<< + * raise IOError('Initializing parser from file-like ' + * 'object failed') + */ + __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":569 + * ptr = new_rd_source(source) + * if ptr == NULL: + * raise IOError('Initializing parser from file-like ' # <<<<<<<<<<<<<< + * 'object failed') + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":572 + * 'object failed') + * + * self.parser.source = ptr # <<<<<<<<<<<<<< + * self.parser.cb_io = &buffer_rd_bytes + * self.parser.cb_cleanup = &del_rd_source + */ + __pyx_v_self->parser->source = __pyx_v_ptr; + + /* "pandas/parser.pyx":573 + * + * self.parser.source = ptr + * self.parser.cb_io = &buffer_rd_bytes # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = &del_rd_source + * else: + */ + __pyx_v_self->parser->cb_io = (&buffer_rd_bytes); + + /* "pandas/parser.pyx":574 + * self.parser.source = ptr + * self.parser.cb_io = &buffer_rd_bytes + * self.parser.cb_cleanup = &del_rd_source # <<<<<<<<<<<<<< + * else: + * raise IOError('Expected file path name or file-like object,' + */ + __pyx_v_self->parser->cb_cleanup = (&del_rd_source); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/parser.pyx":577 + * else: + * raise IOError('Expected file path name or file-like object,' + * ' got %s type' % type(source)) # <<<<<<<<<<<<<< + * + * cdef _get_header(self): + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_file_path_name_or_file, ((PyObject *)Py_TYPE(__pyx_v_source))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/parser.pyx":576 + * self.parser.cb_cleanup = &del_rd_source + * else: + * raise IOError('Expected file path name or file-like object,' # <<<<<<<<<<<<<< + * ' got %s type' % type(source)) + * + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L7:; + + /* "pandas/parser.pyx":512 + * parser_add_skiprow(self.parser, i) + * + * cdef _setup_parser_source(self, source): # <<<<<<<<<<<<<< + * cdef: + * int status + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.parser.TextReader._setup_parser_source", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_gzip); + __Pyx_XDECREF(__pyx_v_bz2); + __Pyx_XDECREF(__pyx_v_source); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":579 + * ' got %s type' % type(source)) + * + * cdef _get_header(self): # <<<<<<<<<<<<<< + * # header is now a list of lists, so field_count should use header[0] + * + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__get_header(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + size_t __pyx_v_i; + size_t __pyx_v_start; + size_t __pyx_v_data_line; + size_t __pyx_v_field_count; + size_t __pyx_v_passed_count; + size_t __pyx_v_hr; + size_t __pyx_v_unnamed_count; + char *__pyx_v_word; + PyObject *__pyx_v_name = 0; + char *__pyx_v_errors; + PyObject *__pyx_v_header = NULL; + PyObject *__pyx_v_level = NULL; + PyObject *__pyx_v_this_header = NULL; + PyObject *__pyx_v_msg = NULL; + PyObject *__pyx_v_counts = NULL; + PyObject *__pyx_v_count = NULL; + PyObject *__pyx_v_lc = NULL; + PyObject *__pyx_v_ic = NULL; + Py_ssize_t __pyx_v_nuse; + PyObject *__pyx_v_m = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + size_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_header", 0); + + /* "pandas/parser.pyx":588 + * int status + * Py_ssize_t size + * char *errors = "strict" # <<<<<<<<<<<<<< + * + * header = [] + */ + __pyx_v_errors = __pyx_k_strict; + + /* "pandas/parser.pyx":590 + * char *errors = "strict" + * + * header = [] # <<<<<<<<<<<<<< + * + * if self.parser.header_start >= 0: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_header = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":592 + * header = [] + * + * if self.parser.header_start >= 0: # <<<<<<<<<<<<<< + * + * # Header is in the file + */ + __pyx_t_2 = ((__pyx_v_self->parser->header_start >= 0) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":595 + * + * # Header is in the file + * for level, hr in enumerate(self.header): # <<<<<<<<<<<<<< + * + * this_header = [] + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_self->header) || PyTuple_CheckExact(__pyx_v_self->header)) { + __pyx_t_3 = __pyx_v_self->header; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self->header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_hr = __pyx_t_7; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_level, __pyx_t_1); + __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":597 + * for level, hr in enumerate(self.header): + * + * this_header = [] # <<<<<<<<<<<<<< + * + * if self.parser.lines < hr + 1: + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_this_header, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":599 + * this_header = [] + * + * if self.parser.lines < hr + 1: # <<<<<<<<<<<<<< + * self._tokenize_rows(hr + 2) + * + */ + __pyx_t_2 = ((__pyx_v_self->parser->lines < (__pyx_v_hr + 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":600 + * + * if self.parser.lines < hr + 1: + * self._tokenize_rows(hr + 2) # <<<<<<<<<<<<<< + * + * # e.g., if header=3 and file only has 2 lines + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_tokenize_rows(__pyx_v_self, (__pyx_v_hr + 2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/parser.pyx":603 + * + * # e.g., if header=3 and file only has 2 lines + * if self.parser.lines < hr + 1: # <<<<<<<<<<<<<< + * msg = self.orig_header + * if isinstance(msg,list): + */ + __pyx_t_2 = ((__pyx_v_self->parser->lines < (__pyx_v_hr + 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":604 + * # e.g., if header=3 and file only has 2 lines + * if self.parser.lines < hr + 1: + * msg = self.orig_header # <<<<<<<<<<<<<< + * if isinstance(msg,list): + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + */ + __pyx_t_6 = __pyx_v_self->orig_header; + __Pyx_INCREF(__pyx_t_6); + __pyx_v_msg = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":605 + * if self.parser.lines < hr + 1: + * msg = self.orig_header + * if isinstance(msg,list): # <<<<<<<<<<<<<< + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + * raise CParserError('Passed header=%s but only %d lines in file' + */ + __pyx_t_2 = PyList_Check(__pyx_v_msg); + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":606 + * msg = self.orig_header + * if isinstance(msg,list): + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) # <<<<<<<<<<<<<< + * raise CParserError('Passed header=%s but only %d lines in file' + * % (msg, self.parser.lines)) + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyList_CheckExact(__pyx_v_msg) || PyTuple_CheckExact(__pyx_v_msg)) { + __pyx_t_9 = __pyx_v_msg; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_msg); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext; + } + for (;;) { + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_12 = __pyx_t_11(__pyx_t_9); + if (unlikely(!__pyx_t_12)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_12); + } + __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_m); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_m); + __Pyx_GIVEREF(__pyx_v_m); + __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_10 = PyObject_Length(__pyx_v_msg); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_9 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_s_len_of_d, __pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/parser.pyx":607 + * if isinstance(msg,list): + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + * raise CParserError('Passed header=%s but only %d lines in file' # <<<<<<<<<<<<<< + * % (msg, self.parser.lines)) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_CParserError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/parser.pyx":608 + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + * raise CParserError('Passed header=%s but only %d lines in file' + * % (msg, self.parser.lines)) # <<<<<<<<<<<<<< + * + * field_count = self.parser.line_fields[hr] + */ + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_self->parser->lines); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_msg); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_msg); + __Pyx_GIVEREF(__pyx_v_msg); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyString_Format(__pyx_kp_s_Passed_header_s_but_only_d_lines, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":607 + * if isinstance(msg,list): + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + * raise CParserError('Passed header=%s but only %d lines in file' # <<<<<<<<<<<<<< + * % (msg, self.parser.lines)) + * + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_13, 0, 0, 0); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":610 + * % (msg, self.parser.lines)) + * + * field_count = self.parser.line_fields[hr] # <<<<<<<<<<<<<< + * start = self.parser.line_start[hr] + * + */ + __pyx_v_field_count = (__pyx_v_self->parser->line_fields[__pyx_v_hr]); + + /* "pandas/parser.pyx":611 + * + * field_count = self.parser.line_fields[hr] + * start = self.parser.line_start[hr] # <<<<<<<<<<<<<< + * + * # TODO: Py3 vs. Py2 + */ + __pyx_v_start = (__pyx_v_self->parser->line_start[__pyx_v_hr]); + + /* "pandas/parser.pyx":614 + * + * # TODO: Py3 vs. Py2 + * counts = {} # <<<<<<<<<<<<<< + * unnamed_count = 0 + * for i in range(field_count): + */ + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_XDECREF_SET(__pyx_v_counts, ((PyObject*)__pyx_t_13)); + __pyx_t_13 = 0; + + /* "pandas/parser.pyx":615 + * # TODO: Py3 vs. Py2 + * counts = {} + * unnamed_count = 0 # <<<<<<<<<<<<<< + * for i in range(field_count): + * word = self.parser.words[start + i] + */ + __pyx_v_unnamed_count = 0; + + /* "pandas/parser.pyx":616 + * counts = {} + * unnamed_count = 0 + * for i in range(field_count): # <<<<<<<<<<<<<< + * word = self.parser.words[start + i] + * + */ + __pyx_t_7 = __pyx_v_field_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_7; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/parser.pyx":617 + * unnamed_count = 0 + * for i in range(field_count): + * word = self.parser.words[start + i] # <<<<<<<<<<<<<< + * + * if self.c_encoding == NULL and not PY3: + */ + __pyx_v_word = (__pyx_v_self->parser->words[(__pyx_v_start + __pyx_v_i)]); + + /* "pandas/parser.pyx":619 + * word = self.parser.words[start + i] + * + * if self.c_encoding == NULL and not PY3: # <<<<<<<<<<<<<< + * name = PyBytes_FromString(word) + * else: + */ + __pyx_t_8 = ((__pyx_v_self->c_encoding == NULL) != 0); + if (__pyx_t_8) { + __pyx_t_2 = ((!(__pyx_v_6pandas_6parser_PY3 != 0)) != 0); + __pyx_t_15 = __pyx_t_2; + } else { + __pyx_t_15 = __pyx_t_8; + } + if (__pyx_t_15) { + + /* "pandas/parser.pyx":620 + * + * if self.c_encoding == NULL and not PY3: + * name = PyBytes_FromString(word) # <<<<<<<<<<<<<< + * else: + * if self.c_encoding == NULL or self.c_encoding == b'utf-8': + */ + __pyx_t_13 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/parser.pyx":622 + * name = PyBytes_FromString(word) + * else: + * if self.c_encoding == NULL or self.c_encoding == b'utf-8': # <<<<<<<<<<<<<< + * name = PyUnicode_FromString(word) + * else: + */ + __pyx_t_15 = (__pyx_v_self->c_encoding == NULL); + if (!__pyx_t_15) { + __pyx_t_13 = __Pyx_PyBytes_FromString(__pyx_v_self->c_encoding); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_8 = (__Pyx_PyBytes_Equals(__pyx_t_13, __pyx_kp_b_utf_8, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_2 = __pyx_t_8; + } else { + __pyx_t_2 = __pyx_t_15; + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":623 + * else: + * if self.c_encoding == NULL or self.c_encoding == b'utf-8': + * name = PyUnicode_FromString(word) # <<<<<<<<<<<<<< + * else: + * name = PyUnicode_Decode(word, strlen(word), + */ + __pyx_t_13 = PyUnicode_FromString(__pyx_v_word); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/parser.pyx":625 + * name = PyUnicode_FromString(word) + * else: + * name = PyUnicode_Decode(word, strlen(word), # <<<<<<<<<<<<<< + * self.c_encoding, errors) + * + */ + __pyx_t_13 = PyUnicode_Decode(__pyx_v_word, strlen(__pyx_v_word), __pyx_v_self->c_encoding, __pyx_v_errors); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_13); + __pyx_t_13 = 0; + } + __pyx_L14:; + } + __pyx_L13:; + + /* "pandas/parser.pyx":628 + * self.c_encoding, errors) + * + * if name == '': # <<<<<<<<<<<<<< + * if self.has_mi_columns: + * name = 'Unnamed: %d_level_%d' % (i,level) + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_kp_s__16, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + + /* "pandas/parser.pyx":629 + * + * if name == '': + * if self.has_mi_columns: # <<<<<<<<<<<<<< + * name = 'Unnamed: %d_level_%d' % (i,level) + * else: + */ + __pyx_t_2 = (__pyx_v_self->has_mi_columns != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":630 + * if name == '': + * if self.has_mi_columns: + * name = 'Unnamed: %d_level_%d' % (i,level) # <<<<<<<<<<<<<< + * else: + * name = 'Unnamed: %d' % i + */ + __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_level); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_level); + __Pyx_GIVEREF(__pyx_v_level); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyString_Format(__pyx_kp_s_Unnamed_d_level__d, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/parser.pyx":632 + * name = 'Unnamed: %d_level_%d' % (i,level) + * else: + * name = 'Unnamed: %d' % i # <<<<<<<<<<<<<< + * unnamed_count += 1 + * + */ + __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Unnamed_d, __pyx_t_13); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_9); + __pyx_t_9 = 0; + } + __pyx_L16:; + + /* "pandas/parser.pyx":633 + * else: + * name = 'Unnamed: %d' % i + * unnamed_count += 1 # <<<<<<<<<<<<<< + * + * count = counts.get(name, 0) + */ + __pyx_v_unnamed_count = (__pyx_v_unnamed_count + 1); + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/parser.pyx":635 + * unnamed_count += 1 + * + * count = counts.get(name, 0) # <<<<<<<<<<<<<< + * if count > 0 and self.mangle_dupe_cols and not self.has_mi_columns: + * this_header.append('%s.%d' % (name, count)) + */ + __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_counts, __pyx_v_name, __pyx_int_0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/parser.pyx":636 + * + * count = counts.get(name, 0) + * if count > 0 and self.mangle_dupe_cols and not self.has_mi_columns: # <<<<<<<<<<<<<< + * this_header.append('%s.%d' % (name, count)) + * else: + */ + __pyx_t_9 = PyObject_RichCompare(__pyx_v_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_self->mangle_dupe_cols); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_15) { + __pyx_t_8 = (!(__pyx_v_self->has_mi_columns != 0)); + __pyx_t_16 = __pyx_t_8; + } else { + __pyx_t_16 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_16; + } else { + __pyx_t_15 = __pyx_t_2; + } + if (__pyx_t_15) { + + /* "pandas/parser.pyx":637 + * count = counts.get(name, 0) + * if count > 0 and self.mangle_dupe_cols and not self.has_mi_columns: + * this_header.append('%s.%d' % (name, count)) # <<<<<<<<<<<<<< + * else: + * this_header.append(name) + */ + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_INCREF(__pyx_v_count); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_count); + __Pyx_GIVEREF(__pyx_v_count); + __pyx_t_13 = __Pyx_PyString_Format(__pyx_kp_s_s_d, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_this_header, __pyx_t_13); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/parser.pyx":639 + * this_header.append('%s.%d' % (name, count)) + * else: + * this_header.append(name) # <<<<<<<<<<<<<< + * counts[name] = count + 1 + * + */ + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_this_header, __pyx_v_name); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L17:; + + /* "pandas/parser.pyx":640 + * else: + * this_header.append(name) + * counts[name] = count + 1 # <<<<<<<<<<<<<< + * + * if self.has_mi_columns: + */ + __pyx_t_13 = PyNumber_Add(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (unlikely(PyDict_SetItem(__pyx_v_counts, __pyx_v_name, __pyx_t_13) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + + /* "pandas/parser.pyx":642 + * counts[name] = count + 1 + * + * if self.has_mi_columns: # <<<<<<<<<<<<<< + * + * # if we have grabbed an extra line, but its not in our format + */ + __pyx_t_15 = (__pyx_v_self->has_mi_columns != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":647 + * # so save in the buffer, and create an blank extra line for the rest of the + * # parsing code + * if hr == self.header[-1]: # <<<<<<<<<<<<<< + * lc = len(this_header) + * ic = len(self.index_col) if self.index_col is not None else 0 + */ + __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_hr); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_self->header, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_13, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_15) { + + /* "pandas/parser.pyx":648 + * # parsing code + * if hr == self.header[-1]: + * lc = len(this_header) # <<<<<<<<<<<<<< + * ic = len(self.index_col) if self.index_col is not None else 0 + * if lc != unnamed_count and lc-ic > unnamed_count: + */ + __pyx_t_10 = PyList_GET_SIZE(__pyx_v_this_header); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":649 + * if hr == self.header[-1]: + * lc = len(this_header) + * ic = len(self.index_col) if self.index_col is not None else 0 # <<<<<<<<<<<<<< + * if lc != unnamed_count and lc-ic > unnamed_count: + * hr -= 1 + */ + __pyx_t_15 = (__pyx_v_self->index_col != Py_None); + if ((__pyx_t_15 != 0)) { + __pyx_t_9 = __pyx_v_self->index_col; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __Pyx_INCREF(__pyx_int_0); + __pyx_t_6 = __pyx_int_0; + } + __Pyx_XDECREF_SET(__pyx_v_ic, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":650 + * lc = len(this_header) + * ic = len(self.index_col) if self.index_col is not None else 0 + * if lc != unnamed_count and lc-ic > unnamed_count: # <<<<<<<<<<<<<< + * hr -= 1 + * self.parser_start -= 1 + */ + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_unnamed_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_lc, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_15) { + __pyx_t_9 = PyNumber_Subtract(__pyx_v_lc, __pyx_v_ic); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_unnamed_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyObject_RichCompare(__pyx_t_9, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_16 = __pyx_t_2; + } else { + __pyx_t_16 = __pyx_t_15; + } + if (__pyx_t_16) { + + /* "pandas/parser.pyx":651 + * ic = len(self.index_col) if self.index_col is not None else 0 + * if lc != unnamed_count and lc-ic > unnamed_count: + * hr -= 1 # <<<<<<<<<<<<<< + * self.parser_start -= 1 + * this_header = [ None ] * lc + */ + __pyx_v_hr = (__pyx_v_hr - 1); + + /* "pandas/parser.pyx":652 + * if lc != unnamed_count and lc-ic > unnamed_count: + * hr -= 1 + * self.parser_start -= 1 # <<<<<<<<<<<<<< + * this_header = [ None ] * lc + * + */ + __pyx_v_self->parser_start = (__pyx_v_self->parser_start - 1); + + /* "pandas/parser.pyx":653 + * hr -= 1 + * self.parser_start -= 1 + * this_header = [ None ] * lc # <<<<<<<<<<<<<< + * + * data_line = hr + 1 + */ + __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_13, 0, Py_None); + __Pyx_GIVEREF(Py_None); + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_13, __pyx_v_lc); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_temp); + __Pyx_DECREF(__pyx_t_13); + __pyx_t_13 = __pyx_temp; + } + __Pyx_DECREF_SET(__pyx_v_this_header, ((PyObject*)__pyx_t_13)); + __pyx_t_13 = 0; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + goto __pyx_L18; + } + __pyx_L18:; + + /* "pandas/parser.pyx":655 + * this_header = [ None ] * lc + * + * data_line = hr + 1 # <<<<<<<<<<<<<< + * header.append(this_header) + * + */ + __pyx_v_data_line = (__pyx_v_hr + 1); + + /* "pandas/parser.pyx":656 + * + * data_line = hr + 1 + * header.append(this_header) # <<<<<<<<<<<<<< + * + * if self.names is not None: + */ + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_header, __pyx_v_this_header); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":658 + * header.append(this_header) + * + * if self.names is not None: # <<<<<<<<<<<<<< + * header = [ self.names ] + * + */ + __pyx_t_16 = (__pyx_v_self->names != Py_None); + __pyx_t_15 = (__pyx_t_16 != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":659 + * + * if self.names is not None: + * header = [ self.names ] # <<<<<<<<<<<<<< + * + * elif self.names is not None: + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->names); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->names); + __Pyx_GIVEREF(__pyx_v_self->names); + __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L21; + } + __pyx_L21:; + goto __pyx_L3; + } + + /* "pandas/parser.pyx":661 + * header = [ self.names ] + * + * elif self.names is not None: # <<<<<<<<<<<<<< + * # Enforce this unless usecols + * if not self.has_usecols: + */ + __pyx_t_15 = (__pyx_v_self->names != Py_None); + __pyx_t_16 = (__pyx_t_15 != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":663 + * elif self.names is not None: + * # Enforce this unless usecols + * if not self.has_usecols: # <<<<<<<<<<<<<< + * self.parser.expected_fields = len(self.names) + * + */ + __pyx_t_16 = ((!(__pyx_v_self->has_usecols != 0)) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":664 + * # Enforce this unless usecols + * if not self.has_usecols: + * self.parser.expected_fields = len(self.names) # <<<<<<<<<<<<<< + * + * # Names passed + */ + __pyx_t_1 = __pyx_v_self->names; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->parser->expected_fields = __pyx_t_4; + goto __pyx_L22; + } + __pyx_L22:; + + /* "pandas/parser.pyx":667 + * + * # Names passed + * if self.parser.lines < 1: # <<<<<<<<<<<<<< + * self._tokenize_rows(1) + * + */ + __pyx_t_16 = ((__pyx_v_self->parser->lines < 1) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":668 + * # Names passed + * if self.parser.lines < 1: + * self._tokenize_rows(1) # <<<<<<<<<<<<<< + * + * header = [ self.names ] + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_tokenize_rows(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L23; + } + __pyx_L23:; + + /* "pandas/parser.pyx":670 + * self._tokenize_rows(1) + * + * header = [ self.names ] # <<<<<<<<<<<<<< + * data_line = 0 + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->names); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->names); + __Pyx_GIVEREF(__pyx_v_self->names); + __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":671 + * + * header = [ self.names ] + * data_line = 0 # <<<<<<<<<<<<<< + * + * if self.parser.lines < 1: + */ + __pyx_v_data_line = 0; + + /* "pandas/parser.pyx":673 + * data_line = 0 + * + * if self.parser.lines < 1: # <<<<<<<<<<<<<< + * field_count = len(header[0]) + * else: + */ + __pyx_t_16 = ((__pyx_v_self->parser->lines < 1) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":674 + * + * if self.parser.lines < 1: + * field_count = len(header[0]) # <<<<<<<<<<<<<< + * else: + * field_count = self.parser.line_fields[data_line] + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_field_count = __pyx_t_4; + goto __pyx_L24; + } + /*else*/ { + + /* "pandas/parser.pyx":676 + * field_count = len(header[0]) + * else: + * field_count = self.parser.line_fields[data_line] # <<<<<<<<<<<<<< + * else: + * # No header passed nor to be found in the file + */ + __pyx_v_field_count = (__pyx_v_self->parser->line_fields[__pyx_v_data_line]); + } + __pyx_L24:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":679 + * else: + * # No header passed nor to be found in the file + * if self.parser.lines < 1: # <<<<<<<<<<<<<< + * self._tokenize_rows(1) + * + */ + __pyx_t_16 = ((__pyx_v_self->parser->lines < 1) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":680 + * # No header passed nor to be found in the file + * if self.parser.lines < 1: + * self._tokenize_rows(1) # <<<<<<<<<<<<<< + * + * return None, self.parser.line_fields[0] + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_tokenize_rows(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L25; + } + __pyx_L25:; + + /* "pandas/parser.pyx":682 + * self._tokenize_rows(1) + * + * return None, self.parser.line_fields[0] # <<<<<<<<<<<<<< + * + * # Corner case, not enough lines in the file + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->parser->line_fields[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":685 + * + * # Corner case, not enough lines in the file + * if self.parser.lines < data_line + 1: # <<<<<<<<<<<<<< + * field_count = len(header[0]) + * else: # not self.has_usecols: + */ + __pyx_t_16 = ((__pyx_v_self->parser->lines < (__pyx_v_data_line + 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":686 + * # Corner case, not enough lines in the file + * if self.parser.lines < data_line + 1: + * field_count = len(header[0]) # <<<<<<<<<<<<<< + * else: # not self.has_usecols: + * + */ + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_field_count = __pyx_t_4; + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/parser.pyx":689 + * else: # not self.has_usecols: + * + * field_count = self.parser.line_fields[data_line] # <<<<<<<<<<<<<< + * + * # #2981 + */ + __pyx_v_field_count = (__pyx_v_self->parser->line_fields[__pyx_v_data_line]); + + /* "pandas/parser.pyx":692 + * + * # #2981 + * if self.names is not None: # <<<<<<<<<<<<<< + * field_count = max(field_count, len(self.names)) + * + */ + __pyx_t_16 = (__pyx_v_self->names != Py_None); + __pyx_t_15 = (__pyx_t_16 != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":693 + * # #2981 + * if self.names is not None: + * field_count = max(field_count, len(self.names)) # <<<<<<<<<<<<<< + * + * passed_count = len(header[0]) + */ + __pyx_t_3 = __pyx_v_self->names; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __pyx_v_field_count; + if (((__pyx_t_4 > __pyx_t_7) != 0)) { + __pyx_t_14 = __pyx_t_4; + } else { + __pyx_t_14 = __pyx_t_7; + } + __pyx_v_field_count = __pyx_t_14; + goto __pyx_L27; + } + __pyx_L27:; + + /* "pandas/parser.pyx":695 + * field_count = max(field_count, len(self.names)) + * + * passed_count = len(header[0]) # <<<<<<<<<<<<<< + * + * # if passed_count > field_count: + */ + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_passed_count = __pyx_t_4; + + /* "pandas/parser.pyx":702 + * # % (passed_count, field_count)) + * + * if self.has_usecols: # <<<<<<<<<<<<<< + * nuse = len(self.usecols) + * if nuse == passed_count: + */ + __pyx_t_15 = (__pyx_v_self->has_usecols != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":703 + * + * if self.has_usecols: + * nuse = len(self.usecols) # <<<<<<<<<<<<<< + * if nuse == passed_count: + * self.leading_cols = 0 + */ + __pyx_t_3 = __pyx_v_self->usecols; + __Pyx_INCREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PySet_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_nuse = __pyx_t_4; + + /* "pandas/parser.pyx":704 + * if self.has_usecols: + * nuse = len(self.usecols) + * if nuse == passed_count: # <<<<<<<<<<<<<< + * self.leading_cols = 0 + * elif self.names is None and nuse < passed_count: + */ + __pyx_t_15 = ((__pyx_v_nuse == __pyx_v_passed_count) != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":705 + * nuse = len(self.usecols) + * if nuse == passed_count: + * self.leading_cols = 0 # <<<<<<<<<<<<<< + * elif self.names is None and nuse < passed_count: + * self.leading_cols = field_count - passed_count + */ + __pyx_v_self->leading_cols = 0; + goto __pyx_L29; + } + + /* "pandas/parser.pyx":706 + * if nuse == passed_count: + * self.leading_cols = 0 + * elif self.names is None and nuse < passed_count: # <<<<<<<<<<<<<< + * self.leading_cols = field_count - passed_count + * elif passed_count != field_count: + */ + __pyx_t_15 = (__pyx_v_self->names == Py_None); + if ((__pyx_t_15 != 0)) { + __pyx_t_16 = ((__pyx_v_nuse < __pyx_v_passed_count) != 0); + __pyx_t_2 = __pyx_t_16; + } else { + __pyx_t_2 = (__pyx_t_15 != 0); + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":707 + * self.leading_cols = 0 + * elif self.names is None and nuse < passed_count: + * self.leading_cols = field_count - passed_count # <<<<<<<<<<<<<< + * elif passed_count != field_count: + * raise ValueError('Passed header names ' + */ + __pyx_v_self->leading_cols = (__pyx_v_field_count - __pyx_v_passed_count); + goto __pyx_L29; + } + + /* "pandas/parser.pyx":708 + * elif self.names is None and nuse < passed_count: + * self.leading_cols = field_count - passed_count + * elif passed_count != field_count: # <<<<<<<<<<<<<< + * raise ValueError('Passed header names ' + * 'mismatches usecols') + */ + __pyx_t_2 = ((__pyx_v_passed_count != __pyx_v_field_count) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":709 + * self.leading_cols = field_count - passed_count + * elif passed_count != field_count: + * raise ValueError('Passed header names ' # <<<<<<<<<<<<<< + * 'mismatches usecols') + * # oh boy, #2442, #2981 + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L29:; + goto __pyx_L28; + } + + /* "pandas/parser.pyx":712 + * 'mismatches usecols') + * # oh boy, #2442, #2981 + * elif self.allow_leading_cols and passed_count < field_count: # <<<<<<<<<<<<<< + * self.leading_cols = field_count - passed_count + * + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->allow_leading_cols); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __pyx_t_15 = (__pyx_v_passed_count < __pyx_v_field_count); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_2; + } + if (__pyx_t_16) { + + /* "pandas/parser.pyx":713 + * # oh boy, #2442, #2981 + * elif self.allow_leading_cols and passed_count < field_count: + * self.leading_cols = field_count - passed_count # <<<<<<<<<<<<<< + * + * return header, field_count + */ + __pyx_v_self->leading_cols = (__pyx_v_field_count - __pyx_v_passed_count); + goto __pyx_L28; + } + __pyx_L28:; + } + __pyx_L26:; + + /* "pandas/parser.pyx":715 + * self.leading_cols = field_count - passed_count + * + * return header, field_count # <<<<<<<<<<<<<< + * + * cdef _implicit_index_count(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_field_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_header); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":579 + * ' got %s type' % type(source)) + * + * cdef _get_header(self): # <<<<<<<<<<<<<< + * # header is now a list of lists, so field_count should use header[0] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.parser.TextReader._get_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_header); + __Pyx_XDECREF(__pyx_v_level); + __Pyx_XDECREF(__pyx_v_this_header); + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XDECREF(__pyx_v_counts); + __Pyx_XDECREF(__pyx_v_count); + __Pyx_XDECREF(__pyx_v_lc); + __Pyx_XDECREF(__pyx_v_ic); + __Pyx_XDECREF(__pyx_v_m); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":717 + * return header, field_count + * + * cdef _implicit_index_count(self): # <<<<<<<<<<<<<< + * pass + * + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__implicit_index_count(CYTHON_UNUSED struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_implicit_index_count", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":720 + * pass + * + * def read(self, rows=None): # <<<<<<<<<<<<<< + * """ + * rows=None --> read all rows + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_6parser_10TextReader_8read[] = "\n rows=None --> read all rows\n "; +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_rows = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rows); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_rows = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8read(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_rows); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8read(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows) { + PyObject *__pyx_v_columns = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read", 0); + + /* "pandas/parser.pyx":727 + * int status + * + * if self.low_memory: # <<<<<<<<<<<<<< + * # Conserve intermediate space + * columns = self._read_low_memory(rows) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->low_memory); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":729 + * if self.low_memory: + * # Conserve intermediate space + * columns = self._read_low_memory(rows) # <<<<<<<<<<<<<< + * else: + * # Don't care about memory usage + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_read_low_memory(__pyx_v_self, __pyx_v_rows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_columns = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":732 + * else: + * # Don't care about memory usage + * columns = self._read_rows(rows, 1) # <<<<<<<<<<<<<< + * + * if self.as_recarray: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_read_rows(__pyx_v_self, __pyx_v_rows, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_columns = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":734 + * columns = self._read_rows(rows, 1) + * + * if self.as_recarray: # <<<<<<<<<<<<<< + * self._start_clock() + * result = _to_structured_array(columns, self.header) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->as_recarray); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":735 + * + * if self.as_recarray: + * self._start_clock() # <<<<<<<<<<<<<< + * result = _to_structured_array(columns, self.header) + * self._end_clock('Conversion to structured array') + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_start_clock(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":736 + * if self.as_recarray: + * self._start_clock() + * result = _to_structured_array(columns, self.header) # <<<<<<<<<<<<<< + * self._end_clock('Conversion to structured array') + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_to_structured_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_columns); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_columns); + __Pyx_GIVEREF(__pyx_v_columns); + __Pyx_INCREF(__pyx_v_self->header); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->header); + __Pyx_GIVEREF(__pyx_v_self->header); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":737 + * self._start_clock() + * result = _to_structured_array(columns, self.header) + * self._end_clock('Conversion to structured array') # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_end_clock(__pyx_v_self, __pyx_kp_s_Conversion_to_structured_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":739 + * self._end_clock('Conversion to structured array') + * + * return result # <<<<<<<<<<<<<< + * else: + * return columns + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":741 + * return result + * else: + * return columns # <<<<<<<<<<<<<< + * + * cdef _read_low_memory(self, rows): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_columns); + __pyx_r = __pyx_v_columns; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":720 + * pass + * + * def read(self, rows=None): # <<<<<<<<<<<<<< + * """ + * rows=None --> read all rows + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.parser.TextReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_columns); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":743 + * return columns + * + * cdef _read_low_memory(self, rows): # <<<<<<<<<<<<<< + * cdef: + * size_t rows_read = 0 + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__read_low_memory(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows) { + size_t __pyx_v_rows_read; + PyObject *__pyx_v_chunks = 0; + PyObject *__pyx_v_chunk = NULL; + PyObject *__pyx_v_crows = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_read_low_memory", 0); + + /* "pandas/parser.pyx":745 + * cdef _read_low_memory(self, rows): + * cdef: + * size_t rows_read = 0 # <<<<<<<<<<<<<< + * chunks = [] + * + */ + __pyx_v_rows_read = 0; + + /* "pandas/parser.pyx":746 + * cdef: + * size_t rows_read = 0 + * chunks = [] # <<<<<<<<<<<<<< + * + * if rows is None: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_chunks = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":748 + * chunks = [] + * + * if rows is None: # <<<<<<<<<<<<<< + * while True: + * try: + */ + __pyx_t_2 = (__pyx_v_rows == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":749 + * + * if rows is None: + * while True: # <<<<<<<<<<<<<< + * try: + * chunk = self._read_rows(self.buffer_lines, 0) + */ + while (1) { + + /* "pandas/parser.pyx":750 + * if rows is None: + * while True: + * try: # <<<<<<<<<<<<<< + * chunk = self._read_rows(self.buffer_lines, 0) + * if len(chunk) == 0: + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/parser.pyx":751 + * while True: + * try: + * chunk = self._read_rows(self.buffer_lines, 0) # <<<<<<<<<<<<<< + * if len(chunk) == 0: + * break + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->buffer_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_read_rows(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":752 + * try: + * chunk = self._read_rows(self.buffer_lines, 0) + * if len(chunk) == 0: # <<<<<<<<<<<<<< + * break + * except StopIteration: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_3 = ((__pyx_t_8 == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":753 + * chunk = self._read_rows(self.buffer_lines, 0) + * if len(chunk) == 0: + * break # <<<<<<<<<<<<<< + * except StopIteration: + * break + */ + goto __pyx_L11_try_break; + } + } + /*else:*/ { + + /* "pandas/parser.pyx":757 + * break + * else: + * chunks.append(chunk) # <<<<<<<<<<<<<< + * else: + * while rows_read < rows: + */ + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_chunks, __pyx_v_chunk); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/parser.pyx":754 + * if len(chunk) == 0: + * break + * except StopIteration: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); + if (__pyx_t_10) { + __Pyx_AddTraceback("pandas.parser.TextReader._read_low_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/parser.pyx":755 + * break + * except StopIteration: + * break # <<<<<<<<<<<<<< + * else: + * chunks.append(chunk) + */ + goto __pyx_L15_except_break; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L7_exception_handled; + __pyx_L15_except_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L11_try_break; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L11_try_break:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L5_break; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L13_try_end:; + } + } + __pyx_L5_break:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":759 + * chunks.append(chunk) + * else: + * while rows_read < rows: # <<<<<<<<<<<<<< + * try: + * crows = min(self.buffer_lines, rows - rows_read) + */ + while (1) { + __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_v_rows_read); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_v_rows, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_3) break; + + /* "pandas/parser.pyx":760 + * else: + * while rows_read < rows: + * try: # <<<<<<<<<<<<<< + * crows = min(self.buffer_lines, rows - rows_read) + * + */ + { + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/parser.pyx":761 + * while rows_read < rows: + * try: + * crows = min(self.buffer_lines, rows - rows_read) # <<<<<<<<<<<<<< + * + * chunk = self._read_rows(crows, 0) + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rows_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PyNumber_Subtract(__pyx_v_rows, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __pyx_v_self->buffer_lines; + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_3) { + __Pyx_INCREF(__pyx_t_11); + __pyx_t_1 = __pyx_t_11; + } else { + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __pyx_t_12; + __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_crows, __pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/parser.pyx":763 + * crows = min(self.buffer_lines, rows - rows_read) + * + * chunk = self._read_rows(crows, 0) # <<<<<<<<<<<<<< + * if len(chunk) == 0: + * break + */ + __pyx_t_11 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_read_rows(__pyx_v_self, __pyx_v_crows, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/parser.pyx":764 + * + * chunk = self._read_rows(crows, 0) + * if len(chunk) == 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_8 = PyObject_Length(__pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __pyx_t_3 = ((__pyx_t_8 == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":765 + * chunk = self._read_rows(crows, 0) + * if len(chunk) == 0: + * break # <<<<<<<<<<<<<< + * + * rows_read += len(list(chunk.values())[0]) + */ + goto __pyx_L24_try_break; + } + + /* "pandas/parser.pyx":767 + * break + * + * rows_read += len(list(chunk.values())[0]) # <<<<<<<<<<<<<< + * except StopIteration: + * break + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_values); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;}; + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_rows_read = (__pyx_v_rows_read + __pyx_t_8); + } + /*else:*/ { + + /* "pandas/parser.pyx":771 + * break + * else: + * chunks.append(chunk) # <<<<<<<<<<<<<< + * + * parser_trim_buffers(self.parser) + */ + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_chunks, __pyx_v_chunk); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L26_try_end; + __pyx_L19_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "pandas/parser.pyx":768 + * + * rows_read += len(list(chunk.values())[0]) + * except StopIteration: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); + if (__pyx_t_10) { + __Pyx_AddTraceback("pandas.parser.TextReader._read_low_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_1, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_12); + + /* "pandas/parser.pyx":769 + * rows_read += len(list(chunk.values())[0]) + * except StopIteration: + * break # <<<<<<<<<<<<<< + * else: + * chunks.append(chunk) + */ + goto __pyx_L28_except_break; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L20_exception_handled; + __pyx_L28_except_break:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L24_try_break; + } + goto __pyx_L21_except_error; + __pyx_L21_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L24_try_break:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L18_break; + __pyx_L20_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_L26_try_end:; + } + } + __pyx_L18_break:; + } + __pyx_L3:; + + /* "pandas/parser.pyx":773 + * chunks.append(chunk) + * + * parser_trim_buffers(self.parser) # <<<<<<<<<<<<<< + * + * if len(chunks) == 0: + */ + parser_trim_buffers(__pyx_v_self->parser); + + /* "pandas/parser.pyx":775 + * parser_trim_buffers(self.parser) + * + * if len(chunks) == 0: # <<<<<<<<<<<<<< + * raise StopIteration + * + */ + __pyx_t_8 = PyObject_Length(__pyx_v_chunks); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_8 == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":776 + * + * if len(chunks) == 0: + * raise StopIteration # <<<<<<<<<<<<<< + * + * # destructive to chunks + */ + __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":779 + * + * # destructive to chunks + * return _concatenate_chunks(chunks) # <<<<<<<<<<<<<< + * + * cdef _tokenize_rows(self, size_t nrows): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_concatenate_chunks); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_chunks); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chunks); + __Pyx_GIVEREF(__pyx_v_chunks); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":743 + * return columns + * + * cdef _read_low_memory(self, rows): # <<<<<<<<<<<<<< + * cdef: + * size_t rows_read = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("pandas.parser.TextReader._read_low_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_chunks); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_crows); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":781 + * return _concatenate_chunks(chunks) + * + * cdef _tokenize_rows(self, size_t nrows): # <<<<<<<<<<<<<< + * cdef int status + * status = tokenize_nrows(self.parser, nrows) + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__tokenize_rows(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, size_t __pyx_v_nrows) { + int __pyx_v_status; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_tokenize_rows", 0); + + /* "pandas/parser.pyx":783 + * cdef _tokenize_rows(self, size_t nrows): + * cdef int status + * status = tokenize_nrows(self.parser, nrows) # <<<<<<<<<<<<<< + * + * if self.parser.warn_msg != NULL: + */ + __pyx_v_status = tokenize_nrows(__pyx_v_self->parser, __pyx_v_nrows); + + /* "pandas/parser.pyx":785 + * status = tokenize_nrows(self.parser, nrows) + * + * if self.parser.warn_msg != NULL: # <<<<<<<<<<<<<< + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) + */ + __pyx_t_1 = ((__pyx_v_self->parser->warn_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":786 + * + * if self.parser.warn_msg != NULL: + * print >> sys.stderr, self.parser.warn_msg # <<<<<<<<<<<<<< + * free(self.parser.warn_msg) + * self.parser.warn_msg = NULL + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stderr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->parser->warn_msg); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PrintOne(__pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/parser.pyx":787 + * if self.parser.warn_msg != NULL: + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) # <<<<<<<<<<<<<< + * self.parser.warn_msg = NULL + * + */ + free(__pyx_v_self->parser->warn_msg); + + /* "pandas/parser.pyx":788 + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) + * self.parser.warn_msg = NULL # <<<<<<<<<<<<<< + * + * if status < 0: + */ + __pyx_v_self->parser->warn_msg = NULL; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":790 + * self.parser.warn_msg = NULL + * + * if status < 0: # <<<<<<<<<<<<<< + * raise_parser_error('Error tokenizing data', self.parser) + * + */ + __pyx_t_1 = ((__pyx_v_status < 0) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":791 + * + * if status < 0: + * raise_parser_error('Error tokenizing data', self.parser) # <<<<<<<<<<<<<< + * + * cdef _read_rows(self, rows, bint trim): + */ + __pyx_t_3 = __pyx_f_6pandas_6parser_raise_parser_error(__pyx_kp_s_Error_tokenizing_data, __pyx_v_self->parser); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/parser.pyx":781 + * return _concatenate_chunks(chunks) + * + * cdef _tokenize_rows(self, size_t nrows): # <<<<<<<<<<<<<< + * cdef int status + * status = tokenize_nrows(self.parser, nrows) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.TextReader._tokenize_rows", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":793 + * raise_parser_error('Error tokenizing data', self.parser) + * + * cdef _read_rows(self, rows, bint trim): # <<<<<<<<<<<<<< + * cdef: + * int buffered_lines + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__read_rows(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows, int __pyx_v_trim) { + int __pyx_v_buffered_lines; + int __pyx_v_irows; + int __pyx_v_footer; + int __pyx_v_status; + PyObject *__pyx_v_columns = NULL; + PyObject *__pyx_v_rows_read = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + size_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_read_rows", 0); + + /* "pandas/parser.pyx":796 + * cdef: + * int buffered_lines + * int irows, footer = 0 # <<<<<<<<<<<<<< + * + * self._start_clock() + */ + __pyx_v_footer = 0; + + /* "pandas/parser.pyx":798 + * int irows, footer = 0 + * + * self._start_clock() # <<<<<<<<<<<<<< + * + * if rows is not None: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_start_clock(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":800 + * self._start_clock() + * + * if rows is not None: # <<<<<<<<<<<<<< + * irows = rows + * buffered_lines = self.parser.lines - self.parser_start + */ + __pyx_t_2 = (__pyx_v_rows != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":801 + * + * if rows is not None: + * irows = rows # <<<<<<<<<<<<<< + * buffered_lines = self.parser.lines - self.parser_start + * if buffered_lines < irows: + */ + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_rows); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_irows = __pyx_t_4; + + /* "pandas/parser.pyx":802 + * if rows is not None: + * irows = rows + * buffered_lines = self.parser.lines - self.parser_start # <<<<<<<<<<<<<< + * if buffered_lines < irows: + * self._tokenize_rows(irows - buffered_lines) + */ + __pyx_v_buffered_lines = (__pyx_v_self->parser->lines - __pyx_v_self->parser_start); + + /* "pandas/parser.pyx":803 + * irows = rows + * buffered_lines = self.parser.lines - self.parser_start + * if buffered_lines < irows: # <<<<<<<<<<<<<< + * self._tokenize_rows(irows - buffered_lines) + * + */ + __pyx_t_3 = ((__pyx_v_buffered_lines < __pyx_v_irows) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":804 + * buffered_lines = self.parser.lines - self.parser_start + * if buffered_lines < irows: + * self._tokenize_rows(irows - buffered_lines) # <<<<<<<<<<<<<< + * + * if self.skip_footer > 0: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_tokenize_rows(__pyx_v_self, (__pyx_v_irows - __pyx_v_buffered_lines)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/parser.pyx":806 + * self._tokenize_rows(irows - buffered_lines) + * + * if self.skip_footer > 0: # <<<<<<<<<<<<<< + * raise ValueError('skip_footer can only be used to read ' + * 'the whole file') + */ + __pyx_t_3 = ((__pyx_v_self->skip_footer > 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":807 + * + * if self.skip_footer > 0: + * raise ValueError('skip_footer can only be used to read ' # <<<<<<<<<<<<<< + * 'the whole file') + * else: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":810 + * 'the whole file') + * else: + * status = tokenize_all_rows(self.parser) # <<<<<<<<<<<<<< + * + * if self.parser.warn_msg != NULL: + */ + __pyx_v_status = tokenize_all_rows(__pyx_v_self->parser); + + /* "pandas/parser.pyx":812 + * status = tokenize_all_rows(self.parser) + * + * if self.parser.warn_msg != NULL: # <<<<<<<<<<<<<< + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) + */ + __pyx_t_3 = ((__pyx_v_self->parser->warn_msg != NULL) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":813 + * + * if self.parser.warn_msg != NULL: + * print >> sys.stderr, self.parser.warn_msg # <<<<<<<<<<<<<< + * free(self.parser.warn_msg) + * self.parser.warn_msg = NULL + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->parser->warn_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PrintOne(__pyx_t_5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":814 + * if self.parser.warn_msg != NULL: + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) # <<<<<<<<<<<<<< + * self.parser.warn_msg = NULL + * + */ + free(__pyx_v_self->parser->warn_msg); + + /* "pandas/parser.pyx":815 + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) + * self.parser.warn_msg = NULL # <<<<<<<<<<<<<< + * + * if status < 0: + */ + __pyx_v_self->parser->warn_msg = NULL; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/parser.pyx":817 + * self.parser.warn_msg = NULL + * + * if status < 0: # <<<<<<<<<<<<<< + * raise_parser_error('Error tokenizing data', self.parser) + * footer = self.skip_footer + */ + __pyx_t_3 = ((__pyx_v_status < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":818 + * + * if status < 0: + * raise_parser_error('Error tokenizing data', self.parser) # <<<<<<<<<<<<<< + * footer = self.skip_footer + * + */ + __pyx_t_5 = __pyx_f_6pandas_6parser_raise_parser_error(__pyx_kp_s_Error_tokenizing_data, __pyx_v_self->parser); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/parser.pyx":819 + * if status < 0: + * raise_parser_error('Error tokenizing data', self.parser) + * footer = self.skip_footer # <<<<<<<<<<<<<< + * + * if self.parser_start == self.parser.lines: + */ + __pyx_t_4 = __pyx_v_self->skip_footer; + __pyx_v_footer = __pyx_t_4; + } + __pyx_L3:; + + /* "pandas/parser.pyx":821 + * footer = self.skip_footer + * + * if self.parser_start == self.parser.lines: # <<<<<<<<<<<<<< + * raise StopIteration + * self._end_clock('Tokenization') + */ + __pyx_t_3 = ((__pyx_v_self->parser_start == __pyx_v_self->parser->lines) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":822 + * + * if self.parser_start == self.parser.lines: + * raise StopIteration # <<<<<<<<<<<<<< + * self._end_clock('Tokenization') + * + */ + __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":823 + * if self.parser_start == self.parser.lines: + * raise StopIteration + * self._end_clock('Tokenization') # <<<<<<<<<<<<<< + * + * self._start_clock() + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_end_clock(__pyx_v_self, __pyx_n_s_Tokenization); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":825 + * self._end_clock('Tokenization') + * + * self._start_clock() # <<<<<<<<<<<<<< + * columns = self._convert_column_data(rows=rows, + * footer=footer, + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_start_clock(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":826 + * + * self._start_clock() + * columns = self._convert_column_data(rows=rows, # <<<<<<<<<<<<<< + * footer=footer, + * upcast_na=not self.as_recarray) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_column_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rows, __pyx_v_rows) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":827 + * self._start_clock() + * columns = self._convert_column_data(rows=rows, + * footer=footer, # <<<<<<<<<<<<<< + * upcast_na=not self.as_recarray) + * self._end_clock('Type conversion') + */ + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_footer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_footer, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":828 + * columns = self._convert_column_data(rows=rows, + * footer=footer, + * upcast_na=not self.as_recarray) # <<<<<<<<<<<<<< + * self._end_clock('Type conversion') + * + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->as_recarray); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyBool_FromLong((!__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_upcast_na, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":826 + * + * self._start_clock() + * columns = self._convert_column_data(rows=rows, # <<<<<<<<<<<<<< + * footer=footer, + * upcast_na=not self.as_recarray) + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_columns = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":829 + * footer=footer, + * upcast_na=not self.as_recarray) + * self._end_clock('Type conversion') # <<<<<<<<<<<<<< + * + * self._start_clock() + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_end_clock(__pyx_v_self, __pyx_kp_s_Type_conversion); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":831 + * self._end_clock('Type conversion') + * + * self._start_clock() # <<<<<<<<<<<<<< + * if len(columns) > 0: + * rows_read = len(list(columns.values())[0]) + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_start_clock(__pyx_v_self); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":832 + * + * self._start_clock() + * if len(columns) > 0: # <<<<<<<<<<<<<< + * rows_read = len(list(columns.values())[0]) + * # trim + */ + __pyx_t_7 = PyObject_Length(__pyx_v_columns); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_7 > 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":833 + * self._start_clock() + * if len(columns) > 0: + * rows_read = len(list(columns.values())[0]) # <<<<<<<<<<<<<< + * # trim + * parser_consume_rows(self.parser, rows_read) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_columns, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_rows_read = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":835 + * rows_read = len(list(columns.values())[0]) + * # trim + * parser_consume_rows(self.parser, rows_read) # <<<<<<<<<<<<<< + * if trim: + * parser_trim_buffers(self.parser) + */ + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_v_rows_read); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + parser_consume_rows(__pyx_v_self->parser, __pyx_t_8); + + /* "pandas/parser.pyx":836 + * # trim + * parser_consume_rows(self.parser, rows_read) + * if trim: # <<<<<<<<<<<<<< + * parser_trim_buffers(self.parser) + * self.parser_start -= rows_read + */ + __pyx_t_3 = (__pyx_v_trim != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":837 + * parser_consume_rows(self.parser, rows_read) + * if trim: + * parser_trim_buffers(self.parser) # <<<<<<<<<<<<<< + * self.parser_start -= rows_read + * + */ + parser_trim_buffers(__pyx_v_self->parser); + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":838 + * if trim: + * parser_trim_buffers(self.parser) + * self.parser_start -= rows_read # <<<<<<<<<<<<<< + * + * self._end_clock('Parser memory cleanup') + */ + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->parser_start); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_6, __pyx_v_rows_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->parser_start = __pyx_t_4; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/parser.pyx":840 + * self.parser_start -= rows_read + * + * self._end_clock('Parser memory cleanup') # <<<<<<<<<<<<<< + * + * return columns + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_end_clock(__pyx_v_self, __pyx_kp_s_Parser_memory_cleanup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":842 + * self._end_clock('Parser memory cleanup') + * + * return columns # <<<<<<<<<<<<<< + * + * def debug_print(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_columns); + __pyx_r = __pyx_v_columns; + goto __pyx_L0; + + /* "pandas/parser.pyx":793 + * raise_parser_error('Error tokenizing data', self.parser) + * + * cdef _read_rows(self, rows, bint trim): # <<<<<<<<<<<<<< + * cdef: + * int buffered_lines + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser.TextReader._read_rows", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_columns); + __Pyx_XDECREF(__pyx_v_rows_read); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":844 + * return columns + * + * def debug_print(self): # <<<<<<<<<<<<<< + * debug_print_parser(self.parser) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11debug_print(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11debug_print(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("debug_print (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10debug_print(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10debug_print(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("debug_print", 0); + + /* "pandas/parser.pyx":845 + * + * def debug_print(self): + * debug_print_parser(self.parser) # <<<<<<<<<<<<<< + * + * cdef _start_clock(self): + */ + debug_print_parser(__pyx_v_self->parser); + + /* "pandas/parser.pyx":844 + * return columns + * + * def debug_print(self): # <<<<<<<<<<<<<< + * debug_print_parser(self.parser) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":847 + * debug_print_parser(self.parser) + * + * cdef _start_clock(self): # <<<<<<<<<<<<<< + * self.clocks.append(time.time()) + * + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__start_clock(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_start_clock", 0); + + /* "pandas/parser.pyx":848 + * + * cdef _start_clock(self): + * self.clocks.append(time.time()) # <<<<<<<<<<<<<< + * + * cdef _end_clock(self, what): + */ + if (unlikely(__pyx_v_self->clocks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_self->clocks, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":847 + * debug_print_parser(self.parser) + * + * cdef _start_clock(self): # <<<<<<<<<<<<<< + * self.clocks.append(time.time()) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.parser.TextReader._start_clock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":850 + * self.clocks.append(time.time()) + * + * cdef _end_clock(self, what): # <<<<<<<<<<<<<< + * if self.verbose: + * elapsed = time.time() - self.clocks.pop(-1) + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__end_clock(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_what) { + PyObject *__pyx_v_elapsed = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_end_clock", 0); + + /* "pandas/parser.pyx":851 + * + * cdef _end_clock(self, what): + * if self.verbose: # <<<<<<<<<<<<<< + * elapsed = time.time() - self.clocks.pop(-1) + * print '%s took: %.2f ms' % (what, elapsed * 1000) + */ + __pyx_t_1 = (__pyx_v_self->verbose != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":852 + * cdef _end_clock(self, what): + * if self.verbose: + * elapsed = time.time() - self.clocks.pop(-1) # <<<<<<<<<<<<<< + * print '%s took: %.2f ms' % (what, elapsed * 1000) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_v_self->clocks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_self->clocks, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_elapsed = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":853 + * if self.verbose: + * elapsed = time.time() - self.clocks.pop(-1) + * print '%s took: %.2f ms' % (what, elapsed * 1000) # <<<<<<<<<<<<<< + * + * def set_noconvert(self, i): + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_elapsed, __pyx_int_1000); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_what); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_what); + __Pyx_GIVEREF(__pyx_v_what); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_took_2f_ms, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":850 + * self.clocks.append(time.time()) + * + * cdef _end_clock(self, what): # <<<<<<<<<<<<<< + * if self.verbose: + * elapsed = time.time() - self.clocks.pop(-1) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.parser.TextReader._end_clock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_elapsed); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":855 + * print '%s took: %.2f ms' % (what, elapsed * 1000) + * + * def set_noconvert(self, i): # <<<<<<<<<<<<<< + * self.noconvert.add(i) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_13set_noconvert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_13set_noconvert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_noconvert (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12set_noconvert(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12set_noconvert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_noconvert", 0); + + /* "pandas/parser.pyx":856 + * + * def set_noconvert(self, i): + * self.noconvert.add(i) # <<<<<<<<<<<<<< + * + * def remove_noconvert(self, i): + */ + if (unlikely(__pyx_v_self->noconvert == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PySet_Add(__pyx_v_self->noconvert, __pyx_v_i); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":855 + * print '%s took: %.2f ms' % (what, elapsed * 1000) + * + * def set_noconvert(self, i): # <<<<<<<<<<<<<< + * self.noconvert.add(i) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.set_noconvert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":858 + * self.noconvert.add(i) + * + * def remove_noconvert(self, i): # <<<<<<<<<<<<<< + * self.noconvert.remove(i) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_15remove_noconvert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_15remove_noconvert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("remove_noconvert (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_14remove_noconvert(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_14remove_noconvert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("remove_noconvert", 0); + + /* "pandas/parser.pyx":859 + * + * def remove_noconvert(self, i): + * self.noconvert.remove(i) # <<<<<<<<<<<<<< + * + * def _convert_column_data(self, rows=None, upcast_na=False, footer=0): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->noconvert, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_i); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i); + __Pyx_GIVEREF(__pyx_v_i); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/parser.pyx":858 + * self.noconvert.add(i) + * + * def remove_noconvert(self, i): # <<<<<<<<<<<<<< + * self.noconvert.remove(i) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.TextReader.remove_noconvert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":861 + * self.noconvert.remove(i) + * + * def _convert_column_data(self, rows=None, upcast_na=False, footer=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, nused + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_17_convert_column_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_17_convert_column_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_rows = 0; + PyObject *__pyx_v_upcast_na = 0; + CYTHON_UNUSED PyObject *__pyx_v_footer = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_convert_column_data (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_upcast_na,&__pyx_n_s_footer,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rows); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_upcast_na); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_footer); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_convert_column_data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_rows = values[0]; + __pyx_v_upcast_na = values[1]; + __pyx_v_footer = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_convert_column_data", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader._convert_column_data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16_convert_column_data(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_rows, __pyx_v_upcast_na, __pyx_v_footer); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16_convert_column_data(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_upcast_na, CYTHON_UNUSED PyObject *__pyx_v_footer) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_nused; + kh_str_t *__pyx_v_na_hashset; + int __pyx_v_start; + int __pyx_v_end; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_na_flist = 0; + int __pyx_v_na_filter; + Py_ssize_t __pyx_v_num_cols; + PyObject *__pyx_v_results = NULL; + PyObject *__pyx_v_conv = NULL; + PyObject *__pyx_v_na_list = NULL; + PyObject *__pyx_v_col_res = NULL; + PyObject *__pyx_v_na_count = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + kh_str_t *__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_convert_column_data", 0); + + /* "pandas/parser.pyx":864 + * cdef: + * Py_ssize_t i, nused + * kh_str_t *na_hashset = NULL # <<<<<<<<<<<<<< + * int start, end + * object name, na_flist + */ + __pyx_v_na_hashset = NULL; + + /* "pandas/parser.pyx":867 + * int start, end + * object name, na_flist + * bint na_filter = 0 # <<<<<<<<<<<<<< + * Py_ssize_t num_cols + * + */ + __pyx_v_na_filter = 0; + + /* "pandas/parser.pyx":870 + * Py_ssize_t num_cols + * + * start = self.parser_start # <<<<<<<<<<<<<< + * + * if rows is None: + */ + __pyx_t_1 = __pyx_v_self->parser_start; + __pyx_v_start = __pyx_t_1; + + /* "pandas/parser.pyx":872 + * start = self.parser_start + * + * if rows is None: # <<<<<<<<<<<<<< + * end = self.parser.lines + * else: + */ + __pyx_t_2 = (__pyx_v_rows == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":873 + * + * if rows is None: + * end = self.parser.lines # <<<<<<<<<<<<<< + * else: + * end = min(start + rows, self.parser.lines) + */ + __pyx_t_1 = __pyx_v_self->parser->lines; + __pyx_v_end = __pyx_t_1; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":875 + * end = self.parser.lines + * else: + * end = min(start + rows, self.parser.lines) # <<<<<<<<<<<<<< + * + * # # skip footer + */ + __pyx_t_1 = __pyx_v_self->parser->lines; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_rows); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __Pyx_INCREF(__pyx_t_5); + __pyx_t_4 = __pyx_t_5; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_end = __pyx_t_1; + } + __pyx_L3:; + + /* "pandas/parser.pyx":888 + * #print >> sys.stderr, self.header + * #print >> sys.stderr, "index" + * num_cols = -1 # <<<<<<<<<<<<<< + * for i in range(self.parser.lines): + * num_cols = (num_cols < self.parser.line_fields[i]) * self.parser.line_fields[i] +\ + */ + __pyx_v_num_cols = -1; + + /* "pandas/parser.pyx":889 + * #print >> sys.stderr, "index" + * num_cols = -1 + * for i in range(self.parser.lines): # <<<<<<<<<<<<<< + * num_cols = (num_cols < self.parser.line_fields[i]) * self.parser.line_fields[i] +\ + * (num_cols >= self.parser.line_fields[i]) * num_cols + */ + __pyx_t_1 = __pyx_v_self->parser->lines; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/parser.pyx":890 + * num_cols = -1 + * for i in range(self.parser.lines): + * num_cols = (num_cols < self.parser.line_fields[i]) * self.parser.line_fields[i] +\ # <<<<<<<<<<<<<< + * (num_cols >= self.parser.line_fields[i]) * num_cols + * + */ + __pyx_v_num_cols = (((__pyx_v_num_cols < (__pyx_v_self->parser->line_fields[__pyx_v_i])) * (__pyx_v_self->parser->line_fields[__pyx_v_i])) + ((__pyx_v_num_cols >= (__pyx_v_self->parser->line_fields[__pyx_v_i])) * __pyx_v_num_cols)); + } + + /* "pandas/parser.pyx":893 + * (num_cols >= self.parser.line_fields[i]) * num_cols + * + * if self.table_width - self.leading_cols > num_cols: # <<<<<<<<<<<<<< + * raise CParserError("Too many columns specified: expected %s and found %s" % + * (self.table_width - self.leading_cols, num_cols)) + */ + __pyx_t_3 = (((__pyx_v_self->table_width - __pyx_v_self->leading_cols) > __pyx_v_num_cols) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":894 + * + * if self.table_width - self.leading_cols > num_cols: + * raise CParserError("Too many columns specified: expected %s and found %s" % # <<<<<<<<<<<<<< + * (self.table_width - self.leading_cols, num_cols)) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CParserError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/parser.pyx":895 + * if self.table_width - self.leading_cols > num_cols: + * raise CParserError("Too many columns specified: expected %s and found %s" % + * (self.table_width - self.leading_cols, num_cols)) # <<<<<<<<<<<<<< + * + * results = {} + */ + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_self->table_width - __pyx_v_self->leading_cols)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_num_cols); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_5 = 0; + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":894 + * + * if self.table_width - self.leading_cols > num_cols: + * raise CParserError("Too many columns specified: expected %s and found %s" % # <<<<<<<<<<<<<< + * (self.table_width - self.leading_cols, num_cols)) + * + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Too_many_columns_specified_expec, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":897 + * (self.table_width - self.leading_cols, num_cols)) + * + * results = {} # <<<<<<<<<<<<<< + * nused = 0 + * for i in range(self.table_width): + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_results = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":898 + * + * results = {} + * nused = 0 # <<<<<<<<<<<<<< + * for i in range(self.table_width): + * if i < self.leading_cols: + */ + __pyx_v_nused = 0; + + /* "pandas/parser.pyx":899 + * results = {} + * nused = 0 + * for i in range(self.table_width): # <<<<<<<<<<<<<< + * if i < self.leading_cols: + * # Pass through leading columns always + */ + __pyx_t_1 = __pyx_v_self->table_width; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/parser.pyx":900 + * nused = 0 + * for i in range(self.table_width): + * if i < self.leading_cols: # <<<<<<<<<<<<<< + * # Pass through leading columns always + * name = i + */ + __pyx_t_3 = ((__pyx_v_i < __pyx_v_self->leading_cols) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":902 + * if i < self.leading_cols: + * # Pass through leading columns always + * name = i # <<<<<<<<<<<<<< + * elif self.usecols and nused == len(self.usecols): + * # Once we've gathered all requested columns, stop. GH5766 + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L9; + } + + /* "pandas/parser.pyx":903 + * # Pass through leading columns always + * name = i + * elif self.usecols and nused == len(self.usecols): # <<<<<<<<<<<<<< + * # Once we've gathered all requested columns, stop. GH5766 + * break + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->usecols); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + __pyx_t_7 = __pyx_v_self->usecols; + __Pyx_INCREF(__pyx_t_7); + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = PySet_Size(__pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = (__pyx_v_nused == __pyx_t_9); + __pyx_t_10 = __pyx_t_2; + } else { + __pyx_t_10 = __pyx_t_3; + } + if (__pyx_t_10) { + + /* "pandas/parser.pyx":905 + * elif self.usecols and nused == len(self.usecols): + * # Once we've gathered all requested columns, stop. GH5766 + * break # <<<<<<<<<<<<<< + * else: + * name = self._get_column_name(i, nused) + */ + goto __pyx_L8_break; + } + /*else*/ { + + /* "pandas/parser.pyx":907 + * break + * else: + * name = self._get_column_name(i, nused) # <<<<<<<<<<<<<< + * if self.has_usecols and not (i in self.usecols or + * name in self.usecols): + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_get_column_name(__pyx_v_self, __pyx_v_i, __pyx_v_nused); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":908 + * else: + * name = self._get_column_name(i, nused) + * if self.has_usecols and not (i in self.usecols or # <<<<<<<<<<<<<< + * name in self.usecols): + * continue + */ + if ((__pyx_v_self->has_usecols != 0)) { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_7, __pyx_v_self->usecols, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(__pyx_t_10 != 0)) { + + /* "pandas/parser.pyx":909 + * name = self._get_column_name(i, nused) + * if self.has_usecols and not (i in self.usecols or + * name in self.usecols): # <<<<<<<<<<<<<< + * continue + * nused += 1 + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_self->usecols, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_3 != 0); + } else { + __pyx_t_2 = (__pyx_t_10 != 0); + } + + /* "pandas/parser.pyx":908 + * else: + * name = self._get_column_name(i, nused) + * if self.has_usecols and not (i in self.usecols or # <<<<<<<<<<<<<< + * name in self.usecols): + * continue + */ + __pyx_t_10 = ((!__pyx_t_2) != 0); + __pyx_t_2 = __pyx_t_10; + } else { + __pyx_t_2 = (__pyx_v_self->has_usecols != 0); + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":910 + * if self.has_usecols and not (i in self.usecols or + * name in self.usecols): + * continue # <<<<<<<<<<<<<< + * nused += 1 + * + */ + goto __pyx_L7_continue; + } + + /* "pandas/parser.pyx":911 + * name in self.usecols): + * continue + * nused += 1 # <<<<<<<<<<<<<< + * + * conv = self._get_converter(i, name) + */ + __pyx_v_nused = (__pyx_v_nused + 1); + } + __pyx_L9:; + + /* "pandas/parser.pyx":913 + * nused += 1 + * + * conv = self._get_converter(i, name) # <<<<<<<<<<<<<< + * + * # XXX + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_converter); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_conv, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":916 + * + * # XXX + * na_flist = set() # <<<<<<<<<<<<<< + * if self.na_filter: + * na_list, na_flist = self._get_na_list(i, name) + */ + __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_na_flist, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":917 + * # XXX + * na_flist = set() + * if self.na_filter: # <<<<<<<<<<<<<< + * na_list, na_flist = self._get_na_list(i, name) + * if na_list is None: + */ + __pyx_t_2 = (__pyx_v_self->na_filter != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":918 + * na_flist = set() + * if self.na_filter: + * na_list, na_flist = self._get_na_list(i, name) # <<<<<<<<<<<<<< + * if na_list is None: + * na_filter = 0 + */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_get_na_list(__pyx_v_self, __pyx_t_6, __pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L13_unpacking_done; + __pyx_L12_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L13_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_na_list, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_na_flist, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":919 + * if self.na_filter: + * na_list, na_flist = self._get_na_list(i, name) + * if na_list is None: # <<<<<<<<<<<<<< + * na_filter = 0 + * else: + */ + __pyx_t_2 = (__pyx_v_na_list == Py_None); + __pyx_t_10 = (__pyx_t_2 != 0); + if (__pyx_t_10) { + + /* "pandas/parser.pyx":920 + * na_list, na_flist = self._get_na_list(i, name) + * if na_list is None: + * na_filter = 0 # <<<<<<<<<<<<<< + * else: + * na_filter = 1 + */ + __pyx_v_na_filter = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/parser.pyx":922 + * na_filter = 0 + * else: + * na_filter = 1 # <<<<<<<<<<<<<< + * na_hashset = kset_from_list(na_list) + * else: + */ + __pyx_v_na_filter = 1; + + /* "pandas/parser.pyx":923 + * else: + * na_filter = 1 + * na_hashset = kset_from_list(na_list) # <<<<<<<<<<<<<< + * else: + * na_filter = 0 + */ + if (!(likely(PyList_CheckExact(__pyx_v_na_list))||((__pyx_v_na_list) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_na_list)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_f_6pandas_6parser_kset_from_list(((PyObject*)__pyx_v_na_list)); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_na_hashset = __pyx_t_12; + } + __pyx_L14:; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/parser.pyx":925 + * na_hashset = kset_from_list(na_list) + * else: + * na_filter = 0 # <<<<<<<<<<<<<< + * + * if conv: + */ + __pyx_v_na_filter = 0; + } + __pyx_L11:; + + /* "pandas/parser.pyx":927 + * na_filter = 0 + * + * if conv: # <<<<<<<<<<<<<< + * results[i] = _apply_converter(conv, self.parser, i, start, end, + * self.c_encoding) + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_conv); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_10) { + + /* "pandas/parser.pyx":928 + * + * if conv: + * results[i] = _apply_converter(conv, self.parser, i, start, end, # <<<<<<<<<<<<<< + * self.c_encoding) + * continue + */ + __pyx_t_4 = __pyx_f_6pandas_6parser__apply_converter(__pyx_v_conv, __pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_self->c_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PyDict_SetItem(__pyx_v_results, __pyx_t_7, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":930 + * results[i] = _apply_converter(conv, self.parser, i, start, end, + * self.c_encoding) + * continue # <<<<<<<<<<<<<< + * + * # Should return as the desired dtype (inferred or specified) + */ + goto __pyx_L7_continue; + } + + /* "pandas/parser.pyx":933 + * + * # Should return as the desired dtype (inferred or specified) + * col_res, na_count = self._convert_tokens(i, start, end, name, # <<<<<<<<<<<<<< + * na_filter, na_hashset, na_flist) + * + */ + __pyx_t_4 = __pyx_f_6pandas_6parser_10TextReader__convert_tokens(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_name, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_7 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L16_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_6 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L16_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L17_unpacking_done; + __pyx_L16_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L17_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_col_res, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_na_count, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":936 + * na_filter, na_hashset, na_flist) + * + * if na_filter: # <<<<<<<<<<<<<< + * self._free_na_set(na_hashset) + * + */ + __pyx_t_10 = (__pyx_v_na_filter != 0); + if (__pyx_t_10) { + + /* "pandas/parser.pyx":937 + * + * if na_filter: + * self._free_na_set(na_hashset) # <<<<<<<<<<<<<< + * + * if upcast_na and na_count > 0: + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_free_na_set(__pyx_v_self, __pyx_v_na_hashset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L18; + } + __pyx_L18:; + + /* "pandas/parser.pyx":939 + * self._free_na_set(na_hashset) + * + * if upcast_na and na_count > 0: # <<<<<<<<<<<<<< + * col_res = _maybe_upcast(col_res) + * + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_upcast_na); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_10) { + __pyx_t_4 = PyObject_RichCompare(__pyx_v_na_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_10; + } + if (__pyx_t_3) { + + /* "pandas/parser.pyx":940 + * + * if upcast_na and na_count > 0: + * col_res = _maybe_upcast(col_res) # <<<<<<<<<<<<<< + * + * if issubclass(col_res.dtype.type, np.integer) and self.compact_ints: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_upcast); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_col_res); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_col_res); + __Pyx_GIVEREF(__pyx_v_col_res); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_col_res, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L19; + } + __pyx_L19:; + + /* "pandas/parser.pyx":942 + * col_res = _maybe_upcast(col_res) + * + * if issubclass(col_res.dtype.type, np.integer) and self.compact_ints: # <<<<<<<<<<<<<< + * col_res = downcast_int64(col_res, self.use_unsigned) + * + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_res, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = PyObject_IsSubclass(__pyx_t_6, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_self->compact_ints); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_t_10; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":943 + * + * if issubclass(col_res.dtype.type, np.integer) and self.compact_ints: + * col_res = downcast_int64(col_res, self.use_unsigned) # <<<<<<<<<<<<<< + * + * if col_res is None: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_downcast_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_col_res); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_col_res); + __Pyx_GIVEREF(__pyx_v_col_res); + __Pyx_INCREF(__pyx_v_self->use_unsigned); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_self->use_unsigned); + __Pyx_GIVEREF(__pyx_v_self->use_unsigned); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_col_res, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/parser.pyx":945 + * col_res = downcast_int64(col_res, self.use_unsigned) + * + * if col_res is None: # <<<<<<<<<<<<<< + * raise Exception('Unable to parse column %d' % i) + * + */ + __pyx_t_2 = (__pyx_v_col_res == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":946 + * + * if col_res is None: + * raise Exception('Unable to parse column %d' % i) # <<<<<<<<<<<<<< + * + * results[i] = col_res + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_column_d, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":948 + * raise Exception('Unable to parse column %d' % i) + * + * results[i] = col_res # <<<<<<<<<<<<<< + * + * self.parser_start += end - start + */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyDict_SetItem(__pyx_v_results, __pyx_t_6, __pyx_v_col_res) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_L7_continue:; + } + __pyx_L8_break:; + + /* "pandas/parser.pyx":950 + * results[i] = col_res + * + * self.parser_start += end - start # <<<<<<<<<<<<<< + * + * return results + */ + __pyx_v_self->parser_start = (__pyx_v_self->parser_start + (__pyx_v_end - __pyx_v_start)); + + /* "pandas/parser.pyx":952 + * self.parser_start += end - start + * + * return results # <<<<<<<<<<<<<< + * + * cdef inline _convert_tokens(self, Py_ssize_t i, int start, int end, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_results); + __pyx_r = __pyx_v_results; + goto __pyx_L0; + + /* "pandas/parser.pyx":861 + * self.noconvert.remove(i) + * + * def _convert_column_data(self, rows=None, upcast_na=False, footer=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, nused + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.parser.TextReader._convert_column_data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_na_flist); + __Pyx_XDECREF(__pyx_v_results); + __Pyx_XDECREF(__pyx_v_conv); + __Pyx_XDECREF(__pyx_v_na_list); + __Pyx_XDECREF(__pyx_v_col_res); + __Pyx_XDECREF(__pyx_v_na_count); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":954 + * return results + * + * cdef inline _convert_tokens(self, Py_ssize_t i, int start, int end, # <<<<<<<<<<<<<< + * object name, bint na_filter, + * kh_str_t *na_hashset, + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_6parser_10TextReader__convert_tokens(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, Py_ssize_t __pyx_v_i, int __pyx_v_start, int __pyx_v_end, PyObject *__pyx_v_name, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset, PyObject *__pyx_v_na_flist) { + PyObject *__pyx_v_col_dtype = 0; + PyObject *__pyx_v_col_res = NULL; + PyObject *__pyx_v_dt = NULL; + PyObject *__pyx_v_na_count = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_convert_tokens", 0); + + /* "pandas/parser.pyx":959 + * object na_flist): + * cdef: + * object col_dtype = None # <<<<<<<<<<<<<< + * + * if self.dtype is not None: + */ + __Pyx_INCREF(Py_None); + __pyx_v_col_dtype = Py_None; + + /* "pandas/parser.pyx":961 + * object col_dtype = None + * + * if self.dtype is not None: # <<<<<<<<<<<<<< + * if isinstance(self.dtype, dict): + * if name in self.dtype: + */ + __pyx_t_1 = (__pyx_v_self->dtype != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":962 + * + * if self.dtype is not None: + * if isinstance(self.dtype, dict): # <<<<<<<<<<<<<< + * if name in self.dtype: + * col_dtype = self.dtype[name] + */ + __pyx_t_3 = __pyx_v_self->dtype; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyDict_Check(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":963 + * if self.dtype is not None: + * if isinstance(self.dtype, dict): + * if name in self.dtype: # <<<<<<<<<<<<<< + * col_dtype = self.dtype[name] + * elif i in self.dtype: + */ + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_self->dtype, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":964 + * if isinstance(self.dtype, dict): + * if name in self.dtype: + * col_dtype = self.dtype[name] # <<<<<<<<<<<<<< + * elif i in self.dtype: + * col_dtype = self.dtype[i] + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->dtype, __pyx_v_name); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + + /* "pandas/parser.pyx":965 + * if name in self.dtype: + * col_dtype = self.dtype[name] + * elif i in self.dtype: # <<<<<<<<<<<<<< + * col_dtype = self.dtype[i] + * else: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_3, __pyx_v_self->dtype, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":966 + * col_dtype = self.dtype[name] + * elif i in self.dtype: + * col_dtype = self.dtype[i] # <<<<<<<<<<<<<< + * else: + * if self.dtype.names: + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->dtype, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/parser.pyx":968 + * col_dtype = self.dtype[i] + * else: + * if self.dtype.names: # <<<<<<<<<<<<<< + * col_dtype = self.dtype.descr[i][1] + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/parser.pyx":969 + * else: + * if self.dtype.names: + * col_dtype = self.dtype.descr[i][1] # <<<<<<<<<<<<<< + * else: + * col_dtype = self.dtype + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_descr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/parser.pyx":971 + * col_dtype = self.dtype.descr[i][1] + * else: + * col_dtype = self.dtype # <<<<<<<<<<<<<< + * + * if col_dtype is not None: + */ + __pyx_t_3 = __pyx_v_self->dtype; + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L6:; + } + __pyx_L4:; + + /* "pandas/parser.pyx":973 + * col_dtype = self.dtype + * + * if col_dtype is not None: # <<<<<<<<<<<<<< + * if not isinstance(col_dtype, basestring): + * if isinstance(col_dtype, np.dtype): + */ + __pyx_t_1 = (__pyx_v_col_dtype != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":974 + * + * if col_dtype is not None: + * if not isinstance(col_dtype, basestring): # <<<<<<<<<<<<<< + * if isinstance(col_dtype, np.dtype): + * col_dtype = col_dtype.str + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_col_dtype, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":975 + * if col_dtype is not None: + * if not isinstance(col_dtype, basestring): + * if isinstance(col_dtype, np.dtype): # <<<<<<<<<<<<<< + * col_dtype = col_dtype.str + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_col_dtype, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":976 + * if not isinstance(col_dtype, basestring): + * if isinstance(col_dtype, np.dtype): + * col_dtype = col_dtype.str # <<<<<<<<<<<<<< + * else: + * col_dtype = np.dtype(col_dtype).str + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/parser.pyx":978 + * col_dtype = col_dtype.str + * else: + * col_dtype = np.dtype(col_dtype).str # <<<<<<<<<<<<<< + * + * return self._convert_with_dtype(col_dtype, i, start, end, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_col_dtype); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_col_dtype); + __Pyx_GIVEREF(__pyx_v_col_dtype); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L9:; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/parser.pyx":980 + * col_dtype = np.dtype(col_dtype).str + * + * return self._convert_with_dtype(col_dtype, i, start, end, # <<<<<<<<<<<<<< + * na_filter, 1, na_hashset, na_flist) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":981 + * + * return self._convert_with_dtype(col_dtype, i, start, end, + * na_filter, 1, na_hashset, na_flist) # <<<<<<<<<<<<<< + * + * if i in self.noconvert: + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_convert_with_dtype(__pyx_v_self, __pyx_v_col_dtype, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, 1, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":983 + * na_filter, 1, na_hashset, na_flist) + * + * if i in self.noconvert: # <<<<<<<<<<<<<< + * return self._string_convert(i, start, end, na_filter, na_hashset) + * else: + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_4, __pyx_v_self->noconvert, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":984 + * + * if i in self.noconvert: + * return self._string_convert(i, start, end, na_filter, na_hashset) # <<<<<<<<<<<<<< + * else: + * col_res = None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_string_convert(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":986 + * return self._string_convert(i, start, end, na_filter, na_hashset) + * else: + * col_res = None # <<<<<<<<<<<<<< + * for dt in dtype_cast_order: + * try: + */ + __Pyx_INCREF(Py_None); + __pyx_v_col_res = Py_None; + + /* "pandas/parser.pyx":987 + * else: + * col_res = None + * for dt in dtype_cast_order: # <<<<<<<<<<<<<< + * try: + * col_res, na_count = self._convert_with_dtype( + */ + if (unlikely(__pyx_v_6pandas_6parser_dtype_cast_order == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __pyx_v_6pandas_6parser_dtype_cast_order; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + for (;;) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":988 + * col_res = None + * for dt in dtype_cast_order: + * try: # <<<<<<<<<<<<<< + * col_res, na_count = self._convert_with_dtype( + * dt, i, start, end, na_filter, 0, na_hashset, na_flist) + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/parser.pyx":989 + * for dt in dtype_cast_order: + * try: + * col_res, na_count = self._convert_with_dtype( # <<<<<<<<<<<<<< + * dt, i, start, end, na_filter, 0, na_hashset, na_flist) + * except OverflowError: + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_convert_with_dtype(__pyx_v_self, __pyx_v_dt, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, 0, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_10 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_10); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L22_unpacking_done; + __pyx_L21_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __pyx_L22_unpacking_done:; + } + __Pyx_DECREF_SET(__pyx_v_col_res, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_na_count, __pyx_t_10); + __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":991 + * col_res, na_count = self._convert_with_dtype( + * dt, i, start, end, na_filter, 0, na_hashset, na_flist) + * except OverflowError: # <<<<<<<<<<<<<< + * col_res, na_count = self._convert_with_dtype( + * '|O8', i, start, end, na_filter, 0, na_hashset, na_flist) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OverflowError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_13) { + __Pyx_AddTraceback("pandas.parser.TextReader._convert_tokens", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/parser.pyx":992 + * dt, i, start, end, na_filter, 0, na_hashset, na_flist) + * except OverflowError: + * col_res, na_count = self._convert_with_dtype( # <<<<<<<<<<<<<< + * '|O8', i, start, end, na_filter, 0, na_hashset, na_flist) + * + */ + __pyx_t_11 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_convert_with_dtype(__pyx_v_self, __pyx_kp_s_O8, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, 0, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_11); + if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { + PyObject* sequence = __pyx_t_11; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_14 = PyList_GET_ITEM(sequence, 0); + __pyx_t_15 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + #else + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_15); + #endif + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_14 = __pyx_t_12(__pyx_t_16); if (unlikely(!__pyx_t_14)) goto __pyx_L25_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + index = 1; __pyx_t_15 = __pyx_t_12(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L25_unpacking_failed; + __Pyx_GOTREF(__pyx_t_15); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_16), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L26_unpacking_done; + __pyx_L25_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __pyx_L26_unpacking_done:; + } + __Pyx_DECREF_SET(__pyx_v_col_res, __pyx_t_14); + __pyx_t_14 = 0; + __Pyx_XDECREF_SET(__pyx_v_na_count, __pyx_t_15); + __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L20_try_end:; + } + + /* "pandas/parser.pyx":995 + * '|O8', i, start, end, na_filter, 0, na_hashset, na_flist) + * + * if col_res is not None: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_1 = (__pyx_v_col_res != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":996 + * + * if col_res is not None: + * break # <<<<<<<<<<<<<< + * + * return col_res, na_count + */ + goto __pyx_L12_break; + } + } + __pyx_L12_break:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "pandas/parser.pyx":998 + * break + * + * return col_res, na_count # <<<<<<<<<<<<<< + * + * cdef _convert_with_dtype(self, object dtype, Py_ssize_t i, + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_na_count)) { __Pyx_RaiseUnboundLocalError("na_count"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_col_res); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_col_res); + __Pyx_GIVEREF(__pyx_v_col_res); + __Pyx_INCREF(__pyx_v_na_count); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_na_count); + __Pyx_GIVEREF(__pyx_v_na_count); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":954 + * return results + * + * cdef inline _convert_tokens(self, Py_ssize_t i, int start, int end, # <<<<<<<<<<<<<< + * object name, bint na_filter, + * kh_str_t *na_hashset, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("pandas.parser.TextReader._convert_tokens", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_col_dtype); + __Pyx_XDECREF(__pyx_v_col_res); + __Pyx_XDECREF(__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_na_count); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1000 + * return col_res, na_count + * + * cdef _convert_with_dtype(self, object dtype, Py_ssize_t i, # <<<<<<<<<<<<<< + * int start, int end, + * bint na_filter, + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__convert_with_dtype(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_dtype, Py_ssize_t __pyx_v_i, int __pyx_v_start, int __pyx_v_end, int __pyx_v_na_filter, int __pyx_v_user_dtype, kh_str_t *__pyx_v_na_hashset, PyObject *__pyx_v_na_flist) { + kh_str_t *__pyx_v_true_set; + kh_str_t *__pyx_v_false_set; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_na_count = NULL; + PyObject *__pyx_v_width = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + kh_str_t *__pyx_t_9; + size_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_convert_with_dtype", 0); + + /* "pandas/parser.pyx":1008 + * cdef kh_str_t *true_set, *false_set + * + * if dtype[1] == 'i' or dtype[1] == 'u': # <<<<<<<<<<<<<< + * result, na_count = _try_int64(self.parser, i, start, end, + * na_filter, na_hashset) + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_i, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_u, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/parser.pyx":1009 + * + * if dtype[1] == 'i' or dtype[1] == 'u': + * result, na_count = _try_int64(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * if user_dtype and na_count > 0: + */ + __pyx_t_1 = __pyx_f_6pandas_6parser__try_int64(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_na_count = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1011 + * result, na_count = _try_int64(self.parser, i, start, end, + * na_filter, na_hashset) + * if user_dtype and na_count > 0: # <<<<<<<<<<<<<< + * raise Exception('Integer column has NA values') + * + */ + __pyx_t_4 = __pyx_v_user_dtype; + if (__pyx_t_4) { + __pyx_t_1 = PyObject_RichCompare(__pyx_v_na_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1012 + * na_filter, na_hashset) + * if user_dtype and na_count > 0: + * raise Exception('Integer column has NA values') # <<<<<<<<<<<<<< + * + * if dtype[1:] != 'i8': + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1014 + * raise Exception('Integer column has NA values') + * + * if dtype[1:] != 'i8': # <<<<<<<<<<<<<< + * result = result.astype(dtype) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_dtype, 1, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_i8, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1015 + * + * if dtype[1:] != 'i8': + * result = result.astype(dtype) # <<<<<<<<<<<<<< + * + * return result, na_count + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_dtype); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_dtype); + __Pyx_GIVEREF(__pyx_v_dtype); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/parser.pyx":1017 + * result = result.astype(dtype) + * + * return result, na_count # <<<<<<<<<<<<<< + * + * elif dtype[1] == 'f': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v_na_count); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_na_count); + __Pyx_GIVEREF(__pyx_v_na_count); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1019 + * return result, na_count + * + * elif dtype[1] == 'f': # <<<<<<<<<<<<<< + * result, na_count = _try_double(self.parser, i, start, end, + * na_filter, na_hashset, na_flist) + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1020 + * + * elif dtype[1] == 'f': + * result, na_count = _try_double(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset, na_flist) + * + */ + __pyx_t_5 = __pyx_f_6pandas_6parser__try_double(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L9_unpacking_done:; + } + __pyx_v_result = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_na_count = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1023 + * na_filter, na_hashset, na_flist) + * + * if dtype[1:] != 'f8': # <<<<<<<<<<<<<< + * result = result.astype(dtype) + * return result, na_count + */ + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_dtype, 1, 0, NULL, NULL, &__pyx_slice__21, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_f8, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1024 + * + * if dtype[1:] != 'f8': + * result = result.astype(dtype) # <<<<<<<<<<<<<< + * return result, na_count + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_dtype); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dtype); + __Pyx_GIVEREF(__pyx_v_dtype); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":1025 + * if dtype[1:] != 'f8': + * result = result.astype(dtype) + * return result, na_count # <<<<<<<<<<<<<< + * + * elif dtype[1] == 'b': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v_na_count); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_na_count); + __Pyx_GIVEREF(__pyx_v_na_count); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1027 + * return result, na_count + * + * elif dtype[1] == 'b': # <<<<<<<<<<<<<< + * if self.true_values is not None or self.false_values is not None: + * + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_b, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1028 + * + * elif dtype[1] == 'b': + * if self.true_values is not None or self.false_values is not None: # <<<<<<<<<<<<<< + * + * true_set = kset_from_list(self.true_values + _true_values) + */ + __pyx_t_3 = (__pyx_v_self->true_values != Py_None); + if (!(__pyx_t_3 != 0)) { + __pyx_t_4 = (__pyx_v_self->false_values != Py_None); + __pyx_t_2 = (__pyx_t_4 != 0); + } else { + __pyx_t_2 = (__pyx_t_3 != 0); + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1030 + * if self.true_values is not None or self.false_values is not None: + * + * true_set = kset_from_list(self.true_values + _true_values) # <<<<<<<<<<<<<< + * false_set = kset_from_list(self.false_values + _false_values) + * result, na_count = _try_bool_flex(self.parser, i, start, end, + */ + __pyx_t_6 = PyNumber_Add(__pyx_v_self->true_values, __pyx_v_6pandas_6parser__true_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_6pandas_6parser_kset_from_list(((PyObject*)__pyx_t_6)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_true_set = __pyx_t_9; + + /* "pandas/parser.pyx":1031 + * + * true_set = kset_from_list(self.true_values + _true_values) + * false_set = kset_from_list(self.false_values + _false_values) # <<<<<<<<<<<<<< + * result, na_count = _try_bool_flex(self.parser, i, start, end, + * na_filter, na_hashset, + */ + __pyx_t_6 = PyNumber_Add(__pyx_v_self->false_values, __pyx_v_6pandas_6parser__false_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_6pandas_6parser_kset_from_list(((PyObject*)__pyx_t_6)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_false_set = __pyx_t_9; + + /* "pandas/parser.pyx":1032 + * true_set = kset_from_list(self.true_values + _true_values) + * false_set = kset_from_list(self.false_values + _false_values) + * result, na_count = _try_bool_flex(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset, + * true_set, false_set) + */ + __pyx_t_6 = __pyx_f_6pandas_6parser__try_bool_flex(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_true_set, __pyx_v_false_set); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L13_unpacking_done; + __pyx_L12_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L13_unpacking_done:; + } + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_na_count = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1035 + * na_filter, na_hashset, + * true_set, false_set) + * kh_destroy_str(true_set) # <<<<<<<<<<<<<< + * kh_destroy_str(false_set) + * else: + */ + kh_destroy_str(__pyx_v_true_set); + + /* "pandas/parser.pyx":1036 + * true_set, false_set) + * kh_destroy_str(true_set) + * kh_destroy_str(false_set) # <<<<<<<<<<<<<< + * else: + * result, na_count = _try_bool(self.parser, i, start, end, + */ + kh_destroy_str(__pyx_v_false_set); + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/parser.pyx":1038 + * kh_destroy_str(false_set) + * else: + * result, na_count = _try_bool(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * return result, na_count + */ + __pyx_t_6 = __pyx_f_6pandas_6parser__try_bool(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L15_unpacking_done; + __pyx_L14_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L15_unpacking_done:; + } + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_na_count = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L11:; + + /* "pandas/parser.pyx":1040 + * result, na_count = _try_bool(self.parser, i, start, end, + * na_filter, na_hashset) + * return result, na_count # <<<<<<<<<<<<<< + * elif dtype[1] == 'c': + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v_na_count); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_na_count); + __Pyx_GIVEREF(__pyx_v_na_count); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1041 + * na_filter, na_hashset) + * return result, na_count + * elif dtype[1] == 'c': # <<<<<<<<<<<<<< + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + * + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1042 + * return result, na_count + * elif dtype[1] == 'c': + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) # <<<<<<<<<<<<<< + * + * elif dtype[1] == 'S': + */ + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_the_dtype_s_is_not_supported_for, __pyx_v_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1044 + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + * + * elif dtype[1] == 'S': # <<<<<<<<<<<<<< + * # TODO: na handling + * width = int(dtype[2:]) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1046 + * elif dtype[1] == 'S': + * # TODO: na handling + * width = int(dtype[2:]) # <<<<<<<<<<<<<< + * if width > 0: + * result = _to_fw_string(self.parser, i, start, end, width) + */ + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_dtype, 2, 0, NULL, NULL, &__pyx_slice__22, 1, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_width = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1047 + * # TODO: na handling + * width = int(dtype[2:]) + * if width > 0: # <<<<<<<<<<<<<< + * result = _to_fw_string(self.parser, i, start, end, width) + * return result, 0 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_width, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1048 + * width = int(dtype[2:]) + * if width > 0: + * result = _to_fw_string(self.parser, i, start, end, width) # <<<<<<<<<<<<<< + * return result, 0 + * + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_width); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_6pandas_6parser__to_fw_string(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1049 + * if width > 0: + * result = _to_fw_string(self.parser, i, start, end, width) + * return result, 0 # <<<<<<<<<<<<<< + * + * # treat as a regular string parsing + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1052 + * + * # treat as a regular string parsing + * return self._string_convert(i, start, end, na_filter, # <<<<<<<<<<<<<< + * na_hashset) + * elif dtype[1] == 'U': + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1053 + * # treat as a regular string parsing + * return self._string_convert(i, start, end, na_filter, + * na_hashset) # <<<<<<<<<<<<<< + * elif dtype[1] == 'U': + * width = int(dtype[2:]) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_string_convert(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1054 + * return self._string_convert(i, start, end, na_filter, + * na_hashset) + * elif dtype[1] == 'U': # <<<<<<<<<<<<<< + * width = int(dtype[2:]) + * if width > 0: + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1055 + * na_hashset) + * elif dtype[1] == 'U': + * width = int(dtype[2:]) # <<<<<<<<<<<<<< + * if width > 0: + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_dtype, 2, 0, NULL, NULL, &__pyx_slice__23, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_width = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1056 + * elif dtype[1] == 'U': + * width = int(dtype[2:]) + * if width > 0: # <<<<<<<<<<<<<< + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + * + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_width, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1057 + * width = int(dtype[2:]) + * if width > 0: + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) # <<<<<<<<<<<<<< + * + * # unicode variable width + */ + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_the_dtype_s_is_not_supported_for, __pyx_v_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1060 + * + * # unicode variable width + * return self._string_convert(i, start, end, na_filter, # <<<<<<<<<<<<<< + * na_hashset) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1061 + * # unicode variable width + * return self._string_convert(i, start, end, na_filter, + * na_hashset) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_string_convert(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1064 + * + * + * elif dtype[1] == 'O': # <<<<<<<<<<<<<< + * return self._string_convert(i, start, end, na_filter, + * na_hashset) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1065 + * + * elif dtype[1] == 'O': + * return self._string_convert(i, start, end, na_filter, # <<<<<<<<<<<<<< + * na_hashset) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1066 + * elif dtype[1] == 'O': + * return self._string_convert(i, start, end, na_filter, + * na_hashset) # <<<<<<<<<<<<<< + * else: + * if dtype[1] == 'M': + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_string_convert(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1068 + * na_hashset) + * else: + * if dtype[1] == 'M': # <<<<<<<<<<<<<< + * raise TypeError("the dtype %s is not supported for parsing, " + * "pass this column using parse_dates instead" % dtype) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_M, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1070 + * if dtype[1] == 'M': + * raise TypeError("the dtype %s is not supported for parsing, " + * "pass this column using parse_dates instead" % dtype) # <<<<<<<<<<<<<< + * raise TypeError("the dtype %s is not supported for parsing" % dtype) + * + */ + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_the_dtype_s_is_not_supported_for_2, __pyx_v_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/parser.pyx":1069 + * else: + * if dtype[1] == 'M': + * raise TypeError("the dtype %s is not supported for parsing, " # <<<<<<<<<<<<<< + * "pass this column using parse_dates instead" % dtype) + * raise TypeError("the dtype %s is not supported for parsing" % dtype) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1071 + * raise TypeError("the dtype %s is not supported for parsing, " + * "pass this column using parse_dates instead" % dtype) + * raise TypeError("the dtype %s is not supported for parsing" % dtype) # <<<<<<<<<<<<<< + * + * cdef _string_convert(self, Py_ssize_t i, int start, int end, + */ + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_the_dtype_s_is_not_supported_for, __pyx_v_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1000 + * return col_res, na_count + * + * cdef _convert_with_dtype(self, object dtype, Py_ssize_t i, # <<<<<<<<<<<<<< + * int start, int end, + * bint na_filter, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.parser.TextReader._convert_with_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_na_count); + __Pyx_XDECREF(__pyx_v_width); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1073 + * raise TypeError("the dtype %s is not supported for parsing" % dtype) + * + * cdef _string_convert(self, Py_ssize_t i, int start, int end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * if PY3: + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__string_convert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, Py_ssize_t __pyx_v_i, int __pyx_v_start, int __pyx_v_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_convert", 0); + + /* "pandas/parser.pyx":1075 + * cdef _string_convert(self, Py_ssize_t i, int start, int end, + * bint na_filter, kh_str_t *na_hashset): + * if PY3: # <<<<<<<<<<<<<< + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": + */ + __pyx_t_1 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1076 + * bint na_filter, kh_str_t *na_hashset): + * if PY3: + * if self.c_encoding != NULL: # <<<<<<<<<<<<<< + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, + */ + __pyx_t_1 = ((__pyx_v_self->c_encoding != NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1077 + * if PY3: + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": # <<<<<<<<<<<<<< + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) + */ + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->c_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b_utf_8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1078 + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1079 + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) # <<<<<<<<<<<<<< + * else: + * return _string_box_decode(self.parser, i, start, end, + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_utf8(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1081 + * na_filter, na_hashset) + * else: + * return _string_box_decode(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset, + * self.c_encoding) + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1083 + * return _string_box_decode(self.parser, i, start, end, + * na_filter, na_hashset, + * self.c_encoding) # <<<<<<<<<<<<<< + * else: + * return _string_box_utf8(self.parser, i, start, end, + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_decode(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_self->c_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1085 + * self.c_encoding) + * else: + * return _string_box_utf8(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1086 + * else: + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) # <<<<<<<<<<<<<< + * else: + * if self.c_encoding != NULL: + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_utf8(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1088 + * na_filter, na_hashset) + * else: + * if self.c_encoding != NULL: # <<<<<<<<<<<<<< + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, + */ + __pyx_t_1 = ((__pyx_v_self->c_encoding != NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1089 + * else: + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": # <<<<<<<<<<<<<< + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) + */ + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->c_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b_utf_8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1090 + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1091 + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) # <<<<<<<<<<<<<< + * else: + * return _string_box_decode(self.parser, i, start, end, + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_utf8(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1093 + * na_filter, na_hashset) + * else: + * return _string_box_decode(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset, + * self.c_encoding) + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1095 + * return _string_box_decode(self.parser, i, start, end, + * na_filter, na_hashset, + * self.c_encoding) # <<<<<<<<<<<<<< + * else: + * return _string_box_factorize(self.parser, i, start, end, + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_decode(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_self->c_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1097 + * self.c_encoding) + * else: + * return _string_box_factorize(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1098 + * else: + * return _string_box_factorize(self.parser, i, start, end, + * na_filter, na_hashset) # <<<<<<<<<<<<<< + * + * def _get_converter(self, i, name): + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_factorize(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + + /* "pandas/parser.pyx":1073 + * raise TypeError("the dtype %s is not supported for parsing" % dtype) + * + * cdef _string_convert(self, Py_ssize_t i, int start, int end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * if PY3: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.parser.TextReader._string_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1100 + * na_filter, na_hashset) + * + * def _get_converter(self, i, name): # <<<<<<<<<<<<<< + * if self.converters is None: + * return None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_19_get_converter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_19_get_converter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_i = 0; + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_converter (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_get_converter", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_converter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_i = values[0]; + __pyx_v_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_converter", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader._get_converter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_18_get_converter(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_i, __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_18_get_converter(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_name) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_converter", 0); + + /* "pandas/parser.pyx":1101 + * + * def _get_converter(self, i, name): + * if self.converters is None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = (__pyx_v_self->converters == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1102 + * def _get_converter(self, i, name): + * if self.converters is None: + * return None # <<<<<<<<<<<<<< + * + * if name is not None and name in self.converters: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1104 + * return None + * + * if name is not None and name in self.converters: # <<<<<<<<<<<<<< + * return self.converters[name] + * + */ + __pyx_t_2 = (__pyx_v_name != Py_None); + if ((__pyx_t_2 != 0)) { + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_self->converters, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__pyx_t_1 != 0); + } else { + __pyx_t_3 = (__pyx_t_2 != 0); + } + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1105 + * + * if name is not None and name in self.converters: + * return self.converters[name] # <<<<<<<<<<<<<< + * + * # Converter for position, if any + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->converters, __pyx_v_name); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1108 + * + * # Converter for position, if any + * return self.converters.get(i) # <<<<<<<<<<<<<< + * + * cdef _get_na_list(self, i, name): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->converters, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_i); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_i); + __Pyx_GIVEREF(__pyx_v_i); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1100 + * na_filter, na_hashset) + * + * def _get_converter(self, i, name): # <<<<<<<<<<<<<< + * if self.converters is None: + * return None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser.TextReader._get_converter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1110 + * return self.converters.get(i) + * + * cdef _get_na_list(self, i, name): # <<<<<<<<<<<<<< + * if self.na_values is None: + * return None, set() + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__get_na_list(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_name) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_fvalues = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_na_list", 0); + + /* "pandas/parser.pyx":1111 + * + * cdef _get_na_list(self, i, name): + * if self.na_values is None: # <<<<<<<<<<<<<< + * return None, set() + * + */ + __pyx_t_1 = (__pyx_v_self->na_values == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1112 + * cdef _get_na_list(self, i, name): + * if self.na_values is None: + * return None, set() # <<<<<<<<<<<<<< + * + * if isinstance(self.na_values, dict): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1114 + * return None, set() + * + * if isinstance(self.na_values, dict): # <<<<<<<<<<<<<< + * values = None + * if name is not None and name in self.na_values: + */ + __pyx_t_4 = __pyx_v_self->na_values; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = PyDict_Check(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1115 + * + * if isinstance(self.na_values, dict): + * values = None # <<<<<<<<<<<<<< + * if name is not None and name in self.na_values: + * values = self.na_values[name] + */ + __Pyx_INCREF(Py_None); + __pyx_v_values = Py_None; + + /* "pandas/parser.pyx":1116 + * if isinstance(self.na_values, dict): + * values = None + * if name is not None and name in self.na_values: # <<<<<<<<<<<<<< + * values = self.na_values[name] + * if values is not None and not isinstance(values, list): + */ + __pyx_t_1 = (__pyx_v_name != Py_None); + if ((__pyx_t_1 != 0)) { + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_self->na_values, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_2 != 0); + } else { + __pyx_t_5 = (__pyx_t_1 != 0); + } + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1117 + * values = None + * if name is not None and name in self.na_values: + * values = self.na_values[name] # <<<<<<<<<<<<<< + * if values is not None and not isinstance(values, list): + * values = list(values) + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->na_values, __pyx_v_name); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1118 + * if name is not None and name in self.na_values: + * values = self.na_values[name] + * if values is not None and not isinstance(values, list): # <<<<<<<<<<<<<< + * values = list(values) + * fvalues = self.na_fvalues[name] + */ + __pyx_t_5 = (__pyx_v_values != Py_None); + if ((__pyx_t_5 != 0)) { + __pyx_t_1 = PyList_Check(__pyx_v_values); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + } else { + __pyx_t_1 = (__pyx_t_5 != 0); + } + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1119 + * values = self.na_values[name] + * if values is not None and not isinstance(values, list): + * values = list(values) # <<<<<<<<<<<<<< + * fvalues = self.na_fvalues[name] + * if fvalues is not None and not isinstance(fvalues, set): + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/parser.pyx":1120 + * if values is not None and not isinstance(values, list): + * values = list(values) + * fvalues = self.na_fvalues[name] # <<<<<<<<<<<<<< + * if fvalues is not None and not isinstance(fvalues, set): + * fvalues = set(fvalues) + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->na_fvalues, __pyx_v_name); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_fvalues = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1121 + * values = list(values) + * fvalues = self.na_fvalues[name] + * if fvalues is not None and not isinstance(fvalues, set): # <<<<<<<<<<<<<< + * fvalues = set(fvalues) + * else: + */ + __pyx_t_1 = (__pyx_v_fvalues != Py_None); + if ((__pyx_t_1 != 0)) { + __pyx_t_5 = PySet_Check(__pyx_v_fvalues); + __pyx_t_2 = ((!(__pyx_t_5 != 0)) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = (__pyx_t_1 != 0); + } + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1122 + * fvalues = self.na_fvalues[name] + * if fvalues is not None and not isinstance(fvalues, set): + * fvalues = set(fvalues) # <<<<<<<<<<<<<< + * else: + * if i in self.na_values: + */ + __pyx_t_3 = PySet_New(__pyx_v_fvalues); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_fvalues, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/parser.pyx":1124 + * fvalues = set(fvalues) + * else: + * if i in self.na_values: # <<<<<<<<<<<<<< + * return self.na_values[i], self.na_fvalues[i] + * else: + */ + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_i, __pyx_v_self->na_values, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1125 + * else: + * if i in self.na_values: + * return self.na_values[i], self.na_fvalues[i] # <<<<<<<<<<<<<< + * else: + * return _NA_VALUES, set() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->na_values, __pyx_v_i); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->na_fvalues, __pyx_v_i); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1127 + * return self.na_values[i], self.na_fvalues[i] + * else: + * return _NA_VALUES, set() # <<<<<<<<<<<<<< + * + * return _ensure_encoded(values), fvalues + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NA_VALUES); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + } + __pyx_L5:; + + /* "pandas/parser.pyx":1129 + * return _NA_VALUES, set() + * + * return _ensure_encoded(values), fvalues # <<<<<<<<<<<<<< + * else: + * if not isinstance(self.na_values, list): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ensure_encoded); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_fvalues); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_fvalues); + __Pyx_GIVEREF(__pyx_v_fvalues); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1131 + * return _ensure_encoded(values), fvalues + * else: + * if not isinstance(self.na_values, list): # <<<<<<<<<<<<<< + * self.na_values = list(self.na_values) + * if not isinstance(self.na_fvalues, set): + */ + __pyx_t_4 = __pyx_v_self->na_values; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = PyList_Check(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1132 + * else: + * if not isinstance(self.na_values, list): + * self.na_values = list(self.na_values) # <<<<<<<<<<<<<< + * if not isinstance(self.na_fvalues, set): + * self.na_fvalues = set(self.na_fvalues) + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->na_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->na_values); + __Pyx_GIVEREF(__pyx_v_self->na_values); + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->na_values); + __Pyx_DECREF(__pyx_v_self->na_values); + __pyx_v_self->na_values = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/parser.pyx":1133 + * if not isinstance(self.na_values, list): + * self.na_values = list(self.na_values) + * if not isinstance(self.na_fvalues, set): # <<<<<<<<<<<<<< + * self.na_fvalues = set(self.na_fvalues) + * + */ + __pyx_t_6 = __pyx_v_self->na_fvalues; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_5 = PySet_Check(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1134 + * self.na_values = list(self.na_values) + * if not isinstance(self.na_fvalues, set): + * self.na_fvalues = set(self.na_fvalues) # <<<<<<<<<<<<<< + * + * return _ensure_encoded(self.na_values), self.na_fvalues + */ + __pyx_t_6 = PySet_New(__pyx_v_self->na_fvalues); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->na_fvalues); + __Pyx_DECREF(__pyx_v_self->na_fvalues); + __pyx_v_self->na_fvalues = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":1136 + * self.na_fvalues = set(self.na_fvalues) + * + * return _ensure_encoded(self.na_values), self.na_fvalues # <<<<<<<<<<<<<< + * + * cdef _free_na_set(self, kh_str_t *table): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ensure_encoded); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->na_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->na_values); + __Pyx_GIVEREF(__pyx_v_self->na_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self->na_fvalues); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->na_fvalues); + __Pyx_GIVEREF(__pyx_v_self->na_fvalues); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1110 + * return self.converters.get(i) + * + * cdef _get_na_list(self, i, name): # <<<<<<<<<<<<<< + * if self.na_values is None: + * return None, set() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser.TextReader._get_na_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_fvalues); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1138 + * return _ensure_encoded(self.na_values), self.na_fvalues + * + * cdef _free_na_set(self, kh_str_t *table): # <<<<<<<<<<<<<< + * kh_destroy_str(table) + * + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__free_na_set(CYTHON_UNUSED struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, kh_str_t *__pyx_v_table) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_free_na_set", 0); + + /* "pandas/parser.pyx":1139 + * + * cdef _free_na_set(self, kh_str_t *table): + * kh_destroy_str(table) # <<<<<<<<<<<<<< + * + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): + */ + kh_destroy_str(__pyx_v_table); + + /* "pandas/parser.pyx":1138 + * return _ensure_encoded(self.na_values), self.na_fvalues + * + * cdef _free_na_set(self, kh_str_t *table): # <<<<<<<<<<<<<< + * kh_destroy_str(table) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1141 + * kh_destroy_str(table) + * + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): # <<<<<<<<<<<<<< + * if self.has_usecols and self.names is not None: + * if len(self.names) == len(self.usecols): + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__get_column_name(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, Py_ssize_t __pyx_v_i, Py_ssize_t __pyx_v_nused) { + Py_ssize_t __pyx_v_j; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_column_name", 0); + + /* "pandas/parser.pyx":1142 + * + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): + * if self.has_usecols and self.names is not None: # <<<<<<<<<<<<<< + * if len(self.names) == len(self.usecols): + * return self.names[nused] + */ + if ((__pyx_v_self->has_usecols != 0)) { + __pyx_t_1 = (__pyx_v_self->names != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + } else { + __pyx_t_2 = (__pyx_v_self->has_usecols != 0); + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1143 + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): + * if self.has_usecols and self.names is not None: + * if len(self.names) == len(self.usecols): # <<<<<<<<<<<<<< + * return self.names[nused] + * else: + */ + __pyx_t_3 = __pyx_v_self->names; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_v_self->usecols; + __Pyx_INCREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = PySet_Size(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((__pyx_t_4 == __pyx_t_5) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1144 + * if self.has_usecols and self.names is not None: + * if len(self.names) == len(self.usecols): + * return self.names[nused] # <<<<<<<<<<<<<< + * else: + * return self.names[i - self.leading_cols] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->names, __pyx_v_nused, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1146 + * return self.names[nused] + * else: + * return self.names[i - self.leading_cols] # <<<<<<<<<<<<<< + * else: + * if self.header is not None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = (__pyx_v_i - __pyx_v_self->leading_cols); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->names, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1148 + * return self.names[i - self.leading_cols] + * else: + * if self.header is not None: # <<<<<<<<<<<<<< + * j = i - self.leading_cols + * # hack for #2442 + */ + __pyx_t_2 = (__pyx_v_self->header != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1149 + * else: + * if self.header is not None: + * j = i - self.leading_cols # <<<<<<<<<<<<<< + * # hack for #2442 + * if j == len(self.header[0]): + */ + __pyx_v_j = (__pyx_v_i - __pyx_v_self->leading_cols); + + /* "pandas/parser.pyx":1151 + * j = i - self.leading_cols + * # hack for #2442 + * if j == len(self.header[0]): # <<<<<<<<<<<<<< + * return j + * else: + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->header, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((__pyx_v_j == __pyx_t_5) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1152 + * # hack for #2442 + * if j == len(self.header[0]): + * return j # <<<<<<<<<<<<<< + * else: + * return self.header[0][j] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1154 + * return j + * else: + * return self.header[0][j] # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->header, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1156 + * return self.header[0][j] + * else: + * return None # <<<<<<<<<<<<<< + * + * class CParserError(Exception): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + } + + /* "pandas/parser.pyx":1141 + * kh_destroy_str(table) + * + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): # <<<<<<<<<<<<<< + * if self.has_usecols and self.names is not None: + * if len(self.names) == len(self.usecols): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser.TextReader._get_column_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":248 + * + * cdef public: + * int leading_cols, table_width, skip_footer, buffer_lines # <<<<<<<<<<<<<< + * object allow_leading_cols + * object delimiter, converters, delim_whitespace + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12leading_cols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12leading_cols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12leading_cols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12leading_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->leading_cols); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.leading_cols.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12leading_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12leading_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12leading_cols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12leading_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->leading_cols = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.leading_cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11table_width_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11table_width_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11table_width___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11table_width___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->table_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.table_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11table_width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11table_width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11table_width_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11table_width_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->table_width = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.table_width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11skip_footer_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11skip_footer_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11skip_footer___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11skip_footer___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->skip_footer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.skip_footer.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11skip_footer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11skip_footer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11skip_footer_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11skip_footer_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->skip_footer = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.skip_footer.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12buffer_lines___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12buffer_lines___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->buffer_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.buffer_lines.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12buffer_lines_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12buffer_lines_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->buffer_lines = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.buffer_lines.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":249 + * cdef public: + * int leading_cols, table_width, skip_footer, buffer_lines + * object allow_leading_cols # <<<<<<<<<<<<<< + * object delimiter, converters, delim_whitespace + * object na_values, true_values, false_values + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->allow_leading_cols); + __pyx_r = __pyx_v_self->allow_leading_cols; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->allow_leading_cols); + __Pyx_DECREF(__pyx_v_self->allow_leading_cols); + __pyx_v_self->allow_leading_cols = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->allow_leading_cols); + __Pyx_DECREF(__pyx_v_self->allow_leading_cols); + __pyx_v_self->allow_leading_cols = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":250 + * int leading_cols, table_width, skip_footer, buffer_lines + * object allow_leading_cols + * object delimiter, converters, delim_whitespace # <<<<<<<<<<<<<< + * object na_values, true_values, false_values + * object memory_map + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9delimiter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9delimiter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9delimiter___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9delimiter___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->delimiter); + __pyx_r = __pyx_v_self->delimiter; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9delimiter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9delimiter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9delimiter_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9delimiter_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->delimiter); + __Pyx_DECREF(__pyx_v_self->delimiter); + __pyx_v_self->delimiter = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9delimiter_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9delimiter_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9delimiter_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9delimiter_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->delimiter); + __Pyx_DECREF(__pyx_v_self->delimiter); + __pyx_v_self->delimiter = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10converters_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10converters_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10converters___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10converters___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->converters); + __pyx_r = __pyx_v_self->converters; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10converters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10converters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10converters_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10converters_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->converters); + __Pyx_DECREF(__pyx_v_self->converters); + __pyx_v_self->converters = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10converters_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10converters_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10converters_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10converters_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->converters); + __Pyx_DECREF(__pyx_v_self->converters); + __pyx_v_self->converters = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->delim_whitespace); + __pyx_r = __pyx_v_self->delim_whitespace; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->delim_whitespace); + __Pyx_DECREF(__pyx_v_self->delim_whitespace); + __pyx_v_self->delim_whitespace = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->delim_whitespace); + __Pyx_DECREF(__pyx_v_self->delim_whitespace); + __pyx_v_self->delim_whitespace = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":251 + * object allow_leading_cols + * object delimiter, converters, delim_whitespace + * object na_values, true_values, false_values # <<<<<<<<<<<<<< + * object memory_map + * object as_recarray + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9na_values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9na_values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9na_values___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9na_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->na_values); + __pyx_r = __pyx_v_self->na_values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9na_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9na_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9na_values_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9na_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->na_values); + __Pyx_DECREF(__pyx_v_self->na_values); + __pyx_v_self->na_values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9na_values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9na_values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9na_values_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9na_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->na_values); + __Pyx_DECREF(__pyx_v_self->na_values); + __pyx_v_self->na_values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11true_values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11true_values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11true_values___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11true_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->true_values); + __pyx_r = __pyx_v_self->true_values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11true_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11true_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11true_values_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11true_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->true_values); + __Pyx_DECREF(__pyx_v_self->true_values); + __pyx_v_self->true_values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11true_values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11true_values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11true_values_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11true_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->true_values); + __Pyx_DECREF(__pyx_v_self->true_values); + __pyx_v_self->true_values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12false_values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12false_values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12false_values___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12false_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->false_values); + __pyx_r = __pyx_v_self->false_values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12false_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12false_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12false_values_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12false_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->false_values); + __Pyx_DECREF(__pyx_v_self->false_values); + __pyx_v_self->false_values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12false_values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12false_values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12false_values_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12false_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->false_values); + __Pyx_DECREF(__pyx_v_self->false_values); + __pyx_v_self->false_values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":252 + * object delimiter, converters, delim_whitespace + * object na_values, true_values, false_values + * object memory_map # <<<<<<<<<<<<<< + * object as_recarray + * object header, orig_header, names, header_start, header_end + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10memory_map_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10memory_map_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10memory_map___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10memory_map___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->memory_map); + __pyx_r = __pyx_v_self->memory_map; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10memory_map_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10memory_map_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10memory_map_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10memory_map_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->memory_map); + __Pyx_DECREF(__pyx_v_self->memory_map); + __pyx_v_self->memory_map = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10memory_map_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10memory_map_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10memory_map_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10memory_map_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->memory_map); + __Pyx_DECREF(__pyx_v_self->memory_map); + __pyx_v_self->memory_map = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":253 + * object na_values, true_values, false_values + * object memory_map + * object as_recarray # <<<<<<<<<<<<<< + * object header, orig_header, names, header_start, header_end + * object index_col + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11as_recarray_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11as_recarray_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11as_recarray___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11as_recarray___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->as_recarray); + __pyx_r = __pyx_v_self->as_recarray; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->as_recarray); + __Pyx_DECREF(__pyx_v_self->as_recarray); + __pyx_v_self->as_recarray = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->as_recarray); + __Pyx_DECREF(__pyx_v_self->as_recarray); + __pyx_v_self->as_recarray = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":254 + * object memory_map + * object as_recarray + * object header, orig_header, names, header_start, header_end # <<<<<<<<<<<<<< + * object index_col + * object low_memory + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_6header_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_6header_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_6header___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_6header___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->header); + __pyx_r = __pyx_v_self->header; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_6header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_6header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_6header_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_6header_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_6header_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_6header_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_6header_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_6header_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11orig_header_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11orig_header_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11orig_header___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11orig_header___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->orig_header); + __pyx_r = __pyx_v_self->orig_header; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11orig_header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11orig_header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11orig_header_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11orig_header_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->orig_header); + __Pyx_DECREF(__pyx_v_self->orig_header); + __pyx_v_self->orig_header = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11orig_header_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11orig_header_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11orig_header_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11orig_header_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->orig_header); + __Pyx_DECREF(__pyx_v_self->orig_header); + __pyx_v_self->orig_header = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_5names_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_5names_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5names___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_5names___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->names); + __pyx_r = __pyx_v_self->names; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_5names_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_5names_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5names_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_5names_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->names); + __Pyx_DECREF(__pyx_v_self->names); + __pyx_v_self->names = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_5names_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_5names_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5names_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_5names_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->names); + __Pyx_DECREF(__pyx_v_self->names); + __pyx_v_self->names = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12header_start_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12header_start_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12header_start___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12header_start___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->header_start); + __pyx_r = __pyx_v_self->header_start; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12header_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12header_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12header_start_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12header_start_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->header_start); + __Pyx_DECREF(__pyx_v_self->header_start); + __pyx_v_self->header_start = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12header_start_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12header_start_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12header_start_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12header_start_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->header_start); + __Pyx_DECREF(__pyx_v_self->header_start); + __pyx_v_self->header_start = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10header_end_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10header_end_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10header_end___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10header_end___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->header_end); + __pyx_r = __pyx_v_self->header_end; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10header_end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10header_end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10header_end_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10header_end_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->header_end); + __Pyx_DECREF(__pyx_v_self->header_end); + __pyx_v_self->header_end = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10header_end_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10header_end_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10header_end_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10header_end_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->header_end); + __Pyx_DECREF(__pyx_v_self->header_end); + __pyx_v_self->header_end = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":255 + * object as_recarray + * object header, orig_header, names, header_start, header_end + * object index_col # <<<<<<<<<<<<<< + * object low_memory + * object skiprows + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9index_col_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9index_col_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9index_col___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9index_col___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->index_col); + __pyx_r = __pyx_v_self->index_col; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9index_col_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9index_col_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9index_col_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9index_col_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->index_col); + __Pyx_DECREF(__pyx_v_self->index_col); + __pyx_v_self->index_col = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9index_col_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9index_col_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9index_col_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9index_col_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->index_col); + __Pyx_DECREF(__pyx_v_self->index_col); + __pyx_v_self->index_col = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":256 + * object header, orig_header, names, header_start, header_end + * object index_col + * object low_memory # <<<<<<<<<<<<<< + * object skiprows + * object compact_ints, use_unsigned + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10low_memory_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10low_memory_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10low_memory___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10low_memory___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->low_memory); + __pyx_r = __pyx_v_self->low_memory; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10low_memory_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10low_memory_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10low_memory_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10low_memory_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->low_memory); + __Pyx_DECREF(__pyx_v_self->low_memory); + __pyx_v_self->low_memory = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10low_memory_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10low_memory_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10low_memory_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10low_memory_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->low_memory); + __Pyx_DECREF(__pyx_v_self->low_memory); + __pyx_v_self->low_memory = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":257 + * object index_col + * object low_memory + * object skiprows # <<<<<<<<<<<<<< + * object compact_ints, use_unsigned + * object dtype + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_8skiprows_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_8skiprows_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8skiprows___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8skiprows___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->skiprows); + __pyx_r = __pyx_v_self->skiprows; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_8skiprows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_8skiprows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8skiprows_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_8skiprows_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->skiprows); + __Pyx_DECREF(__pyx_v_self->skiprows); + __pyx_v_self->skiprows = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_8skiprows_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_8skiprows_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8skiprows_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_8skiprows_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->skiprows); + __Pyx_DECREF(__pyx_v_self->skiprows); + __pyx_v_self->skiprows = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":258 + * object low_memory + * object skiprows + * object compact_ints, use_unsigned # <<<<<<<<<<<<<< + * object dtype + * object encoding + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12compact_ints_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12compact_ints_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12compact_ints___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12compact_ints___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->compact_ints); + __pyx_r = __pyx_v_self->compact_ints; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->compact_ints); + __Pyx_DECREF(__pyx_v_self->compact_ints); + __pyx_v_self->compact_ints = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->compact_ints); + __Pyx_DECREF(__pyx_v_self->compact_ints); + __pyx_v_self->compact_ints = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12use_unsigned___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->use_unsigned); + __pyx_r = __pyx_v_self->use_unsigned; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->use_unsigned); + __Pyx_DECREF(__pyx_v_self->use_unsigned); + __pyx_v_self->use_unsigned = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->use_unsigned); + __Pyx_DECREF(__pyx_v_self->use_unsigned); + __pyx_v_self->use_unsigned = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":259 + * object skiprows + * object compact_ints, use_unsigned + * object dtype # <<<<<<<<<<<<<< + * object encoding + * object compression + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_5dtype_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5dtype___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_5dtype___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dtype); + __pyx_r = __pyx_v_self->dtype; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5dtype_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_5dtype_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dtype); + __Pyx_DECREF(__pyx_v_self->dtype); + __pyx_v_self->dtype = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_5dtype_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_5dtype_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5dtype_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_5dtype_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dtype); + __Pyx_DECREF(__pyx_v_self->dtype); + __pyx_v_self->dtype = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":260 + * object compact_ints, use_unsigned + * object dtype + * object encoding # <<<<<<<<<<<<<< + * object compression + * object mangle_dupe_cols + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_8encoding_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_8encoding_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8encoding___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8encoding___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->encoding); + __pyx_r = __pyx_v_self->encoding; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_8encoding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_8encoding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8encoding_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_8encoding_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->encoding); + __Pyx_DECREF(__pyx_v_self->encoding); + __pyx_v_self->encoding = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_8encoding_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_8encoding_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8encoding_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_8encoding_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->encoding); + __Pyx_DECREF(__pyx_v_self->encoding); + __pyx_v_self->encoding = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":261 + * object dtype + * object encoding + * object compression # <<<<<<<<<<<<<< + * object mangle_dupe_cols + * object tupleize_cols + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11compression_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11compression_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11compression___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11compression___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->compression); + __pyx_r = __pyx_v_self->compression; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11compression_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11compression_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11compression_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11compression_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->compression); + __Pyx_DECREF(__pyx_v_self->compression); + __pyx_v_self->compression = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11compression_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11compression_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11compression_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11compression_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->compression); + __Pyx_DECREF(__pyx_v_self->compression); + __pyx_v_self->compression = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":262 + * object encoding + * object compression + * object mangle_dupe_cols # <<<<<<<<<<<<<< + * object tupleize_cols + * set noconvert, usecols + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->mangle_dupe_cols); + __pyx_r = __pyx_v_self->mangle_dupe_cols; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->mangle_dupe_cols); + __Pyx_DECREF(__pyx_v_self->mangle_dupe_cols); + __pyx_v_self->mangle_dupe_cols = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->mangle_dupe_cols); + __Pyx_DECREF(__pyx_v_self->mangle_dupe_cols); + __pyx_v_self->mangle_dupe_cols = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":263 + * object compression + * object mangle_dupe_cols + * object tupleize_cols # <<<<<<<<<<<<<< + * set noconvert, usecols + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->tupleize_cols); + __pyx_r = __pyx_v_self->tupleize_cols; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->tupleize_cols); + __Pyx_DECREF(__pyx_v_self->tupleize_cols); + __pyx_v_self->tupleize_cols = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->tupleize_cols); + __Pyx_DECREF(__pyx_v_self->tupleize_cols); + __pyx_v_self->tupleize_cols = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":264 + * object mangle_dupe_cols + * object tupleize_cols + * set noconvert, usecols # <<<<<<<<<<<<<< + * + * def __cinit__(self, source, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9noconvert_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9noconvert_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9noconvert___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9noconvert___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->noconvert); + __pyx_r = __pyx_v_self->noconvert; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9noconvert_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9noconvert_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9noconvert_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9noconvert_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->noconvert); + __Pyx_DECREF(__pyx_v_self->noconvert); + __pyx_v_self->noconvert = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.noconvert.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9noconvert_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9noconvert_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9noconvert_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9noconvert_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->noconvert); + __Pyx_DECREF(__pyx_v_self->noconvert); + __pyx_v_self->noconvert = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_7usecols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_7usecols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_7usecols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_7usecols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->usecols); + __pyx_r = __pyx_v_self->usecols; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_7usecols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_7usecols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_7usecols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_7usecols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->usecols); + __Pyx_DECREF(__pyx_v_self->usecols); + __pyx_v_self->usecols = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.usecols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_7usecols_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_7usecols_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_7usecols_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_7usecols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->usecols); + __Pyx_DECREF(__pyx_v_self->usecols); + __pyx_v_self->usecols = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1169 + * + * + * def _ensure_encoded(list lst): # <<<<<<<<<<<<<< + * cdef list result = [] + * for x in lst: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_1_ensure_encoded(PyObject *__pyx_self, PyObject *__pyx_v_lst); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_1_ensure_encoded = {__Pyx_NAMESTR("_ensure_encoded"), (PyCFunction)__pyx_pw_6pandas_6parser_1_ensure_encoded, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_1_ensure_encoded(PyObject *__pyx_self, PyObject *__pyx_v_lst) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ensure_encoded (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lst), (&PyList_Type), 1, "lst", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_6parser__ensure_encoded(__pyx_self, ((PyObject*)__pyx_v_lst)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser__ensure_encoded(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst) { + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ensure_encoded", 0); + + /* "pandas/parser.pyx":1170 + * + * def _ensure_encoded(list lst): + * cdef list result = [] # <<<<<<<<<<<<<< + * for x in lst: + * if PyUnicode_Check(x): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1171 + * def _ensure_encoded(list lst): + * cdef list result = [] + * for x in lst: # <<<<<<<<<<<<<< + * if PyUnicode_Check(x): + * x = PyUnicode_AsUTF8String(x) + */ + if (unlikely(__pyx_v_lst == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1172 + * cdef list result = [] + * for x in lst: + * if PyUnicode_Check(x): # <<<<<<<<<<<<<< + * x = PyUnicode_AsUTF8String(x) + * elif not PyBytes_Check(x): + */ + __pyx_t_4 = (PyUnicode_Check(__pyx_v_x) != 0); + if (__pyx_t_4) { + + /* "pandas/parser.pyx":1173 + * for x in lst: + * if PyUnicode_Check(x): + * x = PyUnicode_AsUTF8String(x) # <<<<<<<<<<<<<< + * elif not PyBytes_Check(x): + * x = asbytes(x) + */ + __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + + /* "pandas/parser.pyx":1174 + * if PyUnicode_Check(x): + * x = PyUnicode_AsUTF8String(x) + * elif not PyBytes_Check(x): # <<<<<<<<<<<<<< + * x = asbytes(x) + * + */ + __pyx_t_4 = ((!(PyBytes_Check(__pyx_v_x) != 0)) != 0); + if (__pyx_t_4) { + + /* "pandas/parser.pyx":1175 + * x = PyUnicode_AsUTF8String(x) + * elif not PyBytes_Check(x): + * x = asbytes(x) # <<<<<<<<<<<<<< + * + * result.append(x) + */ + __pyx_t_3 = __pyx_f_6pandas_6parser_asbytes(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":1177 + * x = asbytes(x) + * + * result.append(x) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_x); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1178 + * + * result.append(x) + * return result # <<<<<<<<<<<<<< + * + * cdef asbytes(object o): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/parser.pyx":1169 + * + * + * def _ensure_encoded(list lst): # <<<<<<<<<<<<<< + * cdef list result = [] + * for x in lst: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser._ensure_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1180 + * return result + * + * cdef asbytes(object o): # <<<<<<<<<<<<<< + * if PY3: + * return str(o).encode('utf-8') + */ + +static PyObject *__pyx_f_6pandas_6parser_asbytes(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("asbytes", 0); + + /* "pandas/parser.pyx":1181 + * + * cdef asbytes(object o): + * if PY3: # <<<<<<<<<<<<<< + * return str(o).encode('utf-8') + * else: + */ + __pyx_t_1 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1182 + * cdef asbytes(object o): + * if PY3: + * return str(o).encode('utf-8') # <<<<<<<<<<<<<< + * else: + * return str(o) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1184 + * return str(o).encode('utf-8') + * else: + * return str(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1180 + * return result + * + * cdef asbytes(object o): # <<<<<<<<<<<<<< + * if PY3: + * return str(o).encode('utf-8') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.asbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1187 + * + * + * def _is_file_like(obj): # <<<<<<<<<<<<<< + * if PY3: + * import io + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_3_is_file_like(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_3_is_file_like = {__Pyx_NAMESTR("_is_file_like"), (PyCFunction)__pyx_pw_6pandas_6parser_3_is_file_like, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_3_is_file_like(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_is_file_like (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_2_is_file_like(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_2_is_file_like(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_v_io = NULL; + PyObject *__pyx_v_file = NULL; + PyObject *__pyx_v___builtin__ = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_file_like", 0); + + /* "pandas/parser.pyx":1188 + * + * def _is_file_like(obj): + * if PY3: # <<<<<<<<<<<<<< + * import io + * if isinstance(obj, io.TextIOWrapper): + */ + __pyx_t_1 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1189 + * def _is_file_like(obj): + * if PY3: + * import io # <<<<<<<<<<<<<< + * if isinstance(obj, io.TextIOWrapper): + * raise CParserError('Cannot handle open unicode files (yet)') + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_io, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_io = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1190 + * if PY3: + * import io + * if isinstance(obj, io.TextIOWrapper): # <<<<<<<<<<<<<< + * raise CParserError('Cannot handle open unicode files (yet)') + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_TextIOWrapper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1191 + * import io + * if isinstance(obj, io.TextIOWrapper): + * raise CParserError('Cannot handle open unicode files (yet)') # <<<<<<<<<<<<<< + * + * # BufferedReader is a byte reader for Python 3 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CParserError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1194 + * + * # BufferedReader is a byte reader for Python 3 + * file = io.BufferedReader # <<<<<<<<<<<<<< + * else: + * import __builtin__ + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_BufferedReader); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_file = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1196 + * file = io.BufferedReader + * else: + * import __builtin__ # <<<<<<<<<<<<<< + * file = __builtin__.file + * + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_builtin, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v___builtin__ = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1197 + * else: + * import __builtin__ + * file = __builtin__.file # <<<<<<<<<<<<<< + * + * return isinstance(obj, (basestring, file)) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v___builtin__, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_file = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":1199 + * file = __builtin__.file + * + * return isinstance(obj, (basestring, file)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_file); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_file); + __Pyx_GIVEREF(__pyx_v_file); + __pyx_t_4 = 0; + __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1187 + * + * + * def _is_file_like(obj): # <<<<<<<<<<<<<< + * if PY3: + * import io + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.parser._is_file_like", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_io); + __Pyx_XDECREF(__pyx_v_file); + __Pyx_XDECREF(__pyx_v___builtin__); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1202 + * + * + * def _maybe_upcast(arr): # <<<<<<<<<<<<<< + * """ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_5_maybe_upcast(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_6parser_4_maybe_upcast[] = "\n\n "; +static PyMethodDef __pyx_mdef_6pandas_6parser_5_maybe_upcast = {__Pyx_NAMESTR("_maybe_upcast"), (PyCFunction)__pyx_pw_6pandas_6parser_5_maybe_upcast, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_6parser_4_maybe_upcast)}; +static PyObject *__pyx_pw_6pandas_6parser_5_maybe_upcast(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_maybe_upcast (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_4_maybe_upcast(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_4_maybe_upcast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_v_na_value = NULL; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_upcast", 0); + __Pyx_INCREF(__pyx_v_arr); + + /* "pandas/parser.pyx":1206 + * + * """ + * if issubclass(arr.dtype.type, np.integer): # <<<<<<<<<<<<<< + * na_value = na_values[arr.dtype] + * arr = arr.astype(float) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_IsSubclass(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1207 + * """ + * if issubclass(arr.dtype.type, np.integer): + * na_value = na_values[arr.dtype] # <<<<<<<<<<<<<< + * arr = arr.astype(float) + * np.putmask(arr, arr == na_value, np.nan) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_t_2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_na_value = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1208 + * if issubclass(arr.dtype.type, np.integer): + * na_value = na_values[arr.dtype] + * arr = arr.astype(float) # <<<<<<<<<<<<<< + * np.putmask(arr, arr == na_value, np.nan) + * elif arr.dtype == np.bool_: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyFloat_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1209 + * na_value = na_values[arr.dtype] + * arr = arr.astype(float) + * np.putmask(arr, arr == na_value, np.nan) # <<<<<<<<<<<<<< + * elif arr.dtype == np.bool_: + * mask = arr.view(np.uint8) == na_values[np.uint8] + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_putmask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_arr, __pyx_v_na_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_3 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L3; + } + + /* "pandas/parser.pyx":1210 + * arr = arr.astype(float) + * np.putmask(arr, arr == na_value, np.nan) + * elif arr.dtype == np.bool_: # <<<<<<<<<<<<<< + * mask = arr.view(np.uint8) == na_values[np.uint8] + * arr = arr.astype(object) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1211 + * np.putmask(arr, arr == na_value, np.nan) + * elif arr.dtype == np.bool_: + * mask = arr.view(np.uint8) == na_values[np.uint8] # <<<<<<<<<<<<<< + * arr = arr.astype(object) + * np.putmask(arr, mask, np.nan) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_mask = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1212 + * elif arr.dtype == np.bool_: + * mask = arr.view(np.uint8) == na_values[np.uint8] + * arr = arr.astype(object) # <<<<<<<<<<<<<< + * np.putmask(arr, mask, np.nan) + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1213 + * mask = arr.view(np.uint8) == na_values[np.uint8] + * arr = arr.astype(object) + * np.putmask(arr, mask, np.nan) # <<<<<<<<<<<<<< + * + * return arr + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":1215 + * np.putmask(arr, mask, np.nan) + * + * return arr # <<<<<<<<<<<<<< + * + * # ---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + + /* "pandas/parser.pyx":1202 + * + * + * def _maybe_upcast(arr): # <<<<<<<<<<<<<< + * """ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser._maybe_upcast", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_na_value); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1220 + * # Type conversions / inference support code + * + * cdef _string_box_factorize(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset): + */ + +static PyObject *__pyx_f_6pandas_6parser__string_box_factorize(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + int __pyx_v_na_count; + Py_ssize_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_ret; + kh_strbox_t *__pyx_v_table; + PyObject *__pyx_v_pyval = 0; + PyObject *__pyx_v_NA = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_box_factorize", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1224 + * bint na_filter, kh_str_t *na_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i + * size_t lines + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1231 + * ndarray[object] result + * + * int ret = 0 # <<<<<<<<<<<<<< + * kh_strbox_t *table + * + */ + __pyx_v_ret = 0; + + /* "pandas/parser.pyx":1236 + * object pyval + * + * object NA = na_values[np.object_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_NA = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1239 + * khiter_t k + * + * table = kh_init_strbox() # <<<<<<<<<<<<<< + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + */ + __pyx_v_table = kh_init_strbox(); + + /* "pandas/parser.pyx":1240 + * + * table = kh_init_strbox() + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1241 + * table = kh_init_strbox() + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1242 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * for i in range(lines): + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1244 + * coliter_setup(&it, parser, col, line_start) + * + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_11 = __pyx_v_lines; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1245 + * + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1247 + * word = COLITER_NEXT(it) + * + * if na_filter: # <<<<<<<<<<<<<< + * k = kh_get_str(na_hashset, word) + * # in the hash table + */ + __pyx_t_13 = (__pyx_v_na_filter != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1248 + * + * if na_filter: + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1250 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * result[i] = NA + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1251 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * result[i] = NA + * continue + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1252 + * if k != na_hashset.n_buckets: + * na_count += 1 + * result[i] = NA # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_NA); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_NA; + __Pyx_GIVEREF(*__pyx_t_15); + + /* "pandas/parser.pyx":1253 + * na_count += 1 + * result[i] = NA + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_strbox(table, word) + */ + goto __pyx_L3_continue; + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":1255 + * continue + * + * k = kh_get_strbox(table, word) # <<<<<<<<<<<<<< + * + * # in the hash table + */ + __pyx_v_k = kh_get_strbox(__pyx_v_table, __pyx_v_word); + + /* "pandas/parser.pyx":1258 + * + * # in the hash table + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * # this increments the refcount, but need to test + * pyval = table.vals[k] + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1260 + * if k != table.n_buckets: + * # this increments the refcount, but need to test + * pyval = table.vals[k] # <<<<<<<<<<<<<< + * else: + * # box it. new ref? + */ + __pyx_t_5 = ((PyObject *)(__pyx_v_table->vals[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/parser.pyx":1263 + * else: + * # box it. new ref? + * pyval = PyBytes_FromString(word) # <<<<<<<<<<<<<< + * + * k = kh_put_strbox(table, word, &ret) + */ + __pyx_t_5 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1265 + * pyval = PyBytes_FromString(word) + * + * k = kh_put_strbox(table, word, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = pyval + * + */ + __pyx_v_k = kh_put_strbox(__pyx_v_table, __pyx_v_word, (&__pyx_v_ret)); + + /* "pandas/parser.pyx":1266 + * + * k = kh_put_strbox(table, word, &ret) + * table.vals[k] = pyval # <<<<<<<<<<<<<< + * + * result[i] = pyval + */ + (__pyx_v_table->vals[__pyx_v_k]) = ((PyObject *)__pyx_v_pyval); + } + __pyx_L7:; + + /* "pandas/parser.pyx":1268 + * table.vals[k] = pyval + * + * result[i] = pyval # <<<<<<<<<<<<<< + * + * kh_destroy_strbox(table) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_pyval); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_pyval; + __Pyx_GIVEREF(*__pyx_t_15); + __pyx_L3_continue:; + } + + /* "pandas/parser.pyx":1270 + * result[i] = pyval + * + * kh_destroy_strbox(table) # <<<<<<<<<<<<<< + * + * return result, na_count + */ + kh_destroy_strbox(__pyx_v_table); + + /* "pandas/parser.pyx":1272 + * kh_destroy_strbox(table) + * + * return result, na_count # <<<<<<<<<<<<<< + * + * cdef _string_box_utf8(parser_t *parser, int col, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1220 + * # Type conversions / inference support code + * + * cdef _string_box_factorize(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._string_box_factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_pyval); + __Pyx_XDECREF(__pyx_v_NA); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1274 + * return result, na_count + * + * cdef _string_box_utf8(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset): + */ + +static PyObject *__pyx_f_6pandas_6parser__string_box_utf8(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + int __pyx_v_na_count; + Py_ssize_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_ret; + kh_strbox_t *__pyx_v_table; + PyObject *__pyx_v_pyval = 0; + PyObject *__pyx_v_NA = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_box_utf8", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1278 + * bint na_filter, kh_str_t *na_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i + * size_t lines + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1285 + * ndarray[object] result + * + * int ret = 0 # <<<<<<<<<<<<<< + * kh_strbox_t *table + * + */ + __pyx_v_ret = 0; + + /* "pandas/parser.pyx":1290 + * object pyval + * + * object NA = na_values[np.object_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_NA = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1293 + * khiter_t k + * + * table = kh_init_strbox() # <<<<<<<<<<<<<< + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + */ + __pyx_v_table = kh_init_strbox(); + + /* "pandas/parser.pyx":1294 + * + * table = kh_init_strbox() + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1295 + * table = kh_init_strbox() + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1296 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * for i in range(lines): + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1298 + * coliter_setup(&it, parser, col, line_start) + * + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_11 = __pyx_v_lines; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1299 + * + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1301 + * word = COLITER_NEXT(it) + * + * if na_filter: # <<<<<<<<<<<<<< + * k = kh_get_str(na_hashset, word) + * # in the hash table + */ + __pyx_t_13 = (__pyx_v_na_filter != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1302 + * + * if na_filter: + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1304 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * result[i] = NA + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1305 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * result[i] = NA + * continue + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1306 + * if k != na_hashset.n_buckets: + * na_count += 1 + * result[i] = NA # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_NA); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_NA; + __Pyx_GIVEREF(*__pyx_t_15); + + /* "pandas/parser.pyx":1307 + * na_count += 1 + * result[i] = NA + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_strbox(table, word) + */ + goto __pyx_L3_continue; + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":1309 + * continue + * + * k = kh_get_strbox(table, word) # <<<<<<<<<<<<<< + * + * # in the hash table + */ + __pyx_v_k = kh_get_strbox(__pyx_v_table, __pyx_v_word); + + /* "pandas/parser.pyx":1312 + * + * # in the hash table + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * # this increments the refcount, but need to test + * pyval = table.vals[k] + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1314 + * if k != table.n_buckets: + * # this increments the refcount, but need to test + * pyval = table.vals[k] # <<<<<<<<<<<<<< + * else: + * # box it. new ref? + */ + __pyx_t_5 = ((PyObject *)(__pyx_v_table->vals[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/parser.pyx":1317 + * else: + * # box it. new ref? + * pyval = PyUnicode_FromString(word) # <<<<<<<<<<<<<< + * + * k = kh_put_strbox(table, word, &ret) + */ + __pyx_t_5 = PyUnicode_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1319 + * pyval = PyUnicode_FromString(word) + * + * k = kh_put_strbox(table, word, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = pyval + * + */ + __pyx_v_k = kh_put_strbox(__pyx_v_table, __pyx_v_word, (&__pyx_v_ret)); + + /* "pandas/parser.pyx":1320 + * + * k = kh_put_strbox(table, word, &ret) + * table.vals[k] = pyval # <<<<<<<<<<<<<< + * + * result[i] = pyval + */ + (__pyx_v_table->vals[__pyx_v_k]) = ((PyObject *)__pyx_v_pyval); + } + __pyx_L7:; + + /* "pandas/parser.pyx":1322 + * table.vals[k] = pyval + * + * result[i] = pyval # <<<<<<<<<<<<<< + * + * kh_destroy_strbox(table) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_pyval); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_pyval; + __Pyx_GIVEREF(*__pyx_t_15); + __pyx_L3_continue:; + } + + /* "pandas/parser.pyx":1324 + * result[i] = pyval + * + * kh_destroy_strbox(table) # <<<<<<<<<<<<<< + * + * return result, na_count + */ + kh_destroy_strbox(__pyx_v_table); + + /* "pandas/parser.pyx":1326 + * kh_destroy_strbox(table) + * + * return result, na_count # <<<<<<<<<<<<<< + * + * cdef _string_box_decode(parser_t *parser, int col, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1274 + * return result, na_count + * + * cdef _string_box_utf8(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._string_box_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_pyval); + __Pyx_XDECREF(__pyx_v_NA); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1328 + * return result, na_count + * + * cdef _string_box_decode(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset, + */ + +static PyObject *__pyx_f_6pandas_6parser__string_box_decode(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset, char *__pyx_v_encoding) { + int __pyx_v_na_count; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_size; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_ret; + kh_strbox_t *__pyx_v_table; + char *__pyx_v_errors; + PyObject *__pyx_v_pyval = 0; + PyObject *__pyx_v_NA = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_box_decode", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1333 + * char *encoding): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, size + * size_t lines + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1340 + * ndarray[object] result + * + * int ret = 0 # <<<<<<<<<<<<<< + * kh_strbox_t *table + * + */ + __pyx_v_ret = 0; + + /* "pandas/parser.pyx":1343 + * kh_strbox_t *table + * + * char *errors = "strict" # <<<<<<<<<<<<<< + * + * object pyval + */ + __pyx_v_errors = __pyx_k_strict; + + /* "pandas/parser.pyx":1347 + * object pyval + * + * object NA = na_values[np.object_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_NA = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1350 + * khiter_t k + * + * table = kh_init_strbox() # <<<<<<<<<<<<<< + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + */ + __pyx_v_table = kh_init_strbox(); + + /* "pandas/parser.pyx":1351 + * + * table = kh_init_strbox() + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1352 + * table = kh_init_strbox() + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1353 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * for i in range(lines): + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1355 + * coliter_setup(&it, parser, col, line_start) + * + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_11 = __pyx_v_lines; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1356 + * + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1358 + * word = COLITER_NEXT(it) + * + * if na_filter: # <<<<<<<<<<<<<< + * k = kh_get_str(na_hashset, word) + * # in the hash table + */ + __pyx_t_13 = (__pyx_v_na_filter != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1359 + * + * if na_filter: + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1361 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * result[i] = NA + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1362 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * result[i] = NA + * continue + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1363 + * if k != na_hashset.n_buckets: + * na_count += 1 + * result[i] = NA # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_NA); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_NA; + __Pyx_GIVEREF(*__pyx_t_15); + + /* "pandas/parser.pyx":1364 + * na_count += 1 + * result[i] = NA + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_strbox(table, word) + */ + goto __pyx_L3_continue; + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":1366 + * continue + * + * k = kh_get_strbox(table, word) # <<<<<<<<<<<<<< + * + * # in the hash table + */ + __pyx_v_k = kh_get_strbox(__pyx_v_table, __pyx_v_word); + + /* "pandas/parser.pyx":1369 + * + * # in the hash table + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * # this increments the refcount, but need to test + * pyval = table.vals[k] + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1371 + * if k != table.n_buckets: + * # this increments the refcount, but need to test + * pyval = table.vals[k] # <<<<<<<<<<<<<< + * else: + * # box it. new ref? + */ + __pyx_t_5 = ((PyObject *)(__pyx_v_table->vals[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/parser.pyx":1374 + * else: + * # box it. new ref? + * size = strlen(word) # <<<<<<<<<<<<<< + * pyval = PyUnicode_Decode(word, size, encoding, errors) + * + */ + __pyx_v_size = strlen(__pyx_v_word); + + /* "pandas/parser.pyx":1375 + * # box it. new ref? + * size = strlen(word) + * pyval = PyUnicode_Decode(word, size, encoding, errors) # <<<<<<<<<<<<<< + * + * k = kh_put_strbox(table, word, &ret) + */ + __pyx_t_5 = PyUnicode_Decode(__pyx_v_word, __pyx_v_size, __pyx_v_encoding, __pyx_v_errors); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1377 + * pyval = PyUnicode_Decode(word, size, encoding, errors) + * + * k = kh_put_strbox(table, word, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = pyval + * + */ + __pyx_v_k = kh_put_strbox(__pyx_v_table, __pyx_v_word, (&__pyx_v_ret)); + + /* "pandas/parser.pyx":1378 + * + * k = kh_put_strbox(table, word, &ret) + * table.vals[k] = pyval # <<<<<<<<<<<<<< + * + * result[i] = pyval + */ + (__pyx_v_table->vals[__pyx_v_k]) = ((PyObject *)__pyx_v_pyval); + } + __pyx_L7:; + + /* "pandas/parser.pyx":1380 + * table.vals[k] = pyval + * + * result[i] = pyval # <<<<<<<<<<<<<< + * + * kh_destroy_strbox(table) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_pyval); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_pyval; + __Pyx_GIVEREF(*__pyx_t_15); + __pyx_L3_continue:; + } + + /* "pandas/parser.pyx":1382 + * result[i] = pyval + * + * kh_destroy_strbox(table) # <<<<<<<<<<<<<< + * + * return result, na_count + */ + kh_destroy_strbox(__pyx_v_table); + + /* "pandas/parser.pyx":1384 + * kh_destroy_strbox(table) + * + * return result, na_count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1328 + * return result, na_count + * + * cdef _string_box_decode(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._string_box_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_pyval); + __Pyx_XDECREF(__pyx_v_NA); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1387 + * + * + * cdef _to_fw_string(parser_t *parser, int col, int line_start, # <<<<<<<<<<<<<< + * int line_end, size_t width): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__to_fw_string(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, size_t __pyx_v_width) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + coliter_t __pyx_v_it; + char *__pyx_v_word; + char *__pyx_v_data; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_to_fw_string", 0); + + /* "pandas/parser.pyx":1396 + * ndarray result + * + * result = np.empty(line_end - line_start, dtype='|S%d' % width) # <<<<<<<<<<<<<< + * data = result.data + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_line_end - __pyx_v_line_start)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_S_d, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1397 + * + * result = np.empty(line_end - line_start, dtype='|S%d' % width) + * data = result.data # <<<<<<<<<<<<<< + * + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_v_data = ((char *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1399 + * data = result.data + * + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * for i in range(line_end - line_start): + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1401 + * coliter_setup(&it, parser, col, line_start) + * + * for i in range(line_end - line_start): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * strncpy(data, word, width) + */ + __pyx_t_6 = (__pyx_v_line_end - __pyx_v_line_start); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/parser.pyx":1402 + * + * for i in range(line_end - line_start): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * strncpy(data, word, width) + * data += width + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1403 + * for i in range(line_end - line_start): + * word = COLITER_NEXT(it) + * strncpy(data, word, width) # <<<<<<<<<<<<<< + * data += width + * + */ + strncpy(__pyx_v_data, __pyx_v_word, __pyx_v_width); + + /* "pandas/parser.pyx":1404 + * word = COLITER_NEXT(it) + * strncpy(data, word, width) + * data += width # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_width); + } + + /* "pandas/parser.pyx":1406 + * data += width + * + * return result # <<<<<<<<<<<<<< + * + * cdef char* cinf = b'inf' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/parser.pyx":1387 + * + * + * cdef _to_fw_string(parser_t *parser, int col, int line_start, # <<<<<<<<<<<<<< + * int line_end, size_t width): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.parser._to_fw_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1411 + * cdef char* cneginf = b'-inf' + * + * cdef _try_double(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset, object na_flist): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__try_double(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset, PyObject *__pyx_v_na_flist) { + int __pyx_v_error; + int __pyx_v_na_count; + CYTHON_UNUSED size_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + double *__pyx_v_data; + double __pyx_v_NA; + PyArrayObject *__pyx_v_result = 0; + khiter_t __pyx_v_k; + int __pyx_v_use_na_flist; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + double __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_try_double", 0); + + /* "pandas/parser.pyx":1414 + * bint na_filter, kh_str_t *na_hashset, object na_flist): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * size_t i, lines + * coliter_t it + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1419 + * char *word + * double *data + * double NA = na_values[np.float64] # <<<<<<<<<<<<<< + * ndarray result + * khiter_t k + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_NA = __pyx_t_4; + + /* "pandas/parser.pyx":1422 + * ndarray result + * khiter_t k + * bint use_na_flist = len(na_flist) > 0 # <<<<<<<<<<<<<< + * + * lines = line_end - line_start + */ + __pyx_t_5 = PyObject_Length(__pyx_v_na_flist); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_use_na_flist = (__pyx_t_5 > 0); + + /* "pandas/parser.pyx":1424 + * bint use_na_flist = len(na_flist) > 0 + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.float64) + * data = result.data + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1425 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.float64) # <<<<<<<<<<<<<< + * data = result.data + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":1426 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.float64) + * data = result.data # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_v_data = ((double *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1427 + * result = np.empty(lines, dtype=np.float64) + * data = result.data + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1429 + * coliter_setup(&it, parser, col, line_start) + * + * if na_filter: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_8 = (__pyx_v_na_filter != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1430 + * + * if na_filter: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_9 = __pyx_v_lines; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/parser.pyx":1431 + * if na_filter: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(na_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1433 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1435 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * data[0] = NA + */ + __pyx_t_8 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1436 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * data[0] = NA + * else: + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1437 + * if k != na_hashset.n_buckets: + * na_count += 1 + * data[0] = NA # <<<<<<<<<<<<<< + * else: + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + */ + (__pyx_v_data[0]) = __pyx_v_NA; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/parser.pyx":1439 + * data[0] = NA + * else: + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) # <<<<<<<<<<<<<< + * if error != 1: + * if strcasecmp(word, cinf) == 0: + */ + __pyx_v_error = to_double(__pyx_v_word, __pyx_v_data, __pyx_v_parser->sci, __pyx_v_parser->decimal, __pyx_v_parser->thousands); + + /* "pandas/parser.pyx":1440 + * else: + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: # <<<<<<<<<<<<<< + * if strcasecmp(word, cinf) == 0: + * data[0] = INF + */ + __pyx_t_8 = ((__pyx_v_error != 1) != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1441 + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: + * if strcasecmp(word, cinf) == 0: # <<<<<<<<<<<<<< + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: + */ + __pyx_t_8 = ((strcasecmp(__pyx_v_word, __pyx_v_6pandas_6parser_cinf) == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1442 + * if error != 1: + * if strcasecmp(word, cinf) == 0: + * data[0] = INF # <<<<<<<<<<<<<< + * elif strcasecmp(word, cneginf) == 0: + * data[0] = NEGINF + */ + (__pyx_v_data[0]) = __pyx_v_6pandas_6parser_INF; + goto __pyx_L8; + } + + /* "pandas/parser.pyx":1443 + * if strcasecmp(word, cinf) == 0: + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: # <<<<<<<<<<<<<< + * data[0] = NEGINF + * else: + */ + __pyx_t_8 = ((strcasecmp(__pyx_v_word, __pyx_v_6pandas_6parser_cneginf) == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1444 + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: + * data[0] = NEGINF # <<<<<<<<<<<<<< + * else: + * return None, None + */ + (__pyx_v_data[0]) = __pyx_v_6pandas_6parser_NEGINF; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/parser.pyx":1446 + * data[0] = NEGINF + * else: + * return None, None # <<<<<<<<<<<<<< + * if use_na_flist: + * if data[0] in na_flist: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__26); + __pyx_r = __pyx_tuple__26; + goto __pyx_L0; + } + __pyx_L8:; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/parser.pyx":1447 + * else: + * return None, None + * if use_na_flist: # <<<<<<<<<<<<<< + * if data[0] in na_flist: + * na_count += 1 + */ + __pyx_t_8 = (__pyx_v_use_na_flist != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1448 + * return None, None + * if use_na_flist: + * if data[0] in na_flist: # <<<<<<<<<<<<<< + * na_count += 1 + * data[0] = NA + */ + __pyx_t_7 = PyFloat_FromDouble((__pyx_v_data[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_t_7, __pyx_v_na_flist, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = (__pyx_t_8 != 0); + if (__pyx_t_11) { + + /* "pandas/parser.pyx":1449 + * if use_na_flist: + * if data[0] in na_flist: + * na_count += 1 # <<<<<<<<<<<<<< + * data[0] = NA + * data += 1 + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1450 + * if data[0] in na_flist: + * na_count += 1 + * data[0] = NA # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + (__pyx_v_data[0]) = __pyx_v_NA; + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + } + __pyx_L6:; + + /* "pandas/parser.pyx":1451 + * na_count += 1 + * data[0] = NA + * data += 1 # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_v_data = (__pyx_v_data + 1); + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1453 + * data += 1 + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + */ + __pyx_t_9 = __pyx_v_lines; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/parser.pyx":1454 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1455 + * for i in range(lines): + * word = COLITER_NEXT(it) + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) # <<<<<<<<<<<<<< + * if error != 1: + * if strcasecmp(word, cinf) == 0: + */ + __pyx_v_error = to_double(__pyx_v_word, __pyx_v_data, __pyx_v_parser->sci, __pyx_v_parser->decimal, __pyx_v_parser->thousands); + + /* "pandas/parser.pyx":1456 + * word = COLITER_NEXT(it) + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: # <<<<<<<<<<<<<< + * if strcasecmp(word, cinf) == 0: + * data[0] = INF + */ + __pyx_t_11 = ((__pyx_v_error != 1) != 0); + if (__pyx_t_11) { + + /* "pandas/parser.pyx":1457 + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: + * if strcasecmp(word, cinf) == 0: # <<<<<<<<<<<<<< + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: + */ + __pyx_t_11 = ((strcasecmp(__pyx_v_word, __pyx_v_6pandas_6parser_cinf) == 0) != 0); + if (__pyx_t_11) { + + /* "pandas/parser.pyx":1458 + * if error != 1: + * if strcasecmp(word, cinf) == 0: + * data[0] = INF # <<<<<<<<<<<<<< + * elif strcasecmp(word, cneginf) == 0: + * data[0] = NEGINF + */ + (__pyx_v_data[0]) = __pyx_v_6pandas_6parser_INF; + goto __pyx_L14; + } + + /* "pandas/parser.pyx":1459 + * if strcasecmp(word, cinf) == 0: + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: # <<<<<<<<<<<<<< + * data[0] = NEGINF + * else: + */ + __pyx_t_11 = ((strcasecmp(__pyx_v_word, __pyx_v_6pandas_6parser_cneginf) == 0) != 0); + if (__pyx_t_11) { + + /* "pandas/parser.pyx":1460 + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: + * data[0] = NEGINF # <<<<<<<<<<<<<< + * else: + * return None, None + */ + (__pyx_v_data[0]) = __pyx_v_6pandas_6parser_NEGINF; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/parser.pyx":1462 + * data[0] = NEGINF + * else: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__27); + __pyx_r = __pyx_tuple__27; + goto __pyx_L0; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/parser.pyx":1463 + * else: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * + * return result, na_count + */ + __pyx_v_data = (__pyx_v_data + 1); + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1465 + * data += 1 + * + * return result, na_count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1411 + * cdef char* cneginf = b'-inf' + * + * cdef _try_double(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset, object na_flist): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.parser._try_double", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1468 + * + * + * cdef _try_int64(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__try_int64(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + int __pyx_v_error; + int __pyx_v_na_count; + size_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + __pyx_t_5numpy_int64_t *__pyx_v_data; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_int64_t __pyx_v_NA; + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + size_t __pyx_t_8; + size_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_try_int64", 0); + + /* "pandas/parser.pyx":1471 + * bint na_filter, kh_str_t *na_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * size_t i, lines + * coliter_t it + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1478 + * ndarray result + * + * int64_t NA = na_values[np.int64] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_NA = __pyx_t_4; + + /* "pandas/parser.pyx":1481 + * khiter_t k + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.int64) + * data = result.data + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1482 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.int64) # <<<<<<<<<<<<<< + * data = result.data + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1483 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.int64) + * data = result.data # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_v_data = ((__pyx_t_5numpy_int64_t *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1484 + * result = np.empty(lines, dtype=np.int64) + * data = result.data + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1486 + * coliter_setup(&it, parser, col, line_start) + * + * if na_filter: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_7 = (__pyx_v_na_filter != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1487 + * + * if na_filter: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * k = kh_get_str(na_hashset, word) + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1488 + * if na_filter: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * k = kh_get_str(na_hashset, word) + * # in the hash table + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1489 + * for i in range(lines): + * word = COLITER_NEXT(it) + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1491 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * data[i] = NA + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1492 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * data[i] = NA + * continue + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1493 + * if k != na_hashset.n_buckets: + * na_count += 1 + * data[i] = NA # <<<<<<<<<<<<<< + * continue + * + */ + (__pyx_v_data[__pyx_v_i]) = __pyx_v_NA; + + /* "pandas/parser.pyx":1494 + * na_count += 1 + * data[i] = NA + * continue # <<<<<<<<<<<<<< + * + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1496 + * continue + * + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, # <<<<<<<<<<<<<< + * &error, parser.thousands) + * if error != 0: + */ + (__pyx_v_data[__pyx_v_i]) = str_to_int64(__pyx_v_word, INT64_MIN, INT64_MAX, (&__pyx_v_error), __pyx_v_parser->thousands); + + /* "pandas/parser.pyx":1498 + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + * &error, parser.thousands) + * if error != 0: # <<<<<<<<<<<<<< + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1499 + * &error, parser.thousands) + * if error != 0: + * if error == ERROR_OVERFLOW: # <<<<<<<<<<<<<< + * raise OverflowError(word) + * + */ + __pyx_t_7 = ((__pyx_v_error == ERROR_OVERFLOW) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1500 + * if error != 0: + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) # <<<<<<<<<<<<<< + * + * return None, None + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_OverflowError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1502 + * raise OverflowError(word) + * + * return None, None # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__28); + __pyx_r = __pyx_tuple__28; + goto __pyx_L0; + } + __pyx_L4_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1504 + * return None, None + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1505 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + * &error, parser.thousands) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1506 + * for i in range(lines): + * word = COLITER_NEXT(it) + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, # <<<<<<<<<<<<<< + * &error, parser.thousands) + * if error != 0: + */ + (__pyx_v_data[__pyx_v_i]) = str_to_int64(__pyx_v_word, INT64_MIN, INT64_MAX, (&__pyx_v_error), __pyx_v_parser->thousands); + + /* "pandas/parser.pyx":1508 + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + * &error, parser.thousands) + * if error != 0: # <<<<<<<<<<<<<< + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1509 + * &error, parser.thousands) + * if error != 0: + * if error == ERROR_OVERFLOW: # <<<<<<<<<<<<<< + * raise OverflowError(word) + * return None, None + */ + __pyx_t_7 = ((__pyx_v_error == ERROR_OVERFLOW) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1510 + * if error != 0: + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) # <<<<<<<<<<<<<< + * return None, None + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OverflowError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1511 + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) + * return None, None # <<<<<<<<<<<<<< + * + * return result, na_count + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__29); + __pyx_r = __pyx_tuple__29; + goto __pyx_L0; + } + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1513 + * return None, None + * + * return result, na_count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1468 + * + * + * cdef _try_int64(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser._try_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1516 + * + * + * cdef _try_bool(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__try_bool(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + int __pyx_v_error; + int __pyx_v_na_count; + CYTHON_UNUSED size_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + __pyx_t_5numpy_uint8_t *__pyx_v_data; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_uint8_t __pyx_v_NA; + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_uint8_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + size_t __pyx_t_8; + size_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_try_bool", 0); + + /* "pandas/parser.pyx":1519 + * bint na_filter, kh_str_t *na_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * size_t i, lines + * coliter_t it + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1526 + * ndarray result + * + * uint8_t NA = na_values[np.bool_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_uint8(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_NA = __pyx_t_4; + + /* "pandas/parser.pyx":1529 + * khiter_t k + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.uint8) + * data = result.data + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1530 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.uint8) # <<<<<<<<<<<<<< + * data = result.data + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1531 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.uint8) + * data = result.data # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_v_data = ((__pyx_t_5numpy_uint8_t *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1532 + * result = np.empty(lines, dtype=np.uint8) + * data = result.data + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1534 + * coliter_setup(&it, parser, col, line_start) + * + * if na_filter: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_7 = (__pyx_v_na_filter != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1535 + * + * if na_filter: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1536 + * if na_filter: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(na_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1538 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1540 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * data[0] = NA + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1541 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * data[0] = NA + * data += 1 + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1542 + * if k != na_hashset.n_buckets: + * na_count += 1 + * data[0] = NA # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = __pyx_v_NA; + + /* "pandas/parser.pyx":1543 + * na_count += 1 + * data[0] = NA + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1544 + * data[0] = NA + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * error = to_boolean(word, data) + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1546 + * continue + * + * error = to_boolean(word, data) # <<<<<<<<<<<<<< + * if error != 0: + * return None, None + */ + __pyx_v_error = to_boolean(__pyx_v_word, __pyx_v_data); + + /* "pandas/parser.pyx":1547 + * + * error = to_boolean(word, data) + * if error != 0: # <<<<<<<<<<<<<< + * return None, None + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1548 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__30); + __pyx_r = __pyx_tuple__30; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1549 + * if error != 0: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_v_data = (__pyx_v_data + 1); + __pyx_L4_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1551 + * data += 1 + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1552 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * error = to_boolean(word, data) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1554 + * word = COLITER_NEXT(it) + * + * error = to_boolean(word, data) # <<<<<<<<<<<<<< + * if error != 0: + * return None, None + */ + __pyx_v_error = to_boolean(__pyx_v_word, __pyx_v_data); + + /* "pandas/parser.pyx":1555 + * + * error = to_boolean(word, data) + * if error != 0: # <<<<<<<<<<<<<< + * return None, None + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1556 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__31); + __pyx_r = __pyx_tuple__31; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1557 + * if error != 0: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * + * return result.view(np.bool_), na_count + */ + __pyx_v_data = (__pyx_v_data + 1); + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1559 + * data += 1 + * + * return result.view(np.bool_), na_count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1516 + * + * + * cdef _try_bool(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser._try_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1562 + * + * + * cdef _try_bool_flex(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset, + * kh_str_t *true_hashset, kh_str_t *false_hashset): + */ + +static PyObject *__pyx_f_6pandas_6parser__try_bool_flex(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset, kh_str_t *__pyx_v_true_hashset, kh_str_t *__pyx_v_false_hashset) { + int __pyx_v_error; + int __pyx_v_na_count; + CYTHON_UNUSED size_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + __pyx_t_5numpy_uint8_t *__pyx_v_data; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_uint8_t __pyx_v_NA; + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_uint8_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + size_t __pyx_t_8; + size_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_try_bool_flex", 0); + + /* "pandas/parser.pyx":1566 + * kh_str_t *true_hashset, kh_str_t *false_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * size_t i, lines + * coliter_t it + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1573 + * ndarray result + * + * uint8_t NA = na_values[np.bool_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_uint8(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_NA = __pyx_t_4; + + /* "pandas/parser.pyx":1576 + * khiter_t k + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.uint8) + * data = result.data + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1577 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.uint8) # <<<<<<<<<<<<<< + * data = result.data + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1578 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.uint8) + * data = result.data # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_v_data = ((__pyx_t_5numpy_uint8_t *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1579 + * result = np.empty(lines, dtype=np.uint8) + * data = result.data + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1581 + * coliter_setup(&it, parser, col, line_start) + * + * if na_filter: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_7 = (__pyx_v_na_filter != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1582 + * + * if na_filter: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1583 + * if na_filter: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(na_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1585 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1587 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * data[0] = NA + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1588 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * data[0] = NA + * data += 1 + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1589 + * if k != na_hashset.n_buckets: + * na_count += 1 + * data[0] = NA # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = __pyx_v_NA; + + /* "pandas/parser.pyx":1590 + * na_count += 1 + * data[0] = NA + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1591 + * data[0] = NA + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_str(true_hashset, word) + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1593 + * continue + * + * k = kh_get_str(true_hashset, word) # <<<<<<<<<<<<<< + * if k != true_hashset.n_buckets: + * data[0] = 1 + */ + __pyx_v_k = kh_get_str(__pyx_v_true_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1594 + * + * k = kh_get_str(true_hashset, word) + * if k != true_hashset.n_buckets: # <<<<<<<<<<<<<< + * data[0] = 1 + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_true_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1595 + * k = kh_get_str(true_hashset, word) + * if k != true_hashset.n_buckets: + * data[0] = 1 # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = 1; + + /* "pandas/parser.pyx":1596 + * if k != true_hashset.n_buckets: + * data[0] = 1 + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1597 + * data[0] = 1 + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_str(false_hashset, word) + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1599 + * continue + * + * k = kh_get_str(false_hashset, word) # <<<<<<<<<<<<<< + * if k != false_hashset.n_buckets: + * data[0] = 0 + */ + __pyx_v_k = kh_get_str(__pyx_v_false_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1600 + * + * k = kh_get_str(false_hashset, word) + * if k != false_hashset.n_buckets: # <<<<<<<<<<<<<< + * data[0] = 0 + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_false_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1601 + * k = kh_get_str(false_hashset, word) + * if k != false_hashset.n_buckets: + * data[0] = 0 # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = 0; + + /* "pandas/parser.pyx":1602 + * if k != false_hashset.n_buckets: + * data[0] = 0 + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1603 + * data[0] = 0 + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * error = to_boolean(word, data) + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1605 + * continue + * + * error = to_boolean(word, data) # <<<<<<<<<<<<<< + * if error != 0: + * return None, None + */ + __pyx_v_error = to_boolean(__pyx_v_word, __pyx_v_data); + + /* "pandas/parser.pyx":1606 + * + * error = to_boolean(word, data) + * if error != 0: # <<<<<<<<<<<<<< + * return None, None + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1607 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__32); + __pyx_r = __pyx_tuple__32; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1608 + * if error != 0: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_v_data = (__pyx_v_data + 1); + __pyx_L4_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1610 + * data += 1 + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1611 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(true_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1613 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(true_hashset, word) # <<<<<<<<<<<<<< + * if k != true_hashset.n_buckets: + * data[0] = 1 + */ + __pyx_v_k = kh_get_str(__pyx_v_true_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1614 + * + * k = kh_get_str(true_hashset, word) + * if k != true_hashset.n_buckets: # <<<<<<<<<<<<<< + * data[0] = 1 + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_true_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1615 + * k = kh_get_str(true_hashset, word) + * if k != true_hashset.n_buckets: + * data[0] = 1 # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = 1; + + /* "pandas/parser.pyx":1616 + * if k != true_hashset.n_buckets: + * data[0] = 1 + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1617 + * data[0] = 1 + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_str(false_hashset, word) + */ + goto __pyx_L10_continue; + } + + /* "pandas/parser.pyx":1619 + * continue + * + * k = kh_get_str(false_hashset, word) # <<<<<<<<<<<<<< + * if k != false_hashset.n_buckets: + * data[0] = 0 + */ + __pyx_v_k = kh_get_str(__pyx_v_false_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1620 + * + * k = kh_get_str(false_hashset, word) + * if k != false_hashset.n_buckets: # <<<<<<<<<<<<<< + * data[0] = 0 + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_false_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1621 + * k = kh_get_str(false_hashset, word) + * if k != false_hashset.n_buckets: + * data[0] = 0 # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = 0; + + /* "pandas/parser.pyx":1622 + * if k != false_hashset.n_buckets: + * data[0] = 0 + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1623 + * data[0] = 0 + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * error = to_boolean(word, data) + */ + goto __pyx_L10_continue; + } + + /* "pandas/parser.pyx":1625 + * continue + * + * error = to_boolean(word, data) # <<<<<<<<<<<<<< + * if error != 0: + * return None, None + */ + __pyx_v_error = to_boolean(__pyx_v_word, __pyx_v_data); + + /* "pandas/parser.pyx":1626 + * + * error = to_boolean(word, data) + * if error != 0: # <<<<<<<<<<<<<< + * return None, None + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1627 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__33); + __pyx_r = __pyx_tuple__33; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1628 + * if error != 0: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * + * return result.view(np.bool_), na_count + */ + __pyx_v_data = (__pyx_v_data + 1); + __pyx_L10_continue:; + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1630 + * data += 1 + * + * return result.view(np.bool_), na_count # <<<<<<<<<<<<<< + * + * cdef _get_na_mask(parser_t *parser, int col, int line_start, int line_end, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1562 + * + * + * cdef _try_bool_flex(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset, + * kh_str_t *true_hashset, kh_str_t *false_hashset): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser._try_bool_flex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1632 + * return result.view(np.bool_), na_count + * + * cdef _get_na_mask(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * kh_str_t *na_hashset): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__get_na_mask(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, kh_str_t *__pyx_v_na_hashset) { + Py_ssize_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + PyArrayObject *__pyx_v_result = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_na_mask", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1643 + * khiter_t k + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.bool_) + * + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1644 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.bool_) # <<<<<<<<<<<<<< + * + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1646 + * result = np.empty(lines, dtype=np.bool_) + * + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1647 + * + * coliter_setup(&it, parser, col, line_start) + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_11 = __pyx_v_lines; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1648 + * coliter_setup(&it, parser, col, line_start) + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(na_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1650 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1652 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * result[i] = 1 + * else: + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1653 + * # in the hash table + * if k != na_hashset.n_buckets: + * result[i] = 1 # <<<<<<<<<<<<<< + * else: + * result[i] = 0 + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/parser.pyx":1655 + * result[i] = 1 + * else: + * result[i] = 0 # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + } + __pyx_L5:; + } + + /* "pandas/parser.pyx":1657 + * result[i] = 0 + * + * return result # <<<<<<<<<<<<<< + * + * cdef kh_str_t* kset_from_list(list values) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/parser.pyx":1632 + * return result.view(np.bool_), na_count + * + * cdef _get_na_mask(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * kh_str_t *na_hashset): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._get_na_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1659 + * return result + * + * cdef kh_str_t* kset_from_list(list values) except NULL: # <<<<<<<<<<<<<< + * # caller takes responsibility for freeing the hash table + * cdef: + */ + +static kh_str_t *__pyx_f_6pandas_6parser_kset_from_list(PyObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + CYTHON_UNUSED khiter_t __pyx_v_k; + kh_str_t *__pyx_v_table; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + kh_str_t *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char *__pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("kset_from_list", 0); + + /* "pandas/parser.pyx":1665 + * khiter_t k + * kh_str_t *table + * int ret = 0 # <<<<<<<<<<<<<< + * + * object val + */ + __pyx_v_ret = 0; + + /* "pandas/parser.pyx":1669 + * object val + * + * table = kh_init_str() # <<<<<<<<<<<<<< + * + * for i in range(len(values)): + */ + __pyx_v_table = kh_init_str(); + + /* "pandas/parser.pyx":1671 + * table = kh_init_str() + * + * for i in range(len(values)): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + if (unlikely(__pyx_v_values == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/parser.pyx":1672 + * + * for i in range(len(values)): + * val = values[i] # <<<<<<<<<<<<<< + * + * # None creeps in sometimes, which isn't possible here + */ + if (unlikely(__pyx_v_values == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_values, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1675 + * + * # None creeps in sometimes, which isn't possible here + * if not PyBytes_Check(val): # <<<<<<<<<<<<<< + * raise Exception('Must be all encoded bytes') + * + */ + __pyx_t_4 = ((!(PyBytes_Check(__pyx_v_val) != 0)) != 0); + if (__pyx_t_4) { + + /* "pandas/parser.pyx":1676 + * # None creeps in sometimes, which isn't possible here + * if not PyBytes_Check(val): + * raise Exception('Must be all encoded bytes') # <<<<<<<<<<<<<< + * + * k = kh_put_str(table, PyBytes_AsString(val), &ret) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1678 + * raise Exception('Must be all encoded bytes') + * + * k = kh_put_str(table, PyBytes_AsString(val), &ret) # <<<<<<<<<<<<<< + * + * return table + */ + __pyx_t_5 = PyBytes_AsString(__pyx_v_val); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_put_str(__pyx_v_table, __pyx_t_5, (&__pyx_v_ret)); + } + + /* "pandas/parser.pyx":1680 + * k = kh_put_str(table, PyBytes_AsString(val), &ret) + * + * return table # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_table; + goto __pyx_L0; + + /* "pandas/parser.pyx":1659 + * return result + * + * cdef kh_str_t* kset_from_list(list values) except NULL: # <<<<<<<<<<<<<< + * # caller takes responsibility for freeing the hash table + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.kset_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1689 + * + * + * cdef raise_parser_error(object base, parser_t *parser): # <<<<<<<<<<<<<< + * message = '%s. C error: ' % base + * if parser.error_msg != NULL: + */ + +static PyObject *__pyx_f_6pandas_6parser_raise_parser_error(PyObject *__pyx_v_base, parser_t *__pyx_v_parser) { + PyObject *__pyx_v_message = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + char *__pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("raise_parser_error", 0); + + /* "pandas/parser.pyx":1690 + * + * cdef raise_parser_error(object base, parser_t *parser): + * message = '%s. C error: ' % base # <<<<<<<<<<<<<< + * if parser.error_msg != NULL: + * if PY3: + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_C_error, __pyx_v_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_message = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1691 + * cdef raise_parser_error(object base, parser_t *parser): + * message = '%s. C error: ' % base + * if parser.error_msg != NULL: # <<<<<<<<<<<<<< + * if PY3: + * message += parser.error_msg.decode('utf-8') + */ + __pyx_t_2 = ((__pyx_v_parser->error_msg != NULL) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1692 + * message = '%s. C error: ' % base + * if parser.error_msg != NULL: + * if PY3: # <<<<<<<<<<<<<< + * message += parser.error_msg.decode('utf-8') + * else: + */ + __pyx_t_2 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1693 + * if parser.error_msg != NULL: + * if PY3: + * message += parser.error_msg.decode('utf-8') # <<<<<<<<<<<<<< + * else: + * message += parser.error_msg + */ + __pyx_t_3 = __pyx_v_parser->error_msg; + __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_3, 0, strlen(__pyx_t_3), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_message, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/parser.pyx":1695 + * message += parser.error_msg.decode('utf-8') + * else: + * message += parser.error_msg # <<<<<<<<<<<<<< + * else: + * message += 'no error message set' + */ + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_parser->error_msg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1697 + * message += parser.error_msg + * else: + * message += 'no error message set' # <<<<<<<<<<<<<< + * + * raise CParserError(message) + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_kp_s_no_error_message_set); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":1699 + * message += 'no error message set' + * + * raise CParserError(message) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CParserError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_message); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_message); + __Pyx_GIVEREF(__pyx_v_message); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1689 + * + * + * cdef raise_parser_error(object base, parser_t *parser): # <<<<<<<<<<<<<< + * message = '%s. C error: ' % base + * if parser.error_msg != NULL: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.parser.raise_parser_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __Pyx_XDECREF(__pyx_v_message); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1702 + * + * + * def downcast_int64(ndarray[int64_t] arr, bint use_unsigned=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_7downcast_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_7downcast_int64 = {__Pyx_NAMESTR("downcast_int64"), (PyCFunction)__pyx_pw_6pandas_6parser_7downcast_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_7downcast_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_use_unsigned; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("downcast_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_use_unsigned,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_unsigned); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "downcast_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_use_unsigned = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_use_unsigned == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_use_unsigned = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("downcast_int64", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.downcast_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_6parser_6downcast_int64(__pyx_self, __pyx_v_arr, __pyx_v_use_unsigned); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_6downcast_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_use_unsigned) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_mx; + __pyx_t_5numpy_int64_t __pyx_v_mn; + __pyx_t_5numpy_int64_t __pyx_v_NA; + __pyx_t_5numpy_int64_t __pyx_v_val; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_v_na_count; + PyObject *__pyx_v__mask = NULL; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_t_17; + int __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("downcast_int64", 0); + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/parser.pyx":1704 + * def downcast_int64(ndarray[int64_t] arr, bint use_unsigned=0): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * int64_t mx = INT64_MIN + 1, mn = INT64_MAX + * int64_t NA = na_values[np.int64] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/parser.pyx":1705 + * cdef: + * Py_ssize_t i, n = len(arr) + * int64_t mx = INT64_MIN + 1, mn = INT64_MAX # <<<<<<<<<<<<<< + * int64_t NA = na_values[np.int64] + * int64_t val + */ + __pyx_v_mx = (INT64_MIN + 1); + __pyx_v_mn = INT64_MAX; + + /* "pandas/parser.pyx":1706 + * Py_ssize_t i, n = len(arr) + * int64_t mx = INT64_MIN + 1, mn = INT64_MAX + * int64_t NA = na_values[np.int64] # <<<<<<<<<<<<<< + * int64_t val + * ndarray[uint8_t] mask + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_t_4); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_NA = __pyx_t_5; + + /* "pandas/parser.pyx":1709 + * int64_t val + * ndarray[uint8_t] mask + * int na_count = 0 # <<<<<<<<<<<<<< + * + * _mask = np.empty(n, dtype=bool) + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1711 + * int na_count = 0 + * + * _mask = np.empty(n, dtype=bool) # <<<<<<<<<<<<<< + * mask = _mask.view(np.uint8) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v__mask = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1712 + * + * _mask = np.empty(n, dtype=bool) + * mask = _mask.view(np.uint8) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__mask, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_mask = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1714 + * mask = _mask.view(np.uint8) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1715 + * + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * + * if val == NA: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/parser.pyx":1717 + * val = arr[i] + * + * if val == NA: # <<<<<<<<<<<<<< + * mask[i] = 1 + * na_count += 1 + */ + __pyx_t_14 = ((__pyx_v_val == __pyx_v_NA) != 0); + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1718 + * + * if val == NA: + * mask[i] = 1 # <<<<<<<<<<<<<< + * na_count += 1 + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides) = 1; + + /* "pandas/parser.pyx":1719 + * if val == NA: + * mask[i] = 1 + * na_count += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1720 + * mask[i] = 1 + * na_count += 1 + * continue # <<<<<<<<<<<<<< + * + * # not NA + */ + goto __pyx_L3_continue; + } + + /* "pandas/parser.pyx":1723 + * + * # not NA + * mask[i] = 0 # <<<<<<<<<<<<<< + * + * if val > mx: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[0].strides) = 0; + + /* "pandas/parser.pyx":1725 + * mask[i] = 0 + * + * if val > mx: # <<<<<<<<<<<<<< + * mx = val + * + */ + __pyx_t_14 = ((__pyx_v_val > __pyx_v_mx) != 0); + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1726 + * + * if val > mx: + * mx = val # <<<<<<<<<<<<<< + * + * if val < mn: + */ + __pyx_v_mx = __pyx_v_val; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/parser.pyx":1728 + * mx = val + * + * if val < mn: # <<<<<<<<<<<<<< + * mn = val + * + */ + __pyx_t_14 = ((__pyx_v_val < __pyx_v_mn) != 0); + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1729 + * + * if val < mn: + * mn = val # <<<<<<<<<<<<<< + * + * if mn >= 0 and use_unsigned: + */ + __pyx_v_mn = __pyx_v_val; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_L3_continue:; + } + + /* "pandas/parser.pyx":1731 + * mn = val + * + * if mn >= 0 and use_unsigned: # <<<<<<<<<<<<<< + * if mx <= UINT8_MAX - 1: + * result = arr.astype(np.uint8) + */ + __pyx_t_14 = ((__pyx_v_mn >= 0) != 0); + if (__pyx_t_14) { + __pyx_t_17 = (__pyx_v_use_unsigned != 0); + } else { + __pyx_t_17 = __pyx_t_14; + } + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1732 + * + * if mn >= 0 and use_unsigned: + * if mx <= UINT8_MAX - 1: # <<<<<<<<<<<<<< + * result = arr.astype(np.uint8) + * if na_count: + */ + __pyx_t_17 = ((__pyx_v_mx <= (UINT8_MAX - 1)) != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1733 + * if mn >= 0 and use_unsigned: + * if mx <= UINT8_MAX - 1: + * result = arr.astype(np.uint8) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.uint8]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1734 + * if mx <= UINT8_MAX - 1: + * result = arr.astype(np.uint8) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.uint8]) + * return result + */ + __pyx_t_17 = (__pyx_v_na_count != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1735 + * result = arr.astype(np.uint8) + * if na_count: + * np.putmask(result, _mask, na_values[np.uint8]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_6, __pyx_t_4); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":1736 + * if na_count: + * np.putmask(result, _mask, na_values[np.uint8]) + * return result # <<<<<<<<<<<<<< + * + * if mx <= UINT16_MAX - 1: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1738 + * return result + * + * if mx <= UINT16_MAX - 1: # <<<<<<<<<<<<<< + * result = arr.astype(np.uint16) + * if na_count: + */ + __pyx_t_17 = ((__pyx_v_mx <= (UINT16_MAX - 1)) != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1739 + * + * if mx <= UINT16_MAX - 1: + * result = arr.astype(np.uint16) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.uint16]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1740 + * if mx <= UINT16_MAX - 1: + * result = arr.astype(np.uint16) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.uint16]) + * return result + */ + __pyx_t_17 = (__pyx_v_na_count != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1741 + * result = arr.astype(np.uint16) + * if na_count: + * np.putmask(result, _mask, na_values[np.uint16]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/parser.pyx":1742 + * if na_count: + * np.putmask(result, _mask, na_values[np.uint16]) + * return result # <<<<<<<<<<<<<< + * + * if mx <= UINT32_MAX - 1: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1744 + * return result + * + * if mx <= UINT32_MAX - 1: # <<<<<<<<<<<<<< + * result = arr.astype(np.uint32) + * if na_count: + */ + __pyx_t_17 = ((__pyx_v_mx <= (UINT32_MAX - 1)) != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1745 + * + * if mx <= UINT32_MAX - 1: + * result = arr.astype(np.uint32) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.uint32]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1746 + * if mx <= UINT32_MAX - 1: + * result = arr.astype(np.uint32) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.uint32]) + * return result + */ + __pyx_t_17 = (__pyx_v_na_count != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1747 + * result = arr.astype(np.uint32) + * if na_count: + * np.putmask(result, _mask, na_values[np.uint32]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_putmask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/parser.pyx":1748 + * if na_count: + * np.putmask(result, _mask, na_values[np.uint32]) + * return result # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/parser.pyx":1751 + * + * else: + * if mn >= INT8_MIN + 1 and mx <= INT8_MAX: # <<<<<<<<<<<<<< + * result = arr.astype(np.int8) + * if na_count: + */ + __pyx_t_17 = ((__pyx_v_mn >= (INT8_MIN + 1)) != 0); + if (__pyx_t_17) { + __pyx_t_14 = ((__pyx_v_mx <= INT8_MAX) != 0); + __pyx_t_18 = __pyx_t_14; + } else { + __pyx_t_18 = __pyx_t_17; + } + if (__pyx_t_18) { + + /* "pandas/parser.pyx":1752 + * else: + * if mn >= INT8_MIN + 1 and mx <= INT8_MAX: + * result = arr.astype(np.int8) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.int8]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1753 + * if mn >= INT8_MIN + 1 and mx <= INT8_MAX: + * result = arr.astype(np.int8) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.int8]) + * return result + */ + __pyx_t_18 = (__pyx_v_na_count != 0); + if (__pyx_t_18) { + + /* "pandas/parser.pyx":1754 + * result = arr.astype(np.int8) + * if na_count: + * np.putmask(result, _mask, na_values[np.int8]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_6, __pyx_t_4); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/parser.pyx":1755 + * if na_count: + * np.putmask(result, _mask, na_values[np.int8]) + * return result # <<<<<<<<<<<<<< + * + * if mn >= INT16_MIN + 1 and mx <= INT16_MAX: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1757 + * return result + * + * if mn >= INT16_MIN + 1 and mx <= INT16_MAX: # <<<<<<<<<<<<<< + * result = arr.astype(np.int16) + * if na_count: + */ + __pyx_t_18 = ((__pyx_v_mn >= (INT16_MIN + 1)) != 0); + if (__pyx_t_18) { + __pyx_t_17 = ((__pyx_v_mx <= INT16_MAX) != 0); + __pyx_t_14 = __pyx_t_17; + } else { + __pyx_t_14 = __pyx_t_18; + } + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1758 + * + * if mn >= INT16_MIN + 1 and mx <= INT16_MAX: + * result = arr.astype(np.int16) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.int16]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1759 + * if mn >= INT16_MIN + 1 and mx <= INT16_MAX: + * result = arr.astype(np.int16) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.int16]) + * return result + */ + __pyx_t_14 = (__pyx_v_na_count != 0); + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1760 + * result = arr.astype(np.int16) + * if na_count: + * np.putmask(result, _mask, na_values[np.int16]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L18; + } + __pyx_L18:; + + /* "pandas/parser.pyx":1761 + * if na_count: + * np.putmask(result, _mask, na_values[np.int16]) + * return result # <<<<<<<<<<<<<< + * + * if mn >= INT32_MIN + 1 and mx <= INT32_MAX: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1763 + * return result + * + * if mn >= INT32_MIN + 1 and mx <= INT32_MAX: # <<<<<<<<<<<<<< + * result = arr.astype(np.int32) + * if na_count: + */ + __pyx_t_14 = ((__pyx_v_mn >= (INT32_MIN + 1)) != 0); + if (__pyx_t_14) { + __pyx_t_18 = ((__pyx_v_mx <= INT32_MAX) != 0); + __pyx_t_17 = __pyx_t_18; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1764 + * + * if mn >= INT32_MIN + 1 and mx <= INT32_MAX: + * result = arr.astype(np.int32) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.int32]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1765 + * if mn >= INT32_MIN + 1 and mx <= INT32_MAX: + * result = arr.astype(np.int32) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.int32]) + * return result + */ + __pyx_t_17 = (__pyx_v_na_count != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1766 + * result = arr.astype(np.int32) + * if na_count: + * np.putmask(result, _mask, na_values[np.int32]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_putmask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/parser.pyx":1767 + * if na_count: + * np.putmask(result, _mask, na_values[np.int32]) + * return result # <<<<<<<<<<<<<< + * + * return arr + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + } + __pyx_L8:; + + /* "pandas/parser.pyx":1769 + * return result + * + * return arr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/parser.pyx":1702 + * + * + * def downcast_int64(ndarray[int64_t] arr, bint use_unsigned=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser.downcast_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_mask); + __Pyx_XDECREF(__pyx_v__mask); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1772 + * + * + * def _concatenate_chunks(list chunks): # <<<<<<<<<<<<<< + * cdef: + * list names = list(chunks[0].keys()) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_9_concatenate_chunks(PyObject *__pyx_self, PyObject *__pyx_v_chunks); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_9_concatenate_chunks = {__Pyx_NAMESTR("_concatenate_chunks"), (PyCFunction)__pyx_pw_6pandas_6parser_9_concatenate_chunks, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_9_concatenate_chunks(PyObject *__pyx_self, PyObject *__pyx_v_chunks) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_concatenate_chunks (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chunks), (&PyList_Type), 1, "chunks", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_6parser_8_concatenate_chunks(__pyx_self, ((PyObject*)__pyx_v_chunks)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_8_concatenate_chunks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chunks) { + PyObject *__pyx_v_names = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_warning_columns = 0; + PyObject *__pyx_v_warning_names = 0; + PyObject *__pyx_v_common_type = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_arrs = NULL; + PyObject *__pyx_v_dtypes = NULL; + PyObject *__pyx_v_warning_message = NULL; + PyObject *__pyx_v_chunk = NULL; + PyObject *__pyx_v_a = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_concatenate_chunks", 0); + + /* "pandas/parser.pyx":1774 + * def _concatenate_chunks(list chunks): + * cdef: + * list names = list(chunks[0].keys()) # <<<<<<<<<<<<<< + * object name + * list warning_columns + */ + if (unlikely(__pyx_v_chunks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_chunks, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_names = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1780 + * object common_type + * + * result = {} # <<<<<<<<<<<<<< + * warning_columns = list() + * for name in names: + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1781 + * + * result = {} + * warning_columns = list() # <<<<<<<<<<<<<< + * for name in names: + * arrs = [chunk.pop(name) for chunk in chunks] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_warning_columns = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1782 + * result = {} + * warning_columns = list() + * for name in names: # <<<<<<<<<<<<<< + * arrs = [chunk.pop(name) for chunk in chunks] + * # Check each arr for consistent types. + */ + __pyx_t_1 = __pyx_v_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1783 + * warning_columns = list() + * for name in names: + * arrs = [chunk.pop(name) for chunk in chunks] # <<<<<<<<<<<<<< + * # Check each arr for consistent types. + * dtypes = set([a.dtype for a in arrs]) + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_chunks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + for (;;) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_arrs, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1785 + * arrs = [chunk.pop(name) for chunk in chunks] + * # Check each arr for consistent types. + * dtypes = set([a.dtype for a in arrs]) # <<<<<<<<<<<<<< + * if len(dtypes) > 1: + * common_type = np.find_common_type(dtypes, []) + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __pyx_v_arrs; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + for (;;) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_dtypes, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1786 + * # Check each arr for consistent types. + * dtypes = set([a.dtype for a in arrs]) + * if len(dtypes) > 1: # <<<<<<<<<<<<<< + * common_type = np.find_common_type(dtypes, []) + * if common_type == np.object: + */ + __pyx_t_5 = PySet_Size(__pyx_v_dtypes); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_5 > 1) != 0); + if (__pyx_t_9) { + + /* "pandas/parser.pyx":1787 + * dtypes = set([a.dtype for a in arrs]) + * if len(dtypes) > 1: + * common_type = np.find_common_type(dtypes, []) # <<<<<<<<<<<<<< + * if common_type == np.object: + * warning_columns.append(str(name)) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_find_common_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_dtypes); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_dtypes); + __Pyx_GIVEREF(__pyx_v_dtypes); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_common_type, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1788 + * if len(dtypes) > 1: + * common_type = np.find_common_type(dtypes, []) + * if common_type == np.object: # <<<<<<<<<<<<<< + * warning_columns.append(str(name)) + * result[name] = np.concatenate(arrs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_common_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "pandas/parser.pyx":1789 + * common_type = np.find_common_type(dtypes, []) + * if common_type == np.object: + * warning_columns.append(str(name)) # <<<<<<<<<<<<<< + * result[name] = np.concatenate(arrs) + * + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_warning_columns, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/parser.pyx":1790 + * if common_type == np.object: + * warning_columns.append(str(name)) + * result[name] = np.concatenate(arrs) # <<<<<<<<<<<<<< + * + * if warning_columns: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_arrs); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_arrs); + __Pyx_GIVEREF(__pyx_v_arrs); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_name, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1792 + * result[name] = np.concatenate(arrs) + * + * if warning_columns: # <<<<<<<<<<<<<< + * warning_names = ','.join(warning_columns) + * warning_message = " ".join(["Columns (%s) have mixed types." % warning_names, + */ + __pyx_t_9 = (__pyx_v_warning_columns != Py_None) && (PyList_GET_SIZE(__pyx_v_warning_columns) != 0); + if (__pyx_t_9) { + + /* "pandas/parser.pyx":1793 + * + * if warning_columns: + * warning_names = ','.join(warning_columns) # <<<<<<<<<<<<<< + * warning_message = " ".join(["Columns (%s) have mixed types." % warning_names, + * "Specify dtype option on import or set low_memory=False." + */ + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_v_warning_columns); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_warning_names = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1794 + * if warning_columns: + * warning_names = ','.join(warning_columns) + * warning_message = " ".join(["Columns (%s) have mixed types." % warning_names, # <<<<<<<<<<<<<< + * "Specify dtype option on import or set low_memory=False." + * ]) + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Columns_s_have_mixed_types, __pyx_v_warning_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_Specify_dtype_option_on_import_o); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_Specify_dtype_option_on_import_o); + __Pyx_GIVEREF(__pyx_kp_s_Specify_dtype_option_on_import_o); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__35, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_warning_message = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1797 + * "Specify dtype option on import or set low_memory=False." + * ]) + * warnings.warn(warning_message, DtypeWarning) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DtypeWarning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_warning_message); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_warning_message); + __Pyx_GIVEREF(__pyx_v_warning_message); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/parser.pyx":1798 + * ]) + * warnings.warn(warning_message, DtypeWarning) + * return result # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/parser.pyx":1772 + * + * + * def _concatenate_chunks(list chunks): # <<<<<<<<<<<<<< + * cdef: + * list names = list(chunks[0].keys()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.parser._concatenate_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_names); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_warning_columns); + __Pyx_XDECREF(__pyx_v_warning_names); + __Pyx_XDECREF(__pyx_v_common_type); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_arrs); + __Pyx_XDECREF(__pyx_v_dtypes); + __Pyx_XDECREF(__pyx_v_warning_message); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_a); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1803 + * + * # NA values + * def _compute_na_values(): # <<<<<<<<<<<<<< + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_11_compute_na_values(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_11_compute_na_values = {__Pyx_NAMESTR("_compute_na_values"), (PyCFunction)__pyx_pw_6pandas_6parser_11_compute_na_values, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_11_compute_na_values(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_compute_na_values (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10_compute_na_values(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10_compute_na_values(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_int64info = NULL; + PyObject *__pyx_v_int32info = NULL; + PyObject *__pyx_v_int16info = NULL; + PyObject *__pyx_v_int8info = NULL; + PyObject *__pyx_v_uint64info = NULL; + PyObject *__pyx_v_uint32info = NULL; + PyObject *__pyx_v_uint16info = NULL; + PyObject *__pyx_v_uint8info = NULL; + PyObject *__pyx_v_na_values = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_compute_na_values", 0); + + /* "pandas/parser.pyx":1804 + * # NA values + * def _compute_na_values(): + * int64info = np.iinfo(np.int64) # <<<<<<<<<<<<<< + * int32info = np.iinfo(np.int32) + * int16info = np.iinfo(np.int16) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_int64info = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1805 + * def _compute_na_values(): + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) # <<<<<<<<<<<<<< + * int16info = np.iinfo(np.int16) + * int8info = np.iinfo(np.int8) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_int32info = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1806 + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) + * int16info = np.iinfo(np.int16) # <<<<<<<<<<<<<< + * int8info = np.iinfo(np.int8) + * uint64info = np.iinfo(np.uint64) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_int16info = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1807 + * int32info = np.iinfo(np.int32) + * int16info = np.iinfo(np.int16) + * int8info = np.iinfo(np.int8) # <<<<<<<<<<<<<< + * uint64info = np.iinfo(np.uint64) + * uint32info = np.iinfo(np.uint32) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_int8info = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1808 + * int16info = np.iinfo(np.int16) + * int8info = np.iinfo(np.int8) + * uint64info = np.iinfo(np.uint64) # <<<<<<<<<<<<<< + * uint32info = np.iinfo(np.uint32) + * uint16info = np.iinfo(np.uint16) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_uint64info = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1809 + * int8info = np.iinfo(np.int8) + * uint64info = np.iinfo(np.uint64) + * uint32info = np.iinfo(np.uint32) # <<<<<<<<<<<<<< + * uint16info = np.iinfo(np.uint16) + * uint8info = np.iinfo(np.uint8) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_uint32info = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1810 + * uint64info = np.iinfo(np.uint64) + * uint32info = np.iinfo(np.uint32) + * uint16info = np.iinfo(np.uint16) # <<<<<<<<<<<<<< + * uint8info = np.iinfo(np.uint8) + * na_values = { + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_uint16info = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1811 + * uint32info = np.iinfo(np.uint32) + * uint16info = np.iinfo(np.uint16) + * uint8info = np.iinfo(np.uint8) # <<<<<<<<<<<<<< + * na_values = { + * np.float64 : np.nan, + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_uint8info = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1812 + * uint16info = np.iinfo(np.uint16) + * uint8info = np.iinfo(np.uint8) + * na_values = { # <<<<<<<<<<<<<< + * np.float64 : np.nan, + * np.int64 : int64info.min, + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/parser.pyx":1813 + * uint8info = np.iinfo(np.uint8) + * na_values = { + * np.float64 : np.nan, # <<<<<<<<<<<<<< + * np.int64 : int64info.min, + * np.int32 : int32info.min, + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1814 + * na_values = { + * np.float64 : np.nan, + * np.int64 : int64info.min, # <<<<<<<<<<<<<< + * np.int32 : int32info.min, + * np.int16 : int16info.min, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_int64info, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1815 + * np.float64 : np.nan, + * np.int64 : int64info.min, + * np.int32 : int32info.min, # <<<<<<<<<<<<<< + * np.int16 : int16info.min, + * np.int8 : int8info.min, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_int32info, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1816 + * np.int64 : int64info.min, + * np.int32 : int32info.min, + * np.int16 : int16info.min, # <<<<<<<<<<<<<< + * np.int8 : int8info.min, + * np.uint64 : uint64info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_int16info, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1817 + * np.int32 : int32info.min, + * np.int16 : int16info.min, + * np.int8 : int8info.min, # <<<<<<<<<<<<<< + * np.uint64 : uint64info.max, + * np.uint32 : uint32info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_int8info, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1818 + * np.int16 : int16info.min, + * np.int8 : int8info.min, + * np.uint64 : uint64info.max, # <<<<<<<<<<<<<< + * np.uint32 : uint32info.max, + * np.uint16 : uint16info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint64info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1819 + * np.int8 : int8info.min, + * np.uint64 : uint64info.max, + * np.uint32 : uint32info.max, # <<<<<<<<<<<<<< + * np.uint16 : uint16info.max, + * np.uint8 : uint8info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint32info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1820 + * np.uint64 : uint64info.max, + * np.uint32 : uint32info.max, + * np.uint16 : uint16info.max, # <<<<<<<<<<<<<< + * np.uint8 : uint8info.max, + * np.bool_ : uint8info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint16info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1821 + * np.uint32 : uint32info.max, + * np.uint16 : uint16info.max, + * np.uint8 : uint8info.max, # <<<<<<<<<<<<<< + * np.bool_ : uint8info.max, + * np.object_ : np.nan # oof + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint8info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1822 + * np.uint16 : uint16info.max, + * np.uint8 : uint8info.max, + * np.bool_ : uint8info.max, # <<<<<<<<<<<<<< + * np.object_ : np.nan # oof + * } + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint8info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1823 + * np.uint8 : uint8info.max, + * np.bool_ : uint8info.max, + * np.object_ : np.nan # oof # <<<<<<<<<<<<<< + * } + * return na_values + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_na_values = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1825 + * np.object_ : np.nan # oof + * } + * return na_values # <<<<<<<<<<<<<< + * + * na_values = _compute_na_values() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_na_values); + __pyx_r = __pyx_v_na_values; + goto __pyx_L0; + + /* "pandas/parser.pyx":1803 + * + * # NA values + * def _compute_na_values(): # <<<<<<<<<<<<<< + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.parser._compute_na_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_int64info); + __Pyx_XDECREF(__pyx_v_int32info); + __Pyx_XDECREF(__pyx_v_int16info); + __Pyx_XDECREF(__pyx_v_int8info); + __Pyx_XDECREF(__pyx_v_uint64info); + __Pyx_XDECREF(__pyx_v_uint32info); + __Pyx_XDECREF(__pyx_v_uint16info); + __Pyx_XDECREF(__pyx_v_uint8info); + __Pyx_XDECREF(__pyx_v_na_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1833 + * + * + * cdef _apply_converter(object f, parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * char* c_encoding): + */ + +static PyObject *__pyx_f_6pandas_6parser__apply_converter(PyObject *__pyx_v_f, parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, char *__pyx_v_c_encoding) { + Py_ssize_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + char *__pyx_v_errors; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + size_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject **__pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_apply_converter", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1842 + * coliter_t it + * char *word + * char *errors = "strict" # <<<<<<<<<<<<<< + * ndarray[object] result + * object val + */ + __pyx_v_errors = __pyx_k_strict; + + /* "pandas/parser.pyx":1846 + * object val + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.object_) + * + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1847 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) # <<<<<<<<<<<<<< + * + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1849 + * result = np.empty(lines, dtype=np.object_) + * + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if not PY3 and c_encoding == NULL: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1851 + * coliter_setup(&it, parser, col, line_start) + * + * if not PY3 and c_encoding == NULL: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_11 = ((!(__pyx_v_6pandas_6parser_PY3 != 0)) != 0); + if (__pyx_t_11) { + __pyx_t_12 = ((__pyx_v_c_encoding == NULL) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_11; + } + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1852 + * + * if not PY3 and c_encoding == NULL: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * val = PyBytes_FromString(word) + */ + __pyx_t_14 = __pyx_v_lines; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/parser.pyx":1853 + * if not PY3 and c_encoding == NULL: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * val = PyBytes_FromString(word) + * result[i] = f(val) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1854 + * for i in range(lines): + * word = COLITER_NEXT(it) + * val = PyBytes_FromString(word) # <<<<<<<<<<<<<< + * result[i] = f(val) + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): + */ + __pyx_t_5 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1855 + * word = COLITER_NEXT(it) + * val = PyBytes_FromString(word) + * result[i] = f(val) # <<<<<<<<<<<<<< + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): + * for i in range(lines): + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_17); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_17); + *__pyx_t_17 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_17); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + goto __pyx_L3; + } + + /* "pandas/parser.pyx":1856 + * val = PyBytes_FromString(word) + * result[i] = f(val) + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + if (__pyx_v_6pandas_6parser_PY3) { + __pyx_t_13 = (__pyx_v_c_encoding == NULL); + __pyx_t_11 = __pyx_t_13; + } else { + __pyx_t_11 = __pyx_v_6pandas_6parser_PY3; + } + if (!__pyx_t_11) { + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c_encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b_utf_8, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __pyx_t_13; + } else { + __pyx_t_12 = __pyx_t_11; + } + if (__pyx_t_12) { + + /* "pandas/parser.pyx":1857 + * result[i] = f(val) + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * val = PyUnicode_FromString(word) + */ + __pyx_t_14 = __pyx_v_lines; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/parser.pyx":1858 + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * val = PyUnicode_FromString(word) + * result[i] = f(val) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1859 + * for i in range(lines): + * word = COLITER_NEXT(it) + * val = PyUnicode_FromString(word) # <<<<<<<<<<<<<< + * result[i] = f(val) + * else: + */ + __pyx_t_1 = PyUnicode_FromString(__pyx_v_word); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1860 + * word = COLITER_NEXT(it) + * val = PyUnicode_FromString(word) + * result[i] = f(val) # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_17); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_17); + *__pyx_t_17 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_17); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1862 + * result[i] = f(val) + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * val = PyUnicode_Decode(word, strlen(word), + */ + __pyx_t_14 = __pyx_v_lines; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/parser.pyx":1863 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * val = PyUnicode_Decode(word, strlen(word), + * c_encoding, errors) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1864 + * for i in range(lines): + * word = COLITER_NEXT(it) + * val = PyUnicode_Decode(word, strlen(word), # <<<<<<<<<<<<<< + * c_encoding, errors) + * result[i] = f(val) + */ + __pyx_t_5 = PyUnicode_Decode(__pyx_v_word, strlen(__pyx_v_word), __pyx_v_c_encoding, __pyx_v_errors); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1866 + * val = PyUnicode_Decode(word, strlen(word), + * c_encoding, errors) + * result[i] = f(val) # <<<<<<<<<<<<<< + * + * return lib.maybe_convert_objects(result) + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_17); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_17); + *__pyx_t_17 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_17); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1868 + * result[i] = f(val) + * + * return lib.maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1833 + * + * + * cdef _apply_converter(object f, parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * char* c_encoding): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._apply_converter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1871 + * + * + * def _to_structured_array(dict columns, object names): # <<<<<<<<<<<<<< + * cdef: + * ndarray recs, column + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_13_to_structured_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_13_to_structured_array = {__Pyx_NAMESTR("_to_structured_array"), (PyCFunction)__pyx_pw_6pandas_6parser_13_to_structured_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_13_to_structured_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_columns = 0; + PyObject *__pyx_v_names = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_to_structured_array (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_columns,&__pyx_n_s_names,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_names)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_to_structured_array", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_to_structured_array") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_columns = ((PyObject*)values[0]); + __pyx_v_names = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_to_structured_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser._to_structured_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_columns), (&PyDict_Type), 1, "columns", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_6parser_12_to_structured_array(__pyx_self, __pyx_v_columns, __pyx_v_names); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_12_to_structured_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_names) { + PyArrayObject *__pyx_v_recs = 0; + PyArrayObject *__pyx_v_column = 0; + PyArray_Descr *__pyx_v_dt = 0; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_fnames = 0; + PyObject *__pyx_v_field_type = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_offset; + Py_ssize_t __pyx_v_nfields; + Py_ssize_t __pyx_v_length; + int __pyx_v_stride; + int __pyx_v_elsize; + char *__pyx_v_buf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_to_structured_array", 0); + __Pyx_INCREF(__pyx_v_names); + + /* "pandas/parser.pyx":1882 + * char *buf + * + * if names is None: # <<<<<<<<<<<<<< + * names = ['%d' % i for i in range(len(columns))] + * else: + */ + __pyx_t_1 = (__pyx_v_names == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1883 + * + * if names is None: + * names = ['%d' % i for i in range(len(columns))] # <<<<<<<<<<<<<< + * else: + * # single line header + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyDict_Size(__pyx_v_columns); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF_SET(__pyx_v_names, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1886 + * else: + * # single line header + * names = names[0] # <<<<<<<<<<<<<< + * + * dt = np.dtype([(str(name), columns[i].dtype) + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_names, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_names, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":1888 + * names = names[0] + * + * dt = np.dtype([(str(name), columns[i].dtype) # <<<<<<<<<<<<<< + * for i, name in enumerate(names)]) + * fnames = dt.names + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1889 + * + * dt = np.dtype([(str(name), columns[i].dtype) + * for i, name in enumerate(names)]) # <<<<<<<<<<<<<< + * fnames = dt.names + * fields = dt.fields + */ + if (PyList_CheckExact(__pyx_v_names) || PyTuple_CheckExact(__pyx_v_names)) { + __pyx_t_6 = __pyx_v_names; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_6); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_i = __pyx_t_4; + __pyx_t_4 = (__pyx_t_4 + 1); + + /* "pandas/parser.pyx":1888 + * names = names[0] + * + * dt = np.dtype([(str(name), columns[i].dtype) # <<<<<<<<<<<<<< + * for i, name in enumerate(names)]) + * fnames = dt.names + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_columns, __pyx_t_9); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_10 = 0; + __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dt = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1890 + * dt = np.dtype([(str(name), columns[i].dtype) + * for i, name in enumerate(names)]) + * fnames = dt.names # <<<<<<<<<<<<<< + * fields = dt.fields + * + */ + __pyx_t_3 = __pyx_v_dt->names; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_fnames = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1891 + * for i, name in enumerate(names)]) + * fnames = dt.names + * fields = dt.fields # <<<<<<<<<<<<<< + * + * nfields = len(fields) + */ + if (!(likely(PyDict_CheckExact(__pyx_v_dt->fields))||((__pyx_v_dt->fields) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_dt->fields)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_dt->fields; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_fields = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1893 + * fields = dt.fields + * + * nfields = len(fields) # <<<<<<<<<<<<<< + * + * if PY3: + */ + if (unlikely(__pyx_v_fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyDict_Size(__pyx_v_fields); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nfields = __pyx_t_4; + + /* "pandas/parser.pyx":1895 + * nfields = len(fields) + * + * if PY3: # <<<<<<<<<<<<<< + * length = len(list(columns.values())[0]) + * else: + */ + __pyx_t_2 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1896 + * + * if PY3: + * length = len(list(columns.values())[0]) # <<<<<<<<<<<<<< + * else: + * length = len(columns.values()[0]) + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyDict_Values(__pyx_v_columns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_length = __pyx_t_4; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/parser.pyx":1898 + * length = len(list(columns.values())[0]) + * else: + * length = len(columns.values()[0]) # <<<<<<<<<<<<<< + * + * stride = dt.itemsize + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_PyDict_Values(__pyx_v_columns); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_length = __pyx_t_4; + } + __pyx_L8:; + + /* "pandas/parser.pyx":1900 + * length = len(columns.values()[0]) + * + * stride = dt.itemsize # <<<<<<<<<<<<<< + * + * # start = time.time() + */ + __pyx_t_12 = __pyx_v_dt->elsize; + __pyx_v_stride = __pyx_t_12; + + /* "pandas/parser.pyx":1905 + * + * # we own the data + * buf = malloc(length * stride) # <<<<<<<<<<<<<< + * + * recs = util.sarr_from_data(dt, length, buf) + */ + __pyx_v_buf = ((char *)malloc((__pyx_v_length * __pyx_v_stride))); + + /* "pandas/parser.pyx":1907 + * buf = malloc(length * stride) + * + * recs = util.sarr_from_data(dt, length, buf) # <<<<<<<<<<<<<< + * assert(recs.flags.owndata) + * + */ + __pyx_t_3 = sarr_from_data(__pyx_v_dt, __pyx_v_length, __pyx_v_buf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_recs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1908 + * + * recs = util.sarr_from_data(dt, length, buf) + * assert(recs.flags.owndata) # <<<<<<<<<<<<<< + * + * # buf = recs.data + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_recs), __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_owndata); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/parser.pyx":1914 + * # print 'took %.4f' % (end - start) + * + * for i in range(nfields): # <<<<<<<<<<<<<< + * # start = time.clock() + * # name = names[i] + */ + __pyx_t_4 = __pyx_v_nfields; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/parser.pyx":1919 + * + * # XXX + * field_type = fields[fnames[i]] # <<<<<<<<<<<<<< + * + * # (dtype, stride) tuple + */ + if (unlikely(__pyx_v_fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_fnames, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_fields, __pyx_t_6); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_field_type, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1922 + * + * # (dtype, stride) tuple + * offset = field_type[1] # <<<<<<<<<<<<<< + * elsize = field_type[0].itemsize + * column = columns[i] + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_field_type, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_offset = __pyx_t_13; + + /* "pandas/parser.pyx":1923 + * # (dtype, stride) tuple + * offset = field_type[1] + * elsize = field_type[0].itemsize # <<<<<<<<<<<<<< + * column = columns[i] + * + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_field_type, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_elsize = __pyx_t_12; + + /* "pandas/parser.pyx":1924 + * offset = field_type[1] + * elsize = field_type[0].itemsize + * column = columns[i] # <<<<<<<<<<<<<< + * + * _fill_structured_column(buf + offset, column.data, + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_columns, __pyx_t_6); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_column, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1928 + * _fill_structured_column(buf + offset, column.data, + * elsize, stride, length, + * field_type[0] == np.object_) # <<<<<<<<<<<<<< + * + * # print 'Transfer of %s took %.4f' % (str(field_type), + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_field_type, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_object_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1926 + * column = columns[i] + * + * _fill_structured_column(buf + offset, column.data, # <<<<<<<<<<<<<< + * elsize, stride, length, + * field_type[0] == np.object_) + */ + __pyx_t_6 = __pyx_f_6pandas_6parser__fill_structured_column((__pyx_v_buf + __pyx_v_offset), ((char *)__pyx_v_column->data), __pyx_v_elsize, __pyx_v_stride, __pyx_v_length, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "pandas/parser.pyx":1933 + * # time.clock() - start) + * + * return recs # <<<<<<<<<<<<<< + * + * cdef _fill_structured_column(char *dst, char* src, int elsize, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_recs)); + __pyx_r = ((PyObject *)__pyx_v_recs); + goto __pyx_L0; + + /* "pandas/parser.pyx":1871 + * + * + * def _to_structured_array(dict columns, object names): # <<<<<<<<<<<<<< + * cdef: + * ndarray recs, column + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.parser._to_structured_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_recs); + __Pyx_XDECREF((PyObject *)__pyx_v_column); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_fnames); + __Pyx_XDECREF(__pyx_v_field_type); + __Pyx_XDECREF(__pyx_v_names); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1935 + * return recs + * + * cdef _fill_structured_column(char *dst, char* src, int elsize, # <<<<<<<<<<<<<< + * int stride, int length, bint incref): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__fill_structured_column(char *__pyx_v_dst, char *__pyx_v_src, int __pyx_v_elsize, int __pyx_v_stride, int __pyx_v_length, int __pyx_v_incref) { + CYTHON_UNUSED size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("_fill_structured_column", 0); + + /* "pandas/parser.pyx":1940 + * size_t i + * + * if incref: # <<<<<<<<<<<<<< + * util.transfer_object_column(dst, src, stride, length) + * else: + */ + __pyx_t_1 = (__pyx_v_incref != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1941 + * + * if incref: + * util.transfer_object_column(dst, src, stride, length) # <<<<<<<<<<<<<< + * else: + * for i in range(length): + */ + transfer_object_column(__pyx_v_dst, __pyx_v_src, __pyx_v_stride, __pyx_v_length); + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1943 + * util.transfer_object_column(dst, src, stride, length) + * else: + * for i in range(length): # <<<<<<<<<<<<<< + * memcpy(dst, src, elsize) + * dst += stride + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/parser.pyx":1944 + * else: + * for i in range(length): + * memcpy(dst, src, elsize) # <<<<<<<<<<<<<< + * dst += stride + * src += elsize + */ + memcpy(__pyx_v_dst, __pyx_v_src, __pyx_v_elsize); + + /* "pandas/parser.pyx":1945 + * for i in range(length): + * memcpy(dst, src, elsize) + * dst += stride # <<<<<<<<<<<<<< + * src += elsize + * + */ + __pyx_v_dst = (__pyx_v_dst + __pyx_v_stride); + + /* "pandas/parser.pyx":1946 + * memcpy(dst, src, elsize) + * dst += stride + * src += elsize # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_src = (__pyx_v_src + __pyx_v_elsize); + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1935 + * return recs + * + * cdef _fill_structured_column(char *dst, char* src, int elsize, # <<<<<<<<<<<<<< + * int stride, int length, bint incref): + * cdef: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1950 + * + * + * def _maybe_encode(values): # <<<<<<<<<<<<<< + * if values is None: + * return [] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_15_maybe_encode(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_15_maybe_encode = {__Pyx_NAMESTR("_maybe_encode"), (PyCFunction)__pyx_pw_6pandas_6parser_15_maybe_encode, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_15_maybe_encode(PyObject *__pyx_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_maybe_encode (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_14_maybe_encode(__pyx_self, ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_14_maybe_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_encode", 0); + + /* "pandas/parser.pyx":1951 + * + * def _maybe_encode(values): + * if values is None: # <<<<<<<<<<<<<< + * return [] + * return [x.encode('utf-8') if isinstance(x, unicode) else x for x in values] + */ + __pyx_t_1 = (__pyx_v_values == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1952 + * def _maybe_encode(values): + * if values is None: + * return [] # <<<<<<<<<<<<<< + * return [x.encode('utf-8') if isinstance(x, unicode) else x for x in values] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1953 + * if values is None: + * return [] + * return [x.encode('utf-8') if isinstance(x, unicode) else x for x in values] # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) { + __pyx_t_4 = __pyx_v_values; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_2 = PyUnicode_Check(__pyx_v_x); + if ((__pyx_t_2 != 0)) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __Pyx_INCREF(__pyx_v_x); + __pyx_t_7 = __pyx_v_x; + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1950 + * + * + * def _maybe_encode(values): # <<<<<<<<<<<<<< + * if values is None: + * return [] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.parser._maybe_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d_2; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6pandas_6parser_TextReader __pyx_vtable_6pandas_6parser_TextReader; + +static PyObject *__pyx_tp_new_6pandas_6parser_TextReader(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_6parser_TextReader *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_6parser_TextReader *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_6parser_TextReader; + p->file_handle = Py_None; Py_INCREF(Py_None); + p->na_fvalues = Py_None; Py_INCREF(Py_None); + p->clocks = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->allow_leading_cols = Py_None; Py_INCREF(Py_None); + p->delimiter = Py_None; Py_INCREF(Py_None); + p->converters = Py_None; Py_INCREF(Py_None); + p->delim_whitespace = Py_None; Py_INCREF(Py_None); + p->na_values = Py_None; Py_INCREF(Py_None); + p->true_values = Py_None; Py_INCREF(Py_None); + p->false_values = Py_None; Py_INCREF(Py_None); + p->memory_map = Py_None; Py_INCREF(Py_None); + p->as_recarray = Py_None; Py_INCREF(Py_None); + p->header = Py_None; Py_INCREF(Py_None); + p->orig_header = Py_None; Py_INCREF(Py_None); + p->names = Py_None; Py_INCREF(Py_None); + p->header_start = Py_None; Py_INCREF(Py_None); + p->header_end = Py_None; Py_INCREF(Py_None); + p->index_col = Py_None; Py_INCREF(Py_None); + p->low_memory = Py_None; Py_INCREF(Py_None); + p->skiprows = Py_None; Py_INCREF(Py_None); + p->compact_ints = Py_None; Py_INCREF(Py_None); + p->use_unsigned = Py_None; Py_INCREF(Py_None); + p->dtype = Py_None; Py_INCREF(Py_None); + p->encoding = Py_None; Py_INCREF(Py_None); + p->compression = Py_None; Py_INCREF(Py_None); + p->mangle_dupe_cols = Py_None; Py_INCREF(Py_None); + p->tupleize_cols = Py_None; Py_INCREF(Py_None); + p->noconvert = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->usecols = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_6parser_10TextReader_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_6parser_TextReader(PyObject *o) { + struct __pyx_obj_6pandas_6parser_TextReader *p = (struct __pyx_obj_6pandas_6parser_TextReader *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_6parser_10TextReader_5__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->file_handle); + Py_CLEAR(p->na_fvalues); + Py_CLEAR(p->clocks); + Py_CLEAR(p->allow_leading_cols); + Py_CLEAR(p->delimiter); + Py_CLEAR(p->converters); + Py_CLEAR(p->delim_whitespace); + Py_CLEAR(p->na_values); + Py_CLEAR(p->true_values); + Py_CLEAR(p->false_values); + Py_CLEAR(p->memory_map); + Py_CLEAR(p->as_recarray); + Py_CLEAR(p->header); + Py_CLEAR(p->orig_header); + Py_CLEAR(p->names); + Py_CLEAR(p->header_start); + Py_CLEAR(p->header_end); + Py_CLEAR(p->index_col); + Py_CLEAR(p->low_memory); + Py_CLEAR(p->skiprows); + Py_CLEAR(p->compact_ints); + Py_CLEAR(p->use_unsigned); + Py_CLEAR(p->dtype); + Py_CLEAR(p->encoding); + Py_CLEAR(p->compression); + Py_CLEAR(p->mangle_dupe_cols); + Py_CLEAR(p->tupleize_cols); + Py_CLEAR(p->noconvert); + Py_CLEAR(p->usecols); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_6parser_TextReader(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_6parser_TextReader *p = (struct __pyx_obj_6pandas_6parser_TextReader *)o; + if (p->file_handle) { + e = (*v)(p->file_handle, a); if (e) return e; + } + if (p->na_fvalues) { + e = (*v)(p->na_fvalues, a); if (e) return e; + } + if (p->clocks) { + e = (*v)(p->clocks, a); if (e) return e; + } + if (p->allow_leading_cols) { + e = (*v)(p->allow_leading_cols, a); if (e) return e; + } + if (p->delimiter) { + e = (*v)(p->delimiter, a); if (e) return e; + } + if (p->converters) { + e = (*v)(p->converters, a); if (e) return e; + } + if (p->delim_whitespace) { + e = (*v)(p->delim_whitespace, a); if (e) return e; + } + if (p->na_values) { + e = (*v)(p->na_values, a); if (e) return e; + } + if (p->true_values) { + e = (*v)(p->true_values, a); if (e) return e; + } + if (p->false_values) { + e = (*v)(p->false_values, a); if (e) return e; + } + if (p->memory_map) { + e = (*v)(p->memory_map, a); if (e) return e; + } + if (p->as_recarray) { + e = (*v)(p->as_recarray, a); if (e) return e; + } + if (p->header) { + e = (*v)(p->header, a); if (e) return e; + } + if (p->orig_header) { + e = (*v)(p->orig_header, a); if (e) return e; + } + if (p->names) { + e = (*v)(p->names, a); if (e) return e; + } + if (p->header_start) { + e = (*v)(p->header_start, a); if (e) return e; + } + if (p->header_end) { + e = (*v)(p->header_end, a); if (e) return e; + } + if (p->index_col) { + e = (*v)(p->index_col, a); if (e) return e; + } + if (p->low_memory) { + e = (*v)(p->low_memory, a); if (e) return e; + } + if (p->skiprows) { + e = (*v)(p->skiprows, a); if (e) return e; + } + if (p->compact_ints) { + e = (*v)(p->compact_ints, a); if (e) return e; + } + if (p->use_unsigned) { + e = (*v)(p->use_unsigned, a); if (e) return e; + } + if (p->dtype) { + e = (*v)(p->dtype, a); if (e) return e; + } + if (p->encoding) { + e = (*v)(p->encoding, a); if (e) return e; + } + if (p->compression) { + e = (*v)(p->compression, a); if (e) return e; + } + if (p->mangle_dupe_cols) { + e = (*v)(p->mangle_dupe_cols, a); if (e) return e; + } + if (p->tupleize_cols) { + e = (*v)(p->tupleize_cols, a); if (e) return e; + } + if (p->noconvert) { + e = (*v)(p->noconvert, a); if (e) return e; + } + if (p->usecols) { + e = (*v)(p->usecols, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_6parser_TextReader(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_6parser_TextReader *p = (struct __pyx_obj_6pandas_6parser_TextReader *)o; + tmp = ((PyObject*)p->file_handle); + p->file_handle = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->na_fvalues); + p->na_fvalues = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->clocks); + p->clocks = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->allow_leading_cols); + p->allow_leading_cols = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->delimiter); + p->delimiter = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->converters); + p->converters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->delim_whitespace); + p->delim_whitespace = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->na_values); + p->na_values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->true_values); + p->true_values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->false_values); + p->false_values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->memory_map); + p->memory_map = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->as_recarray); + p->as_recarray = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->header); + p->header = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->orig_header); + p->orig_header = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->names); + p->names = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->header_start); + p->header_start = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->header_end); + p->header_end = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->index_col); + p->index_col = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->low_memory); + p->low_memory = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->skiprows); + p->skiprows = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->compact_ints); + p->compact_ints = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->use_unsigned); + p->use_unsigned = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dtype); + p->dtype = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->encoding); + p->encoding = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->compression); + p->compression = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->mangle_dupe_cols); + p->mangle_dupe_cols = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->tupleize_cols); + p->tupleize_cols = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->noconvert); + p->noconvert = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->usecols); + p->usecols = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_leading_cols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12leading_cols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_leading_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12leading_cols_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_table_width(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11table_width_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_table_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11table_width_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_skip_footer(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11skip_footer_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_skip_footer(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11skip_footer_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_buffer_lines(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_buffer_lines(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_allow_leading_cols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_allow_leading_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_delimiter(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_9delimiter_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_delimiter(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_9delimiter_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_9delimiter_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_converters(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_10converters_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_converters(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_10converters_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_10converters_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_delim_whitespace(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_delim_whitespace(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_na_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_9na_values_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_na_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_9na_values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_9na_values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_true_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11true_values_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_true_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11true_values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_11true_values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_false_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12false_values_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_false_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12false_values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_12false_values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_memory_map(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_10memory_map_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_memory_map(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_10memory_map_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_10memory_map_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_as_recarray(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_as_recarray(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_header(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_6header_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_header(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_6header_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_6header_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_orig_header(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11orig_header_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_orig_header(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11orig_header_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_11orig_header_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_names(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_5names_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_names(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_5names_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_5names_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_header_start(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12header_start_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_header_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12header_start_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_12header_start_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_header_end(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_10header_end_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_header_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_10header_end_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_10header_end_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_index_col(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_9index_col_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_index_col(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_9index_col_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_9index_col_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_low_memory(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_10low_memory_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_low_memory(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_10low_memory_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_10low_memory_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_skiprows(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_8skiprows_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_skiprows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_8skiprows_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_8skiprows_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_compact_ints(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_compact_ints(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_use_unsigned(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_use_unsigned(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_dtype(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_5dtype_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_dtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_5dtype_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_5dtype_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_encoding(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_8encoding_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_encoding(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_8encoding_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_8encoding_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_compression(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11compression_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_compression(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11compression_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_11compression_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_mangle_dupe_cols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_mangle_dupe_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_tupleize_cols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_tupleize_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_noconvert(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_9noconvert_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_noconvert(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_9noconvert_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_9noconvert_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_usecols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_7usecols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_usecols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_7usecols_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_7usecols_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_6parser_TextReader[] = { + {__Pyx_NAMESTR("set_error_bad_lines"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_7set_error_bad_lines, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_9read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_6parser_10TextReader_8read)}, + {__Pyx_NAMESTR("debug_print"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_11debug_print, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_noconvert"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_13set_noconvert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("remove_noconvert"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_15remove_noconvert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_convert_column_data"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_17_convert_column_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_converter"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_19_get_converter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_6parser_TextReader[] = { + {(char *)"leading_cols", __pyx_getprop_6pandas_6parser_10TextReader_leading_cols, __pyx_setprop_6pandas_6parser_10TextReader_leading_cols, 0, 0}, + {(char *)"table_width", __pyx_getprop_6pandas_6parser_10TextReader_table_width, __pyx_setprop_6pandas_6parser_10TextReader_table_width, 0, 0}, + {(char *)"skip_footer", __pyx_getprop_6pandas_6parser_10TextReader_skip_footer, __pyx_setprop_6pandas_6parser_10TextReader_skip_footer, 0, 0}, + {(char *)"buffer_lines", __pyx_getprop_6pandas_6parser_10TextReader_buffer_lines, __pyx_setprop_6pandas_6parser_10TextReader_buffer_lines, 0, 0}, + {(char *)"allow_leading_cols", __pyx_getprop_6pandas_6parser_10TextReader_allow_leading_cols, __pyx_setprop_6pandas_6parser_10TextReader_allow_leading_cols, 0, 0}, + {(char *)"delimiter", __pyx_getprop_6pandas_6parser_10TextReader_delimiter, __pyx_setprop_6pandas_6parser_10TextReader_delimiter, 0, 0}, + {(char *)"converters", __pyx_getprop_6pandas_6parser_10TextReader_converters, __pyx_setprop_6pandas_6parser_10TextReader_converters, 0, 0}, + {(char *)"delim_whitespace", __pyx_getprop_6pandas_6parser_10TextReader_delim_whitespace, __pyx_setprop_6pandas_6parser_10TextReader_delim_whitespace, 0, 0}, + {(char *)"na_values", __pyx_getprop_6pandas_6parser_10TextReader_na_values, __pyx_setprop_6pandas_6parser_10TextReader_na_values, 0, 0}, + {(char *)"true_values", __pyx_getprop_6pandas_6parser_10TextReader_true_values, __pyx_setprop_6pandas_6parser_10TextReader_true_values, 0, 0}, + {(char *)"false_values", __pyx_getprop_6pandas_6parser_10TextReader_false_values, __pyx_setprop_6pandas_6parser_10TextReader_false_values, 0, 0}, + {(char *)"memory_map", __pyx_getprop_6pandas_6parser_10TextReader_memory_map, __pyx_setprop_6pandas_6parser_10TextReader_memory_map, 0, 0}, + {(char *)"as_recarray", __pyx_getprop_6pandas_6parser_10TextReader_as_recarray, __pyx_setprop_6pandas_6parser_10TextReader_as_recarray, 0, 0}, + {(char *)"header", __pyx_getprop_6pandas_6parser_10TextReader_header, __pyx_setprop_6pandas_6parser_10TextReader_header, 0, 0}, + {(char *)"orig_header", __pyx_getprop_6pandas_6parser_10TextReader_orig_header, __pyx_setprop_6pandas_6parser_10TextReader_orig_header, 0, 0}, + {(char *)"names", __pyx_getprop_6pandas_6parser_10TextReader_names, __pyx_setprop_6pandas_6parser_10TextReader_names, 0, 0}, + {(char *)"header_start", __pyx_getprop_6pandas_6parser_10TextReader_header_start, __pyx_setprop_6pandas_6parser_10TextReader_header_start, 0, 0}, + {(char *)"header_end", __pyx_getprop_6pandas_6parser_10TextReader_header_end, __pyx_setprop_6pandas_6parser_10TextReader_header_end, 0, 0}, + {(char *)"index_col", __pyx_getprop_6pandas_6parser_10TextReader_index_col, __pyx_setprop_6pandas_6parser_10TextReader_index_col, 0, 0}, + {(char *)"low_memory", __pyx_getprop_6pandas_6parser_10TextReader_low_memory, __pyx_setprop_6pandas_6parser_10TextReader_low_memory, 0, 0}, + {(char *)"skiprows", __pyx_getprop_6pandas_6parser_10TextReader_skiprows, __pyx_setprop_6pandas_6parser_10TextReader_skiprows, 0, 0}, + {(char *)"compact_ints", __pyx_getprop_6pandas_6parser_10TextReader_compact_ints, __pyx_setprop_6pandas_6parser_10TextReader_compact_ints, 0, 0}, + {(char *)"use_unsigned", __pyx_getprop_6pandas_6parser_10TextReader_use_unsigned, __pyx_setprop_6pandas_6parser_10TextReader_use_unsigned, 0, 0}, + {(char *)"dtype", __pyx_getprop_6pandas_6parser_10TextReader_dtype, __pyx_setprop_6pandas_6parser_10TextReader_dtype, 0, 0}, + {(char *)"encoding", __pyx_getprop_6pandas_6parser_10TextReader_encoding, __pyx_setprop_6pandas_6parser_10TextReader_encoding, 0, 0}, + {(char *)"compression", __pyx_getprop_6pandas_6parser_10TextReader_compression, __pyx_setprop_6pandas_6parser_10TextReader_compression, 0, 0}, + {(char *)"mangle_dupe_cols", __pyx_getprop_6pandas_6parser_10TextReader_mangle_dupe_cols, __pyx_setprop_6pandas_6parser_10TextReader_mangle_dupe_cols, 0, 0}, + {(char *)"tupleize_cols", __pyx_getprop_6pandas_6parser_10TextReader_tupleize_cols, __pyx_setprop_6pandas_6parser_10TextReader_tupleize_cols, 0, 0}, + {(char *)"noconvert", __pyx_getprop_6pandas_6parser_10TextReader_noconvert, __pyx_setprop_6pandas_6parser_10TextReader_noconvert, 0, 0}, + {(char *)"usecols", __pyx_getprop_6pandas_6parser_10TextReader_usecols, __pyx_setprop_6pandas_6parser_10TextReader_usecols, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_6parser_TextReader = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.parser.TextReader"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_6parser_TextReader), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_6parser_TextReader, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n\n # source: StringIO or file object\n\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_6parser_TextReader, /*tp_traverse*/ + __pyx_tp_clear_6pandas_6parser_TextReader, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_6parser_TextReader, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_6parser_TextReader, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_6parser_10TextReader_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_6parser_TextReader, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("parser"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0}, + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_kp_b_1_IND, __pyx_k_1_IND, sizeof(__pyx_k_1_IND), 0, 0, 0, 0}, + {&__pyx_kp_b_1_IND_2, __pyx_k_1_IND_2, sizeof(__pyx_k_1_IND_2), 0, 0, 0, 0}, + {&__pyx_kp_b_1_QNAN, __pyx_k_1_QNAN, sizeof(__pyx_k_1_QNAN), 0, 0, 0, 0}, + {&__pyx_kp_b_1_QNAN_2, __pyx_k_1_QNAN_2, sizeof(__pyx_k_1_QNAN_2), 0, 0, 0, 0}, + {&__pyx_n_s_BZ2File, __pyx_k_BZ2File, sizeof(__pyx_k_BZ2File), 0, 0, 1, 1}, + {&__pyx_n_s_BufferedReader, __pyx_k_BufferedReader, sizeof(__pyx_k_BufferedReader), 0, 0, 1, 1}, + {&__pyx_n_s_CParserError, __pyx_k_CParserError, sizeof(__pyx_k_CParserError), 0, 0, 1, 1}, + {&__pyx_kp_s_Cannot_handle_open_unicode_files, __pyx_k_Cannot_handle_open_unicode_files, sizeof(__pyx_k_Cannot_handle_open_unicode_files), 0, 0, 1, 0}, + {&__pyx_kp_s_Columns_s_have_mixed_types, __pyx_k_Columns_s_have_mixed_types, sizeof(__pyx_k_Columns_s_have_mixed_types), 0, 0, 1, 0}, + {&__pyx_kp_s_Conversion_to_structured_array, __pyx_k_Conversion_to_structured_array, sizeof(__pyx_k_Conversion_to_structured_array), 0, 0, 1, 0}, + {&__pyx_n_s_DEFAULT_CHUNKSIZE, __pyx_k_DEFAULT_CHUNKSIZE, sizeof(__pyx_k_DEFAULT_CHUNKSIZE), 0, 0, 1, 1}, + {&__pyx_n_s_DtypeWarning, __pyx_k_DtypeWarning, sizeof(__pyx_k_DtypeWarning), 0, 0, 1, 1}, + {&__pyx_kp_s_Error_tokenizing_data, __pyx_k_Error_tokenizing_data, sizeof(__pyx_k_Error_tokenizing_data), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_s_Expected_file_path_name_or_file, __pyx_k_Expected_file_path_name_or_file, sizeof(__pyx_k_Expected_file_path_name_or_file), 0, 0, 1, 0}, + {&__pyx_n_b_FALSE, __pyx_k_FALSE, sizeof(__pyx_k_FALSE), 0, 0, 0, 1}, + {&__pyx_n_b_False, __pyx_k_False, sizeof(__pyx_k_False), 0, 0, 0, 1}, + {&__pyx_kp_s_File_s_does_not_exist, __pyx_k_File_s_does_not_exist, sizeof(__pyx_k_File_s_does_not_exist), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_GzipFile, __pyx_k_GzipFile, sizeof(__pyx_k_GzipFile), 0, 0, 1, 1}, + {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Initializing_from_file_failed, __pyx_k_Initializing_from_file_failed, sizeof(__pyx_k_Initializing_from_file_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_Initializing_parser_from_file_li, __pyx_k_Initializing_parser_from_file_li, sizeof(__pyx_k_Initializing_parser_from_file_li), 0, 0, 1, 0}, + {&__pyx_kp_s_Integer_column_has_NA_values, __pyx_k_Integer_column_has_NA_values, sizeof(__pyx_k_Integer_column_has_NA_values), 0, 0, 1, 0}, + {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1}, + {&__pyx_kp_s_Must_be_all_encoded_bytes, __pyx_k_Must_be_all_encoded_bytes, sizeof(__pyx_k_Must_be_all_encoded_bytes), 0, 0, 1, 0}, + {&__pyx_n_b_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 0, 1}, + {&__pyx_n_s_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 1, 1}, + {&__pyx_kp_b_NA_2, __pyx_k_NA_2, sizeof(__pyx_k_NA_2), 0, 0, 0, 0}, + {&__pyx_n_s_NA_VALUES, __pyx_k_NA_VALUES, sizeof(__pyx_k_NA_VALUES), 0, 0, 1, 1}, + {&__pyx_n_b_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 0, 0, 1}, + {&__pyx_kp_b_N_A_N_A, __pyx_k_N_A_N_A, sizeof(__pyx_k_N_A_N_A), 0, 0, 0, 0}, + {&__pyx_n_b_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 0, 1}, + {&__pyx_n_s_NameError, __pyx_k_NameError, sizeof(__pyx_k_NameError), 0, 0, 1, 1}, + {&__pyx_kp_s_No_columns_to_parse_from_file, __pyx_k_No_columns_to_parse_from_file, sizeof(__pyx_k_No_columns_to_parse_from_file), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1}, + {&__pyx_kp_s_O8, __pyx_k_O8, sizeof(__pyx_k_O8), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_comment_characters, __pyx_k_Only_length_1_comment_characters, sizeof(__pyx_k_Only_length_1_comment_characters), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_decimal_markers_su, __pyx_k_Only_length_1_decimal_markers_su, sizeof(__pyx_k_Only_length_1_decimal_markers_su), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_escapes_supported, __pyx_k_Only_length_1_escapes_supported, sizeof(__pyx_k_Only_length_1_escapes_supported), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_line_terminators_s, __pyx_k_Only_length_1_line_terminators_s, sizeof(__pyx_k_Only_length_1_line_terminators_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_thousands_markers, __pyx_k_Only_length_1_thousands_markers, sizeof(__pyx_k_Only_length_1_thousands_markers), 0, 0, 1, 0}, + {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, + {&__pyx_kp_s_Parser_memory_cleanup, __pyx_k_Parser_memory_cleanup, sizeof(__pyx_k_Parser_memory_cleanup), 0, 0, 1, 0}, + {&__pyx_kp_s_Passed_header_names_mismatches_u, __pyx_k_Passed_header_names_mismatches_u, sizeof(__pyx_k_Passed_header_names_mismatches_u), 0, 0, 1, 0}, + {&__pyx_kp_s_Passed_header_s_but_only_d_lines, __pyx_k_Passed_header_s_but_only_d_lines, sizeof(__pyx_k_Passed_header_s_but_only_d_lines), 0, 0, 1, 0}, + {&__pyx_kp_s_Python_cannot_read_bz2_from_open, __pyx_k_Python_cannot_read_bz2_from_open, sizeof(__pyx_k_Python_cannot_read_bz2_from_open), 0, 0, 1, 0}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_kp_s_S_d, __pyx_k_S_d, sizeof(__pyx_k_S_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Specify_dtype_option_on_import_o, __pyx_k_Specify_dtype_option_on_import_o, sizeof(__pyx_k_Specify_dtype_option_on_import_o), 0, 0, 1, 0}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_b_TRUE, __pyx_k_TRUE, sizeof(__pyx_k_TRUE), 0, 0, 0, 1}, + {&__pyx_n_s_TextIOWrapper, __pyx_k_TextIOWrapper, sizeof(__pyx_k_TextIOWrapper), 0, 0, 1, 1}, + {&__pyx_n_s_Tokenization, __pyx_k_Tokenization, sizeof(__pyx_k_Tokenization), 0, 0, 1, 1}, + {&__pyx_kp_s_Too_many_columns_specified_expec, __pyx_k_Too_many_columns_specified_expec, sizeof(__pyx_k_Too_many_columns_specified_expec), 0, 0, 1, 0}, + {&__pyx_n_b_True, __pyx_k_True, sizeof(__pyx_k_True), 0, 0, 0, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Type_conversion, __pyx_k_Type_conversion, sizeof(__pyx_k_Type_conversion), 0, 0, 1, 0}, + {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_parse_column_d, __pyx_k_Unable_to_parse_column_d, sizeof(__pyx_k_Unable_to_parse_column_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unnamed_d, __pyx_k_Unnamed_d, sizeof(__pyx_k_Unnamed_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unnamed_d_level__d, __pyx_k_Unnamed_d_level__d, sizeof(__pyx_k_Unnamed_d_level__d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_compression_type_s, __pyx_k_Unrecognized_compression_type_s, sizeof(__pyx_k_Unrecognized_compression_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_b__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 0, 0}, + {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0}, + {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, + {&__pyx_kp_s__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 1, 0}, + {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, + {&__pyx_n_s__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 0, 1, 1}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_allow_leading_cols, __pyx_k_allow_leading_cols, sizeof(__pyx_k_allow_leading_cols), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_arrs, __pyx_k_arrs, sizeof(__pyx_k_arrs), 0, 0, 1, 1}, + {&__pyx_n_s_as_recarray, __pyx_k_as_recarray, sizeof(__pyx_k_as_recarray), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_kp_s_b1, __pyx_k_b1, sizeof(__pyx_k_b1), 0, 0, 1, 0}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, + {&__pyx_n_s_buffer_lines, __pyx_k_buffer_lines, sizeof(__pyx_k_buffer_lines), 0, 0, 1, 1}, + {&__pyx_n_s_builtin, __pyx_k_builtin, sizeof(__pyx_k_builtin), 0, 0, 1, 1}, + {&__pyx_n_s_bz2, __pyx_k_bz2, sizeof(__pyx_k_bz2), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1}, + {&__pyx_n_s_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 0, 1, 1}, + {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1}, + {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1}, + {&__pyx_n_s_comment, __pyx_k_comment, sizeof(__pyx_k_comment), 0, 0, 1, 1}, + {&__pyx_n_s_common_type, __pyx_k_common_type, sizeof(__pyx_k_common_type), 0, 0, 1, 1}, + {&__pyx_n_s_compact_ints, __pyx_k_compact_ints, sizeof(__pyx_k_compact_ints), 0, 0, 1, 1}, + {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1}, + {&__pyx_n_s_compute_na_values, __pyx_k_compute_na_values, sizeof(__pyx_k_compute_na_values), 0, 0, 1, 1}, + {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, + {&__pyx_n_s_concatenate_chunks, __pyx_k_concatenate_chunks, sizeof(__pyx_k_concatenate_chunks), 0, 0, 1, 1}, + {&__pyx_n_s_convert_column_data, __pyx_k_convert_column_data, sizeof(__pyx_k_convert_column_data), 0, 0, 1, 1}, + {&__pyx_n_s_converters, __pyx_k_converters, sizeof(__pyx_k_converters), 0, 0, 1, 1}, + {&__pyx_kp_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 0}, + {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1}, + {&__pyx_n_s_delim_whitespace, __pyx_k_delim_whitespace, sizeof(__pyx_k_delim_whitespace), 0, 0, 1, 1}, + {&__pyx_n_s_delimiter, __pyx_k_delimiter, sizeof(__pyx_k_delimiter), 0, 0, 1, 1}, + {&__pyx_n_s_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_doublequote, __pyx_k_doublequote, sizeof(__pyx_k_doublequote), 0, 0, 1, 1}, + {&__pyx_n_s_downcast_int64, __pyx_k_downcast_int64, sizeof(__pyx_k_downcast_int64), 0, 0, 1, 1}, + {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtypes, __pyx_k_dtypes, sizeof(__pyx_k_dtypes), 0, 0, 1, 1}, + {&__pyx_n_s_elsize, __pyx_k_elsize, sizeof(__pyx_k_elsize), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_ensure_encoded, __pyx_k_ensure_encoded, sizeof(__pyx_k_ensure_encoded), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error_bad_lines, __pyx_k_error_bad_lines, sizeof(__pyx_k_error_bad_lines), 0, 0, 1, 1}, + {&__pyx_n_s_escapechar, __pyx_k_escapechar, sizeof(__pyx_k_escapechar), 0, 0, 1, 1}, + {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 1}, + {&__pyx_kp_s_f8_2, __pyx_k_f8_2, sizeof(__pyx_k_f8_2), 0, 0, 1, 0}, + {&__pyx_n_b_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 0, 1}, + {&__pyx_n_s_false_values, __pyx_k_false_values, sizeof(__pyx_k_false_values), 0, 0, 1, 1}, + {&__pyx_n_s_field_type, __pyx_k_field_type, sizeof(__pyx_k_field_type), 0, 0, 1, 1}, + {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_fileobj, __pyx_k_fileobj, sizeof(__pyx_k_fileobj), 0, 0, 1, 1}, + {&__pyx_n_s_find_common_type, __pyx_k_find_common_type, sizeof(__pyx_k_find_common_type), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_fnames, __pyx_k_fnames, sizeof(__pyx_k_fnames), 0, 0, 1, 1}, + {&__pyx_n_s_footer, __pyx_k_footer, sizeof(__pyx_k_footer), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_converter, __pyx_k_get_converter, sizeof(__pyx_k_get_converter), 0, 0, 1, 1}, + {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, + {&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1}, + {&__pyx_n_s_header_end, __pyx_k_header_end, sizeof(__pyx_k_header_end), 0, 0, 1, 1}, + {&__pyx_n_s_header_start, __pyx_k_header_start, sizeof(__pyx_k_header_start), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_kp_s_i8_2, __pyx_k_i8_2, sizeof(__pyx_k_i8_2), 0, 0, 1, 0}, + {&__pyx_n_s_iinfo, __pyx_k_iinfo, sizeof(__pyx_k_iinfo), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index_col, __pyx_k_index_col, sizeof(__pyx_k_index_col), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1}, + {&__pyx_n_s_int16info, __pyx_k_int16info, sizeof(__pyx_k_int16info), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int32info, __pyx_k_int32info, sizeof(__pyx_k_int32info), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int64info, __pyx_k_int64info, sizeof(__pyx_k_int64info), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_int8info, __pyx_k_int8info, sizeof(__pyx_k_int8info), 0, 0, 1, 1}, + {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_n_s_io_common, __pyx_k_io_common, sizeof(__pyx_k_io_common), 0, 0, 1, 1}, + {&__pyx_n_s_is_file_like, __pyx_k_is_file_like, sizeof(__pyx_k_is_file_like), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1}, + {&__pyx_n_s_lineterminator, __pyx_k_lineterminator, sizeof(__pyx_k_lineterminator), 0, 0, 1, 1}, + {&__pyx_n_s_low_memory, __pyx_k_low_memory, sizeof(__pyx_k_low_memory), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mangle_dupe_cols, __pyx_k_mangle_dupe_cols, sizeof(__pyx_k_mangle_dupe_cols), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_mask_2, __pyx_k_mask_2, sizeof(__pyx_k_mask_2), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_objects, __pyx_k_maybe_convert_objects, sizeof(__pyx_k_maybe_convert_objects), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_encode, __pyx_k_maybe_encode, sizeof(__pyx_k_maybe_encode), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_upcast, __pyx_k_maybe_upcast, sizeof(__pyx_k_maybe_upcast), 0, 0, 1, 1}, + {&__pyx_n_s_memory_map, __pyx_k_memory_map, sizeof(__pyx_k_memory_map), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_mn, __pyx_k_mn, sizeof(__pyx_k_mn), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_mx, __pyx_k_mx, sizeof(__pyx_k_mx), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_na_count, __pyx_k_na_count, sizeof(__pyx_k_na_count), 0, 0, 1, 1}, + {&__pyx_n_s_na_filter, __pyx_k_na_filter, sizeof(__pyx_k_na_filter), 0, 0, 1, 1}, + {&__pyx_n_s_na_fvalues, __pyx_k_na_fvalues, sizeof(__pyx_k_na_fvalues), 0, 0, 1, 1}, + {&__pyx_n_s_na_value, __pyx_k_na_value, sizeof(__pyx_k_na_value), 0, 0, 1, 1}, + {&__pyx_n_s_na_values, __pyx_k_na_values, sizeof(__pyx_k_na_values), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1}, + {&__pyx_n_b_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 0, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_nfields, __pyx_k_nfields, sizeof(__pyx_k_nfields), 0, 0, 1, 1}, + {&__pyx_kp_s_no_error_message_set, __pyx_k_no_error_message_set, sizeof(__pyx_k_no_error_message_set), 0, 0, 1, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_kp_s_only_length_1_separators_exclude, __pyx_k_only_length_1_separators_exclude, sizeof(__pyx_k_only_length_1_separators_exclude), 0, 0, 1, 0}, + {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_owndata, __pyx_k_owndata, sizeof(__pyx_k_owndata), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_lib, __pyx_k_pandas_lib, sizeof(__pyx_k_pandas_lib), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_parser, __pyx_k_pandas_parser, sizeof(__pyx_k_pandas_parser), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_putmask, __pyx_k_putmask, sizeof(__pyx_k_putmask), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_quotechar, __pyx_k_quotechar, sizeof(__pyx_k_quotechar), 0, 0, 1, 1}, + {&__pyx_n_s_quoting, __pyx_k_quoting, sizeof(__pyx_k_quoting), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, + {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, + {&__pyx_n_s_recs, __pyx_k_recs, sizeof(__pyx_k_recs), 0, 0, 1, 1}, + {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1}, + {&__pyx_kp_s_s_C_error, __pyx_k_s_C_error, sizeof(__pyx_k_s_C_error), 0, 0, 1, 0}, + {&__pyx_kp_s_s_d, __pyx_k_s_d, sizeof(__pyx_k_s_d), 0, 0, 1, 0}, + {&__pyx_kp_s_s_len_of_d, __pyx_k_s_len_of_d, sizeof(__pyx_k_s_len_of_d), 0, 0, 1, 0}, + {&__pyx_kp_s_s_took_2f_ms, __pyx_k_s_took_2f_ms, sizeof(__pyx_k_s_took_2f_ms), 0, 0, 1, 0}, + {&__pyx_n_s_skip_footer, __pyx_k_skip_footer, sizeof(__pyx_k_skip_footer), 0, 0, 1, 1}, + {&__pyx_kp_s_skip_footer_can_only_be_used_to, __pyx_k_skip_footer_can_only_be_used_to, sizeof(__pyx_k_skip_footer_can_only_be_used_to), 0, 0, 1, 0}, + {&__pyx_n_s_skipinitialspace, __pyx_k_skipinitialspace, sizeof(__pyx_k_skipinitialspace), 0, 0, 1, 1}, + {&__pyx_n_s_skiprows, __pyx_k_skiprows, sizeof(__pyx_k_skiprows), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_stride, __pyx_k_stride, sizeof(__pyx_k_stride), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_kp_s_the_dtype_s_is_not_supported_for, __pyx_k_the_dtype_s_is_not_supported_for, sizeof(__pyx_k_the_dtype_s_is_not_supported_for), 0, 0, 1, 0}, + {&__pyx_kp_s_the_dtype_s_is_not_supported_for_2, __pyx_k_the_dtype_s_is_not_supported_for_2, sizeof(__pyx_k_the_dtype_s_is_not_supported_for_2), 0, 0, 1, 0}, + {&__pyx_n_s_thousands, __pyx_k_thousands, sizeof(__pyx_k_thousands), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_to_structured_array, __pyx_k_to_structured_array, sizeof(__pyx_k_to_structured_array), 0, 0, 1, 1}, + {&__pyx_n_s_tokenize_chunksize, __pyx_k_tokenize_chunksize, sizeof(__pyx_k_tokenize_chunksize), 0, 0, 1, 1}, + {&__pyx_n_b_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 0, 1}, + {&__pyx_n_s_true_values, __pyx_k_true_values, sizeof(__pyx_k_true_values), 0, 0, 1, 1}, + {&__pyx_n_s_tupleize_cols, __pyx_k_tupleize_cols, sizeof(__pyx_k_tupleize_cols), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, + {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1}, + {&__pyx_n_s_uint16info, __pyx_k_uint16info, sizeof(__pyx_k_uint16info), 0, 0, 1, 1}, + {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1}, + {&__pyx_n_s_uint32info, __pyx_k_uint32info, sizeof(__pyx_k_uint32info), 0, 0, 1, 1}, + {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1}, + {&__pyx_n_s_uint64info, __pyx_k_uint64info, sizeof(__pyx_k_uint64info), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_n_s_uint8info, __pyx_k_uint8info, sizeof(__pyx_k_uint8info), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_upcast_na, __pyx_k_upcast_na, sizeof(__pyx_k_upcast_na), 0, 0, 1, 1}, + {&__pyx_n_s_use_unsigned, __pyx_k_use_unsigned, sizeof(__pyx_k_use_unsigned), 0, 0, 1, 1}, + {&__pyx_n_s_usecols, __pyx_k_usecols, sizeof(__pyx_k_usecols), 0, 0, 1, 1}, + {&__pyx_kp_b_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 0, 0}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, + {&__pyx_n_s_warn_bad_lines, __pyx_k_warn_bad_lines, sizeof(__pyx_k_warn_bad_lines), 0, 0, 1, 1}, + {&__pyx_n_s_warning_columns, __pyx_k_warning_columns, sizeof(__pyx_k_warning_columns), 0, 0, 1, 1}, + {&__pyx_n_s_warning_message, __pyx_k_warning_message, sizeof(__pyx_k_warning_message), 0, 0, 1, 1}, + {&__pyx_n_s_warning_names, __pyx_k_warning_names, sizeof(__pyx_k_warning_names), 0, 0, 1, 1}, + {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/parser.pyx":341 + * else: + * if len(delimiter) > 1: + * raise ValueError('only length-1 separators excluded right now') # <<<<<<<<<<<<<< + * self.parser.delimiter = ord(delimiter) + * + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_only_length_1_separators_exclude); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/parser.pyx":352 + * if lineterminator is not None: + * if len(lineterminator) != 1: + * raise ValueError('Only length-1 line terminators supported') # <<<<<<<<<<<<<< + * self.parser.lineterminator = ord(lineterminator) + * + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_line_terminators_s); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/parser.pyx":356 + * + * if len(decimal) != 1: + * raise ValueError('Only length-1 decimal markers supported') # <<<<<<<<<<<<<< + * self.parser.decimal = ord(decimal) + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_decimal_markers_su); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/parser.pyx":361 + * if thousands is not None: + * if len(thousands) != 1: + * raise ValueError('Only length-1 thousands markers supported') # <<<<<<<<<<<<<< + * self.parser.thousands = ord(thousands) + * + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_thousands_markers); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/parser.pyx":366 + * if escapechar is not None: + * if len(escapechar) != 1: + * raise ValueError('Only length-1 escapes supported') # <<<<<<<<<<<<<< + * self.parser.escapechar = ord(escapechar) + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_escapes_supported); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/parser.pyx":374 + * if comment is not None: + * if len(comment) > 1: + * raise ValueError('Only length-1 comment characters supported') # <<<<<<<<<<<<<< + * self.parser.commentchar = ord(comment) + * + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_comment_characters); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "pandas/parser.pyx":422 + * if encoding is not None: + * if not isinstance(encoding, bytes): + * encoding = encoding.encode('utf-8') # <<<<<<<<<<<<<< + * encoding = encoding.lower() + * self.c_encoding = encoding + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "pandas/parser.pyx":488 + * + * if not self.table_width: + * raise ValueError("No columns to parse from file") # <<<<<<<<<<<<<< + * + * # compute buffer_lines as function of table width + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_No_columns_to_parse_from_file); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/parser.pyx":532 + * source = bz2.BZ2File(source, 'rb') + * else: + * raise ValueError('Python cannot read bz2 from open file ' # <<<<<<<<<<<<<< + * 'handle') + * else: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Python_cannot_read_bz2_from_open); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/parser.pyx":560 + * if not os.path.exists(source): + * raise IOError('File %s does not exist' % source) + * raise IOError('Initializing from file failed') # <<<<<<<<<<<<<< + * + * self.parser.source = ptr + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Initializing_from_file_failed); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "pandas/parser.pyx":569 + * ptr = new_rd_source(source) + * if ptr == NULL: + * raise IOError('Initializing parser from file-like ' # <<<<<<<<<<<<<< + * 'object failed') + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Initializing_parser_from_file_li); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/parser.pyx":709 + * self.leading_cols = field_count - passed_count + * elif passed_count != field_count: + * raise ValueError('Passed header names ' # <<<<<<<<<<<<<< + * 'mismatches usecols') + * # oh boy, #2442, #2981 + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Passed_header_names_mismatches_u); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "pandas/parser.pyx":807 + * + * if self.skip_footer > 0: + * raise ValueError('skip_footer can only be used to read ' # <<<<<<<<<<<<<< + * 'the whole file') + * else: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_skip_footer_can_only_be_used_to); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "pandas/parser.pyx":1012 + * na_filter, na_hashset) + * if user_dtype and na_count > 0: + * raise Exception('Integer column has NA values') # <<<<<<<<<<<<<< + * + * if dtype[1:] != 'i8': + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Integer_column_has_NA_values); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "pandas/parser.pyx":1014 + * raise Exception('Integer column has NA values') + * + * if dtype[1:] != 'i8': # <<<<<<<<<<<<<< + * result = result.astype(dtype) + * + */ + __pyx_slice__20 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__20); + __Pyx_GIVEREF(__pyx_slice__20); + + /* "pandas/parser.pyx":1023 + * na_filter, na_hashset, na_flist) + * + * if dtype[1:] != 'f8': # <<<<<<<<<<<<<< + * result = result.astype(dtype) + * return result, na_count + */ + __pyx_slice__21 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__21); + __Pyx_GIVEREF(__pyx_slice__21); + + /* "pandas/parser.pyx":1046 + * elif dtype[1] == 'S': + * # TODO: na handling + * width = int(dtype[2:]) # <<<<<<<<<<<<<< + * if width > 0: + * result = _to_fw_string(self.parser, i, start, end, width) + */ + __pyx_slice__22 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__22); + __Pyx_GIVEREF(__pyx_slice__22); + + /* "pandas/parser.pyx":1055 + * na_hashset) + * elif dtype[1] == 'U': + * width = int(dtype[2:]) # <<<<<<<<<<<<<< + * if width > 0: + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + */ + __pyx_slice__23 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + + /* "pandas/parser.pyx":1182 + * cdef asbytes(object o): + * if PY3: + * return str(o).encode('utf-8') # <<<<<<<<<<<<<< + * else: + * return str(o) + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "pandas/parser.pyx":1191 + * import io + * if isinstance(obj, io.TextIOWrapper): + * raise CParserError('Cannot handle open unicode files (yet)') # <<<<<<<<<<<<<< + * + * # BufferedReader is a byte reader for Python 3 + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_handle_open_unicode_files); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "pandas/parser.pyx":1446 + * data[0] = NEGINF + * else: + * return None, None # <<<<<<<<<<<<<< + * if use_na_flist: + * if data[0] in na_flist: + */ + __pyx_tuple__26 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "pandas/parser.pyx":1462 + * data[0] = NEGINF + * else: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __pyx_tuple__27 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "pandas/parser.pyx":1502 + * raise OverflowError(word) + * + * return None, None # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_tuple__28 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/parser.pyx":1511 + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) + * return None, None # <<<<<<<<<<<<<< + * + * return result, na_count + */ + __pyx_tuple__29 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "pandas/parser.pyx":1548 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + __pyx_tuple__30 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "pandas/parser.pyx":1556 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __pyx_tuple__31 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "pandas/parser.pyx":1607 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + __pyx_tuple__32 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "pandas/parser.pyx":1627 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __pyx_tuple__33 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "pandas/parser.pyx":1676 + * # None creeps in sometimes, which isn't possible here + * if not PyBytes_Check(val): + * raise Exception('Must be all encoded bytes') # <<<<<<<<<<<<<< + * + * k = kh_put_str(table, PyBytes_AsString(val), &ret) + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Must_be_all_encoded_bytes); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "pandas/parser.pyx":1953 + * if values is None: + * return [] + * return [x.encode('utf-8') if isinstance(x, unicode) else x for x in values] # <<<<<<<<<<<<<< + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "pandas/parser.pyx":1169 + * + * + * def _ensure_encoded(list lst): # <<<<<<<<<<<<<< + * cdef list result = [] + * for x in lst: + */ + __pyx_tuple__46 = PyTuple_Pack(3, __pyx_n_s_lst, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ensure_encoded, 1169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1187 + * + * + * def _is_file_like(obj): # <<<<<<<<<<<<<< + * if PY3: + * import io + */ + __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_io, __pyx_n_s_file, __pyx_n_s_builtin); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_file_like, 1187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1202 + * + * + * def _maybe_upcast(arr): # <<<<<<<<<<<<<< + * """ + * + */ + __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_arr, __pyx_n_s_na_value, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_maybe_upcast, 1202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1702 + * + * + * def downcast_int64(ndarray[int64_t] arr, bint use_unsigned=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__52 = PyTuple_Pack(12, __pyx_n_s_arr, __pyx_n_s_use_unsigned, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_mx, __pyx_n_s_mn, __pyx_n_s_NA, __pyx_n_s_val, __pyx_n_s_mask, __pyx_n_s_na_count, __pyx_n_s_mask_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_downcast_int64, 1702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1772 + * + * + * def _concatenate_chunks(list chunks): # <<<<<<<<<<<<<< + * cdef: + * list names = list(chunks[0].keys()) + */ + __pyx_tuple__54 = PyTuple_Pack(12, __pyx_n_s_chunks, __pyx_n_s_names, __pyx_n_s_name, __pyx_n_s_warning_columns, __pyx_n_s_warning_names, __pyx_n_s_common_type, __pyx_n_s_result, __pyx_n_s_arrs, __pyx_n_s_dtypes, __pyx_n_s_warning_message, __pyx_n_s_chunk, __pyx_n_s_a); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_concatenate_chunks, 1772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1803 + * + * # NA values + * def _compute_na_values(): # <<<<<<<<<<<<<< + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) + */ + __pyx_tuple__56 = PyTuple_Pack(9, __pyx_n_s_int64info, __pyx_n_s_int32info, __pyx_n_s_int16info, __pyx_n_s_int8info, __pyx_n_s_uint64info, __pyx_n_s_uint32info, __pyx_n_s_uint16info, __pyx_n_s_uint8info, __pyx_n_s_na_values); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(0, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_compute_na_values, 1803, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1871 + * + * + * def _to_structured_array(dict columns, object names): # <<<<<<<<<<<<<< + * cdef: + * ndarray recs, column + */ + __pyx_tuple__58 = PyTuple_Pack(16, __pyx_n_s_columns, __pyx_n_s_names, __pyx_n_s_recs, __pyx_n_s_column, __pyx_n_s_dt, __pyx_n_s_fields, __pyx_n_s_name, __pyx_n_s_fnames, __pyx_n_s_field_type, __pyx_n_s_i, __pyx_n_s_offset, __pyx_n_s_nfields, __pyx_n_s_length, __pyx_n_s_stride, __pyx_n_s_elsize, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_to_structured_array, 1871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1950 + * + * + * def _maybe_encode(values): # <<<<<<<<<<<<<< + * if values is None: + * return [] + */ + __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_x); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_maybe_encode, 1950, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_262144 = PyInt_FromLong(262144L); if (unlikely(!__pyx_int_262144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initparser(void); /*proto*/ +PyMODINIT_FUNC initparser(void) +#else +PyMODINIT_FUNC PyInit_parser(void); /*proto*/ +PyMODINIT_FUNC PyInit_parser(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_parser(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("parser"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__parser) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.parser")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.parser", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + __pyx_v_6pandas_6parser__true_values = Py_None; Py_INCREF(Py_None); + __pyx_v_6pandas_6parser__false_values = Py_None; Py_INCREF(Py_None); + __pyx_v_6pandas_6parser_dtype_cast_order = ((PyObject*)Py_None); Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_6pandas_6parser_TextReader = &__pyx_vtable_6pandas_6parser_TextReader; + __pyx_vtable_6pandas_6parser_TextReader._make_skiprow_set = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *))__pyx_f_6pandas_6parser_10TextReader__make_skiprow_set; + __pyx_vtable_6pandas_6parser_TextReader._setup_parser_source = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__setup_parser_source; + __pyx_vtable_6pandas_6parser_TextReader._get_header = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *))__pyx_f_6pandas_6parser_10TextReader__get_header; + __pyx_vtable_6pandas_6parser_TextReader._implicit_index_count = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *))__pyx_f_6pandas_6parser_10TextReader__implicit_index_count; + __pyx_vtable_6pandas_6parser_TextReader._read_low_memory = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__read_low_memory; + __pyx_vtable_6pandas_6parser_TextReader._tokenize_rows = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, size_t))__pyx_f_6pandas_6parser_10TextReader__tokenize_rows; + __pyx_vtable_6pandas_6parser_TextReader._read_rows = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, int))__pyx_f_6pandas_6parser_10TextReader__read_rows; + __pyx_vtable_6pandas_6parser_TextReader._start_clock = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *))__pyx_f_6pandas_6parser_10TextReader__start_clock; + __pyx_vtable_6pandas_6parser_TextReader._end_clock = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__end_clock; + __pyx_vtable_6pandas_6parser_TextReader._convert_tokens = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, PyObject *, int, kh_str_t *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__convert_tokens; + __pyx_vtable_6pandas_6parser_TextReader._convert_with_dtype = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, Py_ssize_t, int, int, int, int, kh_str_t *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__convert_with_dtype; + __pyx_vtable_6pandas_6parser_TextReader._string_convert = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, int, kh_str_t *))__pyx_f_6pandas_6parser_10TextReader__string_convert; + __pyx_vtable_6pandas_6parser_TextReader._get_na_list = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__get_na_list; + __pyx_vtable_6pandas_6parser_TextReader._free_na_set = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, kh_str_t *))__pyx_f_6pandas_6parser_10TextReader__free_na_set; + __pyx_vtable_6pandas_6parser_TextReader._get_column_name = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, Py_ssize_t))__pyx_f_6pandas_6parser_10TextReader__get_column_name; + if (PyType_Ready(&__pyx_type_6pandas_6parser_TextReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_6parser_TextReader.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_6parser_TextReader.tp_dict, __pyx_vtabptr_6pandas_6parser_TextReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TextReader", (PyObject *)&__pyx_type_6pandas_6parser_TextReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_6parser_TextReader = &__pyx_type_6pandas_6parser_TextReader; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/parser.pyx":8 + * from libc.string cimport strncpy, strlen, strcmp, strcasecmp + * cimport libc.stdio as stdio + * import warnings # <<<<<<<<<<<<<< + * + * from cpython cimport (PyObject, PyBytes_FromString, + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":13 + * PyBytes_AsString, PyBytes_Check, + * PyUnicode_Check, PyUnicode_AsUTF8String) + * from io.common import DtypeWarning # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_DtypeWarning); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_DtypeWarning); + __Pyx_GIVEREF(__pyx_n_s_DtypeWarning); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_io_common, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_DtypeWarning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DtypeWarning, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":29 + * from numpy cimport ndarray, uint8_t, uint64_t + * + * import numpy as np # <<<<<<<<<<<<<< + * cimport util + * + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":32 + * cimport util + * + * import pandas.lib as lib # <<<<<<<<<<<<<< + * + * import time + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s__45); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__45); + __Pyx_GIVEREF(__pyx_n_s__45); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":34 + * import pandas.lib as lib + * + * import time # <<<<<<<<<<<<<< + * import os + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":35 + * + * import time + * import os # <<<<<<<<<<<<<< + * + * cnp.import_array() + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":37 + * import os + * + * cnp.import_array() # <<<<<<<<<<<<<< + * + * from khash cimport * + */ + import_array(); + + /* "pandas/parser.pyx":41 + * from khash cimport * + * + * import sys # <<<<<<<<<<<<<< + * + * cdef bint PY3 = (sys.version_info[0] >= 3) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":43 + * import sys + * + * cdef bint PY3 = (sys.version_info[0] >= 3) # <<<<<<<<<<<<<< + * + * cdef double INF = np.inf + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_6parser_PY3 = __pyx_t_3; + + /* "pandas/parser.pyx":45 + * cdef bint PY3 = (sys.version_info[0] >= 3) + * + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_6parser_INF = ((double)__pyx_t_4); + + /* "pandas/parser.pyx":46 + * + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * + * cdef extern from "headers/stdint.h": + */ + __pyx_v_6pandas_6parser_NEGINF = (-__pyx_v_6pandas_6parser_INF); + + /* "pandas/parser.pyx":65 + * pass + * + * try: # <<<<<<<<<<<<<< + * basestring + * except NameError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/parser.pyx":66 + * + * try: + * basestring # <<<<<<<<<<<<<< + * except NameError: + * basestring = str + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L9_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":67 + * try: + * basestring + * except NameError: # <<<<<<<<<<<<<< + * basestring = str + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_NameError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.parser", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/parser.pyx":68 + * basestring + * except NameError: + * basestring = str # <<<<<<<<<<<<<< + * + * cdef extern from "parser/tokenizer.h": + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L9_try_end:; + } + + /* "pandas/parser.pyx":222 + * + * + * DEFAULT_CHUNKSIZE = 256 * 1024 # <<<<<<<<<<<<<< + * + * # common NA values + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_CHUNKSIZE, __pyx_int_262144) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":227 + * # no longer excluding inf representations + * # '1.#INF','-1.#INF', '1.#INF000000', + * _NA_VALUES = [b'-1.#IND', b'1.#QNAN', b'1.#IND', b'-1.#QNAN', # <<<<<<<<<<<<<< + * b'#N/A N/A', b'NA', b'#NA', b'NULL', b'NaN', + * b'nan', b''] + */ + __pyx_t_9 = PyList_New(11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_kp_b_1_IND); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_kp_b_1_IND); + __Pyx_GIVEREF(__pyx_kp_b_1_IND); + __Pyx_INCREF(__pyx_kp_b_1_QNAN); + PyList_SET_ITEM(__pyx_t_9, 1, __pyx_kp_b_1_QNAN); + __Pyx_GIVEREF(__pyx_kp_b_1_QNAN); + __Pyx_INCREF(__pyx_kp_b_1_IND_2); + PyList_SET_ITEM(__pyx_t_9, 2, __pyx_kp_b_1_IND_2); + __Pyx_GIVEREF(__pyx_kp_b_1_IND_2); + __Pyx_INCREF(__pyx_kp_b_1_QNAN_2); + PyList_SET_ITEM(__pyx_t_9, 3, __pyx_kp_b_1_QNAN_2); + __Pyx_GIVEREF(__pyx_kp_b_1_QNAN_2); + __Pyx_INCREF(__pyx_kp_b_N_A_N_A); + PyList_SET_ITEM(__pyx_t_9, 4, __pyx_kp_b_N_A_N_A); + __Pyx_GIVEREF(__pyx_kp_b_N_A_N_A); + __Pyx_INCREF(__pyx_n_b_NA); + PyList_SET_ITEM(__pyx_t_9, 5, __pyx_n_b_NA); + __Pyx_GIVEREF(__pyx_n_b_NA); + __Pyx_INCREF(__pyx_kp_b_NA_2); + PyList_SET_ITEM(__pyx_t_9, 6, __pyx_kp_b_NA_2); + __Pyx_GIVEREF(__pyx_kp_b_NA_2); + __Pyx_INCREF(__pyx_n_b_NULL); + PyList_SET_ITEM(__pyx_t_9, 7, __pyx_n_b_NULL); + __Pyx_GIVEREF(__pyx_n_b_NULL); + __Pyx_INCREF(__pyx_n_b_NaN); + PyList_SET_ITEM(__pyx_t_9, 8, __pyx_n_b_NaN); + __Pyx_GIVEREF(__pyx_n_b_NaN); + __Pyx_INCREF(__pyx_n_b_nan); + PyList_SET_ITEM(__pyx_t_9, 9, __pyx_n_b_nan); + __Pyx_GIVEREF(__pyx_n_b_nan); + __Pyx_INCREF(__pyx_kp_b__16); + PyList_SET_ITEM(__pyx_t_9, 10, __pyx_kp_b__16); + __Pyx_GIVEREF(__pyx_kp_b__16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA_VALUES, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":276 + * + * memory_map=False, + * tokenize_chunksize=DEFAULT_CHUNKSIZE, # <<<<<<<<<<<<<< + * delim_whitespace=False, + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEFAULT_CHUNKSIZE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_k__2 = __pyx_t_9; + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1158 + * return None + * + * class CParserError(Exception): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_builtin_Exception); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_builtin_Exception); + __Pyx_GIVEREF(__pyx_builtin_Exception); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_9, __pyx_n_s_CParserError, __pyx_n_s_CParserError, (PyObject *) NULL, __pyx_n_s_pandas_parser, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_CParserError, __pyx_t_9, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CParserError, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1162 + * + * + * class OverflowError(ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_9, __pyx_n_s_OverflowError, __pyx_n_s_OverflowError, (PyObject *) NULL, __pyx_n_s_pandas_parser, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OverflowError, __pyx_t_9, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OverflowError, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1165 + * pass + * + * cdef object _true_values = [b'True', b'TRUE', b'true'] # <<<<<<<<<<<<<< + * cdef object _false_values = [b'False', b'FALSE', b'false'] + * + */ + __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_b_True); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_b_True); + __Pyx_GIVEREF(__pyx_n_b_True); + __Pyx_INCREF(__pyx_n_b_TRUE); + PyList_SET_ITEM(__pyx_t_9, 1, __pyx_n_b_TRUE); + __Pyx_GIVEREF(__pyx_n_b_TRUE); + __Pyx_INCREF(__pyx_n_b_true); + PyList_SET_ITEM(__pyx_t_9, 2, __pyx_n_b_true); + __Pyx_GIVEREF(__pyx_n_b_true); + __Pyx_XGOTREF(__pyx_v_6pandas_6parser__true_values); + __Pyx_DECREF_SET(__pyx_v_6pandas_6parser__true_values, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1166 + * + * cdef object _true_values = [b'True', b'TRUE', b'true'] + * cdef object _false_values = [b'False', b'FALSE', b'false'] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_b_False); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_b_False); + __Pyx_GIVEREF(__pyx_n_b_False); + __Pyx_INCREF(__pyx_n_b_FALSE); + PyList_SET_ITEM(__pyx_t_9, 1, __pyx_n_b_FALSE); + __Pyx_GIVEREF(__pyx_n_b_FALSE); + __Pyx_INCREF(__pyx_n_b_false); + PyList_SET_ITEM(__pyx_t_9, 2, __pyx_n_b_false); + __Pyx_GIVEREF(__pyx_n_b_false); + __Pyx_XGOTREF(__pyx_v_6pandas_6parser__false_values); + __Pyx_DECREF_SET(__pyx_v_6pandas_6parser__false_values, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1169 + * + * + * def _ensure_encoded(list lst): # <<<<<<<<<<<<<< + * cdef list result = [] + * for x in lst: + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_1_ensure_encoded, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ensure_encoded, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1187 + * + * + * def _is_file_like(obj): # <<<<<<<<<<<<<< + * if PY3: + * import io + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_3_is_file_like, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_file_like, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1202 + * + * + * def _maybe_upcast(arr): # <<<<<<<<<<<<<< + * """ + * + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_5_maybe_upcast, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_upcast, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1408 + * return result + * + * cdef char* cinf = b'inf' # <<<<<<<<<<<<<< + * cdef char* cneginf = b'-inf' + * + */ + __pyx_v_6pandas_6parser_cinf = __pyx_k_inf; + + /* "pandas/parser.pyx":1409 + * + * cdef char* cinf = b'inf' + * cdef char* cneginf = b'-inf' # <<<<<<<<<<<<<< + * + * cdef _try_double(parser_t *parser, int col, int line_start, int line_end, + */ + __pyx_v_6pandas_6parser_cneginf = __pyx_k_inf_2; + + /* "pandas/parser.pyx":1686 + * + * # TODO: endianness just a placeholder? + * cdef list dtype_cast_order = ['= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (PyDict_SetItem(__pyx_d, __pyx_n_s_k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1830 + * + * for k in list(na_values): + * na_values[np.dtype(k)] = na_values[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1871 + * + * + * def _to_structured_array(dict columns, object names): # <<<<<<<<<<<<<< + * cdef: + * ndarray recs, column + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_13_to_structured_array, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_structured_array, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1950 + * + * + * def _maybe_encode(values): # <<<<<<<<<<<<<< + * if values is None: + * return [] + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_15_maybe_encode, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_encode, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1 + * # Copyright (c) 2012, Lambda Foundry, Inc. # <<<<<<<<<<<<<< + * # See LICENSE for the license + * + */ + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.parser", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.parser"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { + PyObject* value; +#if PY_MAJOR_VERSION >= 3 + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (unlikely(PyErr_Occurred())) + return NULL; + value = default_value; + } + Py_INCREF(value); +#else + if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + value = PyDict_GetItem(d, key); + if (unlikely(!value)) { + value = default_value; + } + Py_INCREF(value); + } else { + if (default_value == Py_None) + default_value = NULL; + value = PyObject_CallMethodObjArgs( + d, __pyx_n_s_get, key, default_value, NULL); + } +#endif + return value; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, Py_ssize_t ix) { + PyObject *r, *py_ix; + py_ix = PyInt_FromSsize_t(ix); + if (!py_ix) return NULL; + r = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); + Py_DECREF(py_ix); + return r; +} +static PyObject* __Pyx_PyList_PopIndex(PyObject* L, Py_ssize_t ix) { +#if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = PyList_GET_SIZE(L); + if (likely(size > (((PyListObject*)L)->allocated >> 1))) { + Py_ssize_t cix = ix; + if (cix < 0) { + cix += size; + } + if (likely(0 <= cix && cix < size)) { + PyObject* v = PyList_GET_ITEM(L, cix); + Py_SIZE(L) -= 1; + size -= 1; + memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); + return v; + } + } +#endif + return __Pyx__PyObject_PopIndex(L, ix); +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + length = strlen(cstring); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { + if (PY_MAJOR_VERSION >= 3) + return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s_values, d); + else + return PyDict_Values(d); +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(char) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(char) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong) + } else if (sizeof(char) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(char, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(size_t)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (size_t) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(size_t) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(size_t)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(size_t) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(size_t) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong) + } else if (sizeof(size_t) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + return (npy_uint8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong) + } else if (sizeof(npy_uint8) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint8 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint8) -1; + } + } else { + npy_uint8 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files/pandas/src/sparse.c b/cythonized-files/pandas/src/sparse.c new file mode 100644 index 00000000..f4be2b0e --- /dev/null +++ b/cythonized-files/pandas/src/sparse.c @@ -0,0 +1,24464 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas___sparse +#define __PYX_HAVE_API__pandas___sparse +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "sparse.pyx", + "numpy.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_7_sparse_SparseIndex; +struct __pyx_obj_6pandas_7_sparse_IntIndex; +struct __pyx_obj_6pandas_7_sparse_BlockIndex; +struct __pyx_obj_6pandas_7_sparse_BlockMerge; +struct __pyx_obj_6pandas_7_sparse_BlockIntersection; +struct __pyx_obj_6pandas_7_sparse_BlockUnion; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "pandas/src/sparse.pyx":688 + * # Sparse arithmetic + * + * ctypedef float64_t (* double_func)(float64_t a, float64_t b) # <<<<<<<<<<<<<< + * + * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex, + */ +typedef __pyx_t_5numpy_float64_t (*__pyx_t_6pandas_7_sparse_double_func)(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); + +/* "pandas/src/sparse.pyx":25 + * + * + * cdef class SparseIndex: # <<<<<<<<<<<<<< + * ''' + * Abstract superclass for sparse index types + */ +struct __pyx_obj_6pandas_7_sparse_SparseIndex { + PyObject_HEAD +}; + + +/* "pandas/src/sparse.pyx":33 + * + * + * cdef class IntIndex(SparseIndex): # <<<<<<<<<<<<<< + * ''' + * Object for holding exact integer sparse indexing information + */ +struct __pyx_obj_6pandas_7_sparse_IntIndex { + struct __pyx_obj_6pandas_7_sparse_SparseIndex __pyx_base; + struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *__pyx_vtab; + Py_ssize_t length; + Py_ssize_t npoints; + PyArrayObject *indices; +}; + + +/* "pandas/src/sparse.pyx":259 + * # BlockIndex + * + * cdef class BlockIndex(SparseIndex): # <<<<<<<<<<<<<< + * ''' + * Object for holding block-based sparse indexing information + */ +struct __pyx_obj_6pandas_7_sparse_BlockIndex { + struct __pyx_obj_6pandas_7_sparse_SparseIndex __pyx_base; + struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *__pyx_vtab; + Py_ssize_t nblocks; + Py_ssize_t npoints; + Py_ssize_t length; + PyArrayObject *blocs; + PyArrayObject *blengths; + PyObject *__weakref__; + __pyx_t_5numpy_int32_t *locbuf; + __pyx_t_5numpy_int32_t *lenbuf; +}; + + +/* "pandas/src/sparse.pyx":527 + * + * + * cdef class BlockMerge(object): # <<<<<<<<<<<<<< + * ''' + * Object-oriented approach makes sharing state between recursive functions a + */ +struct __pyx_obj_6pandas_7_sparse_BlockMerge { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *__pyx_vtab; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *x; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *y; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *result; + PyArrayObject *xstart; + PyArrayObject *xlen; + PyArrayObject *xend; + PyArrayObject *ystart; + PyArrayObject *ylen; + PyArrayObject *yend; + __pyx_t_5numpy_int32_t xi; + __pyx_t_5numpy_int32_t yi; +}; + + +/* "pandas/src/sparse.pyx":569 + * self.yi = xi + * + * cdef class BlockIntersection(BlockMerge): # <<<<<<<<<<<<<< + * ''' + * not done yet + */ +struct __pyx_obj_6pandas_7_sparse_BlockIntersection { + struct __pyx_obj_6pandas_7_sparse_BlockMerge __pyx_base; +}; + + +/* "pandas/src/sparse.pyx":575 + * pass + * + * cdef class BlockUnion(BlockMerge): # <<<<<<<<<<<<<< + * ''' + * Object-oriented approach makes sharing state between recursive functions a + */ +struct __pyx_obj_6pandas_7_sparse_BlockUnion { + struct __pyx_obj_6pandas_7_sparse_BlockMerge __pyx_base; +}; + + + +/* "pandas/src/sparse.pyx":33 + * + * + * cdef class IntIndex(SparseIndex): # <<<<<<<<<<<<<< + * ''' + * Object for holding exact integer sparse indexing information + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex { + struct __pyx_obj_6pandas_7_sparse_IntIndex *(*intersect)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + struct __pyx_obj_6pandas_7_sparse_IntIndex *(*make_union)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + PyObject *(*lookup)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, Py_ssize_t, int __pyx_skip_dispatch); + PyArrayObject *(*reindex)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + PyObject *(*put)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*take)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *__pyx_vtabptr_6pandas_7_sparse_IntIndex; + + +/* "pandas/src/sparse.pyx":259 + * # BlockIndex + * + * cdef class BlockIndex(SparseIndex): # <<<<<<<<<<<<<< + * ''' + * Object for holding block-based sparse indexing information + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex { + PyObject *(*check_integrity)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, int __pyx_skip_dispatch); + struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*intersect)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*make_union)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + PyObject *(*lookup)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, Py_ssize_t, int __pyx_skip_dispatch); + PyArrayObject *(*reindex)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + PyObject *(*put)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*take)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *__pyx_vtabptr_6pandas_7_sparse_BlockIndex; + + +/* "pandas/src/sparse.pyx":527 + * + * + * cdef class BlockMerge(object): # <<<<<<<<<<<<<< + * ''' + * Object-oriented approach makes sharing state between recursive functions a + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge { + PyObject *(*_make_merged_blocks)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *); + PyObject *(*_set_current_indices)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t, int); +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *__pyx_vtabptr_6pandas_7_sparse_BlockMerge; + + +/* "pandas/src/sparse.pyx":569 + * self.yi = xi + * + * cdef class BlockIntersection(BlockMerge): # <<<<<<<<<<<<<< + * ''' + * not done yet + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection { + struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection *__pyx_vtabptr_6pandas_7_sparse_BlockIntersection; + + +/* "pandas/src/sparse.pyx":575 + * pass + * + * cdef class BlockUnion(BlockMerge): # <<<<<<<<<<<<<< + * ''' + * Object-oriented approach makes sharing state between recursive functions a + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion { + struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_base; + __pyx_t_5numpy_int32_t (*_find_next_block_end)(struct __pyx_obj_6pandas_7_sparse_BlockUnion *, int); +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *__pyx_vtabptr_6pandas_7_sparse_BlockUnion; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/ + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); /*proto*/ + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'pandas._sparse' */ +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_SparseIndex = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_IntIndex = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockIndex = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockMerge = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockIntersection = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockUnion = 0; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_7_sparse_NaN; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_7_sparse_INF; +static PyObject *__pyx_f_6pandas_7_sparse_get_blocks(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_nancombine(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_combine(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_nanop(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_op(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_BlockIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_BlockIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_op(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___add(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___sub(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rsub(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___div(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rdiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___floordiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rfloordiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___mul(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___pow(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rpow(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanadd(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nansub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrsub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanmul(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nandiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrdiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_add(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_sub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rsub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_mul(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_div(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rdiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_floordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_pow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +#define __Pyx_MODULE_NAME "pandas._sparse" +int __pyx_module_is_main_pandas___sparse = 0; + +/* Implementation of 'pandas._sparse' */ +static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_RuntimeError; +static int __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7_sparse_8IntIndex___init__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_length, PyObject *__pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_8equals(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_22reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_24put(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_26take(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_get_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices); /* proto */ +static int __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_blocs, PyObject *__pyx_v_blengths); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_22reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_24put(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_26take(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_2sparse_nanadd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_4sparse_nansub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_6sparse_nanrsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8sparse_nanmul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10sparse_nandiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_12sparse_nanrdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_14sparse_nanfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_16sparse_nanrfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_18sparse_nanpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_20sparse_nanrpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_22sparse_add(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_24sparse_sub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_26sparse_rsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_28sparse_mul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_30sparse_div(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_32sparse_rdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_34sparse_floordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_36sparse_rfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_38sparse_pow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_40sparse_rpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_42get_reindexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_index_map); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_44reindex_integer(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index, CYTHON_UNUSED PyArrayObject *__pyx_v_indexer); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_7_sparse_SparseIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_IntIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockMerge(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIntersection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockUnion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k_idx[] = "idx"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_put[] = "put"; +static char __pyx_k_sum[] = "sum"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_fill[] = "fill"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_take[] = "take"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_blocs[] = "blocs"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_ngaps[] = "ngaps"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_other[] = "other_"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_xfill[] = "xfill"; +static char __pyx_k_yfill[] = "yfill"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_length[] = "length"; +static char __pyx_k_lookup[] = "lookup"; +static char __pyx_k_to_put[] = "to_put"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_xindex[] = "xindex"; +static char __pyx_k_yindex[] = "yindex"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_indexer[] = "indexer"; +static char __pyx_k_indices[] = "indices"; +static char __pyx_k_reindex[] = "reindex"; +static char __pyx_k_IntIndex[] = "IntIndex\n"; +static char __pyx_k_blengths[] = "blengths"; +static char __pyx_k_operator[] = "operator"; +static char __pyx_k_property[] = "property"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_Indices_s[] = "Indices: %s\n"; +static char __pyx_k_index_map[] = "index_map"; +static char __pyx_k_intersect[] = "intersect"; +static char __pyx_k_BlockIndex[] = "BlockIndex\n"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_fill_value[] = "fill_value"; +static char __pyx_k_make_union[] = "make_union"; +static char __pyx_k_new_length[] = "new_length"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_sparse_div[] = "sparse_div"; +static char __pyx_k_array_equal[] = "array_equal"; +static char __pyx_k_sparse_rdiv[] = "sparse_rdiv"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_searchsorted[] = "searchsorted"; +static char __pyx_k_sparse_index[] = "sparse_index"; +static char __pyx_k_to_int_index[] = "to_int_index"; +static char __pyx_k_get_reindexer[] = "get_reindexer"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_sparse_nandiv[] = "sparse_nandiv"; +static char __pyx_k_pandas__sparse[] = "pandas._sparse"; +static char __pyx_k_sparse_nanrdiv[] = "sparse_nanrdiv"; +static char __pyx_k_sparse_truediv[] = "sparse_truediv"; +static char __pyx_k_to_block_index[] = "to_block_index"; +static char __pyx_k_Block_lengths_s[] = "Block lengths: %s"; +static char __pyx_k_check_integrity[] = "check_integrity"; +static char __pyx_k_reindex_integer[] = "reindex_integer"; +static char __pyx_k_sparse_rtruediv[] = "sparse_rtruediv"; +static char __pyx_k_Block_d_overlaps[] = "Block %d overlaps"; +static char __pyx_k_Block_locations_s[] = "Block locations: %s\n"; +static char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_sparse_nantruediv[] = "sparse_nantruediv"; +static char __pyx_k_sparse_nanrtruediv[] = "sparse_nanrtruediv"; +static char __pyx_k_Mode_must_be_0_or_1[] = "Mode must be 0 or 1"; +static char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static char __pyx_k_Zero_length_block_d[] = "Zero-length block %d"; +static char __pyx_k_Block_d_extends_beyond_end[] = "Block %d extends beyond end"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_block_bound_arrays_must_be_same[] = "block bound arrays must be same length"; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/src/sparse.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Indices_must_reference_same_unde[] = "Indices must reference same underlying length"; +static char __pyx_k_Locations_not_in_ascending_order[] = "Locations not in ascending order"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_BlockIndex; +static PyObject *__pyx_kp_s_Block_d_extends_beyond_end; +static PyObject *__pyx_kp_s_Block_d_overlaps; +static PyObject *__pyx_kp_s_Block_lengths_s; +static PyObject *__pyx_kp_s_Block_locations_s; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_kp_s_Indices_must_reference_same_unde; +static PyObject *__pyx_kp_s_Indices_s; +static PyObject *__pyx_n_s_IntIndex; +static PyObject *__pyx_kp_s_Locations_not_in_ascending_order; +static PyObject *__pyx_kp_s_Mode_must_be_0_or_1; +static PyObject *__pyx_n_s_NaN; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s_Zero_length_block_d; +static PyObject *__pyx_n_s_array_equal; +static PyObject *__pyx_n_s_ascontiguousarray; +static PyObject *__pyx_n_s_blengths; +static PyObject *__pyx_kp_s_block_bound_arrays_must_be_same; +static PyObject *__pyx_n_s_blocs; +static PyObject *__pyx_n_s_check_integrity; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_fill; +static PyObject *__pyx_n_s_fill_value; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_get_reindexer; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_index_map; +static PyObject *__pyx_n_s_indexer; +static PyObject *__pyx_n_s_indices; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_intersect; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_lookup; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_union; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_new_length; +static PyObject *__pyx_n_s_ngaps; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_operator; +static PyObject *__pyx_n_s_other; +static PyObject *__pyx_n_s_pandas__sparse; +static PyObject *__pyx_n_s_property; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reindex; +static PyObject *__pyx_n_s_reindex_integer; +static PyObject *__pyx_n_s_searchsorted; +static PyObject *__pyx_n_s_sparse_div; +static PyObject *__pyx_n_s_sparse_index; +static PyObject *__pyx_n_s_sparse_nandiv; +static PyObject *__pyx_n_s_sparse_nanrdiv; +static PyObject *__pyx_n_s_sparse_nanrtruediv; +static PyObject *__pyx_n_s_sparse_nantruediv; +static PyObject *__pyx_n_s_sparse_rdiv; +static PyObject *__pyx_n_s_sparse_rtruediv; +static PyObject *__pyx_n_s_sparse_truediv; +static PyObject *__pyx_n_s_sum; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_take; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_to_block_index; +static PyObject *__pyx_n_s_to_int_index; +static PyObject *__pyx_n_s_to_put; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xfill; +static PyObject *__pyx_n_s_xindex; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_n_s_yfill; +static PyObject *__pyx_n_s_yindex; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__17; + +/* "pandas/src/sparse.pyx":19 + * cdef float64_t INF = np.inf + * + * cdef inline int int_max(int a, int b): return a if a >= b else b # <<<<<<<<<<<<<< + * cdef inline int int_min(int a, int b): return a if a <= b else b + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_7_sparse_int_max(int __pyx_v_a, int __pyx_v_b) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("int_max", 0); + if (((__pyx_v_a >= __pyx_v_b) != 0)) { + __pyx_t_1 = __pyx_v_a; + } else { + __pyx_t_1 = __pyx_v_b; + } + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":20 + * + * cdef inline int int_max(int a, int b): return a if a >= b else b + * cdef inline int int_min(int a, int b): return a if a <= b else b # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + +static CYTHON_INLINE int __pyx_f_6pandas_7_sparse_int_min(int __pyx_v_a, int __pyx_v_b) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("int_min", 0); + if (((__pyx_v_a <= __pyx_v_b) != 0)) { + __pyx_t_1 = __pyx_v_a; + } else { + __pyx_t_1 = __pyx_v_b; + } + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":29 + * Abstract superclass for sparse index types + * ''' + * def __init__(self): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/sparse.pyx":30 + * ''' + * def __init__(self): + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":29 + * Abstract superclass for sparse index types + * ''' + * def __init__(self): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas._sparse.SparseIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":47 + * ndarray indices + * + * def __init__(self, Py_ssize_t length, indices): # <<<<<<<<<<<<<< + * self.length = length + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_indices = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_indices,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_length = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indices = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex___init__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_length, __pyx_v_indices); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7_sparse_8IntIndex___init__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_length, PyObject *__pyx_v_indices) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/sparse.pyx":48 + * + * def __init__(self, Py_ssize_t length, indices): + * self.length = length # <<<<<<<<<<<<<< + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) + * self.npoints = len(self.indices) + */ + __pyx_v_self->length = __pyx_v_length; + + /* "pandas/src/sparse.pyx":49 + * def __init__(self, Py_ssize_t length, indices): + * self.length = length + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) # <<<<<<<<<<<<<< + * self.npoints = len(self.indices) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_indices); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices); + __Pyx_GIVEREF(__pyx_v_indices); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->indices); + __Pyx_DECREF(((PyObject *)__pyx_v_self->indices)); + __pyx_v_self->indices = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":50 + * self.length = length + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) + * self.npoints = len(self.indices) # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + __pyx_t_5 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->npoints = __pyx_t_6; + + /* "pandas/src/sparse.pyx":47 + * ndarray indices + * + * def __init__(self, Py_ssize_t length, indices): # <<<<<<<<<<<<<< + * self.length = length + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas._sparse.IntIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":52 + * self.npoints = len(self.indices) + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * args = (self.length, self.indices) + * return (IntIndex, args) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "pandas/src/sparse.pyx":53 + * + * def __reduce__(self): + * args = (self.length, self.indices) # <<<<<<<<<<<<<< + * return (IntIndex, args) + * + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices)); + __pyx_t_1 = 0; + __pyx_v_args = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":54 + * def __reduce__(self): + * args = (self.length, self.indices) + * return (IntIndex, args) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex))); + __Pyx_INCREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":52 + * self.npoints = len(self.indices) + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * args = (self.length, self.indices) + * return (IntIndex, args) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.IntIndex.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":56 + * return (IntIndex, args) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * output = 'IntIndex\n' + * output += 'Indices: %s\n' % repr(self.indices) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "pandas/src/sparse.pyx":57 + * + * def __repr__(self): + * output = 'IntIndex\n' # <<<<<<<<<<<<<< + * output += 'Indices: %s\n' % repr(self.indices) + * return output + */ + __Pyx_INCREF(__pyx_n_s_IntIndex); + __pyx_v_output = __pyx_n_s_IntIndex; + + /* "pandas/src/sparse.pyx":58 + * def __repr__(self): + * output = 'IntIndex\n' + * output += 'Indices: %s\n' % repr(self.indices) # <<<<<<<<<<<<<< + * return output + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Indices_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":59 + * output = 'IntIndex\n' + * output += 'Indices: %s\n' % repr(self.indices) + * return output # <<<<<<<<<<<<<< + * + * def check_integrity(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_output); + __pyx_r = __pyx_v_output; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":56 + * return (IntIndex, args) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * output = 'IntIndex\n' + * output += 'Indices: %s\n' % repr(self.indices) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.IntIndex.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":61 + * return output + * + * def check_integrity(self): # <<<<<<<<<<<<<< + * ''' + * Only need be strictly ascending and nothing less than 0 or greater than + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_8IntIndex_6check_integrity[] = "\n Only need be strictly ascending and nothing less than 0 or greater than\n totall ength\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_integrity (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_integrity", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":68 + * pass + * + * def equals(self, other): # <<<<<<<<<<<<<< + * if not isinstance(other, IntIndex): + * return False + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_8equals(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_8equals(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_same_length = NULL; + PyObject *__pyx_v_same_indices = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "pandas/src/sparse.pyx":69 + * + * def equals(self, other): + * if not isinstance(other, IntIndex): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/sparse.pyx":70 + * def equals(self, other): + * if not isinstance(other, IntIndex): + * return False # <<<<<<<<<<<<<< + * + * if self is other: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":72 + * return False + * + * if self is other: # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_2 = (((PyObject *)__pyx_v_self) == __pyx_v_other); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":73 + * + * if self is other: + * return True # <<<<<<<<<<<<<< + * + * same_length = self.length == other.length + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":75 + * return True + * + * same_length = self.length == other.length # <<<<<<<<<<<<<< + * same_indices = np.array_equal(self.indices, other.indices) + * return same_length and same_indices + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_same_length = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":76 + * + * same_length = self.length == other.length + * same_indices = np.array_equal(self.indices, other.indices) # <<<<<<<<<<<<<< + * return same_length and same_indices + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->indices)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_same_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":77 + * same_length = self.length == other.length + * same_indices = np.array_equal(self.indices, other.indices) + * return same_length and same_indices # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_same_length); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __Pyx_INCREF(__pyx_v_same_indices); + __pyx_t_5 = __pyx_v_same_indices; + } else { + __Pyx_INCREF(__pyx_v_same_length); + __pyx_t_5 = __pyx_v_same_length; + } + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":68 + * pass + * + * def equals(self, other): # <<<<<<<<<<<<<< + * if not isinstance(other, IntIndex): + * return False + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas._sparse.IntIndex.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_same_length); + __Pyx_XDECREF(__pyx_v_same_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":80 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ngaps (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ngaps", 0); + + /* "pandas/src/sparse.pyx":81 + * @property + * def ngaps(self): + * return self.length - self.npoints # <<<<<<<<<<<<<< + * + * def to_int_index(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->length - __pyx_v_self->npoints)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":80 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.ngaps", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":83 + * return self.length - self.npoints + * + * def to_int_index(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_int_index (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_int_index", 0); + + /* "pandas/src/sparse.pyx":84 + * + * def to_int_index(self): + * return self # <<<<<<<<<<<<<< + * + * def to_block_index(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":83 + * return self.length - self.npoints + * + * def to_int_index(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":86 + * return self + * + * def to_block_index(self): # <<<<<<<<<<<<<< + * locs, lens = get_blocks(self.indices) + * return BlockIndex(self.length, locs, lens) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_block_index (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_v_locs = NULL; + PyObject *__pyx_v_lens = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_block_index", 0); + + /* "pandas/src/sparse.pyx":87 + * + * def to_block_index(self): + * locs, lens = get_blocks(self.indices) # <<<<<<<<<<<<<< + * return BlockIndex(self.length, locs, lens) + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6pandas_7_sparse_get_blocks(((PyArrayObject *)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_v_locs = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_lens = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":88 + * def to_block_index(self): + * locs, lens = get_blocks(self.indices) + * return BlockIndex(self.length, locs, lens) # <<<<<<<<<<<<<< + * + * cpdef IntIndex intersect(self, SparseIndex y_): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_locs); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_locs); + __Pyx_GIVEREF(__pyx_v_locs); + __Pyx_INCREF(__pyx_v_lens); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_lens); + __Pyx_GIVEREF(__pyx_v_lens); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":86 + * return self + * + * def to_block_index(self): # <<<<<<<<<<<<<< + * locs, lens = get_blocks(self.indices) + * return BlockIndex(self.length, locs, lens) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas._sparse.IntIndex.to_block_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_locs); + __Pyx_XDECREF(__pyx_v_lens); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":90 + * return BlockIndex(self.length, locs, lens) + * + * cpdef IntIndex intersect(self, SparseIndex y_): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t out_length, xi, yi = 0 + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/ +static struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_f_6pandas_7_sparse_8IntIndex_intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + __pyx_t_5numpy_int32_t __pyx_v_xind; + PyArrayObject *__pyx_v_xindices = 0; + PyArrayObject *__pyx_v_yindices = 0; + PyObject *__pyx_v_new_list = 0; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_y = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices; + __Pyx_Buffer __pyx_pybuffer_xindices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices; + __Pyx_Buffer __pyx_pybuffer_yindices; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersect", 0); + __pyx_pybuffer_xindices.pybuffer.buf = NULL; + __pyx_pybuffer_xindices.refcount = 0; + __pyx_pybuffernd_xindices.data = NULL; + __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices; + __pyx_pybuffer_yindices.pybuffer.buf = NULL; + __pyx_pybuffer_yindices.refcount = 0; + __pyx_pybuffernd_yindices.data = NULL; + __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_intersect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_y_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_y_)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":92 + * cpdef IntIndex intersect(self, SparseIndex y_): + * cdef: + * Py_ssize_t out_length, xi, yi = 0 # <<<<<<<<<<<<<< + * int32_t xind + * ndarray[int32_t, ndim=1] xindices, yindices + */ + __pyx_v_yi = 0; + + /* "pandas/src/sparse.pyx":95 + * int32_t xind + * ndarray[int32_t, ndim=1] xindices, yindices + * list new_list = [] # <<<<<<<<<<<<<< + * IntIndex y + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_new_list = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":99 + * + * # if is one already, returns self + * y = y_.to_int_index() # <<<<<<<<<<<<<< + * + * if self.length != y.length: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":101 + * y = y_.to_int_index() + * + * if self.length != y.length: # <<<<<<<<<<<<<< + * raise Exception('Indices must reference same underlying length') + * + */ + __pyx_t_4 = ((__pyx_v_self->length != __pyx_v_y->length) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":102 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xindices = self.indices + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":104 + * raise Exception('Indices must reference same underlying length') + * + * xindices = self.indices # <<<<<<<<<<<<<< + * yindices = y.indices + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xindices = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":105 + * + * xindices = self.indices + * yindices = y.indices # <<<<<<<<<<<<<< + * + * for xi from 0 <= xi < self.npoints: + */ + __pyx_t_3 = ((PyObject *)__pyx_v_y->indices); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yindices = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":107 + * yindices = y.indices + * + * for xi from 0 <= xi < self.npoints: # <<<<<<<<<<<<<< + * xind = xindices[xi] + * + */ + __pyx_t_9 = __pyx_v_self->npoints; + for (__pyx_v_xi = 0; __pyx_v_xi < __pyx_t_9; __pyx_v_xi++) { + + /* "pandas/src/sparse.pyx":108 + * + * for xi from 0 <= xi < self.npoints: + * xind = xindices[xi] # <<<<<<<<<<<<<< + * + * while yi < y.npoints and yindices[yi] < xind: + */ + __pyx_t_10 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_xindices.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_xindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xind = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_xindices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":110 + * xind = xindices[xi] + * + * while yi < y.npoints and yindices[yi] < xind: # <<<<<<<<<<<<<< + * yi += 1 + * + */ + while (1) { + __pyx_t_4 = ((__pyx_v_yi < __pyx_v_y->npoints) != 0); + if (__pyx_t_4) { + __pyx_t_11 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_yindices.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_yindices.diminfo[0].strides)) < __pyx_v_xind) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_4; + } + if (!__pyx_t_13) break; + + /* "pandas/src/sparse.pyx":111 + * + * while yi < y.npoints and yindices[yi] < xind: + * yi += 1 # <<<<<<<<<<<<<< + * + * if yi >= y.npoints: + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":113 + * yi += 1 + * + * if yi >= y.npoints: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_13 = ((__pyx_v_yi >= __pyx_v_y->npoints) != 0); + if (__pyx_t_13) { + + /* "pandas/src/sparse.pyx":114 + * + * if yi >= y.npoints: + * break # <<<<<<<<<<<<<< + * + * # TODO: would a two-pass algorithm be faster? + */ + goto __pyx_L5_break; + } + + /* "pandas/src/sparse.pyx":117 + * + * # TODO: would a two-pass algorithm be faster? + * if yindices[yi] == xind: # <<<<<<<<<<<<<< + * new_list.append(xind) + * + */ + __pyx_t_14 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_yindices.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_yindices.diminfo[0].strides)) == __pyx_v_xind) != 0); + if (__pyx_t_13) { + + /* "pandas/src/sparse.pyx":118 + * # TODO: would a two-pass algorithm be faster? + * if yindices[yi] == xind: + * new_list.append(xind) # <<<<<<<<<<<<<< + * + * return IntIndex(self.length, new_list) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_3); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L9; + } + __pyx_L9:; + } + __pyx_L5_break:; + + /* "pandas/src/sparse.pyx":120 + * new_list.append(xind) + * + * return IntIndex(self.length, new_list) # <<<<<<<<<<<<<< + * + * cpdef IntIndex make_union(self, SparseIndex y_): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_new_list); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_new_list); + __Pyx_GIVEREF(__pyx_v_new_list); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":90 + * return BlockIndex(self.length, locs, lens) + * + * cpdef IntIndex intersect(self, SparseIndex y_): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t out_length, xi, yi = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_xindices); + __Pyx_XDECREF((PyObject *)__pyx_v_yindices); + __Pyx_XDECREF(__pyx_v_new_list); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersect (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y_)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersect", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->intersect(__pyx_v_self, __pyx_v_y_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":122 + * return IntIndex(self.length, new_list) + * + * cpdef IntIndex make_union(self, SparseIndex y_): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t out_length, i, xi, yi + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/ +static struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_f_6pandas_7_sparse_8IntIndex_make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + __pyx_t_5numpy_int32_t __pyx_v_xind; + PyArrayObject *__pyx_v_xindices = 0; + PyArrayObject *__pyx_v_yindices = 0; + PyObject *__pyx_v_new_list = 0; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_y = 0; + PyObject *__pyx_v_yind = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices; + __Pyx_Buffer __pyx_pybuffer_xindices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices; + __Pyx_Buffer __pyx_pybuffer_yindices; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_union", 0); + __pyx_pybuffer_xindices.pybuffer.buf = NULL; + __pyx_pybuffer_xindices.refcount = 0; + __pyx_pybuffernd_xindices.data = NULL; + __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices; + __pyx_pybuffer_yindices.pybuffer.buf = NULL; + __pyx_pybuffer_yindices.refcount = 0; + __pyx_pybuffernd_yindices.data = NULL; + __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_y_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_y_)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":127 + * int32_t xind + * ndarray[int32_t, ndim=1] xindices, yindices + * list new_list = [] # <<<<<<<<<<<<<< + * IntIndex x, y + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_new_list = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":130 + * IntIndex x, y + * + * x = self # <<<<<<<<<<<<<< + * + * # if is one already, returns self + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_v_x = __pyx_v_self; + + /* "pandas/src/sparse.pyx":133 + * + * # if is one already, returns self + * y = y_.to_int_index() # <<<<<<<<<<<<<< + * + * if self.length != y.length: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":135 + * y = y_.to_int_index() + * + * if self.length != y.length: # <<<<<<<<<<<<<< + * raise Exception('Indices must reference same underlying length') + * + */ + __pyx_t_4 = ((__pyx_v_self->length != __pyx_v_y->length) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":136 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xindices = self.indices + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":138 + * raise Exception('Indices must reference same underlying length') + * + * xindices = self.indices # <<<<<<<<<<<<<< + * yindices = y.indices + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xindices = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":139 + * + * xindices = self.indices + * yindices = y.indices # <<<<<<<<<<<<<< + * + * xi = yi = 0 + */ + __pyx_t_3 = ((PyObject *)__pyx_v_y->indices); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yindices = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":141 + * yindices = y.indices + * + * xi = yi = 0 # <<<<<<<<<<<<<< + * while True: + * if xi == x.npoints: + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + + /* "pandas/src/sparse.pyx":142 + * + * xi = yi = 0 + * while True: # <<<<<<<<<<<<<< + * if xi == x.npoints: + * while yi < y.npoints: + */ + while (1) { + + /* "pandas/src/sparse.pyx":143 + * xi = yi = 0 + * while True: + * if xi == x.npoints: # <<<<<<<<<<<<<< + * while yi < y.npoints: + * new_list.append(yindices[yi]) + */ + __pyx_t_4 = ((__pyx_v_xi == __pyx_v_x->npoints) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":144 + * while True: + * if xi == x.npoints: + * while yi < y.npoints: # <<<<<<<<<<<<<< + * new_list.append(yindices[yi]) + * yi += 1 + */ + while (1) { + __pyx_t_4 = ((__pyx_v_yi < __pyx_v_y->npoints) != 0); + if (!__pyx_t_4) break; + + /* "pandas/src/sparse.pyx":145 + * if xi == x.npoints: + * while yi < y.npoints: + * new_list.append(yindices[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * break + */ + __pyx_t_9 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_yindices.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_yindices.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":146 + * while yi < y.npoints: + * new_list.append(yindices[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * break + * elif yi == y.npoints: + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":147 + * new_list.append(yindices[yi]) + * yi += 1 + * break # <<<<<<<<<<<<<< + * elif yi == y.npoints: + * while xi < x.npoints: + */ + goto __pyx_L5_break; + } + + /* "pandas/src/sparse.pyx":148 + * yi += 1 + * break + * elif yi == y.npoints: # <<<<<<<<<<<<<< + * while xi < x.npoints: + * new_list.append(xindices[xi]) + */ + __pyx_t_4 = ((__pyx_v_yi == __pyx_v_y->npoints) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":149 + * break + * elif yi == y.npoints: + * while xi < x.npoints: # <<<<<<<<<<<<<< + * new_list.append(xindices[xi]) + * xi += 1 + */ + while (1) { + __pyx_t_4 = ((__pyx_v_xi < __pyx_v_x->npoints) != 0); + if (!__pyx_t_4) break; + + /* "pandas/src/sparse.pyx":150 + * elif yi == y.npoints: + * while xi < x.npoints: + * new_list.append(xindices[xi]) # <<<<<<<<<<<<<< + * xi += 1 + * break + */ + __pyx_t_11 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_xindices.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_xindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_xindices.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":151 + * while xi < x.npoints: + * new_list.append(xindices[xi]) + * xi += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + } + + /* "pandas/src/sparse.pyx":152 + * new_list.append(xindices[xi]) + * xi += 1 + * break # <<<<<<<<<<<<<< + * + * xind = xindices[xi] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/sparse.pyx":154 + * break + * + * xind = xindices[xi] # <<<<<<<<<<<<<< + * yind = yindices[yi] + * + */ + __pyx_t_12 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_xindices.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_xindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xind = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_xindices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":155 + * + * xind = xindices[xi] + * yind = yindices[yi] # <<<<<<<<<<<<<< + * + * if xind == yind: + */ + __pyx_t_13 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_yindices.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_yindices.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_yind, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":157 + * yind = yindices[yi] + * + * if xind == yind: # <<<<<<<<<<<<<< + * new_list.append(xind) + * xi += 1 + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_yind, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":158 + * + * if xind == yind: + * new_list.append(xind) # <<<<<<<<<<<<<< + * xi += 1 + * yi += 1 + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":159 + * if xind == yind: + * new_list.append(xind) + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * elif xind < yind: + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":160 + * new_list.append(xind) + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * elif xind < yind: + * new_list.append(xind) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + goto __pyx_L11; + } + + /* "pandas/src/sparse.pyx":161 + * xi += 1 + * yi += 1 + * elif xind < yind: # <<<<<<<<<<<<<< + * new_list.append(xind) + * xi += 1 + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_yind, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":162 + * yi += 1 + * elif xind < yind: + * new_list.append(xind) # <<<<<<<<<<<<<< + * xi += 1 + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":163 + * elif xind < yind: + * new_list.append(xind) + * xi += 1 # <<<<<<<<<<<<<< + * else: + * new_list.append(yind) + */ + __pyx_v_xi = (__pyx_v_xi + 1); + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":165 + * xi += 1 + * else: + * new_list.append(yind) # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_v_yind); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":166 + * else: + * new_list.append(yind) + * yi += 1 # <<<<<<<<<<<<<< + * + * return IntIndex(x.length, new_list) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + __pyx_L11:; + } + __pyx_L5_break:; + + /* "pandas/src/sparse.pyx":168 + * yi += 1 + * + * return IntIndex(x.length, new_list) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_x->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_new_list); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_new_list); + __Pyx_GIVEREF(__pyx_v_new_list); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":122 + * return IntIndex(self.length, new_list) + * + * cpdef IntIndex make_union(self, SparseIndex y_): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t out_length, i, xi, yi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_xindices); + __Pyx_XDECREF((PyObject *)__pyx_v_yindices); + __Pyx_XDECREF(__pyx_v_new_list); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF(__pyx_v_yind); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_union (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y_)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_union", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->make_union(__pyx_v_self, __pyx_v_y_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":171 + * + * @cython.wraparound(False) + * cpdef lookup(self, Py_ssize_t index): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t res, n, cum_len = 0 + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_res; + CYTHON_UNUSED Py_ssize_t __pyx_v_cum_len; + PyArrayObject *__pyx_v_inds = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_inds; + __Pyx_Buffer __pyx_pybuffer_inds; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_inds.pybuffer.buf = NULL; + __pyx_pybuffer_inds.refcount = 0; + __pyx_pybuffernd_inds.data = NULL; + __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":173 + * cpdef lookup(self, Py_ssize_t index): + * cdef: + * Py_ssize_t res, n, cum_len = 0 # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] inds + * + */ + __pyx_v_cum_len = 0; + + /* "pandas/src/sparse.pyx":176 + * ndarray[int32_t, ndim=1] inds + * + * inds = self.indices # <<<<<<<<<<<<<< + * res = inds.searchsorted(index) + * if res == self.npoints: + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_inds = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":177 + * + * inds = self.indices + * res = inds.searchsorted(index) # <<<<<<<<<<<<<< + * if res == self.npoints: + * return -1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_inds), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_res = __pyx_t_8; + + /* "pandas/src/sparse.pyx":178 + * inds = self.indices + * res = inds.searchsorted(index) + * if res == self.npoints: # <<<<<<<<<<<<<< + * return -1 + * elif inds[res] == index: + */ + __pyx_t_9 = ((__pyx_v_res == __pyx_v_self->npoints) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":179 + * res = inds.searchsorted(index) + * if res == self.npoints: + * return -1 # <<<<<<<<<<<<<< + * elif inds[res] == index: + * return res + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":180 + * if res == self.npoints: + * return -1 + * elif inds[res] == index: # <<<<<<<<<<<<<< + * return res + * else: + */ + __pyx_t_8 = __pyx_v_res; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_inds.diminfo[0].strides)) == __pyx_v_index) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":181 + * return -1 + * elif inds[res] == index: + * return res # <<<<<<<<<<<<<< + * else: + * return -1 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":183 + * return res + * else: + * return -1 # <<<<<<<<<<<<<< + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":171 + * + * @cython.wraparound(False) + * cpdef lookup(self, Py_ssize_t index): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t res, n, cum_len = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_inds); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) { + Py_ssize_t __pyx_v_index; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + assert(__pyx_arg_index); { + __pyx_v_index = __Pyx_PyIndex_AsSsize_t(__pyx_arg_index); if (unlikely((__pyx_v_index == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((Py_ssize_t)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->lookup(__pyx_v_self, __pyx_v_index, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":185 + * return -1 + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * float64_t fill_value, SparseIndex other_): + * cdef: + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_7_sparse_8IntIndex_reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_other = 0; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_sinds = 0; + PyArrayObject *__pyx_v_oinds = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_oinds; + __Pyx_Buffer __pyx_pybuffer_oinds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sinds; + __Pyx_Buffer __pyx_pybuffer_sinds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_sinds.pybuffer.buf = NULL; + __pyx_pybuffer_sinds.refcount = 0; + __pyx_pybuffernd_sinds.data = NULL; + __pyx_pybuffernd_sinds.rcbuffer = &__pyx_pybuffer_sinds; + __pyx_pybuffer_oinds.pybuffer.buf = NULL; + __pyx_pybuffer_oinds.refcount = 0; + __pyx_pybuffernd_oinds.data = NULL; + __pyx_pybuffernd_oinds.rcbuffer = &__pyx_pybuffer_oinds; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_other_)); + PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_other_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_other_)); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":188 + * float64_t fill_value, SparseIndex other_): + * cdef: + * Py_ssize_t i = 0, j = 0 # <<<<<<<<<<<<<< + * IntIndex other + * ndarray[float64_t, ndim=1] result + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/sparse.pyx":193 + * ndarray[int32_t, ndim=1] sinds, oinds + * + * other = other_.to_int_index() # <<<<<<<<<<<<<< + * + * oinds = other.indices + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_other = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":195 + * other = other_.to_int_index() + * + * oinds = other.indices # <<<<<<<<<<<<<< + * sinds = self.indices + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_other->indices); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_oinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_oinds.diminfo[0].strides = __pyx_pybuffernd_oinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oinds.diminfo[0].shape = __pyx_pybuffernd_oinds.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_oinds = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":196 + * + * oinds = other.indices + * sinds = self.indices # <<<<<<<<<<<<<< + * + * result = np.empty(other.npoints, dtype=np.float64) + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_sinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_sinds.diminfo[0].strides = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sinds.diminfo[0].shape = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_sinds = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":198 + * sinds = self.indices + * + * result = np.empty(other.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * result.fill(fill_value) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_other->npoints); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":199 + * + * result = np.empty(other.npoints, dtype=np.float64) + * result.fill(fill_value) # <<<<<<<<<<<<<< + * + * for 0 <= i < other.npoints: + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_fill); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":201 + * result.fill(fill_value) + * + * for 0 <= i < other.npoints: # <<<<<<<<<<<<<< + * while oinds[i] > sinds[j] and j < self.npoints: + * j += 1 + */ + __pyx_t_11 = __pyx_v_other->npoints; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":202 + * + * for 0 <= i < other.npoints: + * while oinds[i] > sinds[j] and j < self.npoints: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_oinds.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_sinds.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_oinds.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0); + if (__pyx_t_14) { + __pyx_t_15 = ((__pyx_v_j < __pyx_v_self->npoints) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_14; + } + if (!__pyx_t_16) break; + + /* "pandas/src/sparse.pyx":203 + * for 0 <= i < other.npoints: + * while oinds[i] > sinds[j] and j < self.npoints: + * j += 1 # <<<<<<<<<<<<<< + * + * if j == self.npoints: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/sparse.pyx":205 + * j += 1 + * + * if j == self.npoints: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_self->npoints) != 0); + if (__pyx_t_16) { + + /* "pandas/src/sparse.pyx":206 + * + * if j == self.npoints: + * break # <<<<<<<<<<<<<< + * + * if oinds[i] < sinds[j]: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/sparse.pyx":208 + * break + * + * if oinds[i] < sinds[j]: # <<<<<<<<<<<<<< + * continue + * elif oinds[i] == sinds[j]: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_oinds.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_sinds.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_oinds.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/sparse.pyx":209 + * + * if oinds[i] < sinds[j]: + * continue # <<<<<<<<<<<<<< + * elif oinds[i] == sinds[j]: + * result[i] = values[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":210 + * if oinds[i] < sinds[j]: + * continue + * elif oinds[i] == sinds[j]: # <<<<<<<<<<<<<< + * result[i] = values[j] + * j += 1 + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_oinds.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_20 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_sinds.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_oinds.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/sparse.pyx":211 + * continue + * elif oinds[i] == sinds[j]: + * result[i] = values[j] # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":212 + * elif oinds[i] == sinds[j]: + * result[i] = values[j] + * j += 1 # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L8; + } + __pyx_L8:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/sparse.pyx":214 + * j += 1 + * + * return result # <<<<<<<<<<<<<< + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyArrayObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":185 + * return -1 + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * float64_t fill_value, SparseIndex other_): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_other); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_sinds); + __Pyx_XDECREF((PyObject *)__pyx_v_oinds); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + __pyx_t_5numpy_float64_t __pyx_v_fill_value; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reindex (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_fill_value,&__pyx_n_s_other,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_fill_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fill_value == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_other_ = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_22reindex(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_22reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->reindex(__pyx_v_self, __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":216 + * return result + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_put(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_to_put, int __pyx_skip_dispatch) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_25put)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __Pyx_INCREF(__pyx_v_to_put); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_to_put); + __Pyx_GIVEREF(__pyx_v_to_put); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":218 + * cpdef put(self, ndarray[float64_t, ndim=1] values, + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass # <<<<<<<<<<<<<< + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":216 + * return result + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indices = 0; + PyObject *__pyx_v_to_put = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,&__pyx_n_s_to_put,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_put)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indices = ((PyArrayObject *)values[1]); + __pyx_v_to_put = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_24put(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices, __pyx_v_to_put); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_24put(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_values, __pyx_v_indices, __pyx_v_to_put, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":220 + * pass + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices): + * pass + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_take(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, int __pyx_skip_dispatch) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_27take)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":222 + * cpdef take(self, ndarray[float64_t, ndim=1] values, + * ndarray[int32_t, ndim=1] indices): + * pass # <<<<<<<<<<<<<< + * + * cpdef get_blocks(ndarray[int32_t, ndim=1] indices): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":220 + * pass + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices): + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indices = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indices = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_26take(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_26take(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->take(__pyx_v_self, __pyx_v_values, __pyx_v_indices, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":44 + * ''' + * cdef readonly: + * Py_ssize_t length, npoints # <<<<<<<<<<<<<< + * ndarray indices + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.npoints.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":45 + * cdef readonly: + * Py_ssize_t length, npoints + * ndarray indices # <<<<<<<<<<<<<< + * + * def __init__(self, Py_ssize_t length, indices): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->indices)); + __pyx_r = ((PyObject *)__pyx_v_self->indices); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":224 + * pass + * + * cpdef get_blocks(ndarray[int32_t, ndim=1] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, npoints + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_get_blocks(PyArrayObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_npoints; + __pyx_t_5numpy_int32_t __pyx_v_block; + __pyx_t_5numpy_int32_t __pyx_v_length; + __pyx_t_5numpy_int32_t __pyx_v_cur; + __pyx_t_5numpy_int32_t __pyx_v_prev; + PyObject *__pyx_v_locs = 0; + PyObject *__pyx_v_lens = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + long __pyx_t_6; + int __pyx_t_7; + __pyx_t_5numpy_int32_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_blocks", 0); + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/sparse.pyx":227 + * cdef: + * Py_ssize_t i, npoints + * int32_t block, length = 1, cur, prev # <<<<<<<<<<<<<< + * list locs = [], lens = [] + * + */ + __pyx_v_length = 1; + + /* "pandas/src/sparse.pyx":228 + * Py_ssize_t i, npoints + * int32_t block, length = 1, cur, prev + * list locs = [], lens = [] # <<<<<<<<<<<<<< + * + * npoints = len(indices) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_locs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_lens = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":230 + * list locs = [], lens = [] + * + * npoints = len(indices) # <<<<<<<<<<<<<< + * + * # just handle the special empty case separately + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indices)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_npoints = __pyx_t_2; + + /* "pandas/src/sparse.pyx":233 + * + * # just handle the special empty case separately + * if npoints == 0: # <<<<<<<<<<<<<< + * return [], [] + * + */ + __pyx_t_3 = ((__pyx_v_npoints == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/sparse.pyx":234 + * # just handle the special empty case separately + * if npoints == 0: + * return [], [] # <<<<<<<<<<<<<< + * + * # TODO: two-pass algorithm faster? + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":237 + * + * # TODO: two-pass algorithm faster? + * prev = block = indices[0] # <<<<<<<<<<<<<< + * for i from 1 <= i < npoints: + * cur = indices[i] + */ + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_indices.diminfo[0].strides)); + __pyx_v_prev = __pyx_t_8; + __pyx_v_block = __pyx_t_8; + + /* "pandas/src/sparse.pyx":238 + * # TODO: two-pass algorithm faster? + * prev = block = indices[0] + * for i from 1 <= i < npoints: # <<<<<<<<<<<<<< + * cur = indices[i] + * if cur - prev > 1: + */ + __pyx_t_2 = __pyx_v_npoints; + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":239 + * prev = block = indices[0] + * for i from 1 <= i < npoints: + * cur = indices[i] # <<<<<<<<<<<<<< + * if cur - prev > 1: + * # new block + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":240 + * for i from 1 <= i < npoints: + * cur = indices[i] + * if cur - prev > 1: # <<<<<<<<<<<<<< + * # new block + * locs.append(block) + */ + __pyx_t_3 = (((__pyx_v_cur - __pyx_v_prev) > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/sparse.pyx":242 + * if cur - prev > 1: + * # new block + * locs.append(block) # <<<<<<<<<<<<<< + * lens.append(length) + * block = cur + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_block); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_locs, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":243 + * # new block + * locs.append(block) + * lens.append(length) # <<<<<<<<<<<<<< + * block = cur + * length = 1 + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lens, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":244 + * locs.append(block) + * lens.append(length) + * block = cur # <<<<<<<<<<<<<< + * length = 1 + * else: + */ + __pyx_v_block = __pyx_v_cur; + + /* "pandas/src/sparse.pyx":245 + * lens.append(length) + * block = cur + * length = 1 # <<<<<<<<<<<<<< + * else: + * # same block, increment length + */ + __pyx_v_length = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":248 + * else: + * # same block, increment length + * length += 1 # <<<<<<<<<<<<<< + * + * prev = cur + */ + __pyx_v_length = (__pyx_v_length + 1); + } + __pyx_L6:; + + /* "pandas/src/sparse.pyx":250 + * length += 1 + * + * prev = cur # <<<<<<<<<<<<<< + * + * locs.append(block) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/sparse.pyx":252 + * prev = cur + * + * locs.append(block) # <<<<<<<<<<<<<< + * lens.append(length) + * return locs, lens + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_block); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_locs, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":253 + * + * locs.append(block) + * lens.append(length) # <<<<<<<<<<<<<< + * return locs, lens + * + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lens, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":254 + * locs.append(block) + * lens.append(length) + * return locs, lens # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_locs); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_locs); + __Pyx_GIVEREF(__pyx_v_locs); + __Pyx_INCREF(__pyx_v_lens); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_lens); + __Pyx_GIVEREF(__pyx_v_lens); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":224 + * pass + * + * cpdef get_blocks(ndarray[int32_t, ndim=1] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, npoints + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.get_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_locs); + __Pyx_XDECREF(__pyx_v_lens); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_blocks (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_get_blocks(__pyx_self, ((PyArrayObject *)__pyx_v_indices)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_get_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_blocks", 0); + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_get_blocks(__pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.get_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":274 + * int32_t* locbuf, *lenbuf + * + * def __init__(self, length, blocs, blengths): # <<<<<<<<<<<<<< + * + * self.blocs = np.ascontiguousarray(blocs, dtype=np.int32) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_length = 0; + PyObject *__pyx_v_blocs = 0; + PyObject *__pyx_v_blengths = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_blocs,&__pyx_n_s_blengths,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blocs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blengths)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_length = values[0]; + __pyx_v_blocs = values[1]; + __pyx_v_blengths = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_length, __pyx_v_blocs, __pyx_v_blengths); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_blocs, PyObject *__pyx_v_blengths) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/sparse.pyx":276 + * def __init__(self, length, blocs, blengths): + * + * self.blocs = np.ascontiguousarray(blocs, dtype=np.int32) # <<<<<<<<<<<<<< + * self.blengths = np.ascontiguousarray(blengths, dtype=np.int32) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_blocs); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_blocs); + __Pyx_GIVEREF(__pyx_v_blocs); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->blocs); + __Pyx_DECREF(((PyObject *)__pyx_v_self->blocs)); + __pyx_v_self->blocs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":277 + * + * self.blocs = np.ascontiguousarray(blocs, dtype=np.int32) + * self.blengths = np.ascontiguousarray(blengths, dtype=np.int32) # <<<<<<<<<<<<<< + * + * # in case we need + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_blengths); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_blengths); + __Pyx_GIVEREF(__pyx_v_blengths); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->blengths); + __Pyx_DECREF(((PyObject *)__pyx_v_self->blengths)); + __pyx_v_self->blengths = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/sparse.pyx":280 + * + * # in case we need + * self.locbuf = self.blocs.data # <<<<<<<<<<<<<< + * self.lenbuf = self.blengths.data + * + */ + __pyx_v_self->locbuf = ((__pyx_t_5numpy_int32_t *)__pyx_v_self->blocs->data); + + /* "pandas/src/sparse.pyx":281 + * # in case we need + * self.locbuf = self.blocs.data + * self.lenbuf = self.blengths.data # <<<<<<<<<<<<<< + * + * self.length = length + */ + __pyx_v_self->lenbuf = ((__pyx_t_5numpy_int32_t *)__pyx_v_self->blengths->data); + + /* "pandas/src/sparse.pyx":283 + * self.lenbuf = self.blengths.data + * + * self.length = length # <<<<<<<<<<<<<< + * self.nblocks = len(self.blocs) + * self.npoints = self.blengths.sum() + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_length); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->length = __pyx_t_6; + + /* "pandas/src/sparse.pyx":284 + * + * self.length = length + * self.nblocks = len(self.blocs) # <<<<<<<<<<<<<< + * self.npoints = self.blengths.sum() + * + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_self->nblocks = __pyx_t_6; + + /* "pandas/src/sparse.pyx":285 + * self.length = length + * self.nblocks = len(self.blocs) + * self.npoints = self.blengths.sum() # <<<<<<<<<<<<<< + * + * # self.block_start = blocs + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->blengths), __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->npoints = __pyx_t_6; + + /* "pandas/src/sparse.pyx":290 + * # self.block_end = blocs + blengths + * + * self.check_integrity() # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->check_integrity(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":274 + * int32_t* locbuf, *lenbuf + * + * def __init__(self, length, blocs, blengths): # <<<<<<<<<<<<<< + * + * self.blocs = np.ascontiguousarray(blocs, dtype=np.int32) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":292 + * self.check_integrity() + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * args = (self.length, self.blocs, self.blengths) + * return (BlockIndex, args) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "pandas/src/sparse.pyx":293 + * + * def __reduce__(self): + * args = (self.length, self.blocs, self.blengths) # <<<<<<<<<<<<<< + * return (BlockIndex, args) + * + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->blocs)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blocs)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->blengths)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blengths)); + __pyx_t_1 = 0; + __pyx_v_args = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":294 + * def __reduce__(self): + * args = (self.length, self.blocs, self.blengths) + * return (BlockIndex, args) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex))); + __Pyx_INCREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":292 + * self.check_integrity() + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * args = (self.length, self.blocs, self.blengths) + * return (BlockIndex, args) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":296 + * return (BlockIndex, args) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * output = 'BlockIndex\n' + * output += 'Block locations: %s\n' % repr(self.blocs) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "pandas/src/sparse.pyx":297 + * + * def __repr__(self): + * output = 'BlockIndex\n' # <<<<<<<<<<<<<< + * output += 'Block locations: %s\n' % repr(self.blocs) + * output += 'Block lengths: %s' % repr(self.blengths) + */ + __Pyx_INCREF(__pyx_n_s_BlockIndex); + __pyx_v_output = __pyx_n_s_BlockIndex; + + /* "pandas/src/sparse.pyx":298 + * def __repr__(self): + * output = 'BlockIndex\n' + * output += 'Block locations: %s\n' % repr(self.blocs) # <<<<<<<<<<<<<< + * output += 'Block lengths: %s' % repr(self.blengths) + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Block_locations_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":299 + * output = 'BlockIndex\n' + * output += 'Block locations: %s\n' % repr(self.blocs) + * output += 'Block lengths: %s' % repr(self.blengths) # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Block_lengths_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":301 + * output += 'Block lengths: %s' % repr(self.blengths) + * + * return output # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_output); + __pyx_r = __pyx_v_output; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":296 + * return (BlockIndex, args) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * output = 'BlockIndex\n' + * output += 'Block locations: %s\n' % repr(self.blocs) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":304 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ngaps (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ngaps", 0); + + /* "pandas/src/sparse.pyx":305 + * @property + * def ngaps(self): + * return self.length - self.npoints # <<<<<<<<<<<<<< + * + * cpdef check_integrity(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->length - __pyx_v_self->npoints)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":304 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.ngaps", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":307 + * return self.length - self.npoints + * + * cpdef check_integrity(self): # <<<<<<<<<<<<<< + * ''' + * Check: + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_blocs = 0; + PyArrayObject *__pyx_v_blengths = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_blengths; + __Pyx_Buffer __pyx_pybuffer_blengths; + __Pyx_LocalBuf_ND __pyx_pybuffernd_blocs; + __Pyx_Buffer __pyx_pybuffer_blocs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_integrity", 0); + __pyx_pybuffer_blocs.pybuffer.buf = NULL; + __pyx_pybuffer_blocs.refcount = 0; + __pyx_pybuffernd_blocs.data = NULL; + __pyx_pybuffernd_blocs.rcbuffer = &__pyx_pybuffer_blocs; + __pyx_pybuffer_blengths.pybuffer.buf = NULL; + __pyx_pybuffer_blengths.refcount = 0; + __pyx_pybuffernd_blengths.data = NULL; + __pyx_pybuffernd_blengths.rcbuffer = &__pyx_pybuffer_blengths; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_integrity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":318 + * ndarray[int32_t, ndim=1] blocs, blengths + * + * blocs = self.blocs # <<<<<<<<<<<<<< + * blengths = self.blengths + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_blocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_blocs.diminfo[0].strides = __pyx_pybuffernd_blocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_blocs.diminfo[0].shape = __pyx_pybuffernd_blocs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_blocs = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":319 + * + * blocs = self.blocs + * blengths = self.blengths # <<<<<<<<<<<<<< + * + * if len(blocs) != len(blengths): + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer, (PyObject*)__pyx_v_blengths, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_blengths.diminfo[0].strides = __pyx_pybuffernd_blengths.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_blengths.diminfo[0].shape = __pyx_pybuffernd_blengths.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_blengths = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":321 + * blengths = self.blengths + * + * if len(blocs) != len(blengths): # <<<<<<<<<<<<<< + * raise ValueError('block bound arrays must be same length') + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_blocs)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_blengths)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":322 + * + * if len(blocs) != len(blengths): + * raise ValueError('block bound arrays must be same length') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < self.nblocks: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":324 + * raise ValueError('block bound arrays must be same length') + * + * for i from 0 <= i < self.nblocks: # <<<<<<<<<<<<<< + * if i > 0: + * if blocs[i] <= blocs[i-1]: + */ + __pyx_t_8 = __pyx_v_self->nblocks; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":325 + * + * for i from 0 <= i < self.nblocks: + * if i > 0: # <<<<<<<<<<<<<< + * if blocs[i] <= blocs[i-1]: + * raise ValueError('Locations not in ascending order') + */ + __pyx_t_9 = ((__pyx_v_i > 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":326 + * for i from 0 <= i < self.nblocks: + * if i > 0: + * if blocs[i] <= blocs[i-1]: # <<<<<<<<<<<<<< + * raise ValueError('Locations not in ascending order') + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = (__pyx_v_i - 1); + __pyx_t_3 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_blocs.diminfo[0].strides)) <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_blocs.diminfo[0].strides))) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":327 + * if i > 0: + * if blocs[i] <= blocs[i-1]: + * raise ValueError('Locations not in ascending order') # <<<<<<<<<<<<<< + * + * if i < self.nblocks - 1: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/sparse.pyx":329 + * raise ValueError('Locations not in ascending order') + * + * if i < self.nblocks - 1: # <<<<<<<<<<<<<< + * if blocs[i] + blengths[i] > blocs[i + 1]: + * raise ValueError('Block %d overlaps' % i) + */ + __pyx_t_9 = ((__pyx_v_i < (__pyx_v_self->nblocks - 1)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":330 + * + * if i < self.nblocks - 1: + * if blocs[i] + blengths[i] > blocs[i + 1]: # <<<<<<<<<<<<<< + * raise ValueError('Block %d overlaps' % i) + * else: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_blengths.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (__pyx_v_i + 1); + __pyx_t_3 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_blocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_blengths.diminfo[0].strides))) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_blocs.diminfo[0].strides))) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":331 + * if i < self.nblocks - 1: + * if blocs[i] + blengths[i] > blocs[i + 1]: + * raise ValueError('Block %d overlaps' % i) # <<<<<<<<<<<<<< + * else: + * if blocs[i] + blengths[i] > self.length: + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Block_d_overlaps, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":333 + * raise ValueError('Block %d overlaps' % i) + * else: + * if blocs[i] + blengths[i] > self.length: # <<<<<<<<<<<<<< + * raise ValueError('Block %d extends beyond end' % i) + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_blengths.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_blocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_blengths.diminfo[0].strides))) > __pyx_v_self->length) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":334 + * else: + * if blocs[i] + blengths[i] > self.length: + * raise ValueError('Block %d extends beyond end' % i) # <<<<<<<<<<<<<< + * + * # no zero-length blocks + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Block_d_extends_beyond_end, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L8:; + + /* "pandas/src/sparse.pyx":337 + * + * # no zero-length blocks + * if blengths[i] == 0: # <<<<<<<<<<<<<< + * raise ValueError('Zero-length block %d' % i) + * + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_blengths.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_blengths.diminfo[0].strides)) == 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":338 + * # no zero-length blocks + * if blengths[i] == 0: + * raise ValueError('Zero-length block %d' % i) # <<<<<<<<<<<<<< + * + * def equals(self, other): + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Zero_length_block_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + + /* "pandas/src/sparse.pyx":307 + * return self.length - self.npoints + * + * cpdef check_integrity(self): # <<<<<<<<<<<<<< + * ''' + * Check: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.check_integrity", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_blocs); + __Pyx_XDECREF((PyObject *)__pyx_v_blengths); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_10BlockIndex_8check_integrity[] = "\n Check:\n - Locations are in ascending order\n - No overlapping blocks\n - Blocks to not start after end of index, nor extend beyond end\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_integrity (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_integrity", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->check_integrity(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.check_integrity", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":340 + * raise ValueError('Zero-length block %d' % i) + * + * def equals(self, other): # <<<<<<<<<<<<<< + * if not isinstance(other, BlockIndex): + * return False + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_same_length = NULL; + PyObject *__pyx_v_same_blocks = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "pandas/src/sparse.pyx":341 + * + * def equals(self, other): + * if not isinstance(other, BlockIndex): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/sparse.pyx":342 + * def equals(self, other): + * if not isinstance(other, BlockIndex): + * return False # <<<<<<<<<<<<<< + * + * if self is other: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":344 + * return False + * + * if self is other: # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_2 = (((PyObject *)__pyx_v_self) == __pyx_v_other); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":345 + * + * if self is other: + * return True # <<<<<<<<<<<<<< + * + * same_length = self.length == other.length + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":347 + * return True + * + * same_length = self.length == other.length # <<<<<<<<<<<<<< + * same_blocks = (np.array_equal(self.blocs, other.blocs) and + * np.array_equal(self.blengths, other.blengths)) + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_same_length = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":348 + * + * same_length = self.length == other.length + * same_blocks = (np.array_equal(self.blocs, other.blocs) and # <<<<<<<<<<<<<< + * np.array_equal(self.blengths, other.blengths)) + * return same_length and same_blocks + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_blocs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->blocs)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blocs)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":349 + * same_length = self.length == other.length + * same_blocks = (np.array_equal(self.blocs, other.blocs) and + * np.array_equal(self.blengths, other.blengths)) # <<<<<<<<<<<<<< + * return same_length and same_blocks + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_blengths); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self->blengths)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blengths)); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_v_same_blocks = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/src/sparse.pyx":350 + * same_blocks = (np.array_equal(self.blocs, other.blocs) and + * np.array_equal(self.blengths, other.blengths)) + * return same_length and same_blocks # <<<<<<<<<<<<<< + * + * def to_block_index(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_same_length); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __Pyx_INCREF(__pyx_v_same_blocks); + __pyx_t_6 = __pyx_v_same_blocks; + } else { + __Pyx_INCREF(__pyx_v_same_length); + __pyx_t_6 = __pyx_v_same_length; + } + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":340 + * raise ValueError('Zero-length block %d' % i) + * + * def equals(self, other): # <<<<<<<<<<<<<< + * if not isinstance(other, BlockIndex): + * return False + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_same_length); + __Pyx_XDECREF(__pyx_v_same_blocks); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":352 + * return same_length and same_blocks + * + * def to_block_index(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_block_index (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_block_index", 0); + + /* "pandas/src/sparse.pyx":353 + * + * def to_block_index(self): + * return self # <<<<<<<<<<<<<< + * + * def to_int_index(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":352 + * return same_length and same_blocks + * + * def to_block_index(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":355 + * return self + * + * def to_int_index(self): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i = 0, j, b + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_int_index (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_int32_t __pyx_v_offset; + PyArrayObject *__pyx_v_indices = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + __pyx_t_5numpy_int32_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_int_index", 0); + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + + /* "pandas/src/sparse.pyx":357 + * def to_int_index(self): + * cdef: + * Py_ssize_t i = 0, j, b # <<<<<<<<<<<<<< + * int32_t offset + * ndarray[int32_t, ndim=1] indices + */ + __pyx_v_i = 0; + + /* "pandas/src/sparse.pyx":361 + * ndarray[int32_t, ndim=1] indices + * + * indices = np.empty(self.npoints, dtype=np.int32) # <<<<<<<<<<<<<< + * + * for b from 0 <= b < self.nblocks: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_indices = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":363 + * indices = np.empty(self.npoints, dtype=np.int32) + * + * for b from 0 <= b < self.nblocks: # <<<<<<<<<<<<<< + * offset = self.locbuf[b] + * + */ + __pyx_t_11 = __pyx_v_self->nblocks; + for (__pyx_v_b = 0; __pyx_v_b < __pyx_t_11; __pyx_v_b++) { + + /* "pandas/src/sparse.pyx":364 + * + * for b from 0 <= b < self.nblocks: + * offset = self.locbuf[b] # <<<<<<<<<<<<<< + * + * for j from 0 <= j < self.lenbuf[b]: + */ + __pyx_v_offset = (__pyx_v_self->locbuf[__pyx_v_b]); + + /* "pandas/src/sparse.pyx":366 + * offset = self.locbuf[b] + * + * for j from 0 <= j < self.lenbuf[b]: # <<<<<<<<<<<<<< + * indices[i] = offset + j + * i += 1 + */ + __pyx_t_12 = (__pyx_v_self->lenbuf[__pyx_v_b]); + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_12; __pyx_v_j++) { + + /* "pandas/src/sparse.pyx":367 + * + * for j from 0 <= j < self.lenbuf[b]: + * indices[i] = offset + j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indices.diminfo[0].strides) = (__pyx_v_offset + __pyx_v_j); + + /* "pandas/src/sparse.pyx":368 + * for j from 0 <= j < self.lenbuf[b]: + * indices[i] = offset + j + * i += 1 # <<<<<<<<<<<<<< + * + * return IntIndex(self.length, indices) + */ + __pyx_v_i = (__pyx_v_i + 1); + } + } + + /* "pandas/src/sparse.pyx":370 + * i += 1 + * + * return IntIndex(self.length, indices) # <<<<<<<<<<<<<< + * + * cpdef BlockIndex intersect(self, SparseIndex other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":355 + * return self + * + * def to_int_index(self): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i = 0, j, b + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.to_int_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":372 + * return IntIndex(self.length, indices) + * + * cpdef BlockIndex intersect(self, SparseIndex other): # <<<<<<<<<<<<<< + * ''' + * Intersect two BlockIndex objects + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_f_6pandas_7_sparse_10BlockIndex_intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other, int __pyx_skip_dispatch) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y = 0; + PyArrayObject *__pyx_v_xloc = 0; + PyArrayObject *__pyx_v_xlen = 0; + PyArrayObject *__pyx_v_yloc = 0; + PyArrayObject *__pyx_v_ylen = 0; + PyObject *__pyx_v_out_blocs = 0; + PyObject *__pyx_v_out_blengths = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + __pyx_t_5numpy_int32_t __pyx_v_cur_loc; + __pyx_t_5numpy_int32_t __pyx_v_cur_length; + __pyx_t_5numpy_int32_t __pyx_v_diff; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xlen; + __Pyx_Buffer __pyx_pybuffer_xlen; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xloc; + __Pyx_Buffer __pyx_pybuffer_xloc; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ylen; + __Pyx_Buffer __pyx_pybuffer_ylen; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yloc; + __Pyx_Buffer __pyx_pybuffer_yloc; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersect", 0); + __pyx_pybuffer_xloc.pybuffer.buf = NULL; + __pyx_pybuffer_xloc.refcount = 0; + __pyx_pybuffernd_xloc.data = NULL; + __pyx_pybuffernd_xloc.rcbuffer = &__pyx_pybuffer_xloc; + __pyx_pybuffer_xlen.pybuffer.buf = NULL; + __pyx_pybuffer_xlen.refcount = 0; + __pyx_pybuffernd_xlen.data = NULL; + __pyx_pybuffernd_xlen.rcbuffer = &__pyx_pybuffer_xlen; + __pyx_pybuffer_yloc.pybuffer.buf = NULL; + __pyx_pybuffer_yloc.refcount = 0; + __pyx_pybuffernd_yloc.data = NULL; + __pyx_pybuffernd_yloc.rcbuffer = &__pyx_pybuffer_yloc; + __pyx_pybuffer_ylen.pybuffer.buf = NULL; + __pyx_pybuffer_ylen.refcount = 0; + __pyx_pybuffernd_ylen.data = NULL; + __pyx_pybuffernd_ylen.rcbuffer = &__pyx_pybuffer_ylen; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_intersect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_other)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_other)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_other)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":387 + * ndarray[int32_t, ndim=1] xloc, xlen, yloc, ylen + * + * list out_blocs = [] # <<<<<<<<<<<<<< + * list out_blengths = [] + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_out_blocs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":388 + * + * list out_blocs = [] + * list out_blengths = [] # <<<<<<<<<<<<<< + * + * Py_ssize_t xi = 0, yi = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_out_blengths = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":390 + * list out_blengths = [] + * + * Py_ssize_t xi = 0, yi = 0 # <<<<<<<<<<<<<< + * int32_t cur_loc, cur_length, diff + * + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + + /* "pandas/src/sparse.pyx":393 + * int32_t cur_loc, cur_length, diff + * + * y = other.to_block_index() # <<<<<<<<<<<<<< + * + * if self.length != y.length: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":395 + * y = other.to_block_index() + * + * if self.length != y.length: # <<<<<<<<<<<<<< + * raise Exception('Indices must reference same underlying length') + * + */ + __pyx_t_4 = ((__pyx_v_self->length != __pyx_v_y->length) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":396 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xloc = self.blocs + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":398 + * raise Exception('Indices must reference same underlying length') + * + * xloc = self.blocs # <<<<<<<<<<<<<< + * xlen = self.blengths + * yloc = y.blocs + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer, (PyObject*)__pyx_v_xloc, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_xloc.diminfo[0].strides = __pyx_pybuffernd_xloc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xloc.diminfo[0].shape = __pyx_pybuffernd_xloc.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xloc = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":399 + * + * xloc = self.blocs + * xlen = self.blengths # <<<<<<<<<<<<<< + * yloc = y.blocs + * ylen = y.blengths + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer, (PyObject*)__pyx_v_xlen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_xlen.diminfo[0].strides = __pyx_pybuffernd_xlen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xlen.diminfo[0].shape = __pyx_pybuffernd_xlen.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xlen = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":400 + * xloc = self.blocs + * xlen = self.blengths + * yloc = y.blocs # <<<<<<<<<<<<<< + * ylen = y.blengths + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_y->blocs); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer, (PyObject*)__pyx_v_yloc, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_yloc.diminfo[0].strides = __pyx_pybuffernd_yloc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yloc.diminfo[0].shape = __pyx_pybuffernd_yloc.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yloc = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":401 + * xlen = self.blengths + * yloc = y.blocs + * ylen = y.blengths # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_t_3 = ((PyObject *)__pyx_v_y->blengths); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer, (PyObject*)__pyx_v_ylen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_ylen.diminfo[0].strides = __pyx_pybuffernd_ylen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ylen.diminfo[0].shape = __pyx_pybuffernd_ylen.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ylen = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":403 + * ylen = y.blengths + * + * while True: # <<<<<<<<<<<<<< + * # we are done (or possibly never began) + * if xi >= self.nblocks or yi >= y.nblocks: + */ + while (1) { + + /* "pandas/src/sparse.pyx":405 + * while True: + * # we are done (or possibly never began) + * if xi >= self.nblocks or yi >= y.nblocks: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_xi >= __pyx_v_self->nblocks) != 0); + if (!__pyx_t_4) { + __pyx_t_9 = ((__pyx_v_yi >= __pyx_v_y->nblocks) != 0); + __pyx_t_10 = __pyx_t_9; + } else { + __pyx_t_10 = __pyx_t_4; + } + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":406 + * # we are done (or possibly never began) + * if xi >= self.nblocks or yi >= y.nblocks: + * break # <<<<<<<<<<<<<< + * + * # completely symmetric...would like to avoid code dup but oh well + */ + goto __pyx_L5_break; + } + + /* "pandas/src/sparse.pyx":409 + * + * # completely symmetric...would like to avoid code dup but oh well + * if xloc[xi] >= yloc[yi]: # <<<<<<<<<<<<<< + * cur_loc = xloc[xi] + * diff = xloc[xi] - yloc[yi] + */ + __pyx_t_11 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_xloc.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_yloc.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_xloc.diminfo[0].strides)) >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_yloc.diminfo[0].strides))) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":410 + * # completely symmetric...would like to avoid code dup but oh well + * if xloc[xi] >= yloc[yi]: + * cur_loc = xloc[xi] # <<<<<<<<<<<<<< + * diff = xloc[xi] - yloc[yi] + * + */ + __pyx_t_13 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_xloc.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_xloc.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":411 + * if xloc[xi] >= yloc[yi]: + * cur_loc = xloc[xi] + * diff = xloc[xi] - yloc[yi] # <<<<<<<<<<<<<< + * + * if ylen[yi] <= diff: + */ + __pyx_t_14 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_xloc.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_yloc.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_diff = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_xloc.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_yloc.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":413 + * diff = xloc[xi] - yloc[yi] + * + * if ylen[yi] <= diff: # <<<<<<<<<<<<<< + * # have to skip this block + * yi += 1 + */ + __pyx_t_16 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_ylen.diminfo[0].strides)) <= __pyx_v_diff) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":415 + * if ylen[yi] <= diff: + * # have to skip this block + * yi += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":416 + * # have to skip this block + * yi += 1 + * continue # <<<<<<<<<<<<<< + * + * if ylen[yi] - diff < xlen[xi]: + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/sparse.pyx":418 + * continue + * + * if ylen[yi] - diff < xlen[xi]: # <<<<<<<<<<<<<< + * # take end of y block, move onward + * cur_length = ylen[yi] - diff + */ + __pyx_t_17 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ylen.diminfo[0].strides)) - __pyx_v_diff) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_xlen.diminfo[0].strides))) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":420 + * if ylen[yi] - diff < xlen[xi]: + * # take end of y block, move onward + * cur_length = ylen[yi] - diff # <<<<<<<<<<<<<< + * yi += 1 + * else: + */ + __pyx_t_19 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_length = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ylen.diminfo[0].strides)) - __pyx_v_diff); + + /* "pandas/src/sparse.pyx":421 + * # take end of y block, move onward + * cur_length = ylen[yi] - diff + * yi += 1 # <<<<<<<<<<<<<< + * else: + * # take end of x block + */ + __pyx_v_yi = (__pyx_v_yi + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":424 + * else: + * # take end of x block + * cur_length = xlen[xi] # <<<<<<<<<<<<<< + * xi += 1 + * + */ + __pyx_t_20 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_length = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_xlen.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":425 + * # take end of x block + * cur_length = xlen[xi] + * xi += 1 # <<<<<<<<<<<<<< + * + * else: # xloc[xi] < yloc[yi] + */ + __pyx_v_xi = (__pyx_v_xi + 1); + } + __pyx_L9:; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":428 + * + * else: # xloc[xi] < yloc[yi] + * cur_loc = yloc[yi] # <<<<<<<<<<<<<< + * diff = yloc[yi] - xloc[xi] + * + */ + __pyx_t_21 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_yloc.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_yloc.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":429 + * else: # xloc[xi] < yloc[yi] + * cur_loc = yloc[yi] + * diff = yloc[yi] - xloc[xi] # <<<<<<<<<<<<<< + * + * if xlen[xi] <= diff: + */ + __pyx_t_22 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_yloc.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_xloc.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_diff = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_yloc.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_xloc.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":431 + * diff = yloc[yi] - xloc[xi] + * + * if xlen[xi] <= diff: # <<<<<<<<<<<<<< + * # have to skip this block + * xi += 1 + */ + __pyx_t_24 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_xlen.diminfo[0].strides)) <= __pyx_v_diff) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":433 + * if xlen[xi] <= diff: + * # have to skip this block + * xi += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":434 + * # have to skip this block + * xi += 1 + * continue # <<<<<<<<<<<<<< + * + * if xlen[xi] - diff < ylen[yi]: + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/sparse.pyx":436 + * continue + * + * if xlen[xi] - diff < ylen[yi]: # <<<<<<<<<<<<<< + * # take end of x block, move onward + * cur_length = xlen[xi] - diff + */ + __pyx_t_25 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_xlen.diminfo[0].strides)) - __pyx_v_diff) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ylen.diminfo[0].strides))) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":438 + * if xlen[xi] - diff < ylen[yi]: + * # take end of x block, move onward + * cur_length = xlen[xi] - diff # <<<<<<<<<<<<<< + * xi += 1 + * else: + */ + __pyx_t_27 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_length = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_xlen.diminfo[0].strides)) - __pyx_v_diff); + + /* "pandas/src/sparse.pyx":439 + * # take end of x block, move onward + * cur_length = xlen[xi] - diff + * xi += 1 # <<<<<<<<<<<<<< + * else: + * # take end of y block + */ + __pyx_v_xi = (__pyx_v_xi + 1); + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":442 + * else: + * # take end of y block + * cur_length = ylen[yi] # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_28 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_length = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ylen.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":443 + * # take end of y block + * cur_length = ylen[yi] + * yi += 1 # <<<<<<<<<<<<<< + * + * out_blocs.append(cur_loc) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + __pyx_L11:; + } + __pyx_L7:; + + /* "pandas/src/sparse.pyx":445 + * yi += 1 + * + * out_blocs.append(cur_loc) # <<<<<<<<<<<<<< + * out_blengths.append(cur_length) + * + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_cur_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_29 = __Pyx_PyList_Append(__pyx_v_out_blocs, __pyx_t_3); if (unlikely(__pyx_t_29 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":446 + * + * out_blocs.append(cur_loc) + * out_blengths.append(cur_length) # <<<<<<<<<<<<<< + * + * return BlockIndex(self.length, out_blocs, out_blengths) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_cur_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_29 = __Pyx_PyList_Append(__pyx_v_out_blengths, __pyx_t_3); if (unlikely(__pyx_t_29 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L4_continue:; + } + __pyx_L5_break:; + + /* "pandas/src/sparse.pyx":448 + * out_blengths.append(cur_length) + * + * return BlockIndex(self.length, out_blocs, out_blengths) # <<<<<<<<<<<<<< + * + * cpdef BlockIndex make_union(self, SparseIndex y): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_out_blocs); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_out_blocs); + __Pyx_GIVEREF(__pyx_v_out_blocs); + __Pyx_INCREF(__pyx_v_out_blengths); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_out_blengths); + __Pyx_GIVEREF(__pyx_v_out_blengths); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":372 + * return IntIndex(self.length, indices) + * + * cpdef BlockIndex intersect(self, SparseIndex other): # <<<<<<<<<<<<<< + * ''' + * Intersect two BlockIndex objects + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_xloc); + __Pyx_XDECREF((PyObject *)__pyx_v_xlen); + __Pyx_XDECREF((PyObject *)__pyx_v_yloc); + __Pyx_XDECREF((PyObject *)__pyx_v_ylen); + __Pyx_XDECREF(__pyx_v_out_blocs); + __Pyx_XDECREF(__pyx_v_out_blengths); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_10BlockIndex_16intersect[] = "\n Intersect two BlockIndex objects\n\n Parameters\n ----------\n\n Returns\n -------\n intersection : BlockIndex\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersect (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_other)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersect", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->intersect(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":450 + * return BlockIndex(self.length, out_blocs, out_blengths) + * + * cpdef BlockIndex make_union(self, SparseIndex y): # <<<<<<<<<<<<<< + * ''' + * Combine together two BlockIndex objects, accepting indices if contained + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/ +static struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_f_6pandas_7_sparse_10BlockIndex_make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y, int __pyx_skip_dispatch) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_union", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_y)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_y)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_y)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":467 + * union : BlockIndex + * ''' + * return BlockUnion(self, y.to_block_index()).result # <<<<<<<<<<<<<< + * + * cpdef lookup(self, Py_ssize_t index): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockUnion)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)__pyx_t_3)->__pyx_base.result)); + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)__pyx_t_3)->__pyx_base.result; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":450 + * return BlockIndex(self.length, out_blocs, out_blengths) + * + * cpdef BlockIndex make_union(self, SparseIndex y): # <<<<<<<<<<<<<< + * ''' + * Combine together two BlockIndex objects, accepting indices if contained + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_10BlockIndex_18make_union[] = "\n Combine together two BlockIndex objects, accepting indices if contained\n in one or the other\n\n Parameters\n ----------\n other : SparseIndex\n\n Notes\n -----\n union is a protected keyword in Cython, hence make_union\n\n Returns\n -------\n union : BlockIndex\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_union (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_union", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->make_union(__pyx_v_self, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":469 + * return BlockUnion(self, y.to_block_index()).result + * + * cpdef lookup(self, Py_ssize_t index): # <<<<<<<<<<<<<< + * ''' + * + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_cum_len; + PyArrayObject *__pyx_v_locs = 0; + PyArrayObject *__pyx_v_lens = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lens; + __Pyx_Buffer __pyx_pybuffer_lens; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_lens.pybuffer.buf = NULL; + __pyx_pybuffer_lens.refcount = 0; + __pyx_pybuffernd_lens.data = NULL; + __pyx_pybuffernd_lens.rcbuffer = &__pyx_pybuffer_lens; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":478 + * ndarray[int32_t, ndim=1] locs, lens + * + * locs = self.blocs # <<<<<<<<<<<<<< + * lens = self.blengths + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_v_locs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_locs = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":479 + * + * locs = self.blocs + * lens = self.blengths # <<<<<<<<<<<<<< + * + * if self.nblocks == 0: + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lens.rcbuffer->pybuffer, (PyObject*)__pyx_v_lens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_lens.diminfo[0].strides = __pyx_pybuffernd_lens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lens.diminfo[0].shape = __pyx_pybuffernd_lens.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lens = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":481 + * lens = self.blengths + * + * if self.nblocks == 0: # <<<<<<<<<<<<<< + * return -1 + * elif index < locs[0]: + */ + __pyx_t_8 = ((__pyx_v_self->nblocks == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":482 + * + * if self.nblocks == 0: + * return -1 # <<<<<<<<<<<<<< + * elif index < locs[0]: + * return -1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":483 + * if self.nblocks == 0: + * return -1 + * elif index < locs[0]: # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_t_9 = 0; + __pyx_t_4 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = ((__pyx_v_index < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_locs.diminfo[0].strides))) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":484 + * return -1 + * elif index < locs[0]: + * return -1 # <<<<<<<<<<<<<< + * + * cum_len = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":486 + * return -1 + * + * cum_len = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < self.nblocks: + * if index >= locs[i] and index < locs[i] + lens[i]: + */ + __pyx_v_cum_len = 0; + + /* "pandas/src/sparse.pyx":487 + * + * cum_len = 0 + * for i from 0 <= i < self.nblocks: # <<<<<<<<<<<<<< + * if index >= locs[i] and index < locs[i] + lens[i]: + * return cum_len + index - locs[i] + */ + __pyx_t_10 = __pyx_v_self->nblocks; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":488 + * cum_len = 0 + * for i from 0 <= i < self.nblocks: + * if index >= locs[i] and index < locs[i] + lens[i]: # <<<<<<<<<<<<<< + * return cum_len + index - locs[i] + * cum_len += lens[i] + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = ((__pyx_v_index >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_locs.diminfo[0].strides))) != 0); + if (__pyx_t_8) { + __pyx_t_12 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_lens.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_lens.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = ((__pyx_v_index < ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_lens.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_lens.diminfo[0].strides)))) != 0); + __pyx_t_15 = __pyx_t_14; + } else { + __pyx_t_15 = __pyx_t_8; + } + if (__pyx_t_15) { + + /* "pandas/src/sparse.pyx":489 + * for i from 0 <= i < self.nblocks: + * if index >= locs[i] and index < locs[i] + lens[i]: + * return cum_len + index - locs[i] # <<<<<<<<<<<<<< + * cum_len += lens[i] + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_16 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyInt_FromSsize_t(((__pyx_v_cum_len + __pyx_v_index) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_locs.diminfo[0].strides)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":490 + * if index >= locs[i] and index < locs[i] + lens[i]: + * return cum_len + index - locs[i] + * cum_len += lens[i] # <<<<<<<<<<<<<< + * + * return -1 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_lens.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_lens.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cum_len = (__pyx_v_cum_len + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_lens.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_lens.diminfo[0].strides))); + } + + /* "pandas/src/sparse.pyx":492 + * cum_len += lens[i] + * + * return -1 # <<<<<<<<<<<<<< + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":469 + * return BlockUnion(self, y.to_block_index()).result + * + * cpdef lookup(self, Py_ssize_t index): # <<<<<<<<<<<<<< + * ''' + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XDECREF((PyObject *)__pyx_v_lens); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_10BlockIndex_20lookup[] = "\n\n Returns -1 if not found\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) { + Py_ssize_t __pyx_v_index; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + assert(__pyx_arg_index); { + __pyx_v_index = __Pyx_PyIndex_AsSsize_t(__pyx_arg_index); if (unlikely((__pyx_v_index == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((Py_ssize_t)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->lookup(__pyx_v_self, __pyx_v_index, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":494 + * return -1 + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * float64_t fill_value, SparseIndex other_): + * cdef: + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_7_sparse_10BlockIndex_reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ocur; + CYTHON_UNUSED Py_ssize_t __pyx_v_ocurlen; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_other = 0; + CYTHON_UNUSED PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_slocs = 0; + PyArrayObject *__pyx_v_slens = 0; + PyArrayObject *__pyx_v_olocs = 0; + PyArrayObject *__pyx_v_olens = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_olens; + __Pyx_Buffer __pyx_pybuffer_olens; + __Pyx_LocalBuf_ND __pyx_pybuffernd_olocs; + __Pyx_Buffer __pyx_pybuffer_olocs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_slens; + __Pyx_Buffer __pyx_pybuffer_slens; + __Pyx_LocalBuf_ND __pyx_pybuffernd_slocs; + __Pyx_Buffer __pyx_pybuffer_slocs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_slocs.pybuffer.buf = NULL; + __pyx_pybuffer_slocs.refcount = 0; + __pyx_pybuffernd_slocs.data = NULL; + __pyx_pybuffernd_slocs.rcbuffer = &__pyx_pybuffer_slocs; + __pyx_pybuffer_slens.pybuffer.buf = NULL; + __pyx_pybuffer_slens.refcount = 0; + __pyx_pybuffernd_slens.data = NULL; + __pyx_pybuffernd_slens.rcbuffer = &__pyx_pybuffer_slens; + __pyx_pybuffer_olocs.pybuffer.buf = NULL; + __pyx_pybuffer_olocs.refcount = 0; + __pyx_pybuffernd_olocs.data = NULL; + __pyx_pybuffernd_olocs.rcbuffer = &__pyx_pybuffer_olocs; + __pyx_pybuffer_olens.pybuffer.buf = NULL; + __pyx_pybuffer_olens.refcount = 0; + __pyx_pybuffernd_olens.data = NULL; + __pyx_pybuffernd_olens.rcbuffer = &__pyx_pybuffer_olens; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_other_)); + PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_other_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_other_)); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":497 + * float64_t fill_value, SparseIndex other_): + * cdef: + * Py_ssize_t i = 0, j = 0, ocur, ocurlen # <<<<<<<<<<<<<< + * BlockIndex other + * ndarray[float64_t, ndim=1] result + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/sparse.pyx":502 + * ndarray[int32_t, ndim=1] slocs, slens, olocs, olens + * + * other = other_.to_block_index() # <<<<<<<<<<<<<< + * + * olocs = other.blocs + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other_), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_other = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":504 + * other = other_.to_block_index() + * + * olocs = other.blocs # <<<<<<<<<<<<<< + * olens = other.blengths + * slocs = self.blocs + */ + __pyx_t_2 = ((PyObject *)__pyx_v_other->blocs); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_olocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_olocs.diminfo[0].strides = __pyx_pybuffernd_olocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_olocs.diminfo[0].shape = __pyx_pybuffernd_olocs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_olocs = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":505 + * + * olocs = other.blocs + * olens = other.blengths # <<<<<<<<<<<<<< + * slocs = self.blocs + * slens = self.blengths + */ + __pyx_t_2 = ((PyObject *)__pyx_v_other->blengths); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olens.rcbuffer->pybuffer, (PyObject*)__pyx_v_olens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_olens.diminfo[0].strides = __pyx_pybuffernd_olens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_olens.diminfo[0].shape = __pyx_pybuffernd_olens.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_olens = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":506 + * olocs = other.blocs + * olens = other.blengths + * slocs = self.blocs # <<<<<<<<<<<<<< + * slens = self.blengths + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_slocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_slocs.diminfo[0].strides = __pyx_pybuffernd_slocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_slocs.diminfo[0].shape = __pyx_pybuffernd_slocs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_slocs = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":507 + * olens = other.blengths + * slocs = self.blocs + * slens = self.blengths # <<<<<<<<<<<<<< + * + * result = np.empty(other.npoints, dtype=np.float64) + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slens.rcbuffer->pybuffer, (PyObject*)__pyx_v_slens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_slens.diminfo[0].strides = __pyx_pybuffernd_slens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_slens.diminfo[0].shape = __pyx_pybuffernd_slens.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_slens = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":509 + * slens = self.blengths + * + * result = np.empty(other.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * for 0 <= i < other.nblocks: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_other->npoints); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":511 + * result = np.empty(other.npoints, dtype=np.float64) + * + * for 0 <= i < other.nblocks: # <<<<<<<<<<<<<< + * ocur = olocs[i] + * ocurlen = olens[i] + */ + __pyx_t_11 = __pyx_v_other->nblocks; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":512 + * + * for 0 <= i < other.nblocks: + * ocur = olocs[i] # <<<<<<<<<<<<<< + * ocurlen = olens[i] + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_olocs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_olocs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ocur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_olocs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_olocs.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":513 + * for 0 <= i < other.nblocks: + * ocur = olocs[i] + * ocurlen = olens[i] # <<<<<<<<<<<<<< + * + * while slocs[j] + slens[j] < ocur: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_olens.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_olens.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ocurlen = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_olens.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_olens.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":515 + * ocurlen = olens[i] + * + * while slocs[j] + slens[j] < ocur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_14 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_slocs.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_slocs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_slens.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_slens.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_slocs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_slocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_slens.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_slens.diminfo[0].strides))) < __pyx_v_ocur) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/sparse.pyx":516 + * + * while slocs[j] + slens[j] < ocur: + * j += 1 # <<<<<<<<<<<<<< + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, + */ + __pyx_v_j = (__pyx_v_j + 1); + } + } + + /* "pandas/src/sparse.pyx":494 + * return -1 + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * float64_t fill_value, SparseIndex other_): + * cdef: + */ + + /* function exit code */ + __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_other); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_slocs); + __Pyx_XDECREF((PyObject *)__pyx_v_slens); + __Pyx_XDECREF((PyObject *)__pyx_v_olocs); + __Pyx_XDECREF((PyObject *)__pyx_v_olens); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + __pyx_t_5numpy_float64_t __pyx_v_fill_value; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reindex (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_fill_value,&__pyx_n_s_other,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_fill_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fill_value == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_other_ = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_22reindex(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_22reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->reindex(__pyx_v_self, __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":518 + * j += 1 + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_put(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_to_put, int __pyx_skip_dispatch) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_25put)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __Pyx_INCREF(__pyx_v_to_put); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_to_put); + __Pyx_GIVEREF(__pyx_v_to_put); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":520 + * cpdef put(self, ndarray[float64_t, ndim=1] values, + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass # <<<<<<<<<<<<<< + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":518 + * j += 1 + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indices = 0; + PyObject *__pyx_v_to_put = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,&__pyx_n_s_to_put,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_put)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indices = ((PyArrayObject *)values[1]); + __pyx_v_to_put = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_24put(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices, __pyx_v_to_put); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_24put(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_values, __pyx_v_indices, __pyx_v_to_put, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":522 + * pass + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices): + * pass + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_take(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, int __pyx_skip_dispatch) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_27take)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":524 + * cpdef take(self, ndarray[float64_t, ndim=1] values, + * ndarray[int32_t, ndim=1] indices): + * pass # <<<<<<<<<<<<<< + * + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":522 + * pass + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices): + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indices = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indices = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_26take(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_26take(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->take(__pyx_v_self, __pyx_v_values, __pyx_v_indices, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":267 + * ''' + * cdef readonly: + * Py_ssize_t nblocks, npoints, length # <<<<<<<<<<<<<< + * ndarray blocs, blengths + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->nblocks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.nblocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.npoints.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":268 + * cdef readonly: + * Py_ssize_t nblocks, npoints, length + * ndarray blocs, blengths # <<<<<<<<<<<<<< + * + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs)); + __pyx_r = ((PyObject *)__pyx_v_self->blocs); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths)); + __pyx_r = ((PyObject *)__pyx_v_self->blengths); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":537 + * int32_t xi, yi # block indices + * + * def __init__(self, BlockIndex x, BlockIndex y): # <<<<<<<<<<<<<< + * self.x = x + * self.y = y + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)values[0]); + __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockMerge.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_6pandas_7_sparse_BlockIndex, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_6pandas_7_sparse_BlockIndex, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), __pyx_v_x, __pyx_v_y); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/sparse.pyx":538 + * + * def __init__(self, BlockIndex x, BlockIndex y): + * self.x = x # <<<<<<<<<<<<<< + * self.y = y + * + */ + __Pyx_INCREF(((PyObject *)__pyx_v_x)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); + __Pyx_GOTREF(__pyx_v_self->x); + __Pyx_DECREF(((PyObject *)__pyx_v_self->x)); + __pyx_v_self->x = __pyx_v_x; + + /* "pandas/src/sparse.pyx":539 + * def __init__(self, BlockIndex x, BlockIndex y): + * self.x = x + * self.y = y # <<<<<<<<<<<<<< + * + * if x.length != y.length: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_y)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_y)); + __Pyx_GOTREF(__pyx_v_self->y); + __Pyx_DECREF(((PyObject *)__pyx_v_self->y)); + __pyx_v_self->y = __pyx_v_y; + + /* "pandas/src/sparse.pyx":541 + * self.y = y + * + * if x.length != y.length: # <<<<<<<<<<<<<< + * raise Exception('Indices must reference same underlying length') + * + */ + __pyx_t_1 = ((__pyx_v_x->length != __pyx_v_y->length) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":542 + * + * if x.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * self.xstart = self.x.blocs + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":544 + * raise Exception('Indices must reference same underlying length') + * + * self.xstart = self.x.blocs # <<<<<<<<<<<<<< + * self.ystart = self.y.blocs + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->x->blocs); + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->xstart); + __Pyx_DECREF(((PyObject *)__pyx_v_self->xstart)); + __pyx_v_self->xstart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":545 + * + * self.xstart = self.x.blocs + * self.ystart = self.y.blocs # <<<<<<<<<<<<<< + * + * self.xend = self.x.blocs + self.x.blengths + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->y->blocs); + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->ystart); + __Pyx_DECREF(((PyObject *)__pyx_v_self->ystart)); + __pyx_v_self->ystart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":547 + * self.ystart = self.y.blocs + * + * self.xend = self.x.blocs + self.x.blengths # <<<<<<<<<<<<<< + * self.yend = self.y.blocs + self.y.blengths + * + */ + __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_self->x->blocs), ((PyObject *)__pyx_v_self->x->blengths)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->xend); + __Pyx_DECREF(((PyObject *)__pyx_v_self->xend)); + __pyx_v_self->xend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":548 + * + * self.xend = self.x.blocs + self.x.blengths + * self.yend = self.y.blocs + self.y.blengths # <<<<<<<<<<<<<< + * + * # self.xlen = self.x.blengths + */ + __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_self->y->blocs), ((PyObject *)__pyx_v_self->y->blengths)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->yend); + __Pyx_DECREF(((PyObject *)__pyx_v_self->yend)); + __pyx_v_self->yend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":553 + * # self.ylen = self.y.blengths + * + * self.xi = 0 # <<<<<<<<<<<<<< + * self.yi = 0 + * + */ + __pyx_v_self->xi = 0; + + /* "pandas/src/sparse.pyx":554 + * + * self.xi = 0 + * self.yi = 0 # <<<<<<<<<<<<<< + * + * self.result = self._make_merged_blocks() + */ + __pyx_v_self->yi = 0; + + /* "pandas/src/sparse.pyx":556 + * self.yi = 0 + * + * self.result = self._make_merged_blocks() # <<<<<<<<<<<<<< + * + * cdef _make_merged_blocks(self): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *)__pyx_v_self->__pyx_vtab)->_make_merged_blocks(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->result); + __Pyx_DECREF(((PyObject *)__pyx_v_self->result)); + __pyx_v_self->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":537 + * int32_t xi, yi # block indices + * + * def __init__(self, BlockIndex x, BlockIndex y): # <<<<<<<<<<<<<< + * self.x = x + * self.y = y + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.BlockMerge.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":558 + * self.result = self._make_merged_blocks() + * + * cdef _make_merged_blocks(self): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + +static PyObject *__pyx_f_6pandas_7_sparse_10BlockMerge__make_merged_blocks(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_merged_blocks", 0); + + /* "pandas/src/sparse.pyx":559 + * + * cdef _make_merged_blocks(self): + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":558 + * self.result = self._make_merged_blocks() + * + * cdef _make_merged_blocks(self): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas._sparse.BlockMerge._make_merged_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":561 + * raise NotImplementedError + * + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): # <<<<<<<<<<<<<< + * if mode == 0: + * self.xi = xi + */ + +static PyObject *__pyx_f_6pandas_7_sparse_10BlockMerge__set_current_indices(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_xi, __pyx_t_5numpy_int32_t __pyx_v_yi, int __pyx_v_mode) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_set_current_indices", 0); + + /* "pandas/src/sparse.pyx":562 + * + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): + * if mode == 0: # <<<<<<<<<<<<<< + * self.xi = xi + * self.yi = yi + */ + __pyx_t_1 = ((__pyx_v_mode == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":563 + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): + * if mode == 0: + * self.xi = xi # <<<<<<<<<<<<<< + * self.yi = yi + * else: + */ + __pyx_v_self->xi = __pyx_v_xi; + + /* "pandas/src/sparse.pyx":564 + * if mode == 0: + * self.xi = xi + * self.yi = yi # <<<<<<<<<<<<<< + * else: + * self.xi = yi + */ + __pyx_v_self->yi = __pyx_v_yi; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":566 + * self.yi = yi + * else: + * self.xi = yi # <<<<<<<<<<<<<< + * self.yi = xi + * + */ + __pyx_v_self->xi = __pyx_v_yi; + + /* "pandas/src/sparse.pyx":567 + * else: + * self.xi = yi + * self.yi = xi # <<<<<<<<<<<<<< + * + * cdef class BlockIntersection(BlockMerge): + */ + __pyx_v_self->yi = __pyx_v_xi; + } + __pyx_L3:; + + /* "pandas/src/sparse.pyx":561 + * raise NotImplementedError + * + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): # <<<<<<<<<<<<<< + * if mode == 0: + * self.xi = xi + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":581 + * ''' + * + * cdef _make_merged_blocks(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int32_t, ndim=1] xstart, xend, ystart, yend + */ + +static PyObject *__pyx_f_6pandas_7_sparse_10BlockUnion__make_merged_blocks(struct __pyx_obj_6pandas_7_sparse_BlockUnion *__pyx_v_self) { + PyArrayObject *__pyx_v_xstart = 0; + PyArrayObject *__pyx_v_xend = 0; + PyArrayObject *__pyx_v_ystart = 0; + PyArrayObject *__pyx_v_yend = 0; + __pyx_t_5numpy_int32_t __pyx_v_nstart; + __pyx_t_5numpy_int32_t __pyx_v_nend; + PyObject *__pyx_v_out_blocs = 0; + PyObject *__pyx_v_out_blengths = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xend; + __Pyx_Buffer __pyx_pybuffer_xend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xstart; + __Pyx_Buffer __pyx_pybuffer_xstart; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yend; + __Pyx_Buffer __pyx_pybuffer_yend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ystart; + __Pyx_Buffer __pyx_pybuffer_ystart; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __pyx_t_5numpy_int32_t __pyx_t_9; + __pyx_t_5numpy_int32_t __pyx_t_10; + __pyx_t_5numpy_int32_t __pyx_t_11; + __pyx_t_5numpy_int32_t __pyx_t_12; + __pyx_t_5numpy_int32_t __pyx_t_13; + __pyx_t_5numpy_int32_t __pyx_t_14; + __pyx_t_5numpy_int32_t __pyx_t_15; + __pyx_t_5numpy_int32_t __pyx_t_16; + __pyx_t_5numpy_int32_t __pyx_t_17; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_merged_blocks", 0); + __pyx_pybuffer_xstart.pybuffer.buf = NULL; + __pyx_pybuffer_xstart.refcount = 0; + __pyx_pybuffernd_xstart.data = NULL; + __pyx_pybuffernd_xstart.rcbuffer = &__pyx_pybuffer_xstart; + __pyx_pybuffer_xend.pybuffer.buf = NULL; + __pyx_pybuffer_xend.refcount = 0; + __pyx_pybuffernd_xend.data = NULL; + __pyx_pybuffernd_xend.rcbuffer = &__pyx_pybuffer_xend; + __pyx_pybuffer_ystart.pybuffer.buf = NULL; + __pyx_pybuffer_ystart.refcount = 0; + __pyx_pybuffernd_ystart.data = NULL; + __pyx_pybuffernd_ystart.rcbuffer = &__pyx_pybuffer_ystart; + __pyx_pybuffer_yend.pybuffer.buf = NULL; + __pyx_pybuffer_yend.refcount = 0; + __pyx_pybuffernd_yend.data = NULL; + __pyx_pybuffernd_yend.rcbuffer = &__pyx_pybuffer_yend; + + /* "pandas/src/sparse.pyx":585 + * ndarray[int32_t, ndim=1] xstart, xend, ystart, yend + * int32_t nstart, nend, diff + * list out_blocs = [], out_blengths = [] # <<<<<<<<<<<<<< + * + * xstart = self.xstart + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_out_blocs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_out_blengths = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":587 + * list out_blocs = [], out_blengths = [] + * + * xstart = self.xstart # <<<<<<<<<<<<<< + * xend = self.xend + * ystart = self.ystart + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.xstart); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5); + } + } + __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xstart = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":588 + * + * xstart = self.xstart + * xend = self.xend # <<<<<<<<<<<<<< + * ystart = self.ystart + * yend = self.yend + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.xend); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3); + } + } + __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xend = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":589 + * xstart = self.xstart + * xend = self.xend + * ystart = self.ystart # <<<<<<<<<<<<<< + * yend = self.yend + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.ystart); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5); + } + } + __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ystart = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":590 + * xend = self.xend + * ystart = self.ystart + * yend = self.yend # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.yend); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3); + } + } + __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yend = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":592 + * yend = self.yend + * + * while True: # <<<<<<<<<<<<<< + * # we are done (or possibly never began) + * if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks: + */ + while (1) { + + /* "pandas/src/sparse.pyx":594 + * while True: + * # we are done (or possibly never began) + * if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks: # <<<<<<<<<<<<<< + * break + * elif self.yi >= self.y.nblocks: + */ + __pyx_t_6 = ((__pyx_v_self->__pyx_base.xi >= __pyx_v_self->__pyx_base.x->nblocks) != 0); + if (__pyx_t_6) { + __pyx_t_7 = ((__pyx_v_self->__pyx_base.yi >= __pyx_v_self->__pyx_base.y->nblocks) != 0); + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":595 + * # we are done (or possibly never began) + * if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks: + * break # <<<<<<<<<<<<<< + * elif self.yi >= self.y.nblocks: + * # through with y, just pass through x blocks + */ + goto __pyx_L4_break; + } + + /* "pandas/src/sparse.pyx":596 + * if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks: + * break + * elif self.yi >= self.y.nblocks: # <<<<<<<<<<<<<< + * # through with y, just pass through x blocks + * nstart = xstart[self.xi] + */ + __pyx_t_8 = ((__pyx_v_self->__pyx_base.yi >= __pyx_v_self->__pyx_base.y->nblocks) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":598 + * elif self.yi >= self.y.nblocks: + * # through with y, just pass through x blocks + * nstart = xstart[self.xi] # <<<<<<<<<<<<<< + * nend = xend[self.xi] + * self.xi += 1 + */ + __pyx_t_9 = __pyx_v_self->__pyx_base.xi; + __pyx_t_2 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_xstart.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_xstart.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":599 + * # through with y, just pass through x blocks + * nstart = xstart[self.xi] + * nend = xend[self.xi] # <<<<<<<<<<<<<< + * self.xi += 1 + * elif self.xi >= self.x.nblocks: + */ + __pyx_t_10 = __pyx_v_self->__pyx_base.xi; + __pyx_t_2 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_xend.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_xend.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xend.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_xend.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":600 + * nstart = xstart[self.xi] + * nend = xend[self.xi] + * self.xi += 1 # <<<<<<<<<<<<<< + * elif self.xi >= self.x.nblocks: + * # through with x, just pass through y blocks + */ + __pyx_v_self->__pyx_base.xi = (__pyx_v_self->__pyx_base.xi + 1); + goto __pyx_L5; + } + + /* "pandas/src/sparse.pyx":601 + * nend = xend[self.xi] + * self.xi += 1 + * elif self.xi >= self.x.nblocks: # <<<<<<<<<<<<<< + * # through with x, just pass through y blocks + * nstart = ystart[self.yi] + */ + __pyx_t_8 = ((__pyx_v_self->__pyx_base.xi >= __pyx_v_self->__pyx_base.x->nblocks) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":603 + * elif self.xi >= self.x.nblocks: + * # through with x, just pass through y blocks + * nstart = ystart[self.yi] # <<<<<<<<<<<<<< + * nend = yend[self.yi] + * self.yi += 1 + */ + __pyx_t_11 = __pyx_v_self->__pyx_base.yi; + __pyx_t_2 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_ystart.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":604 + * # through with x, just pass through y blocks + * nstart = ystart[self.yi] + * nend = yend[self.yi] # <<<<<<<<<<<<<< + * self.yi += 1 + * else: + */ + __pyx_t_12 = __pyx_v_self->__pyx_base.yi; + __pyx_t_2 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_yend.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_yend.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yend.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_yend.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":605 + * nstart = ystart[self.yi] + * nend = yend[self.yi] + * self.yi += 1 # <<<<<<<<<<<<<< + * else: + * # find end of new block + */ + __pyx_v_self->__pyx_base.yi = (__pyx_v_self->__pyx_base.yi + 1); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":608 + * else: + * # find end of new block + * if xstart[self.xi] < ystart[self.yi]: # <<<<<<<<<<<<<< + * nstart = xstart[self.xi] + * nend = self._find_next_block_end(0) + */ + __pyx_t_13 = __pyx_v_self->__pyx_base.xi; + __pyx_t_2 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_xstart.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = __pyx_v_self->__pyx_base.yi; + __pyx_t_2 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_xstart.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":609 + * # find end of new block + * if xstart[self.xi] < ystart[self.yi]: + * nstart = xstart[self.xi] # <<<<<<<<<<<<<< + * nend = self._find_next_block_end(0) + * else: + */ + __pyx_t_15 = __pyx_v_self->__pyx_base.xi; + __pyx_t_2 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_xstart.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_xstart.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":610 + * if xstart[self.xi] < ystart[self.yi]: + * nstart = xstart[self.xi] + * nend = self._find_next_block_end(0) # <<<<<<<<<<<<<< + * else: + * nstart = ystart[self.yi] + */ + __pyx_t_16 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, 0); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nend = __pyx_t_16; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":612 + * nend = self._find_next_block_end(0) + * else: + * nstart = ystart[self.yi] # <<<<<<<<<<<<<< + * nend = self._find_next_block_end(1) + * + */ + __pyx_t_16 = __pyx_v_self->__pyx_base.yi; + __pyx_t_2 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_ystart.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":613 + * else: + * nstart = ystart[self.yi] + * nend = self._find_next_block_end(1) # <<<<<<<<<<<<<< + * + * out_blocs.append(nstart) + */ + __pyx_t_17 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, 1); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nend = __pyx_t_17; + } + __pyx_L6:; + } + __pyx_L5:; + + /* "pandas/src/sparse.pyx":615 + * nend = self._find_next_block_end(1) + * + * out_blocs.append(nstart) # <<<<<<<<<<<<<< + * out_blengths.append(nend - nstart) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_nstart); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_out_blocs, __pyx_t_1); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":616 + * + * out_blocs.append(nstart) + * out_blengths.append(nend - nstart) # <<<<<<<<<<<<<< + * + * return BlockIndex(self.x.length, out_blocs, out_blengths) + */ + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_nend - __pyx_v_nstart)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_out_blengths, __pyx_t_1); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4_break:; + + /* "pandas/src/sparse.pyx":618 + * out_blengths.append(nend - nstart) + * + * return BlockIndex(self.x.length, out_blocs, out_blengths) # <<<<<<<<<<<<<< + * + * cdef int32_t _find_next_block_end(self, bint mode) except -1: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->__pyx_base.x->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_out_blocs); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_out_blocs); + __Pyx_GIVEREF(__pyx_v_out_blocs); + __Pyx_INCREF(__pyx_v_out_blengths); + PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_v_out_blengths); + __Pyx_GIVEREF(__pyx_v_out_blengths); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":581 + * ''' + * + * cdef _make_merged_blocks(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int32_t, ndim=1] xstart, xend, ystart, yend + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_19); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockUnion._make_merged_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_xstart); + __Pyx_XDECREF((PyObject *)__pyx_v_xend); + __Pyx_XDECREF((PyObject *)__pyx_v_ystart); + __Pyx_XDECREF((PyObject *)__pyx_v_yend); + __Pyx_XDECREF(__pyx_v_out_blocs); + __Pyx_XDECREF(__pyx_v_out_blengths); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":620 + * return BlockIndex(self.x.length, out_blocs, out_blengths) + * + * cdef int32_t _find_next_block_end(self, bint mode) except -1: # <<<<<<<<<<<<<< + * ''' + * Wow, this got complicated in a hurry + */ + +static __pyx_t_5numpy_int32_t __pyx_f_6pandas_7_sparse_10BlockUnion__find_next_block_end(struct __pyx_obj_6pandas_7_sparse_BlockUnion *__pyx_v_self, int __pyx_v_mode) { + CYTHON_UNUSED PyArrayObject *__pyx_v_xstart = 0; + PyArrayObject *__pyx_v_xend = 0; + PyArrayObject *__pyx_v_ystart = 0; + PyArrayObject *__pyx_v_yend = 0; + __pyx_t_5numpy_int32_t __pyx_v_xi; + __pyx_t_5numpy_int32_t __pyx_v_yi; + __pyx_t_5numpy_int32_t __pyx_v_ynblocks; + __pyx_t_5numpy_int32_t __pyx_v_nend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xend; + __Pyx_Buffer __pyx_pybuffer_xend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xstart; + __Pyx_Buffer __pyx_pybuffer_xstart; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yend; + __Pyx_Buffer __pyx_pybuffer_yend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ystart; + __Pyx_Buffer __pyx_pybuffer_ystart; + __pyx_t_5numpy_int32_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __pyx_t_5numpy_int32_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + __pyx_t_5numpy_int32_t __pyx_t_9; + __pyx_t_5numpy_int32_t __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + __pyx_t_5numpy_int32_t __pyx_t_13; + __pyx_t_5numpy_int32_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_find_next_block_end", 0); + __pyx_pybuffer_xstart.pybuffer.buf = NULL; + __pyx_pybuffer_xstart.refcount = 0; + __pyx_pybuffernd_xstart.data = NULL; + __pyx_pybuffernd_xstart.rcbuffer = &__pyx_pybuffer_xstart; + __pyx_pybuffer_xend.pybuffer.buf = NULL; + __pyx_pybuffer_xend.refcount = 0; + __pyx_pybuffernd_xend.data = NULL; + __pyx_pybuffernd_xend.rcbuffer = &__pyx_pybuffer_xend; + __pyx_pybuffer_ystart.pybuffer.buf = NULL; + __pyx_pybuffer_ystart.refcount = 0; + __pyx_pybuffernd_ystart.data = NULL; + __pyx_pybuffernd_ystart.rcbuffer = &__pyx_pybuffer_ystart; + __pyx_pybuffer_yend.pybuffer.buf = NULL; + __pyx_pybuffer_yend.refcount = 0; + __pyx_pybuffernd_yend.data = NULL; + __pyx_pybuffernd_yend.rcbuffer = &__pyx_pybuffer_yend; + + /* "pandas/src/sparse.pyx":631 + * int32_t xi, yi, xnblocks, ynblocks, nend + * + * if mode != 0 and mode != 1: # <<<<<<<<<<<<<< + * raise Exception('Mode must be 0 or 1') + * + */ + switch (__pyx_v_mode) { + case 0: + case 1: + __pyx_t_1 = 0; + break; + default: + __pyx_t_1 = 1; + break; + } + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":632 + * + * if mode != 0 and mode != 1: + * raise Exception('Mode must be 0 or 1') # <<<<<<<<<<<<<< + * + * # so symmetric code will work + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":635 + * + * # so symmetric code will work + * if mode == 0: # <<<<<<<<<<<<<< + * xstart = self.xstart + * xend = self.xend + */ + __pyx_t_1 = ((__pyx_v_mode == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":636 + * # so symmetric code will work + * if mode == 0: + * xstart = self.xstart # <<<<<<<<<<<<<< + * xend = self.xend + * xi = self.xi + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xstart); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xstart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":637 + * if mode == 0: + * xstart = self.xstart + * xend = self.xend # <<<<<<<<<<<<<< + * xi = self.xi + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xend); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":638 + * xstart = self.xstart + * xend = self.xend + * xi = self.xi # <<<<<<<<<<<<<< + * + * ystart = self.ystart + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.xi; + __pyx_v_xi = __pyx_t_7; + + /* "pandas/src/sparse.pyx":640 + * xi = self.xi + * + * ystart = self.ystart # <<<<<<<<<<<<<< + * yend = self.yend + * yi = self.yi + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.ystart); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ystart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":641 + * + * ystart = self.ystart + * yend = self.yend # <<<<<<<<<<<<<< + * yi = self.yi + * ynblocks = self.y.nblocks + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.yend); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":642 + * ystart = self.ystart + * yend = self.yend + * yi = self.yi # <<<<<<<<<<<<<< + * ynblocks = self.y.nblocks + * else: + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.yi; + __pyx_v_yi = __pyx_t_7; + + /* "pandas/src/sparse.pyx":643 + * yend = self.yend + * yi = self.yi + * ynblocks = self.y.nblocks # <<<<<<<<<<<<<< + * else: + * xstart = self.ystart + */ + __pyx_t_8 = __pyx_v_self->__pyx_base.y->nblocks; + __pyx_v_ynblocks = __pyx_t_8; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":645 + * ynblocks = self.y.nblocks + * else: + * xstart = self.ystart # <<<<<<<<<<<<<< + * xend = self.yend + * xi = self.yi + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.ystart); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xstart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":646 + * else: + * xstart = self.ystart + * xend = self.yend # <<<<<<<<<<<<<< + * xi = self.yi + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.yend); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":647 + * xstart = self.ystart + * xend = self.yend + * xi = self.yi # <<<<<<<<<<<<<< + * + * ystart = self.xstart + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.yi; + __pyx_v_xi = __pyx_t_7; + + /* "pandas/src/sparse.pyx":649 + * xi = self.yi + * + * ystart = self.xstart # <<<<<<<<<<<<<< + * yend = self.xend + * yi = self.xi + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xstart); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ystart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":650 + * + * ystart = self.xstart + * yend = self.xend # <<<<<<<<<<<<<< + * yi = self.xi + * ynblocks = self.x.nblocks + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xend); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":651 + * ystart = self.xstart + * yend = self.xend + * yi = self.xi # <<<<<<<<<<<<<< + * ynblocks = self.x.nblocks + * + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.xi; + __pyx_v_yi = __pyx_t_7; + + /* "pandas/src/sparse.pyx":652 + * yend = self.xend + * yi = self.xi + * ynblocks = self.x.nblocks # <<<<<<<<<<<<<< + * + * nend = xend[xi] + */ + __pyx_t_8 = __pyx_v_self->__pyx_base.x->nblocks; + __pyx_v_ynblocks = __pyx_t_8; + } + __pyx_L4:; + + /* "pandas/src/sparse.pyx":654 + * ynblocks = self.x.nblocks + * + * nend = xend[xi] # <<<<<<<<<<<<<< + * + * # print 'here xi=%d, yi=%d, mode=%d, nend=%d' % (self.xi, self.yi, + */ + __pyx_t_7 = __pyx_v_xi; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_xend.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_xend.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xend.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_xend.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":660 + * + * # done with y? + * if yi == ynblocks: # <<<<<<<<<<<<<< + * self._set_current_indices(xi + 1, yi, mode) + * return nend + */ + __pyx_t_1 = ((__pyx_v_yi == __pyx_v_ynblocks) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":661 + * # done with y? + * if yi == ynblocks: + * self._set_current_indices(xi + 1, yi, mode) # <<<<<<<<<<<<<< + * return nend + * elif nend < ystart[yi]: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":662 + * if yi == ynblocks: + * self._set_current_indices(xi + 1, yi, mode) + * return nend # <<<<<<<<<<<<<< + * elif nend < ystart[yi]: + * # block ends before y block + */ + __pyx_r = __pyx_v_nend; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":663 + * self._set_current_indices(xi + 1, yi, mode) + * return nend + * elif nend < ystart[yi]: # <<<<<<<<<<<<<< + * # block ends before y block + * self._set_current_indices(xi + 1, yi, mode) + */ + __pyx_t_9 = __pyx_v_yi; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = ((__pyx_v_nend < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":665 + * elif nend < ystart[yi]: + * # block ends before y block + * self._set_current_indices(xi + 1, yi, mode) # <<<<<<<<<<<<<< + * return nend + * else: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":666 + * # block ends before y block + * self._set_current_indices(xi + 1, yi, mode) + * return nend # <<<<<<<<<<<<<< + * else: + * while yi < ynblocks and nend > yend[yi]: + */ + __pyx_r = __pyx_v_nend; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":668 + * return nend + * else: + * while yi < ynblocks and nend > yend[yi]: # <<<<<<<<<<<<<< + * yi += 1 + * + */ + while (1) { + __pyx_t_1 = ((__pyx_v_yi < __pyx_v_ynblocks) != 0); + if (__pyx_t_1) { + __pyx_t_10 = __pyx_v_yi; + __pyx_t_3 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_yend.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_yend.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = ((__pyx_v_nend > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yend.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_yend.diminfo[0].strides))) != 0); + __pyx_t_12 = __pyx_t_11; + } else { + __pyx_t_12 = __pyx_t_1; + } + if (!__pyx_t_12) break; + + /* "pandas/src/sparse.pyx":669 + * else: + * while yi < ynblocks and nend > yend[yi]: + * yi += 1 # <<<<<<<<<<<<<< + * + * self._set_current_indices(xi + 1, yi, mode) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":671 + * yi += 1 + * + * self._set_current_indices(xi + 1, yi, mode) # <<<<<<<<<<<<<< + * + * if yi == ynblocks: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":673 + * self._set_current_indices(xi + 1, yi, mode) + * + * if yi == ynblocks: # <<<<<<<<<<<<<< + * return nend + * + */ + __pyx_t_12 = ((__pyx_v_yi == __pyx_v_ynblocks) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":674 + * + * if yi == ynblocks: + * return nend # <<<<<<<<<<<<<< + * + * if nend < ystart[yi]: + */ + __pyx_r = __pyx_v_nend; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":676 + * return nend + * + * if nend < ystart[yi]: # <<<<<<<<<<<<<< + * # we're done, return the block end + * return nend + */ + __pyx_t_13 = __pyx_v_yi; + __pyx_t_3 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = ((__pyx_v_nend < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":678 + * if nend < ystart[yi]: + * # we're done, return the block end + * return nend # <<<<<<<<<<<<<< + * else: + * # merge blocks, continue searching + */ + __pyx_r = __pyx_v_nend; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":682 + * # merge blocks, continue searching + * # this also catches the case where blocks + * return self._find_next_block_end(1 - mode) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_14 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, (1 - __pyx_v_mode)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_14; + goto __pyx_L0; + } + } + + /* "pandas/src/sparse.pyx":620 + * return BlockIndex(self.x.length, out_blocs, out_blengths) + * + * cdef int32_t _find_next_block_end(self, bint mode) except -1: # <<<<<<<<<<<<<< + * ''' + * Wow, this got complicated in a hurry + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockUnion._find_next_block_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_xstart); + __Pyx_XDECREF((PyObject *)__pyx_v_xend); + __Pyx_XDECREF((PyObject *)__pyx_v_ystart); + __Pyx_XDECREF((PyObject *)__pyx_v_yend); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":690 + * ctypedef float64_t (* double_func)(float64_t a, float64_t b) + * + * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_nancombine(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nancombine", 0); + + /* "pandas/src/sparse.pyx":694 + * double_func op): + * # faster to convert to IntIndex + * return int_nanop(x, xindex.to_int_index(), # <<<<<<<<<<<<<< + * y, yindex.to_int_index(), op) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":695 + * # faster to convert to IntIndex + * return int_nanop(x, xindex.to_int_index(), + * y, yindex.to_int_index(), op) # <<<<<<<<<<<<<< + * + * # if isinstance(xindex, BlockIndex): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_yindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":694 + * double_func op): + * # faster to convert to IntIndex + * return int_nanop(x, xindex.to_int_index(), # <<<<<<<<<<<<<< + * y, yindex.to_int_index(), op) + * + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_int_nanop(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_2), __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3), __pyx_v_op); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":690 + * ctypedef float64_t (* double_func)(float64_t a, float64_t b) + * + * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas._sparse.sparse_nancombine", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":705 + * + * + * cdef inline tuple sparse_combine(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_combine(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_combine", 0); + + /* "pandas/src/sparse.pyx":708 + * ndarray y, SparseIndex yindex, float64_t yfill, + * double_func op): + * if isinstance(xindex, BlockIndex): # <<<<<<<<<<<<<< + * return block_op(x, xindex.to_block_index(), xfill, + * y, yindex.to_block_index(), yfill, op) + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_xindex), ((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/sparse.pyx":709 + * double_func op): + * if isinstance(xindex, BlockIndex): + * return block_op(x, xindex.to_block_index(), xfill, # <<<<<<<<<<<<<< + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":710 + * if isinstance(xindex, BlockIndex): + * return block_op(x, xindex.to_block_index(), xfill, + * y, yindex.to_block_index(), yfill, op) # <<<<<<<<<<<<<< + * elif isinstance(xindex, IntIndex): + * return int_op(x, xindex.to_int_index(), xfill, + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_yindex), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":709 + * double_func op): + * if isinstance(xindex, BlockIndex): + * return block_op(x, xindex.to_block_index(), xfill, # <<<<<<<<<<<<<< + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): + */ + __pyx_t_3 = __pyx_f_6pandas_7_sparse_block_op(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_4), __pyx_v_xfill, __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_5), __pyx_v_yfill, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":711 + * return block_op(x, xindex.to_block_index(), xfill, + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): # <<<<<<<<<<<<<< + * return int_op(x, xindex.to_int_index(), xfill, + * y, yindex.to_int_index(), yfill, op) + */ + __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_xindex), ((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":712 + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): + * return int_op(x, xindex.to_int_index(), xfill, # <<<<<<<<<<<<<< + * y, yindex.to_int_index(), yfill, op) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":713 + * elif isinstance(xindex, IntIndex): + * return int_op(x, xindex.to_int_index(), xfill, + * y, yindex.to_int_index(), yfill, op) # <<<<<<<<<<<<<< + * + * # NaN-based arithmetic operation-- no handling of fill values + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_yindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":712 + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): + * return int_op(x, xindex.to_int_index(), xfill, # <<<<<<<<<<<<<< + * y, yindex.to_int_index(), yfill, op) + * + */ + __pyx_t_3 = __pyx_f_6pandas_7_sparse_int_op(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_5), __pyx_v_xfill, __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_4), __pyx_v_yfill, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":705 + * + * + * cdef inline tuple sparse_combine(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill, + * double_func op): + */ + + /* function exit code */ + __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas._sparse.sparse_combine", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":719 + * + * @cython.boundscheck(False) + * cdef inline tuple block_nanop(ndarray x_, BlockIndex xindex, # <<<<<<<<<<<<<< + * ndarray y_, BlockIndex yindex, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_nanop(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_yindex, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_out_index = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_out_i; + Py_ssize_t __pyx_v_xbp; + Py_ssize_t __pyx_v_ybp; + Py_ssize_t __pyx_v_obp; + Py_ssize_t __pyx_v_xblock; + Py_ssize_t __pyx_v_yblock; + Py_ssize_t __pyx_v_outblock; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_y = 0; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("block_nanop", 0); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/src/sparse.pyx":724 + * cdef: + * BlockIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices # <<<<<<<<<<<<<< + * Py_ssize_t xbp = 0, ybp = 0, obp = 0 # block positions + * Py_ssize_t xblock = 0, yblock = 0, outblock = 0 # block numbers + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + __pyx_v_out_i = 0; + + /* "pandas/src/sparse.pyx":725 + * BlockIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices + * Py_ssize_t xbp = 0, ybp = 0, obp = 0 # block positions # <<<<<<<<<<<<<< + * Py_ssize_t xblock = 0, yblock = 0, outblock = 0 # block numbers + * + */ + __pyx_v_xbp = 0; + __pyx_v_ybp = 0; + __pyx_v_obp = 0; + + /* "pandas/src/sparse.pyx":726 + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices + * Py_ssize_t xbp = 0, ybp = 0, obp = 0 # block positions + * Py_ssize_t xblock = 0, yblock = 0, outblock = 0 # block numbers # <<<<<<<<<<<<<< + * + * ndarray[float64_t, ndim=1] x, y + */ + __pyx_v_xblock = 0; + __pyx_v_yblock = 0; + __pyx_v_outblock = 0; + + /* "pandas/src/sparse.pyx":732 + * + * # suppress Cython compiler warnings due to inlining + * x = x_ # <<<<<<<<<<<<<< + * y = y_ + * + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_x_)); + __pyx_v_x = ((PyArrayObject *)__pyx_v_x_); + + /* "pandas/src/sparse.pyx":733 + * # suppress Cython compiler warnings due to inlining + * x = x_ + * y = y_ # <<<<<<<<<<<<<< + * + * out_index = xindex.intersect(yindex) + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + __pyx_v_y = ((PyArrayObject *)__pyx_v_y_); + + /* "pandas/src/sparse.pyx":735 + * y = y_ + * + * out_index = xindex.intersect(yindex) # <<<<<<<<<<<<<< + * out = np.empty(out_index.npoints, dtype=np.float64) + * + */ + __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_xindex->__pyx_vtab)->intersect(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":736 + * + * out_index = xindex.intersect(yindex) + * out = np.empty(out_index.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * # walk the two SparseVectors, adding matched locations... + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":739 + * + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: # <<<<<<<<<<<<<< + * + * # I have a feeling this is inefficient + */ + __pyx_t_11 = __pyx_v_out_index->npoints; + for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) { + + /* "pandas/src/sparse.pyx":744 + * + * # walk x + * while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp: # <<<<<<<<<<<<<< + * xbp += 1 + * xi += 1 + */ + while (1) { + __pyx_t_12 = ((((__pyx_v_xindex->locbuf[__pyx_v_xblock]) + __pyx_v_xbp) < ((__pyx_v_out_index->locbuf[__pyx_v_outblock]) + __pyx_v_obp)) != 0); + if (!__pyx_t_12) break; + + /* "pandas/src/sparse.pyx":745 + * # walk x + * while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp: + * xbp += 1 # <<<<<<<<<<<<<< + * xi += 1 + * if xbp == xindex.lenbuf[xblock]: + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":746 + * while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp: + * xbp += 1 + * xi += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":747 + * xbp += 1 + * xi += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":748 + * xi += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":749 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * + * # walk y + */ + __pyx_v_xbp = 0; + goto __pyx_L7; + } + __pyx_L7:; + } + + /* "pandas/src/sparse.pyx":752 + * + * # walk y + * while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp: # <<<<<<<<<<<<<< + * ybp += 1 + * yi += 1 + */ + while (1) { + __pyx_t_12 = ((((__pyx_v_yindex->locbuf[__pyx_v_yblock]) + __pyx_v_ybp) < ((__pyx_v_out_index->locbuf[__pyx_v_outblock]) + __pyx_v_obp)) != 0); + if (!__pyx_t_12) break; + + /* "pandas/src/sparse.pyx":753 + * # walk y + * while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp: + * ybp += 1 # <<<<<<<<<<<<<< + * yi += 1 + * if ybp == yindex.lenbuf[yblock]: + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":754 + * while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp: + * ybp += 1 + * yi += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":755 + * ybp += 1 + * yi += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":756 + * yi += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":757 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * + * out[out_i] = op(x[xi], y[yi]) + */ + __pyx_v_ybp = 0; + goto __pyx_L10; + } + __pyx_L10:; + } + + /* "pandas/src/sparse.pyx":759 + * ybp = 0 + * + * out[out_i] = op(x[xi], y[yi]) # <<<<<<<<<<<<<< + * + * # advance. strikes me as too complicated + */ + __pyx_t_13 = __pyx_v_xi; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_14 = __pyx_v_yi; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_15 = __pyx_v_out_i; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":762 + * + * # advance. strikes me as too complicated + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":763 + * # advance. strikes me as too complicated + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * + * xbp += 1 + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":765 + * yi += 1 + * + * xbp += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":766 + * + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":767 + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":768 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * + * ybp += 1 + */ + __pyx_v_xbp = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/src/sparse.pyx":770 + * xbp = 0 + * + * ybp += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":771 + * + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":772 + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":773 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * + * obp += 1 + */ + __pyx_v_ybp = 0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/sparse.pyx":775 + * ybp = 0 + * + * obp += 1 # <<<<<<<<<<<<<< + * if obp == out_index.lenbuf[outblock]: + * outblock += 1 + */ + __pyx_v_obp = (__pyx_v_obp + 1); + + /* "pandas/src/sparse.pyx":776 + * + * obp += 1 + * if obp == out_index.lenbuf[outblock]: # <<<<<<<<<<<<<< + * outblock += 1 + * obp = 0 + */ + __pyx_t_12 = ((__pyx_v_obp == (__pyx_v_out_index->lenbuf[__pyx_v_outblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":777 + * obp += 1 + * if obp == out_index.lenbuf[outblock]: + * outblock += 1 # <<<<<<<<<<<<<< + * obp = 0 + * + */ + __pyx_v_outblock = (__pyx_v_outblock + 1); + + /* "pandas/src/sparse.pyx":778 + * if obp == out_index.lenbuf[outblock]: + * outblock += 1 + * obp = 0 # <<<<<<<<<<<<<< + * + * return out, out_index + */ + __pyx_v_obp = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/src/sparse.pyx":780 + * obp = 0 + * + * return out, out_index # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __Pyx_INCREF(((PyObject *)__pyx_v_out_index)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index)); + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":719 + * + * @cython.boundscheck(False) + * cdef inline tuple block_nanop(ndarray x_, BlockIndex xindex, # <<<<<<<<<<<<<< + * ndarray y_, BlockIndex yindex, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.block_nanop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out_index); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":783 + * + * @cython.boundscheck(False) + * cdef inline tuple int_nanop(ndarray x_, IntIndex xindex, # <<<<<<<<<<<<<< + * ndarray y_, IntIndex yindex, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_nanop(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_yindex, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_out_index = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_out_i; + PyArrayObject *__pyx_v_xindices = 0; + PyArrayObject *__pyx_v_yindices = 0; + PyArrayObject *__pyx_v_out_indices = 0; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_y = 0; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out_indices; + __Pyx_Buffer __pyx_pybuffer_out_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices; + __Pyx_Buffer __pyx_pybuffer_xindices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices; + __Pyx_Buffer __pyx_pybuffer_yindices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("int_nanop", 0); + __pyx_pybuffer_xindices.pybuffer.buf = NULL; + __pyx_pybuffer_xindices.refcount = 0; + __pyx_pybuffernd_xindices.data = NULL; + __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices; + __pyx_pybuffer_yindices.pybuffer.buf = NULL; + __pyx_pybuffer_yindices.refcount = 0; + __pyx_pybuffernd_yindices.data = NULL; + __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices; + __pyx_pybuffer_out_indices.pybuffer.buf = NULL; + __pyx_pybuffer_out_indices.refcount = 0; + __pyx_pybuffernd_out_indices.data = NULL; + __pyx_pybuffernd_out_indices.rcbuffer = &__pyx_pybuffer_out_indices; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/src/sparse.pyx":788 + * cdef: + * IntIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] xindices, yindices, out_indices + * ndarray[float64_t, ndim=1] x, y + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + __pyx_v_out_i = 0; + + /* "pandas/src/sparse.pyx":794 + * + * # suppress Cython compiler warnings due to inlining + * x = x_ # <<<<<<<<<<<<<< + * y = y_ + * + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_x_)); + __pyx_v_x = ((PyArrayObject *)__pyx_v_x_); + + /* "pandas/src/sparse.pyx":795 + * # suppress Cython compiler warnings due to inlining + * x = x_ + * y = y_ # <<<<<<<<<<<<<< + * + * # need to do this first to know size of result array + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + __pyx_v_y = ((PyArrayObject *)__pyx_v_y_); + + /* "pandas/src/sparse.pyx":798 + * + * # need to do this first to know size of result array + * out_index = xindex.intersect(yindex) # <<<<<<<<<<<<<< + * out = np.empty(out_index.npoints, dtype=np.float64) + * + */ + __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_xindex->__pyx_vtab)->intersect(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":799 + * # need to do this first to know size of result array + * out_index = xindex.intersect(yindex) + * out = np.empty(out_index.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * xindices = xindex.indices + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":801 + * out = np.empty(out_index.npoints, dtype=np.float64) + * + * xindices = xindex.indices # <<<<<<<<<<<<<< + * yindices = yindex.indices + * out_indices = out_index.indices + */ + __pyx_t_9 = ((PyObject *)__pyx_v_xindex->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xindices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":802 + * + * xindices = xindex.indices + * yindices = yindex.indices # <<<<<<<<<<<<<< + * out_indices = out_index.indices + * + */ + __pyx_t_9 = ((PyObject *)__pyx_v_yindex->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yindices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":803 + * xindices = xindex.indices + * yindices = yindex.indices + * out_indices = out_index.indices # <<<<<<<<<<<<<< + * + * # walk the two SparseVectors, adding matched locations... + */ + __pyx_t_9 = ((PyObject *)__pyx_v_out_index->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_out_indices.diminfo[0].strides = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_indices.diminfo[0].shape = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_out_indices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":806 + * + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: # <<<<<<<<<<<<<< + * + * # walk x + */ + __pyx_t_11 = __pyx_v_out_index->npoints; + for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) { + + /* "pandas/src/sparse.pyx":809 + * + * # walk x + * while xindices[xi] < out_indices[out_i]: # <<<<<<<<<<<<<< + * xi += 1 + * + */ + while (1) { + __pyx_t_12 = __pyx_v_xi; + if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_pybuffernd_xindices.diminfo[0].shape; + __pyx_t_13 = __pyx_v_out_i; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_out_indices.diminfo[0].shape; + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_xindices.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_out_indices.diminfo[0].strides))) != 0); + if (!__pyx_t_14) break; + + /* "pandas/src/sparse.pyx":810 + * # walk x + * while xindices[xi] < out_indices[out_i]: + * xi += 1 # <<<<<<<<<<<<<< + * + * # walk y + */ + __pyx_v_xi = (__pyx_v_xi + 1); + } + + /* "pandas/src/sparse.pyx":813 + * + * # walk y + * while yindices[yi] < out_indices[out_i]: # <<<<<<<<<<<<<< + * yi += 1 + * + */ + while (1) { + __pyx_t_15 = __pyx_v_yi; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_yindices.diminfo[0].shape; + __pyx_t_16 = __pyx_v_out_i; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out_indices.diminfo[0].shape; + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_yindices.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out_indices.diminfo[0].strides))) != 0); + if (!__pyx_t_14) break; + + /* "pandas/src/sparse.pyx":814 + * # walk y + * while yindices[yi] < out_indices[out_i]: + * yi += 1 # <<<<<<<<<<<<<< + * + * out[out_i] = op(x[xi], y[yi]) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":816 + * yi += 1 + * + * out[out_i] = op(x[xi], y[yi]) # <<<<<<<<<<<<<< + * + * # advance + */ + __pyx_t_17 = __pyx_v_xi; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_18 = __pyx_v_yi; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_19 = __pyx_v_out_i; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":819 + * + * # advance + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":820 + * # advance + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * + * return out, out_index + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":822 + * yi += 1 + * + * return out, out_index # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __Pyx_INCREF(((PyObject *)__pyx_v_out_index)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index)); + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":783 + * + * @cython.boundscheck(False) + * cdef inline tuple int_nanop(ndarray x_, IntIndex xindex, # <<<<<<<<<<<<<< + * ndarray y_, IntIndex yindex, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.int_nanop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out_index); + __Pyx_XDECREF((PyObject *)__pyx_v_xindices); + __Pyx_XDECREF((PyObject *)__pyx_v_yindices); + __Pyx_XDECREF((PyObject *)__pyx_v_out_indices); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":826 + * + * @cython.boundscheck(False) + * cdef inline tuple block_op(ndarray x_, BlockIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y_, BlockIndex yindex, float64_t yfill, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_op(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_out_index = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_out_i; + Py_ssize_t __pyx_v_xbp; + Py_ssize_t __pyx_v_ybp; + __pyx_t_5numpy_int32_t __pyx_v_xloc; + __pyx_t_5numpy_int32_t __pyx_v_yloc; + Py_ssize_t __pyx_v_xblock; + Py_ssize_t __pyx_v_yblock; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_y = 0; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("block_op", 0); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/src/sparse.pyx":835 + * cdef: + * BlockIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices # <<<<<<<<<<<<<< + * Py_ssize_t xbp = 0, ybp = 0 # block positions + * int32_t xloc, yloc + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + __pyx_v_out_i = 0; + + /* "pandas/src/sparse.pyx":836 + * BlockIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices + * Py_ssize_t xbp = 0, ybp = 0 # block positions # <<<<<<<<<<<<<< + * int32_t xloc, yloc + * Py_ssize_t xblock = 0, yblock = 0 # block numbers + */ + __pyx_v_xbp = 0; + __pyx_v_ybp = 0; + + /* "pandas/src/sparse.pyx":838 + * Py_ssize_t xbp = 0, ybp = 0 # block positions + * int32_t xloc, yloc + * Py_ssize_t xblock = 0, yblock = 0 # block numbers # <<<<<<<<<<<<<< + * + * ndarray[float64_t, ndim=1] x, y + */ + __pyx_v_xblock = 0; + __pyx_v_yblock = 0; + + /* "pandas/src/sparse.pyx":844 + * + * # to suppress Cython warning + * x = x_ # <<<<<<<<<<<<<< + * y = y_ + * + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_x_)); + __pyx_v_x = ((PyArrayObject *)__pyx_v_x_); + + /* "pandas/src/sparse.pyx":845 + * # to suppress Cython warning + * x = x_ + * y = y_ # <<<<<<<<<<<<<< + * + * out_index = xindex.make_union(yindex) + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + __pyx_v_y = ((PyArrayObject *)__pyx_v_y_); + + /* "pandas/src/sparse.pyx":847 + * y = y_ + * + * out_index = xindex.make_union(yindex) # <<<<<<<<<<<<<< + * out = np.empty(out_index.npoints, dtype=np.float64) + * + */ + __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_xindex->__pyx_vtab)->make_union(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":848 + * + * out_index = xindex.make_union(yindex) + * out = np.empty(out_index.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * # Wow, what a hack job. Need to do something about this + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":853 + * + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: # <<<<<<<<<<<<<< + * if yblock == yindex.nblocks: + * # use y fill value + */ + __pyx_t_11 = __pyx_v_out_index->npoints; + for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) { + + /* "pandas/src/sparse.pyx":854 + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: + * if yblock == yindex.nblocks: # <<<<<<<<<<<<<< + * # use y fill value + * out[out_i] = op(x[xi], yfill) + */ + __pyx_t_12 = ((__pyx_v_yblock == __pyx_v_yindex->nblocks) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":856 + * if yblock == yindex.nblocks: + * # use y fill value + * out[out_i] = op(x[xi], yfill) # <<<<<<<<<<<<<< + * xi += 1 + * + */ + __pyx_t_13 = __pyx_v_xi; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_14 = __pyx_v_out_i; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill); + + /* "pandas/src/sparse.pyx":857 + * # use y fill value + * out[out_i] = op(x[xi], yfill) + * xi += 1 # <<<<<<<<<<<<<< + * + * # advance x location + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":860 + * + * # advance x location + * xbp += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":861 + * # advance x location + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":862 + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * continue + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":863 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_xbp = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/sparse.pyx":864 + * xblock += 1 + * xbp = 0 + * continue # <<<<<<<<<<<<<< + * + * if xblock == xindex.nblocks: + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":866 + * continue + * + * if xblock == xindex.nblocks: # <<<<<<<<<<<<<< + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + */ + __pyx_t_12 = ((__pyx_v_xblock == __pyx_v_xindex->nblocks) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":868 + * if xblock == xindex.nblocks: + * # use x fill value + * out[out_i] = op(xfill, y[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_15 = __pyx_v_yi; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_16 = __pyx_v_out_i; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":869 + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * + * # advance y location + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":872 + * + * # advance y location + * ybp += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":873 + * # advance y location + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":874 + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * continue + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":875 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_ybp = 0; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/src/sparse.pyx":876 + * yblock += 1 + * ybp = 0 + * continue # <<<<<<<<<<<<<< + * + * yloc = yindex.locbuf[yblock] + ybp + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":878 + * continue + * + * yloc = yindex.locbuf[yblock] + ybp # <<<<<<<<<<<<<< + * xloc = xindex.locbuf[xblock] + xbp + * + */ + __pyx_v_yloc = ((__pyx_v_yindex->locbuf[__pyx_v_yblock]) + __pyx_v_ybp); + + /* "pandas/src/sparse.pyx":879 + * + * yloc = yindex.locbuf[yblock] + ybp + * xloc = xindex.locbuf[xblock] + xbp # <<<<<<<<<<<<<< + * + * # each index in the out_index had to come from either x, y, or both + */ + __pyx_v_xloc = ((__pyx_v_xindex->locbuf[__pyx_v_xblock]) + __pyx_v_xbp); + + /* "pandas/src/sparse.pyx":882 + * + * # each index in the out_index had to come from either x, y, or both + * if xloc == yloc: # <<<<<<<<<<<<<< + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 + */ + __pyx_t_12 = ((__pyx_v_xloc == __pyx_v_yloc) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":883 + * # each index in the out_index had to come from either x, y, or both + * if xloc == yloc: + * out[out_i] = op(x[xi], y[yi]) # <<<<<<<<<<<<<< + * xi += 1 + * yi += 1 + */ + __pyx_t_17 = __pyx_v_xi; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_18 = __pyx_v_yi; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_19 = __pyx_v_out_i; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":884 + * if xloc == yloc: + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":885 + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * + * # advance both locations + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":888 + * + * # advance both locations + * xbp += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":889 + * # advance both locations + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":890 + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":891 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * + * ybp += 1 + */ + __pyx_v_xbp = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/src/sparse.pyx":893 + * xbp = 0 + * + * ybp += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":894 + * + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":895 + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":896 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * + * elif xloc < yloc: + */ + __pyx_v_ybp = 0; + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L9; + } + + /* "pandas/src/sparse.pyx":898 + * ybp = 0 + * + * elif xloc < yloc: # <<<<<<<<<<<<<< + * # use y fill value + * out[out_i] = op(x[xi], yfill) + */ + __pyx_t_12 = ((__pyx_v_xloc < __pyx_v_yloc) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":900 + * elif xloc < yloc: + * # use y fill value + * out[out_i] = op(x[xi], yfill) # <<<<<<<<<<<<<< + * xi += 1 + * + */ + __pyx_t_20 = __pyx_v_xi; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_21 = __pyx_v_out_i; + if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill); + + /* "pandas/src/sparse.pyx":901 + * # use y fill value + * out[out_i] = op(x[xi], yfill) + * xi += 1 # <<<<<<<<<<<<<< + * + * # advance x location + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":904 + * + * # advance x location + * xbp += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":905 + * # advance x location + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":906 + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * else: + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":907 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * else: + * # use x fill value + */ + __pyx_v_xbp = 0; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":910 + * else: + * # use x fill value + * out[out_i] = op(xfill, y[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_22 = __pyx_v_yi; + if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_23 = __pyx_v_out_i; + if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":911 + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * + * # advance y location + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":914 + * + * # advance y location + * ybp += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":915 + * # advance y location + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":916 + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":917 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * + * return out, out_index + */ + __pyx_v_ybp = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + __pyx_L9:; + __pyx_L3_continue:; + } + + /* "pandas/src/sparse.pyx":919 + * ybp = 0 + * + * return out, out_index # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __Pyx_INCREF(((PyObject *)__pyx_v_out_index)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index)); + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":826 + * + * @cython.boundscheck(False) + * cdef inline tuple block_op(ndarray x_, BlockIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y_, BlockIndex yindex, float64_t yfill, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.block_op", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out_index); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":923 + * + * @cython.boundscheck(False) + * cdef inline tuple int_op(ndarray x_, IntIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y_, IntIndex yindex, float64_t yfill, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_op(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_out_index = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_out_i; + __pyx_t_5numpy_int32_t __pyx_v_xloc; + __pyx_t_5numpy_int32_t __pyx_v_yloc; + PyArrayObject *__pyx_v_xindices = 0; + PyArrayObject *__pyx_v_yindices = 0; + CYTHON_UNUSED PyArrayObject *__pyx_v_out_indices = 0; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_y = 0; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out_indices; + __Pyx_Buffer __pyx_pybuffer_out_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices; + __Pyx_Buffer __pyx_pybuffer_xindices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices; + __Pyx_Buffer __pyx_pybuffer_yindices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("int_op", 0); + __pyx_pybuffer_xindices.pybuffer.buf = NULL; + __pyx_pybuffer_xindices.refcount = 0; + __pyx_pybuffernd_xindices.data = NULL; + __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices; + __pyx_pybuffer_yindices.pybuffer.buf = NULL; + __pyx_pybuffer_yindices.refcount = 0; + __pyx_pybuffernd_yindices.data = NULL; + __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices; + __pyx_pybuffer_out_indices.pybuffer.buf = NULL; + __pyx_pybuffer_out_indices.refcount = 0; + __pyx_pybuffernd_out_indices.data = NULL; + __pyx_pybuffernd_out_indices.rcbuffer = &__pyx_pybuffer_out_indices; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/src/sparse.pyx":928 + * cdef: + * IntIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices # <<<<<<<<<<<<<< + * int32_t xloc, yloc + * ndarray[int32_t, ndim=1] xindices, yindices, out_indices + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + __pyx_v_out_i = 0; + + /* "pandas/src/sparse.pyx":935 + * + * # suppress Cython compiler warnings due to inlining + * x = x_ # <<<<<<<<<<<<<< + * y = y_ + * + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_x_)); + __pyx_v_x = ((PyArrayObject *)__pyx_v_x_); + + /* "pandas/src/sparse.pyx":936 + * # suppress Cython compiler warnings due to inlining + * x = x_ + * y = y_ # <<<<<<<<<<<<<< + * + * # need to do this first to know size of result array + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + __pyx_v_y = ((PyArrayObject *)__pyx_v_y_); + + /* "pandas/src/sparse.pyx":939 + * + * # need to do this first to know size of result array + * out_index = xindex.make_union(yindex) # <<<<<<<<<<<<<< + * out = np.empty(out_index.npoints, dtype=np.float64) + * + */ + __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_xindex->__pyx_vtab)->make_union(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":940 + * # need to do this first to know size of result array + * out_index = xindex.make_union(yindex) + * out = np.empty(out_index.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * xindices = xindex.indices + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":942 + * out = np.empty(out_index.npoints, dtype=np.float64) + * + * xindices = xindex.indices # <<<<<<<<<<<<<< + * yindices = yindex.indices + * out_indices = out_index.indices + */ + __pyx_t_9 = ((PyObject *)__pyx_v_xindex->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xindices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":943 + * + * xindices = xindex.indices + * yindices = yindex.indices # <<<<<<<<<<<<<< + * out_indices = out_index.indices + * + */ + __pyx_t_9 = ((PyObject *)__pyx_v_yindex->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yindices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":944 + * xindices = xindex.indices + * yindices = yindex.indices + * out_indices = out_index.indices # <<<<<<<<<<<<<< + * + * # walk the two SparseVectors, adding matched locations... + */ + __pyx_t_9 = ((PyObject *)__pyx_v_out_index->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_out_indices.diminfo[0].strides = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_indices.diminfo[0].shape = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_out_indices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":947 + * + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: # <<<<<<<<<<<<<< + * if xi == xindex.npoints: + * # use x fill value + */ + __pyx_t_11 = __pyx_v_out_index->npoints; + for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) { + + /* "pandas/src/sparse.pyx":948 + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: + * if xi == xindex.npoints: # <<<<<<<<<<<<<< + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + */ + __pyx_t_12 = ((__pyx_v_xi == __pyx_v_xindex->npoints) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":950 + * if xi == xindex.npoints: + * # use x fill value + * out[out_i] = op(xfill, y[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * continue + */ + __pyx_t_13 = __pyx_v_yi; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_14 = __pyx_v_out_i; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":951 + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":952 + * out[out_i] = op(xfill, y[yi]) + * yi += 1 + * continue # <<<<<<<<<<<<<< + * + * if yi == yindex.npoints: + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":954 + * continue + * + * if yi == yindex.npoints: # <<<<<<<<<<<<<< + * # use y fill value + * out[out_i] = op(x[xi], yfill) + */ + __pyx_t_12 = ((__pyx_v_yi == __pyx_v_yindex->npoints) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":956 + * if yi == yindex.npoints: + * # use y fill value + * out[out_i] = op(x[xi], yfill) # <<<<<<<<<<<<<< + * xi += 1 + * continue + */ + __pyx_t_15 = __pyx_v_xi; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_16 = __pyx_v_out_i; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill); + + /* "pandas/src/sparse.pyx":957 + * # use y fill value + * out[out_i] = op(x[xi], yfill) + * xi += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":958 + * out[out_i] = op(x[xi], yfill) + * xi += 1 + * continue # <<<<<<<<<<<<<< + * + * xloc = xindices[xi] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":960 + * continue + * + * xloc = xindices[xi] # <<<<<<<<<<<<<< + * yloc = yindices[yi] + * + */ + __pyx_t_17 = __pyx_v_xi; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_xindices.diminfo[0].shape; + __pyx_v_xloc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_xindices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":961 + * + * xloc = xindices[xi] + * yloc = yindices[yi] # <<<<<<<<<<<<<< + * + * # each index in the out_index had to come from either x, y, or both + */ + __pyx_t_18 = __pyx_v_yi; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_yindices.diminfo[0].shape; + __pyx_v_yloc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_yindices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":964 + * + * # each index in the out_index had to come from either x, y, or both + * if xloc == yloc: # <<<<<<<<<<<<<< + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 + */ + __pyx_t_12 = ((__pyx_v_xloc == __pyx_v_yloc) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":965 + * # each index in the out_index had to come from either x, y, or both + * if xloc == yloc: + * out[out_i] = op(x[xi], y[yi]) # <<<<<<<<<<<<<< + * xi += 1 + * yi += 1 + */ + __pyx_t_19 = __pyx_v_xi; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_20 = __pyx_v_yi; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_21 = __pyx_v_out_i; + if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":966 + * if xloc == yloc: + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * elif xloc < yloc: + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":967 + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * elif xloc < yloc: + * # use y fill value + */ + __pyx_v_yi = (__pyx_v_yi + 1); + goto __pyx_L7; + } + + /* "pandas/src/sparse.pyx":968 + * xi += 1 + * yi += 1 + * elif xloc < yloc: # <<<<<<<<<<<<<< + * # use y fill value + * out[out_i] = op(x[xi], yfill) + */ + __pyx_t_12 = ((__pyx_v_xloc < __pyx_v_yloc) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":970 + * elif xloc < yloc: + * # use y fill value + * out[out_i] = op(x[xi], yfill) # <<<<<<<<<<<<<< + * xi += 1 + * else: + */ + __pyx_t_22 = __pyx_v_xi; + if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_23 = __pyx_v_out_i; + if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill); + + /* "pandas/src/sparse.pyx":971 + * # use y fill value + * out[out_i] = op(x[xi], yfill) + * xi += 1 # <<<<<<<<<<<<<< + * else: + * # use x fill value + */ + __pyx_v_xi = (__pyx_v_xi + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":974 + * else: + * # use x fill value + * out[out_i] = op(xfill, y[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_24 = __pyx_v_yi; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_25 = __pyx_v_out_i; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":975 + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * + * return out, out_index + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + __pyx_L7:; + __pyx_L3_continue:; + } + + /* "pandas/src/sparse.pyx":977 + * yi += 1 + * + * return out, out_index # <<<<<<<<<<<<<< + * + * cdef inline float64_t __add(float64_t a, float64_t b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __Pyx_INCREF(((PyObject *)__pyx_v_out_index)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index)); + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":923 + * + * @cython.boundscheck(False) + * cdef inline tuple int_op(ndarray x_, IntIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y_, IntIndex yindex, float64_t yfill, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.int_op", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out_index); + __Pyx_XDECREF((PyObject *)__pyx_v_xindices); + __Pyx_XDECREF((PyObject *)__pyx_v_yindices); + __Pyx_XDECREF((PyObject *)__pyx_v_out_indices); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":979 + * return out, out_index + * + * cdef inline float64_t __add(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a + b + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___add(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add", 0); + + /* "pandas/src/sparse.pyx":980 + * + * cdef inline float64_t __add(float64_t a, float64_t b): + * return a + b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __sub(float64_t a, float64_t b): + */ + __pyx_r = (__pyx_v_a + __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":979 + * return out, out_index + * + * cdef inline float64_t __add(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a + b + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":982 + * return a + b + * + * cdef inline float64_t __sub(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a - b + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___sub(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__sub", 0); + + /* "pandas/src/sparse.pyx":983 + * + * cdef inline float64_t __sub(float64_t a, float64_t b): + * return a - b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __rsub(float64_t a, float64_t b): + */ + __pyx_r = (__pyx_v_a - __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":982 + * return a + b + * + * cdef inline float64_t __sub(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a - b + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":985 + * return a - b + * + * cdef inline float64_t __rsub(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return b - a + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rsub(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__rsub", 0); + + /* "pandas/src/sparse.pyx":986 + * + * cdef inline float64_t __rsub(float64_t a, float64_t b): + * return b - a # <<<<<<<<<<<<<< + * + * cdef inline float64_t __div(float64_t a, float64_t b): + */ + __pyx_r = (__pyx_v_b - __pyx_v_a); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":985 + * return a - b + * + * cdef inline float64_t __rsub(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return b - a + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":988 + * return b - a + * + * cdef inline float64_t __div(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * if b == 0: + * if a > 0: + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___div(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__div", 0); + + /* "pandas/src/sparse.pyx":989 + * + * cdef inline float64_t __div(float64_t a, float64_t b): + * if b == 0: # <<<<<<<<<<<<<< + * if a > 0: + * return INF + */ + __pyx_t_1 = ((__pyx_v_b == 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":990 + * cdef inline float64_t __div(float64_t a, float64_t b): + * if b == 0: + * if a > 0: # <<<<<<<<<<<<<< + * return INF + * elif a < 0: + */ + __pyx_t_1 = ((__pyx_v_a > 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":991 + * if b == 0: + * if a > 0: + * return INF # <<<<<<<<<<<<<< + * elif a < 0: + * return -INF + */ + __pyx_r = __pyx_v_6pandas_7_sparse_INF; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":992 + * if a > 0: + * return INF + * elif a < 0: # <<<<<<<<<<<<<< + * return -INF + * else: + */ + __pyx_t_1 = ((__pyx_v_a < 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":993 + * return INF + * elif a < 0: + * return -INF # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_r = (-__pyx_v_6pandas_7_sparse_INF); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":995 + * return -INF + * else: + * return NaN # <<<<<<<<<<<<<< + * else: + * return a / b + */ + __pyx_r = __pyx_v_6pandas_7_sparse_NaN; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/sparse.pyx":997 + * return NaN + * else: + * return a / b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __rdiv(float64_t a, float64_t b): + */ + if (unlikely(__pyx_v_b == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = (__pyx_v_a / __pyx_v_b); + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":988 + * return b - a + * + * cdef inline float64_t __div(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * if b == 0: + * if a > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._sparse.__div", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":999 + * return a / b + * + * cdef inline float64_t __rdiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __div(b, a) + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rdiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__rdiv", 0); + + /* "pandas/src/sparse.pyx":1000 + * + * cdef inline float64_t __rdiv(float64_t a, float64_t b): + * return __div(b, a) # <<<<<<<<<<<<<< + * + * cdef inline float64_t __floordiv(float64_t a, float64_t b): + */ + __pyx_r = __pyx_f_6pandas_7_sparse___div(__pyx_v_b, __pyx_v_a); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":999 + * return a / b + * + * cdef inline float64_t __rdiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __div(b, a) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1002 + * return __div(b, a) + * + * cdef inline float64_t __floordiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * if b == 0: + * if a > 0: + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___floordiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__floordiv", 0); + + /* "pandas/src/sparse.pyx":1003 + * + * cdef inline float64_t __floordiv(float64_t a, float64_t b): + * if b == 0: # <<<<<<<<<<<<<< + * if a > 0: + * return INF + */ + __pyx_t_1 = ((__pyx_v_b == 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":1004 + * cdef inline float64_t __floordiv(float64_t a, float64_t b): + * if b == 0: + * if a > 0: # <<<<<<<<<<<<<< + * return INF + * elif a < 0: + */ + __pyx_t_1 = ((__pyx_v_a > 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":1005 + * if b == 0: + * if a > 0: + * return INF # <<<<<<<<<<<<<< + * elif a < 0: + * return -INF + */ + __pyx_r = __pyx_v_6pandas_7_sparse_INF; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":1006 + * if a > 0: + * return INF + * elif a < 0: # <<<<<<<<<<<<<< + * return -INF + * else: + */ + __pyx_t_1 = ((__pyx_v_a < 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":1007 + * return INF + * elif a < 0: + * return -INF # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_r = (-__pyx_v_6pandas_7_sparse_INF); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":1009 + * return -INF + * else: + * return NaN # <<<<<<<<<<<<<< + * else: + * return a // b + */ + __pyx_r = __pyx_v_6pandas_7_sparse_NaN; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/sparse.pyx":1011 + * return NaN + * else: + * return a // b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __rfloordiv(float64_t a, float64_t b): + */ + if (unlikely(__pyx_v_b == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = floor(__pyx_v_a / __pyx_v_b); + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":1002 + * return __div(b, a) + * + * cdef inline float64_t __floordiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * if b == 0: + * if a > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._sparse.__floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1013 + * return a // b + * + * cdef inline float64_t __rfloordiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __floordiv(b, a) + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rfloordiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__rfloordiv", 0); + + /* "pandas/src/sparse.pyx":1014 + * + * cdef inline float64_t __rfloordiv(float64_t a, float64_t b): + * return __floordiv(b, a) # <<<<<<<<<<<<<< + * + * cdef inline float64_t __mul(float64_t a, float64_t b): + */ + __pyx_r = __pyx_f_6pandas_7_sparse___floordiv(__pyx_v_b, __pyx_v_a); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1013 + * return a // b + * + * cdef inline float64_t __rfloordiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __floordiv(b, a) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1016 + * return __floordiv(b, a) + * + * cdef inline float64_t __mul(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___mul(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__mul", 0); + + /* "pandas/src/sparse.pyx":1017 + * + * cdef inline float64_t __mul(float64_t a, float64_t b): + * return a * b # <<<<<<<<<<<<<< + * cdef inline float64_t __eq(float64_t a, float64_t b): + * return a == b + */ + __pyx_r = (__pyx_v_a * __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1016 + * return __floordiv(b, a) + * + * cdef inline float64_t __mul(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1018 + * cdef inline float64_t __mul(float64_t a, float64_t b): + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___eq(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq", 0); + + /* "pandas/src/sparse.pyx":1019 + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): + * return a == b # <<<<<<<<<<<<<< + * cdef inline float64_t __ne(float64_t a, float64_t b): + * return a != b + */ + __pyx_r = (__pyx_v_a == __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1018 + * cdef inline float64_t __mul(float64_t a, float64_t b): + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1020 + * cdef inline float64_t __eq(float64_t a, float64_t b): + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___ne(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne", 0); + + /* "pandas/src/sparse.pyx":1021 + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): + * return a != b # <<<<<<<<<<<<<< + * cdef inline float64_t __lt(float64_t a, float64_t b): + * return a < b + */ + __pyx_r = (__pyx_v_a != __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1020 + * cdef inline float64_t __eq(float64_t a, float64_t b): + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1022 + * cdef inline float64_t __ne(float64_t a, float64_t b): + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___lt(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__lt", 0); + + /* "pandas/src/sparse.pyx":1023 + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): + * return a < b # <<<<<<<<<<<<<< + * cdef inline float64_t __gt(float64_t a, float64_t b): + * return a > b + */ + __pyx_r = (__pyx_v_a < __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1022 + * cdef inline float64_t __ne(float64_t a, float64_t b): + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1024 + * cdef inline float64_t __lt(float64_t a, float64_t b): + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a > b + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___gt(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__gt", 0); + + /* "pandas/src/sparse.pyx":1025 + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): + * return a > b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __pow(float64_t a, float64_t b): + */ + __pyx_r = (__pyx_v_a > __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1024 + * cdef inline float64_t __lt(float64_t a, float64_t b): + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a > b + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1027 + * return a > b + * + * cdef inline float64_t __pow(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * # NaN + * if a != a or b != b: + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___pow(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__pow", 0); + + /* "pandas/src/sparse.pyx":1029 + * cdef inline float64_t __pow(float64_t a, float64_t b): + * # NaN + * if a != a or b != b: # <<<<<<<<<<<<<< + * return NaN + * return a ** b + */ + __pyx_t_1 = ((__pyx_v_a != __pyx_v_a) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_b != __pyx_v_b) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/src/sparse.pyx":1030 + * # NaN + * if a != a or b != b: + * return NaN # <<<<<<<<<<<<<< + * return a ** b + * + */ + __pyx_r = __pyx_v_6pandas_7_sparse_NaN; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":1031 + * if a != a or b != b: + * return NaN + * return a ** b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __rpow(float64_t a, float64_t b): + */ + __pyx_r = pow(__pyx_v_a, __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1027 + * return a > b + * + * cdef inline float64_t __pow(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * # NaN + * if a != a or b != b: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1033 + * return a ** b + * + * cdef inline float64_t __rpow(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __pow(b, a) + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rpow(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__rpow", 0); + + /* "pandas/src/sparse.pyx":1034 + * + * cdef inline float64_t __rpow(float64_t a, float64_t b): + * return __pow(b, a) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_f_6pandas_7_sparse___pow(__pyx_v_b, __pyx_v_a); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1033 + * return a ** b + * + * cdef inline float64_t __rpow(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __pow(b, a) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1040 + * # TODO: quantify performance boost to "templating" + * + * cpdef sparse_nanadd(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __add) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_nanadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanadd(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanadd", 0); + + /* "pandas/src/sparse.pyx":1042 + * cpdef sparse_nanadd(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __add) # <<<<<<<<<<<<<< + * + * cpdef sparse_nansub(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1040 + * # TODO: quantify performance boost to "templating" + * + * cpdef sparse_nanadd(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __add) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanadd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_nanadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_nanadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanadd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanadd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanadd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_2sparse_nanadd(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_2sparse_nanadd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanadd", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanadd(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanadd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1044 + * return sparse_nancombine(x, xindex, y, yindex, __add) + * + * cpdef sparse_nansub(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __sub) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_nansub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nansub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nansub", 0); + + /* "pandas/src/sparse.pyx":1046 + * cpdef sparse_nansub(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __sub) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1044 + * return sparse_nancombine(x, xindex, y, yindex, __add) + * + * cpdef sparse_nansub(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __sub) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nansub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_nansub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_nansub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nansub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nansub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nansub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_4sparse_nansub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_4sparse_nansub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nansub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nansub(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nansub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1048 + * return sparse_nancombine(x, xindex, y, yindex, __sub) + * + * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rsub) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_nanrsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrsub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrsub", 0); + + /* "pandas/src/sparse.pyx":1050 + * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rsub) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanmul(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rsub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1048 + * return sparse_nancombine(x, xindex, y, yindex, __sub) + * + * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rsub) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_nanrsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_nanrsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanrsub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanrsub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanrsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_6sparse_nanrsub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_6sparse_nanrsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrsub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrsub(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1052 + * return sparse_nancombine(x, xindex, y, yindex, __rsub) + * + * cpdef sparse_nanmul(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __mul) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_nanmul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanmul(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanmul", 0); + + /* "pandas/src/sparse.pyx":1054 + * cpdef sparse_nanmul(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __mul) # <<<<<<<<<<<<<< + * + * cpdef sparse_nandiv(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___mul); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1052 + * return sparse_nancombine(x, xindex, y, yindex, __rsub) + * + * cpdef sparse_nanmul(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __mul) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanmul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_nanmul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_nanmul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanmul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanmul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanmul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8sparse_nanmul(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8sparse_nanmul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanmul", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanmul(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanmul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1056 + * return sparse_nancombine(x, xindex, y, yindex, __mul) + * + * cpdef sparse_nandiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __div) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_nandiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nandiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nandiv", 0); + + /* "pandas/src/sparse.pyx":1058 + * cpdef sparse_nandiv(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __div) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1056 + * return sparse_nancombine(x, xindex, y, yindex, __mul) + * + * cpdef sparse_nandiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __div) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nandiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_nandiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_nandiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nandiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nandiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nandiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10sparse_nandiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10sparse_nandiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nandiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nandiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nandiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1060 + * return sparse_nancombine(x, xindex, y, yindex, __div) + * + * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rdiv) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrdiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrdiv", 0); + + /* "pandas/src/sparse.pyx":1062 + * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rdiv) # <<<<<<<<<<<<<< + * + * sparse_nantruediv = sparse_nandiv + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1060 + * return sparse_nancombine(x, xindex, y, yindex, __div) + * + * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rdiv) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanrdiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanrdiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanrdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_12sparse_nanrdiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_12sparse_nanrdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrdiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrdiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1067 + * sparse_nanrtruediv = sparse_nanrdiv + * + * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanfloordiv", 0); + + /* "pandas/src/sparse.pyx":1069 + * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___floordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1067 + * sparse_nanrtruediv = sparse_nanrdiv + * + * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanfloordiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_14sparse_nanfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_14sparse_nanfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanfloordiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1071 + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) + * + * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrfloordiv", 0); + + /* "pandas/src/sparse.pyx":1073 + * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanpow(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rfloordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1071 + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) + * + * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanrfloordiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanrfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanrfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_16sparse_nanrfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_16sparse_nanrfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrfloordiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1075 + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) + * + * cpdef sparse_nanpow(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __pow) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_nanpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanpow", 0); + + /* "pandas/src/sparse.pyx":1077 + * cpdef sparse_nanpow(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __pow) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___pow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1075 + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) + * + * cpdef sparse_nanpow(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __pow) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_nanpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_nanpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanpow (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_18sparse_nanpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_18sparse_nanpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanpow", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1079 + * return sparse_nancombine(x, xindex, y, yindex, __pow) + * + * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rpow) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_nanrpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrpow", 0); + + /* "pandas/src/sparse.pyx":1081 + * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rpow) # <<<<<<<<<<<<<< + * + * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rpow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1079 + * return sparse_nancombine(x, xindex, y, yindex, __pow) + * + * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rpow) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_nanrpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_nanrpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanrpow (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanrpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanrpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_20sparse_nanrpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_20sparse_nanrpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrpow", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1083 + * return sparse_nancombine(x, xindex, y, yindex, __rpow) + * + * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_add(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_add", 0); + + /* "pandas/src/sparse.pyx":1085 + * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __add) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1086 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __add) # <<<<<<<<<<<<<< + * + * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1083 + * return sparse_nancombine(x, xindex, y, yindex, __rpow) + * + * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_22sparse_add(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_22sparse_add(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_add", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_add(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1088 + * y, yindex, yfill, __add) + * + * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_sub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_sub", 0); + + /* "pandas/src/sparse.pyx":1090 + * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __sub) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1091 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __sub) # <<<<<<<<<<<<<< + * + * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1088 + * y, yindex, yfill, __add) + * + * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_24sparse_sub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_24sparse_sub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_sub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_sub(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1093 + * y, yindex, yfill, __sub) + * + * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rsub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rsub", 0); + + /* "pandas/src/sparse.pyx":1095 + * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __rsub) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1096 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __rsub) # <<<<<<<<<<<<<< + * + * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rsub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1093 + * y, yindex, yfill, __sub) + * + * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_rsub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rsub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_26sparse_rsub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_26sparse_rsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rsub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rsub(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1098 + * y, yindex, yfill, __rsub) + * + * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_mul(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_mul", 0); + + /* "pandas/src/sparse.pyx":1100 + * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __mul) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1101 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __mul) # <<<<<<<<<<<<<< + * + * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___mul); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1098 + * y, yindex, yfill, __rsub) + * + * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_28sparse_mul(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_28sparse_mul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_mul", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_mul(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1103 + * y, yindex, yfill, __mul) + * + * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_div(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_div", 0); + + /* "pandas/src/sparse.pyx":1105 + * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __div) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1106 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __div) # <<<<<<<<<<<<<< + * + * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1103 + * y, yindex, yfill, __mul) + * + * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_30sparse_div(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_30sparse_div(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_div", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_div(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1108 + * y, yindex, yfill, __div) + * + * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rdiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rdiv", 0); + + /* "pandas/src/sparse.pyx":1110 + * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __rdiv) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1111 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __rdiv) # <<<<<<<<<<<<<< + * + * sparse_truediv = sparse_div + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1108 + * y, yindex, yfill, __div) + * + * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_rdiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rdiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_32sparse_rdiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_32sparse_rdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rdiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rdiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1116 + * sparse_rtruediv = sparse_rdiv + * + * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_floordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_floordiv", 0); + + /* "pandas/src/sparse.pyx":1118 + * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __floordiv) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1119 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __floordiv) # <<<<<<<<<<<<<< + * + * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___floordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1116 + * sparse_rtruediv = sparse_rdiv + * + * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_floordiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_floordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_34sparse_floordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_34sparse_floordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_floordiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_floordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1121 + * y, yindex, yfill, __floordiv) + * + * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rfloordiv", 0); + + /* "pandas/src/sparse.pyx":1123 + * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __rfloordiv) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1124 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __rfloordiv) # <<<<<<<<<<<<<< + * + * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rfloordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1121 + * y, yindex, yfill, __floordiv) + * + * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_rfloordiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_36sparse_rfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_36sparse_rfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rfloordiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1126 + * y, yindex, yfill, __rfloordiv) + * + * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_39sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_pow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_pow", 0); + + /* "pandas/src/sparse.pyx":1128 + * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __pow) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1129 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __pow) # <<<<<<<<<<<<<< + * + * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___pow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1126 + * y, yindex, yfill, __rfloordiv) + * + * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_39sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_39sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_pow (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_pow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_38sparse_pow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_38sparse_pow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_pow", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_pow(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1131 + * y, yindex, yfill, __pow) + * + * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_41sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rpow", 0); + + /* "pandas/src/sparse.pyx":1133 + * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __rpow) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1134 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __rpow) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rpow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1131 + * y, yindex, yfill, __pow) + * + * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_41sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_41sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_rpow (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_40sparse_rpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_40sparse_rpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rpow", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1140 + * # Indexing operations + * + * def get_reindexer(ndarray[object, ndim=1] values, dict index_map): # <<<<<<<<<<<<<< + * cdef object idx + * cdef Py_ssize_t i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_43get_reindexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_7_sparse_43get_reindexer = {__Pyx_NAMESTR("get_reindexer"), (PyCFunction)__pyx_pw_6pandas_7_sparse_43get_reindexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_7_sparse_43get_reindexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_index_map = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_reindexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_index_map,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_map)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_reindexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reindexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_index_map = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_reindexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.get_reindexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index_map), (&PyDict_Type), 1, "index_map", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_42get_reindexer(__pyx_self, __pyx_v_values, __pyx_v_index_map); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_42get_reindexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_index_map) { + PyObject *__pyx_v_idx = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_new_length; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + __pyx_t_5numpy_int32_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_reindexer", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/sparse.pyx":1143 + * cdef object idx + * cdef Py_ssize_t i + * cdef Py_ssize_t new_length = len(values) # <<<<<<<<<<<<<< + * cdef ndarray[int32_t, ndim=1] indexer + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_new_length = __pyx_t_1; + + /* "pandas/src/sparse.pyx":1146 + * cdef ndarray[int32_t, ndim=1] indexer + * + * indexer = np.empty(new_length, dtype=np.int32) # <<<<<<<<<<<<<< + * + * for i in range(new_length): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_new_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/sparse.pyx":1148 + * indexer = np.empty(new_length, dtype=np.int32) + * + * for i in range(new_length): # <<<<<<<<<<<<<< + * idx = values[i] + * if idx in index_map: + */ + __pyx_t_1 = __pyx_v_new_length; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/sparse.pyx":1149 + * + * for i in range(new_length): + * idx = values[i] # <<<<<<<<<<<<<< + * if idx in index_map: + * indexer[i] = index_map[idx] + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/sparse.pyx":1150 + * for i in range(new_length): + * idx = values[i] + * if idx in index_map: # <<<<<<<<<<<<<< + * indexer[i] = index_map[idx] + * else: + */ + if (unlikely(__pyx_v_index_map == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (__Pyx_PyDict_Contains(__pyx_v_idx, __pyx_v_index_map, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = (__pyx_t_14 != 0); + if (__pyx_t_15) { + + /* "pandas/src/sparse.pyx":1151 + * idx = values[i] + * if idx in index_map: + * indexer[i] = index_map[idx] # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + if (unlikely(__pyx_v_index_map == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_index_map, __pyx_v_idx); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_6); if (unlikely((__pyx_t_16 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_t_16; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":1153 + * indexer[i] = index_map[idx] + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + } + __pyx_L5:; + } + + /* "pandas/src/sparse.pyx":1155 + * indexer[i] = -1 + * + * return indexer # <<<<<<<<<<<<<< + * + * # def reindex_block(ndarray[float64_t, ndim=1] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1140 + * # Indexing operations + * + * def get_reindexer(ndarray[object, ndim=1] values, dict index_map): # <<<<<<<<<<<<<< + * cdef object idx + * cdef Py_ssize_t i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.get_reindexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1187 + * + * + * def reindex_integer(ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * IntIndex sparse_index, + * ndarray[int32_t, ndim=1] indexer): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_45reindex_integer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_7_sparse_45reindex_integer = {__Pyx_NAMESTR("reindex_integer"), (PyCFunction)__pyx_pw_6pandas_7_sparse_45reindex_integer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_7_sparse_45reindex_integer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyArrayObject *__pyx_v_values = 0; + CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index = 0; + CYTHON_UNUSED PyArrayObject *__pyx_v_indexer = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reindex_integer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_sparse_index,&__pyx_n_s_indexer,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sparse_index)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex_integer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_sparse_index = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)values[1]); + __pyx_v_indexer = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.reindex_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sparse_index), __pyx_ptype_6pandas_7_sparse_IntIndex, 1, "sparse_index", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_44reindex_integer(__pyx_self, __pyx_v_values, __pyx_v_sparse_index, __pyx_v_indexer); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_44reindex_integer(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index, CYTHON_UNUSED PyArrayObject *__pyx_v_indexer) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex_integer", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.reindex_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6pandas_7_sparse_SparseIndex(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6pandas_7_sparse_SparseIndex[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7_sparse_SparseIndex = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.SparseIndex"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_SparseIndex), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + __Pyx_DOCSTR("\n Abstract superclass for sparse index types\n "), /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7_sparse_SparseIndex, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_SparseIndex, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex __pyx_vtable_6pandas_7_sparse_IntIndex; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_IntIndex(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_IntIndex *p; + PyObject *o = __pyx_tp_new_6pandas_7_sparse_SparseIndex(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_IntIndex; + p->indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_7_sparse_IntIndex(PyObject *o) { + struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->indices); + #if CYTHON_COMPILING_IN_CPYTHON + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(o); +} + +static int __pyx_tp_traverse_6pandas_7_sparse_IntIndex(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o; + e = ((likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) ? ((__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse) ? __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6pandas_7_sparse_IntIndex)); if (e) return e; + if (p->indices) { + e = (*v)(((PyObject*)p->indices), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7_sparse_IntIndex(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o; + if (likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) { if (__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear) __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6pandas_7_sparse_IntIndex); + tmp = ((PyObject*)p->indices); + p->indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_length(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_npoints(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_indices(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_7_sparse_IntIndex[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("check_integrity"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_8IntIndex_6check_integrity)}, + {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_9equals, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ngaps"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_int_index"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_block_index"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("intersect"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("make_union"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("reindex"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("put"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_25put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("take"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_27take, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_7_sparse_IntIndex[] = { + {(char *)"length", __pyx_getprop_6pandas_7_sparse_8IntIndex_length, 0, 0, 0}, + {(char *)"npoints", __pyx_getprop_6pandas_7_sparse_8IntIndex_npoints, 0, 0, 0}, + {(char *)"indices", __pyx_getprop_6pandas_7_sparse_8IntIndex_indices, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7_sparse_IntIndex = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.IntIndex"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_IntIndex), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_IntIndex, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Object for holding exact integer sparse indexing information\n\n Parameters\n ----------\n length : integer\n indices : array-like\n Contains integers corresponding to\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_IntIndex, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_IntIndex, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7_sparse_IntIndex, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_7_sparse_IntIndex, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_IntIndex, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex __pyx_vtable_6pandas_7_sparse_BlockIndex; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIndex(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *p; + PyObject *o = __pyx_tp_new_6pandas_7_sparse_SparseIndex(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_BlockIndex; + p->blocs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->blengths = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_7_sparse_BlockIndex(PyObject *o) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->blocs); + Py_CLEAR(p->blengths); + #if CYTHON_COMPILING_IN_CPYTHON + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(o); +} + +static int __pyx_tp_traverse_6pandas_7_sparse_BlockIndex(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o; + e = ((likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) ? ((__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse) ? __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6pandas_7_sparse_BlockIndex)); if (e) return e; + if (p->blocs) { + e = (*v)(((PyObject*)p->blocs), a); if (e) return e; + } + if (p->blengths) { + e = (*v)(((PyObject*)p->blengths), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7_sparse_BlockIndex(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o; + if (likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) { if (__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear) __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6pandas_7_sparse_BlockIndex); + tmp = ((PyObject*)p->blocs); + p->blocs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->blengths); + p->blengths = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_nblocks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_npoints(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_length(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_blocs(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_blengths(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_7_sparse_BlockIndex[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ngaps"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("check_integrity"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_10BlockIndex_8check_integrity)}, + {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_block_index"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_int_index"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("intersect"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_10BlockIndex_16intersect)}, + {__Pyx_NAMESTR("make_union"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_10BlockIndex_18make_union)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_10BlockIndex_20lookup)}, + {__Pyx_NAMESTR("reindex"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("put"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_25put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("take"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_27take, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_7_sparse_BlockIndex[] = { + {(char *)"nblocks", __pyx_getprop_6pandas_7_sparse_10BlockIndex_nblocks, 0, 0, 0}, + {(char *)"npoints", __pyx_getprop_6pandas_7_sparse_10BlockIndex_npoints, 0, 0, 0}, + {(char *)"length", __pyx_getprop_6pandas_7_sparse_10BlockIndex_length, 0, 0, 0}, + {(char *)"blocs", __pyx_getprop_6pandas_7_sparse_10BlockIndex_blocs, 0, 0, 0}, + {(char *)"blengths", __pyx_getprop_6pandas_7_sparse_10BlockIndex_blengths, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7_sparse_BlockIndex = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.BlockIndex"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_BlockIndex), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_BlockIndex, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Object for holding block-based sparse indexing information\n\n Parameters\n ----------\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_BlockIndex, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_BlockIndex, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7_sparse_BlockIndex, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_7_sparse_BlockIndex, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_BlockIndex, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_vtable_6pandas_7_sparse_BlockMerge; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockMerge(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_BlockMerge *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_BlockMerge; + p->x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + p->y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + p->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + p->xstart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->xlen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->xend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->ystart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->ylen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->yend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge(PyObject *o) { + struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->x); + Py_CLEAR(p->y); + Py_CLEAR(p->result); + Py_CLEAR(p->xstart); + Py_CLEAR(p->xlen); + Py_CLEAR(p->xend); + Py_CLEAR(p->ystart); + Py_CLEAR(p->ylen); + Py_CLEAR(p->yend); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_7_sparse_BlockMerge(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o; + if (p->x) { + e = (*v)(((PyObject*)p->x), a); if (e) return e; + } + if (p->y) { + e = (*v)(((PyObject*)p->y), a); if (e) return e; + } + if (p->result) { + e = (*v)(((PyObject*)p->result), a); if (e) return e; + } + if (p->xstart) { + e = (*v)(((PyObject*)p->xstart), a); if (e) return e; + } + if (p->xlen) { + e = (*v)(((PyObject*)p->xlen), a); if (e) return e; + } + if (p->xend) { + e = (*v)(((PyObject*)p->xend), a); if (e) return e; + } + if (p->ystart) { + e = (*v)(((PyObject*)p->ystart), a); if (e) return e; + } + if (p->ylen) { + e = (*v)(((PyObject*)p->ylen), a); if (e) return e; + } + if (p->yend) { + e = (*v)(((PyObject*)p->yend), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7_sparse_BlockMerge(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o; + tmp = ((PyObject*)p->x); + p->x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->y); + p->y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->result); + p->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->xstart); + p->xstart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->xlen); + p->xlen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->xend); + p->xend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->ystart); + p->ystart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->ylen); + p->ylen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->yend); + p->yend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_7_sparse_BlockMerge[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7_sparse_BlockMerge = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.BlockMerge"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_BlockMerge), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Object-oriented approach makes sharing state between recursive functions a\n lot easier and reduces code duplication\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7_sparse_BlockMerge, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_BlockMerge, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection __pyx_vtable_6pandas_7_sparse_BlockIntersection; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIntersection(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_BlockIntersection *p; + PyObject *o = __pyx_tp_new_6pandas_7_sparse_BlockMerge(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_BlockIntersection *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge*)__pyx_vtabptr_6pandas_7_sparse_BlockIntersection; + return o; +} + +static PyTypeObject __pyx_type_6pandas_7_sparse_BlockIntersection = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.BlockIntersection"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_BlockIntersection), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n not done yet\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_BlockIntersection, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion __pyx_vtable_6pandas_7_sparse_BlockUnion; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockUnion(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_BlockUnion *p; + PyObject *o = __pyx_tp_new_6pandas_7_sparse_BlockMerge(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge*)__pyx_vtabptr_6pandas_7_sparse_BlockUnion; + return o; +} + +static PyTypeObject __pyx_type_6pandas_7_sparse_BlockUnion = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.BlockUnion"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_BlockUnion), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Object-oriented approach makes sharing state between recursive functions a\n lot easier and reduces code duplication\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_BlockUnion, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("get_blocks"), (PyCFunction)__pyx_pw_6pandas_7_sparse_1get_blocks, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanadd"), (PyCFunction)__pyx_pw_6pandas_7_sparse_3sparse_nanadd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nansub"), (PyCFunction)__pyx_pw_6pandas_7_sparse_5sparse_nansub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanrsub"), (PyCFunction)__pyx_pw_6pandas_7_sparse_7sparse_nanrsub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanmul"), (PyCFunction)__pyx_pw_6pandas_7_sparse_9sparse_nanmul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nandiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_11sparse_nandiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanrdiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanfloordiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanrfloordiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanpow"), (PyCFunction)__pyx_pw_6pandas_7_sparse_19sparse_nanpow, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanrpow"), (PyCFunction)__pyx_pw_6pandas_7_sparse_21sparse_nanrpow, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_add"), (PyCFunction)__pyx_pw_6pandas_7_sparse_23sparse_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_sub"), (PyCFunction)__pyx_pw_6pandas_7_sparse_25sparse_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_rsub"), (PyCFunction)__pyx_pw_6pandas_7_sparse_27sparse_rsub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_mul"), (PyCFunction)__pyx_pw_6pandas_7_sparse_29sparse_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_div"), (PyCFunction)__pyx_pw_6pandas_7_sparse_31sparse_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_rdiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_33sparse_rdiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_floordiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_35sparse_floordiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_rfloordiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_pow"), (PyCFunction)__pyx_pw_6pandas_7_sparse_39sparse_pow, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_rpow"), (PyCFunction)__pyx_pw_6pandas_7_sparse_41sparse_rpow, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("_sparse"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_BlockIndex, __pyx_k_BlockIndex, sizeof(__pyx_k_BlockIndex), 0, 0, 1, 1}, + {&__pyx_kp_s_Block_d_extends_beyond_end, __pyx_k_Block_d_extends_beyond_end, sizeof(__pyx_k_Block_d_extends_beyond_end), 0, 0, 1, 0}, + {&__pyx_kp_s_Block_d_overlaps, __pyx_k_Block_d_overlaps, sizeof(__pyx_k_Block_d_overlaps), 0, 0, 1, 0}, + {&__pyx_kp_s_Block_lengths_s, __pyx_k_Block_lengths_s, sizeof(__pyx_k_Block_lengths_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Block_locations_s, __pyx_k_Block_locations_s, sizeof(__pyx_k_Block_locations_s), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Indices_must_reference_same_unde, __pyx_k_Indices_must_reference_same_unde, sizeof(__pyx_k_Indices_must_reference_same_unde), 0, 0, 1, 0}, + {&__pyx_kp_s_Indices_s, __pyx_k_Indices_s, sizeof(__pyx_k_Indices_s), 0, 0, 1, 0}, + {&__pyx_n_s_IntIndex, __pyx_k_IntIndex, sizeof(__pyx_k_IntIndex), 0, 0, 1, 1}, + {&__pyx_kp_s_Locations_not_in_ascending_order, __pyx_k_Locations_not_in_ascending_order, sizeof(__pyx_k_Locations_not_in_ascending_order), 0, 0, 1, 0}, + {&__pyx_kp_s_Mode_must_be_0_or_1, __pyx_k_Mode_must_be_0_or_1, sizeof(__pyx_k_Mode_must_be_0_or_1), 0, 0, 1, 0}, + {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_Zero_length_block_d, __pyx_k_Zero_length_block_d, sizeof(__pyx_k_Zero_length_block_d), 0, 0, 1, 0}, + {&__pyx_n_s_array_equal, __pyx_k_array_equal, sizeof(__pyx_k_array_equal), 0, 0, 1, 1}, + {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1}, + {&__pyx_n_s_blengths, __pyx_k_blengths, sizeof(__pyx_k_blengths), 0, 0, 1, 1}, + {&__pyx_kp_s_block_bound_arrays_must_be_same, __pyx_k_block_bound_arrays_must_be_same, sizeof(__pyx_k_block_bound_arrays_must_be_same), 0, 0, 1, 0}, + {&__pyx_n_s_blocs, __pyx_k_blocs, sizeof(__pyx_k_blocs), 0, 0, 1, 1}, + {&__pyx_n_s_check_integrity, __pyx_k_check_integrity, sizeof(__pyx_k_check_integrity), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, + {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_get_reindexer, __pyx_k_get_reindexer, sizeof(__pyx_k_get_reindexer), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index_map, __pyx_k_index_map, sizeof(__pyx_k_index_map), 0, 0, 1, 1}, + {&__pyx_n_s_indexer, __pyx_k_indexer, sizeof(__pyx_k_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_intersect, __pyx_k_intersect, sizeof(__pyx_k_intersect), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_union, __pyx_k_make_union, sizeof(__pyx_k_make_union), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_new_length, __pyx_k_new_length, sizeof(__pyx_k_new_length), 0, 0, 1, 1}, + {&__pyx_n_s_ngaps, __pyx_k_ngaps, sizeof(__pyx_k_ngaps), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_pandas__sparse, __pyx_k_pandas__sparse, sizeof(__pyx_k_pandas__sparse), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reindex, __pyx_k_reindex, sizeof(__pyx_k_reindex), 0, 0, 1, 1}, + {&__pyx_n_s_reindex_integer, __pyx_k_reindex_integer, sizeof(__pyx_k_reindex_integer), 0, 0, 1, 1}, + {&__pyx_n_s_searchsorted, __pyx_k_searchsorted, sizeof(__pyx_k_searchsorted), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_div, __pyx_k_sparse_div, sizeof(__pyx_k_sparse_div), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_index, __pyx_k_sparse_index, sizeof(__pyx_k_sparse_index), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_nandiv, __pyx_k_sparse_nandiv, sizeof(__pyx_k_sparse_nandiv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_nanrdiv, __pyx_k_sparse_nanrdiv, sizeof(__pyx_k_sparse_nanrdiv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_nanrtruediv, __pyx_k_sparse_nanrtruediv, sizeof(__pyx_k_sparse_nanrtruediv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_nantruediv, __pyx_k_sparse_nantruediv, sizeof(__pyx_k_sparse_nantruediv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_rdiv, __pyx_k_sparse_rdiv, sizeof(__pyx_k_sparse_rdiv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_rtruediv, __pyx_k_sparse_rtruediv, sizeof(__pyx_k_sparse_rtruediv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_truediv, __pyx_k_sparse_truediv, sizeof(__pyx_k_sparse_truediv), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_to_block_index, __pyx_k_to_block_index, sizeof(__pyx_k_to_block_index), 0, 0, 1, 1}, + {&__pyx_n_s_to_int_index, __pyx_k_to_int_index, sizeof(__pyx_k_to_int_index), 0, 0, 1, 1}, + {&__pyx_n_s_to_put, __pyx_k_to_put, sizeof(__pyx_k_to_put), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xfill, __pyx_k_xfill, sizeof(__pyx_k_xfill), 0, 0, 1, 1}, + {&__pyx_n_s_xindex, __pyx_k_xindex, sizeof(__pyx_k_xindex), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_yfill, __pyx_k_yfill, sizeof(__pyx_k_yfill), 0, 0, 1, 1}, + {&__pyx_n_s_yindex, __pyx_k_yindex, sizeof(__pyx_k_yindex), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/src/sparse.pyx":102 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xindices = self.indices + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/src/sparse.pyx":136 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xindices = self.indices + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/src/sparse.pyx":322 + * + * if len(blocs) != len(blengths): + * raise ValueError('block bound arrays must be same length') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < self.nblocks: + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_block_bound_arrays_must_be_same); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/src/sparse.pyx":327 + * if i > 0: + * if blocs[i] <= blocs[i-1]: + * raise ValueError('Locations not in ascending order') # <<<<<<<<<<<<<< + * + * if i < self.nblocks - 1: + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Locations_not_in_ascending_order); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/src/sparse.pyx":396 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xloc = self.blocs + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/src/sparse.pyx":542 + * + * if x.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * self.xstart = self.x.blocs + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/src/sparse.pyx":632 + * + * if mode != 0 and mode != 1: + * raise Exception('Mode must be 0 or 1') # <<<<<<<<<<<<<< + * + * # so symmetric code will work + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Mode_must_be_0_or_1); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/src/sparse.pyx":1140 + * # Indexing operations + * + * def get_reindexer(ndarray[object, ndim=1] values, dict index_map): # <<<<<<<<<<<<<< + * cdef object idx + * cdef Py_ssize_t i + */ + __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_values, __pyx_n_s_index_map, __pyx_n_s_idx, __pyx_n_s_i, __pyx_n_s_new_length, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_reindexer, 1140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":1187 + * + * + * def reindex_integer(ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * IntIndex sparse_index, + * ndarray[int32_t, ndim=1] indexer): + */ + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_sparse_index, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_reindex_integer, 1187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_sparse(void); /*proto*/ +PyMODINIT_FUNC init_sparse(void) +#else +PyMODINIT_FUNC PyInit__sparse(void); /*proto*/ +PyMODINIT_FUNC PyInit__sparse(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__sparse(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_sparse"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas___sparse) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas._sparse")) { + if (unlikely(PyDict_SetItemString(modules, "pandas._sparse", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_SparseIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_SparseIndex.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "SparseIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_SparseIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_SparseIndex = &__pyx_type_6pandas_7_sparse_SparseIndex; + __pyx_vtabptr_6pandas_7_sparse_IntIndex = &__pyx_vtable_6pandas_7_sparse_IntIndex; + __pyx_vtable_6pandas_7_sparse_IntIndex.intersect = (struct __pyx_obj_6pandas_7_sparse_IntIndex *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_intersect; + __pyx_vtable_6pandas_7_sparse_IntIndex.make_union = (struct __pyx_obj_6pandas_7_sparse_IntIndex *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_make_union; + __pyx_vtable_6pandas_7_sparse_IntIndex.lookup = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_lookup; + __pyx_vtable_6pandas_7_sparse_IntIndex.reindex = (PyArrayObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_reindex; + __pyx_vtable_6pandas_7_sparse_IntIndex.put = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_put; + __pyx_vtable_6pandas_7_sparse_IntIndex.take = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_take; + __pyx_type_6pandas_7_sparse_IntIndex.tp_base = __pyx_ptype_6pandas_7_sparse_SparseIndex; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_IntIndex.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_IntIndex.tp_dict, __pyx_vtabptr_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "IntIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_IntIndex = &__pyx_type_6pandas_7_sparse_IntIndex; + __pyx_vtabptr_6pandas_7_sparse_BlockIndex = &__pyx_vtable_6pandas_7_sparse_BlockIndex; + __pyx_vtable_6pandas_7_sparse_BlockIndex.check_integrity = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_check_integrity; + __pyx_vtable_6pandas_7_sparse_BlockIndex.intersect = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_intersect; + __pyx_vtable_6pandas_7_sparse_BlockIndex.make_union = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_make_union; + __pyx_vtable_6pandas_7_sparse_BlockIndex.lookup = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_lookup; + __pyx_vtable_6pandas_7_sparse_BlockIndex.reindex = (PyArrayObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_reindex; + __pyx_vtable_6pandas_7_sparse_BlockIndex.put = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_put; + __pyx_vtable_6pandas_7_sparse_BlockIndex.take = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_take; + __pyx_type_6pandas_7_sparse_BlockIndex.tp_base = __pyx_ptype_6pandas_7_sparse_SparseIndex; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_BlockIndex.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockIndex.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_type_6pandas_7_sparse_BlockIndex.tp_weaklistoffset == 0) __pyx_type_6pandas_7_sparse_BlockIndex.tp_weaklistoffset = offsetof(struct __pyx_obj_6pandas_7_sparse_BlockIndex, __weakref__); + __pyx_ptype_6pandas_7_sparse_BlockIndex = &__pyx_type_6pandas_7_sparse_BlockIndex; + __pyx_vtabptr_6pandas_7_sparse_BlockMerge = &__pyx_vtable_6pandas_7_sparse_BlockMerge; + __pyx_vtable_6pandas_7_sparse_BlockMerge._make_merged_blocks = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *))__pyx_f_6pandas_7_sparse_10BlockMerge__make_merged_blocks; + __pyx_vtable_6pandas_7_sparse_BlockMerge._set_current_indices = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t, int))__pyx_f_6pandas_7_sparse_10BlockMerge__set_current_indices; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_BlockMerge.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockMerge.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockMerge", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_BlockMerge = &__pyx_type_6pandas_7_sparse_BlockMerge; + __pyx_vtabptr_6pandas_7_sparse_BlockIntersection = &__pyx_vtable_6pandas_7_sparse_BlockIntersection; + __pyx_vtable_6pandas_7_sparse_BlockIntersection.__pyx_base = *__pyx_vtabptr_6pandas_7_sparse_BlockMerge; + __pyx_type_6pandas_7_sparse_BlockIntersection.tp_base = __pyx_ptype_6pandas_7_sparse_BlockMerge; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_BlockIntersection.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockIntersection.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockIntersection", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_BlockIntersection = &__pyx_type_6pandas_7_sparse_BlockIntersection; + __pyx_vtabptr_6pandas_7_sparse_BlockUnion = &__pyx_vtable_6pandas_7_sparse_BlockUnion; + __pyx_vtable_6pandas_7_sparse_BlockUnion.__pyx_base = *__pyx_vtabptr_6pandas_7_sparse_BlockMerge; + __pyx_vtable_6pandas_7_sparse_BlockUnion.__pyx_base._make_merged_blocks = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *))__pyx_f_6pandas_7_sparse_10BlockUnion__make_merged_blocks; + __pyx_vtable_6pandas_7_sparse_BlockUnion._find_next_block_end = (__pyx_t_5numpy_int32_t (*)(struct __pyx_obj_6pandas_7_sparse_BlockUnion *, int))__pyx_f_6pandas_7_sparse_10BlockUnion__find_next_block_end; + __pyx_type_6pandas_7_sparse_BlockUnion.tp_base = __pyx_ptype_6pandas_7_sparse_BlockMerge; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_BlockUnion.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockUnion.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockUnion", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_BlockUnion = &__pyx_type_6pandas_7_sparse_BlockUnion; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/src/sparse.pyx":6 + * cimport cython + * + * import numpy as np # <<<<<<<<<<<<<< + * import operator + * import sys + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":7 + * + * import numpy as np + * import operator # <<<<<<<<<<<<<< + * import sys + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":8 + * import numpy as np + * import operator + * import sys # <<<<<<<<<<<<<< + * + * np.import_array() + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":10 + * import sys + * + * np.import_array() # <<<<<<<<<<<<<< + * np.import_ufunc() + * + */ + import_array(); + + /* "pandas/src/sparse.pyx":11 + * + * np.import_array() + * np.import_ufunc() # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + import_ufunc(); + + /* "pandas/src/sparse.pyx":16 + * # Preamble stuff + * + * cdef float64_t NaN = np.NaN # <<<<<<<<<<<<<< + * cdef float64_t INF = np.inf + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_7_sparse_NaN = ((__pyx_t_5numpy_float64_t)__pyx_t_3); + + /* "pandas/src/sparse.pyx":17 + * + * cdef float64_t NaN = np.NaN + * cdef float64_t INF = np.inf # <<<<<<<<<<<<<< + * + * cdef inline int int_max(int a, int b): return a if a >= b else b + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_7_sparse_INF = ((__pyx_t_5numpy_float64_t)__pyx_t_3); + + /* "pandas/src/sparse.pyx":80 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex, __pyx_n_s_ngaps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/sparse.pyx":79 + * return same_length and same_indices + * + * @property # <<<<<<<<<<<<<< + * def ngaps(self): + * return self.length - self.npoints + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex->tp_dict, __pyx_n_s_ngaps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6pandas_7_sparse_IntIndex); + + /* "pandas/src/sparse.pyx":304 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex, __pyx_n_s_ngaps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/sparse.pyx":303 + * return output + * + * @property # <<<<<<<<<<<<<< + * def ngaps(self): + * return self.length - self.npoints + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex->tp_dict, __pyx_n_s_ngaps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6pandas_7_sparse_BlockIndex); + + /* "pandas/src/sparse.pyx":1064 + * return sparse_nancombine(x, xindex, y, yindex, __rdiv) + * + * sparse_nantruediv = sparse_nandiv # <<<<<<<<<<<<<< + * sparse_nanrtruediv = sparse_nanrdiv + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_nandiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_nantruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1065 + * + * sparse_nantruediv = sparse_nandiv + * sparse_nanrtruediv = sparse_nanrdiv # <<<<<<<<<<<<<< + * + * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_nanrdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_nanrtruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1113 + * y, yindex, yfill, __rdiv) + * + * sparse_truediv = sparse_div # <<<<<<<<<<<<<< + * sparse_rtruediv = sparse_rdiv + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_truediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1114 + * + * sparse_truediv = sparse_div + * sparse_rtruediv = sparse_rdiv # <<<<<<<<<<<<<< + * + * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_rtruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1140 + * # Indexing operations + * + * def get_reindexer(ndarray[object, ndim=1] values, dict index_map): # <<<<<<<<<<<<<< + * cdef object idx + * cdef Py_ssize_t i + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7_sparse_43get_reindexer, NULL, __pyx_n_s_pandas__sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reindexer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1187 + * + * + * def reindex_integer(ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * IntIndex sparse_index, + * ndarray[int32_t, ndim=1] indexer): + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7_sparse_45reindex_integer, NULL, __pyx_n_s_pandas__sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reindex_integer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1 + * from numpy cimport ndarray, int32_t, float64_t # <<<<<<<<<<<<<< + * cimport numpy as np + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas._sparse", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas._sparse"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) + result = __Pyx_GetModuleGlobalName(name); + return result; +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files/pandas/src/testing.c b/cythonized-files/pandas/src/testing.c new file mode 100644 index 00000000..78df5b98 --- /dev/null +++ b/cythonized-files/pandas/src/testing.c @@ -0,0 +1,4188 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas___testing +#define __PYX_HAVE_API__pandas___testing +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "testing.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal; +struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal; + +/* "pandas/src/testing.pyx":42 + * return abs(desired - actual) < (0.5 * 10.0 ** -decimal) + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): # <<<<<<<<<<<<<< + * assert is_dictlike(a) and is_dictlike(b), ( + * "Cannot compare dict objects, one or both is not dict-like" + */ +struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal { + int __pyx_n; + int compare_keys; +}; + +/* "pandas/src/testing.pyx":58 + * return True + * + * cpdef assert_almost_equal(a, b, bint check_less_precise=False): # <<<<<<<<<<<<<< + * cdef: + * int decimal + */ +struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal { + int __pyx_n; + int check_less_precise; +}; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); + } + #if CYTHON_COMPILING_IN_CPYTHON + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); + #else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); + #endif +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'pandas._testing' */ +static PyObject *__pyx_v_6pandas_8_testing_NUMERIC_TYPES = 0; +static int __pyx_f_6pandas_8_testing_is_comparable_as_number(PyObject *); /*proto*/ +static int __pyx_f_6pandas_8_testing_isiterable(PyObject *); /*proto*/ +static int __pyx_f_6pandas_8_testing_has_length(PyObject *); /*proto*/ +static int __pyx_f_6pandas_8_testing_is_dictlike(PyObject *); /*proto*/ +static int __pyx_f_6pandas_8_testing_decimal_almost_equal(double, double, int); /*proto*/ +static PyObject *__pyx_f_6pandas_8_testing_assert_dict_equal(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6pandas_8_testing_assert_almost_equal(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal *__pyx_optional_args); /*proto*/ +#define __Pyx_MODULE_NAME "pandas._testing" +int __pyx_module_is_main_pandas___testing = 0; + +/* Implementation of 'pandas._testing' */ +static PyObject *__pyx_builtin_xrange; +static PyObject *__pyx_pf_6pandas_8_testing_assert_dict_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_compare_keys); /* proto */ +static PyObject *__pyx_pf_6pandas_8_testing_2assert_almost_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_check_less_precise); /* proto */ +static char __pyx_k_a[] = "a"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_len[] = "__len__"; +static char __pyx_k_r_r[] = "%r != %r"; +static char __pyx_k_bool[] = "bool"; +static char __pyx_k_int8[] = "int8"; +static char __pyx_k_iter[] = "__iter__"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_int16[] = "int16"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_isinf[] = "isinf"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_compat[] = "compat"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_isnull[] = "isnull"; +static char __pyx_k_pandas[] = "pandas"; +static char __pyx_k_uint16[] = "uint16"; +static char __pyx_k_uint32[] = "uint32"; +static char __pyx_k_uint64[] = "uint64"; +static char __pyx_k_xrange[] = "xrange"; +static char __pyx_k_float16[] = "float16"; +static char __pyx_k_float32[] = "float32"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_getitem[] = "__getitem__"; +static char __pyx_k_ndarray[] = "ndarray"; +static char __pyx_k_array_equal[] = "array_equal"; +static char __pyx_k_compare_keys[] = "compare_keys"; +static char __pyx_k_string_types[] = "string_types"; +static char __pyx_k_check_less_precise[] = "check_less_precise"; +static char __pyx_k_pandas_core_common[] = "pandas.core.common"; +static char __pyx_k_Cannot_compare_dict_objects_one[] = "Cannot compare dict objects, one or both is not dict-like"; +static char __pyx_k_First_object_is_iterable_second[] = "First object is iterable, second isn't: %r != %r"; +static char __pyx_k_First_object_is_not_null_second[] = "First object is not null, second is null: %r != %r"; +static char __pyx_k_First_object_is_null_second_isn[] = "First object is null, second isn't: %r != %r"; +static char __pyx_k_Length_of_two_iterators_not_the[] = "Length of two iterators not the same: %r != %r"; +static char __pyx_k_Second_object_is_iterable_first[] = "Second object is iterable, first isn't: %r != %r"; +static char __pyx_k_very_low_values_expected_5f_but[] = "(very low values) expected %.5f but got %.5f, with decimal %d"; +static char __pyx_k_Can_t_compare_objects_without_le[] = "Can't compare objects without length, one or both is invalid: (%r, %r)"; +static char __pyx_k_First_object_is_inf_second_isn_t[] = "First object is inf, second isn't"; +static char __pyx_k_First_object_is_numeric_second_i[] = "First object is numeric, second is not: %r != %r"; +static char __pyx_k_expected_5f_but_got_5f_with_deci[] = "expected %.5f but got %.5f, with decimal %d"; +static PyObject *__pyx_kp_s_Can_t_compare_objects_without_le; +static PyObject *__pyx_kp_s_Cannot_compare_dict_objects_one; +static PyObject *__pyx_kp_s_First_object_is_inf_second_isn_t; +static PyObject *__pyx_kp_s_First_object_is_iterable_second; +static PyObject *__pyx_kp_s_First_object_is_not_null_second; +static PyObject *__pyx_kp_s_First_object_is_null_second_isn; +static PyObject *__pyx_kp_s_First_object_is_numeric_second_i; +static PyObject *__pyx_kp_s_Length_of_two_iterators_not_the; +static PyObject *__pyx_kp_s_Second_object_is_iterable_first; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_array_equal; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_check_less_precise; +static PyObject *__pyx_n_s_compare_keys; +static PyObject *__pyx_n_s_compat; +static PyObject *__pyx_kp_s_expected_5f_but_got_5f_with_deci; +static PyObject *__pyx_n_s_float16; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_getitem; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_int16; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_isinf; +static PyObject *__pyx_n_s_isnull; +static PyObject *__pyx_n_s_iter; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_len; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_ndarray; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_pandas_core_common; +static PyObject *__pyx_kp_s_r_r; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_string_types; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_uint16; +static PyObject *__pyx_n_s_uint32; +static PyObject *__pyx_n_s_uint64; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_kp_s_very_low_values_expected_5f_but; +static PyObject *__pyx_n_s_xrange; + +/* "pandas/src/testing.pyx":24 + * ) + * + * cdef bint is_comparable_as_number(obj): # <<<<<<<<<<<<<< + * return isinstance(obj, NUMERIC_TYPES) + * + */ + +static int __pyx_f_6pandas_8_testing_is_comparable_as_number(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_comparable_as_number", 0); + + /* "pandas/src/testing.pyx":25 + * + * cdef bint is_comparable_as_number(obj): + * return isinstance(obj, NUMERIC_TYPES) # <<<<<<<<<<<<<< + * + * cdef bint isiterable(obj): + */ + __pyx_t_1 = __pyx_v_6pandas_8_testing_NUMERIC_TYPES; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":24 + * ) + * + * cdef bint is_comparable_as_number(obj): # <<<<<<<<<<<<<< + * return isinstance(obj, NUMERIC_TYPES) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("pandas._testing.is_comparable_as_number", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":27 + * return isinstance(obj, NUMERIC_TYPES) + * + * cdef bint isiterable(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, '__iter__') + * + */ + +static int __pyx_f_6pandas_8_testing_isiterable(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isiterable", 0); + + /* "pandas/src/testing.pyx":28 + * + * cdef bint isiterable(obj): + * return hasattr(obj, '__iter__') # <<<<<<<<<<<<<< + * + * cdef bint has_length(obj): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_s_iter); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":27 + * return isinstance(obj, NUMERIC_TYPES) + * + * cdef bint isiterable(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, '__iter__') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._testing.isiterable", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":30 + * return hasattr(obj, '__iter__') + * + * cdef bint has_length(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, '__len__') + * + */ + +static int __pyx_f_6pandas_8_testing_has_length(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("has_length", 0); + + /* "pandas/src/testing.pyx":31 + * + * cdef bint has_length(obj): + * return hasattr(obj, '__len__') # <<<<<<<<<<<<<< + * + * cdef bint is_dictlike(obj): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_s_len); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":30 + * return hasattr(obj, '__iter__') + * + * cdef bint has_length(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, '__len__') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._testing.has_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":33 + * return hasattr(obj, '__len__') + * + * cdef bint is_dictlike(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') + * + */ + +static int __pyx_f_6pandas_8_testing_is_dictlike(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_dictlike", 0); + + /* "pandas/src/testing.pyx":34 + * + * cdef bint is_dictlike(obj): + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') # <<<<<<<<<<<<<< + * + * cdef bint decimal_almost_equal(double desired, double actual, int decimal): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_s_keys); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __pyx_t_2 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_s_getitem); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":33 + * return hasattr(obj, '__len__') + * + * cdef bint is_dictlike(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._testing.is_dictlike", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":36 + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') + * + * cdef bint decimal_almost_equal(double desired, double actual, int decimal): # <<<<<<<<<<<<<< + * # Code from + * # http://docs.scipy.org/doc/numpy/reference/generated + */ + +static int __pyx_f_6pandas_8_testing_decimal_almost_equal(double __pyx_v_desired, double __pyx_v_actual, int __pyx_v_decimal) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("decimal_almost_equal", 0); + + /* "pandas/src/testing.pyx":40 + * # http://docs.scipy.org/doc/numpy/reference/generated + * # /numpy.testing.assert_almost_equal.html + * return abs(desired - actual) < (0.5 * 10.0 ** -decimal) # <<<<<<<<<<<<<< + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): + */ + __pyx_r = (fabs((__pyx_v_desired - __pyx_v_actual)) < (0.5 * pow(10.0, ((double)(-__pyx_v_decimal))))); + goto __pyx_L0; + + /* "pandas/src/testing.pyx":36 + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') + * + * cdef bint decimal_almost_equal(double desired, double actual, int decimal): # <<<<<<<<<<<<<< + * # Code from + * # http://docs.scipy.org/doc/numpy/reference/generated + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":42 + * return abs(desired - actual) < (0.5 * 10.0 ** -decimal) + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): # <<<<<<<<<<<<<< + * assert is_dictlike(a) and is_dictlike(b), ( + * "Cannot compare dict objects, one or both is not dict-like" + */ + +static PyObject *__pyx_pw_6pandas_8_testing_1assert_dict_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_8_testing_assert_dict_equal(PyObject *__pyx_v_a, PyObject *__pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal *__pyx_optional_args) { + int __pyx_v_compare_keys = ((int)1); + PyObject *__pyx_v_a_keys = NULL; + PyObject *__pyx_v_b_keys = NULL; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_dict_equal", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_compare_keys = __pyx_optional_args->compare_keys; + } + } + + /* "pandas/src/testing.pyx":43 + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): + * assert is_dictlike(a) and is_dictlike(b), ( # <<<<<<<<<<<<<< + * "Cannot compare dict objects, one or both is not dict-like" + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = (__pyx_f_6pandas_8_testing_is_dictlike(__pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_f_6pandas_8_testing_is_dictlike(__pyx_v_b) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (unlikely(!__pyx_t_3)) { + PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Cannot_compare_dict_objects_one); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":47 + * ) + * + * a_keys = frozenset(a.keys()) # <<<<<<<<<<<<<< + * b_keys = frozenset(b.keys()) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyFrozenSet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_a_keys = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/testing.pyx":48 + * + * a_keys = frozenset(a.keys()) + * b_keys = frozenset(b.keys()) # <<<<<<<<<<<<<< + * + * if compare_keys: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyFrozenSet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_b_keys = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/testing.pyx":50 + * b_keys = frozenset(b.keys()) + * + * if compare_keys: # <<<<<<<<<<<<<< + * assert a_keys == b_keys + * + */ + __pyx_t_3 = (__pyx_v_compare_keys != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":51 + * + * if compare_keys: + * assert a_keys == b_keys # <<<<<<<<<<<<<< + * + * for k in a_keys: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyObject_RichCompare(__pyx_v_a_keys, __pyx_v_b_keys, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/testing.pyx":53 + * assert a_keys == b_keys + * + * for k in a_keys: # <<<<<<<<<<<<<< + * assert_almost_equal(a[k], b[k]) + * + */ + __pyx_t_4 = PyObject_GetIter(__pyx_v_a_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + for (;;) { + { + __pyx_t_5 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/testing.pyx":54 + * + * for k in a_keys: + * assert_almost_equal(a[k], b[k]) # <<<<<<<<<<<<<< + * + * return True + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_a, __pyx_v_k); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyObject_GetItem(__pyx_v_b, __pyx_v_k); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __pyx_f_6pandas_8_testing_assert_almost_equal(__pyx_t_5, __pyx_t_7, 0, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/testing.pyx":56 + * assert_almost_equal(a[k], b[k]) + * + * return True # <<<<<<<<<<<<<< + * + * cpdef assert_almost_equal(a, b, bint check_less_precise=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":42 + * return abs(desired - actual) < (0.5 * 10.0 ** -decimal) + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): # <<<<<<<<<<<<<< + * assert is_dictlike(a) and is_dictlike(b), ( + * "Cannot compare dict objects, one or both is not dict-like" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas._testing.assert_dict_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_a_keys); + __Pyx_XDECREF(__pyx_v_b_keys); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_8_testing_1assert_dict_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_8_testing_1assert_dict_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_b = 0; + int __pyx_v_compare_keys; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("assert_dict_equal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_compare_keys,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("assert_dict_equal", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compare_keys); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assert_dict_equal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_a = values[0]; + __pyx_v_b = values[1]; + if (values[2]) { + __pyx_v_compare_keys = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_compare_keys == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_compare_keys = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("assert_dict_equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._testing.assert_dict_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_8_testing_assert_dict_equal(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_compare_keys); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_8_testing_assert_dict_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_compare_keys) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_dict_equal", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.compare_keys = __pyx_v_compare_keys; + __pyx_t_1 = __pyx_f_6pandas_8_testing_assert_dict_equal(__pyx_v_a, __pyx_v_b, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._testing.assert_dict_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":58 + * return True + * + * cpdef assert_almost_equal(a, b, bint check_less_precise=False): # <<<<<<<<<<<<<< + * cdef: + * int decimal + */ + +static PyObject *__pyx_pw_6pandas_8_testing_3assert_almost_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_8_testing_assert_almost_equal(PyObject *__pyx_v_a, PyObject *__pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal *__pyx_optional_args) { + int __pyx_v_check_less_precise = ((int)0); + int __pyx_v_decimal; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_na; + Py_ssize_t __pyx_v_nb; + double __pyx_v_fa; + double __pyx_v_fb; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal __pyx_t_12; + double __pyx_t_13; + double __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_almost_equal", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_check_less_precise = __pyx_optional_args->check_less_precise; + } + } + + /* "pandas/src/testing.pyx":64 + * double fa, fb + * + * if isinstance(a, dict) or isinstance(b, dict): # <<<<<<<<<<<<<< + * return assert_dict_equal(a, b) + * + */ + __pyx_t_1 = PyDict_Check(__pyx_v_a); + if (!(__pyx_t_1 != 0)) { + __pyx_t_2 = PyDict_Check(__pyx_v_b); + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":65 + * + * if isinstance(a, dict) or isinstance(b, dict): + * return assert_dict_equal(a, b) # <<<<<<<<<<<<<< + * + * if (isinstance(a, compat.string_types) or + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __pyx_f_6pandas_8_testing_assert_dict_equal(__pyx_v_a, __pyx_v_b, 0, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":67 + * return assert_dict_equal(a, b) + * + * if (isinstance(a, compat.string_types) or # <<<<<<<<<<<<<< + * isinstance(b, compat.string_types)): + * assert a == b, "%r != %r" % (a, b) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_compat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyObject_IsInstance(__pyx_v_a, __pyx_t_5); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(__pyx_t_3 != 0)) { + + /* "pandas/src/testing.pyx":68 + * + * if (isinstance(a, compat.string_types) or + * isinstance(b, compat.string_types)): # <<<<<<<<<<<<<< + * assert a == b, "%r != %r" % (a, b) + * return True + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_compat); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_string_types); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_b, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + } else { + __pyx_t_2 = (__pyx_t_3 != 0); + } + if (__pyx_t_2) { + + /* "pandas/src/testing.pyx":69 + * if (isinstance(a, compat.string_types) or + * isinstance(b, compat.string_types)): + * assert a == b, "%r != %r" % (a, b) # <<<<<<<<<<<<<< + * return True + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) { + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_r_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":70 + * isinstance(b, compat.string_types)): + * assert a == b, "%r != %r" % (a, b) + * return True # <<<<<<<<<<<<<< + * + * if isiterable(a): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":72 + * return True + * + * if isiterable(a): # <<<<<<<<<<<<<< + * assert isiterable(b), ( + * "First object is iterable, second isn't: %r != %r" % (a, b) + */ + __pyx_t_2 = (__pyx_f_6pandas_8_testing_isiterable(__pyx_v_a) != 0); + if (__pyx_t_2) { + + /* "pandas/src/testing.pyx":73 + * + * if isiterable(a): + * assert isiterable(b), ( # <<<<<<<<<<<<<< + * "First object is iterable, second isn't: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_f_6pandas_8_testing_isiterable(__pyx_v_b) != 0))) { + + /* "pandas/src/testing.pyx":74 + * if isiterable(a): + * assert isiterable(b), ( + * "First object is iterable, second isn't: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * assert has_length(a) and has_length(b), ( + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_First_object_is_iterable_second, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":76 + * "First object is iterable, second isn't: %r != %r" % (a, b) + * ) + * assert has_length(a) and has_length(b), ( # <<<<<<<<<<<<<< + * "Can't compare objects without length, one or both is invalid: " + * "(%r, %r)" % (a, b) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = (__pyx_f_6pandas_8_testing_has_length(__pyx_v_a) != 0); + if (__pyx_t_2) { + __pyx_t_3 = (__pyx_f_6pandas_8_testing_has_length(__pyx_v_b) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (unlikely(!__pyx_t_1)) { + + /* "pandas/src/testing.pyx":78 + * assert has_length(a) and has_length(b), ( + * "Can't compare objects without length, one or both is invalid: " + * "(%r, %r)" % (a, b) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Can_t_compare_objects_without_le, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":81 + * ) + * + * na, nb = len(a), len(b) # <<<<<<<<<<<<<< + * assert na == nb, ( + * "Length of two iterators not the same: %r != %r" % (na, nb) + */ + __pyx_t_6 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Length(__pyx_v_b); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_na = __pyx_t_6; + __pyx_v_nb = __pyx_t_7; + + /* "pandas/src/testing.pyx":82 + * + * na, nb = len(a), len(b) + * assert na == nb, ( # <<<<<<<<<<<<<< + * "Length of two iterators not the same: %r != %r" % (na, nb) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_na == __pyx_v_nb) != 0))) { + + /* "pandas/src/testing.pyx":83 + * na, nb = len(a), len(b) + * assert na == nb, ( + * "Length of two iterators not the same: %r != %r" % (na, nb) # <<<<<<<<<<<<<< + * ) + * if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_na); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nb); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Length_of_two_iterators_not_the, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":85 + * "Length of two iterators not the same: %r != %r" % (na, nb) + * ) + * if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): # <<<<<<<<<<<<<< + * try: + * if np.array_equal(a, b): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_a, __pyx_t_8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if ((__pyx_t_1 != 0)) { + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = PyObject_IsInstance(__pyx_v_b, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":86 + * ) + * if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): + * try: # <<<<<<<<<<<<<< + * if np.array_equal(a, b): + * return True + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "pandas/src/testing.pyx":87 + * if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): + * try: + * if np.array_equal(a, b): # <<<<<<<<<<<<<< + * return True + * except: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":88 + * try: + * if np.array_equal(a, b): + * return True # <<<<<<<<<<<<<< + * except: + * pass + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L11_try_return; + } + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/testing.pyx":89 + * if np.array_equal(a, b): + * return True + * except: # <<<<<<<<<<<<<< + * pass + * + */ + /*except:*/ { + PyErr_Restore(0,0,0); + goto __pyx_L8_exception_handled; + } + __pyx_L11_try_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L0; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L14_try_end:; + } + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/testing.pyx":92 + * pass + * + * for i in xrange(na): # <<<<<<<<<<<<<< + * assert_almost_equal(a[i], b[i], check_less_precise) + * + */ + __pyx_t_7 = __pyx_v_na; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/testing.pyx":93 + * + * for i in xrange(na): + * assert_almost_equal(a[i], b[i], check_less_precise) # <<<<<<<<<<<<<< + * + * return True + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_a, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_b, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12.__pyx_n = 1; + __pyx_t_12.check_less_precise = __pyx_v_check_less_precise; + __pyx_t_8 = __pyx_f_6pandas_8_testing_assert_almost_equal(__pyx_t_5, __pyx_t_4, 0, &__pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + + /* "pandas/src/testing.pyx":95 + * assert_almost_equal(a[i], b[i], check_less_precise) + * + * return True # <<<<<<<<<<<<<< + * elif isiterable(b): + * assert False, ( + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":96 + * + * return True + * elif isiterable(b): # <<<<<<<<<<<<<< + * assert False, ( + * "Second object is iterable, first isn't: %r != %r" % (a, b) + */ + __pyx_t_3 = (__pyx_f_6pandas_8_testing_isiterable(__pyx_v_b) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":97 + * return True + * elif isiterable(b): + * assert False, ( # <<<<<<<<<<<<<< + * "Second object is iterable, first isn't: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!0)) { + + /* "pandas/src/testing.pyx":98 + * elif isiterable(b): + * assert False, ( + * "Second object is iterable, first isn't: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Second_object_is_iterable_first, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/testing.pyx":101 + * ) + * + * if isnull(a): # <<<<<<<<<<<<<< + * assert isnull(b), ( + * "First object is null, second isn't: %r != %r" % (a, b) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":102 + * + * if isnull(a): + * assert isnull(b), ( # <<<<<<<<<<<<<< + * "First object is null, second isn't: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnull); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) { + + /* "pandas/src/testing.pyx":103 + * if isnull(a): + * assert isnull(b), ( + * "First object is null, second isn't: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * return True + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_First_object_is_null_second_isn, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":105 + * "First object is null, second isn't: %r != %r" % (a, b) + * ) + * return True # <<<<<<<<<<<<<< + * elif isnull(b): + * assert isnull(a), ( + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":106 + * ) + * return True + * elif isnull(b): # <<<<<<<<<<<<<< + * assert isnull(a), ( + * "First object is not null, second is null: %r != %r" % (a, b) + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnull); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":107 + * return True + * elif isnull(b): + * assert isnull(a), ( # <<<<<<<<<<<<<< + * "First object is not null, second is null: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnull); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) { + + /* "pandas/src/testing.pyx":108 + * elif isnull(b): + * assert isnull(a), ( + * "First object is not null, second is null: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * return True + */ + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_First_object_is_not_null_second, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":110 + * "First object is not null, second is null: %r != %r" % (a, b) + * ) + * return True # <<<<<<<<<<<<<< + * + * if is_comparable_as_number(a): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":112 + * return True + * + * if is_comparable_as_number(a): # <<<<<<<<<<<<<< + * assert is_comparable_as_number(b), ( + * "First object is numeric, second is not: %r != %r" % (a, b) + */ + __pyx_t_3 = (__pyx_f_6pandas_8_testing_is_comparable_as_number(__pyx_v_a) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":113 + * + * if is_comparable_as_number(a): + * assert is_comparable_as_number(b), ( # <<<<<<<<<<<<<< + * "First object is numeric, second is not: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_f_6pandas_8_testing_is_comparable_as_number(__pyx_v_b) != 0))) { + + /* "pandas/src/testing.pyx":114 + * if is_comparable_as_number(a): + * assert is_comparable_as_number(b), ( + * "First object is numeric, second is not: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_First_object_is_numeric_second_i, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":117 + * ) + * + * decimal = 5 # <<<<<<<<<<<<<< + * + * # deal with differing dtypes + */ + __pyx_v_decimal = 5; + + /* "pandas/src/testing.pyx":120 + * + * # deal with differing dtypes + * if check_less_precise: # <<<<<<<<<<<<<< + * decimal = 3 + * + */ + __pyx_t_3 = (__pyx_v_check_less_precise != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":121 + * # deal with differing dtypes + * if check_less_precise: + * decimal = 3 # <<<<<<<<<<<<<< + * + * if np.isinf(a): + */ + __pyx_v_decimal = 3; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/src/testing.pyx":123 + * decimal = 3 + * + * if np.isinf(a): # <<<<<<<<<<<<<< + * assert np.isinf(b), "First object is inf, second isn't" + * else: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isinf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":124 + * + * if np.isinf(a): + * assert np.isinf(b), "First object is inf, second isn't" # <<<<<<<<<<<<<< + * else: + * fa, fb = a, b + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isinf); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) { + PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_First_object_is_inf_second_isn_t); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/testing.pyx":126 + * assert np.isinf(b), "First object is inf, second isn't" + * else: + * fa, fb = a, b # <<<<<<<<<<<<<< + * + * # case for zero + */ + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_b); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fa = __pyx_t_13; + __pyx_v_fb = __pyx_t_14; + + /* "pandas/src/testing.pyx":129 + * + * # case for zero + * if abs(fa) < 1e-5: # <<<<<<<<<<<<<< + * if not decimal_almost_equal(fa, fb, decimal): + * assert False, ( + */ + __pyx_t_3 = ((fabs(__pyx_v_fa) < 1e-5) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":130 + * # case for zero + * if abs(fa) < 1e-5: + * if not decimal_almost_equal(fa, fb, decimal): # <<<<<<<<<<<<<< + * assert False, ( + * '(very low values) expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) + */ + __pyx_t_3 = ((!(__pyx_f_6pandas_8_testing_decimal_almost_equal(__pyx_v_fa, __pyx_v_fb, __pyx_v_decimal) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":131 + * if abs(fa) < 1e-5: + * if not decimal_almost_equal(fa, fb, decimal): + * assert False, ( # <<<<<<<<<<<<<< + * '(very low values) expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!0)) { + + /* "pandas/src/testing.pyx":132 + * if not decimal_almost_equal(fa, fb, decimal): + * assert False, ( + * '(very low values) expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) # <<<<<<<<<<<<<< + * ) + * else: + */ + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_fb); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_fa); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_decimal); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_very_low_values_expected_5f_but, __pyx_t_15); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L23; + } + __pyx_L23:; + goto __pyx_L22; + } + /*else*/ { + + /* "pandas/src/testing.pyx":135 + * ) + * else: + * if not decimal_almost_equal(1, fb / fa, decimal): # <<<<<<<<<<<<<< + * assert False, 'expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) + * + */ + if (unlikely(__pyx_v_fa == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = ((!(__pyx_f_6pandas_8_testing_decimal_almost_equal(1.0, (__pyx_v_fb / __pyx_v_fa), __pyx_v_decimal) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":136 + * else: + * if not decimal_almost_equal(1, fb / fa, decimal): + * assert False, 'expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) # <<<<<<<<<<<<<< + * + * else: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!0)) { + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_fb); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = PyFloat_FromDouble(__pyx_v_fa); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_decimal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_8 = 0; + __pyx_t_15 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_expected_5f_but_got_5f_with_deci, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L24; + } + __pyx_L24:; + } + __pyx_L22:; + } + __pyx_L21:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/testing.pyx":139 + * + * else: + * assert a == b, "%r != %r" % (a, b) # <<<<<<<<<<<<<< + * + * return True + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_5 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) { + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_r_r, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + } + __pyx_L19:; + + /* "pandas/src/testing.pyx":141 + * assert a == b, "%r != %r" % (a, b) + * + * return True # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":58 + * return True + * + * cpdef assert_almost_equal(a, b, bint check_less_precise=False): # <<<<<<<<<<<<<< + * cdef: + * int decimal + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("pandas._testing.assert_almost_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_8_testing_3assert_almost_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_8_testing_3assert_almost_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_b = 0; + int __pyx_v_check_less_precise; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("assert_almost_equal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_check_less_precise,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("assert_almost_equal", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check_less_precise); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assert_almost_equal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_a = values[0]; + __pyx_v_b = values[1]; + if (values[2]) { + __pyx_v_check_less_precise = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_check_less_precise == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_check_less_precise = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("assert_almost_equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._testing.assert_almost_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_8_testing_2assert_almost_equal(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_check_less_precise); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_8_testing_2assert_almost_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_check_less_precise) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_almost_equal", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.check_less_precise = __pyx_v_check_less_precise; + __pyx_t_1 = __pyx_f_6pandas_8_testing_assert_almost_equal(__pyx_v_a, __pyx_v_b, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._testing.assert_almost_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("assert_dict_equal"), (PyCFunction)__pyx_pw_6pandas_8_testing_1assert_dict_equal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("assert_almost_equal"), (PyCFunction)__pyx_pw_6pandas_8_testing_3assert_almost_equal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("_testing"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_Can_t_compare_objects_without_le, __pyx_k_Can_t_compare_objects_without_le, sizeof(__pyx_k_Can_t_compare_objects_without_le), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_compare_dict_objects_one, __pyx_k_Cannot_compare_dict_objects_one, sizeof(__pyx_k_Cannot_compare_dict_objects_one), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_inf_second_isn_t, __pyx_k_First_object_is_inf_second_isn_t, sizeof(__pyx_k_First_object_is_inf_second_isn_t), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_iterable_second, __pyx_k_First_object_is_iterable_second, sizeof(__pyx_k_First_object_is_iterable_second), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_not_null_second, __pyx_k_First_object_is_not_null_second, sizeof(__pyx_k_First_object_is_not_null_second), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_null_second_isn, __pyx_k_First_object_is_null_second_isn, sizeof(__pyx_k_First_object_is_null_second_isn), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_numeric_second_i, __pyx_k_First_object_is_numeric_second_i, sizeof(__pyx_k_First_object_is_numeric_second_i), 0, 0, 1, 0}, + {&__pyx_kp_s_Length_of_two_iterators_not_the, __pyx_k_Length_of_two_iterators_not_the, sizeof(__pyx_k_Length_of_two_iterators_not_the), 0, 0, 1, 0}, + {&__pyx_kp_s_Second_object_is_iterable_first, __pyx_k_Second_object_is_iterable_first, sizeof(__pyx_k_Second_object_is_iterable_first), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_array_equal, __pyx_k_array_equal, sizeof(__pyx_k_array_equal), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_check_less_precise, __pyx_k_check_less_precise, sizeof(__pyx_k_check_less_precise), 0, 0, 1, 1}, + {&__pyx_n_s_compare_keys, __pyx_k_compare_keys, sizeof(__pyx_k_compare_keys), 0, 0, 1, 1}, + {&__pyx_n_s_compat, __pyx_k_compat, sizeof(__pyx_k_compat), 0, 0, 1, 1}, + {&__pyx_kp_s_expected_5f_but_got_5f_with_deci, __pyx_k_expected_5f_but_got_5f_with_deci, sizeof(__pyx_k_expected_5f_but_got_5f_with_deci), 0, 0, 1, 0}, + {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_isinf, __pyx_k_isinf, sizeof(__pyx_k_isinf), 0, 0, 1, 1}, + {&__pyx_n_s_isnull, __pyx_k_isnull, sizeof(__pyx_k_isnull), 0, 0, 1, 1}, + {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_core_common, __pyx_k_pandas_core_common, sizeof(__pyx_k_pandas_core_common), 0, 0, 1, 1}, + {&__pyx_kp_s_r_r, __pyx_k_r_r, sizeof(__pyx_k_r_r), 0, 0, 1, 0}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_string_types, __pyx_k_string_types, sizeof(__pyx_k_string_types), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1}, + {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1}, + {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_kp_s_very_low_values_expected_5f_but, __pyx_k_very_low_values_expected_5f_but, sizeof(__pyx_k_very_low_values_expected_5f_but), 0, 0, 1, 0}, + {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + #if PY_MAJOR_VERSION >= 3 + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_testing(void); /*proto*/ +PyMODINIT_FUNC init_testing(void) +#else +PyMODINIT_FUNC PyInit__testing(void); /*proto*/ +PyMODINIT_FUNC PyInit__testing(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__testing(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_testing"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas___testing) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas._testing")) { + if (unlikely(PyDict_SetItemString(modules, "pandas._testing", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + __pyx_v_6pandas_8_testing_NUMERIC_TYPES = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/src/testing.pyx":1 + * import numpy as np # <<<<<<<<<<<<<< + * + * from pandas import compat + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":3 + * import numpy as np + * + * from pandas import compat # <<<<<<<<<<<<<< + * from pandas.core.common import isnull + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_compat); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_compat); + __Pyx_GIVEREF(__pyx_n_s_compat); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_compat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/testing.pyx":4 + * + * from pandas import compat + * from pandas.core.common import isnull # <<<<<<<<<<<<<< + * + * cdef NUMERIC_TYPES = ( + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_isnull); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_isnull); + __Pyx_GIVEREF(__pyx_n_s_isnull); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_core_common, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_isnull); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":10 + * int, + * float, + * np.bool, # <<<<<<<<<<<<<< + * np.int8, + * np.int16, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":11 + * float, + * np.bool, + * np.int8, # <<<<<<<<<<<<<< + * np.int16, + * np.int32, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":12 + * np.bool, + * np.int8, + * np.int16, # <<<<<<<<<<<<<< + * np.int32, + * np.int64, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":13 + * np.int8, + * np.int16, + * np.int32, # <<<<<<<<<<<<<< + * np.int64, + * np.uint8, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":14 + * np.int16, + * np.int32, + * np.int64, # <<<<<<<<<<<<<< + * np.uint8, + * np.uint16, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":15 + * np.int32, + * np.int64, + * np.uint8, # <<<<<<<<<<<<<< + * np.uint16, + * np.uint32, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":16 + * np.int64, + * np.uint8, + * np.uint16, # <<<<<<<<<<<<<< + * np.uint32, + * np.uint64, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":17 + * np.uint8, + * np.uint16, + * np.uint32, # <<<<<<<<<<<<<< + * np.uint64, + * np.float16, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":18 + * np.uint16, + * np.uint32, + * np.uint64, # <<<<<<<<<<<<<< + * np.float16, + * np.float32, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":19 + * np.uint32, + * np.uint64, + * np.float16, # <<<<<<<<<<<<<< + * np.float32, + * np.float64, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":20 + * np.uint64, + * np.float16, + * np.float32, # <<<<<<<<<<<<<< + * np.float64, + * ) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":21 + * np.float16, + * np.float32, + * np.float64, # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":7 + * + * cdef NUMERIC_TYPES = ( + * bool, # <<<<<<<<<<<<<< + * int, + * float, + */ + __pyx_t_1 = PyTuple_New(15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((PyObject*)(&PyInt_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)((PyObject*)(&PyFloat_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 11, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_1, 13, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_1, 14, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __Pyx_XGOTREF(__pyx_v_6pandas_8_testing_NUMERIC_TYPES); + __Pyx_DECREF_SET(__pyx_v_6pandas_8_testing_NUMERIC_TYPES, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":1 + * import numpy as np # <<<<<<<<<<<<<< + * + * from pandas import compat + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas._testing", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas._testing"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files/pandas/tslib.c b/cythonized-files/pandas/tslib.c new file mode 100644 index 00000000..83af8781 --- /dev/null +++ b/cythonized-files/pandas/tslib.c @@ -0,0 +1,71036 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:39:47 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__tslib +#define __PYX_HAVE_API__pandas__tslib +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "headers/stdint.h" +#include "datetime.h" +#include "datetime_helper.h" +#include "numpy/ndarrayobject.h" +#include "numpy_helper.h" +#include "numpy/npy_common.h" +#include "datetime/np_datetime.h" +#include "datetime/np_datetime_strings.h" +#include "khash_python.h" +#include "period.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "tslib.pyx", + "datetime.pxd", + "numpy.pxd", + "util.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_5tslib__Timestamp; +struct __pyx_obj_6pandas_5tslib__NaT; +struct __pyx_obj_6pandas_5tslib__TSObject; +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__; +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr; +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE; +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_opt_args_6pandas_5tslib_resolution; + +/* "pandas/tslib.pyx":3292 + * # period accessors + * + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN # <<<<<<<<<<<<<< + * + * def get_period_field(int code, int64_t value, int freq): + */ +typedef int (*__pyx_t_6pandas_5tslib_accessor)(__pyx_t_5numpy_int64_t, int); + +/* "pandas/tslib.pyx":3365 + * return ordinals + * + * cpdef resolution(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ +struct __pyx_opt_args_6pandas_5tslib_resolution { + int __pyx_n; + PyObject *tz; +}; + +/* "pandas/tslib.pyx":649 + * # (see Timestamp class above). This will serve as a C extension type that + * # shadows the python class, where we do any heavy lifting. + * cdef class _Timestamp(datetime): # <<<<<<<<<<<<<< + * cdef readonly: + * int64_t value, nanosecond + */ +struct __pyx_obj_6pandas_5tslib__Timestamp { + PyDateTime_DateTime __pyx_base; + struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *__pyx_vtab; + __pyx_t_5numpy_int64_t value; + __pyx_t_5numpy_int64_t nanosecond; + PyObject *offset; +}; + + +/* "pandas/tslib.pyx":804 + * + * + * cdef class _NaT(_Timestamp): # <<<<<<<<<<<<<< + * + * def __hash__(_NaT self): + */ +struct __pyx_obj_6pandas_5tslib__NaT { + struct __pyx_obj_6pandas_5tslib__Timestamp __pyx_base; +}; + + +/* "pandas/tslib.pyx":858 + * + * # lightweight C object to hold datetime & int64 pair + * cdef class _TSObject: # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts # pandas_datetimestruct + */ +struct __pyx_obj_6pandas_5tslib__TSObject { + PyObject_HEAD + pandas_datetimestruct dts; + __pyx_t_5numpy_int64_t value; + PyObject *tzinfo; +}; + + +/* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ { + PyObject_HEAD + PyObject *__pyx_v_self; +}; + + +/* "pandas/tslib.pyx":3686 + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone # <<<<<<<<<<<<<< + * for tz in tz_names), + * 'Z'), + */ +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr { + PyObject_HEAD + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *__pyx_outer_scope; + PyObject *__pyx_v_tz; + PyObject *__pyx_v_tz_names; + PyObject *__pyx_t_0; + PyObject *__pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); +}; + + +/* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE { + PyObject_HEAD + PyObject *__pyx_v_to_convert; +}; + + +/* "pandas/tslib.pyx":3710 + * else: + * return '' + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) # <<<<<<<<<<<<<< + * regex = '(?P<%s>%s' % (directive, regex) + * return '%s)' % regex + */ +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr { + PyObject_HEAD + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *__pyx_outer_scope; + PyObject *__pyx_v_stuff; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; + PyObject *(*__pyx_t_2)(PyObject *); +}; + + + +/* "pandas/tslib.pyx":649 + * # (see Timestamp class above). This will serve as a C extension type that + * # shadows the python class, where we do any heavy lifting. + * cdef class _Timestamp(datetime): # <<<<<<<<<<<<<< + * cdef readonly: + * int64_t value, nanosecond + */ + +struct __pyx_vtabstruct_6pandas_5tslib__Timestamp { + int (*_compare_outside_nanorange)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyDateTime_DateTime *, int); + int (*_assert_tzawareness_compat)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *); + PyDateTime_DateTime *(*to_datetime)(struct __pyx_obj_6pandas_5tslib__Timestamp *, int __pyx_skip_dispatch); + PyObject *(*_get_field)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_get_start_end_field)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *__pyx_vtabptr_6pandas_5tslib__Timestamp; + + +/* "pandas/tslib.pyx":804 + * + * + * cdef class _NaT(_Timestamp): # <<<<<<<<<<<<<< + * + * def __hash__(_NaT self): + */ + +struct __pyx_vtabstruct_6pandas_5tslib__NaT { + struct __pyx_vtabstruct_6pandas_5tslib__Timestamp __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_5tslib__NaT *__pyx_vtabptr_6pandas_5tslib__NaT; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*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); /*proto*/ + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +#if CYTHON_COMPILING_IN_CPYTHON +#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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*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); + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* proto */ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ +#if CYTHON_COMPILING_IN_PYPY +#define __Pyx_PyObject_AsDouble(obj) \ +(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \ + likely(PyInt_CheckExact(obj)) ? \ + PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) +#else +#define __Pyx_PyObject_AsDouble(obj) \ +((likely(PyFloat_CheckExact(obj))) ? \ + PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +#endif + +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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 CYTHON_INLINE 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); + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000) +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, + int is_tuple, int has_known_size, int decref_tuple); + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* proto */ + +#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + 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 +} + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); + } + #if CYTHON_COMPILING_IN_CPYTHON + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); + #else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); + #endif +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/ +#endif + +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_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 { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +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(void); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +#include "descrobject.h" +static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/ + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_Generator_USED +#include +#include +typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *); +typedef struct { + PyObject_HEAD + __pyx_generator_body_t body; + PyObject *closure; + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + int resume_label; + char is_running; +} __pyx_GeneratorObject; +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure); +static int __pyx_Generator_init(void); +static int __Pyx_Generator_clear(PyObject* self); +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) +#endif + +static int __Pyx_check_binary_version(void); + +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/ + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'datetime' */ + +/* Module declarations from 'datetime' */ +static PyTypeObject *__pyx_ptype_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0; +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *, pandas_datetimestruct *); /*proto*/ + +/* Module declarations from 'util' */ +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *); /*proto*/ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'pandas.tslib' */ +static PyTypeObject *__pyx_ptype_6pandas_5tslib__Timestamp = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib__NaT = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib__TSObject = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib___pyx_scope_struct____init__ = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib___pyx_scope_struct_1_genexpr = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib___pyx_scope_struct_2___seqToRE = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib___pyx_scope_struct_3_genexpr = 0; +static int __pyx_v_6pandas_5tslib_PY2; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5tslib_NPY_NAT; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5tslib__NS_LOWER_BOUND; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5tslib__NS_UPPER_BOUND; +static pandas_datetimestruct __pyx_v_6pandas_5tslib__NS_MIN_DTS; +static pandas_datetimestruct __pyx_v_6pandas_5tslib__NS_MAX_DTS; +static int __pyx_v_6pandas_5tslib__reverse_ops[6]; +static PyObject *__pyx_v_6pandas_5tslib__NDIM_STRING = 0; +static PyTypeObject *__pyx_v_6pandas_5tslib_ts_type; +static int __pyx_v_6pandas_5tslib__nat_scalar_rules[6]; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5tslib_DAY_NS; +static char __pyx_v_6pandas_5tslib_START; +static char __pyx_v_6pandas_5tslib_END; +static PyObject *__pyx_v_6pandas_5tslib_extra_fmts = 0; +static PyObject *__pyx_v_6pandas_5tslib_str_extra_fmts = 0; +static PyObject *__pyx_f_6pandas_5tslib_convert_to_tsobject(PyObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_convert_to_timedelta64(PyObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_tzlocal(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_fixed_offset(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__checknull_with_nat(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__cmp_nat_dt(struct __pyx_obj_6pandas_5tslib__NaT *, struct __pyx_obj_6pandas_5tslib__Timestamp *, int); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_get_value_box(PyArrayObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__cmp_scalar(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, int); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib_is_timestamp(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_utcoffset(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE void __pyx_f_6pandas_5tslib__localize_tso(struct __pyx_obj_6pandas_5tslib__TSObject *, PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_utc(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__get_zone(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_maybe_get_tz(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__check_dts_bounds(pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__get_datetime64_nanos(PyObject *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_cast_from_unit(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__treat_tz_as_pytz(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__treat_tz_as_dateutil(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__tz_cache_key(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_transitions(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_utc_trans_times_from_dateutil_tz(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_deltas(PyObject *); /*proto*/ +static double __pyx_f_6pandas_5tslib_total_seconds(PyObject *); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_5tslib__unbox_utcoffsets(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__ensure_int64(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_bisect_right_i8(__pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, Py_ssize_t); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__normalize_local(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib__normalized_stamp(pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_ts_dayofweek(struct __pyx_obj_6pandas_5tslib__TSObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_normalize_date(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_5tslib_localize_dt64arr_to_period(PyArrayObject *, int, PyObject *); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_period_asfreq(__pyx_t_5numpy_int64_t, int, int, int, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_period_ordinal_to_dt64(__pyx_t_5numpy_int64_t, int, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__period_strftime(__pyx_t_5numpy_int64_t, int, PyObject *); /*proto*/ +static __pyx_t_6pandas_5tslib_accessor __pyx_f_6pandas_5tslib__get_accessor_func(int); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_resolution(PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_5tslib_resolution *__pyx_optional_args); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__reso_stamp(pandas_datetimestruct *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__reso_local(PyArrayObject *, PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 }; +#define __Pyx_MODULE_NAME "pandas.tslib" +int __pyx_module_is_main_pandas__tslib = 0; + +/* Implementation of 'pandas.tslib' */ +static PyObject *__pyx_builtin_NameError; +static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_super; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_NotImplemented; +static PyObject *__pyx_builtin_OverflowError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_round; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_sorted; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_lambda_funcdef_6pandas_5tslib_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_ints_to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_fromordinal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ordinal, PyObject *__pyx_v_offset, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_2now(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_4today(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_6utcnow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_8__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ts_input, PyObject *__pyx_v_offset, PyObject *__pyx_v_tz, PyObject *__pyx_v_unit); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_12_date_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_14_time_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_16_repr_base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_18tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_20freq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_22__setstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_24__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_26to_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_28dayofweek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_30dayofyear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_32week(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_34quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_36freqstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_38asm8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_40is_month_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_42is_month_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_44is_quarter_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_46is_quarter_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_48is_year_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_50is_year_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_52tz_localize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz, PyObject *__pyx_v_infer_dst); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_54tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_56replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwds); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_58to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_warn); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_60isoformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_sep); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_62_has_time_component(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_64to_julian_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_4__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_6__hash__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_8__int__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_10__long__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_12weekday(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_14toordinal(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_16__reduce__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_2__nat_unpickle(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_4is_timestamp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6get_value_box(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_8unique_deltas(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10apply_offset(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyObject *__pyx_v_offset); /* proto */ +static Py_hash_t __pyx_pf_6pandas_5tslib_10_Timestamp___hash__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_2__richcmp__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_4to_datetime(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_6__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_8__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_10_get_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_12_get_start_end_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_5value___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_10nanosecond___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_6offset___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static Py_hash_t __pyx_pf_6pandas_5tslib_4_NaT___hash__(struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_2__richcmp__(struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_4__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_6__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_12_delta_to_nanoseconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_delta); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9_TSObject_5value___get__(struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_14_get_utcoffset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tzinfo, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_16get_timezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_18maybe_get_tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_20datetime_to_datetime64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_22_does_string_look_like_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_string); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_24parse_datetime_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_string, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_26array_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_raise_, PyObject *__pyx_v_dayfirst, CYTHON_UNUSED PyObject *__pyx_v_format, PyObject *__pyx_v_utc, PyObject *__pyx_v_coerce, PyObject *__pyx_v_unit); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_28array_to_timedelta64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_30convert_to_timedelta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_32repr_timedelta64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_format); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_34array_strptime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_fmt, PyObject *__pyx_v_coerce); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_36cast_from_unit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_unit); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_38cast_to_nanoseconds(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_40pydt_to_i8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pydt); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_42i8_to_pydt(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_i8, CYTHON_UNUSED PyObject *__pyx_v_tzinfo); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_44tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vals, PyObject *__pyx_v_tz1, PyObject *__pyx_v_tz2); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_46tz_convert_single(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_val, PyObject *__pyx_v_tz1, PyObject *__pyx_v_tz2); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_48_p_tz_cache_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_50tot_seconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_td); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_52_unbox_utcoffsets(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_transinfo); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_54tz_localize_to_utc(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vals, PyObject *__pyx_v_tz, int __pyx_v_infer_dst); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_56build_field_sarray(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_58get_time_micros(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_60get_date_field(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex, PyObject *__pyx_v_field); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_62get_start_end_field(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex, PyObject *__pyx_v_field, PyObject *__pyx_v_freqstr, int __pyx_v_month_kw); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_64date_normalize(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_66dates_normalized(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_68isleapyear(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_year); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_70monthrange(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_year, __pyx_t_5numpy_int64_t __pyx_v_month); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_72normalize_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dt); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_74dt64arr_to_periodarr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtarr, int __pyx_v_freq, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_76periodarr_to_dt64arr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_periodarr, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_78period_asfreq(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_period_ordinal, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_80period_asfreq_arr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_82period_ordinal(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_y, int __pyx_v_m, int __pyx_v_d, int __pyx_v_h, int __pyx_v_min, int __pyx_v_s, int __pyx_v_us, int __pyx_v_ps, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_84period_ordinal_to_dt64(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_ordinal, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_86period_format(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq, PyObject *__pyx_v_fmt); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_88get_period_field(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_code, __pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_90get_period_field_arr(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_code, PyArrayObject *__pyx_v_arr, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_92extract_ordinals(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_94resolution(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_96_getlang(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_2__pad(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_front); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_4__calc_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_6__calc_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_8__calc_am_pm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_10__calc_date_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_12__calc_timezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_8__init___genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_locale_time); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_9__seqToRE_genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_2__seqToRE(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_to_convert, PyObject *__pyx_v_directive); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_4pattern(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_6compile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_98_calc_julian_from_U_or_W(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_year, PyObject *__pyx_v_week_of_year, PyObject *__pyx_v_day_of_week, PyObject *__pyx_v_week_starts_Mon); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_5tslib__Timestamp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib__NaT(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib__TSObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct____init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_0[] = "0"; +static char __pyx_k_1[] = "\\\\\\1"; +static char __pyx_k_2[] = "2"; +static char __pyx_k_3[] = "3"; +static char __pyx_k_A[] = "A"; +static char __pyx_k_B[] = "B"; +static char __pyx_k_C[] = "C"; +static char __pyx_k_D[] = "D"; +static char __pyx_k_F[] = "%F"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_M[] = "M"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_P[] = "P"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_S[] = "S"; +static char __pyx_k_T[] = "T"; +static char __pyx_k_U[] = "U"; +static char __pyx_k_W[] = "W"; +static char __pyx_k_X[] = "%X"; +static char __pyx_k_Y[] = "Y"; +static char __pyx_k_Z[] = " %%Z"; +static char __pyx_k_a[] = "a"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_c[] = "%c"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_m[] = "m"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_p[] = "p"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_s[] = "s"; +static char __pyx_k_t[] = "t"; +static char __pyx_k_u[] = "u"; +static char __pyx_k_v[] = "v"; +static char __pyx_k_w[] = "w"; +static char __pyx_k_x[] = "%x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k_z[] = "%z"; +static char __pyx_k_00[] = "00"; +static char __pyx_k_03[] = "03"; +static char __pyx_k_10[] = "10"; +static char __pyx_k_11[] = "11"; +static char __pyx_k_17[] = "17"; +static char __pyx_k_22[] = "22"; +static char __pyx_k_2d[] = "%.2d"; +static char __pyx_k_3d[] = "%.3d"; +static char __pyx_k_44[] = "44"; +static char __pyx_k_55[] = "55"; +static char __pyx_k_6d[] = ".%.6d"; +static char __pyx_k_76[] = "76"; +static char __pyx_k_99[] = "99"; +static char __pyx_k_9d[] = ".%.9d"; +static char __pyx_k_AB[] = "^`AB`^"; +static char __pyx_k_AS[] = "AS"; +static char __pyx_k_CD[] = "^`CD`^"; +static char __pyx_k_EF[] = "^`EF`^"; +static char __pyx_k_GH[] = "^`GH`^"; +static char __pyx_k_IJ[] = "^`IJ`^"; +static char __pyx_k_KL[] = "^`KL`^"; +static char __pyx_k_MS[] = "MS"; +static char __pyx_k_QS[] = "QS"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k__5[] = ""; +static char __pyx_k_dt[] = "dt"; +static char __pyx_k_i4[] = "i4"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_ms[] = "ms"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_ns[] = "ns"; +static char __pyx_k_ps[] = "ps"; +static char __pyx_k_re[] = "re"; +static char __pyx_k_sp[] = "sp"; +static char __pyx_k_sz[] = "sz"; +static char __pyx_k_td[] = "td"; +static char __pyx_k_ts[] = "ts"; +static char __pyx_k_tz[] = "tz"; +static char __pyx_k_us[] = "us"; +static char __pyx_k_02d[] = "%02d"; +static char __pyx_k_03d[] = "%03d"; +static char __pyx_k_06d[] = "%06d"; +static char __pyx_k_09d[] = "%09d"; +static char __pyx_k_1_6[] = "1.6"; +static char __pyx_k_1_7[] = "1.7"; +static char __pyx_k_A_2[] = "%A"; +static char __pyx_k_B_2[] = "%B"; +static char __pyx_k_H_2[] = "%H"; +static char __pyx_k_I_2[] = "%I"; +static char __pyx_k_M_2[] = "%M"; +static char __pyx_k_NAN[] = "NAN"; +static char __pyx_k_NAT[] = "NAT"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k_NaT[] = "NaT"; +static char __pyx_k_S_2[] = "%S"; +static char __pyx_k_UTC[] = "UTC"; +static char __pyx_k_U_2[] = "%U"; +static char __pyx_k_U_W[] = "U_W"; +static char __pyx_k_W_2[] = "%W"; +static char __pyx_k_X_2[] = "X"; +static char __pyx_k_Y_2[] = "%Y"; +static char __pyx_k_Y_m[] = "%Y-%m"; +static char __pyx_k_Z_2[] = "Z"; +static char __pyx_k_Z_3[] = "%Z"; +static char __pyx_k__50[] = "-"; +static char __pyx_k__51[] = "\\"; +static char __pyx_k__52[] = "%"; +static char __pyx_k__89[] = "%%"; +static char __pyx_k_a_2[] = "%a"; +static char __pyx_k_abs[] = "abs"; +static char __pyx_k_add[] = "__add__"; +static char __pyx_k_all[] = "all"; +static char __pyx_k_any[] = "any"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_b_2[] = "%b"; +static char __pyx_k_c_2[] = "c"; +static char __pyx_k_cls[] = "cls"; +static char __pyx_k_d_2[] = "%d"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_dom[] = "dom"; +static char __pyx_k_dow[] = "dow"; +static char __pyx_k_doy[] = "doy"; +static char __pyx_k_dts[] = "dts"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_err[] = "err"; +static char __pyx_k_f_2[] = "%f"; +static char __pyx_k_fix[] = "fix"; +static char __pyx_k_fmt[] = "fmt"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_gmt[] = "gmt"; +static char __pyx_k_grp[] = "grp"; +static char __pyx_k_idx[] = "idx"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_int[] = "__int__"; +static char __pyx_k_j_2[] = "%j"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_l_2[] = "%l"; +static char __pyx_k_len[] = "len"; +static char __pyx_k_loc[] = "loc"; +static char __pyx_k_m_2[] = "%m"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_mus[] = "mus"; +static char __pyx_k_n_2[] = "%n"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_nat[] = "nat"; +static char __pyx_k_new[] = "__new__"; +static char __pyx_k_now[] = "now"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_old[] = "old"; +static char __pyx_k_out[] = "out"; +static char __pyx_k_p_2[] = "%p"; +static char __pyx_k_pad[] = "__pad"; +static char __pyx_k_pos[] = "pos"; +static char __pyx_k_q_2[] = "%q"; +static char __pyx_k_ret[] = "ret"; +static char __pyx_k_s_2[] = "%s)"; +static char __pyx_k_s_3[] = "\\s+"; +static char __pyx_k_s_s[] = "%s %s"; +static char __pyx_k_sep[] = "sep"; +static char __pyx_k_seq[] = "seq"; +static char __pyx_k_str[] = "__str__"; +static char __pyx_k_sub[] = "__sub__"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_tso[] = "tso"; +static char __pyx_k_tz1[] = "tz1"; +static char __pyx_k_tz2[] = "tz2"; +static char __pyx_k_u_2[] = "%u"; +static char __pyx_k_utc[] = "utc"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_w_2[] = "%w"; +static char __pyx_k_woy[] = "woy"; +static char __pyx_k_x_2[] = "x"; +static char __pyx_k_y_2[] = "%y"; +static char __pyx_k_zip[] = "zip"; +static char __pyx_k_1999[] = "1999"; +static char __pyx_k_FQ_q[] = "%FQ%q"; +static char __pyx_k_M8_s[] = "M8[s]"; +static char __pyx_k__112[] = "|"; +static char __pyx_k__113[] = "([\\\\.^$*+?\\(\\){}\\[\\]|])"; +static char __pyx_k_ampm[] = "ampm"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_asm8[] = "asm8"; +static char __pyx_k_base[] = "base"; +static char __pyx_k_code[] = "code"; +static char __pyx_k_date[] = "date"; +static char __pyx_k_days[] = "days"; +static char __pyx_k_diff[] = "diff"; +static char __pyx_k_exit[] = "__exit__"; +static char __pyx_k_fget[] = "fget"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_fill[] = "fill"; +static char __pyx_k_flat[] = "flat"; +static char __pyx_k_frac[] = "frac"; +static char __pyx_k_freq[] = "freq"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_hash[] = "__hash__"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_iNaT[] = "iNaT"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_int8[] = "int8"; +static char __pyx_k_item[] = "item"; +static char __pyx_k_join[] = "join"; +static char __pyx_k_kwds[] = "kwds"; +static char __pyx_k_lang[] = "lang"; +static char __pyx_k_ldom[] = "ldom"; +static char __pyx_k_left[] = "left"; +static char __pyx_k_long[] = "long"; +static char __pyx_k_m8_0[] = "m8[{0}]"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mask[] = "mask"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_ndim[] = "ndim"; +static char __pyx_k_prop[] = "prop"; +static char __pyx_k_pydt[] = "pydt"; +static char __pyx_k_pytz[] = "pytz"; +static char __pyx_k_repr[] = "__repr__"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_send[] = "send"; +static char __pyx_k_side[] = "side"; +static char __pyx_k_sign[] = "sign"; +static char __pyx_k_size[] = "size"; +static char __pyx_k_sort[] = "sort"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_time[] = "time"; +static char __pyx_k_ts_2[] = "_ts"; +static char __pyx_k_tz_0[] = ", tz='{0}'"; +static char __pyx_k_tz_s[] = ", tz=%s"; +static char __pyx_k_unit[] = "unit"; +static char __pyx_k_vals[] = "vals"; +static char __pyx_k_view[] = "view"; +static char __pyx_k_warn[] = "warn"; +static char __pyx_k_week[] = "week"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_zone[] = "zone"; +static char __pyx_k_M8_ns[] = "M8[ns]"; +static char __pyx_k_P_s_s[] = "(?P<%s>%s"; +static char __pyx_k_Y_m_d[] = "%Y-%m-%d"; +static char __pyx_k_a_idx[] = "a_idx"; +static char __pyx_k_all_2[] = "__all__"; +static char __pyx_k_am_pm[] = "am_pm"; +static char __pyx_k_apply[] = "apply"; +static char __pyx_k_array[] = "array"; +static char __pyx_k_b_idx[] = "b_idx"; +static char __pyx_k_base1[] = "base1"; +static char __pyx_k_base2[] = "base2"; +static char __pyx_k_boxed[] = "boxed"; +static char __pyx_k_clear[] = "clear"; +static char __pyx_k_close[] = "close"; +static char __pyx_k_count[] = "count"; +static char __pyx_k_delta[] = "delta"; +static char __pyx_k_dtarr[] = "dtarr"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_enter[] = "__enter__"; +static char __pyx_k_field[] = "field"; +static char __pyx_k_finfo[] = "finfo"; +static char __pyx_k_floor[] = "floor"; +static char __pyx_k_found[] = "found"; +static char __pyx_k_freq1[] = "freq1"; +static char __pyx_k_freq2[] = "freq2"; +static char __pyx_k_front[] = "front"; +static char __pyx_k_gettz[] = "gettz"; +static char __pyx_k_hours[] = "hours"; +static char __pyx_k_index[] = "index"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_isdst[] = "isdst"; +static char __pyx_k_lower[] = "lower"; +static char __pyx_k_m8_ns[] = "m8[ns]"; +static char __pyx_k_match[] = "match"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_nanos[] = "nanos"; +static char __pyx_k_new_2[] = "new"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_py_dt[] = "py_dt"; +static char __pyx_k_raise[] = "raise_"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_ravel[] = "ravel"; +static char __pyx_k_regex[] = "regex"; +static char __pyx_k_right[] = "right"; +static char __pyx_k_round[] = "round"; +static char __pyx_k_s_s_2[] = "%s/%s"; +static char __pyx_k_s_s_3[] = "%s%s"; +static char __pyx_k_s_s_s[] = "%s%s%s"; +static char __pyx_k_shape[] = "shape"; +static char __pyx_k_short[] = "short"; +static char __pyx_k_stamp[] = "stamp"; +static char __pyx_k_state[] = "state"; +static char __pyx_k_sub_2[] = "sub"; +static char __pyx_k_super[] = "super"; +static char __pyx_k_table[] = "table"; +static char __pyx_k_tdata[] = "tdata"; +static char __pyx_k_throw[] = "throw"; +static char __pyx_k_today[] = "today"; +static char __pyx_k_trans[] = "trans"; +static char __pyx_k_tzset[] = "tzset"; +static char __pyx_k_tzutc[] = "tzutc"; +static char __pyx_k_utf_8[] = "utf-8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_where[] = "where"; +static char __pyx_k_years[] = "years"; +static char __pyx_k_zeros[] = "zeros"; +static char __pyx_k_D_RESO[] = "D_RESO"; +static char __pyx_k_H_RESO[] = "H_RESO"; +static char __pyx_k_Period[] = "Period"; +static char __pyx_k_S_RESO[] = "S_RESO"; +static char __pyx_k_T_RESO[] = "T_RESO"; +static char __pyx_k_TimeRE[] = "TimeRE"; +static char __pyx_k_Z_tz_s[] = " %%Z, tz=%s"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_coerce[] = "coerce"; +static char __pyx_k_decode[] = "decode"; +static char __pyx_k_deltas[] = "deltas"; +static char __pyx_k_encode[] = "encode"; +static char __pyx_k_escape[] = "escape"; +static char __pyx_k_fields[] = "fields"; +static char __pyx_k_format[] = "format"; +static char __pyx_k_hstack[] = "hstack"; +static char __pyx_k_ignore[] = "ignore"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_insert[] = "insert"; +static char __pyx_k_isleap[] = "isleap"; +static char __pyx_k_ivalue[] = "ivalue"; +static char __pyx_k_julian[] = "julian"; +static char __pyx_k_kwargs[] = "kwargs"; +static char __pyx_k_lambda[] = ""; +static char __pyx_k_locale[] = "locale"; +static char __pyx_k_long_2[] = "__long__"; +static char __pyx_k_micros[] = "micros"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_mo_off[] = "mo_off"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_months[] = "months"; +static char __pyx_k_new_tz[] = "new_tz"; +static char __pyx_k_np_NaT[] = "np_NaT"; +static char __pyx_k_ntrans[] = "ntrans"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_offset[] = "offset"; +static char __pyx_k_reduce[] = "__reduce__"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_sorted[] = "sorted"; +static char __pyx_k_stamps[] = "stamps"; +static char __pyx_k_tar_gz[] = ".tar.gz"; +static char __pyx_k_thread[] = "thread"; +static char __pyx_k_tzfile[] = "tzfile"; +static char __pyx_k_tzinfo[] = "tzinfo"; +static char __pyx_k_tzname[] = "tzname"; +static char __pyx_k_utcnow[] = "utcnow"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_02d_06d[] = "%02d.%06d"; +static char __pyx_k_LC_TIME[] = "LC_TIME"; +static char __pyx_k_LC_date[] = "LC_date"; +static char __pyx_k_LC_time[] = "LC_time"; +static char __pyx_k_MS_RESO[] = "MS_RESO"; +static char __pyx_k_NaTType[] = "NaTType"; +static char __pyx_k_P_w_0_6[] = "(?P[0-6])"; +static char __pyx_k_P_y_d_d[] = "(?P\\d\\d)"; +static char __pyx_k_US_RESO[] = "US_RESO"; +static char __pyx_k_a_month[] = "a_month"; +static char __pyx_k_both_eq[] = "both_eq"; +static char __pyx_k_combine[] = "combine"; +static char __pyx_k_compile[] = "compile"; +static char __pyx_k_d_2d_2d[] = "%d-%.2d-%.2d"; +static char __pyx_k_dtindex[] = "dtindex"; +static char __pyx_k_f_month[] = "f_month"; +static char __pyx_k_freqstr[] = "freqstr"; +static char __pyx_k_genexpr[] = "genexpr"; +static char __pyx_k_getitem[] = "__getitem__"; +static char __pyx_k_getlang[] = "_getlang"; +static char __pyx_k_iresult[] = "iresult"; +static char __pyx_k_ivalues[] = "ivalues"; +static char __pyx_k_maximum[] = "maximum"; +static char __pyx_k_minutes[] = "minutes"; +static char __pyx_k_nonzero[] = "nonzero"; +static char __pyx_k_ordinal[] = "ordinal"; +static char __pyx_k_oresult[] = "oresult"; +static char __pyx_k_pattern[] = "pattern"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_quarter[] = "quarter"; +static char __pyx_k_replace[] = "replace"; +static char __pyx_k_reverse[] = "reverse"; +static char __pyx_k_seconds[] = "seconds"; +static char __pyx_k_seqToRE[] = "__seqToRE"; +static char __pyx_k_setitem[] = "__setitem__"; +static char __pyx_k_squeeze[] = "squeeze"; +static char __pyx_k_ts_base[] = "ts_base"; +static char __pyx_k_tzinfos[] = "_tzinfos"; +static char __pyx_k_tzlocal[] = "tzlocal"; +static char __pyx_k_uniques[] = "uniques"; +static char __pyx_k_version[] = "version"; +static char __pyx_k_weekday[] = "weekday"; +static char __pyx_k_2d_2d_2d[] = "%.2d:%.2d:%.2d"; +static char __pyx_k_KeyError[] = "KeyError"; +static char __pyx_k_both_nat[] = "both_nat"; +static char __pyx_k_calendar[] = "calendar"; +static char __pyx_k_datetime[] = "datetime"; +static char __pyx_k_dateutil[] = "dateutil/"; +static char __pyx_k_day_abbr[] = "day_abbr"; +static char __pyx_k_day_name[] = "day_name"; +static char __pyx_k_dayfirst[] = "dayfirst"; +static char __pyx_k_daylight[] = "daylight"; +static char __pyx_k_filename[] = "_filename"; +static char __pyx_k_fraction[] = "fraction"; +static char __pyx_k_iterkeys[] = "iterkeys"; +static char __pyx_k_localize[] = "localize"; +static char __pyx_k_month_kw[] = "month_kw"; +static char __pyx_k_offset_0[] = ", offset='{0}'"; +static char __pyx_k_one_diff[] = "one_diff"; +static char __pyx_k_ordinals[] = "ordinals"; +static char __pyx_k_property[] = "property"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_relation[] = "relation"; +static char __pyx_k_result_a[] = "result_a"; +static char __pyx_k_result_b[] = "result_b"; +static char __pyx_k_s_d_days[] = "%s%d days"; +static char __pyx_k_sa_dtype[] = "sa_dtype"; +static char __pyx_k_setstate[] = "__setstate__"; +static char __pyx_k_strftime[] = "strftime"; +static char __pyx_k_thread_2[] = "_thread"; +static char __pyx_k_timezone[] = "timezone"; +static char __pyx_k_ts_input[] = "ts_input"; +static char __pyx_k_tzoffset[] = "tzoffset"; +static char __pyx_k_utc_date[] = "utc_date"; +static char __pyx_k_year2000[] = "year2000"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_NameError[] = "NameError"; +static char __pyx_k_Timestamp[] = "Timestamp"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_Y_m_d_H_M[] = "%Y-%m-%d %H:%M"; +static char __pyx_k_a_weekday[] = "a_weekday"; +static char __pyx_k_date_repr[] = "_date_repr"; +static char __pyx_k_date_time[] = "date_time"; +static char __pyx_k_dayofweek[] = "dayofweek"; +static char __pyx_k_dayofyear[] = "dayofyear"; +static char __pyx_k_directive[] = "directive"; +static char __pyx_k_dst_hours[] = "dst_hours"; +static char __pyx_k_end_month[] = "end_month"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_f_weekday[] = "f_weekday"; +static char __pyx_k_get_field[] = "_get_field"; +static char __pyx_k_getlocale[] = "getlocale"; +static char __pyx_k_group_key[] = "group_key"; +static char __pyx_k_groupdict[] = "groupdict"; +static char __pyx_k_have_pytz[] = "have_pytz"; +static char __pyx_k_infer_dst[] = "infer_dst"; +static char __pyx_k_isoformat[] = "isoformat"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_no_saving[] = "no_saving"; +static char __pyx_k_normalize[] = "normalize"; +static char __pyx_k_periodarr[] = "periodarr"; +static char __pyx_k_re_escape[] = "re_escape"; +static char __pyx_k_repr_base[] = "_repr_base"; +static char __pyx_k_time_repr[] = "_time_repr"; +static char __pyx_k_timedelta[] = "timedelta"; +static char __pyx_k_to_offset[] = "to_offset"; +static char __pyx_k_to_period[] = "to_period"; +static char __pyx_k_toordinal[] = "toordinal"; +static char __pyx_k_trans_grp[] = "trans_grp"; +static char __pyx_k_trans_idx[] = "_trans_idx"; +static char __pyx_k_trans_len[] = "trans_len"; +static char __pyx_k_tz_values[] = "tz_values"; +static char __pyx_k_utc_dates[] = "utc_dates"; +static char __pyx_k_utcoffset[] = "utcoffset"; +static char __pyx_k_zero_time[] = "_zero_time"; +static char __pyx_k_BaseTzInfo[] = "BaseTzInfo"; +static char __pyx_k_IGNORECASE[] = "IGNORECASE"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_LocaleTime[] = "LocaleTime"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_Y_m_d_H_00[] = "%Y-%m-%d %H:00"; +static char __pyx_k_astimezone[] = "astimezone"; +static char __pyx_k_basestring[] = "basestring"; +static char __pyx_k_cache_lock[] = "_cache_lock"; +static char __pyx_k_calc_am_pm[] = "__calc_am_pm"; +static char __pyx_k_calc_month[] = "__calc_month"; +static char __pyx_k_compat_NaT[] = "compat_NaT"; +static char __pyx_k_datetime64[] = "datetime64"; +static char __pyx_k_dateutil_2[] = "dateutil"; +static char __pyx_k_found_dict[] = "found_dict"; +static char __pyx_k_found_zone[] = "found_zone"; +static char __pyx_k_freq_group[] = "freq_group"; +static char __pyx_k_has_saving[] = "has_saving"; +static char __pyx_k_i8_to_pydt[] = "i8_to_pydt"; +static char __pyx_k_isleapyear[] = "isleapyear"; +static char __pyx_k_month_abbr[] = "month_abbr"; +static char __pyx_k_month_name[] = "month_name"; +static char __pyx_k_monthrange[] = "monthrange"; +static char __pyx_k_nanosecond[] = "nanosecond"; +static char __pyx_k_new_values[] = "new_values"; +static char __pyx_k_np_version[] = "_np_version"; +static char __pyx_k_parse_code[] = "parse_code"; +static char __pyx_k_parse_date[] = "parse_date"; +static char __pyx_k_pydt_to_i8[] = "pydt_to_i8"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_re_compile[] = "re_compile"; +static char __pyx_k_startswith[] = "startswith"; +static char __pyx_k_switch_idx[] = "switch_idx"; +static char __pyx_k_time_tuple[] = "time_tuple"; +static char __pyx_k_to_convert[] = "to_convert"; +static char __pyx_k_trans_list[] = "_trans_list"; +static char __pyx_k_ttinfo_std[] = "_ttinfo_std"; +static char __pyx_k_tz_convert[] = "tz_convert"; +static char __pyx_k_weekofyear[] = "weekofyear"; +static char __pyx_k_P_M_0_5_d_d[] = "(?P[0-5]\\d|\\d)"; +static char __pyx_k_P_Y_d_d_d_d[] = "(?P\\d\\d\\d\\d)"; +static char __pyx_k_P_f_0_9_1_6[] = "(?P[0-9]{1,6})"; +static char __pyx_k_Y_m_d_H_M_S[] = "%Y-%m-%d %H:%M:%S"; +static char __pyx_k_array_split[] = "array_split"; +static char __pyx_k_date_string[] = "date_string"; +static char __pyx_k_dateutil_tz[] = "dateutil.tz"; +static char __pyx_k_day_of_week[] = "day_of_week"; +static char __pyx_k_fromordinal[] = "fromordinal"; +static char __pyx_k_idx_shifted[] = "idx_shifted"; +static char __pyx_k_inferred_tz[] = "inferred_tz"; +static char __pyx_k_is_business[] = "is_business"; +static char __pyx_k_is_year_end[] = "is_year_end"; +static char __pyx_k_isleap_prev[] = "isleap_prev"; +static char __pyx_k_locale_time[] = "locale_time"; +static char __pyx_k_logical_and[] = "logical_and"; +static char __pyx_k_microsecond[] = "microsecond"; +static char __pyx_k_nat_strings[] = "_nat_strings"; +static char __pyx_k_pytz_tzinfo[] = "pytz.tzinfo"; +static char __pyx_k_regex_cache[] = "_regex_cache"; +static char __pyx_k_regex_chars[] = "regex_chars"; +static char __pyx_k_s_02d_02d_s[] = "%s%02d:%02d:%s"; +static char __pyx_k_sign_pretty[] = "sign_pretty"; +static char __pyx_k_start_month[] = "start_month"; +static char __pyx_k_struct_time[] = "struct_time"; +static char __pyx_k_timedelta64[] = "timedelta64"; +static char __pyx_k_to_datetime[] = "to_datetime"; +static char __pyx_k_tot_seconds[] = "tot_seconds"; +static char __pyx_k_trans_cache[] = "trans_cache"; +static char __pyx_k_trans_idx_2[] = "trans_idx"; +static char __pyx_k_tz_localize[] = "tz_localize"; +static char __pyx_k_utc_convert[] = "utc_convert"; +static char __pyx_k_utcoffset_2[] = "_utcoffset"; +static char __pyx_k_LC_date_time[] = "LC_date_time"; +static char __pyx_k_LooseVersion[] = "LooseVersion"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_TimeRE_cache[] = "_TimeRE_cache"; +static char __pyx_k_Timestamp_tz[] = "Timestamp.tz"; +static char __pyx_k_apply_offset[] = "apply_offset"; +static char __pyx_k_calc_weekday[] = "__calc_weekday"; +static char __pyx_k_days_to_week[] = "days_to_week"; +static char __pyx_k_dummy_thread[] = "dummy_thread"; +static char __pyx_k_format_regex[] = "format_regex"; +static char __pyx_k_get_timezone[] = "get_timezone"; +static char __pyx_k_is_month_end[] = "is_month_end"; +static char __pyx_k_microseconds[] = "microseconds"; +static char __pyx_k_month_offset[] = "_month_offset"; +static char __pyx_k_nat_unpickle[] = "__nat_unpickle"; +static char __pyx_k_object_state[] = "object_state"; +static char __pyx_k_pandas_tslib[] = "pandas.tslib"; +static char __pyx_k_searchsorted[] = "searchsorted"; +static char __pyx_k_seen_integer[] = "seen_integer"; +static char __pyx_k_string_types[] = "string_types"; +static char __pyx_k_version_info[] = "version_info"; +static char __pyx_k_week_of_year[] = "week_of_year"; +static char __pyx_k_NaTType___int[] = "NaTType.__int__"; +static char __pyx_k_NaTType___new[] = "NaTType.__new__"; +static char __pyx_k_NaTType___str[] = "NaTType.__str__"; +static char __pyx_k_OverflowError[] = "OverflowError"; +static char __pyx_k_TimeRE___init[] = "TimeRE.__init__"; +static char __pyx_k_Timestamp_now[] = "Timestamp.now"; +static char __pyx_k_Y_m_d_H_M_S_l[] = "%Y-%m-%d %H:%M:%S.%l"; +static char __pyx_k_Y_m_d_H_M_S_n[] = "%Y-%m-%d %H:%M:%S.%n"; +static char __pyx_k_Y_m_d_H_M_S_u[] = "%Y-%m-%d %H:%M:%S.%u"; +static char __pyx_k_allocate_lock[] = "allocate_lock"; +static char __pyx_k_bad_directive[] = "bad_directive"; +static char __pyx_k_calc_timezone[] = "__calc_timezone"; +static char __pyx_k_datetime_date[] = "datetime_date"; +static char __pyx_k_datetime_time[] = "datetime_time"; +static char __pyx_k_first_weekday[] = "first_weekday"; +static char __pyx_k_is_year_start[] = "is_year_start"; +static char __pyx_k_pandas_compat[] = "pandas.compat"; +static char __pyx_k_period_format[] = "period_format"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_seen_datetime[] = "seen_datetime"; +static char __pyx_k_short_version[] = "short_version"; +static char __pyx_k_startingMonth[] = "startingMonth"; +static char __pyx_k_to_pydatetime[] = "to_pydatetime"; +static char __pyx_k_total_seconds[] = "total_seconds"; +static char __pyx_k_ttinfo_before[] = "_ttinfo_before"; +static char __pyx_k_unique_deltas[] = "unique_deltas"; +static char __pyx_k_week_0_length[] = "week_0_length"; +static char __pyx_k_AttributeError[] = "AttributeError"; +static char __pyx_k_CACHE_MAX_SIZE[] = "_CACHE_MAX_SIZE"; +static char __pyx_k_NaTType___hash[] = "NaTType.__hash__"; +static char __pyx_k_NaTType___long[] = "NaTType.__long__"; +static char __pyx_k_NaTType___repr[] = "NaTType.__repr__"; +static char __pyx_k_NotImplemented[] = "NotImplemented"; +static char __pyx_k_TimeRE_compile[] = "TimeRE.compile"; +static char __pyx_k_TimeRE_pattern[] = "TimeRE.pattern"; +static char __pyx_k_Timestamp_asm8[] = "Timestamp.asm8"; +static char __pyx_k_Timestamp_freq[] = "Timestamp.freq"; +static char __pyx_k_Timestamp_week[] = "Timestamp.week"; +static char __pyx_k_Unknown_freq_d[] = "Unknown freq: %d"; +static char __pyx_k_array_strptime[] = "array_strptime"; +static char __pyx_k_calc_date_time[] = "__calc_date_time"; +static char __pyx_k_current_format[] = "current_format"; +static char __pyx_k_date_normalize[] = "date_normalize"; +static char __pyx_k_dateutil_gettz[] = "_dateutil_gettz"; +static char __pyx_k_dateutil_tzutc[] = "_dateutil_tzutc"; +static char __pyx_k_dummy_thread_2[] = "_dummy_thread"; +static char __pyx_k_get_date_field[] = "get_date_field"; +static char __pyx_k_is_month_start[] = "is_month_start"; +static char __pyx_k_is_quarter_end[] = "is_quarter_end"; +static char __pyx_k_p_tz_cache_key[] = "_p_tz_cache_key"; +static char __pyx_k_period_ordinal[] = "period_ordinal"; +static char __pyx_k_seconds_pretty[] = "seconds_pretty"; +static char __pyx_k_timedelta64_ns[] = "timedelta64[ns]"; +static char __pyx_k_to_julian_date[] = "to_julian_date"; +static char __pyx_k_LocaleTime__pad[] = "_LocaleTime__pad"; +static char __pyx_k_NaTType_weekday[] = "NaTType.weekday"; +static char __pyx_k_TimeRE__seqToRE[] = "_TimeRE__seqToRE"; +static char __pyx_k_Timestamp___new[] = "Timestamp.__new__"; +static char __pyx_k_Timestamp_today[] = "Timestamp.today"; +static char __pyx_k_datetime_result[] = "datetime_result"; +static char __pyx_k_dateutil_tzfile[] = "_dateutil_tzfile"; +static char __pyx_k_directive_index[] = "directive_index"; +static char __pyx_k_get_time_micros[] = "get_time_micros"; +static char __pyx_k_pytz_BaseTzInfo[] = "_pytz_BaseTzInfo"; +static char __pyx_k_s_is_wrong_freq[] = "%s is wrong freq"; +static char __pyx_k_transition_info[] = "_transition_info"; +static char __pyx_k_week_starts_Mon[] = "week_starts_Mon"; +static char __pyx_k_LocaleTime___pad[] = "LocaleTime.__pad"; +static char __pyx_k_NaTType___reduce[] = "NaTType.__reduce__"; +static char __pyx_k_TimeRE___seqToRE[] = "TimeRE.__seqToRE"; +static char __pyx_k_Timestamp___repr[] = "Timestamp.__repr__"; +static char __pyx_k_Timestamp_utcnow[] = "Timestamp.utcnow"; +static char __pyx_k_d_2d_2d_2d_2d_2d[] = "%d-%.2d-%.2d %.2d:%.2d:%.2d"; +static char __pyx_k_dates_normalized[] = "dates_normalized"; +static char __pyx_k_dateutil_tzlocal[] = "_dateutil_tzlocal"; +static char __pyx_k_extract_ordinals[] = "extract_ordinals"; +static char __pyx_k_get_period_field[] = "get_period_field"; +static char __pyx_k_is_quarter_start[] = "is_quarter_start"; +static char __pyx_k_parse_code_table[] = "_parse_code_table"; +static char __pyx_k_processed_format[] = "processed_format"; +static char __pyx_k_repr_timedelta64[] = "repr_timedelta64"; +static char __pyx_k_utc_offset_cache[] = "utc_offset_cache"; +static char __pyx_k_LocaleTime___init[] = "LocaleTime.__init__"; +static char __pyx_k_NaTType_toordinal[] = "NaTType.toordinal"; +static char __pyx_k_P_H_2_0_3_0_1_d_d[] = "(?P2[0-3]|[0-1]\\d|\\d)"; +static char __pyx_k_P_S_6_0_1_0_5_d_d[] = "(?P6[0-1]|[0-5]\\d|\\d)"; +static char __pyx_k_P_U_5_0_3_0_4_d_d[] = "(?P5[0-3]|[0-4]\\d|\\d)"; +static char __pyx_k_Timestamp_freqstr[] = "Timestamp.freqstr"; +static char __pyx_k_Timestamp_quarter[] = "Timestamp.quarter"; +static char __pyx_k_Timestamp_replace[] = "Timestamp.replace"; +static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s"; +static char __pyx_k_array_to_datetime[] = "array_to_datetime"; +static char __pyx_k_distutils_version[] = "distutils.version"; +static char __pyx_k_period_asfreq_arr[] = "period_asfreq_arr"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_replacement_pairs[] = "replacement_pairs"; +static char __pyx_k_stray_in_format_s[] = "stray %% in format '%s'"; +static char __pyx_k_tz_convert_single[] = "tz_convert_single"; +static char __pyx_k_AmbiguousTimeError[] = "AmbiguousTimeError"; +static char __pyx_k_Timestamp___reduce[] = "Timestamp.__reduce__"; +static char __pyx_k_build_field_sarray[] = "build_field_sarray"; +static char __pyx_k_cannot_cast_unit_0[] = "cannot cast unit {0}"; +static char __pyx_k_has_time_component[] = "_has_time_component"; +static char __pyx_k_ints_to_pydatetime[] = "ints_to_pydatetime"; +static char __pyx_k_is_timestamp_array[] = "is_timestamp_array"; +static char __pyx_k_s_d_days_02d_02d_s[] = "%s%d days, %02d:%02d:%s"; +static char __pyx_k_tz_localize_to_utc[] = "tz_localize_to_utc"; +static char __pyx_k_week_of_year_start[] = "week_of_year_start"; +static char __pyx_k_OutOfBoundsDatetime[] = "OutOfBoundsDatetime"; +static char __pyx_k_P_I_1_0_2_0_1_9_1_9[] = "(?P1[0-2]|0[1-9]|[1-9])"; +static char __pyx_k_P_m_1_0_2_0_1_9_1_9[] = "(?P1[0-2]|0[1-9]|[1-9])"; +static char __pyx_k_Timestamp_dayofweek[] = "Timestamp.dayofweek"; +static char __pyx_k_Timestamp_dayofyear[] = "Timestamp.dayofyear"; +static char __pyx_k_Timestamp_isoformat[] = "Timestamp.isoformat"; +static char __pyx_k_Timestamp_to_period[] = "Timestamp.to_period"; +static char __pyx_k_Unrecognized_type_s[] = "Unrecognized type: %s"; +static char __pyx_k_cast_to_nanoseconds[] = "cast_to_nanoseconds"; +static char __pyx_k_get_start_end_field[] = "_get_start_end_field"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_np_version_under1p6[] = "_np_version_under1p6"; +static char __pyx_k_np_version_under1p7[] = "_np_version_under1p7"; +static char __pyx_k_NonExistentTimeError[] = "NonExistentTimeError"; +static char __pyx_k_Timestamp___setstate[] = "Timestamp.__setstate__"; +static char __pyx_k_Timestamp__date_repr[] = "Timestamp._date_repr"; +static char __pyx_k_Timestamp__repr_base[] = "Timestamp._repr_base"; +static char __pyx_k_Timestamp__time_repr[] = "Timestamp._time_repr"; +static char __pyx_k_Timestamp_tz_convert[] = "Timestamp.tz_convert"; +static char __pyx_k_array_to_timedelta64[] = "array_to_timedelta64"; +static char __pyx_k_convert_to_timedelta[] = "convert_to_timedelta"; +static char __pyx_k_delta_to_nanoseconds[] = "_delta_to_nanoseconds"; +static char __pyx_k_dt64arr_to_periodarr[] = "dt64arr_to_periodarr"; +static char __pyx_k_get_period_field_arr[] = "get_period_field_arr"; +static char __pyx_k_not_datelike_strings[] = "_not_datelike_strings"; +static char __pyx_k_periodarr_to_dt64arr[] = "periodarr_to_dt64arr"; +static char __pyx_k_thread_allocate_lock[] = "_thread_allocate_lock"; +static char __pyx_k_utc_transition_times[] = "_utc_transition_times"; +static char __pyx_k_Field_s_not_supported[] = "Field %s not supported"; +static char __pyx_k_Timestamp_fromordinal[] = "Timestamp.fromordinal"; +static char __pyx_k_Timestamp_is_year_end[] = "Timestamp.is_year_end"; +static char __pyx_k_Timestamp_tz_localize[] = "Timestamp.tz_localize"; +static char __pyx_k_get_start_end_field_2[] = "get_start_end_field"; +static char __pyx_k_pandas_tseries_period[] = "pandas.tseries.period"; +static char __pyx_k_parse_datetime_string[] = "parse_datetime_string"; +static char __pyx_k_LocaleTime__calc_am_pm[] = "_LocaleTime__calc_am_pm"; +static char __pyx_k_LocaleTime__calc_month[] = "_LocaleTime__calc_month"; +static char __pyx_k_Timestamp_is_month_end[] = "Timestamp.is_month_end"; +static char __pyx_k_datetime_to_datetime64[] = "datetime_to_datetime64"; +static char __pyx_k_whitespace_replacement[] = "whitespace_replacement"; +static char __pyx_k_LocaleTime___calc_am_pm[] = "LocaleTime.__calc_am_pm"; +static char __pyx_k_LocaleTime___calc_month[] = "LocaleTime.__calc_month"; +static char __pyx_k_Timestamp_is_year_start[] = "Timestamp.is_year_start"; +static char __pyx_k_Timestamp_to_pydatetime[] = "Timestamp.to_pydatetime"; +static char __pyx_k_calc_julian_from_U_or_W[] = "_calc_julian_from_U_or_W"; +static char __pyx_k_LocaleTime__calc_weekday[] = "_LocaleTime__calc_weekday"; +static char __pyx_k_Timestamp_is_month_start[] = "Timestamp.is_month_start"; +static char __pyx_k_Timestamp_is_quarter_end[] = "Timestamp.is_quarter_end"; +static char __pyx_k_Timestamp_to_julian_date[] = "Timestamp.to_julian_date"; +static char __pyx_k_LocaleTime___calc_weekday[] = "LocaleTime.__calc_weekday"; +static char __pyx_k_LocaleTime__calc_timezone[] = "_LocaleTime__calc_timezone"; +static char __pyx_k_Timestamp_stamp_tz_offset[] = "Timestamp('{stamp}'{tz}{offset})"; +static char __pyx_k_Unrecognized_value_type_s[] = "Unrecognized value type: %s"; +static char __pyx_k_Could_not_find_pytz_module[] = "Could not find pytz module"; +static char __pyx_k_LocaleTime___calc_timezone[] = "LocaleTime.__calc_timezone"; +static char __pyx_k_LocaleTime__calc_date_time[] = "_LocaleTime__calc_date_time"; +static char __pyx_k_Timestamp_is_quarter_start[] = "Timestamp.is_quarter_start"; +static char __pyx_k_Unrecognized_period_code_d[] = "Unrecognized period code: %d"; +static char __pyx_k_pandas_tseries_frequencies[] = "pandas.tseries.frequencies"; +static char __pyx_k_unconverted_data_remains_s[] = "unconverted data remains: %s"; +static char __pyx_k_Frequency_conversion_failed[] = "Frequency conversion failed"; +static char __pyx_k_LocaleTime___calc_date_time[] = "LocaleTime.__calc_date_time"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9[] = "(?P3[0-1]|[1-2]\\d|0[1-9]|[1-9]| [1-9])"; +static char __pyx_k_Timestamp__has_time_component[] = "Timestamp._has_time_component"; +static char __pyx_k_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1[] = "(?P36[0-6]|3[0-5]\\d|[1-2]\\d\\d|0[1-9]\\d|00[1-9]|[1-9]\\d|0[1-9]|[1-9])"; +static char __pyx_k_Unable_to_get_quarter_and_year[] = "Unable to get quarter and year"; +static char __pyx_k_does_string_look_like_datetime[] = "_does_string_look_like_datetime"; +static char __pyx_k_s_is_a_bad_directive_in_format[] = "'%s' is a bad directive in format '%s'"; +static char __pyx_k_Cannot_compare_type_r_with_type[] = "Cannot compare type %r with type %r"; +static char __pyx_k_N_ot_A_T_ime_the_time_equivalen[] = "(N)ot-(A)-(T)ime, the time equivalent of NaN"; +static char __pyx_k_bad_month_number_0_must_be_1_12[] = "bad month number 0; must be 1-12"; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/tslib.pyx"; +static char __pyx_k_mixed_datetimes_and_integers_in[] = "mixed datetimes and integers in passed array"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_Array_must_be_all_same_time_zone[] = "Array must be all same time zone"; +static char __pyx_k_Bad_tz_filename_Dateutil_on_pyth[] = "Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all timezone files. Please construct dateutil timezones implicitly by passing a string like \"dateutil/Europe/London\" when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362"; +static char __pyx_k_Cannot_add_integral_value_to_Tim[] = "Cannot add integral value to Timestamp without offset."; +static char __pyx_k_Cannot_compare_tz_naive_and_tz_a[] = "Cannot compare tz-naive and tz-aware timestamps"; +static char __pyx_k_Cannot_convert_tz_naive_Timestam[] = "Cannot convert tz-naive Timestamp, use tz_localize to localize"; +static char __pyx_k_Cannot_infer_dst_time_from_r_try[] = "Cannot infer dst time from %r, try using the 'infer_dst' argument"; +static char __pyx_k_Cannot_infer_dst_time_from_s_ast[] = "Cannot infer dst time from %s asthere are no repeated times"; +static char __pyx_k_Cannot_localize_tz_aware_Timesta[] = "Cannot localize tz-aware Timestamp, use tz_convert for conversions"; +static char __pyx_k_Cannot_mix_tz_aware_with_tz_naiv[] = "Cannot mix tz-aware with tz-naive values"; +static char __pyx_k_Could_not_construct_Timestamp_fr[] = "Could not construct Timestamp from argument %s"; +static char __pyx_k_Custom_business_days_is_not_supp[] = "Custom business days is not supported by %s"; +static char __pyx_k_First_time_before_start_of_DST_i[] = "First time before start of DST info"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Given_date_string_not_likely_a_d[] = "Given date string not likely a datetime."; +static char __pyx_k_Handle_conversion_from_format_di[] = "Handle conversion from format directives to regexes."; +static char __pyx_k_Invalid_type_for_timedelta_scala[] = "Invalid type for timedelta scalar: %s"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_NumPy_1_6_1_business_freq_not_su[] = "NumPy 1.6.1 business freq not supported"; +static char __pyx_k_Out_of_bounds_nanosecond_timesta[] = "Out of bounds nanosecond timestamp: %s"; +static char __pyx_k_Stores_and_handles_locale_specif[] = "Stores and handles locale-specific information related to time.\n\n ATTRIBUTES:\n f_weekday -- full weekday names (7-item list)\n a_weekday -- abbreviated weekday names (7-item list)\n f_month -- full month names (13-item list; dummy value in [0], which\n is added by code)\n a_month -- abbreviated month names (13-item list, dummy value in\n [0], which is added by code)\n am_pm -- AM/PM representation (2-item list)\n LC_date_time -- format string for date/time representation (string)\n LC_date -- format string for date representation (string)\n LC_time -- format string for time representation (string)\n timezone -- daylight- and non-daylight-savings timezone representation\n (2-item list of sets)\n lang -- Language used by instance (2-item tuple)\n "; +static char __pyx_k_There_are_i_dst_switches_when_th[] = "There are %i dst switches when there should only be 1."; +static char __pyx_k_TimeStamp_is_the_pandas_equivale[] = "TimeStamp is the pandas equivalent of python's Datetime\n and is interchangable with it in most cases. It's the type used\n for the entries that make up a DatetimeIndex, and other timeseries\n oriented data structures in pandas.\n "; +static char __pyx_k_Tz_aware_datetime_datetime_canno[] = "Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True"; +static char __pyx_k_Unable_to_convert_to_desired_fre[] = "Unable to convert to desired frequency."; +static char __pyx_k_Warning_discarding_nonzero_nanos[] = "Warning: discarding nonzero nanoseconds"; +static char __pyx_k_locale_changed_during_initializa[] = "locale changed during initialization"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_time_data_r_does_not_match_forma[] = "time data %r does not match format %r"; +static char __pyx_k_unsupported_unit_for_native_time[] = "unsupported unit for native timedelta under this numpy {0}"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_kp_s_0; +static PyObject *__pyx_kp_s_00; +static PyObject *__pyx_kp_s_02d; +static PyObject *__pyx_kp_s_02d_06d; +static PyObject *__pyx_kp_s_03; +static PyObject *__pyx_kp_s_03d; +static PyObject *__pyx_kp_s_06d; +static PyObject *__pyx_kp_s_09d; +static PyObject *__pyx_kp_s_1; +static PyObject *__pyx_kp_s_10; +static PyObject *__pyx_kp_s_11; +static PyObject *__pyx_kp_s_17; +static PyObject *__pyx_kp_s_1999; +static PyObject *__pyx_kp_s_1_6; +static PyObject *__pyx_kp_s_1_7; +static PyObject *__pyx_kp_s_2; +static PyObject *__pyx_kp_s_22; +static PyObject *__pyx_kp_s_2d; +static PyObject *__pyx_kp_s_2d_2d_2d; +static PyObject *__pyx_kp_s_3; +static PyObject *__pyx_kp_s_3d; +static PyObject *__pyx_kp_s_44; +static PyObject *__pyx_kp_s_55; +static PyObject *__pyx_kp_s_6d; +static PyObject *__pyx_kp_s_76; +static PyObject *__pyx_kp_s_99; +static PyObject *__pyx_kp_s_9d; +static PyObject *__pyx_n_s_A; +static PyObject *__pyx_kp_b_AB; +static PyObject *__pyx_kp_s_AB; +static PyObject *__pyx_n_s_AS; +static PyObject *__pyx_kp_s_A_2; +static PyObject *__pyx_n_s_AmbiguousTimeError; +static PyObject *__pyx_kp_s_Array_must_be_all_same_time_zone; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_B; +static PyObject *__pyx_kp_s_B_2; +static PyObject *__pyx_kp_s_Bad_tz_filename_Dateutil_on_pyth; +static PyObject *__pyx_n_s_BaseTzInfo; +static PyObject *__pyx_n_s_C; +static PyObject *__pyx_n_s_CACHE_MAX_SIZE; +static PyObject *__pyx_kp_b_CD; +static PyObject *__pyx_kp_s_CD; +static PyObject *__pyx_kp_s_Cannot_add_integral_value_to_Tim; +static PyObject *__pyx_kp_s_Cannot_compare_type_r_with_type; +static PyObject *__pyx_kp_s_Cannot_compare_tz_naive_and_tz_a; +static PyObject *__pyx_kp_s_Cannot_convert_tz_naive_Timestam; +static PyObject *__pyx_kp_s_Cannot_infer_dst_time_from_r_try; +static PyObject *__pyx_kp_s_Cannot_infer_dst_time_from_s_ast; +static PyObject *__pyx_kp_s_Cannot_localize_tz_aware_Timesta; +static PyObject *__pyx_kp_s_Cannot_mix_tz_aware_with_tz_naiv; +static PyObject *__pyx_kp_s_Could_not_construct_Timestamp_fr; +static PyObject *__pyx_kp_s_Could_not_find_pytz_module; +static PyObject *__pyx_kp_s_Custom_business_days_is_not_supp; +static PyObject *__pyx_n_s_D; +static PyObject *__pyx_n_s_D_RESO; +static PyObject *__pyx_kp_b_EF; +static PyObject *__pyx_kp_s_EF; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_kp_b_F; +static PyObject *__pyx_kp_b_FQ_q; +static PyObject *__pyx_kp_s_Field_s_not_supported; +static PyObject *__pyx_kp_s_First_time_before_start_of_DST_i; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_kp_s_Frequency_conversion_failed; +static PyObject *__pyx_kp_b_GH; +static PyObject *__pyx_kp_s_GH; +static PyObject *__pyx_kp_s_Given_date_string_not_likely_a_d; +static PyObject *__pyx_n_s_H; +static PyObject *__pyx_kp_s_H_2; +static PyObject *__pyx_n_s_H_RESO; +static PyObject *__pyx_kp_s_Handle_conversion_from_format_di; +static PyObject *__pyx_n_s_I; +static PyObject *__pyx_n_s_IGNORECASE; +static PyObject *__pyx_kp_b_IJ; +static PyObject *__pyx_kp_s_IJ; +static PyObject *__pyx_kp_s_I_2; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Invalid_type_for_timedelta_scala; +static PyObject *__pyx_kp_b_KL; +static PyObject *__pyx_kp_s_KL; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_LC_TIME; +static PyObject *__pyx_n_s_LC_date; +static PyObject *__pyx_n_s_LC_date_time; +static PyObject *__pyx_n_s_LC_time; +static PyObject *__pyx_n_s_LocaleTime; +static PyObject *__pyx_n_s_LocaleTime___calc_am_pm; +static PyObject *__pyx_n_s_LocaleTime___calc_date_time; +static PyObject *__pyx_n_s_LocaleTime___calc_month; +static PyObject *__pyx_n_s_LocaleTime___calc_timezone; +static PyObject *__pyx_n_s_LocaleTime___calc_weekday; +static PyObject *__pyx_n_s_LocaleTime___init; +static PyObject *__pyx_n_s_LocaleTime___pad; +static PyObject *__pyx_n_s_LocaleTime__calc_am_pm; +static PyObject *__pyx_n_s_LocaleTime__calc_date_time; +static PyObject *__pyx_n_s_LocaleTime__calc_month; +static PyObject *__pyx_n_s_LocaleTime__calc_timezone; +static PyObject *__pyx_n_s_LocaleTime__calc_weekday; +static PyObject *__pyx_n_s_LocaleTime__pad; +static PyObject *__pyx_n_s_LooseVersion; +static PyObject *__pyx_n_s_M; +static PyObject *__pyx_kp_s_M8_ns; +static PyObject *__pyx_kp_s_M8_s; +static PyObject *__pyx_n_s_MS; +static PyObject *__pyx_n_s_MS_RESO; +static PyObject *__pyx_kp_s_M_2; +static PyObject *__pyx_n_s_NAN; +static PyObject *__pyx_n_s_NAT; +static PyObject *__pyx_kp_s_N_ot_A_T_ime_the_time_equivalen; +static PyObject *__pyx_n_s_NaN; +static PyObject *__pyx_n_s_NaT; +static PyObject *__pyx_n_s_NaTType; +static PyObject *__pyx_n_s_NaTType___hash; +static PyObject *__pyx_n_s_NaTType___int; +static PyObject *__pyx_n_s_NaTType___long; +static PyObject *__pyx_n_s_NaTType___new; +static PyObject *__pyx_n_s_NaTType___reduce; +static PyObject *__pyx_n_s_NaTType___repr; +static PyObject *__pyx_n_s_NaTType___str; +static PyObject *__pyx_n_s_NaTType_toordinal; +static PyObject *__pyx_n_s_NaTType_weekday; +static PyObject *__pyx_n_s_NameError; +static PyObject *__pyx_n_s_NonExistentTimeError; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_NotImplemented; +static PyObject *__pyx_kp_s_NumPy_1_6_1_business_freq_not_su; +static PyObject *__pyx_n_s_OutOfBoundsDatetime; +static PyObject *__pyx_kp_s_Out_of_bounds_nanosecond_timesta; +static PyObject *__pyx_n_s_OverflowError; +static PyObject *__pyx_n_s_P; +static PyObject *__pyx_kp_s_P_H_2_0_3_0_1_d_d; +static PyObject *__pyx_kp_s_P_I_1_0_2_0_1_9_1_9; +static PyObject *__pyx_kp_s_P_M_0_5_d_d; +static PyObject *__pyx_kp_s_P_S_6_0_1_0_5_d_d; +static PyObject *__pyx_kp_s_P_U_5_0_3_0_4_d_d; +static PyObject *__pyx_kp_s_P_Y_d_d_d_d; +static PyObject *__pyx_kp_s_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9; +static PyObject *__pyx_kp_s_P_f_0_9_1_6; +static PyObject *__pyx_kp_s_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1; +static PyObject *__pyx_kp_s_P_m_1_0_2_0_1_9_1_9; +static PyObject *__pyx_kp_s_P_s_s; +static PyObject *__pyx_kp_s_P_w_0_6; +static PyObject *__pyx_kp_s_P_y_d_d; +static PyObject *__pyx_n_s_Period; +static PyObject *__pyx_n_s_QS; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_S; +static PyObject *__pyx_kp_s_S_2; +static PyObject *__pyx_n_s_S_RESO; +static PyObject *__pyx_kp_s_Stores_and_handles_locale_specif; +static PyObject *__pyx_n_s_T; +static PyObject *__pyx_n_s_T_RESO; +static PyObject *__pyx_kp_s_There_are_i_dst_switches_when_th; +static PyObject *__pyx_n_s_TimeRE; +static PyObject *__pyx_n_s_TimeRE___init; +static PyObject *__pyx_n_s_TimeRE___seqToRE; +static PyObject *__pyx_n_s_TimeRE__seqToRE; +static PyObject *__pyx_n_s_TimeRE_cache; +static PyObject *__pyx_n_s_TimeRE_compile; +static PyObject *__pyx_n_s_TimeRE_pattern; +static PyObject *__pyx_kp_s_TimeStamp_is_the_pandas_equivale; +static PyObject *__pyx_n_s_Timestamp; +static PyObject *__pyx_n_s_Timestamp___new; +static PyObject *__pyx_n_s_Timestamp___reduce; +static PyObject *__pyx_n_s_Timestamp___repr; +static PyObject *__pyx_n_s_Timestamp___setstate; +static PyObject *__pyx_n_s_Timestamp__date_repr; +static PyObject *__pyx_n_s_Timestamp__has_time_component; +static PyObject *__pyx_n_s_Timestamp__repr_base; +static PyObject *__pyx_n_s_Timestamp__time_repr; +static PyObject *__pyx_n_s_Timestamp_asm8; +static PyObject *__pyx_n_s_Timestamp_dayofweek; +static PyObject *__pyx_n_s_Timestamp_dayofyear; +static PyObject *__pyx_n_s_Timestamp_freq; +static PyObject *__pyx_n_s_Timestamp_freqstr; +static PyObject *__pyx_n_s_Timestamp_fromordinal; +static PyObject *__pyx_n_s_Timestamp_is_month_end; +static PyObject *__pyx_n_s_Timestamp_is_month_start; +static PyObject *__pyx_n_s_Timestamp_is_quarter_end; +static PyObject *__pyx_n_s_Timestamp_is_quarter_start; +static PyObject *__pyx_n_s_Timestamp_is_year_end; +static PyObject *__pyx_n_s_Timestamp_is_year_start; +static PyObject *__pyx_n_s_Timestamp_isoformat; +static PyObject *__pyx_n_s_Timestamp_now; +static PyObject *__pyx_n_s_Timestamp_quarter; +static PyObject *__pyx_n_s_Timestamp_replace; +static PyObject *__pyx_kp_s_Timestamp_stamp_tz_offset; +static PyObject *__pyx_n_s_Timestamp_to_julian_date; +static PyObject *__pyx_n_s_Timestamp_to_period; +static PyObject *__pyx_n_s_Timestamp_to_pydatetime; +static PyObject *__pyx_n_s_Timestamp_today; +static PyObject *__pyx_n_s_Timestamp_tz; +static PyObject *__pyx_n_s_Timestamp_tz_convert; +static PyObject *__pyx_n_s_Timestamp_tz_localize; +static PyObject *__pyx_n_s_Timestamp_utcnow; +static PyObject *__pyx_n_s_Timestamp_week; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Tz_aware_datetime_datetime_canno; +static PyObject *__pyx_n_s_U; +static PyObject *__pyx_n_s_US_RESO; +static PyObject *__pyx_n_s_UTC; +static PyObject *__pyx_kp_s_U_2; +static PyObject *__pyx_n_s_U_W; +static PyObject *__pyx_kp_s_Unable_to_convert_to_desired_fre; +static PyObject *__pyx_kp_s_Unable_to_get_quarter_and_year; +static PyObject *__pyx_kp_s_Unable_to_parse_s; +static PyObject *__pyx_kp_s_Unknown_freq_d; +static PyObject *__pyx_kp_s_Unrecognized_period_code_d; +static PyObject *__pyx_kp_s_Unrecognized_type_s; +static PyObject *__pyx_kp_s_Unrecognized_value_type_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_W; +static PyObject *__pyx_kp_s_W_2; +static PyObject *__pyx_kp_s_Warning_discarding_nonzero_nanos; +static PyObject *__pyx_kp_s_X; +static PyObject *__pyx_n_s_X_2; +static PyObject *__pyx_n_s_Y; +static PyObject *__pyx_kp_b_Y_2; +static PyObject *__pyx_kp_s_Y_2; +static PyObject *__pyx_kp_b_Y_m; +static PyObject *__pyx_kp_b_Y_m_d; +static PyObject *__pyx_kp_b_Y_m_d_H_00; +static PyObject *__pyx_kp_b_Y_m_d_H_M; +static PyObject *__pyx_kp_b_Y_m_d_H_M_S; +static PyObject *__pyx_kp_b_Y_m_d_H_M_S_l; +static PyObject *__pyx_kp_b_Y_m_d_H_M_S_n; +static PyObject *__pyx_kp_b_Y_m_d_H_M_S_u; +static PyObject *__pyx_kp_s_Z; +static PyObject *__pyx_n_s_Z_2; +static PyObject *__pyx_kp_s_Z_3; +static PyObject *__pyx_kp_s_Z_tz_s; +static PyObject *__pyx_kp_s__112; +static PyObject *__pyx_kp_s__113; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__50; +static PyObject *__pyx_kp_s__51; +static PyObject *__pyx_kp_s__52; +static PyObject *__pyx_kp_s__89; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_kp_s_a_2; +static PyObject *__pyx_n_s_a_idx; +static PyObject *__pyx_n_s_a_month; +static PyObject *__pyx_n_s_a_weekday; +static PyObject *__pyx_n_s_abs; +static PyObject *__pyx_n_s_add; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_all_2; +static PyObject *__pyx_n_s_allocate_lock; +static PyObject *__pyx_n_s_am_pm; +static PyObject *__pyx_n_s_ampm; +static PyObject *__pyx_n_s_any; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_apply; +static PyObject *__pyx_n_s_apply_offset; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_array_split; +static PyObject *__pyx_n_s_array_strptime; +static PyObject *__pyx_n_s_array_to_datetime; +static PyObject *__pyx_n_s_array_to_timedelta64; +static PyObject *__pyx_n_s_asm8; +static PyObject *__pyx_n_s_astimezone; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_kp_s_b_2; +static PyObject *__pyx_n_s_b_idx; +static PyObject *__pyx_n_s_bad_directive; +static PyObject *__pyx_kp_s_bad_month_number_0_must_be_1_12; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_base1; +static PyObject *__pyx_n_s_base2; +static PyObject *__pyx_n_s_basestring; +static PyObject *__pyx_n_s_both_eq; +static PyObject *__pyx_n_s_both_nat; +static PyObject *__pyx_n_s_boxed; +static PyObject *__pyx_n_s_build_field_sarray; +static PyObject *__pyx_kp_s_c; +static PyObject *__pyx_n_s_c_2; +static PyObject *__pyx_n_s_cache_lock; +static PyObject *__pyx_n_s_calc_am_pm; +static PyObject *__pyx_n_s_calc_date_time; +static PyObject *__pyx_n_s_calc_julian_from_U_or_W; +static PyObject *__pyx_n_s_calc_month; +static PyObject *__pyx_n_s_calc_timezone; +static PyObject *__pyx_n_s_calc_weekday; +static PyObject *__pyx_n_s_calendar; +static PyObject *__pyx_kp_s_cannot_cast_unit_0; +static PyObject *__pyx_n_s_cast_to_nanoseconds; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_code; +static PyObject *__pyx_n_s_coerce; +static PyObject *__pyx_n_s_combine; +static PyObject *__pyx_n_s_compat_NaT; +static PyObject *__pyx_n_s_compile; +static PyObject *__pyx_n_s_convert_to_timedelta; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_current_format; +static PyObject *__pyx_n_s_d; +static PyObject *__pyx_kp_s_d_2; +static PyObject *__pyx_kp_s_d_2d_2d; +static PyObject *__pyx_kp_s_d_2d_2d_2d_2d_2d; +static PyObject *__pyx_n_s_date; +static PyObject *__pyx_n_s_date_normalize; +static PyObject *__pyx_n_s_date_repr; +static PyObject *__pyx_n_s_date_string; +static PyObject *__pyx_n_s_date_time; +static PyObject *__pyx_n_s_dates_normalized; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_datetime64; +static PyObject *__pyx_n_s_datetime_date; +static PyObject *__pyx_n_s_datetime_result; +static PyObject *__pyx_n_s_datetime_time; +static PyObject *__pyx_n_s_datetime_to_datetime64; +static PyObject *__pyx_kp_s_dateutil; +static PyObject *__pyx_n_s_dateutil_2; +static PyObject *__pyx_n_s_dateutil_gettz; +static PyObject *__pyx_n_s_dateutil_tz; +static PyObject *__pyx_n_s_dateutil_tzfile; +static PyObject *__pyx_n_s_dateutil_tzlocal; +static PyObject *__pyx_n_s_dateutil_tzutc; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_day_abbr; +static PyObject *__pyx_n_s_day_name; +static PyObject *__pyx_n_s_day_of_week; +static PyObject *__pyx_n_s_dayfirst; +static PyObject *__pyx_n_s_daylight; +static PyObject *__pyx_n_s_dayofweek; +static PyObject *__pyx_n_s_dayofyear; +static PyObject *__pyx_n_s_days; +static PyObject *__pyx_n_s_days_to_week; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_delta; +static PyObject *__pyx_n_s_delta_to_nanoseconds; +static PyObject *__pyx_n_s_deltas; +static PyObject *__pyx_n_s_diff; +static PyObject *__pyx_n_s_directive; +static PyObject *__pyx_n_s_directive_index; +static PyObject *__pyx_n_s_distutils_version; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_does_string_look_like_datetime; +static PyObject *__pyx_n_s_dom; +static PyObject *__pyx_n_s_dow; +static PyObject *__pyx_n_s_doy; +static PyObject *__pyx_n_s_dst_hours; +static PyObject *__pyx_n_s_dt; +static PyObject *__pyx_n_s_dt64arr_to_periodarr; +static PyObject *__pyx_n_s_dtarr; +static PyObject *__pyx_n_s_dtindex; +static PyObject *__pyx_n_s_dts; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dummy_thread; +static PyObject *__pyx_n_s_dummy_thread_2; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_end_month; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_err; +static PyObject *__pyx_n_s_escape; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_extract_ordinals; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_kp_b_f_2; +static PyObject *__pyx_n_s_f_month; +static PyObject *__pyx_n_s_f_weekday; +static PyObject *__pyx_n_s_fget; +static PyObject *__pyx_n_s_field; +static PyObject *__pyx_n_s_fields; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_filename; +static PyObject *__pyx_n_s_fill; +static PyObject *__pyx_n_s_finfo; +static PyObject *__pyx_n_s_first_weekday; +static PyObject *__pyx_n_s_fix; +static PyObject *__pyx_n_s_flat; +static PyObject *__pyx_n_s_floor; +static PyObject *__pyx_n_s_fmt; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_format_regex; +static PyObject *__pyx_n_s_found; +static PyObject *__pyx_n_s_found_dict; +static PyObject *__pyx_n_s_found_zone; +static PyObject *__pyx_n_s_frac; +static PyObject *__pyx_n_s_fraction; +static PyObject *__pyx_n_s_freq; +static PyObject *__pyx_n_s_freq1; +static PyObject *__pyx_n_s_freq2; +static PyObject *__pyx_n_s_freq_group; +static PyObject *__pyx_n_s_freqstr; +static PyObject *__pyx_n_s_fromordinal; +static PyObject *__pyx_n_s_front; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_date_field; +static PyObject *__pyx_n_s_get_field; +static PyObject *__pyx_n_s_get_period_field; +static PyObject *__pyx_n_s_get_period_field_arr; +static PyObject *__pyx_n_s_get_start_end_field; +static PyObject *__pyx_n_s_get_start_end_field_2; +static PyObject *__pyx_n_s_get_time_micros; +static PyObject *__pyx_n_s_get_timezone; +static PyObject *__pyx_n_s_getitem; +static PyObject *__pyx_n_s_getlang; +static PyObject *__pyx_n_s_getlocale; +static PyObject *__pyx_n_s_gettz; +static PyObject *__pyx_n_s_gmt; +static PyObject *__pyx_n_s_group_key; +static PyObject *__pyx_n_s_groupdict; +static PyObject *__pyx_n_s_grp; +static PyObject *__pyx_n_s_h; +static PyObject *__pyx_n_s_has_saving; +static PyObject *__pyx_n_s_has_time_component; +static PyObject *__pyx_n_s_hash; +static PyObject *__pyx_n_s_have_pytz; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_hours; +static PyObject *__pyx_n_s_hstack; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_i4; +static PyObject *__pyx_n_s_i8; +static PyObject *__pyx_n_s_i8_to_pydt; +static PyObject *__pyx_n_s_iNaT; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_idx_shifted; +static PyObject *__pyx_n_s_ignore; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_infer_dst; +static PyObject *__pyx_n_s_inferred_tz; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_insert; +static PyObject *__pyx_n_s_int; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_ints_to_pydatetime; +static PyObject *__pyx_n_s_iresult; +static PyObject *__pyx_n_s_is_business; +static PyObject *__pyx_n_s_is_month_end; +static PyObject *__pyx_n_s_is_month_start; +static PyObject *__pyx_n_s_is_quarter_end; +static PyObject *__pyx_n_s_is_quarter_start; +static PyObject *__pyx_n_s_is_timestamp_array; +static PyObject *__pyx_n_s_is_year_end; +static PyObject *__pyx_n_s_is_year_start; +static PyObject *__pyx_n_s_isdst; +static PyObject *__pyx_n_s_isleap; +static PyObject *__pyx_n_s_isleap_prev; +static PyObject *__pyx_n_s_isleapyear; +static PyObject *__pyx_n_s_isoformat; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_iterkeys; +static PyObject *__pyx_n_s_ivalue; +static PyObject *__pyx_n_s_ivalues; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_kp_s_j_2; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_julian; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_kwds; +static PyObject *__pyx_n_s_l; +static PyObject *__pyx_kp_b_l_2; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_lang; +static PyObject *__pyx_n_s_ldom; +static PyObject *__pyx_n_s_left; +static PyObject *__pyx_n_s_len; +static PyObject *__pyx_n_s_loc; +static PyObject *__pyx_n_s_locale; +static PyObject *__pyx_kp_s_locale_changed_during_initializa; +static PyObject *__pyx_n_s_locale_time; +static PyObject *__pyx_n_s_localize; +static PyObject *__pyx_n_s_logical_and; +static PyObject *__pyx_n_s_long; +static PyObject *__pyx_n_s_long_2; +static PyObject *__pyx_n_s_lower; +static PyObject *__pyx_n_s_m; +static PyObject *__pyx_kp_s_m8_0; +static PyObject *__pyx_kp_s_m8_ns; +static PyObject *__pyx_kp_s_m_2; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mask; +static PyObject *__pyx_n_s_match; +static PyObject *__pyx_n_s_max; +static PyObject *__pyx_n_s_maximum; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_micros; +static PyObject *__pyx_n_s_microsecond; +static PyObject *__pyx_n_s_microseconds; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_minutes; +static PyObject *__pyx_kp_s_mixed_datetimes_and_integers_in; +static PyObject *__pyx_n_s_mo_off; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_month_abbr; +static PyObject *__pyx_n_s_month_kw; +static PyObject *__pyx_n_s_month_name; +static PyObject *__pyx_n_s_month_offset; +static PyObject *__pyx_n_s_monthrange; +static PyObject *__pyx_n_s_months; +static PyObject *__pyx_n_s_ms; +static PyObject *__pyx_n_s_mus; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_kp_b_n_2; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_n_s_nanos; +static PyObject *__pyx_n_s_nanosecond; +static PyObject *__pyx_n_s_nat; +static PyObject *__pyx_n_s_nat_strings; +static PyObject *__pyx_n_s_nat_unpickle; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_new_2; +static PyObject *__pyx_n_s_new_tz; +static PyObject *__pyx_n_s_new_values; +static PyObject *__pyx_n_s_no_saving; +static PyObject *__pyx_n_s_nonzero; +static PyObject *__pyx_n_s_normalize; +static PyObject *__pyx_n_s_not_datelike_strings; +static PyObject *__pyx_n_s_now; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_np_NaT; +static PyObject *__pyx_n_s_np_version; +static PyObject *__pyx_n_s_np_version_under1p6; +static PyObject *__pyx_n_s_np_version_under1p7; +static PyObject *__pyx_n_s_ns; +static PyObject *__pyx_n_s_ntrans; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_object_state; +static PyObject *__pyx_n_s_offset; +static PyObject *__pyx_kp_s_offset_0; +static PyObject *__pyx_n_s_old; +static PyObject *__pyx_n_s_one_diff; +static PyObject *__pyx_n_s_ordinal; +static PyObject *__pyx_n_s_ordinals; +static PyObject *__pyx_n_s_oresult; +static PyObject *__pyx_n_s_out; +static PyObject *__pyx_n_s_p; +static PyObject *__pyx_kp_s_p_2; +static PyObject *__pyx_n_s_p_tz_cache_key; +static PyObject *__pyx_n_s_pad; +static PyObject *__pyx_n_s_pandas_compat; +static PyObject *__pyx_n_s_pandas_tseries_frequencies; +static PyObject *__pyx_n_s_pandas_tseries_period; +static PyObject *__pyx_n_s_pandas_tslib; +static PyObject *__pyx_n_s_parse_code; +static PyObject *__pyx_n_s_parse_code_table; +static PyObject *__pyx_n_s_parse_date; +static PyObject *__pyx_n_s_parse_datetime_string; +static PyObject *__pyx_n_s_pattern; +static PyObject *__pyx_n_s_period_asfreq_arr; +static PyObject *__pyx_n_s_period_format; +static PyObject *__pyx_n_s_period_ordinal; +static PyObject *__pyx_n_s_periodarr; +static PyObject *__pyx_n_s_periodarr_to_dt64arr; +static PyObject *__pyx_n_s_pos; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_processed_format; +static PyObject *__pyx_n_s_prop; +static PyObject *__pyx_n_s_property; +static PyObject *__pyx_n_s_ps; +static PyObject *__pyx_n_s_py_dt; +static PyObject *__pyx_n_s_pydt; +static PyObject *__pyx_n_s_pydt_to_i8; +static PyObject *__pyx_n_s_pytz; +static PyObject *__pyx_n_s_pytz_BaseTzInfo; +static PyObject *__pyx_n_s_pytz_tzinfo; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_q; +static PyObject *__pyx_kp_b_q_2; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_quarter; +static PyObject *__pyx_n_s_raise; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_ravel; +static PyObject *__pyx_n_s_re; +static PyObject *__pyx_n_s_re_compile; +static PyObject *__pyx_n_s_re_escape; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_regex; +static PyObject *__pyx_n_s_regex_cache; +static PyObject *__pyx_n_s_regex_chars; +static PyObject *__pyx_n_s_relation; +static PyObject *__pyx_n_s_replace; +static PyObject *__pyx_n_s_replacement_pairs; +static PyObject *__pyx_n_s_repr; +static PyObject *__pyx_n_s_repr_base; +static PyObject *__pyx_n_s_repr_timedelta64; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_result_a; +static PyObject *__pyx_n_s_result_b; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_reverse; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_round; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_kp_s_s_02d_02d_s; +static PyObject *__pyx_kp_s_s_2; +static PyObject *__pyx_kp_s_s_3; +static PyObject *__pyx_kp_s_s_d_days; +static PyObject *__pyx_kp_s_s_d_days_02d_02d_s; +static PyObject *__pyx_kp_s_s_is_a_bad_directive_in_format; +static PyObject *__pyx_kp_s_s_is_wrong_freq; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_s_2; +static PyObject *__pyx_kp_s_s_s_3; +static PyObject *__pyx_kp_s_s_s_s; +static PyObject *__pyx_n_s_sa_dtype; +static PyObject *__pyx_n_s_searchsorted; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_seconds; +static PyObject *__pyx_n_s_seconds_pretty; +static PyObject *__pyx_n_s_seen_datetime; +static PyObject *__pyx_n_s_seen_integer; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_sep; +static PyObject *__pyx_n_s_seq; +static PyObject *__pyx_n_s_seqToRE; +static PyObject *__pyx_n_s_setitem; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_short; +static PyObject *__pyx_n_s_short_version; +static PyObject *__pyx_n_s_side; +static PyObject *__pyx_n_s_sign; +static PyObject *__pyx_n_s_sign_pretty; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_sort; +static PyObject *__pyx_n_s_sorted; +static PyObject *__pyx_n_s_sp; +static PyObject *__pyx_n_s_squeeze; +static PyObject *__pyx_n_s_stamp; +static PyObject *__pyx_n_s_stamps; +static PyObject *__pyx_n_s_start_month; +static PyObject *__pyx_n_s_startingMonth; +static PyObject *__pyx_n_s_startswith; +static PyObject *__pyx_n_s_state; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_kp_s_stray_in_format_s; +static PyObject *__pyx_n_s_strftime; +static PyObject *__pyx_n_s_string_types; +static PyObject *__pyx_n_s_struct_time; +static PyObject *__pyx_n_s_sub; +static PyObject *__pyx_n_s_sub_2; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_switch_idx; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_sz; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_table; +static PyObject *__pyx_kp_s_tar_gz; +static PyObject *__pyx_n_s_td; +static PyObject *__pyx_n_s_tdata; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_thread; +static PyObject *__pyx_n_s_thread_2; +static PyObject *__pyx_n_s_thread_allocate_lock; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_kp_s_time_data_r_does_not_match_forma; +static PyObject *__pyx_n_s_time_repr; +static PyObject *__pyx_n_s_time_tuple; +static PyObject *__pyx_n_s_timedelta; +static PyObject *__pyx_n_s_timedelta64; +static PyObject *__pyx_kp_s_timedelta64_ns; +static PyObject *__pyx_n_s_timezone; +static PyObject *__pyx_n_s_to_convert; +static PyObject *__pyx_n_s_to_datetime; +static PyObject *__pyx_n_s_to_julian_date; +static PyObject *__pyx_n_s_to_offset; +static PyObject *__pyx_n_s_to_period; +static PyObject *__pyx_n_s_to_pydatetime; +static PyObject *__pyx_n_s_today; +static PyObject *__pyx_n_s_toordinal; +static PyObject *__pyx_n_s_tot_seconds; +static PyObject *__pyx_n_s_total_seconds; +static PyObject *__pyx_n_s_trans; +static PyObject *__pyx_n_s_trans_cache; +static PyObject *__pyx_n_s_trans_grp; +static PyObject *__pyx_n_s_trans_idx; +static PyObject *__pyx_n_s_trans_idx_2; +static PyObject *__pyx_n_s_trans_len; +static PyObject *__pyx_n_s_trans_list; +static PyObject *__pyx_n_s_transition_info; +static PyObject *__pyx_n_s_ts; +static PyObject *__pyx_n_s_ts_2; +static PyObject *__pyx_n_s_ts_base; +static PyObject *__pyx_n_s_ts_input; +static PyObject *__pyx_n_s_tso; +static PyObject *__pyx_n_s_ttinfo_before; +static PyObject *__pyx_n_s_ttinfo_std; +static PyObject *__pyx_n_s_tz; +static PyObject *__pyx_n_s_tz1; +static PyObject *__pyx_n_s_tz2; +static PyObject *__pyx_kp_s_tz_0; +static PyObject *__pyx_n_s_tz_convert; +static PyObject *__pyx_n_s_tz_convert_single; +static PyObject *__pyx_n_s_tz_localize; +static PyObject *__pyx_n_s_tz_localize_to_utc; +static PyObject *__pyx_kp_s_tz_s; +static PyObject *__pyx_n_s_tz_values; +static PyObject *__pyx_n_s_tzfile; +static PyObject *__pyx_n_s_tzinfo; +static PyObject *__pyx_n_s_tzinfos; +static PyObject *__pyx_n_s_tzlocal; +static PyObject *__pyx_n_s_tzname; +static PyObject *__pyx_n_s_tzoffset; +static PyObject *__pyx_n_s_tzset; +static PyObject *__pyx_n_s_tzutc; +static PyObject *__pyx_n_s_u; +static PyObject *__pyx_kp_b_u_2; +static PyObject *__pyx_kp_s_unconverted_data_remains_s; +static PyObject *__pyx_n_s_unique_deltas; +static PyObject *__pyx_n_s_uniques; +static PyObject *__pyx_n_s_unit; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_kp_s_unsupported_unit_for_native_time; +static PyObject *__pyx_n_s_us; +static PyObject *__pyx_n_s_utc; +static PyObject *__pyx_n_s_utc_convert; +static PyObject *__pyx_n_s_utc_date; +static PyObject *__pyx_n_s_utc_dates; +static PyObject *__pyx_n_s_utc_offset_cache; +static PyObject *__pyx_n_s_utc_transition_times; +static PyObject *__pyx_n_s_utcnow; +static PyObject *__pyx_n_s_utcoffset; +static PyObject *__pyx_n_s_utcoffset_2; +static PyObject *__pyx_kp_s_utf_8; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_vals; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_version; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_view; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_kp_s_w_2; +static PyObject *__pyx_n_s_warn; +static PyObject *__pyx_n_s_week; +static PyObject *__pyx_n_s_week_0_length; +static PyObject *__pyx_n_s_week_of_year; +static PyObject *__pyx_n_s_week_of_year_start; +static PyObject *__pyx_n_s_week_starts_Mon; +static PyObject *__pyx_n_s_weekday; +static PyObject *__pyx_n_s_weekofyear; +static PyObject *__pyx_n_s_where; +static PyObject *__pyx_n_s_whitespace_replacement; +static PyObject *__pyx_n_s_woy; +static PyObject *__pyx_kp_s_x; +static PyObject *__pyx_n_s_x_2; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_kp_s_y_2; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_n_s_year2000; +static PyObject *__pyx_n_s_years; +static PyObject *__pyx_kp_s_z; +static PyObject *__pyx_n_s_zero_time; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_n_s_zip; +static PyObject *__pyx_n_s_zone; +static PyObject *__pyx_float_1e6; +static PyObject *__pyx_float_1e9; +static PyObject *__pyx_float_1e_6; +static PyObject *__pyx_float_1e_9; +static PyObject *__pyx_float_24_0; +static PyObject *__pyx_float_60_0; +static PyObject *__pyx_float_1000_0; +static PyObject *__pyx_float_3600_0; +static PyObject *__pyx_float_1721118_5; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_4; +static PyObject *__pyx_int_5; +static PyObject *__pyx_int_6; +static PyObject *__pyx_int_7; +static PyObject *__pyx_int_8; +static PyObject *__pyx_int_9; +static PyObject *__pyx_int_10; +static PyObject *__pyx_int_11; +static PyObject *__pyx_int_12; +static PyObject *__pyx_int_13; +static PyObject *__pyx_int_14; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_16; +static PyObject *__pyx_int_17; +static PyObject *__pyx_int_18; +static PyObject *__pyx_int_22; +static PyObject *__pyx_int_24; +static PyObject *__pyx_int_31; +static PyObject *__pyx_int_44; +static PyObject *__pyx_int_55; +static PyObject *__pyx_int_59; +static PyObject *__pyx_int_60; +static PyObject *__pyx_int_76; +static PyObject *__pyx_int_90; +static PyObject *__pyx_int_91; +static PyObject *__pyx_int_100; +static PyObject *__pyx_int_120; +static PyObject *__pyx_int_121; +static PyObject *__pyx_int_151; +static PyObject *__pyx_int_152; +static PyObject *__pyx_int_153; +static PyObject *__pyx_int_181; +static PyObject *__pyx_int_182; +static PyObject *__pyx_int_212; +static PyObject *__pyx_int_213; +static PyObject *__pyx_int_243; +static PyObject *__pyx_int_244; +static PyObject *__pyx_int_273; +static PyObject *__pyx_int_274; +static PyObject *__pyx_int_304; +static PyObject *__pyx_int_305; +static PyObject *__pyx_int_334; +static PyObject *__pyx_int_335; +static PyObject *__pyx_int_365; +static PyObject *__pyx_int_366; +static PyObject *__pyx_int_400; +static PyObject *__pyx_int_457; +static PyObject *__pyx_int_1000; +static PyObject *__pyx_int_1999; +static PyObject *__pyx_int_2000; +static PyObject *__pyx_int_3600; +static PyObject *__pyx_int_6000; +static PyObject *__pyx_int_86400; +static PyObject *__pyx_int_1000000; +static PyObject *__pyx_int_1000000000; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_int_neg_6; +static PyObject *__pyx_int_1L; +static PyObject *__pyx_int_1000L; +static PyObject *__pyx_int_1000000L; +static PyObject *__pyx_int_1000000000L; +static PyObject *__pyx_int_60000000000L; +static PyObject *__pyx_int_3600000000000L; +static PyObject *__pyx_int_86400000000000L; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__18; +static PyObject *__pyx_slice__19; +static PyObject *__pyx_slice__33; +static PyObject *__pyx_slice__34; +static PyObject *__pyx_slice__74; +static PyObject *__pyx_slice__75; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_slice__108; +static PyObject *__pyx_slice__109; +static PyObject *__pyx_tuple__100; +static PyObject *__pyx_tuple__101; +static PyObject *__pyx_tuple__102; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__104; +static PyObject *__pyx_tuple__105; +static PyObject *__pyx_tuple__106; +static PyObject *__pyx_tuple__107; +static PyObject *__pyx_tuple__110; +static PyObject *__pyx_tuple__111; +static PyObject *__pyx_tuple__114; +static PyObject *__pyx_tuple__115; +static PyObject *__pyx_tuple__116; +static PyObject *__pyx_tuple__117; +static PyObject *__pyx_tuple__118; +static PyObject *__pyx_tuple__119; +static PyObject *__pyx_tuple__120; +static PyObject *__pyx_tuple__121; +static PyObject *__pyx_tuple__122; +static PyObject *__pyx_tuple__123; +static PyObject *__pyx_tuple__124; +static PyObject *__pyx_tuple__125; +static PyObject *__pyx_tuple__126; +static PyObject *__pyx_tuple__127; +static PyObject *__pyx_tuple__129; +static PyObject *__pyx_tuple__130; +static PyObject *__pyx_tuple__132; +static PyObject *__pyx_tuple__133; +static PyObject *__pyx_tuple__135; +static PyObject *__pyx_tuple__136; +static PyObject *__pyx_tuple__138; +static PyObject *__pyx_tuple__140; +static PyObject *__pyx_tuple__142; +static PyObject *__pyx_tuple__143; +static PyObject *__pyx_tuple__145; +static PyObject *__pyx_tuple__147; +static PyObject *__pyx_tuple__149; +static PyObject *__pyx_tuple__151; +static PyObject *__pyx_tuple__153; +static PyObject *__pyx_tuple__155; +static PyObject *__pyx_tuple__157; +static PyObject *__pyx_tuple__159; +static PyObject *__pyx_tuple__161; +static PyObject *__pyx_tuple__162; +static PyObject *__pyx_tuple__164; +static PyObject *__pyx_tuple__166; +static PyObject *__pyx_tuple__168; +static PyObject *__pyx_tuple__170; +static PyObject *__pyx_tuple__172; +static PyObject *__pyx_tuple__174; +static PyObject *__pyx_tuple__176; +static PyObject *__pyx_tuple__178; +static PyObject *__pyx_tuple__180; +static PyObject *__pyx_tuple__182; +static PyObject *__pyx_tuple__184; +static PyObject *__pyx_tuple__186; +static PyObject *__pyx_tuple__188; +static PyObject *__pyx_tuple__189; +static PyObject *__pyx_tuple__191; +static PyObject *__pyx_tuple__193; +static PyObject *__pyx_tuple__195; +static PyObject *__pyx_tuple__196; +static PyObject *__pyx_tuple__198; +static PyObject *__pyx_tuple__199; +static PyObject *__pyx_tuple__201; +static PyObject *__pyx_tuple__203; +static PyObject *__pyx_tuple__205; +static PyObject *__pyx_tuple__207; +static PyObject *__pyx_tuple__209; +static PyObject *__pyx_tuple__211; +static PyObject *__pyx_tuple__213; +static PyObject *__pyx_tuple__215; +static PyObject *__pyx_tuple__217; +static PyObject *__pyx_tuple__219; +static PyObject *__pyx_tuple__221; +static PyObject *__pyx_tuple__223; +static PyObject *__pyx_tuple__225; +static PyObject *__pyx_tuple__227; +static PyObject *__pyx_tuple__229; +static PyObject *__pyx_tuple__231; +static PyObject *__pyx_tuple__233; +static PyObject *__pyx_tuple__235; +static PyObject *__pyx_tuple__237; +static PyObject *__pyx_tuple__239; +static PyObject *__pyx_tuple__241; +static PyObject *__pyx_tuple__243; +static PyObject *__pyx_tuple__245; +static PyObject *__pyx_tuple__247; +static PyObject *__pyx_tuple__249; +static PyObject *__pyx_tuple__251; +static PyObject *__pyx_tuple__253; +static PyObject *__pyx_tuple__255; +static PyObject *__pyx_tuple__257; +static PyObject *__pyx_tuple__259; +static PyObject *__pyx_tuple__261; +static PyObject *__pyx_tuple__263; +static PyObject *__pyx_tuple__265; +static PyObject *__pyx_tuple__267; +static PyObject *__pyx_tuple__269; +static PyObject *__pyx_tuple__271; +static PyObject *__pyx_tuple__273; +static PyObject *__pyx_tuple__275; +static PyObject *__pyx_tuple__277; +static PyObject *__pyx_tuple__279; +static PyObject *__pyx_tuple__281; +static PyObject *__pyx_tuple__283; +static PyObject *__pyx_tuple__285; +static PyObject *__pyx_tuple__287; +static PyObject *__pyx_tuple__289; +static PyObject *__pyx_tuple__291; +static PyObject *__pyx_tuple__292; +static PyObject *__pyx_tuple__293; +static PyObject *__pyx_tuple__294; +static PyObject *__pyx_tuple__295; +static PyObject *__pyx_tuple__296; +static PyObject *__pyx_tuple__297; +static PyObject *__pyx_tuple__299; +static PyObject *__pyx_tuple__301; +static PyObject *__pyx_tuple__304; +static PyObject *__pyx_tuple__306; +static PyObject *__pyx_tuple__308; +static PyObject *__pyx_tuple__310; +static PyObject *__pyx_tuple__312; +static PyObject *__pyx_tuple__314; +static PyObject *__pyx_tuple__316; +static PyObject *__pyx_tuple__318; +static PyObject *__pyx_tuple__320; +static PyObject *__pyx_tuple__321; +static PyObject *__pyx_tuple__323; +static PyObject *__pyx_tuple__325; +static PyObject *__pyx_tuple__327; +static PyObject *__pyx_codeobj__128; +static PyObject *__pyx_codeobj__131; +static PyObject *__pyx_codeobj__134; +static PyObject *__pyx_codeobj__137; +static PyObject *__pyx_codeobj__139; +static PyObject *__pyx_codeobj__141; +static PyObject *__pyx_codeobj__144; +static PyObject *__pyx_codeobj__146; +static PyObject *__pyx_codeobj__148; +static PyObject *__pyx_codeobj__150; +static PyObject *__pyx_codeobj__152; +static PyObject *__pyx_codeobj__154; +static PyObject *__pyx_codeobj__156; +static PyObject *__pyx_codeobj__158; +static PyObject *__pyx_codeobj__160; +static PyObject *__pyx_codeobj__163; +static PyObject *__pyx_codeobj__165; +static PyObject *__pyx_codeobj__167; +static PyObject *__pyx_codeobj__169; +static PyObject *__pyx_codeobj__171; +static PyObject *__pyx_codeobj__173; +static PyObject *__pyx_codeobj__175; +static PyObject *__pyx_codeobj__177; +static PyObject *__pyx_codeobj__179; +static PyObject *__pyx_codeobj__181; +static PyObject *__pyx_codeobj__183; +static PyObject *__pyx_codeobj__185; +static PyObject *__pyx_codeobj__187; +static PyObject *__pyx_codeobj__190; +static PyObject *__pyx_codeobj__192; +static PyObject *__pyx_codeobj__194; +static PyObject *__pyx_codeobj__197; +static PyObject *__pyx_codeobj__200; +static PyObject *__pyx_codeobj__202; +static PyObject *__pyx_codeobj__204; +static PyObject *__pyx_codeobj__206; +static PyObject *__pyx_codeobj__208; +static PyObject *__pyx_codeobj__210; +static PyObject *__pyx_codeobj__212; +static PyObject *__pyx_codeobj__214; +static PyObject *__pyx_codeobj__216; +static PyObject *__pyx_codeobj__218; +static PyObject *__pyx_codeobj__220; +static PyObject *__pyx_codeobj__222; +static PyObject *__pyx_codeobj__224; +static PyObject *__pyx_codeobj__226; +static PyObject *__pyx_codeobj__228; +static PyObject *__pyx_codeobj__230; +static PyObject *__pyx_codeobj__232; +static PyObject *__pyx_codeobj__234; +static PyObject *__pyx_codeobj__236; +static PyObject *__pyx_codeobj__238; +static PyObject *__pyx_codeobj__240; +static PyObject *__pyx_codeobj__242; +static PyObject *__pyx_codeobj__244; +static PyObject *__pyx_codeobj__246; +static PyObject *__pyx_codeobj__248; +static PyObject *__pyx_codeobj__250; +static PyObject *__pyx_codeobj__252; +static PyObject *__pyx_codeobj__254; +static PyObject *__pyx_codeobj__256; +static PyObject *__pyx_codeobj__258; +static PyObject *__pyx_codeobj__260; +static PyObject *__pyx_codeobj__262; +static PyObject *__pyx_codeobj__264; +static PyObject *__pyx_codeobj__266; +static PyObject *__pyx_codeobj__268; +static PyObject *__pyx_codeobj__270; +static PyObject *__pyx_codeobj__272; +static PyObject *__pyx_codeobj__274; +static PyObject *__pyx_codeobj__276; +static PyObject *__pyx_codeobj__278; +static PyObject *__pyx_codeobj__280; +static PyObject *__pyx_codeobj__282; +static PyObject *__pyx_codeobj__284; +static PyObject *__pyx_codeobj__286; +static PyObject *__pyx_codeobj__288; +static PyObject *__pyx_codeobj__290; +static PyObject *__pyx_codeobj__298; +static PyObject *__pyx_codeobj__300; +static PyObject *__pyx_codeobj__302; +static PyObject *__pyx_codeobj__303; +static PyObject *__pyx_codeobj__305; +static PyObject *__pyx_codeobj__307; +static PyObject *__pyx_codeobj__309; +static PyObject *__pyx_codeobj__311; +static PyObject *__pyx_codeobj__313; +static PyObject *__pyx_codeobj__315; +static PyObject *__pyx_codeobj__317; +static PyObject *__pyx_codeobj__319; +static PyObject *__pyx_codeobj__322; +static PyObject *__pyx_codeobj__324; +static PyObject *__pyx_codeobj__326; +static PyObject *__pyx_codeobj__328; + +/* "pandas/tslib.pyx":503 + * 'week', 'dayofyear'] + * for field in fields: + * prop = property(fget=lambda self: -1) # <<<<<<<<<<<<<< + * setattr(NaTType, field, prop) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_100lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_100lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_6pandas_5tslib_100lambda1, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_100lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6pandas_5tslib_lambda1(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6pandas_5tslib_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":77 + * basestring = str + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_1ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_1ints_to_pydatetime = {__Pyx_NAMESTR("ints_to_pydatetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_1ints_to_pydatetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_1ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ints_to_pydatetime (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ints_to_pydatetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ints_to_pydatetime", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_ints_to_pydatetime(__pyx_self, __pyx_v_arr, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_ints_to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + PyArrayObject *__pyx_v_result = 0; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_trans = NULL; + PyObject *__pyx_v_deltas = NULL; + PyObject *__pyx_v_pos = NULL; + PyObject *__pyx_v_new_tz = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject **__pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + Py_ssize_t __pyx_t_19; + int __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + npy_datetime __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ints_to_pydatetime", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":79 + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * ndarray[object] result = np.empty(n, dtype=object) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":81 + * Py_ssize_t i, n = len(arr) + * pandas_datetimestruct dts + * ndarray[object] result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":83 + * ndarray[object] result = np.empty(n, dtype=object) + * + * if tz is not None: # <<<<<<<<<<<<<< + * if _is_utc(tz): + * for i in range(n): + */ + __pyx_t_7 = (__pyx_v_tz != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":84 + * + * if tz is not None: + * if _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if arr[i] == iNaT: + */ + __pyx_t_8 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":85 + * if tz is not None: + * if _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if arr[i] == iNaT: + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":86 + * if _is_utc(tz): + * for i in range(n): + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":87 + * for i in range(n): + * if arr[i] == iNaT: + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":89 + * result[i] = np.nan + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":90 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":91 + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + * for i in range(n): + */ + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + + /* "pandas/tslib.pyx":90 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + */ + __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_19 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_17); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_17; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + } + __pyx_L7:; + } + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":92 + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if arr[i] == iNaT: + */ + __pyx_t_8 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (!__pyx_t_8) { + __pyx_t_7 = (__pyx_f_6pandas_5tslib__is_fixed_offset(__pyx_v_tz) != 0); + __pyx_t_20 = __pyx_t_7; + } else { + __pyx_t_20 = __pyx_t_8; + } + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":93 + * dts.min, dts.sec, dts.us, tz) + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if arr[i] == iNaT: + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":94 + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + * for i in range(n): + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_16 = PyObject_RichCompare(__pyx_t_17, __pyx_t_18, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":95 + * for i in range(n): + * if arr[i] == iNaT: + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_22 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_18); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_18; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/tslib.pyx":97 + * result[i] = np.nan + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":98 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * result[i] = dt + tz.utcoffset(dt) + */ + __pyx_t_18 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/tslib.pyx":99 + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * result[i] = dt + tz.utcoffset(dt) + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":98 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * result[i] = dt + tz.utcoffset(dt) + */ + __pyx_t_2 = PyTuple_New(8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_18 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_15 = 0; + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":100 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * result[i] = dt + tz.utcoffset(dt) # <<<<<<<<<<<<<< + * else: + * trans = _get_transitions(tz) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_dt)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_dt)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_dt)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_dt), __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_24 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L10:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":102 + * result[i] = dt + tz.utcoffset(dt) + * else: + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * for i in range(n): + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_trans = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":103 + * else: + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * for i in range(n): + * + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_deltas = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":104 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * for i in range(n): # <<<<<<<<<<<<<< + * + * if arr[i] == iNaT: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":106 + * for i in range(n): + * + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":107 + * + * if arr[i] == iNaT: + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_26 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/tslib.pyx":111 + * + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(arr[i], side='right') - 1 # <<<<<<<<<<<<<< + * if _treat_tz_as_pytz(tz): + * # find right representation of dst etc in pytz timezone + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_27 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":112 + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(arr[i], side='right') - 1 + * if _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * # find right representation of dst etc in pytz timezone + * new_tz = tz._tzinfos[tz._transition_info[pos]] + */ + __pyx_t_20 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":114 + * if _treat_tz_as_pytz(tz): + * # find right representation of dst etc in pytz timezone + * new_tz = tz._tzinfos[tz._transition_info[pos]] # <<<<<<<<<<<<<< + * else: + * # no zone-name change for dateutil tzs - dst etc represented in single object. + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_tzinfos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_v_pos); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetItem(__pyx_t_4, __pyx_t_2); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_tz, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/tslib.pyx":117 + * else: + * # no zone-name change for dateutil tzs - dst etc represented in single object. + * new_tz = tz # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_XDECREF_SET(__pyx_v_new_tz, __pyx_v_tz); + } + __pyx_L14:; + + /* "pandas/tslib.pyx":119 + * new_tz = tz + * + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_29 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_29 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":120 + * + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, + */ + pandas_datetime_to_datetimestruct(__pyx_t_29, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":121 + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], + * PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, + * new_tz) + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":122 + * PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, # <<<<<<<<<<<<<< + * new_tz) + * else: + */ + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + + /* "pandas/tslib.pyx":121 + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], + * PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, + * new_tz) + */ + __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_new_tz); + PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_v_new_tz); + __Pyx_GIVEREF(__pyx_v_new_tz); + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_15 = 0; + __pyx_t_17 = 0; + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_30 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_16); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_16; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + __pyx_L13:; + } + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":125 + * new_tz) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if arr[i] == iNaT: + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":126 + * else: + * for i in range(n): + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_17 = PyObject_RichCompare(__pyx_t_16, __pyx_t_18, Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":127 + * for i in range(n): + * if arr[i] == iNaT: + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_32 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_18); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_18; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/tslib.pyx":129 + * result[i] = np.nan + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_arr.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":130 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us) + * + */ + __pyx_t_18 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/tslib.pyx":131 + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":130 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us) + * + */ + __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_18 = 0; + __pyx_t_17 = 0; + __pyx_t_16 = 0; + __pyx_t_15 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_34 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L17:; + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":133 + * dts.min, dts.sec, dts.us) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":77 + * basestring = str + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_trans); + __Pyx_XDECREF(__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pos); + __Pyx_XDECREF(__pyx_v_new_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":136 + * + * + * cdef inline bint _is_tzlocal(object tz): # <<<<<<<<<<<<<< + * return isinstance(tz, _dateutil_tzlocal) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_tzlocal(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_tzlocal", 0); + + /* "pandas/tslib.pyx":137 + * + * cdef inline bint _is_tzlocal(object tz): + * return isinstance(tz, _dateutil_tzlocal) # <<<<<<<<<<<<<< + * + * cdef inline bint _is_fixed_offset(object tz): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_tzlocal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "pandas/tslib.pyx":136 + * + * + * cdef inline bint _is_tzlocal(object tz): # <<<<<<<<<<<<<< + * return isinstance(tz, _dateutil_tzlocal) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("pandas.tslib._is_tzlocal", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":139 + * return isinstance(tz, _dateutil_tzlocal) + * + * cdef inline bint _is_fixed_offset(object tz): # <<<<<<<<<<<<<< + * if _treat_tz_as_dateutil(tz): + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_fixed_offset(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_fixed_offset", 0); + + /* "pandas/tslib.pyx":140 + * + * cdef inline bint _is_fixed_offset(object tz): + * if _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: + * return 1 + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":141 + * cdef inline bint _is_fixed_offset(object tz): + * if _treat_tz_as_dateutil(tz): + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: # <<<<<<<<<<<<<< + * return 1 + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_idx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = ((__pyx_t_3 == 0) != 0); + if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((__pyx_t_3 == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":142 + * if _treat_tz_as_dateutil(tz): + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: + * return 1 # <<<<<<<<<<<<<< + * else: + * return 0 + */ + __pyx_r = 1; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":144 + * return 1 + * else: + * return 0 # <<<<<<<<<<<<<< + * elif _treat_tz_as_pytz(tz): + * if len(tz._transition_info) == 0 and len(tz._utc_transition_times) == 0: + */ + __pyx_r = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":145 + * else: + * return 0 + * elif _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * if len(tz._transition_info) == 0 and len(tz._utc_transition_times) == 0: + * return 1 + */ + __pyx_t_5 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":146 + * return 0 + * elif _treat_tz_as_pytz(tz): + * if len(tz._transition_info) == 0 and len(tz._utc_transition_times) == 0: # <<<<<<<<<<<<<< + * return 1 + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((__pyx_t_3 == 0) != 0); + if (__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utc_transition_times); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = ((__pyx_t_3 == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":147 + * elif _treat_tz_as_pytz(tz): + * if len(tz._transition_info) == 0 and len(tz._utc_transition_times) == 0: + * return 1 # <<<<<<<<<<<<<< + * else: + * return 0 + */ + __pyx_r = 1; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":149 + * return 1 + * else: + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":150 + * else: + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "pandas/tslib.pyx":139 + * return isinstance(tz, _dateutil_tzlocal) + * + * cdef inline bint _is_fixed_offset(object tz): # <<<<<<<<<<<<<< + * if _treat_tz_as_dateutil(tz): + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.tslib._is_fixed_offset", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":165 + * + * @classmethod + * def fromordinal(cls, ordinal, offset=None, tz=None): # <<<<<<<<<<<<<< + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_1fromordinal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_fromordinal[] = " passed an ordinal, translate and convert to a ts\n note: by definition there cannot be any tz info on the ordinal itself "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_1fromordinal = {__Pyx_NAMESTR("fromordinal"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_1fromordinal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_fromordinal)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_1fromordinal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_ordinal = 0; + PyObject *__pyx_v_offset = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fromordinal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_ordinal,&__pyx_n_s_offset,&__pyx_n_s_tz,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_None)); + values[3] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ordinal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fromordinal", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fromordinal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_ordinal = values[1]; + __pyx_v_offset = values[2]; + __pyx_v_tz = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fromordinal", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.fromordinal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_fromordinal(__pyx_self, __pyx_v_cls, __pyx_v_ordinal, __pyx_v_offset, __pyx_v_tz); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_fromordinal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ordinal, PyObject *__pyx_v_offset, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fromordinal", 0); + + /* "pandas/tslib.pyx":168 + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + * return cls(datetime.fromordinal(ordinal),offset=offset,tz=tz) # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_fromordinal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_ordinal); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ordinal); + __Pyx_GIVEREF(__pyx_v_ordinal); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_offset, __pyx_v_offset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":165 + * + * @classmethod + * def fromordinal(cls, ordinal, offset=None, tz=None): # <<<<<<<<<<<<<< + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp.fromordinal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":171 + * + * @classmethod + * def now(cls, tz=None): # <<<<<<<<<<<<<< + * """ compat now with datetime """ + * if isinstance(tz, basestring): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_3now(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_2now[] = " compat now with datetime "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_3now = {__Pyx_NAMESTR("now"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_3now, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_2now)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_3now(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("now (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "now") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("now", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_2now(__pyx_self, __pyx_v_cls, __pyx_v_tz); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_2now(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("now", 0); + __Pyx_INCREF(__pyx_v_tz); + + /* "pandas/tslib.pyx":173 + * def now(cls, tz=None): + * """ compat now with datetime """ + * if isinstance(tz, basestring): # <<<<<<<<<<<<<< + * tz = maybe_get_tz(tz) + * return cls(datetime.now(tz)) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":174 + * """ compat now with datetime """ + * if isinstance(tz, basestring): + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * return cls(datetime.now(tz)) + * + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":175 + * if isinstance(tz, basestring): + * tz = maybe_get_tz(tz) + * return cls(datetime.now(tz)) # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":171 + * + * @classmethod + * def now(cls, tz=None): # <<<<<<<<<<<<<< + * """ compat now with datetime """ + * if isinstance(tz, basestring): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":178 + * + * @classmethod + * def today(cls): # <<<<<<<<<<<<<< + * """ compat today with datetime """ + * return cls(datetime.today()) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_5today(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_4today[] = " compat today with datetime "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_5today = {__Pyx_NAMESTR("today"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_5today, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_4today)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_5today(PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("today (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_4today(__pyx_self, ((PyObject *)__pyx_v_cls)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_4today(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("today", 0); + + /* "pandas/tslib.pyx":180 + * def today(cls): + * """ compat today with datetime """ + * return cls(datetime.today()) # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_today); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":178 + * + * @classmethod + * def today(cls): # <<<<<<<<<<<<<< + * """ compat today with datetime """ + * return cls(datetime.today()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.today", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":183 + * + * @classmethod + * def utcnow(cls): # <<<<<<<<<<<<<< + * return cls.now('UTC') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_7utcnow(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_7utcnow = {__Pyx_NAMESTR("utcnow"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_7utcnow, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_7utcnow(PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("utcnow (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_6utcnow(__pyx_self, ((PyObject *)__pyx_v_cls)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_6utcnow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("utcnow", 0); + + /* "pandas/tslib.pyx":184 + * @classmethod + * def utcnow(cls): + * return cls.now('UTC') # <<<<<<<<<<<<<< + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":183 + * + * @classmethod + * def utcnow(cls): # <<<<<<<<<<<<<< + * return cls.now('UTC') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.utcnow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":186 + * return cls.now('UTC') + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): # <<<<<<<<<<<<<< + * cdef _TSObject ts + * cdef _Timestamp ts_base + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_9__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_9__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_9__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_9__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_ts_input = 0; + PyObject *__pyx_v_offset = 0; + PyObject *__pyx_v_tz = 0; + PyObject *__pyx_v_unit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_ts_input,&__pyx_n_s_offset,&__pyx_n_s_tz,&__pyx_n_s_unit,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_None)); + values[3] = ((PyObject *)((PyObject *)Py_None)); + values[4] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ts_input)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_ts_input = values[1]; + __pyx_v_offset = values[2]; + __pyx_v_tz = values[3]; + __pyx_v_unit = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_8__new__(__pyx_self, __pyx_v_cls, __pyx_v_ts_input, __pyx_v_offset, __pyx_v_tz, __pyx_v_unit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_8__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ts_input, PyObject *__pyx_v_offset, PyObject *__pyx_v_tz, PyObject *__pyx_v_unit) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_ts_base = 0; + PyObject *__pyx_v_to_offset = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + __Pyx_INCREF(__pyx_v_ts_input); + __Pyx_INCREF(__pyx_v_offset); + + /* "pandas/tslib.pyx":190 + * cdef _Timestamp ts_base + * + * if util.is_string_object(ts_input): # <<<<<<<<<<<<<< + * try: + * ts_input = parse_date(ts_input) + */ + __pyx_t_1 = (is_string_object(__pyx_v_ts_input) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":191 + * + * if util.is_string_object(ts_input): + * try: # <<<<<<<<<<<<<< + * ts_input = parse_date(ts_input) + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/tslib.pyx":192 + * if util.is_string_object(ts_input): + * try: + * ts_input = parse_date(ts_input) # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_date); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_ts_input); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts_input); + __Pyx_GIVEREF(__pyx_v_ts_input); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_ts_input, __pyx_t_7); + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":193 + * try: + * ts_input = parse_date(ts_input) + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + PyErr_Restore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":196 + * pass + * + * ts = convert_to_tsobject(ts_input, tz, unit) # <<<<<<<<<<<<<< + * + * if ts.value == NPY_NAT: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_ts_input, __pyx_v_tz, __pyx_v_unit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":198 + * ts = convert_to_tsobject(ts_input, tz, unit) + * + * if ts.value == NPY_NAT: # <<<<<<<<<<<<<< + * return NaT + * + */ + __pyx_t_1 = ((__pyx_v_ts->value == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":199 + * + * if ts.value == NPY_NAT: + * return NaT # <<<<<<<<<<<<<< + * + * if util.is_string_object(offset): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":201 + * return NaT + * + * if util.is_string_object(offset): # <<<<<<<<<<<<<< + * from pandas.tseries.frequencies import to_offset + * offset = to_offset(offset) + */ + __pyx_t_1 = (is_string_object(__pyx_v_offset) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":202 + * + * if util.is_string_object(offset): + * from pandas.tseries.frequencies import to_offset # <<<<<<<<<<<<<< + * offset = to_offset(offset) + * + */ + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_n_s_to_offset); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_to_offset); + __Pyx_GIVEREF(__pyx_n_s_to_offset); + __pyx_t_6 = __Pyx_Import(__pyx_n_s_pandas_tseries_frequencies, __pyx_t_7, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_to_offset); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_to_offset = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":203 + * if util.is_string_object(offset): + * from pandas.tseries.frequencies import to_offset + * offset = to_offset(offset) # <<<<<<<<<<<<<< + * + * # make datetime happy + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_offset); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_offset); + __Pyx_GIVEREF(__pyx_v_offset); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_to_offset, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_offset, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/tslib.pyx":206 + * + * # make datetime happy + * ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month, # <<<<<<<<<<<<<< + * ts.dts.day, ts.dts.hour, ts.dts.min, + * ts.dts.sec, ts.dts.us, ts.tzinfo) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp)), __pyx_n_s_new); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_ts->dts.year); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":207 + * # make datetime happy + * ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month, + * ts.dts.day, ts.dts.hour, ts.dts.min, # <<<<<<<<<<<<<< + * ts.dts.sec, ts.dts.us, ts.tzinfo) + * + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.day); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.hour); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.min); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/tslib.pyx":208 + * ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month, + * ts.dts.day, ts.dts.hour, ts.dts.min, + * ts.dts.sec, ts.dts.us, ts.tzinfo) # <<<<<<<<<<<<<< + * + * # fill out rest of data + */ + __pyx_t_12 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.sec); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.us); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + + /* "pandas/tslib.pyx":206 + * + * # make datetime happy + * ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month, # <<<<<<<<<<<<<< + * ts.dts.day, ts.dts.hour, ts.dts.min, + * ts.dts.sec, ts.dts.us, ts.tzinfo) + */ + __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_ts->tzinfo); + PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_v_ts->tzinfo); + __Pyx_GIVEREF(__pyx_v_ts->tzinfo); + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_6pandas_5tslib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts_base = ((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/tslib.pyx":211 + * + * # fill out rest of data + * ts_base.value = ts.value # <<<<<<<<<<<<<< + * ts_base.offset = offset + * ts_base.nanosecond = ts.dts.ps / 1000 + */ + __pyx_t_15 = __pyx_v_ts->value; + __pyx_v_ts_base->value = __pyx_t_15; + + /* "pandas/tslib.pyx":212 + * # fill out rest of data + * ts_base.value = ts.value + * ts_base.offset = offset # <<<<<<<<<<<<<< + * ts_base.nanosecond = ts.dts.ps / 1000 + * + */ + __Pyx_INCREF(__pyx_v_offset); + __Pyx_GIVEREF(__pyx_v_offset); + __Pyx_GOTREF(__pyx_v_ts_base->offset); + __Pyx_DECREF(__pyx_v_ts_base->offset); + __pyx_v_ts_base->offset = __pyx_v_offset; + + /* "pandas/tslib.pyx":213 + * ts_base.value = ts.value + * ts_base.offset = offset + * ts_base.nanosecond = ts.dts.ps / 1000 # <<<<<<<<<<<<<< + * + * return ts_base + */ + __pyx_v_ts_base->nanosecond = __Pyx_div_long(__pyx_v_ts->dts.ps, 1000); + + /* "pandas/tslib.pyx":215 + * ts_base.nanosecond = ts.dts.ps / 1000 + * + * return ts_base # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ts_base)); + __pyx_r = ((PyObject *)__pyx_v_ts_base); + goto __pyx_L0; + + /* "pandas/tslib.pyx":186 + * return cls.now('UTC') + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): # <<<<<<<<<<<<<< + * cdef _TSObject ts + * cdef _Timestamp ts_base + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("pandas.tslib.Timestamp.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XDECREF((PyObject *)__pyx_v_ts_base); + __Pyx_XDECREF(__pyx_v_to_offset); + __Pyx_XDECREF(__pyx_v_ts_input); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":217 + * return ts_base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * stamp = self._repr_base + * zone = None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_11__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_11__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_11__repr__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_11__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_10__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_stamp = NULL; + PyObject *__pyx_v_zone = NULL; + PyObject *__pyx_v_year2000 = NULL; + PyObject *__pyx_v_tz = NULL; + PyObject *__pyx_v_offset = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "pandas/tslib.pyx":218 + * + * def __repr__(self): + * stamp = self._repr_base # <<<<<<<<<<<<<< + * zone = None + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_repr_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_stamp = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":219 + * def __repr__(self): + * stamp = self._repr_base + * zone = None # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_INCREF(Py_None); + __pyx_v_zone = Py_None; + + /* "pandas/tslib.pyx":221 + * zone = None + * + * try: # <<<<<<<<<<<<<< + * stamp += self.strftime('%z') + * if self.tzinfo: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/tslib.pyx":222 + * + * try: + * stamp += self.strftime('%z') # <<<<<<<<<<<<<< + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_strftime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_stamp, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_stamp, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":223 + * try: + * stamp += self.strftime('%z') + * if self.tzinfo: # <<<<<<<<<<<<<< + * zone = _get_zone(self.tzinfo) + * except ValueError: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":224 + * stamp += self.strftime('%z') + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) # <<<<<<<<<<<<<< + * except ValueError: + * year2000 = self.replace(year=2000) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __pyx_f_6pandas_5tslib__get_zone(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_zone, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L11; + } + __pyx_L11:; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":225 + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + * except ValueError: # <<<<<<<<<<<<<< + * year2000 = self.replace(year=2000) + * stamp += year2000.strftime('%z') + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.tslib.Timestamp.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/tslib.pyx":226 + * zone = _get_zone(self.tzinfo) + * except ValueError: + * year2000 = self.replace(year=2000) # <<<<<<<<<<<<<< + * stamp += year2000.strftime('%z') + * if self.tzinfo: + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_replace); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_year, __pyx_int_2000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_year2000 = __pyx_t_11; + __pyx_t_11 = 0; + + /* "pandas/tslib.pyx":227 + * except ValueError: + * year2000 = self.replace(year=2000) + * stamp += year2000.strftime('%z') # <<<<<<<<<<<<<< + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_year2000, __pyx_n_s_strftime); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_stamp, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_v_stamp, __pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/tslib.pyx":228 + * year2000 = self.replace(year=2000) + * stamp += year2000.strftime('%z') + * if self.tzinfo: # <<<<<<<<<<<<<< + * zone = _get_zone(self.tzinfo) + * + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":229 + * stamp += year2000.strftime('%z') + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __pyx_f_6pandas_5tslib__get_zone(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_zone, __pyx_t_10); + __pyx_t_10 = 0; + goto __pyx_L14; + } + __pyx_L14:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":231 + * zone = _get_zone(self.tzinfo) + * + * try: # <<<<<<<<<<<<<< + * stamp += zone.strftime(' %%Z') + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + /*try:*/ { + + /* "pandas/tslib.pyx":232 + * + * try: + * stamp += zone.strftime(' %%Z') # <<<<<<<<<<<<<< + * except: + * pass + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_zone, __pyx_n_s_strftime); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_stamp, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_stamp, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L22_try_end; + __pyx_L15_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":233 + * try: + * stamp += zone.strftime(' %%Z') + * except: # <<<<<<<<<<<<<< + * pass + * + */ + /*except:*/ { + PyErr_Restore(0,0,0); + goto __pyx_L16_exception_handled; + } + __pyx_L16_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2); + __pyx_L22_try_end:; + } + + /* "pandas/tslib.pyx":236 + * pass + * + * tz = ", tz='{0}'".format(zone) if zone is not None and not isinstance(zone, tzoffset) else "" # <<<<<<<<<<<<<< + * offset = ", offset='{0}'".format(self.offset.freqstr) if self.offset is not None else "" + * + */ + __pyx_t_6 = (__pyx_v_zone != Py_None); + if ((__pyx_t_6 != 0)) { + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tzoffset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = PyObject_IsInstance(__pyx_v_zone, __pyx_t_1); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0); + __pyx_t_12 = __pyx_t_13; + } else { + __pyx_t_12 = (__pyx_t_6 != 0); + } + if (__pyx_t_12) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_tz_0, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_zone); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_zone); + __Pyx_GIVEREF(__pyx_v_zone); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_t_8 = __pyx_kp_s__5; + } + __pyx_v_tz = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":237 + * + * tz = ", tz='{0}'".format(zone) if zone is not None and not isinstance(zone, tzoffset) else "" + * offset = ", offset='{0}'".format(self.offset.freqstr) if self.offset is not None else "" # <<<<<<<<<<<<<< + * + * return "Timestamp('{stamp}'{tz}{offset})".format(stamp=stamp, tz=tz, offset=offset) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = (__pyx_t_10 != Py_None); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if ((__pyx_t_12 != 0)) { + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_offset_0, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_freqstr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_t_8 = __pyx_kp_s__5; + } + __pyx_v_offset = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":239 + * offset = ", offset='{0}'".format(self.offset.freqstr) if self.offset is not None else "" + * + * return "Timestamp('{stamp}'{tz}{offset})".format(stamp=stamp, tz=tz, offset=offset) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Timestamp_stamp_tz_offset, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stamp, __pyx_v_stamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tz, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_offset, __pyx_v_offset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":217 + * return ts_base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * stamp = self._repr_base + * zone = None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.tslib.Timestamp.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_stamp); + __Pyx_XDECREF(__pyx_v_zone); + __Pyx_XDECREF(__pyx_v_year2000); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":242 + * + * @property + * def _date_repr(self): # <<<<<<<<<<<<<< + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_13_date_repr(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_13_date_repr = {__Pyx_NAMESTR("_date_repr"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_13_date_repr, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_13_date_repr(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_date_repr (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_12_date_repr(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_12_date_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_repr", 0); + + /* "pandas/tslib.pyx":245 + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + * return '%d-%.2d-%.2d' % (self.year, self.month, self.day) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_day); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_d_2d_2d, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":242 + * + * @property + * def _date_repr(self): # <<<<<<<<<<<<<< + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.Timestamp._date_repr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":248 + * + * @property + * def _time_repr(self): # <<<<<<<<<<<<<< + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_15_time_repr(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_15_time_repr = {__Pyx_NAMESTR("_time_repr"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_15_time_repr, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_15_time_repr(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_time_repr (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_14_time_repr(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_14_time_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_nanos = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_time_repr", 0); + + /* "pandas/tslib.pyx":249 + * @property + * def _time_repr(self): + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) # <<<<<<<<<<<<<< + * + * if self.nanosecond != 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minute); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_second); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_2d_2d_2d, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":251 + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + * if self.nanosecond != 0: # <<<<<<<<<<<<<< + * nanos = self.nanosecond + 1000 * self.microsecond + * result += '.%.9d' % nanos + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":252 + * + * if self.nanosecond != 0: + * nanos = self.nanosecond + 1000 * self.microsecond # <<<<<<<<<<<<<< + * result += '.%.9d' % nanos + * elif self.microsecond != 0: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Multiply(__pyx_int_1000, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nanos = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":253 + * if self.nanosecond != 0: + * nanos = self.nanosecond + 1000 * self.microsecond + * result += '.%.9d' % nanos # <<<<<<<<<<<<<< + * elif self.microsecond != 0: + * result += '.%.6d' % self.microsecond + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_9d, __pyx_v_nanos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":254 + * nanos = self.nanosecond + 1000 * self.microsecond + * result += '.%.9d' % nanos + * elif self.microsecond != 0: # <<<<<<<<<<<<<< + * result += '.%.6d' % self.microsecond + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":255 + * result += '.%.9d' % nanos + * elif self.microsecond != 0: + * result += '.%.6d' % self.microsecond # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_6d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":257 + * result += '.%.6d' % self.microsecond + * + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":248 + * + * @property + * def _time_repr(self): # <<<<<<<<<<<<<< + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.Timestamp._time_repr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_nanos); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":260 + * + * @property + * def _repr_base(self): # <<<<<<<<<<<<<< + * return '%s %s' % (self._date_repr, self._time_repr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_17_repr_base(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_17_repr_base = {__Pyx_NAMESTR("_repr_base"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_17_repr_base, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_17_repr_base(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_repr_base (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_16_repr_base(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_16_repr_base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_repr_base", 0); + + /* "pandas/tslib.pyx":261 + * @property + * def _repr_base(self): + * return '%s %s' % (self._date_repr, self._time_repr) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_date_repr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_time_repr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":260 + * + * @property + * def _repr_base(self): # <<<<<<<<<<<<<< + * return '%s %s' % (self._date_repr, self._time_repr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp._repr_base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":264 + * + * @property + * def tz(self): # <<<<<<<<<<<<<< + * """ + * Alias for tzinfo + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_19tz(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_18tz[] = "\n Alias for tzinfo\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_19tz = {__Pyx_NAMESTR("tz"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_19tz, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_18tz)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_19tz(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_18tz(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_18tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz", 0); + + /* "pandas/tslib.pyx":268 + * Alias for tzinfo + * """ + * return self.tzinfo # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":264 + * + * @property + * def tz(self): # <<<<<<<<<<<<<< + * """ + * Alias for tzinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":271 + * + * @property + * def freq(self): # <<<<<<<<<<<<<< + * return self.offset + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_21freq(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_21freq = {__Pyx_NAMESTR("freq"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_21freq, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_21freq(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("freq (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_20freq(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_20freq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("freq", 0); + + /* "pandas/tslib.pyx":272 + * @property + * def freq(self): + * return self.offset # <<<<<<<<<<<<<< + * + * def __setstate__(self, state): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":271 + * + * @property + * def freq(self): # <<<<<<<<<<<<<< + * return self.offset + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.Timestamp.freq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":274 + * return self.offset + * + * def __setstate__(self, state): # <<<<<<<<<<<<<< + * self.value = state[0] + * self.offset = state[1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_23__setstate__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_23__setstate__ = {__Pyx_NAMESTR("__setstate__"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_23__setstate__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_23__setstate__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_state,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setstate__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_state = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_22__setstate__(__pyx_self, __pyx_v_self, __pyx_v_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_22__setstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate__", 0); + + /* "pandas/tslib.pyx":275 + * + * def __setstate__(self, state): + * self.value = state[0] # <<<<<<<<<<<<<< + * self.offset = state[1] + * self.tzinfo = state[2] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":276 + * def __setstate__(self, state): + * self.value = state[0] + * self.offset = state[1] # <<<<<<<<<<<<<< + * self.tzinfo = state[2] + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":277 + * self.value = state[0] + * self.offset = state[1] + * self.tzinfo = state[2] # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":274 + * return self.offset + * + * def __setstate__(self, state): # <<<<<<<<<<<<<< + * self.value = state[0] + * self.offset = state[1] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.Timestamp.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":279 + * self.tzinfo = state[2] + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_25__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_25__reduce__ = {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_25__reduce__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_25__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_24__reduce__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_24__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_object_state = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "pandas/tslib.pyx":280 + * + * def __reduce__(self): + * object_state = self.value, self.offset, self.tzinfo # <<<<<<<<<<<<<< + * return (Timestamp, object_state) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_v_object_state = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":281 + * def __reduce__(self): + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) # <<<<<<<<<<<<<< + * + * def to_period(self, freq=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_object_state); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_object_state); + __Pyx_GIVEREF(__pyx_v_object_state); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":279 + * self.tzinfo = state[2] + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.Timestamp.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_object_state); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":283 + * return (Timestamp, object_state) + * + * def to_period(self, freq=None): # <<<<<<<<<<<<<< + * """ + * Return an period of which this timestamp is an observation. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_27to_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_26to_period[] = "\n Return an period of which this timestamp is an observation.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_27to_period = {__Pyx_NAMESTR("to_period"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_27to_period, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_26to_period)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_27to_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_freq = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_period (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_freq,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_period") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_freq = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("to_period", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_26to_period(__pyx_self, __pyx_v_self, __pyx_v_freq); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_26to_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_freq) { + PyObject *__pyx_v_Period = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_period", 0); + __Pyx_INCREF(__pyx_v_freq); + + /* "pandas/tslib.pyx":287 + * Return an period of which this timestamp is an observation. + * """ + * from pandas.tseries.period import Period # <<<<<<<<<<<<<< + * + * if freq is None: + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Period); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Period); + __Pyx_GIVEREF(__pyx_n_s_Period); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas_tseries_period, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Period); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_Period = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":289 + * from pandas.tseries.period import Period + * + * if freq is None: # <<<<<<<<<<<<<< + * freq = self.freq + * + */ + __pyx_t_3 = (__pyx_v_freq == Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":290 + * + * if freq is None: + * freq = self.freq # <<<<<<<<<<<<<< + * + * return Period(self, freq=freq) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_freq, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":292 + * freq = self.freq + * + * return Period(self, freq=freq) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_freq, __pyx_v_freq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_Period, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":283 + * return (Timestamp, object_state) + * + * def to_period(self, freq=None): # <<<<<<<<<<<<<< + * """ + * Return an period of which this timestamp is an observation. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Period); + __Pyx_XDECREF(__pyx_v_freq); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":295 + * + * @property + * def dayofweek(self): # <<<<<<<<<<<<<< + * return self.weekday() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_29dayofweek(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_29dayofweek = {__Pyx_NAMESTR("dayofweek"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_29dayofweek, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_29dayofweek(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dayofweek (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_28dayofweek(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_28dayofweek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dayofweek", 0); + + /* "pandas/tslib.pyx":296 + * @property + * def dayofweek(self): + * return self.weekday() # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_weekday); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":295 + * + * @property + * def dayofweek(self): # <<<<<<<<<<<<<< + * return self.weekday() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.dayofweek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":299 + * + * @property + * def dayofyear(self): # <<<<<<<<<<<<<< + * return self._get_field('doy') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_31dayofyear(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_31dayofyear = {__Pyx_NAMESTR("dayofyear"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_31dayofyear, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_31dayofyear(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dayofyear (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_30dayofyear(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_30dayofyear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dayofyear", 0); + + /* "pandas/tslib.pyx":300 + * @property + * def dayofyear(self): + * return self._get_field('doy') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":299 + * + * @property + * def dayofyear(self): # <<<<<<<<<<<<<< + * return self._get_field('doy') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.dayofyear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":303 + * + * @property + * def week(self): # <<<<<<<<<<<<<< + * return self._get_field('woy') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_33week(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_33week = {__Pyx_NAMESTR("week"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_33week, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_33week(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("week (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_32week(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_32week(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("week", 0); + + /* "pandas/tslib.pyx":304 + * @property + * def week(self): + * return self._get_field('woy') # <<<<<<<<<<<<<< + * + * weekofyear = week + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":303 + * + * @property + * def week(self): # <<<<<<<<<<<<<< + * return self._get_field('woy') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.week", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":309 + * + * @property + * def quarter(self): # <<<<<<<<<<<<<< + * return self._get_field('q') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_35quarter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_35quarter = {__Pyx_NAMESTR("quarter"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_35quarter, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_35quarter(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("quarter (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_34quarter(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_34quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("quarter", 0); + + /* "pandas/tslib.pyx":310 + * @property + * def quarter(self): + * return self._get_field('q') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":309 + * + * @property + * def quarter(self): # <<<<<<<<<<<<<< + * return self._get_field('q') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.quarter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":313 + * + * @property + * def freqstr(self): # <<<<<<<<<<<<<< + * return getattr(self.offset, 'freqstr', self.offset) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_37freqstr(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_37freqstr = {__Pyx_NAMESTR("freqstr"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_37freqstr, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_37freqstr(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("freqstr (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_36freqstr(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_36freqstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("freqstr", 0); + + /* "pandas/tslib.pyx":314 + * @property + * def freqstr(self): + * return getattr(self.offset, 'freqstr', self.offset) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_freqstr, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":313 + * + * @property + * def freqstr(self): # <<<<<<<<<<<<<< + * return getattr(self.offset, 'freqstr', self.offset) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp.freqstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":317 + * + * @property + * def asm8(self): # <<<<<<<<<<<<<< + * return np.int64(self.value).view('M8[ns]') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_39asm8(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_39asm8 = {__Pyx_NAMESTR("asm8"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_39asm8, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_39asm8(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("asm8 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_38asm8(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_38asm8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("asm8", 0); + + /* "pandas/tslib.pyx":318 + * @property + * def asm8(self): + * return np.int64(self.value).view('M8[ns]') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":317 + * + * @property + * def asm8(self): # <<<<<<<<<<<<<< + * return np.int64(self.value).view('M8[ns]') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp.asm8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":321 + * + * @property + * def is_month_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_start') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_41is_month_start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_41is_month_start = {__Pyx_NAMESTR("is_month_start"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_41is_month_start, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_41is_month_start(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_month_start (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_40is_month_start(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_40is_month_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_month_start", 0); + + /* "pandas/tslib.pyx":322 + * @property + * def is_month_start(self): + * return self._get_start_end_field('is_month_start') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":321 + * + * @property + * def is_month_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_start') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_month_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":325 + * + * @property + * def is_month_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_end') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_43is_month_end(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_43is_month_end = {__Pyx_NAMESTR("is_month_end"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_43is_month_end, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_43is_month_end(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_month_end (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_42is_month_end(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_42is_month_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_month_end", 0); + + /* "pandas/tslib.pyx":326 + * @property + * def is_month_end(self): + * return self._get_start_end_field('is_month_end') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":325 + * + * @property + * def is_month_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_end') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_month_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":329 + * + * @property + * def is_quarter_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_start') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_45is_quarter_start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_45is_quarter_start = {__Pyx_NAMESTR("is_quarter_start"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_45is_quarter_start, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_45is_quarter_start(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_quarter_start (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_44is_quarter_start(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_44is_quarter_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_quarter_start", 0); + + /* "pandas/tslib.pyx":330 + * @property + * def is_quarter_start(self): + * return self._get_start_end_field('is_quarter_start') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":329 + * + * @property + * def is_quarter_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_start') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_quarter_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":333 + * + * @property + * def is_quarter_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_end') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_47is_quarter_end(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_47is_quarter_end = {__Pyx_NAMESTR("is_quarter_end"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_47is_quarter_end, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_47is_quarter_end(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_quarter_end (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_46is_quarter_end(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_46is_quarter_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_quarter_end", 0); + + /* "pandas/tslib.pyx":334 + * @property + * def is_quarter_end(self): + * return self._get_start_end_field('is_quarter_end') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":333 + * + * @property + * def is_quarter_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_end') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_quarter_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":337 + * + * @property + * def is_year_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_start') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_49is_year_start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_49is_year_start = {__Pyx_NAMESTR("is_year_start"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_49is_year_start, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_49is_year_start(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_year_start (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_48is_year_start(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_48is_year_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_year_start", 0); + + /* "pandas/tslib.pyx":338 + * @property + * def is_year_start(self): + * return self._get_start_end_field('is_year_start') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":337 + * + * @property + * def is_year_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_start') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_year_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":341 + * + * @property + * def is_year_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_end') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_51is_year_end(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_51is_year_end = {__Pyx_NAMESTR("is_year_end"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_51is_year_end, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_51is_year_end(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_year_end (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_50is_year_end(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_50is_year_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_year_end", 0); + + /* "pandas/tslib.pyx":342 + * @property + * def is_year_end(self): + * return self._get_start_end_field('is_year_end') # <<<<<<<<<<<<<< + * + * def tz_localize(self, tz, infer_dst=False): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":341 + * + * @property + * def is_year_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_end') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_year_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":344 + * return self._get_start_end_field('is_year_end') + * + * def tz_localize(self, tz, infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Convert naive Timestamp to local time zone + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_53tz_localize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_52tz_localize[] = "\n Convert naive Timestamp to local time zone\n\n Parameters\n ----------\n tz : pytz.timezone or dateutil.tz.tzfile\n infer_dst : boolean, default False\n Attempt to infer fall dst-transition hours based on order\n\n Returns\n -------\n localized : Timestamp\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_53tz_localize = {__Pyx_NAMESTR("tz_localize"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_53tz_localize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_52tz_localize)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_53tz_localize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_tz = 0; + PyObject *__pyx_v_infer_dst = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_localize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_tz,&__pyx_n_s_infer_dst,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_localize", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infer_dst); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_localize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_tz = values[1]; + __pyx_v_infer_dst = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_localize", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_52tz_localize(__pyx_self, __pyx_v_self, __pyx_v_tz, __pyx_v_infer_dst); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_52tz_localize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz, PyObject *__pyx_v_infer_dst) { + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_localize", 0); + __Pyx_INCREF(__pyx_v_tz); + + /* "pandas/tslib.pyx":358 + * localized : Timestamp + * """ + * if self.tzinfo is None: # <<<<<<<<<<<<<< + * # tz naive, localize + * tz = maybe_get_tz(tz) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":360 + * if self.tzinfo is None: + * # tz naive, localize + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * value = tz_localize_to_utc(np.array([self.value]), tz, + * infer_dst=infer_dst)[0] + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":361 + * # tz naive, localize + * tz = maybe_get_tz(tz) + * value = tz_localize_to_utc(np.array([self.value]), tz, # <<<<<<<<<<<<<< + * infer_dst=infer_dst)[0] + * return Timestamp(value, tz=tz) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tz_localize_to_utc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/tslib.pyx":362 + * tz = maybe_get_tz(tz) + * value = tz_localize_to_utc(np.array([self.value]), tz, + * infer_dst=infer_dst)[0] # <<<<<<<<<<<<<< + * return Timestamp(value, tz=tz) + * else: + */ + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_infer_dst, __pyx_v_infer_dst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":361 + * # tz naive, localize + * tz = maybe_get_tz(tz) + * value = tz_localize_to_utc(np.array([self.value]), tz, # <<<<<<<<<<<<<< + * infer_dst=infer_dst)[0] + * return Timestamp(value, tz=tz) + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":362 + * tz = maybe_get_tz(tz) + * value = tz_localize_to_utc(np.array([self.value]), tz, + * infer_dst=infer_dst)[0] # <<<<<<<<<<<<<< + * return Timestamp(value, tz=tz) + * else: + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":363 + * value = tz_localize_to_utc(np.array([self.value]), tz, + * infer_dst=infer_dst)[0] + * return Timestamp(value, tz=tz) # <<<<<<<<<<<<<< + * else: + * raise Exception('Cannot localize tz-aware Timestamp, use ' + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tz, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":365 + * return Timestamp(value, tz=tz) + * else: + * raise Exception('Cannot localize tz-aware Timestamp, use ' # <<<<<<<<<<<<<< + * 'tz_convert for conversions') + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":344 + * return self._get_start_end_field('is_year_end') + * + * def tz_localize(self, tz, infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Convert naive Timestamp to local time zone + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":368 + * 'tz_convert for conversions') + * + * def tz_convert(self, tz): # <<<<<<<<<<<<<< + * """ + * Convert Timestamp to another time zone or localize to requested time + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_55tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_54tz_convert[] = "\n Convert Timestamp to another time zone or localize to requested time\n zone\n\n Parameters\n ----------\n tz : pytz.timezone or dateutil.tz.tzfile\n\n Returns\n -------\n converted : Timestamp\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_55tz_convert = {__Pyx_NAMESTR("tz_convert"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_55tz_convert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_54tz_convert)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_55tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_convert (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_convert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_54tz_convert(__pyx_self, __pyx_v_self, __pyx_v_tz); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_54tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_convert", 0); + + /* "pandas/tslib.pyx":381 + * converted : Timestamp + * """ + * if self.tzinfo is None: # <<<<<<<<<<<<<< + * # tz naive, use tz_localize + * raise Exception('Cannot convert tz-naive Timestamp, use ' + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":383 + * if self.tzinfo is None: + * # tz naive, use tz_localize + * raise Exception('Cannot convert tz-naive Timestamp, use ' # <<<<<<<<<<<<<< + * 'tz_localize to localize') + * else: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/tslib.pyx":387 + * else: + * # Same UTC timestamp, different time zone + * return Timestamp(self.value, tz=tz) # <<<<<<<<<<<<<< + * + * astimezone = tz_convert + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tz, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":368 + * 'tz_convert for conversions') + * + * def tz_convert(self, tz): # <<<<<<<<<<<<<< + * """ + * Convert Timestamp to another time zone or localize to requested time + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":391 + * astimezone = tz_convert + * + * def replace(self, **kwds): # <<<<<<<<<<<<<< + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_57replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_57replace = {__Pyx_NAMESTR("replace"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_57replace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_57replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_kwds = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("replace (wrapper)", 0); + __pyx_v_kwds = PyDict_New(); if (unlikely(!__pyx_v_kwds)) return NULL; + __Pyx_GOTREF(__pyx_v_kwds); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwds, values, pos_args, "replace") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("replace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0; + __Pyx_AddTraceback("pandas.tslib.Timestamp.replace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_56replace(__pyx_self, __pyx_v_self, __pyx_v_kwds); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_kwds); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_56replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwds) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("replace", 0); + + /* "pandas/tslib.pyx":392 + * + * def replace(self, **kwds): + * return Timestamp(datetime.replace(self, **kwds), # <<<<<<<<<<<<<< + * offset=self.offset) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_4 = __pyx_v_kwds; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":393 + * def replace(self, **kwds): + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) # <<<<<<<<<<<<<< + * + * def to_pydatetime(self, warn=True): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_offset, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":392 + * + * def replace(self, **kwds): + * return Timestamp(datetime.replace(self, **kwds), # <<<<<<<<<<<<<< + * offset=self.offset) + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":391 + * astimezone = tz_convert + * + * def replace(self, **kwds): # <<<<<<<<<<<<<< + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp.replace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":395 + * offset=self.offset) + * + * def to_pydatetime(self, warn=True): # <<<<<<<<<<<<<< + * """ + * If warn=True, issue warning if nanoseconds is nonzero + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_59to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_58to_pydatetime[] = "\n If warn=True, issue warning if nanoseconds is nonzero\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_59to_pydatetime = {__Pyx_NAMESTR("to_pydatetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_59to_pydatetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_58to_pydatetime)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_59to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_warn = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_pydatetime (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_warn,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_True)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_warn); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_pydatetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_warn = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("to_pydatetime", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_58to_pydatetime(__pyx_self, __pyx_v_self, __pyx_v_warn); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_58to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_warn) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_pydatetime", 0); + + /* "pandas/tslib.pyx":403 + * _TSObject ts + * + * if self.nanosecond != 0 and warn: # <<<<<<<<<<<<<< + * print 'Warning: discarding nonzero nanoseconds' + * ts = convert_to_tsobject(self, self.tzinfo, None) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_warn); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":404 + * + * if self.nanosecond != 0 and warn: + * print 'Warning: discarding nonzero nanoseconds' # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(self, self.tzinfo, None) + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Warning_discarding_nonzero_nanos) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":405 + * if self.nanosecond != 0 and warn: + * print 'Warning: discarding nonzero nanoseconds' + * ts = convert_to_tsobject(self, self.tzinfo, None) # <<<<<<<<<<<<<< + * + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_self, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":407 + * ts = convert_to_tsobject(self, self.tzinfo, None) + * + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, # <<<<<<<<<<<<<< + * ts.dts.hour, ts.dts.min, ts.dts.sec, + * ts.dts.us, ts.tzinfo) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_ts->dts.year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/tslib.pyx":408 + * + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, + * ts.dts.hour, ts.dts.min, ts.dts.sec, # <<<<<<<<<<<<<< + * ts.dts.us, ts.tzinfo) + * + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.hour); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.min); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.sec); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":409 + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, + * ts.dts.hour, ts.dts.min, ts.dts.sec, + * ts.dts.us, ts.tzinfo) # <<<<<<<<<<<<<< + * + * def isoformat(self, sep='T'): + */ + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.us); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + + /* "pandas/tslib.pyx":407 + * ts = convert_to_tsobject(self, self.tzinfo, None) + * + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, # <<<<<<<<<<<<<< + * ts.dts.hour, ts.dts.min, ts.dts.sec, + * ts.dts.us, ts.tzinfo) + */ + __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_ts->tzinfo); + PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_v_ts->tzinfo); + __Pyx_GIVEREF(__pyx_v_ts->tzinfo); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":395 + * offset=self.offset) + * + * def to_pydatetime(self, warn=True): # <<<<<<<<<<<<<< + * """ + * If warn=True, issue warning if nanoseconds is nonzero + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":411 + * ts.dts.us, ts.tzinfo) + * + * def isoformat(self, sep='T'): # <<<<<<<<<<<<<< + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_61isoformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_61isoformat = {__Pyx_NAMESTR("isoformat"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_61isoformat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_61isoformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_sep = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isoformat (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_sep,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_n_s_T)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sep); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isoformat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_sep = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("isoformat", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_60isoformat(__pyx_self, __pyx_v_self, __pyx_v_sep); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_60isoformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_sep) { + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_base1 = NULL; + PyObject *__pyx_v_base2 = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isoformat", 0); + + /* "pandas/tslib.pyx":412 + * + * def isoformat(self, sep='T'): + * base = super(_Timestamp, self).isoformat(sep=sep) # <<<<<<<<<<<<<< + * if self.nanosecond == 0: + * return base + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isoformat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sep, __pyx_v_sep) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_base = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":413 + * def isoformat(self, sep='T'): + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: # <<<<<<<<<<<<<< + * return base + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":414 + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + * return base # <<<<<<<<<<<<<< + * + * if self.tzinfo is not None: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_base); + __pyx_r = __pyx_v_base; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":416 + * return base + * + * if self.tzinfo is not None: # <<<<<<<<<<<<<< + * base1, base2 = base[:-6], base[-6:] + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":417 + * + * if self.tzinfo is not None: + * base1, base2 = base[:-6], base[-6:] # <<<<<<<<<<<<<< + * else: + * base1, base2 = base, "" + */ + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_base, 0, -6, NULL, NULL, &__pyx_slice__18, 0, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_base, -6, 0, NULL, NULL, &__pyx_slice__19, 1, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_base1 = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_base2 = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":419 + * base1, base2 = base[:-6], base[-6:] + * else: + * base1, base2 = base, "" # <<<<<<<<<<<<<< + * + * if self.microsecond != 0: + */ + __pyx_t_3 = __pyx_v_base; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_kp_s__5; + __Pyx_INCREF(__pyx_t_2); + __pyx_v_base1 = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_base2 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":421 + * base1, base2 = base, "" + * + * if self.microsecond != 0: # <<<<<<<<<<<<<< + * base1 += "%.3d" % self.nanosecond + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":422 + * + * if self.microsecond != 0: + * base1 += "%.3d" % self.nanosecond # <<<<<<<<<<<<<< + * else: + * base1 += ".%.9d" % self.nanosecond + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_3d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_base1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_base1, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":424 + * base1 += "%.3d" % self.nanosecond + * else: + * base1 += ".%.9d" % self.nanosecond # <<<<<<<<<<<<<< + * + * return base1 + base2 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_9d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_base1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_base1, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":426 + * base1 += ".%.9d" % self.nanosecond + * + * return base1 + base2 # <<<<<<<<<<<<<< + * + * def _has_time_component(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyNumber_Add(__pyx_v_base1, __pyx_v_base2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":411 + * ts.dts.us, ts.tzinfo) + * + * def isoformat(self, sep='T'): # <<<<<<<<<<<<<< + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp.isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_base1); + __Pyx_XDECREF(__pyx_v_base2); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":428 + * return base1 + base2 + * + * def _has_time_component(self): # <<<<<<<<<<<<<< + * """ + * Returns if the Timestamp has a time component + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_63_has_time_component(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_62_has_time_component[] = "\n Returns if the Timestamp has a time component\n in addition to the date part\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_63_has_time_component = {__Pyx_NAMESTR("_has_time_component"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_63_has_time_component, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_62_has_time_component)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_63_has_time_component(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_has_time_component (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_62_has_time_component(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_62_has_time_component(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_has_time_component", 0); + + /* "pandas/tslib.pyx":433 + * in addition to the date part + * """ + * return (self.time() != _zero_time # <<<<<<<<<<<<<< + * or self.tzinfo is not None + * or self.nanosecond != 0) + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/tslib.pyx":434 + * """ + * return (self.time() != _zero_time + * or self.tzinfo is not None # <<<<<<<<<<<<<< + * or self.nanosecond != 0) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/tslib.pyx":433 + * in addition to the date part + * """ + * return (self.time() != _zero_time # <<<<<<<<<<<<<< + * or self.tzinfo is not None + * or self.nanosecond != 0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":434 + * """ + * return (self.time() != _zero_time + * or self.tzinfo is not None # <<<<<<<<<<<<<< + * or self.nanosecond != 0) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_zero_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":435 + * return (self.time() != _zero_time + * or self.tzinfo is not None + * or self.nanosecond != 0) # <<<<<<<<<<<<<< + * + * def to_julian_date(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/tslib.pyx":434 + * """ + * return (self.time() != _zero_time + * or self.tzinfo is not None # <<<<<<<<<<<<<< + * or self.nanosecond != 0) + * + */ + __pyx_t_4 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":435 + * return (self.time() != _zero_time + * or self.tzinfo is not None + * or self.nanosecond != 0) # <<<<<<<<<<<<<< + * + * def to_julian_date(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":428 + * return base1 + base2 + * + * def _has_time_component(self): # <<<<<<<<<<<<<< + * """ + * Returns if the Timestamp has a time component + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp._has_time_component", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":437 + * or self.nanosecond != 0) + * + * def to_julian_date(self): # <<<<<<<<<<<<<< + * """ + * Convert TimeStamp to a Julian Date. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_65to_julian_date(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_64to_julian_date[] = "\n Convert TimeStamp to a Julian Date.\n 0 Julian date is noon January 1, 4713 BC.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_65to_julian_date = {__Pyx_NAMESTR("to_julian_date"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_65to_julian_date, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_64to_julian_date)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_65to_julian_date(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_julian_date (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_64to_julian_date(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_64to_julian_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_year = NULL; + PyObject *__pyx_v_month = NULL; + PyObject *__pyx_v_day = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_julian_date", 0); + + /* "pandas/tslib.pyx":442 + * 0 Julian date is noon January 1, 4713 BC. + * """ + * year = self.year # <<<<<<<<<<<<<< + * month = self.month + * day = self.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_year = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":443 + * """ + * year = self.year + * month = self.month # <<<<<<<<<<<<<< + * day = self.day + * if month <= 2: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_month = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":444 + * year = self.year + * month = self.month + * day = self.day # <<<<<<<<<<<<<< + * if month <= 2: + * year -= 1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_day = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":445 + * month = self.month + * day = self.day + * if month <= 2: # <<<<<<<<<<<<<< + * year -= 1 + * month += 12 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_month, __pyx_int_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":446 + * day = self.day + * if month <= 2: + * year -= 1 # <<<<<<<<<<<<<< + * month += 12 + * return (day + + */ + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_year, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_year, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":447 + * if month <= 2: + * year -= 1 + * month += 12 # <<<<<<<<<<<<<< + * return (day + + * np.fix((153*month - 457)/5) + + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_month, __pyx_int_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_month, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":448 + * year -= 1 + * month += 12 + * return (day + # <<<<<<<<<<<<<< + * np.fix((153*month - 457)/5) + + * 365*year + + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/tslib.pyx":449 + * month += 12 + * return (day + + * np.fix((153*month - 457)/5) + # <<<<<<<<<<<<<< + * 365*year + + * np.floor(year / 4) - + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fix); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_int_153, __pyx_v_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_457); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_int_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":448 + * year -= 1 + * month += 12 + * return (day + # <<<<<<<<<<<<<< + * np.fix((153*month - 457)/5) + + * 365*year + + */ + __pyx_t_4 = PyNumber_Add(__pyx_v_day, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":450 + * return (day + + * np.fix((153*month - 457)/5) + + * 365*year + # <<<<<<<<<<<<<< + * np.floor(year / 4) - + * np.floor(year / 100) + + */ + __pyx_t_1 = PyNumber_Multiply(__pyx_int_365, __pyx_v_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/tslib.pyx":449 + * month += 12 + * return (day + + * np.fix((153*month - 457)/5) + # <<<<<<<<<<<<<< + * 365*year + + * np.floor(year / 4) - + */ + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":451 + * np.fix((153*month - 457)/5) + + * 365*year + + * np.floor(year / 4) - # <<<<<<<<<<<<<< + * np.floor(year / 100) + + * np.floor(year / 400) + + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_floor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_year, __pyx_int_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":450 + * return (day + + * np.fix((153*month - 457)/5) + + * 365*year + # <<<<<<<<<<<<<< + * np.floor(year / 4) - + * np.floor(year / 100) + + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":452 + * 365*year + + * np.floor(year / 4) - + * np.floor(year / 100) + # <<<<<<<<<<<<<< + * np.floor(year / 400) + + * 1721118.5 + + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_year, __pyx_int_100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":451 + * np.fix((153*month - 457)/5) + + * 365*year + + * np.floor(year / 4) - # <<<<<<<<<<<<<< + * np.floor(year / 100) + + * np.floor(year / 400) + + */ + __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":453 + * np.floor(year / 4) - + * np.floor(year / 100) + + * np.floor(year / 400) + # <<<<<<<<<<<<<< + * 1721118.5 + + * (self.hour + + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_year, __pyx_int_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":452 + * 365*year + + * np.floor(year / 4) - + * np.floor(year / 100) + # <<<<<<<<<<<<<< + * np.floor(year / 400) + + * 1721118.5 + + */ + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":453 + * np.floor(year / 4) - + * np.floor(year / 100) + + * np.floor(year / 400) + # <<<<<<<<<<<<<< + * 1721118.5 + + * (self.hour + + */ + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_float_1721118_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":455 + * np.floor(year / 400) + + * 1721118.5 + + * (self.hour + # <<<<<<<<<<<<<< + * self.minute/60.0 + + * self.second/3600.0 + + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":456 + * 1721118.5 + + * (self.hour + + * self.minute/60.0 + # <<<<<<<<<<<<<< + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minute); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_float_60_0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":455 + * np.floor(year / 400) + + * 1721118.5 + + * (self.hour + # <<<<<<<<<<<<<< + * self.minute/60.0 + + * self.second/3600.0 + + */ + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":457 + * (self.hour + + * self.minute/60.0 + + * self.second/3600.0 + # <<<<<<<<<<<<<< + * self.microsecond/3600.0/1e+6 + + * self.nanosecond/3600.0/1e+9 + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_second); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_float_3600_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":456 + * 1721118.5 + + * (self.hour + + * self.minute/60.0 + # <<<<<<<<<<<<<< + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":458 + * self.minute/60.0 + + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + # <<<<<<<<<<<<<< + * self.nanosecond/3600.0/1e+9 + * )/24.0) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_float_3600_0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_float_1e_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":457 + * (self.hour + + * self.minute/60.0 + + * self.second/3600.0 + # <<<<<<<<<<<<<< + * self.microsecond/3600.0/1e+6 + + * self.nanosecond/3600.0/1e+9 + */ + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":459 + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + + * self.nanosecond/3600.0/1e+9 # <<<<<<<<<<<<<< + * )/24.0) + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_float_3600_0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_float_1e_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":458 + * self.minute/60.0 + + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + # <<<<<<<<<<<<<< + * self.nanosecond/3600.0/1e+9 + * )/24.0) + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":460 + * self.microsecond/3600.0/1e+6 + + * self.nanosecond/3600.0/1e+9 + * )/24.0) # <<<<<<<<<<<<<< + * + * _nat_strings = set(['NaT','nat','NAT','nan','NaN','NAN']) + */ + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_float_24_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":454 + * np.floor(year / 100) + + * np.floor(year / 400) + + * 1721118.5 + # <<<<<<<<<<<<<< + * (self.hour + + * self.minute/60.0 + + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":437 + * or self.nanosecond != 0) + * + * def to_julian_date(self): # <<<<<<<<<<<<<< + * """ + * Convert TimeStamp to a Julian Date. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_julian_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_year); + __Pyx_XDECREF(__pyx_v_month); + __Pyx_XDECREF(__pyx_v_day); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":466 + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + * def __new__(cls): # <<<<<<<<<<<<<< + * cdef _NaT base + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_1__new__(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_1__new__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_1__new__(PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType___new__(__pyx_self, ((PyObject *)__pyx_v_cls)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { + struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_base = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "pandas/tslib.pyx":469 + * cdef _NaT base + * + * base = _NaT.__new__(cls, 1, 1, 1) # <<<<<<<<<<<<<< + * mangle_nat(base) + * base.value = NPY_NAT + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__NaT)), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_5tslib__NaT))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_base = ((struct __pyx_obj_6pandas_5tslib__NaT *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":470 + * + * base = _NaT.__new__(cls, 1, 1, 1) + * mangle_nat(base) # <<<<<<<<<<<<<< + * base.value = NPY_NAT + * + */ + mangle_nat(((PyObject *)__pyx_v_base)); + + /* "pandas/tslib.pyx":471 + * base = _NaT.__new__(cls, 1, 1, 1) + * mangle_nat(base) + * base.value = NPY_NAT # <<<<<<<<<<<<<< + * + * return base + */ + __pyx_v_base->__pyx_base.value = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":473 + * base.value = NPY_NAT + * + * return base # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "pandas/tslib.pyx":466 + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + * def __new__(cls): # <<<<<<<<<<<<<< + * cdef _NaT base + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.NaTType.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_base); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":475 + * return base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_3__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_3__repr__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "pandas/tslib.pyx":476 + * + * def __repr__(self): + * return 'NaT' # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_NaT); + __pyx_r = __pyx_n_s_NaT; + goto __pyx_L0; + + /* "pandas/tslib.pyx":475 + * return base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":478 + * return 'NaT' + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_5__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_5__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_5__str__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_5__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_4__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_4__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__", 0); + + /* "pandas/tslib.pyx":479 + * + * def __str__(self): + * return 'NaT' # <<<<<<<<<<<<<< + * + * def __hash__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_NaT); + __pyx_r = __pyx_n_s_NaT; + goto __pyx_L0; + + /* "pandas/tslib.pyx":478 + * return 'NaT' + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":481 + * return 'NaT' + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return iNaT + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_7__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_7__hash__ = {__Pyx_NAMESTR("__hash__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_7__hash__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_7__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_6__hash__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_6__hash__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "pandas/tslib.pyx":482 + * + * def __hash__(self): + * return iNaT # <<<<<<<<<<<<<< + * + * def __int__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":481 + * return 'NaT' + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return iNaT + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.NaTType.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":484 + * return iNaT + * + * def __int__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_9__int__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_9__int__ = {__Pyx_NAMESTR("__int__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_9__int__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_9__int__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_8__int__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_8__int__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__int__", 0); + + /* "pandas/tslib.pyx":485 + * + * def __int__(self): + * return NPY_NAT # <<<<<<<<<<<<<< + * + * def __long__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":484 + * return iNaT + * + * def __int__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.NaTType.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":487 + * return NPY_NAT + * + * def __long__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_11__long__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_11__long__ = {__Pyx_NAMESTR("__long__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_11__long__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_11__long__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__long__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_10__long__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_10__long__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__long__", 0); + + /* "pandas/tslib.pyx":488 + * + * def __long__(self): + * return NPY_NAT # <<<<<<<<<<<<<< + * + * def weekday(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":487 + * return NPY_NAT + * + * def __long__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.NaTType.__long__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":490 + * return NPY_NAT + * + * def weekday(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_13weekday(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_13weekday = {__Pyx_NAMESTR("weekday"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_13weekday, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_13weekday(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("weekday (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_12weekday(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_12weekday(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("weekday", 0); + + /* "pandas/tslib.pyx":491 + * + * def weekday(self): + * return -1 # <<<<<<<<<<<<<< + * + * def toordinal(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* "pandas/tslib.pyx":490 + * return NPY_NAT + * + * def weekday(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":493 + * return -1 + * + * def toordinal(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_15toordinal(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_15toordinal = {__Pyx_NAMESTR("toordinal"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_15toordinal, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_15toordinal(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("toordinal (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_14toordinal(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_14toordinal(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("toordinal", 0); + + /* "pandas/tslib.pyx":494 + * + * def toordinal(self): + * return -1 # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* "pandas/tslib.pyx":493 + * return -1 + * + * def toordinal(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":496 + * return -1 + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * return (__nat_unpickle, (None, )) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_17__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_17__reduce__ = {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_17__reduce__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_17__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_16__reduce__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_16__reduce__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "pandas/tslib.pyx":497 + * + * def __reduce__(self): + * return (__nat_unpickle, (None, )) # <<<<<<<<<<<<<< + * + * fields = ['year', 'quarter', 'month', 'day', 'hour', + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_unpickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_tuple__20); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":496 + * return -1 + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * return (__nat_unpickle, (None, )) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.NaTType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":506 + * setattr(NaTType, field, prop) + * + * def __nat_unpickle(*args): # <<<<<<<<<<<<<< + * # return constant defined in the module + * return NaT + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_3__nat_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_3__nat_unpickle = {__Pyx_NAMESTR("__nat_unpickle"), (PyCFunction)__pyx_pw_6pandas_5tslib_3__nat_unpickle, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_3__nat_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nat_unpickle (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__nat_unpickle", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6pandas_5tslib_2__nat_unpickle(__pyx_self, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_2__nat_unpickle(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__nat_unpickle", 0); + + /* "pandas/tslib.pyx":508 + * def __nat_unpickle(*args): + * # return constant defined in the module + * return NaT # <<<<<<<<<<<<<< + * + * NaT = NaTType() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":506 + * setattr(NaTType, field, prop) + * + * def __nat_unpickle(*args): # <<<<<<<<<<<<<< + * # return constant defined in the module + * return NaT + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.__nat_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":515 + * + * + * cdef inline bint _checknull_with_nat(object val): # <<<<<<<<<<<<<< + * """ utility to check if a value is a nat or not """ + * return val is None or ( + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__checknull_with_nat(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_with_nat", 0); + + /* "pandas/tslib.pyx":517 + * cdef inline bint _checknull_with_nat(object val): + * """ utility to check if a value is a nat or not """ + * return val is None or ( # <<<<<<<<<<<<<< + * PyFloat_Check(val) and val != val) or val is NaT + * + */ + __pyx_t_1 = (__pyx_v_val == Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":518 + * """ utility to check if a value is a nat or not """ + * return val is None or ( + * PyFloat_Check(val) and val != val) or val is NaT # <<<<<<<<<<<<<< + * + * cdef inline bint _cmp_nat_dt(_NaT lhs, _Timestamp rhs, int op) except -1: + */ + __pyx_t_3 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_5 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__pyx_v_val == __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_5 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; + } + + /* "pandas/tslib.pyx":517 + * cdef inline bint _checknull_with_nat(object val): + * """ utility to check if a value is a nat or not """ + * return val is None or ( # <<<<<<<<<<<<<< + * PyFloat_Check(val) and val != val) or val is NaT + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "pandas/tslib.pyx":515 + * + * + * cdef inline bint _checknull_with_nat(object val): # <<<<<<<<<<<<<< + * """ utility to check if a value is a nat or not """ + * return val is None or ( + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_WriteUnraisable("pandas.tslib._checknull_with_nat", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":520 + * PyFloat_Check(val) and val != val) or val is NaT + * + * cdef inline bint _cmp_nat_dt(_NaT lhs, _Timestamp rhs, int op) except -1: # <<<<<<<<<<<<<< + * return _nat_scalar_rules[op] + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__cmp_nat_dt(CYTHON_UNUSED struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_lhs, CYTHON_UNUSED struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_rhs, int __pyx_v_op) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cmp_nat_dt", 0); + + /* "pandas/tslib.pyx":521 + * + * cdef inline bint _cmp_nat_dt(_NaT lhs, _Timestamp rhs, int op) except -1: + * return _nat_scalar_rules[op] # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = (__pyx_v_6pandas_5tslib__nat_scalar_rules[__pyx_v_op]); + goto __pyx_L0; + + /* "pandas/tslib.pyx":520 + * PyFloat_Check(val) and val != val) or val is NaT + * + * cdef inline bint _cmp_nat_dt(_NaT lhs, _Timestamp rhs, int op) except -1: # <<<<<<<<<<<<<< + * return _nat_scalar_rules[op] + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":524 + * + * + * cdef _tz_format(object obj, object zone): # <<<<<<<<<<<<<< + * try: + * return obj.strftime(' %%Z, tz=%s' % zone) + */ + +static PyObject *__pyx_f_6pandas_5tslib__tz_format(PyObject *__pyx_v_obj, PyObject *__pyx_v_zone) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_tz_format", 0); + + /* "pandas/tslib.pyx":525 + * + * cdef _tz_format(object obj, object zone): + * try: # <<<<<<<<<<<<<< + * return obj.strftime(' %%Z, tz=%s' % zone) + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":526 + * cdef _tz_format(object obj, object zone): + * try: + * return obj.strftime(' %%Z, tz=%s' % zone) # <<<<<<<<<<<<<< + * except: + * return ', tz=%s' % zone + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_strftime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Z_tz_s, __pyx_v_zone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":527 + * try: + * return obj.strftime(' %%Z, tz=%s' % zone) + * except: # <<<<<<<<<<<<<< + * return ', tz=%s' % zone + * + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib._tz_format", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":528 + * return obj.strftime(' %%Z, tz=%s' % zone) + * except: + * return ', tz=%s' % zone # <<<<<<<<<<<<<< + * + * def is_timestamp_array(ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_tz_s, __pyx_v_zone); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":524 + * + * + * cdef _tz_format(object obj, object zone): # <<<<<<<<<<<<<< + * try: + * return obj.strftime(' %%Z, tz=%s' % zone) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.tslib._tz_format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":530 + * return ', tz=%s' % zone + * + * def is_timestamp_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_5is_timestamp_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_5is_timestamp_array = {__Pyx_NAMESTR("is_timestamp_array"), (PyCFunction)__pyx_pw_6pandas_5tslib_5is_timestamp_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_5is_timestamp_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timestamp_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_4is_timestamp_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_4is_timestamp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_n; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timestamp_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":531 + * + * def is_timestamp_array(ndarray[object] values): + * cdef int i, n = len(values) # <<<<<<<<<<<<<< + * if n == 0: + * return False + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":532 + * def is_timestamp_array(ndarray[object] values): + * cdef int i, n = len(values) + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":533 + * cdef int i, n = len(values) + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * if not is_timestamp(values[i]): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":534 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * if not is_timestamp(values[i]): + * return False + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/tslib.pyx":535 + * return False + * for i in range(n): + * if not is_timestamp(values[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = ((!(__pyx_f_6pandas_5tslib_is_timestamp(__pyx_t_5) != 0)) != 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":536 + * for i in range(n): + * if not is_timestamp(values[i]): + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":537 + * if not is_timestamp(values[i]): + * return False + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/tslib.pyx":530 + * return ', tz=%s' % zone + * + * def is_timestamp_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.is_timestamp_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":540 + * + * + * cpdef object get_value_box(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static PyObject *__pyx_pw_6pandas_5tslib_7get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_get_value_box(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_box", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "pandas/tslib.pyx":544 + * Py_ssize_t i, sz + * void* data_ptr + * if util.is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":545 + * void* data_ptr + * if util.is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":546 + * if util.is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":547 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = np.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":548 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = np.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/tslib.pyx":549 + * loc = casted + * i = loc + * sz = np.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "pandas/tslib.pyx":551 + * sz = np.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":552 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * + * if i >= sz or sz == 0 or i < 0: + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":554 + * i += sz + * + * if i >= sz or sz == 0 or i < 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + if (!__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_i < 0) != 0); + __pyx_t_6 = __pyx_t_4; + } else { + __pyx_t_6 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_6; + } else { + __pyx_t_1 = __pyx_t_5; + } + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":555 + * + * if i >= sz or sz == 0 or i < 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * if arr.descr.type_num == NPY_DATETIME: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":557 + * raise IndexError('index out of bounds') + * + * if arr.descr.type_num == NPY_DATETIME: # <<<<<<<<<<<<<< + * return Timestamp(util.get_value_1d(arr, i)) + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->descr->type_num == NPY_DATETIME) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":558 + * + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_1d(arr, i)) # <<<<<<<<<<<<<< + * else: + * return util.get_value_1d(arr, i) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":560 + * return Timestamp(util.get_value_1d(arr, i)) + * else: + * return util.get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":540 + * + * + * cpdef object get_value_box(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.tslib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_7get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_loc = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_value_box (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_loc,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_value_box", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_value_box") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_loc = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_value_box", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_6get_value_box(__pyx_self, __pyx_v_arr, __pyx_v_loc); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_6get_value_box(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_box", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_get_value_box(__pyx_v_arr, __pyx_v_loc, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":580 + * # Frequency inference + * + * def unique_deltas(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9unique_deltas(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9unique_deltas = {__Pyx_NAMESTR("unique_deltas"), (PyCFunction)__pyx_pw_6pandas_5tslib_9unique_deltas, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9unique_deltas(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique_deltas (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_8unique_deltas(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_8unique_deltas(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + kh_int64_t *__pyx_v_table; + int __pyx_v_ret; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique_deltas", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":582 + * def unique_deltas(ndarray[int64_t] arr): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":586 + * khiter_t k + * kh_int64_t *table + * int ret = 0 # <<<<<<<<<<<<<< + * list uniques = [] + * + */ + __pyx_v_ret = 0; + + /* "pandas/tslib.pyx":587 + * kh_int64_t *table + * int ret = 0 + * list uniques = [] # <<<<<<<<<<<<<< + * + * table = kh_init_int64() + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":589 + * list uniques = [] + * + * table = kh_init_int64() # <<<<<<<<<<<<<< + * kh_resize_int64(table, 10) + * for i in range(n - 1): + */ + __pyx_v_table = kh_init_int64(); + + /* "pandas/tslib.pyx":590 + * + * table = kh_init_int64() + * kh_resize_int64(table, 10) # <<<<<<<<<<<<<< + * for i in range(n - 1): + * val = arr[i + 1] - arr[i] + */ + kh_resize_int64(__pyx_v_table, 10); + + /* "pandas/tslib.pyx":591 + * table = kh_init_int64() + * kh_resize_int64(table, 10) + * for i in range(n - 1): # <<<<<<<<<<<<<< + * val = arr[i + 1] - arr[i] + * k = kh_get_int64(table, val) + */ + __pyx_t_1 = (__pyx_v_n - 1); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/tslib.pyx":592 + * kh_resize_int64(table, 10) + * for i in range(n - 1): + * val = arr[i + 1] - arr[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(table, val) + * if k == table.n_buckets: + */ + __pyx_t_4 = (__pyx_v_i + 1); + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides))); + + /* "pandas/tslib.pyx":593 + * for i in range(n - 1): + * val = arr[i + 1] - arr[i] + * k = kh_get_int64(table, val) # <<<<<<<<<<<<<< + * if k == table.n_buckets: + * kh_put_int64(table, val, &ret) + */ + __pyx_v_k = kh_get_int64(__pyx_v_table, __pyx_v_val); + + /* "pandas/tslib.pyx":594 + * val = arr[i + 1] - arr[i] + * k = kh_get_int64(table, val) + * if k == table.n_buckets: # <<<<<<<<<<<<<< + * kh_put_int64(table, val, &ret) + * uniques.append(val) + */ + __pyx_t_7 = ((__pyx_v_k == __pyx_v_table->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":595 + * k = kh_get_int64(table, val) + * if k == table.n_buckets: + * kh_put_int64(table, val, &ret) # <<<<<<<<<<<<<< + * uniques.append(val) + * kh_destroy_int64(table) + */ + kh_put_int64(__pyx_v_table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/tslib.pyx":596 + * if k == table.n_buckets: + * kh_put_int64(table, val, &ret) + * uniques.append(val) # <<<<<<<<<<<<<< + * kh_destroy_int64(table) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/tslib.pyx":597 + * kh_put_int64(table, val, &ret) + * uniques.append(val) + * kh_destroy_int64(table) # <<<<<<<<<<<<<< + * + * result = np.array(uniques, dtype=np.int64) + */ + kh_destroy_int64(__pyx_v_table); + + /* "pandas/tslib.pyx":599 + * kh_destroy_int64(table) + * + * result = np.array(uniques, dtype=np.int64) # <<<<<<<<<<<<<< + * result.sort() + * return result + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_uniques); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_uniques); + __Pyx_GIVEREF(__pyx_v_uniques); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/tslib.pyx":600 + * + * result = np.array(uniques, dtype=np.int64) + * result.sort() # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_sort); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":601 + * result = np.array(uniques, dtype=np.int64) + * result.sort() + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":580 + * # Frequency inference + * + * def unique_deltas(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.unique_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":604 + * + * + * cdef inline bint _is_multiple(int64_t us, int64_t mult): # <<<<<<<<<<<<<< + * return us % mult == 0 + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_multiple(__pyx_t_5numpy_int64_t __pyx_v_us, __pyx_t_5numpy_int64_t __pyx_v_mult) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_multiple", 0); + + /* "pandas/tslib.pyx":605 + * + * cdef inline bint _is_multiple(int64_t us, int64_t mult): + * return us % mult == 0 # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_mult == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = (__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_us, __pyx_v_mult) == 0); + goto __pyx_L0; + + /* "pandas/tslib.pyx":604 + * + * + * cdef inline bint _is_multiple(int64_t us, int64_t mult): # <<<<<<<<<<<<<< + * return us % mult == 0 + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.tslib._is_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":608 + * + * + * def apply_offset(ndarray[object] values, object offset): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_11apply_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_11apply_offset = {__Pyx_NAMESTR("apply_offset"), (PyCFunction)__pyx_pw_6pandas_5tslib_11apply_offset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_11apply_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + CYTHON_UNUSED PyObject *__pyx_v_offset = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("apply_offset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_offset,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_offset", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_offset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_offset = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("apply_offset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.apply_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_10apply_offset(__pyx_self, __pyx_v_values, __pyx_v_offset); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10apply_offset(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyObject *__pyx_v_offset) { + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED PyArrayObject *__pyx_v_new_values = 0; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new_values; + __Pyx_Buffer __pyx_pybuffer_new_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("apply_offset", 0); + __pyx_pybuffer_new_values.pybuffer.buf = NULL; + __pyx_pybuffer_new_values.refcount = 0; + __pyx_pybuffernd_new_values.data = NULL; + __pyx_pybuffernd_new_values.rcbuffer = &__pyx_pybuffer_new_values; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":610 + * def apply_offset(ndarray[object] values, object offset): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] new_values + * object boxed + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":614 + * object boxed + * + * result = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * new_values = result.view('i8') + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":615 + * + * result = np.empty(n, dtype='M8[ns]') + * new_values = result.view('i8') # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_new_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_new_values.diminfo[0].strides = __pyx_pybuffernd_new_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new_values.diminfo[0].shape = __pyx_pybuffernd_new_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_new_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":608 + * + * + * def apply_offset(ndarray[object] values, object offset): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.apply_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_new_values); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":618 + * + * + * cdef inline bint _cmp_scalar(int64_t lhs, int64_t rhs, int op) except -1: # <<<<<<<<<<<<<< + * if op == Py_EQ: + * return lhs == rhs + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__cmp_scalar(__pyx_t_5numpy_int64_t __pyx_v_lhs, __pyx_t_5numpy_int64_t __pyx_v_rhs, int __pyx_v_op) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_cmp_scalar", 0); + + /* "pandas/tslib.pyx":619 + * + * cdef inline bint _cmp_scalar(int64_t lhs, int64_t rhs, int op) except -1: + * if op == Py_EQ: # <<<<<<<<<<<<<< + * return lhs == rhs + * elif op == Py_NE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_EQ) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":620 + * cdef inline bint _cmp_scalar(int64_t lhs, int64_t rhs, int op) except -1: + * if op == Py_EQ: + * return lhs == rhs # <<<<<<<<<<<<<< + * elif op == Py_NE: + * return lhs != rhs + */ + __pyx_r = (__pyx_v_lhs == __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":621 + * if op == Py_EQ: + * return lhs == rhs + * elif op == Py_NE: # <<<<<<<<<<<<<< + * return lhs != rhs + * elif op == Py_LT: + */ + __pyx_t_1 = ((__pyx_v_op == Py_NE) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":622 + * return lhs == rhs + * elif op == Py_NE: + * return lhs != rhs # <<<<<<<<<<<<<< + * elif op == Py_LT: + * return lhs < rhs + */ + __pyx_r = (__pyx_v_lhs != __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":623 + * elif op == Py_NE: + * return lhs != rhs + * elif op == Py_LT: # <<<<<<<<<<<<<< + * return lhs < rhs + * elif op == Py_LE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_LT) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":624 + * return lhs != rhs + * elif op == Py_LT: + * return lhs < rhs # <<<<<<<<<<<<<< + * elif op == Py_LE: + * return lhs <= rhs + */ + __pyx_r = (__pyx_v_lhs < __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":625 + * elif op == Py_LT: + * return lhs < rhs + * elif op == Py_LE: # <<<<<<<<<<<<<< + * return lhs <= rhs + * elif op == Py_GT: + */ + __pyx_t_1 = ((__pyx_v_op == Py_LE) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":626 + * return lhs < rhs + * elif op == Py_LE: + * return lhs <= rhs # <<<<<<<<<<<<<< + * elif op == Py_GT: + * return lhs > rhs + */ + __pyx_r = (__pyx_v_lhs <= __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":627 + * elif op == Py_LE: + * return lhs <= rhs + * elif op == Py_GT: # <<<<<<<<<<<<<< + * return lhs > rhs + * elif op == Py_GE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_GT) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":628 + * return lhs <= rhs + * elif op == Py_GT: + * return lhs > rhs # <<<<<<<<<<<<<< + * elif op == Py_GE: + * return lhs >= rhs + */ + __pyx_r = (__pyx_v_lhs > __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":629 + * elif op == Py_GT: + * return lhs > rhs + * elif op == Py_GE: # <<<<<<<<<<<<<< + * return lhs >= rhs + * + */ + __pyx_t_1 = ((__pyx_v_op == Py_GE) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":630 + * return lhs > rhs + * elif op == Py_GE: + * return lhs >= rhs # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = (__pyx_v_lhs >= __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":618 + * + * + * cdef inline bint _cmp_scalar(int64_t lhs, int64_t rhs, int op) except -1: # <<<<<<<<<<<<<< + * if op == Py_EQ: + * return lhs == rhs + */ + + /* function exit code */ + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":654 + * object offset # frequency reference + * + * def __hash__(_Timestamp self): # <<<<<<<<<<<<<< + * if self.nanosecond: + * return hash(self.value) + */ + +/* Python wrapper */ +static Py_hash_t __pyx_pw_6pandas_5tslib_10_Timestamp_1__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_6pandas_5tslib_10_Timestamp_1__hash__(PyObject *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp___hash__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_hash_t __pyx_pf_6pandas_5tslib_10_Timestamp___hash__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_hash_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "pandas/tslib.pyx":655 + * + * def __hash__(_Timestamp self): + * if self.nanosecond: # <<<<<<<<<<<<<< + * return hash(self.value) + * return datetime.__hash__(self) + */ + __pyx_t_1 = (__pyx_v_self->nanosecond != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":656 + * def __hash__(_Timestamp self): + * if self.nanosecond: + * return hash(self.value) # <<<<<<<<<<<<<< + * return datetime.__hash__(self) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Hash(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":657 + * if self.nanosecond: + * return hash(self.value) + * return datetime.__hash__(self) # <<<<<<<<<<<<<< + * + * def __richcmp__(_Timestamp self, object other, int op): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_hash); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyInt_AsHash_t(__pyx_t_5); if (unlikely((__pyx_t_3 == (Py_hash_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/tslib.pyx":654 + * object offset # frequency reference + * + * def __hash__(_Timestamp self): # <<<<<<<<<<<<<< + * if self.nanosecond: + * return hash(self.value) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib._Timestamp.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":659 + * return datetime.__hash__(self) + * + * def __richcmp__(_Timestamp self, object other, int op): # <<<<<<<<<<<<<< + * cdef: + * _Timestamp ots + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_5tslib__Timestamp, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_2__richcmp__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_2__richcmp__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_ots = 0; + int __pyx_v_ndim; + PyDateTime_DateTime *__pyx_v_val = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__richcmp__", 0); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/tslib.pyx":664 + * int ndim + * + * if isinstance(other, _Timestamp): # <<<<<<<<<<<<<< + * if isinstance(other, _NaT): + * return _cmp_nat_dt(other, self, _reverse_ops[op]) + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":665 + * + * if isinstance(other, _Timestamp): + * if isinstance(other, _NaT): # <<<<<<<<<<<<<< + * return _cmp_nat_dt(other, self, _reverse_ops[op]) + * ots = other + */ + __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_5tslib__NaT)); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":666 + * if isinstance(other, _Timestamp): + * if isinstance(other, _NaT): + * return _cmp_nat_dt(other, self, _reverse_ops[op]) # <<<<<<<<<<<<<< + * ots = other + * elif isinstance(other, datetime): + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_6pandas_5tslib__NaT))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_6pandas_5tslib__cmp_nat_dt(((struct __pyx_obj_6pandas_5tslib__NaT *)__pyx_v_other), __pyx_v_self, (__pyx_v_6pandas_5tslib__reverse_ops[__pyx_v_op])); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":667 + * if isinstance(other, _NaT): + * return _cmp_nat_dt(other, self, _reverse_ops[op]) + * ots = other # <<<<<<<<<<<<<< + * elif isinstance(other, datetime): + * if self.nanosecond == 0: + */ + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_6pandas_5tslib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_other; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ots = ((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":668 + * return _cmp_nat_dt(other, self, _reverse_ops[op]) + * ots = other + * elif isinstance(other, datetime): # <<<<<<<<<<<<<< + * if self.nanosecond == 0: + * val = self.to_datetime() + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_8datetime_datetime)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":669 + * ots = other + * elif isinstance(other, datetime): + * if self.nanosecond == 0: # <<<<<<<<<<<<<< + * val = self.to_datetime() + * return PyObject_RichCompareBool(val, other, op) + */ + __pyx_t_2 = ((__pyx_v_self->nanosecond == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":670 + * elif isinstance(other, datetime): + * if self.nanosecond == 0: + * val = self.to_datetime() # <<<<<<<<<<<<<< + * return PyObject_RichCompareBool(val, other, op) + * + */ + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->to_datetime(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_val = ((PyDateTime_DateTime *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":671 + * if self.nanosecond == 0: + * val = self.to_datetime() + * return PyObject_RichCompareBool(val, other, op) # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyObject_RichCompareBool(((PyObject *)__pyx_v_val), __pyx_v_other, __pyx_v_op); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":673 + * return PyObject_RichCompareBool(val, other, op) + * + * try: # <<<<<<<<<<<<<< + * ots = Timestamp(other) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/tslib.pyx":674 + * + * try: + * ots = Timestamp(other) # <<<<<<<<<<<<<< + * except ValueError: + * return self._compare_outside_nanorange(other, op) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_6pandas_5tslib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_v_ots = ((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":675 + * try: + * ots = Timestamp(other) + * except ValueError: # <<<<<<<<<<<<<< + * return self._compare_outside_nanorange(other, op) + * else: + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("pandas.tslib._Timestamp.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":676 + * ots = Timestamp(other) + * except ValueError: + * return self._compare_outside_nanorange(other, op) # <<<<<<<<<<<<<< + * else: + * ndim = getattr(other, _NDIM_STRING, -1) + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8datetime_datetime))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_compare_outside_nanorange(__pyx_v_self, ((PyDateTime_DateTime *)__pyx_v_other), __pyx_v_op); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L9_except_return; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L9_except_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L13_try_end:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":678 + * return self._compare_outside_nanorange(other, op) + * else: + * ndim = getattr(other, _NDIM_STRING, -1) # <<<<<<<<<<<<<< + * + * if ndim != -1: + */ + __pyx_t_3 = __pyx_v_6pandas_5tslib__NDIM_STRING; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = __Pyx_GetAttr3(__pyx_v_other, __pyx_t_3, __pyx_int_neg_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_ndim = __pyx_t_9; + + /* "pandas/tslib.pyx":680 + * ndim = getattr(other, _NDIM_STRING, -1) + * + * if ndim != -1: # <<<<<<<<<<<<<< + * if ndim == 0: + * if isinstance(other, np.datetime64): + */ + __pyx_t_2 = ((__pyx_v_ndim != -1) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":681 + * + * if ndim != -1: + * if ndim == 0: # <<<<<<<<<<<<<< + * if isinstance(other, np.datetime64): + * other = Timestamp(other) + */ + __pyx_t_2 = ((__pyx_v_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":682 + * if ndim != -1: + * if ndim == 0: + * if isinstance(other, np.datetime64): # <<<<<<<<<<<<<< + * other = Timestamp(other) + * else: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":683 + * if ndim == 0: + * if isinstance(other, np.datetime64): + * other = Timestamp(other) # <<<<<<<<<<<<<< + * else: + * raise TypeError('Cannot compare type %r with type %r' % + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/tslib.pyx":686 + * else: + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, # <<<<<<<<<<<<<< + * type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/tslib.pyx":687 + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, + * type(other).__name__)) # <<<<<<<<<<<<<< + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * else: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_other)), __pyx_n_s_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":686 + * else: + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, # <<<<<<<<<<<<<< + * type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_8 = 0; + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":685 + * other = Timestamp(other) + * else: + * raise TypeError('Cannot compare type %r with type %r' % # <<<<<<<<<<<<<< + * (type(self).__name__, + * type(other).__name__)) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_compare_type_r_with_type, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/tslib.pyx":688 + * (type(self).__name__, + * type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) # <<<<<<<<<<<<<< + * else: + * if op == Py_EQ: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_other, ((PyObject *)__pyx_v_self), (__pyx_v_6pandas_5tslib__reverse_ops[__pyx_v_op])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":690 + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * else: + * if op == Py_EQ: # <<<<<<<<<<<<<< + * return False + * elif op == Py_NE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_EQ) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":691 + * else: + * if op == Py_EQ: + * return False # <<<<<<<<<<<<<< + * elif op == Py_NE: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":692 + * if op == Py_EQ: + * return False + * elif op == Py_NE: # <<<<<<<<<<<<<< + * return True + * raise TypeError('Cannot compare type %r with type %r' % + */ + __pyx_t_1 = ((__pyx_v_op == Py_NE) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":693 + * return False + * elif op == Py_NE: + * return True # <<<<<<<<<<<<<< + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, type(other).__name__)) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":695 + * return True + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, type(other).__name__)) # <<<<<<<<<<<<<< + * + * self._assert_tzawareness_compat(other) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_other)), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_7 = 0; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":694 + * elif op == Py_NE: + * return True + * raise TypeError('Cannot compare type %r with type %r' % # <<<<<<<<<<<<<< + * (type(self).__name__, type(other).__name__)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_compare_type_r_with_type, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":697 + * (type(self).__name__, type(other).__name__)) + * + * self._assert_tzawareness_compat(other) # <<<<<<<<<<<<<< + * return _cmp_scalar(self.value, ots.value, op) + * + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_assert_tzawareness_compat(__pyx_v_self, __pyx_v_other); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":698 + * + * self._assert_tzawareness_compat(other) + * return _cmp_scalar(self.value, ots.value, op) # <<<<<<<<<<<<<< + * + * cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib__cmp_scalar(__pyx_v_self->value, __pyx_v_ots->value, __pyx_v_op); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":659 + * return datetime.__hash__(self) + * + * def __richcmp__(_Timestamp self, object other, int op): # <<<<<<<<<<<<<< + * cdef: + * _Timestamp ots + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.tslib._Timestamp.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ots); + __Pyx_XDECREF((PyObject *)__pyx_v_val); + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":700 + * return _cmp_scalar(self.value, ots.value, op) + * + * cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, # <<<<<<<<<<<<<< + * int op) except -1: + * cdef datetime dtval = self.to_datetime() + */ + +static int __pyx_f_6pandas_5tslib_10_Timestamp__compare_outside_nanorange(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyDateTime_DateTime *__pyx_v_other, int __pyx_v_op) { + PyDateTime_DateTime *__pyx_v_dtval = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_compare_outside_nanorange", 0); + + /* "pandas/tslib.pyx":702 + * cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, + * int op) except -1: + * cdef datetime dtval = self.to_datetime() # <<<<<<<<<<<<<< + * + * self._assert_tzawareness_compat(other) + */ + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->to_datetime(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtval = ((PyDateTime_DateTime *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":704 + * cdef datetime dtval = self.to_datetime() + * + * self._assert_tzawareness_compat(other) # <<<<<<<<<<<<<< + * + * if self.nanosecond == 0: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_assert_tzawareness_compat(__pyx_v_self, ((PyObject *)__pyx_v_other)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":706 + * self._assert_tzawareness_compat(other) + * + * if self.nanosecond == 0: # <<<<<<<<<<<<<< + * return PyObject_RichCompareBool(dtval, other, op) + * else: + */ + __pyx_t_3 = ((__pyx_v_self->nanosecond == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":707 + * + * if self.nanosecond == 0: + * return PyObject_RichCompareBool(dtval, other, op) # <<<<<<<<<<<<<< + * else: + * if op == Py_EQ: + */ + __pyx_t_3 = PyObject_RichCompareBool(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), __pyx_v_op); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":709 + * return PyObject_RichCompareBool(dtval, other, op) + * else: + * if op == Py_EQ: # <<<<<<<<<<<<<< + * return False + * elif op == Py_NE: + */ + __pyx_t_3 = ((__pyx_v_op == Py_EQ) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":710 + * else: + * if op == Py_EQ: + * return False # <<<<<<<<<<<<<< + * elif op == Py_NE: + * return True + */ + __pyx_r = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":711 + * if op == Py_EQ: + * return False + * elif op == Py_NE: # <<<<<<<<<<<<<< + * return True + * elif op == Py_LT: + */ + __pyx_t_3 = ((__pyx_v_op == Py_NE) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":712 + * return False + * elif op == Py_NE: + * return True # <<<<<<<<<<<<<< + * elif op == Py_LT: + * return dtval < other + */ + __pyx_r = 1; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":713 + * elif op == Py_NE: + * return True + * elif op == Py_LT: # <<<<<<<<<<<<<< + * return dtval < other + * elif op == Py_LE: + */ + __pyx_t_3 = ((__pyx_v_op == Py_LT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":714 + * return True + * elif op == Py_LT: + * return dtval < other # <<<<<<<<<<<<<< + * elif op == Py_LE: + * return dtval < other + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":715 + * elif op == Py_LT: + * return dtval < other + * elif op == Py_LE: # <<<<<<<<<<<<<< + * return dtval < other + * elif op == Py_GT: + */ + __pyx_t_3 = ((__pyx_v_op == Py_LE) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":716 + * return dtval < other + * elif op == Py_LE: + * return dtval < other # <<<<<<<<<<<<<< + * elif op == Py_GT: + * return dtval >= other + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":717 + * elif op == Py_LE: + * return dtval < other + * elif op == Py_GT: # <<<<<<<<<<<<<< + * return dtval >= other + * elif op == Py_GE: + */ + __pyx_t_3 = ((__pyx_v_op == Py_GT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":718 + * return dtval < other + * elif op == Py_GT: + * return dtval >= other # <<<<<<<<<<<<<< + * elif op == Py_GE: + * return dtval >= other + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":719 + * elif op == Py_GT: + * return dtval >= other + * elif op == Py_GE: # <<<<<<<<<<<<<< + * return dtval >= other + * + */ + __pyx_t_3 = ((__pyx_v_op == Py_GE) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":720 + * return dtval >= other + * elif op == Py_GE: + * return dtval >= other # <<<<<<<<<<<<<< + * + * cdef int _assert_tzawareness_compat(_Timestamp self, + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":700 + * return _cmp_scalar(self.value, ots.value, op) + * + * cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, # <<<<<<<<<<<<<< + * int op) except -1: + * cdef datetime dtval = self.to_datetime() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp._compare_outside_nanorange", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_dtval); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":722 + * return dtval >= other + * + * cdef int _assert_tzawareness_compat(_Timestamp self, # <<<<<<<<<<<<<< + * object other) except -1: + * if self.tzinfo is None: + */ + +static int __pyx_f_6pandas_5tslib_10_Timestamp__assert_tzawareness_compat(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_other) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_assert_tzawareness_compat", 0); + + /* "pandas/tslib.pyx":724 + * cdef int _assert_tzawareness_compat(_Timestamp self, + * object other) except -1: + * if self.tzinfo is None: # <<<<<<<<<<<<<< + * if other.tzinfo is not None: + * raise ValueError('Cannot compare tz-naive and tz-aware ' + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":725 + * object other) except -1: + * if self.tzinfo is None: + * if other.tzinfo is not None: # <<<<<<<<<<<<<< + * raise ValueError('Cannot compare tz-naive and tz-aware ' + * 'timestamps') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":726 + * if self.tzinfo is None: + * if other.tzinfo is not None: + * raise ValueError('Cannot compare tz-naive and tz-aware ' # <<<<<<<<<<<<<< + * 'timestamps') + * elif other.tzinfo is None: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":728 + * raise ValueError('Cannot compare tz-naive and tz-aware ' + * 'timestamps') + * elif other.tzinfo is None: # <<<<<<<<<<<<<< + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":729 + * 'timestamps') + * elif other.tzinfo is None: + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') # <<<<<<<<<<<<<< + * + * cpdef datetime to_datetime(_Timestamp self): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/tslib.pyx":722 + * return dtval >= other + * + * cdef int _assert_tzawareness_compat(_Timestamp self, # <<<<<<<<<<<<<< + * object other) except -1: + * if self.tzinfo is None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp._assert_tzawareness_compat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":731 + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') + * + * cpdef datetime to_datetime(_Timestamp self): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyDateTime_DateTime *__pyx_f_6pandas_5tslib_10_Timestamp_to_datetime(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, int __pyx_skip_dispatch) { + pandas_datetimestruct __pyx_v_dts; + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + PyDateTime_DateTime *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + pandas_datetimestruct __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_datetime", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8datetime_datetime))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/tslib.pyx":735 + * pandas_datetimestruct dts + * _TSObject ts + * ts = convert_to_tsobject(self, self.tzinfo, None) # <<<<<<<<<<<<<< + * dts = ts.dts + * return datetime(dts.year, dts.month, dts.day, + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(((PyObject *)__pyx_v_self), __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":736 + * _TSObject ts + * ts = convert_to_tsobject(self, self.tzinfo, None) + * dts = ts.dts # <<<<<<<<<<<<<< + * return datetime(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, + */ + __pyx_t_3 = __pyx_v_ts->dts; + __pyx_v_dts = __pyx_t_3; + + /* "pandas/tslib.pyx":737 + * ts = convert_to_tsobject(self, self.tzinfo, None) + * dts = ts.dts + * return datetime(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, + * dts.us, ts.tzinfo) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":738 + * dts = ts.dts + * return datetime(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, # <<<<<<<<<<<<<< + * dts.us, ts.tzinfo) + * + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":739 + * return datetime(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, + * dts.us, ts.tzinfo) # <<<<<<<<<<<<<< + * + * def __add__(self, other): + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/tslib.pyx":737 + * ts = convert_to_tsobject(self, self.tzinfo, None) + * dts = ts.dts + * return datetime(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, + * dts.us, ts.tzinfo) + */ + __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_ts->tzinfo); + PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_v_ts->tzinfo); + __Pyx_GIVEREF(__pyx_v_ts->tzinfo); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = ((PyDateTime_DateTime *)__pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":731 + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') + * + * cpdef datetime to_datetime(_Timestamp self): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.tslib._Timestamp.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_datetime (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_4to_datetime(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_4to_datetime(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_datetime", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->to_datetime(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":741 + * dts.us, ts.tzinfo) + * + * def __add__(self, other): # <<<<<<<<<<<<<< + * cdef int64_t other_int + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_7__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_7__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_6__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_6__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + __pyx_t_5numpy_int64_t __pyx_v_other_int; + PyObject *__pyx_v_nanos = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 0); + + /* "pandas/tslib.pyx":744 + * cdef int64_t other_int + * + * if is_timedelta64_object(other): # <<<<<<<<<<<<<< + * other_int = other.astype('timedelta64[ns]').view('i8') + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) + */ + __pyx_t_1 = (is_timedelta64_object(__pyx_v_other) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":745 + * + * if is_timedelta64_object(other): + * other_int = other.astype('timedelta64[ns]').view('i8') # <<<<<<<<<<<<<< + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_other_int = __pyx_t_4; + + /* "pandas/tslib.pyx":746 + * if is_timedelta64_object(other): + * other_int = other.astype('timedelta64[ns]').view('i8') + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) # <<<<<<<<<<<<<< + * + * elif is_integer_object(other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_other_int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_offset, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":748 + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) + * + * elif is_integer_object(other): # <<<<<<<<<<<<<< + * if self.offset is None: + * raise ValueError("Cannot add integral value to Timestamp " + */ + __pyx_t_1 = (is_integer_object(__pyx_v_other) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":749 + * + * elif is_integer_object(other): + * if self.offset is None: # <<<<<<<<<<<<<< + * raise ValueError("Cannot add integral value to Timestamp " + * "without offset.") + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__pyx_t_2 == Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":750 + * elif is_integer_object(other): + * if self.offset is None: + * raise ValueError("Cannot add integral value to Timestamp " # <<<<<<<<<<<<<< + * "without offset.") + * return Timestamp((self.offset * other).apply(self), offset=self.offset) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":752 + * raise ValueError("Cannot add integral value to Timestamp " + * "without offset.") + * return Timestamp((self.offset * other).apply(self), offset=self.offset) # <<<<<<<<<<<<<< + * + * elif isinstance(other, timedelta) or hasattr(other, 'delta'): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_apply); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_offset, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":754 + * return Timestamp((self.offset * other).apply(self), offset=self.offset) + * + * elif isinstance(other, timedelta) or hasattr(other, 'delta'): # <<<<<<<<<<<<<< + * nanos = _delta_to_nanoseconds(other) + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) + */ + __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_8datetime_timedelta)); + if (!(__pyx_t_7 != 0)) { + __pyx_t_1 = PyObject_HasAttr(__pyx_v_other, __pyx_n_s_delta); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_1 != 0); + } else { + __pyx_t_8 = (__pyx_t_7 != 0); + } + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":755 + * + * elif isinstance(other, timedelta) or hasattr(other, 'delta'): + * nanos = _delta_to_nanoseconds(other) # <<<<<<<<<<<<<< + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) + * if getattr(other, 'normalize', False): + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_nanos = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":756 + * elif isinstance(other, timedelta) or hasattr(other, 'delta'): + * nanos = _delta_to_nanoseconds(other) + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) # <<<<<<<<<<<<<< + * if getattr(other, 'normalize', False): + * result = Timestamp(normalize_date(result)) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_nanos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_offset, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":757 + * nanos = _delta_to_nanoseconds(other) + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) + * if getattr(other, 'normalize', False): # <<<<<<<<<<<<<< + * result = Timestamp(normalize_date(result)) + * return result + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_s_normalize, Py_False); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":758 + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) + * if getattr(other, 'normalize', False): + * result = Timestamp(normalize_date(result)) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __pyx_f_6pandas_5tslib_normalize_date(__pyx_v_result, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":759 + * if getattr(other, 'normalize', False): + * result = Timestamp(normalize_date(result)) + * return result # <<<<<<<<<<<<<< + * + * result = datetime.__add__(self, other) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":761 + * return result + * + * result = datetime.__add__(self, other) # <<<<<<<<<<<<<< + * if isinstance(result, datetime): + * result = Timestamp(result) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":762 + * + * result = datetime.__add__(self, other) + * if isinstance(result, datetime): # <<<<<<<<<<<<<< + * result = Timestamp(result) + * result.nanosecond = self.nanosecond + */ + __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_result, ((PyObject*)__pyx_ptype_8datetime_datetime)); + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":763 + * result = datetime.__add__(self, other) + * if isinstance(result, datetime): + * result = Timestamp(result) # <<<<<<<<<<<<<< + * result.nanosecond = self.nanosecond + * return result + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":764 + * if isinstance(result, datetime): + * result = Timestamp(result) + * result.nanosecond = self.nanosecond # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_nanosecond, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/tslib.pyx":765 + * result = Timestamp(result) + * result.nanosecond = self.nanosecond + * return result # <<<<<<<<<<<<<< + * + * def __sub__(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":741 + * dts.us, ts.tzinfo) + * + * def __add__(self, other): # <<<<<<<<<<<<<< + * cdef int64_t other_int + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._Timestamp.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_nanos); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":767 + * return result + * + * def __sub__(self, other): # <<<<<<<<<<<<<< + * if is_timedelta64_object(other) or is_integer_object(other) \ + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_9__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_9__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_8__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_8__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_neg_other = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__sub__", 0); + + /* "pandas/tslib.pyx":768 + * + * def __sub__(self, other): + * if is_timedelta64_object(other) or is_integer_object(other) \ # <<<<<<<<<<<<<< + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + * neg_other = -other + */ + if (!(is_timedelta64_object(__pyx_v_other) != 0)) { + + /* "pandas/tslib.pyx":769 + * def __sub__(self, other): + * if is_timedelta64_object(other) or is_integer_object(other) \ + * or isinstance(other, timedelta) or hasattr(other, 'delta'): # <<<<<<<<<<<<<< + * neg_other = -other + * return self + neg_other + */ + if (!(is_integer_object(__pyx_v_other) != 0)) { + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_8datetime_timedelta)); + if (!__pyx_t_1) { + __pyx_t_2 = PyObject_HasAttr(__pyx_v_other, __pyx_n_s_delta); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = (is_integer_object(__pyx_v_other) != 0); + } + __pyx_t_3 = __pyx_t_1; + } else { + __pyx_t_3 = (is_timedelta64_object(__pyx_v_other) != 0); + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":770 + * if is_timedelta64_object(other) or is_integer_object(other) \ + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + * neg_other = -other # <<<<<<<<<<<<<< + * return self + neg_other + * elif other is NaT: + */ + __pyx_t_4 = PyNumber_Negative(__pyx_v_other); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_neg_other = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":771 + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + * neg_other = -other + * return self + neg_other # <<<<<<<<<<<<<< + * elif other is NaT: + * return NaT + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyNumber_Add(__pyx_v_self, __pyx_v_neg_other); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":772 + * neg_other = -other + * return self + neg_other + * elif other is NaT: # <<<<<<<<<<<<<< + * return NaT + * return datetime.__sub__(self, other) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_other == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":773 + * return self + neg_other + * elif other is NaT: + * return NaT # <<<<<<<<<<<<<< + * return datetime.__sub__(self, other) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":774 + * elif other is NaT: + * return NaT + * return datetime.__sub__(self, other) # <<<<<<<<<<<<<< + * + * cpdef _get_field(self, field): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_sub); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":767 + * return result + * + * def __sub__(self, other): # <<<<<<<<<<<<<< + * if is_timedelta64_object(other) or is_integer_object(other) \ + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._Timestamp.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_neg_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":776 + * return datetime.__sub__(self, other) + * + * cpdef _get_field(self, field): # <<<<<<<<<<<<<< + * out = get_date_field(np.array([self.value], dtype=np.int64), field) + * return out[0] + */ + +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_10_Timestamp__get_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field, int __pyx_skip_dispatch) { + PyObject *__pyx_v_out = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_field", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/tslib.pyx":777 + * + * cpdef _get_field(self, field): + * out = get_date_field(np.array([self.value], dtype=np.int64), field) # <<<<<<<<<<<<<< + * return out[0] + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_date_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_out = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":778 + * cpdef _get_field(self, field): + * out = get_date_field(np.array([self.value], dtype=np.int64), field) + * return out[0] # <<<<<<<<<<<<<< + * + * cpdef _get_start_end_field(self, field): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":776 + * return datetime.__sub__(self, other) + * + * cpdef _get_field(self, field): # <<<<<<<<<<<<<< + * out = get_date_field(np.array([self.value], dtype=np.int64), field) + * return out[0] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._Timestamp._get_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_field (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_10_get_field(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self), ((PyObject *)__pyx_v_field)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_10_get_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_field", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_get_field(__pyx_v_self, __pyx_v_field, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp._get_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":780 + * return out[0] + * + * cpdef _get_start_end_field(self, field): # <<<<<<<<<<<<<< + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 + * freqstr = self.freqstr if self.freq else None + */ + +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_10_Timestamp__get_start_end_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field, int __pyx_skip_dispatch) { + PyObject *__pyx_v_month_kw = NULL; + PyObject *__pyx_v_freqstr = NULL; + PyObject *__pyx_v_out = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_start_end_field", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/tslib.pyx":781 + * + * cpdef _get_start_end_field(self, field): + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 # <<<<<<<<<<<<<< + * freqstr = self.freqstr if self.freq else None + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_kwds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_kwds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_startingMonth); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_startingMonth); + __Pyx_GIVEREF(__pyx_n_s_startingMonth); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __Pyx_INCREF(__pyx_int_12); + __pyx_t_1 = __pyx_int_12; + } + __pyx_v_month_kw = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":782 + * cpdef _get_start_end_field(self, field): + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 + * freqstr = self.freqstr if self.freq else None # <<<<<<<<<<<<<< + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) + * return out[0] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freq); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freqstr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } + __pyx_v_freqstr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":783 + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 + * freqstr = self.freqstr if self.freq else None + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) # <<<<<<<<<<<<<< + * return out[0] + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_start_end_field_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + __Pyx_INCREF(__pyx_v_freqstr); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_freqstr); + __Pyx_GIVEREF(__pyx_v_freqstr); + __Pyx_INCREF(__pyx_v_month_kw); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_month_kw); + __Pyx_GIVEREF(__pyx_v_month_kw); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_out = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":784 + * freqstr = self.freqstr if self.freq else None + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) + * return out[0] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":780 + * return out[0] + * + * cpdef _get_start_end_field(self, field): # <<<<<<<<<<<<<< + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 + * freqstr = self.freqstr if self.freq else None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.tslib._Timestamp._get_start_end_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_month_kw); + __Pyx_XDECREF(__pyx_v_freqstr); + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_start_end_field (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_12_get_start_end_field(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self), ((PyObject *)__pyx_v_field)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_12_get_start_end_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_start_end_field", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_get_start_end_field(__pyx_v_self, __pyx_v_field, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp._get_start_end_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":651 + * cdef class _Timestamp(datetime): + * cdef readonly: + * int64_t value, nanosecond # <<<<<<<<<<<<<< + * object offset # frequency reference + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_5value___get__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_5value___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_10nanosecond_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_10nanosecond_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_10nanosecond___get__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_10nanosecond___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nanosecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp.nanosecond.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":652 + * cdef readonly: + * int64_t value, nanosecond + * object offset # frequency reference # <<<<<<<<<<<<<< + * + * def __hash__(_Timestamp self): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_6offset_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_6offset___get__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_6offset___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->offset); + __pyx_r = __pyx_v_self->offset; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":790 + * + * + * cdef inline bint is_timestamp(object o): # <<<<<<<<<<<<<< + * return Py_TYPE(o) == ts_type # isinstance(o, Timestamp) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib_is_timestamp(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timestamp", 0); + + /* "pandas/tslib.pyx":791 + * + * cdef inline bint is_timestamp(object o): + * return Py_TYPE(o) == ts_type # isinstance(o, Timestamp) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = (Py_TYPE(__pyx_v_o) == __pyx_v_6pandas_5tslib_ts_type); + goto __pyx_L0; + + /* "pandas/tslib.pyx":790 + * + * + * cdef inline bint is_timestamp(object o): # <<<<<<<<<<<<<< + * return Py_TYPE(o) == ts_type # isinstance(o, Timestamp) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":806 + * cdef class _NaT(_Timestamp): + * + * def __hash__(_NaT self): # <<<<<<<<<<<<<< + * # py3k needs this defined here + * return hash(self.value) + */ + +/* Python wrapper */ +static Py_hash_t __pyx_pw_6pandas_5tslib_4_NaT_1__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_6pandas_5tslib_4_NaT_1__hash__(PyObject *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_4_NaT___hash__(((struct __pyx_obj_6pandas_5tslib__NaT *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_hash_t __pyx_pf_6pandas_5tslib_4_NaT___hash__(struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_hash_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "pandas/tslib.pyx":808 + * def __hash__(_NaT self): + * # py3k needs this defined here + * return hash(self.value) # <<<<<<<<<<<<<< + * + * def __richcmp__(_NaT self, object other, int op): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "pandas/tslib.pyx":806 + * cdef class _NaT(_Timestamp): + * + * def __hash__(_NaT self): # <<<<<<<<<<<<<< + * # py3k needs this defined here + * return hash(self.value) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._NaT.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":810 + * return hash(self.value) + * + * def __richcmp__(_NaT self, object other, int op): # <<<<<<<<<<<<<< + * cdef int ndim = getattr(other, 'ndim', -1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_5tslib__NaT, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_4_NaT_2__richcmp__(((struct __pyx_obj_6pandas_5tslib__NaT *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_2__richcmp__(struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + int __pyx_v_ndim; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__richcmp__", 0); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/tslib.pyx":811 + * + * def __richcmp__(_NaT self, object other, int op): + * cdef int ndim = getattr(other, 'ndim', -1) # <<<<<<<<<<<<<< + * + * if ndim == -1: + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_s_ndim, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_ndim = __pyx_t_2; + + /* "pandas/tslib.pyx":813 + * cdef int ndim = getattr(other, 'ndim', -1) + * + * if ndim == -1: # <<<<<<<<<<<<<< + * return _nat_scalar_rules[op] + * + */ + __pyx_t_3 = ((__pyx_v_ndim == -1) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":814 + * + * if ndim == -1: + * return _nat_scalar_rules[op] # <<<<<<<<<<<<<< + * + * if ndim == 0: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_6pandas_5tslib__nat_scalar_rules[__pyx_v_op])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":816 + * return _nat_scalar_rules[op] + * + * if ndim == 0: # <<<<<<<<<<<<<< + * if isinstance(other, np.datetime64): + * other = Timestamp(other) + */ + __pyx_t_3 = ((__pyx_v_ndim == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":817 + * + * if ndim == 0: + * if isinstance(other, np.datetime64): # <<<<<<<<<<<<<< + * other = Timestamp(other) + * else: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_IsInstance(__pyx_v_other, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = (__pyx_t_3 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":818 + * if ndim == 0: + * if isinstance(other, np.datetime64): + * other = Timestamp(other) # <<<<<<<<<<<<<< + * else: + * raise TypeError('Cannot compare type %r with type %r' % + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":821 + * else: + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, type(other).__name__)) # <<<<<<<<<<<<<< + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_other)), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_6 = 0; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":820 + * other = Timestamp(other) + * else: + * raise TypeError('Cannot compare type %r with type %r' % # <<<<<<<<<<<<<< + * (type(self).__name__, type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_compare_type_r_with_type, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":822 + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) # <<<<<<<<<<<<<< + * + * def __add__(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_other, ((PyObject *)__pyx_v_self), (__pyx_v_6pandas_5tslib__reverse_ops[__pyx_v_op])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":810 + * return hash(self.value) + * + * def __richcmp__(_NaT self, object other, int op): # <<<<<<<<<<<<<< + * cdef int ndim = getattr(other, 'ndim', -1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._NaT.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":824 + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * + * def __add__(self, other): # <<<<<<<<<<<<<< + * try: + * result = _Timestamp.__add__(self, other) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_4_NaT_4__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_4__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 0); + + /* "pandas/tslib.pyx":825 + * + * def __add__(self, other): + * try: # <<<<<<<<<<<<<< + * result = _Timestamp.__add__(self, other) + * if result is NotImplemented: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":826 + * def __add__(self, other): + * try: + * result = _Timestamp.__add__(self, other) # <<<<<<<<<<<<<< + * if result is NotImplemented: + * return result + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp)), __pyx_n_s_add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":827 + * try: + * result = _Timestamp.__add__(self, other) + * if result is NotImplemented: # <<<<<<<<<<<<<< + * return result + * except (OverflowError, OutOfBoundsDatetime): + */ + __pyx_t_7 = (__pyx_v_result == __pyx_builtin_NotImplemented); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":828 + * result = _Timestamp.__add__(self, other) + * if result is NotImplemented: + * return result # <<<<<<<<<<<<<< + * except (OverflowError, OutOfBoundsDatetime): + * pass + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":829 + * if result is NotImplemented: + * return result + * except (OverflowError, OutOfBoundsDatetime): # <<<<<<<<<<<<<< + * pass + * return NaT + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError) || PyErr_ExceptionMatches(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + PyErr_Restore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":831 + * except (OverflowError, OutOfBoundsDatetime): + * pass + * return NaT # <<<<<<<<<<<<<< + * + * def __sub__(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":824 + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * + * def __add__(self, other): # <<<<<<<<<<<<<< + * try: + * result = _Timestamp.__add__(self, other) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._NaT.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":833 + * return NaT + * + * def __sub__(self, other): # <<<<<<<<<<<<<< + * if type(self) is datetime: + * other, self = self, other + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_7__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_7__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_4_NaT_6__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_6__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__sub__", 0); + __Pyx_INCREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/tslib.pyx":834 + * + * def __sub__(self, other): + * if type(self) is datetime: # <<<<<<<<<<<<<< + * other, self = self, other + * try: + */ + __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_self)) == ((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime))); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":835 + * def __sub__(self, other): + * if type(self) is datetime: + * other, self = self, other # <<<<<<<<<<<<<< + * try: + * result = _Timestamp.__sub__(self, other) + */ + __pyx_t_3 = __pyx_v_self; + __pyx_t_4 = __pyx_v_other; + __pyx_v_other = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_self = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":836 + * if type(self) is datetime: + * other, self = self, other + * try: # <<<<<<<<<<<<<< + * result = _Timestamp.__sub__(self, other) + * if result is NotImplemented: + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "pandas/tslib.pyx":837 + * other, self = self, other + * try: + * result = _Timestamp.__sub__(self, other) # <<<<<<<<<<<<<< + * if result is NotImplemented: + * return result + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp)), __pyx_n_s_sub); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_result = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":838 + * try: + * result = _Timestamp.__sub__(self, other) + * if result is NotImplemented: # <<<<<<<<<<<<<< + * return result + * except (OverflowError, OutOfBoundsDatetime): + */ + __pyx_t_2 = (__pyx_v_result == __pyx_builtin_NotImplemented); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":839 + * result = _Timestamp.__sub__(self, other) + * if result is NotImplemented: + * return result # <<<<<<<<<<<<<< + * except (OverflowError, OutOfBoundsDatetime): + * pass + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L8_try_return; + } + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":840 + * if result is NotImplemented: + * return result + * except (OverflowError, OutOfBoundsDatetime): # <<<<<<<<<<<<<< + * pass + * return NaT + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError) || PyErr_ExceptionMatches(__pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + PyErr_Restore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L8_try_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_5); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_5); + __pyx_L11_try_end:; + } + + /* "pandas/tslib.pyx":842 + * except (OverflowError, OutOfBoundsDatetime): + * pass + * return NaT # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":833 + * return NaT + * + * def __sub__(self, other): # <<<<<<<<<<<<<< + * if type(self) is datetime: + * other, self = self, other + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.tslib._NaT.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_self); + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":845 + * + * + * def _delta_to_nanoseconds(delta): # <<<<<<<<<<<<<< + * if hasattr(delta, 'delta'): + * delta = delta.delta + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_13_delta_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_delta); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_13_delta_to_nanoseconds = {__Pyx_NAMESTR("_delta_to_nanoseconds"), (PyCFunction)__pyx_pw_6pandas_5tslib_13_delta_to_nanoseconds, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_13_delta_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_delta) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_delta_to_nanoseconds (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_12_delta_to_nanoseconds(__pyx_self, ((PyObject *)__pyx_v_delta)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_12_delta_to_nanoseconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_delta) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_delta_to_nanoseconds", 0); + __Pyx_INCREF(__pyx_v_delta); + + /* "pandas/tslib.pyx":846 + * + * def _delta_to_nanoseconds(delta): + * if hasattr(delta, 'delta'): # <<<<<<<<<<<<<< + * delta = delta.delta + * if is_timedelta64_object(delta): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_delta, __pyx_n_s_delta); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":847 + * def _delta_to_nanoseconds(delta): + * if hasattr(delta, 'delta'): + * delta = delta.delta # <<<<<<<<<<<<<< + * if is_timedelta64_object(delta): + * return delta.astype("timedelta64[ns]").item() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_delta); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_delta, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":848 + * if hasattr(delta, 'delta'): + * delta = delta.delta + * if is_timedelta64_object(delta): # <<<<<<<<<<<<<< + * return delta.astype("timedelta64[ns]").item() + * if is_integer_object(delta): + */ + __pyx_t_2 = (is_timedelta64_object(__pyx_v_delta) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":849 + * delta = delta.delta + * if is_timedelta64_object(delta): + * return delta.astype("timedelta64[ns]").item() # <<<<<<<<<<<<<< + * if is_integer_object(delta): + * return delta + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_item); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":850 + * if is_timedelta64_object(delta): + * return delta.astype("timedelta64[ns]").item() + * if is_integer_object(delta): # <<<<<<<<<<<<<< + * return delta + * return (delta.days * 24 * 60 * 60 * 1000000 + */ + __pyx_t_2 = (is_integer_object(__pyx_v_delta) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":851 + * return delta.astype("timedelta64[ns]").item() + * if is_integer_object(delta): + * return delta # <<<<<<<<<<<<<< + * return (delta.days * 24 * 60 * 60 * 1000000 + * + delta.seconds * 1000000 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_delta); + __pyx_r = __pyx_v_delta; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":852 + * if is_integer_object(delta): + * return delta + * return (delta.days * 24 * 60 * 60 * 1000000 # <<<<<<<<<<<<<< + * + delta.seconds * 1000000 + * + delta.microseconds) * 1000 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_days); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_24); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_int_60); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_60); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_int_1000000); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":853 + * return delta + * return (delta.days * 24 * 60 * 60 * 1000000 + * + delta.seconds * 1000000 # <<<<<<<<<<<<<< + * + delta.microseconds) * 1000 + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_seconds); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_int_1000000); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":854 + * return (delta.days * 24 * 60 * 60 * 1000000 + * + delta.seconds * 1000000 + * + delta.microseconds) * 1000 # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":845 + * + * + * def _delta_to_nanoseconds(delta): # <<<<<<<<<<<<<< + * if hasattr(delta, 'delta'): + * delta = delta.delta + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib._delta_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":865 + * + * property value: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.value + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9_TSObject_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_9_TSObject_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9_TSObject_5value___get__(((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9_TSObject_5value___get__(struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/tslib.pyx":866 + * property value: + * def __get__(self): + * return self.value # <<<<<<<<<<<<<< + * + * cpdef _get_utcoffset(tzinfo, obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":865 + * + * property value: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.value + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._TSObject.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":868 + * return self.value + * + * cpdef _get_utcoffset(tzinfo, obj): # <<<<<<<<<<<<<< + * try: + * return tzinfo._utcoffset + */ + +static PyObject *__pyx_pw_6pandas_5tslib_15_get_utcoffset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_utcoffset(PyObject *__pyx_v_tzinfo, PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_utcoffset", 0); + + /* "pandas/tslib.pyx":869 + * + * cpdef _get_utcoffset(tzinfo, obj): + * try: # <<<<<<<<<<<<<< + * return tzinfo._utcoffset + * except AttributeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":870 + * cpdef _get_utcoffset(tzinfo, obj): + * try: + * return tzinfo._utcoffset # <<<<<<<<<<<<<< + * except AttributeError: + * return tzinfo.utcoffset(obj) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_utcoffset_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":871 + * try: + * return tzinfo._utcoffset + * except AttributeError: # <<<<<<<<<<<<<< + * return tzinfo.utcoffset(obj) + * + */ + __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_5) { + __Pyx_AddTraceback("pandas.tslib._get_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":872 + * return tzinfo._utcoffset + * except AttributeError: + * return tzinfo.utcoffset(obj) # <<<<<<<<<<<<<< + * + * # helper to extract datetime and int64 from several different possibilities + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":868 + * return self.value + * + * cpdef _get_utcoffset(tzinfo, obj): # <<<<<<<<<<<<<< + * try: + * return tzinfo._utcoffset + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.tslib._get_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_15_get_utcoffset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_15_get_utcoffset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_tzinfo = 0; + PyObject *__pyx_v_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_utcoffset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tzinfo,&__pyx_n_s_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_get_utcoffset", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_utcoffset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_tzinfo = values[0]; + __pyx_v_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_utcoffset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib._get_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_14_get_utcoffset(__pyx_self, __pyx_v_tzinfo, __pyx_v_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_14_get_utcoffset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tzinfo, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_utcoffset", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tzinfo, __pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._get_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":875 + * + * # helper to extract datetime and int64 from several different possibilities + * cdef convert_to_tsobject(object ts, object tz, object unit): # <<<<<<<<<<<<<< + * """ + * Extract datetime and int64 from any of: + */ + +static PyObject *__pyx_f_6pandas_5tslib_convert_to_tsobject(PyObject *__pyx_v_ts, PyObject *__pyx_v_tz, PyObject *__pyx_v_unit) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_obj = 0; + CYTHON_UNUSED int __pyx_v_utc_convert; + PyObject *__pyx_v_ts_offset = NULL; + PyObject *__pyx_v_tz_offset = NULL; + PyObject *__pyx_v_offset = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_8; + npy_datetime __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + npy_int32 __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_to_tsobject", 0); + __Pyx_INCREF(__pyx_v_ts); + __Pyx_INCREF(__pyx_v_tz); + + /* "pandas/tslib.pyx":888 + * cdef: + * _TSObject obj + * bint utc_convert = 1 # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_v_utc_convert = 1; + + /* "pandas/tslib.pyx":890 + * bint utc_convert = 1 + * + * if tz is not None: # <<<<<<<<<<<<<< + * tz = maybe_get_tz(tz) + * + */ + __pyx_t_1 = (__pyx_v_tz != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":891 + * + * if tz is not None: + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * + * obj = _TSObject() + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":893 + * tz = maybe_get_tz(tz) + * + * obj = _TSObject() # <<<<<<<<<<<<<< + * + * if ts is None or ts is NaT or ts is np_NaT: + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__TSObject)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":895 + * obj = _TSObject() + * + * if ts is None or ts is NaT or ts is np_NaT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * elif is_datetime64_object(ts): + */ + __pyx_t_2 = (__pyx_v_ts == Py_None); + if (!(__pyx_t_2 != 0)) { + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__pyx_v_ts == __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(__pyx_t_1 != 0)) { + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = (__pyx_v_ts == __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + } else { + __pyx_t_5 = (__pyx_t_1 != 0); + } + __pyx_t_1 = __pyx_t_5; + } else { + __pyx_t_1 = (__pyx_t_2 != 0); + } + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":896 + * + * if ts is None or ts is NaT or ts is np_NaT: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * elif is_datetime64_object(ts): + * if ts.view('i8') == iNaT: + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":897 + * if ts is None or ts is NaT or ts is np_NaT: + * obj.value = NPY_NAT + * elif is_datetime64_object(ts): # <<<<<<<<<<<<<< + * if ts.view('i8') == iNaT: + * obj.value = NPY_NAT + */ + __pyx_t_1 = (is_datetime64_object(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":898 + * obj.value = NPY_NAT + * elif is_datetime64_object(ts): + * if ts.view('i8') == iNaT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":899 + * elif is_datetime64_object(ts): + * if ts.view('i8') == iNaT: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * else: + * obj.value = _get_datetime64_nanos(ts) + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":901 + * obj.value = NPY_NAT + * else: + * obj.value = _get_datetime64_nanos(ts) # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * elif is_integer_object(ts): + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib__get_datetime64_nanos(__pyx_v_ts); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":902 + * else: + * obj.value = _get_datetime64_nanos(ts) + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * elif is_integer_object(ts): + * if ts == NPY_NAT: + */ + pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L5:; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":903 + * obj.value = _get_datetime64_nanos(ts) + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * elif is_integer_object(ts): # <<<<<<<<<<<<<< + * if ts == NPY_NAT: + * obj.value = NPY_NAT + */ + __pyx_t_1 = (is_integer_object(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":904 + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * elif is_integer_object(ts): + * if ts == NPY_NAT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_ts, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":905 + * elif is_integer_object(ts): + * if ts == NPY_NAT: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * else: + * ts = ts * cast_from_unit(None,unit) + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/tslib.pyx":907 + * obj.value = NPY_NAT + * else: + * ts = ts * cast_from_unit(None,unit) # <<<<<<<<<<<<<< + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib_cast_from_unit(Py_None, __pyx_v_unit, 0); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyNumber_Multiply(__pyx_v_ts, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":908 + * else: + * ts = ts * cast_from_unit(None,unit) + * obj.value = ts # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_float_object(ts): + */ + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":909 + * ts = ts * cast_from_unit(None,unit) + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * elif util.is_float_object(ts): + * if ts != ts or ts == NPY_NAT: + */ + __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_9 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + pandas_datetime_to_datetimestruct(__pyx_t_9, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L6:; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":910 + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_float_object(ts): # <<<<<<<<<<<<<< + * if ts != ts or ts == NPY_NAT: + * obj.value = NPY_NAT + */ + __pyx_t_1 = (is_float_object(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":911 + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_float_object(ts): + * if ts != ts or ts == NPY_NAT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_ts, __pyx_v_ts, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_1) { + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_ts, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":912 + * elif util.is_float_object(ts): + * if ts != ts or ts == NPY_NAT: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * else: + * ts = cast_from_unit(ts,unit) + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":914 + * obj.value = NPY_NAT + * else: + * ts = cast_from_unit(ts,unit) # <<<<<<<<<<<<<< + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib_cast_from_unit(__pyx_v_ts, __pyx_v_unit, 0); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":915 + * else: + * ts = cast_from_unit(ts,unit) + * obj.value = ts # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_string_object(ts): + */ + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":916 + * ts = cast_from_unit(ts,unit) + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * elif util.is_string_object(ts): + * if ts in _nat_strings: + */ + __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_9 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + pandas_datetime_to_datetimestruct(__pyx_t_9, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L7:; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":917 + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_string_object(ts): # <<<<<<<<<<<<<< + * if ts in _nat_strings: + * obj.value = NPY_NAT + */ + __pyx_t_5 = (is_string_object(__pyx_v_ts) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":918 + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_string_object(ts): + * if ts in _nat_strings: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_strings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_ts, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":919 + * elif util.is_string_object(ts): + * if ts in _nat_strings: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * else: + * _string_to_dts(ts, &obj.dts) + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/tslib.pyx":921 + * obj.value = NPY_NAT + * else: + * _string_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts) + * elif PyDateTime_Check(ts): + */ + __pyx_t_3 = __pyx_f_8datetime__string_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":922 + * else: + * _string_to_dts(ts, &obj.dts) + * obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * elif PyDateTime_Check(ts): + * if tz is not None: + */ + __pyx_v_obj->value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L8:; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":923 + * _string_to_dts(ts, &obj.dts) + * obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts) + * elif PyDateTime_Check(ts): # <<<<<<<<<<<<<< + * if tz is not None: + * # sort of a temporary hack + */ + __pyx_t_1 = (PyDateTime_Check(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":924 + * obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts) + * elif PyDateTime_Check(ts): + * if tz is not None: # <<<<<<<<<<<<<< + * # sort of a temporary hack + * if ts.tzinfo is not None: + */ + __pyx_t_1 = (__pyx_v_tz != Py_None); + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":926 + * if tz is not None: + * # sort of a temporary hack + * if ts.tzinfo is not None: # <<<<<<<<<<<<<< + * if (hasattr(tz, 'normalize') and + * hasattr(ts.tzinfo, '_utcoffset')): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_t_3 != Py_None); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":927 + * # sort of a temporary hack + * if ts.tzinfo is not None: + * if (hasattr(tz, 'normalize') and # <<<<<<<<<<<<<< + * hasattr(ts.tzinfo, '_utcoffset')): + * ts = tz.normalize(ts) + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_normalize); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if ((__pyx_t_1 != 0)) { + + /* "pandas/tslib.pyx":928 + * if ts.tzinfo is not None: + * if (hasattr(tz, 'normalize') and + * hasattr(ts.tzinfo, '_utcoffset')): # <<<<<<<<<<<<<< + * ts = tz.normalize(ts) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_HasAttr(__pyx_t_3, __pyx_n_s_utcoffset_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__pyx_t_5 != 0); + } else { + __pyx_t_2 = (__pyx_t_1 != 0); + } + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":929 + * if (hasattr(tz, 'normalize') and + * hasattr(ts.tzinfo, '_utcoffset')): + * ts = tz.normalize(ts) # <<<<<<<<<<<<<< + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_normalize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":930 + * hasattr(ts.tzinfo, '_utcoffset')): + * ts = tz.normalize(ts) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = ts.tzinfo + * else: #tzoffset + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":931 + * ts = tz.normalize(ts) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo # <<<<<<<<<<<<<< + * else: #tzoffset + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/tslib.pyx":933 + * obj.tzinfo = ts.tzinfo + * else: #tzoffset + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * ts_offset = _get_utcoffset(ts.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(ts_offset) + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":934 + * else: #tzoffset + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * ts_offset = _get_utcoffset(ts.tzinfo, ts) # <<<<<<<<<<<<<< + * obj.value -= _delta_to_nanoseconds(ts_offset) + * tz_offset = _get_utcoffset(tz, ts) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_t_6, __pyx_v_ts, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_ts_offset = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":935 + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * ts_offset = _get_utcoffset(ts.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(ts_offset) # <<<<<<<<<<<<<< + * tz_offset = _get_utcoffset(tz, ts) + * obj.value += _delta_to_nanoseconds(tz_offset) + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_ts_offset); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ts_offset); + __Pyx_GIVEREF(__pyx_v_ts_offset); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":936 + * ts_offset = _get_utcoffset(ts.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(ts_offset) + * tz_offset = _get_utcoffset(tz, ts) # <<<<<<<<<<<<<< + * obj.value += _delta_to_nanoseconds(tz_offset) + * pandas_datetime_to_datetimestruct(obj.value, + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, __pyx_v_ts, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_tz_offset = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":937 + * obj.value -= _delta_to_nanoseconds(ts_offset) + * tz_offset = _get_utcoffset(tz, ts) + * obj.value += _delta_to_nanoseconds(tz_offset) # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value, + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_tz_offset); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_tz_offset); + __Pyx_GIVEREF(__pyx_v_tz_offset); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":938 + * tz_offset = _get_utcoffset(tz, ts) + * obj.value += _delta_to_nanoseconds(tz_offset) + * pandas_datetime_to_datetimestruct(obj.value, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + */ + pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":940 + * pandas_datetime_to_datetimestruct(obj.value, + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * elif not _is_utc(tz): + * try: + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + } + __pyx_L11:; + goto __pyx_L10; + } + + /* "pandas/tslib.pyx":941 + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + * elif not _is_utc(tz): # <<<<<<<<<<<<<< + * try: + * ts = tz.localize(ts) + */ + __pyx_t_2 = ((!(__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":942 + * obj.tzinfo = tz + * elif not _is_utc(tz): + * try: # <<<<<<<<<<<<<< + * ts = tz.localize(ts) + * except AttributeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":943 + * elif not _is_utc(tz): + * try: + * ts = tz.localize(ts) # <<<<<<<<<<<<<< + * except AttributeError: + * ts = ts.replace(tzinfo=tz) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_localize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L19_try_end; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":944 + * try: + * ts = tz.localize(ts) + * except AttributeError: # <<<<<<<<<<<<<< + * ts = ts.replace(tzinfo=tz) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + */ + __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_14) { + __Pyx_AddTraceback("pandas.tslib.convert_to_tsobject", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":945 + * ts = tz.localize(ts) + * except AttributeError: + * ts = ts.replace(tzinfo=tz) # <<<<<<<<<<<<<< + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_replace); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __Pyx_GOTREF(__pyx_t_15); + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_tzinfo, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_16); + __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L13_exception_handled; + } + goto __pyx_L14_except_error; + __pyx_L14_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L1_error; + __pyx_L13_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L19_try_end:; + } + + /* "pandas/tslib.pyx":946 + * except AttributeError: + * ts = ts.replace(tzinfo=tz) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = ts.tzinfo + * else: + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":947 + * ts = ts.replace(tzinfo=tz) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo # <<<<<<<<<<<<<< + * else: + * # UTC + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/tslib.pyx":950 + * else: + * # UTC + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = pytz.utc + * else: + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":951 + * # UTC + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = pytz.utc # <<<<<<<<<<<<<< + * else: + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_utc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L10:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/tslib.pyx":953 + * obj.tzinfo = pytz.utc + * else: + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = ts.tzinfo + * + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":954 + * else: + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo # <<<<<<<<<<<<<< + * + * if obj.tzinfo is not None and not _is_utc(obj.tzinfo): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L9:; + + /* "pandas/tslib.pyx":956 + * obj.tzinfo = ts.tzinfo + * + * if obj.tzinfo is not None and not _is_utc(obj.tzinfo): # <<<<<<<<<<<<<< + * offset = _get_utcoffset(obj.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(offset) + */ + __pyx_t_2 = (__pyx_v_obj->tzinfo != Py_None); + if ((__pyx_t_2 != 0)) { + __pyx_t_6 = __pyx_v_obj->tzinfo; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = ((!(__pyx_f_6pandas_5tslib__is_utc(__pyx_t_6) != 0)) != 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __pyx_t_1; + } else { + __pyx_t_5 = (__pyx_t_2 != 0); + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":957 + * + * if obj.tzinfo is not None and not _is_utc(obj.tzinfo): + * offset = _get_utcoffset(obj.tzinfo, ts) # <<<<<<<<<<<<<< + * obj.value -= _delta_to_nanoseconds(offset) + * + */ + __pyx_t_6 = __pyx_v_obj->tzinfo; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_t_6, __pyx_v_ts, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_offset = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":958 + * if obj.tzinfo is not None and not _is_utc(obj.tzinfo): + * offset = _get_utcoffset(obj.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(offset) # <<<<<<<<<<<<<< + * + * if is_timestamp(ts): + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_offset); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_offset); + __Pyx_GIVEREF(__pyx_v_offset); + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_7, __pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_obj->value = __pyx_t_8; + goto __pyx_L22; + } + __pyx_L22:; + + /* "pandas/tslib.pyx":960 + * obj.value -= _delta_to_nanoseconds(offset) + * + * if is_timestamp(ts): # <<<<<<<<<<<<<< + * obj.value += ts.nanosecond + * obj.dts.ps = ts.nanosecond * 1000 + */ + __pyx_t_5 = (__pyx_f_6pandas_5tslib_is_timestamp(__pyx_v_ts) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":961 + * + * if is_timestamp(ts): + * obj.value += ts.nanosecond # <<<<<<<<<<<<<< + * obj.dts.ps = ts.nanosecond * 1000 + * _check_dts_bounds(&obj.dts) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":962 + * if is_timestamp(ts): + * obj.value += ts.nanosecond + * obj.dts.ps = ts.nanosecond * 1000 # <<<<<<<<<<<<<< + * _check_dts_bounds(&obj.dts) + * return obj + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_16 = PyNumber_Multiply(__pyx_t_7, __pyx_int_1000); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_17 = __Pyx_PyInt_As_npy_int32(__pyx_t_16); if (unlikely((__pyx_t_17 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_obj->dts.ps = __pyx_t_17; + goto __pyx_L23; + } + __pyx_L23:; + + /* "pandas/tslib.pyx":963 + * obj.value += ts.nanosecond + * obj.dts.ps = ts.nanosecond * 1000 + * _check_dts_bounds(&obj.dts) # <<<<<<<<<<<<<< + * return obj + * elif PyDate_Check(ts): + */ + __pyx_t_16 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":964 + * obj.dts.ps = ts.nanosecond * 1000 + * _check_dts_bounds(&obj.dts) + * return obj # <<<<<<<<<<<<<< + * elif PyDate_Check(ts): + * # Keep the converter same as PyDateTime's + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_obj)); + __pyx_r = ((PyObject *)__pyx_v_obj); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":965 + * _check_dts_bounds(&obj.dts) + * return obj + * elif PyDate_Check(ts): # <<<<<<<<<<<<<< + * # Keep the converter same as PyDateTime's + * ts = datetime.combine(ts, datetime_time()) + */ + __pyx_t_5 = (PyDate_Check(__pyx_v_ts) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":967 + * elif PyDate_Check(ts): + * # Keep the converter same as PyDateTime's + * ts = datetime.combine(ts, datetime_time()) # <<<<<<<<<<<<<< + * return convert_to_tsobject(ts, tz, None) + * else: + */ + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_combine); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_time); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":968 + * # Keep the converter same as PyDateTime's + * ts = datetime.combine(ts, datetime_time()) + * return convert_to_tsobject(ts, tz, None) # <<<<<<<<<<<<<< + * else: + * raise ValueError("Could not construct Timestamp from argument %s" % + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_ts, __pyx_v_tz, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":970 + * return convert_to_tsobject(ts, tz, None) + * else: + * raise ValueError("Could not construct Timestamp from argument %s" % # <<<<<<<<<<<<<< + * type(ts)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Could_not_construct_Timestamp_fr, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + + /* "pandas/tslib.pyx":973 + * type(ts)) + * + * if obj.value != NPY_NAT: # <<<<<<<<<<<<<< + * _check_dts_bounds(&obj.dts) + * + */ + __pyx_t_5 = ((__pyx_v_obj->value != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":974 + * + * if obj.value != NPY_NAT: + * _check_dts_bounds(&obj.dts) # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L24; + } + __pyx_L24:; + + /* "pandas/tslib.pyx":976 + * _check_dts_bounds(&obj.dts) + * + * if tz is not None: # <<<<<<<<<<<<<< + * _localize_tso(obj, tz) + * + */ + __pyx_t_5 = (__pyx_v_tz != Py_None); + __pyx_t_2 = (__pyx_t_5 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":977 + * + * if tz is not None: + * _localize_tso(obj, tz) # <<<<<<<<<<<<<< + * + * return obj + */ + __pyx_f_6pandas_5tslib__localize_tso(__pyx_v_obj, __pyx_v_tz); + goto __pyx_L25; + } + __pyx_L25:; + + /* "pandas/tslib.pyx":979 + * _localize_tso(obj, tz) + * + * return obj # <<<<<<<<<<<<<< + * + * cdef inline void _localize_tso(_TSObject obj, object tz): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_obj)); + __pyx_r = ((PyObject *)__pyx_v_obj); + goto __pyx_L0; + + /* "pandas/tslib.pyx":875 + * + * # helper to extract datetime and int64 from several different possibilities + * cdef convert_to_tsobject(object ts, object tz, object unit): # <<<<<<<<<<<<<< + * """ + * Extract datetime and int64 from any of: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("pandas.tslib.convert_to_tsobject", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_ts_offset); + __Pyx_XDECREF(__pyx_v_tz_offset); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XDECREF(__pyx_v_ts); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":981 + * return obj + * + * cdef inline void _localize_tso(_TSObject obj, object tz): # <<<<<<<<<<<<<< + * ''' + * Take a TSObject in UTC and localizes to timezone tz. + */ + +static CYTHON_INLINE void __pyx_f_6pandas_5tslib__localize_tso(struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_obj, PyObject *__pyx_v_tz) { + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v_trans = NULL; + PyObject *__pyx_v_deltas = NULL; + PyObject *__pyx_v_pos = NULL; + PyObject *__pyx_v_inf = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + npy_datetime __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_localize_tso", 0); + + /* "pandas/tslib.pyx":985 + * Take a TSObject in UTC and localizes to timezone tz. + * ''' + * if _is_utc(tz): # <<<<<<<<<<<<<< + * obj.tzinfo = tz + * elif _is_tzlocal(tz): + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":986 + * ''' + * if _is_utc(tz): + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz): + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":987 + * if _is_utc(tz): + * obj.tzinfo = tz + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":988 + * obj.tzinfo = tz + * elif _is_tzlocal(tz): + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + */ + pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":989 + * elif _is_tzlocal(tz): + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, # <<<<<<<<<<<<<< + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.month); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.hour); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":990 + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(obj.value + delta, + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.sec); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.us); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/tslib.pyx":989 + * elif _is_tzlocal(tz): + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, # <<<<<<<<<<<<<< + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dt = ((PyDateTime_DateTime *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":991 + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value + delta, + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Multiply(__pyx_t_9, __pyx_int_1000000000); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_delta = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":992 + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(obj.value + delta, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_delta); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_10 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":993 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(obj.value + delta, + * PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = tz + * else: + */ + pandas_datetime_to_datetimestruct(__pyx_t_10, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":994 + * pandas_datetime_to_datetimestruct(obj.value + delta, + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":997 + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * pos = trans.searchsorted(obj.value, side='right') - 1 + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_trans = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":998 + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(obj.value, side='right') - 1 + * + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_deltas = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":999 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * pos = trans.searchsorted(obj.value, side='right') - 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Subtract(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_pos = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1003 + * + * # static/pytz/dateutil specific code + * if _is_fixed_offset(tz): # <<<<<<<<<<<<<< + * # statictzinfo + * if len(deltas) > 0: + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__is_fixed_offset(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1005 + * if _is_fixed_offset(tz): + * # statictzinfo + * if len(deltas) > 0: # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value + deltas[0], + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_11 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((__pyx_t_11 > 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1006 + * # statictzinfo + * if len(deltas) > 0: + * pandas_datetime_to_datetimestruct(obj.value + deltas[0], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * else: + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_deltas, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_10 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1007 + * if len(deltas) > 0: + * pandas_datetime_to_datetimestruct(obj.value + deltas[0], + * PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * else: + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + */ + pandas_datetime_to_datetimestruct(__pyx_t_10, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1009 + * PANDAS_FR_ns, &obj.dts) + * else: + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = tz + * elif _treat_tz_as_pytz(tz): + */ + pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L5:; + + /* "pandas/tslib.pyx":1010 + * else: + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * elif _treat_tz_as_pytz(tz): + * inf = tz._transition_info[pos] + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":1011 + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + * elif _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * inf = tz._transition_info[pos] + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1012 + * obj.tzinfo = tz + * elif _treat_tz_as_pytz(tz): + * inf = tz._transition_info[pos] # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyObject_GetItem(__pyx_t_7, __pyx_v_pos); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_inf = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1013 + * elif _treat_tz_as_pytz(tz): + * inf = tz._transition_info[pos] + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz._tzinfos[inf] + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_10 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1014 + * inf = tz._transition_info[pos] + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = tz._tzinfos[inf] + * elif _treat_tz_as_dateutil(tz): + */ + pandas_datetime_to_datetimestruct(__pyx_t_10, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":1015 + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz._tzinfos[inf] # <<<<<<<<<<<<<< + * elif _treat_tz_as_dateutil(tz): + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_tzinfos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyObject_GetItem(__pyx_t_8, __pyx_v_inf); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":1016 + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz._tzinfos[inf] + * elif _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1017 + * obj.tzinfo = tz._tzinfos[inf] + * elif _treat_tz_as_dateutil(tz): + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_10 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1018 + * elif _treat_tz_as_dateutil(tz): + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = tz + * else: + */ + pandas_datetime_to_datetimestruct(__pyx_t_10, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":1019 + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * else: + * obj.tzinfo = tz + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":1021 + * obj.tzinfo = tz + * else: + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + } + __pyx_L4:; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":981 + * return obj + * + * cdef inline void _localize_tso(_TSObject obj, object tz): # <<<<<<<<<<<<<< + * ''' + * Take a TSObject in UTC and localizes to timezone tz. + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_WriteUnraisable("pandas.tslib._localize_tso", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v_trans); + __Pyx_XDECREF(__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pos); + __Pyx_XDECREF(__pyx_v_inf); + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/tslib.pyx":1024 + * + * + * def get_timezone(tz): # <<<<<<<<<<<<<< + * return _get_zone(tz) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_17get_timezone(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_17get_timezone = {__Pyx_NAMESTR("get_timezone"), (PyCFunction)__pyx_pw_6pandas_5tslib_17get_timezone, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_17get_timezone(PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_timezone (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_16get_timezone(__pyx_self, ((PyObject *)__pyx_v_tz)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_16get_timezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_timezone", 0); + + /* "pandas/tslib.pyx":1025 + * + * def get_timezone(tz): + * return _get_zone(tz) # <<<<<<<<<<<<<< + * + * cdef inline bint _is_utc(object tz): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1024 + * + * + * def get_timezone(tz): # <<<<<<<<<<<<<< + * return _get_zone(tz) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.get_timezone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1027 + * return _get_zone(tz) + * + * cdef inline bint _is_utc(object tz): # <<<<<<<<<<<<<< + * return tz is UTC or isinstance(tz, _dateutil_tzutc) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_utc(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_utc", 0); + + /* "pandas/tslib.pyx":1028 + * + * cdef inline bint _is_utc(object tz): + * return tz is UTC or isinstance(tz, _dateutil_tzutc) # <<<<<<<<<<<<<< + * + * cdef inline object _get_zone(object tz): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UTC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_v_tz == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_tzutc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_r = __pyx_t_4; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1027 + * return _get_zone(tz) + * + * cdef inline bint _is_utc(object tz): # <<<<<<<<<<<<<< + * return tz is UTC or isinstance(tz, _dateutil_tzutc) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("pandas.tslib._is_utc", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1030 + * return tz is UTC or isinstance(tz, _dateutil_tzutc) + * + * cdef inline object _get_zone(object tz): # <<<<<<<<<<<<<< + * ''' + * We need to do several things here: + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__get_zone(PyObject *__pyx_v_tz) { + PyObject *__pyx_v_zone = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_zone", 0); + + /* "pandas/tslib.pyx":1040 + * string so that we can serialize it with UJSON/pytables. maybe_get_tz (below) is the inverse of this process. + * ''' + * if _is_utc(tz): # <<<<<<<<<<<<<< + * return 'UTC' + * else: + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1041 + * ''' + * if _is_utc(tz): + * return 'UTC' # <<<<<<<<<<<<<< + * else: + * if _treat_tz_as_dateutil(tz): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_UTC); + __pyx_r = __pyx_n_s_UTC; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1043 + * return 'UTC' + * else: + * if _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1044 + * else: + * if _treat_tz_as_dateutil(tz): + * if '.tar.gz' in tz._filename: # <<<<<<<<<<<<<< + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_kp_s_tar_gz, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1045 + * if _treat_tz_as_dateutil(tz): + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' # <<<<<<<<<<<<<< + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1048 + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + * return 'dateutil/' + tz._filename # <<<<<<<<<<<<<< + * else: + * # tz is a pytz timezone or unknown. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_kp_s_dateutil, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1051 + * else: + * # tz is a pytz timezone or unknown. + * try: # <<<<<<<<<<<<<< + * zone = tz.zone + * if zone is None: + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/tslib.pyx":1052 + * # tz is a pytz timezone or unknown. + * try: + * zone = tz.zone # <<<<<<<<<<<<<< + * if zone is None: + * return tz + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_zone = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1053 + * try: + * zone = tz.zone + * if zone is None: # <<<<<<<<<<<<<< + * return tz + * return zone + */ + __pyx_t_3 = (__pyx_v_zone == Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1054 + * zone = tz.zone + * if zone is None: + * return tz # <<<<<<<<<<<<<< + * return zone + * except AttributeError: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tz); + __pyx_r = __pyx_v_tz; + goto __pyx_L10_try_return; + } + + /* "pandas/tslib.pyx":1055 + * if zone is None: + * return tz + * return zone # <<<<<<<<<<<<<< + * except AttributeError: + * return tz + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_zone); + __pyx_r = __pyx_v_zone; + goto __pyx_L10_try_return; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1056 + * return tz + * return zone + * except AttributeError: # <<<<<<<<<<<<<< + * return tz + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.tslib._get_zone", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1057 + * return zone + * except AttributeError: + * return tz # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tz); + __pyx_r = __pyx_v_tz; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L10_try_return:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L0; + __pyx_L9_except_return:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L0; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L13_try_end:; + } + } + } + + /* "pandas/tslib.pyx":1030 + * return tz is UTC or isinstance(tz, _dateutil_tzutc) + * + * cdef inline object _get_zone(object tz): # <<<<<<<<<<<<<< + * ''' + * We need to do several things here: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.tslib._get_zone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_zone); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1060 + * + * + * cpdef inline object maybe_get_tz(object tz): # <<<<<<<<<<<<<< + * ''' + * (Maybe) Construct a timezone object from a string. If tz is a string, use it to construct a timezone object. + */ + +static PyObject *__pyx_pw_6pandas_5tslib_19maybe_get_tz(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_maybe_get_tz(PyObject *__pyx_v_tz, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_zone = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_get_tz", 0); + __Pyx_INCREF(__pyx_v_tz); + + /* "pandas/tslib.pyx":1065 + * Otherwise, just return tz. + * ''' + * if isinstance(tz, string_types): # <<<<<<<<<<<<<< + * if tz.startswith('dateutil/'): + * zone = tz[9:] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_string_types); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1066 + * ''' + * if isinstance(tz, string_types): + * if tz.startswith('dateutil/'): # <<<<<<<<<<<<<< + * zone = tz[9:] + * tz = _dateutil_gettz(tz[9:]) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1067 + * if isinstance(tz, string_types): + * if tz.startswith('dateutil/'): + * zone = tz[9:] # <<<<<<<<<<<<<< + * tz = _dateutil_gettz(tz[9:]) + * # On Python 3 on Windows, the filename is not always set correctly. + */ + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_tz, 9, 0, NULL, NULL, &__pyx_slice__33, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_zone = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1068 + * if tz.startswith('dateutil/'): + * zone = tz[9:] + * tz = _dateutil_gettz(tz[9:]) # <<<<<<<<<<<<<< + * # On Python 3 on Windows, the filename is not always set correctly. + * if isinstance(tz, _dateutil_tzfile) and '.tar.gz' in tz._filename: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_gettz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_tz, 9, 0, NULL, NULL, &__pyx_slice__34, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1070 + * tz = _dateutil_gettz(tz[9:]) + * # On Python 3 on Windows, the filename is not always set correctly. + * if isinstance(tz, _dateutil_tzfile) and '.tar.gz' in tz._filename: # <<<<<<<<<<<<<< + * tz._filename = zone + * else: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_tzfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if ((__pyx_t_3 != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_kp_s_tar_gz, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = (__pyx_t_2 != 0); + } else { + __pyx_t_6 = (__pyx_t_3 != 0); + } + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":1071 + * # On Python 3 on Windows, the filename is not always set correctly. + * if isinstance(tz, _dateutil_tzfile) and '.tar.gz' in tz._filename: + * tz._filename = zone # <<<<<<<<<<<<<< + * else: + * tz = pytz.timezone(tz) + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_tz, __pyx_n_s_filename, __pyx_v_zone) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":1073 + * tz._filename = zone + * else: + * tz = pytz.timezone(tz) # <<<<<<<<<<<<<< + * return tz + * else: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timezone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":1074 + * else: + * tz = pytz.timezone(tz) + * return tz # <<<<<<<<<<<<<< + * else: + * return tz + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tz); + __pyx_r = __pyx_v_tz; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1076 + * return tz + * else: + * return tz # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tz); + __pyx_r = __pyx_v_tz; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1060 + * + * + * cpdef inline object maybe_get_tz(object tz): # <<<<<<<<<<<<<< + * ''' + * (Maybe) Construct a timezone object from a string. If tz is a string, use it to construct a timezone object. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.maybe_get_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_zone); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_19maybe_get_tz(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/ +static char __pyx_doc_6pandas_5tslib_18maybe_get_tz[] = "\n (Maybe) Construct a timezone object from a string. If tz is a string, use it to construct a timezone object.\n Otherwise, just return tz.\n "; +static PyObject *__pyx_pw_6pandas_5tslib_19maybe_get_tz(PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_get_tz (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_18maybe_get_tz(__pyx_self, ((PyObject *)__pyx_v_tz)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_18maybe_get_tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_get_tz", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.maybe_get_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1082 + * pass + * + * cdef inline _check_dts_bounds(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * cdef: + * bint error = False + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__check_dts_bounds(pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_error; + PyObject *__pyx_v_fmt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_dts_bounds", 0); + + /* "pandas/tslib.pyx":1084 + * cdef inline _check_dts_bounds(pandas_datetimestruct *dts): + * cdef: + * bint error = False # <<<<<<<<<<<<<< + * + * if dts.year <= 1677 and cmp_pandas_datetimestruct(dts, &_NS_MIN_DTS) == -1: + */ + __pyx_v_error = 0; + + /* "pandas/tslib.pyx":1086 + * bint error = False + * + * if dts.year <= 1677 and cmp_pandas_datetimestruct(dts, &_NS_MIN_DTS) == -1: # <<<<<<<<<<<<<< + * error = True + * elif ( + */ + __pyx_t_1 = ((__pyx_v_dts->year <= 1677) != 0); + if (__pyx_t_1) { + __pyx_t_2 = ((cmp_pandas_datetimestruct(__pyx_v_dts, (&__pyx_v_6pandas_5tslib__NS_MIN_DTS)) == -1) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1087 + * + * if dts.year <= 1677 and cmp_pandas_datetimestruct(dts, &_NS_MIN_DTS) == -1: + * error = True # <<<<<<<<<<<<<< + * elif ( + * dts.year >= 2262 and + */ + __pyx_v_error = 1; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1089 + * error = True + * elif ( + * dts.year >= 2262 and # <<<<<<<<<<<<<< + * cmp_pandas_datetimestruct(dts, &_NS_MAX_DTS) == 1): + * error = True + */ + __pyx_t_3 = ((__pyx_v_dts->year >= 2262) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1090 + * elif ( + * dts.year >= 2262 and + * cmp_pandas_datetimestruct(dts, &_NS_MAX_DTS) == 1): # <<<<<<<<<<<<<< + * error = True + * + */ + __pyx_t_1 = ((cmp_pandas_datetimestruct(__pyx_v_dts, (&__pyx_v_6pandas_5tslib__NS_MAX_DTS)) == 1) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1091 + * dts.year >= 2262 and + * cmp_pandas_datetimestruct(dts, &_NS_MAX_DTS) == 1): + * error = True # <<<<<<<<<<<<<< + * + * if error: + */ + __pyx_v_error = 1; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1093 + * error = True + * + * if error: # <<<<<<<<<<<<<< + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, + * dts.day, dts.hour, + */ + __pyx_t_2 = (__pyx_v_error != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1094 + * + * if error: + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec) + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts->year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":1095 + * if error: + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, + * dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec) + * + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->hour); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1096 + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec) # <<<<<<<<<<<<<< + * + * raise OutOfBoundsDatetime('Out of bounds nanosecond timestamp: %s' % fmt) + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->min); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->sec); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1094 + * + * if error: + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec) + */ + __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_d_2d_2d_2d_2d_2d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_fmt = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1098 + * dts.min, dts.sec) + * + * raise OutOfBoundsDatetime('Out of bounds nanosecond timestamp: %s' % fmt) # <<<<<<<<<<<<<< + * + * # elif isinstance(ts, _Timestamp): + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_nanosecond_timesta, __pyx_v_fmt); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1082 + * pass + * + * cdef inline _check_dts_bounds(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * cdef: + * bint error = False + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.tslib._check_dts_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fmt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1109 + * # obj.dtval = _dts_to_pydatetime(&obj.dts) + * + * def datetime_to_datetime64(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_21datetime_to_datetime64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_21datetime_to_datetime64 = {__Pyx_NAMESTR("datetime_to_datetime64"), (PyCFunction)__pyx_pw_6pandas_5tslib_21datetime_to_datetime64, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_21datetime_to_datetime64(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_to_datetime64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_20datetime_to_datetime64(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_20datetime_to_datetime64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_inferred_tz = 0; + PyArrayObject *__pyx_v_iresult = 0; + pandas_datetimestruct __pyx_v_dts; + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v__ts = 0; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + __pyx_t_5numpy_int64_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("datetime_to_datetime64", 0); + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1111 + * def datetime_to_datetime64(ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * object val, inferred_tz = None + * ndarray[int64_t] iresult + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":1112 + * cdef: + * Py_ssize_t i, n = len(values) + * object val, inferred_tz = None # <<<<<<<<<<<<<< + * ndarray[int64_t] iresult + * pandas_datetimestruct dts + */ + __Pyx_INCREF(Py_None); + __pyx_v_inferred_tz = Py_None; + + /* "pandas/tslib.pyx":1117 + * _TSObject _ts + * + * result = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * iresult = result.view('i8') + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1118 + * + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1119 + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * if _checknull_with_nat(val): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":1120 + * iresult = result.view('i8') + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * if _checknull_with_nat(val): + * iresult[i] = iNaT + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1121 + * for i in range(n): + * val = values[i] + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * elif PyDateTime_Check(val): + */ + __pyx_t_13 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":1122 + * val = values[i] + * if _checknull_with_nat(val): + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * elif PyDateTime_Check(val): + * if val.tzinfo is not None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_14 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_14; + goto __pyx_L5; + } + + /* "pandas/tslib.pyx":1123 + * if _checknull_with_nat(val): + * iresult[i] = iNaT + * elif PyDateTime_Check(val): # <<<<<<<<<<<<<< + * if val.tzinfo is not None: + * if inferred_tz is not None: + */ + __pyx_t_13 = (PyDateTime_Check(__pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":1124 + * iresult[i] = iNaT + * elif PyDateTime_Check(val): + * if val.tzinfo is not None: # <<<<<<<<<<<<<< + * if inferred_tz is not None: + * if _get_zone(val.tzinfo) != inferred_tz: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = (__pyx_t_13 != 0); + if (__pyx_t_16) { + + /* "pandas/tslib.pyx":1125 + * elif PyDateTime_Check(val): + * if val.tzinfo is not None: + * if inferred_tz is not None: # <<<<<<<<<<<<<< + * if _get_zone(val.tzinfo) != inferred_tz: + * raise ValueError('Array must be all same time zone') + */ + __pyx_t_16 = (__pyx_v_inferred_tz != Py_None); + __pyx_t_13 = (__pyx_t_16 != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":1126 + * if val.tzinfo is not None: + * if inferred_tz is not None: + * if _get_zone(val.tzinfo) != inferred_tz: # <<<<<<<<<<<<<< + * raise ValueError('Array must be all same time zone') + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib__get_zone(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_v_inferred_tz, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":1127 + * if inferred_tz is not None: + * if _get_zone(val.tzinfo) != inferred_tz: + * raise ValueError('Array must be all same time zone') # <<<<<<<<<<<<<< + * else: + * inferred_tz = _get_zone(val.tzinfo) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":1129 + * raise ValueError('Array must be all same time zone') + * else: + * inferred_tz = _get_zone(val.tzinfo) # <<<<<<<<<<<<<< + * + * _ts = convert_to_tsobject(val, None, None) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib__get_zone(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_inferred_tz, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L7:; + + /* "pandas/tslib.pyx":1131 + * inferred_tz = _get_zone(val.tzinfo) + * + * _ts = convert_to_tsobject(val, None, None) # <<<<<<<<<<<<<< + * iresult[i] = _ts.value + * _check_dts_bounds(&_ts.dts) + */ + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_val, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v__ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1132 + * + * _ts = convert_to_tsobject(val, None, None) + * iresult[i] = _ts.value # <<<<<<<<<<<<<< + * _check_dts_bounds(&_ts.dts) + * else: + */ + __pyx_t_14 = __pyx_v__ts->value; + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_14; + + /* "pandas/tslib.pyx":1133 + * _ts = convert_to_tsobject(val, None, None) + * iresult[i] = _ts.value + * _check_dts_bounds(&_ts.dts) # <<<<<<<<<<<<<< + * else: + * if inferred_tz is not None: + */ + __pyx_t_5 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v__ts->dts)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/tslib.pyx":1135 + * _check_dts_bounds(&_ts.dts) + * else: + * if inferred_tz is not None: # <<<<<<<<<<<<<< + * raise ValueError('Cannot mix tz-aware with tz-naive values') + * iresult[i] = _pydatetime_to_dts(val, &dts) + */ + __pyx_t_13 = (__pyx_v_inferred_tz != Py_None); + __pyx_t_16 = (__pyx_t_13 != 0); + if (__pyx_t_16) { + + /* "pandas/tslib.pyx":1136 + * else: + * if inferred_tz is not None: + * raise ValueError('Cannot mix tz-aware with tz-naive values') # <<<<<<<<<<<<<< + * iresult[i] = _pydatetime_to_dts(val, &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1137 + * if inferred_tz is not None: + * raise ValueError('Cannot mix tz-aware with tz-naive values') + * iresult[i] = _pydatetime_to_dts(val, &dts) # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * else: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_val, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1138 + * raise ValueError('Cannot mix tz-aware with tz-naive values') + * iresult[i] = _pydatetime_to_dts(val, &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * else: + * raise TypeError('Unrecognized value type: %s' % type(val)) + */ + __pyx_t_5 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1140 + * _check_dts_bounds(&dts) + * else: + * raise TypeError('Unrecognized value type: %s' % type(val)) # <<<<<<<<<<<<<< + * + * return result, inferred_tz + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_value_type_s, ((PyObject *)Py_TYPE(__pyx_v_val))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + } + + /* "pandas/tslib.pyx":1142 + * raise TypeError('Unrecognized value type: %s' % type(val)) + * + * return result, inferred_tz # <<<<<<<<<<<<<< + * + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v_inferred_tz); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_inferred_tz); + __Pyx_GIVEREF(__pyx_v_inferred_tz); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1109 + * # obj.dtval = _dts_to_pydatetime(&obj.dts) + * + * def datetime_to_datetime64(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.datetime_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_inferred_tz); + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF((PyObject *)__pyx_v__ts); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1146 + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + * + * def _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * if date_string.startswith('0'): + * # Strings starting with 0 are more consistent with a + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_23_does_string_look_like_datetime(PyObject *__pyx_self, PyObject *__pyx_v_date_string); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_23_does_string_look_like_datetime = {__Pyx_NAMESTR("_does_string_look_like_datetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_23_does_string_look_like_datetime, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_23_does_string_look_like_datetime(PyObject *__pyx_self, PyObject *__pyx_v_date_string) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_does_string_look_like_datetime (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_22_does_string_look_like_datetime(__pyx_self, ((PyObject *)__pyx_v_date_string)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_22_does_string_look_like_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + double __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_does_string_look_like_datetime", 0); + + /* "pandas/tslib.pyx":1147 + * + * def _does_string_look_like_datetime(date_string): + * if date_string.startswith('0'): # <<<<<<<<<<<<<< + * # Strings starting with 0 are more consistent with a + * # date-like string than a number + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date_string, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1150 + * # Strings starting with 0 are more consistent with a + * # date-like string than a number + * return True # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1152 + * return True + * + * try: # <<<<<<<<<<<<<< + * if float(date_string) < 1000: + * return False + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/tslib.pyx":1153 + * + * try: + * if float(date_string) < 1000: # <<<<<<<<<<<<<< + * return False + * except ValueError: + */ + __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_date_string); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_3 = ((__pyx_t_7 < 1000.0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1154 + * try: + * if float(date_string) < 1000: + * return False # <<<<<<<<<<<<<< + * except ValueError: + * pass + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L8_try_return; + } + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1155 + * if float(date_string) < 1000: + * return False + * except ValueError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_8) { + PyErr_Restore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L8_try_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L11_try_end:; + } + + /* "pandas/tslib.pyx":1158 + * pass + * + * if date_string in _not_datelike_strings: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_not_datelike_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_date_string, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = (__pyx_t_3 != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1159 + * + * if date_string in _not_datelike_strings: + * return False # <<<<<<<<<<<<<< + * + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1161 + * return False + * + * return True # <<<<<<<<<<<<<< + * + * def parse_datetime_string(date_string, **kwargs): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1146 + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + * + * def _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * if date_string.startswith('0'): + * # Strings starting with 0 are more consistent with a + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib._does_string_look_like_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1163 + * return True + * + * def parse_datetime_string(date_string, **kwargs): # <<<<<<<<<<<<<< + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_25parse_datetime_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_25parse_datetime_string = {__Pyx_NAMESTR("parse_datetime_string"), (PyCFunction)__pyx_pw_6pandas_5tslib_25parse_datetime_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_25parse_datetime_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_date_string = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parse_datetime_string (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_date_string,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_date_string)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "parse_datetime_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_date_string = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("parse_datetime_string", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("pandas.tslib.parse_datetime_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_24parse_datetime_string(__pyx_self, __pyx_v_date_string, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_24parse_datetime_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_string, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_v_dt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_datetime_string", 0); + + /* "pandas/tslib.pyx":1164 + * + * def parse_datetime_string(date_string, **kwargs): + * if not _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * raise ValueError('Given date string not likely a datetime.') + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_does_string_look_like_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_date_string); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_date_string); + __Pyx_GIVEREF(__pyx_v_date_string); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1165 + * def parse_datetime_string(date_string, **kwargs): + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') # <<<<<<<<<<<<<< + * + * dt = parse_date(date_string, **kwargs) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1167 + * raise ValueError('Given date string not likely a datetime.') + * + * dt = parse_date(date_string, **kwargs) # <<<<<<<<<<<<<< + * return dt + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_date); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_date_string); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_date_string); + __Pyx_GIVEREF(__pyx_v_date_string); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dt = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1168 + * + * dt = parse_date(date_string, **kwargs) + * return dt # <<<<<<<<<<<<<< + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dt); + __pyx_r = __pyx_v_dt; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1163 + * return True + * + * def parse_datetime_string(date_string, **kwargs): # <<<<<<<<<<<<<< + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.parse_datetime_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_27array_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_27array_to_datetime = {__Pyx_NAMESTR("array_to_datetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_27array_to_datetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_27array_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_raise_ = 0; + PyObject *__pyx_v_dayfirst = 0; + CYTHON_UNUSED PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_utc = 0; + PyObject *__pyx_v_coerce = 0; + PyObject *__pyx_v_unit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("array_to_datetime (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_raise,&__pyx_n_s_dayfirst,&__pyx_n_s_format,&__pyx_n_s_utc,&__pyx_n_s_coerce,&__pyx_n_s_unit,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)Py_False); + + /* "pandas/tslib.pyx":1171 + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, + * format=None, utc=None, coerce=False, unit=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)Py_False); + values[6] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_raise); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dayfirst); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_utc); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array_to_datetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_raise_ = values[1]; + __pyx_v_dayfirst = values[2]; + __pyx_v_format = values[3]; + __pyx_v_utc = values[4]; + __pyx_v_coerce = values[5]; + __pyx_v_unit = values[6]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("array_to_datetime", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_26array_to_datetime(__pyx_self, __pyx_v_values, __pyx_v_raise_, __pyx_v_dayfirst, __pyx_v_format, __pyx_v_utc, __pyx_v_coerce, __pyx_v_unit); + + /* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_26array_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_raise_, PyObject *__pyx_v_dayfirst, CYTHON_UNUSED PyObject *__pyx_v_format, PyObject *__pyx_v_utc, PyObject *__pyx_v_coerce, PyObject *__pyx_v_unit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_py_dt = 0; + PyArrayObject *__pyx_v_iresult = 0; + PyArrayObject *__pyx_v_oresult = 0; + pandas_datetimestruct __pyx_v_dts; + int __pyx_v_utc_convert; + int __pyx_v_seen_integer; + int __pyx_v_seen_datetime; + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v__ts = 0; + __pyx_t_5numpy_int64_t __pyx_v_m; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_oresult; + __Pyx_Buffer __pyx_pybuffer_oresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + __pyx_t_5numpy_int64_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + int __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + PyObject *__pyx_t_38 = NULL; + PyObject *__pyx_t_39 = NULL; + PyObject *__pyx_t_40 = NULL; + PyObject *__pyx_t_41 = NULL; + PyObject *__pyx_t_42 = NULL; + PyObject *__pyx_t_43 = NULL; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + PyArrayObject *__pyx_t_48 = NULL; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + PyObject **__pyx_t_51; + Py_ssize_t __pyx_t_52; + Py_ssize_t __pyx_t_53; + Py_ssize_t __pyx_t_54; + Py_ssize_t __pyx_t_55; + Py_ssize_t __pyx_t_56; + Py_ssize_t __pyx_t_57; + Py_ssize_t __pyx_t_58; + Py_ssize_t __pyx_t_59; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_to_datetime", 0); + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + __pyx_pybuffer_oresult.pybuffer.buf = NULL; + __pyx_pybuffer_oresult.refcount = 0; + __pyx_pybuffernd_oresult.data = NULL; + __pyx_pybuffernd_oresult.rcbuffer = &__pyx_pybuffer_oresult; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1173 + * format=None, utc=None, coerce=False, unit=None): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * object val, py_dt + * ndarray[int64_t] iresult + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":1178 + * ndarray[object] oresult + * pandas_datetimestruct dts + * bint utc_convert = bool(utc), seen_integer=0, seen_datetime=0 # <<<<<<<<<<<<<< + * _TSObject _ts + * int64_t m = cast_from_unit(None,unit) + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_utc); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_utc_convert = (!(!__pyx_t_2)); + __pyx_v_seen_integer = 0; + __pyx_v_seen_datetime = 0; + + /* "pandas/tslib.pyx":1180 + * bint utc_convert = bool(utc), seen_integer=0, seen_datetime=0 + * _TSObject _ts + * int64_t m = cast_from_unit(None,unit) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib_cast_from_unit(Py_None, __pyx_v_unit, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_m = __pyx_t_3; + + /* "pandas/tslib.pyx":1182 + * int64_t m = cast_from_unit(None,unit) + * + * try: # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/tslib.pyx":1183 + * + * try: + * result = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * iresult = result.view('i8') + * for i in range(n): + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":1184 + * try: + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_t_11 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1185 + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * if _checknull_with_nat(val): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/tslib.pyx":1186 + * iresult = result.view('i8') + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * if _checknull_with_nat(val): + * iresult[i] = iNaT + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1187 + * for i in range(n): + * val = values[i] + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * elif PyDateTime_Check(val): + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1188 + * val = values[i] + * if _checknull_with_nat(val): + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * elif PyDateTime_Check(val): + * seen_datetime=1 + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_18 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1189 + * if _checknull_with_nat(val): + * iresult[i] = iNaT + * elif PyDateTime_Check(val): # <<<<<<<<<<<<<< + * seen_datetime=1 + * if val.tzinfo is not None: + */ + __pyx_t_2 = (PyDateTime_Check(__pyx_v_val) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1190 + * iresult[i] = iNaT + * elif PyDateTime_Check(val): + * seen_datetime=1 # <<<<<<<<<<<<<< + * if val.tzinfo is not None: + * if utc_convert: + */ + __pyx_v_seen_datetime = 1; + + /* "pandas/tslib.pyx":1191 + * elif PyDateTime_Check(val): + * seen_datetime=1 + * if val.tzinfo is not None: # <<<<<<<<<<<<<< + * if utc_convert: + * _ts = convert_to_tsobject(val, None, unit) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = (__pyx_t_7 != Py_None); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_19 = (__pyx_t_2 != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1192 + * seen_datetime=1 + * if val.tzinfo is not None: + * if utc_convert: # <<<<<<<<<<<<<< + * _ts = convert_to_tsobject(val, None, unit) + * iresult[i] = _ts.value + */ + __pyx_t_19 = (__pyx_v_utc_convert != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1193 + * if val.tzinfo is not None: + * if utc_convert: + * _ts = convert_to_tsobject(val, None, unit) # <<<<<<<<<<<<<< + * iresult[i] = _ts.value + * try: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_val, Py_None, __pyx_v_unit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_XDECREF_SET(__pyx_v__ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_7)); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1194 + * if utc_convert: + * _ts = convert_to_tsobject(val, None, unit) + * iresult[i] = _ts.value # <<<<<<<<<<<<<< + * try: + * _check_dts_bounds(&_ts.dts) + */ + __pyx_t_3 = __pyx_v__ts->value; + __pyx_t_20 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1195 + * _ts = convert_to_tsobject(val, None, unit) + * iresult[i] = _ts.value + * try: # <<<<<<<<<<<<<< + * _check_dts_bounds(&_ts.dts) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":1196 + * iresult[i] = _ts.value + * try: + * _check_dts_bounds(&_ts.dts) # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v__ts->dts)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L23_try_end; + __pyx_L16_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1197 + * try: + * _check_dts_bounds(&_ts.dts) + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1198 + * _check_dts_bounds(&_ts.dts) + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1199 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1200 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * else: + */ + goto __pyx_L25_except_continue; + } + + /* "pandas/tslib.pyx":1201 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * else: + * raise ValueError('Tz-aware datetime.datetime cannot ' + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_10, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L17_exception_handled; + __pyx_L25_except_continue:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L22_try_continue; + } + goto __pyx_L18_except_error; + __pyx_L18_except_error:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L22_try_continue:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L11_continue; + __pyx_L17_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + __pyx_L23_try_end:; + } + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/tslib.pyx":1203 + * raise + * else: + * raise ValueError('Tz-aware datetime.datetime cannot ' # <<<<<<<<<<<<<< + * 'be converted to datetime64 unless ' + * 'utc=True') + */ + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_L15:; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/tslib.pyx":1207 + * 'utc=True') + * else: + * iresult[i] = _pydatetime_to_dts(val, &dts) # <<<<<<<<<<<<<< + * if is_timestamp(val): + * iresult[i] += (<_Timestamp>val).nanosecond + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_val, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1208 + * else: + * iresult[i] = _pydatetime_to_dts(val, &dts) + * if is_timestamp(val): # <<<<<<<<<<<<<< + * iresult[i] += (<_Timestamp>val).nanosecond + * try: + */ + __pyx_t_19 = (__pyx_f_6pandas_5tslib_is_timestamp(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1209 + * iresult[i] = _pydatetime_to_dts(val, &dts) + * if is_timestamp(val): + * iresult[i] += (<_Timestamp>val).nanosecond # <<<<<<<<<<<<<< + * try: + * _check_dts_bounds(&dts) + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_iresult.diminfo[0].strides) += ((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_val)->nanosecond; + goto __pyx_L27; + } + __pyx_L27:; + + /* "pandas/tslib.pyx":1210 + * if is_timestamp(val): + * iresult[i] += (<_Timestamp>val).nanosecond + * try: # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + + /* "pandas/tslib.pyx":1211 + * iresult[i] += (<_Timestamp>val).nanosecond + * try: + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L35_try_end; + __pyx_L28_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1212 + * try: + * _check_dts_bounds(&dts) + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1213 + * _check_dts_bounds(&dts) + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1214 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_24 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1215 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * elif PyDate_Check(val): + */ + goto __pyx_L37_except_continue; + } + + /* "pandas/tslib.pyx":1216 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * elif PyDate_Check(val): + * iresult[i] = _date_to_datetime64(val, &dts) + */ + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_7); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L29_exception_handled; + __pyx_L37_except_continue:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L34_try_continue; + } + goto __pyx_L30_except_error; + __pyx_L30_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L34_try_continue:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L11_continue; + __pyx_L29_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L35_try_end:; + } + } + __pyx_L14:; + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1217 + * continue + * raise + * elif PyDate_Check(val): # <<<<<<<<<<<<<< + * iresult[i] = _date_to_datetime64(val, &dts) + * try: + */ + __pyx_t_19 = (PyDate_Check(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1218 + * raise + * elif PyDate_Check(val): + * iresult[i] = _date_to_datetime64(val, &dts) # <<<<<<<<<<<<<< + * try: + * _check_dts_bounds(&dts) + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_f_8datetime__date_to_datetime64(__pyx_v_val, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1219 + * elif PyDate_Check(val): + * iresult[i] = _date_to_datetime64(val, &dts) + * try: # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * seen_datetime=1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":1220 + * iresult[i] = _date_to_datetime64(val, &dts) + * try: + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * seen_datetime=1 + * except ValueError: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L39_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1221 + * try: + * _check_dts_bounds(&dts) + * seen_datetime=1 # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_v_seen_datetime = 1; + } + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L46_try_end; + __pyx_L39_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1222 + * _check_dts_bounds(&dts) + * seen_datetime=1 + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1223 + * seen_datetime=1 + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1224 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_26 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1225 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * elif util.is_datetime64_object(val): + */ + goto __pyx_L48_except_continue; + } + + /* "pandas/tslib.pyx":1226 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_10, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L40_exception_handled; + __pyx_L48_except_continue:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L45_try_continue; + } + goto __pyx_L41_except_error; + __pyx_L41_except_error:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L45_try_continue:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L11_continue; + __pyx_L40_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + __pyx_L46_try_end:; + } + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1227 + * continue + * raise + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * if val is np_NaT or val.view('i8') == iNaT: + * iresult[i] = iNaT + */ + __pyx_t_19 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1228 + * raise + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * else: + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_NaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_19 = (__pyx_v_val == __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!__pyx_t_19) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_view); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_27 = __pyx_t_2; + } else { + __pyx_t_27 = __pyx_t_19; + } + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1229 + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * else: + * try: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_28 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + goto __pyx_L50; + } + /*else*/ { + + /* "pandas/tslib.pyx":1231 + * iresult[i] = iNaT + * else: + * try: # <<<<<<<<<<<<<< + * iresult[i] = _get_datetime64_nanos(val) + * seen_datetime=1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + + /* "pandas/tslib.pyx":1232 + * else: + * try: + * iresult[i] = _get_datetime64_nanos(val) # <<<<<<<<<<<<<< + * seen_datetime=1 + * except ValueError: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib__get_datetime64_nanos(__pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L51_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L51_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_29 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L51_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1233 + * try: + * iresult[i] = _get_datetime64_nanos(val) + * seen_datetime=1 # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_v_seen_datetime = 1; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L58_try_end; + __pyx_L51_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1234 + * iresult[i] = _get_datetime64_nanos(val) + * seen_datetime=1 + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + + /* "pandas/tslib.pyx":1235 + * seen_datetime=1 + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1236 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_30 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1237 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * + */ + goto __pyx_L60_except_continue; + } + + /* "pandas/tslib.pyx":1238 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * + * # if we are coercing, dont' allow integers + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_9, __pyx_t_10); + __pyx_t_7 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L52_exception_handled; + __pyx_L60_except_continue:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L57_try_continue; + } + goto __pyx_L53_except_error; + __pyx_L53_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L57_try_continue:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L11_continue; + __pyx_L52_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L58_try_end:; + } + } + __pyx_L50:; + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1241 + * + * # if we are coercing, dont' allow integers + * elif util.is_integer_object(val) and not coerce: # <<<<<<<<<<<<<< + * if val == iNaT: + * iresult[i] = iNaT + */ + if ((is_integer_object(__pyx_v_val) != 0)) { + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_19 = (!__pyx_t_27); + __pyx_t_27 = __pyx_t_19; + } else { + __pyx_t_27 = (is_integer_object(__pyx_v_val) != 0); + } + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1242 + * # if we are coercing, dont' allow integers + * elif util.is_integer_object(val) and not coerce: + * if val == iNaT: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * else: + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1243 + * elif util.is_integer_object(val) and not coerce: + * if val == iNaT: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * else: + * iresult[i] = val*m + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_31 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + goto __pyx_L62; + } + /*else*/ { + + /* "pandas/tslib.pyx":1245 + * iresult[i] = iNaT + * else: + * iresult[i] = val*m # <<<<<<<<<<<<<< + * seen_integer=1 + * elif util.is_float_object(val) and not coerce: + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_m); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyNumber_Multiply(__pyx_v_val, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_10); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_32 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1246 + * else: + * iresult[i] = val*m + * seen_integer=1 # <<<<<<<<<<<<<< + * elif util.is_float_object(val) and not coerce: + * if val != val or val == iNaT: + */ + __pyx_v_seen_integer = 1; + } + __pyx_L62:; + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1247 + * iresult[i] = val*m + * seen_integer=1 + * elif util.is_float_object(val) and not coerce: # <<<<<<<<<<<<<< + * if val != val or val == iNaT: + * iresult[i] = iNaT + */ + if ((is_float_object(__pyx_v_val) != 0)) { + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_19 = (!__pyx_t_27); + __pyx_t_27 = __pyx_t_19; + } else { + __pyx_t_27 = (is_float_object(__pyx_v_val) != 0); + } + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1248 + * seen_integer=1 + * elif util.is_float_object(val) and not coerce: + * if val != val or val == iNaT: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * else: + */ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!__pyx_t_27) { + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __pyx_t_19; + } else { + __pyx_t_2 = __pyx_t_27; + } + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1249 + * elif util.is_float_object(val) and not coerce: + * if val != val or val == iNaT: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * else: + * iresult[i] = cast_from_unit(val,unit) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_33 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + goto __pyx_L63; + } + /*else*/ { + + /* "pandas/tslib.pyx":1251 + * iresult[i] = iNaT + * else: + * iresult[i] = cast_from_unit(val,unit) # <<<<<<<<<<<<<< + * seen_integer=1 + * else: + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib_cast_from_unit(__pyx_v_val, __pyx_v_unit, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_34 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1252 + * else: + * iresult[i] = cast_from_unit(val,unit) + * seen_integer=1 # <<<<<<<<<<<<<< + * else: + * try: + */ + __pyx_v_seen_integer = 1; + } + __pyx_L63:; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/tslib.pyx":1254 + * seen_integer=1 + * else: + * try: # <<<<<<<<<<<<<< + * if len(val) == 0: + * iresult[i] = iNaT + */ + { + __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":1255 + * else: + * try: + * if len(val) == 0: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_35 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_35 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __pyx_t_2 = ((__pyx_t_35 == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1256 + * try: + * if len(val) == 0: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_35 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1257 + * if len(val) == 0: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * + * elif val in _nat_strings: + */ + goto __pyx_L70_try_continue; + } + + /* "pandas/tslib.pyx":1259 + * continue + * + * elif val in _nat_strings: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_strings); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_27 = (__pyx_t_2 != 0); + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1260 + * + * elif val in _nat_strings: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_36 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1261 + * elif val in _nat_strings: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * + * _string_to_dts(val, &dts) + */ + goto __pyx_L70_try_continue; + } + + /* "pandas/tslib.pyx":1263 + * continue + * + * _string_to_dts(val, &dts) # <<<<<<<<<<<<<< + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, + * &dts) + */ + __pyx_t_9 = __pyx_f_8datetime__string_to_dts(__pyx_v_val, (&__pyx_v_dts)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1264 + * + * _string_to_dts(val, &dts) + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, # <<<<<<<<<<<<<< + * &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_iresult.diminfo[0].strides) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1266 + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, + * &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * except ValueError: + * try: + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L71_try_end; + __pyx_L64_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1267 + * &dts) + * _check_dts_bounds(&dts) + * except ValueError: # <<<<<<<<<<<<<< + * try: + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1268 + * _check_dts_bounds(&dts) + * except ValueError: + * try: # <<<<<<<<<<<<<< + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_38, &__pyx_t_39, &__pyx_t_40); + __Pyx_XGOTREF(__pyx_t_38); + __Pyx_XGOTREF(__pyx_t_39); + __Pyx_XGOTREF(__pyx_t_40); + /*try:*/ { + + /* "pandas/tslib.pyx":1269 + * except ValueError: + * try: + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) # <<<<<<<<<<<<<< + * except Exception: + * if coerce: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_datetime_string); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_41 = PyTuple_New(1); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __Pyx_GOTREF(__pyx_t_41); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_42 = PyDict_New(); if (unlikely(!__pyx_t_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __Pyx_GOTREF(__pyx_t_42); + if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_dayfirst, __pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_41, __pyx_t_42); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF_SET(__pyx_v_py_dt, __pyx_t_43); + __pyx_t_43 = 0; + } + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_XDECREF(__pyx_t_40); __pyx_t_40 = 0; + goto __pyx_L82_try_end; + __pyx_L75_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0; + + /* "pandas/tslib.pyx":1270 + * try: + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) + * except Exception: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_43, &__pyx_t_42, &__pyx_t_41) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_GOTREF(__pyx_t_42); + __Pyx_GOTREF(__pyx_t_41); + + /* "pandas/tslib.pyx":1271 + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) + * except Exception: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1272 + * except Exception: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise TypeError + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_44 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1273 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise TypeError + * + */ + goto __pyx_L84_except_continue; + } + + /* "pandas/tslib.pyx":1274 + * iresult[i] = iNaT + * continue + * raise TypeError # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + goto __pyx_L76_exception_handled; + __pyx_L84_except_continue:; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + goto __pyx_L81_try_continue; + } + goto __pyx_L77_except_error; + __pyx_L77_except_error:; + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_39, __pyx_t_40); + goto __pyx_L66_except_error; + __pyx_L81_try_continue:; + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_39, __pyx_t_40); + goto __pyx_L74_except_continue; + __pyx_L76_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_39, __pyx_t_40); + __pyx_L82_try_end:; + } + + /* "pandas/tslib.pyx":1276 + * raise TypeError + * + * try: # <<<<<<<<<<<<<< + * _ts = convert_to_tsobject(py_dt, None, None) + * iresult[i] = _ts.value + */ + { + __Pyx_ExceptionSave(&__pyx_t_40, &__pyx_t_39, &__pyx_t_38); + __Pyx_XGOTREF(__pyx_t_40); + __Pyx_XGOTREF(__pyx_t_39); + __Pyx_XGOTREF(__pyx_t_38); + /*try:*/ { + + /* "pandas/tslib.pyx":1277 + * + * try: + * _ts = convert_to_tsobject(py_dt, None, None) # <<<<<<<<<<<<<< + * iresult[i] = _ts.value + * except ValueError: + */ + __pyx_t_41 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_py_dt, Py_None, Py_None); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L86_error;} + __Pyx_GOTREF(__pyx_t_41); + if (!(likely(((__pyx_t_41) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_41, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L86_error;} + __Pyx_XDECREF_SET(__pyx_v__ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_41)); + __pyx_t_41 = 0; + + /* "pandas/tslib.pyx":1278 + * try: + * _ts = convert_to_tsobject(py_dt, None, None) + * iresult[i] = _ts.value # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_t_3 = __pyx_v__ts->value; + __pyx_t_45 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L86_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + } + __Pyx_XDECREF(__pyx_t_40); __pyx_t_40 = 0; + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + goto __pyx_L93_try_end; + __pyx_L86_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + + /* "pandas/tslib.pyx":1279 + * _ts = convert_to_tsobject(py_dt, None, None) + * iresult[i] = _ts.value + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_41, &__pyx_t_42, &__pyx_t_43) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __Pyx_GOTREF(__pyx_t_42); + __Pyx_GOTREF(__pyx_t_43); + + /* "pandas/tslib.pyx":1280 + * iresult[i] = _ts.value + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1281 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_46 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_46 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_46 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1282 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * except: + */ + goto __pyx_L95_except_continue; + } + + /* "pandas/tslib.pyx":1283 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * except: + * if coerce: + */ + __Pyx_GIVEREF(__pyx_t_41); + __Pyx_GIVEREF(__pyx_t_42); + __Pyx_XGIVEREF(__pyx_t_43); + __Pyx_ErrRestore(__pyx_t_41, __pyx_t_42, __pyx_t_43); + __pyx_t_41 = 0; __pyx_t_42 = 0; __pyx_t_43 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L87_exception_handled; + __pyx_L95_except_continue:; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L92_try_continue; + } + goto __pyx_L88_except_error; + __pyx_L88_except_error:; + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_ExceptionReset(__pyx_t_40, __pyx_t_39, __pyx_t_38); + goto __pyx_L66_except_error; + __pyx_L92_try_continue:; + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_ExceptionReset(__pyx_t_40, __pyx_t_39, __pyx_t_38); + goto __pyx_L74_except_continue; + __pyx_L87_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_ExceptionReset(__pyx_t_40, __pyx_t_39, __pyx_t_38); + __pyx_L93_try_end:; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L65_exception_handled; + __pyx_L74_except_continue:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L70_try_continue; + } + + /* "pandas/tslib.pyx":1284 + * continue + * raise + * except: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1285 + * raise + * except: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1286 + * except: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_43 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_43); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_47 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_47 < 0) { + __pyx_t_47 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_47 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1287 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * + */ + goto __pyx_L98_except_continue; + } + + /* "pandas/tslib.pyx":1288 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * + * # don't allow mixed integers and datetime like + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_10, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L65_exception_handled; + __pyx_L98_except_continue:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L70_try_continue; + } + __pyx_L66_except_error:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L70_try_continue:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L11_continue; + __pyx_L65_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + __pyx_L71_try_end:; + } + } + __pyx_L13:; + __pyx_L11_continue:; + } + + /* "pandas/tslib.pyx":1293 + * # higher levels can catch and coerce to object, for + * # example + * if seen_integer and seen_datetime: # <<<<<<<<<<<<<< + * raise ValueError("mixed datetimes and integers in passed array") + * + */ + if ((__pyx_v_seen_integer != 0)) { + __pyx_t_27 = (__pyx_v_seen_datetime != 0); + } else { + __pyx_t_27 = (__pyx_v_seen_integer != 0); + } + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1294 + * # example + * if seen_integer and seen_datetime: + * raise ValueError("mixed datetimes and integers in passed array") # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "pandas/tslib.pyx":1296 + * raise ValueError("mixed datetimes and integers in passed array") + * + * return result # <<<<<<<<<<<<<< + * except OutOfBoundsDatetime: + * if raise_: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1297 + * + * return result + * except OutOfBoundsDatetime: # <<<<<<<<<<<<<< + * if raise_: + * raise + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1298 + * return result + * except OutOfBoundsDatetime: + * if raise_: # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_raise_); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1299 + * except OutOfBoundsDatetime: + * if raise_: + * raise # <<<<<<<<<<<<<< + * + * oresult = np.empty(n, dtype=object) + */ + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_7); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + + /* "pandas/tslib.pyx":1301 + * raise + * + * oresult = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_t_43 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_empty); if (unlikely(!__pyx_t_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_42); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_43 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_41 = PyTuple_New(1); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_43); + __Pyx_GIVEREF(__pyx_t_43); + __pyx_t_43 = 0; + __pyx_t_43 = PyDict_New(); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + if (PyDict_SetItem(__pyx_t_43, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_42, __pyx_t_41, __pyx_t_43); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_48 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_oresult, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + } + __pyx_pybuffernd_oresult.diminfo[0].strides = __pyx_pybuffernd_oresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oresult.diminfo[0].shape = __pyx_pybuffernd_oresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_48 = 0; + __pyx_v_oresult = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1302 + * + * oresult = np.empty(n, dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/tslib.pyx":1303 + * oresult = np.empty(n, dtype=object) + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * # set as nan if is even a datetime NaT + */ + __pyx_t_49 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_49 < 0) { + __pyx_t_49 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_49 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1306 + * + * # set as nan if is even a datetime NaT + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * oresult[i] = np.nan + * elif util.is_datetime64_object(val): + */ + __pyx_t_27 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1307 + * # set as nan if is even a datetime NaT + * if _checknull_with_nat(val): + * oresult[i] = np.nan # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nan); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_50 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_50 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_50 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_t_43); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_t_43; + __Pyx_GIVEREF(*__pyx_t_51); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L106; + } + + /* "pandas/tslib.pyx":1308 + * if _checknull_with_nat(val): + * oresult[i] = np.nan + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * if val is np_NaT or val.view('i8') == iNaT: + * oresult[i] = np.nan + */ + __pyx_t_27 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1309 + * oresult[i] = np.nan + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: # <<<<<<<<<<<<<< + * oresult[i] = np.nan + * else: + */ + __pyx_t_43 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_NaT); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_27 = (__pyx_v_val == __pyx_t_43); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + if (!__pyx_t_27) { + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_view); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_43 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_41 = PyObject_RichCompare(__pyx_t_8, __pyx_t_43, Py_EQ); __Pyx_XGOTREF(__pyx_t_41); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_41); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __pyx_t_19 = __pyx_t_2; + } else { + __pyx_t_19 = __pyx_t_27; + } + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1310 + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: + * oresult[i] = np.nan # <<<<<<<<<<<<<< + * else: + * oresult[i] = val.item() + */ + __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_nan); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __pyx_t_52 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_52 < 0) { + __pyx_t_52 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_52 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_t_43); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_t_43; + __Pyx_GIVEREF(*__pyx_t_51); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L107; + } + /*else*/ { + + /* "pandas/tslib.pyx":1312 + * oresult[i] = np.nan + * else: + * oresult[i] = val.item() # <<<<<<<<<<<<<< + * else: + * oresult[i] = val + */ + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_item); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_53 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_53 < 0) { + __pyx_t_53 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_53 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_t_41); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_t_41; + __Pyx_GIVEREF(*__pyx_t_51); + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + } + __pyx_L107:; + goto __pyx_L106; + } + /*else*/ { + + /* "pandas/tslib.pyx":1314 + * oresult[i] = val.item() + * else: + * oresult[i] = val # <<<<<<<<<<<<<< + * return oresult + * except TypeError: + */ + __pyx_t_54 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_54 < 0) { + __pyx_t_54 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_54 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_51); + } + __pyx_L106:; + } + + /* "pandas/tslib.pyx":1315 + * else: + * oresult[i] = val + * return oresult # <<<<<<<<<<<<<< + * except TypeError: + * oresult = np.empty(n, dtype=object) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_oresult)); + __pyx_r = ((PyObject *)__pyx_v_oresult); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + + /* "pandas/tslib.pyx":1316 + * oresult[i] = val + * return oresult + * except TypeError: # <<<<<<<<<<<<<< + * oresult = np.empty(n, dtype=object) + * + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1317 + * return oresult + * except TypeError: + * oresult = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_empty); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __pyx_t_41 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_41); + __Pyx_GIVEREF(__pyx_t_41); + __pyx_t_41 = 0; + __pyx_t_41 = PyDict_New(); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_t_8, __pyx_t_41); if (unlikely(!__pyx_t_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_42); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + if (!(likely(((__pyx_t_42) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_42, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_48 = ((PyArrayObject *)__pyx_t_42); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_oresult, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13); + } + } + __pyx_pybuffernd_oresult.diminfo[0].strides = __pyx_pybuffernd_oresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oresult.diminfo[0].shape = __pyx_pybuffernd_oresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_48 = 0; + __pyx_v_oresult = ((PyArrayObject *)__pyx_t_42); + __pyx_t_42 = 0; + + /* "pandas/tslib.pyx":1319 + * oresult = np.empty(n, dtype=object) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * if _checknull_with_nat(val): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/tslib.pyx":1320 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * if _checknull_with_nat(val): + * oresult[i] = val + */ + __pyx_t_55 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_55 < 0) { + __pyx_t_55 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_55 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_42 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_42); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_42); + __pyx_t_42 = 0; + + /* "pandas/tslib.pyx":1321 + * for i in range(n): + * val = values[i] + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * oresult[i] = val + * elif util.is_string_object(val): + */ + __pyx_t_19 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1322 + * val = values[i] + * if _checknull_with_nat(val): + * oresult[i] = val # <<<<<<<<<<<<<< + * elif util.is_string_object(val): + * if len(val) == 0: + */ + __pyx_t_56 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_56 < 0) { + __pyx_t_56 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_56 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_51); + goto __pyx_L112; + } + + /* "pandas/tslib.pyx":1323 + * if _checknull_with_nat(val): + * oresult[i] = val + * elif util.is_string_object(val): # <<<<<<<<<<<<<< + * if len(val) == 0: + * # TODO: ?? + */ + __pyx_t_19 = (is_string_object(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1324 + * oresult[i] = val + * elif util.is_string_object(val): + * if len(val) == 0: # <<<<<<<<<<<<<< + * # TODO: ?? + * oresult[i] = 'NaT' + */ + __pyx_t_57 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_57 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_19 = ((__pyx_t_57 == 0) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1326 + * if len(val) == 0: + * # TODO: ?? + * oresult[i] = 'NaT' # <<<<<<<<<<<<<< + * continue + * try: + */ + __pyx_t_57 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_57 < 0) { + __pyx_t_57 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_57 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_n_s_NaT); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_n_s_NaT; + __Pyx_GIVEREF(*__pyx_t_51); + + /* "pandas/tslib.pyx":1327 + * # TODO: ?? + * oresult[i] = 'NaT' + * continue # <<<<<<<<<<<<<< + * try: + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) + */ + goto __pyx_L110_continue; + } + + /* "pandas/tslib.pyx":1328 + * oresult[i] = 'NaT' + * continue + * try: # <<<<<<<<<<<<<< + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) + * _pydatetime_to_dts(oresult[i], &dts) + */ + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + + /* "pandas/tslib.pyx":1329 + * continue + * try: + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) # <<<<<<<<<<<<<< + * _pydatetime_to_dts(oresult[i], &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_42 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_datetime_string); if (unlikely(!__pyx_t_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_42); + __pyx_t_41 = PyTuple_New(1); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_41); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dayfirst, __pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_42, __pyx_t_41, __pyx_t_8); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_58 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_58 < 0) { + __pyx_t_58 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_58 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_t_43); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_t_43; + __Pyx_GIVEREF(*__pyx_t_51); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + + /* "pandas/tslib.pyx":1330 + * try: + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) + * _pydatetime_to_dts(oresult[i], &dts) # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * except Exception: + */ + __pyx_t_59 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_59 < 0) { + __pyx_t_59 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_59 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + } + __pyx_t_43 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_43); + __pyx_f_8datetime__pydatetime_to_dts(__pyx_t_43, (&__pyx_v_dts)); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + + /* "pandas/tslib.pyx":1331 + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) + * _pydatetime_to_dts(oresult[i], &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * except Exception: + * if raise_: + */ + __pyx_t_43 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L121_try_end; + __pyx_L114_error:; + __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0; + + /* "pandas/tslib.pyx":1332 + * _pydatetime_to_dts(oresult[i], &dts) + * _check_dts_bounds(&dts) + * except Exception: # <<<<<<<<<<<<<< + * if raise_: + * raise + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_43, &__pyx_t_8, &__pyx_t_41) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L116_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_41); + + /* "pandas/tslib.pyx":1333 + * _check_dts_bounds(&dts) + * except Exception: + * if raise_: # <<<<<<<<<<<<<< + * raise + * return values + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_raise_); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L116_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1334 + * except Exception: + * if raise_: + * raise # <<<<<<<<<<<<<< + * return values + * # oresult[i] = val + */ + __Pyx_GIVEREF(__pyx_t_43); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_41); + __Pyx_ErrRestore(__pyx_t_43, __pyx_t_8, __pyx_t_41); + __pyx_t_43 = 0; __pyx_t_8 = 0; __pyx_t_41 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L116_except_error;} + } + + /* "pandas/tslib.pyx":1335 + * if raise_: + * raise + * return values # <<<<<<<<<<<<<< + * # oresult[i] = val + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_r = ((PyObject *)__pyx_v_values); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L117_except_return; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + goto __pyx_L115_exception_handled; + } + goto __pyx_L116_except_error; + __pyx_L116_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L5_except_error; + __pyx_L117_except_return:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L6_except_return; + __pyx_L115_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L121_try_end:; + } + goto __pyx_L112; + } + /*else*/ { + + /* "pandas/tslib.pyx":1338 + * # oresult[i] = val + * else: + * if raise_: # <<<<<<<<<<<<<< + * raise + * return values + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_raise_); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1339 + * else: + * if raise_: + * raise # <<<<<<<<<<<<<< + * return values + * + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_10, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + + /* "pandas/tslib.pyx":1340 + * if raise_: + * raise + * return values # <<<<<<<<<<<<<< + * + * return oresult + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_r = ((PyObject *)__pyx_v_values); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L6_except_return; + } + __pyx_L112:; + __pyx_L110_continue:; + } + + /* "pandas/tslib.pyx":1342 + * return values + * + * return oresult # <<<<<<<<<<<<<< + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_oresult)); + __pyx_r = ((PyObject *)__pyx_v_oresult); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_41); + __Pyx_XDECREF(__pyx_t_42); + __Pyx_XDECREF(__pyx_t_43); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_py_dt); + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF((PyObject *)__pyx_v_oresult); + __Pyx_XDECREF((PyObject *)__pyx_v__ts); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1344 + * return oresult + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): # <<<<<<<<<<<<<< + * """ convert an ndarray to an array of ints that are timedeltas + * force conversion if coerce = True, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_29array_to_timedelta64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_28array_to_timedelta64[] = " convert an ndarray to an array of ints that are timedeltas\n force conversion if coerce = True,\n else will raise if cannot convert "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_29array_to_timedelta64 = {__Pyx_NAMESTR("array_to_timedelta64"), (PyCFunction)__pyx_pw_6pandas_5tslib_29array_to_timedelta64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_28array_to_timedelta64)}; +static PyObject *__pyx_pw_6pandas_5tslib_29array_to_timedelta64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_unit = 0; + PyObject *__pyx_v_coerce = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("array_to_timedelta64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_unit,&__pyx_n_s_coerce,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_n_s_ns); + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array_to_timedelta64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_unit = values[1]; + __pyx_v_coerce = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("array_to_timedelta64", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.array_to_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_28array_to_timedelta64(__pyx_self, __pyx_v_values, __pyx_v_unit, __pyx_v_coerce); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_28array_to_timedelta64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_iresult = 0; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_to_timedelta64", 0); + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1352 + * ndarray[int64_t] iresult + * + * n = values.shape[0] # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='m8[ns]') + * iresult = result.view('i8') + */ + __pyx_v_n = (__pyx_v_values->dimensions[0]); + + /* "pandas/tslib.pyx":1353 + * + * n = values.shape[0] + * result = np.empty(n, dtype='m8[ns]') # <<<<<<<<<<<<<< + * iresult = result.view('i8') + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_kp_s_m8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1354 + * n = values.shape[0] + * result = np.empty(n, dtype='m8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1356 + * iresult = result.view('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * result[i] = convert_to_timedelta64(values[i], unit, coerce) + * return iresult + */ + __pyx_t_10 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":1357 + * + * for i in range(n): + * result[i] = convert_to_timedelta64(values[i], unit, coerce) # <<<<<<<<<<<<<< + * return iresult + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_4 = __pyx_f_6pandas_5tslib_convert_to_timedelta64(__pyx_t_1, __pyx_v_unit, __pyx_v_coerce); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_result, __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "pandas/tslib.pyx":1358 + * for i in range(n): + * result[i] = convert_to_timedelta64(values[i], unit, coerce) + * return iresult # <<<<<<<<<<<<<< + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_iresult)); + __pyx_r = ((PyObject *)__pyx_v_iresult); + goto __pyx_L0; + + /* "pandas/tslib.pyx":1344 + * return oresult + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): # <<<<<<<<<<<<<< + * """ convert an ndarray to an array of ints that are timedeltas + * force conversion if coerce = True, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.array_to_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1360 + * return iresult + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): # <<<<<<<<<<<<<< + * return convert_to_timedelta64(ts, unit, coerce) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_31convert_to_timedelta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_31convert_to_timedelta = {__Pyx_NAMESTR("convert_to_timedelta"), (PyCFunction)__pyx_pw_6pandas_5tslib_31convert_to_timedelta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_31convert_to_timedelta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ts = 0; + PyObject *__pyx_v_unit = 0; + PyObject *__pyx_v_coerce = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_to_timedelta (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_unit,&__pyx_n_s_coerce,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_n_s_ns); + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert_to_timedelta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ts = values[0]; + __pyx_v_unit = values[1]; + __pyx_v_coerce = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("convert_to_timedelta", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.convert_to_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_30convert_to_timedelta(__pyx_self, __pyx_v_ts, __pyx_v_unit, __pyx_v_coerce); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_30convert_to_timedelta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_to_timedelta", 0); + + /* "pandas/tslib.pyx":1361 + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): + * return convert_to_timedelta64(ts, unit, coerce) # <<<<<<<<<<<<<< + * + * cdef inline convert_to_timedelta64(object ts, object unit, object coerce): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_convert_to_timedelta64(__pyx_v_ts, __pyx_v_unit, __pyx_v_coerce); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1360 + * return iresult + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): # <<<<<<<<<<<<<< + * return convert_to_timedelta64(ts, unit, coerce) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.convert_to_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1363 + * return convert_to_timedelta64(ts, unit, coerce) + * + * cdef inline convert_to_timedelta64(object ts, object unit, object coerce): # <<<<<<<<<<<<<< + * """ + * Convert an incoming object to a timedelta64 if possible + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_convert_to_timedelta64(PyObject *__pyx_v_ts, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_to_timedelta64", 0); + __Pyx_INCREF(__pyx_v_ts); + + /* "pandas/tslib.pyx":1380 + * # handle the numpy < 1.7 case + * """ + * if _checknull_with_nat(ts): # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * elif util.is_datetime64_object(ts): + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1381 + * """ + * if _checknull_with_nat(ts): + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(ts): + * # only accept a NaT here + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1382 + * if _checknull_with_nat(ts): + * return np.timedelta64(iNaT) + * elif util.is_datetime64_object(ts): # <<<<<<<<<<<<<< + * # only accept a NaT here + * if ts.astype('int64') == iNaT: + */ + __pyx_t_1 = (is_datetime64_object(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1384 + * elif util.is_datetime64_object(ts): + * # only accept a NaT here + * if ts.astype('int64') == iNaT: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * elif isinstance(ts, np.timedelta64): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1385 + * # only accept a NaT here + * if ts.astype('int64') == iNaT: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * elif isinstance(ts, np.timedelta64): + * ts = ts.astype("m8[{0}]".format(unit.lower())) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1386 + * if ts.astype('int64') == iNaT: + * return np.timedelta64(iNaT) + * elif isinstance(ts, np.timedelta64): # <<<<<<<<<<<<<< + * ts = ts.astype("m8[{0}]".format(unit.lower())) + * elif is_integer_object(ts): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_ts, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1387 + * return np.timedelta64(iNaT) + * elif isinstance(ts, np.timedelta64): + * ts = ts.astype("m8[{0}]".format(unit.lower())) # <<<<<<<<<<<<<< + * elif is_integer_object(ts): + * if ts == iNaT: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_m8_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_unit, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1388 + * elif isinstance(ts, np.timedelta64): + * ts = ts.astype("m8[{0}]".format(unit.lower())) + * elif is_integer_object(ts): # <<<<<<<<<<<<<< + * if ts == iNaT: + * return np.timedelta64(iNaT) + */ + __pyx_t_5 = (is_integer_object(__pyx_v_ts) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1389 + * ts = ts.astype("m8[{0}]".format(unit.lower())) + * elif is_integer_object(ts): + * if ts == iNaT: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * else: + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_ts, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1390 + * elif is_integer_object(ts): + * if ts == iNaT: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * else: + * if util.is_array(ts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1392 + * return np.timedelta64(iNaT) + * else: + * if util.is_array(ts): # <<<<<<<<<<<<<< + * ts = ts.astype('int64').item() + * if unit in ['Y','M','W']: + */ + __pyx_t_2 = __pyx_f_4util_is_array(__pyx_v_ts); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1393 + * else: + * if util.is_array(ts): + * ts = ts.astype('int64').item() # <<<<<<<<<<<<<< + * if unit in ['Y','M','W']: + * if _np_version_under1p7: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/tslib.pyx":1394 + * if util.is_array(ts): + * ts = ts.astype('int64').item() + * if unit in ['Y','M','W']: # <<<<<<<<<<<<<< + * if _np_version_under1p7: + * raise ValueError("unsupported unit for native timedelta under this numpy {0}".format(unit)) + */ + __Pyx_INCREF(__pyx_v_unit); + __pyx_t_4 = __pyx_v_unit; + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_Y, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_5) { + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_M, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_t_1; + } else { + __pyx_t_7 = __pyx_t_5; + } + if (!__pyx_t_7) { + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_W, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_t_5; + } else { + __pyx_t_1 = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1395 + * ts = ts.astype('int64').item() + * if unit in ['Y','M','W']: + * if _np_version_under1p7: # <<<<<<<<<<<<<< + * raise ValueError("unsupported unit for native timedelta under this numpy {0}".format(unit)) + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1396 + * if unit in ['Y','M','W']: + * if _np_version_under1p7: + * raise ValueError("unsupported unit for native timedelta under this numpy {0}".format(unit)) # <<<<<<<<<<<<<< + * else: + * ts = np.timedelta64(ts,unit) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unsupported_unit_for_native_time, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_unit); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_unit); + __Pyx_GIVEREF(__pyx_v_unit); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/tslib.pyx":1398 + * raise ValueError("unsupported unit for native timedelta under this numpy {0}".format(unit)) + * else: + * ts = np.timedelta64(ts,unit) # <<<<<<<<<<<<<< + * else: + * ts = cast_from_unit(ts, unit) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __Pyx_INCREF(__pyx_v_unit); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_unit); + __Pyx_GIVEREF(__pyx_v_unit); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_4); + __pyx_t_4 = 0; + } + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":1400 + * ts = np.timedelta64(ts,unit) + * else: + * ts = cast_from_unit(ts, unit) # <<<<<<<<<<<<<< + * if _np_version_under1p7: + * ts = timedelta(microseconds=ts/1000.0) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib_cast_from_unit(__pyx_v_ts, __pyx_v_unit, 0); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1401 + * else: + * ts = cast_from_unit(ts, unit) + * if _np_version_under1p7: # <<<<<<<<<<<<<< + * ts = timedelta(microseconds=ts/1000.0) + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1402 + * ts = cast_from_unit(ts, unit) + * if _np_version_under1p7: + * ts = timedelta(microseconds=ts/1000.0) # <<<<<<<<<<<<<< + * else: + * ts = np.timedelta64(ts) + */ + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ts, __pyx_float_1000_0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_timedelta)), __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/tslib.pyx":1404 + * ts = timedelta(microseconds=ts/1000.0) + * else: + * ts = np.timedelta64(ts) # <<<<<<<<<<<<<< + * elif util.is_string_object(ts): + * if ts in _nat_strings or coerce: + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L9:; + } + __pyx_L7:; + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1405 + * else: + * ts = np.timedelta64(ts) + * elif util.is_string_object(ts): # <<<<<<<<<<<<<< + * if ts in _nat_strings or coerce: + * return np.timedelta64(iNaT) + */ + __pyx_t_7 = (is_string_object(__pyx_v_ts) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1406 + * ts = np.timedelta64(ts) + * elif util.is_string_object(ts): + * if ts in _nat_strings or coerce: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * else: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_ts, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_7) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_1; + } else { + __pyx_t_5 = __pyx_t_7; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1407 + * elif util.is_string_object(ts): + * if ts in _nat_strings or coerce: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1409 + * return np.timedelta64(iNaT) + * else: + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) # <<<<<<<<<<<<<< + * + * if _np_version_under1p7: + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_type_for_timedelta_scala, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1411 + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * + * if _np_version_under1p7: # <<<<<<<<<<<<<< + * if not isinstance(ts, timedelta): + * if coerce: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1412 + * + * if _np_version_under1p7: + * if not isinstance(ts, timedelta): # <<<<<<<<<<<<<< + * if coerce: + * return np.timedelta64(iNaT) + */ + __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_ts, ((PyObject*)__pyx_ptype_8datetime_timedelta)); + __pyx_t_7 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1413 + * if _np_version_under1p7: + * if not isinstance(ts, timedelta): + * if coerce: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1414 + * if not isinstance(ts, timedelta): + * if coerce: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * if not PY2: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1415 + * if coerce: + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) # <<<<<<<<<<<<<< + * if not PY2: + * # convert to microseconds in timedelta64 + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_type_for_timedelta_scala, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1416 + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * if not PY2: # <<<<<<<<<<<<<< + * # convert to microseconds in timedelta64 + * ts = np.timedelta64(int(ts.total_seconds()*1e9 + ts.microseconds*1000)) + */ + __pyx_t_7 = ((!(__pyx_v_6pandas_5tslib_PY2 != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1418 + * if not PY2: + * # convert to microseconds in timedelta64 + * ts = np.timedelta64(int(ts.total_seconds()*1e9 + ts.microseconds*1000)) # <<<<<<<<<<<<<< + * else: + * return ts + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_float_1e9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/tslib.pyx":1420 + * ts = np.timedelta64(int(ts.total_seconds()*1e9 + ts.microseconds*1000)) + * else: + * return ts # <<<<<<<<<<<<<< + * + * if isinstance(ts, timedelta): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ts); + __pyx_r = __pyx_v_ts; + goto __pyx_L0; + } + __pyx_L14:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":1422 + * return ts + * + * if isinstance(ts, timedelta): # <<<<<<<<<<<<<< + * ts = np.timedelta64(ts) + * elif not isinstance(ts, np.timedelta64): + */ + __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_ts, ((PyObject*)__pyx_ptype_8datetime_timedelta)); + __pyx_t_5 = (__pyx_t_7 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1423 + * + * if isinstance(ts, timedelta): + * ts = np.timedelta64(ts) # <<<<<<<<<<<<<< + * elif not isinstance(ts, np.timedelta64): + * if coerce: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L15; + } + + /* "pandas/tslib.pyx":1424 + * if isinstance(ts, timedelta): + * ts = np.timedelta64(ts) + * elif not isinstance(ts, np.timedelta64): # <<<<<<<<<<<<<< + * if coerce: + * return np.timedelta64(iNaT) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = PyObject_IsInstance(__pyx_v_ts, __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1425 + * ts = np.timedelta64(ts) + * elif not isinstance(ts, np.timedelta64): + * if coerce: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1426 + * elif not isinstance(ts, np.timedelta64): + * if coerce: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * return ts.astype('timedelta64[ns]') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1427 + * if coerce: + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) # <<<<<<<<<<<<<< + * return ts.astype('timedelta64[ns]') + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_type_for_timedelta_scala, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L15:; + + /* "pandas/tslib.pyx":1428 + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * return ts.astype('timedelta64[ns]') # <<<<<<<<<<<<<< + * + * def repr_timedelta64(object value, format=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1363 + * return convert_to_timedelta64(ts, unit, coerce) + * + * cdef inline convert_to_timedelta64(object ts, object unit, object coerce): # <<<<<<<<<<<<<< + * """ + * Convert an incoming object to a timedelta64 if possible + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.convert_to_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1430 + * return ts.astype('timedelta64[ns]') + * + * def repr_timedelta64(object value, format=None): # <<<<<<<<<<<<<< + * """ + * provide repr for timedelta64 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_33repr_timedelta64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_32repr_timedelta64[] = "\n provide repr for timedelta64\n\n Parameters\n ----------\n value : timedelta64\n format : None|\"short\"|\"long\"\n\n Returns\n -------\n converted : Timestamp\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_33repr_timedelta64 = {__Pyx_NAMESTR("repr_timedelta64"), (PyCFunction)__pyx_pw_6pandas_5tslib_33repr_timedelta64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_32repr_timedelta64)}; +static PyObject *__pyx_pw_6pandas_5tslib_33repr_timedelta64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_format = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("repr_timedelta64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_format,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "repr_timedelta64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = values[0]; + __pyx_v_format = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("repr_timedelta64", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.repr_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_32repr_timedelta64(__pyx_self, __pyx_v_value, __pyx_v_format); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_32repr_timedelta64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_format) { + PyObject *__pyx_v_ivalue = 0; + PyObject *__pyx_v_frac = NULL; + PyObject *__pyx_v_sign = NULL; + PyObject *__pyx_v_days = NULL; + PyObject *__pyx_v_hours = NULL; + PyObject *__pyx_v_minutes = NULL; + PyObject *__pyx_v_seconds = NULL; + PyObject *__pyx_v_seconds_pretty = NULL; + PyObject *__pyx_v_sp = NULL; + PyObject *__pyx_v_sign_pretty = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + double __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("repr_timedelta64", 0); + + /* "pandas/tslib.pyx":1446 + * cdef object ivalue + * + * ivalue = value.view('i8') # <<<<<<<<<<<<<< + * + * # put frac in seconds + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_ivalue = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1449 + * + * # put frac in seconds + * frac = float(ivalue)/1e9 # <<<<<<<<<<<<<< + * sign = np.sign(frac) + * frac = np.abs(frac) + */ + __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_v_ivalue); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble((__pyx_t_3 / 1e9)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_frac = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1450 + * # put frac in seconds + * frac = float(ivalue)/1e9 + * sign = np.sign(frac) # <<<<<<<<<<<<<< + * frac = np.abs(frac) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sign); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_frac); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_frac); + __Pyx_GIVEREF(__pyx_v_frac); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_sign = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1451 + * frac = float(ivalue)/1e9 + * sign = np.sign(frac) + * frac = np.abs(frac) # <<<<<<<<<<<<<< + * + * if frac >= 86400: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_frac); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_frac); + __Pyx_GIVEREF(__pyx_v_frac); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1453 + * frac = np.abs(frac) + * + * if frac >= 86400: # <<<<<<<<<<<<<< + * days = int(frac / 86400) + * frac -= days * 86400 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frac, __pyx_int_86400, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1454 + * + * if frac >= 86400: + * days = int(frac / 86400) # <<<<<<<<<<<<<< + * frac -= days * 86400 + * else: + */ + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_frac, __pyx_int_86400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_days = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1455 + * if frac >= 86400: + * days = int(frac / 86400) + * frac -= days * 86400 # <<<<<<<<<<<<<< + * else: + * days = 0 + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_days, __pyx_int_86400); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_frac, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":1457 + * frac -= days * 86400 + * else: + * days = 0 # <<<<<<<<<<<<<< + * + * if frac >= 3600: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_days = __pyx_int_0; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1459 + * days = 0 + * + * if frac >= 3600: # <<<<<<<<<<<<<< + * hours = int(frac / 3600) + * frac -= hours * 3600 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frac, __pyx_int_3600, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1460 + * + * if frac >= 3600: + * hours = int(frac / 3600) # <<<<<<<<<<<<<< + * frac -= hours * 3600 + * else: + */ + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_frac, __pyx_int_3600); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_hours = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1461 + * if frac >= 3600: + * hours = int(frac / 3600) + * frac -= hours * 3600 # <<<<<<<<<<<<<< + * else: + * hours = 0 + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_hours, __pyx_int_3600); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_frac, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":1463 + * frac -= hours * 3600 + * else: + * hours = 0 # <<<<<<<<<<<<<< + * + * if frac >= 60: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_hours = __pyx_int_0; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":1465 + * hours = 0 + * + * if frac >= 60: # <<<<<<<<<<<<<< + * minutes = int(frac / 60) + * frac -= minutes * 60 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frac, __pyx_int_60, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1466 + * + * if frac >= 60: + * minutes = int(frac / 60) # <<<<<<<<<<<<<< + * frac -= minutes * 60 + * else: + */ + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_frac, __pyx_int_60); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_minutes = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1467 + * if frac >= 60: + * minutes = int(frac / 60) + * frac -= minutes * 60 # <<<<<<<<<<<<<< + * else: + * minutes = 0 + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_minutes, __pyx_int_60); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_frac, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1469 + * frac -= minutes * 60 + * else: + * minutes = 0 # <<<<<<<<<<<<<< + * + * if frac >= 1: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_minutes = __pyx_int_0; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":1471 + * minutes = 0 + * + * if frac >= 1: # <<<<<<<<<<<<<< + * seconds = int(frac) + * frac -= seconds + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frac, __pyx_int_1, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1472 + * + * if frac >= 1: + * seconds = int(frac) # <<<<<<<<<<<<<< + * frac -= seconds + * else: + */ + __pyx_t_1 = PyNumber_Int(__pyx_v_frac); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_seconds = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1473 + * if frac >= 1: + * seconds = int(frac) + * frac -= seconds # <<<<<<<<<<<<<< + * else: + * seconds = 0 + */ + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_frac, __pyx_v_seconds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/tslib.pyx":1475 + * frac -= seconds + * else: + * seconds = 0 # <<<<<<<<<<<<<< + * + * if frac == int(frac): + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_seconds = __pyx_int_0; + } + __pyx_L6:; + + /* "pandas/tslib.pyx":1477 + * seconds = 0 + * + * if frac == int(frac): # <<<<<<<<<<<<<< + * seconds_pretty = "%02d" % seconds + * else: + */ + __pyx_t_1 = PyNumber_Int(__pyx_v_frac); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_frac, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1478 + * + * if frac == int(frac): + * seconds_pretty = "%02d" % seconds # <<<<<<<<<<<<<< + * else: + * sp = abs(round(1e6*frac)) + */ + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_02d, __pyx_v_seconds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_seconds_pretty = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":1480 + * seconds_pretty = "%02d" % seconds + * else: + * sp = abs(round(1e6*frac)) # <<<<<<<<<<<<<< + * seconds_pretty = "%02d.%06d" % (seconds, sp) + * + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_float_1e6, __pyx_v_frac); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_sp = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1481 + * else: + * sp = abs(round(1e6*frac)) + * seconds_pretty = "%02d.%06d" % (seconds, sp) # <<<<<<<<<<<<<< + * + * if sign < 0: + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_seconds); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seconds); + __Pyx_GIVEREF(__pyx_v_seconds); + __Pyx_INCREF(__pyx_v_sp); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_sp); + __Pyx_GIVEREF(__pyx_v_sp); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_02d_06d, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_seconds_pretty = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L7:; + + /* "pandas/tslib.pyx":1483 + * seconds_pretty = "%02d.%06d" % (seconds, sp) + * + * if sign < 0: # <<<<<<<<<<<<<< + * sign_pretty = "-" + * else: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_sign, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1484 + * + * if sign < 0: + * sign_pretty = "-" # <<<<<<<<<<<<<< + * else: + * sign_pretty = "" + */ + __Pyx_INCREF(__pyx_kp_s__50); + __pyx_v_sign_pretty = __pyx_kp_s__50; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/tslib.pyx":1486 + * sign_pretty = "-" + * else: + * sign_pretty = "" # <<<<<<<<<<<<<< + * + * if days or format == 'long': + */ + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_v_sign_pretty = __pyx_kp_s__5; + } + __pyx_L8:; + + /* "pandas/tslib.pyx":1488 + * sign_pretty = "" + * + * if days or format == 'long': # <<<<<<<<<<<<<< + * if (hours or minutes or seconds or frac) or format != 'short': + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_days); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_5) { + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_format, __pyx_n_s_long, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_5; + } + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1489 + * + * if days or format == 'long': + * if (hours or minutes or seconds or frac) or format != 'short': # <<<<<<<<<<<<<< + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, + * seconds_pretty) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_hours); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_7) { + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_minutes); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_5) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_seconds); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_6) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_frac); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_5; + } + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_7; + } + if (!__pyx_t_5) { + __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_format, __pyx_n_s_short, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_t_7; + } else { + __pyx_t_6 = __pyx_t_5; + } + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":1490 + * if days or format == 'long': + * if (hours or minutes or seconds or frac) or format != 'short': + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, # <<<<<<<<<<<<<< + * seconds_pretty) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/tslib.pyx":1491 + * if (hours or minutes or seconds or frac) or format != 'short': + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, + * seconds_pretty) # <<<<<<<<<<<<<< + * else: + * return "%s%d days" % (sign_pretty, days) + */ + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_sign_pretty); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_sign_pretty); + __Pyx_GIVEREF(__pyx_v_sign_pretty); + __Pyx_INCREF(__pyx_v_days); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_days); + __Pyx_GIVEREF(__pyx_v_days); + __Pyx_INCREF(__pyx_v_hours); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_hours); + __Pyx_GIVEREF(__pyx_v_hours); + __Pyx_INCREF(__pyx_v_minutes); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_minutes); + __Pyx_GIVEREF(__pyx_v_minutes); + __Pyx_INCREF(__pyx_v_seconds_pretty); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_seconds_pretty); + __Pyx_GIVEREF(__pyx_v_seconds_pretty); + + /* "pandas/tslib.pyx":1490 + * if days or format == 'long': + * if (hours or minutes or seconds or frac) or format != 'short': + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, # <<<<<<<<<<<<<< + * seconds_pretty) + * else: + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_d_days_02d_02d_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1493 + * seconds_pretty) + * else: + * return "%s%d days" % (sign_pretty, days) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_sign_pretty); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sign_pretty); + __Pyx_GIVEREF(__pyx_v_sign_pretty); + __Pyx_INCREF(__pyx_v_days); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_days); + __Pyx_GIVEREF(__pyx_v_days); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_d_days, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":1496 + * + * + * return "%s%02d:%02d:%s" % (sign_pretty, hours, minutes, seconds_pretty) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_sign_pretty); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_sign_pretty); + __Pyx_GIVEREF(__pyx_v_sign_pretty); + __Pyx_INCREF(__pyx_v_hours); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_hours); + __Pyx_GIVEREF(__pyx_v_hours); + __Pyx_INCREF(__pyx_v_minutes); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_minutes); + __Pyx_GIVEREF(__pyx_v_minutes); + __Pyx_INCREF(__pyx_v_seconds_pretty); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_seconds_pretty); + __Pyx_GIVEREF(__pyx_v_seconds_pretty); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_02d_02d_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1430 + * return ts.astype('timedelta64[ns]') + * + * def repr_timedelta64(object value, format=None): # <<<<<<<<<<<<<< + * """ + * provide repr for timedelta64 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.repr_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ivalue); + __Pyx_XDECREF(__pyx_v_frac); + __Pyx_XDECREF(__pyx_v_sign); + __Pyx_XDECREF(__pyx_v_days); + __Pyx_XDECREF(__pyx_v_hours); + __Pyx_XDECREF(__pyx_v_minutes); + __Pyx_XDECREF(__pyx_v_seconds); + __Pyx_XDECREF(__pyx_v_seconds_pretty); + __Pyx_XDECREF(__pyx_v_sp); + __Pyx_XDECREF(__pyx_v_sign_pretty); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1499 + * + * + * def array_strptime(ndarray[object] values, object fmt, coerce=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_35array_strptime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_35array_strptime = {__Pyx_NAMESTR("array_strptime"), (PyCFunction)__pyx_pw_6pandas_5tslib_35array_strptime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_35array_strptime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_fmt = 0; + PyObject *__pyx_v_coerce = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("array_strptime (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_fmt,&__pyx_n_s_coerce,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmt)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("array_strptime", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array_strptime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_fmt = values[1]; + __pyx_v_coerce = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("array_strptime", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_34array_strptime(__pyx_self, __pyx_v_values, __pyx_v_fmt, __pyx_v_coerce); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_34array_strptime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_fmt, PyObject *__pyx_v_coerce) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + PyArrayObject *__pyx_v_iresult = 0; + int __pyx_v_year; + int __pyx_v_month; + int __pyx_v_day; + int __pyx_v_minute; + int __pyx_v_hour; + int __pyx_v_second; + int __pyx_v_fraction; + int __pyx_v_weekday; + int __pyx_v_julian; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_locale_time = NULL; + PyObject *__pyx_v_format_regex = NULL; + PyObject *__pyx_v_err = NULL; + PyObject *__pyx_v_bad_directive = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v__parse_code_table = 0; + int __pyx_v_parse_code; + PyObject *__pyx_v_found = NULL; + CYTHON_UNUSED PyObject *__pyx_v_tz = NULL; + PyObject *__pyx_v_week_of_year = NULL; + long __pyx_v_week_of_year_start; + PyObject *__pyx_v_found_dict = NULL; + PyObject *__pyx_v_group_key = NULL; + PyObject *__pyx_v_ampm = NULL; + PyObject *__pyx_v_s = NULL; + PyObject *__pyx_v_found_zone = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_tz_values = NULL; + int __pyx_v_week_starts_Mon; + PyObject *__pyx_v_datetime_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyArrayObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + __pyx_t_5numpy_int64_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_t_29; + int __pyx_t_30; + Py_ssize_t __pyx_t_31; + PyObject *(*__pyx_t_32)(PyObject *); + PyObject *__pyx_t_33 = NULL; + int __pyx_t_34; + int __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_strptime", 0); + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1501 + * def array_strptime(ndarray[object] values, object fmt, coerce=False): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * ndarray[int64_t] iresult + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":1508 + * + * global _TimeRE_cache, _regex_cache + * with _cache_lock: # <<<<<<<<<<<<<< + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() + */ + /*with:*/ { + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/tslib.pyx":1509 + * global _TimeRE_cache, _regex_cache + * with _cache_lock: + * if _getlang() != _TimeRE_cache.locale_time.lang: # <<<<<<<<<<<<<< + * _TimeRE_cache = TimeRE() + * _regex_cache.clear() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_getlang); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lang); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1510 + * with _cache_lock: + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() # <<<<<<<<<<<<<< + * _regex_cache.clear() + * if len(_regex_cache) > _CACHE_MAX_SIZE: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeRE_cache, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1511 + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() + * _regex_cache.clear() # <<<<<<<<<<<<<< + * if len(_regex_cache) > _CACHE_MAX_SIZE: + * _regex_cache.clear() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/tslib.pyx":1512 + * _TimeRE_cache = TimeRE() + * _regex_cache.clear() + * if len(_regex_cache) > _CACHE_MAX_SIZE: # <<<<<<<<<<<<<< + * _regex_cache.clear() + * locale_time = _TimeRE_cache.locale_time + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CACHE_MAX_SIZE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1513 + * _regex_cache.clear() + * if len(_regex_cache) > _CACHE_MAX_SIZE: + * _regex_cache.clear() # <<<<<<<<<<<<<< + * locale_time = _TimeRE_cache.locale_time + * format_regex = _regex_cache.get(fmt) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/tslib.pyx":1514 + * if len(_regex_cache) > _CACHE_MAX_SIZE: + * _regex_cache.clear() + * locale_time = _TimeRE_cache.locale_time # <<<<<<<<<<<<<< + * format_regex = _regex_cache.get(fmt) + * if not format_regex: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_locale_time = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1515 + * _regex_cache.clear() + * locale_time = _TimeRE_cache.locale_time + * format_regex = _regex_cache.get(fmt) # <<<<<<<<<<<<<< + * if not format_regex: + * try: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_fmt); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmt); + __Pyx_GIVEREF(__pyx_v_fmt); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_format_regex = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1516 + * locale_time = _TimeRE_cache.locale_time + * format_regex = _regex_cache.get(fmt) + * if not format_regex: # <<<<<<<<<<<<<< + * try: + * format_regex = _TimeRE_cache.compile(fmt) + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_format_regex); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = ((!__pyx_t_9) != 0); + if (__pyx_t_10) { + + /* "pandas/tslib.pyx":1517 + * format_regex = _regex_cache.get(fmt) + * if not format_regex: + * try: # <<<<<<<<<<<<<< + * format_regex = _TimeRE_cache.compile(fmt) + * # KeyError raised when a bad format is found; can be specified as + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":1518 + * if not format_regex: + * try: + * format_regex = _TimeRE_cache.compile(fmt) # <<<<<<<<<<<<<< + * # KeyError raised when a bad format is found; can be specified as + * # \\, in which case it was a stray % but with a space after it + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_fmt); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fmt); + __Pyx_GIVEREF(__pyx_v_fmt); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_format_regex, __pyx_t_5); + __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1521 + * # KeyError raised when a bad format is found; can be specified as + * # \\, in which case it was a stray % but with a space after it + * except KeyError, err: # <<<<<<<<<<<<<< + * bad_directive = err.args[0] + * if bad_directive == "\\": + */ + __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_14) { + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_err = __pyx_t_2; + + /* "pandas/tslib.pyx":1522 + * # \\, in which case it was a stray % but with a space after it + * except KeyError, err: + * bad_directive = err.args[0] # <<<<<<<<<<<<<< + * if bad_directive == "\\": + * bad_directive = "%" + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_err, __pyx_n_s_args); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}; + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_v_bad_directive = __pyx_t_16; + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":1523 + * except KeyError, err: + * bad_directive = err.args[0] + * if bad_directive == "\\": # <<<<<<<<<<<<<< + * bad_directive = "%" + * del err + */ + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_bad_directive, __pyx_kp_s__51, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + if (__pyx_t_10) { + + /* "pandas/tslib.pyx":1524 + * bad_directive = err.args[0] + * if bad_directive == "\\": + * bad_directive = "%" # <<<<<<<<<<<<<< + * del err + * raise ValueError("'%s' is a bad directive in format '%s'" % + */ + __Pyx_INCREF(__pyx_kp_s__52); + __Pyx_DECREF_SET(__pyx_v_bad_directive, __pyx_kp_s__52); + goto __pyx_L28; + } + __pyx_L28:; + + /* "pandas/tslib.pyx":1525 + * if bad_directive == "\\": + * bad_directive = "%" + * del err # <<<<<<<<<<<<<< + * raise ValueError("'%s' is a bad directive in format '%s'" % + * (bad_directive, fmt)) + */ + __Pyx_DECREF(__pyx_v_err); + __pyx_v_err = NULL; + + /* "pandas/tslib.pyx":1527 + * del err + * raise ValueError("'%s' is a bad directive in format '%s'" % + * (bad_directive, fmt)) # <<<<<<<<<<<<<< + * # IndexError only occurs when the format string is "%" + * except IndexError: + */ + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_bad_directive); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_bad_directive); + __Pyx_GIVEREF(__pyx_v_bad_directive); + __Pyx_INCREF(__pyx_v_fmt); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_fmt); + __Pyx_GIVEREF(__pyx_v_fmt); + + /* "pandas/tslib.pyx":1526 + * bad_directive = "%" + * del err + * raise ValueError("'%s' is a bad directive in format '%s'" % # <<<<<<<<<<<<<< + * (bad_directive, fmt)) + * # IndexError only occurs when the format string is "%" + */ + __pyx_t_15 = __Pyx_PyString_Format(__pyx_kp_s_s_is_a_bad_directive_in_format, __pyx_t_16); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_Raise(__pyx_t_15, 0, 0, 0); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L19_exception_handled; + } + + /* "pandas/tslib.pyx":1529 + * (bad_directive, fmt)) + * # IndexError only occurs when the format string is "%" + * except IndexError: # <<<<<<<<<<<<<< + * raise ValueError("stray %% in format '%s'" % fmt) + * _regex_cache[fmt] = format_regex + */ + __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_IndexError); + if (__pyx_t_14) { + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":1530 + * # IndexError only occurs when the format string is "%" + * except IndexError: + * raise ValueError("stray %% in format '%s'" % fmt) # <<<<<<<<<<<<<< + * _regex_cache[fmt] = format_regex + * + */ + __pyx_t_15 = __Pyx_PyString_Format(__pyx_kp_s_stray_in_format_s, __pyx_v_fmt); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_Raise(__pyx_t_15, 0, 0, 0); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L19_exception_handled; + } + goto __pyx_L20_except_error; + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L7_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L25_try_end:; + } + + /* "pandas/tslib.pyx":1531 + * except IndexError: + * raise ValueError("stray %% in format '%s'" % fmt) + * _regex_cache[fmt] = format_regex # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype='M8[ns]') + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_fmt, __pyx_v_format_regex) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L17; + } + __pyx_L17:; + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1508 + * + * global _TimeRE_cache, _regex_cache + * with _cache_lock: # <<<<<<<<<<<<<< + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_15, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_9 = ((!(__pyx_t_10 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_2, __pyx_t_4); + __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L14_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + goto __pyx_L6; + } + __pyx_L6:; + } + goto __pyx_L34; + __pyx_L3_error:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L1_error; + __pyx_L34:; + } + + /* "pandas/tslib.pyx":1533 + * _regex_cache[fmt] = format_regex + * + * result = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * iresult = result.view('i8') + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_15; + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":1534 + * + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * + * dts.us = dts.ps = dts.as = 0 + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_14 < 0)) { + PyErr_Fetch(&__pyx_t_3, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_3, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1536 + * iresult = result.view('i8') + * + * dts.us = dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * + * cdef dict _parse_code_table = { + */ + __pyx_v_dts.us = 0; + __pyx_v_dts.ps = 0; + __pyx_v_dts.as = 0; + + /* "pandas/tslib.pyx":1538 + * dts.us = dts.ps = dts.as = 0 + * + * cdef dict _parse_code_table = { # <<<<<<<<<<<<<< + * 'y': 0, + * 'Y': 1, + */ + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Y, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_m, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_B, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_b, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_d, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_H, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_I, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_M, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_S, __pyx_int_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_f, __pyx_int_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_A, __pyx_int_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_a, __pyx_int_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_w, __pyx_int_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_j, __pyx_int_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_U, __pyx_int_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_W, __pyx_int_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Z_2, __pyx_int_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_p, __pyx_int_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v__parse_code_table = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1561 + * cdef int parse_code + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * if util.is_string_object(val): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_1; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + + /* "pandas/tslib.pyx":1562 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * if util.is_string_object(val): + * if val in _nat_strings: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1563 + * for i in range(n): + * val = values[i] + * if util.is_string_object(val): # <<<<<<<<<<<<<< + * if val in _nat_strings: + * iresult[i] = iNaT + */ + __pyx_t_9 = (is_string_object(__pyx_v_val) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1564 + * val = values[i] + * if util.is_string_object(val): + * if val in _nat_strings: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_strings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "pandas/tslib.pyx":1565 + * if util.is_string_object(val): + * if val in _nat_strings: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1566 + * if val in _nat_strings: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * else: + * if _checknull_with_nat(val): + */ + goto __pyx_L35_continue; + } + goto __pyx_L37; + } + /*else*/ { + + /* "pandas/tslib.pyx":1568 + * continue + * else: + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_10 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/tslib.pyx":1569 + * else: + * if _checknull_with_nat(val): + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_22 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1570 + * if _checknull_with_nat(val): + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * else: + * val = str(val) + */ + goto __pyx_L35_continue; + } + /*else*/ { + + /* "pandas/tslib.pyx":1572 + * continue + * else: + * val = str(val) # <<<<<<<<<<<<<< + * + * found = format_regex.match(val) + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_15); + __pyx_t_15 = 0; + } + } + __pyx_L37:; + + /* "pandas/tslib.pyx":1574 + * val = str(val) + * + * found = format_regex.match(val) # <<<<<<<<<<<<<< + * if not found: + * if coerce: + */ + if (unlikely(!__pyx_v_format_regex)) { __Pyx_RaiseUnboundLocalError("format_regex"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_format_regex, __pyx_n_s_match); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_found, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1575 + * + * found = format_regex.match(val) + * if not found: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_found); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((!__pyx_t_10) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1576 + * found = format_regex.match(val) + * if not found: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1577 + * if not found: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise ValueError("time data %r does not match format %r" % + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_23 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1578 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise ValueError("time data %r does not match format %r" % + * (values[i], fmt)) + */ + goto __pyx_L35_continue; + } + + /* "pandas/tslib.pyx":1580 + * continue + * raise ValueError("time data %r does not match format %r" % + * (values[i], fmt)) # <<<<<<<<<<<<<< + * if len(val) != found.end(): + * if coerce: + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_fmt); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_fmt); + __Pyx_GIVEREF(__pyx_v_fmt); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1579 + * iresult[i] = iNaT + * continue + * raise ValueError("time data %r does not match format %r" % # <<<<<<<<<<<<<< + * (values[i], fmt)) + * if len(val) != found.end(): + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_time_data_r_does_not_match_forma, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1581 + * raise ValueError("time data %r does not match format %r" % + * (values[i], fmt)) + * if len(val) != found.end(): # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_25 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_25); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s_end); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_15, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1582 + * (values[i], fmt)) + * if len(val) != found.end(): + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1583 + * if len(val) != found.end(): + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise ValueError("unconverted data remains: %s" % + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_25 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1584 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise ValueError("unconverted data remains: %s" % + * values[i][found.end():]) + */ + goto __pyx_L35_continue; + } + + /* "pandas/tslib.pyx":1586 + * continue + * raise ValueError("unconverted data remains: %s" % + * values[i][found.end():]) # <<<<<<<<<<<<<< + * year = 1900 + * month = day = 1 + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s_end); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_5, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1585 + * iresult[i] = iNaT + * continue + * raise ValueError("unconverted data remains: %s" % # <<<<<<<<<<<<<< + * values[i][found.end():]) + * year = 1900 + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_unconverted_data_remains_s, __pyx_t_15); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1587 + * raise ValueError("unconverted data remains: %s" % + * values[i][found.end():]) + * year = 1900 # <<<<<<<<<<<<<< + * month = day = 1 + * hour = minute = second = fraction = 0 + */ + __pyx_v_year = 1900; + + /* "pandas/tslib.pyx":1588 + * values[i][found.end():]) + * year = 1900 + * month = day = 1 # <<<<<<<<<<<<<< + * hour = minute = second = fraction = 0 + * tz = -1 + */ + __pyx_v_month = 1; + __pyx_v_day = 1; + + /* "pandas/tslib.pyx":1589 + * year = 1900 + * month = day = 1 + * hour = minute = second = fraction = 0 # <<<<<<<<<<<<<< + * tz = -1 + * # Default to -1 to signify that values not known; not critical to have, + */ + __pyx_v_hour = 0; + __pyx_v_minute = 0; + __pyx_v_second = 0; + __pyx_v_fraction = 0; + + /* "pandas/tslib.pyx":1590 + * month = day = 1 + * hour = minute = second = fraction = 0 + * tz = -1 # <<<<<<<<<<<<<< + * # Default to -1 to signify that values not known; not critical to have, + * # though + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_XDECREF_SET(__pyx_v_tz, __pyx_int_neg_1); + + /* "pandas/tslib.pyx":1593 + * # Default to -1 to signify that values not known; not critical to have, + * # though + * week_of_year = -1 # <<<<<<<<<<<<<< + * week_of_year_start = -1 + * # weekday and julian defaulted to -1 so as to signal need to calculate + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_XDECREF_SET(__pyx_v_week_of_year, __pyx_int_neg_1); + + /* "pandas/tslib.pyx":1594 + * # though + * week_of_year = -1 + * week_of_year_start = -1 # <<<<<<<<<<<<<< + * # weekday and julian defaulted to -1 so as to signal need to calculate + * # values + */ + __pyx_v_week_of_year_start = -1; + + /* "pandas/tslib.pyx":1597 + * # weekday and julian defaulted to -1 so as to signal need to calculate + * # values + * weekday = julian = -1 # <<<<<<<<<<<<<< + * found_dict = found.groupdict() + * for group_key in found_dict.iterkeys(): + */ + __pyx_v_weekday = -1; + __pyx_v_julian = -1; + + /* "pandas/tslib.pyx":1598 + * # values + * weekday = julian = -1 + * found_dict = found.groupdict() # <<<<<<<<<<<<<< + * for group_key in found_dict.iterkeys(): + * # Directives not explicitly handled below: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s_groupdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_found_dict, __pyx_t_15); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":1599 + * weekday = julian = -1 + * found_dict = found.groupdict() + * for group_key in found_dict.iterkeys(): # <<<<<<<<<<<<<< + * # Directives not explicitly handled below: + * # c, x, X + */ + __pyx_t_27 = 0; + if (unlikely(__pyx_v_found_dict == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iterkeys"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_found_dict, 0, __pyx_n_s_iterkeys, (&__pyx_t_28), (&__pyx_t_14)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_15); + __pyx_t_15 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_29 = __Pyx_dict_iter_next(__pyx_t_15, __pyx_t_28, &__pyx_t_27, &__pyx_t_5, NULL, NULL, __pyx_t_14); + if (unlikely(__pyx_t_29 == 0)) break; + if (unlikely(__pyx_t_29 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_group_key, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1605 + * # U, W + * # worthless without day of the week + * parse_code = _parse_code_table[group_key] # <<<<<<<<<<<<<< + * + * if parse_code == 0: + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v__parse_code_table, __pyx_v_group_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_parse_code = __pyx_t_29; + + /* "pandas/tslib.pyx":1677 + * # W starts week on Monday. + * week_of_year_start = 0 + * elif parse_code == 17: # <<<<<<<<<<<<<< + * # Since -1 is default value only need to worry about setting tz + * # if it can be something other than -1. + */ + switch (__pyx_v_parse_code) { + + /* "pandas/tslib.pyx":1607 + * parse_code = _parse_code_table[group_key] + * + * if parse_code == 0: # <<<<<<<<<<<<<< + * year = int(found_dict['y']) + * # Open Group specification for strptime() states that a %y + */ + case 0: + + /* "pandas/tslib.pyx":1608 + * + * if parse_code == 0: + * year = int(found_dict['y']) # <<<<<<<<<<<<<< + * # Open Group specification for strptime() states that a %y + * #value in the range of [00, 68] is in the century 2000, while + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_y); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_year = __pyx_t_29; + + /* "pandas/tslib.pyx":1612 + * #value in the range of [00, 68] is in the century 2000, while + * #[69,99] is in the century 1900 + * if year <= 68: # <<<<<<<<<<<<<< + * year += 2000 + * else: + */ + __pyx_t_9 = ((__pyx_v_year <= 68) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1613 + * #[69,99] is in the century 1900 + * if year <= 68: + * year += 2000 # <<<<<<<<<<<<<< + * else: + * year += 1900 + */ + __pyx_v_year = (__pyx_v_year + 2000); + goto __pyx_L46; + } + /*else*/ { + + /* "pandas/tslib.pyx":1615 + * year += 2000 + * else: + * year += 1900 # <<<<<<<<<<<<<< + * elif parse_code == 1: + * year = int(found_dict['Y']) + */ + __pyx_v_year = (__pyx_v_year + 1900); + } + __pyx_L46:; + break; + + /* "pandas/tslib.pyx":1616 + * else: + * year += 1900 + * elif parse_code == 1: # <<<<<<<<<<<<<< + * year = int(found_dict['Y']) + * elif parse_code == 2: + */ + case 1: + + /* "pandas/tslib.pyx":1617 + * year += 1900 + * elif parse_code == 1: + * year = int(found_dict['Y']) # <<<<<<<<<<<<<< + * elif parse_code == 2: + * month = int(found_dict['m']) + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_Y); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_year = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1618 + * elif parse_code == 1: + * year = int(found_dict['Y']) + * elif parse_code == 2: # <<<<<<<<<<<<<< + * month = int(found_dict['m']) + * elif parse_code == 3: + */ + case 2: + + /* "pandas/tslib.pyx":1619 + * year = int(found_dict['Y']) + * elif parse_code == 2: + * month = int(found_dict['m']) # <<<<<<<<<<<<<< + * elif parse_code == 3: + * # elif group_key == 'B': + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_m); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_month = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1620 + * elif parse_code == 2: + * month = int(found_dict['m']) + * elif parse_code == 3: # <<<<<<<<<<<<<< + * # elif group_key == 'B': + * month = locale_time.f_month.index(found_dict['B'].lower()) + */ + case 3: + + /* "pandas/tslib.pyx":1622 + * elif parse_code == 3: + * # elif group_key == 'B': + * month = locale_time.f_month.index(found_dict['B'].lower()) # <<<<<<<<<<<<<< + * elif parse_code == 4: + * # elif group_key == 'b': + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_f_month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_B); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_month = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1623 + * # elif group_key == 'B': + * month = locale_time.f_month.index(found_dict['B'].lower()) + * elif parse_code == 4: # <<<<<<<<<<<<<< + * # elif group_key == 'b': + * month = locale_time.a_month.index(found_dict['b'].lower()) + */ + case 4: + + /* "pandas/tslib.pyx":1625 + * elif parse_code == 4: + * # elif group_key == 'b': + * month = locale_time.a_month.index(found_dict['b'].lower()) # <<<<<<<<<<<<<< + * elif parse_code == 5: + * # elif group_key == 'd': + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_a_month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_b); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_month = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1626 + * # elif group_key == 'b': + * month = locale_time.a_month.index(found_dict['b'].lower()) + * elif parse_code == 5: # <<<<<<<<<<<<<< + * # elif group_key == 'd': + * day = int(found_dict['d']) + */ + case 5: + + /* "pandas/tslib.pyx":1628 + * elif parse_code == 5: + * # elif group_key == 'd': + * day = int(found_dict['d']) # <<<<<<<<<<<<<< + * elif parse_code == 6: + * # elif group_key == 'H': + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_d); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_day = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1629 + * # elif group_key == 'd': + * day = int(found_dict['d']) + * elif parse_code == 6: # <<<<<<<<<<<<<< + * # elif group_key == 'H': + * hour = int(found_dict['H']) + */ + case 6: + + /* "pandas/tslib.pyx":1631 + * elif parse_code == 6: + * # elif group_key == 'H': + * hour = int(found_dict['H']) # <<<<<<<<<<<<<< + * elif parse_code == 7: + * hour = int(found_dict['I']) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_H); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_hour = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1632 + * # elif group_key == 'H': + * hour = int(found_dict['H']) + * elif parse_code == 7: # <<<<<<<<<<<<<< + * hour = int(found_dict['I']) + * ampm = found_dict.get('p', '').lower() + */ + case 7: + + /* "pandas/tslib.pyx":1633 + * hour = int(found_dict['H']) + * elif parse_code == 7: + * hour = int(found_dict['I']) # <<<<<<<<<<<<<< + * ampm = found_dict.get('p', '').lower() + * # If there was no AM/PM indicator, we'll treat this like AM + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_I); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_hour = __pyx_t_29; + + /* "pandas/tslib.pyx":1634 + * elif parse_code == 7: + * hour = int(found_dict['I']) + * ampm = found_dict.get('p', '').lower() # <<<<<<<<<<<<<< + * # If there was no AM/PM indicator, we'll treat this like AM + * if ampm in ('', locale_time.am_pm[0]): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_found_dict, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_ampm, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1636 + * ampm = found_dict.get('p', '').lower() + * # If there was no AM/PM indicator, we'll treat this like AM + * if ampm in ('', locale_time.am_pm[0]): # <<<<<<<<<<<<<< + * # We're in AM so the hour is correct unless we're + * # looking at 12 midnight. + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_am_pm); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_v_ampm); + __pyx_t_4 = __pyx_v_ampm; + __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__5, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_9) { + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_30 = __pyx_t_10; + } else { + __pyx_t_30 = __pyx_t_9; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = (__pyx_t_30 != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1640 + * # looking at 12 midnight. + * # 12 midnight == 12 AM == hour 0 + * if hour == 12: # <<<<<<<<<<<<<< + * hour = 0 + * elif ampm == locale_time.am_pm[1]: + */ + __pyx_t_9 = ((__pyx_v_hour == 12) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1641 + * # 12 midnight == 12 AM == hour 0 + * if hour == 12: + * hour = 0 # <<<<<<<<<<<<<< + * elif ampm == locale_time.am_pm[1]: + * # We're in PM so we need to add 12 to the hour unless + */ + __pyx_v_hour = 0; + goto __pyx_L48; + } + __pyx_L48:; + goto __pyx_L47; + } + + /* "pandas/tslib.pyx":1642 + * if hour == 12: + * hour = 0 + * elif ampm == locale_time.am_pm[1]: # <<<<<<<<<<<<<< + * # We're in PM so we need to add 12 to the hour unless + * # we're looking at 12 noon. + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_am_pm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_v_ampm, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1646 + * # we're looking at 12 noon. + * # 12 noon == 12 PM == hour 12 + * if hour != 12: # <<<<<<<<<<<<<< + * hour += 12 + * elif parse_code == 8: + */ + __pyx_t_9 = ((__pyx_v_hour != 12) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1647 + * # 12 noon == 12 PM == hour 12 + * if hour != 12: + * hour += 12 # <<<<<<<<<<<<<< + * elif parse_code == 8: + * minute = int(found_dict['M']) + */ + __pyx_v_hour = (__pyx_v_hour + 12); + goto __pyx_L49; + } + __pyx_L49:; + goto __pyx_L47; + } + __pyx_L47:; + break; + + /* "pandas/tslib.pyx":1648 + * if hour != 12: + * hour += 12 + * elif parse_code == 8: # <<<<<<<<<<<<<< + * minute = int(found_dict['M']) + * elif parse_code == 9: + */ + case 8: + + /* "pandas/tslib.pyx":1649 + * hour += 12 + * elif parse_code == 8: + * minute = int(found_dict['M']) # <<<<<<<<<<<<<< + * elif parse_code == 9: + * second = int(found_dict['S']) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_M); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_minute = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1650 + * elif parse_code == 8: + * minute = int(found_dict['M']) + * elif parse_code == 9: # <<<<<<<<<<<<<< + * second = int(found_dict['S']) + * elif parse_code == 10: + */ + case 9: + + /* "pandas/tslib.pyx":1651 + * minute = int(found_dict['M']) + * elif parse_code == 9: + * second = int(found_dict['S']) # <<<<<<<<<<<<<< + * elif parse_code == 10: + * s = found_dict['f'] + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_S); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_second = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1652 + * elif parse_code == 9: + * second = int(found_dict['S']) + * elif parse_code == 10: # <<<<<<<<<<<<<< + * s = found_dict['f'] + * # Pad to always return microseconds. + */ + case 10: + + /* "pandas/tslib.pyx":1653 + * second = int(found_dict['S']) + * elif parse_code == 10: + * s = found_dict['f'] # <<<<<<<<<<<<<< + * # Pad to always return microseconds. + * s += "0" * (6 - len(s)) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_f); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1655 + * s = found_dict['f'] + * # Pad to always return microseconds. + * s += "0" * (6 - len(s)) # <<<<<<<<<<<<<< + * fraction = int(s) + * elif parse_code == 11: + */ + __pyx_t_31 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_31 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t((6 - __pyx_t_31)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Multiply(__pyx_kp_s_0, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1656 + * # Pad to always return microseconds. + * s += "0" * (6 - len(s)) + * fraction = int(s) # <<<<<<<<<<<<<< + * elif parse_code == 11: + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) + */ + __pyx_t_5 = PyNumber_Int(__pyx_v_s); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_fraction = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1657 + * s += "0" * (6 - len(s)) + * fraction = int(s) + * elif parse_code == 11: # <<<<<<<<<<<<<< + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) + * elif parse_code == 12: + */ + case 11: + + /* "pandas/tslib.pyx":1658 + * fraction = int(s) + * elif parse_code == 11: + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) # <<<<<<<<<<<<<< + * elif parse_code == 12: + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_f_weekday); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_A); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_weekday = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1659 + * elif parse_code == 11: + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) + * elif parse_code == 12: # <<<<<<<<<<<<<< + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) + * elif parse_code == 13: + */ + case 12: + + /* "pandas/tslib.pyx":1660 + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) + * elif parse_code == 12: + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) # <<<<<<<<<<<<<< + * elif parse_code == 13: + * weekday = int(found_dict['w']) + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_a_weekday); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_a); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_weekday = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1661 + * elif parse_code == 12: + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) + * elif parse_code == 13: # <<<<<<<<<<<<<< + * weekday = int(found_dict['w']) + * if weekday == 0: + */ + case 13: + + /* "pandas/tslib.pyx":1662 + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) + * elif parse_code == 13: + * weekday = int(found_dict['w']) # <<<<<<<<<<<<<< + * if weekday == 0: + * weekday = 6 + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_w); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_weekday = __pyx_t_29; + + /* "pandas/tslib.pyx":1663 + * elif parse_code == 13: + * weekday = int(found_dict['w']) + * if weekday == 0: # <<<<<<<<<<<<<< + * weekday = 6 + * else: + */ + __pyx_t_9 = ((__pyx_v_weekday == 0) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1664 + * weekday = int(found_dict['w']) + * if weekday == 0: + * weekday = 6 # <<<<<<<<<<<<<< + * else: + * weekday -= 1 + */ + __pyx_v_weekday = 6; + goto __pyx_L50; + } + /*else*/ { + + /* "pandas/tslib.pyx":1666 + * weekday = 6 + * else: + * weekday -= 1 # <<<<<<<<<<<<<< + * elif parse_code == 14: + * julian = int(found_dict['j']) + */ + __pyx_v_weekday = (__pyx_v_weekday - 1); + } + __pyx_L50:; + break; + + /* "pandas/tslib.pyx":1667 + * else: + * weekday -= 1 + * elif parse_code == 14: # <<<<<<<<<<<<<< + * julian = int(found_dict['j']) + * elif parse_code == 15 or parse_code == 16: + */ + case 14: + + /* "pandas/tslib.pyx":1668 + * weekday -= 1 + * elif parse_code == 14: + * julian = int(found_dict['j']) # <<<<<<<<<<<<<< + * elif parse_code == 15 or parse_code == 16: + * week_of_year = int(found_dict[group_key]) + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_j); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_julian = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1669 + * elif parse_code == 14: + * julian = int(found_dict['j']) + * elif parse_code == 15 or parse_code == 16: # <<<<<<<<<<<<<< + * week_of_year = int(found_dict[group_key]) + * if group_key == 'U': + */ + case 15: + case 16: + + /* "pandas/tslib.pyx":1670 + * julian = int(found_dict['j']) + * elif parse_code == 15 or parse_code == 16: + * week_of_year = int(found_dict[group_key]) # <<<<<<<<<<<<<< + * if group_key == 'U': + * # U starts week on Sunday. + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_v_group_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_week_of_year, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1671 + * elif parse_code == 15 or parse_code == 16: + * week_of_year = int(found_dict[group_key]) + * if group_key == 'U': # <<<<<<<<<<<<<< + * # U starts week on Sunday. + * week_of_year_start = 6 + */ + __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_group_key, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1673 + * if group_key == 'U': + * # U starts week on Sunday. + * week_of_year_start = 6 # <<<<<<<<<<<<<< + * else: + * # W starts week on Monday. + */ + __pyx_v_week_of_year_start = 6; + goto __pyx_L51; + } + /*else*/ { + + /* "pandas/tslib.pyx":1676 + * else: + * # W starts week on Monday. + * week_of_year_start = 0 # <<<<<<<<<<<<<< + * elif parse_code == 17: + * # Since -1 is default value only need to worry about setting tz + */ + __pyx_v_week_of_year_start = 0; + } + __pyx_L51:; + break; + + /* "pandas/tslib.pyx":1677 + * # W starts week on Monday. + * week_of_year_start = 0 + * elif parse_code == 17: # <<<<<<<<<<<<<< + * # Since -1 is default value only need to worry about setting tz + * # if it can be something other than -1. + */ + case 17: + + /* "pandas/tslib.pyx":1680 + * # Since -1 is default value only need to worry about setting tz + * # if it can be something other than -1. + * found_zone = found_dict['Z'].lower() # <<<<<<<<<<<<<< + * for value, tz_values in enumerate(locale_time.timezone): + * if found_zone in tz_values: + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_Z_2); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_found_zone, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1681 + * # if it can be something other than -1. + * found_zone = found_dict['Z'].lower() + * for value, tz_values in enumerate(locale_time.timezone): # <<<<<<<<<<<<<< + * if found_zone in tz_values: + * # Deal w/ bad locale setup where timezone names are the + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_4 = __pyx_int_0; + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_timezone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { + __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_31 = 0; + __pyx_t_32 = NULL; + } else { + __pyx_t_31 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_32 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + for (;;) { + if (!__pyx_t_32 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_31 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_31); __Pyx_INCREF(__pyx_t_5); __pyx_t_31++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_31); __pyx_t_31++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_32 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_31 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_31); __Pyx_INCREF(__pyx_t_5); __pyx_t_31++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_31); __pyx_t_31++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_32(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_tz_values, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1682 + * found_zone = found_dict['Z'].lower() + * for value, tz_values in enumerate(locale_time.timezone): + * if found_zone in tz_values: # <<<<<<<<<<<<<< + * # Deal w/ bad locale setup where timezone names are the + * # same and yet time.daylight is true; too ambiguous to + */ + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_found_zone, __pyx_v_tz_values, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_30 = (__pyx_t_9 != 0); + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1686 + * # same and yet time.daylight is true; too ambiguous to + * # be able to tell what timezone has daylight savings + * if (time.tzname[0] == time.tzname[1] and # <<<<<<<<<<<<<< + * time.daylight and found_zone not in ("utc", "gmt")): + * break + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tzname); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_tzname); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_33, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_33 = PyObject_RichCompare(__pyx_t_5, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_33); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_33); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1687 + * # be able to tell what timezone has daylight savings + * if (time.tzname[0] == time.tzname[1] and + * time.daylight and found_zone not in ("utc", "gmt")): # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_33 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_daylight); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (__pyx_t_9) { + __Pyx_INCREF(__pyx_v_found_zone); + __pyx_t_16 = __pyx_v_found_zone; + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_16, __pyx_n_s_utc, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_10) { + __pyx_t_34 = (__Pyx_PyString_Equals(__pyx_t_16, __pyx_n_s_gmt, Py_NE)); if (unlikely(__pyx_t_34 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_35 = __pyx_t_34; + } else { + __pyx_t_35 = __pyx_t_10; + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_10 = __pyx_t_35; + __pyx_t_35 = __pyx_t_10; + } else { + __pyx_t_35 = __pyx_t_9; + } + __pyx_t_9 = __pyx_t_35; + } else { + __pyx_t_9 = __pyx_t_30; + } + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1688 + * if (time.tzname[0] == time.tzname[1] and + * time.daylight and found_zone not in ("utc", "gmt")): + * break # <<<<<<<<<<<<<< + * else: + * tz = value + */ + goto __pyx_L53_break; + } + /*else*/ { + + /* "pandas/tslib.pyx":1690 + * break + * else: + * tz = value # <<<<<<<<<<<<<< + * break + * # If we know the wk of the year and what day of that wk, we can figure + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_v_value); + + /* "pandas/tslib.pyx":1691 + * else: + * tz = value + * break # <<<<<<<<<<<<<< + * # If we know the wk of the year and what day of that wk, we can figure + * # out the Julian day of the year. + */ + goto __pyx_L53_break; + } + } + } + __pyx_L53_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + break; + default: break; + } + } + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":1694 + * # If we know the wk of the year and what day of that wk, we can figure + * # out the Julian day of the year. + * if julian == -1 and week_of_year != -1 and weekday != -1: # <<<<<<<<<<<<<< + * week_starts_Mon = True if week_of_year_start == 0 else False + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, + */ + __pyx_t_9 = (__pyx_v_julian == -1); + if (__pyx_t_9) { + __pyx_t_15 = PyObject_RichCompare(__pyx_v_week_of_year, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_30) { + __pyx_t_35 = (__pyx_v_weekday != -1); + __pyx_t_10 = __pyx_t_35; + } else { + __pyx_t_10 = __pyx_t_30; + } + __pyx_t_30 = __pyx_t_10; + } else { + __pyx_t_30 = __pyx_t_9; + } + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1695 + * # out the Julian day of the year. + * if julian == -1 and week_of_year != -1 and weekday != -1: + * week_starts_Mon = True if week_of_year_start == 0 else False # <<<<<<<<<<<<<< + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, + * week_starts_Mon) + */ + if (((__pyx_v_week_of_year_start == 0) != 0)) { + __pyx_t_30 = 1; + } else { + __pyx_t_30 = 0; + } + __pyx_v_week_starts_Mon = __pyx_t_30; + + /* "pandas/tslib.pyx":1696 + * if julian == -1 and week_of_year != -1 and weekday != -1: + * week_starts_Mon = True if week_of_year_start == 0 else False + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, # <<<<<<<<<<<<<< + * week_starts_Mon) + * # Cannot pre-calculate datetime_date() since can change in Julian + */ + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_calc_julian_from_U_or_W); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_weekday); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":1697 + * week_starts_Mon = True if week_of_year_start == 0 else False + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, + * week_starts_Mon) # <<<<<<<<<<<<<< + * # Cannot pre-calculate datetime_date() since can change in Julian + * # calculation and thus could have different value for the day of the wk + */ + __pyx_t_16 = __Pyx_PyBool_FromLong(__pyx_v_week_starts_Mon); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + + /* "pandas/tslib.pyx":1696 + * if julian == -1 and week_of_year != -1 and weekday != -1: + * week_starts_Mon = True if week_of_year_start == 0 else False + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, # <<<<<<<<<<<<<< + * week_starts_Mon) + * # Cannot pre-calculate datetime_date() since can change in Julian + */ + __pyx_t_33 = PyTuple_New(4); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_week_of_year); + PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_v_week_of_year); + __Pyx_GIVEREF(__pyx_v_week_of_year); + PyTuple_SET_ITEM(__pyx_t_33, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_33, 3, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_33, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_julian = __pyx_t_14; + goto __pyx_L56; + } + __pyx_L56:; + + /* "pandas/tslib.pyx":1701 + * # calculation and thus could have different value for the day of the wk + * # calculation. + * if julian == -1: # <<<<<<<<<<<<<< + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ + */ + __pyx_t_30 = ((__pyx_v_julian == -1) != 0); + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1703 + * if julian == -1: + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ # <<<<<<<<<<<<<< + * datetime_date(year, 1, 1).toordinal() + 1 + * else: # Assume that if they bothered to include Julian day it will + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_33); + __Pyx_GIVEREF(__pyx_t_33); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_33 = 0; + __pyx_t_15 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1704 + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ + * datetime_date(year, 1, 1).toordinal() + 1 # <<<<<<<<<<<<<< + * else: # Assume that if they bothered to include Julian day it will + * # be accurate. + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":1703 + * if julian == -1: + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ # <<<<<<<<<<<<<< + * datetime_date(year, 1, 1).toordinal() + 1 + * else: # Assume that if they bothered to include Julian day it will + */ + __pyx_t_15 = PyNumber_Subtract(__pyx_t_2, __pyx_t_16); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":1704 + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ + * datetime_date(year, 1, 1).toordinal() + 1 # <<<<<<<<<<<<<< + * else: # Assume that if they bothered to include Julian day it will + * # be accurate. + */ + __pyx_t_16 = PyNumber_Add(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_julian = __pyx_t_14; + goto __pyx_L57; + } + /*else*/ { + + /* "pandas/tslib.pyx":1707 + * else: # Assume that if they bothered to include Julian day it will + * # be accurate. + * datetime_result = datetime_date.fromordinal( # <<<<<<<<<<<<<< + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) + * year = datetime_result.year + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_fromordinal); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":1708 + * # be accurate. + * datetime_result = datetime_date.fromordinal( + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) # <<<<<<<<<<<<<< + * year = datetime_result.year + * month = datetime_result.month + */ + __pyx_t_16 = __Pyx_PyInt_From_long((__pyx_v_julian - 1)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_33 = PyTuple_New(3); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_33, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_33, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_33 = PyNumber_Add(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1707 + * else: # Assume that if they bothered to include Julian day it will + * # be accurate. + * datetime_result = datetime_date.fromordinal( # <<<<<<<<<<<<<< + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) + * year = datetime_result.year + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_33); + __Pyx_GIVEREF(__pyx_t_33); + __pyx_t_33 = 0; + __pyx_t_33 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, NULL); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_datetime_result, __pyx_t_33); + __pyx_t_33 = 0; + + /* "pandas/tslib.pyx":1709 + * datetime_result = datetime_date.fromordinal( + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) + * year = datetime_result.year # <<<<<<<<<<<<<< + * month = datetime_result.month + * day = datetime_result.day + */ + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime_result, __pyx_n_s_year); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_33); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_v_year = __pyx_t_14; + + /* "pandas/tslib.pyx":1710 + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) + * year = datetime_result.year + * month = datetime_result.month # <<<<<<<<<<<<<< + * day = datetime_result.day + * if weekday == -1: + */ + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime_result, __pyx_n_s_month); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_33); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_v_month = __pyx_t_14; + + /* "pandas/tslib.pyx":1711 + * year = datetime_result.year + * month = datetime_result.month + * day = datetime_result.day # <<<<<<<<<<<<<< + * if weekday == -1: + * weekday = datetime_date(year, month, day).weekday() + */ + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime_result, __pyx_n_s_day); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_33); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_v_day = __pyx_t_14; + } + __pyx_L57:; + + /* "pandas/tslib.pyx":1712 + * month = datetime_result.month + * day = datetime_result.day + * if weekday == -1: # <<<<<<<<<<<<<< + * weekday = datetime_date(year, month, day).weekday() + * + */ + __pyx_t_30 = ((__pyx_v_weekday == -1) != 0); + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1713 + * day = datetime_result.day + * if weekday == -1: + * weekday = datetime_date(year, month, day).weekday() # <<<<<<<<<<<<<< + * + * dts.year = year + */ + __pyx_t_33 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_4 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_t_2, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_weekday); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_weekday = __pyx_t_14; + goto __pyx_L58; + } + __pyx_L58:; + + /* "pandas/tslib.pyx":1715 + * weekday = datetime_date(year, month, day).weekday() + * + * dts.year = year # <<<<<<<<<<<<<< + * dts.month = month + * dts.day = day + */ + __pyx_v_dts.year = __pyx_v_year; + + /* "pandas/tslib.pyx":1716 + * + * dts.year = year + * dts.month = month # <<<<<<<<<<<<<< + * dts.day = day + * dts.hour = hour + */ + __pyx_v_dts.month = __pyx_v_month; + + /* "pandas/tslib.pyx":1717 + * dts.year = year + * dts.month = month + * dts.day = day # <<<<<<<<<<<<<< + * dts.hour = hour + * dts.min = minute + */ + __pyx_v_dts.day = __pyx_v_day; + + /* "pandas/tslib.pyx":1718 + * dts.month = month + * dts.day = day + * dts.hour = hour # <<<<<<<<<<<<<< + * dts.min = minute + * dts.sec = second + */ + __pyx_v_dts.hour = __pyx_v_hour; + + /* "pandas/tslib.pyx":1719 + * dts.day = day + * dts.hour = hour + * dts.min = minute # <<<<<<<<<<<<<< + * dts.sec = second + * dts.us = fraction + */ + __pyx_v_dts.min = __pyx_v_minute; + + /* "pandas/tslib.pyx":1720 + * dts.hour = hour + * dts.min = minute + * dts.sec = second # <<<<<<<<<<<<<< + * dts.us = fraction + * + */ + __pyx_v_dts.sec = __pyx_v_second; + + /* "pandas/tslib.pyx":1721 + * dts.min = minute + * dts.sec = second + * dts.us = fraction # <<<<<<<<<<<<<< + * + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + */ + __pyx_v_dts.us = __pyx_v_fraction; + + /* "pandas/tslib.pyx":1723 + * dts.us = fraction + * + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * try: + * _check_dts_bounds(&dts) + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_iresult.diminfo[0].strides) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1724 + * + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * try: # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":1725 + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * try: + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_t_16 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L59_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L66_try_end; + __pyx_L59_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":1726 + * try: + * _check_dts_bounds(&dts) + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_14) { + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_2, &__pyx_t_33) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_33); + + /* "pandas/tslib.pyx":1727 + * _check_dts_bounds(&dts) + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1728 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_15); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_27 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1729 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * + */ + goto __pyx_L68_except_continue; + } + + /* "pandas/tslib.pyx":1730 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_33); + __Pyx_ErrRestore(__pyx_t_16, __pyx_t_2, __pyx_t_33); + __pyx_t_16 = 0; __pyx_t_2 = 0; __pyx_t_33 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + goto __pyx_L60_exception_handled; + __pyx_L68_except_continue:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + goto __pyx_L65_try_continue; + } + goto __pyx_L61_except_error; + __pyx_L61_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L65_try_continue:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_3); + goto __pyx_L35_continue; + __pyx_L60_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_3); + __pyx_L66_try_end:; + } + __pyx_L35_continue:; + } + + /* "pandas/tslib.pyx":1732 + * raise + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1499 + * + * + * def array_strptime(ndarray[object] values, object fmt, coerce=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_33); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_locale_time); + __Pyx_XDECREF(__pyx_v_format_regex); + __Pyx_XDECREF(__pyx_v_err); + __Pyx_XDECREF(__pyx_v_bad_directive); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v__parse_code_table); + __Pyx_XDECREF(__pyx_v_found); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XDECREF(__pyx_v_week_of_year); + __Pyx_XDECREF(__pyx_v_found_dict); + __Pyx_XDECREF(__pyx_v_group_key); + __Pyx_XDECREF(__pyx_v_ampm); + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_found_zone); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_tz_values); + __Pyx_XDECREF(__pyx_v_datetime_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1735 + * + * + * cdef inline _get_datetime64_nanos(object val): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__get_datetime64_nanos(PyObject *__pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PANDAS_DATETIMEUNIT __pyx_v_unit; + npy_datetime __pyx_v_ival; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_datetime64_nanos", 0); + + /* "pandas/tslib.pyx":1741 + * npy_datetime ival + * + * unit = get_datetime64_unit(val) # <<<<<<<<<<<<<< + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') + */ + __pyx_v_unit = get_datetime64_unit(__pyx_v_val); + + /* "pandas/tslib.pyx":1742 + * + * unit = get_datetime64_unit(val) + * if unit == 3: # <<<<<<<<<<<<<< + * raise ValueError('NumPy 1.6.1 business freq not supported') + * + */ + __pyx_t_1 = ((__pyx_v_unit == 3) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1743 + * unit = get_datetime64_unit(val) + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') # <<<<<<<<<<<<<< + * + * ival = get_datetime64_value(val) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1745 + * raise ValueError('NumPy 1.6.1 business freq not supported') + * + * ival = get_datetime64_value(val) # <<<<<<<<<<<<<< + * + * if unit != PANDAS_FR_ns: + */ + __pyx_v_ival = get_datetime64_value(__pyx_v_val); + + /* "pandas/tslib.pyx":1747 + * ival = get_datetime64_value(val) + * + * if unit != PANDAS_FR_ns: # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(ival, unit, &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_1 = ((__pyx_v_unit != PANDAS_FR_ns) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1748 + * + * if unit != PANDAS_FR_ns: + * pandas_datetime_to_datetimestruct(ival, unit, &dts) # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + */ + pandas_datetime_to_datetimestruct(__pyx_v_ival, __pyx_v_unit, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1749 + * if unit != PANDAS_FR_ns: + * pandas_datetime_to_datetimestruct(ival, unit, &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * else: + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1750 + * pandas_datetime_to_datetimestruct(ival, unit, &dts) + * _check_dts_bounds(&dts) + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * else: + * return ival + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1752 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * else: + * return ival # <<<<<<<<<<<<<< + * + * cpdef inline int64_t cast_from_unit(object ts, object unit) except -1: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_ival); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1735 + * + * + * cdef inline _get_datetime64_nanos(object val): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib._get_datetime64_nanos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1754 + * return ival + * + * cpdef inline int64_t cast_from_unit(object ts, object unit) except -1: # <<<<<<<<<<<<<< + * """ return a casting of the unit represented to nanoseconds + * round the fractional part of a float to our precision, p """ + */ + +static PyObject *__pyx_pw_6pandas_5tslib_37cast_from_unit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_cast_from_unit(PyObject *__pyx_v_ts, PyObject *__pyx_v_unit, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_m = NULL; + long __pyx_v_p; + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_frac = NULL; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cast_from_unit", 0); + + /* "pandas/tslib.pyx":1757 + * """ return a casting of the unit represented to nanoseconds + * round the fractional part of a float to our precision, p """ + * if unit == 'D' or unit == 'd': # <<<<<<<<<<<<<< + * m = 1000000000L * 86400 + * p = 6 + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_d, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1758 + * round the fractional part of a float to our precision, p """ + * if unit == 'D' or unit == 'd': + * m = 1000000000L * 86400 # <<<<<<<<<<<<<< + * p = 6 + * elif unit == 'h': + */ + __Pyx_INCREF(__pyx_int_86400000000000L); + __pyx_v_m = __pyx_int_86400000000000L; + + /* "pandas/tslib.pyx":1759 + * if unit == 'D' or unit == 'd': + * m = 1000000000L * 86400 + * p = 6 # <<<<<<<<<<<<<< + * elif unit == 'h': + * m = 1000000000L * 3600 + */ + __pyx_v_p = 6; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1760 + * m = 1000000000L * 86400 + * p = 6 + * elif unit == 'h': # <<<<<<<<<<<<<< + * m = 1000000000L * 3600 + * p = 6 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_h, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1761 + * p = 6 + * elif unit == 'h': + * m = 1000000000L * 3600 # <<<<<<<<<<<<<< + * p = 6 + * elif unit == 'm': + */ + __Pyx_INCREF(__pyx_int_3600000000000L); + __pyx_v_m = __pyx_int_3600000000000L; + + /* "pandas/tslib.pyx":1762 + * elif unit == 'h': + * m = 1000000000L * 3600 + * p = 6 # <<<<<<<<<<<<<< + * elif unit == 'm': + * m = 1000000000L * 60 + */ + __pyx_v_p = 6; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1763 + * m = 1000000000L * 3600 + * p = 6 + * elif unit == 'm': # <<<<<<<<<<<<<< + * m = 1000000000L * 60 + * p = 6 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_m, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1764 + * p = 6 + * elif unit == 'm': + * m = 1000000000L * 60 # <<<<<<<<<<<<<< + * p = 6 + * elif unit == 's': + */ + __Pyx_INCREF(__pyx_int_60000000000L); + __pyx_v_m = __pyx_int_60000000000L; + + /* "pandas/tslib.pyx":1765 + * elif unit == 'm': + * m = 1000000000L * 60 + * p = 6 # <<<<<<<<<<<<<< + * elif unit == 's': + * m = 1000000000L + */ + __pyx_v_p = 6; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1766 + * m = 1000000000L * 60 + * p = 6 + * elif unit == 's': # <<<<<<<<<<<<<< + * m = 1000000000L + * p = 6 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_s, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1767 + * p = 6 + * elif unit == 's': + * m = 1000000000L # <<<<<<<<<<<<<< + * p = 6 + * elif unit == 'ms': + */ + __Pyx_INCREF(__pyx_int_1000000000L); + __pyx_v_m = __pyx_int_1000000000L; + + /* "pandas/tslib.pyx":1768 + * elif unit == 's': + * m = 1000000000L + * p = 6 # <<<<<<<<<<<<<< + * elif unit == 'ms': + * m = 1000000L + */ + __pyx_v_p = 6; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1769 + * m = 1000000000L + * p = 6 + * elif unit == 'ms': # <<<<<<<<<<<<<< + * m = 1000000L + * p = 3 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_ms, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1770 + * p = 6 + * elif unit == 'ms': + * m = 1000000L # <<<<<<<<<<<<<< + * p = 3 + * elif unit == 'us': + */ + __Pyx_INCREF(__pyx_int_1000000L); + __pyx_v_m = __pyx_int_1000000L; + + /* "pandas/tslib.pyx":1771 + * elif unit == 'ms': + * m = 1000000L + * p = 3 # <<<<<<<<<<<<<< + * elif unit == 'us': + * m = 1000L + */ + __pyx_v_p = 3; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1772 + * m = 1000000L + * p = 3 + * elif unit == 'us': # <<<<<<<<<<<<<< + * m = 1000L + * p = 0 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_us, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1773 + * p = 3 + * elif unit == 'us': + * m = 1000L # <<<<<<<<<<<<<< + * p = 0 + * elif unit == 'ns' or unit is None: + */ + __Pyx_INCREF(__pyx_int_1000L); + __pyx_v_m = __pyx_int_1000L; + + /* "pandas/tslib.pyx":1774 + * elif unit == 'us': + * m = 1000L + * p = 0 # <<<<<<<<<<<<<< + * elif unit == 'ns' or unit is None: + * m = 1L + */ + __pyx_v_p = 0; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1775 + * m = 1000L + * p = 0 + * elif unit == 'ns' or unit is None: # <<<<<<<<<<<<<< + * m = 1L + * p = 0 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_ns, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_3) { + __pyx_t_1 = (__pyx_v_unit == Py_None); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1776 + * p = 0 + * elif unit == 'ns' or unit is None: + * m = 1L # <<<<<<<<<<<<<< + * p = 0 + * else: + */ + __Pyx_INCREF(__pyx_int_1L); + __pyx_v_m = __pyx_int_1L; + + /* "pandas/tslib.pyx":1777 + * elif unit == 'ns' or unit is None: + * m = 1L + * p = 0 # <<<<<<<<<<<<<< + * else: + * raise ValueError("cannot cast unit {0}".format(unit)) + */ + __pyx_v_p = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":1779 + * p = 0 + * else: + * raise ValueError("cannot cast unit {0}".format(unit)) # <<<<<<<<<<<<<< + * + * # just give me the unit back + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_cast_unit_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_unit); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_unit); + __Pyx_GIVEREF(__pyx_v_unit); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1782 + * + * # just give me the unit back + * if ts is None: # <<<<<<<<<<<<<< + * return m + * + */ + __pyx_t_2 = (__pyx_v_ts == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1783 + * # just give me the unit back + * if ts is None: + * return m # <<<<<<<<<<<<<< + * + * # cast the unit, multiply base/frace separately + */ + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_v_m); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_7; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1787 + * # cast the unit, multiply base/frace separately + * # to avoid precision issues from float -> int + * base = ts # <<<<<<<<<<<<<< + * frac = ts-base + * if p: + */ + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(((__pyx_t_5numpy_int64_t)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_base = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1788 + * # to avoid precision issues from float -> int + * base = ts + * frac = ts-base # <<<<<<<<<<<<<< + * if p: + * frac = round(frac,p) + */ + __pyx_t_6 = PyNumber_Subtract(__pyx_v_ts, __pyx_v_base); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_frac = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1789 + * base = ts + * frac = ts-base + * if p: # <<<<<<<<<<<<<< + * frac = round(frac,p) + * return (base*m) + (frac*m) + */ + __pyx_t_3 = (__pyx_v_p != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1790 + * frac = ts-base + * if p: + * frac = round(frac,p) # <<<<<<<<<<<<<< + * return (base*m) + (frac*m) + * + */ + __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_frac); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_frac); + __Pyx_GIVEREF(__pyx_v_frac); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":1791 + * if p: + * frac = round(frac,p) + * return (base*m) + (frac*m) # <<<<<<<<<<<<<< + * + * def cast_to_nanoseconds(ndarray arr): + */ + __pyx_t_6 = PyNumber_Multiply(__pyx_v_base, __pyx_v_m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Multiply(__pyx_v_frac, __pyx_v_m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = (((__pyx_t_5numpy_int64_t)__pyx_t_7) + ((__pyx_t_5numpy_int64_t)__pyx_t_8)); + goto __pyx_L0; + + /* "pandas/tslib.pyx":1754 + * return ival + * + * cpdef inline int64_t cast_from_unit(object ts, object unit) except -1: # <<<<<<<<<<<<<< + * """ return a casting of the unit represented to nanoseconds + * round the fractional part of a float to our precision, p """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.cast_from_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_m); + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_frac); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_37cast_from_unit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_36cast_from_unit[] = " return a casting of the unit represented to nanoseconds\n round the fractional part of a float to our precision, p "; +static PyObject *__pyx_pw_6pandas_5tslib_37cast_from_unit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ts = 0; + PyObject *__pyx_v_unit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cast_from_unit (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_unit,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cast_from_unit", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast_from_unit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_ts = values[0]; + __pyx_v_unit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cast_from_unit", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.cast_from_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_36cast_from_unit(__pyx_self, __pyx_v_ts, __pyx_v_unit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_36cast_from_unit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_unit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_int64_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cast_from_unit", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_cast_from_unit(__pyx_v_ts, __pyx_v_unit, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.cast_from_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1793 + * return (base*m) + (frac*m) + * + * def cast_to_nanoseconds(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_39cast_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_39cast_to_nanoseconds = {__Pyx_NAMESTR("cast_to_nanoseconds"), (PyCFunction)__pyx_pw_6pandas_5tslib_39cast_to_nanoseconds, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_39cast_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cast_to_nanoseconds (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_38cast_to_nanoseconds(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_38cast_to_nanoseconds(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_ivalues = 0; + PyArrayObject *__pyx_v_iresult = 0; + PANDAS_DATETIMEUNIT __pyx_v_unit; + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_v_shape = NULL; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ivalues; + __Pyx_Buffer __pyx_pybuffer_ivalues; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cast_to_nanoseconds", 0); + __pyx_pybuffer_ivalues.pybuffer.buf = NULL; + __pyx_pybuffer_ivalues.refcount = 0; + __pyx_pybuffernd_ivalues.data = NULL; + __pyx_pybuffernd_ivalues.rcbuffer = &__pyx_pybuffer_ivalues; + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + + /* "pandas/tslib.pyx":1795 + * def cast_to_nanoseconds(ndarray arr): + * cdef: + * Py_ssize_t i, n = arr.size # <<<<<<<<<<<<<< + * ndarray[int64_t] ivalues, iresult + * PANDAS_DATETIMEUNIT unit + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/tslib.pyx":1800 + * pandas_datetimestruct dts + * + * shape = ( arr).shape # <<<<<<<<<<<<<< + * + * ivalues = arr.view(np.int64).ravel() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_shape = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1802 + * shape = ( arr).shape + * + * ivalues = arr.view(np.int64).ravel() # <<<<<<<<<<<<<< + * + * result = np.empty(shape, dtype='M8[ns]') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_ivalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_ivalues.diminfo[0].strides = __pyx_pybuffernd_ivalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ivalues.diminfo[0].shape = __pyx_pybuffernd_ivalues.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_ivalues = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1804 + * ivalues = arr.view(np.int64).ravel() + * + * result = np.empty(shape, dtype='M8[ns]') # <<<<<<<<<<<<<< + * iresult = result.ravel().view(np.int64) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":1805 + * + * result = np.empty(shape, dtype='M8[ns]') + * iresult = result.ravel().view(np.int64) # <<<<<<<<<<<<<< + * + * if len(iresult) == 0: + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_ravel); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1807 + * iresult = result.ravel().view(np.int64) + * + * if len(iresult) == 0: # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_iresult)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((__pyx_t_2 == 0) != 0); + if (__pyx_t_11) { + + /* "pandas/tslib.pyx":1808 + * + * if len(iresult) == 0: + * return result # <<<<<<<<<<<<<< + * + * unit = get_datetime64_unit(arr.flat[0]) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1810 + * return result + * + * unit = get_datetime64_unit(arr.flat[0]) # <<<<<<<<<<<<<< + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_unit = get_datetime64_unit(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1811 + * + * unit = get_datetime64_unit(arr.flat[0]) + * if unit == 3: # <<<<<<<<<<<<<< + * raise ValueError('NumPy 1.6.1 business freq not supported') + * + */ + __pyx_t_11 = ((__pyx_v_unit == 3) != 0); + if (__pyx_t_11) { + + /* "pandas/tslib.pyx":1812 + * unit = get_datetime64_unit(arr.flat[0]) + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1814 + * raise ValueError('NumPy 1.6.1 business freq not supported') + * + * for i in range(n): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts) + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/tslib.pyx":1815 + * + * for i in range(n): + * pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts) # <<<<<<<<<<<<<< + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_ivalues.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_ivalues.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ivalues.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ivalues.diminfo[0].strides)), __pyx_v_unit, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1816 + * for i in range(n): + * pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts) + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_iresult.diminfo[0].strides) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1817 + * pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts) + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/tslib.pyx":1819 + * _check_dts_bounds(&dts) + * + * return result # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1793 + * return (base*m) + (frac*m) + * + * def cast_to_nanoseconds(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.cast_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ivalues); + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF(__pyx_v_shape); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1825 + * + * + * def pydt_to_i8(object pydt): # <<<<<<<<<<<<<< + * ''' + * Convert to int64 representation compatible with numpy datetime64; converts + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_41pydt_to_i8(PyObject *__pyx_self, PyObject *__pyx_v_pydt); /*proto*/ +static char __pyx_doc_6pandas_5tslib_40pydt_to_i8[] = "\n Convert to int64 representation compatible with numpy datetime64; converts\n to UTC\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_41pydt_to_i8 = {__Pyx_NAMESTR("pydt_to_i8"), (PyCFunction)__pyx_pw_6pandas_5tslib_41pydt_to_i8, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_40pydt_to_i8)}; +static PyObject *__pyx_pw_6pandas_5tslib_41pydt_to_i8(PyObject *__pyx_self, PyObject *__pyx_v_pydt) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pydt_to_i8 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_40pydt_to_i8(__pyx_self, ((PyObject *)__pyx_v_pydt)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_40pydt_to_i8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pydt) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pydt_to_i8", 0); + + /* "pandas/tslib.pyx":1833 + * _TSObject ts + * + * ts = convert_to_tsobject(pydt, None, None) # <<<<<<<<<<<<<< + * + * return ts.value + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_pydt, Py_None, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1835 + * ts = convert_to_tsobject(pydt, None, None) + * + * return ts.value # <<<<<<<<<<<<<< + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_ts->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1825 + * + * + * def pydt_to_i8(object pydt): # <<<<<<<<<<<<<< + * ''' + * Convert to int64 representation compatible with numpy datetime64; converts + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.pydt_to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1837 + * return ts.value + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): # <<<<<<<<<<<<<< + * ''' + * Inverse of pydt_to_i8 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_43i8_to_pydt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_42i8_to_pydt[] = "\n Inverse of pydt_to_i8\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_43i8_to_pydt = {__Pyx_NAMESTR("i8_to_pydt"), (PyCFunction)__pyx_pw_6pandas_5tslib_43i8_to_pydt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_42i8_to_pydt)}; +static PyObject *__pyx_pw_6pandas_5tslib_43i8_to_pydt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_i8; + CYTHON_UNUSED PyObject *__pyx_v_tzinfo = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("i8_to_pydt (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i8,&__pyx_n_s_tzinfo,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i8)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tzinfo); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "i8_to_pydt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_i8 = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_i8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_tzinfo = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("i8_to_pydt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.i8_to_pydt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_42i8_to_pydt(__pyx_self, __pyx_v_i8, __pyx_v_tzinfo); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_42i8_to_pydt(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_i8, CYTHON_UNUSED PyObject *__pyx_v_tzinfo) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("i8_to_pydt", 0); + + /* "pandas/tslib.pyx":1841 + * Inverse of pydt_to_i8 + * ''' + * return Timestamp(i8) # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_i8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1837 + * return ts.value + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): # <<<<<<<<<<<<<< + * ''' + * Inverse of pydt_to_i8 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.i8_to_pydt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1853 + * have_pytz = False + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_45tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_45tz_convert = {__Pyx_NAMESTR("tz_convert"), (PyCFunction)__pyx_pw_6pandas_5tslib_45tz_convert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_45tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vals = 0; + PyObject *__pyx_v_tz1 = 0; + PyObject *__pyx_v_tz2 = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_convert (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vals,&__pyx_n_s_tz1,&__pyx_n_s_tz2,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_convert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_vals = ((PyArrayObject *)values[0]); + __pyx_v_tz1 = values[1]; + __pyx_v_tz2 = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_44tz_convert(__pyx_self, __pyx_v_vals, __pyx_v_tz1, __pyx_v_tz2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_44tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vals, PyObject *__pyx_v_tz1, PyObject *__pyx_v_tz2) { + PyArrayObject *__pyx_v_utc_dates = 0; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_pos; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_v; + __pyx_t_5numpy_int64_t __pyx_v_offset; + pandas_datetimestruct __pyx_v_dts; + CYTHON_UNUSED PyObject *__pyx_v_pytz = NULL; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + Py_ssize_t __pyx_v_trans_len; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + __Pyx_LocalBuf_ND __pyx_pybuffernd_utc_dates; + __Pyx_Buffer __pyx_pybuffer_utc_dates; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vals; + __Pyx_Buffer __pyx_pybuffer_vals; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + long __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_convert", 0); + __pyx_pybuffer_utc_dates.pybuffer.buf = NULL; + __pyx_pybuffer_utc_dates.refcount = 0; + __pyx_pybuffernd_utc_dates.data = NULL; + __pyx_pybuffernd_utc_dates.rcbuffer = &__pyx_pybuffer_utc_dates; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_vals.pybuffer.buf = NULL; + __pyx_pybuffer_vals.refcount = 0; + __pyx_pybuffernd_vals.data = NULL; + __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1856 + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + * Py_ssize_t i, pos, n = len(vals) # <<<<<<<<<<<<<< + * int64_t v, offset + * pandas_datetimestruct dts + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_vals)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":1860 + * pandas_datetimestruct dts + * + * if not have_pytz: # <<<<<<<<<<<<<< + * import pytz + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_have_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1861 + * + * if not have_pytz: + * import pytz # <<<<<<<<<<<<<< + * + * # Convert to UTC + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_pytz = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1865 + * # Convert to UTC + * + * if _get_zone(tz1) != 'UTC': # <<<<<<<<<<<<<< + * utc_dates = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz1): + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_UTC, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1866 + * + * if _get_zone(tz1) != 'UTC': + * utc_dates = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * if _is_tzlocal(tz1): + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer, (PyObject*)__pyx_v_utc_dates, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_utc_dates.diminfo[0].strides = __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_utc_dates.diminfo[0].shape = __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_utc_dates = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1867 + * if _get_zone(tz1) != 'UTC': + * utc_dates = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz1): # <<<<<<<<<<<<<< + * for i in range(n): + * v = vals[i] + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz1) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1868 + * utc_dates = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz1): + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_1; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":1869 + * if _is_tzlocal(tz1): + * for i in range(n): + * v = vals[i] # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_vals.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1870 + * for i in range(n): + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) + */ + pandas_datetime_to_datetimestruct(__pyx_v_v, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1871 + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz1) + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":1872 + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) # <<<<<<<<<<<<<< + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + * * 1000000000) + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + + /* "pandas/tslib.pyx":1871 + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz1) + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + */ + __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __Pyx_INCREF(__pyx_v_tz1); + PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_v_tz1); + __Pyx_GIVEREF(__pyx_v_tz1); + __pyx_t_8 = 0; + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_17)); + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":1873 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) # <<<<<<<<<<<<<< + * * 1000000000) + * utc_dates[i] = v - delta + */ + __pyx_t_17 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz1, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_17)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":1874 + * dts.min, dts.sec, dts.us, tz1) + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + * * 1000000000) # <<<<<<<<<<<<<< + * utc_dates[i] = v - delta + * else: + */ + __pyx_t_17 = PyNumber_Multiply(__pyx_t_18, __pyx_int_1000000000); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_17); + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":1875 + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + * * 1000000000) + * utc_dates[i] = v - delta # <<<<<<<<<<<<<< + * else: + * deltas = _get_deltas(tz1) + */ + __pyx_t_17 = __Pyx_PyInt_From_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyNumber_Subtract(__pyx_t_17, __pyx_v_delta); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_18); if (unlikely((__pyx_t_19 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_20 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_utc_dates.diminfo[0].strides) = __pyx_t_19; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1877 + * utc_dates[i] = v - delta + * else: + * deltas = _get_deltas(tz1) # <<<<<<<<<<<<<< + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(vals[0]) - 1 + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":1878 + * else: + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(vals[0]) - 1 + * if pos < 0: + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":1879 + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(vals[0]) - 1 # <<<<<<<<<<<<<< + * if pos < 0: + * raise ValueError('First time before start of DST info') + */ + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_21 = 0; + __pyx_t_10 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_vals.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyNumber_Subtract(__pyx_t_17, __pyx_int_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_pos = __pyx_t_1; + + /* "pandas/tslib.pyx":1880 + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(vals[0]) - 1 + * if pos < 0: # <<<<<<<<<<<<<< + * raise ValueError('First time before start of DST info') + * + */ + __pyx_t_4 = ((__pyx_v_pos < 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1881 + * pos = trans.searchsorted(vals[0]) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_Raise(__pyx_t_16, 0, 0, 0); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1883 + * raise ValueError('First time before start of DST info') + * + * offset = deltas[pos] # <<<<<<<<<<<<<< + * for i in range(n): + * v = vals[i] + */ + __pyx_t_1 = __pyx_v_pos; + __pyx_t_10 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_deltas.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1884 + * + * offset = deltas[pos] + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] + * if v >= [pos + 1]: + */ + __pyx_t_14 = __pyx_v_n; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_14; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "pandas/tslib.pyx":1885 + * offset = deltas[pos] + * for i in range(n): + * v = vals[i] # <<<<<<<<<<<<<< + * if v >= [pos + 1]: + * pos += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_vals.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1886 + * for i in range(n): + * v = vals[i] + * if v >= [pos + 1]: # <<<<<<<<<<<<<< + * pos += 1 + * offset = deltas[pos] + */ + __pyx_t_16 = __Pyx_PyInt_From_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = PyInt_FromSsize_t((__pyx_v_pos + 1)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyList_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = PyObject_RichCompare(__pyx_t_16, __pyx_t_18, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1887 + * v = vals[i] + * if v >= [pos + 1]: + * pos += 1 # <<<<<<<<<<<<<< + * offset = deltas[pos] + * utc_dates[i] = v - offset + */ + __pyx_v_pos = (__pyx_v_pos + 1); + + /* "pandas/tslib.pyx":1888 + * if v >= [pos + 1]: + * pos += 1 + * offset = deltas[pos] # <<<<<<<<<<<<<< + * utc_dates[i] = v - offset + * else: + */ + __pyx_t_24 = __pyx_v_pos; + __pyx_t_10 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_deltas.diminfo[0].strides)); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":1889 + * pos += 1 + * offset = deltas[pos] + * utc_dates[i] = v - offset # <<<<<<<<<<<<<< + * else: + * utc_dates = vals + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_utc_dates.diminfo[0].strides) = (__pyx_v_v - __pyx_v_offset); + } + } + __pyx_L5:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":1891 + * utc_dates[i] = v - offset + * else: + * utc_dates = vals # <<<<<<<<<<<<<< + * + * if _get_zone(tz2) == 'UTC': + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_vals), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer, (PyObject*)__pyx_v_utc_dates, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_utc_dates.diminfo[0].strides = __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_utc_dates.diminfo[0].shape = __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_vals)); + __pyx_v_utc_dates = ((PyArrayObject *)__pyx_v_vals); + } + __pyx_L4:; + + /* "pandas/tslib.pyx":1893 + * utc_dates = vals + * + * if _get_zone(tz2) == 'UTC': # <<<<<<<<<<<<<< + * return utc_dates + * + */ + __pyx_t_17 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_17, __pyx_n_s_UTC, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1894 + * + * if _get_zone(tz2) == 'UTC': + * return utc_dates # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_utc_dates)); + __pyx_r = ((PyObject *)__pyx_v_utc_dates); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1896 + * return utc_dates + * + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * if _is_tzlocal(tz2): + * for i in range(n): + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_empty); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = PyDict_New(); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1897 + * + * result = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz2): # <<<<<<<<<<<<<< + * for i in range(n): + * v = utc_dates[i] + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz2) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1898 + * result = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz2): + * for i in range(n): # <<<<<<<<<<<<<< + * v = utc_dates[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + */ + __pyx_t_14 = __pyx_v_n; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_14; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "pandas/tslib.pyx":1899 + * if _is_tzlocal(tz2): + * for i in range(n): + * v = utc_dates[i] # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_utc_dates.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1900 + * for i in range(n): + * v = utc_dates[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) + */ + pandas_datetime_to_datetimestruct(__pyx_v_v, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1901 + * v = utc_dates[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + + /* "pandas/tslib.pyx":1902 + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * result[i] = v + delta + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":1901 + * v = utc_dates[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + */ + __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_tz2); + PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_v_tz2); + __Pyx_GIVEREF(__pyx_v_tz2); + __pyx_t_5 = 0; + __pyx_t_17 = 0; + __pyx_t_16 = 0; + __pyx_t_18 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1903 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 # <<<<<<<<<<<<<< + * result[i] = v + delta + * return result + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz2, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_t_8, __pyx_int_1000000000); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1904 + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * result[i] = v + delta # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_v_delta); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_19 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_27 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_19; + + /* "pandas/tslib.pyx":1905 + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * result[i] = v + delta + * return result # <<<<<<<<<<<<<< + * + * # Convert UTC to other timezone + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + } + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/tslib.pyx":1908 + * + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_dates[0]) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_trans, ((PyArrayObject *)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1909 + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) + * deltas = _get_deltas(tz2) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(utc_dates[0]) + * if pos == 0: + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_deltas, ((PyArrayObject *)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1910 + * trans = _get_transitions(tz2) + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_dates[0]) # <<<<<<<<<<<<<< + * if pos == 0: + * raise ValueError('First time before start of DST info') + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_28 = 0; + __pyx_t_10 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_utc_dates.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_pos = __pyx_t_14; + + /* "pandas/tslib.pyx":1911 + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_dates[0]) + * if pos == 0: # <<<<<<<<<<<<<< + * raise ValueError('First time before start of DST info') + * elif pos == len(trans): + */ + __pyx_t_4 = ((__pyx_v_pos == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1912 + * pos = trans.searchsorted(utc_dates[0]) + * if pos == 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * elif pos == len(trans): + * return utc_dates + deltas[-1] + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1913 + * if pos == 0: + * raise ValueError('First time before start of DST info') + * elif pos == len(trans): # <<<<<<<<<<<<<< + * return utc_dates + deltas[-1] + * + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_trans)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_v_pos == __pyx_t_14) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1914 + * raise ValueError('First time before start of DST info') + * elif pos == len(trans): + * return utc_dates + deltas[-1] # <<<<<<<<<<<<<< + * + * # TODO: this assumed sortedness :/ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_29 = -1; + __pyx_t_10 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_deltas.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_v_utc_dates), __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1917 + * + * # TODO: this assumed sortedness :/ + * pos -= 1 # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_v_pos = (__pyx_v_pos - 1); + + /* "pandas/tslib.pyx":1919 + * pos -= 1 + * + * offset = deltas[pos] # <<<<<<<<<<<<<< + * cdef Py_ssize_t trans_len = len(trans) + * + */ + __pyx_t_14 = __pyx_v_pos; + __pyx_t_10 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_deltas.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1920 + * + * offset = deltas[pos] + * cdef Py_ssize_t trans_len = len(trans) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_22 = PyObject_Length(((PyObject *)__pyx_v_trans)); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_trans_len = __pyx_t_22; + + /* "pandas/tslib.pyx":1922 + * cdef Py_ssize_t trans_len = len(trans) + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = utc_dates[i] + * if vals[i] == NPY_NAT: + */ + __pyx_t_22 = __pyx_v_n; + for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_22; __pyx_t_30+=1) { + __pyx_v_i = __pyx_t_30; + + /* "pandas/tslib.pyx":1923 + * + * for i in range(n): + * v = utc_dates[i] # <<<<<<<<<<<<<< + * if vals[i] == NPY_NAT: + * result[i] = vals[i] + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_utc_dates.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1924 + * for i in range(n): + * v = utc_dates[i] + * if vals[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = vals[i] + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_vals.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1925 + * v = utc_dates[i] + * if vals[i] == NPY_NAT: + * result[i] = vals[i] # <<<<<<<<<<<<<< + * else: + * if (pos + 1) < trans_len and v >= trans[pos + 1]: + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_34 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_vals.diminfo[0].strides)); + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/tslib.pyx":1927 + * result[i] = vals[i] + * else: + * if (pos + 1) < trans_len and v >= trans[pos + 1]: # <<<<<<<<<<<<<< + * pos += 1 + * offset = deltas[pos] + */ + __pyx_t_4 = (((__pyx_v_pos + 1) < __pyx_v_trans_len) != 0); + if (__pyx_t_4) { + __pyx_t_35 = (__pyx_v_pos + 1); + __pyx_t_10 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_trans.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_trans.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = ((__pyx_v_v >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_trans.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_trans.diminfo[0].strides))) != 0); + __pyx_t_36 = __pyx_t_3; + } else { + __pyx_t_36 = __pyx_t_4; + } + if (__pyx_t_36) { + + /* "pandas/tslib.pyx":1928 + * else: + * if (pos + 1) < trans_len and v >= trans[pos + 1]: + * pos += 1 # <<<<<<<<<<<<<< + * offset = deltas[pos] + * result[i] = v + offset + */ + __pyx_v_pos = (__pyx_v_pos + 1); + + /* "pandas/tslib.pyx":1929 + * if (pos + 1) < trans_len and v >= trans[pos + 1]: + * pos += 1 + * offset = deltas[pos] # <<<<<<<<<<<<<< + * result[i] = v + offset + * + */ + __pyx_t_37 = __pyx_v_pos; + __pyx_t_10 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_deltas.diminfo[0].strides)); + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/tslib.pyx":1930 + * pos += 1 + * offset = deltas[pos] + * result[i] = v + offset # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_result.diminfo[0].strides) = (__pyx_v_v + __pyx_v_offset); + } + __pyx_L19:; + } + + /* "pandas/tslib.pyx":1932 + * result[i] = v + offset + * + * return result # <<<<<<<<<<<<<< + * + * def tz_convert_single(int64_t val, object tz1, object tz2): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":1853 + * have_pytz = False + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vals.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vals.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_utc_dates); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pytz); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1934 + * return result + * + * def tz_convert_single(int64_t val, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] trans, deltas + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_47tz_convert_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_47tz_convert_single = {__Pyx_NAMESTR("tz_convert_single"), (PyCFunction)__pyx_pw_6pandas_5tslib_47tz_convert_single, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_47tz_convert_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_val; + PyObject *__pyx_v_tz1 = 0; + PyObject *__pyx_v_tz2 = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_convert_single (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,&__pyx_n_s_tz1,&__pyx_n_s_tz2,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_convert_single") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_val = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_val == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_tz1 = values[1]; + __pyx_v_tz2 = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.tz_convert_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_46tz_convert_single(__pyx_self, __pyx_v_val, __pyx_v_tz1, __pyx_v_tz2); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_46tz_convert_single(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_val, PyObject *__pyx_v_tz1, PyObject *__pyx_v_tz2) { + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + Py_ssize_t __pyx_v_pos; + __pyx_t_5numpy_int64_t __pyx_v_offset; + __pyx_t_5numpy_int64_t __pyx_v_utc_date; + pandas_datetimestruct __pyx_v_dts; + CYTHON_UNUSED PyObject *__pyx_v_pytz = NULL; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_11; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_convert_single", 0); + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + + /* "pandas/tslib.pyx":1941 + * pandas_datetimestruct dts + * + * if not have_pytz: # <<<<<<<<<<<<<< + * import pytz + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_have_pytz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1942 + * + * if not have_pytz: + * import pytz # <<<<<<<<<<<<<< + * + * if val == NPY_NAT: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_pytz = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1944 + * import pytz + * + * if val == NPY_NAT: # <<<<<<<<<<<<<< + * return val + * + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1945 + * + * if val == NPY_NAT: + * return val # <<<<<<<<<<<<<< + * + * # Convert to UTC + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1948 + * + * # Convert to UTC + * if _is_tzlocal(tz1): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_3 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz1) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1949 + * # Convert to UTC + * if _is_tzlocal(tz1): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1950 + * if _is_tzlocal(tz1): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz1) + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/tslib.pyx":1951 + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + * utc_date = val - delta + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1950 + * if _is_tzlocal(tz1): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz1) + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + */ + __pyx_t_10 = PyTuple_New(8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_tz1); + PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_v_tz1); + __Pyx_GIVEREF(__pyx_v_tz1); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_dt = ((PyDateTime_DateTime *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1952 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 # <<<<<<<<<<<<<< + * utc_date = val - delta + * elif _get_zone(tz1) != 'UTC': + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz1, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Multiply(__pyx_t_10, __pyx_int_1000000000); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_delta = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1953 + * dts.min, dts.sec, dts.us, tz1) + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + * utc_date = val - delta # <<<<<<<<<<<<<< + * elif _get_zone(tz1) != 'UTC': + * deltas = _get_deltas(tz1) + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyNumber_Subtract(__pyx_t_9, __pyx_v_delta); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_10); if (unlikely((__pyx_t_11 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_utc_date = __pyx_t_11; + goto __pyx_L5; + } + + /* "pandas/tslib.pyx":1954 + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + * utc_date = val - delta + * elif _get_zone(tz1) != 'UTC': # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) + */ + __pyx_t_10 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_UTC, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1955 + * utc_date = val - delta + * elif _get_zone(tz1) != 'UTC': + * deltas = _get_deltas(tz1) # <<<<<<<<<<<<<< + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(val) - 1 + */ + __pyx_t_10 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":1956 + * elif _get_zone(tz1) != 'UTC': + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(val) - 1 + * if pos < 0: + */ + __pyx_t_10 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_15, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_15, __pyx_t_14); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":1957 + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(val) - 1 # <<<<<<<<<<<<<< + * if pos < 0: + * raise ValueError('First time before start of DST info') + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Subtract(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_pos = __pyx_t_17; + + /* "pandas/tslib.pyx":1958 + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(val) - 1 + * if pos < 0: # <<<<<<<<<<<<<< + * raise ValueError('First time before start of DST info') + * offset = deltas[pos] + */ + __pyx_t_3 = ((__pyx_v_pos < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1959 + * pos = trans.searchsorted(val) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * offset = deltas[pos] + * utc_date = val - offset + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1960 + * if pos < 0: + * raise ValueError('First time before start of DST info') + * offset = deltas[pos] # <<<<<<<<<<<<<< + * utc_date = val - offset + * else: + */ + __pyx_t_17 = __pyx_v_pos; + __pyx_t_13 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_deltas.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1961 + * raise ValueError('First time before start of DST info') + * offset = deltas[pos] + * utc_date = val - offset # <<<<<<<<<<<<<< + * else: + * utc_date = val + */ + __pyx_v_utc_date = (__pyx_v_val - __pyx_v_offset); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1963 + * utc_date = val - offset + * else: + * utc_date = val # <<<<<<<<<<<<<< + * + * if _get_zone(tz2) == 'UTC': + */ + __pyx_v_utc_date = __pyx_v_val; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":1965 + * utc_date = val + * + * if _get_zone(tz2) == 'UTC': # <<<<<<<<<<<<<< + * return utc_date + * if _is_tzlocal(tz2): + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_UTC, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1966 + * + * if _get_zone(tz2) == 'UTC': + * return utc_date # <<<<<<<<<<<<<< + * if _is_tzlocal(tz2): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_utc_date); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1967 + * if _get_zone(tz2) == 'UTC': + * return utc_date + * if _is_tzlocal(tz2): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_3 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz2) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1968 + * return utc_date + * if _is_tzlocal(tz2): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1969 + * if _is_tzlocal(tz2): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1970 + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * return utc_date + delta + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":1969 + * if _is_tzlocal(tz2): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + */ + __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_tz2); + PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_tz2); + __Pyx_GIVEREF(__pyx_v_tz2); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1971 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 # <<<<<<<<<<<<<< + * return utc_date + delta + * # Convert UTC to other timezone + */ + __pyx_t_4 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz2, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_int_1000000000); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1972 + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * return utc_date + delta # <<<<<<<<<<<<<< + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_utc_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1974 + * return utc_date + delta + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_date) - 1 + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_trans, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1975 + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) + * deltas = _get_deltas(tz2) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(utc_date) - 1 + * if pos < 0: + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_15, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_15, __pyx_t_14); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_deltas, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1976 + * trans = _get_transitions(tz2) + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_date) - 1 # <<<<<<<<<<<<<< + * if pos < 0: + * raise ValueError('First time before start of DST info') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_utc_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_pos = __pyx_t_18; + + /* "pandas/tslib.pyx":1977 + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_date) - 1 + * if pos < 0: # <<<<<<<<<<<<<< + * raise ValueError('First time before start of DST info') + * + */ + __pyx_t_3 = ((__pyx_v_pos < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1978 + * pos = trans.searchsorted(utc_date) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1980 + * raise ValueError('First time before start of DST info') + * + * offset = deltas[pos] # <<<<<<<<<<<<<< + * return utc_date + offset + * + */ + __pyx_t_18 = __pyx_v_pos; + __pyx_t_13 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_deltas.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1981 + * + * offset = deltas[pos] + * return utc_date + offset # <<<<<<<<<<<<<< + * + * # Timezone data caches, key is the pytz string or dateutil file name. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((__pyx_v_utc_date + __pyx_v_offset)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1934 + * return result + * + * def tz_convert_single(int64_t val, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] trans, deltas + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.tz_convert_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pytz); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1987 + * utc_offset_cache = {} + * + * cdef inline bint _treat_tz_as_pytz(object tz): # <<<<<<<<<<<<<< + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__treat_tz_as_pytz(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_treat_tz_as_pytz", 0); + + /* "pandas/tslib.pyx":1988 + * + * cdef inline bint _treat_tz_as_pytz(object tz): + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') # <<<<<<<<<<<<<< + * + * cdef inline bint _treat_tz_as_dateutil(object tz): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_utc_transition_times); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __pyx_t_2 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1987 + * utc_offset_cache = {} + * + * cdef inline bint _treat_tz_as_pytz(object tz): # <<<<<<<<<<<<<< + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.tslib._treat_tz_as_pytz", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1990 + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') + * + * cdef inline bint _treat_tz_as_dateutil(object tz): # <<<<<<<<<<<<<< + * return hasattr(tz, '_trans_list') and hasattr(tz, '_trans_idx') + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__treat_tz_as_dateutil(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_treat_tz_as_dateutil", 0); + + /* "pandas/tslib.pyx":1991 + * + * cdef inline bint _treat_tz_as_dateutil(object tz): + * return hasattr(tz, '_trans_list') and hasattr(tz, '_trans_idx') # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __pyx_t_2 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_trans_idx); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1990 + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') + * + * cdef inline bint _treat_tz_as_dateutil(object tz): # <<<<<<<<<<<<<< + * return hasattr(tz, '_trans_list') and hasattr(tz, '_trans_idx') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.tslib._treat_tz_as_dateutil", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1994 + * + * + * def _p_tz_cache_key(tz): # <<<<<<<<<<<<<< + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_49_p_tz_cache_key(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/ +static char __pyx_doc_6pandas_5tslib_48_p_tz_cache_key[] = " Python interface for cache function to facilitate testing."; +static PyMethodDef __pyx_mdef_6pandas_5tslib_49_p_tz_cache_key = {__Pyx_NAMESTR("_p_tz_cache_key"), (PyCFunction)__pyx_pw_6pandas_5tslib_49_p_tz_cache_key, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_48_p_tz_cache_key)}; +static PyObject *__pyx_pw_6pandas_5tslib_49_p_tz_cache_key(PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_p_tz_cache_key (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_48_p_tz_cache_key(__pyx_self, ((PyObject *)__pyx_v_tz)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_48_p_tz_cache_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_p_tz_cache_key", 0); + + /* "pandas/tslib.pyx":1996 + * def _p_tz_cache_key(tz): + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib__tz_cache_key(__pyx_v_tz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1994 + * + * + * def _p_tz_cache_key(tz): # <<<<<<<<<<<<<< + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._p_tz_cache_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1999 + * + * + * cdef inline object _tz_cache_key(object tz): # <<<<<<<<<<<<<< + * """ + * Return the key in the cache for the timezone info object or None if unknown. + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__tz_cache_key(PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_tz_cache_key", 0); + + /* "pandas/tslib.pyx":2012 + * Also, pytz objects are not always hashable so we use str(tz) instead. + * """ + * if isinstance(tz, _pytz_BaseTzInfo): # <<<<<<<<<<<<<< + * return tz.zone + * elif isinstance(tz, _dateutil_tzfile): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz_BaseTzInfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2013 + * """ + * if isinstance(tz, _pytz_BaseTzInfo): + * return tz.zone # <<<<<<<<<<<<<< + * elif isinstance(tz, _dateutil_tzfile): + * if '.tar.gz' in tz._filename: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2014 + * if isinstance(tz, _pytz_BaseTzInfo): + * return tz.zone + * elif isinstance(tz, _dateutil_tzfile): # <<<<<<<<<<<<<< + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_tzfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2015 + * return tz.zone + * elif isinstance(tz, _dateutil_tzfile): + * if '.tar.gz' in tz._filename: # <<<<<<<<<<<<<< + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_kp_s_tar_gz, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2016 + * elif isinstance(tz, _dateutil_tzfile): + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' # <<<<<<<<<<<<<< + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2019 + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + * return 'dateutil' + tz._filename # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Add(__pyx_n_s_dateutil_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2021 + * return 'dateutil' + tz._filename + * else: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1999 + * + * + * cdef inline object _tz_cache_key(object tz): # <<<<<<<<<<<<<< + * """ + * Return the key in the cache for the timezone info object or None if unknown. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib._tz_cache_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2024 + * + * + * cdef object _get_transitions(object tz): # <<<<<<<<<<<<<< + * """ + * Get UTC times of DST transitions + */ + +static PyObject *__pyx_f_6pandas_5tslib__get_transitions(PyObject *__pyx_v_tz) { + PyObject *__pyx_v_cache_key = NULL; + PyObject *__pyx_v_arr = NULL; + PyObject *__pyx_v_trans_list = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_transitions", 0); + + /* "pandas/tslib.pyx":2028 + * Get UTC times of DST transitions + * """ + * cache_key = _tz_cache_key(tz) # <<<<<<<<<<<<<< + * if cache_key is None: + * return np.array([NPY_NAT + 1], dtype=np.int64) + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__tz_cache_key(__pyx_v_tz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cache_key = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2029 + * """ + * cache_key = _tz_cache_key(tz) + * if cache_key is None: # <<<<<<<<<<<<<< + * return np.array([NPY_NAT + 1], dtype=np.int64) + * + */ + __pyx_t_2 = (__pyx_v_cache_key == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2030 + * cache_key = _tz_cache_key(tz) + * if cache_key is None: + * return np.array([NPY_NAT + 1], dtype=np.int64) # <<<<<<<<<<<<<< + * + * if cache_key not in trans_cache: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2032 + * return np.array([NPY_NAT + 1], dtype=np.int64) + * + * if cache_key not in trans_cache: # <<<<<<<<<<<<<< + * if _treat_tz_as_pytz(tz): + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_trans_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_cache_key, __pyx_t_7, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2033 + * + * if cache_key not in trans_cache: + * if _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + * arr = arr.view('i8') + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2034 + * if cache_key not in trans_cache: + * if _treat_tz_as_pytz(tz): + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') # <<<<<<<<<<<<<< + * arr = arr.view('i8') + * try: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utc_transition_times); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_arr = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":2035 + * if _treat_tz_as_pytz(tz): + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + * arr = arr.view('i8') # <<<<<<<<<<<<<< + * try: + * if tz._utc_transition_times[0].year == 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":2036 + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + * arr = arr.view('i8') + * try: # <<<<<<<<<<<<<< + * if tz._utc_transition_times[0].year == 1: + * arr[0] = NPY_NAT + 1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/tslib.pyx":2037 + * arr = arr.view('i8') + * try: + * if tz._utc_transition_times[0].year == 1: # <<<<<<<<<<<<<< + * arr[0] = NPY_NAT + 1 + * except Exception: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utc_transition_times); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_year); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2038 + * try: + * if tz._utc_transition_times[0].year == 1: + * arr[0] = NPY_NAT + 1 # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_SetItemInt(__pyx_v_arr, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L14; + } + __pyx_L14:; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":2039 + * if tz._utc_transition_times[0].year == 1: + * arr[0] = NPY_NAT + 1 + * except Exception: # <<<<<<<<<<<<<< + * pass + * elif _treat_tz_as_dateutil(tz): + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_11) { + PyErr_Restore(0,0,0); + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L13_try_end:; + } + goto __pyx_L5; + } + + /* "pandas/tslib.pyx":2041 + * except Exception: + * pass + * elif _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * if len(tz._trans_list): + * # get utc trans times + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2042 + * pass + * elif _treat_tz_as_dateutil(tz): + * if len(tz._trans_list): # <<<<<<<<<<<<<< + * # get utc trans times + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__pyx_t_12 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2044 + * if len(tz._trans_list): + * # get utc trans times + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) # <<<<<<<<<<<<<< + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + */ + __pyx_t_4 = __pyx_f_6pandas_5tslib__get_utc_trans_times_from_dateutil_tz(__pyx_v_tz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_trans_list = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":2045 + * # get utc trans times + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item # <<<<<<<<<<<<<< + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + * arr = arr.view('i8') + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_hstack); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_kp_s_M8_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":2046 + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed # <<<<<<<<<<<<<< + * arr = arr.view('i8') + * # scale transitions correctly in numpy 1.6 + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_trans_list); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_trans_list); + __Pyx_GIVEREF(__pyx_v_trans_list); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_kp_s_M8_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2045 + * # get utc trans times + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item # <<<<<<<<<<<<<< + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + * arr = arr.view('i8') + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_6 = 0; + __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/tslib.pyx":2046 + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed # <<<<<<<<<<<<<< + * arr = arr.view('i8') + * # scale transitions correctly in numpy 1.6 + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2047 + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + * arr = arr.view('i8') # <<<<<<<<<<<<<< + * # scale transitions correctly in numpy 1.6 + * if _np_version_under1p7: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/tslib.pyx":2049 + * arr = arr.view('i8') + * # scale transitions correctly in numpy 1.6 + * if _np_version_under1p7: # <<<<<<<<<<<<<< + * arr *= 1000000000 + * arr[0] = NPY_NAT + 1 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2050 + * # scale transitions correctly in numpy 1.6 + * if _np_version_under1p7: + * arr *= 1000000000 # <<<<<<<<<<<<<< + * arr[0] = NPY_NAT + 1 + * elif _is_fixed_offset(tz): + */ + __pyx_t_13 = PyNumber_InPlaceMultiply(__pyx_v_arr, __pyx_int_1000000000); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/tslib.pyx":2051 + * if _np_version_under1p7: + * arr *= 1000000000 + * arr[0] = NPY_NAT + 1 # <<<<<<<<<<<<<< + * elif _is_fixed_offset(tz): + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + */ + __pyx_t_13 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (unlikely(__Pyx_SetItemInt(__pyx_v_arr, 0, __pyx_t_13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L15; + } + + /* "pandas/tslib.pyx":2052 + * arr *= 1000000000 + * arr[0] = NPY_NAT + 1 + * elif _is_fixed_offset(tz): # <<<<<<<<<<<<<< + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + * else: + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__is_fixed_offset(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2053 + * arr[0] = NPY_NAT + 1 + * elif _is_fixed_offset(tz): + * arr = np.array([NPY_NAT + 1], dtype=np.int64) # <<<<<<<<<<<<<< + * else: + * arr = np.array([], dtype='M8[ns]') + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_arr = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/tslib.pyx":2055 + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + * else: + * arr = np.array([], dtype='M8[ns]') # <<<<<<<<<<<<<< + * else: + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_arr = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L15:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":2057 + * arr = np.array([], dtype='M8[ns]') + * else: + * arr = np.array([NPY_NAT + 1], dtype=np.int64) # <<<<<<<<<<<<<< + * trans_cache[cache_key] = arr + * return trans_cache[cache_key] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_arr = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":2058 + * else: + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + * trans_cache[cache_key] = arr # <<<<<<<<<<<<<< + * return trans_cache[cache_key] + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_trans_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_cache_key, __pyx_v_arr) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":2059 + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + * trans_cache[cache_key] = arr + * return trans_cache[cache_key] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_trans_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyObject_GetItem(__pyx_t_6, __pyx_v_cache_key); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2024 + * + * + * cdef object _get_transitions(object tz): # <<<<<<<<<<<<<< + * """ + * Get UTC times of DST transitions + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.tslib._get_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cache_key); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XDECREF(__pyx_v_trans_list); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2062 + * + * + * cdef object _get_utc_trans_times_from_dateutil_tz(object tz): # <<<<<<<<<<<<<< + * ''' + * Transition times in dateutil timezones are stored in local non-dst time. This code + */ + +static PyObject *__pyx_f_6pandas_5tslib__get_utc_trans_times_from_dateutil_tz(PyObject *__pyx_v_tz) { + PyObject *__pyx_v_new_trans = NULL; + PyObject *__pyx_v_last_std_offset = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_trans = NULL; + PyObject *__pyx_v_tti = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_utc_trans_times_from_dateutil_tz", 0); + + /* "pandas/tslib.pyx":2067 + * converts them to UTC. It's the reverse of the code in dateutil.tz.tzfile.__init__. + * ''' + * new_trans = list(tz._trans_list) # <<<<<<<<<<<<<< + * last_std_offset = 0 + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_new_trans = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2068 + * ''' + * new_trans = list(tz._trans_list) + * last_std_offset = 0 # <<<<<<<<<<<<<< + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): + * if not tti.isdst: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_last_std_offset = __pyx_int_0; + + /* "pandas/tslib.pyx":2069 + * new_trans = list(tz._trans_list) + * last_std_offset = 0 + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): # <<<<<<<<<<<<<< + * if not tti.isdst: + * last_std_offset = tti.offset + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_idx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_trans, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_tti, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":2070 + * last_std_offset = 0 + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): + * if not tti.isdst: # <<<<<<<<<<<<<< + * last_std_offset = tti.offset + * new_trans[i] = trans - last_std_offset + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tti, __pyx_n_s_isdst); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = ((!__pyx_t_10) != 0); + if (__pyx_t_11) { + + /* "pandas/tslib.pyx":2071 + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): + * if not tti.isdst: + * last_std_offset = tti.offset # <<<<<<<<<<<<<< + * new_trans[i] = trans - last_std_offset + * return new_trans + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tti, __pyx_n_s_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_last_std_offset, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/tslib.pyx":2072 + * if not tti.isdst: + * last_std_offset = tti.offset + * new_trans[i] = trans - last_std_offset # <<<<<<<<<<<<<< + * return new_trans + * + */ + __pyx_t_3 = PyNumber_Subtract(__pyx_v_trans, __pyx_v_last_std_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyObject_SetItem(__pyx_v_new_trans, __pyx_v_i, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2073 + * last_std_offset = tti.offset + * new_trans[i] = trans - last_std_offset + * return new_trans # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_new_trans); + __pyx_r = __pyx_v_new_trans; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2062 + * + * + * cdef object _get_utc_trans_times_from_dateutil_tz(object tz): # <<<<<<<<<<<<<< + * ''' + * Transition times in dateutil timezones are stored in local non-dst time. This code + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.tslib._get_utc_trans_times_from_dateutil_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_new_trans); + __Pyx_XDECREF(__pyx_v_last_std_offset); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_trans); + __Pyx_XDECREF(__pyx_v_tti); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2076 + * + * + * cdef object _get_deltas(object tz): # <<<<<<<<<<<<<< + * """ + * Get UTC offsets in microseconds corresponding to DST transitions + */ + +static PyObject *__pyx_f_6pandas_5tslib__get_deltas(PyObject *__pyx_v_tz) { + PyObject *__pyx_v_cache_key = NULL; + PyObject *__pyx_v_num = NULL; + PyObject *__pyx_v_arr = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_deltas", 0); + + /* "pandas/tslib.pyx":2080 + * Get UTC offsets in microseconds corresponding to DST transitions + * """ + * cache_key = _tz_cache_key(tz) # <<<<<<<<<<<<<< + * if cache_key is None: + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__tz_cache_key(__pyx_v_tz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cache_key = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2081 + * """ + * cache_key = _tz_cache_key(tz) + * if cache_key is None: # <<<<<<<<<<<<<< + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 + * return np.array([num], dtype=np.int64) + */ + __pyx_t_2 = (__pyx_v_cache_key == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2082 + * cache_key = _tz_cache_key(tz) + * if cache_key is None: + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 # <<<<<<<<<<<<<< + * return np.array([num], dtype=np.int64) + * + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, Py_None, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_num = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2083 + * if cache_key is None: + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 + * return np.array([num], dtype=np.int64) # <<<<<<<<<<<<<< + * + * if cache_key not in utc_offset_cache: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_num); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_num); + __Pyx_GIVEREF(__pyx_v_num); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2085 + * return np.array([num], dtype=np.int64) + * + * if cache_key not in utc_offset_cache: # <<<<<<<<<<<<<< + * if _treat_tz_as_pytz(tz): + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_cache_key, __pyx_t_7, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2086 + * + * if cache_key not in utc_offset_cache: + * if _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) + * elif _treat_tz_as_dateutil(tz): + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2087 + * if cache_key not in utc_offset_cache: + * if _treat_tz_as_pytz(tz): + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) # <<<<<<<<<<<<<< + * elif _treat_tz_as_dateutil(tz): + * if len(tz._trans_list): + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_5tslib__unbox_utcoffsets(__pyx_t_7, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_cache_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5; + } + + /* "pandas/tslib.pyx":2088 + * if _treat_tz_as_pytz(tz): + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) + * elif _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * if len(tz._trans_list): + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2089 + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) + * elif _treat_tz_as_dateutil(tz): + * if len(tz._trans_list): # <<<<<<<<<<<<<< + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) + * arr *= 1000000000 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_8 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2090 + * elif _treat_tz_as_dateutil(tz): + * if len(tz._trans_list): + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) # <<<<<<<<<<<<<< + * arr *= 1000000000 + * utc_offset_cache[cache_key] = arr + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_ttinfo_before); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_9(__pyx_t_5); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2091 + * if len(tz._trans_list): + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) + * arr *= 1000000000 # <<<<<<<<<<<<<< + * utc_offset_cache[cache_key] = arr + * elif _is_fixed_offset(tz): + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_arr, __pyx_int_1000000000); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2092 + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) + * arr *= 1000000000 + * utc_offset_cache[cache_key] = arr # <<<<<<<<<<<<<< + * elif _is_fixed_offset(tz): + * utc_offset_cache[cache_key] = np.array([tz._ttinfo_std.offset], dtype='i8') * 1000000000 + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_cache_key, __pyx_v_arr) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + + /* "pandas/tslib.pyx":2093 + * arr *= 1000000000 + * utc_offset_cache[cache_key] = arr + * elif _is_fixed_offset(tz): # <<<<<<<<<<<<<< + * utc_offset_cache[cache_key] = np.array([tz._ttinfo_std.offset], dtype='i8') * 1000000000 + * else: + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__is_fixed_offset(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2094 + * utc_offset_cache[cache_key] = arr + * elif _is_fixed_offset(tz): + * utc_offset_cache[cache_key] = np.array([tz._ttinfo_std.offset], dtype='i8') * 1000000000 # <<<<<<<<<<<<<< + * else: + * utc_offset_cache[cache_key] = np.array([], dtype='i8') + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_ttinfo_std); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_offset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_int_1000000000); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_cache_key, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/tslib.pyx":2096 + * utc_offset_cache[cache_key] = np.array([tz._ttinfo_std.offset], dtype='i8') * 1000000000 + * else: + * utc_offset_cache[cache_key] = np.array([], dtype='i8') # <<<<<<<<<<<<<< + * else: + * # static tzinfo + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_cache_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":2099 + * else: + * # static tzinfo + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 # <<<<<<<<<<<<<< + * utc_offset_cache[cache_key] = np.array([num], dtype=np.int64) + * + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, Py_None, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_t_6, __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_num = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2100 + * # static tzinfo + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 + * utc_offset_cache[cache_key] = np.array([num], dtype=np.int64) # <<<<<<<<<<<<<< + * + * return utc_offset_cache[cache_key] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_num); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_num); + __Pyx_GIVEREF(__pyx_v_num); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_cache_key, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L5:; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":2102 + * utc_offset_cache[cache_key] = np.array([num], dtype=np.int64) + * + * return utc_offset_cache[cache_key] # <<<<<<<<<<<<<< + * + * cdef double total_seconds(object td): # Python 2.6 compat + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_GetItem(__pyx_t_4, __pyx_v_cache_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2076 + * + * + * cdef object _get_deltas(object tz): # <<<<<<<<<<<<<< + * """ + * Get UTC offsets in microseconds corresponding to DST transitions + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.tslib._get_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cache_key); + __Pyx_XDECREF(__pyx_v_num); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2104 + * return utc_offset_cache[cache_key] + * + * cdef double total_seconds(object td): # Python 2.6 compat # <<<<<<<<<<<<<< + * return ((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) // + * 10**6) + */ + +static double __pyx_f_6pandas_5tslib_total_seconds(PyObject *__pyx_v_td) { + double __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + double __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("total_seconds", 0); + + /* "pandas/tslib.pyx":2105 + * + * cdef double total_seconds(object td): # Python 2.6 compat + * return ((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) // # <<<<<<<<<<<<<< + * 10**6) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_seconds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_days); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_int_24); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_3600); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_4, __pyx_int_1000000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2104 + * return utc_offset_cache[cache_key] + * + * cdef double total_seconds(object td): # Python 2.6 compat # <<<<<<<<<<<<<< + * return ((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) // + * 10**6) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.tslib.total_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2108 + * 10**6) + * + * def tot_seconds(td): # <<<<<<<<<<<<<< + * return total_seconds(td) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_51tot_seconds(PyObject *__pyx_self, PyObject *__pyx_v_td); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_51tot_seconds = {__Pyx_NAMESTR("tot_seconds"), (PyCFunction)__pyx_pw_6pandas_5tslib_51tot_seconds, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_51tot_seconds(PyObject *__pyx_self, PyObject *__pyx_v_td) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tot_seconds (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_50tot_seconds(__pyx_self, ((PyObject *)__pyx_v_td)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_50tot_seconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_td) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tot_seconds", 0); + + /* "pandas/tslib.pyx":2109 + * + * def tot_seconds(td): + * return total_seconds(td) # <<<<<<<<<<<<<< + * + * cpdef ndarray _unbox_utcoffsets(object transinfo): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_v_td)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2108 + * 10**6) + * + * def tot_seconds(td): # <<<<<<<<<<<<<< + * return total_seconds(td) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.tot_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2111 + * return total_seconds(td) + * + * cpdef ndarray _unbox_utcoffsets(object transinfo): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static PyObject *__pyx_pw_6pandas_5tslib_53_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_5tslib__unbox_utcoffsets(PyObject *__pyx_v_transinfo, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyArrayObject *__pyx_v_arr = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + __pyx_t_5numpy_int64_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unbox_utcoffsets", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + + /* "pandas/tslib.pyx":2116 + * ndarray[int64_t] arr + * + * sz = len(transinfo) # <<<<<<<<<<<<<< + * arr = np.empty(sz, dtype='i8') + * + */ + __pyx_t_1 = PyObject_Length(__pyx_v_transinfo); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_sz = __pyx_t_1; + + /* "pandas/tslib.pyx":2117 + * + * sz = len(transinfo) + * arr = np.empty(sz, dtype='i8') # <<<<<<<<<<<<<< + * + * for i in range(sz): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_sz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_arr = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2119 + * arr = np.empty(sz, dtype='i8') + * + * for i in range(sz): # <<<<<<<<<<<<<< + * arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000 + * + */ + __pyx_t_1 = __pyx_v_sz; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2120 + * + * for i in range(sz): + * arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000 # <<<<<<<<<<<<<< + * + * return arr + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_transinfo, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_1000000000); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_t_12; + } + + /* "pandas/tslib.pyx":2122 + * arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000 + * + * return arr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyArrayObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2111 + * return total_seconds(td) + * + * cpdef ndarray _unbox_utcoffsets(object transinfo): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib._unbox_utcoffsets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_53_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_53_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_unbox_utcoffsets (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_52_unbox_utcoffsets(__pyx_self, ((PyObject *)__pyx_v_transinfo)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_52_unbox_utcoffsets(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_transinfo) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unbox_utcoffsets", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_5tslib__unbox_utcoffsets(__pyx_v_transinfo, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._unbox_utcoffsets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2127 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Localize tzinfo-naive DateRange to given time zone (using pytz). If + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_55tz_localize_to_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_54tz_localize_to_utc[] = "\n Localize tzinfo-naive DateRange to given time zone (using pytz). If\n there are ambiguities in the values, raise AmbiguousTimeError.\n\n Returns\n -------\n localized : DatetimeIndex\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_55tz_localize_to_utc = {__Pyx_NAMESTR("tz_localize_to_utc"), (PyCFunction)__pyx_pw_6pandas_5tslib_55tz_localize_to_utc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_54tz_localize_to_utc)}; +static PyObject *__pyx_pw_6pandas_5tslib_55tz_localize_to_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vals = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_v_infer_dst; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_localize_to_utc (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vals,&__pyx_n_s_tz,&__pyx_n_s_infer_dst,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_localize_to_utc", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infer_dst); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_localize_to_utc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_vals = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + if (values[2]) { + __pyx_v_infer_dst = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_infer_dst == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_infer_dst = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_localize_to_utc", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.tz_localize_to_utc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_54tz_localize_to_utc(__pyx_self, __pyx_v_vals, __pyx_v_tz, __pyx_v_infer_dst); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_54tz_localize_to_utc(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vals, PyObject *__pyx_v_tz, int __pyx_v_infer_dst) { + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + PyArrayObject *__pyx_v_idx_shifted = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_pos; + Py_ssize_t __pyx_v_ntrans; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t *__pyx_v_tdata; + __pyx_t_5numpy_int64_t __pyx_v_v; + __pyx_t_5numpy_int64_t __pyx_v_left; + __pyx_t_5numpy_int64_t __pyx_v_right; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_result_a = 0; + PyArrayObject *__pyx_v_result_b = 0; + PyArrayObject *__pyx_v_dst_hours = 0; + pandas_datetimestruct __pyx_v_dts; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v_both_nat = NULL; + PyObject *__pyx_v_both_eq = NULL; + PyObject *__pyx_v_trans_idx = NULL; + PyObject *__pyx_v_stamp = NULL; + PyObject *__pyx_v_one_diff = NULL; + PyObject *__pyx_v_trans_grp = NULL; + PyObject *__pyx_v_grp = NULL; + PyObject *__pyx_v_switch_idx = NULL; + PyObject *__pyx_v_a_idx = NULL; + PyObject *__pyx_v_b_idx = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dst_hours; + __Pyx_Buffer __pyx_pybuffer_dst_hours; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx_shifted; + __Pyx_Buffer __pyx_pybuffer_idx_shifted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result_a; + __Pyx_Buffer __pyx_pybuffer_result_a; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result_b; + __Pyx_Buffer __pyx_pybuffer_result_b; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vals; + __Pyx_Buffer __pyx_pybuffer_vals; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + PyArrayObject *__pyx_t_22 = NULL; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + PyObject *(*__pyx_t_34)(PyObject *); + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_localize_to_utc", 0); + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_idx_shifted.pybuffer.buf = NULL; + __pyx_pybuffer_idx_shifted.refcount = 0; + __pyx_pybuffernd_idx_shifted.data = NULL; + __pyx_pybuffernd_idx_shifted.rcbuffer = &__pyx_pybuffer_idx_shifted; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_result_a.pybuffer.buf = NULL; + __pyx_pybuffer_result_a.refcount = 0; + __pyx_pybuffernd_result_a.data = NULL; + __pyx_pybuffernd_result_a.rcbuffer = &__pyx_pybuffer_result_a; + __pyx_pybuffer_result_b.pybuffer.buf = NULL; + __pyx_pybuffer_result_b.refcount = 0; + __pyx_pybuffernd_result_b.data = NULL; + __pyx_pybuffernd_result_b.rcbuffer = &__pyx_pybuffer_result_b; + __pyx_pybuffer_dst_hours.pybuffer.buf = NULL; + __pyx_pybuffer_dst_hours.refcount = 0; + __pyx_pybuffernd_dst_hours.data = NULL; + __pyx_pybuffernd_dst_hours.rcbuffer = &__pyx_pybuffer_dst_hours; + __pyx_pybuffer_vals.pybuffer.buf = NULL; + __pyx_pybuffer_vals.refcount = 0; + __pyx_pybuffernd_vals.data = NULL; + __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2138 + * cdef: + * ndarray[int64_t] trans, deltas, idx_shifted + * Py_ssize_t i, idx, pos, ntrans, n = len(vals) # <<<<<<<<<<<<<< + * int64_t *tdata + * int64_t v, left, right + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_vals)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2146 + * # Vectorized version of DstTzInfo.localize + * + * if not have_pytz: # <<<<<<<<<<<<<< + * raise Exception("Could not find pytz module") + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_have_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2147 + * + * if not have_pytz: + * raise Exception("Could not find pytz module") # <<<<<<<<<<<<<< + * + * if tz == UTC or tz is None: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2149 + * raise Exception("Could not find pytz module") + * + * if tz == UTC or tz is None: # <<<<<<<<<<<<<< + * return vals + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_UTC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_tz, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!__pyx_t_4) { + __pyx_t_3 = (__pyx_v_tz == Py_None); + __pyx_t_6 = __pyx_t_3; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2150 + * + * if tz == UTC or tz is None: + * return vals # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_vals)); + __pyx_r = ((PyObject *)__pyx_v_vals); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2152 + * return vals + * + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * if _is_tzlocal(tz): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":2154 + * result = np.empty(n, dtype=np.int64) + * + * if _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * v = vals[i] + */ + __pyx_t_6 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2155 + * + * if _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/tslib.pyx":2156 + * if _is_tzlocal(tz): + * for i in range(n): + * v = vals[i] # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_vals.diminfo[0].strides)); + + /* "pandas/tslib.pyx":2157 + * for i in range(n): + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + pandas_datetime_to_datetimestruct(__pyx_v_v, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2158 + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":2159 + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * result[i] = v - delta + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + + /* "pandas/tslib.pyx":2158 + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_19 = PyTuple_New(8); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_19, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_19, 5, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_19, 6, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_19, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_9 = 0; + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_17 = 0; + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_19, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_18)); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2160 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * result[i] = v - delta + * return result + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_18)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyNumber_Multiply(__pyx_t_19, __pyx_int_1000000000); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2161 + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * result[i] = v - delta # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_18 = __Pyx_PyInt_From_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = PyNumber_Subtract(__pyx_t_18, __pyx_v_delta); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_19); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_21 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_20; + } + + /* "pandas/tslib.pyx":2162 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * result[i] = v - delta + * return result # <<<<<<<<<<<<<< + * + * trans = _get_transitions(tz) # transition dates + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2164 + * return result + * + * trans = _get_transitions(tz) # transition dates # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) # utc offsets + * + */ + __pyx_t_19 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_19); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_19); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2165 + * + * trans = _get_transitions(tz) # transition dates + * deltas = _get_deltas(tz) # utc offsets # <<<<<<<<<<<<<< + * + * tdata = trans.data + */ + __pyx_t_19 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_19); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_19); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2167 + * deltas = _get_deltas(tz) # utc offsets + * + * tdata = trans.data # <<<<<<<<<<<<<< + * ntrans = len(trans) + * + */ + __pyx_v_tdata = ((__pyx_t_5numpy_int64_t *)__pyx_v_trans->data); + + /* "pandas/tslib.pyx":2168 + * + * tdata = trans.data + * ntrans = len(trans) # <<<<<<<<<<<<<< + * + * result_a = np.empty(n, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_trans)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ntrans = __pyx_t_1; + + /* "pandas/tslib.pyx":2170 + * ntrans = len(trans) + * + * result_a = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * result_b = np.empty(n, dtype=np.int64) + * result_a.fill(NPY_NAT) + */ + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_empty); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_17, __pyx_t_19); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_result_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); + } + } + __pyx_pybuffernd_result_a.diminfo[0].strides = __pyx_pybuffernd_result_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result_a.diminfo[0].shape = __pyx_pybuffernd_result_a.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result_a = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2171 + * + * result_a = np.empty(n, dtype=np.int64) + * result_b = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * result_a.fill(NPY_NAT) + * result_b.fill(NPY_NAT) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_17, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer, (PyObject*)__pyx_v_result_b, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_result_b.diminfo[0].strides = __pyx_pybuffernd_result_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result_b.diminfo[0].shape = __pyx_pybuffernd_result_b.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result_b = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2172 + * result_a = np.empty(n, dtype=np.int64) + * result_b = np.empty(n, dtype=np.int64) + * result_a.fill(NPY_NAT) # <<<<<<<<<<<<<< + * result_b.fill(NPY_NAT) + * + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result_a), __pyx_n_s_fill); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2173 + * result_b = np.empty(n, dtype=np.int64) + * result_a.fill(NPY_NAT) + * result_b.fill(NPY_NAT) # <<<<<<<<<<<<<< + * + * # left side + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result_b), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2177 + * # left side + * idx_shifted = _ensure_int64( + * np.maximum(0, trans.searchsorted(vals - DAY_NS, side='right') - 1)) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_maximum); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_DAY_NS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = PyNumber_Subtract(((PyObject *)__pyx_v_vals), __pyx_t_2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_2, __pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Subtract(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_18, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2176 + * + * # left side + * idx_shifted = _ensure_int64( # <<<<<<<<<<<<<< + * np.maximum(0, trans.searchsorted(vals - DAY_NS, side='right') - 1)) + * + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib__ensure_int64(__pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_v_idx_shifted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); + } + } + __pyx_pybuffernd_idx_shifted.diminfo[0].strides = __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx_shifted.diminfo[0].shape = __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __pyx_v_idx_shifted = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2179 + * np.maximum(0, trans.searchsorted(vals - DAY_NS, side='right') - 1)) + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] - deltas[idx_shifted[i]] + * pos = bisect_right_i8(tdata, v, ntrans) - 1 + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/tslib.pyx":2180 + * + * for i in range(n): + * v = vals[i] - deltas[idx_shifted[i]] # <<<<<<<<<<<<<< + * pos = bisect_right_i8(tdata, v, ntrans) - 1 + * + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_i; + __pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_idx_shifted.diminfo[0].strides)); + __pyx_v_v = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_vals.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_deltas.diminfo[0].strides))); + + /* "pandas/tslib.pyx":2181 + * for i in range(n): + * v = vals[i] - deltas[idx_shifted[i]] + * pos = bisect_right_i8(tdata, v, ntrans) - 1 # <<<<<<<<<<<<<< + * + * # timestamp falls to the left side of the DST transition + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib_bisect_right_i8(__pyx_v_tdata, __pyx_v_v, __pyx_v_ntrans); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = PyNumber_Subtract(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_t_19); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_v_pos = __pyx_t_25; + + /* "pandas/tslib.pyx":2184 + * + * # timestamp falls to the left side of the DST transition + * if v + deltas[pos] == vals[i]: # <<<<<<<<<<<<<< + * result_a[i] = v + * + */ + __pyx_t_25 = __pyx_v_pos; + __pyx_t_26 = __pyx_v_i; + __pyx_t_6 = (((__pyx_v_v + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_deltas.diminfo[0].strides))) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_vals.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2185 + * # timestamp falls to the left side of the DST transition + * if v + deltas[pos] == vals[i]: + * result_a[i] = v # <<<<<<<<<<<<<< + * + * # right side + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result_a.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result_a.diminfo[0].strides) = __pyx_v_v; + goto __pyx_L10; + } + __pyx_L10:; + } + + /* "pandas/tslib.pyx":2189 + * # right side + * idx_shifted = _ensure_int64( + * np.maximum(0, trans.searchsorted(vals + DAY_NS, side='right') - 1)) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_maximum); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_DAY_NS); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_vals), __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_17, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2188 + * + * # right side + * idx_shifted = _ensure_int64( # <<<<<<<<<<<<<< + * np.maximum(0, trans.searchsorted(vals + DAY_NS, side='right') - 1)) + * + */ + __pyx_t_17 = __pyx_f_6pandas_5tslib__ensure_int64(__pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_17); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_v_idx_shifted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_idx_shifted.diminfo[0].strides = __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx_shifted.diminfo[0].shape = __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __Pyx_DECREF_SET(__pyx_v_idx_shifted, ((PyArrayObject *)__pyx_t_17)); + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2191 + * np.maximum(0, trans.searchsorted(vals + DAY_NS, side='right') - 1)) + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] - deltas[idx_shifted[i]] + * pos = bisect_right_i8(tdata, v, ntrans) - 1 + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/tslib.pyx":2192 + * + * for i in range(n): + * v = vals[i] - deltas[idx_shifted[i]] # <<<<<<<<<<<<<< + * pos = bisect_right_i8(tdata, v, ntrans) - 1 + * + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_idx_shifted.diminfo[0].strides)); + __pyx_v_v = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_vals.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_deltas.diminfo[0].strides))); + + /* "pandas/tslib.pyx":2193 + * for i in range(n): + * v = vals[i] - deltas[idx_shifted[i]] + * pos = bisect_right_i8(tdata, v, ntrans) - 1 # <<<<<<<<<<<<<< + * + * # timestamp falls to the right side of the DST transition + */ + __pyx_t_17 = __pyx_f_6pandas_5tslib_bisect_right_i8(__pyx_v_tdata, __pyx_v_v, __pyx_v_ntrans); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_17, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_31 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_31 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_pos = __pyx_t_31; + + /* "pandas/tslib.pyx":2196 + * + * # timestamp falls to the right side of the DST transition + * if v + deltas[pos] == vals[i]: # <<<<<<<<<<<<<< + * result_b[i] = v + * + */ + __pyx_t_31 = __pyx_v_pos; + __pyx_t_32 = __pyx_v_i; + __pyx_t_6 = (((__pyx_v_v + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_deltas.diminfo[0].strides))) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_vals.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2197 + * # timestamp falls to the right side of the DST transition + * if v + deltas[pos] == vals[i]: + * result_b[i] = v # <<<<<<<<<<<<<< + * + * if infer_dst: + */ + __pyx_t_33 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result_b.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_result_b.diminfo[0].strides) = __pyx_v_v; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/tslib.pyx":2199 + * result_b[i] = v + * + * if infer_dst: # <<<<<<<<<<<<<< + * dst_hours = np.empty(n, dtype=np.int64) + * dst_hours.fill(NPY_NAT) + */ + __pyx_t_6 = (__pyx_v_infer_dst != 0); + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2200 + * + * if infer_dst: + * dst_hours = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * dst_hours.fill(NPY_NAT) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_18, __pyx_t_2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_19); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer, (PyObject*)__pyx_v_dst_hours, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); + } + } + __pyx_pybuffernd_dst_hours.diminfo[0].strides = __pyx_pybuffernd_dst_hours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dst_hours.diminfo[0].shape = __pyx_pybuffernd_dst_hours.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_dst_hours = ((PyArrayObject *)__pyx_t_19); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2201 + * if infer_dst: + * dst_hours = np.empty(n, dtype=np.int64) + * dst_hours.fill(NPY_NAT) # <<<<<<<<<<<<<< + * + * # Get the ambiguous hours (given the above, these are the hours + */ + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dst_hours), __pyx_n_s_fill); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2205 + * # Get the ambiguous hours (given the above, these are the hours + * # where result_a != result_b and neither of them are NAT) + * both_nat = np.logical_and(result_a != NPY_NAT, result_b != NPY_NAT) # <<<<<<<<<<<<<< + * both_eq = result_a == result_b + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = PyObject_RichCompare(((PyObject *)__pyx_v_result_a), __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = PyObject_RichCompare(((PyObject *)__pyx_v_result_b), __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_19 = 0; + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_2, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_both_nat = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2206 + * # where result_a != result_b and neither of them are NAT) + * both_nat = np.logical_and(result_a != NPY_NAT, result_b != NPY_NAT) + * both_eq = result_a == result_b # <<<<<<<<<<<<<< + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) + * if trans_idx.size == 1: + */ + __pyx_t_17 = PyObject_RichCompare(((PyObject *)__pyx_v_result_a), ((PyObject *)__pyx_v_result_b), Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_both_eq = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2207 + * both_nat = np.logical_and(result_a != NPY_NAT, result_b != NPY_NAT) + * both_eq = result_a == result_b + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) # <<<<<<<<<<<<<< + * if trans_idx.size == 1: + * stamp = Timestamp(vals[trans_idx]) + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyNumber_Invert(__pyx_v_both_eq); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_both_nat); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_both_nat); + __Pyx_GIVEREF(__pyx_v_both_nat); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_trans_idx = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2208 + * both_eq = result_a == result_b + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) + * if trans_idx.size == 1: # <<<<<<<<<<<<<< + * stamp = Timestamp(vals[trans_idx]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" + */ + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans_idx, __pyx_n_s_size); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_17, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2209 + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) + * if trans_idx.size == 1: + * stamp = Timestamp(vals[trans_idx]) # <<<<<<<<<<<<<< + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" + * "there are no repeated times" % stamp) + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_17 = PyObject_GetItem(((PyObject *)__pyx_v_vals), __pyx_v_trans_idx); if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_stamp = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2210 + * if trans_idx.size == 1: + * stamp = Timestamp(vals[trans_idx]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" # <<<<<<<<<<<<<< + * "there are no repeated times" % stamp) + * # Split the array into contiguous chunks (where the difference between + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2211 + * stamp = Timestamp(vals[trans_idx]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" + * "there are no repeated times" % stamp) # <<<<<<<<<<<<<< + * # Split the array into contiguous chunks (where the difference between + * # indices is 1). These are effectively dst transitions in different years + */ + __pyx_t_17 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_infer_dst_time_from_s_ast, __pyx_v_stamp); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + + /* "pandas/tslib.pyx":2210 + * if trans_idx.size == 1: + * stamp = Timestamp(vals[trans_idx]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" # <<<<<<<<<<<<<< + * "there are no repeated times" % stamp) + * # Split the array into contiguous chunks (where the difference between + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_17, 0, 0, 0); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2216 + * # which is useful for checking that there is not an ambiguous transition + * # in an individual year. + * if trans_idx.size > 0: # <<<<<<<<<<<<<< + * one_diff = np.where(np.diff(trans_idx)!=1)[0]+1 + * trans_grp = np.array_split(trans_idx, one_diff) + */ + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans_idx, __pyx_n_s_size); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_17, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2217 + * # in an individual year. + * if trans_idx.size > 0: + * one_diff = np.where(np.diff(trans_idx)!=1)[0]+1 # <<<<<<<<<<<<<< + * trans_grp = np.array_split(trans_idx, one_diff) + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_where); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_diff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_trans_idx); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_trans_idx); + __Pyx_GIVEREF(__pyx_v_trans_idx); + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_18, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_v_one_diff = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2218 + * if trans_idx.size > 0: + * one_diff = np.where(np.diff(trans_idx)!=1)[0]+1 + * trans_grp = np.array_split(trans_idx, one_diff) # <<<<<<<<<<<<<< + * + * # Iterate through each day, if there are no hours where the delta is negative + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array_split); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_trans_idx); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_trans_idx); + __Pyx_GIVEREF(__pyx_v_trans_idx); + __Pyx_INCREF(__pyx_v_one_diff); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_one_diff); + __Pyx_GIVEREF(__pyx_v_one_diff); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_trans_grp = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2222 + * # Iterate through each day, if there are no hours where the delta is negative + * # (indicates a repeat of hour) the switch cannot be inferred + * for grp in trans_grp: # <<<<<<<<<<<<<< + * + * delta = np.diff(result_a[grp]) + */ + if (PyList_CheckExact(__pyx_v_trans_grp) || PyTuple_CheckExact(__pyx_v_trans_grp)) { + __pyx_t_17 = __pyx_v_trans_grp; __Pyx_INCREF(__pyx_t_17); __pyx_t_1 = 0; + __pyx_t_34 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_v_trans_grp); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_34 = Py_TYPE(__pyx_t_17)->tp_iternext; + } + for (;;) { + if (!__pyx_t_34 && PyList_CheckExact(__pyx_t_17)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_17)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_17, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_34 && PyTuple_CheckExact(__pyx_t_17)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_17)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_17, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_34(__pyx_t_17); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_grp, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2224 + * for grp in trans_grp: + * + * delta = np.diff(result_a[grp]) # <<<<<<<<<<<<<< + * if grp.size == 1 or np.all(delta>0): + * stamp = Timestamp(vals[grp[0]]) + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_diff); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_result_a), __pyx_v_grp); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2225 + * + * delta = np.diff(result_a[grp]) + * if grp.size == 1 or np.all(delta>0): # <<<<<<<<<<<<<< + * stamp = Timestamp(vals[grp[0]]) + * raise pytz.AmbiguousTimeError(stamp) + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_6) { + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_v_delta, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_t_4; + } else { + __pyx_t_3 = __pyx_t_6; + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2226 + * delta = np.diff(result_a[grp]) + * if grp.size == 1 or np.all(delta>0): + * stamp = Timestamp(vals[grp[0]]) # <<<<<<<<<<<<<< + * raise pytz.AmbiguousTimeError(stamp) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_grp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_vals), __pyx_t_18); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_v_stamp = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2227 + * if grp.size == 1 or np.all(delta>0): + * stamp = Timestamp(vals[grp[0]]) + * raise pytz.AmbiguousTimeError(stamp) # <<<<<<<<<<<<<< + * + * # Find the index for the switch and pull from a for dst and b for standard + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_stamp); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_stamp); + __Pyx_GIVEREF(__pyx_v_stamp); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2230 + * + * # Find the index for the switch and pull from a for dst and b for standard + * switch_idx = (delta<=0).nonzero()[0] # <<<<<<<<<<<<<< + * if switch_idx.size > 1: + * raise pytz.AmbiguousTimeError("There are %i dst switches " + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_delta, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_switch_idx, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2231 + * # Find the index for the switch and pull from a for dst and b for standard + * switch_idx = (delta<=0).nonzero()[0] + * if switch_idx.size > 1: # <<<<<<<<<<<<<< + * raise pytz.AmbiguousTimeError("There are %i dst switches " + * "when there should only be 1." + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_switch_idx, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2232 + * switch_idx = (delta<=0).nonzero()[0] + * if switch_idx.size > 1: + * raise pytz.AmbiguousTimeError("There are %i dst switches " # <<<<<<<<<<<<<< + * "when there should only be 1." + * % switch_idx.size) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2234 + * raise pytz.AmbiguousTimeError("There are %i dst switches " + * "when there should only be 1." + * % switch_idx.size) # <<<<<<<<<<<<<< + * switch_idx = switch_idx[0]+1 # Pull the only index and adjust + * a_idx = grp[:switch_idx] + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_switch_idx, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_PyString_Format(__pyx_kp_s_There_are_i_dst_switches_when_th, __pyx_t_2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2232 + * switch_idx = (delta<=0).nonzero()[0] + * if switch_idx.size > 1: + * raise pytz.AmbiguousTimeError("There are %i dst switches " # <<<<<<<<<<<<<< + * "when there should only be 1." + * % switch_idx.size) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_18, 0, 0, 0); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2235 + * "when there should only be 1." + * % switch_idx.size) + * switch_idx = switch_idx[0]+1 # Pull the only index and adjust # <<<<<<<<<<<<<< + * a_idx = grp[:switch_idx] + * b_idx = grp[switch_idx:] + */ + __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_switch_idx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_2 = PyNumber_Add(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF_SET(__pyx_v_switch_idx, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2236 + * % switch_idx.size) + * switch_idx = switch_idx[0]+1 # Pull the only index and adjust + * a_idx = grp[:switch_idx] # <<<<<<<<<<<<<< + * b_idx = grp[switch_idx:] + * dst_hours[grp] = np.hstack((result_a[a_idx], result_b[b_idx])) + */ + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_grp, 0, 0, NULL, &__pyx_v_switch_idx, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_a_idx, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2237 + * switch_idx = switch_idx[0]+1 # Pull the only index and adjust + * a_idx = grp[:switch_idx] + * b_idx = grp[switch_idx:] # <<<<<<<<<<<<<< + * dst_hours[grp] = np.hstack((result_a[a_idx], result_b[b_idx])) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_grp, 0, 0, &__pyx_v_switch_idx, NULL, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_b_idx, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2238 + * a_idx = grp[:switch_idx] + * b_idx = grp[switch_idx:] + * dst_hours[grp] = np.hstack((result_a[a_idx], result_b[b_idx])) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hstack); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_result_a), __pyx_v_a_idx); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_result_b), __pyx_v_b_idx); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_8, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dst_hours), __pyx_v_grp, __pyx_t_19) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + } + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L16; + } + __pyx_L16:; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/tslib.pyx":2240 + * dst_hours[grp] = np.hstack((result_a[a_idx], result_b[b_idx])) + * + * for i in range(n): # <<<<<<<<<<<<<< + * left = result_a[i] + * right = result_b[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/tslib.pyx":2241 + * + * for i in range(n): + * left = result_a[i] # <<<<<<<<<<<<<< + * right = result_b[i] + * if vals[i] == NPY_NAT: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_v_left = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result_a.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result_a.diminfo[0].strides)); + + /* "pandas/tslib.pyx":2242 + * for i in range(n): + * left = result_a[i] + * right = result_b[i] # <<<<<<<<<<<<<< + * if vals[i] == NPY_NAT: + * result[i] = vals[i] + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_right = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result_b.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result_b.diminfo[0].strides)); + + /* "pandas/tslib.pyx":2243 + * left = result_a[i] + * right = result_b[i] + * if vals[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = vals[i] + * elif left != NPY_NAT and right != NPY_NAT: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_vals.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2244 + * right = result_b[i] + * if vals[i] == NPY_NAT: + * result[i] = vals[i] # <<<<<<<<<<<<<< + * elif left != NPY_NAT and right != NPY_NAT: + * if left == right: + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_vals.diminfo[0].strides)); + goto __pyx_L23; + } + + /* "pandas/tslib.pyx":2245 + * if vals[i] == NPY_NAT: + * result[i] = vals[i] + * elif left != NPY_NAT and right != NPY_NAT: # <<<<<<<<<<<<<< + * if left == right: + * result[i] = left + */ + __pyx_t_3 = ((__pyx_v_left != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + __pyx_t_6 = ((__pyx_v_right != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2246 + * result[i] = vals[i] + * elif left != NPY_NAT and right != NPY_NAT: + * if left == right: # <<<<<<<<<<<<<< + * result[i] = left + * else: + */ + __pyx_t_4 = ((__pyx_v_left == __pyx_v_right) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2247 + * elif left != NPY_NAT and right != NPY_NAT: + * if left == right: + * result[i] = left # <<<<<<<<<<<<<< + * else: + * if infer_dst and dst_hours[i] != NPY_NAT: + */ + __pyx_t_40 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_left; + goto __pyx_L24; + } + /*else*/ { + + /* "pandas/tslib.pyx":2249 + * result[i] = left + * else: + * if infer_dst and dst_hours[i] != NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = dst_hours[i] + * else: + */ + if ((__pyx_v_infer_dst != 0)) { + __pyx_t_41 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dst_hours.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_dst_hours.diminfo[0].strides)) != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + __pyx_t_3 = __pyx_t_4; + } else { + __pyx_t_3 = (__pyx_v_infer_dst != 0); + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2250 + * else: + * if infer_dst and dst_hours[i] != NPY_NAT: + * result[i] = dst_hours[i] # <<<<<<<<<<<<<< + * else: + * stamp = Timestamp(vals[i]) + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dst_hours.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_dst_hours.diminfo[0].strides)); + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/tslib.pyx":2252 + * result[i] = dst_hours[i] + * else: + * stamp = Timestamp(vals[i]) # <<<<<<<<<<<<<< + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %r, "\ + * "try using the 'infer_dst' argument" + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_44 = __pyx_v_i; + __pyx_t_19 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_vals.diminfo[0].strides))); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_8, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_stamp = __pyx_t_19; + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2253 + * else: + * stamp = Timestamp(vals[i]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %r, "\ # <<<<<<<<<<<<<< + * "try using the 'infer_dst' argument" + * % stamp) + */ + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2255 + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %r, "\ + * "try using the 'infer_dst' argument" + * % stamp) # <<<<<<<<<<<<<< + * elif left != NPY_NAT: + * result[i] = left + */ + __pyx_t_19 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_infer_dst_time_from_r_try, __pyx_v_stamp); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + + /* "pandas/tslib.pyx":2253 + * else: + * stamp = Timestamp(vals[i]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %r, "\ # <<<<<<<<<<<<<< + * "try using the 'infer_dst' argument" + * % stamp) + */ + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_17, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_Raise(__pyx_t_19, 0, 0, 0); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L25:; + } + __pyx_L24:; + goto __pyx_L23; + } + + /* "pandas/tslib.pyx":2256 + * "try using the 'infer_dst' argument" + * % stamp) + * elif left != NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = left + * elif right != NPY_NAT: + */ + __pyx_t_3 = ((__pyx_v_left != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2257 + * % stamp) + * elif left != NPY_NAT: + * result[i] = left # <<<<<<<<<<<<<< + * elif right != NPY_NAT: + * result[i] = right + */ + __pyx_t_45 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_left; + goto __pyx_L23; + } + + /* "pandas/tslib.pyx":2258 + * elif left != NPY_NAT: + * result[i] = left + * elif right != NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = right + * else: + */ + __pyx_t_3 = ((__pyx_v_right != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2259 + * result[i] = left + * elif right != NPY_NAT: + * result[i] = right # <<<<<<<<<<<<<< + * else: + * stamp = Timestamp(vals[i]) + */ + __pyx_t_46 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_right; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/tslib.pyx":2261 + * result[i] = right + * else: + * stamp = Timestamp(vals[i]) # <<<<<<<<<<<<<< + * raise pytz.NonExistentTimeError(stamp) + * + */ + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_47 = __pyx_v_i; + __pyx_t_17 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_vals.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_stamp = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2262 + * else: + * stamp = Timestamp(vals[i]) + * raise pytz.NonExistentTimeError(stamp) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_NonExistentTimeError); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_INCREF(__pyx_v_stamp); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_stamp); + __Pyx_GIVEREF(__pyx_v_stamp); + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_17, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_Raise(__pyx_t_19, 0, 0, 0); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L23:; + } + + /* "pandas/tslib.pyx":2264 + * raise pytz.NonExistentTimeError(stamp) + * + * return result # <<<<<<<<<<<<<< + * + * cdef _ensure_int64(object arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2127 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Localize tzinfo-naive DateRange to given time zone (using pytz). If + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vals.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.tz_localize_to_utc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vals.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF((PyObject *)__pyx_v_idx_shifted); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_result_a); + __Pyx_XDECREF((PyObject *)__pyx_v_result_b); + __Pyx_XDECREF((PyObject *)__pyx_v_dst_hours); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v_both_nat); + __Pyx_XDECREF(__pyx_v_both_eq); + __Pyx_XDECREF(__pyx_v_trans_idx); + __Pyx_XDECREF(__pyx_v_stamp); + __Pyx_XDECREF(__pyx_v_one_diff); + __Pyx_XDECREF(__pyx_v_trans_grp); + __Pyx_XDECREF(__pyx_v_grp); + __Pyx_XDECREF(__pyx_v_switch_idx); + __Pyx_XDECREF(__pyx_v_a_idx); + __Pyx_XDECREF(__pyx_v_b_idx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2266 + * return result + * + * cdef _ensure_int64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + */ + +static PyObject *__pyx_f_6pandas_5tslib__ensure_int64(PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ensure_int64", 0); + + /* "pandas/tslib.pyx":2267 + * + * cdef _ensure_int64(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT64: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2268 + * cdef _ensure_int64(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT64) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2269 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2271 + * return arr + * else: + * return arr.astype(np.int64) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/tslib.pyx":2273 + * return arr.astype(np.int64) + * else: + * return np.array(arr, dtype=np.int64) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2266 + * return result + * + * cdef _ensure_int64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2276 + * + * + * cdef inline bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n): # <<<<<<<<<<<<<< + * cdef Py_ssize_t pivot, left = 0, right = n + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_bisect_right_i8(__pyx_t_5numpy_int64_t *__pyx_v_data, __pyx_t_5numpy_int64_t __pyx_v_val, Py_ssize_t __pyx_v_n) { + Py_ssize_t __pyx_v_pivot; + Py_ssize_t __pyx_v_left; + Py_ssize_t __pyx_v_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("bisect_right_i8", 0); + + /* "pandas/tslib.pyx":2277 + * + * cdef inline bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n): + * cdef Py_ssize_t pivot, left = 0, right = n # <<<<<<<<<<<<<< + * + * # edge cases + */ + __pyx_v_left = 0; + __pyx_v_right = __pyx_v_n; + + /* "pandas/tslib.pyx":2280 + * + * # edge cases + * if val > data[n - 1]: # <<<<<<<<<<<<<< + * return n + * + */ + __pyx_t_1 = ((__pyx_v_val > (__pyx_v_data[(__pyx_v_n - 1)])) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2281 + * # edge cases + * if val > data[n - 1]: + * return n # <<<<<<<<<<<<<< + * + * if val < data[0]: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2283 + * return n + * + * if val < data[0]: # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_1 = ((__pyx_v_val < (__pyx_v_data[0])) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2284 + * + * if val < data[0]: + * return 0 # <<<<<<<<<<<<<< + * + * while left < right: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_0); + __pyx_r = __pyx_int_0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2286 + * return 0 + * + * while left < right: # <<<<<<<<<<<<<< + * pivot = left + (right - left) // 2 + * + */ + while (1) { + __pyx_t_1 = ((__pyx_v_left < __pyx_v_right) != 0); + if (!__pyx_t_1) break; + + /* "pandas/tslib.pyx":2287 + * + * while left < right: + * pivot = left + (right - left) // 2 # <<<<<<<<<<<<<< + * + * if data[pivot] <= val: + */ + __pyx_v_pivot = (__pyx_v_left + __Pyx_div_Py_ssize_t((__pyx_v_right - __pyx_v_left), 2)); + + /* "pandas/tslib.pyx":2289 + * pivot = left + (right - left) // 2 + * + * if data[pivot] <= val: # <<<<<<<<<<<<<< + * left = pivot + 1 + * else: + */ + __pyx_t_1 = (((__pyx_v_data[__pyx_v_pivot]) <= __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2290 + * + * if data[pivot] <= val: + * left = pivot + 1 # <<<<<<<<<<<<<< + * else: + * right = pivot + */ + __pyx_v_left = (__pyx_v_pivot + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":2292 + * left = pivot + 1 + * else: + * right = pivot # <<<<<<<<<<<<<< + * + * return left + */ + __pyx_v_right = __pyx_v_pivot; + } + __pyx_L7:; + } + + /* "pandas/tslib.pyx":2294 + * right = pivot + * + * return left # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_left); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2276 + * + * + * cdef inline bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n): # <<<<<<<<<<<<<< + * cdef Py_ssize_t pivot, left = 0, right = n + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.bisect_right_i8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2300 + * #---------------------------------------------------------------------- + * + * def build_field_sarray(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_57build_field_sarray(PyObject *__pyx_self, PyObject *__pyx_v_dtindex); /*proto*/ +static char __pyx_doc_6pandas_5tslib_56build_field_sarray[] = "\n Datetime as int64 representation to a structured array of fields\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_57build_field_sarray = {__Pyx_NAMESTR("build_field_sarray"), (PyCFunction)__pyx_pw_6pandas_5tslib_57build_field_sarray, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_56build_field_sarray)}; +static PyObject *__pyx_pw_6pandas_5tslib_57build_field_sarray(PyObject *__pyx_self, PyObject *__pyx_v_dtindex) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("build_field_sarray (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_56build_field_sarray(__pyx_self, ((PyArrayObject *)__pyx_v_dtindex)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_56build_field_sarray(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_count; + pandas_datetimestruct __pyx_v_dts; + PyArrayObject *__pyx_v_years = 0; + PyArrayObject *__pyx_v_months = 0; + PyArrayObject *__pyx_v_days = 0; + PyArrayObject *__pyx_v_hours = 0; + PyArrayObject *__pyx_v_minutes = 0; + PyArrayObject *__pyx_v_seconds = 0; + PyArrayObject *__pyx_v_mus = 0; + PyObject *__pyx_v_sa_dtype = NULL; + PyObject *__pyx_v_out = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_days; + __Pyx_Buffer __pyx_pybuffer_days; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtindex; + __Pyx_Buffer __pyx_pybuffer_dtindex; + __Pyx_LocalBuf_ND __pyx_pybuffernd_hours; + __Pyx_Buffer __pyx_pybuffer_hours; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minutes; + __Pyx_Buffer __pyx_pybuffer_minutes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_months; + __Pyx_Buffer __pyx_pybuffer_months; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mus; + __Pyx_Buffer __pyx_pybuffer_mus; + __Pyx_LocalBuf_ND __pyx_pybuffernd_seconds; + __Pyx_Buffer __pyx_pybuffer_seconds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_years; + __Pyx_Buffer __pyx_pybuffer_years; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + npy_int64 __pyx_t_13; + Py_ssize_t __pyx_t_14; + npy_int32 __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("build_field_sarray", 0); + __pyx_pybuffer_years.pybuffer.buf = NULL; + __pyx_pybuffer_years.refcount = 0; + __pyx_pybuffernd_years.data = NULL; + __pyx_pybuffernd_years.rcbuffer = &__pyx_pybuffer_years; + __pyx_pybuffer_months.pybuffer.buf = NULL; + __pyx_pybuffer_months.refcount = 0; + __pyx_pybuffernd_months.data = NULL; + __pyx_pybuffernd_months.rcbuffer = &__pyx_pybuffer_months; + __pyx_pybuffer_days.pybuffer.buf = NULL; + __pyx_pybuffer_days.refcount = 0; + __pyx_pybuffernd_days.data = NULL; + __pyx_pybuffernd_days.rcbuffer = &__pyx_pybuffer_days; + __pyx_pybuffer_hours.pybuffer.buf = NULL; + __pyx_pybuffer_hours.refcount = 0; + __pyx_pybuffernd_hours.data = NULL; + __pyx_pybuffernd_hours.rcbuffer = &__pyx_pybuffer_hours; + __pyx_pybuffer_minutes.pybuffer.buf = NULL; + __pyx_pybuffer_minutes.refcount = 0; + __pyx_pybuffernd_minutes.data = NULL; + __pyx_pybuffernd_minutes.rcbuffer = &__pyx_pybuffer_minutes; + __pyx_pybuffer_seconds.pybuffer.buf = NULL; + __pyx_pybuffer_seconds.refcount = 0; + __pyx_pybuffernd_seconds.data = NULL; + __pyx_pybuffernd_seconds.rcbuffer = &__pyx_pybuffer_seconds; + __pyx_pybuffer_mus.pybuffer.buf = NULL; + __pyx_pybuffer_mus.refcount = 0; + __pyx_pybuffernd_mus.data = NULL; + __pyx_pybuffernd_mus.rcbuffer = &__pyx_pybuffer_mus; + __pyx_pybuffer_dtindex.pybuffer.buf = NULL; + __pyx_pybuffer_dtindex.refcount = 0; + __pyx_pybuffernd_dtindex.data = NULL; + __pyx_pybuffernd_dtindex.rcbuffer = &__pyx_pybuffer_dtindex; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtindex.diminfo[0].strides = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtindex.diminfo[0].shape = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2305 + * ''' + * cdef: + * Py_ssize_t i, count = 0 # <<<<<<<<<<<<<< + * int isleap + * pandas_datetimestruct dts + */ + __pyx_v_count = 0; + + /* "pandas/tslib.pyx":2310 + * ndarray[int32_t] years, months, days, hours, minutes, seconds, mus + * + * count = len(dtindex) # <<<<<<<<<<<<<< + * + * sa_dtype = [('Y', 'i4'), # year + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_count = __pyx_t_1; + + /* "pandas/tslib.pyx":2312 + * count = len(dtindex) + * + * sa_dtype = [('Y', 'i4'), # year # <<<<<<<<<<<<<< + * ('M', 'i4'), # month + * ('D', 'i4'), # day + */ + __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_tuple__67); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __Pyx_INCREF(__pyx_tuple__68); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __Pyx_INCREF(__pyx_tuple__69); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __Pyx_INCREF(__pyx_tuple__70); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + __Pyx_INCREF(__pyx_tuple__71); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __Pyx_INCREF(__pyx_tuple__72); + PyList_SET_ITEM(__pyx_t_2, 5, __pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + __Pyx_INCREF(__pyx_tuple__73); + PyList_SET_ITEM(__pyx_t_2, 6, __pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_v_sa_dtype = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2320 + * ('u', 'i4')] # microsecond + * + * out = np.empty(count, dtype=sa_dtype) # <<<<<<<<<<<<<< + * + * years = out['Y'] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_sa_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_out = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2322 + * out = np.empty(count, dtype=sa_dtype) + * + * years = out['Y'] # <<<<<<<<<<<<<< + * months = out['M'] + * days = out['D'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_Y); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_years.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_years.rcbuffer->pybuffer, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_years.diminfo[0].strides = __pyx_pybuffernd_years.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_years.diminfo[0].shape = __pyx_pybuffernd_years.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_years = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2323 + * + * years = out['Y'] + * months = out['M'] # <<<<<<<<<<<<<< + * days = out['D'] + * hours = out['h'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_M); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_months.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_months.rcbuffer->pybuffer, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_months.diminfo[0].strides = __pyx_pybuffernd_months.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_months.diminfo[0].shape = __pyx_pybuffernd_months.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_months = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2324 + * years = out['Y'] + * months = out['M'] + * days = out['D'] # <<<<<<<<<<<<<< + * hours = out['h'] + * minutes = out['m'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_D); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_days.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_days.rcbuffer->pybuffer, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_days.diminfo[0].strides = __pyx_pybuffernd_days.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_days.diminfo[0].shape = __pyx_pybuffernd_days.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_days = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2325 + * months = out['M'] + * days = out['D'] + * hours = out['h'] # <<<<<<<<<<<<<< + * minutes = out['m'] + * seconds = out['s'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_h); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hours.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hours.rcbuffer->pybuffer, (PyObject*)__pyx_v_hours, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_hours.diminfo[0].strides = __pyx_pybuffernd_hours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hours.diminfo[0].shape = __pyx_pybuffernd_hours.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_hours = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2326 + * days = out['D'] + * hours = out['h'] + * minutes = out['m'] # <<<<<<<<<<<<<< + * seconds = out['s'] + * mus = out['u'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_m); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer, (PyObject*)__pyx_v_minutes, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_minutes.diminfo[0].strides = __pyx_pybuffernd_minutes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minutes.diminfo[0].shape = __pyx_pybuffernd_minutes.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_minutes = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2327 + * hours = out['h'] + * minutes = out['m'] + * seconds = out['s'] # <<<<<<<<<<<<<< + * mus = out['u'] + * + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_s); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer, (PyObject*)__pyx_v_seconds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_seconds.diminfo[0].strides = __pyx_pybuffernd_seconds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_seconds.diminfo[0].shape = __pyx_pybuffernd_seconds.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_seconds = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2328 + * minutes = out['m'] + * seconds = out['s'] + * mus = out['u'] # <<<<<<<<<<<<<< + * + * for i in range(count): + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_u); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mus.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mus.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mus.rcbuffer->pybuffer, (PyObject*)__pyx_v_mus, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_mus.diminfo[0].strides = __pyx_pybuffernd_mus.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mus.diminfo[0].shape = __pyx_pybuffernd_mus.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_mus = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2330 + * mus = out['u'] + * + * for i in range(count): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * years[i] = dts.year + */ + __pyx_t_1 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2331 + * + * for i in range(count): + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * years[i] = dts.year + * months[i] = dts.month + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_dtindex.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2332 + * for i in range(count): + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * years[i] = dts.year # <<<<<<<<<<<<<< + * months[i] = dts.month + * days[i] = dts.day + */ + __pyx_t_13 = __pyx_v_dts.year; + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_years.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_years.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_years.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_years.diminfo[0].strides) = __pyx_t_13; + + /* "pandas/tslib.pyx":2333 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * years[i] = dts.year + * months[i] = dts.month # <<<<<<<<<<<<<< + * days[i] = dts.day + * hours[i] = dts.hour + */ + __pyx_t_15 = __pyx_v_dts.month; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_months.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_months.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_months.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_months.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2334 + * years[i] = dts.year + * months[i] = dts.month + * days[i] = dts.day # <<<<<<<<<<<<<< + * hours[i] = dts.hour + * minutes[i] = dts.min + */ + __pyx_t_15 = __pyx_v_dts.day; + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_days.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_days.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_days.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_days.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2335 + * months[i] = dts.month + * days[i] = dts.day + * hours[i] = dts.hour # <<<<<<<<<<<<<< + * minutes[i] = dts.min + * seconds[i] = dts.sec + */ + __pyx_t_15 = __pyx_v_dts.hour; + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_hours.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_hours.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_hours.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_hours.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2336 + * days[i] = dts.day + * hours[i] = dts.hour + * minutes[i] = dts.min # <<<<<<<<<<<<<< + * seconds[i] = dts.sec + * mus[i] = dts.us + */ + __pyx_t_15 = __pyx_v_dts.min; + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_minutes.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_minutes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_minutes.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_minutes.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2337 + * hours[i] = dts.hour + * minutes[i] = dts.min + * seconds[i] = dts.sec # <<<<<<<<<<<<<< + * mus[i] = dts.us + * + */ + __pyx_t_15 = __pyx_v_dts.sec; + __pyx_t_20 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_seconds.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_seconds.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_seconds.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_seconds.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2338 + * minutes[i] = dts.min + * seconds[i] = dts.sec + * mus[i] = dts.us # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_15 = __pyx_v_dts.us; + __pyx_t_21 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_mus.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_mus.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_mus.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mus.diminfo[0].strides) = __pyx_t_15; + } + + /* "pandas/tslib.pyx":2340 + * mus[i] = dts.us + * + * return out # <<<<<<<<<<<<<< + * + * def get_time_micros(ndarray[int64_t] dtindex): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_out); + __pyx_r = __pyx_v_out; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2300 + * #---------------------------------------------------------------------- + * + * def build_field_sarray(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mus.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.build_field_sarray", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mus.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_years); + __Pyx_XDECREF((PyObject *)__pyx_v_months); + __Pyx_XDECREF((PyObject *)__pyx_v_days); + __Pyx_XDECREF((PyObject *)__pyx_v_hours); + __Pyx_XDECREF((PyObject *)__pyx_v_minutes); + __Pyx_XDECREF((PyObject *)__pyx_v_seconds); + __Pyx_XDECREF((PyObject *)__pyx_v_mus); + __Pyx_XDECREF(__pyx_v_sa_dtype); + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2342 + * return out + * + * def get_time_micros(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_59get_time_micros(PyObject *__pyx_self, PyObject *__pyx_v_dtindex); /*proto*/ +static char __pyx_doc_6pandas_5tslib_58get_time_micros[] = "\n Datetime as int64 representation to a structured array of fields\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_59get_time_micros = {__Pyx_NAMESTR("get_time_micros"), (PyCFunction)__pyx_pw_6pandas_5tslib_59get_time_micros, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_58get_time_micros)}; +static PyObject *__pyx_pw_6pandas_5tslib_59get_time_micros(PyObject *__pyx_self, PyObject *__pyx_v_dtindex) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_time_micros (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_58get_time_micros(__pyx_self, ((PyArrayObject *)__pyx_v_dtindex)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_58get_time_micros(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + PyArrayObject *__pyx_v_micros = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtindex; + __Pyx_Buffer __pyx_pybuffer_dtindex; + __Pyx_LocalBuf_ND __pyx_pybuffernd_micros; + __Pyx_Buffer __pyx_pybuffer_micros; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_time_micros", 0); + __pyx_pybuffer_micros.pybuffer.buf = NULL; + __pyx_pybuffer_micros.refcount = 0; + __pyx_pybuffernd_micros.data = NULL; + __pyx_pybuffernd_micros.rcbuffer = &__pyx_pybuffer_micros; + __pyx_pybuffer_dtindex.pybuffer.buf = NULL; + __pyx_pybuffer_dtindex.refcount = 0; + __pyx_pybuffernd_dtindex.data = NULL; + __pyx_pybuffernd_dtindex.rcbuffer = &__pyx_pybuffer_dtindex; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtindex.diminfo[0].strides = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtindex.diminfo[0].shape = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2347 + * ''' + * cdef: + * Py_ssize_t i, n = len(dtindex) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * ndarray[int64_t] micros + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2351 + * ndarray[int64_t] micros + * + * micros = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_micros.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_micros.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_micros.rcbuffer->pybuffer, (PyObject*)__pyx_v_micros, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_micros.diminfo[0].strides = __pyx_pybuffernd_micros.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_micros.diminfo[0].shape = __pyx_pybuffernd_micros.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_micros = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2353 + * micros = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * micros[i] = 1000000LL * (dts.hour * 60 * 60 + + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/tslib.pyx":2354 + * + * for i in range(n): + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * micros[i] = 1000000LL * (dts.hour * 60 * 60 + + * 60 * dts.min + dts.sec) + dts.us + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_dtindex.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2355 + * for i in range(n): + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * micros[i] = 1000000LL * (dts.hour * 60 * 60 + # <<<<<<<<<<<<<< + * 60 * dts.min + dts.sec) + dts.us + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_micros.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_micros.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_micros.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_micros.diminfo[0].strides) = ((1000000LL * ((((__pyx_v_dts.hour * 60) * 60) + (60 * __pyx_v_dts.min)) + __pyx_v_dts.sec)) + __pyx_v_dts.us); + } + + /* "pandas/tslib.pyx":2358 + * 60 * dts.min + dts.sec) + dts.us + * + * return micros # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_micros)); + __pyx_r = ((PyObject *)__pyx_v_micros); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2342 + * return out + * + * def get_time_micros(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_micros.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.get_time_micros", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_micros.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_micros); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2361 + * + * @cython.wraparound(False) + * def get_date_field(ndarray[int64_t] dtindex, object field): # <<<<<<<<<<<<<< + * ''' + * Given a int64-based datetime index, extract the year, month, etc., + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_61get_date_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_60get_date_field[] = "\n Given a int64-based datetime index, extract the year, month, etc.,\n field and return an array of these values.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_61get_date_field = {__Pyx_NAMESTR("get_date_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_61get_date_field, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_60get_date_field)}; +static PyObject *__pyx_pw_6pandas_5tslib_61get_date_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_dtindex = 0; + PyObject *__pyx_v_field = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_date_field (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtindex,&__pyx_n_s_field,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtindex)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_date_field", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_date_field") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_dtindex = ((PyArrayObject *)values[0]); + __pyx_v_field = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_date_field", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_date_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_60get_date_field(__pyx_self, __pyx_v_dtindex, __pyx_v_field); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_60get_date_field(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex, PyObject *__pyx_v_field) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_count; + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v__month_offset = 0; + int __pyx_v_isleap; + int __pyx_v_isleap_prev; + pandas_datetimestruct __pyx_v_dts; + int __pyx_v_mo_off; + int __pyx_v_doy; + int __pyx_v_dow; + int __pyx_v_woy; + __Pyx_LocalBuf_ND __pyx_pybuffernd__month_offset; + __Pyx_Buffer __pyx_pybuffer__month_offset; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtindex; + __Pyx_Buffer __pyx_pybuffer_dtindex; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + npy_int64 __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + npy_int32 __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + long __pyx_t_52; + int __pyx_t_53; + Py_ssize_t __pyx_t_54; + Py_ssize_t __pyx_t_55; + Py_ssize_t __pyx_t_56; + Py_ssize_t __pyx_t_57; + Py_ssize_t __pyx_t_58; + Py_ssize_t __pyx_t_59; + Py_ssize_t __pyx_t_60; + Py_ssize_t __pyx_t_61; + Py_ssize_t __pyx_t_62; + long __pyx_t_63; + int __pyx_t_64; + int __pyx_t_65; + int __pyx_t_66; + Py_ssize_t __pyx_t_67; + Py_ssize_t __pyx_t_68; + Py_ssize_t __pyx_t_69; + Py_ssize_t __pyx_t_70; + Py_ssize_t __pyx_t_71; + Py_ssize_t __pyx_t_72; + Py_ssize_t __pyx_t_73; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_date_field", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer__month_offset.pybuffer.buf = NULL; + __pyx_pybuffer__month_offset.refcount = 0; + __pyx_pybuffernd__month_offset.data = NULL; + __pyx_pybuffernd__month_offset.rcbuffer = &__pyx_pybuffer__month_offset; + __pyx_pybuffer_dtindex.pybuffer.buf = NULL; + __pyx_pybuffer_dtindex.refcount = 0; + __pyx_pybuffernd_dtindex.data = NULL; + __pyx_pybuffernd_dtindex.rcbuffer = &__pyx_pybuffer_dtindex; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtindex.diminfo[0].strides = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtindex.diminfo[0].shape = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2368 + * cdef: + * _TSObject ts + * Py_ssize_t i, count = 0 # <<<<<<<<<<<<<< + * ndarray[int32_t] out + * ndarray[int32_t, ndim=2] _month_offset + */ + __pyx_v_count = 0; + + /* "pandas/tslib.pyx":2375 + * int mo_off, doy, dow, woy + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2376 + * + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], # <<<<<<<<<<<<<< + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) + */ + __pyx_t_1 = PyList_New(13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_31); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_31); + __Pyx_GIVEREF(__pyx_int_31); + __Pyx_INCREF(__pyx_int_59); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_59); + __Pyx_GIVEREF(__pyx_int_59); + __Pyx_INCREF(__pyx_int_90); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_90); + __Pyx_GIVEREF(__pyx_int_90); + __Pyx_INCREF(__pyx_int_120); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_120); + __Pyx_GIVEREF(__pyx_int_120); + __Pyx_INCREF(__pyx_int_151); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_151); + __Pyx_GIVEREF(__pyx_int_151); + __Pyx_INCREF(__pyx_int_181); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_181); + __Pyx_GIVEREF(__pyx_int_181); + __Pyx_INCREF(__pyx_int_212); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_212); + __Pyx_GIVEREF(__pyx_int_212); + __Pyx_INCREF(__pyx_int_243); + PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_243); + __Pyx_GIVEREF(__pyx_int_243); + __Pyx_INCREF(__pyx_int_273); + PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_273); + __Pyx_GIVEREF(__pyx_int_273); + __Pyx_INCREF(__pyx_int_304); + PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_304); + __Pyx_GIVEREF(__pyx_int_304); + __Pyx_INCREF(__pyx_int_334); + PyList_SET_ITEM(__pyx_t_1, 11, __pyx_int_334); + __Pyx_GIVEREF(__pyx_int_334); + __Pyx_INCREF(__pyx_int_365); + PyList_SET_ITEM(__pyx_t_1, 12, __pyx_int_365); + __Pyx_GIVEREF(__pyx_int_365); + + /* "pandas/tslib.pyx":2377 + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], # <<<<<<<<<<<<<< + * dtype=np.int32 ) + * + */ + __pyx_t_3 = PyList_New(13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_31); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_31); + __Pyx_GIVEREF(__pyx_int_31); + __Pyx_INCREF(__pyx_int_60); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_60); + __Pyx_GIVEREF(__pyx_int_60); + __Pyx_INCREF(__pyx_int_91); + PyList_SET_ITEM(__pyx_t_3, 3, __pyx_int_91); + __Pyx_GIVEREF(__pyx_int_91); + __Pyx_INCREF(__pyx_int_121); + PyList_SET_ITEM(__pyx_t_3, 4, __pyx_int_121); + __Pyx_GIVEREF(__pyx_int_121); + __Pyx_INCREF(__pyx_int_152); + PyList_SET_ITEM(__pyx_t_3, 5, __pyx_int_152); + __Pyx_GIVEREF(__pyx_int_152); + __Pyx_INCREF(__pyx_int_182); + PyList_SET_ITEM(__pyx_t_3, 6, __pyx_int_182); + __Pyx_GIVEREF(__pyx_int_182); + __Pyx_INCREF(__pyx_int_213); + PyList_SET_ITEM(__pyx_t_3, 7, __pyx_int_213); + __Pyx_GIVEREF(__pyx_int_213); + __Pyx_INCREF(__pyx_int_244); + PyList_SET_ITEM(__pyx_t_3, 8, __pyx_int_244); + __Pyx_GIVEREF(__pyx_int_244); + __Pyx_INCREF(__pyx_int_274); + PyList_SET_ITEM(__pyx_t_3, 9, __pyx_int_274); + __Pyx_GIVEREF(__pyx_int_274); + __Pyx_INCREF(__pyx_int_305); + PyList_SET_ITEM(__pyx_t_3, 10, __pyx_int_305); + __Pyx_GIVEREF(__pyx_int_305); + __Pyx_INCREF(__pyx_int_335); + PyList_SET_ITEM(__pyx_t_3, 11, __pyx_int_335); + __Pyx_GIVEREF(__pyx_int_335); + __Pyx_INCREF(__pyx_int_366); + PyList_SET_ITEM(__pyx_t_3, 12, __pyx_int_366); + __Pyx_GIVEREF(__pyx_int_366); + + /* "pandas/tslib.pyx":2376 + * + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], # <<<<<<<<<<<<<< + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) + */ + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":2375 + * int mo_off, doy, dow, woy + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":2378 + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) # <<<<<<<<<<<<<< + * + * count = len(dtindex) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2375 + * int mo_off, doy, dow, woy + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer, (PyObject*)__pyx_v__month_offset, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd__month_offset.diminfo[0].strides = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__month_offset.diminfo[0].shape = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd__month_offset.diminfo[1].strides = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd__month_offset.diminfo[1].shape = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v__month_offset = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2380 + * dtype=np.int32 ) + * + * count = len(dtindex) # <<<<<<<<<<<<<< + * out = np.empty(count, dtype='i4') + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_count = __pyx_t_11; + + /* "pandas/tslib.pyx":2381 + * + * count = len(dtindex) + * out = np.empty(count, dtype='i4') # <<<<<<<<<<<<<< + * + * if field == 'Y': + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2383 + * out = np.empty(count, dtype='i4') + * + * if field == 'Y': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_Y, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2384 + * + * if field == 'Y': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2385 + * if field == 'Y': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":2387 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.year + * return out + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2388 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.year # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_18 = __pyx_v_dts.year; + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_18; + __pyx_L4_continue:; + } + + /* "pandas/tslib.pyx":2389 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.year + * return out # <<<<<<<<<<<<<< + * + * elif field == 'M': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2391 + * return out + * + * elif field == 'M': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_M, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2392 + * + * elif field == 'M': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2393 + * elif field == 'M': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L7_continue; + } + + /* "pandas/tslib.pyx":2395 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.month + * return out + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2396 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.month # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.month; + __pyx_t_24 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L7_continue:; + } + + /* "pandas/tslib.pyx":2397 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.month + * return out # <<<<<<<<<<<<<< + * + * elif field == 'D': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2399 + * return out + * + * elif field == 'D': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2400 + * + * elif field == 'D': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2401 + * elif field == 'D': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_26 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L10_continue; + } + + /* "pandas/tslib.pyx":2403 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.day + * return out + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2404 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.day # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.day; + __pyx_t_28 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L10_continue:; + } + + /* "pandas/tslib.pyx":2405 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.day + * return out # <<<<<<<<<<<<<< + * + * elif field == 'h': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2407 + * return out + * + * elif field == 'h': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_h, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2408 + * + * elif field == 'h': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2409 + * elif field == 'h': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_30 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L13_continue; + } + + /* "pandas/tslib.pyx":2411 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.hour + * return out + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2412 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.hour # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.hour; + __pyx_t_32 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L13_continue:; + } + + /* "pandas/tslib.pyx":2413 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.hour + * return out # <<<<<<<<<<<<<< + * + * elif field == 'm': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2415 + * return out + * + * elif field == 'm': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_m, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2416 + * + * elif field == 'm': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2417 + * elif field == 'm': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_34 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L16_continue; + } + + /* "pandas/tslib.pyx":2419 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.min + * return out + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2420 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.min # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.min; + __pyx_t_36 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L16_continue:; + } + + /* "pandas/tslib.pyx":2421 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.min + * return out # <<<<<<<<<<<<<< + * + * elif field == 's': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2423 + * return out + * + * elif field == 's': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_s, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2424 + * + * elif field == 's': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2425 + * elif field == 's': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_38 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L19_continue; + } + + /* "pandas/tslib.pyx":2427 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.sec + * return out + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_39 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2428 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.sec # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.sec; + __pyx_t_40 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L19_continue:; + } + + /* "pandas/tslib.pyx":2429 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.sec + * return out # <<<<<<<<<<<<<< + * + * elif field == 'us': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2431 + * return out + * + * elif field == 'us': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_us, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2432 + * + * elif field == 'us': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2433 + * elif field == 'us': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_41 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_42 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L22_continue; + } + + /* "pandas/tslib.pyx":2435 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.us + * return out + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_43 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2436 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.us # <<<<<<<<<<<<<< + * return out + * elif field == 'ns': + */ + __pyx_t_23 = __pyx_v_dts.us; + __pyx_t_44 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L22_continue:; + } + + /* "pandas/tslib.pyx":2437 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.us + * return out # <<<<<<<<<<<<<< + * elif field == 'ns': + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2438 + * out[i] = dts.us + * return out + * elif field == 'ns': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_ns, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2439 + * return out + * elif field == 'ns': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2440 + * elif field == 'ns': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_45 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_45 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_46 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L25_continue; + } + + /* "pandas/tslib.pyx":2442 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.ps / 1000 + * return out + */ + __pyx_t_47 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_47 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2443 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.ps / 1000 # <<<<<<<<<<<<<< + * return out + * elif field == 'doy': + */ + __pyx_t_48 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_out.diminfo[0].strides) = __Pyx_div_long(__pyx_v_dts.ps, 1000); + __pyx_L25_continue:; + } + + /* "pandas/tslib.pyx":2444 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.ps / 1000 + * return out # <<<<<<<<<<<<<< + * elif field == 'doy': + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2445 + * out[i] = dts.ps / 1000 + * return out + * elif field == 'doy': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_doy, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2446 + * return out + * elif field == 'doy': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2447 + * elif field == 'doy': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_49 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_49 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_50 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L28_continue; + } + + /* "pandas/tslib.pyx":2449 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * out[i] = _month_offset[isleap, dts.month-1] + dts.day + */ + __pyx_t_51 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_51 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2450 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * out[i] = _month_offset[isleap, dts.month-1] + dts.day + * return out + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2451 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) + * out[i] = _month_offset[isleap, dts.month-1] + dts.day # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_7 = __pyx_v_isleap; + __pyx_t_52 = (__pyx_v_dts.month - 1); + __pyx_t_53 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_53 = 0; + if (__pyx_t_52 < 0) { + __pyx_t_53 = 1; + } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_53 = 1; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_54 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_54 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_out.diminfo[0].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd__month_offset.diminfo[1].strides)) + __pyx_v_dts.day); + __pyx_L28_continue:; + } + + /* "pandas/tslib.pyx":2452 + * isleap = is_leapyear(dts.year) + * out[i] = _month_offset[isleap, dts.month-1] + dts.day + * return out # <<<<<<<<<<<<<< + * + * elif field == 'dow': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2454 + * return out + * + * elif field == 'dow': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_dow, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2455 + * + * elif field == 'dow': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2456 + * elif field == 'dow': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * ts = convert_to_tsobject(dtindex[i], None, None) + */ + __pyx_t_55 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_55 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_56 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_56 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L31_continue; + } + + /* "pandas/tslib.pyx":2458 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * out[i] = ts_dayofweek(ts) + * return out + */ + __pyx_t_57 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_57 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2459 + * + * ts = convert_to_tsobject(dtindex[i], None, None) + * out[i] = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_58 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_58 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + __pyx_L31_continue:; + } + + /* "pandas/tslib.pyx":2460 + * ts = convert_to_tsobject(dtindex[i], None, None) + * out[i] = ts_dayofweek(ts) + * return out # <<<<<<<<<<<<<< + * + * elif field == 'woy': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2462 + * return out + * + * elif field == 'woy': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_woy, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2463 + * + * elif field == 'woy': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2464 + * elif field == 'woy': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_59 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_59 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_60 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_60 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L34_continue; + } + + /* "pandas/tslib.pyx":2466 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_61 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_61 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2467 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * isleap_prev = is_leapyear(dts.year - 1) + */ + __pyx_t_62 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_62 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2468 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * isleap_prev = is_leapyear(dts.year - 1) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2469 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * isleap_prev = is_leapyear(dts.year - 1) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dts.day + */ + __pyx_v_isleap_prev = is_leapyear((__pyx_v_dts.year - 1)); + + /* "pandas/tslib.pyx":2470 + * isleap = is_leapyear(dts.year) + * isleap_prev = is_leapyear(dts.year - 1) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * doy = mo_off + dts.day + * dow = ts_dayofweek(ts) + */ + __pyx_t_53 = __pyx_v_isleap; + __pyx_t_63 = (__pyx_v_dts.month - 1); + __pyx_t_64 = -1; + if (__pyx_t_53 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_64 = 0; + if (__pyx_t_63 < 0) { + __pyx_t_64 = 1; + } else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_64 = 1; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_63, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2471 + * isleap_prev = is_leapyear(dts.year - 1) + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dts.day # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dts.day); + + /* "pandas/tslib.pyx":2472 + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dts.day + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * #estimate + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2475 + * + * #estimate + * woy = (doy - 1) - dow + 3 # <<<<<<<<<<<<<< + * if woy >= 0: + * woy = woy / 7 + 1 + */ + __pyx_v_woy = (((__pyx_v_doy - 1) - __pyx_v_dow) + 3); + + /* "pandas/tslib.pyx":2476 + * #estimate + * woy = (doy - 1) - dow + 3 + * if woy >= 0: # <<<<<<<<<<<<<< + * woy = woy / 7 + 1 + * + */ + __pyx_t_13 = ((__pyx_v_woy >= 0) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2477 + * woy = (doy - 1) - dow + 3 + * if woy >= 0: + * woy = woy / 7 + 1 # <<<<<<<<<<<<<< + * + * # verify + */ + __pyx_v_woy = (__Pyx_div_long(__pyx_v_woy, 7) + 1); + goto __pyx_L37; + } + __pyx_L37:; + + /* "pandas/tslib.pyx":2480 + * + * # verify + * if woy < 0: # <<<<<<<<<<<<<< + * if (woy > -2) or (woy == -2 and isleap_prev): + * woy = 53 + */ + __pyx_t_13 = ((__pyx_v_woy < 0) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2481 + * # verify + * if woy < 0: + * if (woy > -2) or (woy == -2 and isleap_prev): # <<<<<<<<<<<<<< + * woy = 53 + * else: + */ + __pyx_t_13 = (__pyx_v_woy > -2); + if (!__pyx_t_13) { + __pyx_t_65 = (__pyx_v_woy == -2); + if (__pyx_t_65) { + __pyx_t_66 = (__pyx_v_isleap_prev != 0); + } else { + __pyx_t_66 = __pyx_t_65; + } + __pyx_t_65 = __pyx_t_66; + } else { + __pyx_t_65 = __pyx_t_13; + } + if (__pyx_t_65) { + + /* "pandas/tslib.pyx":2482 + * if woy < 0: + * if (woy > -2) or (woy == -2 and isleap_prev): + * woy = 53 # <<<<<<<<<<<<<< + * else: + * woy = 52 + */ + __pyx_v_woy = 53; + goto __pyx_L39; + } + /*else*/ { + + /* "pandas/tslib.pyx":2484 + * woy = 53 + * else: + * woy = 52 # <<<<<<<<<<<<<< + * elif woy == 53: + * if 31 - dts.day + dow < 3: + */ + __pyx_v_woy = 52; + } + __pyx_L39:; + goto __pyx_L38; + } + + /* "pandas/tslib.pyx":2485 + * else: + * woy = 52 + * elif woy == 53: # <<<<<<<<<<<<<< + * if 31 - dts.day + dow < 3: + * woy = 1 + */ + __pyx_t_65 = ((__pyx_v_woy == 53) != 0); + if (__pyx_t_65) { + + /* "pandas/tslib.pyx":2486 + * woy = 52 + * elif woy == 53: + * if 31 - dts.day + dow < 3: # <<<<<<<<<<<<<< + * woy = 1 + * + */ + __pyx_t_65 = ((((31 - __pyx_v_dts.day) + __pyx_v_dow) < 3) != 0); + if (__pyx_t_65) { + + /* "pandas/tslib.pyx":2487 + * elif woy == 53: + * if 31 - dts.day + dow < 3: + * woy = 1 # <<<<<<<<<<<<<< + * + * out[i] = woy + */ + __pyx_v_woy = 1; + goto __pyx_L40; + } + __pyx_L40:; + goto __pyx_L38; + } + __pyx_L38:; + + /* "pandas/tslib.pyx":2489 + * woy = 1 + * + * out[i] = woy # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_67 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_67 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_woy; + __pyx_L34_continue:; + } + + /* "pandas/tslib.pyx":2490 + * + * out[i] = woy + * return out # <<<<<<<<<<<<<< + * + * elif field == 'q': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2492 + * return out + * + * elif field == 'q': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_65 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_q, Py_EQ)); if (unlikely(__pyx_t_65 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_65) { + + /* "pandas/tslib.pyx":2493 + * + * elif field == 'q': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2494 + * elif field == 'q': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_68 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_68 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_65 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_68, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_65) { + __pyx_t_69 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_69 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L41_continue; + } + + /* "pandas/tslib.pyx":2496 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.month + * out[i] = ((out[i] - 1) / 3) + 1 + */ + __pyx_t_70 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_70 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2497 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.month # <<<<<<<<<<<<<< + * out[i] = ((out[i] - 1) / 3) + 1 + * return out + */ + __pyx_t_23 = __pyx_v_dts.month; + __pyx_t_71 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_71 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + + /* "pandas/tslib.pyx":2498 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.month + * out[i] = ((out[i] - 1) / 3) + 1 # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_72 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_72 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_73 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_73 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_73, __pyx_pybuffernd_out.diminfo[0].strides) = (__Pyx_div_long(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_out.diminfo[0].strides)) - 1), 3) + 1); + __pyx_L41_continue:; + } + + /* "pandas/tslib.pyx":2499 + * out[i] = dts.month + * out[i] = ((out[i] - 1) / 3) + 1 + * return out # <<<<<<<<<<<<<< + * + * raise ValueError("Field %s not supported" % field) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2501 + * return out + * + * raise ValueError("Field %s not supported" % field) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Field_s_not_supported, __pyx_v_field); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2361 + * + * @cython.wraparound(False) + * def get_date_field(ndarray[int64_t] dtindex, object field): # <<<<<<<<<<<<<< + * ''' + * Given a int64-based datetime index, extract the year, month, etc., + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.get_date_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XDECREF((PyObject *)__pyx_v__month_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2505 + * + * @cython.wraparound(False) + * def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=None, int month_kw=12): # <<<<<<<<<<<<<< + * ''' + * Given an int64-based datetime index return array of indicators + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_63get_start_end_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_62get_start_end_field[] = "\n Given an int64-based datetime index return array of indicators\n of whether timestamps are at the start/end of the month/quarter/year\n (defined by frequency).\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_63get_start_end_field = {__Pyx_NAMESTR("get_start_end_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_63get_start_end_field, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_62get_start_end_field)}; +static PyObject *__pyx_pw_6pandas_5tslib_63get_start_end_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_dtindex = 0; + PyObject *__pyx_v_field = 0; + PyObject *__pyx_v_freqstr = 0; + int __pyx_v_month_kw; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_start_end_field (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtindex,&__pyx_n_s_field,&__pyx_n_s_freqstr,&__pyx_n_s_month_kw,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtindex)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_start_end_field", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freqstr); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_month_kw); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_start_end_field") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dtindex = ((PyArrayObject *)values[0]); + __pyx_v_field = values[1]; + __pyx_v_freqstr = values[2]; + if (values[3]) { + __pyx_v_month_kw = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_month_kw == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_month_kw = ((int)12); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_start_end_field", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_start_end_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_62get_start_end_field(__pyx_self, __pyx_v_dtindex, __pyx_v_field, __pyx_v_freqstr, __pyx_v_month_kw); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_62get_start_end_field(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex, PyObject *__pyx_v_field, PyObject *__pyx_v_freqstr, int __pyx_v_month_kw) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + Py_ssize_t __pyx_v_i; + int __pyx_v_count; + int __pyx_v_is_business; + int __pyx_v_end_month; + int __pyx_v_start_month; + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v__month_offset = 0; + int __pyx_v_isleap; + pandas_datetimestruct __pyx_v_dts; + int __pyx_v_mo_off; + int __pyx_v_dom; + int __pyx_v_doy; + int __pyx_v_dow; + int __pyx_v_ldom; + __Pyx_LocalBuf_ND __pyx_pybuffernd__month_offset; + __Pyx_Buffer __pyx_pybuffer__month_offset; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtindex; + __Pyx_Buffer __pyx_pybuffer_dtindex; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + npy_int32 __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + int __pyx_t_33; + int __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + long __pyx_t_39; + npy_int32 __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + npy_int32 __pyx_t_46; + int __pyx_t_47; + int __pyx_t_48; + int __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + Py_ssize_t __pyx_t_53; + Py_ssize_t __pyx_t_54; + Py_ssize_t __pyx_t_55; + Py_ssize_t __pyx_t_56; + Py_ssize_t __pyx_t_57; + Py_ssize_t __pyx_t_58; + long __pyx_t_59; + int __pyx_t_60; + int __pyx_t_61; + Py_ssize_t __pyx_t_62; + Py_ssize_t __pyx_t_63; + Py_ssize_t __pyx_t_64; + Py_ssize_t __pyx_t_65; + long __pyx_t_66; + npy_int32 __pyx_t_67; + Py_ssize_t __pyx_t_68; + Py_ssize_t __pyx_t_69; + Py_ssize_t __pyx_t_70; + Py_ssize_t __pyx_t_71; + Py_ssize_t __pyx_t_72; + npy_int32 __pyx_t_73; + int __pyx_t_74; + int __pyx_t_75; + Py_ssize_t __pyx_t_76; + Py_ssize_t __pyx_t_77; + Py_ssize_t __pyx_t_78; + Py_ssize_t __pyx_t_79; + Py_ssize_t __pyx_t_80; + Py_ssize_t __pyx_t_81; + Py_ssize_t __pyx_t_82; + Py_ssize_t __pyx_t_83; + Py_ssize_t __pyx_t_84; + long __pyx_t_85; + int __pyx_t_86; + int __pyx_t_87; + Py_ssize_t __pyx_t_88; + Py_ssize_t __pyx_t_89; + Py_ssize_t __pyx_t_90; + Py_ssize_t __pyx_t_91; + Py_ssize_t __pyx_t_92; + long __pyx_t_93; + npy_int32 __pyx_t_94; + Py_ssize_t __pyx_t_95; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_start_end_field", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer__month_offset.pybuffer.buf = NULL; + __pyx_pybuffer__month_offset.refcount = 0; + __pyx_pybuffernd__month_offset.data = NULL; + __pyx_pybuffernd__month_offset.rcbuffer = &__pyx_pybuffer__month_offset; + __pyx_pybuffer_dtindex.pybuffer.buf = NULL; + __pyx_pybuffer_dtindex.refcount = 0; + __pyx_pybuffernd_dtindex.data = NULL; + __pyx_pybuffernd_dtindex.rcbuffer = &__pyx_pybuffer_dtindex; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtindex.diminfo[0].strides = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtindex.diminfo[0].shape = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2514 + * _TSObject ts + * Py_ssize_t i + * int count = 0 # <<<<<<<<<<<<<< + * bint is_business = 0 + * int end_month = 12 + */ + __pyx_v_count = 0; + + /* "pandas/tslib.pyx":2515 + * Py_ssize_t i + * int count = 0 + * bint is_business = 0 # <<<<<<<<<<<<<< + * int end_month = 12 + * int start_month = 1 + */ + __pyx_v_is_business = 0; + + /* "pandas/tslib.pyx":2516 + * int count = 0 + * bint is_business = 0 + * int end_month = 12 # <<<<<<<<<<<<<< + * int start_month = 1 + * ndarray[int8_t] out + */ + __pyx_v_end_month = 12; + + /* "pandas/tslib.pyx":2517 + * bint is_business = 0 + * int end_month = 12 + * int start_month = 1 # <<<<<<<<<<<<<< + * ndarray[int8_t] out + * ndarray[int32_t, ndim=2] _month_offset + */ + __pyx_v_start_month = 1; + + /* "pandas/tslib.pyx":2524 + * int mo_off, dom, doy, dow, ldom + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2525 + * + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], # <<<<<<<<<<<<<< + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) + */ + __pyx_t_1 = PyList_New(13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_31); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_31); + __Pyx_GIVEREF(__pyx_int_31); + __Pyx_INCREF(__pyx_int_59); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_59); + __Pyx_GIVEREF(__pyx_int_59); + __Pyx_INCREF(__pyx_int_90); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_90); + __Pyx_GIVEREF(__pyx_int_90); + __Pyx_INCREF(__pyx_int_120); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_120); + __Pyx_GIVEREF(__pyx_int_120); + __Pyx_INCREF(__pyx_int_151); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_151); + __Pyx_GIVEREF(__pyx_int_151); + __Pyx_INCREF(__pyx_int_181); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_181); + __Pyx_GIVEREF(__pyx_int_181); + __Pyx_INCREF(__pyx_int_212); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_212); + __Pyx_GIVEREF(__pyx_int_212); + __Pyx_INCREF(__pyx_int_243); + PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_243); + __Pyx_GIVEREF(__pyx_int_243); + __Pyx_INCREF(__pyx_int_273); + PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_273); + __Pyx_GIVEREF(__pyx_int_273); + __Pyx_INCREF(__pyx_int_304); + PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_304); + __Pyx_GIVEREF(__pyx_int_304); + __Pyx_INCREF(__pyx_int_334); + PyList_SET_ITEM(__pyx_t_1, 11, __pyx_int_334); + __Pyx_GIVEREF(__pyx_int_334); + __Pyx_INCREF(__pyx_int_365); + PyList_SET_ITEM(__pyx_t_1, 12, __pyx_int_365); + __Pyx_GIVEREF(__pyx_int_365); + + /* "pandas/tslib.pyx":2526 + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], # <<<<<<<<<<<<<< + * dtype=np.int32 ) + * + */ + __pyx_t_3 = PyList_New(13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_31); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_31); + __Pyx_GIVEREF(__pyx_int_31); + __Pyx_INCREF(__pyx_int_60); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_60); + __Pyx_GIVEREF(__pyx_int_60); + __Pyx_INCREF(__pyx_int_91); + PyList_SET_ITEM(__pyx_t_3, 3, __pyx_int_91); + __Pyx_GIVEREF(__pyx_int_91); + __Pyx_INCREF(__pyx_int_121); + PyList_SET_ITEM(__pyx_t_3, 4, __pyx_int_121); + __Pyx_GIVEREF(__pyx_int_121); + __Pyx_INCREF(__pyx_int_152); + PyList_SET_ITEM(__pyx_t_3, 5, __pyx_int_152); + __Pyx_GIVEREF(__pyx_int_152); + __Pyx_INCREF(__pyx_int_182); + PyList_SET_ITEM(__pyx_t_3, 6, __pyx_int_182); + __Pyx_GIVEREF(__pyx_int_182); + __Pyx_INCREF(__pyx_int_213); + PyList_SET_ITEM(__pyx_t_3, 7, __pyx_int_213); + __Pyx_GIVEREF(__pyx_int_213); + __Pyx_INCREF(__pyx_int_244); + PyList_SET_ITEM(__pyx_t_3, 8, __pyx_int_244); + __Pyx_GIVEREF(__pyx_int_244); + __Pyx_INCREF(__pyx_int_274); + PyList_SET_ITEM(__pyx_t_3, 9, __pyx_int_274); + __Pyx_GIVEREF(__pyx_int_274); + __Pyx_INCREF(__pyx_int_305); + PyList_SET_ITEM(__pyx_t_3, 10, __pyx_int_305); + __Pyx_GIVEREF(__pyx_int_305); + __Pyx_INCREF(__pyx_int_335); + PyList_SET_ITEM(__pyx_t_3, 11, __pyx_int_335); + __Pyx_GIVEREF(__pyx_int_335); + __Pyx_INCREF(__pyx_int_366); + PyList_SET_ITEM(__pyx_t_3, 12, __pyx_int_366); + __Pyx_GIVEREF(__pyx_int_366); + + /* "pandas/tslib.pyx":2525 + * + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], # <<<<<<<<<<<<<< + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) + */ + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":2524 + * int mo_off, dom, doy, dow, ldom + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":2527 + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) # <<<<<<<<<<<<<< + * + * count = len(dtindex) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2524 + * int mo_off, dom, doy, dow, ldom + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer, (PyObject*)__pyx_v__month_offset, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd__month_offset.diminfo[0].strides = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__month_offset.diminfo[0].shape = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd__month_offset.diminfo[1].strides = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd__month_offset.diminfo[1].shape = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v__month_offset = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2529 + * dtype=np.int32 ) + * + * count = len(dtindex) # <<<<<<<<<<<<<< + * out = np.zeros(count, dtype='int8') + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_count = __pyx_t_11; + + /* "pandas/tslib.pyx":2530 + * + * count = len(dtindex) + * out = np.zeros(count, dtype='int8') # <<<<<<<<<<<<<< + * + * if freqstr: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_int8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2532 + * out = np.zeros(count, dtype='int8') + * + * if freqstr: # <<<<<<<<<<<<<< + * if freqstr == 'C': + * raise ValueError("Custom business days is not supported by %s" % field) + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_freqstr); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2533 + * + * if freqstr: + * if freqstr == 'C': # <<<<<<<<<<<<<< + * raise ValueError("Custom business days is not supported by %s" % field) + * is_business = freqstr[0] == 'B' + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_freqstr, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2534 + * if freqstr: + * if freqstr == 'C': + * raise ValueError("Custom business days is not supported by %s" % field) # <<<<<<<<<<<<<< + * is_business = freqstr[0] == 'B' + * + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Custom_business_days_is_not_supp, __pyx_v_field); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2535 + * if freqstr == 'C': + * raise ValueError("Custom business days is not supported by %s" % field) + * is_business = freqstr[0] == 'B' # <<<<<<<<<<<<<< + * + * # YearBegin(), BYearBegin() use month = starting month of year + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_freqstr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_n_s_B, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_is_business = __pyx_t_13; + + /* "pandas/tslib.pyx":2541 + * # other offests use month, startingMonth as ending month of year. + * + * if (freqstr[0:2] in ['MS', 'QS', 'AS']) or (freqstr[1:3] in ['MS', 'QS', 'AS']): # <<<<<<<<<<<<<< + * end_month = 12 if month_kw == 1 else month_kw - 1 + * start_month = month_kw + */ + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_freqstr, 0, 2, NULL, NULL, &__pyx_slice__74, 1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_MS, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_13) { + __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_QS, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __pyx_t_14; + } else { + __pyx_t_15 = __pyx_t_13; + } + if (!__pyx_t_15) { + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_AS, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_t_13; + } else { + __pyx_t_14 = __pyx_t_15; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = (__pyx_t_14 != 0); + if (!__pyx_t_15) { + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_freqstr, 1, 3, NULL, NULL, &__pyx_slice__75, 1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_MS, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_14) { + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_QS, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_14; + } + if (!__pyx_t_16) { + __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_AS, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __pyx_t_14; + } else { + __pyx_t_13 = __pyx_t_16; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_16 = (__pyx_t_13 != 0); + __pyx_t_13 = __pyx_t_16; + } else { + __pyx_t_13 = __pyx_t_15; + } + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2542 + * + * if (freqstr[0:2] in ['MS', 'QS', 'AS']) or (freqstr[1:3] in ['MS', 'QS', 'AS']): + * end_month = 12 if month_kw == 1 else month_kw - 1 # <<<<<<<<<<<<<< + * start_month = month_kw + * else: + */ + if (((__pyx_v_month_kw == 1) != 0)) { + __pyx_t_17 = 12; + } else { + __pyx_t_17 = (__pyx_v_month_kw - 1); + } + __pyx_v_end_month = __pyx_t_17; + + /* "pandas/tslib.pyx":2543 + * if (freqstr[0:2] in ['MS', 'QS', 'AS']) or (freqstr[1:3] in ['MS', 'QS', 'AS']): + * end_month = 12 if month_kw == 1 else month_kw - 1 + * start_month = month_kw # <<<<<<<<<<<<<< + * else: + * end_month = month_kw + */ + __pyx_v_start_month = __pyx_v_month_kw; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":2545 + * start_month = month_kw + * else: + * end_month = month_kw # <<<<<<<<<<<<<< + * start_month = (end_month % 12) + 1 + * else: + */ + __pyx_v_end_month = __pyx_v_month_kw; + + /* "pandas/tslib.pyx":2546 + * else: + * end_month = month_kw + * start_month = (end_month % 12) + 1 # <<<<<<<<<<<<<< + * else: + * end_month = 12 + */ + __pyx_v_start_month = (__Pyx_mod_long(__pyx_v_end_month, 12) + 1); + } + __pyx_L5:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":2548 + * start_month = (end_month % 12) + 1 + * else: + * end_month = 12 # <<<<<<<<<<<<<< + * start_month = 1 + * + */ + __pyx_v_end_month = 12; + + /* "pandas/tslib.pyx":2549 + * else: + * end_month = 12 + * start_month = 1 # <<<<<<<<<<<<<< + * + * if field == 'is_month_start': + */ + __pyx_v_start_month = 1; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2551 + * start_month = 1 + * + * if field == 'is_month_start': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_month_start, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2552 + * + * if field == 'is_month_start': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__pyx_v_is_business != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2553 + * if field == 'is_month_start': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2554 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_20 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L8_continue; + } + + /* "pandas/tslib.pyx":2556 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2557 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * dom = dts.day + * dow = ts_dayofweek(ts) + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2558 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_23 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_23; + + /* "pandas/tslib.pyx":2559 + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if (dom == 1 and dow < 5) or (dom <= 3 and dow == 0): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2561 + * dow = ts_dayofweek(ts) + * + * if (dom == 1 and dow < 5) or (dom <= 3 and dow == 0): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_13 = ((__pyx_v_dom == 1) != 0); + if (__pyx_t_13) { + __pyx_t_15 = ((__pyx_v_dow < 5) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_13; + } + if (!__pyx_t_16) { + __pyx_t_13 = ((__pyx_v_dom <= 3) != 0); + if (__pyx_t_13) { + __pyx_t_15 = ((__pyx_v_dow == 0) != 0); + __pyx_t_14 = __pyx_t_15; + } else { + __pyx_t_14 = __pyx_t_13; + } + __pyx_t_13 = __pyx_t_14; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2562 + * + * if (dom == 1 and dow < 5) or (dom <= 3 and dow == 0): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L11; + } + __pyx_L11:; + __pyx_L8_continue:; + } + + /* "pandas/tslib.pyx":2563 + * if (dom == 1 and dow < 5) or (dom <= 3 and dow == 0): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2565 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2566 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_26 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L12_continue; + } + + /* "pandas/tslib.pyx":2568 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dom = dts.day + * + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2569 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * dom = dts.day # <<<<<<<<<<<<<< + * + * if dom == 1: + */ + __pyx_t_23 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_23; + + /* "pandas/tslib.pyx":2571 + * dom = dts.day + * + * if dom == 1: # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_13 = ((__pyx_v_dom == 1) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2572 + * + * if dom == 1: + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L15; + } + __pyx_L15:; + __pyx_L12_continue:; + } + + /* "pandas/tslib.pyx":2573 + * if dom == 1: + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_month_end': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2575 + * return out.view(bool) + * + * elif field == 'is_month_end': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_month_end, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2576 + * + * elif field == 'is_month_end': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__pyx_v_is_business != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2577 + * elif field == 'is_month_end': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2578 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_30 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L17_continue; + } + + /* "pandas/tslib.pyx":2580 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2581 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2582 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2583 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_13 = __pyx_v_isleap; + __pyx_t_17 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_17 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2584 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_23 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_23; + + /* "pandas/tslib.pyx":2585 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * dow = ts_dayofweek(ts) + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2586 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_16 = __pyx_v_isleap; + __pyx_t_23 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_23 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2587 + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if (ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2)): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2589 + * dow = ts_dayofweek(ts) + * + * if (ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2)): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_14 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + if (__pyx_t_14) { + __pyx_t_15 = ((__pyx_v_dow < 5) != 0); + __pyx_t_33 = __pyx_t_15; + } else { + __pyx_t_33 = __pyx_t_14; + } + if (!__pyx_t_33) { + __pyx_t_14 = ((__pyx_v_dow == 4) != 0); + if (__pyx_t_14) { + __pyx_t_15 = (((__pyx_v_ldom - __pyx_v_doy) <= 2) != 0); + __pyx_t_34 = __pyx_t_15; + } else { + __pyx_t_34 = __pyx_t_14; + } + __pyx_t_14 = __pyx_t_34; + } else { + __pyx_t_14 = __pyx_t_33; + } + if (__pyx_t_14) { + + /* "pandas/tslib.pyx":2590 + * + * if (ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2)): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L20; + } + __pyx_L20:; + __pyx_L17_continue:; + } + + /* "pandas/tslib.pyx":2591 + * if (ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2)): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2593 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2594 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_14) { + __pyx_t_37 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L21_continue; + } + + /* "pandas/tslib.pyx":2596 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2597 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2598 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_14 = __pyx_v_isleap; + __pyx_t_39 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2599 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_40 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_40; + + /* "pandas/tslib.pyx":2600 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2601 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * + * if ldom == doy: + */ + __pyx_t_33 = __pyx_v_isleap; + __pyx_t_40 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_40 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2603 + * ldom = _month_offset[isleap, dts.month] + * + * if ldom == doy: # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_34 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + if (__pyx_t_34) { + + /* "pandas/tslib.pyx":2604 + * + * if ldom == doy: + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_41 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L24; + } + __pyx_L24:; + __pyx_L21_continue:; + } + + /* "pandas/tslib.pyx":2605 + * if ldom == doy: + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_quarter_start': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2607 + * return out.view(bool) + * + * elif field == 'is_quarter_start': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_34 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_quarter_start, Py_EQ)); if (unlikely(__pyx_t_34 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_34) { + + /* "pandas/tslib.pyx":2608 + * + * elif field == 'is_quarter_start': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_34 = (__pyx_v_is_business != 0); + if (__pyx_t_34) { + + /* "pandas/tslib.pyx":2609 + * elif field == 'is_quarter_start': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2610 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_34 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_34) { + __pyx_t_43 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_43 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L26_continue; + } + + /* "pandas/tslib.pyx":2612 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + */ + __pyx_t_44 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2613 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * dom = dts.day + * dow = ts_dayofweek(ts) + */ + __pyx_t_45 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_45 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2614 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_46 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_46; + + /* "pandas/tslib.pyx":2615 + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if ((dts.month - start_month) % 3 == 0) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2617 + * dow = ts_dayofweek(ts) + * + * if ((dts.month - start_month) % 3 == 0) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_34 = ((__Pyx_mod_long((__pyx_v_dts.month - __pyx_v_start_month), 3) == 0) != 0); + if (__pyx_t_34) { + __pyx_t_15 = ((__pyx_v_dom == 1) != 0); + if (__pyx_t_15) { + __pyx_t_47 = ((__pyx_v_dow < 5) != 0); + __pyx_t_48 = __pyx_t_47; + } else { + __pyx_t_48 = __pyx_t_15; + } + if (!__pyx_t_48) { + __pyx_t_15 = ((__pyx_v_dom <= 3) != 0); + if (__pyx_t_15) { + __pyx_t_47 = ((__pyx_v_dow == 0) != 0); + __pyx_t_49 = __pyx_t_47; + } else { + __pyx_t_49 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_49; + } else { + __pyx_t_15 = __pyx_t_48; + } + __pyx_t_48 = __pyx_t_15; + } else { + __pyx_t_48 = __pyx_t_34; + } + if (__pyx_t_48) { + + /* "pandas/tslib.pyx":2618 + * + * if ((dts.month - start_month) % 3 == 0) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_50 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L29; + } + __pyx_L29:; + __pyx_L26_continue:; + } + + /* "pandas/tslib.pyx":2619 + * if ((dts.month - start_month) % 3 == 0) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2621 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2622 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_51 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_51 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_48) { + __pyx_t_52 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_52 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L30_continue; + } + + /* "pandas/tslib.pyx":2624 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dom = dts.day + * + */ + __pyx_t_53 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_53 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2625 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * dom = dts.day # <<<<<<<<<<<<<< + * + * if ((dts.month - start_month) % 3 == 0) and dom == 1: + */ + __pyx_t_46 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_46; + + /* "pandas/tslib.pyx":2627 + * dom = dts.day + * + * if ((dts.month - start_month) % 3 == 0) and dom == 1: # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_48 = ((__Pyx_mod_long((__pyx_v_dts.month - __pyx_v_start_month), 3) == 0) != 0); + if (__pyx_t_48) { + __pyx_t_34 = ((__pyx_v_dom == 1) != 0); + __pyx_t_15 = __pyx_t_34; + } else { + __pyx_t_15 = __pyx_t_48; + } + if (__pyx_t_15) { + + /* "pandas/tslib.pyx":2628 + * + * if ((dts.month - start_month) % 3 == 0) and dom == 1: + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_54 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_54 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L33; + } + __pyx_L33:; + __pyx_L30_continue:; + } + + /* "pandas/tslib.pyx":2629 + * if ((dts.month - start_month) % 3 == 0) and dom == 1: + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_quarter_end': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2631 + * return out.view(bool) + * + * elif field == 'is_quarter_end': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_quarter_end, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_15) { + + /* "pandas/tslib.pyx":2632 + * + * elif field == 'is_quarter_end': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_15 = (__pyx_v_is_business != 0); + if (__pyx_t_15) { + + /* "pandas/tslib.pyx":2633 + * elif field == 'is_quarter_end': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2634 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_55 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_55 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_15) { + __pyx_t_56 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_56 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L35_continue; + } + + /* "pandas/tslib.pyx":2636 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_57 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_57 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2637 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_58 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_58 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2638 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2639 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_15 = __pyx_v_isleap; + __pyx_t_59 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_59 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2640 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_46 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_46; + + /* "pandas/tslib.pyx":2641 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * dow = ts_dayofweek(ts) + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2642 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_48 = __pyx_v_isleap; + __pyx_t_46 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_46 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2643 + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if ((dts.month - end_month) % 3 == 0) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2645 + * dow = ts_dayofweek(ts) + * + * if ((dts.month - end_month) % 3 == 0) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_34 = ((__Pyx_mod_long((__pyx_v_dts.month - __pyx_v_end_month), 3) == 0) != 0); + if (__pyx_t_34) { + __pyx_t_49 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + if (__pyx_t_49) { + __pyx_t_47 = ((__pyx_v_dow < 5) != 0); + __pyx_t_60 = __pyx_t_47; + } else { + __pyx_t_60 = __pyx_t_49; + } + if (!__pyx_t_60) { + __pyx_t_49 = ((__pyx_v_dow == 4) != 0); + if (__pyx_t_49) { + __pyx_t_47 = (((__pyx_v_ldom - __pyx_v_doy) <= 2) != 0); + __pyx_t_61 = __pyx_t_47; + } else { + __pyx_t_61 = __pyx_t_49; + } + __pyx_t_49 = __pyx_t_61; + } else { + __pyx_t_49 = __pyx_t_60; + } + __pyx_t_60 = __pyx_t_49; + } else { + __pyx_t_60 = __pyx_t_34; + } + if (__pyx_t_60) { + + /* "pandas/tslib.pyx":2646 + * + * if ((dts.month - end_month) % 3 == 0) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_62 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_62 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L38; + } + __pyx_L38:; + __pyx_L35_continue:; + } + + /* "pandas/tslib.pyx":2647 + * if ((dts.month - end_month) % 3 == 0) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2649 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2650 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_63 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_63 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_60 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_60) { + __pyx_t_64 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_64 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L39_continue; + } + + /* "pandas/tslib.pyx":2652 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_65 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_65 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2653 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2654 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_60 = __pyx_v_isleap; + __pyx_t_66 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_60 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_66 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_66, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2655 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_67 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_67; + + /* "pandas/tslib.pyx":2656 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2657 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * + * if ((dts.month - end_month) % 3 == 0) and (ldom == doy): + */ + __pyx_t_34 = __pyx_v_isleap; + __pyx_t_67 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_67 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2659 + * ldom = _month_offset[isleap, dts.month] + * + * if ((dts.month - end_month) % 3 == 0) and (ldom == doy): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_49 = ((__Pyx_mod_long((__pyx_v_dts.month - __pyx_v_end_month), 3) == 0) != 0); + if (__pyx_t_49) { + __pyx_t_61 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + __pyx_t_47 = __pyx_t_61; + } else { + __pyx_t_47 = __pyx_t_49; + } + if (__pyx_t_47) { + + /* "pandas/tslib.pyx":2660 + * + * if ((dts.month - end_month) % 3 == 0) and (ldom == doy): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_68 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_68 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_68, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L42; + } + __pyx_L42:; + __pyx_L39_continue:; + } + + /* "pandas/tslib.pyx":2661 + * if ((dts.month - end_month) % 3 == 0) and (ldom == doy): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_year_start': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2663 + * return out.view(bool) + * + * elif field == 'is_year_start': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_47 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_year_start, Py_EQ)); if (unlikely(__pyx_t_47 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_47) { + + /* "pandas/tslib.pyx":2664 + * + * elif field == 'is_year_start': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_47 = (__pyx_v_is_business != 0); + if (__pyx_t_47) { + + /* "pandas/tslib.pyx":2665 + * elif field == 'is_year_start': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2666 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_69 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_69 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_47 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_47) { + __pyx_t_70 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_70 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L44_continue; + } + + /* "pandas/tslib.pyx":2668 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + */ + __pyx_t_71 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_71 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2669 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * dom = dts.day + * dow = ts_dayofweek(ts) + */ + __pyx_t_72 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_72 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2670 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_73 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_73; + + /* "pandas/tslib.pyx":2671 + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if (dts.month == start_month) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2673 + * dow = ts_dayofweek(ts) + * + * if (dts.month == start_month) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_47 = ((__pyx_v_dts.month == __pyx_v_start_month) != 0); + if (__pyx_t_47) { + __pyx_t_49 = ((__pyx_v_dom == 1) != 0); + if (__pyx_t_49) { + __pyx_t_61 = ((__pyx_v_dow < 5) != 0); + __pyx_t_74 = __pyx_t_61; + } else { + __pyx_t_74 = __pyx_t_49; + } + if (!__pyx_t_74) { + __pyx_t_49 = ((__pyx_v_dom <= 3) != 0); + if (__pyx_t_49) { + __pyx_t_61 = ((__pyx_v_dow == 0) != 0); + __pyx_t_75 = __pyx_t_61; + } else { + __pyx_t_75 = __pyx_t_49; + } + __pyx_t_49 = __pyx_t_75; + } else { + __pyx_t_49 = __pyx_t_74; + } + __pyx_t_74 = __pyx_t_49; + } else { + __pyx_t_74 = __pyx_t_47; + } + if (__pyx_t_74) { + + /* "pandas/tslib.pyx":2674 + * + * if (dts.month == start_month) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_76 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_76 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_76 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_76, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L47; + } + __pyx_L47:; + __pyx_L44_continue:; + } + + /* "pandas/tslib.pyx":2675 + * if (dts.month == start_month) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2677 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2678 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_77 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_77 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_77 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_74 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_77, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_74) { + __pyx_t_78 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_78 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_78 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L48_continue; + } + + /* "pandas/tslib.pyx":2680 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dom = dts.day + * + */ + __pyx_t_79 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_79 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_79 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2681 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * dom = dts.day # <<<<<<<<<<<<<< + * + * if (dts.month == start_month) and dom == 1: + */ + __pyx_t_73 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_73; + + /* "pandas/tslib.pyx":2683 + * dom = dts.day + * + * if (dts.month == start_month) and dom == 1: # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_74 = ((__pyx_v_dts.month == __pyx_v_start_month) != 0); + if (__pyx_t_74) { + __pyx_t_47 = ((__pyx_v_dom == 1) != 0); + __pyx_t_49 = __pyx_t_47; + } else { + __pyx_t_49 = __pyx_t_74; + } + if (__pyx_t_49) { + + /* "pandas/tslib.pyx":2684 + * + * if (dts.month == start_month) and dom == 1: + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_80 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_80 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_80 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_80, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L51; + } + __pyx_L51:; + __pyx_L48_continue:; + } + + /* "pandas/tslib.pyx":2685 + * if (dts.month == start_month) and dom == 1: + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_year_end': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2687 + * return out.view(bool) + * + * elif field == 'is_year_end': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_49 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_year_end, Py_EQ)); if (unlikely(__pyx_t_49 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_49) { + + /* "pandas/tslib.pyx":2688 + * + * elif field == 'is_year_end': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_49 = (__pyx_v_is_business != 0); + if (__pyx_t_49) { + + /* "pandas/tslib.pyx":2689 + * elif field == 'is_year_end': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2690 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_81 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_81 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_81 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_49 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_81, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_49) { + __pyx_t_82 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_82 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_82 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L53_continue; + } + + /* "pandas/tslib.pyx":2692 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_83 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_83 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_83 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_83, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2693 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * dom = dts.day + */ + __pyx_t_84 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_84 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_84 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_84, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2694 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * dom = dts.day + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2695 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * dom = dts.day # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dom + */ + __pyx_t_73 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_73; + + /* "pandas/tslib.pyx":2696 + * isleap = is_leapyear(dts.year) + * dom = dts.day + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * doy = mo_off + dom + * dow = ts_dayofweek(ts) + */ + __pyx_t_49 = __pyx_v_isleap; + __pyx_t_85 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_49 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_85 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_85 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_85, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2697 + * dom = dts.day + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dom # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2698 + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dom + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2699 + * doy = mo_off + dom + * dow = ts_dayofweek(ts) + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * + * if (dts.month == end_month) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + */ + __pyx_t_74 = __pyx_v_isleap; + __pyx_t_73 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_74 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_74 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_73 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_74, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_73, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2701 + * ldom = _month_offset[isleap, dts.month] + * + * if (dts.month == end_month) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_47 = ((__pyx_v_dts.month == __pyx_v_end_month) != 0); + if (__pyx_t_47) { + __pyx_t_75 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + if (__pyx_t_75) { + __pyx_t_61 = ((__pyx_v_dow < 5) != 0); + __pyx_t_86 = __pyx_t_61; + } else { + __pyx_t_86 = __pyx_t_75; + } + if (!__pyx_t_86) { + __pyx_t_75 = ((__pyx_v_dow == 4) != 0); + if (__pyx_t_75) { + __pyx_t_61 = (((__pyx_v_ldom - __pyx_v_doy) <= 2) != 0); + __pyx_t_87 = __pyx_t_61; + } else { + __pyx_t_87 = __pyx_t_75; + } + __pyx_t_75 = __pyx_t_87; + } else { + __pyx_t_75 = __pyx_t_86; + } + __pyx_t_86 = __pyx_t_75; + } else { + __pyx_t_86 = __pyx_t_47; + } + if (__pyx_t_86) { + + /* "pandas/tslib.pyx":2702 + * + * if (dts.month == end_month) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_88 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_88 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_88 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_88, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L56; + } + __pyx_L56:; + __pyx_L53_continue:; + } + + /* "pandas/tslib.pyx":2703 + * if (dts.month == end_month) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2705 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2706 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_89 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_89 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_89 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_86 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_89, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_86) { + __pyx_t_90 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_90 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_90 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_90, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L57_continue; + } + + /* "pandas/tslib.pyx":2708 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_91 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_91 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_91 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_91, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2709 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_92 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_92 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_92 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_92, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2710 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2711 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_86 = __pyx_v_isleap; + __pyx_t_93 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_86 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_86 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_93 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_93 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_93, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2712 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_94 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_94; + + /* "pandas/tslib.pyx":2713 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2714 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * + * if (dts.month == end_month) and (ldom == doy): + */ + __pyx_t_47 = __pyx_v_isleap; + __pyx_t_94 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_47 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_94 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_94 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_94, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2716 + * ldom = _month_offset[isleap, dts.month] + * + * if (dts.month == end_month) and (ldom == doy): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_75 = ((__pyx_v_dts.month == __pyx_v_end_month) != 0); + if (__pyx_t_75) { + __pyx_t_87 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + __pyx_t_61 = __pyx_t_87; + } else { + __pyx_t_61 = __pyx_t_75; + } + if (__pyx_t_61) { + + /* "pandas/tslib.pyx":2717 + * + * if (dts.month == end_month) and (ldom == doy): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_95 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_95 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_95 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_95, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L60; + } + __pyx_L60:; + __pyx_L57_continue:; + } + + /* "pandas/tslib.pyx":2718 + * if (dts.month == end_month) and (ldom == doy): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * raise ValueError("Field %s not supported" % field) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2720 + * return out.view(bool) + * + * raise ValueError("Field %s not supported" % field) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Field_s_not_supported, __pyx_v_field); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2505 + * + * @cython.wraparound(False) + * def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=None, int month_kw=12): # <<<<<<<<<<<<<< + * ''' + * Given an int64-based datetime index return array of indicators + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.get_start_end_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XDECREF((PyObject *)__pyx_v__month_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2723 + * + * + * cdef inline int m8_weekday(int64_t val): # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(val, None, None) + * return ts_dayofweek(ts) + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib_m8_weekday(__pyx_t_5numpy_int64_t __pyx_v_val) { + PyObject *__pyx_v_ts = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("m8_weekday", 0); + + /* "pandas/tslib.pyx":2724 + * + * cdef inline int m8_weekday(int64_t val): + * ts = convert_to_tsobject(val, None, None) # <<<<<<<<<<<<<< + * return ts_dayofweek(ts) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_ts = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2725 + * cdef inline int m8_weekday(int64_t val): + * ts = convert_to_tsobject(val, None, None) + * return ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * cdef int64_t DAY_NS = 86400000000000LL + */ + if (!(likely(((__pyx_v_ts) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ts, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_f_6pandas_5tslib_ts_dayofweek(((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_v_ts)); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2723 + * + * + * cdef inline int m8_weekday(int64_t val): # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(val, None, None) + * return ts_dayofweek(ts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.tslib.m8_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ts); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2730 + * + * + * def date_normalize(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_65date_normalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_65date_normalize = {__Pyx_NAMESTR("date_normalize"), (PyCFunction)__pyx_pw_6pandas_5tslib_65date_normalize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_65date_normalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_stamps = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("date_normalize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "date_normalize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_stamps = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("date_normalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.date_normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_64date_normalize(__pyx_self, __pyx_v_stamps, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_64date_normalize(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + CYTHON_UNUSED struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_tso = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("date_normalize", 0); + __Pyx_INCREF(__pyx_v_tz); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2732 + * def date_normalize(ndarray[int64_t] stamps, tz=None): + * cdef: + * Py_ssize_t i, n = len(stamps) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * _TSObject tso + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2735 + * pandas_datetimestruct dts + * _TSObject tso + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2737 + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) + * + * if tz is not None: # <<<<<<<<<<<<<< + * tso = _TSObject() + * tz = maybe_get_tz(tz) + */ + __pyx_t_8 = (__pyx_v_tz != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2738 + * + * if tz is not None: + * tso = _TSObject() # <<<<<<<<<<<<<< + * tz = maybe_get_tz(tz) + * result = _normalize_local(stamps, tz) + */ + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__TSObject)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_tso = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2739 + * if tz is not None: + * tso = _TSObject() + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * result = _normalize_local(stamps, tz) + * else: + */ + __pyx_t_6 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2740 + * tso = _TSObject() + * tz = maybe_get_tz(tz) + * result = _normalize_local(stamps, tz) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_6 = __pyx_f_6pandas_5tslib__normalize_local(((PyArrayObject *)__pyx_v_stamps), __pyx_v_tz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_6)); + __pyx_t_6 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":2742 + * result = _normalize_local(stamps, tz) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_1; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2743 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2744 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2745 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":2746 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2747 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L4_continue:; + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2749 + * result[i] = _normalized_stamp(&dts) + * + * return result # <<<<<<<<<<<<<< + * + * cdef _normalize_local(ndarray[int64_t] stamps, object tz): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2730 + * + * + * def date_normalize(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.date_normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_tso); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2751 + * return result + * + * cdef _normalize_local(ndarray[int64_t] stamps, object tz): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t n = len(stamps) + */ + +static PyObject *__pyx_f_6pandas_5tslib__normalize_local(PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + PyArrayObject *__pyx_v_pos = 0; + pandas_datetimestruct __pyx_v_dts; + Py_ssize_t __pyx_v_i; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v__pos = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_pos; + __Pyx_Buffer __pyx_pybuffer_pos; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + Py_ssize_t __pyx_t_21; + npy_datetime __pyx_t_22; + Py_ssize_t __pyx_t_23; + PyArrayObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + PyObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + int __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + __pyx_t_5numpy_int64_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_normalize_local", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_pos.pybuffer.buf = NULL; + __pyx_pybuffer_pos.refcount = 0; + __pyx_pybuffernd_pos.data = NULL; + __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2753 + * cdef _normalize_local(ndarray[int64_t] stamps, object tz): + * cdef: + * Py_ssize_t n = len(stamps) # <<<<<<<<<<<<<< + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) + * ndarray[int64_t] trans, deltas, pos + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2754 + * cdef: + * Py_ssize_t n = len(stamps) + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * ndarray[int64_t] trans, deltas, pos + * pandas_datetimestruct dts + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2758 + * pandas_datetimestruct dts + * + * if _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_8 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2759 + * + * if _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":2760 + * if _is_utc(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2761 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2762 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":2763 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * elif _is_tzlocal(tz): + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2764 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz): + * for i in range(n): + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L4_continue:; + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":2765 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_8 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2766 + * result[i] = _normalized_stamp(&dts) + * elif _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":2767 + * elif _is_tzlocal(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2768 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2769 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + */ + goto __pyx_L7_continue; + } + + /* "pandas/tslib.pyx":2770 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, # <<<<<<<<<<<<<< + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2771 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2772 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":2773 + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_18 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + + /* "pandas/tslib.pyx":2772 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_20 = PyTuple_New(8); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_20, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_20, 5, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_20, 6, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_20, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_18 = 0; + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_19)); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2774 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + */ + __pyx_t_19 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_19)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_19, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Multiply(__pyx_t_20, __pyx_int_1000000000); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_19); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2775 + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_t_19, __pyx_v_delta); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_22 = __Pyx_PyInt_As_npy_int64(__pyx_t_20); if (unlikely((__pyx_t_22 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2776 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * else: + */ + pandas_datetime_to_datetimestruct(__pyx_t_22, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2777 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L7_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":2780 + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + */ + __pyx_t_20 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2781 + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + */ + __pyx_t_20 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2782 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 # <<<<<<<<<<<<<< + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + */ + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_INCREF(((PyObject *)__pyx_v_stamps)); + PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_v_stamps)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_stamps)); + __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, __pyx_t_18); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyNumber_Subtract(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v__pos = __pyx_t_18; + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2783 + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: # <<<<<<<<<<<<<< + * _pos = _pos.astype(np.int64) + * pos = _pos + */ + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_dtype); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_18, __pyx_t_19, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2784 + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) # <<<<<<<<<<<<<< + * pos = _pos + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_int64); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_19, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF_SET(__pyx_v__pos, __pyx_t_18); + __pyx_t_18 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/tslib.pyx":2785 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + * pos = _pos # <<<<<<<<<<<<<< + * + * # statictzinfo + */ + if (!(likely(((__pyx_v__pos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__pos, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_v__pos; + __Pyx_INCREF(__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_18), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27); + } + } + __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_pos = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2788 + * + * # statictzinfo + * if not hasattr(tz, '_transition_info'): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_8 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_28 = ((!(__pyx_t_8 != 0)) != 0); + if (__pyx_t_28) { + + /* "pandas/tslib.pyx":2789 + * # statictzinfo + * if not hasattr(tz, '_transition_info'): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":2790 + * if not hasattr(tz, '_transition_info'): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_28) { + + /* "pandas/tslib.pyx":2791 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2792 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L12_continue; + } + + /* "pandas/tslib.pyx":2793 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = 0; + __pyx_t_11 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2794 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * else: + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2795 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L12_continue:; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/tslib.pyx":2797 + * result[i] = _normalized_stamp(&dts) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":2798 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_28) { + + /* "pandas/tslib.pyx":2799 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2800 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L15_continue; + } + + /* "pandas/tslib.pyx":2801 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_37 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_pos.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_38 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_pos.diminfo[0].strides)); + __pyx_t_11 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2802 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2803 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L15_continue:; + } + } + __pyx_L11:; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2805 + * result[i] = _normalized_stamp(&dts) + * + * return result # <<<<<<<<<<<<<< + * + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2751 + * return result + * + * cdef _normalize_local(ndarray[int64_t] stamps, object tz): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib._normalize_local", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF((PyObject *)__pyx_v_pos); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v__pos); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2807 + * return result + * + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.hour = 0 + * dts.min = 0 + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib__normalized_stamp(pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_normalized_stamp", 0); + + /* "pandas/tslib.pyx":2808 + * + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): + * dts.hour = 0 # <<<<<<<<<<<<<< + * dts.min = 0 + * dts.sec = 0 + */ + __pyx_v_dts->hour = 0; + + /* "pandas/tslib.pyx":2809 + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): + * dts.hour = 0 + * dts.min = 0 # <<<<<<<<<<<<<< + * dts.sec = 0 + * dts.us = 0 + */ + __pyx_v_dts->min = 0; + + /* "pandas/tslib.pyx":2810 + * dts.hour = 0 + * dts.min = 0 + * dts.sec = 0 # <<<<<<<<<<<<<< + * dts.us = 0 + * dts.ps = 0 + */ + __pyx_v_dts->sec = 0; + + /* "pandas/tslib.pyx":2811 + * dts.min = 0 + * dts.sec = 0 + * dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = 0; + + /* "pandas/tslib.pyx":2812 + * dts.sec = 0 + * dts.us = 0 + * dts.ps = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + + /* "pandas/tslib.pyx":2813 + * dts.us = 0 + * dts.ps = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2807 + * return result + * + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.hour = 0 + * dts.min = 0 + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2816 + * + * + * cdef inline void m8_populate_tsobject(int64_t stamp, _TSObject tso, object tz): # <<<<<<<<<<<<<< + * tso.value = stamp + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) + */ + +static CYTHON_INLINE void __pyx_f_6pandas_5tslib_m8_populate_tsobject(__pyx_t_5numpy_int64_t __pyx_v_stamp, struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_tso, PyObject *__pyx_v_tz) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("m8_populate_tsobject", 0); + + /* "pandas/tslib.pyx":2817 + * + * cdef inline void m8_populate_tsobject(int64_t stamp, _TSObject tso, object tz): + * tso.value = stamp # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) + * + */ + __pyx_v_tso->value = __pyx_v_stamp; + + /* "pandas/tslib.pyx":2818 + * cdef inline void m8_populate_tsobject(int64_t stamp, _TSObject tso, object tz): + * tso.value = stamp + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + pandas_datetime_to_datetimestruct(__pyx_v_tso->value, PANDAS_FR_ns, (&__pyx_v_tso->dts)); + + /* "pandas/tslib.pyx":2820 + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) + * + * if tz is not None: # <<<<<<<<<<<<<< + * _localize_tso(tso, tz) + * + */ + __pyx_t_1 = (__pyx_v_tz != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2821 + * + * if tz is not None: + * _localize_tso(tso, tz) # <<<<<<<<<<<<<< + * + * + */ + __pyx_f_6pandas_5tslib__localize_tso(__pyx_v_tso, __pyx_v_tz); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2816 + * + * + * cdef inline void m8_populate_tsobject(int64_t stamp, _TSObject tso, object tz): # <<<<<<<<<<<<<< + * tso.value = stamp + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/tslib.pyx":2824 + * + * + * def dates_normalized(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_67dates_normalized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_67dates_normalized = {__Pyx_NAMESTR("dates_normalized"), (PyCFunction)__pyx_pw_6pandas_5tslib_67dates_normalized, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_67dates_normalized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_stamps = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dates_normalized (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dates_normalized") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_stamps = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dates_normalized", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.dates_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_66dates_normalized(__pyx_self, __pyx_v_stamps, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_66dates_normalized(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_v_dt = NULL; + PyObject *__pyx_v_trans = NULL; + PyObject *__pyx_v_deltas = NULL; + PyObject *__pyx_v_pos = NULL; + CYTHON_UNUSED PyObject *__pyx_v_inf = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + npy_datetime __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dates_normalized", 0); + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2826 + * def dates_normalized(ndarray[int64_t] stamps, tz=None): + * cdef: + * Py_ssize_t i, n = len(stamps) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2829 + * pandas_datetimestruct dts + * + * if tz is None or _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_2 = (__pyx_v_tz == Py_None); + if (!(__pyx_t_2 != 0)) { + __pyx_t_3 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = (__pyx_t_2 != 0); + } + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2830 + * + * if tz is None or _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":2831 + * if tz is None or _is_utc(tz): + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2832 + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: # <<<<<<<<<<<<<< + * return False + * elif _is_tzlocal(tz): + */ + __pyx_t_4 = (((((__pyx_v_dts.hour + __pyx_v_dts.min) + __pyx_v_dts.sec) + __pyx_v_dts.us) > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2833 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz): + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":2834 + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2835 + * return False + * elif _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.min + dts.sec + dts.us) > 0: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":2836 + * elif _is_tzlocal(tz): + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * if (dts.min + dts.sec + dts.us) > 0: + * return False + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2837 + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.min + dts.sec + dts.us) > 0: # <<<<<<<<<<<<<< + * return False + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, + */ + __pyx_t_4 = ((((__pyx_v_dts.min + __pyx_v_dts.sec) + __pyx_v_dts.us) > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2838 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.min + dts.sec + dts.us) > 0: + * return False # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, + * dts.sec, dts.us, tz) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2839 + * if (dts.min + dts.sec + dts.us) > 0: + * return False + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, # <<<<<<<<<<<<<< + * dts.sec, dts.us, tz) + * dt = dt + tz.utcoffset(dt) + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + + /* "pandas/tslib.pyx":2840 + * return False + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, + * dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * dt = dt + tz.utcoffset(dt) + * if dt.hour > 0: + */ + __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/tslib.pyx":2839 + * if (dts.min + dts.sec + dts.us) > 0: + * return False + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, # <<<<<<<<<<<<<< + * dts.sec, dts.us, tz) + * dt = dt + tz.utcoffset(dt) + */ + __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_15); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":2841 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, + * dts.sec, dts.us, tz) + * dt = dt + tz.utcoffset(dt) # <<<<<<<<<<<<<< + * if dt.hour > 0: + * return False + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_dt); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_dt); + __Pyx_GIVEREF(__pyx_v_dt); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_16, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyNumber_Add(__pyx_v_dt, __pyx_t_14); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":2842 + * dts.sec, dts.us, tz) + * dt = dt + tz.utcoffset(dt) + * if dt.hour > 0: # <<<<<<<<<<<<<< + * return False + * else: + */ + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_hour); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_14 = PyObject_RichCompare(__pyx_t_16, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2843 + * dt = dt + tz.utcoffset(dt) + * if dt.hour > 0: + * return False # <<<<<<<<<<<<<< + * else: + * trans = _get_transitions(tz) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":2845 + * return False + * else: + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * for i in range(n): + */ + __pyx_t_14 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_v_trans = __pyx_t_14; + __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":2846 + * else: + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * for i in range(n): + * # Adjust datetime64 timestamp, recompute datetimestruct + */ + __pyx_t_14 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_v_deltas = __pyx_t_14; + __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":2847 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * for i in range(n): # <<<<<<<<<<<<<< + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(stamps[i]) - 1 + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":2849 + * for i in range(n): + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(stamps[i]) - 1 # <<<<<<<<<<<<<< + * inf = tz._transition_info[pos] + * + */ + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_15); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":2850 + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(stamps[i]) - 1 + * inf = tz._transition_info[pos] # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos], + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyObject_GetItem(__pyx_t_15, __pyx_v_pos); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_inf, __pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":2852 + * inf = tz._transition_info[pos] + * + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = PyNumber_Add(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_14); if (unlikely((__pyx_t_19 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":2853 + * + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False + */ + pandas_datetime_to_datetimestruct(__pyx_t_19, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2854 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos], + * PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_4 = (((((__pyx_v_dts.hour + __pyx_v_dts.min) + __pyx_v_dts.sec) + __pyx_v_dts.us) > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2855 + * PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False # <<<<<<<<<<<<<< + * + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2857 + * return False + * + * return True # <<<<<<<<<<<<<< + * + * # Some general helper functions + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2824 + * + * + * def dates_normalized(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.dates_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_trans); + __Pyx_XDECREF(__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pos); + __Pyx_XDECREF(__pyx_v_inf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2862 + * #---------------------------------------------------------------------- + * + * def isleapyear(int64_t year): # <<<<<<<<<<<<<< + * return is_leapyear(year) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_69isleapyear(PyObject *__pyx_self, PyObject *__pyx_arg_year); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_69isleapyear = {__Pyx_NAMESTR("isleapyear"), (PyCFunction)__pyx_pw_6pandas_5tslib_69isleapyear, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_69isleapyear(PyObject *__pyx_self, PyObject *__pyx_arg_year) { + __pyx_t_5numpy_int64_t __pyx_v_year; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isleapyear (wrapper)", 0); + assert(__pyx_arg_year); { + __pyx_v_year = __Pyx_PyInt_As_npy_int64(__pyx_arg_year); if (unlikely((__pyx_v_year == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.isleapyear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_68isleapyear(__pyx_self, ((__pyx_t_5numpy_int64_t)__pyx_v_year)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_68isleapyear(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_year) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isleapyear", 0); + + /* "pandas/tslib.pyx":2863 + * + * def isleapyear(int64_t year): + * return is_leapyear(year) # <<<<<<<<<<<<<< + * + * def monthrange(int64_t year, int64_t month): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_leapyear(__pyx_v_year)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2862 + * #---------------------------------------------------------------------- + * + * def isleapyear(int64_t year): # <<<<<<<<<<<<<< + * return is_leapyear(year) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.isleapyear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2865 + * return is_leapyear(year) + * + * def monthrange(int64_t year, int64_t month): # <<<<<<<<<<<<<< + * cdef: + * int64_t days + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_71monthrange(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_71monthrange = {__Pyx_NAMESTR("monthrange"), (PyCFunction)__pyx_pw_6pandas_5tslib_71monthrange, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_71monthrange(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_year; + __pyx_t_5numpy_int64_t __pyx_v_month; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("monthrange (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_year,&__pyx_n_s_month,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_year)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_month)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("monthrange", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monthrange") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_year = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_year == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_month = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_month == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("monthrange", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.monthrange", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_70monthrange(__pyx_self, __pyx_v_year, __pyx_v_month); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_70monthrange(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_year, __pyx_t_5numpy_int64_t __pyx_v_month) { + __pyx_t_5numpy_int64_t __pyx_v_days; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("monthrange", 0); + + /* "pandas/tslib.pyx":2870 + * int64_t day_of_week + * + * if month < 1 or month > 12: # <<<<<<<<<<<<<< + * raise ValueError("bad month number 0; must be 1-12") + * + */ + __pyx_t_1 = ((__pyx_v_month < 1) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_month > 12) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2871 + * + * if month < 1 or month > 12: + * raise ValueError("bad month number 0; must be 1-12") # <<<<<<<<<<<<<< + * + * days = days_per_month_table[is_leapyear(year)][month-1] + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2873 + * raise ValueError("bad month number 0; must be 1-12") + * + * days = days_per_month_table[is_leapyear(year)][month-1] # <<<<<<<<<<<<<< + * + * return (dayofweek(year, month, 1), days) + */ + __pyx_v_days = ((days_per_month_table[is_leapyear(__pyx_v_year)])[(__pyx_v_month - 1)]); + + /* "pandas/tslib.pyx":2875 + * days = days_per_month_table[is_leapyear(year)][month-1] + * + * return (dayofweek(year, month, 1), days) # <<<<<<<<<<<<<< + * + * cdef inline int64_t ts_dayofweek(_TSObject ts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyInt_From_int(dayofweek(__pyx_v_year, __pyx_v_month, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_days); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2865 + * return is_leapyear(year) + * + * def monthrange(int64_t year, int64_t month): # <<<<<<<<<<<<<< + * cdef: + * int64_t days + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.monthrange", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2877 + * return (dayofweek(year, month, 1), days) + * + * cdef inline int64_t ts_dayofweek(_TSObject ts): # <<<<<<<<<<<<<< + * return dayofweek(ts.dts.year, ts.dts.month, ts.dts.day) + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_ts_dayofweek(struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ts_dayofweek", 0); + + /* "pandas/tslib.pyx":2878 + * + * cdef inline int64_t ts_dayofweek(_TSObject ts): + * return dayofweek(ts.dts.year, ts.dts.month, ts.dts.day) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = dayofweek(__pyx_v_ts->dts.year, __pyx_v_ts->dts.month, __pyx_v_ts->dts.day); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2877 + * return (dayofweek(year, month, 1), days) + * + * cdef inline int64_t ts_dayofweek(_TSObject ts): # <<<<<<<<<<<<<< + * return dayofweek(ts.dts.year, ts.dts.month, ts.dts.day) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2881 + * + * + * cpdef normalize_date(object dt): # <<<<<<<<<<<<<< + * ''' + * Normalize datetime.datetime value to midnight. Returns datetime.date as a + */ + +static PyObject *__pyx_pw_6pandas_5tslib_73normalize_date(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_normalize_date(PyObject *__pyx_v_dt, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("normalize_date", 0); + + /* "pandas/tslib.pyx":2890 + * normalized : datetime.datetime or Timestamp + * ''' + * if PyDateTime_Check(dt): # <<<<<<<<<<<<<< + * return dt.replace(hour=0, minute=0, second=0, microsecond=0) + * elif PyDate_Check(dt): + */ + __pyx_t_1 = (PyDateTime_Check(__pyx_v_dt) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2891 + * ''' + * if PyDateTime_Check(dt): + * return dt.replace(hour=0, minute=0, second=0, microsecond=0) # <<<<<<<<<<<<<< + * elif PyDate_Check(dt): + * return datetime(dt.year, dt.month, dt.day) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hour, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_minute, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_second, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_microsecond, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2892 + * if PyDateTime_Check(dt): + * return dt.replace(hour=0, minute=0, second=0, microsecond=0) + * elif PyDate_Check(dt): # <<<<<<<<<<<<<< + * return datetime(dt.year, dt.month, dt.day) + * else: + */ + __pyx_t_1 = (PyDate_Check(__pyx_v_dt) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2893 + * return dt.replace(hour=0, minute=0, second=0, microsecond=0) + * elif PyDate_Check(dt): + * return datetime(dt.year, dt.month, dt.day) # <<<<<<<<<<<<<< + * else: + * raise TypeError('Unrecognized type: %s' % type(dt)) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_month); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_day); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2895 + * return datetime(dt.year, dt.month, dt.day) + * else: + * raise TypeError('Unrecognized type: %s' % type(dt)) # <<<<<<<<<<<<<< + * + * cdef ndarray[int64_t] localize_dt64arr_to_period(ndarray[int64_t] stamps, + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_type_s, ((PyObject *)Py_TYPE(__pyx_v_dt))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2881 + * + * + * cpdef normalize_date(object dt): # <<<<<<<<<<<<<< + * ''' + * Normalize datetime.datetime value to midnight. Returns datetime.date as a + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.normalize_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_73normalize_date(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/ +static char __pyx_doc_6pandas_5tslib_72normalize_date[] = "\n Normalize datetime.datetime value to midnight. Returns datetime.date as a\n datetime.datetime at midnight\n\n Returns\n -------\n normalized : datetime.datetime or Timestamp\n "; +static PyObject *__pyx_pw_6pandas_5tslib_73normalize_date(PyObject *__pyx_self, PyObject *__pyx_v_dt) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("normalize_date (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_72normalize_date(__pyx_self, ((PyObject *)__pyx_v_dt)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_72normalize_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dt) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("normalize_date", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_normalize_date(__pyx_v_dt, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.normalize_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2897 + * raise TypeError('Unrecognized type: %s' % type(dt)) + * + * cdef ndarray[int64_t] localize_dt64arr_to_period(ndarray[int64_t] stamps, # <<<<<<<<<<<<<< + * int freq, object tz): + * cdef: + */ + +static PyArrayObject *__pyx_f_6pandas_5tslib_localize_dt64arr_to_period(PyArrayObject *__pyx_v_stamps, int __pyx_v_freq, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + PyArrayObject *__pyx_v_pos = 0; + pandas_datetimestruct __pyx_v_dts; + Py_ssize_t __pyx_v_i; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v__pos = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_pos; + __Pyx_Buffer __pyx_pybuffer_pos; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + __pyx_t_5numpy_int64_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + Py_ssize_t __pyx_t_23; + npy_datetime __pyx_t_24; + Py_ssize_t __pyx_t_25; + PyArrayObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + PyObject *__pyx_t_28 = NULL; + PyObject *__pyx_t_29 = NULL; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + __pyx_t_5numpy_int64_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("localize_dt64arr_to_period", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_pos.pybuffer.buf = NULL; + __pyx_pybuffer_pos.refcount = 0; + __pyx_pybuffernd_pos.data = NULL; + __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2900 + * int freq, object tz): + * cdef: + * Py_ssize_t n = len(stamps) # <<<<<<<<<<<<<< + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) + * ndarray[int64_t] trans, deltas, pos + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2901 + * cdef: + * Py_ssize_t n = len(stamps) + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * ndarray[int64_t] trans, deltas, pos + * pandas_datetimestruct dts + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2905 + * pandas_datetimestruct dts + * + * if not have_pytz: # <<<<<<<<<<<<<< + * raise Exception('Could not find pytz module') + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_have_pytz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = ((!__pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2906 + * + * if not have_pytz: + * raise Exception('Could not find pytz module') # <<<<<<<<<<<<<< + * + * if _is_utc(tz): + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2908 + * raise Exception('Could not find pytz module') + * + * if _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_9 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2909 + * + * if _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/tslib.pyx":2910 + * if _is_utc(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2911 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2912 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + goto __pyx_L5_continue; + } + + /* "pandas/tslib.pyx":2913 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2914 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * + */ + __pyx_t_15 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_15 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + __pyx_L5_continue:; + } + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":2917 + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_9 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2918 + * + * elif _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/tslib.pyx":2919 + * elif _is_tzlocal(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2920 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2921 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + */ + goto __pyx_L8_continue; + } + + /* "pandas/tslib.pyx":2922 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, # <<<<<<<<<<<<<< + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2923 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2924 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":2925 + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_20 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_21 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + + /* "pandas/tslib.pyx":2924 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_22 = PyTuple_New(8); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_22, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_22, 5, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_22, 6, __pyx_t_21); + __Pyx_GIVEREF(__pyx_t_21); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_22, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_20 = 0; + __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_22, NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_21)); + __pyx_t_21 = 0; + + /* "pandas/tslib.pyx":2926 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + */ + __pyx_t_21 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_22 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_21)); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22); + __Pyx_GIVEREF(__pyx_t_22); + __pyx_t_22 = 0; + __pyx_t_22 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_21, NULL); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = PyNumber_Multiply(__pyx_t_22, __pyx_int_1000000000); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_21); + __pyx_t_21 = 0; + + /* "pandas/tslib.pyx":2927 + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_22 = PyNumber_Add(__pyx_t_21, __pyx_v_delta); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_24 = __Pyx_PyInt_As_npy_int64(__pyx_t_22); if (unlikely((__pyx_t_24 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + + /* "pandas/tslib.pyx":2928 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + pandas_datetime_to_datetimestruct(__pyx_t_24, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2929 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + */ + __pyx_t_15 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_15 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_25 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + __pyx_L8_continue:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":2933 + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + */ + __pyx_t_22 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + if (!(likely(((__pyx_t_22) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_22, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_26 = ((PyArrayObject *)__pyx_t_22); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_29); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_27, __pyx_t_28, __pyx_t_29); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_22); + __pyx_t_22 = 0; + + /* "pandas/tslib.pyx":2934 + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + */ + __pyx_t_22 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + if (!(likely(((__pyx_t_22) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_22, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_26 = ((PyArrayObject *)__pyx_t_22); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_27); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_29, __pyx_t_28, __pyx_t_27); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_22); + __pyx_t_22 = 0; + + /* "pandas/tslib.pyx":2935 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 # <<<<<<<<<<<<<< + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + */ + __pyx_t_22 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_INCREF(((PyObject *)__pyx_v_stamps)); + PyTuple_SET_ITEM(__pyx_t_21, 0, ((PyObject *)__pyx_v_stamps)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_stamps)); + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_21, __pyx_t_20); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyNumber_Subtract(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v__pos = __pyx_t_20; + __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2936 + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: # <<<<<<<<<<<<<< + * _pos = _pos.astype(np.int64) + * pos = _pos + */ + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_dtype); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_20, __pyx_t_21, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2937 + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) # <<<<<<<<<<<<<< + * pos = _pos + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_21 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_21, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v__pos, __pyx_t_20); + __pyx_t_20 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":2938 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + * pos = _pos # <<<<<<<<<<<<<< + * + * # statictzinfo + */ + if (!(likely(((__pyx_v__pos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__pos, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __pyx_v__pos; + __Pyx_INCREF(__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_20), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_29); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_27, __pyx_t_28, __pyx_t_29); + } + } + __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_pos = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2941 + * + * # statictzinfo + * if not hasattr(tz, '_transition_info'): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_9 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2942 + * # statictzinfo + * if not hasattr(tz, '_transition_info'): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/tslib.pyx":2943 + * if not hasattr(tz, '_transition_info'): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2944 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2945 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L13_continue; + } + + /* "pandas/tslib.pyx":2946 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_33 = 0; + __pyx_t_12 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2947 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2948 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + */ + __pyx_t_15 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_15 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_34 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + __pyx_L13_continue:; + } + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/tslib.pyx":2951 + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/tslib.pyx":2952 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2953 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2954 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L16_continue; + } + + /* "pandas/tslib.pyx":2955 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_38 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_pos.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_pos.diminfo[0].strides)); + __pyx_t_12 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2956 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2957 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * + */ + __pyx_t_39 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_39 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_40 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_39; + __pyx_L16_continue:; + } + } + __pyx_L12:; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":2960 + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyArrayObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2897 + * raise TypeError('Unrecognized type: %s' % type(dt)) + * + * cdef ndarray[int64_t] localize_dt64arr_to_period(ndarray[int64_t] stamps, # <<<<<<<<<<<<<< + * int freq, object tz): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_22); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.localize_dt64arr_to_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF((PyObject *)__pyx_v_pos); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v__pos); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3024 + * #---------------------------------------------------------------------- + * + * cdef inline int64_t apply_mult(int64_t period_ord, int64_t mult): # <<<<<<<<<<<<<< + * """ + * Get freq+multiple ordinal value from corresponding freq-only ordinal value. + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_apply_mult(__pyx_t_5numpy_int64_t __pyx_v_period_ord, __pyx_t_5numpy_int64_t __pyx_v_mult) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("apply_mult", 0); + + /* "pandas/tslib.pyx":3030 + * integer). + * """ + * if mult == 1: # <<<<<<<<<<<<<< + * return period_ord + * + */ + __pyx_t_1 = ((__pyx_v_mult == 1) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3031 + * """ + * if mult == 1: + * return period_ord # <<<<<<<<<<<<<< + * + * return (period_ord - 1) // mult + */ + __pyx_r = __pyx_v_period_ord; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3033 + * return period_ord + * + * return (period_ord - 1) // mult # <<<<<<<<<<<<<< + * + * cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult): + */ + __pyx_t_2 = (__pyx_v_period_ord - 1); + if (unlikely(__pyx_v_mult == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(__pyx_t_5numpy_int64_t) == sizeof(long) && unlikely(__pyx_v_mult == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_2))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_2, __pyx_v_mult); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3024 + * #---------------------------------------------------------------------- + * + * cdef inline int64_t apply_mult(int64_t period_ord, int64_t mult): # <<<<<<<<<<<<<< + * """ + * Get freq+multiple ordinal value from corresponding freq-only ordinal value. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.tslib.apply_mult", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3035 + * return (period_ord - 1) // mult + * + * cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult): # <<<<<<<<<<<<<< + * """ + * Get freq-only ordinal value from corresponding freq+multiple ordinal. + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_remove_mult(__pyx_t_5numpy_int64_t __pyx_v_period_ord_w_mult, __pyx_t_5numpy_int64_t __pyx_v_mult) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("remove_mult", 0); + + /* "pandas/tslib.pyx":3039 + * Get freq-only ordinal value from corresponding freq+multiple ordinal. + * """ + * if mult == 1: # <<<<<<<<<<<<<< + * return period_ord_w_mult + * + */ + __pyx_t_1 = ((__pyx_v_mult == 1) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3040 + * """ + * if mult == 1: + * return period_ord_w_mult # <<<<<<<<<<<<<< + * + * return period_ord_w_mult * mult + 1; + */ + __pyx_r = __pyx_v_period_ord_w_mult; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3042 + * return period_ord_w_mult + * + * return period_ord_w_mult * mult + 1; # <<<<<<<<<<<<<< + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): + */ + __pyx_r = ((__pyx_v_period_ord_w_mult * __pyx_v_mult) + 1); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3035 + * return (period_ord - 1) // mult + * + * cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult): # <<<<<<<<<<<<<< + * """ + * Get freq-only ordinal value from corresponding freq+multiple ordinal. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3044 + * return period_ord_w_mult * mult + 1; + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): # <<<<<<<<<<<<<< + * """ + * Convert array of datetime64 values (passed in as 'i8' dtype) to a set of + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_75dt64arr_to_periodarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_74dt64arr_to_periodarr[] = "\n Convert array of datetime64 values (passed in as 'i8' dtype) to a set of\n periods corresponding to desired frequency, per period convention.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_75dt64arr_to_periodarr = {__Pyx_NAMESTR("dt64arr_to_periodarr"), (PyCFunction)__pyx_pw_6pandas_5tslib_75dt64arr_to_periodarr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_74dt64arr_to_periodarr)}; +static PyObject *__pyx_pw_6pandas_5tslib_75dt64arr_to_periodarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_dtarr = 0; + int __pyx_v_freq; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dt64arr_to_periodarr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtarr,&__pyx_n_s_freq,&__pyx_n_s_tz,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtarr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dt64arr_to_periodarr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dtarr = ((PyArrayObject *)values[0]); + __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_tz = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.dt64arr_to_periodarr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtarr), __pyx_ptype_5numpy_ndarray, 1, "dtarr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_74dt64arr_to_periodarr(__pyx_self, __pyx_v_dtarr, __pyx_v_freq, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_74dt64arr_to_periodarr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtarr, int __pyx_v_freq, PyObject *__pyx_v_tz) { + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_l; + pandas_datetimestruct __pyx_v_dts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtarr; + __Pyx_Buffer __pyx_pybuffer_dtarr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + __pyx_t_5numpy_int64_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dt64arr_to_periodarr", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_dtarr.pybuffer.buf = NULL; + __pyx_pybuffer_dtarr.refcount = 0; + __pyx_pybuffernd_dtarr.data = NULL; + __pyx_pybuffernd_dtarr.rcbuffer = &__pyx_pybuffer_dtarr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtarr.diminfo[0].strides = __pyx_pybuffernd_dtarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtarr.diminfo[0].shape = __pyx_pybuffernd_dtarr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3054 + * pandas_datetimestruct dts + * + * l = len(dtarr) # <<<<<<<<<<<<<< + * + * out = np.empty(l, dtype='i8') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_dtarr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_l = __pyx_t_1; + + /* "pandas/tslib.pyx":3056 + * l = len(dtarr) + * + * out = np.empty(l, dtype='i8') # <<<<<<<<<<<<<< + * + * if tz is None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3058 + * out = np.empty(l, dtype='i8') + * + * if tz is None: # <<<<<<<<<<<<<< + * for i in range(l): + * if dtarr[i] == iNaT: + */ + __pyx_t_11 = (__pyx_v_tz == Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3059 + * + * if tz is None: + * for i in range(l): # <<<<<<<<<<<<<< + * if dtarr[i] == iNaT: + * out[i] = iNaT + */ + __pyx_t_1 = __pyx_v_l; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_1; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/tslib.pyx":3060 + * if tz is None: + * for i in range(l): + * if dtarr[i] == iNaT: # <<<<<<<<<<<<<< + * out[i] = iNaT + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_dtarr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_dtarr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtarr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_dtarr.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3061 + * for i in range(l): + * if dtarr[i] == iNaT: + * out[i] = iNaT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(dtarr[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_15 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":3062 + * if dtarr[i] == iNaT: + * out[i] = iNaT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(dtarr[i], PANDAS_FR_ns, &dts) + * out[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":3063 + * out[i] = iNaT + * continue + * pandas_datetime_to_datetimestruct(dtarr[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_dtarr.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dtarr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtarr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dtarr.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3064 + * continue + * pandas_datetime_to_datetimestruct(dtarr[i], PANDAS_FR_ns, &dts) + * out[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + */ + __pyx_t_15 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_15 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_15; + __pyx_L4_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3067 + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + * out = localize_dt64arr_to_period(dtarr, freq, tz) # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_4 = ((PyObject *)__pyx_f_6pandas_5tslib_localize_dt64arr_to_period(((PyArrayObject *)__pyx_v_dtarr), __pyx_v_freq, __pyx_v_tz)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF_SET(__pyx_v_out, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3068 + * else: + * out = localize_dt64arr_to_period(dtarr, freq, tz) + * return out # <<<<<<<<<<<<<< + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3044 + * return period_ord_w_mult * mult + 1; + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): # <<<<<<<<<<<<<< + * """ + * Convert array of datetime64 values (passed in as 'i8' dtype) to a set of + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtarr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.dt64arr_to_periodarr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtarr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3070 + * return out + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): # <<<<<<<<<<<<<< + * """ + * Convert array to datetime64 values from a set of ordinals corresponding to + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_77periodarr_to_dt64arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_76periodarr_to_dt64arr[] = "\n Convert array to datetime64 values from a set of ordinals corresponding to\n periods per period convention.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_77periodarr_to_dt64arr = {__Pyx_NAMESTR("periodarr_to_dt64arr"), (PyCFunction)__pyx_pw_6pandas_5tslib_77periodarr_to_dt64arr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_76periodarr_to_dt64arr)}; +static PyObject *__pyx_pw_6pandas_5tslib_77periodarr_to_dt64arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_periodarr = 0; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("periodarr_to_dt64arr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_periodarr,&__pyx_n_s_freq,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periodarr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("periodarr_to_dt64arr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodarr_to_dt64arr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_periodarr = ((PyArrayObject *)values[0]); + __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("periodarr_to_dt64arr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.periodarr_to_dt64arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_periodarr), __pyx_ptype_5numpy_ndarray, 1, "periodarr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_76periodarr_to_dt64arr(__pyx_self, __pyx_v_periodarr, __pyx_v_freq); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_76periodarr_to_dt64arr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_periodarr, int __pyx_v_freq) { + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_l; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_periodarr; + __Pyx_Buffer __pyx_pybuffer_periodarr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + __pyx_t_5numpy_int64_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("periodarr_to_dt64arr", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_periodarr.pybuffer.buf = NULL; + __pyx_pybuffer_periodarr.refcount = 0; + __pyx_pybuffernd_periodarr.data = NULL; + __pyx_pybuffernd_periodarr.rcbuffer = &__pyx_pybuffer_periodarr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_periodarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_periodarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_periodarr.diminfo[0].strides = __pyx_pybuffernd_periodarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_periodarr.diminfo[0].shape = __pyx_pybuffernd_periodarr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3079 + * Py_ssize_t i, l + * + * l = len(periodarr) # <<<<<<<<<<<<<< + * + * out = np.empty(l, dtype='i8') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_periodarr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_l = __pyx_t_1; + + /* "pandas/tslib.pyx":3081 + * l = len(periodarr) + * + * out = np.empty(l, dtype='i8') # <<<<<<<<<<<<<< + * + * for i in range(l): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3083 + * out = np.empty(l, dtype='i8') + * + * for i in range(l): # <<<<<<<<<<<<<< + * if periodarr[i] == iNaT: + * out[i] = iNaT + */ + __pyx_t_1 = __pyx_v_l; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":3084 + * + * for i in range(l): + * if periodarr[i] == iNaT: # <<<<<<<<<<<<<< + * out[i] = iNaT + * continue + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_periodarr.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_periodarr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_periodarr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_periodarr.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":3085 + * for i in range(l): + * if periodarr[i] == iNaT: + * out[i] = iNaT # <<<<<<<<<<<<<< + * continue + * out[i] = period_ordinal_to_dt64(periodarr[i], freq) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_14 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_14; + + /* "pandas/tslib.pyx":3086 + * if periodarr[i] == iNaT: + * out[i] = iNaT + * continue # <<<<<<<<<<<<<< + * out[i] = period_ordinal_to_dt64(periodarr[i], freq) + * + */ + goto __pyx_L3_continue; + } + + /* "pandas/tslib.pyx":3087 + * out[i] = iNaT + * continue + * out[i] = period_ordinal_to_dt64(periodarr[i], freq) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_periodarr.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_periodarr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_f_6pandas_5tslib_period_ordinal_to_dt64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_periodarr.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_periodarr.diminfo[0].strides)), __pyx_v_freq, 0); + __pyx_L3_continue:; + } + + /* "pandas/tslib.pyx":3089 + * out[i] = period_ordinal_to_dt64(periodarr[i], freq) + * + * return out # <<<<<<<<<<<<<< + * + * cdef char START = 'S' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3070 + * return out + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): # <<<<<<<<<<<<<< + * """ + * Convert array to datetime64 values from a set of ordinals corresponding to + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_periodarr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.periodarr_to_dt64arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_periodarr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3094 + * cdef char END = 'E' + * + * cpdef int64_t period_asfreq(int64_t period_ordinal, int freq1, int freq2, # <<<<<<<<<<<<<< + * bint end): + * """ + */ + +static PyObject *__pyx_pw_6pandas_5tslib_79period_asfreq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_period_asfreq(__pyx_t_5numpy_int64_t __pyx_v_period_ordinal, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch) { + __pyx_t_5numpy_int64_t __pyx_v_retval; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_asfreq", 0); + + /* "pandas/tslib.pyx":3103 + * int64_t retval + * + * if period_ordinal == iNaT: # <<<<<<<<<<<<<< + * return iNaT + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_period_ordinal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3104 + * + * if period_ordinal == iNaT: + * return iNaT # <<<<<<<<<<<<<< + * + * if end: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3106 + * return iNaT + * + * if end: # <<<<<<<<<<<<<< + * retval = asfreq(period_ordinal, freq1, freq2, END) + * else: + */ + __pyx_t_4 = (__pyx_v_end != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3107 + * + * if end: + * retval = asfreq(period_ordinal, freq1, freq2, END) # <<<<<<<<<<<<<< + * else: + * retval = asfreq(period_ordinal, freq1, freq2, START) + */ + __pyx_t_5 = asfreq(__pyx_v_period_ordinal, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_6pandas_5tslib_END); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_retval = __pyx_t_5; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":3109 + * retval = asfreq(period_ordinal, freq1, freq2, END) + * else: + * retval = asfreq(period_ordinal, freq1, freq2, START) # <<<<<<<<<<<<<< + * + * if retval == INT32_MIN: + */ + __pyx_t_5 = asfreq(__pyx_v_period_ordinal, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_6pandas_5tslib_START); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_retval = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":3111 + * retval = asfreq(period_ordinal, freq1, freq2, START) + * + * if retval == INT32_MIN: # <<<<<<<<<<<<<< + * raise ValueError('Frequency conversion failed') + * + */ + __pyx_t_4 = ((__pyx_v_retval == INT32_MIN) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3112 + * + * if retval == INT32_MIN: + * raise ValueError('Frequency conversion failed') # <<<<<<<<<<<<<< + * + * return retval + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3114 + * raise ValueError('Frequency conversion failed') + * + * return retval # <<<<<<<<<<<<<< + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): + */ + __pyx_r = __pyx_v_retval; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3094 + * cdef char END = 'E' + * + * cpdef int64_t period_asfreq(int64_t period_ordinal, int freq1, int freq2, # <<<<<<<<<<<<<< + * bint end): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("pandas.tslib.period_asfreq", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_79period_asfreq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_78period_asfreq[] = "\n Convert period ordinal from one frequency to another, and if upsampling,\n choose to use start ('S') or end ('E') of period.\n "; +static PyObject *__pyx_pw_6pandas_5tslib_79period_asfreq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_period_ordinal; + int __pyx_v_freq1; + int __pyx_v_freq2; + int __pyx_v_end; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_asfreq (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_period_ordinal,&__pyx_n_s_freq1,&__pyx_n_s_freq2,&__pyx_n_s_end,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period_ordinal)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_asfreq") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_period_ordinal = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_period_ordinal == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq1 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq2 = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_freq2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_end = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3095; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_asfreq", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_asfreq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_78period_asfreq(__pyx_self, __pyx_v_period_ordinal, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_end); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_78period_asfreq(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_period_ordinal, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_asfreq", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_f_6pandas_5tslib_period_asfreq(__pyx_v_period_ordinal, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_end, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.period_asfreq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3116 + * return retval + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): # <<<<<<<<<<<<<< + * """ + * Convert int64-array of period ordinals from one frequency to another, and + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_81period_asfreq_arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_80period_asfreq_arr[] = "\n Convert int64-array of period ordinals from one frequency to another, and\n if upsampling, choose to use start ('S') or end ('E') of period.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_81period_asfreq_arr = {__Pyx_NAMESTR("period_asfreq_arr"), (PyCFunction)__pyx_pw_6pandas_5tslib_81period_asfreq_arr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_80period_asfreq_arr)}; +static PyObject *__pyx_pw_6pandas_5tslib_81period_asfreq_arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_freq1; + int __pyx_v_freq2; + int __pyx_v_end; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_asfreq_arr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_freq1,&__pyx_n_s_freq2,&__pyx_n_s_end,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq_arr", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq_arr", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq_arr", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_asfreq_arr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_freq1 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq2 = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_freq2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_end = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_asfreq_arr", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_asfreq_arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_80period_asfreq_arr(__pyx_self, __pyx_v_arr, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_end); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_80period_asfreq_arr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end) { + PyArrayObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + freq_conv_func __pyx_v_func; + asfreq_info __pyx_v_finfo; + __pyx_t_5numpy_int64_t __pyx_v_val; + char __pyx_v_relation; + PyObject *__pyx_v_mask = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_asfreq_arr", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3129 + * char relation + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.int64) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":3130 + * + * n = len(arr) + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * func = get_asfreq_func(freq1, freq2) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3132 + * result = np.empty(n, dtype=np.int64) + * + * func = get_asfreq_func(freq1, freq2) # <<<<<<<<<<<<<< + * get_asfreq_info(freq1, freq2, &finfo) + * + */ + __pyx_v_func = get_asfreq_func(__pyx_v_freq1, __pyx_v_freq2); + + /* "pandas/tslib.pyx":3133 + * + * func = get_asfreq_func(freq1, freq2) + * get_asfreq_info(freq1, freq2, &finfo) # <<<<<<<<<<<<<< + * + * if end: + */ + get_asfreq_info(__pyx_v_freq1, __pyx_v_freq2, (&__pyx_v_finfo)); + + /* "pandas/tslib.pyx":3135 + * get_asfreq_info(freq1, freq2, &finfo) + * + * if end: # <<<<<<<<<<<<<< + * relation = END + * else: + */ + __pyx_t_12 = (__pyx_v_end != 0); + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3136 + * + * if end: + * relation = END # <<<<<<<<<<<<<< + * else: + * relation = START + */ + __pyx_v_relation = __pyx_v_6pandas_5tslib_END; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3138 + * relation = END + * else: + * relation = START # <<<<<<<<<<<<<< + * + * mask = arr == iNaT + */ + __pyx_v_relation = __pyx_v_6pandas_5tslib_START; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3140 + * relation = START + * + * mask = arr == iNaT # <<<<<<<<<<<<<< + * if mask.any(): # NaT process + * for i in range(n): + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_arr), __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_mask = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3141 + * + * mask = arr == iNaT + * if mask.any(): # NaT process # <<<<<<<<<<<<<< + * for i in range(n): + * val = arr[i] + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3142 + * mask = arr == iNaT + * if mask.any(): # NaT process + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * if val != iNaT: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_1; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/tslib.pyx":3143 + * if mask.any(): # NaT process + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * if val != iNaT: + * val = func(val, relation, &finfo) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/tslib.pyx":3144 + * for i in range(n): + * val = arr[i] + * if val != iNaT: # <<<<<<<<<<<<<< + * val = func(val, relation, &finfo) + * if val == INT32_MIN: + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3145 + * val = arr[i] + * if val != iNaT: + * val = func(val, relation, &finfo) # <<<<<<<<<<<<<< + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") + */ + __pyx_v_val = __pyx_v_func(__pyx_v_val, __pyx_v_relation, (&__pyx_v_finfo)); + + /* "pandas/tslib.pyx":3146 + * if val != iNaT: + * val = func(val, relation, &finfo) + * if val == INT32_MIN: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert to desired frequency.") + * result[i] = val + */ + __pyx_t_12 = ((__pyx_v_val == INT32_MIN) != 0); + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3147 + * val = func(val, relation, &finfo) + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") # <<<<<<<<<<<<<< + * result[i] = val + * else: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/tslib.pyx":3148 + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") + * result[i] = val # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":3150 + * result[i] = val + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * val = func(arr[i], relation, &finfo) + * if val == INT32_MIN: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_1; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/tslib.pyx":3151 + * else: + * for i in range(n): + * val = func(arr[i], relation, &finfo) # <<<<<<<<<<<<<< + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = __pyx_v_func((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_arr.diminfo[0].strides)), __pyx_v_relation, (&__pyx_v_finfo)); + + /* "pandas/tslib.pyx":3152 + * for i in range(n): + * val = func(arr[i], relation, &finfo) + * if val == INT32_MIN: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert to desired frequency.") + * result[i] = val + */ + __pyx_t_12 = ((__pyx_v_val == INT32_MIN) != 0); + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3153 + * val = func(arr[i], relation, &finfo) + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") # <<<<<<<<<<<<<< + * result[i] = val + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3154 + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") + * result[i] = val # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val; + } + } + __pyx_L4:; + + /* "pandas/tslib.pyx":3156 + * result[i] = val + * + * return result # <<<<<<<<<<<<<< + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3116 + * return retval + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): # <<<<<<<<<<<<<< + * """ + * Convert int64-array of period ordinals from one frequency to another, and + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.period_asfreq_arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3158 + * return result + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): # <<<<<<<<<<<<<< + * cdef: + * int64_t ordinal + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_83period_ordinal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_83period_ordinal = {__Pyx_NAMESTR("period_ordinal"), (PyCFunction)__pyx_pw_6pandas_5tslib_83period_ordinal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_83period_ordinal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_y; + int __pyx_v_m; + int __pyx_v_d; + int __pyx_v_h; + int __pyx_v_min; + int __pyx_v_s; + int __pyx_v_us; + int __pyx_v_ps; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_ordinal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_m,&__pyx_n_s_d,&__pyx_n_s_h,&__pyx_n_s_min,&__pyx_n_s_s,&__pyx_n_s_us,&__pyx_n_s_ps,&__pyx_n_s_freq,0}; + PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 6: + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_us)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 7: + if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ps)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 8: + if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_ordinal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + } + __pyx_v_y = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_d = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_d == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_h = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_h == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_min == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_s = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_s == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_us = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_us == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_ps = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ps == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_82period_ordinal(__pyx_self, __pyx_v_y, __pyx_v_m, __pyx_v_d, __pyx_v_h, __pyx_v_min, __pyx_v_s, __pyx_v_us, __pyx_v_ps, __pyx_v_freq); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_82period_ordinal(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_y, int __pyx_v_m, int __pyx_v_d, int __pyx_v_h, int __pyx_v_min, int __pyx_v_s, int __pyx_v_us, int __pyx_v_ps, int __pyx_v_freq) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_int64_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_ordinal", 0); + + /* "pandas/tslib.pyx":3162 + * int64_t ordinal + * + * return get_period_ordinal(y, m, d, h, min, s, us, ps, freq) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = get_period_ordinal(__pyx_v_y, __pyx_v_m, __pyx_v_d, __pyx_v_h, __pyx_v_min, __pyx_v_s, __pyx_v_us, __pyx_v_ps, __pyx_v_freq); if (unlikely(__pyx_t_1 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3158 + * return result + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): # <<<<<<<<<<<<<< + * cdef: + * int64_t ordinal + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.period_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3165 + * + * + * cpdef int64_t period_ordinal_to_dt64(int64_t ordinal, int freq): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + +static PyObject *__pyx_pw_6pandas_5tslib_85period_ordinal_to_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_period_ordinal_to_dt64(__pyx_t_5numpy_int64_t __pyx_v_ordinal, int __pyx_v_freq, CYTHON_UNUSED int __pyx_skip_dispatch) { + pandas_datetimestruct __pyx_v_dts; + date_info __pyx_v_dinfo; + float __pyx_v_subsecond_fraction; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_ordinal_to_dt64", 0); + + /* "pandas/tslib.pyx":3171 + * float subsecond_fraction + * + * if ordinal == iNaT: # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_ordinal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3172 + * + * if ordinal == iNaT: + * return NPY_NAT # <<<<<<<<<<<<<< + * + * get_date_info(ordinal, freq, &dinfo) + */ + __pyx_r = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3174 + * return NPY_NAT + * + * get_date_info(ordinal, freq, &dinfo) # <<<<<<<<<<<<<< + * + * dts.year = dinfo.year + */ + __pyx_t_5 = get_date_info(__pyx_v_ordinal, __pyx_v_freq, (&__pyx_v_dinfo)); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3176 + * get_date_info(ordinal, freq, &dinfo) + * + * dts.year = dinfo.year # <<<<<<<<<<<<<< + * dts.month = dinfo.month + * dts.day = dinfo.day + */ + __pyx_t_5 = __pyx_v_dinfo.year; + __pyx_v_dts.year = __pyx_t_5; + + /* "pandas/tslib.pyx":3177 + * + * dts.year = dinfo.year + * dts.month = dinfo.month # <<<<<<<<<<<<<< + * dts.day = dinfo.day + * dts.hour = dinfo.hour + */ + __pyx_t_5 = __pyx_v_dinfo.month; + __pyx_v_dts.month = __pyx_t_5; + + /* "pandas/tslib.pyx":3178 + * dts.year = dinfo.year + * dts.month = dinfo.month + * dts.day = dinfo.day # <<<<<<<<<<<<<< + * dts.hour = dinfo.hour + * dts.min = dinfo.minute + */ + __pyx_t_5 = __pyx_v_dinfo.day; + __pyx_v_dts.day = __pyx_t_5; + + /* "pandas/tslib.pyx":3179 + * dts.month = dinfo.month + * dts.day = dinfo.day + * dts.hour = dinfo.hour # <<<<<<<<<<<<<< + * dts.min = dinfo.minute + * dts.sec = int(dinfo.second) + */ + __pyx_t_5 = __pyx_v_dinfo.hour; + __pyx_v_dts.hour = __pyx_t_5; + + /* "pandas/tslib.pyx":3180 + * dts.day = dinfo.day + * dts.hour = dinfo.hour + * dts.min = dinfo.minute # <<<<<<<<<<<<<< + * dts.sec = int(dinfo.second) + * subsecond_fraction = dinfo.second - dts.sec + */ + __pyx_t_5 = __pyx_v_dinfo.minute; + __pyx_v_dts.min = __pyx_t_5; + + /* "pandas/tslib.pyx":3181 + * dts.hour = dinfo.hour + * dts.min = dinfo.minute + * dts.sec = int(dinfo.second) # <<<<<<<<<<<<<< + * subsecond_fraction = dinfo.second - dts.sec + * dts.us = int((subsecond_fraction) * 1e6) + */ + __pyx_v_dts.sec = ((npy_int32)__pyx_v_dinfo.second); + + /* "pandas/tslib.pyx":3182 + * dts.min = dinfo.minute + * dts.sec = int(dinfo.second) + * subsecond_fraction = dinfo.second - dts.sec # <<<<<<<<<<<<<< + * dts.us = int((subsecond_fraction) * 1e6) + * dts.ps = int(((subsecond_fraction) * 1e6 - dts.us) * 1e6) + */ + __pyx_v_subsecond_fraction = (__pyx_v_dinfo.second - __pyx_v_dts.sec); + + /* "pandas/tslib.pyx":3183 + * dts.sec = int(dinfo.second) + * subsecond_fraction = dinfo.second - dts.sec + * dts.us = int((subsecond_fraction) * 1e6) # <<<<<<<<<<<<<< + * dts.ps = int(((subsecond_fraction) * 1e6 - dts.us) * 1e6) + * + */ + __pyx_v_dts.us = ((npy_int32)(__pyx_v_subsecond_fraction * 1e6)); + + /* "pandas/tslib.pyx":3184 + * subsecond_fraction = dinfo.second - dts.sec + * dts.us = int((subsecond_fraction) * 1e6) + * dts.ps = int(((subsecond_fraction) * 1e6 - dts.us) * 1e6) # <<<<<<<<<<<<<< + * + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + */ + __pyx_v_dts.ps = ((npy_int32)(((__pyx_v_subsecond_fraction * 1e6) - __pyx_v_dts.us) * 1e6)); + + /* "pandas/tslib.pyx":3186 + * dts.ps = int(((subsecond_fraction) * 1e6 - dts.us) * 1e6) + * + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * + * def period_format(int64_t value, int freq, object fmt=None): + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts)); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3165 + * + * + * cpdef int64_t period_ordinal_to_dt64(int64_t ordinal, int freq): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("pandas.tslib.period_ordinal_to_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_85period_ordinal_to_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_85period_ordinal_to_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_ordinal; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_ordinal_to_dt64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ordinal,&__pyx_n_s_freq,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ordinal)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal_to_dt64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_ordinal_to_dt64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_ordinal = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_ordinal == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_ordinal_to_dt64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_ordinal_to_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_84period_ordinal_to_dt64(__pyx_self, __pyx_v_ordinal, __pyx_v_freq); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_84period_ordinal_to_dt64(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_ordinal, int __pyx_v_freq) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_ordinal_to_dt64", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_f_6pandas_5tslib_period_ordinal_to_dt64(__pyx_v_ordinal, __pyx_v_freq, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.period_ordinal_to_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3188 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * + * def period_format(int64_t value, int freq, object fmt=None): # <<<<<<<<<<<<<< + * cdef: + * int freq_group + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_87period_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_87period_format = {__Pyx_NAMESTR("period_format"), (PyCFunction)__pyx_pw_6pandas_5tslib_87period_format, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_87period_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_value; + int __pyx_v_freq; + PyObject *__pyx_v_fmt = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_format (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_freq,&__pyx_n_s_fmt,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_format", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmt); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_value == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fmt = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_format", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_86period_format(__pyx_self, __pyx_v_value, __pyx_v_freq, __pyx_v_fmt); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_86period_format(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq, PyObject *__pyx_v_fmt) { + int __pyx_v_freq_group; + __pyx_t_5numpy_int64_t __pyx_v_left; + __pyx_t_5numpy_int64_t __pyx_v_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_format", 0); + __Pyx_INCREF(__pyx_v_fmt); + + /* "pandas/tslib.pyx":3192 + * int freq_group + * + * if value == iNaT: # <<<<<<<<<<<<<< + * return repr(NaT) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3193 + * + * if value == iNaT: + * return repr(NaT) # <<<<<<<<<<<<<< + * + * if fmt is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3195 + * return repr(NaT) + * + * if fmt is None: # <<<<<<<<<<<<<< + * freq_group = (freq // 1000) * 1000 + * if freq_group == 1000: # FR_ANN + */ + __pyx_t_4 = (__pyx_v_fmt == Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3196 + * + * if fmt is None: + * freq_group = (freq // 1000) * 1000 # <<<<<<<<<<<<<< + * if freq_group == 1000: # FR_ANN + * fmt = b'%Y' + */ + __pyx_v_freq_group = (__Pyx_div_long(__pyx_v_freq, 1000) * 1000); + + /* "pandas/tslib.pyx":3221 + * elif freq_group == 11000: # MICROSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + * elif freq_group == 12000: # NANOSEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S.%n' + * else: + */ + switch (__pyx_v_freq_group) { + + /* "pandas/tslib.pyx":3197 + * if fmt is None: + * freq_group = (freq // 1000) * 1000 + * if freq_group == 1000: # FR_ANN # <<<<<<<<<<<<<< + * fmt = b'%Y' + * elif freq_group == 2000: # FR_QTR + */ + case 1000: + + /* "pandas/tslib.pyx":3198 + * freq_group = (freq // 1000) * 1000 + * if freq_group == 1000: # FR_ANN + * fmt = b'%Y' # <<<<<<<<<<<<<< + * elif freq_group == 2000: # FR_QTR + * fmt = b'%FQ%q' + */ + __Pyx_INCREF(__pyx_kp_b_Y_2); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_2); + break; + + /* "pandas/tslib.pyx":3199 + * if freq_group == 1000: # FR_ANN + * fmt = b'%Y' + * elif freq_group == 2000: # FR_QTR # <<<<<<<<<<<<<< + * fmt = b'%FQ%q' + * elif freq_group == 3000: # FR_MTH + */ + case 2000: + + /* "pandas/tslib.pyx":3200 + * fmt = b'%Y' + * elif freq_group == 2000: # FR_QTR + * fmt = b'%FQ%q' # <<<<<<<<<<<<<< + * elif freq_group == 3000: # FR_MTH + * fmt = b'%Y-%m' + */ + __Pyx_INCREF(__pyx_kp_b_FQ_q); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_FQ_q); + break; + + /* "pandas/tslib.pyx":3201 + * elif freq_group == 2000: # FR_QTR + * fmt = b'%FQ%q' + * elif freq_group == 3000: # FR_MTH # <<<<<<<<<<<<<< + * fmt = b'%Y-%m' + * elif freq_group == 4000: # WK + */ + case 3000: + + /* "pandas/tslib.pyx":3202 + * fmt = b'%FQ%q' + * elif freq_group == 3000: # FR_MTH + * fmt = b'%Y-%m' # <<<<<<<<<<<<<< + * elif freq_group == 4000: # WK + * left = period_asfreq(value, freq, 6000, 0) + */ + __Pyx_INCREF(__pyx_kp_b_Y_m); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m); + break; + + /* "pandas/tslib.pyx":3203 + * elif freq_group == 3000: # FR_MTH + * fmt = b'%Y-%m' + * elif freq_group == 4000: # WK # <<<<<<<<<<<<<< + * left = period_asfreq(value, freq, 6000, 0) + * right = period_asfreq(value, freq, 6000, 1) + */ + case 4000: + + /* "pandas/tslib.pyx":3204 + * fmt = b'%Y-%m' + * elif freq_group == 4000: # WK + * left = period_asfreq(value, freq, 6000, 0) # <<<<<<<<<<<<<< + * right = period_asfreq(value, freq, 6000, 1) + * return '%s/%s' % (period_format(left, 6000), + */ + __pyx_v_left = __pyx_f_6pandas_5tslib_period_asfreq(__pyx_v_value, __pyx_v_freq, 6000, 0, 0); + + /* "pandas/tslib.pyx":3205 + * elif freq_group == 4000: # WK + * left = period_asfreq(value, freq, 6000, 0) + * right = period_asfreq(value, freq, 6000, 1) # <<<<<<<<<<<<<< + * return '%s/%s' % (period_format(left, 6000), + * period_format(right, 6000)) + */ + __pyx_v_right = __pyx_f_6pandas_5tslib_period_asfreq(__pyx_v_value, __pyx_v_freq, 6000, 1, 0); + + /* "pandas/tslib.pyx":3206 + * left = period_asfreq(value, freq, 6000, 0) + * right = period_asfreq(value, freq, 6000, 1) + * return '%s/%s' % (period_format(left, 6000), # <<<<<<<<<<<<<< + * period_format(right, 6000)) + * elif (freq_group == 5000 # BUS + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_period_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_6000); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_6000); + __Pyx_GIVEREF(__pyx_int_6000); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3207 + * right = period_asfreq(value, freq, 6000, 1) + * return '%s/%s' % (period_format(left, 6000), + * period_format(right, 6000)) # <<<<<<<<<<<<<< + * elif (freq_group == 5000 # BUS + * or freq_group == 6000): # DAY + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_period_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_right); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_int_6000); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_6000); + __Pyx_GIVEREF(__pyx_int_6000); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3206 + * left = period_asfreq(value, freq, 6000, 0) + * right = period_asfreq(value, freq, 6000, 1) + * return '%s/%s' % (period_format(left, 6000), # <<<<<<<<<<<<<< + * period_format(right, 6000)) + * elif (freq_group == 5000 # BUS + */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3208 + * return '%s/%s' % (period_format(left, 6000), + * period_format(right, 6000)) + * elif (freq_group == 5000 # BUS # <<<<<<<<<<<<<< + * or freq_group == 6000): # DAY + * fmt = b'%Y-%m-%d' + */ + case 5000: + + /* "pandas/tslib.pyx":3209 + * period_format(right, 6000)) + * elif (freq_group == 5000 # BUS + * or freq_group == 6000): # DAY # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d' + * elif freq_group == 7000: # HR + */ + case 6000: + + /* "pandas/tslib.pyx":3210 + * elif (freq_group == 5000 # BUS + * or freq_group == 6000): # DAY + * fmt = b'%Y-%m-%d' # <<<<<<<<<<<<<< + * elif freq_group == 7000: # HR + * fmt = b'%Y-%m-%d %H:00' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d); + break; + + /* "pandas/tslib.pyx":3211 + * or freq_group == 6000): # DAY + * fmt = b'%Y-%m-%d' + * elif freq_group == 7000: # HR # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:00' + * elif freq_group == 8000: # MIN + */ + case 7000: + + /* "pandas/tslib.pyx":3212 + * fmt = b'%Y-%m-%d' + * elif freq_group == 7000: # HR + * fmt = b'%Y-%m-%d %H:00' # <<<<<<<<<<<<<< + * elif freq_group == 8000: # MIN + * fmt = b'%Y-%m-%d %H:%M' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_00); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_00); + break; + + /* "pandas/tslib.pyx":3213 + * elif freq_group == 7000: # HR + * fmt = b'%Y-%m-%d %H:00' + * elif freq_group == 8000: # MIN # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M' + * elif freq_group == 9000: # SEC + */ + case 8000: + + /* "pandas/tslib.pyx":3214 + * fmt = b'%Y-%m-%d %H:00' + * elif freq_group == 8000: # MIN + * fmt = b'%Y-%m-%d %H:%M' # <<<<<<<<<<<<<< + * elif freq_group == 9000: # SEC + * fmt = b'%Y-%m-%d %H:%M:%S' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M); + break; + + /* "pandas/tslib.pyx":3215 + * elif freq_group == 8000: # MIN + * fmt = b'%Y-%m-%d %H:%M' + * elif freq_group == 9000: # SEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S' + * elif freq_group == 10000: # MILLISEC + */ + case 9000: + + /* "pandas/tslib.pyx":3216 + * fmt = b'%Y-%m-%d %H:%M' + * elif freq_group == 9000: # SEC + * fmt = b'%Y-%m-%d %H:%M:%S' # <<<<<<<<<<<<<< + * elif freq_group == 10000: # MILLISEC + * fmt = b'%Y-%m-%d %H:%M:%S.%l' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M_S); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M_S); + break; + + /* "pandas/tslib.pyx":3217 + * elif freq_group == 9000: # SEC + * fmt = b'%Y-%m-%d %H:%M:%S' + * elif freq_group == 10000: # MILLISEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S.%l' + * elif freq_group == 11000: # MICROSEC + */ + case 10000: + + /* "pandas/tslib.pyx":3218 + * fmt = b'%Y-%m-%d %H:%M:%S' + * elif freq_group == 10000: # MILLISEC + * fmt = b'%Y-%m-%d %H:%M:%S.%l' # <<<<<<<<<<<<<< + * elif freq_group == 11000: # MICROSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M_S_l); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M_S_l); + break; + + /* "pandas/tslib.pyx":3219 + * elif freq_group == 10000: # MILLISEC + * fmt = b'%Y-%m-%d %H:%M:%S.%l' + * elif freq_group == 11000: # MICROSEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + * elif freq_group == 12000: # NANOSEC + */ + case 11000: + + /* "pandas/tslib.pyx":3220 + * fmt = b'%Y-%m-%d %H:%M:%S.%l' + * elif freq_group == 11000: # MICROSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%u' # <<<<<<<<<<<<<< + * elif freq_group == 12000: # NANOSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%n' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M_S_u); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M_S_u); + break; + + /* "pandas/tslib.pyx":3221 + * elif freq_group == 11000: # MICROSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + * elif freq_group == 12000: # NANOSEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S.%n' + * else: + */ + case 12000: + + /* "pandas/tslib.pyx":3222 + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + * elif freq_group == 12000: # NANOSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%n' # <<<<<<<<<<<<<< + * else: + * raise ValueError('Unknown freq: %d' % freq) + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M_S_n); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M_S_n); + break; + default: + + /* "pandas/tslib.pyx":3224 + * fmt = b'%Y-%m-%d %H:%M:%S.%n' + * else: + * raise ValueError('Unknown freq: %d' % freq) # <<<<<<<<<<<<<< + * + * return _period_strftime(value, freq, fmt) + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_freq_d, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":3226 + * raise ValueError('Unknown freq: %d' % freq) + * + * return _period_strftime(value, freq, fmt) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __pyx_f_6pandas_5tslib__period_strftime(__pyx_v_value, __pyx_v_freq, __pyx_v_fmt); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3188 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * + * def period_format(int64_t value, int freq, object fmt=None): # <<<<<<<<<<<<<< + * cdef: + * int freq_group + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.period_format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fmt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3238 + * cdef list str_extra_fmts = ["^`AB`^", "^`CD`^", "^`EF`^", "^`GH`^", "^`IJ`^", "^`KL`^"] + * + * cdef object _period_strftime(int64_t value, int freq, object fmt): # <<<<<<<<<<<<<< + * import sys + * + */ + +static PyObject *__pyx_f_6pandas_5tslib__period_strftime(__pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq, PyObject *__pyx_v_fmt) { + CYTHON_UNUSED PyObject *__pyx_v_sys = NULL; + Py_ssize_t __pyx_v_i; + date_info __pyx_v_dinfo; + char *__pyx_v_formatted; + PyObject *__pyx_v_pat = 0; + PyObject *__pyx_v_repl = 0; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_found_pat = 0; + int __pyx_v_year; + int __pyx_v_quarter; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_period_strftime", 0); + __Pyx_INCREF(__pyx_v_fmt); + + /* "pandas/tslib.pyx":3239 + * + * cdef object _period_strftime(int64_t value, int freq, object fmt): + * import sys # <<<<<<<<<<<<<< + * + * cdef: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sys = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3246 + * char *formatted + * object pat, repl, result + * list found_pat = [False] * len(extra_fmts) # <<<<<<<<<<<<<< + * int year, quarter + * + */ + __pyx_t_1 = __pyx_v_6pandas_5tslib_extra_fmts; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1 * ((__pyx_t_2<0) ? 0:__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_t_2; __pyx_temp++) { + __Pyx_INCREF(Py_False); + PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_False); + __Pyx_GIVEREF(Py_False); + } + } + __pyx_v_found_pat = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3249 + * int year, quarter + * + * if PyUnicode_Check(fmt): # <<<<<<<<<<<<<< + * fmt = fmt.encode('utf-8') + * + */ + __pyx_t_3 = (PyUnicode_Check(__pyx_v_fmt) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":3250 + * + * if PyUnicode_Check(fmt): + * fmt = fmt.encode('utf-8') # <<<<<<<<<<<<<< + * + * get_date_info(value, freq, &dinfo) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3252 + * fmt = fmt.encode('utf-8') + * + * get_date_info(value, freq, &dinfo) # <<<<<<<<<<<<<< + * for i in range(len(extra_fmts)): + * pat = extra_fmts[i][0] + */ + __pyx_t_5 = get_date_info(__pyx_v_value, __pyx_v_freq, (&__pyx_v_dinfo)); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3253 + * + * get_date_info(value, freq, &dinfo) + * for i in range(len(extra_fmts)): # <<<<<<<<<<<<<< + * pat = extra_fmts[i][0] + * repl = extra_fmts[i][1] + */ + __pyx_t_4 = __pyx_v_6pandas_5tslib_extra_fmts; + __Pyx_INCREF(__pyx_t_4); + if (unlikely(__pyx_t_4 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/tslib.pyx":3254 + * get_date_info(value, freq, &dinfo) + * for i in range(len(extra_fmts)): + * pat = extra_fmts[i][0] # <<<<<<<<<<<<<< + * repl = extra_fmts[i][1] + * if pat in fmt: + */ + if (unlikely(__pyx_v_6pandas_5tslib_extra_fmts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_6pandas_5tslib_extra_fmts, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_pat, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3255 + * for i in range(len(extra_fmts)): + * pat = extra_fmts[i][0] + * repl = extra_fmts[i][1] # <<<<<<<<<<<<<< + * if pat in fmt: + * fmt = fmt.replace(pat, repl) + */ + if (unlikely(__pyx_v_6pandas_5tslib_extra_fmts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_6pandas_5tslib_extra_fmts, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3256 + * pat = extra_fmts[i][0] + * repl = extra_fmts[i][1] + * if pat in fmt: # <<<<<<<<<<<<<< + * fmt = fmt.replace(pat, repl) + * found_pat[i] = True + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_pat, __pyx_v_fmt, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3257 + * repl = extra_fmts[i][1] + * if pat in fmt: + * fmt = fmt.replace(pat, repl) # <<<<<<<<<<<<<< + * found_pat[i] = True + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_pat); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pat); + __Pyx_GIVEREF(__pyx_v_pat); + __Pyx_INCREF(__pyx_v_repl); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_repl); + __Pyx_GIVEREF(__pyx_v_repl); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":3258 + * if pat in fmt: + * fmt = fmt.replace(pat, repl) + * found_pat[i] = True # <<<<<<<<<<<<<< + * + * formatted = c_strftime(&dinfo, fmt) + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_found_pat, __pyx_v_i, Py_True, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + } + + /* "pandas/tslib.pyx":3260 + * found_pat[i] = True + * + * formatted = c_strftime(&dinfo, fmt) # <<<<<<<<<<<<<< + * + * result = util.char_to_string(formatted) + */ + __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_fmt); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_formatted = c_strftime((&__pyx_v_dinfo), ((char *)__pyx_t_9)); + + /* "pandas/tslib.pyx":3262 + * formatted = c_strftime(&dinfo, fmt) + * + * result = util.char_to_string(formatted) # <<<<<<<<<<<<<< + * free(formatted) + * + */ + __pyx_t_8 = char_to_string(__pyx_v_formatted); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_result = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":3263 + * + * result = util.char_to_string(formatted) + * free(formatted) # <<<<<<<<<<<<<< + * + * for i in range(len(extra_fmts)): + */ + free(__pyx_v_formatted); + + /* "pandas/tslib.pyx":3265 + * free(formatted) + * + * for i in range(len(extra_fmts)): # <<<<<<<<<<<<<< + * if found_pat[i]: + * if get_yq(value, freq, &quarter, &year) < 0: + */ + __pyx_t_8 = __pyx_v_6pandas_5tslib_extra_fmts; + __Pyx_INCREF(__pyx_t_8); + if (unlikely(__pyx_t_8 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(__pyx_t_8); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/tslib.pyx":3266 + * + * for i in range(len(extra_fmts)): + * if found_pat[i]: # <<<<<<<<<<<<<< + * if get_yq(value, freq, &quarter, &year) < 0: + * raise ValueError('Unable to get quarter and year') + */ + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_found_pat, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3267 + * for i in range(len(extra_fmts)): + * if found_pat[i]: + * if get_yq(value, freq, &quarter, &year) < 0: # <<<<<<<<<<<<<< + * raise ValueError('Unable to get quarter and year') + * + */ + __pyx_t_7 = ((get_yq(__pyx_v_value, __pyx_v_freq, (&__pyx_v_quarter), (&__pyx_v_year)) < 0) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3268 + * if found_pat[i]: + * if get_yq(value, freq, &quarter, &year) < 0: + * raise ValueError('Unable to get quarter and year') # <<<<<<<<<<<<<< + * + * if i == 0: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3280 + * elif i == 4: + * repl = '%06d' % (value % 1000000) + * elif i == 5: # <<<<<<<<<<<<<< + * repl = '%09d' % (value % 1000000000) + * + */ + switch (__pyx_v_i) { + + /* "pandas/tslib.pyx":3270 + * raise ValueError('Unable to get quarter and year') + * + * if i == 0: # <<<<<<<<<<<<<< + * repl = '%d' % quarter + * elif i == 1: # %f, 2-digit year + */ + case 0: + + /* "pandas/tslib.pyx":3271 + * + * if i == 0: + * repl = '%d' % quarter # <<<<<<<<<<<<<< + * elif i == 1: # %f, 2-digit year + * repl = '%.2d' % (year % 100) + */ + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_quarter); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_1); + __pyx_t_1 = 0; + break; + + /* "pandas/tslib.pyx":3272 + * if i == 0: + * repl = '%d' % quarter + * elif i == 1: # %f, 2-digit year # <<<<<<<<<<<<<< + * repl = '%.2d' % (year % 100) + * elif i == 2: + */ + case 1: + + /* "pandas/tslib.pyx":3273 + * repl = '%d' % quarter + * elif i == 1: # %f, 2-digit year + * repl = '%.2d' % (year % 100) # <<<<<<<<<<<<<< + * elif i == 2: + * repl = '%d' % year + */ + __pyx_t_1 = __Pyx_PyInt_From_long(__Pyx_mod_long(__pyx_v_year, 100)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_2d, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_8); + __pyx_t_8 = 0; + break; + + /* "pandas/tslib.pyx":3274 + * elif i == 1: # %f, 2-digit year + * repl = '%.2d' % (year % 100) + * elif i == 2: # <<<<<<<<<<<<<< + * repl = '%d' % year + * elif i == 3: + */ + case 2: + + /* "pandas/tslib.pyx":3275 + * repl = '%.2d' % (year % 100) + * elif i == 2: + * repl = '%d' % year # <<<<<<<<<<<<<< + * elif i == 3: + * repl = '%03d' % (value % 1000) + */ + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_1); + __pyx_t_1 = 0; + break; + + /* "pandas/tslib.pyx":3276 + * elif i == 2: + * repl = '%d' % year + * elif i == 3: # <<<<<<<<<<<<<< + * repl = '%03d' % (value % 1000) + * elif i == 4: + */ + case 3: + + /* "pandas/tslib.pyx":3277 + * repl = '%d' % year + * elif i == 3: + * repl = '%03d' % (value % 1000) # <<<<<<<<<<<<<< + * elif i == 4: + * repl = '%06d' % (value % 1000000) + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_value, 1000)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_03d, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_8); + __pyx_t_8 = 0; + break; + + /* "pandas/tslib.pyx":3278 + * elif i == 3: + * repl = '%03d' % (value % 1000) + * elif i == 4: # <<<<<<<<<<<<<< + * repl = '%06d' % (value % 1000000) + * elif i == 5: + */ + case 4: + + /* "pandas/tslib.pyx":3279 + * repl = '%03d' % (value % 1000) + * elif i == 4: + * repl = '%06d' % (value % 1000000) # <<<<<<<<<<<<<< + * elif i == 5: + * repl = '%09d' % (value % 1000000000) + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_value, 1000000)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_06d, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_1); + __pyx_t_1 = 0; + break; + + /* "pandas/tslib.pyx":3280 + * elif i == 4: + * repl = '%06d' % (value % 1000000) + * elif i == 5: # <<<<<<<<<<<<<< + * repl = '%09d' % (value % 1000000000) + * + */ + case 5: + + /* "pandas/tslib.pyx":3281 + * repl = '%06d' % (value % 1000000) + * elif i == 5: + * repl = '%09d' % (value % 1000000000) # <<<<<<<<<<<<<< + * + * result = result.replace(str_extra_fmts[i], repl) + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_value, 1000000000)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_09d, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_8); + __pyx_t_8 = 0; + break; + default: break; + } + + /* "pandas/tslib.pyx":3283 + * repl = '%09d' % (value % 1000000000) + * + * result = result.replace(str_extra_fmts[i], repl) # <<<<<<<<<<<<<< + * + * if PY2: + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_replace); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__pyx_v_6pandas_5tslib_str_extra_fmts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_6pandas_5tslib_str_extra_fmts, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_v_repl)) { __Pyx_RaiseUnboundLocalError("repl"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_repl); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_repl); + __Pyx_GIVEREF(__pyx_v_repl); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L9; + } + __pyx_L9:; + } + + /* "pandas/tslib.pyx":3285 + * result = result.replace(str_extra_fmts[i], repl) + * + * if PY2: # <<<<<<<<<<<<<< + * result = result.decode('utf-8', 'ignore') + * + */ + __pyx_t_7 = (__pyx_v_6pandas_5tslib_PY2 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3286 + * + * if PY2: + * result = result.decode('utf-8', 'ignore') # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":3288 + * result = result.decode('utf-8', 'ignore') + * + * return result # <<<<<<<<<<<<<< + * + * # period accessors + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3238 + * cdef list str_extra_fmts = ["^`AB`^", "^`CD`^", "^`EF`^", "^`GH`^", "^`IJ`^", "^`KL`^"] + * + * cdef object _period_strftime(int64_t value, int freq, object fmt): # <<<<<<<<<<<<<< + * import sys + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.tslib._period_strftime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_sys); + __Pyx_XDECREF(__pyx_v_pat); + __Pyx_XDECREF(__pyx_v_repl); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_found_pat); + __Pyx_XDECREF(__pyx_v_fmt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3294 + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN + * + * def get_period_field(int code, int64_t value, int freq): # <<<<<<<<<<<<<< + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_89get_period_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_89get_period_field = {__Pyx_NAMESTR("get_period_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_89get_period_field, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_89get_period_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_code; + __pyx_t_5numpy_int64_t __pyx_v_value; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_period_field (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_code,&__pyx_n_s_value,&__pyx_n_s_freq,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_code)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_period_field", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_period_field", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_period_field") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_code = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_value = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_value == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_period_field", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_period_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_88get_period_field(__pyx_self, __pyx_v_code, __pyx_v_value, __pyx_v_freq); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_88get_period_field(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_code, __pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq) { + __pyx_t_6pandas_5tslib_accessor __pyx_v_f; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_period_field", 0); + + /* "pandas/tslib.pyx":3295 + * + * def get_period_field(int code, int64_t value, int freq): + * cdef accessor f = _get_accessor_func(code) # <<<<<<<<<<<<<< + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) + */ + __pyx_v_f = __pyx_f_6pandas_5tslib__get_accessor_func(__pyx_v_code); + + /* "pandas/tslib.pyx":3296 + * def get_period_field(int code, int64_t value, int freq): + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: # <<<<<<<<<<<<<< + * raise ValueError('Unrecognized period code: %d' % code) + * if value == iNaT: + */ + __pyx_t_1 = ((__pyx_v_f == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3297 + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) # <<<<<<<<<<<<<< + * if value == iNaT: + * return -1 + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_period_code_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3298 + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) + * if value == iNaT: # <<<<<<<<<<<<<< + * return -1 + * return f(value, freq) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3299 + * raise ValueError('Unrecognized period code: %d' % code) + * if value == iNaT: + * return -1 # <<<<<<<<<<<<<< + * return f(value, freq) + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3300 + * if value == iNaT: + * return -1 + * return f(value, freq) # <<<<<<<<<<<<<< + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __pyx_v_f(__pyx_v_value, __pyx_v_freq); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3294 + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN + * + * def get_period_field(int code, int64_t value, int freq): # <<<<<<<<<<<<<< + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.get_period_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3302 + * return f(value, freq) + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_91get_period_field_arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_91get_period_field_arr = {__Pyx_NAMESTR("get_period_field_arr"), (PyCFunction)__pyx_pw_6pandas_5tslib_91get_period_field_arr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_91get_period_field_arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_code; + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_period_field_arr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_code,&__pyx_n_s_arr,&__pyx_n_s_freq,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_code)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_period_field_arr", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_period_field_arr", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_period_field_arr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_code = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_arr = ((PyArrayObject *)values[1]); + __pyx_v_freq = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_period_field_arr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_period_field_arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_90get_period_field_arr(__pyx_self, __pyx_v_code, __pyx_v_arr, __pyx_v_freq); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_90get_period_field_arr(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_code, PyArrayObject *__pyx_v_arr, int __pyx_v_freq) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyArrayObject *__pyx_v_out = 0; + __pyx_t_6pandas_5tslib_accessor __pyx_v_f; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_period_field_arr", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3308 + * accessor f + * + * f = _get_accessor_func(code) # <<<<<<<<<<<<<< + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) + */ + __pyx_v_f = __pyx_f_6pandas_5tslib__get_accessor_func(__pyx_v_code); + + /* "pandas/tslib.pyx":3309 + * + * f = _get_accessor_func(code) + * if f is NULL: # <<<<<<<<<<<<<< + * raise ValueError('Unrecognized period code: %d' % code) + * + */ + __pyx_t_1 = ((__pyx_v_f == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3310 + * f = _get_accessor_func(code) + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) # <<<<<<<<<<<<<< + * + * sz = len(arr) + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_period_code_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3312 + * raise ValueError('Unrecognized period code: %d' % code) + * + * sz = len(arr) # <<<<<<<<<<<<<< + * out = np.empty(sz, dtype=np.int64) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_sz = __pyx_t_4; + + /* "pandas/tslib.pyx":3313 + * + * sz = len(arr) + * out = np.empty(sz, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(sz): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_sz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":3315 + * out = np.empty(sz, dtype=np.int64) + * + * for i in range(sz): # <<<<<<<<<<<<<< + * if arr[i] == iNaT: + * out[i] = -1 + */ + __pyx_t_4 = __pyx_v_sz; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_4; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/tslib.pyx":3316 + * + * for i in range(sz): + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * out[i] = -1 + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3317 + * for i in range(sz): + * if arr[i] == iNaT: + * out[i] = -1 # <<<<<<<<<<<<<< + * continue + * out[i] = f(arr[i], freq) + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + + /* "pandas/tslib.pyx":3318 + * if arr[i] == iNaT: + * out[i] = -1 + * continue # <<<<<<<<<<<<<< + * out[i] = f(arr[i], freq) + * + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":3319 + * out[i] = -1 + * continue + * out[i] = f(arr[i], freq) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = __pyx_v_f((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_arr.diminfo[0].strides)), __pyx_v_freq); if (unlikely(__pyx_t_9 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_18 = 0; + if (unlikely(__pyx_t_18 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_18); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_9; + __pyx_L4_continue:; + } + + /* "pandas/tslib.pyx":3321 + * out[i] = f(arr[i], freq) + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3302 + * return f(value, freq) + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.get_period_field_arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3325 + * + * + * cdef accessor _get_accessor_func(int code): # <<<<<<<<<<<<<< + * if code == 0: + * return &pyear + */ + +static __pyx_t_6pandas_5tslib_accessor __pyx_f_6pandas_5tslib__get_accessor_func(int __pyx_v_code) { + __pyx_t_6pandas_5tslib_accessor __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_accessor_func", 0); + + /* "pandas/tslib.pyx":3346 + * elif code == 9: + * return &pday_of_year + * elif code == 10: # <<<<<<<<<<<<<< + * return &pweekday + * return NULL + */ + switch (__pyx_v_code) { + + /* "pandas/tslib.pyx":3326 + * + * cdef accessor _get_accessor_func(int code): + * if code == 0: # <<<<<<<<<<<<<< + * return &pyear + * elif code == 1: + */ + case 0: + + /* "pandas/tslib.pyx":3327 + * cdef accessor _get_accessor_func(int code): + * if code == 0: + * return &pyear # <<<<<<<<<<<<<< + * elif code == 1: + * return &pqyear + */ + __pyx_r = (&pyear); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3328 + * if code == 0: + * return &pyear + * elif code == 1: # <<<<<<<<<<<<<< + * return &pqyear + * elif code == 2: + */ + case 1: + + /* "pandas/tslib.pyx":3329 + * return &pyear + * elif code == 1: + * return &pqyear # <<<<<<<<<<<<<< + * elif code == 2: + * return &pquarter + */ + __pyx_r = (&pqyear); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3330 + * elif code == 1: + * return &pqyear + * elif code == 2: # <<<<<<<<<<<<<< + * return &pquarter + * elif code == 3: + */ + case 2: + + /* "pandas/tslib.pyx":3331 + * return &pqyear + * elif code == 2: + * return &pquarter # <<<<<<<<<<<<<< + * elif code == 3: + * return &pmonth + */ + __pyx_r = (&pquarter); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3332 + * elif code == 2: + * return &pquarter + * elif code == 3: # <<<<<<<<<<<<<< + * return &pmonth + * elif code == 4: + */ + case 3: + + /* "pandas/tslib.pyx":3333 + * return &pquarter + * elif code == 3: + * return &pmonth # <<<<<<<<<<<<<< + * elif code == 4: + * return &pday + */ + __pyx_r = (&pmonth); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3334 + * elif code == 3: + * return &pmonth + * elif code == 4: # <<<<<<<<<<<<<< + * return &pday + * elif code == 5: + */ + case 4: + + /* "pandas/tslib.pyx":3335 + * return &pmonth + * elif code == 4: + * return &pday # <<<<<<<<<<<<<< + * elif code == 5: + * return &phour + */ + __pyx_r = (&pday); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3336 + * elif code == 4: + * return &pday + * elif code == 5: # <<<<<<<<<<<<<< + * return &phour + * elif code == 6: + */ + case 5: + + /* "pandas/tslib.pyx":3337 + * return &pday + * elif code == 5: + * return &phour # <<<<<<<<<<<<<< + * elif code == 6: + * return &pminute + */ + __pyx_r = (&phour); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3338 + * elif code == 5: + * return &phour + * elif code == 6: # <<<<<<<<<<<<<< + * return &pminute + * elif code == 7: + */ + case 6: + + /* "pandas/tslib.pyx":3339 + * return &phour + * elif code == 6: + * return &pminute # <<<<<<<<<<<<<< + * elif code == 7: + * return &psecond + */ + __pyx_r = (&pminute); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3340 + * elif code == 6: + * return &pminute + * elif code == 7: # <<<<<<<<<<<<<< + * return &psecond + * elif code == 8: + */ + case 7: + + /* "pandas/tslib.pyx":3341 + * return &pminute + * elif code == 7: + * return &psecond # <<<<<<<<<<<<<< + * elif code == 8: + * return &pweek + */ + __pyx_r = (&psecond); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3342 + * elif code == 7: + * return &psecond + * elif code == 8: # <<<<<<<<<<<<<< + * return &pweek + * elif code == 9: + */ + case 8: + + /* "pandas/tslib.pyx":3343 + * return &psecond + * elif code == 8: + * return &pweek # <<<<<<<<<<<<<< + * elif code == 9: + * return &pday_of_year + */ + __pyx_r = (&pweek); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3344 + * elif code == 8: + * return &pweek + * elif code == 9: # <<<<<<<<<<<<<< + * return &pday_of_year + * elif code == 10: + */ + case 9: + + /* "pandas/tslib.pyx":3345 + * return &pweek + * elif code == 9: + * return &pday_of_year # <<<<<<<<<<<<<< + * elif code == 10: + * return &pweekday + */ + __pyx_r = (&pday_of_year); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3346 + * elif code == 9: + * return &pday_of_year + * elif code == 10: # <<<<<<<<<<<<<< + * return &pweekday + * return NULL + */ + case 10: + + /* "pandas/tslib.pyx":3347 + * return &pday_of_year + * elif code == 10: + * return &pweekday # <<<<<<<<<<<<<< + * return NULL + * + */ + __pyx_r = (&pweekday); + goto __pyx_L0; + break; + default: break; + } + + /* "pandas/tslib.pyx":3348 + * elif code == 10: + * return &pweekday + * return NULL # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = NULL; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3325 + * + * + * cdef accessor _get_accessor_func(int code): # <<<<<<<<<<<<<< + * if code == 0: + * return &pyear + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3351 + * + * + * def extract_ordinals(ndarray[object] values, freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_93extract_ordinals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_93extract_ordinals = {__Pyx_NAMESTR("extract_ordinals"), (PyCFunction)__pyx_pw_6pandas_5tslib_93extract_ordinals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_93extract_ordinals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_freq = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("extract_ordinals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_freq,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("extract_ordinals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_ordinals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_freq = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("extract_ordinals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.extract_ordinals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_92extract_ordinals(__pyx_self, __pyx_v_values, __pyx_v_freq); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_92extract_ordinals(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_freq) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_ordinals = 0; + PyObject *__pyx_v_p = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ordinals; + __Pyx_Buffer __pyx_pybuffer_ordinals; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + __pyx_t_5numpy_int64_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("extract_ordinals", 0); + __pyx_pybuffer_ordinals.pybuffer.buf = NULL; + __pyx_pybuffer_ordinals.refcount = 0; + __pyx_pybuffernd_ordinals.data = NULL; + __pyx_pybuffernd_ordinals.rcbuffer = &__pyx_pybuffer_ordinals; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3353 + * def extract_ordinals(ndarray[object] values, freq): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] ordinals = np.empty(n, dtype=np.int64) + * object p + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":3354 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] ordinals = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * object p + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ordinals.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_ordinals = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ordinals.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_ordinals.diminfo[0].strides = __pyx_pybuffernd_ordinals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ordinals.diminfo[0].shape = __pyx_pybuffernd_ordinals.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_ordinals = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3357 + * object p + * + * for i in range(n): # <<<<<<<<<<<<<< + * p = values[i] + * ordinals[i] = p.ordinal + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/tslib.pyx":3358 + * + * for i in range(n): + * p = values[i] # <<<<<<<<<<<<<< + * ordinals[i] = p.ordinal + * if p.freq != freq: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3359 + * for i in range(n): + * p = values[i] + * ordinals[i] = p.ordinal # <<<<<<<<<<<<<< + * if p.freq != freq: + * raise ValueError("%s is wrong freq" % p) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_ordinal); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_11 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_ordinals.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_ordinals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ordinals.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ordinals.diminfo[0].strides) = __pyx_t_11; + + /* "pandas/tslib.pyx":3360 + * p = values[i] + * ordinals[i] = p.ordinal + * if p.freq != freq: # <<<<<<<<<<<<<< + * raise ValueError("%s is wrong freq" % p) + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_freq); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_freq, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":3361 + * ordinals[i] = p.ordinal + * if p.freq != freq: + * raise ValueError("%s is wrong freq" % p) # <<<<<<<<<<<<<< + * + * return ordinals + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_is_wrong_freq, __pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + + /* "pandas/tslib.pyx":3363 + * raise ValueError("%s is wrong freq" % p) + * + * return ordinals # <<<<<<<<<<<<<< + * + * cpdef resolution(ndarray[int64_t] stamps, tz=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ordinals)); + __pyx_r = ((PyObject *)__pyx_v_ordinals); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3351 + * + * + * def extract_ordinals(ndarray[object] values, freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ordinals.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.extract_ordinals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ordinals.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ordinals); + __Pyx_XDECREF(__pyx_v_p); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3365 + * return ordinals + * + * cpdef resolution(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + +static PyObject *__pyx_pw_6pandas_5tslib_95resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_resolution(PyArrayObject *__pyx_v_stamps, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_5tslib_resolution *__pyx_optional_args) { + PyObject *__pyx_v_tz = ((PyObject *)Py_None); + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + int __pyx_v_reso; + int __pyx_v_curr_reso; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("resolution", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_tz = __pyx_optional_args->tz; + } + } + __Pyx_INCREF(__pyx_v_tz); + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3367 + * cpdef resolution(ndarray[int64_t] stamps, tz=None): + * cdef: + * Py_ssize_t i, n = len(stamps) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * int reso = D_RESO, curr_reso + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":3369 + * Py_ssize_t i, n = len(stamps) + * pandas_datetimestruct dts + * int reso = D_RESO, curr_reso # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_D_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_reso = __pyx_t_3; + + /* "pandas/tslib.pyx":3371 + * int reso = D_RESO, curr_reso + * + * if tz is not None: # <<<<<<<<<<<<<< + * tz = maybe_get_tz(tz) + * return _reso_local(stamps, tz) + */ + __pyx_t_4 = (__pyx_v_tz != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3372 + * + * if tz is not None: + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * return _reso_local(stamps, tz) + * else: + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3373 + * if tz is not None: + * tz = maybe_get_tz(tz) + * return _reso_local(stamps, tz) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_6pandas_5tslib__reso_local(((PyArrayObject *)__pyx_v_stamps), __pyx_v_tz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":3375 + * return _reso_local(stamps, tz) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/tslib.pyx":3376 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3377 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":3378 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3379 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3380 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * return reso + */ + __pyx_t_5 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3381 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * return reso + * + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/tslib.pyx":3382 + * if curr_reso < reso: + * reso = curr_reso + * return reso # <<<<<<<<<<<<<< + * + * US_RESO = 0 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_reso); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3365 + * return ordinals + * + * cpdef resolution(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.resolution", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_95resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_95resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_stamps = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("resolution (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resolution") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_stamps = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("resolution", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.resolution", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_94resolution(__pyx_self, __pyx_v_stamps, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_94resolution(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_5tslib_resolution __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("resolution", 0); + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.tz = __pyx_v_tz; + __pyx_t_1 = __pyx_f_6pandas_5tslib_resolution(__pyx_v_stamps, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.resolution", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3391 + * D_RESO = 5 + * + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * if dts.us != 0: + * if dts.us % 1000 == 0: + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__reso_stamp(pandas_datetimestruct *__pyx_v_dts) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_reso_stamp", 0); + + /* "pandas/tslib.pyx":3392 + * + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): + * if dts.us != 0: # <<<<<<<<<<<<<< + * if dts.us % 1000 == 0: + * return MS_RESO + */ + __pyx_t_1 = ((__pyx_v_dts->us != 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3393 + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): + * if dts.us != 0: + * if dts.us % 1000 == 0: # <<<<<<<<<<<<<< + * return MS_RESO + * return US_RESO + */ + __pyx_t_1 = ((__Pyx_mod_long(__pyx_v_dts->us, 1000) == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3394 + * if dts.us != 0: + * if dts.us % 1000 == 0: + * return MS_RESO # <<<<<<<<<<<<<< + * return US_RESO + * elif dts.sec != 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MS_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3395 + * if dts.us % 1000 == 0: + * return MS_RESO + * return US_RESO # <<<<<<<<<<<<<< + * elif dts.sec != 0: + * return S_RESO + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_US_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3396 + * return MS_RESO + * return US_RESO + * elif dts.sec != 0: # <<<<<<<<<<<<<< + * return S_RESO + * elif dts.min != 0: + */ + __pyx_t_1 = ((__pyx_v_dts->sec != 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3397 + * return US_RESO + * elif dts.sec != 0: + * return S_RESO # <<<<<<<<<<<<<< + * elif dts.min != 0: + * return T_RESO + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_S_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3398 + * elif dts.sec != 0: + * return S_RESO + * elif dts.min != 0: # <<<<<<<<<<<<<< + * return T_RESO + * elif dts.hour != 0: + */ + __pyx_t_1 = ((__pyx_v_dts->min != 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3399 + * return S_RESO + * elif dts.min != 0: + * return T_RESO # <<<<<<<<<<<<<< + * elif dts.hour != 0: + * return H_RESO + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_T_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3400 + * elif dts.min != 0: + * return T_RESO + * elif dts.hour != 0: # <<<<<<<<<<<<<< + * return H_RESO + * return D_RESO + */ + __pyx_t_1 = ((__pyx_v_dts->hour != 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3401 + * return T_RESO + * elif dts.hour != 0: + * return H_RESO # <<<<<<<<<<<<<< + * return D_RESO + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_H_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3402 + * elif dts.hour != 0: + * return H_RESO + * return D_RESO # <<<<<<<<<<<<<< + * + * cdef _reso_local(ndarray[int64_t] stamps, object tz): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_D_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3391 + * D_RESO = 5 + * + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * if dts.us != 0: + * if dts.us % 1000 == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.tslib._reso_stamp", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3404 + * return D_RESO + * + * cdef _reso_local(ndarray[int64_t] stamps, object tz): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t n = len(stamps) + */ + +static PyObject *__pyx_f_6pandas_5tslib__reso_local(PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_n; + int __pyx_v_reso; + int __pyx_v_curr_reso; + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + PyArrayObject *__pyx_v_pos = 0; + pandas_datetimestruct __pyx_v_dts; + Py_ssize_t __pyx_v_i; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v__pos = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_pos; + __Pyx_Buffer __pyx_pybuffer_pos; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + npy_datetime __pyx_t_18; + PyArrayObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + int __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + long __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_reso_local", 0); + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_pos.pybuffer.buf = NULL; + __pyx_pybuffer_pos.refcount = 0; + __pyx_pybuffernd_pos.data = NULL; + __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3406 + * cdef _reso_local(ndarray[int64_t] stamps, object tz): + * cdef: + * Py_ssize_t n = len(stamps) # <<<<<<<<<<<<<< + * int reso = D_RESO, curr_reso + * ndarray[int64_t] trans, deltas, pos + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":3407 + * cdef: + * Py_ssize_t n = len(stamps) + * int reso = D_RESO, curr_reso # <<<<<<<<<<<<<< + * ndarray[int64_t] trans, deltas, pos + * pandas_datetimestruct dts + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_D_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_reso = __pyx_t_3; + + /* "pandas/tslib.pyx":3411 + * pandas_datetimestruct dts + * + * if _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3412 + * + * if _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":3413 + * if _is_utc(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3414 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":3415 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3416 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3417 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * elif _is_tzlocal(tz): + */ + __pyx_t_4 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3418 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz): + * for i in range(n): + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_L4_continue:; + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":3419 + * if curr_reso < reso: + * reso = curr_reso + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3420 + * reso = curr_reso + * elif _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":3421 + * elif _is_tzlocal(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3422 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + */ + goto __pyx_L8_continue; + } + + /* "pandas/tslib.pyx":3423 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, # <<<<<<<<<<<<<< + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3424 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3425 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + + /* "pandas/tslib.pyx":3426 + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + */ + __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/tslib.pyx":3425 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_2 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_15)); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":3427 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + */ + __pyx_t_15 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_15)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_15, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyNumber_Multiply(__pyx_t_16, __pyx_int_1000000000); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_15); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":3428 + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyNumber_Add(__pyx_t_15, __pyx_v_delta); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_18 = __Pyx_PyInt_As_npy_int64(__pyx_t_16); if (unlikely((__pyx_t_18 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":3429 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + pandas_datetime_to_datetimestruct(__pyx_t_18, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3430 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3431 + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * else: + */ + __pyx_t_4 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3432 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L11; + } + __pyx_L11:; + __pyx_L8_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3435 + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + */ + __pyx_t_16 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_16); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":3436 + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + */ + __pyx_t_16 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_16); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":3437 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 # <<<<<<<<<<<<<< + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + */ + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(((PyObject *)__pyx_v_stamps)); + PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_stamps)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_stamps)); + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyNumber_Subtract(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v__pos = __pyx_t_14; + __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":3438 + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: # <<<<<<<<<<<<<< + * _pos = _pos.astype(np.int64) + * pos = _pos + */ + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_15, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3439 + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) # <<<<<<<<<<<<<< + * pos = _pos + * + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF_SET(__pyx_v__pos, __pyx_t_14); + __pyx_t_14 = 0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/tslib.pyx":3440 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + * pos = _pos # <<<<<<<<<<<<<< + * + * # statictzinfo + */ + if (!(likely(((__pyx_v__pos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__pos, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_v__pos; + __Pyx_INCREF(__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_14), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + } + __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_pos = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":3443 + * + * # statictzinfo + * if not hasattr(tz, '_transition_info'): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_4 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3444 + * # statictzinfo + * if not hasattr(tz, '_transition_info'): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":3445 + * if not hasattr(tz, '_transition_info'): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3446 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L14_continue; + } + + /* "pandas/tslib.pyx":3447 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = 0; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3448 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3449 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3450 + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * else: + */ + __pyx_t_23 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3451 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/tslib.pyx":3453 + * reso = curr_reso + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":3454 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3455 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L18_continue; + } + + /* "pandas/tslib.pyx":3456 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_pos.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_pos.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3457 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3458 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3459 + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * + */ + __pyx_t_23 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3460 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * + * return reso + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L21; + } + __pyx_L21:; + __pyx_L18_continue:; + } + } + __pyx_L13:; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3462 + * reso = curr_reso + * + * return reso # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_reso); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3404 + * return D_RESO + * + * cdef _reso_local(ndarray[int64_t] stamps, object tz): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib._reso_local", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF((PyObject *)__pyx_v_pos); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v__pos); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3501 + * __all__ = [] + * + * def _getlang(): # <<<<<<<<<<<<<< + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_97_getlang(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_97_getlang = {__Pyx_NAMESTR("_getlang"), (PyCFunction)__pyx_pw_6pandas_5tslib_97_getlang, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_97_getlang(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getlang (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_96_getlang(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_96_getlang(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getlang", 0); + + /* "pandas/tslib.pyx":3503 + * def _getlang(): + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) # <<<<<<<<<<<<<< + * + * class LocaleTime(object): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_locale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getlocale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_locale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LC_TIME); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3501 + * __all__ = [] + * + * def _getlang(): # <<<<<<<<<<<<<< + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib._getlang", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3524 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * """Set all attributes. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_5tslib_10LocaleTime___init__[] = "Set all attributes.\n\n Order of methods called matters for dependency reasons.\n\n The locale language is set at the offset and then checked again before\n exiting. This is to make sure that the attributes were not set with a\n mix of information from more than one locale. This would most likely\n happen when using threads where one thread calls a locale-dependent\n function while another thread changes the locale while the function in\n the other thread is still running. Proper coding would call for\n locks to prevent changing the locale while locale-dependent code is\n running. The check here is done in case someone does not think about\n doing this.\n\n Only other possible issue is if someone changed the timezone and did\n not call tz.tzset . That is an issue for the programmer, though,\n since changing the timezone is worthless without that call.\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_1__init__, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_10LocaleTime___init__)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/tslib.pyx":3544 + * + * """ + * self.lang = _getlang() # <<<<<<<<<<<<<< + * self.__calc_weekday() + * self.__calc_month() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_getlang); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lang, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3545 + * """ + * self.lang = _getlang() + * self.__calc_weekday() # <<<<<<<<<<<<<< + * self.__calc_month() + * self.__calc_am_pm() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_weekday); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3546 + * self.lang = _getlang() + * self.__calc_weekday() + * self.__calc_month() # <<<<<<<<<<<<<< + * self.__calc_am_pm() + * self.__calc_timezone() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3547 + * self.__calc_weekday() + * self.__calc_month() + * self.__calc_am_pm() # <<<<<<<<<<<<<< + * self.__calc_timezone() + * self.__calc_date_time() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_am_pm); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3548 + * self.__calc_month() + * self.__calc_am_pm() + * self.__calc_timezone() # <<<<<<<<<<<<<< + * self.__calc_date_time() + * if _getlang() != self.lang: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_timezone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3549 + * self.__calc_am_pm() + * self.__calc_timezone() + * self.__calc_date_time() # <<<<<<<<<<<<<< + * if _getlang() != self.lang: + * raise ValueError("locale changed during initialization") + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_date_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3550 + * self.__calc_timezone() + * self.__calc_date_time() + * if _getlang() != self.lang: # <<<<<<<<<<<<<< + * raise ValueError("locale changed during initialization") + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_getlang); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lang); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3551 + * self.__calc_date_time() + * if _getlang() != self.lang: + * raise ValueError("locale changed during initialization") # <<<<<<<<<<<<<< + * + * def __pad(self, seq, front): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3524 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * """Set all attributes. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3553 + * raise ValueError("locale changed during initialization") + * + * def __pad(self, seq, front): # <<<<<<<<<<<<<< + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_3__pad(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_3__pad = {__Pyx_NAMESTR("__pad"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_3__pad, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_3__pad(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_seq = 0; + PyObject *__pyx_v_front = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pad (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq,&__pyx_n_s_front,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pad", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_front)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pad", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pad") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_seq = values[1]; + __pyx_v_front = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pad", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__pad", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_2__pad(__pyx_self, __pyx_v_self, __pyx_v_seq, __pyx_v_front); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_2__pad(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_front) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pad", 0); + __Pyx_INCREF(__pyx_v_seq); + + /* "pandas/tslib.pyx":3555 + * def __pad(self, seq, front): + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) # <<<<<<<<<<<<<< + * if front: + * seq.insert(0, '') + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_seq); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq); + __Pyx_GIVEREF(__pyx_v_seq); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3556 + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + * if front: # <<<<<<<<<<<<<< + * seq.insert(0, '') + * else: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_front); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":3557 + * seq = list(seq) + * if front: + * seq.insert(0, '') # <<<<<<<<<<<<<< + * else: + * seq.append('') + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_seq, __pyx_n_s_insert); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3559 + * seq.insert(0, '') + * else: + * seq.append('') # <<<<<<<<<<<<<< + * return seq + * + */ + __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_seq, __pyx_kp_s__5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3560 + * else: + * seq.append('') + * return seq # <<<<<<<<<<<<<< + * + * def __calc_weekday(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_seq); + __pyx_r = __pyx_v_seq; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3553 + * raise ValueError("locale changed during initialization") + * + * def __pad(self, seq, front): # <<<<<<<<<<<<<< + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__pad", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_seq); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3562 + * return seq + * + * def __calc_weekday(self): # <<<<<<<<<<<<<< + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_5__calc_weekday(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_5__calc_weekday = {__Pyx_NAMESTR("__calc_weekday"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_5__calc_weekday, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_5__calc_weekday(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_weekday (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_4__calc_weekday(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_4__calc_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_a_weekday = NULL; + PyObject *__pyx_v_f_weekday = NULL; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + long __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_weekday", 0); + + /* "pandas/tslib.pyx":3565 + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + * a_weekday = [calendar.day_abbr[i].lower() for i in range(7)] # <<<<<<<<<<<<<< + * f_weekday = [calendar.day_name[i].lower() for i in range(7)] + * self.a_weekday = a_weekday + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + for (__pyx_t_2 = 0; __pyx_t_2 < 7; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_day_abbr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_a_weekday = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3566 + * # module. + * a_weekday = [calendar.day_abbr[i].lower() for i in range(7)] + * f_weekday = [calendar.day_name[i].lower() for i in range(7)] # <<<<<<<<<<<<<< + * self.a_weekday = a_weekday + * self.f_weekday = f_weekday + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + for (__pyx_t_2 = 0; __pyx_t_2 < 7; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_day_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_f_weekday = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3567 + * a_weekday = [calendar.day_abbr[i].lower() for i in range(7)] + * f_weekday = [calendar.day_name[i].lower() for i in range(7)] + * self.a_weekday = a_weekday # <<<<<<<<<<<<<< + * self.f_weekday = f_weekday + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_a_weekday, __pyx_v_a_weekday) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3568 + * f_weekday = [calendar.day_name[i].lower() for i in range(7)] + * self.a_weekday = a_weekday + * self.f_weekday = f_weekday # <<<<<<<<<<<<<< + * + * def __calc_month(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_f_weekday, __pyx_v_f_weekday) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3562 + * return seq + * + * def __calc_weekday(self): # <<<<<<<<<<<<<< + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_a_weekday); + __Pyx_XDECREF(__pyx_v_f_weekday); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3570 + * self.f_weekday = f_weekday + * + * def __calc_month(self): # <<<<<<<<<<<<<< + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_7__calc_month(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_7__calc_month = {__Pyx_NAMESTR("__calc_month"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_7__calc_month, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_7__calc_month(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_month (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_6__calc_month(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_6__calc_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_a_month = NULL; + PyObject *__pyx_v_f_month = NULL; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + long __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_month", 0); + + /* "pandas/tslib.pyx":3572 + * def __calc_month(self): + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] # <<<<<<<<<<<<<< + * f_month = [calendar.month_name[i].lower() for i in range(13)] + * self.a_month = a_month + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + for (__pyx_t_2 = 0; __pyx_t_2 < 13; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_month_abbr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_a_month = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3573 + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + * f_month = [calendar.month_name[i].lower() for i in range(13)] # <<<<<<<<<<<<<< + * self.a_month = a_month + * self.f_month = f_month + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + for (__pyx_t_2 = 0; __pyx_t_2 < 13; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_month_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_f_month = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3574 + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + * f_month = [calendar.month_name[i].lower() for i in range(13)] + * self.a_month = a_month # <<<<<<<<<<<<<< + * self.f_month = f_month + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_a_month, __pyx_v_a_month) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3575 + * f_month = [calendar.month_name[i].lower() for i in range(13)] + * self.a_month = a_month + * self.f_month = f_month # <<<<<<<<<<<<<< + * + * def __calc_am_pm(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_f_month, __pyx_v_f_month) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3570 + * self.f_weekday = f_weekday + * + * def __calc_month(self): # <<<<<<<<<<<<<< + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_month", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_a_month); + __Pyx_XDECREF(__pyx_v_f_month); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3577 + * self.f_month = f_month + * + * def __calc_am_pm(self): # <<<<<<<<<<<<<< + * # Set self.am_pm by using time.strftime(). + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_9__calc_am_pm(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_9__calc_am_pm = {__Pyx_NAMESTR("__calc_am_pm"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_9__calc_am_pm, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_9__calc_am_pm(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_am_pm (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_8__calc_am_pm(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_8__calc_am_pm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_am_pm = NULL; + long __pyx_v_hour; + PyObject *__pyx_v_time_tuple = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + long __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_am_pm", 0); + + /* "pandas/tslib.pyx":3583 + * # magical; just happened to have used it everywhere else where a + * # static date was needed. + * am_pm = [] # <<<<<<<<<<<<<< + * for hour in (01,22): + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_am_pm = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3584 + * # static date was needed. + * am_pm = [] + * for hour in (01,22): # <<<<<<<<<<<<<< + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + * am_pm.append(time.strftime("%p", time_tuple).lower()) + */ + __pyx_t_1 = __pyx_tuple__86; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= 2) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_t_4 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_hour = __pyx_t_4; + + /* "pandas/tslib.pyx":3585 + * am_pm = [] + * for hour in (01,22): + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) # <<<<<<<<<<<<<< + * am_pm.append(time.strftime("%p", time_tuple).lower()) + * self.am_pm = am_pm + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_struct_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_1999); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_1999); + __Pyx_GIVEREF(__pyx_int_1999); + __Pyx_INCREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + __Pyx_INCREF(__pyx_int_17); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_17); + __Pyx_GIVEREF(__pyx_int_17); + PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_44); + PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_int_44); + __Pyx_GIVEREF(__pyx_int_44); + __Pyx_INCREF(__pyx_int_55); + PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_55); + __Pyx_GIVEREF(__pyx_int_55); + __Pyx_INCREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + __Pyx_INCREF(__pyx_int_76); + PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_int_76); + __Pyx_GIVEREF(__pyx_int_76); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_6, 8, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_time_tuple, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3586 + * for hour in (01,22): + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + * am_pm.append(time.strftime("%p", time_tuple).lower()) # <<<<<<<<<<<<<< + * self.am_pm = am_pm + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strftime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_kp_s_p_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_p_2); + __Pyx_GIVEREF(__pyx_kp_s_p_2); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lower); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_am_pm, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3587 + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + * am_pm.append(time.strftime("%p", time_tuple).lower()) + * self.am_pm = am_pm # <<<<<<<<<<<<<< + * + * def __calc_date_time(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_am_pm, __pyx_v_am_pm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3577 + * self.f_month = f_month + * + * def __calc_am_pm(self): # <<<<<<<<<<<<<< + * # Set self.am_pm by using time.strftime(). + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_am_pm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_am_pm); + __Pyx_XDECREF(__pyx_v_time_tuple); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3589 + * self.am_pm = am_pm + * + * def __calc_date_time(self): # <<<<<<<<<<<<<< + * # Set self.date_time, self.date, & self.time by using + * # time.strftime(). + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_11__calc_date_time(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_11__calc_date_time = {__Pyx_NAMESTR("__calc_date_time"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_11__calc_date_time, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_11__calc_date_time(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_date_time (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_10__calc_date_time(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_10__calc_date_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_time_tuple = NULL; + PyObject *__pyx_v_date_time = NULL; + PyObject *__pyx_v_replacement_pairs = NULL; + PyObject *__pyx_v_offset = NULL; + PyObject *__pyx_v_directive = NULL; + PyObject *__pyx_v_current_format = NULL; + PyObject *__pyx_v_old = NULL; + PyObject *__pyx_v_new = NULL; + PyObject *__pyx_v_U_W = NULL; + PyObject *__pyx_v_tz_values = NULL; + PyObject *__pyx_v_tz = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + int __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_date_time", 0); + + /* "pandas/tslib.pyx":3597 + * # values within the format string is very important; it eliminates + * # possible ambiguity for what something represents. + * time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) # <<<<<<<<<<<<<< + * date_time = [None, None, None] + * date_time[0] = time.strftime("%c", time_tuple).lower() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_struct_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_time_tuple = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3598 + * # possible ambiguity for what something represents. + * time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) + * date_time = [None, None, None] # <<<<<<<<<<<<<< + * date_time[0] = time.strftime("%c", time_tuple).lower() + * date_time[1] = time.strftime("%x", time_tuple).lower() + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 2, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_v_date_time = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3599 + * time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) + * date_time = [None, None, None] + * date_time[0] = time.strftime("%c", time_tuple).lower() # <<<<<<<<<<<<<< + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strftime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_c); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_c); + __Pyx_GIVEREF(__pyx_kp_s_c); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_date_time, 0, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3600 + * date_time = [None, None, None] + * date_time[0] = time.strftime("%c", time_tuple).lower() + * date_time[1] = time.strftime("%x", time_tuple).lower() # <<<<<<<<<<<<<< + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strftime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_x); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_x); + __Pyx_GIVEREF(__pyx_kp_s_x); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_date_time, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3601 + * date_time[0] = time.strftime("%c", time_tuple).lower() + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() # <<<<<<<<<<<<<< + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strftime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_s_X); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_X); + __Pyx_GIVEREF(__pyx_kp_s_X); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_date_time, 2, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3602 + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), # <<<<<<<<<<<<<< + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_f_weekday); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_s_A_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_A_2); + __Pyx_GIVEREF(__pyx_kp_s_A_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3603 + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), # <<<<<<<<<<<<<< + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_f_month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_B_2); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_B_2); + __Pyx_GIVEREF(__pyx_kp_s_B_2); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a_weekday); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_a_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_a_2); + __Pyx_GIVEREF(__pyx_kp_s_a_2); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3604 + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), # <<<<<<<<<<<<<< + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), + * ('44', '%M'), ('55', '%S'), ('76', '%j'), + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a_month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_b_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_s_b_2); + __Pyx_GIVEREF(__pyx_kp_s_b_2); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_am_pm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_kp_s_p_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_p_2); + __Pyx_GIVEREF(__pyx_kp_s_p_2); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3602 + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), # <<<<<<<<<<<<<< + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + */ + __pyx_t_6 = PyList_New(17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_tuple__90); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_6, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_6, 4, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_6, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_tuple__91); + PyList_SET_ITEM(__pyx_t_6, 6, __pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + __Pyx_INCREF(__pyx_tuple__92); + PyList_SET_ITEM(__pyx_t_6, 7, __pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __Pyx_INCREF(__pyx_tuple__93); + PyList_SET_ITEM(__pyx_t_6, 8, __pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + __Pyx_INCREF(__pyx_tuple__94); + PyList_SET_ITEM(__pyx_t_6, 9, __pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __Pyx_INCREF(__pyx_tuple__95); + PyList_SET_ITEM(__pyx_t_6, 10, __pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __Pyx_INCREF(__pyx_tuple__96); + PyList_SET_ITEM(__pyx_t_6, 11, __pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __Pyx_INCREF(__pyx_tuple__97); + PyList_SET_ITEM(__pyx_t_6, 12, __pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __Pyx_INCREF(__pyx_tuple__98); + PyList_SET_ITEM(__pyx_t_6, 13, __pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __Pyx_INCREF(__pyx_tuple__99); + PyList_SET_ITEM(__pyx_t_6, 14, __pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __Pyx_INCREF(__pyx_tuple__100); + PyList_SET_ITEM(__pyx_t_6, 15, __pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __Pyx_INCREF(__pyx_tuple__101); + PyList_SET_ITEM(__pyx_t_6, 16, __pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_v_replacement_pairs = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3610 + * # '3' needed for when no leading zero. + * ('2', '%w'), ('10', '%I')] + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone # <<<<<<<<<<<<<< + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_timezone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { + __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_tz_values, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3611 + * ('2', '%w'), ('10', '%I')] + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone + * for tz in tz_values]) # <<<<<<<<<<<<<< + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + * current_format = date_time[offset] + */ + if (PyList_CheckExact(__pyx_v_tz_values) || PyTuple_CheckExact(__pyx_v_tz_values)) { + __pyx_t_5 = __pyx_v_tz_values; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_tz_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + for (;;) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_10(__pyx_t_5); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_tz, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3610 + * # '3' needed for when no leading zero. + * ('2', '%w'), ('10', '%I')] + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone # <<<<<<<<<<<<<< + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_INCREF(__pyx_kp_s_Z_3); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_Z_3); + __Pyx_GIVEREF(__pyx_kp_s_Z_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyList_Extend(__pyx_v_replacement_pairs, __pyx_t_6); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3612 + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): # <<<<<<<<<<<<<< + * current_format = date_time[offset] + * for old, new in replacement_pairs: + */ + __pyx_t_6 = __pyx_tuple__105; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (likely(__pyx_t_4 != Py_None)) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_XDECREF_SET(__pyx_v_offset, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_directive, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3613 + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + * current_format = date_time[offset] # <<<<<<<<<<<<<< + * for old, new in replacement_pairs: + * # Must deal with possible lack of locale info + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_date_time, __pyx_v_offset); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_current_format, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3614 + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + * current_format = date_time[offset] + * for old, new in replacement_pairs: # <<<<<<<<<<<<<< + * # Must deal with possible lack of locale info + * # manifesting itself as the empty string (e.g., Swedish's + */ + __pyx_t_4 = __pyx_v_replacement_pairs; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; + for (;;) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_2 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L12_unpacking_done; + __pyx_L11_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L12_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3619 + * # lack of AM/PM info) or a platform returning a tuple of empty + * # strings (e.g., MacOS 9 having timezone as ('','')). + * if old: # <<<<<<<<<<<<<< + * current_format = current_format.replace(old, new) + * # If %W is used, then Sunday, 2005-01-03 will fall on week 0 since + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_old); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":3620 + * # strings (e.g., MacOS 9 having timezone as ('','')). + * if old: + * current_format = current_format.replace(old, new) # <<<<<<<<<<<<<< + * # If %W is used, then Sunday, 2005-01-03 will fall on week 0 since + * # 2005-01-03 occurs before the first Monday of the year. Otherwise + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_current_format, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_old); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_old); + __Pyx_GIVEREF(__pyx_v_old); + __Pyx_INCREF(__pyx_v_new); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_new); + __Pyx_GIVEREF(__pyx_v_new); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_current_format, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3624 + * # 2005-01-03 occurs before the first Monday of the year. Otherwise + * # %U is used. + * time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0)) # <<<<<<<<<<<<<< + * if '00' in time.strftime(directive, time_tuple): + * U_W = '%W' + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_struct_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_time_tuple, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3625 + * # %U is used. + * time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0)) + * if '00' in time.strftime(directive, time_tuple): # <<<<<<<<<<<<<< + * U_W = '%W' + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strftime); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_directive); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_directive); + __Pyx_GIVEREF(__pyx_v_directive); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_kp_s_00, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "pandas/tslib.pyx":3626 + * time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0)) + * if '00' in time.strftime(directive, time_tuple): + * U_W = '%W' # <<<<<<<<<<<<<< + * else: + * U_W = '%U' + */ + __Pyx_INCREF(__pyx_kp_s_W_2); + __Pyx_XDECREF_SET(__pyx_v_U_W, __pyx_kp_s_W_2); + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/tslib.pyx":3628 + * U_W = '%W' + * else: + * U_W = '%U' # <<<<<<<<<<<<<< + * date_time[offset] = current_format.replace('11', U_W) + * self.LC_date_time = date_time[0] + */ + __Pyx_INCREF(__pyx_kp_s_U_2); + __Pyx_XDECREF_SET(__pyx_v_U_W, __pyx_kp_s_U_2); + } + __pyx_L14:; + + /* "pandas/tslib.pyx":3629 + * else: + * U_W = '%U' + * date_time[offset] = current_format.replace('11', U_W) # <<<<<<<<<<<<<< + * self.LC_date_time = date_time[0] + * self.LC_date = date_time[1] + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_current_format, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_11); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_11); + __Pyx_GIVEREF(__pyx_kp_s_11); + __Pyx_INCREF(__pyx_v_U_W); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_U_W); + __Pyx_GIVEREF(__pyx_v_U_W); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_date_time, __pyx_v_offset, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3630 + * U_W = '%U' + * date_time[offset] = current_format.replace('11', U_W) + * self.LC_date_time = date_time[0] # <<<<<<<<<<<<<< + * self.LC_date = date_time[1] + * self.LC_time = date_time[2] + */ + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_date_time, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_LC_date_time, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3631 + * date_time[offset] = current_format.replace('11', U_W) + * self.LC_date_time = date_time[0] + * self.LC_date = date_time[1] # <<<<<<<<<<<<<< + * self.LC_time = date_time[2] + * + */ + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_date_time, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_LC_date, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3632 + * self.LC_date_time = date_time[0] + * self.LC_date = date_time[1] + * self.LC_time = date_time[2] # <<<<<<<<<<<<<< + * + * def __calc_timezone(self): + */ + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_date_time, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_LC_time, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3589 + * self.am_pm = am_pm + * + * def __calc_date_time(self): # <<<<<<<<<<<<<< + * # Set self.date_time, self.date, & self.time by using + * # time.strftime(). + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_date_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_time_tuple); + __Pyx_XDECREF(__pyx_v_date_time); + __Pyx_XDECREF(__pyx_v_replacement_pairs); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XDECREF(__pyx_v_directive); + __Pyx_XDECREF(__pyx_v_current_format); + __Pyx_XDECREF(__pyx_v_old); + __Pyx_XDECREF(__pyx_v_new); + __Pyx_XDECREF(__pyx_v_U_W); + __Pyx_XDECREF(__pyx_v_tz_values); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3634 + * self.LC_time = date_time[2] + * + * def __calc_timezone(self): # <<<<<<<<<<<<<< + * # Set self.timezone by using time.tzname. + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_13__calc_timezone(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_13__calc_timezone = {__Pyx_NAMESTR("__calc_timezone"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_13__calc_timezone, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_13__calc_timezone(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_timezone (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_12__calc_timezone(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_12__calc_timezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_no_saving = NULL; + PyObject *__pyx_v_has_saving = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_timezone", 0); + + /* "pandas/tslib.pyx":3638 + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + * # and time.daylight; handle that in strptime . + * try: # <<<<<<<<<<<<<< + * time.tzset() + * except AttributeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":3639 + * # and time.daylight; handle that in strptime . + * try: + * time.tzset() # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tzset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3640 + * try: + * time.tzset() + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_6) { + PyErr_Restore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":3642 + * except AttributeError: + * pass + * no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) # <<<<<<<<<<<<<< + * if time.daylight: + * has_saving = frozenset([time.tzname[1].lower()]) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tzname); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_utc); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_utc); + __Pyx_GIVEREF(__pyx_n_s_utc); + __Pyx_INCREF(__pyx_n_s_gmt); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_gmt); + __Pyx_GIVEREF(__pyx_n_s_gmt); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyFrozenSet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_no_saving = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3643 + * pass + * no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) + * if time.daylight: # <<<<<<<<<<<<<< + * has_saving = frozenset([time.tzname[1].lower()]) + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_daylight); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3644 + * no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) + * if time.daylight: + * has_saving = frozenset([time.tzname[1].lower()]) # <<<<<<<<<<<<<< + * else: + * has_saving = frozenset() + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tzname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyFrozenSet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_has_saving = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/tslib.pyx":3646 + * has_saving = frozenset([time.tzname[1].lower()]) + * else: + * has_saving = frozenset() # <<<<<<<<<<<<<< + * self.timezone = (no_saving, has_saving) + * + */ + __pyx_t_5 = __Pyx_PyFrozenSet_New(((PyObject *)NULL)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_has_saving = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":3647 + * else: + * has_saving = frozenset() + * self.timezone = (no_saving, has_saving) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_no_saving); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_no_saving); + __Pyx_GIVEREF(__pyx_v_no_saving); + __Pyx_INCREF(__pyx_v_has_saving); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_has_saving); + __Pyx_GIVEREF(__pyx_v_has_saving); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_timezone, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3634 + * self.LC_time = date_time[2] + * + * def __calc_timezone(self): # <<<<<<<<<<<<<< + * # Set self.timezone by using time.tzname. + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_timezone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_no_saving); + __Pyx_XDECREF(__pyx_v_has_saving); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_6TimeRE___init__[] = "Create keys/values.\n\n Order of execution is important for dependency reasons.\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_6TimeRE_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_6pandas_5tslib_6TimeRE_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_6TimeRE___init__)}; +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_locale_time = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_locale_time,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_locale_time); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_locale_time = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_6TimeRE___init__(__pyx_self, __pyx_v_self, __pyx_v_locale_time); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_6pandas_5tslib_6TimeRE_8__init___2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + +/* "pandas/tslib.pyx":3686 + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone # <<<<<<<<<<<<<< + * for tz in tz_names), + * 'Z'), + */ + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_8__init___genexpr(PyObject *__pyx_self) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_1_genexpr(__pyx_ptype_6pandas_5tslib___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *) __pyx_self; + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6pandas_5tslib_6TimeRE_8__init___2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.__init__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6pandas_5tslib_6TimeRE_8__init___2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L8_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tz_names); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tz_names, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3687 + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone + * for tz in tz_names), # <<<<<<<<<<<<<< + * 'Z'), + * '%': '%'}) + */ + if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_tz_names) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_tz_names)) { + __pyx_t_2 = __pyx_cur_scope->__pyx_v_tz_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_tz_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_2); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tz); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tz, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":3686 + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone # <<<<<<<<<<<<<< + * for tz in tz_names), + * 'Z'), + */ + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tz); + __pyx_r = __pyx_cur_scope->__pyx_v_tz; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __Pyx_XGIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = __pyx_t_5; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_6; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L8_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_4; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_5; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return NULL; +} + +/* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_locale_time) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *__pyx_cur_scope; + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)__pyx_tp_new_6pandas_5tslib___pyx_scope_struct____init__(__pyx_ptype_6pandas_5tslib___pyx_scope_struct____init__, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); + + /* "pandas/tslib.pyx":3659 + * + * """ + * if locale_time: # <<<<<<<<<<<<<< + * self.locale_time = locale_time + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_locale_time); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3660 + * """ + * if locale_time: + * self.locale_time = locale_time # <<<<<<<<<<<<<< + * else: + * self.locale_time = LocaleTime() + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time, __pyx_v_locale_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3662 + * self.locale_time = locale_time + * else: + * self.locale_time = LocaleTime() # <<<<<<<<<<<<<< + * base = super(TimeRE, self) + * base.__init__({ + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LocaleTime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3663 + * else: + * self.locale_time = LocaleTime() + * base = super(TimeRE, self) # <<<<<<<<<<<<<< + * base.__init__({ + * # The " \d" part of the regex is to make %c from ANSI C work + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_base = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3664 + * self.locale_time = LocaleTime() + * base = super(TimeRE, self) + * base.__init__({ # <<<<<<<<<<<<<< + * # The " \d" part of the regex is to make %c from ANSI C work + * 'd': r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])", + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_d, __pyx_kp_s_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_f, __pyx_kp_s_P_f_0_9_1_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_H, __pyx_kp_s_P_H_2_0_3_0_1_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_I, __pyx_kp_s_P_I_1_0_2_0_1_9_1_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_j, __pyx_kp_s_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_m, __pyx_kp_s_P_m_1_0_2_0_1_9_1_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_M, __pyx_kp_s_P_M_0_5_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_S, __pyx_kp_s_P_S_6_0_1_0_5_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_U, __pyx_kp_s_P_U_5_0_3_0_4_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_w, __pyx_kp_s_P_w_0_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_y, __pyx_kp_s_P_y_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_Y, __pyx_kp_s_P_Y_d_d_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3681 + * # 4 digits? + * 'Y': r"(?P\d\d\d\d)", + * 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), # <<<<<<<<<<<<<< + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_f_weekday); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_A); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_A); + __Pyx_GIVEREF(__pyx_n_s_A); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_A, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3682 + * 'Y': r"(?P\d\d\d\d)", + * 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), # <<<<<<<<<<<<<< + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_a_weekday); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_a); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_a); + __Pyx_GIVEREF(__pyx_n_s_a); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_a, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3683 + * 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), # <<<<<<<<<<<<<< + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_f_month); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_6, 1, 0, NULL, NULL, &__pyx_slice__108, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_B); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_B); + __Pyx_GIVEREF(__pyx_n_s_B); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_B, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3684 + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), # <<<<<<<<<<<<<< + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_a_month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__109, 1, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_b); + __Pyx_GIVEREF(__pyx_n_s_b); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_b, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3685 + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), # <<<<<<<<<<<<<< + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone + * for tz in tz_names), + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_am_pm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_p); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_p); + __Pyx_GIVEREF(__pyx_n_s_p); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_p, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3686 + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone # <<<<<<<<<<<<<< + * for tz in tz_names), + * 'Z'), + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __pyx_pf_6pandas_5tslib_6TimeRE_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_Z_2); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_Z_2); + __Pyx_GIVEREF(__pyx_n_s_Z_2); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_Z_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s__52, __pyx_kp_s__52) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3664 + * self.locale_time = LocaleTime() + * base = super(TimeRE, self) + * base.__init__({ # <<<<<<<<<<<<<< + * # The " \d" part of the regex is to make %c from ANSI C work + * 'd': r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])", + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3690 + * 'Z'), + * '%': '%'}) + * base.__setitem__('W', base.__getitem__('U').replace('U', 'W')) # <<<<<<<<<<<<<< + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_setitem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_getitem); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_W); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_W); + __Pyx_GIVEREF(__pyx_n_s_W); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3691 + * '%': '%'}) + * base.__setitem__('W', base.__getitem__('U').replace('U', 'W')) + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) # <<<<<<<<<<<<<< + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_setitem); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_pattern); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_LC_date_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_c_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_c_2); + __Pyx_GIVEREF(__pyx_n_s_c_2); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3692 + * base.__setitem__('W', base.__getitem__('U').replace('U', 'W')) + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) # <<<<<<<<<<<<<< + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_setitem); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_pattern); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_LC_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_x_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_x_2); + __Pyx_GIVEREF(__pyx_n_s_x_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3693 + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) # <<<<<<<<<<<<<< + * + * def __seqToRE(self, to_convert, directive): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_setitem); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_pattern); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_LC_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_X_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_X_2); + __Pyx_GIVEREF(__pyx_n_s_X_2); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.TimeRE.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_base); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_3__seqToRE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_6TimeRE_2__seqToRE[] = "Convert a list to a regex string for matching a directive.\n\n Want possible matching values to be from longest to shortest. This\n prevents the possibility of a match occuring for a value that also\n a substring of a larger value that should have matched (e.g., 'abc'\n matching when 'abcdef' should have been the match).\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_6TimeRE_3__seqToRE = {__Pyx_NAMESTR("__seqToRE"), (PyCFunction)__pyx_pw_6pandas_5tslib_6TimeRE_3__seqToRE, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_6TimeRE_2__seqToRE)}; +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_3__seqToRE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_to_convert = 0; + PyObject *__pyx_v_directive = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__seqToRE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_to_convert,&__pyx_n_s_directive,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_convert)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__seqToRE", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_directive)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__seqToRE", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__seqToRE") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_to_convert = values[1]; + __pyx_v_directive = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__seqToRE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.__seqToRE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_6TimeRE_2__seqToRE(__pyx_self, __pyx_v_self, __pyx_v_to_convert, __pyx_v_directive); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_6pandas_5tslib_6TimeRE_9__seqToRE_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + +/* "pandas/tslib.pyx":3710 + * else: + * return '' + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) # <<<<<<<<<<<<<< + * regex = '(?P<%s>%s' % (directive, regex) + * return '%s)' % regex + */ + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_9__seqToRE_genexpr(PyObject *__pyx_self) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_3_genexpr(__pyx_ptype_6pandas_5tslib___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *) __pyx_self; + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6pandas_5tslib_6TimeRE_9__seqToRE_2generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.__seqToRE.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6pandas_5tslib_6TimeRE_9__seqToRE_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert)) { __Pyx_RaiseClosureNameError("to_convert"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_stuff); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_stuff, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re_escape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stuff); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_stuff); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stuff); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return NULL; +} + +/* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_2__seqToRE(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_to_convert, PyObject *__pyx_v_directive) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *__pyx_cur_scope; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_regex = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__seqToRE", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_2___seqToRE(__pyx_ptype_6pandas_5tslib___pyx_scope_struct_2___seqToRE, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_to_convert = __pyx_v_to_convert; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_to_convert); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_to_convert); + + /* "pandas/tslib.pyx":3704 + * + * """ + * to_convert = sorted(to_convert, key=len, reverse=True) # <<<<<<<<<<<<<< + * for value in to_convert: + * if value != '': + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_to_convert); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_to_convert); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_to_convert); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetBuiltinName(__pyx_n_s_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_to_convert); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_to_convert, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3705 + * """ + * to_convert = sorted(to_convert, key=len, reverse=True) + * for value in to_convert: # <<<<<<<<<<<<<< + * if value != '': + * break + */ + if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_to_convert) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_to_convert)) { + __pyx_t_3 = __pyx_cur_scope->__pyx_v_to_convert; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_to_convert); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3706 + * to_convert = sorted(to_convert, key=len, reverse=True) + * for value in to_convert: + * if value != '': # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_kp_s__5, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":3707 + * for value in to_convert: + * if value != '': + * break # <<<<<<<<<<<<<< + * else: + * return '' + */ + goto __pyx_L4_break; + } + } + /*else*/ { + + /* "pandas/tslib.pyx":3709 + * break + * else: + * return '' # <<<<<<<<<<<<<< + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) + * regex = '(?P<%s>%s' % (directive, regex) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_r = __pyx_kp_s__5; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + } + __pyx_L4_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3710 + * else: + * return '' + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) # <<<<<<<<<<<<<< + * regex = '(?P<%s>%s' % (directive, regex) + * return '%s)' % regex + */ + __pyx_t_3 = __pyx_pf_6pandas_5tslib_6TimeRE_9__seqToRE_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__112, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_regex = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3711 + * return '' + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) + * regex = '(?P<%s>%s' % (directive, regex) # <<<<<<<<<<<<<< + * return '%s)' % regex + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_directive); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_directive); + __Pyx_GIVEREF(__pyx_v_directive); + __Pyx_INCREF(__pyx_v_regex); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_regex); + __Pyx_GIVEREF(__pyx_v_regex); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_P_s_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_regex, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3712 + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) + * regex = '(?P<%s>%s' % (directive, regex) + * return '%s)' % regex # <<<<<<<<<<<<<< + * + * def pattern(self, format): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_2, __pyx_v_regex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.TimeRE.__seqToRE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_regex); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3714 + * return '%s)' % regex + * + * def pattern(self, format): # <<<<<<<<<<<<<< + * """Return regex pattern for the format string. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_5pattern(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_6TimeRE_4pattern[] = "Return regex pattern for the format string.\n\n Need to make sure that any characters that might be interpreted as\n regex syntax are escaped.\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_6TimeRE_5pattern = {__Pyx_NAMESTR("pattern"), (PyCFunction)__pyx_pw_6pandas_5tslib_6TimeRE_5pattern, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_6TimeRE_4pattern)}; +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_5pattern(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_format = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pattern (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pattern", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pattern") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_format = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pattern", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.pattern", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_6TimeRE_4pattern(__pyx_self, __pyx_v_self, __pyx_v_format); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_4pattern(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format) { + PyObject *__pyx_v_processed_format = NULL; + PyObject *__pyx_v_regex_chars = NULL; + PyObject *__pyx_v_whitespace_replacement = NULL; + PyObject *__pyx_v_directive_index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pattern", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "pandas/tslib.pyx":3721 + * + * """ + * processed_format = '' # <<<<<<<<<<<<<< + * # The sub() call escapes all characters that might be misconstrued + * # as regex syntax. Cannot use re.escape since we have to deal with + */ + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_v_processed_format = __pyx_kp_s__5; + + /* "pandas/tslib.pyx":3725 + * # as regex syntax. Cannot use re.escape since we have to deal with + * # format directives (%m, etc.). + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") # <<<<<<<<<<<<<< + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re_compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_regex_chars = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3726 + * # format directives (%m, etc.). + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") + * format = regex_chars.sub(r"\\\1", format) # <<<<<<<<<<<<<< + * whitespace_replacement = re_compile('\s+') + * format = whitespace_replacement.sub('\s+', format) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_regex_chars, __pyx_n_s_sub_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_1); + __Pyx_GIVEREF(__pyx_kp_s_1); + __Pyx_INCREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3727 + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') # <<<<<<<<<<<<<< + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re_compile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_whitespace_replacement = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3728 + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') + * format = whitespace_replacement.sub('\s+', format) # <<<<<<<<<<<<<< + * while '%' in format: + * directive_index = format.index('%')+1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_whitespace_replacement, __pyx_n_s_sub_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_s_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_s_3); + __Pyx_GIVEREF(__pyx_kp_s_s_3); + __Pyx_INCREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3729 + * whitespace_replacement = re_compile('\s+') + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: # <<<<<<<<<<<<<< + * directive_index = format.index('%')+1 + * processed_format = "%s%s%s" % (processed_format, + */ + while (1) { + __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_kp_s__52, __pyx_v_format, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_4 != 0); + if (!__pyx_t_5) break; + + /* "pandas/tslib.pyx":3730 + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: + * directive_index = format.index('%')+1 # <<<<<<<<<<<<<< + * processed_format = "%s%s%s" % (processed_format, + * format[:directive_index-1], + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_directive_index, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3732 + * directive_index = format.index('%')+1 + * processed_format = "%s%s%s" % (processed_format, + * format[:directive_index-1], # <<<<<<<<<<<<<< + * self[format[directive_index]]) + * format = format[directive_index+1:] + */ + __pyx_t_2 = PyNumber_Subtract(__pyx_v_directive_index, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_format, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3733 + * processed_format = "%s%s%s" % (processed_format, + * format[:directive_index-1], + * self[format[directive_index]]) # <<<<<<<<<<<<<< + * format = format[directive_index+1:] + * return "%s%s" % (processed_format, format) + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_format, __pyx_v_directive_index); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetItem(__pyx_v_self, __pyx_t_2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3731 + * while '%' in format: + * directive_index = format.index('%')+1 + * processed_format = "%s%s%s" % (processed_format, # <<<<<<<<<<<<<< + * format[:directive_index-1], + * self[format[directive_index]]) + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_processed_format); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_processed_format); + __Pyx_GIVEREF(__pyx_v_processed_format); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_processed_format, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3734 + * format[:directive_index-1], + * self[format[directive_index]]) + * format = format[directive_index+1:] # <<<<<<<<<<<<<< + * return "%s%s" % (processed_format, format) + * + */ + __pyx_t_1 = PyNumber_Add(__pyx_v_directive_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_format, 0, 0, &__pyx_t_1, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_2); + __pyx_t_2 = 0; + } + + /* "pandas/tslib.pyx":3735 + * self[format[directive_index]]) + * format = format[directive_index+1:] + * return "%s%s" % (processed_format, format) # <<<<<<<<<<<<<< + * + * def compile(self, format): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_processed_format); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_processed_format); + __Pyx_GIVEREF(__pyx_v_processed_format); + __Pyx_INCREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3714 + * return '%s)' % regex + * + * def pattern(self, format): # <<<<<<<<<<<<<< + * """Return regex pattern for the format string. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.TimeRE.pattern", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_processed_format); + __Pyx_XDECREF(__pyx_v_regex_chars); + __Pyx_XDECREF(__pyx_v_whitespace_replacement); + __Pyx_XDECREF(__pyx_v_directive_index); + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3737 + * return "%s%s" % (processed_format, format) + * + * def compile(self, format): # <<<<<<<<<<<<<< + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_7compile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_6TimeRE_6compile[] = "Return a compiled re object for the format string."; +static PyMethodDef __pyx_mdef_6pandas_5tslib_6TimeRE_7compile = {__Pyx_NAMESTR("compile"), (PyCFunction)__pyx_pw_6pandas_5tslib_6TimeRE_7compile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_6TimeRE_6compile)}; +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_7compile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_format = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compile (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compile", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_format = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compile", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.compile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_6TimeRE_6compile(__pyx_self, __pyx_v_self, __pyx_v_format); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_6compile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compile", 0); + + /* "pandas/tslib.pyx":3739 + * def compile(self, format): + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) # <<<<<<<<<<<<<< + * + * _cache_lock = _thread_allocate_lock() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re_compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pattern); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_IGNORECASE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3737 + * return "%s%s" % (processed_format, format) + * + * def compile(self, format): # <<<<<<<<<<<<<< + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.TimeRE.compile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3748 + * _regex_cache = {} + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): # <<<<<<<<<<<<<< + * """Calculate the Julian day based on the year, week of the year, and day of + * the week, with week_start_day representing whether the week of the year + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_99_calc_julian_from_U_or_W(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_98_calc_julian_from_U_or_W[] = "Calculate the Julian day based on the year, week of the year, and day of\n the week, with week_start_day representing whether the week of the year\n assumes the week starts on Sunday or Monday (6 or 0)."; +static PyMethodDef __pyx_mdef_6pandas_5tslib_99_calc_julian_from_U_or_W = {__Pyx_NAMESTR("_calc_julian_from_U_or_W"), (PyCFunction)__pyx_pw_6pandas_5tslib_99_calc_julian_from_U_or_W, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_98_calc_julian_from_U_or_W)}; +static PyObject *__pyx_pw_6pandas_5tslib_99_calc_julian_from_U_or_W(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_year = 0; + PyObject *__pyx_v_week_of_year = 0; + PyObject *__pyx_v_day_of_week = 0; + PyObject *__pyx_v_week_starts_Mon = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_calc_julian_from_U_or_W (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_year,&__pyx_n_s_week_of_year,&__pyx_n_s_day_of_week,&__pyx_n_s_week_starts_Mon,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_year)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_week_of_year)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_calc_julian_from_U_or_W", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_day_of_week)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_calc_julian_from_U_or_W", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_week_starts_Mon)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_calc_julian_from_U_or_W", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_calc_julian_from_U_or_W") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_year = values[0]; + __pyx_v_week_of_year = values[1]; + __pyx_v_day_of_week = values[2]; + __pyx_v_week_starts_Mon = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_calc_julian_from_U_or_W", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib._calc_julian_from_U_or_W", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_98_calc_julian_from_U_or_W(__pyx_self, __pyx_v_year, __pyx_v_week_of_year, __pyx_v_day_of_week, __pyx_v_week_starts_Mon); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_98_calc_julian_from_U_or_W(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_year, PyObject *__pyx_v_week_of_year, PyObject *__pyx_v_day_of_week, PyObject *__pyx_v_week_starts_Mon) { + PyObject *__pyx_v_first_weekday = NULL; + PyObject *__pyx_v_week_0_length = NULL; + PyObject *__pyx_v_days_to_week = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_calc_julian_from_U_or_W", 0); + __Pyx_INCREF(__pyx_v_day_of_week); + + /* "pandas/tslib.pyx":3752 + * the week, with week_start_day representing whether the week of the year + * assumes the week starts on Sunday or Monday (6 or 0).""" + * first_weekday = datetime_date(year, 1, 1).weekday() # <<<<<<<<<<<<<< + * # If we are dealing with the %U directive (week starts on Sunday), it's + * # easier to just shift the view to Sunday being the first day of the + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_year); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_year); + __Pyx_GIVEREF(__pyx_v_year); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_weekday); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_first_weekday = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3756 + * # easier to just shift the view to Sunday being the first day of the + * # week. + * if not week_starts_Mon: # <<<<<<<<<<<<<< + * first_weekday = (first_weekday + 1) % 7 + * day_of_week = (day_of_week + 1) % 7 + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_week_starts_Mon); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3757 + * # week. + * if not week_starts_Mon: + * first_weekday = (first_weekday + 1) % 7 # <<<<<<<<<<<<<< + * day_of_week = (day_of_week + 1) % 7 + * # Need to watch out for a week 0 (when the first day of the year is not + */ + __pyx_t_3 = PyNumber_Add(__pyx_v_first_weekday, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Remainder(__pyx_t_3, __pyx_int_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_first_weekday, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3758 + * if not week_starts_Mon: + * first_weekday = (first_weekday + 1) % 7 + * day_of_week = (day_of_week + 1) % 7 # <<<<<<<<<<<<<< + * # Need to watch out for a week 0 (when the first day of the year is not + * # the same as that specified by %U or %W). + */ + __pyx_t_2 = PyNumber_Add(__pyx_v_day_of_week, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Remainder(__pyx_t_2, __pyx_int_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_day_of_week, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3761 + * # Need to watch out for a week 0 (when the first day of the year is not + * # the same as that specified by %U or %W). + * week_0_length = (7 - first_weekday) % 7 # <<<<<<<<<<<<<< + * if week_of_year == 0: + * return 1 + day_of_week - first_weekday + */ + __pyx_t_3 = PyNumber_Subtract(__pyx_int_7, __pyx_v_first_weekday); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Remainder(__pyx_t_3, __pyx_int_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_week_0_length = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3762 + * # the same as that specified by %U or %W). + * week_0_length = (7 - first_weekday) % 7 + * if week_of_year == 0: # <<<<<<<<<<<<<< + * return 1 + day_of_week - first_weekday + * else: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_week_of_year, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3763 + * week_0_length = (7 - first_weekday) % 7 + * if week_of_year == 0: + * return 1 + day_of_week - first_weekday # <<<<<<<<<<<<<< + * else: + * days_to_week = week_0_length + (7 * (week_of_year - 1)) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyNumber_Add(__pyx_int_1, __pyx_v_day_of_week); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_v_first_weekday); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":3765 + * return 1 + day_of_week - first_weekday + * else: + * days_to_week = week_0_length + (7 * (week_of_year - 1)) # <<<<<<<<<<<<<< + * return 1 + days_to_week + day_of_week + * + */ + __pyx_t_3 = PyNumber_Subtract(__pyx_v_week_of_year, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Multiply(__pyx_int_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_week_0_length, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_days_to_week = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3766 + * else: + * days_to_week = week_0_length + (7 * (week_of_year - 1)) + * return 1 + days_to_week + day_of_week # <<<<<<<<<<<<<< + * + * # def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyNumber_Add(__pyx_int_1, __pyx_v_days_to_week); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_day_of_week); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3748 + * _regex_cache = {} + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): # <<<<<<<<<<<<<< + * """Calculate the Julian day based on the year, week of the year, and day of + * the week, with week_start_day representing whether the week of the year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib._calc_julian_from_U_or_W", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_first_weekday); + __Pyx_XDECREF(__pyx_v_week_0_length); + __Pyx_XDECREF(__pyx_v_days_to_week); + __Pyx_XDECREF(__pyx_v_day_of_week); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_result; + char *__pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_to_dts", 0); + __Pyx_INCREF(__pyx_v_val); + + /* "datetime.pxd":130 + * cdef char *tmp + * + * if PyUnicode_Check(val): # <<<<<<<<<<<<<< + * val = PyUnicode_AsASCIIString(val); + * + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":131 + * + * if PyUnicode_Check(val): + * val = PyUnicode_AsASCIIString(val); # <<<<<<<<<<<<<< + * + * tmp = val + */ + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "datetime.pxd":133 + * val = PyUnicode_AsASCIIString(val); + * + * tmp = val # <<<<<<<<<<<<<< + * result = _cstring_to_dts(tmp, len(val), dts) + * + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmp = __pyx_t_3; + + /* "datetime.pxd":134 + * + * tmp = val + * result = _cstring_to_dts(tmp, len(val), dts) # <<<<<<<<<<<<<< + * + * if result == -1: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts); + + /* "datetime.pxd":136 + * result = _cstring_to_dts(tmp, len(val), dts) + * + * if result == -1: # <<<<<<<<<<<<<< + * raise ValueError('Unable to parse %s' % str(val)) + * + */ + __pyx_t_1 = ((__pyx_v_result == -1) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":137 + * + * if result == -1: + * raise ValueError('Unable to parse %s' % str(val)) # <<<<<<<<<<<<<< + * + * cdef inline int _cstring_to_dts(char *val, int length, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("datetime._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts) { + npy_bool __pyx_v_islocal; + npy_bool __pyx_v_special; + PANDAS_DATETIMEUNIT __pyx_v_out_bestunit; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cstring_to_dts", 0); + + /* "datetime.pxd":146 + * int result + * + * result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns, # <<<<<<<<<<<<<< + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + */ + __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special)); + + /* "datetime.pxd":149 + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime64_to_datetime", 0); + + /* "datetime.pxd":154 + * cdef inline object _datetime64_to_datetime(int64_t val): + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * return _dts_to_pydatetime(&dts) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "datetime.pxd":155 + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * return _dts_to_pydatetime(&dts) # <<<<<<<<<<<<<< + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dts_to_pydatetime", 0); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_XDECREF(__pyx_r); + + /* "datetime.pxd":160 + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + */ + __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0); + + /* "datetime.pxd":163 + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":164 + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":165 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":166 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) # <<<<<<<<<<<<<< + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + */ + __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val); + + /* "datetime.pxd":167 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) # <<<<<<<<<<<<<< + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + */ + __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val); + + /* "datetime.pxd":168 + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) # <<<<<<<<<<<<<< + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + */ + __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val); + + /* "datetime.pxd":169 + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val); + + /* "datetime.pxd":170 + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":171 + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _dtlike_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + npy_int64 __pyx_t_2; + npy_int32 __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dtlike_to_datetime64", 0); + + /* "datetime.pxd":175 + * cdef inline int64_t _dtlike_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = val.year # <<<<<<<<<<<<<< + * dts.month = val.month + * dts.day = val.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->year = __pyx_t_2; + + /* "datetime.pxd":176 + * pandas_datetimestruct *dts): + * dts.year = val.year + * dts.month = val.month # <<<<<<<<<<<<<< + * dts.day = val.day + * dts.hour = val.hour + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->month = __pyx_t_3; + + /* "datetime.pxd":177 + * dts.year = val.year + * dts.month = val.month + * dts.day = val.day # <<<<<<<<<<<<<< + * dts.hour = val.hour + * dts.min = val.minute + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->day = __pyx_t_3; + + /* "datetime.pxd":178 + * dts.month = val.month + * dts.day = val.day + * dts.hour = val.hour # <<<<<<<<<<<<<< + * dts.min = val.minute + * dts.sec = val.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->hour = __pyx_t_3; + + /* "datetime.pxd":179 + * dts.day = val.day + * dts.hour = val.hour + * dts.min = val.minute # <<<<<<<<<<<<<< + * dts.sec = val.second + * dts.us = val.microsecond + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->min = __pyx_t_3; + + /* "datetime.pxd":180 + * dts.hour = val.hour + * dts.min = val.minute + * dts.sec = val.second # <<<<<<<<<<<<<< + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->sec = __pyx_t_3; + + /* "datetime.pxd":181 + * dts.min = val.minute + * dts.sec = val.second + * dts.us = val.microsecond # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->us = __pyx_t_3; + + /* "datetime.pxd":182 + * dts.sec = val.second + * dts.us = val.microsecond + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":183 + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _date_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_to_datetime64", 0); + + /* "datetime.pxd":187 + * cdef inline int64_t _date_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":188 + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":189 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":190 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->hour = 0; + __pyx_v_dts->min = 0; + __pyx_v_dts->sec = 0; + __pyx_v_dts->us = 0; + + /* "datetime.pxd":191 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":192 + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6pandas_5tslib__Timestamp __pyx_vtable_6pandas_5tslib__Timestamp; + +static PyObject *__pyx_tp_new_6pandas_5tslib__Timestamp(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5tslib__Timestamp *p; + PyObject *o = __pyx_ptype_8datetime_datetime->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5tslib__Timestamp *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_5tslib__Timestamp; + p->offset = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib__Timestamp(PyObject *o) { + struct __pyx_obj_6pandas_5tslib__Timestamp *p = (struct __pyx_obj_6pandas_5tslib__Timestamp *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->offset); + #if CYTHON_COMPILING_IN_CPYTHON + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + if (likely(__pyx_ptype_8datetime_datetime)) __pyx_ptype_8datetime_datetime->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6pandas_5tslib__Timestamp); +} + +static int __pyx_tp_traverse_6pandas_5tslib__Timestamp(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib__Timestamp *p = (struct __pyx_obj_6pandas_5tslib__Timestamp *)o; + e = ((likely(__pyx_ptype_8datetime_datetime)) ? ((__pyx_ptype_8datetime_datetime->tp_traverse) ? __pyx_ptype_8datetime_datetime->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6pandas_5tslib__Timestamp)); if (e) return e; + if (p->offset) { + e = (*v)(p->offset, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib__Timestamp(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib__Timestamp *p = (struct __pyx_obj_6pandas_5tslib__Timestamp *)o; + if (likely(__pyx_ptype_8datetime_datetime)) { if (__pyx_ptype_8datetime_datetime->tp_clear) __pyx_ptype_8datetime_datetime->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6pandas_5tslib__Timestamp); + tmp = ((PyObject*)p->offset); + p->offset = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_5tslib_10_Timestamp_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5tslib_10_Timestamp_5value_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5tslib_10_Timestamp_nanosecond(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5tslib_10_Timestamp_10nanosecond_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5tslib_10_Timestamp_offset(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5tslib_10_Timestamp_6offset_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_5tslib__Timestamp[] = { + {__Pyx_NAMESTR("to_datetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_start_end_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_5tslib__Timestamp[] = { + {(char *)"value", __pyx_getprop_6pandas_5tslib_10_Timestamp_value, 0, 0, 0}, + {(char *)"nanosecond", __pyx_getprop_6pandas_5tslib_10_Timestamp_nanosecond, 0, 0, 0}, + {(char *)"offset", __pyx_getprop_6pandas_5tslib_10_Timestamp_offset, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number__Timestamp = { + __pyx_pw_6pandas_5tslib_10_Timestamp_7__add__, /*nb_add*/ + __pyx_pw_6pandas_5tslib_10_Timestamp_9__sub__, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PyTypeObject __pyx_type_6pandas_5tslib__Timestamp = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib._Timestamp"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib__Timestamp), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib__Timestamp, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number__Timestamp, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + __pyx_pw_6pandas_5tslib_10_Timestamp_1__hash__, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib__Timestamp, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib__Timestamp, /*tp_clear*/ + __pyx_pw_6pandas_5tslib_10_Timestamp_3__richcmp__, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5tslib__Timestamp, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_5tslib__Timestamp, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib__Timestamp, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5tslib__NaT __pyx_vtable_6pandas_5tslib__NaT; + +static PyObject *__pyx_tp_new_6pandas_5tslib__NaT(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5tslib__NaT *p; + PyObject *o = __pyx_tp_new_6pandas_5tslib__Timestamp(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5tslib__NaT *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5tslib__Timestamp*)__pyx_vtabptr_6pandas_5tslib__NaT; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5tslib__NaT[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number__NaT = { + __pyx_pw_6pandas_5tslib_4_NaT_5__add__, /*nb_add*/ + __pyx_pw_6pandas_5tslib_4_NaT_7__sub__, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PyTypeObject __pyx_type_6pandas_5tslib__NaT = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib._NaT"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib__NaT), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib__Timestamp, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number__NaT, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + __pyx_pw_6pandas_5tslib_4_NaT_1__hash__, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib__Timestamp, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib__Timestamp, /*tp_clear*/ + __pyx_pw_6pandas_5tslib_4_NaT_3__richcmp__, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5tslib__NaT, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib__NaT, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_5tslib__TSObject(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_5tslib__TSObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5tslib__TSObject *)o); + p->tzinfo = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib__TSObject(PyObject *o) { + struct __pyx_obj_6pandas_5tslib__TSObject *p = (struct __pyx_obj_6pandas_5tslib__TSObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->tzinfo); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_5tslib__TSObject(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib__TSObject *p = (struct __pyx_obj_6pandas_5tslib__TSObject *)o; + if (p->tzinfo) { + e = (*v)(p->tzinfo, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib__TSObject(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib__TSObject *p = (struct __pyx_obj_6pandas_5tslib__TSObject *)o; + tmp = ((PyObject*)p->tzinfo); + p->tzinfo = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_5tslib_9_TSObject_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5tslib_9_TSObject_5value_1__get__(o); +} + +static struct PyGetSetDef __pyx_getsets_6pandas_5tslib__TSObject[] = { + {(char *)"value", __pyx_getprop_6pandas_5tslib_9_TSObject_value, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5tslib__TSObject = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib._TSObject"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib__TSObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib__TSObject, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib__TSObject, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib__TSObject, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_5tslib__TSObject, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib__TSObject, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *__pyx_freelist_6pandas_5tslib___pyx_scope_struct____init__[8]; +static int __pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__ = 0; + +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct____init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__)))) { + o = (PyObject*)__pyx_freelist_6pandas_5tslib___pyx_scope_struct____init__[--__pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct____init__(PyObject *o) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_self); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__)))) { + __pyx_freelist_6pandas_5tslib___pyx_scope_struct____init__[__pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__++] = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct____init__(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)o; + if (p->__pyx_v_self) { + e = (*v)(p->__pyx_v_self, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct____init__(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)o; + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_5tslib___pyx_scope_struct____init__ = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib.__pyx_scope_struct____init__"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct____init__, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct____init__, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct____init__, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib___pyx_scope_struct____init__, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *__pyx_freelist_6pandas_5tslib___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_6pandas_5tslib___pyx_scope_struct_1_genexpr[--__pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_tz); + Py_CLEAR(p->__pyx_v_tz_names); + Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_t_1); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_6pandas_5tslib___pyx_scope_struct_1_genexpr[__pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_tz) { + e = (*v)(p->__pyx_v_tz, a); if (e) return e; + } + if (p->__pyx_v_tz_names) { + e = (*v)(p->__pyx_v_tz_names, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + if (p->__pyx_t_1) { + e = (*v)(p->__pyx_t_1, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_tz); + p->__pyx_v_tz = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_tz_names); + p->__pyx_v_tz_names = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_1); + p->__pyx_t_1 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_5tslib___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib.__pyx_scope_struct_1_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_1_genexpr, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *__pyx_freelist_6pandas_5tslib___pyx_scope_struct_2___seqToRE[8]; +static int __pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE = 0; + +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE)))) { + o = (PyObject*)__pyx_freelist_6pandas_5tslib___pyx_scope_struct_2___seqToRE[--__pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyObject *o) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_to_convert); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE)))) { + __pyx_freelist_6pandas_5tslib___pyx_scope_struct_2___seqToRE[__pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE++] = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)o; + if (p->__pyx_v_to_convert) { + e = (*v)(p->__pyx_v_to_convert, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)o; + tmp = ((PyObject*)p->__pyx_v_to_convert); + p->__pyx_v_to_convert = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_5tslib___pyx_scope_struct_2___seqToRE = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib.__pyx_scope_struct_2___seqToRE"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_2___seqToRE, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_2___seqToRE, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_2___seqToRE, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib___pyx_scope_struct_2___seqToRE, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *__pyx_freelist_6pandas_5tslib___pyx_scope_struct_3_genexpr[8]; +static int __pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr = 0; + +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr)))) { + o = (PyObject*)__pyx_freelist_6pandas_5tslib___pyx_scope_struct_3_genexpr[--__pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyObject *o) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_stuff); + Py_CLEAR(p->__pyx_t_0); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr)))) { + __pyx_freelist_6pandas_5tslib___pyx_scope_struct_3_genexpr[__pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_stuff) { + e = (*v)(p->__pyx_v_stuff, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_stuff); + p->__pyx_v_stuff = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_5tslib___pyx_scope_struct_3_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib.__pyx_scope_struct_3_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_3_genexpr, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib___pyx_scope_struct_3_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("get_value_box"), (PyCFunction)__pyx_pw_6pandas_5tslib_7get_value_box, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_utcoffset"), (PyCFunction)__pyx_pw_6pandas_5tslib_15_get_utcoffset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("maybe_get_tz"), (PyCFunction)__pyx_pw_6pandas_5tslib_19maybe_get_tz, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_18maybe_get_tz)}, + {__Pyx_NAMESTR("cast_from_unit"), (PyCFunction)__pyx_pw_6pandas_5tslib_37cast_from_unit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_36cast_from_unit)}, + {__Pyx_NAMESTR("_unbox_utcoffsets"), (PyCFunction)__pyx_pw_6pandas_5tslib_53_unbox_utcoffsets, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("normalize_date"), (PyCFunction)__pyx_pw_6pandas_5tslib_73normalize_date, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_72normalize_date)}, + {__Pyx_NAMESTR("period_asfreq"), (PyCFunction)__pyx_pw_6pandas_5tslib_79period_asfreq, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_78period_asfreq)}, + {__Pyx_NAMESTR("period_ordinal_to_dt64"), (PyCFunction)__pyx_pw_6pandas_5tslib_85period_ordinal_to_dt64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("resolution"), (PyCFunction)__pyx_pw_6pandas_5tslib_95resolution, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("tslib"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0}, + {&__pyx_kp_s_00, __pyx_k_00, sizeof(__pyx_k_00), 0, 0, 1, 0}, + {&__pyx_kp_s_02d, __pyx_k_02d, sizeof(__pyx_k_02d), 0, 0, 1, 0}, + {&__pyx_kp_s_02d_06d, __pyx_k_02d_06d, sizeof(__pyx_k_02d_06d), 0, 0, 1, 0}, + {&__pyx_kp_s_03, __pyx_k_03, sizeof(__pyx_k_03), 0, 0, 1, 0}, + {&__pyx_kp_s_03d, __pyx_k_03d, sizeof(__pyx_k_03d), 0, 0, 1, 0}, + {&__pyx_kp_s_06d, __pyx_k_06d, sizeof(__pyx_k_06d), 0, 0, 1, 0}, + {&__pyx_kp_s_09d, __pyx_k_09d, sizeof(__pyx_k_09d), 0, 0, 1, 0}, + {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, + {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, + {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, + {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0}, + {&__pyx_kp_s_1999, __pyx_k_1999, sizeof(__pyx_k_1999), 0, 0, 1, 0}, + {&__pyx_kp_s_1_6, __pyx_k_1_6, sizeof(__pyx_k_1_6), 0, 0, 1, 0}, + {&__pyx_kp_s_1_7, __pyx_k_1_7, sizeof(__pyx_k_1_7), 0, 0, 1, 0}, + {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, + {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, + {&__pyx_kp_s_2d, __pyx_k_2d, sizeof(__pyx_k_2d), 0, 0, 1, 0}, + {&__pyx_kp_s_2d_2d_2d, __pyx_k_2d_2d_2d, sizeof(__pyx_k_2d_2d_2d), 0, 0, 1, 0}, + {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, + {&__pyx_kp_s_3d, __pyx_k_3d, sizeof(__pyx_k_3d), 0, 0, 1, 0}, + {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0}, + {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0}, + {&__pyx_kp_s_6d, __pyx_k_6d, sizeof(__pyx_k_6d), 0, 0, 1, 0}, + {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0}, + {&__pyx_kp_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 0}, + {&__pyx_kp_s_9d, __pyx_k_9d, sizeof(__pyx_k_9d), 0, 0, 1, 0}, + {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, + {&__pyx_kp_b_AB, __pyx_k_AB, sizeof(__pyx_k_AB), 0, 0, 0, 0}, + {&__pyx_kp_s_AB, __pyx_k_AB, sizeof(__pyx_k_AB), 0, 0, 1, 0}, + {&__pyx_n_s_AS, __pyx_k_AS, sizeof(__pyx_k_AS), 0, 0, 1, 1}, + {&__pyx_kp_s_A_2, __pyx_k_A_2, sizeof(__pyx_k_A_2), 0, 0, 1, 0}, + {&__pyx_n_s_AmbiguousTimeError, __pyx_k_AmbiguousTimeError, sizeof(__pyx_k_AmbiguousTimeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Array_must_be_all_same_time_zone, __pyx_k_Array_must_be_all_same_time_zone, sizeof(__pyx_k_Array_must_be_all_same_time_zone), 0, 0, 1, 0}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, + {&__pyx_kp_s_B_2, __pyx_k_B_2, sizeof(__pyx_k_B_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Bad_tz_filename_Dateutil_on_pyth, __pyx_k_Bad_tz_filename_Dateutil_on_pyth, sizeof(__pyx_k_Bad_tz_filename_Dateutil_on_pyth), 0, 0, 1, 0}, + {&__pyx_n_s_BaseTzInfo, __pyx_k_BaseTzInfo, sizeof(__pyx_k_BaseTzInfo), 0, 0, 1, 1}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, + {&__pyx_n_s_CACHE_MAX_SIZE, __pyx_k_CACHE_MAX_SIZE, sizeof(__pyx_k_CACHE_MAX_SIZE), 0, 0, 1, 1}, + {&__pyx_kp_b_CD, __pyx_k_CD, sizeof(__pyx_k_CD), 0, 0, 0, 0}, + {&__pyx_kp_s_CD, __pyx_k_CD, sizeof(__pyx_k_CD), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_add_integral_value_to_Tim, __pyx_k_Cannot_add_integral_value_to_Tim, sizeof(__pyx_k_Cannot_add_integral_value_to_Tim), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_compare_type_r_with_type, __pyx_k_Cannot_compare_type_r_with_type, sizeof(__pyx_k_Cannot_compare_type_r_with_type), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_compare_tz_naive_and_tz_a, __pyx_k_Cannot_compare_tz_naive_and_tz_a, sizeof(__pyx_k_Cannot_compare_tz_naive_and_tz_a), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_convert_tz_naive_Timestam, __pyx_k_Cannot_convert_tz_naive_Timestam, sizeof(__pyx_k_Cannot_convert_tz_naive_Timestam), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_infer_dst_time_from_r_try, __pyx_k_Cannot_infer_dst_time_from_r_try, sizeof(__pyx_k_Cannot_infer_dst_time_from_r_try), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_infer_dst_time_from_s_ast, __pyx_k_Cannot_infer_dst_time_from_s_ast, sizeof(__pyx_k_Cannot_infer_dst_time_from_s_ast), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_localize_tz_aware_Timesta, __pyx_k_Cannot_localize_tz_aware_Timesta, sizeof(__pyx_k_Cannot_localize_tz_aware_Timesta), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_mix_tz_aware_with_tz_naiv, __pyx_k_Cannot_mix_tz_aware_with_tz_naiv, sizeof(__pyx_k_Cannot_mix_tz_aware_with_tz_naiv), 0, 0, 1, 0}, + {&__pyx_kp_s_Could_not_construct_Timestamp_fr, __pyx_k_Could_not_construct_Timestamp_fr, sizeof(__pyx_k_Could_not_construct_Timestamp_fr), 0, 0, 1, 0}, + {&__pyx_kp_s_Could_not_find_pytz_module, __pyx_k_Could_not_find_pytz_module, sizeof(__pyx_k_Could_not_find_pytz_module), 0, 0, 1, 0}, + {&__pyx_kp_s_Custom_business_days_is_not_supp, __pyx_k_Custom_business_days_is_not_supp, sizeof(__pyx_k_Custom_business_days_is_not_supp), 0, 0, 1, 0}, + {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, + {&__pyx_n_s_D_RESO, __pyx_k_D_RESO, sizeof(__pyx_k_D_RESO), 0, 0, 1, 1}, + {&__pyx_kp_b_EF, __pyx_k_EF, sizeof(__pyx_k_EF), 0, 0, 0, 0}, + {&__pyx_kp_s_EF, __pyx_k_EF, sizeof(__pyx_k_EF), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_b_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 0, 0}, + {&__pyx_kp_b_FQ_q, __pyx_k_FQ_q, sizeof(__pyx_k_FQ_q), 0, 0, 0, 0}, + {&__pyx_kp_s_Field_s_not_supported, __pyx_k_Field_s_not_supported, sizeof(__pyx_k_Field_s_not_supported), 0, 0, 1, 0}, + {&__pyx_kp_s_First_time_before_start_of_DST_i, __pyx_k_First_time_before_start_of_DST_i, sizeof(__pyx_k_First_time_before_start_of_DST_i), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Frequency_conversion_failed, __pyx_k_Frequency_conversion_failed, sizeof(__pyx_k_Frequency_conversion_failed), 0, 0, 1, 0}, + {&__pyx_kp_b_GH, __pyx_k_GH, sizeof(__pyx_k_GH), 0, 0, 0, 0}, + {&__pyx_kp_s_GH, __pyx_k_GH, sizeof(__pyx_k_GH), 0, 0, 1, 0}, + {&__pyx_kp_s_Given_date_string_not_likely_a_d, __pyx_k_Given_date_string_not_likely_a_d, sizeof(__pyx_k_Given_date_string_not_likely_a_d), 0, 0, 1, 0}, + {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1}, + {&__pyx_kp_s_H_2, __pyx_k_H_2, sizeof(__pyx_k_H_2), 0, 0, 1, 0}, + {&__pyx_n_s_H_RESO, __pyx_k_H_RESO, sizeof(__pyx_k_H_RESO), 0, 0, 1, 1}, + {&__pyx_kp_s_Handle_conversion_from_format_di, __pyx_k_Handle_conversion_from_format_di, sizeof(__pyx_k_Handle_conversion_from_format_di), 0, 0, 1, 0}, + {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1}, + {&__pyx_n_s_IGNORECASE, __pyx_k_IGNORECASE, sizeof(__pyx_k_IGNORECASE), 0, 0, 1, 1}, + {&__pyx_kp_b_IJ, __pyx_k_IJ, sizeof(__pyx_k_IJ), 0, 0, 0, 0}, + {&__pyx_kp_s_IJ, __pyx_k_IJ, sizeof(__pyx_k_IJ), 0, 0, 1, 0}, + {&__pyx_kp_s_I_2, __pyx_k_I_2, sizeof(__pyx_k_I_2), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_type_for_timedelta_scala, __pyx_k_Invalid_type_for_timedelta_scala, sizeof(__pyx_k_Invalid_type_for_timedelta_scala), 0, 0, 1, 0}, + {&__pyx_kp_b_KL, __pyx_k_KL, sizeof(__pyx_k_KL), 0, 0, 0, 0}, + {&__pyx_kp_s_KL, __pyx_k_KL, sizeof(__pyx_k_KL), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_LC_TIME, __pyx_k_LC_TIME, sizeof(__pyx_k_LC_TIME), 0, 0, 1, 1}, + {&__pyx_n_s_LC_date, __pyx_k_LC_date, sizeof(__pyx_k_LC_date), 0, 0, 1, 1}, + {&__pyx_n_s_LC_date_time, __pyx_k_LC_date_time, sizeof(__pyx_k_LC_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_LC_time, __pyx_k_LC_time, sizeof(__pyx_k_LC_time), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime, __pyx_k_LocaleTime, sizeof(__pyx_k_LocaleTime), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_am_pm, __pyx_k_LocaleTime___calc_am_pm, sizeof(__pyx_k_LocaleTime___calc_am_pm), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_date_time, __pyx_k_LocaleTime___calc_date_time, sizeof(__pyx_k_LocaleTime___calc_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_month, __pyx_k_LocaleTime___calc_month, sizeof(__pyx_k_LocaleTime___calc_month), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_timezone, __pyx_k_LocaleTime___calc_timezone, sizeof(__pyx_k_LocaleTime___calc_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_weekday, __pyx_k_LocaleTime___calc_weekday, sizeof(__pyx_k_LocaleTime___calc_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___init, __pyx_k_LocaleTime___init, sizeof(__pyx_k_LocaleTime___init), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___pad, __pyx_k_LocaleTime___pad, sizeof(__pyx_k_LocaleTime___pad), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_am_pm, __pyx_k_LocaleTime__calc_am_pm, sizeof(__pyx_k_LocaleTime__calc_am_pm), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_date_time, __pyx_k_LocaleTime__calc_date_time, sizeof(__pyx_k_LocaleTime__calc_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_month, __pyx_k_LocaleTime__calc_month, sizeof(__pyx_k_LocaleTime__calc_month), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_timezone, __pyx_k_LocaleTime__calc_timezone, sizeof(__pyx_k_LocaleTime__calc_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_weekday, __pyx_k_LocaleTime__calc_weekday, sizeof(__pyx_k_LocaleTime__calc_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__pad, __pyx_k_LocaleTime__pad, sizeof(__pyx_k_LocaleTime__pad), 0, 0, 1, 1}, + {&__pyx_n_s_LooseVersion, __pyx_k_LooseVersion, sizeof(__pyx_k_LooseVersion), 0, 0, 1, 1}, + {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1}, + {&__pyx_kp_s_M8_ns, __pyx_k_M8_ns, sizeof(__pyx_k_M8_ns), 0, 0, 1, 0}, + {&__pyx_kp_s_M8_s, __pyx_k_M8_s, sizeof(__pyx_k_M8_s), 0, 0, 1, 0}, + {&__pyx_n_s_MS, __pyx_k_MS, sizeof(__pyx_k_MS), 0, 0, 1, 1}, + {&__pyx_n_s_MS_RESO, __pyx_k_MS_RESO, sizeof(__pyx_k_MS_RESO), 0, 0, 1, 1}, + {&__pyx_kp_s_M_2, __pyx_k_M_2, sizeof(__pyx_k_M_2), 0, 0, 1, 0}, + {&__pyx_n_s_NAN, __pyx_k_NAN, sizeof(__pyx_k_NAN), 0, 0, 1, 1}, + {&__pyx_n_s_NAT, __pyx_k_NAT, sizeof(__pyx_k_NAT), 0, 0, 1, 1}, + {&__pyx_kp_s_N_ot_A_T_ime_the_time_equivalen, __pyx_k_N_ot_A_T_ime_the_time_equivalen, sizeof(__pyx_k_N_ot_A_T_ime_the_time_equivalen), 0, 0, 1, 0}, + {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1}, + {&__pyx_n_s_NaT, __pyx_k_NaT, sizeof(__pyx_k_NaT), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType, __pyx_k_NaTType, sizeof(__pyx_k_NaTType), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___hash, __pyx_k_NaTType___hash, sizeof(__pyx_k_NaTType___hash), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___int, __pyx_k_NaTType___int, sizeof(__pyx_k_NaTType___int), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___long, __pyx_k_NaTType___long, sizeof(__pyx_k_NaTType___long), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___new, __pyx_k_NaTType___new, sizeof(__pyx_k_NaTType___new), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___reduce, __pyx_k_NaTType___reduce, sizeof(__pyx_k_NaTType___reduce), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___repr, __pyx_k_NaTType___repr, sizeof(__pyx_k_NaTType___repr), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___str, __pyx_k_NaTType___str, sizeof(__pyx_k_NaTType___str), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType_toordinal, __pyx_k_NaTType_toordinal, sizeof(__pyx_k_NaTType_toordinal), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType_weekday, __pyx_k_NaTType_weekday, sizeof(__pyx_k_NaTType_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_NameError, __pyx_k_NameError, sizeof(__pyx_k_NameError), 0, 0, 1, 1}, + {&__pyx_n_s_NonExistentTimeError, __pyx_k_NonExistentTimeError, sizeof(__pyx_k_NonExistentTimeError), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1}, + {&__pyx_kp_s_NumPy_1_6_1_business_freq_not_su, __pyx_k_NumPy_1_6_1_business_freq_not_su, sizeof(__pyx_k_NumPy_1_6_1_business_freq_not_su), 0, 0, 1, 0}, + {&__pyx_n_s_OutOfBoundsDatetime, __pyx_k_OutOfBoundsDatetime, sizeof(__pyx_k_OutOfBoundsDatetime), 0, 0, 1, 1}, + {&__pyx_kp_s_Out_of_bounds_nanosecond_timesta, __pyx_k_Out_of_bounds_nanosecond_timesta, sizeof(__pyx_k_Out_of_bounds_nanosecond_timesta), 0, 0, 1, 0}, + {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, + {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1}, + {&__pyx_kp_s_P_H_2_0_3_0_1_d_d, __pyx_k_P_H_2_0_3_0_1_d_d, sizeof(__pyx_k_P_H_2_0_3_0_1_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_I_1_0_2_0_1_9_1_9, __pyx_k_P_I_1_0_2_0_1_9_1_9, sizeof(__pyx_k_P_I_1_0_2_0_1_9_1_9), 0, 0, 1, 0}, + {&__pyx_kp_s_P_M_0_5_d_d, __pyx_k_P_M_0_5_d_d, sizeof(__pyx_k_P_M_0_5_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_S_6_0_1_0_5_d_d, __pyx_k_P_S_6_0_1_0_5_d_d, sizeof(__pyx_k_P_S_6_0_1_0_5_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_U_5_0_3_0_4_d_d, __pyx_k_P_U_5_0_3_0_4_d_d, sizeof(__pyx_k_P_U_5_0_3_0_4_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_Y_d_d_d_d, __pyx_k_P_Y_d_d_d_d, sizeof(__pyx_k_P_Y_d_d_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9, __pyx_k_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9, sizeof(__pyx_k_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9), 0, 0, 1, 0}, + {&__pyx_kp_s_P_f_0_9_1_6, __pyx_k_P_f_0_9_1_6, sizeof(__pyx_k_P_f_0_9_1_6), 0, 0, 1, 0}, + {&__pyx_kp_s_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1, __pyx_k_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1, sizeof(__pyx_k_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1), 0, 0, 1, 0}, + {&__pyx_kp_s_P_m_1_0_2_0_1_9_1_9, __pyx_k_P_m_1_0_2_0_1_9_1_9, sizeof(__pyx_k_P_m_1_0_2_0_1_9_1_9), 0, 0, 1, 0}, + {&__pyx_kp_s_P_s_s, __pyx_k_P_s_s, sizeof(__pyx_k_P_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_P_w_0_6, __pyx_k_P_w_0_6, sizeof(__pyx_k_P_w_0_6), 0, 0, 1, 0}, + {&__pyx_kp_s_P_y_d_d, __pyx_k_P_y_d_d, sizeof(__pyx_k_P_y_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_Period, __pyx_k_Period, sizeof(__pyx_k_Period), 0, 0, 1, 1}, + {&__pyx_n_s_QS, __pyx_k_QS, sizeof(__pyx_k_QS), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_kp_s_S_2, __pyx_k_S_2, sizeof(__pyx_k_S_2), 0, 0, 1, 0}, + {&__pyx_n_s_S_RESO, __pyx_k_S_RESO, sizeof(__pyx_k_S_RESO), 0, 0, 1, 1}, + {&__pyx_kp_s_Stores_and_handles_locale_specif, __pyx_k_Stores_and_handles_locale_specif, sizeof(__pyx_k_Stores_and_handles_locale_specif), 0, 0, 1, 0}, + {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, + {&__pyx_n_s_T_RESO, __pyx_k_T_RESO, sizeof(__pyx_k_T_RESO), 0, 0, 1, 1}, + {&__pyx_kp_s_There_are_i_dst_switches_when_th, __pyx_k_There_are_i_dst_switches_when_th, sizeof(__pyx_k_There_are_i_dst_switches_when_th), 0, 0, 1, 0}, + {&__pyx_n_s_TimeRE, __pyx_k_TimeRE, sizeof(__pyx_k_TimeRE), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE___init, __pyx_k_TimeRE___init, sizeof(__pyx_k_TimeRE___init), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE___seqToRE, __pyx_k_TimeRE___seqToRE, sizeof(__pyx_k_TimeRE___seqToRE), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE__seqToRE, __pyx_k_TimeRE__seqToRE, sizeof(__pyx_k_TimeRE__seqToRE), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE_cache, __pyx_k_TimeRE_cache, sizeof(__pyx_k_TimeRE_cache), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE_compile, __pyx_k_TimeRE_compile, sizeof(__pyx_k_TimeRE_compile), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE_pattern, __pyx_k_TimeRE_pattern, sizeof(__pyx_k_TimeRE_pattern), 0, 0, 1, 1}, + {&__pyx_kp_s_TimeStamp_is_the_pandas_equivale, __pyx_k_TimeStamp_is_the_pandas_equivale, sizeof(__pyx_k_TimeStamp_is_the_pandas_equivale), 0, 0, 1, 0}, + {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp___new, __pyx_k_Timestamp___new, sizeof(__pyx_k_Timestamp___new), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp___reduce, __pyx_k_Timestamp___reduce, sizeof(__pyx_k_Timestamp___reduce), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp___repr, __pyx_k_Timestamp___repr, sizeof(__pyx_k_Timestamp___repr), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp___setstate, __pyx_k_Timestamp___setstate, sizeof(__pyx_k_Timestamp___setstate), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp__date_repr, __pyx_k_Timestamp__date_repr, sizeof(__pyx_k_Timestamp__date_repr), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp__has_time_component, __pyx_k_Timestamp__has_time_component, sizeof(__pyx_k_Timestamp__has_time_component), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp__repr_base, __pyx_k_Timestamp__repr_base, sizeof(__pyx_k_Timestamp__repr_base), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp__time_repr, __pyx_k_Timestamp__time_repr, sizeof(__pyx_k_Timestamp__time_repr), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_asm8, __pyx_k_Timestamp_asm8, sizeof(__pyx_k_Timestamp_asm8), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_dayofweek, __pyx_k_Timestamp_dayofweek, sizeof(__pyx_k_Timestamp_dayofweek), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_dayofyear, __pyx_k_Timestamp_dayofyear, sizeof(__pyx_k_Timestamp_dayofyear), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_freq, __pyx_k_Timestamp_freq, sizeof(__pyx_k_Timestamp_freq), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_freqstr, __pyx_k_Timestamp_freqstr, sizeof(__pyx_k_Timestamp_freqstr), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_fromordinal, __pyx_k_Timestamp_fromordinal, sizeof(__pyx_k_Timestamp_fromordinal), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_month_end, __pyx_k_Timestamp_is_month_end, sizeof(__pyx_k_Timestamp_is_month_end), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_month_start, __pyx_k_Timestamp_is_month_start, sizeof(__pyx_k_Timestamp_is_month_start), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_quarter_end, __pyx_k_Timestamp_is_quarter_end, sizeof(__pyx_k_Timestamp_is_quarter_end), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_quarter_start, __pyx_k_Timestamp_is_quarter_start, sizeof(__pyx_k_Timestamp_is_quarter_start), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_year_end, __pyx_k_Timestamp_is_year_end, sizeof(__pyx_k_Timestamp_is_year_end), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_year_start, __pyx_k_Timestamp_is_year_start, sizeof(__pyx_k_Timestamp_is_year_start), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_isoformat, __pyx_k_Timestamp_isoformat, sizeof(__pyx_k_Timestamp_isoformat), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_now, __pyx_k_Timestamp_now, sizeof(__pyx_k_Timestamp_now), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_quarter, __pyx_k_Timestamp_quarter, sizeof(__pyx_k_Timestamp_quarter), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_replace, __pyx_k_Timestamp_replace, sizeof(__pyx_k_Timestamp_replace), 0, 0, 1, 1}, + {&__pyx_kp_s_Timestamp_stamp_tz_offset, __pyx_k_Timestamp_stamp_tz_offset, sizeof(__pyx_k_Timestamp_stamp_tz_offset), 0, 0, 1, 0}, + {&__pyx_n_s_Timestamp_to_julian_date, __pyx_k_Timestamp_to_julian_date, sizeof(__pyx_k_Timestamp_to_julian_date), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_to_period, __pyx_k_Timestamp_to_period, sizeof(__pyx_k_Timestamp_to_period), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_to_pydatetime, __pyx_k_Timestamp_to_pydatetime, sizeof(__pyx_k_Timestamp_to_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_today, __pyx_k_Timestamp_today, sizeof(__pyx_k_Timestamp_today), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_tz, __pyx_k_Timestamp_tz, sizeof(__pyx_k_Timestamp_tz), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_tz_convert, __pyx_k_Timestamp_tz_convert, sizeof(__pyx_k_Timestamp_tz_convert), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_tz_localize, __pyx_k_Timestamp_tz_localize, sizeof(__pyx_k_Timestamp_tz_localize), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_utcnow, __pyx_k_Timestamp_utcnow, sizeof(__pyx_k_Timestamp_utcnow), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_week, __pyx_k_Timestamp_week, sizeof(__pyx_k_Timestamp_week), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Tz_aware_datetime_datetime_canno, __pyx_k_Tz_aware_datetime_datetime_canno, sizeof(__pyx_k_Tz_aware_datetime_datetime_canno), 0, 0, 1, 0}, + {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, + {&__pyx_n_s_US_RESO, __pyx_k_US_RESO, sizeof(__pyx_k_US_RESO), 0, 0, 1, 1}, + {&__pyx_n_s_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 0, 1, 1}, + {&__pyx_kp_s_U_2, __pyx_k_U_2, sizeof(__pyx_k_U_2), 0, 0, 1, 0}, + {&__pyx_n_s_U_W, __pyx_k_U_W, sizeof(__pyx_k_U_W), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_to_desired_fre, __pyx_k_Unable_to_convert_to_desired_fre, sizeof(__pyx_k_Unable_to_convert_to_desired_fre), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_get_quarter_and_year, __pyx_k_Unable_to_get_quarter_and_year, sizeof(__pyx_k_Unable_to_get_quarter_and_year), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Unknown_freq_d, __pyx_k_Unknown_freq_d, sizeof(__pyx_k_Unknown_freq_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_period_code_d, __pyx_k_Unrecognized_period_code_d, sizeof(__pyx_k_Unrecognized_period_code_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_type_s, __pyx_k_Unrecognized_type_s, sizeof(__pyx_k_Unrecognized_type_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_value_type_s, __pyx_k_Unrecognized_value_type_s, sizeof(__pyx_k_Unrecognized_value_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1}, + {&__pyx_kp_s_W_2, __pyx_k_W_2, sizeof(__pyx_k_W_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Warning_discarding_nonzero_nanos, __pyx_k_Warning_discarding_nonzero_nanos, sizeof(__pyx_k_Warning_discarding_nonzero_nanos), 0, 0, 1, 0}, + {&__pyx_kp_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 0}, + {&__pyx_n_s_X_2, __pyx_k_X_2, sizeof(__pyx_k_X_2), 0, 0, 1, 1}, + {&__pyx_n_s_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 0, 1, 1}, + {&__pyx_kp_b_Y_2, __pyx_k_Y_2, sizeof(__pyx_k_Y_2), 0, 0, 0, 0}, + {&__pyx_kp_s_Y_2, __pyx_k_Y_2, sizeof(__pyx_k_Y_2), 0, 0, 1, 0}, + {&__pyx_kp_b_Y_m, __pyx_k_Y_m, sizeof(__pyx_k_Y_m), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d, __pyx_k_Y_m_d, sizeof(__pyx_k_Y_m_d), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_00, __pyx_k_Y_m_d_H_00, sizeof(__pyx_k_Y_m_d_H_00), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M, __pyx_k_Y_m_d_H_M, sizeof(__pyx_k_Y_m_d_H_M), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M_S, __pyx_k_Y_m_d_H_M_S, sizeof(__pyx_k_Y_m_d_H_M_S), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M_S_l, __pyx_k_Y_m_d_H_M_S_l, sizeof(__pyx_k_Y_m_d_H_M_S_l), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M_S_n, __pyx_k_Y_m_d_H_M_S_n, sizeof(__pyx_k_Y_m_d_H_M_S_n), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M_S_u, __pyx_k_Y_m_d_H_M_S_u, sizeof(__pyx_k_Y_m_d_H_M_S_u), 0, 0, 0, 0}, + {&__pyx_kp_s_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 0, 1, 0}, + {&__pyx_n_s_Z_2, __pyx_k_Z_2, sizeof(__pyx_k_Z_2), 0, 0, 1, 1}, + {&__pyx_kp_s_Z_3, __pyx_k_Z_3, sizeof(__pyx_k_Z_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Z_tz_s, __pyx_k_Z_tz_s, sizeof(__pyx_k_Z_tz_s), 0, 0, 1, 0}, + {&__pyx_kp_s__112, __pyx_k__112, sizeof(__pyx_k__112), 0, 0, 1, 0}, + {&__pyx_kp_s__113, __pyx_k__113, sizeof(__pyx_k__113), 0, 0, 1, 0}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 0, 1, 0}, + {&__pyx_kp_s__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 0, 1, 0}, + {&__pyx_kp_s__52, __pyx_k__52, sizeof(__pyx_k__52), 0, 0, 1, 0}, + {&__pyx_kp_s__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_kp_s_a_2, __pyx_k_a_2, sizeof(__pyx_k_a_2), 0, 0, 1, 0}, + {&__pyx_n_s_a_idx, __pyx_k_a_idx, sizeof(__pyx_k_a_idx), 0, 0, 1, 1}, + {&__pyx_n_s_a_month, __pyx_k_a_month, sizeof(__pyx_k_a_month), 0, 0, 1, 1}, + {&__pyx_n_s_a_weekday, __pyx_k_a_weekday, sizeof(__pyx_k_a_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1}, + {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_all_2, __pyx_k_all_2, sizeof(__pyx_k_all_2), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_lock, __pyx_k_allocate_lock, sizeof(__pyx_k_allocate_lock), 0, 0, 1, 1}, + {&__pyx_n_s_am_pm, __pyx_k_am_pm, sizeof(__pyx_k_am_pm), 0, 0, 1, 1}, + {&__pyx_n_s_ampm, __pyx_k_ampm, sizeof(__pyx_k_ampm), 0, 0, 1, 1}, + {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1}, + {&__pyx_n_s_apply_offset, __pyx_k_apply_offset, sizeof(__pyx_k_apply_offset), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_array_split, __pyx_k_array_split, sizeof(__pyx_k_array_split), 0, 0, 1, 1}, + {&__pyx_n_s_array_strptime, __pyx_k_array_strptime, sizeof(__pyx_k_array_strptime), 0, 0, 1, 1}, + {&__pyx_n_s_array_to_datetime, __pyx_k_array_to_datetime, sizeof(__pyx_k_array_to_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_array_to_timedelta64, __pyx_k_array_to_timedelta64, sizeof(__pyx_k_array_to_timedelta64), 0, 0, 1, 1}, + {&__pyx_n_s_asm8, __pyx_k_asm8, sizeof(__pyx_k_asm8), 0, 0, 1, 1}, + {&__pyx_n_s_astimezone, __pyx_k_astimezone, sizeof(__pyx_k_astimezone), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_kp_s_b_2, __pyx_k_b_2, sizeof(__pyx_k_b_2), 0, 0, 1, 0}, + {&__pyx_n_s_b_idx, __pyx_k_b_idx, sizeof(__pyx_k_b_idx), 0, 0, 1, 1}, + {&__pyx_n_s_bad_directive, __pyx_k_bad_directive, sizeof(__pyx_k_bad_directive), 0, 0, 1, 1}, + {&__pyx_kp_s_bad_month_number_0_must_be_1_12, __pyx_k_bad_month_number_0_must_be_1_12, sizeof(__pyx_k_bad_month_number_0_must_be_1_12), 0, 0, 1, 0}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_base1, __pyx_k_base1, sizeof(__pyx_k_base1), 0, 0, 1, 1}, + {&__pyx_n_s_base2, __pyx_k_base2, sizeof(__pyx_k_base2), 0, 0, 1, 1}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_both_eq, __pyx_k_both_eq, sizeof(__pyx_k_both_eq), 0, 0, 1, 1}, + {&__pyx_n_s_both_nat, __pyx_k_both_nat, sizeof(__pyx_k_both_nat), 0, 0, 1, 1}, + {&__pyx_n_s_boxed, __pyx_k_boxed, sizeof(__pyx_k_boxed), 0, 0, 1, 1}, + {&__pyx_n_s_build_field_sarray, __pyx_k_build_field_sarray, sizeof(__pyx_k_build_field_sarray), 0, 0, 1, 1}, + {&__pyx_kp_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 0}, + {&__pyx_n_s_c_2, __pyx_k_c_2, sizeof(__pyx_k_c_2), 0, 0, 1, 1}, + {&__pyx_n_s_cache_lock, __pyx_k_cache_lock, sizeof(__pyx_k_cache_lock), 0, 0, 1, 1}, + {&__pyx_n_s_calc_am_pm, __pyx_k_calc_am_pm, sizeof(__pyx_k_calc_am_pm), 0, 0, 1, 1}, + {&__pyx_n_s_calc_date_time, __pyx_k_calc_date_time, sizeof(__pyx_k_calc_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_calc_julian_from_U_or_W, __pyx_k_calc_julian_from_U_or_W, sizeof(__pyx_k_calc_julian_from_U_or_W), 0, 0, 1, 1}, + {&__pyx_n_s_calc_month, __pyx_k_calc_month, sizeof(__pyx_k_calc_month), 0, 0, 1, 1}, + {&__pyx_n_s_calc_timezone, __pyx_k_calc_timezone, sizeof(__pyx_k_calc_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_calc_weekday, __pyx_k_calc_weekday, sizeof(__pyx_k_calc_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_calendar, __pyx_k_calendar, sizeof(__pyx_k_calendar), 0, 0, 1, 1}, + {&__pyx_kp_s_cannot_cast_unit_0, __pyx_k_cannot_cast_unit_0, sizeof(__pyx_k_cannot_cast_unit_0), 0, 0, 1, 0}, + {&__pyx_n_s_cast_to_nanoseconds, __pyx_k_cast_to_nanoseconds, sizeof(__pyx_k_cast_to_nanoseconds), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, + {&__pyx_n_s_coerce, __pyx_k_coerce, sizeof(__pyx_k_coerce), 0, 0, 1, 1}, + {&__pyx_n_s_combine, __pyx_k_combine, sizeof(__pyx_k_combine), 0, 0, 1, 1}, + {&__pyx_n_s_compat_NaT, __pyx_k_compat_NaT, sizeof(__pyx_k_compat_NaT), 0, 0, 1, 1}, + {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, + {&__pyx_n_s_convert_to_timedelta, __pyx_k_convert_to_timedelta, sizeof(__pyx_k_convert_to_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_current_format, __pyx_k_current_format, sizeof(__pyx_k_current_format), 0, 0, 1, 1}, + {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, + {&__pyx_kp_s_d_2, __pyx_k_d_2, sizeof(__pyx_k_d_2), 0, 0, 1, 0}, + {&__pyx_kp_s_d_2d_2d, __pyx_k_d_2d_2d, sizeof(__pyx_k_d_2d_2d), 0, 0, 1, 0}, + {&__pyx_kp_s_d_2d_2d_2d_2d_2d, __pyx_k_d_2d_2d_2d_2d_2d, sizeof(__pyx_k_d_2d_2d_2d_2d_2d), 0, 0, 1, 0}, + {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, + {&__pyx_n_s_date_normalize, __pyx_k_date_normalize, sizeof(__pyx_k_date_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_date_repr, __pyx_k_date_repr, sizeof(__pyx_k_date_repr), 0, 0, 1, 1}, + {&__pyx_n_s_date_string, __pyx_k_date_string, sizeof(__pyx_k_date_string), 0, 0, 1, 1}, + {&__pyx_n_s_date_time, __pyx_k_date_time, sizeof(__pyx_k_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_dates_normalized, __pyx_k_dates_normalized, sizeof(__pyx_k_dates_normalized), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_datetime64, __pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_date, __pyx_k_datetime_date, sizeof(__pyx_k_datetime_date), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_result, __pyx_k_datetime_result, sizeof(__pyx_k_datetime_result), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_time, __pyx_k_datetime_time, sizeof(__pyx_k_datetime_time), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_to_datetime64, __pyx_k_datetime_to_datetime64, sizeof(__pyx_k_datetime_to_datetime64), 0, 0, 1, 1}, + {&__pyx_kp_s_dateutil, __pyx_k_dateutil, sizeof(__pyx_k_dateutil), 0, 0, 1, 0}, + {&__pyx_n_s_dateutil_2, __pyx_k_dateutil_2, sizeof(__pyx_k_dateutil_2), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_gettz, __pyx_k_dateutil_gettz, sizeof(__pyx_k_dateutil_gettz), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tz, __pyx_k_dateutil_tz, sizeof(__pyx_k_dateutil_tz), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tzfile, __pyx_k_dateutil_tzfile, sizeof(__pyx_k_dateutil_tzfile), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tzlocal, __pyx_k_dateutil_tzlocal, sizeof(__pyx_k_dateutil_tzlocal), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tzutc, __pyx_k_dateutil_tzutc, sizeof(__pyx_k_dateutil_tzutc), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_day_abbr, __pyx_k_day_abbr, sizeof(__pyx_k_day_abbr), 0, 0, 1, 1}, + {&__pyx_n_s_day_name, __pyx_k_day_name, sizeof(__pyx_k_day_name), 0, 0, 1, 1}, + {&__pyx_n_s_day_of_week, __pyx_k_day_of_week, sizeof(__pyx_k_day_of_week), 0, 0, 1, 1}, + {&__pyx_n_s_dayfirst, __pyx_k_dayfirst, sizeof(__pyx_k_dayfirst), 0, 0, 1, 1}, + {&__pyx_n_s_daylight, __pyx_k_daylight, sizeof(__pyx_k_daylight), 0, 0, 1, 1}, + {&__pyx_n_s_dayofweek, __pyx_k_dayofweek, sizeof(__pyx_k_dayofweek), 0, 0, 1, 1}, + {&__pyx_n_s_dayofyear, __pyx_k_dayofyear, sizeof(__pyx_k_dayofyear), 0, 0, 1, 1}, + {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1}, + {&__pyx_n_s_days_to_week, __pyx_k_days_to_week, sizeof(__pyx_k_days_to_week), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1}, + {&__pyx_n_s_delta_to_nanoseconds, __pyx_k_delta_to_nanoseconds, sizeof(__pyx_k_delta_to_nanoseconds), 0, 0, 1, 1}, + {&__pyx_n_s_deltas, __pyx_k_deltas, sizeof(__pyx_k_deltas), 0, 0, 1, 1}, + {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, + {&__pyx_n_s_directive, __pyx_k_directive, sizeof(__pyx_k_directive), 0, 0, 1, 1}, + {&__pyx_n_s_directive_index, __pyx_k_directive_index, sizeof(__pyx_k_directive_index), 0, 0, 1, 1}, + {&__pyx_n_s_distutils_version, __pyx_k_distutils_version, sizeof(__pyx_k_distutils_version), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_does_string_look_like_datetime, __pyx_k_does_string_look_like_datetime, sizeof(__pyx_k_does_string_look_like_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_dom, __pyx_k_dom, sizeof(__pyx_k_dom), 0, 0, 1, 1}, + {&__pyx_n_s_dow, __pyx_k_dow, sizeof(__pyx_k_dow), 0, 0, 1, 1}, + {&__pyx_n_s_doy, __pyx_k_doy, sizeof(__pyx_k_doy), 0, 0, 1, 1}, + {&__pyx_n_s_dst_hours, __pyx_k_dst_hours, sizeof(__pyx_k_dst_hours), 0, 0, 1, 1}, + {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, + {&__pyx_n_s_dt64arr_to_periodarr, __pyx_k_dt64arr_to_periodarr, sizeof(__pyx_k_dt64arr_to_periodarr), 0, 0, 1, 1}, + {&__pyx_n_s_dtarr, __pyx_k_dtarr, sizeof(__pyx_k_dtarr), 0, 0, 1, 1}, + {&__pyx_n_s_dtindex, __pyx_k_dtindex, sizeof(__pyx_k_dtindex), 0, 0, 1, 1}, + {&__pyx_n_s_dts, __pyx_k_dts, sizeof(__pyx_k_dts), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_thread, __pyx_k_dummy_thread, sizeof(__pyx_k_dummy_thread), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_thread_2, __pyx_k_dummy_thread_2, sizeof(__pyx_k_dummy_thread_2), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_end_month, __pyx_k_end_month, sizeof(__pyx_k_end_month), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, + {&__pyx_n_s_escape, __pyx_k_escape, sizeof(__pyx_k_escape), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_extract_ordinals, __pyx_k_extract_ordinals, sizeof(__pyx_k_extract_ordinals), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_kp_b_f_2, __pyx_k_f_2, sizeof(__pyx_k_f_2), 0, 0, 0, 0}, + {&__pyx_n_s_f_month, __pyx_k_f_month, sizeof(__pyx_k_f_month), 0, 0, 1, 1}, + {&__pyx_n_s_f_weekday, __pyx_k_f_weekday, sizeof(__pyx_k_f_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_fget, __pyx_k_fget, sizeof(__pyx_k_fget), 0, 0, 1, 1}, + {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, + {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, + {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, + {&__pyx_n_s_finfo, __pyx_k_finfo, sizeof(__pyx_k_finfo), 0, 0, 1, 1}, + {&__pyx_n_s_first_weekday, __pyx_k_first_weekday, sizeof(__pyx_k_first_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_fix, __pyx_k_fix, sizeof(__pyx_k_fix), 0, 0, 1, 1}, + {&__pyx_n_s_flat, __pyx_k_flat, sizeof(__pyx_k_flat), 0, 0, 1, 1}, + {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1}, + {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_format_regex, __pyx_k_format_regex, sizeof(__pyx_k_format_regex), 0, 0, 1, 1}, + {&__pyx_n_s_found, __pyx_k_found, sizeof(__pyx_k_found), 0, 0, 1, 1}, + {&__pyx_n_s_found_dict, __pyx_k_found_dict, sizeof(__pyx_k_found_dict), 0, 0, 1, 1}, + {&__pyx_n_s_found_zone, __pyx_k_found_zone, sizeof(__pyx_k_found_zone), 0, 0, 1, 1}, + {&__pyx_n_s_frac, __pyx_k_frac, sizeof(__pyx_k_frac), 0, 0, 1, 1}, + {&__pyx_n_s_fraction, __pyx_k_fraction, sizeof(__pyx_k_fraction), 0, 0, 1, 1}, + {&__pyx_n_s_freq, __pyx_k_freq, sizeof(__pyx_k_freq), 0, 0, 1, 1}, + {&__pyx_n_s_freq1, __pyx_k_freq1, sizeof(__pyx_k_freq1), 0, 0, 1, 1}, + {&__pyx_n_s_freq2, __pyx_k_freq2, sizeof(__pyx_k_freq2), 0, 0, 1, 1}, + {&__pyx_n_s_freq_group, __pyx_k_freq_group, sizeof(__pyx_k_freq_group), 0, 0, 1, 1}, + {&__pyx_n_s_freqstr, __pyx_k_freqstr, sizeof(__pyx_k_freqstr), 0, 0, 1, 1}, + {&__pyx_n_s_fromordinal, __pyx_k_fromordinal, sizeof(__pyx_k_fromordinal), 0, 0, 1, 1}, + {&__pyx_n_s_front, __pyx_k_front, sizeof(__pyx_k_front), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_date_field, __pyx_k_get_date_field, sizeof(__pyx_k_get_date_field), 0, 0, 1, 1}, + {&__pyx_n_s_get_field, __pyx_k_get_field, sizeof(__pyx_k_get_field), 0, 0, 1, 1}, + {&__pyx_n_s_get_period_field, __pyx_k_get_period_field, sizeof(__pyx_k_get_period_field), 0, 0, 1, 1}, + {&__pyx_n_s_get_period_field_arr, __pyx_k_get_period_field_arr, sizeof(__pyx_k_get_period_field_arr), 0, 0, 1, 1}, + {&__pyx_n_s_get_start_end_field, __pyx_k_get_start_end_field, sizeof(__pyx_k_get_start_end_field), 0, 0, 1, 1}, + {&__pyx_n_s_get_start_end_field_2, __pyx_k_get_start_end_field_2, sizeof(__pyx_k_get_start_end_field_2), 0, 0, 1, 1}, + {&__pyx_n_s_get_time_micros, __pyx_k_get_time_micros, sizeof(__pyx_k_get_time_micros), 0, 0, 1, 1}, + {&__pyx_n_s_get_timezone, __pyx_k_get_timezone, sizeof(__pyx_k_get_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_getlang, __pyx_k_getlang, sizeof(__pyx_k_getlang), 0, 0, 1, 1}, + {&__pyx_n_s_getlocale, __pyx_k_getlocale, sizeof(__pyx_k_getlocale), 0, 0, 1, 1}, + {&__pyx_n_s_gettz, __pyx_k_gettz, sizeof(__pyx_k_gettz), 0, 0, 1, 1}, + {&__pyx_n_s_gmt, __pyx_k_gmt, sizeof(__pyx_k_gmt), 0, 0, 1, 1}, + {&__pyx_n_s_group_key, __pyx_k_group_key, sizeof(__pyx_k_group_key), 0, 0, 1, 1}, + {&__pyx_n_s_groupdict, __pyx_k_groupdict, sizeof(__pyx_k_groupdict), 0, 0, 1, 1}, + {&__pyx_n_s_grp, __pyx_k_grp, sizeof(__pyx_k_grp), 0, 0, 1, 1}, + {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, + {&__pyx_n_s_has_saving, __pyx_k_has_saving, sizeof(__pyx_k_has_saving), 0, 0, 1, 1}, + {&__pyx_n_s_has_time_component, __pyx_k_has_time_component, sizeof(__pyx_k_has_time_component), 0, 0, 1, 1}, + {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1}, + {&__pyx_n_s_have_pytz, __pyx_k_have_pytz, sizeof(__pyx_k_have_pytz), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1}, + {&__pyx_n_s_hstack, __pyx_k_hstack, sizeof(__pyx_k_hstack), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_n_s_i8_to_pydt, __pyx_k_i8_to_pydt, sizeof(__pyx_k_i8_to_pydt), 0, 0, 1, 1}, + {&__pyx_n_s_iNaT, __pyx_k_iNaT, sizeof(__pyx_k_iNaT), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_idx_shifted, __pyx_k_idx_shifted, sizeof(__pyx_k_idx_shifted), 0, 0, 1, 1}, + {&__pyx_n_s_ignore, __pyx_k_ignore, sizeof(__pyx_k_ignore), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_infer_dst, __pyx_k_infer_dst, sizeof(__pyx_k_infer_dst), 0, 0, 1, 1}, + {&__pyx_n_s_inferred_tz, __pyx_k_inferred_tz, sizeof(__pyx_k_inferred_tz), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_ints_to_pydatetime, __pyx_k_ints_to_pydatetime, sizeof(__pyx_k_ints_to_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_iresult, __pyx_k_iresult, sizeof(__pyx_k_iresult), 0, 0, 1, 1}, + {&__pyx_n_s_is_business, __pyx_k_is_business, sizeof(__pyx_k_is_business), 0, 0, 1, 1}, + {&__pyx_n_s_is_month_end, __pyx_k_is_month_end, sizeof(__pyx_k_is_month_end), 0, 0, 1, 1}, + {&__pyx_n_s_is_month_start, __pyx_k_is_month_start, sizeof(__pyx_k_is_month_start), 0, 0, 1, 1}, + {&__pyx_n_s_is_quarter_end, __pyx_k_is_quarter_end, sizeof(__pyx_k_is_quarter_end), 0, 0, 1, 1}, + {&__pyx_n_s_is_quarter_start, __pyx_k_is_quarter_start, sizeof(__pyx_k_is_quarter_start), 0, 0, 1, 1}, + {&__pyx_n_s_is_timestamp_array, __pyx_k_is_timestamp_array, sizeof(__pyx_k_is_timestamp_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_year_end, __pyx_k_is_year_end, sizeof(__pyx_k_is_year_end), 0, 0, 1, 1}, + {&__pyx_n_s_is_year_start, __pyx_k_is_year_start, sizeof(__pyx_k_is_year_start), 0, 0, 1, 1}, + {&__pyx_n_s_isdst, __pyx_k_isdst, sizeof(__pyx_k_isdst), 0, 0, 1, 1}, + {&__pyx_n_s_isleap, __pyx_k_isleap, sizeof(__pyx_k_isleap), 0, 0, 1, 1}, + {&__pyx_n_s_isleap_prev, __pyx_k_isleap_prev, sizeof(__pyx_k_isleap_prev), 0, 0, 1, 1}, + {&__pyx_n_s_isleapyear, __pyx_k_isleapyear, sizeof(__pyx_k_isleapyear), 0, 0, 1, 1}, + {&__pyx_n_s_isoformat, __pyx_k_isoformat, sizeof(__pyx_k_isoformat), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_iterkeys, __pyx_k_iterkeys, sizeof(__pyx_k_iterkeys), 0, 0, 1, 1}, + {&__pyx_n_s_ivalue, __pyx_k_ivalue, sizeof(__pyx_k_ivalue), 0, 0, 1, 1}, + {&__pyx_n_s_ivalues, __pyx_k_ivalues, sizeof(__pyx_k_ivalues), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_kp_s_j_2, __pyx_k_j_2, sizeof(__pyx_k_j_2), 0, 0, 1, 0}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_julian, __pyx_k_julian, sizeof(__pyx_k_julian), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_kwds, __pyx_k_kwds, sizeof(__pyx_k_kwds), 0, 0, 1, 1}, + {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, + {&__pyx_kp_b_l_2, __pyx_k_l_2, sizeof(__pyx_k_l_2), 0, 0, 0, 0}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_lang, __pyx_k_lang, sizeof(__pyx_k_lang), 0, 0, 1, 1}, + {&__pyx_n_s_ldom, __pyx_k_ldom, sizeof(__pyx_k_ldom), 0, 0, 1, 1}, + {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, + {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1}, + {&__pyx_n_s_locale, __pyx_k_locale, sizeof(__pyx_k_locale), 0, 0, 1, 1}, + {&__pyx_kp_s_locale_changed_during_initializa, __pyx_k_locale_changed_during_initializa, sizeof(__pyx_k_locale_changed_during_initializa), 0, 0, 1, 0}, + {&__pyx_n_s_locale_time, __pyx_k_locale_time, sizeof(__pyx_k_locale_time), 0, 0, 1, 1}, + {&__pyx_n_s_localize, __pyx_k_localize, sizeof(__pyx_k_localize), 0, 0, 1, 1}, + {&__pyx_n_s_logical_and, __pyx_k_logical_and, sizeof(__pyx_k_logical_and), 0, 0, 1, 1}, + {&__pyx_n_s_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 0, 1, 1}, + {&__pyx_n_s_long_2, __pyx_k_long_2, sizeof(__pyx_k_long_2), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, + {&__pyx_kp_s_m8_0, __pyx_k_m8_0, sizeof(__pyx_k_m8_0), 0, 0, 1, 0}, + {&__pyx_kp_s_m8_ns, __pyx_k_m8_ns, sizeof(__pyx_k_m8_ns), 0, 0, 1, 0}, + {&__pyx_kp_s_m_2, __pyx_k_m_2, sizeof(__pyx_k_m_2), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_micros, __pyx_k_micros, sizeof(__pyx_k_micros), 0, 0, 1, 1}, + {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, + {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1}, + {&__pyx_kp_s_mixed_datetimes_and_integers_in, __pyx_k_mixed_datetimes_and_integers_in, sizeof(__pyx_k_mixed_datetimes_and_integers_in), 0, 0, 1, 0}, + {&__pyx_n_s_mo_off, __pyx_k_mo_off, sizeof(__pyx_k_mo_off), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_month_abbr, __pyx_k_month_abbr, sizeof(__pyx_k_month_abbr), 0, 0, 1, 1}, + {&__pyx_n_s_month_kw, __pyx_k_month_kw, sizeof(__pyx_k_month_kw), 0, 0, 1, 1}, + {&__pyx_n_s_month_name, __pyx_k_month_name, sizeof(__pyx_k_month_name), 0, 0, 1, 1}, + {&__pyx_n_s_month_offset, __pyx_k_month_offset, sizeof(__pyx_k_month_offset), 0, 0, 1, 1}, + {&__pyx_n_s_monthrange, __pyx_k_monthrange, sizeof(__pyx_k_monthrange), 0, 0, 1, 1}, + {&__pyx_n_s_months, __pyx_k_months, sizeof(__pyx_k_months), 0, 0, 1, 1}, + {&__pyx_n_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1}, + {&__pyx_n_s_mus, __pyx_k_mus, sizeof(__pyx_k_mus), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_kp_b_n_2, __pyx_k_n_2, sizeof(__pyx_k_n_2), 0, 0, 0, 0}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_n_s_nanos, __pyx_k_nanos, sizeof(__pyx_k_nanos), 0, 0, 1, 1}, + {&__pyx_n_s_nanosecond, __pyx_k_nanosecond, sizeof(__pyx_k_nanosecond), 0, 0, 1, 1}, + {&__pyx_n_s_nat, __pyx_k_nat, sizeof(__pyx_k_nat), 0, 0, 1, 1}, + {&__pyx_n_s_nat_strings, __pyx_k_nat_strings, sizeof(__pyx_k_nat_strings), 0, 0, 1, 1}, + {&__pyx_n_s_nat_unpickle, __pyx_k_nat_unpickle, sizeof(__pyx_k_nat_unpickle), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_new_2, __pyx_k_new_2, sizeof(__pyx_k_new_2), 0, 0, 1, 1}, + {&__pyx_n_s_new_tz, __pyx_k_new_tz, sizeof(__pyx_k_new_tz), 0, 0, 1, 1}, + {&__pyx_n_s_new_values, __pyx_k_new_values, sizeof(__pyx_k_new_values), 0, 0, 1, 1}, + {&__pyx_n_s_no_saving, __pyx_k_no_saving, sizeof(__pyx_k_no_saving), 0, 0, 1, 1}, + {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, + {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_not_datelike_strings, __pyx_k_not_datelike_strings, sizeof(__pyx_k_not_datelike_strings), 0, 0, 1, 1}, + {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_np_NaT, __pyx_k_np_NaT, sizeof(__pyx_k_np_NaT), 0, 0, 1, 1}, + {&__pyx_n_s_np_version, __pyx_k_np_version, sizeof(__pyx_k_np_version), 0, 0, 1, 1}, + {&__pyx_n_s_np_version_under1p6, __pyx_k_np_version_under1p6, sizeof(__pyx_k_np_version_under1p6), 0, 0, 1, 1}, + {&__pyx_n_s_np_version_under1p7, __pyx_k_np_version_under1p7, sizeof(__pyx_k_np_version_under1p7), 0, 0, 1, 1}, + {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1}, + {&__pyx_n_s_ntrans, __pyx_k_ntrans, sizeof(__pyx_k_ntrans), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_state, __pyx_k_object_state, sizeof(__pyx_k_object_state), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_kp_s_offset_0, __pyx_k_offset_0, sizeof(__pyx_k_offset_0), 0, 0, 1, 0}, + {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1}, + {&__pyx_n_s_one_diff, __pyx_k_one_diff, sizeof(__pyx_k_one_diff), 0, 0, 1, 1}, + {&__pyx_n_s_ordinal, __pyx_k_ordinal, sizeof(__pyx_k_ordinal), 0, 0, 1, 1}, + {&__pyx_n_s_ordinals, __pyx_k_ordinals, sizeof(__pyx_k_ordinals), 0, 0, 1, 1}, + {&__pyx_n_s_oresult, __pyx_k_oresult, sizeof(__pyx_k_oresult), 0, 0, 1, 1}, + {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, + {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, + {&__pyx_kp_s_p_2, __pyx_k_p_2, sizeof(__pyx_k_p_2), 0, 0, 1, 0}, + {&__pyx_n_s_p_tz_cache_key, __pyx_k_p_tz_cache_key, sizeof(__pyx_k_p_tz_cache_key), 0, 0, 1, 1}, + {&__pyx_n_s_pad, __pyx_k_pad, sizeof(__pyx_k_pad), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_compat, __pyx_k_pandas_compat, sizeof(__pyx_k_pandas_compat), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_tseries_frequencies, __pyx_k_pandas_tseries_frequencies, sizeof(__pyx_k_pandas_tseries_frequencies), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_tseries_period, __pyx_k_pandas_tseries_period, sizeof(__pyx_k_pandas_tseries_period), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_tslib, __pyx_k_pandas_tslib, sizeof(__pyx_k_pandas_tslib), 0, 0, 1, 1}, + {&__pyx_n_s_parse_code, __pyx_k_parse_code, sizeof(__pyx_k_parse_code), 0, 0, 1, 1}, + {&__pyx_n_s_parse_code_table, __pyx_k_parse_code_table, sizeof(__pyx_k_parse_code_table), 0, 0, 1, 1}, + {&__pyx_n_s_parse_date, __pyx_k_parse_date, sizeof(__pyx_k_parse_date), 0, 0, 1, 1}, + {&__pyx_n_s_parse_datetime_string, __pyx_k_parse_datetime_string, sizeof(__pyx_k_parse_datetime_string), 0, 0, 1, 1}, + {&__pyx_n_s_pattern, __pyx_k_pattern, sizeof(__pyx_k_pattern), 0, 0, 1, 1}, + {&__pyx_n_s_period_asfreq_arr, __pyx_k_period_asfreq_arr, sizeof(__pyx_k_period_asfreq_arr), 0, 0, 1, 1}, + {&__pyx_n_s_period_format, __pyx_k_period_format, sizeof(__pyx_k_period_format), 0, 0, 1, 1}, + {&__pyx_n_s_period_ordinal, __pyx_k_period_ordinal, sizeof(__pyx_k_period_ordinal), 0, 0, 1, 1}, + {&__pyx_n_s_periodarr, __pyx_k_periodarr, sizeof(__pyx_k_periodarr), 0, 0, 1, 1}, + {&__pyx_n_s_periodarr_to_dt64arr, __pyx_k_periodarr_to_dt64arr, sizeof(__pyx_k_periodarr_to_dt64arr), 0, 0, 1, 1}, + {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_processed_format, __pyx_k_processed_format, sizeof(__pyx_k_processed_format), 0, 0, 1, 1}, + {&__pyx_n_s_prop, __pyx_k_prop, sizeof(__pyx_k_prop), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_ps, __pyx_k_ps, sizeof(__pyx_k_ps), 0, 0, 1, 1}, + {&__pyx_n_s_py_dt, __pyx_k_py_dt, sizeof(__pyx_k_py_dt), 0, 0, 1, 1}, + {&__pyx_n_s_pydt, __pyx_k_pydt, sizeof(__pyx_k_pydt), 0, 0, 1, 1}, + {&__pyx_n_s_pydt_to_i8, __pyx_k_pydt_to_i8, sizeof(__pyx_k_pydt_to_i8), 0, 0, 1, 1}, + {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1}, + {&__pyx_n_s_pytz_BaseTzInfo, __pyx_k_pytz_BaseTzInfo, sizeof(__pyx_k_pytz_BaseTzInfo), 0, 0, 1, 1}, + {&__pyx_n_s_pytz_tzinfo, __pyx_k_pytz_tzinfo, sizeof(__pyx_k_pytz_tzinfo), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, + {&__pyx_kp_b_q_2, __pyx_k_q_2, sizeof(__pyx_k_q_2), 0, 0, 0, 0}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_quarter, __pyx_k_quarter, sizeof(__pyx_k_quarter), 0, 0, 1, 1}, + {&__pyx_n_s_raise, __pyx_k_raise, sizeof(__pyx_k_raise), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1}, + {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, + {&__pyx_n_s_re_compile, __pyx_k_re_compile, sizeof(__pyx_k_re_compile), 0, 0, 1, 1}, + {&__pyx_n_s_re_escape, __pyx_k_re_escape, sizeof(__pyx_k_re_escape), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_regex, __pyx_k_regex, sizeof(__pyx_k_regex), 0, 0, 1, 1}, + {&__pyx_n_s_regex_cache, __pyx_k_regex_cache, sizeof(__pyx_k_regex_cache), 0, 0, 1, 1}, + {&__pyx_n_s_regex_chars, __pyx_k_regex_chars, sizeof(__pyx_k_regex_chars), 0, 0, 1, 1}, + {&__pyx_n_s_relation, __pyx_k_relation, sizeof(__pyx_k_relation), 0, 0, 1, 1}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_replacement_pairs, __pyx_k_replacement_pairs, sizeof(__pyx_k_replacement_pairs), 0, 0, 1, 1}, + {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, + {&__pyx_n_s_repr_base, __pyx_k_repr_base, sizeof(__pyx_k_repr_base), 0, 0, 1, 1}, + {&__pyx_n_s_repr_timedelta64, __pyx_k_repr_timedelta64, sizeof(__pyx_k_repr_timedelta64), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_result_a, __pyx_k_result_a, sizeof(__pyx_k_result_a), 0, 0, 1, 1}, + {&__pyx_n_s_result_b, __pyx_k_result_b, sizeof(__pyx_k_result_b), 0, 0, 1, 1}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_kp_s_s_02d_02d_s, __pyx_k_s_02d_02d_s, sizeof(__pyx_k_s_02d_02d_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 0}, + {&__pyx_kp_s_s_d_days, __pyx_k_s_d_days, sizeof(__pyx_k_s_d_days), 0, 0, 1, 0}, + {&__pyx_kp_s_s_d_days_02d_02d_s, __pyx_k_s_d_days_02d_02d_s, sizeof(__pyx_k_s_d_days_02d_02d_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_is_a_bad_directive_in_format, __pyx_k_s_is_a_bad_directive_in_format, sizeof(__pyx_k_s_is_a_bad_directive_in_format), 0, 0, 1, 0}, + {&__pyx_kp_s_s_is_wrong_freq, __pyx_k_s_is_wrong_freq, sizeof(__pyx_k_s_is_wrong_freq), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_2, __pyx_k_s_s_2, sizeof(__pyx_k_s_s_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_3, __pyx_k_s_s_3, sizeof(__pyx_k_s_s_3), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_s, __pyx_k_s_s_s, sizeof(__pyx_k_s_s_s), 0, 0, 1, 0}, + {&__pyx_n_s_sa_dtype, __pyx_k_sa_dtype, sizeof(__pyx_k_sa_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_searchsorted, __pyx_k_searchsorted, sizeof(__pyx_k_searchsorted), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_seconds_pretty, __pyx_k_seconds_pretty, sizeof(__pyx_k_seconds_pretty), 0, 0, 1, 1}, + {&__pyx_n_s_seen_datetime, __pyx_k_seen_datetime, sizeof(__pyx_k_seen_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_seen_integer, __pyx_k_seen_integer, sizeof(__pyx_k_seen_integer), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_sep, __pyx_k_sep, sizeof(__pyx_k_sep), 0, 0, 1, 1}, + {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1}, + {&__pyx_n_s_seqToRE, __pyx_k_seqToRE, sizeof(__pyx_k_seqToRE), 0, 0, 1, 1}, + {&__pyx_n_s_setitem, __pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_short, __pyx_k_short, sizeof(__pyx_k_short), 0, 0, 1, 1}, + {&__pyx_n_s_short_version, __pyx_k_short_version, sizeof(__pyx_k_short_version), 0, 0, 1, 1}, + {&__pyx_n_s_side, __pyx_k_side, sizeof(__pyx_k_side), 0, 0, 1, 1}, + {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, + {&__pyx_n_s_sign_pretty, __pyx_k_sign_pretty, sizeof(__pyx_k_sign_pretty), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, + {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, + {&__pyx_n_s_sp, __pyx_k_sp, sizeof(__pyx_k_sp), 0, 0, 1, 1}, + {&__pyx_n_s_squeeze, __pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 0, 1, 1}, + {&__pyx_n_s_stamp, __pyx_k_stamp, sizeof(__pyx_k_stamp), 0, 0, 1, 1}, + {&__pyx_n_s_stamps, __pyx_k_stamps, sizeof(__pyx_k_stamps), 0, 0, 1, 1}, + {&__pyx_n_s_start_month, __pyx_k_start_month, sizeof(__pyx_k_start_month), 0, 0, 1, 1}, + {&__pyx_n_s_startingMonth, __pyx_k_startingMonth, sizeof(__pyx_k_startingMonth), 0, 0, 1, 1}, + {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, + {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_kp_s_stray_in_format_s, __pyx_k_stray_in_format_s, sizeof(__pyx_k_stray_in_format_s), 0, 0, 1, 0}, + {&__pyx_n_s_strftime, __pyx_k_strftime, sizeof(__pyx_k_strftime), 0, 0, 1, 1}, + {&__pyx_n_s_string_types, __pyx_k_string_types, sizeof(__pyx_k_string_types), 0, 0, 1, 1}, + {&__pyx_n_s_struct_time, __pyx_k_struct_time, sizeof(__pyx_k_struct_time), 0, 0, 1, 1}, + {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, + {&__pyx_n_s_sub_2, __pyx_k_sub_2, sizeof(__pyx_k_sub_2), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_switch_idx, __pyx_k_switch_idx, sizeof(__pyx_k_switch_idx), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, + {&__pyx_kp_s_tar_gz, __pyx_k_tar_gz, sizeof(__pyx_k_tar_gz), 0, 0, 1, 0}, + {&__pyx_n_s_td, __pyx_k_td, sizeof(__pyx_k_td), 0, 0, 1, 1}, + {&__pyx_n_s_tdata, __pyx_k_tdata, sizeof(__pyx_k_tdata), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_thread, __pyx_k_thread, sizeof(__pyx_k_thread), 0, 0, 1, 1}, + {&__pyx_n_s_thread_2, __pyx_k_thread_2, sizeof(__pyx_k_thread_2), 0, 0, 1, 1}, + {&__pyx_n_s_thread_allocate_lock, __pyx_k_thread_allocate_lock, sizeof(__pyx_k_thread_allocate_lock), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_kp_s_time_data_r_does_not_match_forma, __pyx_k_time_data_r_does_not_match_forma, sizeof(__pyx_k_time_data_r_does_not_match_forma), 0, 0, 1, 0}, + {&__pyx_n_s_time_repr, __pyx_k_time_repr, sizeof(__pyx_k_time_repr), 0, 0, 1, 1}, + {&__pyx_n_s_time_tuple, __pyx_k_time_tuple, sizeof(__pyx_k_time_tuple), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta64, __pyx_k_timedelta64, sizeof(__pyx_k_timedelta64), 0, 0, 1, 1}, + {&__pyx_kp_s_timedelta64_ns, __pyx_k_timedelta64_ns, sizeof(__pyx_k_timedelta64_ns), 0, 0, 1, 0}, + {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_to_convert, __pyx_k_to_convert, sizeof(__pyx_k_to_convert), 0, 0, 1, 1}, + {&__pyx_n_s_to_datetime, __pyx_k_to_datetime, sizeof(__pyx_k_to_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_to_julian_date, __pyx_k_to_julian_date, sizeof(__pyx_k_to_julian_date), 0, 0, 1, 1}, + {&__pyx_n_s_to_offset, __pyx_k_to_offset, sizeof(__pyx_k_to_offset), 0, 0, 1, 1}, + {&__pyx_n_s_to_period, __pyx_k_to_period, sizeof(__pyx_k_to_period), 0, 0, 1, 1}, + {&__pyx_n_s_to_pydatetime, __pyx_k_to_pydatetime, sizeof(__pyx_k_to_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_today, __pyx_k_today, sizeof(__pyx_k_today), 0, 0, 1, 1}, + {&__pyx_n_s_toordinal, __pyx_k_toordinal, sizeof(__pyx_k_toordinal), 0, 0, 1, 1}, + {&__pyx_n_s_tot_seconds, __pyx_k_tot_seconds, sizeof(__pyx_k_tot_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_total_seconds, __pyx_k_total_seconds, sizeof(__pyx_k_total_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_trans, __pyx_k_trans, sizeof(__pyx_k_trans), 0, 0, 1, 1}, + {&__pyx_n_s_trans_cache, __pyx_k_trans_cache, sizeof(__pyx_k_trans_cache), 0, 0, 1, 1}, + {&__pyx_n_s_trans_grp, __pyx_k_trans_grp, sizeof(__pyx_k_trans_grp), 0, 0, 1, 1}, + {&__pyx_n_s_trans_idx, __pyx_k_trans_idx, sizeof(__pyx_k_trans_idx), 0, 0, 1, 1}, + {&__pyx_n_s_trans_idx_2, __pyx_k_trans_idx_2, sizeof(__pyx_k_trans_idx_2), 0, 0, 1, 1}, + {&__pyx_n_s_trans_len, __pyx_k_trans_len, sizeof(__pyx_k_trans_len), 0, 0, 1, 1}, + {&__pyx_n_s_trans_list, __pyx_k_trans_list, sizeof(__pyx_k_trans_list), 0, 0, 1, 1}, + {&__pyx_n_s_transition_info, __pyx_k_transition_info, sizeof(__pyx_k_transition_info), 0, 0, 1, 1}, + {&__pyx_n_s_ts, __pyx_k_ts, sizeof(__pyx_k_ts), 0, 0, 1, 1}, + {&__pyx_n_s_ts_2, __pyx_k_ts_2, sizeof(__pyx_k_ts_2), 0, 0, 1, 1}, + {&__pyx_n_s_ts_base, __pyx_k_ts_base, sizeof(__pyx_k_ts_base), 0, 0, 1, 1}, + {&__pyx_n_s_ts_input, __pyx_k_ts_input, sizeof(__pyx_k_ts_input), 0, 0, 1, 1}, + {&__pyx_n_s_tso, __pyx_k_tso, sizeof(__pyx_k_tso), 0, 0, 1, 1}, + {&__pyx_n_s_ttinfo_before, __pyx_k_ttinfo_before, sizeof(__pyx_k_ttinfo_before), 0, 0, 1, 1}, + {&__pyx_n_s_ttinfo_std, __pyx_k_ttinfo_std, sizeof(__pyx_k_ttinfo_std), 0, 0, 1, 1}, + {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1}, + {&__pyx_n_s_tz1, __pyx_k_tz1, sizeof(__pyx_k_tz1), 0, 0, 1, 1}, + {&__pyx_n_s_tz2, __pyx_k_tz2, sizeof(__pyx_k_tz2), 0, 0, 1, 1}, + {&__pyx_kp_s_tz_0, __pyx_k_tz_0, sizeof(__pyx_k_tz_0), 0, 0, 1, 0}, + {&__pyx_n_s_tz_convert, __pyx_k_tz_convert, sizeof(__pyx_k_tz_convert), 0, 0, 1, 1}, + {&__pyx_n_s_tz_convert_single, __pyx_k_tz_convert_single, sizeof(__pyx_k_tz_convert_single), 0, 0, 1, 1}, + {&__pyx_n_s_tz_localize, __pyx_k_tz_localize, sizeof(__pyx_k_tz_localize), 0, 0, 1, 1}, + {&__pyx_n_s_tz_localize_to_utc, __pyx_k_tz_localize_to_utc, sizeof(__pyx_k_tz_localize_to_utc), 0, 0, 1, 1}, + {&__pyx_kp_s_tz_s, __pyx_k_tz_s, sizeof(__pyx_k_tz_s), 0, 0, 1, 0}, + {&__pyx_n_s_tz_values, __pyx_k_tz_values, sizeof(__pyx_k_tz_values), 0, 0, 1, 1}, + {&__pyx_n_s_tzfile, __pyx_k_tzfile, sizeof(__pyx_k_tzfile), 0, 0, 1, 1}, + {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1}, + {&__pyx_n_s_tzinfos, __pyx_k_tzinfos, sizeof(__pyx_k_tzinfos), 0, 0, 1, 1}, + {&__pyx_n_s_tzlocal, __pyx_k_tzlocal, sizeof(__pyx_k_tzlocal), 0, 0, 1, 1}, + {&__pyx_n_s_tzname, __pyx_k_tzname, sizeof(__pyx_k_tzname), 0, 0, 1, 1}, + {&__pyx_n_s_tzoffset, __pyx_k_tzoffset, sizeof(__pyx_k_tzoffset), 0, 0, 1, 1}, + {&__pyx_n_s_tzset, __pyx_k_tzset, sizeof(__pyx_k_tzset), 0, 0, 1, 1}, + {&__pyx_n_s_tzutc, __pyx_k_tzutc, sizeof(__pyx_k_tzutc), 0, 0, 1, 1}, + {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, + {&__pyx_kp_b_u_2, __pyx_k_u_2, sizeof(__pyx_k_u_2), 0, 0, 0, 0}, + {&__pyx_kp_s_unconverted_data_remains_s, __pyx_k_unconverted_data_remains_s, sizeof(__pyx_k_unconverted_data_remains_s), 0, 0, 1, 0}, + {&__pyx_n_s_unique_deltas, __pyx_k_unique_deltas, sizeof(__pyx_k_unique_deltas), 0, 0, 1, 1}, + {&__pyx_n_s_uniques, __pyx_k_uniques, sizeof(__pyx_k_uniques), 0, 0, 1, 1}, + {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_kp_s_unsupported_unit_for_native_time, __pyx_k_unsupported_unit_for_native_time, sizeof(__pyx_k_unsupported_unit_for_native_time), 0, 0, 1, 0}, + {&__pyx_n_s_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 0, 1, 1}, + {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1}, + {&__pyx_n_s_utc_convert, __pyx_k_utc_convert, sizeof(__pyx_k_utc_convert), 0, 0, 1, 1}, + {&__pyx_n_s_utc_date, __pyx_k_utc_date, sizeof(__pyx_k_utc_date), 0, 0, 1, 1}, + {&__pyx_n_s_utc_dates, __pyx_k_utc_dates, sizeof(__pyx_k_utc_dates), 0, 0, 1, 1}, + {&__pyx_n_s_utc_offset_cache, __pyx_k_utc_offset_cache, sizeof(__pyx_k_utc_offset_cache), 0, 0, 1, 1}, + {&__pyx_n_s_utc_transition_times, __pyx_k_utc_transition_times, sizeof(__pyx_k_utc_transition_times), 0, 0, 1, 1}, + {&__pyx_n_s_utcnow, __pyx_k_utcnow, sizeof(__pyx_k_utcnow), 0, 0, 1, 1}, + {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1}, + {&__pyx_n_s_utcoffset_2, __pyx_k_utcoffset_2, sizeof(__pyx_k_utcoffset_2), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_vals, __pyx_k_vals, sizeof(__pyx_k_vals), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_kp_s_w_2, __pyx_k_w_2, sizeof(__pyx_k_w_2), 0, 0, 1, 0}, + {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, + {&__pyx_n_s_week, __pyx_k_week, sizeof(__pyx_k_week), 0, 0, 1, 1}, + {&__pyx_n_s_week_0_length, __pyx_k_week_0_length, sizeof(__pyx_k_week_0_length), 0, 0, 1, 1}, + {&__pyx_n_s_week_of_year, __pyx_k_week_of_year, sizeof(__pyx_k_week_of_year), 0, 0, 1, 1}, + {&__pyx_n_s_week_of_year_start, __pyx_k_week_of_year_start, sizeof(__pyx_k_week_of_year_start), 0, 0, 1, 1}, + {&__pyx_n_s_week_starts_Mon, __pyx_k_week_starts_Mon, sizeof(__pyx_k_week_starts_Mon), 0, 0, 1, 1}, + {&__pyx_n_s_weekday, __pyx_k_weekday, sizeof(__pyx_k_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_weekofyear, __pyx_k_weekofyear, sizeof(__pyx_k_weekofyear), 0, 0, 1, 1}, + {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1}, + {&__pyx_n_s_whitespace_replacement, __pyx_k_whitespace_replacement, sizeof(__pyx_k_whitespace_replacement), 0, 0, 1, 1}, + {&__pyx_n_s_woy, __pyx_k_woy, sizeof(__pyx_k_woy), 0, 0, 1, 1}, + {&__pyx_kp_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 0}, + {&__pyx_n_s_x_2, __pyx_k_x_2, sizeof(__pyx_k_x_2), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_kp_s_y_2, __pyx_k_y_2, sizeof(__pyx_k_y_2), 0, 0, 1, 0}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {&__pyx_n_s_year2000, __pyx_k_year2000, sizeof(__pyx_k_year2000), 0, 0, 1, 1}, + {&__pyx_n_s_years, __pyx_k_years, sizeof(__pyx_k_years), 0, 0, 1, 1}, + {&__pyx_kp_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 0}, + {&__pyx_n_s_zero_time, __pyx_k_zero_time, sizeof(__pyx_k_zero_time), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {&__pyx_n_s_zone, __pyx_k_zone, sizeof(__pyx_k_zone), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/tslib.pyx":184 + * @classmethod + * def utcnow(cls): + * return cls.now('UTC') # <<<<<<<<<<<<<< + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_UTC); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/tslib.pyx":222 + * + * try: + * stamp += self.strftime('%z') # <<<<<<<<<<<<<< + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_z); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/tslib.pyx":227 + * except ValueError: + * year2000 = self.replace(year=2000) + * stamp += year2000.strftime('%z') # <<<<<<<<<<<<<< + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_z); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/tslib.pyx":232 + * + * try: + * stamp += zone.strftime(' %%Z') # <<<<<<<<<<<<<< + * except: + * pass + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Z); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/tslib.pyx":300 + * @property + * def dayofyear(self): + * return self._get_field('doy') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_doy); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/tslib.pyx":304 + * @property + * def week(self): + * return self._get_field('woy') # <<<<<<<<<<<<<< + * + * weekofyear = week + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_woy); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/tslib.pyx":310 + * @property + * def quarter(self): + * return self._get_field('q') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_q); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/tslib.pyx":318 + * @property + * def asm8(self): + * return np.int64(self.value).view('M8[ns]') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_M8_ns); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/tslib.pyx":322 + * @property + * def is_month_start(self): + * return self._get_start_end_field('is_month_start') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_is_month_start); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "pandas/tslib.pyx":326 + * @property + * def is_month_end(self): + * return self._get_start_end_field('is_month_end') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_is_month_end); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "pandas/tslib.pyx":330 + * @property + * def is_quarter_start(self): + * return self._get_start_end_field('is_quarter_start') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_is_quarter_start); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/tslib.pyx":334 + * @property + * def is_quarter_end(self): + * return self._get_start_end_field('is_quarter_end') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_is_quarter_end); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/tslib.pyx":338 + * @property + * def is_year_start(self): + * return self._get_start_end_field('is_year_start') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_is_year_start); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "pandas/tslib.pyx":342 + * @property + * def is_year_end(self): + * return self._get_start_end_field('is_year_end') # <<<<<<<<<<<<<< + * + * def tz_localize(self, tz, infer_dst=False): + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_is_year_end); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/tslib.pyx":365 + * return Timestamp(value, tz=tz) + * else: + * raise Exception('Cannot localize tz-aware Timestamp, use ' # <<<<<<<<<<<<<< + * 'tz_convert for conversions') + * + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_localize_tz_aware_Timesta); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "pandas/tslib.pyx":383 + * if self.tzinfo is None: + * # tz naive, use tz_localize + * raise Exception('Cannot convert tz-naive Timestamp, use ' # <<<<<<<<<<<<<< + * 'tz_localize to localize') + * else: + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_convert_tz_naive_Timestam); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "pandas/tslib.pyx":417 + * + * if self.tzinfo is not None: + * base1, base2 = base[:-6], base[-6:] # <<<<<<<<<<<<<< + * else: + * base1, base2 = base, "" + */ + __pyx_slice__18 = PySlice_New(Py_None, __pyx_int_neg_6, Py_None); if (unlikely(!__pyx_slice__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__18); + __Pyx_GIVEREF(__pyx_slice__18); + __pyx_slice__19 = PySlice_New(__pyx_int_neg_6, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__19); + __Pyx_GIVEREF(__pyx_slice__19); + + /* "pandas/tslib.pyx":497 + * + * def __reduce__(self): + * return (__nat_unpickle, (None, )) # <<<<<<<<<<<<<< + * + * fields = ['year', 'quarter', 'month', 'day', 'hour', + */ + __pyx_tuple__20 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "pandas/tslib.pyx":555 + * + * if i >= sz or sz == 0 or i < 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * if arr.descr.type_num == NPY_DATETIME: + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "pandas/tslib.pyx":615 + * + * result = np.empty(n, dtype='M8[ns]') + * new_values = result.view('i8') # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "pandas/tslib.pyx":726 + * if self.tzinfo is None: + * if other.tzinfo is not None: + * raise ValueError('Cannot compare tz-naive and tz-aware ' # <<<<<<<<<<<<<< + * 'timestamps') + * elif other.tzinfo is None: + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_compare_tz_naive_and_tz_a); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "pandas/tslib.pyx":729 + * 'timestamps') + * elif other.tzinfo is None: + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') # <<<<<<<<<<<<<< + * + * cpdef datetime to_datetime(_Timestamp self): + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_compare_tz_naive_and_tz_a); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "pandas/tslib.pyx":745 + * + * if is_timedelta64_object(other): + * other_int = other.astype('timedelta64[ns]').view('i8') # <<<<<<<<<<<<<< + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) + * + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_timedelta64_ns); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "pandas/tslib.pyx":750 + * elif is_integer_object(other): + * if self.offset is None: + * raise ValueError("Cannot add integral value to Timestamp " # <<<<<<<<<<<<<< + * "without offset.") + * return Timestamp((self.offset * other).apply(self), offset=self.offset) + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_add_integral_value_to_Tim); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "pandas/tslib.pyx":781 + * + * cpdef _get_start_end_field(self, field): + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 # <<<<<<<<<<<<<< + * freqstr = self.freqstr if self.freq else None + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) + */ + __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_month, __pyx_int_12); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/tslib.pyx":849 + * delta = delta.delta + * if is_timedelta64_object(delta): + * return delta.astype("timedelta64[ns]").item() # <<<<<<<<<<<<<< + * if is_integer_object(delta): + * return delta + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_timedelta64_ns); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "pandas/tslib.pyx":898 + * obj.value = NPY_NAT + * elif is_datetime64_object(ts): + * if ts.view('i8') == iNaT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "pandas/tslib.pyx":1045 + * if _treat_tz_as_dateutil(tz): + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' # <<<<<<<<<<<<<< + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Bad_tz_filename_Dateutil_on_pyth); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "pandas/tslib.pyx":1066 + * ''' + * if isinstance(tz, string_types): + * if tz.startswith('dateutil/'): # <<<<<<<<<<<<<< + * zone = tz[9:] + * tz = _dateutil_gettz(tz[9:]) + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dateutil); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "pandas/tslib.pyx":1067 + * if isinstance(tz, string_types): + * if tz.startswith('dateutil/'): + * zone = tz[9:] # <<<<<<<<<<<<<< + * tz = _dateutil_gettz(tz[9:]) + * # On Python 3 on Windows, the filename is not always set correctly. + */ + __pyx_slice__33 = PySlice_New(__pyx_int_9, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__33); + __Pyx_GIVEREF(__pyx_slice__33); + + /* "pandas/tslib.pyx":1068 + * if tz.startswith('dateutil/'): + * zone = tz[9:] + * tz = _dateutil_gettz(tz[9:]) # <<<<<<<<<<<<<< + * # On Python 3 on Windows, the filename is not always set correctly. + * if isinstance(tz, _dateutil_tzfile) and '.tar.gz' in tz._filename: + */ + __pyx_slice__34 = PySlice_New(__pyx_int_9, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__34); + __Pyx_GIVEREF(__pyx_slice__34); + + /* "pandas/tslib.pyx":1118 + * + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "pandas/tslib.pyx":1127 + * if inferred_tz is not None: + * if _get_zone(val.tzinfo) != inferred_tz: + * raise ValueError('Array must be all same time zone') # <<<<<<<<<<<<<< + * else: + * inferred_tz = _get_zone(val.tzinfo) + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Array_must_be_all_same_time_zone); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "pandas/tslib.pyx":1136 + * else: + * if inferred_tz is not None: + * raise ValueError('Cannot mix tz-aware with tz-naive values') # <<<<<<<<<<<<<< + * iresult[i] = _pydatetime_to_dts(val, &dts) + * _check_dts_bounds(&dts) + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Cannot_mix_tz_aware_with_tz_naiv); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "pandas/tslib.pyx":1147 + * + * def _does_string_look_like_datetime(date_string): + * if date_string.startswith('0'): # <<<<<<<<<<<<<< + * # Strings starting with 0 are more consistent with a + * # date-like string than a number + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "pandas/tslib.pyx":1165 + * def parse_datetime_string(date_string, **kwargs): + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') # <<<<<<<<<<<<<< + * + * dt = parse_date(date_string, **kwargs) + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Given_date_string_not_likely_a_d); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "pandas/tslib.pyx":1184 + * try: + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "pandas/tslib.pyx":1203 + * raise + * else: + * raise ValueError('Tz-aware datetime.datetime cannot ' # <<<<<<<<<<<<<< + * 'be converted to datetime64 unless ' + * 'utc=True') + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Tz_aware_datetime_datetime_canno); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "pandas/tslib.pyx":1228 + * raise + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * else: + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "pandas/tslib.pyx":1294 + * # example + * if seen_integer and seen_datetime: + * raise ValueError("mixed datetimes and integers in passed array") # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_mixed_datetimes_and_integers_in); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "pandas/tslib.pyx":1309 + * oresult[i] = np.nan + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: # <<<<<<<<<<<<<< + * oresult[i] = np.nan + * else: + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "pandas/tslib.pyx":1354 + * n = values.shape[0] + * result = np.empty(n, dtype='m8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "pandas/tslib.pyx":1384 + * elif util.is_datetime64_object(ts): + * # only accept a NaT here + * if ts.astype('int64') == iNaT: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * elif isinstance(ts, np.timedelta64): + */ + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "pandas/tslib.pyx":1393 + * else: + * if util.is_array(ts): + * ts = ts.astype('int64').item() # <<<<<<<<<<<<<< + * if unit in ['Y','M','W']: + * if _np_version_under1p7: + */ + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "pandas/tslib.pyx":1428 + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * return ts.astype('timedelta64[ns]') # <<<<<<<<<<<<<< + * + * def repr_timedelta64(object value, format=None): + */ + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_timedelta64_ns); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "pandas/tslib.pyx":1446 + * cdef object ivalue + * + * ivalue = value.view('i8') # <<<<<<<<<<<<<< + * + * # put frac in seconds + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + + /* "pandas/tslib.pyx":1508 + * + * global _TimeRE_cache, _regex_cache + * with _cache_lock: # <<<<<<<<<<<<<< + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() + */ + __pyx_tuple__53 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + + /* "pandas/tslib.pyx":1534 + * + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * + * dts.us = dts.ps = dts.as = 0 + */ + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + + /* "pandas/tslib.pyx":1634 + * elif parse_code == 7: + * hour = int(found_dict['I']) + * ampm = found_dict.get('p', '').lower() # <<<<<<<<<<<<<< + * # If there was no AM/PM indicator, we'll treat this like AM + * if ampm in ('', locale_time.am_pm[0]): + */ + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "pandas/tslib.pyx":1743 + * unit = get_datetime64_unit(val) + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') # <<<<<<<<<<<<<< + * + * ival = get_datetime64_value(val) + */ + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_NumPy_1_6_1_business_freq_not_su); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "pandas/tslib.pyx":1812 + * unit = get_datetime64_unit(arr.flat[0]) + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_NumPy_1_6_1_business_freq_not_su); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "pandas/tslib.pyx":1881 + * pos = trans.searchsorted(vals[0]) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_First_time_before_start_of_DST_i); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "pandas/tslib.pyx":1912 + * pos = trans.searchsorted(utc_dates[0]) + * if pos == 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * elif pos == len(trans): + * return utc_dates + deltas[-1] + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_First_time_before_start_of_DST_i); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "pandas/tslib.pyx":1959 + * pos = trans.searchsorted(val) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * offset = deltas[pos] + * utc_date = val - offset + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_First_time_before_start_of_DST_i); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "pandas/tslib.pyx":1978 + * pos = trans.searchsorted(utc_date) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_First_time_before_start_of_DST_i); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "pandas/tslib.pyx":2016 + * elif isinstance(tz, _dateutil_tzfile): + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' # <<<<<<<<<<<<<< + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + */ + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Bad_tz_filename_Dateutil_on_pyth); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "pandas/tslib.pyx":2035 + * if _treat_tz_as_pytz(tz): + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + * arr = arr.view('i8') # <<<<<<<<<<<<<< + * try: + * if tz._utc_transition_times[0].year == 1: + */ + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + + /* "pandas/tslib.pyx":2046 + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed # <<<<<<<<<<<<<< + * arr = arr.view('i8') + * # scale transitions correctly in numpy 1.6 + */ + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_M8_ns); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + + /* "pandas/tslib.pyx":2047 + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + * arr = arr.view('i8') # <<<<<<<<<<<<<< + * # scale transitions correctly in numpy 1.6 + * if _np_version_under1p7: + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "pandas/tslib.pyx":2147 + * + * if not have_pytz: + * raise Exception("Could not find pytz module") # <<<<<<<<<<<<<< + * + * if tz == UTC or tz is None: + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_Could_not_find_pytz_module); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "pandas/tslib.pyx":2312 + * count = len(dtindex) + * + * sa_dtype = [('Y', 'i4'), # year # <<<<<<<<<<<<<< + * ('M', 'i4'), # month + * ('D', 'i4'), # day + */ + __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_Y, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "pandas/tslib.pyx":2313 + * + * sa_dtype = [('Y', 'i4'), # year + * ('M', 'i4'), # month # <<<<<<<<<<<<<< + * ('D', 'i4'), # day + * ('h', 'i4'), # hour + */ + __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_M, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "pandas/tslib.pyx":2314 + * sa_dtype = [('Y', 'i4'), # year + * ('M', 'i4'), # month + * ('D', 'i4'), # day # <<<<<<<<<<<<<< + * ('h', 'i4'), # hour + * ('m', 'i4'), # min + */ + __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_D, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "pandas/tslib.pyx":2315 + * ('M', 'i4'), # month + * ('D', 'i4'), # day + * ('h', 'i4'), # hour # <<<<<<<<<<<<<< + * ('m', 'i4'), # min + * ('s', 'i4'), # second + */ + __pyx_tuple__70 = PyTuple_Pack(2, __pyx_n_s_h, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "pandas/tslib.pyx":2316 + * ('D', 'i4'), # day + * ('h', 'i4'), # hour + * ('m', 'i4'), # min # <<<<<<<<<<<<<< + * ('s', 'i4'), # second + * ('u', 'i4')] # microsecond + */ + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_m, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "pandas/tslib.pyx":2317 + * ('h', 'i4'), # hour + * ('m', 'i4'), # min + * ('s', 'i4'), # second # <<<<<<<<<<<<<< + * ('u', 'i4')] # microsecond + * + */ + __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_s, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "pandas/tslib.pyx":2318 + * ('m', 'i4'), # min + * ('s', 'i4'), # second + * ('u', 'i4')] # microsecond # <<<<<<<<<<<<<< + * + * out = np.empty(count, dtype=sa_dtype) + */ + __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_u, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "pandas/tslib.pyx":2541 + * # other offests use month, startingMonth as ending month of year. + * + * if (freqstr[0:2] in ['MS', 'QS', 'AS']) or (freqstr[1:3] in ['MS', 'QS', 'AS']): # <<<<<<<<<<<<<< + * end_month = 12 if month_kw == 1 else month_kw - 1 + * start_month = month_kw + */ + __pyx_slice__74 = PySlice_New(__pyx_int_0, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__74); + __Pyx_GIVEREF(__pyx_slice__74); + __pyx_slice__75 = PySlice_New(__pyx_int_1, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__75); + __Pyx_GIVEREF(__pyx_slice__75); + + /* "pandas/tslib.pyx":2871 + * + * if month < 1 or month > 12: + * raise ValueError("bad month number 0; must be 1-12") # <<<<<<<<<<<<<< + * + * days = days_per_month_table[is_leapyear(year)][month-1] + */ + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_bad_month_number_0_must_be_1_12); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + + /* "pandas/tslib.pyx":2906 + * + * if not have_pytz: + * raise Exception('Could not find pytz module') # <<<<<<<<<<<<<< + * + * if _is_utc(tz): + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Could_not_find_pytz_module); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + + /* "pandas/tslib.pyx":3112 + * + * if retval == INT32_MIN: + * raise ValueError('Frequency conversion failed') # <<<<<<<<<<<<<< + * + * return retval + */ + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Frequency_conversion_failed); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + + /* "pandas/tslib.pyx":3147 + * val = func(val, relation, &finfo) + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") # <<<<<<<<<<<<<< + * result[i] = val + * else: + */ + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_to_desired_fre); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + + /* "pandas/tslib.pyx":3153 + * val = func(arr[i], relation, &finfo) + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") # <<<<<<<<<<<<<< + * result[i] = val + * + */ + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_to_desired_fre); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + + /* "pandas/tslib.pyx":3250 + * + * if PyUnicode_Check(fmt): + * fmt = fmt.encode('utf-8') # <<<<<<<<<<<<<< + * + * get_date_info(value, freq, &dinfo) + */ + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + + /* "pandas/tslib.pyx":3268 + * if found_pat[i]: + * if get_yq(value, freq, &quarter, &year) < 0: + * raise ValueError('Unable to get quarter and year') # <<<<<<<<<<<<<< + * + * if i == 0: + */ + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_get_quarter_and_year); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + + /* "pandas/tslib.pyx":3286 + * + * if PY2: + * result = result.decode('utf-8', 'ignore') # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_tuple__83 = PyTuple_Pack(2, __pyx_kp_s_utf_8, __pyx_n_s_ignore); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + + /* "pandas/tslib.pyx":3551 + * self.__calc_date_time() + * if _getlang() != self.lang: + * raise ValueError("locale changed during initialization") # <<<<<<<<<<<<<< + * + * def __pad(self, seq, front): + */ + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_locale_changed_during_initializa); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + + /* "pandas/tslib.pyx":3557 + * seq = list(seq) + * if front: + * seq.insert(0, '') # <<<<<<<<<<<<<< + * else: + * seq.append('') + */ + __pyx_tuple__85 = PyTuple_Pack(2, __pyx_int_0, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + + /* "pandas/tslib.pyx":3584 + * # static date was needed. + * am_pm = [] + * for hour in (01,22): # <<<<<<<<<<<<<< + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + * am_pm.append(time.strftime("%p", time_tuple).lower()) + */ + __pyx_tuple__86 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_22); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + + /* "pandas/tslib.pyx":3597 + * # values within the format string is very important; it eliminates + * # possible ambiguity for what something represents. + * time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) # <<<<<<<<<<<<<< + * date_time = [None, None, None] + * date_time[0] = time.strftime("%c", time_tuple).lower() + */ + __pyx_tuple__87 = PyTuple_Pack(9, __pyx_int_1999, __pyx_int_3, __pyx_int_17, __pyx_int_22, __pyx_int_44, __pyx_int_55, __pyx_int_2, __pyx_int_76, __pyx_int_0); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_tuple__87); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + + /* "pandas/tslib.pyx":3602 + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), # <<<<<<<<<<<<<< + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + */ + __pyx_tuple__90 = PyTuple_Pack(2, __pyx_kp_s__52, __pyx_kp_s__89); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + + /* "pandas/tslib.pyx":3605 + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), # <<<<<<<<<<<<<< + * ('44', '%M'), ('55', '%S'), ('76', '%j'), + * ('17', '%d'), ('03', '%m'), ('3', '%m'), + */ + __pyx_tuple__91 = PyTuple_Pack(2, __pyx_kp_s_1999, __pyx_kp_s_Y_2); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + __pyx_tuple__92 = PyTuple_Pack(2, __pyx_kp_s_99, __pyx_kp_s_y_2); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_tuple__93 = PyTuple_Pack(2, __pyx_kp_s_22, __pyx_kp_s_H_2); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + + /* "pandas/tslib.pyx":3606 + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), + * ('44', '%M'), ('55', '%S'), ('76', '%j'), # <<<<<<<<<<<<<< + * ('17', '%d'), ('03', '%m'), ('3', '%m'), + * # '3' needed for when no leading zero. + */ + __pyx_tuple__94 = PyTuple_Pack(2, __pyx_kp_s_44, __pyx_kp_s_M_2); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __pyx_tuple__95 = PyTuple_Pack(2, __pyx_kp_s_55, __pyx_kp_s_S_2); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_tuple__96 = PyTuple_Pack(2, __pyx_kp_s_76, __pyx_kp_s_j_2); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + + /* "pandas/tslib.pyx":3607 + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), + * ('44', '%M'), ('55', '%S'), ('76', '%j'), + * ('17', '%d'), ('03', '%m'), ('3', '%m'), # <<<<<<<<<<<<<< + * # '3' needed for when no leading zero. + * ('2', '%w'), ('10', '%I')] + */ + __pyx_tuple__97 = PyTuple_Pack(2, __pyx_kp_s_17, __pyx_kp_s_d_2); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_tuple__98 = PyTuple_Pack(2, __pyx_kp_s_03, __pyx_kp_s_m_2); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_tuple__99 = PyTuple_Pack(2, __pyx_kp_s_3, __pyx_kp_s_m_2); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + + /* "pandas/tslib.pyx":3609 + * ('17', '%d'), ('03', '%m'), ('3', '%m'), + * # '3' needed for when no leading zero. + * ('2', '%w'), ('10', '%I')] # <<<<<<<<<<<<<< + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone + * for tz in tz_values]) + */ + __pyx_tuple__100 = PyTuple_Pack(2, __pyx_kp_s_2, __pyx_kp_s_w_2); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_tuple__101 = PyTuple_Pack(2, __pyx_kp_s_10, __pyx_kp_s_I_2); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + + /* "pandas/tslib.pyx":3612 + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): # <<<<<<<<<<<<<< + * current_format = date_time[offset] + * for old, new in replacement_pairs: + */ + __pyx_tuple__102 = PyTuple_Pack(2, __pyx_int_0, __pyx_kp_s_c); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_tuple__103 = PyTuple_Pack(2, __pyx_int_1, __pyx_kp_s_x); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + __pyx_tuple__104 = PyTuple_Pack(2, __pyx_int_2, __pyx_kp_s_X); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_tuple__105 = PyTuple_Pack(3, __pyx_tuple__102, __pyx_tuple__103, __pyx_tuple__104); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + + /* "pandas/tslib.pyx":3624 + * # 2005-01-03 occurs before the first Monday of the year. Otherwise + * # %U is used. + * time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0)) # <<<<<<<<<<<<<< + * if '00' in time.strftime(directive, time_tuple): + * U_W = '%W' + */ + __pyx_tuple__106 = PyTuple_Pack(9, __pyx_int_1999, __pyx_int_1, __pyx_int_3, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_6, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + __pyx_tuple__107 = PyTuple_Pack(1, __pyx_tuple__106); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + + /* "pandas/tslib.pyx":3683 + * 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), # <<<<<<<<<<<<<< + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + */ + __pyx_slice__108 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__108); + __Pyx_GIVEREF(__pyx_slice__108); + + /* "pandas/tslib.pyx":3684 + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), # <<<<<<<<<<<<<< + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone + */ + __pyx_slice__109 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__109); + __Pyx_GIVEREF(__pyx_slice__109); + + /* "pandas/tslib.pyx":3690 + * 'Z'), + * '%': '%'}) + * base.__setitem__('W', base.__getitem__('U').replace('U', 'W')) # <<<<<<<<<<<<<< + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) + */ + __pyx_tuple__110 = PyTuple_Pack(1, __pyx_n_s_U); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_tuple__111 = PyTuple_Pack(2, __pyx_n_s_U, __pyx_n_s_W); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + + /* "pandas/tslib.pyx":3725 + * # as regex syntax. Cannot use re.escape since we have to deal with + * # format directives (%m, etc.). + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") # <<<<<<<<<<<<<< + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') + */ + __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s__113); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + + /* "pandas/tslib.pyx":3727 + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') # <<<<<<<<<<<<<< + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: + */ + __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_s_3); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + + /* "pandas/tslib.pyx":3730 + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: + * directive_index = format.index('%')+1 # <<<<<<<<<<<<<< + * processed_format = "%s%s%s" % (processed_format, + * format[:directive_index-1], + */ + __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s__52); if (unlikely(!__pyx_tuple__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__117); + __Pyx_GIVEREF(__pyx_tuple__117); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__119)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__121)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + + /* "pandas/tslib.pyx":67 + * + * # < numpy 1.7 compat for NaT + * compat_NaT = np.array([NPY_NAT]).astype('m8[ns]').item() # <<<<<<<<<<<<<< + * + * # numpy actual nat object + */ + __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_m8_ns); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + + /* "pandas/tslib.pyx":70 + * + * # numpy actual nat object + * np_NaT = np.datetime64('NaT') # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_tuple__126 = PyTuple_Pack(1, __pyx_n_s_NaT); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + + /* "pandas/tslib.pyx":77 + * basestring = str + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__127 = PyTuple_Pack(11, __pyx_n_s_arr, __pyx_n_s_tz, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_result, __pyx_n_s_dt, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_pos, __pyx_n_s_new_tz); if (unlikely(!__pyx_tuple__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ints_to_pydatetime, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":153 + * + * + * _zero_time = datetime_time(0, 0) # <<<<<<<<<<<<<< + * + * # Python front end to C extension type _Timestamp + */ + __pyx_tuple__129 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + + /* "pandas/tslib.pyx":165 + * + * @classmethod + * def fromordinal(cls, ordinal, offset=None, tz=None): # <<<<<<<<<<<<<< + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + */ + __pyx_tuple__130 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_ordinal, __pyx_n_s_offset, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fromordinal, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__132 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + + /* "pandas/tslib.pyx":171 + * + * @classmethod + * def now(cls, tz=None): # <<<<<<<<<<<<<< + * """ compat now with datetime """ + * if isinstance(tz, basestring): + */ + __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__133); + __Pyx_GIVEREF(__pyx_tuple__133); + __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_now, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__135 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__135); + __Pyx_GIVEREF(__pyx_tuple__135); + + /* "pandas/tslib.pyx":178 + * + * @classmethod + * def today(cls): # <<<<<<<<<<<<<< + * """ compat today with datetime """ + * return cls(datetime.today()) + */ + __pyx_tuple__136 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__136); + __Pyx_GIVEREF(__pyx_tuple__136); + __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_today, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":183 + * + * @classmethod + * def utcnow(cls): # <<<<<<<<<<<<<< + * return cls.now('UTC') + * + */ + __pyx_tuple__138 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__138); + __Pyx_GIVEREF(__pyx_tuple__138); + __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_utcnow, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":186 + * return cls.now('UTC') + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): # <<<<<<<<<<<<<< + * cdef _TSObject ts + * cdef _Timestamp ts_base + */ + __pyx_tuple__140 = PyTuple_Pack(8, __pyx_n_s_cls, __pyx_n_s_ts_input, __pyx_n_s_offset, __pyx_n_s_tz, __pyx_n_s_unit, __pyx_n_s_ts, __pyx_n_s_ts_base, __pyx_n_s_to_offset); if (unlikely(!__pyx_tuple__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__140); + __Pyx_GIVEREF(__pyx_tuple__140); + __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_new, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__142 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__142); + __Pyx_GIVEREF(__pyx_tuple__142); + + /* "pandas/tslib.pyx":217 + * return ts_base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * stamp = self._repr_base + * zone = None + */ + __pyx_tuple__143 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_stamp, __pyx_n_s_zone, __pyx_n_s_year2000, __pyx_n_s_tz, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__143); + __Pyx_GIVEREF(__pyx_tuple__143); + __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_repr, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":242 + * + * @property + * def _date_repr(self): # <<<<<<<<<<<<<< + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + */ + __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__145); + __Pyx_GIVEREF(__pyx_tuple__145); + __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_date_repr, 242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":248 + * + * @property + * def _time_repr(self): # <<<<<<<<<<<<<< + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + */ + __pyx_tuple__147 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_result, __pyx_n_s_nanos); if (unlikely(!__pyx_tuple__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__147); + __Pyx_GIVEREF(__pyx_tuple__147); + __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_time_repr, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":260 + * + * @property + * def _repr_base(self): # <<<<<<<<<<<<<< + * return '%s %s' % (self._date_repr, self._time_repr) + * + */ + __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__149); + __Pyx_GIVEREF(__pyx_tuple__149); + __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_repr_base, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":264 + * + * @property + * def tz(self): # <<<<<<<<<<<<<< + * """ + * Alias for tzinfo + */ + __pyx_tuple__151 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__151); + __Pyx_GIVEREF(__pyx_tuple__151); + __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":271 + * + * @property + * def freq(self): # <<<<<<<<<<<<<< + * return self.offset + * + */ + __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__153); + __Pyx_GIVEREF(__pyx_tuple__153); + __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_freq, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":274 + * return self.offset + * + * def __setstate__(self, state): # <<<<<<<<<<<<<< + * self.value = state[0] + * self.offset = state[1] + */ + __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_state); if (unlikely(!__pyx_tuple__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__155); + __Pyx_GIVEREF(__pyx_tuple__155); + __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_setstate, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":279 + * self.tzinfo = state[2] + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) + */ + __pyx_tuple__157 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_object_state); if (unlikely(!__pyx_tuple__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__157); + __Pyx_GIVEREF(__pyx_tuple__157); + __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_reduce, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":283 + * return (Timestamp, object_state) + * + * def to_period(self, freq=None): # <<<<<<<<<<<<<< + * """ + * Return an period of which this timestamp is an observation. + */ + __pyx_tuple__159 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_freq, __pyx_n_s_Period); if (unlikely(!__pyx_tuple__159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__159); + __Pyx_GIVEREF(__pyx_tuple__159); + __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_to_period, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__161 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__161); + __Pyx_GIVEREF(__pyx_tuple__161); + + /* "pandas/tslib.pyx":295 + * + * @property + * def dayofweek(self): # <<<<<<<<<<<<<< + * return self.weekday() + * + */ + __pyx_tuple__162 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__162); + __Pyx_GIVEREF(__pyx_tuple__162); + __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dayofweek, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":299 + * + * @property + * def dayofyear(self): # <<<<<<<<<<<<<< + * return self._get_field('doy') + * + */ + __pyx_tuple__164 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__164); + __Pyx_GIVEREF(__pyx_tuple__164); + __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dayofyear, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":303 + * + * @property + * def week(self): # <<<<<<<<<<<<<< + * return self._get_field('woy') + * + */ + __pyx_tuple__166 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__166); + __Pyx_GIVEREF(__pyx_tuple__166); + __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_week, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":309 + * + * @property + * def quarter(self): # <<<<<<<<<<<<<< + * return self._get_field('q') + * + */ + __pyx_tuple__168 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__168); + __Pyx_GIVEREF(__pyx_tuple__168); + __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_quarter, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":313 + * + * @property + * def freqstr(self): # <<<<<<<<<<<<<< + * return getattr(self.offset, 'freqstr', self.offset) + * + */ + __pyx_tuple__170 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__170); + __Pyx_GIVEREF(__pyx_tuple__170); + __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_freqstr, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":317 + * + * @property + * def asm8(self): # <<<<<<<<<<<<<< + * return np.int64(self.value).view('M8[ns]') + * + */ + __pyx_tuple__172 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__172); + __Pyx_GIVEREF(__pyx_tuple__172); + __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_asm8, 317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":321 + * + * @property + * def is_month_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_start') + * + */ + __pyx_tuple__174 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__174); + __Pyx_GIVEREF(__pyx_tuple__174); + __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_month_start, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":325 + * + * @property + * def is_month_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_end') + * + */ + __pyx_tuple__176 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__176); + __Pyx_GIVEREF(__pyx_tuple__176); + __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_month_end, 325, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":329 + * + * @property + * def is_quarter_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_start') + * + */ + __pyx_tuple__178 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__178); + __Pyx_GIVEREF(__pyx_tuple__178); + __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_quarter_start, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":333 + * + * @property + * def is_quarter_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_end') + * + */ + __pyx_tuple__180 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__180); + __Pyx_GIVEREF(__pyx_tuple__180); + __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_quarter_end, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":337 + * + * @property + * def is_year_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_start') + * + */ + __pyx_tuple__182 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__182); + __Pyx_GIVEREF(__pyx_tuple__182); + __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_year_start, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":341 + * + * @property + * def is_year_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_end') + * + */ + __pyx_tuple__184 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__184); + __Pyx_GIVEREF(__pyx_tuple__184); + __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_year_end, 341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":344 + * return self._get_start_end_field('is_year_end') + * + * def tz_localize(self, tz, infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Convert naive Timestamp to local time zone + */ + __pyx_tuple__186 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tz, __pyx_n_s_infer_dst, __pyx_n_s_value); if (unlikely(!__pyx_tuple__186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__186); + __Pyx_GIVEREF(__pyx_tuple__186); + __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_localize, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__188 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__188); + __Pyx_GIVEREF(__pyx_tuple__188); + + /* "pandas/tslib.pyx":368 + * 'tz_convert for conversions') + * + * def tz_convert(self, tz): # <<<<<<<<<<<<<< + * """ + * Convert Timestamp to another time zone or localize to requested time + */ + __pyx_tuple__189 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__189); + __Pyx_GIVEREF(__pyx_tuple__189); + __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_convert, 368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":391 + * astimezone = tz_convert + * + * def replace(self, **kwds): # <<<<<<<<<<<<<< + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) + */ + __pyx_tuple__191 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kwds); if (unlikely(!__pyx_tuple__191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__191); + __Pyx_GIVEREF(__pyx_tuple__191); + __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_replace, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":395 + * offset=self.offset) + * + * def to_pydatetime(self, warn=True): # <<<<<<<<<<<<<< + * """ + * If warn=True, issue warning if nanoseconds is nonzero + */ + __pyx_tuple__193 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_warn, __pyx_n_s_dts, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__193); + __Pyx_GIVEREF(__pyx_tuple__193); + __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_to_pydatetime, 395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__195 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__195); + __Pyx_GIVEREF(__pyx_tuple__195); + + /* "pandas/tslib.pyx":411 + * ts.dts.us, ts.tzinfo) + * + * def isoformat(self, sep='T'): # <<<<<<<<<<<<<< + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + */ + __pyx_tuple__196 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sep, __pyx_n_s_base, __pyx_n_s_base1, __pyx_n_s_base2); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__196); + __Pyx_GIVEREF(__pyx_tuple__196); + __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isoformat, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__198 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_T)); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__198); + __Pyx_GIVEREF(__pyx_tuple__198); + + /* "pandas/tslib.pyx":428 + * return base1 + base2 + * + * def _has_time_component(self): # <<<<<<<<<<<<<< + * """ + * Returns if the Timestamp has a time component + */ + __pyx_tuple__199 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__199); + __Pyx_GIVEREF(__pyx_tuple__199); + __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_has_time_component, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":437 + * or self.nanosecond != 0) + * + * def to_julian_date(self): # <<<<<<<<<<<<<< + * """ + * Convert TimeStamp to a Julian Date. + */ + __pyx_tuple__201 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_to_julian_date, 437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":466 + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + * def __new__(cls): # <<<<<<<<<<<<<< + * cdef _NaT base + * + */ + __pyx_tuple__203 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_base); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__203); + __Pyx_GIVEREF(__pyx_tuple__203); + __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_new, 466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":475 + * return base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + __pyx_tuple__205 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__205); + __Pyx_GIVEREF(__pyx_tuple__205); + __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_repr, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":478 + * return 'NaT' + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + __pyx_tuple__207 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__207); + __Pyx_GIVEREF(__pyx_tuple__207); + __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_str, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":481 + * return 'NaT' + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return iNaT + * + */ + __pyx_tuple__209 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__209); + __Pyx_GIVEREF(__pyx_tuple__209); + __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_hash, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":484 + * return iNaT + * + * def __int__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_tuple__211 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__211); + __Pyx_GIVEREF(__pyx_tuple__211); + __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_int, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":487 + * return NPY_NAT + * + * def __long__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_tuple__213 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__213); + __Pyx_GIVEREF(__pyx_tuple__213); + __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_long_2, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":490 + * return NPY_NAT + * + * def weekday(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_tuple__215 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__215); + __Pyx_GIVEREF(__pyx_tuple__215); + __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_weekday, 490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":493 + * return -1 + * + * def toordinal(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_tuple__217 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__217); + __Pyx_GIVEREF(__pyx_tuple__217); + __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_toordinal, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":496 + * return -1 + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * return (__nat_unpickle, (None, )) + * + */ + __pyx_tuple__219 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__219); + __Pyx_GIVEREF(__pyx_tuple__219); + __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_reduce, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":506 + * setattr(NaTType, field, prop) + * + * def __nat_unpickle(*args): # <<<<<<<<<<<<<< + * # return constant defined in the module + * return NaT + */ + __pyx_tuple__221 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__221)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__221); + __Pyx_GIVEREF(__pyx_tuple__221); + __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_nat_unpickle, 506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":530 + * return ', tz=%s' % zone + * + * def is_timestamp_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_tuple__223 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__223)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__223); + __Pyx_GIVEREF(__pyx_tuple__223); + __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_timestamp_array, 530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":580 + * # Frequency inference + * + * def unique_deltas(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__225 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_k, __pyx_n_s_table, __pyx_n_s_ret, __pyx_n_s_uniques, __pyx_n_s_result); if (unlikely(!__pyx_tuple__225)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__225); + __Pyx_GIVEREF(__pyx_tuple__225); + __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_unique_deltas, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":608 + * + * + * def apply_offset(ndarray[object] values, object offset): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__227 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_offset, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_new_values, __pyx_n_s_boxed, __pyx_n_s_result); if (unlikely(!__pyx_tuple__227)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__227); + __Pyx_GIVEREF(__pyx_tuple__227); + __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_apply_offset, 608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":845 + * + * + * def _delta_to_nanoseconds(delta): # <<<<<<<<<<<<<< + * if hasattr(delta, 'delta'): + * delta = delta.delta + */ + __pyx_tuple__229 = PyTuple_Pack(1, __pyx_n_s_delta); if (unlikely(!__pyx_tuple__229)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__229); + __Pyx_GIVEREF(__pyx_tuple__229); + __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_delta_to_nanoseconds, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1024 + * + * + * def get_timezone(tz): # <<<<<<<<<<<<<< + * return _get_zone(tz) + * + */ + __pyx_tuple__231 = PyTuple_Pack(1, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__231)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__231); + __Pyx_GIVEREF(__pyx_tuple__231); + __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_timezone, 1024, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1109 + * # obj.dtval = _dts_to_pydatetime(&obj.dts) + * + * def datetime_to_datetime64(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__233 = PyTuple_Pack(9, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_inferred_tz, __pyx_n_s_iresult, __pyx_n_s_dts, __pyx_n_s_ts_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__233)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__233); + __Pyx_GIVEREF(__pyx_tuple__233); + __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_datetime_to_datetime64, 1109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1146 + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + * + * def _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * if date_string.startswith('0'): + * # Strings starting with 0 are more consistent with a + */ + __pyx_tuple__235 = PyTuple_Pack(1, __pyx_n_s_date_string); if (unlikely(!__pyx_tuple__235)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__235); + __Pyx_GIVEREF(__pyx_tuple__235); + __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_does_string_look_like_datetime, 1146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1163 + * return True + * + * def parse_datetime_string(date_string, **kwargs): # <<<<<<<<<<<<<< + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') + */ + __pyx_tuple__237 = PyTuple_Pack(3, __pyx_n_s_date_string, __pyx_n_s_kwargs, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__237)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__237); + __Pyx_GIVEREF(__pyx_tuple__237); + __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_parse_datetime_string, 1163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + __pyx_tuple__239 = PyTuple_Pack(20, __pyx_n_s_values, __pyx_n_s_raise, __pyx_n_s_dayfirst, __pyx_n_s_format, __pyx_n_s_utc, __pyx_n_s_coerce, __pyx_n_s_unit, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_py_dt, __pyx_n_s_iresult, __pyx_n_s_oresult, __pyx_n_s_dts, __pyx_n_s_utc_convert, __pyx_n_s_seen_integer, __pyx_n_s_seen_datetime, __pyx_n_s_ts_2, __pyx_n_s_m, __pyx_n_s_result); if (unlikely(!__pyx_tuple__239)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__239); + __Pyx_GIVEREF(__pyx_tuple__239); + __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(7, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_array_to_datetime, 1170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1344 + * return oresult + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): # <<<<<<<<<<<<<< + * """ convert an ndarray to an array of ints that are timedeltas + * force conversion if coerce = True, + */ + __pyx_tuple__241 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_unit, __pyx_n_s_coerce, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_iresult, __pyx_n_s_result); if (unlikely(!__pyx_tuple__241)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__241); + __Pyx_GIVEREF(__pyx_tuple__241); + __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_array_to_timedelta64, 1344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1360 + * return iresult + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): # <<<<<<<<<<<<<< + * return convert_to_timedelta64(ts, unit, coerce) + * + */ + __pyx_tuple__243 = PyTuple_Pack(3, __pyx_n_s_ts, __pyx_n_s_unit, __pyx_n_s_coerce); if (unlikely(!__pyx_tuple__243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__243); + __Pyx_GIVEREF(__pyx_tuple__243); + __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_convert_to_timedelta, 1360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1430 + * return ts.astype('timedelta64[ns]') + * + * def repr_timedelta64(object value, format=None): # <<<<<<<<<<<<<< + * """ + * provide repr for timedelta64 + */ + __pyx_tuple__245 = PyTuple_Pack(12, __pyx_n_s_value, __pyx_n_s_format, __pyx_n_s_ivalue, __pyx_n_s_frac, __pyx_n_s_sign, __pyx_n_s_days, __pyx_n_s_hours, __pyx_n_s_minutes, __pyx_n_s_seconds, __pyx_n_s_seconds_pretty, __pyx_n_s_sp, __pyx_n_s_sign_pretty); if (unlikely(!__pyx_tuple__245)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__245); + __Pyx_GIVEREF(__pyx_tuple__245); + __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_repr_timedelta64, 1430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1499 + * + * + * def array_strptime(ndarray[object] values, object fmt, coerce=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__247 = PyTuple_Pack(37, __pyx_n_s_values, __pyx_n_s_fmt, __pyx_n_s_coerce, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_iresult, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_minute, __pyx_n_s_hour, __pyx_n_s_second, __pyx_n_s_fraction, __pyx_n_s_weekday, __pyx_n_s_julian, __pyx_n_s_val, __pyx_n_s_locale_time, __pyx_n_s_format_regex, __pyx_n_s_err, __pyx_n_s_bad_directive, __pyx_n_s_result, __pyx_n_s_parse_code_table, __pyx_n_s_parse_code, __pyx_n_s_found, __pyx_n_s_tz, __pyx_n_s_week_of_year, __pyx_n_s_week_of_year_start, __pyx_n_s_found_dict, __pyx_n_s_group_key, __pyx_n_s_ampm, __pyx_n_s_s, __pyx_n_s_found_zone, __pyx_n_s_value, __pyx_n_s_tz_values, __pyx_n_s_week_starts_Mon, __pyx_n_s_datetime_result); if (unlikely(!__pyx_tuple__247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__247); + __Pyx_GIVEREF(__pyx_tuple__247); + __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(3, 0, 37, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_array_strptime, 1499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1793 + * return (base*m) + (frac*m) + * + * def cast_to_nanoseconds(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + __pyx_tuple__249 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_ivalues, __pyx_n_s_iresult, __pyx_n_s_unit, __pyx_n_s_dts, __pyx_n_s_shape, __pyx_n_s_result); if (unlikely(!__pyx_tuple__249)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__249); + __Pyx_GIVEREF(__pyx_tuple__249); + __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_cast_to_nanoseconds, 1793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1825 + * + * + * def pydt_to_i8(object pydt): # <<<<<<<<<<<<<< + * ''' + * Convert to int64 representation compatible with numpy datetime64; converts + */ + __pyx_tuple__251 = PyTuple_Pack(2, __pyx_n_s_pydt, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__251)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__251); + __Pyx_GIVEREF(__pyx_tuple__251); + __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pydt_to_i8, 1825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1837 + * return ts.value + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): # <<<<<<<<<<<<<< + * ''' + * Inverse of pydt_to_i8 + */ + __pyx_tuple__253 = PyTuple_Pack(2, __pyx_n_s_i8, __pyx_n_s_tzinfo); if (unlikely(!__pyx_tuple__253)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__253); + __Pyx_GIVEREF(__pyx_tuple__253); + __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_i8_to_pydt, 1837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1853 + * have_pytz = False + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + */ + __pyx_tuple__255 = PyTuple_Pack(17, __pyx_n_s_vals, __pyx_n_s_tz1, __pyx_n_s_tz2, __pyx_n_s_utc_dates, __pyx_n_s_result, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_n, __pyx_n_s_v, __pyx_n_s_offset, __pyx_n_s_dts, __pyx_n_s_pytz, __pyx_n_s_dt, __pyx_n_s_delta, __pyx_n_s_trans_len); if (unlikely(!__pyx_tuple__255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__255); + __Pyx_GIVEREF(__pyx_tuple__255); + __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_convert, 1853, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1934 + * return result + * + * def tz_convert_single(int64_t val, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] trans, deltas + */ + __pyx_tuple__257 = PyTuple_Pack(13, __pyx_n_s_val, __pyx_n_s_tz1, __pyx_n_s_tz2, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_pos, __pyx_n_s_v, __pyx_n_s_offset, __pyx_n_s_utc_date, __pyx_n_s_dts, __pyx_n_s_pytz, __pyx_n_s_dt, __pyx_n_s_delta); if (unlikely(!__pyx_tuple__257)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__257); + __Pyx_GIVEREF(__pyx_tuple__257); + __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_convert_single, 1934, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1994 + * + * + * def _p_tz_cache_key(tz): # <<<<<<<<<<<<<< + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) + */ + __pyx_tuple__259 = PyTuple_Pack(1, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__259)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__259); + __Pyx_GIVEREF(__pyx_tuple__259); + __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_p_tz_cache_key, 1994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2108 + * 10**6) + * + * def tot_seconds(td): # <<<<<<<<<<<<<< + * return total_seconds(td) + * + */ + __pyx_tuple__261 = PyTuple_Pack(1, __pyx_n_s_td); if (unlikely(!__pyx_tuple__261)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__261); + __Pyx_GIVEREF(__pyx_tuple__261); + __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tot_seconds, 2108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2127 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Localize tzinfo-naive DateRange to given time zone (using pytz). If + */ + __pyx_tuple__263 = PyTuple_Pack(32, __pyx_n_s_vals, __pyx_n_s_tz, __pyx_n_s_infer_dst, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_idx_shifted, __pyx_n_s_i, __pyx_n_s_idx, __pyx_n_s_pos, __pyx_n_s_ntrans, __pyx_n_s_n, __pyx_n_s_tdata, __pyx_n_s_v, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_result, __pyx_n_s_result_a, __pyx_n_s_result_b, __pyx_n_s_dst_hours, __pyx_n_s_dts, __pyx_n_s_dt, __pyx_n_s_delta, __pyx_n_s_both_nat, __pyx_n_s_both_eq, __pyx_n_s_trans_idx_2, __pyx_n_s_stamp, __pyx_n_s_one_diff, __pyx_n_s_trans_grp, __pyx_n_s_grp, __pyx_n_s_switch_idx, __pyx_n_s_a_idx, __pyx_n_s_b_idx); if (unlikely(!__pyx_tuple__263)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__263); + __Pyx_GIVEREF(__pyx_tuple__263); + __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(3, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_localize_to_utc, 2127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2300 + * #---------------------------------------------------------------------- + * + * def build_field_sarray(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + __pyx_tuple__265 = PyTuple_Pack(14, __pyx_n_s_dtindex, __pyx_n_s_i, __pyx_n_s_count, __pyx_n_s_isleap, __pyx_n_s_dts, __pyx_n_s_years, __pyx_n_s_months, __pyx_n_s_days, __pyx_n_s_hours, __pyx_n_s_minutes, __pyx_n_s_seconds, __pyx_n_s_mus, __pyx_n_s_sa_dtype, __pyx_n_s_out); if (unlikely(!__pyx_tuple__265)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__265); + __Pyx_GIVEREF(__pyx_tuple__265); + __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(1, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_build_field_sarray, 2300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2342 + * return out + * + * def get_time_micros(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + __pyx_tuple__267 = PyTuple_Pack(5, __pyx_n_s_dtindex, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_micros); if (unlikely(!__pyx_tuple__267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__267); + __Pyx_GIVEREF(__pyx_tuple__267); + __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_time_micros, 2342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2361 + * + * @cython.wraparound(False) + * def get_date_field(ndarray[int64_t] dtindex, object field): # <<<<<<<<<<<<<< + * ''' + * Given a int64-based datetime index, extract the year, month, etc., + */ + __pyx_tuple__269 = PyTuple_Pack(14, __pyx_n_s_dtindex, __pyx_n_s_field, __pyx_n_s_ts, __pyx_n_s_i, __pyx_n_s_count, __pyx_n_s_out, __pyx_n_s_month_offset, __pyx_n_s_isleap, __pyx_n_s_isleap_prev, __pyx_n_s_dts, __pyx_n_s_mo_off, __pyx_n_s_doy, __pyx_n_s_dow, __pyx_n_s_woy); if (unlikely(!__pyx_tuple__269)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__269); + __Pyx_GIVEREF(__pyx_tuple__269); + __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_date_field, 2361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2505 + * + * @cython.wraparound(False) + * def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=None, int month_kw=12): # <<<<<<<<<<<<<< + * ''' + * Given an int64-based datetime index return array of indicators + */ + __pyx_tuple__271 = PyTuple_Pack(19, __pyx_n_s_dtindex, __pyx_n_s_field, __pyx_n_s_freqstr, __pyx_n_s_month_kw, __pyx_n_s_ts, __pyx_n_s_i, __pyx_n_s_count, __pyx_n_s_is_business, __pyx_n_s_end_month, __pyx_n_s_start_month, __pyx_n_s_out, __pyx_n_s_month_offset, __pyx_n_s_isleap, __pyx_n_s_dts, __pyx_n_s_mo_off, __pyx_n_s_dom, __pyx_n_s_doy, __pyx_n_s_dow, __pyx_n_s_ldom); if (unlikely(!__pyx_tuple__271)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__271); + __Pyx_GIVEREF(__pyx_tuple__271); + __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_start_end_field_2, 2505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2730 + * + * + * def date_normalize(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + __pyx_tuple__273 = PyTuple_Pack(7, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_tso, __pyx_n_s_result); if (unlikely(!__pyx_tuple__273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__273); + __Pyx_GIVEREF(__pyx_tuple__273); + __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_date_normalize, 2730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2824 + * + * + * def dates_normalized(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + __pyx_tuple__275 = PyTuple_Pack(10, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_dt, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_pos, __pyx_n_s_inf); if (unlikely(!__pyx_tuple__275)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__275); + __Pyx_GIVEREF(__pyx_tuple__275); + __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dates_normalized, 2824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2862 + * #---------------------------------------------------------------------- + * + * def isleapyear(int64_t year): # <<<<<<<<<<<<<< + * return is_leapyear(year) + * + */ + __pyx_tuple__277 = PyTuple_Pack(2, __pyx_n_s_year, __pyx_n_s_year); if (unlikely(!__pyx_tuple__277)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__277); + __Pyx_GIVEREF(__pyx_tuple__277); + __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isleapyear, 2862, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2865 + * return is_leapyear(year) + * + * def monthrange(int64_t year, int64_t month): # <<<<<<<<<<<<<< + * cdef: + * int64_t days + */ + __pyx_tuple__279 = PyTuple_Pack(4, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_days, __pyx_n_s_day_of_week); if (unlikely(!__pyx_tuple__279)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__279); + __Pyx_GIVEREF(__pyx_tuple__279); + __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_monthrange, 2865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3044 + * return period_ord_w_mult * mult + 1; + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): # <<<<<<<<<<<<<< + * """ + * Convert array of datetime64 values (passed in as 'i8' dtype) to a set of + */ + __pyx_tuple__281 = PyTuple_Pack(7, __pyx_n_s_dtarr, __pyx_n_s_freq, __pyx_n_s_tz, __pyx_n_s_out, __pyx_n_s_i, __pyx_n_s_l, __pyx_n_s_dts); if (unlikely(!__pyx_tuple__281)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__281); + __Pyx_GIVEREF(__pyx_tuple__281); + __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dt64arr_to_periodarr, 3044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3070 + * return out + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): # <<<<<<<<<<<<<< + * """ + * Convert array to datetime64 values from a set of ordinals corresponding to + */ + __pyx_tuple__283 = PyTuple_Pack(5, __pyx_n_s_periodarr, __pyx_n_s_freq, __pyx_n_s_out, __pyx_n_s_i, __pyx_n_s_l); if (unlikely(!__pyx_tuple__283)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__283); + __Pyx_GIVEREF(__pyx_tuple__283); + __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_periodarr_to_dt64arr, 3070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3116 + * return retval + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): # <<<<<<<<<<<<<< + * """ + * Convert int64-array of period ordinals from one frequency to another, and + */ + __pyx_tuple__285 = PyTuple_Pack(13, __pyx_n_s_arr, __pyx_n_s_freq1, __pyx_n_s_freq2, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_func, __pyx_n_s_finfo, __pyx_n_s_val, __pyx_n_s_ordinal, __pyx_n_s_relation, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__285)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__285); + __Pyx_GIVEREF(__pyx_tuple__285); + __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_period_asfreq_arr, 3116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3158 + * return result + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): # <<<<<<<<<<<<<< + * cdef: + * int64_t ordinal + */ + __pyx_tuple__287 = PyTuple_Pack(10, __pyx_n_s_y, __pyx_n_s_m, __pyx_n_s_d, __pyx_n_s_h, __pyx_n_s_min, __pyx_n_s_s, __pyx_n_s_us, __pyx_n_s_ps, __pyx_n_s_freq, __pyx_n_s_ordinal); if (unlikely(!__pyx_tuple__287)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__287); + __Pyx_GIVEREF(__pyx_tuple__287); + __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(9, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_period_ordinal, 3158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3188 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * + * def period_format(int64_t value, int freq, object fmt=None): # <<<<<<<<<<<<<< + * cdef: + * int freq_group + */ + __pyx_tuple__289 = PyTuple_Pack(6, __pyx_n_s_value, __pyx_n_s_freq, __pyx_n_s_fmt, __pyx_n_s_freq_group, __pyx_n_s_left, __pyx_n_s_right); if (unlikely(!__pyx_tuple__289)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__289); + __Pyx_GIVEREF(__pyx_tuple__289); + __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_period_format, 3188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3229 + * + * + * cdef list extra_fmts = [(b"%q", b"^`AB`^"), # <<<<<<<<<<<<<< + * (b"%f", b"^`CD`^"), + * (b"%F", b"^`EF`^"), + */ + __pyx_tuple__291 = PyTuple_Pack(2, __pyx_kp_b_q_2, __pyx_kp_b_AB); if (unlikely(!__pyx_tuple__291)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__291); + __Pyx_GIVEREF(__pyx_tuple__291); + + /* "pandas/tslib.pyx":3230 + * + * cdef list extra_fmts = [(b"%q", b"^`AB`^"), + * (b"%f", b"^`CD`^"), # <<<<<<<<<<<<<< + * (b"%F", b"^`EF`^"), + * (b"%l", b"^`GH`^"), + */ + __pyx_tuple__292 = PyTuple_Pack(2, __pyx_kp_b_f_2, __pyx_kp_b_CD); if (unlikely(!__pyx_tuple__292)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__292); + __Pyx_GIVEREF(__pyx_tuple__292); + + /* "pandas/tslib.pyx":3231 + * cdef list extra_fmts = [(b"%q", b"^`AB`^"), + * (b"%f", b"^`CD`^"), + * (b"%F", b"^`EF`^"), # <<<<<<<<<<<<<< + * (b"%l", b"^`GH`^"), + * (b"%u", b"^`IJ`^"), + */ + __pyx_tuple__293 = PyTuple_Pack(2, __pyx_kp_b_F, __pyx_kp_b_EF); if (unlikely(!__pyx_tuple__293)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__293); + __Pyx_GIVEREF(__pyx_tuple__293); + + /* "pandas/tslib.pyx":3232 + * (b"%f", b"^`CD`^"), + * (b"%F", b"^`EF`^"), + * (b"%l", b"^`GH`^"), # <<<<<<<<<<<<<< + * (b"%u", b"^`IJ`^"), + * (b"%n", b"^`KL`^")] + */ + __pyx_tuple__294 = PyTuple_Pack(2, __pyx_kp_b_l_2, __pyx_kp_b_GH); if (unlikely(!__pyx_tuple__294)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__294); + __Pyx_GIVEREF(__pyx_tuple__294); + + /* "pandas/tslib.pyx":3233 + * (b"%F", b"^`EF`^"), + * (b"%l", b"^`GH`^"), + * (b"%u", b"^`IJ`^"), # <<<<<<<<<<<<<< + * (b"%n", b"^`KL`^")] + * + */ + __pyx_tuple__295 = PyTuple_Pack(2, __pyx_kp_b_u_2, __pyx_kp_b_IJ); if (unlikely(!__pyx_tuple__295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__295); + __Pyx_GIVEREF(__pyx_tuple__295); + + /* "pandas/tslib.pyx":3234 + * (b"%l", b"^`GH`^"), + * (b"%u", b"^`IJ`^"), + * (b"%n", b"^`KL`^")] # <<<<<<<<<<<<<< + * + * cdef list str_extra_fmts = ["^`AB`^", "^`CD`^", "^`EF`^", "^`GH`^", "^`IJ`^", "^`KL`^"] + */ + __pyx_tuple__296 = PyTuple_Pack(2, __pyx_kp_b_n_2, __pyx_kp_b_KL); if (unlikely(!__pyx_tuple__296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__296); + __Pyx_GIVEREF(__pyx_tuple__296); + + /* "pandas/tslib.pyx":3294 + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN + * + * def get_period_field(int code, int64_t value, int freq): # <<<<<<<<<<<<<< + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + */ + __pyx_tuple__297 = PyTuple_Pack(4, __pyx_n_s_code, __pyx_n_s_value, __pyx_n_s_freq, __pyx_n_s_f); if (unlikely(!__pyx_tuple__297)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__297); + __Pyx_GIVEREF(__pyx_tuple__297); + __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_period_field, 3294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3302 + * return f(value, freq) + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + __pyx_tuple__299 = PyTuple_Pack(7, __pyx_n_s_code, __pyx_n_s_arr, __pyx_n_s_freq, __pyx_n_s_i, __pyx_n_s_sz, __pyx_n_s_out, __pyx_n_s_f); if (unlikely(!__pyx_tuple__299)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__299); + __Pyx_GIVEREF(__pyx_tuple__299); + __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_period_field_arr, 3302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3351 + * + * + * def extract_ordinals(ndarray[object] values, freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__301 = PyTuple_Pack(6, __pyx_n_s_values, __pyx_n_s_freq, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_ordinals, __pyx_n_s_p); if (unlikely(!__pyx_tuple__301)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__301); + __Pyx_GIVEREF(__pyx_tuple__301); + __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_extract_ordinals, 3351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3501 + * __all__ = [] + * + * def _getlang(): # <<<<<<<<<<<<<< + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) + */ + __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_getlang, 3501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3524 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * """Set all attributes. + * + */ + __pyx_tuple__304 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__304); + __Pyx_GIVEREF(__pyx_tuple__304); + __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_init, 3524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3553 + * raise ValueError("locale changed during initialization") + * + * def __pad(self, seq, front): # <<<<<<<<<<<<<< + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + */ + __pyx_tuple__306 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_seq, __pyx_n_s_front); if (unlikely(!__pyx_tuple__306)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__306); + __Pyx_GIVEREF(__pyx_tuple__306); + __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pad, 3553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3562 + * return seq + * + * def __calc_weekday(self): # <<<<<<<<<<<<<< + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + */ + __pyx_tuple__308 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_a_weekday, __pyx_n_s_f_weekday, __pyx_n_s_i); if (unlikely(!__pyx_tuple__308)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__308); + __Pyx_GIVEREF(__pyx_tuple__308); + __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_weekday, 3562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3570 + * self.f_weekday = f_weekday + * + * def __calc_month(self): # <<<<<<<<<<<<<< + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + */ + __pyx_tuple__310 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_a_month, __pyx_n_s_f_month, __pyx_n_s_i); if (unlikely(!__pyx_tuple__310)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__310); + __Pyx_GIVEREF(__pyx_tuple__310); + __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_month, 3570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3577 + * self.f_month = f_month + * + * def __calc_am_pm(self): # <<<<<<<<<<<<<< + * # Set self.am_pm by using time.strftime(). + * + */ + __pyx_tuple__312 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_am_pm, __pyx_n_s_hour, __pyx_n_s_time_tuple); if (unlikely(!__pyx_tuple__312)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__312); + __Pyx_GIVEREF(__pyx_tuple__312); + __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_am_pm, 3577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3589 + * self.am_pm = am_pm + * + * def __calc_date_time(self): # <<<<<<<<<<<<<< + * # Set self.date_time, self.date, & self.time by using + * # time.strftime(). + */ + __pyx_tuple__314 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_time_tuple, __pyx_n_s_date_time, __pyx_n_s_replacement_pairs, __pyx_n_s_offset, __pyx_n_s_directive, __pyx_n_s_current_format, __pyx_n_s_old, __pyx_n_s_new_2, __pyx_n_s_U_W, __pyx_n_s_tz_values, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__314)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__314); + __Pyx_GIVEREF(__pyx_tuple__314); + __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_date_time, 3589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3634 + * self.LC_time = date_time[2] + * + * def __calc_timezone(self): # <<<<<<<<<<<<<< + * # Set self.timezone by using time.tzname. + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + */ + __pyx_tuple__316 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_no_saving, __pyx_n_s_has_saving); if (unlikely(!__pyx_tuple__316)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__316); + __Pyx_GIVEREF(__pyx_tuple__316); + __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_timezone, 3634, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + __pyx_tuple__318 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_locale_time, __pyx_n_s_base, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__318)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__318); + __Pyx_GIVEREF(__pyx_tuple__318); + __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__318, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_init, 3653, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__320 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__320)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__320); + __Pyx_GIVEREF(__pyx_tuple__320); + + /* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + __pyx_tuple__321 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_to_convert, __pyx_n_s_directive, __pyx_n_s_value, __pyx_n_s_regex, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__321)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__321); + __Pyx_GIVEREF(__pyx_tuple__321); + __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_seqToRE, 3695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3714 + * return '%s)' % regex + * + * def pattern(self, format): # <<<<<<<<<<<<<< + * """Return regex pattern for the format string. + * + */ + __pyx_tuple__323 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_format, __pyx_n_s_processed_format, __pyx_n_s_regex_chars, __pyx_n_s_whitespace_replacement, __pyx_n_s_directive_index); if (unlikely(!__pyx_tuple__323)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__323); + __Pyx_GIVEREF(__pyx_tuple__323); + __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pattern, 3714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3737 + * return "%s%s" % (processed_format, format) + * + * def compile(self, format): # <<<<<<<<<<<<<< + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) + */ + __pyx_tuple__325 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_format); if (unlikely(!__pyx_tuple__325)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__325); + __Pyx_GIVEREF(__pyx_tuple__325); + __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_compile, 3737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3748 + * _regex_cache = {} + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): # <<<<<<<<<<<<<< + * """Calculate the Julian day based on the year, week of the year, and day of + * the week, with week_start_day representing whether the week of the year + */ + __pyx_tuple__327 = PyTuple_Pack(7, __pyx_n_s_year, __pyx_n_s_week_of_year, __pyx_n_s_day_of_week, __pyx_n_s_week_starts_Mon, __pyx_n_s_first_weekday, __pyx_n_s_week_0_length, __pyx_n_s_days_to_week); if (unlikely(!__pyx_tuple__327)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__327); + __Pyx_GIVEREF(__pyx_tuple__327); + __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_julian_from_U_or_W, 3748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_float_1e6 = PyFloat_FromDouble(1e6); if (unlikely(!__pyx_float_1e6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1e9 = PyFloat_FromDouble(1e9); if (unlikely(!__pyx_float_1e9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1e_6 = PyFloat_FromDouble(1e+6); if (unlikely(!__pyx_float_1e_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1e_9 = PyFloat_FromDouble(1e+9); if (unlikely(!__pyx_float_1e_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_24_0 = PyFloat_FromDouble(24.0); if (unlikely(!__pyx_float_24_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_60_0 = PyFloat_FromDouble(60.0); if (unlikely(!__pyx_float_60_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1000_0 = PyFloat_FromDouble(1000.0); if (unlikely(!__pyx_float_1000_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_3600_0 = PyFloat_FromDouble(3600.0); if (unlikely(!__pyx_float_3600_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1721118_5 = PyFloat_FromDouble(1721118.5); if (unlikely(!__pyx_float_1721118_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_55 = PyInt_FromLong(55); if (unlikely(!__pyx_int_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_153 = PyInt_FromLong(153); if (unlikely(!__pyx_int_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_182 = PyInt_FromLong(182); if (unlikely(!__pyx_int_182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_212 = PyInt_FromLong(212); if (unlikely(!__pyx_int_212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_213 = PyInt_FromLong(213); if (unlikely(!__pyx_int_213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_243 = PyInt_FromLong(243); if (unlikely(!__pyx_int_243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_244 = PyInt_FromLong(244); if (unlikely(!__pyx_int_244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_273 = PyInt_FromLong(273); if (unlikely(!__pyx_int_273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_274 = PyInt_FromLong(274); if (unlikely(!__pyx_int_274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_304 = PyInt_FromLong(304); if (unlikely(!__pyx_int_304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_305 = PyInt_FromLong(305); if (unlikely(!__pyx_int_305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_334 = PyInt_FromLong(334); if (unlikely(!__pyx_int_334)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_335 = PyInt_FromLong(335); if (unlikely(!__pyx_int_335)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_365 = PyInt_FromLong(365); if (unlikely(!__pyx_int_365)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_366 = PyInt_FromLong(366); if (unlikely(!__pyx_int_366)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_400 = PyInt_FromLong(400); if (unlikely(!__pyx_int_400)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_457 = PyInt_FromLong(457); if (unlikely(!__pyx_int_457)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1999 = PyInt_FromLong(1999); if (unlikely(!__pyx_int_1999)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3600 = PyInt_FromLong(3600); if (unlikely(!__pyx_int_3600)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_6000 = PyInt_FromLong(6000); if (unlikely(!__pyx_int_6000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_86400 = PyInt_FromLong(86400L); if (unlikely(!__pyx_int_86400)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000000 = PyInt_FromLong(1000000000L); if (unlikely(!__pyx_int_1000000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_6 = PyInt_FromLong(-6); if (unlikely(!__pyx_int_neg_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1L = PyLong_FromString((char *)"1", 0, 0); if (unlikely(!__pyx_int_1L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000L = PyLong_FromString((char *)"1000", 0, 0); if (unlikely(!__pyx_int_1000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000L = PyLong_FromString((char *)"1000000", 0, 0); if (unlikely(!__pyx_int_1000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000000L = PyLong_FromString((char *)"1000000000", 0, 0); if (unlikely(!__pyx_int_1000000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_60000000000L = PyLong_FromString((char *)"60000000000", 0, 0); if (unlikely(!__pyx_int_60000000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3600000000000L = PyLong_FromString((char *)"3600000000000", 0, 0); if (unlikely(!__pyx_int_3600000000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_86400000000000L = PyLong_FromString((char *)"86400000000000", 0, 0); if (unlikely(!__pyx_int_86400000000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC inittslib(void); /*proto*/ +PyMODINIT_FUNC inittslib(void) +#else +PyMODINIT_FUNC PyInit_tslib(void); /*proto*/ +PyMODINIT_FUNC PyInit_tslib(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_tslib(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("tslib"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__tslib) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.tslib")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.tslib", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + __pyx_v_6pandas_5tslib__NDIM_STRING = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_6pandas_5tslib_extra_fmts = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_6pandas_5tslib_str_extra_fmts = ((PyObject*)Py_None); Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("convert_to_tsobject", (void (*)(void))__pyx_f_6pandas_5tslib_convert_to_tsobject, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ExportFunction("convert_to_timedelta64", (void (*)(void))__pyx_f_6pandas_5tslib_convert_to_timedelta64, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Type init code ---*/ + __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_6pandas_5tslib__Timestamp = &__pyx_vtable_6pandas_5tslib__Timestamp; + __pyx_vtable_6pandas_5tslib__Timestamp._compare_outside_nanorange = (int (*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyDateTime_DateTime *, int))__pyx_f_6pandas_5tslib_10_Timestamp__compare_outside_nanorange; + __pyx_vtable_6pandas_5tslib__Timestamp._assert_tzawareness_compat = (int (*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *))__pyx_f_6pandas_5tslib_10_Timestamp__assert_tzawareness_compat; + __pyx_vtable_6pandas_5tslib__Timestamp.to_datetime = (PyDateTime_DateTime *(*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, int __pyx_skip_dispatch))__pyx_f_6pandas_5tslib_10_Timestamp_to_datetime; + __pyx_vtable_6pandas_5tslib__Timestamp._get_field = (PyObject *(*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5tslib_10_Timestamp__get_field; + __pyx_vtable_6pandas_5tslib__Timestamp._get_start_end_field = (PyObject *(*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5tslib_10_Timestamp__get_start_end_field; + __pyx_type_6pandas_5tslib__Timestamp.tp_base = __pyx_ptype_8datetime_datetime; + if (PyType_Ready(&__pyx_type_6pandas_5tslib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib__Timestamp.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5tslib__Timestamp.tp_dict, __pyx_vtabptr_6pandas_5tslib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "_Timestamp", (PyObject *)&__pyx_type_6pandas_5tslib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5tslib__Timestamp = &__pyx_type_6pandas_5tslib__Timestamp; + __pyx_vtabptr_6pandas_5tslib__NaT = &__pyx_vtable_6pandas_5tslib__NaT; + __pyx_vtable_6pandas_5tslib__NaT.__pyx_base = *__pyx_vtabptr_6pandas_5tslib__Timestamp; + __pyx_type_6pandas_5tslib__NaT.tp_base = __pyx_ptype_6pandas_5tslib__Timestamp; + if (PyType_Ready(&__pyx_type_6pandas_5tslib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib__NaT.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5tslib__NaT.tp_dict, __pyx_vtabptr_6pandas_5tslib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "_NaT", (PyObject *)&__pyx_type_6pandas_5tslib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5tslib__NaT = &__pyx_type_6pandas_5tslib__NaT; + if (PyType_Ready(&__pyx_type_6pandas_5tslib__TSObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib__TSObject.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "_TSObject", (PyObject *)&__pyx_type_6pandas_5tslib__TSObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5tslib__TSObject = &__pyx_type_6pandas_5tslib__TSObject; + if (PyType_Ready(&__pyx_type_6pandas_5tslib___pyx_scope_struct____init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib___pyx_scope_struct____init__.tp_print = 0; + __pyx_ptype_6pandas_5tslib___pyx_scope_struct____init__ = &__pyx_type_6pandas_5tslib___pyx_scope_struct____init__; + if (PyType_Ready(&__pyx_type_6pandas_5tslib___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib___pyx_scope_struct_1_genexpr.tp_print = 0; + __pyx_ptype_6pandas_5tslib___pyx_scope_struct_1_genexpr = &__pyx_type_6pandas_5tslib___pyx_scope_struct_1_genexpr; + if (PyType_Ready(&__pyx_type_6pandas_5tslib___pyx_scope_struct_2___seqToRE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib___pyx_scope_struct_2___seqToRE.tp_print = 0; + __pyx_ptype_6pandas_5tslib___pyx_scope_struct_2___seqToRE = &__pyx_type_6pandas_5tslib___pyx_scope_struct_2___seqToRE; + if (PyType_Ready(&__pyx_type_6pandas_5tslib___pyx_scope_struct_3_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib___pyx_scope_struct_3_genexpr.tp_print = 0; + __pyx_ptype_6pandas_5tslib___pyx_scope_struct_3_genexpr = &__pyx_type_6pandas_5tslib___pyx_scope_struct_3_genexpr; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/tslib.pyx":6 + * from numpy cimport (int8_t, int32_t, int64_t, import_array, ndarray, + * NPY_INT64, NPY_DATETIME, NPY_TIMEDELTA) + * import numpy as np # <<<<<<<<<<<<<< + * + * from cpython cimport ( + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":35 + * cimport cython + * + * from datetime import timedelta, datetime # <<<<<<<<<<<<<< + * from datetime import time as datetime_time + * from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile, + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_timedelta); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_timedelta); + __Pyx_GIVEREF(__pyx_n_s_timedelta); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":36 + * + * from datetime import timedelta, datetime + * from datetime import time as datetime_time # <<<<<<<<<<<<<< + * from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile, + * tzutc as _dateutil_tzutc, gettz as _dateutil_gettz) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_time); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_time); + __Pyx_GIVEREF(__pyx_n_s_time); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":37 + * from datetime import timedelta, datetime + * from datetime import time as datetime_time + * from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile, # <<<<<<<<<<<<<< + * tzutc as _dateutil_tzutc, gettz as _dateutil_gettz) + * from pytz.tzinfo import BaseTzInfo as _pytz_BaseTzInfo + */ + __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_tzoffset); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_tzoffset); + __Pyx_GIVEREF(__pyx_n_s_tzoffset); + __Pyx_INCREF(__pyx_n_s_tzlocal); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_tzlocal); + __Pyx_GIVEREF(__pyx_n_s_tzlocal); + __Pyx_INCREF(__pyx_n_s_tzfile); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_tzfile); + __Pyx_GIVEREF(__pyx_n_s_tzfile); + __Pyx_INCREF(__pyx_n_s_tzutc); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_tzutc); + __Pyx_GIVEREF(__pyx_n_s_tzutc); + __Pyx_INCREF(__pyx_n_s_gettz); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_gettz); + __Pyx_GIVEREF(__pyx_n_s_gettz); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_dateutil_tz, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tzoffset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzlocal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateutil_tzlocal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateutil_tzfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzutc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateutil_tzutc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gettz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateutil_gettz, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":39 + * from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile, + * tzutc as _dateutil_tzutc, gettz as _dateutil_gettz) + * from pytz.tzinfo import BaseTzInfo as _pytz_BaseTzInfo # <<<<<<<<<<<<<< + * from pandas.compat import parse_date + * from pandas.compat import parse_date, string_types + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_BaseTzInfo); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BaseTzInfo); + __Pyx_GIVEREF(__pyx_n_s_BaseTzInfo); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz_tzinfo, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BaseTzInfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz_BaseTzInfo, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":40 + * tzutc as _dateutil_tzutc, gettz as _dateutil_gettz) + * from pytz.tzinfo import BaseTzInfo as _pytz_BaseTzInfo + * from pandas.compat import parse_date # <<<<<<<<<<<<<< + * from pandas.compat import parse_date, string_types + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_parse_date); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_parse_date); + __Pyx_GIVEREF(__pyx_n_s_parse_date); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas_compat, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_parse_date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_date, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":41 + * from pytz.tzinfo import BaseTzInfo as _pytz_BaseTzInfo + * from pandas.compat import parse_date + * from pandas.compat import parse_date, string_types # <<<<<<<<<<<<<< + * + * from sys import version_info + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_parse_date); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_parse_date); + __Pyx_GIVEREF(__pyx_n_s_parse_date); + __Pyx_INCREF(__pyx_n_s_string_types); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_string_types); + __Pyx_GIVEREF(__pyx_n_s_string_types); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_compat, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_parse_date); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_date, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_types, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":43 + * from pandas.compat import parse_date, string_types + * + * from sys import version_info # <<<<<<<<<<<<<< + * + * # numpy compat + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_version_info); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_version_info); + __Pyx_GIVEREF(__pyx_n_s_version_info); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":46 + * + * # numpy compat + * from distutils.version import LooseVersion # <<<<<<<<<<<<<< + * _np_version = np.version.short_version + * _np_version_under1p6 = LooseVersion(_np_version) < '1.6' + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_LooseVersion); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_LooseVersion); + __Pyx_GIVEREF(__pyx_n_s_LooseVersion); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_distutils_version, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LooseVersion, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":47 + * # numpy compat + * from distutils.version import LooseVersion + * _np_version = np.version.short_version # <<<<<<<<<<<<<< + * _np_version_under1p6 = LooseVersion(_np_version) < '1.6' + * _np_version_under1p7 = LooseVersion(_np_version) < '1.7' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_short_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":48 + * from distutils.version import LooseVersion + * _np_version = np.version.short_version + * _np_version_under1p6 = LooseVersion(_np_version) < '1.6' # <<<<<<<<<<<<<< + * _np_version_under1p7 = LooseVersion(_np_version) < '1.7' + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_s_1_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version_under1p6, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":49 + * _np_version = np.version.short_version + * _np_version_under1p6 = LooseVersion(_np_version) < '1.6' + * _np_version_under1p7 = LooseVersion(_np_version) < '1.7' # <<<<<<<<<<<<<< + * + * # GH3363 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_s_1_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version_under1p7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":52 + * + * # GH3363 + * cdef bint PY2 = version_info[0] == 2 # <<<<<<<<<<<<<< + * + * # initialize numpy + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5tslib_PY2 = __pyx_t_4; + + /* "pandas/tslib.pyx":55 + * + * # initialize numpy + * import_array() # <<<<<<<<<<<<<< + * #import_ufunc() + * + */ + import_array(); + + /* "pandas/tslib.pyx":59 + * + * # import datetime C API + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * # in numpy 1.7, will prob need the following: + */ + PyDateTime_IMPORT; + + /* "pandas/tslib.pyx":64 + * # numpy_pydatetime_import + * + * cdef int64_t NPY_NAT = util.get_nat() # <<<<<<<<<<<<<< + * + * # < numpy 1.7 compat for NaT + */ + __pyx_v_6pandas_5tslib_NPY_NAT = get_nat(); + + /* "pandas/tslib.pyx":67 + * + * # < numpy 1.7 compat for NaT + * compat_NaT = np.array([NPY_NAT]).astype('m8[ns]').item() # <<<<<<<<<<<<<< + * + * # numpy actual nat object + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat_NaT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":70 + * + * # numpy actual nat object + * np_NaT = np.datetime64('NaT') # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_NaT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":72 + * np_NaT = np.datetime64('NaT') + * + * try: # <<<<<<<<<<<<<< + * basestring + * except NameError: # py3 + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/tslib.pyx":73 + * + * try: + * basestring # <<<<<<<<<<<<<< + * except NameError: # py3 + * basestring = str + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L9_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":74 + * try: + * basestring + * except NameError: # py3 # <<<<<<<<<<<<<< + * basestring = str + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_NameError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":75 + * basestring + * except NameError: # py3 + * basestring = str # <<<<<<<<<<<<<< + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L9_try_end:; + } + + /* "pandas/tslib.pyx":77 + * basestring = str + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_1ints_to_pydatetime, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ints_to_pydatetime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":153 + * + * + * _zero_time = datetime_time(0, 0) # <<<<<<<<<<<<<< + * + * # Python front end to C extension type _Timestamp + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_zero_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":157 + * # Python front end to C extension type _Timestamp + * # This serves as the box for datetime64 + * class Timestamp(_Timestamp): # <<<<<<<<<<<<<< + * """TimeStamp is the pandas equivalent of python's Datetime + * and is interchangable with it in most cases. It's the type used + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Timestamp, __pyx_n_s_Timestamp, (PyObject *) NULL, __pyx_n_s_pandas_tslib, __pyx_kp_s_TimeStamp_is_the_pandas_equivale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":165 + * + * @classmethod + * def fromordinal(cls, ordinal, offset=None, tz=None): # <<<<<<<<<<<<<< + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_1fromordinal, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Timestamp_fromordinal, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__132); + + /* "pandas/tslib.pyx":164 + * """ + * + * @classmethod # <<<<<<<<<<<<<< + * def fromordinal(cls, ordinal, offset=None, tz=None): + * """ passed an ordinal, translate and convert to a ts + */ + __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_fromordinal, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":171 + * + * @classmethod + * def now(cls, tz=None): # <<<<<<<<<<<<<< + * """ compat now with datetime """ + * if isinstance(tz, basestring): + */ + __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_3now, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Timestamp_now, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__135); + + /* "pandas/tslib.pyx":170 + * return cls(datetime.fromordinal(ordinal),offset=offset,tz=tz) + * + * @classmethod # <<<<<<<<<<<<<< + * def now(cls, tz=None): + * """ compat now with datetime """ + */ + __pyx_t_9 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_now, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":178 + * + * @classmethod + * def today(cls): # <<<<<<<<<<<<<< + * """ compat today with datetime """ + * return cls(datetime.today()) + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_5today, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Timestamp_today, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":177 + * return cls(datetime.now(tz)) + * + * @classmethod # <<<<<<<<<<<<<< + * def today(cls): + * """ compat today with datetime """ + */ + __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_today, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":183 + * + * @classmethod + * def utcnow(cls): # <<<<<<<<<<<<<< + * return cls.now('UTC') + * + */ + __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_7utcnow, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Timestamp_utcnow, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + + /* "pandas/tslib.pyx":182 + * return cls(datetime.today()) + * + * @classmethod # <<<<<<<<<<<<<< + * def utcnow(cls): + * return cls.now('UTC') + */ + __pyx_t_9 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_utcnow, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":186 + * return cls.now('UTC') + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): # <<<<<<<<<<<<<< + * cdef _TSObject ts + * cdef _Timestamp ts_base + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_9__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Timestamp___new, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__142); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":217 + * return ts_base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * stamp = self._repr_base + * zone = None + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_11__repr__, 0, __pyx_n_s_Timestamp___repr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":242 + * + * @property + * def _date_repr(self): # <<<<<<<<<<<<<< + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_13_date_repr, 0, __pyx_n_s_Timestamp__date_repr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":241 + * return "Timestamp('{stamp}'{tz}{offset})".format(stamp=stamp, tz=tz, offset=offset) + * + * @property # <<<<<<<<<<<<<< + * def _date_repr(self): + * # Ideal here would be self.strftime("%Y-%m-%d"), but + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_date_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":248 + * + * @property + * def _time_repr(self): # <<<<<<<<<<<<<< + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_15_time_repr, 0, __pyx_n_s_Timestamp__time_repr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":247 + * return '%d-%.2d-%.2d' % (self.year, self.month, self.day) + * + * @property # <<<<<<<<<<<<<< + * def _time_repr(self): + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_time_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":260 + * + * @property + * def _repr_base(self): # <<<<<<<<<<<<<< + * return '%s %s' % (self._date_repr, self._time_repr) + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_17_repr_base, 0, __pyx_n_s_Timestamp__repr_base, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":259 + * return result + * + * @property # <<<<<<<<<<<<<< + * def _repr_base(self): + * return '%s %s' % (self._date_repr, self._time_repr) + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_repr_base, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":264 + * + * @property + * def tz(self): # <<<<<<<<<<<<<< + * """ + * Alias for tzinfo + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_19tz, 0, __pyx_n_s_Timestamp_tz, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":263 + * return '%s %s' % (self._date_repr, self._time_repr) + * + * @property # <<<<<<<<<<<<<< + * def tz(self): + * """ + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":271 + * + * @property + * def freq(self): # <<<<<<<<<<<<<< + * return self.offset + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_21freq, 0, __pyx_n_s_Timestamp_freq, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":270 + * return self.tzinfo + * + * @property # <<<<<<<<<<<<<< + * def freq(self): + * return self.offset + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_freq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":274 + * return self.offset + * + * def __setstate__(self, state): # <<<<<<<<<<<<<< + * self.value = state[0] + * self.offset = state[1] + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_23__setstate__, 0, __pyx_n_s_Timestamp___setstate, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_setstate, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":279 + * self.tzinfo = state[2] + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_25__reduce__, 0, __pyx_n_s_Timestamp___reduce, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_reduce, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":283 + * return (Timestamp, object_state) + * + * def to_period(self, freq=None): # <<<<<<<<<<<<<< + * """ + * Return an period of which this timestamp is an observation. + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_27to_period, 0, __pyx_n_s_Timestamp_to_period, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__161); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_to_period, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":295 + * + * @property + * def dayofweek(self): # <<<<<<<<<<<<<< + * return self.weekday() + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_29dayofweek, 0, __pyx_n_s_Timestamp_dayofweek, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":294 + * return Period(self, freq=freq) + * + * @property # <<<<<<<<<<<<<< + * def dayofweek(self): + * return self.weekday() + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_dayofweek, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":299 + * + * @property + * def dayofyear(self): # <<<<<<<<<<<<<< + * return self._get_field('doy') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_31dayofyear, 0, __pyx_n_s_Timestamp_dayofyear, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":298 + * return self.weekday() + * + * @property # <<<<<<<<<<<<<< + * def dayofyear(self): + * return self._get_field('doy') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_dayofyear, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":303 + * + * @property + * def week(self): # <<<<<<<<<<<<<< + * return self._get_field('woy') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_33week, 0, __pyx_n_s_Timestamp_week, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":302 + * return self._get_field('doy') + * + * @property # <<<<<<<<<<<<<< + * def week(self): + * return self._get_field('woy') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_week, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":306 + * return self._get_field('woy') + * + * weekofyear = week # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_week); + if (unlikely(!__pyx_t_9)) { + PyErr_Clear(); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_week); + } + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_weekofyear, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":309 + * + * @property + * def quarter(self): # <<<<<<<<<<<<<< + * return self._get_field('q') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_35quarter, 0, __pyx_n_s_Timestamp_quarter, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":308 + * weekofyear = week + * + * @property # <<<<<<<<<<<<<< + * def quarter(self): + * return self._get_field('q') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_quarter, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":313 + * + * @property + * def freqstr(self): # <<<<<<<<<<<<<< + * return getattr(self.offset, 'freqstr', self.offset) + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_37freqstr, 0, __pyx_n_s_Timestamp_freqstr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":312 + * return self._get_field('q') + * + * @property # <<<<<<<<<<<<<< + * def freqstr(self): + * return getattr(self.offset, 'freqstr', self.offset) + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_freqstr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":317 + * + * @property + * def asm8(self): # <<<<<<<<<<<<<< + * return np.int64(self.value).view('M8[ns]') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_39asm8, 0, __pyx_n_s_Timestamp_asm8, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":316 + * return getattr(self.offset, 'freqstr', self.offset) + * + * @property # <<<<<<<<<<<<<< + * def asm8(self): + * return np.int64(self.value).view('M8[ns]') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_asm8, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":321 + * + * @property + * def is_month_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_start') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_41is_month_start, 0, __pyx_n_s_Timestamp_is_month_start, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":320 + * return np.int64(self.value).view('M8[ns]') + * + * @property # <<<<<<<<<<<<<< + * def is_month_start(self): + * return self._get_start_end_field('is_month_start') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_month_start, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":325 + * + * @property + * def is_month_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_end') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_43is_month_end, 0, __pyx_n_s_Timestamp_is_month_end, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":324 + * return self._get_start_end_field('is_month_start') + * + * @property # <<<<<<<<<<<<<< + * def is_month_end(self): + * return self._get_start_end_field('is_month_end') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_month_end, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":329 + * + * @property + * def is_quarter_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_start') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_45is_quarter_start, 0, __pyx_n_s_Timestamp_is_quarter_start, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":328 + * return self._get_start_end_field('is_month_end') + * + * @property # <<<<<<<<<<<<<< + * def is_quarter_start(self): + * return self._get_start_end_field('is_quarter_start') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_quarter_start, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":333 + * + * @property + * def is_quarter_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_end') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_47is_quarter_end, 0, __pyx_n_s_Timestamp_is_quarter_end, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":332 + * return self._get_start_end_field('is_quarter_start') + * + * @property # <<<<<<<<<<<<<< + * def is_quarter_end(self): + * return self._get_start_end_field('is_quarter_end') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_quarter_end, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":337 + * + * @property + * def is_year_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_start') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_49is_year_start, 0, __pyx_n_s_Timestamp_is_year_start, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":336 + * return self._get_start_end_field('is_quarter_end') + * + * @property # <<<<<<<<<<<<<< + * def is_year_start(self): + * return self._get_start_end_field('is_year_start') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_year_start, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":341 + * + * @property + * def is_year_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_end') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_51is_year_end, 0, __pyx_n_s_Timestamp_is_year_end, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":340 + * return self._get_start_end_field('is_year_start') + * + * @property # <<<<<<<<<<<<<< + * def is_year_end(self): + * return self._get_start_end_field('is_year_end') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_year_end, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":344 + * return self._get_start_end_field('is_year_end') + * + * def tz_localize(self, tz, infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Convert naive Timestamp to local time zone + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_53tz_localize, 0, __pyx_n_s_Timestamp_tz_localize, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__188); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_tz_localize, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":368 + * 'tz_convert for conversions') + * + * def tz_convert(self, tz): # <<<<<<<<<<<<<< + * """ + * Convert Timestamp to another time zone or localize to requested time + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_55tz_convert, 0, __pyx_n_s_Timestamp_tz_convert, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_tz_convert, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":389 + * return Timestamp(self.value, tz=tz) + * + * astimezone = tz_convert # <<<<<<<<<<<<<< + * + * def replace(self, **kwds): + */ + __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_tz_convert); + if (unlikely(!__pyx_t_9)) { + PyErr_Clear(); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_tz_convert); + } + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_astimezone, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":391 + * astimezone = tz_convert + * + * def replace(self, **kwds): # <<<<<<<<<<<<<< + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_57replace, 0, __pyx_n_s_Timestamp_replace, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_replace, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":395 + * offset=self.offset) + * + * def to_pydatetime(self, warn=True): # <<<<<<<<<<<<<< + * """ + * If warn=True, issue warning if nanoseconds is nonzero + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_59to_pydatetime, 0, __pyx_n_s_Timestamp_to_pydatetime, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__195); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_to_pydatetime, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":411 + * ts.dts.us, ts.tzinfo) + * + * def isoformat(self, sep='T'): # <<<<<<<<<<<<<< + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_61isoformat, 0, __pyx_n_s_Timestamp_isoformat, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__198); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_isoformat, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":428 + * return base1 + base2 + * + * def _has_time_component(self): # <<<<<<<<<<<<<< + * """ + * Returns if the Timestamp has a time component + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_63_has_time_component, 0, __pyx_n_s_Timestamp__has_time_component, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_has_time_component, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":437 + * or self.nanosecond != 0) + * + * def to_julian_date(self): # <<<<<<<<<<<<<< + * """ + * Convert TimeStamp to a Julian Date. + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_65to_julian_date, 0, __pyx_n_s_Timestamp_to_julian_date, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_to_julian_date, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":157 + * # Python front end to C extension type _Timestamp + * # This serves as the box for datetime64 + * class Timestamp(_Timestamp): # <<<<<<<<<<<<<< + * """TimeStamp is the pandas equivalent of python's Datetime + * and is interchangable with it in most cases. It's the type used + */ + __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Timestamp, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":462 + * )/24.0) + * + * _nat_strings = set(['NaT','nat','NAT','nan','NaN','NAN']) # <<<<<<<<<<<<<< + * class NaTType(_NaT): + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PySet_Add(__pyx_t_1, __pyx_n_s_NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_nat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_NAT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_nan) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_NaN) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_NAN) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nat_strings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":463 + * + * _nat_strings = set(['NaT','nat','NAT','nan','NaN','NAN']) + * class NaTType(_NaT): # <<<<<<<<<<<<<< + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__NaT))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__NaT))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__NaT))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_NaTType, __pyx_n_s_NaTType, (PyObject *) NULL, __pyx_n_s_pandas_tslib, __pyx_kp_s_N_ot_A_T_ime_the_time_equivalen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":466 + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + * def __new__(cls): # <<<<<<<<<<<<<< + * cdef _NaT base + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_NaTType___new, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":475 + * return base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_3__repr__, 0, __pyx_n_s_NaTType___repr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":478 + * return 'NaT' + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_5__str__, 0, __pyx_n_s_NaTType___str, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":481 + * return 'NaT' + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return iNaT + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_7__hash__, 0, __pyx_n_s_NaTType___hash, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_hash, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":484 + * return iNaT + * + * def __int__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_9__int__, 0, __pyx_n_s_NaTType___int, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_int, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":487 + * return NPY_NAT + * + * def __long__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_11__long__, 0, __pyx_n_s_NaTType___long, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_long_2, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":490 + * return NPY_NAT + * + * def weekday(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_13weekday, 0, __pyx_n_s_NaTType_weekday, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_weekday, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":493 + * return -1 + * + * def toordinal(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_15toordinal, 0, __pyx_n_s_NaTType_toordinal, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_toordinal, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":496 + * return -1 + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * return (__nat_unpickle, (None, )) + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_17__reduce__, 0, __pyx_n_s_NaTType___reduce, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_reduce, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":463 + * + * _nat_strings = set(['NaT','nat','NAT','nan','NaN','NAN']) + * class NaTType(_NaT): # <<<<<<<<<<<<<< + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + */ + __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_NaTType, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaTType, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":499 + * return (__nat_unpickle, (None, )) + * + * fields = ['year', 'quarter', 'month', 'day', 'hour', # <<<<<<<<<<<<<< + * 'minute', 'second', 'microsecond', 'nanosecond', + * 'week', 'dayofyear'] + */ + __pyx_t_1 = PyList_New(11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_year); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_year); + __Pyx_GIVEREF(__pyx_n_s_year); + __Pyx_INCREF(__pyx_n_s_quarter); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_quarter); + __Pyx_GIVEREF(__pyx_n_s_quarter); + __Pyx_INCREF(__pyx_n_s_month); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_month); + __Pyx_GIVEREF(__pyx_n_s_month); + __Pyx_INCREF(__pyx_n_s_day); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_day); + __Pyx_GIVEREF(__pyx_n_s_day); + __Pyx_INCREF(__pyx_n_s_hour); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_hour); + __Pyx_GIVEREF(__pyx_n_s_hour); + __Pyx_INCREF(__pyx_n_s_minute); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_minute); + __Pyx_GIVEREF(__pyx_n_s_minute); + __Pyx_INCREF(__pyx_n_s_second); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_second); + __Pyx_GIVEREF(__pyx_n_s_second); + __Pyx_INCREF(__pyx_n_s_microsecond); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_microsecond); + __Pyx_GIVEREF(__pyx_n_s_microsecond); + __Pyx_INCREF(__pyx_n_s_nanosecond); + PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_nanosecond); + __Pyx_GIVEREF(__pyx_n_s_nanosecond); + __Pyx_INCREF(__pyx_n_s_week); + PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_week); + __Pyx_GIVEREF(__pyx_n_s_week); + __Pyx_INCREF(__pyx_n_s_dayofyear); + PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_dayofyear); + __Pyx_GIVEREF(__pyx_n_s_dayofyear); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fields, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":502 + * 'minute', 'second', 'microsecond', 'nanosecond', + * 'week', 'dayofyear'] + * for field in fields: # <<<<<<<<<<<<<< + * prop = property(fget=lambda self: -1) + * setattr(NaTType, field, prop) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_12(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if (PyDict_SetItem(__pyx_d, __pyx_n_s_field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":503 + * 'week', 'dayofyear'] + * for field in fields: + * prop = property(fget=lambda self: -1) # <<<<<<<<<<<<<< + * setattr(NaTType, field, prop) + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_100lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fget, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_prop, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":504 + * for field in fields: + * prop = property(fget=lambda self: -1) + * setattr(NaTType, field, prop) # <<<<<<<<<<<<<< + * + * def __nat_unpickle(*args): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaTType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_prop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = PyObject_SetAttr(__pyx_t_3, __pyx_t_1, __pyx_t_9); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":506 + * setattr(NaTType, field, prop) + * + * def __nat_unpickle(*args): # <<<<<<<<<<<<<< + * # return constant defined in the module + * return NaT + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_3__nat_unpickle, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nat_unpickle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":510 + * return NaT + * + * NaT = NaTType() # <<<<<<<<<<<<<< + * + * iNaT = util.get_nat() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaTType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaT, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":512 + * NaT = NaTType() + * + * iNaT = util.get_nat() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(get_nat()); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_iNaT, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":530 + * return ', tz=%s' % zone + * + * def is_timestamp_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_5is_timestamp_array, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_timestamp_array, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":566 + * # These are defined as magic numbers due to strange + * # wraparound behavior when using the true int64 lower boundary + * cdef int64_t _NS_LOWER_BOUND = -9223285636854775000LL # <<<<<<<<<<<<<< + * cdef int64_t _NS_UPPER_BOUND = 9223372036854775807LL + * + */ + __pyx_v_6pandas_5tslib__NS_LOWER_BOUND = -9223285636854775000LL; + + /* "pandas/tslib.pyx":567 + * # wraparound behavior when using the true int64 lower boundary + * cdef int64_t _NS_LOWER_BOUND = -9223285636854775000LL + * cdef int64_t _NS_UPPER_BOUND = 9223372036854775807LL # <<<<<<<<<<<<<< + * + * cdef pandas_datetimestruct _NS_MIN_DTS, _NS_MAX_DTS + */ + __pyx_v_6pandas_5tslib__NS_UPPER_BOUND = 9223372036854775807LL; + + /* "pandas/tslib.pyx":570 + * + * cdef pandas_datetimestruct _NS_MIN_DTS, _NS_MAX_DTS + * pandas_datetime_to_datetimestruct(_NS_LOWER_BOUND, PANDAS_FR_ns, &_NS_MIN_DTS) # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(_NS_UPPER_BOUND, PANDAS_FR_ns, &_NS_MAX_DTS) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_6pandas_5tslib__NS_LOWER_BOUND, PANDAS_FR_ns, (&__pyx_v_6pandas_5tslib__NS_MIN_DTS)); + + /* "pandas/tslib.pyx":571 + * cdef pandas_datetimestruct _NS_MIN_DTS, _NS_MAX_DTS + * pandas_datetime_to_datetimestruct(_NS_LOWER_BOUND, PANDAS_FR_ns, &_NS_MIN_DTS) + * pandas_datetime_to_datetimestruct(_NS_UPPER_BOUND, PANDAS_FR_ns, &_NS_MAX_DTS) # <<<<<<<<<<<<<< + * + * Timestamp.min = Timestamp(_NS_LOWER_BOUND) + */ + pandas_datetime_to_datetimestruct(__pyx_v_6pandas_5tslib__NS_UPPER_BOUND, PANDAS_FR_ns, (&__pyx_v_6pandas_5tslib__NS_MAX_DTS)); + + /* "pandas/tslib.pyx":573 + * pandas_datetime_to_datetimestruct(_NS_UPPER_BOUND, PANDAS_FR_ns, &_NS_MAX_DTS) + * + * Timestamp.min = Timestamp(_NS_LOWER_BOUND) # <<<<<<<<<<<<<< + * Timestamp.max = Timestamp(_NS_UPPER_BOUND) + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib__NS_LOWER_BOUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":574 + * + * Timestamp.min = Timestamp(_NS_LOWER_BOUND) + * Timestamp.max = Timestamp(_NS_UPPER_BOUND) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib__NS_UPPER_BOUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_PyObject_SetAttrStr(__pyx_t_9, __pyx_n_s_max, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":580 + * # Frequency inference + * + * def unique_deltas(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9unique_deltas, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_deltas, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":608 + * + * + * def apply_offset(ndarray[object] values, object offset): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_11apply_offset, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_offset, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":635 + * cdef int _reverse_ops[6] + * + * _reverse_ops[Py_LT] = Py_GT # <<<<<<<<<<<<<< + * _reverse_ops[Py_LE] = Py_GE + * _reverse_ops[Py_EQ] = Py_EQ + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_LT]) = Py_GT; + + /* "pandas/tslib.pyx":636 + * + * _reverse_ops[Py_LT] = Py_GT + * _reverse_ops[Py_LE] = Py_GE # <<<<<<<<<<<<<< + * _reverse_ops[Py_EQ] = Py_EQ + * _reverse_ops[Py_NE] = Py_NE + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_LE]) = Py_GE; + + /* "pandas/tslib.pyx":637 + * _reverse_ops[Py_LT] = Py_GT + * _reverse_ops[Py_LE] = Py_GE + * _reverse_ops[Py_EQ] = Py_EQ # <<<<<<<<<<<<<< + * _reverse_ops[Py_NE] = Py_NE + * _reverse_ops[Py_GT] = Py_LT + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_EQ]) = Py_EQ; + + /* "pandas/tslib.pyx":638 + * _reverse_ops[Py_LE] = Py_GE + * _reverse_ops[Py_EQ] = Py_EQ + * _reverse_ops[Py_NE] = Py_NE # <<<<<<<<<<<<<< + * _reverse_ops[Py_GT] = Py_LT + * _reverse_ops[Py_GE] = Py_LE + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_NE]) = Py_NE; + + /* "pandas/tslib.pyx":639 + * _reverse_ops[Py_EQ] = Py_EQ + * _reverse_ops[Py_NE] = Py_NE + * _reverse_ops[Py_GT] = Py_LT # <<<<<<<<<<<<<< + * _reverse_ops[Py_GE] = Py_LE + * + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_GT]) = Py_LT; + + /* "pandas/tslib.pyx":640 + * _reverse_ops[Py_NE] = Py_NE + * _reverse_ops[Py_GT] = Py_LT + * _reverse_ops[Py_GE] = Py_LE # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_GE]) = Py_LE; + + /* "pandas/tslib.pyx":643 + * + * + * cdef str _NDIM_STRING = "ndim" # <<<<<<<<<<<<<< + * + * # This is PITA. Because we inherit from datetime, which has very specific + */ + __Pyx_INCREF(__pyx_n_s_ndim); + __Pyx_XGOTREF(__pyx_v_6pandas_5tslib__NDIM_STRING); + __Pyx_DECREF_SET(__pyx_v_6pandas_5tslib__NDIM_STRING, __pyx_n_s_ndim); + __Pyx_GIVEREF(__pyx_n_s_ndim); + + /* "pandas/tslib.pyx":787 + * + * + * cdef PyTypeObject* ts_type = Timestamp # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_6pandas_5tslib_ts_type = ((PyTypeObject *)__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":796 + * cdef bint _nat_scalar_rules[6] + * + * _nat_scalar_rules[Py_EQ] = False # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_NE] = True + * _nat_scalar_rules[Py_LT] = False + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_EQ]) = 0; + + /* "pandas/tslib.pyx":797 + * + * _nat_scalar_rules[Py_EQ] = False + * _nat_scalar_rules[Py_NE] = True # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_LT] = False + * _nat_scalar_rules[Py_LE] = False + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_NE]) = 1; + + /* "pandas/tslib.pyx":798 + * _nat_scalar_rules[Py_EQ] = False + * _nat_scalar_rules[Py_NE] = True + * _nat_scalar_rules[Py_LT] = False # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_LE] = False + * _nat_scalar_rules[Py_GT] = False + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_LT]) = 0; + + /* "pandas/tslib.pyx":799 + * _nat_scalar_rules[Py_NE] = True + * _nat_scalar_rules[Py_LT] = False + * _nat_scalar_rules[Py_LE] = False # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_GT] = False + * _nat_scalar_rules[Py_GE] = False + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_LE]) = 0; + + /* "pandas/tslib.pyx":800 + * _nat_scalar_rules[Py_LT] = False + * _nat_scalar_rules[Py_LE] = False + * _nat_scalar_rules[Py_GT] = False # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_GE] = False + * + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_GT]) = 0; + + /* "pandas/tslib.pyx":801 + * _nat_scalar_rules[Py_LE] = False + * _nat_scalar_rules[Py_GT] = False + * _nat_scalar_rules[Py_GE] = False # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_GE]) = 0; + + /* "pandas/tslib.pyx":845 + * + * + * def _delta_to_nanoseconds(delta): # <<<<<<<<<<<<<< + * if hasattr(delta, 'delta'): + * delta = delta.delta + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_13_delta_to_nanoseconds, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_delta_to_nanoseconds, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1024 + * + * + * def get_timezone(tz): # <<<<<<<<<<<<<< + * return _get_zone(tz) + * + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_17get_timezone, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_timezone, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1079 + * + * + * class OutOfBoundsDatetime(ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_9, __pyx_n_s_OutOfBoundsDatetime, __pyx_n_s_OutOfBoundsDatetime, (PyObject *) NULL, __pyx_n_s_pandas_tslib, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OutOfBoundsDatetime, __pyx_t_9, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutOfBoundsDatetime, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1109 + * # obj.dtval = _dts_to_pydatetime(&obj.dts) + * + * def datetime_to_datetime64(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_21datetime_to_datetime64, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_to_datetime64, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1144 + * return result, inferred_tz + * + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) # <<<<<<<<<<<<<< + * + * def _does_string_look_like_datetime(date_string): + */ + __pyx_t_9 = PySet_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PySet_Add(__pyx_t_9, __pyx_n_s_a) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_A) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_M) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_P) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_T) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_not_datelike_strings, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1146 + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + * + * def _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * if date_string.startswith('0'): + * # Strings starting with 0 are more consistent with a + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_23_does_string_look_like_datetime, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_does_string_look_like_datetime, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1163 + * return True + * + * def parse_datetime_string(date_string, **kwargs): # <<<<<<<<<<<<<< + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_25parse_datetime_string, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_datetime_string, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_27array_to_datetime, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_to_datetime, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1344 + * return oresult + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): # <<<<<<<<<<<<<< + * """ convert an ndarray to an array of ints that are timedeltas + * force conversion if coerce = True, + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_29array_to_timedelta64, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_to_timedelta64, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1360 + * return iresult + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): # <<<<<<<<<<<<<< + * return convert_to_timedelta64(ts, unit, coerce) + * + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_31convert_to_timedelta, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_to_timedelta, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1430 + * return ts.astype('timedelta64[ns]') + * + * def repr_timedelta64(object value, format=None): # <<<<<<<<<<<<<< + * """ + * provide repr for timedelta64 + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_33repr_timedelta64, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_repr_timedelta64, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1499 + * + * + * def array_strptime(ndarray[object] values, object fmt, coerce=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_35array_strptime, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_strptime, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1793 + * return (base*m) + (frac*m) + * + * def cast_to_nanoseconds(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_39cast_to_nanoseconds, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cast_to_nanoseconds, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1825 + * + * + * def pydt_to_i8(object pydt): # <<<<<<<<<<<<<< + * ''' + * Convert to int64 representation compatible with numpy datetime64; converts + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_41pydt_to_i8, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydt_to_i8, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1837 + * return ts.value + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): # <<<<<<<<<<<<<< + * ''' + * Inverse of pydt_to_i8 + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_43i8_to_pydt, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_i8_to_pydt, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1846 + * # time zone conversion helpers + * + * try: # <<<<<<<<<<<<<< + * import pytz + * UTC = pytz.utc + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "pandas/tslib.pyx":1847 + * + * try: + * import pytz # <<<<<<<<<<<<<< + * UTC = pytz.utc + * have_pytz = True + */ + __pyx_t_9 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1848 + * try: + * import pytz + * UTC = pytz.utc # <<<<<<<<<<<<<< + * have_pytz = True + * except: + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_utc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTC, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1849 + * import pytz + * UTC = pytz.utc + * have_pytz = True # <<<<<<<<<<<<<< + * except: + * have_pytz = False + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_pytz, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L21_try_end; + __pyx_L14_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1850 + * UTC = pytz.utc + * have_pytz = True + * except: # <<<<<<<<<<<<<< + * have_pytz = False + * + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/tslib.pyx":1851 + * have_pytz = True + * except: + * have_pytz = False # <<<<<<<<<<<<<< + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_pytz, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L15_exception_handled; + } + __pyx_L16_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L15_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5); + __pyx_L21_try_end:; + } + + /* "pandas/tslib.pyx":1853 + * have_pytz = False + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_45tz_convert, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tz_convert, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1934 + * return result + * + * def tz_convert_single(int64_t val, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] trans, deltas + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_47tz_convert_single, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tz_convert_single, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1984 + * + * # Timezone data caches, key is the pytz string or dateutil file name. + * trans_cache = {} # <<<<<<<<<<<<<< + * utc_offset_cache = {} + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_trans_cache, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1985 + * # Timezone data caches, key is the pytz string or dateutil file name. + * trans_cache = {} + * utc_offset_cache = {} # <<<<<<<<<<<<<< + * + * cdef inline bint _treat_tz_as_pytz(object tz): + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc_offset_cache, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1994 + * + * + * def _p_tz_cache_key(tz): # <<<<<<<<<<<<<< + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_49_p_tz_cache_key, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_p_tz_cache_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2108 + * 10**6) + * + * def tot_seconds(td): # <<<<<<<<<<<<<< + * return total_seconds(td) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_51tot_seconds, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tot_seconds, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2127 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Localize tzinfo-naive DateRange to given time zone (using pytz). If + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_55tz_localize_to_utc, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tz_localize_to_utc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2300 + * #---------------------------------------------------------------------- + * + * def build_field_sarray(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_57build_field_sarray, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_build_field_sarray, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2342 + * return out + * + * def get_time_micros(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_59get_time_micros, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_time_micros, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2361 + * + * @cython.wraparound(False) + * def get_date_field(ndarray[int64_t] dtindex, object field): # <<<<<<<<<<<<<< + * ''' + * Given a int64-based datetime index, extract the year, month, etc., + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_61get_date_field, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_date_field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2505 + * + * @cython.wraparound(False) + * def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=None, int month_kw=12): # <<<<<<<<<<<<<< + * ''' + * Given an int64-based datetime index return array of indicators + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_63get_start_end_field, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_start_end_field_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2727 + * return ts_dayofweek(ts) + * + * cdef int64_t DAY_NS = 86400000000000LL # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6pandas_5tslib_DAY_NS = 86400000000000LL; + + /* "pandas/tslib.pyx":2730 + * + * + * def date_normalize(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_65date_normalize, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_date_normalize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2824 + * + * + * def dates_normalized(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_67dates_normalized, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dates_normalized, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2862 + * #---------------------------------------------------------------------- + * + * def isleapyear(int64_t year): # <<<<<<<<<<<<<< + * return is_leapyear(year) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_69isleapyear, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isleapyear, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2865 + * return is_leapyear(year) + * + * def monthrange(int64_t year, int64_t month): # <<<<<<<<<<<<<< + * cdef: + * int64_t days + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_71monthrange, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_monthrange, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3019 + * int get_yq(int64_t ordinal, int freq, int *quarter, int *year) + * + * initialize_daytime_conversion_factor_matrix() # <<<<<<<<<<<<<< + * + * # Period logic + */ + initialize_daytime_conversion_factor_matrix(); + + /* "pandas/tslib.pyx":3044 + * return period_ord_w_mult * mult + 1; + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): # <<<<<<<<<<<<<< + * """ + * Convert array of datetime64 values (passed in as 'i8' dtype) to a set of + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_75dt64arr_to_periodarr, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt64arr_to_periodarr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3070 + * return out + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): # <<<<<<<<<<<<<< + * """ + * Convert array to datetime64 values from a set of ordinals corresponding to + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_77periodarr_to_dt64arr, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_periodarr_to_dt64arr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3091 + * return out + * + * cdef char START = 'S' # <<<<<<<<<<<<<< + * cdef char END = 'E' + * + */ + __pyx_v_6pandas_5tslib_START = 'S'; + + /* "pandas/tslib.pyx":3092 + * + * cdef char START = 'S' + * cdef char END = 'E' # <<<<<<<<<<<<<< + * + * cpdef int64_t period_asfreq(int64_t period_ordinal, int freq1, int freq2, + */ + __pyx_v_6pandas_5tslib_END = 'E'; + + /* "pandas/tslib.pyx":3116 + * return retval + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): # <<<<<<<<<<<<<< + * """ + * Convert int64-array of period ordinals from one frequency to another, and + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_81period_asfreq_arr, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_period_asfreq_arr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3158 + * return result + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): # <<<<<<<<<<<<<< + * cdef: + * int64_t ordinal + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_83period_ordinal, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_period_ordinal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3188 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * + * def period_format(int64_t value, int freq, object fmt=None): # <<<<<<<<<<<<<< + * cdef: + * int freq_group + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_87period_format, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_period_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3229 + * + * + * cdef list extra_fmts = [(b"%q", b"^`AB`^"), # <<<<<<<<<<<<<< + * (b"%f", b"^`CD`^"), + * (b"%F", b"^`EF`^"), + */ + __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_tuple__291); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_tuple__291); + __Pyx_GIVEREF(__pyx_tuple__291); + __Pyx_INCREF(__pyx_tuple__292); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_tuple__292); + __Pyx_GIVEREF(__pyx_tuple__292); + __Pyx_INCREF(__pyx_tuple__293); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_tuple__293); + __Pyx_GIVEREF(__pyx_tuple__293); + __Pyx_INCREF(__pyx_tuple__294); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_tuple__294); + __Pyx_GIVEREF(__pyx_tuple__294); + __Pyx_INCREF(__pyx_tuple__295); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_tuple__295); + __Pyx_GIVEREF(__pyx_tuple__295); + __Pyx_INCREF(__pyx_tuple__296); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_tuple__296); + __Pyx_GIVEREF(__pyx_tuple__296); + __Pyx_XGOTREF(__pyx_v_6pandas_5tslib_extra_fmts); + __Pyx_DECREF_SET(__pyx_v_6pandas_5tslib_extra_fmts, ((PyObject*)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3236 + * (b"%n", b"^`KL`^")] + * + * cdef list str_extra_fmts = ["^`AB`^", "^`CD`^", "^`EF`^", "^`GH`^", "^`IJ`^", "^`KL`^"] # <<<<<<<<<<<<<< + * + * cdef object _period_strftime(int64_t value, int freq, object fmt): + */ + __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_AB); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_AB); + __Pyx_GIVEREF(__pyx_kp_s_AB); + __Pyx_INCREF(__pyx_kp_s_CD); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_CD); + __Pyx_GIVEREF(__pyx_kp_s_CD); + __Pyx_INCREF(__pyx_kp_s_EF); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_s_EF); + __Pyx_GIVEREF(__pyx_kp_s_EF); + __Pyx_INCREF(__pyx_kp_s_GH); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_s_GH); + __Pyx_GIVEREF(__pyx_kp_s_GH); + __Pyx_INCREF(__pyx_kp_s_IJ); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_s_IJ); + __Pyx_GIVEREF(__pyx_kp_s_IJ); + __Pyx_INCREF(__pyx_kp_s_KL); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_s_KL); + __Pyx_GIVEREF(__pyx_kp_s_KL); + __Pyx_XGOTREF(__pyx_v_6pandas_5tslib_str_extra_fmts); + __Pyx_DECREF_SET(__pyx_v_6pandas_5tslib_str_extra_fmts, ((PyObject*)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3294 + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN + * + * def get_period_field(int code, int64_t value, int freq): # <<<<<<<<<<<<<< + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_89get_period_field, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_period_field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3302 + * return f(value, freq) + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_91get_period_field_arr, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_period_field_arr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3351 + * + * + * def extract_ordinals(ndarray[object] values, freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_93extract_ordinals, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_ordinals, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3384 + * return reso + * + * US_RESO = 0 # <<<<<<<<<<<<<< + * MS_RESO = 1 + * S_RESO = 2 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_US_RESO, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3385 + * + * US_RESO = 0 + * MS_RESO = 1 # <<<<<<<<<<<<<< + * S_RESO = 2 + * T_RESO = 3 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MS_RESO, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3386 + * US_RESO = 0 + * MS_RESO = 1 + * S_RESO = 2 # <<<<<<<<<<<<<< + * T_RESO = 3 + * H_RESO = 4 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_S_RESO, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3387 + * MS_RESO = 1 + * S_RESO = 2 + * T_RESO = 3 # <<<<<<<<<<<<<< + * H_RESO = 4 + * D_RESO = 5 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_T_RESO, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3388 + * S_RESO = 2 + * T_RESO = 3 + * H_RESO = 4 # <<<<<<<<<<<<<< + * D_RESO = 5 + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_H_RESO, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3389 + * T_RESO = 3 + * H_RESO = 4 + * D_RESO = 5 # <<<<<<<<<<<<<< + * + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_D_RESO, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3479 + * + * """ + * import time # <<<<<<<<<<<<<< + * import locale + * import calendar + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3480 + * """ + * import time + * import locale # <<<<<<<<<<<<<< + * import calendar + * from re import compile as re_compile + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_locale, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_locale, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3481 + * import time + * import locale + * import calendar # <<<<<<<<<<<<<< + * from re import compile as re_compile + * from re import IGNORECASE + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_calendar, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calendar, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3482 + * import locale + * import calendar + * from re import compile as re_compile # <<<<<<<<<<<<<< + * from re import IGNORECASE + * from re import escape as re_escape + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_compile); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_compile); + __Pyx_GIVEREF(__pyx_n_s_compile); + __pyx_t_9 = __Pyx_Import(__pyx_n_s_re, __pyx_t_1, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_compile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":3483 + * import calendar + * from re import compile as re_compile + * from re import IGNORECASE # <<<<<<<<<<<<<< + * from re import escape as re_escape + * from datetime import date as datetime_date + */ + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_s_IGNORECASE); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_IGNORECASE); + __Pyx_GIVEREF(__pyx_n_s_IGNORECASE); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, __pyx_t_9, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_IGNORECASE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IGNORECASE, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3484 + * from re import compile as re_compile + * from re import IGNORECASE + * from re import escape as re_escape # <<<<<<<<<<<<<< + * from datetime import date as datetime_date + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_escape); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_escape); + __Pyx_GIVEREF(__pyx_n_s_escape); + __pyx_t_9 = __Pyx_Import(__pyx_n_s_re, __pyx_t_1, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_escape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_escape, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":3485 + * from re import IGNORECASE + * from re import escape as re_escape + * from datetime import date as datetime_date # <<<<<<<<<<<<<< + * + * # Python 2 vs Python 3 + */ + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_s_date); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_date); + __Pyx_GIVEREF(__pyx_n_s_date); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_9, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_date, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3488 + * + * # Python 2 vs Python 3 + * try: # <<<<<<<<<<<<<< + * from thread import allocate_lock as _thread_allocate_lock + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/tslib.pyx":3489 + * # Python 2 vs Python 3 + * try: + * from thread import allocate_lock as _thread_allocate_lock # <<<<<<<<<<<<<< + * except: + * try: + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L24_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_allocate_lock); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_allocate_lock); + __Pyx_GIVEREF(__pyx_n_s_allocate_lock); + __pyx_t_9 = __Pyx_Import(__pyx_n_s_thread, __pyx_t_1, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L24_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L24_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_allocate_lock, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L24_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L31_try_end; + __pyx_L24_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":3490 + * try: + * from thread import allocate_lock as _thread_allocate_lock + * except: # <<<<<<<<<<<<<< + * try: + * from _thread import allocate_lock as _thread_allocate_lock + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":3491 + * from thread import allocate_lock as _thread_allocate_lock + * except: + * try: # <<<<<<<<<<<<<< + * from _thread import allocate_lock as _thread_allocate_lock + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + /*try:*/ { + + /* "pandas/tslib.pyx":3492 + * except: + * try: + * from _thread import allocate_lock as _thread_allocate_lock # <<<<<<<<<<<<<< + * except: + * try: + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L34_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_allocate_lock); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_allocate_lock); + __Pyx_GIVEREF(__pyx_n_s_allocate_lock); + __pyx_t_10 = __Pyx_Import(__pyx_n_s_thread_2, __pyx_t_3, -1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L34_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_10, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L34_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_allocate_lock, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L34_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L41_try_end; + __pyx_L34_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":3493 + * try: + * from _thread import allocate_lock as _thread_allocate_lock + * except: # <<<<<<<<<<<<<< + * try: + * from dummy_thread import allocate_lock as _thread_allocate_lock + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_3, &__pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3493; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_17); + + /* "pandas/tslib.pyx":3494 + * from _thread import allocate_lock as _thread_allocate_lock + * except: + * try: # <<<<<<<<<<<<<< + * from dummy_thread import allocate_lock as _thread_allocate_lock + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + /*try:*/ { + + /* "pandas/tslib.pyx":3495 + * except: + * try: + * from dummy_thread import allocate_lock as _thread_allocate_lock # <<<<<<<<<<<<<< + * except: + * from _dummy_thread import allocate_lock as _thread_allocate_lock + */ + __pyx_t_21 = PyList_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L44_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_INCREF(__pyx_n_s_allocate_lock); + PyList_SET_ITEM(__pyx_t_21, 0, __pyx_n_s_allocate_lock); + __Pyx_GIVEREF(__pyx_n_s_allocate_lock); + __pyx_t_22 = __Pyx_Import(__pyx_n_s_dummy_thread, __pyx_t_21, -1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L44_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_ImportFrom(__pyx_t_22, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L44_error;} + __Pyx_GOTREF(__pyx_t_21); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_allocate_lock, __pyx_t_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L44_error;} + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + } + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + goto __pyx_L51_try_end; + __pyx_L44_error:; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; + + /* "pandas/tslib.pyx":3496 + * try: + * from dummy_thread import allocate_lock as _thread_allocate_lock + * except: # <<<<<<<<<<<<<< + * from _dummy_thread import allocate_lock as _thread_allocate_lock + * + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_23) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3496; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GOTREF(__pyx_t_23); + + /* "pandas/tslib.pyx":3497 + * from dummy_thread import allocate_lock as _thread_allocate_lock + * except: + * from _dummy_thread import allocate_lock as _thread_allocate_lock # <<<<<<<<<<<<<< + * + * __all__ = [] + */ + __pyx_t_24 = PyList_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_GOTREF(__pyx_t_24); + __Pyx_INCREF(__pyx_n_s_allocate_lock); + PyList_SET_ITEM(__pyx_t_24, 0, __pyx_n_s_allocate_lock); + __Pyx_GIVEREF(__pyx_n_s_allocate_lock); + __pyx_t_25 = __Pyx_Import(__pyx_n_s_dummy_thread_2, __pyx_t_24, -1); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_GOTREF(__pyx_t_25); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_ImportFrom(__pyx_t_25, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_allocate_lock, __pyx_t_24) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; + goto __pyx_L45_exception_handled; + } + __pyx_L46_except_error:; + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); + goto __pyx_L36_except_error; + __pyx_L45_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); + __pyx_L51_try_end:; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L35_exception_handled; + } + __pyx_L36_except_error:; + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + goto __pyx_L26_except_error; + __pyx_L35_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __pyx_L41_try_end:; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L25_exception_handled; + } + __pyx_L26_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L25_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L31_try_end:; + } + + /* "pandas/tslib.pyx":3499 + * from _dummy_thread import allocate_lock as _thread_allocate_lock + * + * __all__ = [] # <<<<<<<<<<<<<< + * + * def _getlang(): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3501 + * __all__ = [] + * + * def _getlang(): # <<<<<<<<<<<<<< + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_97_getlang, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_getlang, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3505 + * return locale.getlocale(locale.LC_TIME) + * + * class LocaleTime(object): # <<<<<<<<<<<<<< + * """Stores and handles locale-specific information related to time. + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_LocaleTime, __pyx_n_s_LocaleTime, (PyObject *) NULL, __pyx_n_s_pandas_tslib, __pyx_kp_s_Stores_and_handles_locale_specif); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":3524 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * """Set all attributes. + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_1__init__, 0, __pyx_n_s_LocaleTime___init, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_init, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3553 + * raise ValueError("locale changed during initialization") + * + * def __pad(self, seq, front): # <<<<<<<<<<<<<< + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_3__pad, 0, __pyx_n_s_LocaleTime___pad, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__307)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__pad, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3562 + * return seq + * + * def __calc_weekday(self): # <<<<<<<<<<<<<< + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_5__calc_weekday, 0, __pyx_n_s_LocaleTime___calc_weekday, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_weekday, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3570 + * self.f_weekday = f_weekday + * + * def __calc_month(self): # <<<<<<<<<<<<<< + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_7__calc_month, 0, __pyx_n_s_LocaleTime___calc_month, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_month, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3577 + * self.f_month = f_month + * + * def __calc_am_pm(self): # <<<<<<<<<<<<<< + * # Set self.am_pm by using time.strftime(). + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_9__calc_am_pm, 0, __pyx_n_s_LocaleTime___calc_am_pm, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_am_pm, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3589 + * self.am_pm = am_pm + * + * def __calc_date_time(self): # <<<<<<<<<<<<<< + * # Set self.date_time, self.date, & self.time by using + * # time.strftime(). + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_11__calc_date_time, 0, __pyx_n_s_LocaleTime___calc_date_time, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_date_time, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3634 + * self.LC_time = date_time[2] + * + * def __calc_timezone(self): # <<<<<<<<<<<<<< + * # Set self.timezone by using time.tzname. + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_13__calc_timezone, 0, __pyx_n_s_LocaleTime___calc_timezone, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_timezone, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3505 + * return locale.getlocale(locale.LC_TIME) + * + * class LocaleTime(object): # <<<<<<<<<<<<<< + * """Stores and handles locale-specific information related to time. + * + */ + __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LocaleTime, __pyx_t_2, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LocaleTime, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3650 + * + * + * class TimeRE(dict): # <<<<<<<<<<<<<< + * """Handle conversion from format directives to regexes.""" + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyDict_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyDict_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyDict_Type)))); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_TimeRE, __pyx_n_s_TimeRE, (PyObject *) NULL, __pyx_n_s_pandas_tslib, __pyx_kp_s_Handle_conversion_from_format_di); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_6TimeRE_1__init__, 0, __pyx_n_s_TimeRE___init, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__319)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_17, __pyx_tuple__320); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_init, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_6TimeRE_3__seqToRE, 0, __pyx_n_s_TimeRE___seqToRE, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_TimeRE__seqToRE, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3714 + * return '%s)' % regex + * + * def pattern(self, format): # <<<<<<<<<<<<<< + * """Return regex pattern for the format string. + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_6TimeRE_5pattern, 0, __pyx_n_s_TimeRE_pattern, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_pattern, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3737 + * return "%s%s" % (processed_format, format) + * + * def compile(self, format): # <<<<<<<<<<<<<< + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_6TimeRE_7compile, 0, __pyx_n_s_TimeRE_compile, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_compile, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3650 + * + * + * class TimeRE(dict): # <<<<<<<<<<<<<< + * """Handle conversion from format directives to regexes.""" + * + */ + __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_TimeRE, __pyx_t_2, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeRE, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3741 + * return re_compile(self.pattern(format), IGNORECASE) + * + * _cache_lock = _thread_allocate_lock() # <<<<<<<<<<<<<< + * # DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock + * # first! + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_thread_allocate_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cache_lock, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3744 + * # DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock + * # first! + * _TimeRE_cache = TimeRE() # <<<<<<<<<<<<<< + * _CACHE_MAX_SIZE = 5 # Max number of regexes stored in _regex_cache + * _regex_cache = {} + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeRE_cache, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3745 + * # first! + * _TimeRE_cache = TimeRE() + * _CACHE_MAX_SIZE = 5 # Max number of regexes stored in _regex_cache # <<<<<<<<<<<<<< + * _regex_cache = {} + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CACHE_MAX_SIZE, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3746 + * _TimeRE_cache = TimeRE() + * _CACHE_MAX_SIZE = 5 # Max number of regexes stored in _regex_cache + * _regex_cache = {} # <<<<<<<<<<<<<< + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_regex_cache, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3748 + * _regex_cache = {} + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): # <<<<<<<<<<<<<< + * """Calculate the Julian day based on the year, week of the year, and day of + * the week, with week_start_day representing whether the week of the year + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_99_calc_julian_from_U_or_W, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_julian_from_U_or_W, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1 + * # cython: profile=False # <<<<<<<<<<<<<< + * + * cimport numpy as np + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_22); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_XDECREF(__pyx_t_24); + __Pyx_XDECREF(__pyx_t_25); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.tslib"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) { + __pyx_t_5numpy_int64_t r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static double __Pyx__PyObject_AsDouble(PyObject* obj) { + PyObject* float_value; +#if CYTHON_COMPILING_IN_PYPY + float_value = PyNumber_Float(obj); +#else + PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; + if (likely(nb) && likely(nb->nb_float)) { + float_value = nb->nb_float(obj); + if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { + PyErr_Format(PyExc_TypeError, + "__float__ returned non-float (type %.200s)", + Py_TYPE(float_value)->tp_name); + Py_DECREF(float_value); + goto bad; + } + } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { +#if PY_MAJOR_VERSION >= 3 + float_value = PyFloat_FromString(obj); +#else + float_value = PyFloat_FromString(obj, 0); +#endif + } else { + PyObject* args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + PyTuple_SET_ITEM(args, 0, obj); + float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); + PyTuple_SET_ITEM(args, 0, 0); + Py_DECREF(args); + } +#endif + if (likely(float_value)) { + double value = PyFloat_AS_DOUBLE(float_value); + Py_DECREF(float_value); + return value; + } +bad: + return (double)-1; +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int is_tuple, int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + } else { + if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { + __Pyx_UnpackTupleError(tuple, 2); + goto bad; + } +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); + if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); + if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); + value2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(value1); + Py_INCREF(value2); +#endif + if (decref_tuple) { Py_DECREF(tuple); } + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; +#if !CYTHON_COMPILING_IN_PYPY + if (is_dict) { + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#endif + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { + long r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) { + __pyx_t_5numpy_int64_t q = a / b; + __pyx_t_5numpy_int64_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); + } +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { +#if CYTHON_COMPILING_IN_PYPY + if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { /* cdef classes */ + return PyClassMethod_New(method); + } +#else + static PyTypeObject *methoddescr_type = NULL; + if (methoddescr_type == NULL) { + PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append"); + if (!meth) return NULL; + methoddescr_type = Py_TYPE(meth); + Py_DECREF(meth); + } + if (PyObject_TypeCheck(method, methoddescr_type)) { /* cdef classes */ + PyMethodDescrObject *descr = (PyMethodDescrObject *)method; + #if PY_VERSION_HEX < 0x03020000 + PyTypeObject *d_type = descr->d_type; + #else + PyTypeObject *d_type = descr->d_common.d_type; + #endif + return PyDescr_NewClassMethod(d_type, descr->d_method); + } +#endif + else if (PyMethod_Check(method)) { /* python classes */ + return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); + } + else if (PyCFunction_Check(method)) { + return PyClassMethod_New(method); + } +#ifdef __Pyx_CyFunction_USED + else if (PyObject_TypeCheck(method, __pyx_CyFunctionType)) { + return PyClassMethod_New(method); + } +#endif + PyErr_SetString(PyExc_TypeError, + "Class-level classmethod() can only be called on " + "a method_descriptor or instance method."); + return NULL; +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} + +static PyObject *__Pyx_Generator_Next(PyObject *self); +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Generator_Close(PyObject *self); +static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args); +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (unlikely(et != PyExc_StopIteration) && + unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + if (likely(et == PyExc_StopIteration)) { + if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + ev = Py_None; + } + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = ev; + return 0; + } + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PyObject_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +#endif +static CYTHON_INLINE +void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) { + PyObject *exc_type = self->exc_type; + PyObject *exc_value = self->exc_value; + PyObject *exc_traceback = self->exc_traceback; + self->exc_type = NULL; + self->exc_value = NULL; + self->exc_traceback = NULL; + Py_XDECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_traceback); +} +static CYTHON_INLINE +int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) { + if (unlikely(gen->is_running)) { + PyErr_SetString(PyExc_ValueError, + "generator already executing"); + return 1; + } + return 0; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + PyErr_SetString(PyExc_TypeError, + "can't send non-None value to a " + "just-started generator"); + return NULL; + } + } + if (unlikely(self->resume_label == -1)) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } + if (value) { +#if CYTHON_COMPILING_IN_PYPY +#else + /* Generators always return to their most recent caller, not + * necessarily their creator. */ + if (self->exc_traceback) { + PyThreadState *tstate = PyThreadState_GET(); + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(tstate->frame); + assert(f->f_back == NULL); + f->f_back = tstate->frame; + } +#endif + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); + } else { + __Pyx_Generator_ExceptionClear(self); + } + self->is_running = 1; + retval = self->body((PyObject *) self, value); + self->is_running = 0; + if (retval) { + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); +#if CYTHON_COMPILING_IN_PYPY +#else + /* Don't keep the reference to f_back any longer than necessary. It + * may keep a chain of frames alive or it could create a reference + * cycle. */ + if (self->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + } +#endif + } else { + __Pyx_Generator_ExceptionClear(self); + } + return retval; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Generator_Undelegate(gen); + __Pyx_PyGen_FetchStopIterationValue(&val); + ret = __Pyx_Generator_SendEx(gen, val); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, Py_None); +} +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Send(yf, value); + } else { + if (value == Py_None) + ret = PyIter_Next(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, value); +} +static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Generator_Close(yf); + if (!retval) + return -1; + } else { + PyObject *meth; + gen->is_running = 1; + meth = PyObject_GetAttr(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Close(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + Py_INCREF(yf); + err = __Pyx_Generator_CloseIter(gen, yf); + __Pyx_Generator_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) +#if PY_VERSION_HEX < 0x02050000 + PyErr_SetNone(PyExc_StopIteration); +#else + PyErr_SetNone(PyExc_GeneratorExit); +#endif + retval = __Pyx_Generator_SendEx(gen, NULL); + if (retval) { + Py_DECREF(retval); + PyErr_SetString(PyExc_RuntimeError, + "generator ignored GeneratorExit"); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (!raised_exception + || raised_exception == PyExc_StopIteration +#if PY_VERSION_HEX >= 0x02050000 + || raised_exception == PyExc_GeneratorExit + || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) +#endif + || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) + { + if (raised_exception) PyErr_Clear(); /* ignore these errors */ + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *typ; + PyObject *tb = NULL; + PyObject *val = NULL; + PyObject *yf = gen->yieldfrom; + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) + return NULL; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + Py_INCREF(yf); +#if PY_VERSION_HEX >= 0x02050000 + if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { + int err = __Pyx_Generator_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Generator_Undelegate(gen); + if (err < 0) + return __Pyx_Generator_SendEx(gen, NULL); + goto throw_here; + } +#endif + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Throw(yf, args); + } else { + PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Generator_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + ret = PyObject_CallObject(meth, args); + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Generator_FinishDelegation(gen); + } + return ret; + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Generator_SendEx(gen, NULL); +} +static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + Py_VISIT(gen->exc_type); + Py_VISIT(gen->exc_value); + Py_VISIT(gen->exc_traceback); + return 0; +} +static int __Pyx_Generator_clear(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + Py_CLEAR(gen->exc_type); + Py_CLEAR(gen->exc_value); + Py_CLEAR(gen->exc_traceback); + return 0; +} +static void __Pyx_Generator_dealloc(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label > 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 + if (PyObject_CallFinalizerFromDealloc(self)) +#else + Py_TYPE(gen)->tp_del(self); + if (self->ob_refcnt > 0) +#endif + return; /* resurrected. :( */ + PyObject_GC_UnTrack(self); + } + __Pyx_Generator_clear(self); + PyObject_GC_Del(gen); +} +static void __Pyx_Generator_del(PyObject *self) { + PyObject *res; + PyObject *error_type, *error_value, *error_traceback; + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + if (gen->resume_label <= 0) + return ; +#if PY_VERSION_HEX < 0x030400a1 + assert(self->ob_refcnt == 0); + self->ob_refcnt = 1; +#endif + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); + res = __Pyx_Generator_Close(self); + if (res == NULL) + PyErr_WriteUnraisable(self); + else + Py_DECREF(res); + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if PY_VERSION_HEX < 0x030400a1 + /* Undo the temporary resurrection; can't use DECREF here, it would + * cause a recursive call. + */ + assert(self->ob_refcnt > 0); + if (--self->ob_refcnt == 0) + return; /* this is the normal path out */ + /* close() resurrected it! Make it look like the original Py_DECREF + * never happened. + */ + { + Py_ssize_t refcnt = self->ob_refcnt; + _Py_NewReference(self); + self->ob_refcnt = refcnt; + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(self->ob_type) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so + * we need to undo that. */ + _Py_DEC_REFTOTAL; +#endif + /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object + * chain, so no more to do there. + * If COUNT_ALLOCS, the original decref bumped tp_frees, and + * _Py_NewReference bumped tp_allocs: both of those need to be + * undone. + */ +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", +#if PY_VERSION_HEX >= 0x02060000 + T_BOOL, +#else + T_BYTE, +#endif + offsetof(__pyx_GeneratorObject, is_running), + READONLY, + NULL}, + {0, 0, 0, 0, 0} +}; +static PyMethodDef __pyx_Generator_methods[] = { + {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0}, + {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0}, + {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("generator"), /*tp_name*/ + sizeof(__pyx_GeneratorObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_Generator_traverse, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/ + __pyx_Generator_methods, /*tp_methods*/ + __pyx_Generator_memberlist, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_del*/ +#else + __Pyx_Generator_del, /*tp_del*/ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + __Pyx_Generator_del, /*tp_finalize*/ +#endif +}; +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure) { + __pyx_GeneratorObject *gen = + PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type); + if (gen == NULL) + return NULL; + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + gen->exc_type = NULL; + gen->exc_value = NULL; + gen->exc_traceback = NULL; + gen->gi_weakreflist = NULL; + PyObject_GC_Track(gen); + return gen; +} +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (__pyx_GeneratorType == NULL) { + return -1; + } + return 0; +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/VERSION b/cythonized-files3/VERSION new file mode 100644 index 00000000..930e3000 --- /dev/null +++ b/cythonized-files3/VERSION @@ -0,0 +1 @@ +0.14.1 diff --git a/cythonized-files3/pandas/algos.c b/cythonized-files3/pandas/algos.c new file mode 100644 index 00000000..43af3976 --- /dev/null +++ b/cythonized-files3/pandas/algos.c @@ -0,0 +1,185767 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__algos +#define __PYX_HAVE_API__pandas__algos +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "numpy_helper.h" +#include "src/headers/math.h" +#include "math.h" +#include "skiplist.h" +#include "headers/stdint.h" +#include "datetime.h" +#include "datetime_helper.h" +#include "numpy/ndarrayobject.h" +#include "numpy/npy_common.h" +#include "datetime/np_datetime.h" +#include "datetime/np_datetime_strings.h" +#include "khash_python.h" +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "algos.pyx", + "skiplist.pyx", + "generated.pyx", + "join.pyx", + "numpy.pxd", + "util.pxd", + "datetime.pxd", + "stringsource", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; + +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && MSC_VER + #include + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using MSVC atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview) \ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview) \ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#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 + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; + +/* "pandas/src/generated.pyx":27 + * from khash cimport * + * + * ctypedef unsigned char UChar # <<<<<<<<<<<<<< + * + * cimport util + */ +typedef unsigned char __pyx_t_6pandas_5algos_UChar; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_5algos_Node; +struct __pyx_obj_6pandas_5algos_IndexableSkiplist; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_t_6pandas_5algos_pairs; + +/* "pandas/algos.pyx":1392 + * # Rolling median, min, max + * + * ctypedef double_t (* skiplist_f)(object sl, int n, int p) # <<<<<<<<<<<<<< + * + * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op): + */ +typedef __pyx_t_5numpy_double_t (*__pyx_t_6pandas_5algos_skiplist_f)(PyObject *, int, int); + +/* "pandas/algos.pyx":1520 + * # https://github.com/kwgoodman/bottleneck + * + * cdef struct pairs: # <<<<<<<<<<<<<< + * double value + * int death + */ +struct __pyx_t_6pandas_5algos_pairs { + double value; + int death; +}; + +/* "pandas/src/skiplist.pyx":32 + * # TODO: optimize this, make less messy + * + * cdef class Node: # <<<<<<<<<<<<<< + * cdef public: + * double_t value + */ +struct __pyx_obj_6pandas_5algos_Node { + PyObject_HEAD + __pyx_t_5numpy_double_t value; + PyObject *next; + PyObject *width; +}; + + +/* "pandas/src/skiplist.pyx":46 + * NIL = Node(np.inf, [], []) + * + * cdef class IndexableSkiplist: # <<<<<<<<<<<<<< + * ''' + * Sorted collection supporting O(lg n) insertion, removal, and + */ +struct __pyx_obj_6pandas_5algos_IndexableSkiplist { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *__pyx_vtab; + Py_ssize_t size; + Py_ssize_t maxlevels; + struct __pyx_obj_6pandas_5algos_Node *head; +}; + + +/* "View.MemoryView":99 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":269 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":302 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":922 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "pandas/src/skiplist.pyx":46 + * NIL = Node(np.inf, [], []) + * + * cdef class IndexableSkiplist: # <<<<<<<<<<<<<< + * ''' + * Sorted collection supporting O(lg n) insertion, removal, and + */ + +struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist { + PyObject *(*get)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch); + PyObject *(*insert)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch); + PyObject *(*remove)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *__pyx_vtabptr_6pandas_5algos_IndexableSkiplist; + + +/* "View.MemoryView":302 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":922 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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 CYTHON_INLINE 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); + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* proto */ + +static CYTHON_INLINE long __Pyx_mod_long(long, long); /* 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); + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#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); + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/ +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + 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 +} + +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_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 { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +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(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +typedef struct { + __pyx_CyFunctionObject func; + PyObject *__signatures__; + PyObject *type; + PyObject *self; +} __pyx_FusedFunctionObject; +#define __pyx_FusedFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __pyx_FusedFunction_New(__pyx_FusedFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__pyx_FusedFunction_New(PyTypeObject *type, + PyMethodDef *ml, int flags, + PyObject *qualname, PyObject *self, + PyObject *module, PyObject *globals, + PyObject *code); +static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self); +static PyTypeObject *__pyx_FusedFunctionType = NULL; +static int __pyx_FusedFunction_init(void); +#define __Pyx_FusedFunction_USED + +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *); + +static CYTHON_INLINE npy_int16 __Pyx_PyInt_As_npy_int16(PyObject *); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_object(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int8_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int16(npy_int16 value); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int16_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value); + +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint16(npy_uint16 value); + +static CYTHON_INLINE npy_uint16 __Pyx_PyInt_As_npy_uint16(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint16_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_uint16_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value); + +static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint32_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value); + +static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj); /* proto */ + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float32_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_float32_t(const char *itemp, PyObject *obj); /* proto */ + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj); /* proto */ + +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int8_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_int8_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int16_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_int16_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int32_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_int32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int64_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_int64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint8_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_uint8_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint16_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_uint16_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint32_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_uint32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint64_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_uint64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float32_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_float32_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +#define __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float64_t_c(slice) \ + __pyx_memoryview_copy_new_contig(&slice, "c", 1, \ + sizeof(__pyx_t_5numpy_float64_t), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), \ + 0) + +static PyObject *__pyx_memview_get_object(const char *itemp); /* proto */ +static int __pyx_memview_set_object(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, + char order, int ndim); + +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython.view' */ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'util' */ +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *); /*proto*/ + +/* Module declarations from 'skiplist' */ + +/* Module declarations from 'libc' */ + +/* Module declarations from 'datetime' */ + +/* Module declarations from 'datetime' */ +static PyTypeObject *__pyx_ptype_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0; +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'pandas.algos' */ +static PyTypeObject *__pyx_ptype_6pandas_5algos_Node = 0; +static PyTypeObject *__pyx_ptype_6pandas_5algos_IndexableSkiplist = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_FP_ERR; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_REL_TOL; +static __pyx_t_5numpy_int8_t __pyx_v_6pandas_5algos_MINint8; +static __pyx_t_5numpy_int16_t __pyx_v_6pandas_5algos_MINint16; +static __pyx_t_5numpy_int32_t __pyx_v_6pandas_5algos_MINint32; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_MINint64; +static __pyx_t_5numpy_float16_t __pyx_v_6pandas_5algos_MINfloat16; +static __pyx_t_5numpy_float32_t __pyx_v_6pandas_5algos_MINfloat32; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_MINfloat64; +static __pyx_t_5numpy_int8_t __pyx_v_6pandas_5algos_MAXint8; +static __pyx_t_5numpy_int16_t __pyx_v_6pandas_5algos_MAXint16; +static __pyx_t_5numpy_int32_t __pyx_v_6pandas_5algos_MAXint32; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_MAXint64; +static __pyx_t_5numpy_float16_t __pyx_v_6pandas_5algos_MAXfloat16; +static __pyx_t_5numpy_float32_t __pyx_v_6pandas_5algos_MAXfloat32; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5algos_MAXfloat64; +static double __pyx_v_6pandas_5algos_NaN; +static double __pyx_v_6pandas_5algos_nan; +static int __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE; +static int __pyx_v_6pandas_5algos_TIEBREAK_MIN; +static int __pyx_v_6pandas_5algos_TIEBREAK_MAX; +static int __pyx_v_6pandas_5algos_TIEBREAK_FIRST; +static int __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; +static int __pyx_v_6pandas_5algos_TIEBREAK_DENSE; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5algos_iNaT; +static int __pyx_v_6pandas_5algos_PLATFORM_INT; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_max(int, int); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_min(int, int); /*proto*/ +static double __pyx_f_6pandas_5algos_Log2(double); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos__take_2d_float64(PyArrayObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos__take_2d_int64(PyArrayObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos__take_2d_object(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5algos_float64_are_diff(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_are_diff(PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_kth_smallest_c(__pyx_t_5numpy_float64_t *, Py_ssize_t, Py_ssize_t); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos__roll_skiplist_op(PyArrayObject *, int, int, __pyx_t_6pandas_5algos_skiplist_f); /*proto*/ +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_median(PyObject *, int, int); /*proto*/ +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_max(PyObject *, int, int); /*proto*/ +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_min(PyObject *, int, int); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_5algos__median_linear(__pyx_t_5numpy_float64_t *, int); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_platform_int(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_float64(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_float32(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int8(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int16(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int32(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int64(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_object(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_float64(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_float32(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_object(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_int32(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_int64(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_bool(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_0__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int8_t *, __pyx_t_5numpy_int8_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_1__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int16_t *, __pyx_t_5numpy_int16_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_2__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int32_t *, __pyx_t_5numpy_int32_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_3__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_4__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint8_t *, __pyx_t_5numpy_uint8_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_5__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint16_t *, __pyx_t_5numpy_uint16_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_6__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_7__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint64_t *, __pyx_t_5numpy_uint64_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_8__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float32_t *, __pyx_t_5numpy_float32_t *); /*proto*/ +static CYTHON_INLINE Py_ssize_t __pyx_fuse_9__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); /*proto*/ +static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice, Py_ssize_t, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_median(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_Py_ssize_t = { "Py_ssize_t", NULL, sizeof(Py_ssize_t), { 0 }, 0, IS_UNSIGNED(Py_ssize_t) ? 'U' : 'I', IS_UNSIGNED(Py_ssize_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t = { "int16_t", NULL, sizeof(__pyx_t_5numpy_int16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int16_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t = { "uint16_t", NULL, sizeof(__pyx_t_5numpy_uint16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint16_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t = { "uint32_t", NULL, sizeof(__pyx_t_5numpy_uint32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t = { "uint64_t", NULL, sizeof(__pyx_t_5numpy_uint64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint64_t), 0 }; +#define __Pyx_MODULE_NAME "pandas.algos" +int __pyx_module_is_main_pandas__algos = 0; + +/* Implementation of 'pandas.algos' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_ord; +static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_AssertionError; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_xrange; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node___init__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, __pyx_t_5numpy_double_t __pyx_v_value, PyObject *__pyx_v_next, PyObject *__pyx_v_width); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_4Node_5value___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_5value_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_4Node_4next___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_4next_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_4next_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_4Node_5width___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_5width_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_5algos_4Node_5width_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_expected_size); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_rank_1d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_2rank_1d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_4rank_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_6rank_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_8rank_1d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, int __pyx_v_retry, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_10rank_2d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_12_check_minp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_N); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_14kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_16median(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_534__pyx_fuse_0median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_536__pyx_fuse_1median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_538__pyx_fuse_2median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_540__pyx_fuse_3median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_542__pyx_fuse_4median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_544__pyx_fuse_5median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_546__pyx_fuse_6median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_548__pyx_fuse_7median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_550__pyx_fuse_8median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_552__pyx_fuse_9median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_18max_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_20min_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_22roll_sum(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_24roll_mean(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_26ewma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_28nancorr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, PyObject *__pyx_v_cov, PyObject *__pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_30nancorr_spearman(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, Py_ssize_t __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_32roll_var(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, int __pyx_v_ddof); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_34roll_skew(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_36roll_kurt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_38roll_median_c(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_40roll_median_cython(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_42roll_max2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_44roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_46roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_48roll_min2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_50roll_quantile(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, double __pyx_v_quantile); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_52roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_54roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg, int __pyx_v_avg_wgt); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_56is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_58groupby_indices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_60group_labels(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_62groupsort_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, Py_ssize_t __pyx_v_ngroups); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_64group_nth_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_66group_nth_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_68group_last_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_70group_last_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_72group_median(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_74inner_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_76left_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups, PyObject *__pyx_v_sort); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_78full_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_80_get_result_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sorter, PyObject *__pyx_v_indexer); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_82ffill_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_84ffill_by_group(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_group_ids, __pyx_t_5numpy_int64_t __pyx_v_max_group); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_86ensure_platform_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_88ensure_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_90ensure_float32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_92ensure_int8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_94ensure_int16(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_96ensure_int32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_98ensure_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_100ensure_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_102map_indices_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_104map_indices_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_106map_indices_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_108map_indices_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_110map_indices_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_112map_indices_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_114pad_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_116pad_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_118pad_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_120pad_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_122pad_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_124pad_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_126backfill_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_128backfill_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_130backfill_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_132backfill_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_134backfill_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_136backfill_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_138pad_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_140pad_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_142pad_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_144pad_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_146pad_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_148pad_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_150backfill_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_152backfill_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_154backfill_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_156backfill_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_158backfill_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_160backfill_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_166pad_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_186is_monotonic_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_188is_monotonic_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_190is_monotonic_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_192is_monotonic_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_194is_monotonic_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_196is_monotonic_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_198groupby_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_200groupby_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_202groupby_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_204groupby_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_206groupby_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_208groupby_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_210arrmap_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_212arrmap_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_214arrmap_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_216arrmap_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_218arrmap_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_220arrmap_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_222take_1d_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_224take_1d_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_226take_1d_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_228take_1d_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_230take_1d_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_232take_1d_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_234take_1d_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_236take_1d_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_238take_1d_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_240take_1d_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_242take_1d_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_244take_1d_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_246take_1d_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_248take_1d_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_250take_1d_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_252take_1d_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_254take_1d_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_256take_1d_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_258take_1d_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_372take_2d_multi_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_374diff_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_376diff_2d_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_378diff_2d_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_380diff_2d_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_382diff_2d_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_384diff_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_386group_last_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_388group_last_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_390group_last_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_392group_last_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_394group_nth_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_396group_nth_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_398group_nth_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_400group_nth_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_402group_add_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_404group_add_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_406group_add_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_408group_add_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_410group_prod_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_412group_prod_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_414group_prod_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_416group_prod_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_418group_var_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_420group_var_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_422group_var_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_424group_var_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_426group_mean_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_428group_mean_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_430group_mean_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_432group_mean_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_434group_min_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_436group_min_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_438group_min_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_440group_min_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_442group_max_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_444group_max_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_446group_max_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_448group_max_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_450group_ohlc_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_452group_ohlc_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_454group_count_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_456group_count_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_458group_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_460group_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_462group_count_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_464group_count_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_466group_count_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_468group_count_bin_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_480left_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_482left_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_484left_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_486left_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_488left_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_490outer_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_492outer_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_494outer_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_496outer_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_498outer_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_500inner_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_502inner_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_504inner_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_506inner_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static PyObject *__pyx_pf_6pandas_5algos_508inner_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6pandas_5algos_Node(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5algos_IndexableSkiplist(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_A[] = "A"; +static char __pyx_k_B[] = "B"; +static char __pyx_k_C[] = "C"; +static char __pyx_k_D[] = "D"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_K[] = "K"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_N[] = "N"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_R[] = "R"; +static char __pyx_k_S[] = "S"; +static char __pyx_k_T[] = "T"; +static char __pyx_k_a[] = "a"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_c[] = "c"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_e[] = "e"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_m[] = "m"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_o[] = "o"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_s[] = "s"; +static char __pyx_k_u[] = "u"; +static char __pyx_k_v[] = "v"; +static char __pyx_k_w[] = "w"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k_z[] = "z"; +static char __pyx_k_NA[] = "NA"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_ai[] = "ai"; +static char __pyx_k_as[] = "_as"; +static char __pyx_k_ct[] = "ct"; +static char __pyx_k_eq[] = "__eq__"; +static char __pyx_k_f8[] = "f8"; +static char __pyx_k_fv[] = "fv"; +static char __pyx_k_ge[] = "__ge__"; +static char __pyx_k_gt[] = "__gt__"; +static char __pyx_k_i0[] = "i0"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_id[] = "id"; +static char __pyx_k_lc[] = "lc"; +static char __pyx_k_le[] = "__le__"; +static char __pyx_k_lt[] = "__lt__"; +static char __pyx_k_n0[] = "n0"; +static char __pyx_k_ne[] = "__ne__"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_rc[] = "rc"; +static char __pyx_k_sl[] = "sl"; +static char __pyx_k_sx[] = "sx"; +static char __pyx_k_sy[] = "sy"; +static char __pyx_k_vx[] = "vx"; +static char __pyx_k_vy[] = "vy"; +static char __pyx_k_xi[] = "xi"; +static char __pyx_k_xx[] = "xx"; +static char __pyx_k_yi[] = "yi"; +static char __pyx_k_NIL[] = "NIL"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k__32[] = "()"; +static char __pyx_k__34[] = "|"; +static char __pyx_k_adj[] = "adj"; +static char __pyx_k_arg[] = "arg"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_avg[] = "avg"; +static char __pyx_k_buf[] = "buf"; +static char __pyx_k_cmp[] = "__cmp__"; +static char __pyx_k_com[] = "com"; +static char __pyx_k_cov[] = "cov"; +static char __pyx_k_cur[] = "cur"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_dim[] = "dim"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_gid[] = "gid"; +static char __pyx_k_ids[] = "ids"; +static char __pyx_k_idx[] = "idx"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_int[] = "int_"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_lab[] = "lab"; +static char __pyx_k_lib[] = "lib"; +static char __pyx_k_lim[] = "lim"; +static char __pyx_k_loc[] = "loc"; +static char __pyx_k_mat[] = "mat"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_new[] = "new"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_old[] = "old"; +static char __pyx_k_ord[] = "ord"; +static char __pyx_k_out[] = "out"; +static char __pyx_k_pct[] = "pct"; +static char __pyx_k_pre[] = "pre"; +static char __pyx_k_ptr[] = "ptr"; +static char __pyx_k_put[] = "put"; +static char __pyx_k_res[] = "res"; +static char __pyx_k_ret[] = "ret"; +static char __pyx_k_rev[] = "rev"; +static char __pyx_k_top[] = "top"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_win[] = "win"; +static char __pyx_k_xxx[] = "xxx"; +static char __pyx_k_zip[] = "zip"; +static char __pyx_k_NINF[] = "NINF"; +static char __pyx_k_aold[] = "aold"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_axis[] = "axis"; +static char __pyx_k_base[] = "base"; +static char __pyx_k_bins[] = "bins"; +static char __pyx_k_copy[] = "copy"; +static char __pyx_k_data[] = "data"; +static char __pyx_k_ddof[] = "ddof"; +static char __pyx_k_dims[] = "dims"; +static char __pyx_k_dups[] = "dups"; +static char __pyx_k_ewma[] = "ewma"; +static char __pyx_k_fill[] = "fill"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_idx0[] = "idx0"; +static char __pyx_k_idx1[] = "idx1"; +static char __pyx_k_in_i[] = "in_i"; +static char __pyx_k_in_k[] = "in_k"; +static char __pyx_k_in_n[] = "in_n"; +static char __pyx_k_infs[] = "infs"; +static char __pyx_k_int8[] = "int8"; +static char __pyx_k_keep[] = "keep"; +static char __pyx_k_kind[] = "kind"; +static char __pyx_k_last[] = "last"; +static char __pyx_k_left[] = "left"; +static char __pyx_k_lval[] = "lval"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mask[] = "mask"; +static char __pyx_k_maxx[] = "maxx"; +static char __pyx_k_mean[] = "mean"; +static char __pyx_k_minp[] = "minp"; +static char __pyx_k_minx[] = "minx"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_name[] = "name"; +static char __pyx_k_ndim[] = "ndim"; +static char __pyx_k_neww[] = "neww"; +static char __pyx_k_next[] = "next"; +static char __pyx_k_nobs[] = "nobs"; +static char __pyx_k_oldw[] = "oldw"; +static char __pyx_k_pack[] = "pack"; +static char __pyx_k_prev[] = "prev"; +static char __pyx_k_rank[] = "rank"; +static char __pyx_k_resx[] = "resx"; +static char __pyx_k_ring[] = "ring"; +static char __pyx_k_rval[] = "rval"; +static char __pyx_k_seen[] = "seen"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_size[] = "size"; +static char __pyx_k_sort[] = "sort"; +static char __pyx_k_step[] = "step"; +static char __pyx_k_stop[] = "stop"; +static char __pyx_k_sumx[] = "sumx"; +static char __pyx_k_sumy[] = "sumy"; +static char __pyx_k_take[] = "take"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_vecs[] = "vecs"; +static char __pyx_k_view[] = "view"; +static char __pyx_k_vlow[] = "vlow"; +static char __pyx_k_xxxx[] = "xxxx"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_array[] = "array"; +static char __pyx_k_class[] = "__class__"; +static char __pyx_k_count[] = "count"; +static char __pyx_k_delta[] = "delta"; +static char __pyx_k_dense[] = "dense"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_error[] = "error"; +static char __pyx_k_first[] = "first"; +static char __pyx_k_flags[] = "flags"; +static char __pyx_k_iinfo[] = "iinfo"; +static char __pyx_k_index[] = "index"; +static char __pyx_k_input[] = "input"; +static char __pyx_k_int16[] = "int16"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_isnan[] = "isnan"; +static char __pyx_k_label[] = "label"; +static char __pyx_k_limit[] = "limit"; +static char __pyx_k_meanx[] = "meanx"; +static char __pyx_k_meany[] = "meany"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_nbins[] = "nbins"; +static char __pyx_k_nleft[] = "nleft"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_other[] = "other"; +static char __pyx_k_prodx[] = "prodx"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_ranks[] = "ranks"; +static char __pyx_k_retry[] = "retry"; +static char __pyx_k_right[] = "right"; +static char __pyx_k_shape[] = "shape"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_start[] = "start"; +static char __pyx_k_strip[] = "strip"; +static char __pyx_k_sum_x[] = "sum_x"; +static char __pyx_k_sumxx[] = "sumxx"; +static char __pyx_k_sumyy[] = "sumyy"; +static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_vhigh[] = "vhigh"; +static char __pyx_k_vopen[] = "vopen"; +static char __pyx_k_where[] = "where"; +static char __pyx_k_width[] = "width"; +static char __pyx_k_win_i[] = "win_i"; +static char __pyx_k_win_k[] = "win_k"; +static char __pyx_k_win_n[] = "win_n"; +static char __pyx_k_zeros[] = "zeros"; +static char __pyx_k_adjust[] = "adjust"; +static char __pyx_k_arange[] = "arange"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_bufarr[] = "bufarr"; +static char __pyx_k_counts[] = "counts"; +static char __pyx_k_format[] = "format"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_in_arr[] = "in_arr"; +static char __pyx_k_insert[] = "insert"; +static char __pyx_k_int8_t[] = "int8_t"; +static char __pyx_k_kwargs[] = "kwargs"; +static char __pyx_k_labels[] = "labels"; +static char __pyx_k_lambda[] = ""; +static char __pyx_k_length[] = "length"; +static char __pyx_k_mean_x[] = "mean_x"; +static char __pyx_k_median[] = "median"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_name_2[] = "__name__"; +static char __pyx_k_neg_ct[] = "neg_ct"; +static char __pyx_k_nright[] = "nright"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_offset[] = "offset"; +static char __pyx_k_oldbuf[] = "oldbuf"; +static char __pyx_k_output[] = "output"; +static char __pyx_k_pandas[] = "pandas"; +static char __pyx_k_random[] = "random"; +static char __pyx_k_remove[] = "remove"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_sorter[] = "sorter"; +static char __pyx_k_struct[] = "struct"; +static char __pyx_k_unpack[] = "unpack"; +static char __pyx_k_val_in[] = "val_in"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_vclose[] = "vclose"; +static char __pyx_k_window[] = "window"; +static char __pyx_k_xrange[] = "xrange"; +static char __pyx_k_argsort[] = "argsort"; +static char __pyx_k_asarray[] = "asarray"; +static char __pyx_k_average[] = "average"; +static char __pyx_k_avg_wgt[] = "avg_wgt"; +static char __pyx_k_divisor[] = "divisor"; +static char __pyx_k_float16[] = "float16"; +static char __pyx_k_float32[] = "float32"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_fortran[] = "fortran"; +static char __pyx_k_indexer[] = "indexer"; +static char __pyx_k_int16_t[] = "int16_t"; +static char __pyx_k_int32_t[] = "int32_t"; +static char __pyx_k_int64_t[] = "int64_t"; +static char __pyx_k_keep_na[] = "keep_na"; +static char __pyx_k_maskedx[] = "maskedx"; +static char __pyx_k_maskedy[] = "maskedy"; +static char __pyx_k_members[] = "members"; +static char __pyx_k_memview[] = "memview"; +static char __pyx_k_minpair[] = "minpair"; +static char __pyx_k_nancorr[] = "nancorr"; +static char __pyx_k_ndarray[] = "ndarray"; +static char __pyx_k_ngroups[] = "ngroups"; +static char __pyx_k_nlevels[] = "nlevels"; +static char __pyx_k_nonzero[] = "nonzero"; +static char __pyx_k_periods[] = "periods"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_putmask[] = "putmask"; +static char __pyx_k_reverse[] = "reverse"; +static char __pyx_k_ssqdm_x[] = "ssqdm_x"; +static char __pyx_k_tot_wgt[] = "tot_wgt"; +static char __pyx_k_uint8_t[] = "uint8_t"; +static char __pyx_k_val_win[] = "val_win"; +static char __pyx_k_weights[] = "weights"; +static char __pyx_k_Ellipsis[] = "Ellipsis"; +static char __pyx_k_Infinity[] = "Infinity"; +static char __pyx_k_KeyError[] = "KeyError"; +static char __pyx_k_counts_2[] = "_counts"; +static char __pyx_k_datetime[] = "datetime"; +static char __pyx_k_defaults[] = "defaults"; +static char __pyx_k_isfinite[] = "isfinite"; +static char __pyx_k_itemsize[] = "itemsize"; +static char __pyx_k_last_obs[] = "last_obs"; +static char __pyx_k_left_pos[] = "left_pos"; +static char __pyx_k_lindexer[] = "lindexer"; +static char __pyx_k_midpoint[] = "midpoint"; +static char __pyx_k_object_2[] = "object_"; +static char __pyx_k_pad_bool[] = "pad_bool"; +static char __pyx_k_position[] = "position"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_quantile[] = "quantile"; +static char __pyx_k_rindexer[] = "rindexer"; +static char __pyx_k_roll_max[] = "roll_max"; +static char __pyx_k_roll_min[] = "roll_min"; +static char __pyx_k_roll_sum[] = "roll_sum"; +static char __pyx_k_roll_var[] = "roll_var"; +static char __pyx_k_skiplist[] = "skiplist"; +static char __pyx_k_tiebreak[] = "tiebreak"; +static char __pyx_k_uint16_t[] = "uint16_t"; +static char __pyx_k_uint32_t[] = "uint32_t"; +static char __pyx_k_uint64_t[] = "uint64_t"; +static char __pyx_k_Not_Found[] = "Not Found"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_argsorted[] = "argsorted"; +static char __pyx_k_ascending[] = "ascending"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_float32_t[] = "float32_t"; +static char __pyx_k_float64_t[] = "float64_t"; +static char __pyx_k_got_first[] = "got_first"; +static char __pyx_k_group_ids[] = "group_ids"; +static char __pyx_k_is_unique[] = "is_unique"; +static char __pyx_k_isnullobj[] = "isnullobj"; +static char __pyx_k_max_group[] = "max_group"; +static char __pyx_k_mergesort[] = "mergesort"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_na_option[] = "na_option"; +static char __pyx_k_nan_value[] = "nan_value"; +static char __pyx_k_ones_like[] = "ones_like"; +static char __pyx_k_pad_int32[] = "pad_int32"; +static char __pyx_k_pad_int64[] = "pad_int64"; +static char __pyx_k_right_pos[] = "right_pos"; +static char __pyx_k_roll_kurt[] = "roll_kurt"; +static char __pyx_k_roll_max2[] = "roll_max2"; +static char __pyx_k_roll_mean[] = "roll_mean"; +static char __pyx_k_roll_min2[] = "roll_min2"; +static char __pyx_k_roll_skew[] = "roll_skew"; +static char __pyx_k_sum_ranks[] = "sum_ranks"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_check_minp[] = "_check_minp"; +static char __pyx_k_empty_like[] = "empty_like"; +static char __pyx_k_fill_count[] = "fill_count"; +static char __pyx_k_fill_value[] = "fill_value"; +static char __pyx_k_inner_join[] = "inner_join"; +static char __pyx_k_left_count[] = "left_count"; +static char __pyx_k_max_groups[] = "max_groups"; +static char __pyx_k_max_subseq[] = "max_subseq"; +static char __pyx_k_min_subseq[] = "min_subseq"; +static char __pyx_k_pad_object[] = "pad_object"; +static char __pyx_k_pandas_lib[] = "pandas.lib"; +static char __pyx_k_pydatetime[] = "pydatetime"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_signatures[] = "signatures"; +static char __pyx_k_valid_locs[] = "valid_locs"; +static char __pyx_k_zeros_like[] = "zeros_like"; +static char __pyx_k_ImportError[] = "ImportError"; +static char __pyx_k_MemoryError[] = "MemoryError"; +static char __pyx_k_NegInfinity[] = "NegInfinity"; +static char __pyx_k_arrmap_bool[] = "arrmap_bool"; +static char __pyx_k_isnullobj2d[] = "isnullobj2d"; +static char __pyx_k_left_sorter[] = "left_sorter"; +static char __pyx_k_microsecond[] = "microsecond"; +static char __pyx_k_pad_float32[] = "pad_float32"; +static char __pyx_k_pad_float64[] = "pad_float64"; +static char __pyx_k_return_true[] = "_return_true"; +static char __pyx_k_right_count[] = "right_count"; +static char __pyx_k_roll_window[] = "roll_window"; +static char __pyx_k_sorted_data[] = "sorted_data"; +static char __pyx_k_tiebreakers[] = "tiebreakers"; +static char __pyx_k_ties_method[] = "ties_method"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_arrmap_int32[] = "arrmap_int32"; +static char __pyx_k_arrmap_int64[] = "arrmap_int64"; +static char __pyx_k_c_contiguous[] = "c_contiguous"; +static char __pyx_k_diff_2d_int8[] = "diff_2d_int8"; +static char __pyx_k_f_contiguous[] = "f_contiguous"; +static char __pyx_k_group_labels[] = "group_labels"; +static char __pyx_k_group_median[] = "group_median"; +static char __pyx_k_groupby_bool[] = "groupby_bool"; +static char __pyx_k_is_lexsorted[] = "is_lexsorted"; +static char __pyx_k_kth_smallest[] = "kth_smallest"; +static char __pyx_k_left_indexer[] = "left_indexer"; +static char __pyx_k_pandas_algos[] = "pandas.algos"; +static char __pyx_k_return_false[] = "_return_false"; +static char __pyx_k_right_sorter[] = "right_sorter"; +static char __pyx_k_roll_generic[] = "roll_generic"; +static char __pyx_k_arrmap_object[] = "arrmap_object"; +static char __pyx_k_backfill_bool[] = "backfill_bool"; +static char __pyx_k_diff_2d_int16[] = "diff_2d_int16"; +static char __pyx_k_diff_2d_int32[] = "diff_2d_int32"; +static char __pyx_k_diff_2d_int64[] = "diff_2d_int64"; +static char __pyx_k_expected_size[] = "expected_size"; +static char __pyx_k_ffill_indexer[] = "ffill_indexer"; +static char __pyx_k_groupby_int32[] = "groupby_int32"; +static char __pyx_k_groupby_int64[] = "groupby_int64"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_rank_1d_int64[] = "rank_1d_int64"; +static char __pyx_k_rank_2d_int64[] = "rank_2d_int64"; +static char __pyx_k_right_indexer[] = "right_indexer"; +static char __pyx_k_roll_median_c[] = "roll_median_c"; +static char __pyx_k_roll_quantile[] = "roll_quantile"; +static char __pyx_k_AssertionError[] = "AssertionError"; +static char __pyx_k_arrmap_float32[] = "arrmap_float32"; +static char __pyx_k_arrmap_float64[] = "arrmap_float64"; +static char __pyx_k_backfill_int32[] = "backfill_int32"; +static char __pyx_k_backfill_int64[] = "backfill_int64"; +static char __pyx_k_ffill_by_group[] = "ffill_by_group"; +static char __pyx_k_groupby_object[] = "groupby_object"; +static char __pyx_k_list_of_arrays[] = "list_of_arrays"; +static char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static char __pyx_k_backfill_object[] = "backfill_object"; +static char __pyx_k_diff_2d_float32[] = "diff_2d_float32"; +static char __pyx_k_diff_2d_float64[] = "diff_2d_float64"; +static char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static char __pyx_k_full_outer_join[] = "full_outer_join"; +static char __pyx_k_groupby_float32[] = "groupby_float32"; +static char __pyx_k_groupby_float64[] = "groupby_float64"; +static char __pyx_k_groupby_indices[] = "groupby_indices"; +static char __pyx_k_left_outer_join[] = "left_outer_join"; +static char __pyx_k_rank_1d_float64[] = "rank_1d_float64"; +static char __pyx_k_rank_1d_generic[] = "rank_1d_generic"; +static char __pyx_k_rank_2d_float64[] = "rank_2d_float64"; +static char __pyx_k_rank_2d_generic[] = "rank_2d_generic"; +static char __pyx_k_total_tie_count[] = "total_tie_count"; +static char __pyx_k_backfill_float32[] = "backfill_float32"; +static char __pyx_k_backfill_float64[] = "backfill_float64"; +static char __pyx_k_group_nth_object[] = "group_nth_object"; +static char __pyx_k_nancorr_spearman[] = "nancorr_spearman"; +static char __pyx_k_pad_inplace_bool[] = "pad_inplace_bool"; +static char __pyx_k_pyx_fuse_0median[] = "__pyx_fuse_0median"; +static char __pyx_k_pyx_fuse_1median[] = "__pyx_fuse_1median"; +static char __pyx_k_pyx_fuse_2median[] = "__pyx_fuse_2median"; +static char __pyx_k_pyx_fuse_3median[] = "__pyx_fuse_3median"; +static char __pyx_k_pyx_fuse_4median[] = "__pyx_fuse_4median"; +static char __pyx_k_pyx_fuse_5median[] = "__pyx_fuse_5median"; +static char __pyx_k_pyx_fuse_6median[] = "__pyx_fuse_6median"; +static char __pyx_k_pyx_fuse_7median[] = "__pyx_fuse_7median"; +static char __pyx_k_pyx_fuse_8median[] = "__pyx_fuse_8median"; +static char __pyx_k_pyx_fuse_9median[] = "__pyx_fuse_9median"; +static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s"; +static char __pyx_k_group_add_float32[] = "group_add_float32"; +static char __pyx_k_group_add_float64[] = "group_add_float64"; +static char __pyx_k_group_count_int64[] = "group_count_int64"; +static char __pyx_k_group_last_object[] = "group_last_object"; +static char __pyx_k_group_max_float32[] = "group_max_float32"; +static char __pyx_k_group_max_float64[] = "group_max_float64"; +static char __pyx_k_group_min_float32[] = "group_min_float32"; +static char __pyx_k_group_min_float64[] = "group_min_float64"; +static char __pyx_k_group_nth_float32[] = "group_nth_float32"; +static char __pyx_k_group_nth_float64[] = "group_nth_float64"; +static char __pyx_k_group_var_float32[] = "group_var_float32"; +static char __pyx_k_group_var_float64[] = "group_var_float64"; +static char __pyx_k_groupsort_indexer[] = "groupsort_indexer"; +static char __pyx_k_is_monotonic_bool[] = "is_monotonic_bool"; +static char __pyx_k_pad_inplace_int32[] = "pad_inplace_int32"; +static char __pyx_k_pad_inplace_int64[] = "pad_inplace_int64"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_take_1d_bool_bool[] = "take_1d_bool_bool"; +static char __pyx_k_take_1d_int8_int8[] = "take_1d_int8_int8"; +static char __pyx_k_get_result_indexer[] = "_get_result_indexer"; +static char __pyx_k_group_count_object[] = "group_count_object"; +static char __pyx_k_group_last_float32[] = "group_last_float32"; +static char __pyx_k_group_last_float64[] = "group_last_float64"; +static char __pyx_k_group_mean_float32[] = "group_mean_float32"; +static char __pyx_k_group_mean_float64[] = "group_mean_float64"; +static char __pyx_k_group_ohlc_float32[] = "group_ohlc_float32"; +static char __pyx_k_group_ohlc_float64[] = "group_ohlc_float64"; +static char __pyx_k_group_prod_float32[] = "group_prod_float32"; +static char __pyx_k_group_prod_float64[] = "group_prod_float64"; +static char __pyx_k_is_monotonic_int32[] = "is_monotonic_int32"; +static char __pyx_k_is_monotonic_int64[] = "is_monotonic_int64"; +static char __pyx_k_pad_inplace_object[] = "pad_inplace_object"; +static char __pyx_k_roll_median_cython[] = "roll_median_cython"; +static char __pyx_k_strided_and_direct[] = ""; +static char __pyx_k_take_1d_int8_int32[] = "take_1d_int8_int32"; +static char __pyx_k_take_1d_int8_int64[] = "take_1d_int8_int64"; +static char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static char __pyx_k_group_count_float32[] = "group_count_float32"; +static char __pyx_k_group_count_float64[] = "group_count_float64"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_is_monotonic_object[] = "is_monotonic_object"; +static char __pyx_k_pad_2d_inplace_bool[] = "pad_2d_inplace_bool"; +static char __pyx_k_pad_inplace_float32[] = "pad_inplace_float32"; +static char __pyx_k_pad_inplace_float64[] = "pad_inplace_float64"; +static char __pyx_k_pandas_src_join_pyx[] = "pandas/src/join.pyx"; +static char __pyx_k_take_1d_bool_object[] = "take_1d_bool_object"; +static char __pyx_k_take_1d_int16_int16[] = "take_1d_int16_int16"; +static char __pyx_k_take_1d_int16_int32[] = "take_1d_int16_int32"; +static char __pyx_k_take_1d_int16_int64[] = "take_1d_int16_int64"; +static char __pyx_k_take_1d_int32_int32[] = "take_1d_int32_int32"; +static char __pyx_k_take_1d_int32_int64[] = "take_1d_int32_int64"; +static char __pyx_k_take_1d_int64_int64[] = "take_1d_int64_int64"; +static char __pyx_k_group_nth_bin_object[] = "group_nth_bin_object"; +static char __pyx_k_is_monotonic_float32[] = "is_monotonic_float32"; +static char __pyx_k_is_monotonic_float64[] = "is_monotonic_float64"; +static char __pyx_k_len_index_len_labels[] = "len(index) != len(labels)"; +static char __pyx_k_pad_2d_inplace_int32[] = "pad_2d_inplace_int32"; +static char __pyx_k_pad_2d_inplace_int64[] = "pad_2d_inplace_int64"; +static char __pyx_k_strided_and_indirect[] = ""; +static char __pyx_k_take_1d_int8_float64[] = "take_1d_int8_float64"; +static char __pyx_k_Invalid_window_size_d[] = "Invalid window size %d"; +static char __pyx_k_backfill_inplace_bool[] = "backfill_inplace_bool"; +static char __pyx_k_contiguous_and_direct[] = ""; +static char __pyx_k_group_add_bin_float32[] = "group_add_bin_float32"; +static char __pyx_k_group_add_bin_float64[] = "group_add_bin_float64"; +static char __pyx_k_group_count_bin_int64[] = "group_count_bin_int64"; +static char __pyx_k_group_last_bin_object[] = "group_last_bin_object"; +static char __pyx_k_group_max_bin_float32[] = "group_max_bin_float32"; +static char __pyx_k_group_max_bin_float64[] = "group_max_bin_float64"; +static char __pyx_k_group_min_bin_float32[] = "group_min_bin_float32"; +static char __pyx_k_group_min_bin_float64[] = "group_min_bin_float64"; +static char __pyx_k_group_nth_bin_float32[] = "group_nth_bin_float32"; +static char __pyx_k_group_nth_bin_float64[] = "group_nth_bin_float64"; +static char __pyx_k_group_var_bin_float32[] = "group_var_bin_float32"; +static char __pyx_k_group_var_bin_float64[] = "group_var_bin_float64"; +static char __pyx_k_maybe_convert_objects[] = "maybe_convert_objects"; +static char __pyx_k_min_periods_must_be_0[] = "min_periods must be >= 0"; +static char __pyx_k_pad_2d_inplace_object[] = "pad_2d_inplace_object"; +static char __pyx_k_take_1d_int16_float64[] = "take_1d_int16_float64"; +static char __pyx_k_take_1d_int32_float64[] = "take_1d_int32_float64"; +static char __pyx_k_take_1d_int64_float64[] = "take_1d_int64_float64"; +static char __pyx_k_take_1d_object_object[] = "take_1d_object_object"; +static char __pyx_k_MemoryView_of_r_object[] = ""; +static char __pyx_k_backfill_inplace_int32[] = "backfill_inplace_int32"; +static char __pyx_k_backfill_inplace_int64[] = "backfill_inplace_int64"; +static char __pyx_k_group_count_bin_object[] = "group_count_bin_object"; +static char __pyx_k_group_last_bin_float32[] = "group_last_bin_float32"; +static char __pyx_k_group_last_bin_float64[] = "group_last_bin_float64"; +static char __pyx_k_group_mean_bin_float32[] = "group_mean_bin_float32"; +static char __pyx_k_group_mean_bin_float64[] = "group_mean_bin_float64"; +static char __pyx_k_group_prod_bin_float32[] = "group_prod_bin_float32"; +static char __pyx_k_group_prod_bin_float64[] = "group_prod_bin_float64"; +static char __pyx_k_pad_2d_inplace_float32[] = "pad_2d_inplace_float32"; +static char __pyx_k_pad_2d_inplace_float64[] = "pad_2d_inplace_float64"; +static char __pyx_k_pyx_fuse_0kth_smallest[] = "__pyx_fuse_0kth_smallest"; +static char __pyx_k_pyx_fuse_1kth_smallest[] = "__pyx_fuse_1kth_smallest"; +static char __pyx_k_pyx_fuse_2kth_smallest[] = "__pyx_fuse_2kth_smallest"; +static char __pyx_k_pyx_fuse_3kth_smallest[] = "__pyx_fuse_3kth_smallest"; +static char __pyx_k_pyx_fuse_4kth_smallest[] = "__pyx_fuse_4kth_smallest"; +static char __pyx_k_pyx_fuse_5kth_smallest[] = "__pyx_fuse_5kth_smallest"; +static char __pyx_k_pyx_fuse_6kth_smallest[] = "__pyx_fuse_6kth_smallest"; +static char __pyx_k_pyx_fuse_7kth_smallest[] = "__pyx_fuse_7kth_smallest"; +static char __pyx_k_pyx_fuse_8kth_smallest[] = "__pyx_fuse_8kth_smallest"; +static char __pyx_k_pyx_fuse_9kth_smallest[] = "__pyx_fuse_9kth_smallest"; +static char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static char __pyx_k_backfill_inplace_object[] = "backfill_inplace_object"; +static char __pyx_k_contiguous_and_indirect[] = ""; +static char __pyx_k_group_count_bin_float32[] = "group_count_bin_float32"; +static char __pyx_k_group_count_bin_float64[] = "group_count_bin_float64"; +static char __pyx_k_left_join_indexer_int32[] = "left_join_indexer_int32"; +static char __pyx_k_left_join_indexer_int64[] = "left_join_indexer_int64"; +static char __pyx_k_take_1d_float32_float32[] = "take_1d_float32_float32"; +static char __pyx_k_take_1d_float32_float64[] = "take_1d_float32_float64"; +static char __pyx_k_take_1d_float64_float64[] = "take_1d_float64_float64"; +static char __pyx_k_take_2d_axis0_bool_bool[] = "take_2d_axis0_bool_bool"; +static char __pyx_k_take_2d_axis0_int8_int8[] = "take_2d_axis0_int8_int8"; +static char __pyx_k_take_2d_axis1_bool_bool[] = "take_2d_axis1_bool_bool"; +static char __pyx_k_take_2d_axis1_int8_int8[] = "take_2d_axis1_int8_int8"; +static char __pyx_k_take_2d_multi_bool_bool[] = "take_2d_multi_bool_bool"; +static char __pyx_k_take_2d_multi_int8_int8[] = "take_2d_multi_int8_int8"; +static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static char __pyx_k_backfill_2d_inplace_bool[] = "backfill_2d_inplace_bool"; +static char __pyx_k_backfill_inplace_float32[] = "backfill_inplace_float32"; +static char __pyx_k_backfill_inplace_float64[] = "backfill_inplace_float64"; +static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)"; +static char __pyx_k_inner_join_indexer_int32[] = "inner_join_indexer_int32"; +static char __pyx_k_inner_join_indexer_int64[] = "inner_join_indexer_int64"; +static char __pyx_k_left_join_indexer_object[] = "left_join_indexer_object"; +static char __pyx_k_outer_join_indexer_int32[] = "outer_join_indexer_int32"; +static char __pyx_k_outer_join_indexer_int64[] = "outer_join_indexer_int64"; +static char __pyx_k_pandas_src_generated_pyx[] = "pandas/src/generated.pyx"; +static char __pyx_k_take_2d_axis0_int8_int32[] = "take_2d_axis0_int8_int32"; +static char __pyx_k_take_2d_axis0_int8_int64[] = "take_2d_axis0_int8_int64"; +static char __pyx_k_take_2d_axis1_int8_int32[] = "take_2d_axis1_int8_int32"; +static char __pyx_k_take_2d_axis1_int8_int64[] = "take_2d_axis1_int8_int64"; +static char __pyx_k_take_2d_multi_int8_int32[] = "take_2d_multi_int8_int32"; +static char __pyx_k_take_2d_multi_int8_int64[] = "take_2d_multi_int8_int64"; +static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct"; +static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static char __pyx_k_backfill_2d_inplace_int32[] = "backfill_2d_inplace_int32"; +static char __pyx_k_backfill_2d_inplace_int64[] = "backfill_2d_inplace_int64"; +static char __pyx_k_inner_join_indexer_object[] = "inner_join_indexer_object"; +static char __pyx_k_left_join_indexer_float32[] = "left_join_indexer_float32"; +static char __pyx_k_left_join_indexer_float64[] = "left_join_indexer_float64"; +static char __pyx_k_outer_join_indexer_object[] = "outer_join_indexer_object"; +static char __pyx_k_take_2d_axis0_bool_object[] = "take_2d_axis0_bool_object"; +static char __pyx_k_take_2d_axis0_int16_int16[] = "take_2d_axis0_int16_int16"; +static char __pyx_k_take_2d_axis0_int16_int32[] = "take_2d_axis0_int16_int32"; +static char __pyx_k_take_2d_axis0_int16_int64[] = "take_2d_axis0_int16_int64"; +static char __pyx_k_take_2d_axis0_int32_int32[] = "take_2d_axis0_int32_int32"; +static char __pyx_k_take_2d_axis0_int32_int64[] = "take_2d_axis0_int32_int64"; +static char __pyx_k_take_2d_axis0_int64_int64[] = "take_2d_axis0_int64_int64"; +static char __pyx_k_take_2d_axis1_bool_object[] = "take_2d_axis1_bool_object"; +static char __pyx_k_take_2d_axis1_int16_int16[] = "take_2d_axis1_int16_int16"; +static char __pyx_k_take_2d_axis1_int16_int32[] = "take_2d_axis1_int16_int32"; +static char __pyx_k_take_2d_axis1_int16_int64[] = "take_2d_axis1_int16_int64"; +static char __pyx_k_take_2d_axis1_int32_int32[] = "take_2d_axis1_int32_int32"; +static char __pyx_k_take_2d_axis1_int32_int64[] = "take_2d_axis1_int32_int64"; +static char __pyx_k_take_2d_axis1_int64_int64[] = "take_2d_axis1_int64_int64"; +static char __pyx_k_take_2d_multi_bool_object[] = "take_2d_multi_bool_object"; +static char __pyx_k_take_2d_multi_int16_int16[] = "take_2d_multi_int16_int16"; +static char __pyx_k_take_2d_multi_int16_int32[] = "take_2d_multi_int16_int32"; +static char __pyx_k_take_2d_multi_int16_int64[] = "take_2d_multi_int16_int64"; +static char __pyx_k_take_2d_multi_int32_int32[] = "take_2d_multi_int32_int32"; +static char __pyx_k_take_2d_multi_int32_int64[] = "take_2d_multi_int32_int64"; +static char __pyx_k_take_2d_multi_int64_int64[] = "take_2d_multi_int64_int64"; +static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)"; +static char __pyx_k_Limit_must_be_non_negative[] = "Limit must be non-negative"; +static char __pyx_k_backfill_2d_inplace_object[] = "backfill_2d_inplace_object"; +static char __pyx_k_inner_join_indexer_float32[] = "inner_join_indexer_float32"; +static char __pyx_k_inner_join_indexer_float64[] = "inner_join_indexer_float64"; +static char __pyx_k_outer_join_indexer_float32[] = "outer_join_indexer_float32"; +static char __pyx_k_outer_join_indexer_float64[] = "outer_join_indexer_float64"; +static char __pyx_k_take_2d_axis0_int8_float64[] = "take_2d_axis0_int8_float64"; +static char __pyx_k_take_2d_axis1_int8_float64[] = "take_2d_axis1_int8_float64"; +static char __pyx_k_take_2d_multi_int8_float64[] = "take_2d_multi_int8_float64"; +static char __pyx_k_No_matching_signature_found[] = "No matching signature found"; +static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)"; +static char __pyx_k_backfill_2d_inplace_float32[] = "backfill_2d_inplace_float32"; +static char __pyx_k_backfill_2d_inplace_float64[] = "backfill_2d_inplace_float64"; +static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_take_2d_axis0_int16_float64[] = "take_2d_axis0_int16_float64"; +static char __pyx_k_take_2d_axis0_int32_float64[] = "take_2d_axis0_int32_float64"; +static char __pyx_k_take_2d_axis0_int64_float64[] = "take_2d_axis0_int64_float64"; +static char __pyx_k_take_2d_axis0_object_object[] = "take_2d_axis0_object_object"; +static char __pyx_k_take_2d_axis1_int16_float64[] = "take_2d_axis1_int16_float64"; +static char __pyx_k_take_2d_axis1_int32_float64[] = "take_2d_axis1_int32_float64"; +static char __pyx_k_take_2d_axis1_int64_float64[] = "take_2d_axis1_int64_float64"; +static char __pyx_k_take_2d_axis1_object_object[] = "take_2d_axis1_object_object"; +static char __pyx_k_take_2d_multi_int16_float64[] = "take_2d_multi_int16_float64"; +static char __pyx_k_take_2d_multi_int32_float64[] = "take_2d_multi_int32_float64"; +static char __pyx_k_take_2d_multi_int64_float64[] = "take_2d_multi_int64_float64"; +static char __pyx_k_take_2d_multi_object_object[] = "take_2d_multi_object_object"; +static char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments"; +static char __pyx_k_take_2d_axis0_float32_float32[] = "take_2d_axis0_float32_float32"; +static char __pyx_k_take_2d_axis0_float32_float64[] = "take_2d_axis0_float32_float64"; +static char __pyx_k_take_2d_axis0_float64_float64[] = "take_2d_axis0_float64_float64"; +static char __pyx_k_take_2d_axis1_float32_float32[] = "take_2d_axis1_float32_float32"; +static char __pyx_k_take_2d_axis1_float32_float64[] = "take_2d_axis1_float32_float64"; +static char __pyx_k_take_2d_axis1_float64_float64[] = "take_2d_axis1_float64_float64"; +static char __pyx_k_take_2d_multi_float32_float32[] = "take_2d_multi_float32_float32"; +static char __pyx_k_take_2d_multi_float32_float64[] = "take_2d_multi_float32_float64"; +static char __pyx_k_take_2d_multi_float64_float64[] = "take_2d_multi_float64_float64"; +static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static char __pyx_k_left_join_indexer_unique_int32[] = "left_join_indexer_unique_int32"; +static char __pyx_k_left_join_indexer_unique_int64[] = "left_join_indexer_unique_int64"; +static char __pyx_k_min_periods_d_must_be_window_d[] = "min_periods (%d) must be <= window (%d)"; +static char __pyx_k_strided_and_direct_or_indirect[] = ""; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/algos.pyx"; +static char __pyx_k_left_join_indexer_unique_object[] = "left_join_indexer_unique_object"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; +static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions"; +static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types"; +static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static char __pyx_k_Invalid_min_periods_size_d_great[] = "Invalid min_periods size %d greater than window %d"; +static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static char __pyx_k_Output_array_must_have_4_columns[] = "Output array must have 4 columns"; +static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static char __pyx_k_first_not_supported_for_non_nume[] = "first not supported for non-numeric data"; +static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static char __pyx_k_left_join_indexer_unique_float32[] = "left_join_indexer_unique_float32"; +static char __pyx_k_left_join_indexer_unique_float64[] = "left_join_indexer_unique_float64"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_A; +static PyObject *__pyx_n_s_AssertionError; +static PyObject *__pyx_n_s_B; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_n_s_C; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_D; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_kp_s_Expected_at_least_d_arguments; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_n_s_Infinity; +static PyObject *__pyx_kp_s_Invalid_min_periods_size_d_great; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_kp_s_Invalid_window_size_d; +static PyObject *__pyx_n_s_K; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_kp_s_Limit_must_be_non_negative; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_N; +static PyObject *__pyx_n_s_NA; +static PyObject *__pyx_n_s_NIL; +static PyObject *__pyx_n_s_NINF; +static PyObject *__pyx_n_s_NaN; +static PyObject *__pyx_n_s_NegInfinity; +static PyObject *__pyx_kp_s_No_matching_signature_found; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_kp_s_Not_Found; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_n_s_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_kp_s_Output_array_must_have_4_columns; +static PyObject *__pyx_n_s_R; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_S; +static PyObject *__pyx_n_s_T; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_kp_s_Unable_to_parse_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s__32; +static PyObject *__pyx_kp_s__34; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_adj; +static PyObject *__pyx_n_s_adjust; +static PyObject *__pyx_n_s_ai; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_aold; +static PyObject *__pyx_n_s_arange; +static PyObject *__pyx_n_s_arg; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_argsort; +static PyObject *__pyx_n_s_argsorted; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_arrmap_bool; +static PyObject *__pyx_n_s_arrmap_float32; +static PyObject *__pyx_n_s_arrmap_float64; +static PyObject *__pyx_n_s_arrmap_int32; +static PyObject *__pyx_n_s_arrmap_int64; +static PyObject *__pyx_n_s_arrmap_object; +static PyObject *__pyx_n_s_as; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_ascending; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_average; +static PyObject *__pyx_n_s_avg; +static PyObject *__pyx_n_s_avg_wgt; +static PyObject *__pyx_n_s_axis; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_backfill_2d_inplace_bool; +static PyObject *__pyx_n_s_backfill_2d_inplace_float32; +static PyObject *__pyx_n_s_backfill_2d_inplace_float64; +static PyObject *__pyx_n_s_backfill_2d_inplace_int32; +static PyObject *__pyx_n_s_backfill_2d_inplace_int64; +static PyObject *__pyx_n_s_backfill_2d_inplace_object; +static PyObject *__pyx_n_s_backfill_bool; +static PyObject *__pyx_n_s_backfill_float32; +static PyObject *__pyx_n_s_backfill_float64; +static PyObject *__pyx_n_s_backfill_inplace_bool; +static PyObject *__pyx_n_s_backfill_inplace_float32; +static PyObject *__pyx_n_s_backfill_inplace_float64; +static PyObject *__pyx_n_s_backfill_inplace_int32; +static PyObject *__pyx_n_s_backfill_inplace_int64; +static PyObject *__pyx_n_s_backfill_inplace_object; +static PyObject *__pyx_n_s_backfill_int32; +static PyObject *__pyx_n_s_backfill_int64; +static PyObject *__pyx_n_s_backfill_object; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_bins; +static PyObject *__pyx_n_s_buf; +static PyObject *__pyx_n_s_bufarr; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_c_contiguous; +static PyObject *__pyx_n_s_check_minp; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cmp; +static PyObject *__pyx_n_s_com; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_counts; +static PyObject *__pyx_n_s_counts_2; +static PyObject *__pyx_n_s_cov; +static PyObject *__pyx_n_s_ct; +static PyObject *__pyx_n_s_cur; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_ddof; +static PyObject *__pyx_n_s_defaults; +static PyObject *__pyx_n_s_delta; +static PyObject *__pyx_n_s_dense; +static PyObject *__pyx_n_s_diff_2d_float32; +static PyObject *__pyx_n_s_diff_2d_float64; +static PyObject *__pyx_n_s_diff_2d_int16; +static PyObject *__pyx_n_s_diff_2d_int32; +static PyObject *__pyx_n_s_diff_2d_int64; +static PyObject *__pyx_n_s_diff_2d_int8; +static PyObject *__pyx_n_s_dim; +static PyObject *__pyx_n_s_dims; +static PyObject *__pyx_n_s_divisor; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_dups; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_empty_like; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_eq; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_ewma; +static PyObject *__pyx_n_s_expected_size; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_f8; +static PyObject *__pyx_n_s_f_contiguous; +static PyObject *__pyx_n_s_ffill_by_group; +static PyObject *__pyx_n_s_ffill_indexer; +static PyObject *__pyx_n_s_fill; +static PyObject *__pyx_n_s_fill_count; +static PyObject *__pyx_n_s_fill_value; +static PyObject *__pyx_n_s_first; +static PyObject *__pyx_kp_s_first_not_supported_for_non_nume; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float16; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_float32_t; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_float64_t; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_full_outer_join; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_fv; +static PyObject *__pyx_n_s_ge; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_result_indexer; +static PyObject *__pyx_n_s_gid; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_got_first; +static PyObject *__pyx_n_s_group_add_bin_float32; +static PyObject *__pyx_n_s_group_add_bin_float64; +static PyObject *__pyx_n_s_group_add_float32; +static PyObject *__pyx_n_s_group_add_float64; +static PyObject *__pyx_n_s_group_count_bin_float32; +static PyObject *__pyx_n_s_group_count_bin_float64; +static PyObject *__pyx_n_s_group_count_bin_int64; +static PyObject *__pyx_n_s_group_count_bin_object; +static PyObject *__pyx_n_s_group_count_float32; +static PyObject *__pyx_n_s_group_count_float64; +static PyObject *__pyx_n_s_group_count_int64; +static PyObject *__pyx_n_s_group_count_object; +static PyObject *__pyx_n_s_group_ids; +static PyObject *__pyx_n_s_group_labels; +static PyObject *__pyx_n_s_group_last_bin_float32; +static PyObject *__pyx_n_s_group_last_bin_float64; +static PyObject *__pyx_n_s_group_last_bin_object; +static PyObject *__pyx_n_s_group_last_float32; +static PyObject *__pyx_n_s_group_last_float64; +static PyObject *__pyx_n_s_group_last_object; +static PyObject *__pyx_n_s_group_max_bin_float32; +static PyObject *__pyx_n_s_group_max_bin_float64; +static PyObject *__pyx_n_s_group_max_float32; +static PyObject *__pyx_n_s_group_max_float64; +static PyObject *__pyx_n_s_group_mean_bin_float32; +static PyObject *__pyx_n_s_group_mean_bin_float64; +static PyObject *__pyx_n_s_group_mean_float32; +static PyObject *__pyx_n_s_group_mean_float64; +static PyObject *__pyx_n_s_group_median; +static PyObject *__pyx_n_s_group_min_bin_float32; +static PyObject *__pyx_n_s_group_min_bin_float64; +static PyObject *__pyx_n_s_group_min_float32; +static PyObject *__pyx_n_s_group_min_float64; +static PyObject *__pyx_n_s_group_nth_bin_float32; +static PyObject *__pyx_n_s_group_nth_bin_float64; +static PyObject *__pyx_n_s_group_nth_bin_object; +static PyObject *__pyx_n_s_group_nth_float32; +static PyObject *__pyx_n_s_group_nth_float64; +static PyObject *__pyx_n_s_group_nth_object; +static PyObject *__pyx_n_s_group_ohlc_float32; +static PyObject *__pyx_n_s_group_ohlc_float64; +static PyObject *__pyx_n_s_group_prod_bin_float32; +static PyObject *__pyx_n_s_group_prod_bin_float64; +static PyObject *__pyx_n_s_group_prod_float32; +static PyObject *__pyx_n_s_group_prod_float64; +static PyObject *__pyx_n_s_group_var_bin_float32; +static PyObject *__pyx_n_s_group_var_bin_float64; +static PyObject *__pyx_n_s_group_var_float32; +static PyObject *__pyx_n_s_group_var_float64; +static PyObject *__pyx_n_s_groupby_bool; +static PyObject *__pyx_n_s_groupby_float32; +static PyObject *__pyx_n_s_groupby_float64; +static PyObject *__pyx_n_s_groupby_indices; +static PyObject *__pyx_n_s_groupby_int32; +static PyObject *__pyx_n_s_groupby_int64; +static PyObject *__pyx_n_s_groupby_object; +static PyObject *__pyx_n_s_groupsort_indexer; +static PyObject *__pyx_n_s_gt; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_i0; +static PyObject *__pyx_n_s_i8; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_ids; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_idx0; +static PyObject *__pyx_n_s_idx1; +static PyObject *__pyx_n_s_iinfo; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_in_arr; +static PyObject *__pyx_n_s_in_i; +static PyObject *__pyx_n_s_in_k; +static PyObject *__pyx_n_s_in_n; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_indexer; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_infs; +static PyObject *__pyx_n_s_inner_join; +static PyObject *__pyx_n_s_inner_join_indexer_float32; +static PyObject *__pyx_n_s_inner_join_indexer_float64; +static PyObject *__pyx_n_s_inner_join_indexer_int32; +static PyObject *__pyx_n_s_inner_join_indexer_int64; +static PyObject *__pyx_n_s_inner_join_indexer_object; +static PyObject *__pyx_n_s_input; +static PyObject *__pyx_n_s_insert; +static PyObject *__pyx_n_s_int; +static PyObject *__pyx_n_s_int16; +static PyObject *__pyx_n_s_int16_t; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int32_t; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_int64_t; +static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_int8_t; +static PyObject *__pyx_n_s_is_lexsorted; +static PyObject *__pyx_n_s_is_monotonic_bool; +static PyObject *__pyx_n_s_is_monotonic_float32; +static PyObject *__pyx_n_s_is_monotonic_float64; +static PyObject *__pyx_n_s_is_monotonic_int32; +static PyObject *__pyx_n_s_is_monotonic_int64; +static PyObject *__pyx_n_s_is_monotonic_object; +static PyObject *__pyx_n_s_is_unique; +static PyObject *__pyx_n_s_isfinite; +static PyObject *__pyx_n_s_isnan; +static PyObject *__pyx_n_s_isnullobj; +static PyObject *__pyx_n_s_isnullobj2d; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_keep; +static PyObject *__pyx_n_s_keep_na; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_kind; +static PyObject *__pyx_n_s_kth_smallest; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lab; +static PyObject *__pyx_n_s_label; +static PyObject *__pyx_n_s_labels; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_last; +static PyObject *__pyx_n_s_last_obs; +static PyObject *__pyx_n_s_lc; +static PyObject *__pyx_n_s_le; +static PyObject *__pyx_n_s_left; +static PyObject *__pyx_n_s_left_count; +static PyObject *__pyx_n_s_left_indexer; +static PyObject *__pyx_n_s_left_join_indexer_float32; +static PyObject *__pyx_n_s_left_join_indexer_float64; +static PyObject *__pyx_n_s_left_join_indexer_int32; +static PyObject *__pyx_n_s_left_join_indexer_int64; +static PyObject *__pyx_n_s_left_join_indexer_object; +static PyObject *__pyx_n_s_left_join_indexer_unique_float32; +static PyObject *__pyx_n_s_left_join_indexer_unique_float64; +static PyObject *__pyx_n_s_left_join_indexer_unique_int32; +static PyObject *__pyx_n_s_left_join_indexer_unique_int64; +static PyObject *__pyx_n_s_left_join_indexer_unique_object; +static PyObject *__pyx_n_s_left_outer_join; +static PyObject *__pyx_n_s_left_pos; +static PyObject *__pyx_n_s_left_sorter; +static PyObject *__pyx_kp_s_len_index_len_labels; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_lib; +static PyObject *__pyx_n_s_lim; +static PyObject *__pyx_n_s_limit; +static PyObject *__pyx_n_s_lindexer; +static PyObject *__pyx_n_s_list_of_arrays; +static PyObject *__pyx_n_s_loc; +static PyObject *__pyx_n_s_lt; +static PyObject *__pyx_n_s_lval; +static PyObject *__pyx_n_s_m; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mask; +static PyObject *__pyx_n_s_maskedx; +static PyObject *__pyx_n_s_maskedy; +static PyObject *__pyx_n_s_mat; +static PyObject *__pyx_n_s_max; +static PyObject *__pyx_n_s_max_group; +static PyObject *__pyx_n_s_max_groups; +static PyObject *__pyx_n_s_max_subseq; +static PyObject *__pyx_n_s_maxx; +static PyObject *__pyx_n_s_maybe_convert_objects; +static PyObject *__pyx_n_s_mean; +static PyObject *__pyx_n_s_mean_x; +static PyObject *__pyx_n_s_meanx; +static PyObject *__pyx_n_s_meany; +static PyObject *__pyx_n_s_median; +static PyObject *__pyx_n_s_members; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mergesort; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_microsecond; +static PyObject *__pyx_n_s_midpoint; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_kp_s_min_periods_d_must_be_window_d; +static PyObject *__pyx_kp_s_min_periods_must_be_0; +static PyObject *__pyx_n_s_min_subseq; +static PyObject *__pyx_n_s_minp; +static PyObject *__pyx_n_s_minpair; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_minx; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_n0; +static PyObject *__pyx_n_s_na_option; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_n_s_nan_value; +static PyObject *__pyx_n_s_nancorr; +static PyObject *__pyx_n_s_nancorr_spearman; +static PyObject *__pyx_n_s_nbins; +static PyObject *__pyx_n_s_ndarray; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_ne; +static PyObject *__pyx_n_s_neg_ct; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_neww; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_ngroups; +static PyObject *__pyx_n_s_nleft; +static PyObject *__pyx_n_s_nlevels; +static PyObject *__pyx_n_s_nobs; +static PyObject *__pyx_n_s_nonzero; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_nright; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_o; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_object_2; +static PyObject *__pyx_n_s_offset; +static PyObject *__pyx_n_s_old; +static PyObject *__pyx_n_s_oldbuf; +static PyObject *__pyx_n_s_oldw; +static PyObject *__pyx_n_s_ones_like; +static PyObject *__pyx_n_s_ord; +static PyObject *__pyx_n_s_other; +static PyObject *__pyx_n_s_out; +static PyObject *__pyx_n_s_outer_join_indexer_float32; +static PyObject *__pyx_n_s_outer_join_indexer_float64; +static PyObject *__pyx_n_s_outer_join_indexer_int32; +static PyObject *__pyx_n_s_outer_join_indexer_int64; +static PyObject *__pyx_n_s_outer_join_indexer_object; +static PyObject *__pyx_n_s_output; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pad_2d_inplace_bool; +static PyObject *__pyx_n_s_pad_2d_inplace_float32; +static PyObject *__pyx_n_s_pad_2d_inplace_float64; +static PyObject *__pyx_n_s_pad_2d_inplace_int32; +static PyObject *__pyx_n_s_pad_2d_inplace_int64; +static PyObject *__pyx_n_s_pad_2d_inplace_object; +static PyObject *__pyx_n_s_pad_bool; +static PyObject *__pyx_n_s_pad_float32; +static PyObject *__pyx_n_s_pad_float64; +static PyObject *__pyx_n_s_pad_inplace_bool; +static PyObject *__pyx_n_s_pad_inplace_float32; +static PyObject *__pyx_n_s_pad_inplace_float64; +static PyObject *__pyx_n_s_pad_inplace_int32; +static PyObject *__pyx_n_s_pad_inplace_int64; +static PyObject *__pyx_n_s_pad_inplace_object; +static PyObject *__pyx_n_s_pad_int32; +static PyObject *__pyx_n_s_pad_int64; +static PyObject *__pyx_n_s_pad_object; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_pandas_algos; +static PyObject *__pyx_n_s_pandas_lib; +static PyObject *__pyx_kp_s_pandas_src_generated_pyx; +static PyObject *__pyx_kp_s_pandas_src_join_pyx; +static PyObject *__pyx_n_s_pct; +static PyObject *__pyx_n_s_periods; +static PyObject *__pyx_n_s_position; +static PyObject *__pyx_n_s_pre; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_prev; +static PyObject *__pyx_n_s_prodx; +static PyObject *__pyx_n_s_ptr; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_putmask; +static PyObject *__pyx_n_s_pydatetime; +static PyObject *__pyx_n_s_pyx_fuse_0kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_0median; +static PyObject *__pyx_n_s_pyx_fuse_1kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_1median; +static PyObject *__pyx_n_s_pyx_fuse_2kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_2median; +static PyObject *__pyx_n_s_pyx_fuse_3kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_3median; +static PyObject *__pyx_n_s_pyx_fuse_4kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_4median; +static PyObject *__pyx_n_s_pyx_fuse_5kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_5median; +static PyObject *__pyx_n_s_pyx_fuse_6kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_6median; +static PyObject *__pyx_n_s_pyx_fuse_7kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_7median; +static PyObject *__pyx_n_s_pyx_fuse_8kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_8median; +static PyObject *__pyx_n_s_pyx_fuse_9kth_smallest; +static PyObject *__pyx_n_s_pyx_fuse_9median; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_quantile; +static PyObject *__pyx_n_s_random; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_rank; +static PyObject *__pyx_n_s_rank_1d_float64; +static PyObject *__pyx_n_s_rank_1d_generic; +static PyObject *__pyx_n_s_rank_1d_int64; +static PyObject *__pyx_n_s_rank_2d_float64; +static PyObject *__pyx_n_s_rank_2d_generic; +static PyObject *__pyx_n_s_rank_2d_int64; +static PyObject *__pyx_n_s_ranks; +static PyObject *__pyx_n_s_rc; +static PyObject *__pyx_n_s_remove; +static PyObject *__pyx_n_s_res; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_resx; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_retry; +static PyObject *__pyx_n_s_return_false; +static PyObject *__pyx_n_s_return_true; +static PyObject *__pyx_n_s_rev; +static PyObject *__pyx_n_s_reverse; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_right_count; +static PyObject *__pyx_n_s_right_indexer; +static PyObject *__pyx_n_s_right_pos; +static PyObject *__pyx_n_s_right_sorter; +static PyObject *__pyx_n_s_rindexer; +static PyObject *__pyx_n_s_ring; +static PyObject *__pyx_n_s_roll_generic; +static PyObject *__pyx_n_s_roll_kurt; +static PyObject *__pyx_n_s_roll_max; +static PyObject *__pyx_n_s_roll_max2; +static PyObject *__pyx_n_s_roll_mean; +static PyObject *__pyx_n_s_roll_median_c; +static PyObject *__pyx_n_s_roll_median_cython; +static PyObject *__pyx_n_s_roll_min; +static PyObject *__pyx_n_s_roll_min2; +static PyObject *__pyx_n_s_roll_quantile; +static PyObject *__pyx_n_s_roll_skew; +static PyObject *__pyx_n_s_roll_sum; +static PyObject *__pyx_n_s_roll_var; +static PyObject *__pyx_n_s_roll_window; +static PyObject *__pyx_n_s_rval; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_seen; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_signatures; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_skiplist; +static PyObject *__pyx_n_s_sl; +static PyObject *__pyx_n_s_sort; +static PyObject *__pyx_n_s_sorted_data; +static PyObject *__pyx_n_s_sorter; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_ssqdm_x; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_n_s_strip; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_sum_ranks; +static PyObject *__pyx_n_s_sum_x; +static PyObject *__pyx_n_s_sumx; +static PyObject *__pyx_n_s_sumxx; +static PyObject *__pyx_n_s_sumy; +static PyObject *__pyx_n_s_sumyy; +static PyObject *__pyx_n_s_sx; +static PyObject *__pyx_n_s_sy; +static PyObject *__pyx_n_s_take; +static PyObject *__pyx_n_s_take_1d_bool_bool; +static PyObject *__pyx_n_s_take_1d_bool_object; +static PyObject *__pyx_n_s_take_1d_float32_float32; +static PyObject *__pyx_n_s_take_1d_float32_float64; +static PyObject *__pyx_n_s_take_1d_float64_float64; +static PyObject *__pyx_n_s_take_1d_int16_float64; +static PyObject *__pyx_n_s_take_1d_int16_int16; +static PyObject *__pyx_n_s_take_1d_int16_int32; +static PyObject *__pyx_n_s_take_1d_int16_int64; +static PyObject *__pyx_n_s_take_1d_int32_float64; +static PyObject *__pyx_n_s_take_1d_int32_int32; +static PyObject *__pyx_n_s_take_1d_int32_int64; +static PyObject *__pyx_n_s_take_1d_int64_float64; +static PyObject *__pyx_n_s_take_1d_int64_int64; +static PyObject *__pyx_n_s_take_1d_int8_float64; +static PyObject *__pyx_n_s_take_1d_int8_int32; +static PyObject *__pyx_n_s_take_1d_int8_int64; +static PyObject *__pyx_n_s_take_1d_int8_int8; +static PyObject *__pyx_n_s_take_1d_object_object; +static PyObject *__pyx_n_s_take_2d_axis0_bool_bool; +static PyObject *__pyx_n_s_take_2d_axis0_bool_object; +static PyObject *__pyx_n_s_take_2d_axis0_float32_float32; +static PyObject *__pyx_n_s_take_2d_axis0_float32_float64; +static PyObject *__pyx_n_s_take_2d_axis0_float64_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int16_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int16_int16; +static PyObject *__pyx_n_s_take_2d_axis0_int16_int32; +static PyObject *__pyx_n_s_take_2d_axis0_int16_int64; +static PyObject *__pyx_n_s_take_2d_axis0_int32_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int32_int32; +static PyObject *__pyx_n_s_take_2d_axis0_int32_int64; +static PyObject *__pyx_n_s_take_2d_axis0_int64_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int64_int64; +static PyObject *__pyx_n_s_take_2d_axis0_int8_float64; +static PyObject *__pyx_n_s_take_2d_axis0_int8_int32; +static PyObject *__pyx_n_s_take_2d_axis0_int8_int64; +static PyObject *__pyx_n_s_take_2d_axis0_int8_int8; +static PyObject *__pyx_n_s_take_2d_axis0_object_object; +static PyObject *__pyx_n_s_take_2d_axis1_bool_bool; +static PyObject *__pyx_n_s_take_2d_axis1_bool_object; +static PyObject *__pyx_n_s_take_2d_axis1_float32_float32; +static PyObject *__pyx_n_s_take_2d_axis1_float32_float64; +static PyObject *__pyx_n_s_take_2d_axis1_float64_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int16_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int16_int16; +static PyObject *__pyx_n_s_take_2d_axis1_int16_int32; +static PyObject *__pyx_n_s_take_2d_axis1_int16_int64; +static PyObject *__pyx_n_s_take_2d_axis1_int32_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int32_int32; +static PyObject *__pyx_n_s_take_2d_axis1_int32_int64; +static PyObject *__pyx_n_s_take_2d_axis1_int64_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int64_int64; +static PyObject *__pyx_n_s_take_2d_axis1_int8_float64; +static PyObject *__pyx_n_s_take_2d_axis1_int8_int32; +static PyObject *__pyx_n_s_take_2d_axis1_int8_int64; +static PyObject *__pyx_n_s_take_2d_axis1_int8_int8; +static PyObject *__pyx_n_s_take_2d_axis1_object_object; +static PyObject *__pyx_n_s_take_2d_multi_bool_bool; +static PyObject *__pyx_n_s_take_2d_multi_bool_object; +static PyObject *__pyx_n_s_take_2d_multi_float32_float32; +static PyObject *__pyx_n_s_take_2d_multi_float32_float64; +static PyObject *__pyx_n_s_take_2d_multi_float64_float64; +static PyObject *__pyx_n_s_take_2d_multi_int16_float64; +static PyObject *__pyx_n_s_take_2d_multi_int16_int16; +static PyObject *__pyx_n_s_take_2d_multi_int16_int32; +static PyObject *__pyx_n_s_take_2d_multi_int16_int64; +static PyObject *__pyx_n_s_take_2d_multi_int32_float64; +static PyObject *__pyx_n_s_take_2d_multi_int32_int32; +static PyObject *__pyx_n_s_take_2d_multi_int32_int64; +static PyObject *__pyx_n_s_take_2d_multi_int64_float64; +static PyObject *__pyx_n_s_take_2d_multi_int64_int64; +static PyObject *__pyx_n_s_take_2d_multi_int8_float64; +static PyObject *__pyx_n_s_take_2d_multi_int8_int32; +static PyObject *__pyx_n_s_take_2d_multi_int8_int64; +static PyObject *__pyx_n_s_take_2d_multi_int8_int8; +static PyObject *__pyx_n_s_take_2d_multi_object_object; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_tiebreak; +static PyObject *__pyx_n_s_tiebreakers; +static PyObject *__pyx_n_s_ties_method; +static PyObject *__pyx_n_s_top; +static PyObject *__pyx_n_s_tot_wgt; +static PyObject *__pyx_n_s_total_tie_count; +static PyObject *__pyx_n_s_u; +static PyObject *__pyx_n_s_uint16_t; +static PyObject *__pyx_n_s_uint32_t; +static PyObject *__pyx_n_s_uint64_t; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_n_s_uint8_t; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_val_in; +static PyObject *__pyx_n_s_val_win; +static PyObject *__pyx_n_s_valid_locs; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_vclose; +static PyObject *__pyx_n_s_vecs; +static PyObject *__pyx_n_s_vhigh; +static PyObject *__pyx_n_s_view; +static PyObject *__pyx_n_s_vlow; +static PyObject *__pyx_n_s_vopen; +static PyObject *__pyx_n_s_vx; +static PyObject *__pyx_n_s_vy; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_n_s_weights; +static PyObject *__pyx_n_s_where; +static PyObject *__pyx_n_s_width; +static PyObject *__pyx_n_s_win; +static PyObject *__pyx_n_s_win_i; +static PyObject *__pyx_n_s_win_k; +static PyObject *__pyx_n_s_win_n; +static PyObject *__pyx_n_s_window; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xi; +static PyObject *__pyx_n_s_xrange; +static PyObject *__pyx_n_s_xx; +static PyObject *__pyx_n_s_xxx; +static PyObject *__pyx_n_s_xxxx; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_n_s_yi; +static PyObject *__pyx_n_s_z; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_n_s_zeros_like; +static PyObject *__pyx_n_s_zip; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_100; +static PyObject *__pyx_int_105; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_k__116; +static PyObject *__pyx_k__117; +static PyObject *__pyx_k__118; +static PyObject *__pyx_k__119; +static PyObject *__pyx_k__120; +static PyObject *__pyx_k__121; +static PyObject *__pyx_k__122; +static PyObject *__pyx_k__123; +static PyObject *__pyx_k__124; +static PyObject *__pyx_k__125; +static PyObject *__pyx_k__126; +static PyObject *__pyx_k__127; +static PyObject *__pyx_k__128; +static PyObject *__pyx_k__129; +static PyObject *__pyx_k__130; +static PyObject *__pyx_k__131; +static PyObject *__pyx_k__132; +static PyObject *__pyx_k__133; +static PyObject *__pyx_k__134; +static PyObject *__pyx_k__135; +static PyObject *__pyx_k__136; +static PyObject *__pyx_k__137; +static PyObject *__pyx_k__138; +static PyObject *__pyx_k__139; +static PyObject *__pyx_k__140; +static PyObject *__pyx_k__141; +static PyObject *__pyx_k__142; +static PyObject *__pyx_k__143; +static PyObject *__pyx_k__144; +static PyObject *__pyx_k__145; +static PyObject *__pyx_k__146; +static PyObject *__pyx_k__147; +static PyObject *__pyx_k__148; +static PyObject *__pyx_k__149; +static PyObject *__pyx_k__150; +static PyObject *__pyx_k__151; +static PyObject *__pyx_k__152; +static PyObject *__pyx_k__153; +static PyObject *__pyx_k__154; +static PyObject *__pyx_k__155; +static PyObject *__pyx_k__156; +static PyObject *__pyx_k__157; +static PyObject *__pyx_k__158; +static PyObject *__pyx_k__159; +static PyObject *__pyx_k__160; +static PyObject *__pyx_k__161; +static PyObject *__pyx_k__162; +static PyObject *__pyx_k__163; +static PyObject *__pyx_k__164; +static PyObject *__pyx_k__165; +static PyObject *__pyx_k__166; +static PyObject *__pyx_k__167; +static PyObject *__pyx_k__168; +static PyObject *__pyx_k__169; +static PyObject *__pyx_k__170; +static PyObject *__pyx_k__171; +static PyObject *__pyx_k__172; +static PyObject *__pyx_k__173; +static PyObject *__pyx_k__174; +static PyObject *__pyx_k__175; +static PyObject *__pyx_k__176; +static PyObject *__pyx_k__177; +static PyObject *__pyx_k__178; +static PyObject *__pyx_k__179; +static PyObject *__pyx_k__180; +static PyObject *__pyx_k__181; +static PyObject *__pyx_k__182; +static PyObject *__pyx_k__183; +static PyObject *__pyx_k__184; +static PyObject *__pyx_k__185; +static PyObject *__pyx_k__186; +static PyObject *__pyx_k__187; +static PyObject *__pyx_k__188; +static PyObject *__pyx_k__189; +static PyObject *__pyx_k__190; +static PyObject *__pyx_k__191; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_slice__2; +static PyObject *__pyx_slice__4; +static PyObject *__pyx_slice__7; +static PyObject *__pyx_slice__8; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__11; +static PyObject *__pyx_slice__13; +static PyObject *__pyx_slice__14; +static PyObject *__pyx_slice__17; +static PyObject *__pyx_slice__19; +static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; +static PyObject *__pyx_slice__29; +static PyObject *__pyx_slice__46; +static PyObject *__pyx_slice__47; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__89; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_tuple__100; +static PyObject *__pyx_tuple__101; +static PyObject *__pyx_tuple__102; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__104; +static PyObject *__pyx_tuple__105; +static PyObject *__pyx_tuple__106; +static PyObject *__pyx_tuple__107; +static PyObject *__pyx_tuple__108; +static PyObject *__pyx_tuple__109; +static PyObject *__pyx_tuple__110; +static PyObject *__pyx_tuple__111; +static PyObject *__pyx_tuple__112; +static PyObject *__pyx_tuple__113; +static PyObject *__pyx_tuple__114; +static PyObject *__pyx_tuple__115; +static PyObject *__pyx_tuple__192; +static PyObject *__pyx_tuple__193; +static PyObject *__pyx_tuple__194; +static PyObject *__pyx_tuple__195; +static PyObject *__pyx_tuple__196; +static PyObject *__pyx_tuple__197; +static PyObject *__pyx_tuple__198; +static PyObject *__pyx_tuple__199; +static PyObject *__pyx_tuple__200; +static PyObject *__pyx_tuple__201; +static PyObject *__pyx_tuple__202; +static PyObject *__pyx_tuple__203; +static PyObject *__pyx_tuple__204; +static PyObject *__pyx_tuple__205; +static PyObject *__pyx_tuple__206; +static PyObject *__pyx_tuple__207; +static PyObject *__pyx_tuple__208; +static PyObject *__pyx_tuple__209; +static PyObject *__pyx_tuple__210; +static PyObject *__pyx_tuple__211; +static PyObject *__pyx_tuple__212; +static PyObject *__pyx_tuple__213; +static PyObject *__pyx_tuple__214; +static PyObject *__pyx_tuple__215; +static PyObject *__pyx_tuple__216; +static PyObject *__pyx_tuple__217; +static PyObject *__pyx_tuple__218; +static PyObject *__pyx_tuple__219; +static PyObject *__pyx_tuple__220; +static PyObject *__pyx_tuple__221; +static PyObject *__pyx_tuple__222; +static PyObject *__pyx_tuple__223; +static PyObject *__pyx_tuple__224; +static PyObject *__pyx_tuple__225; +static PyObject *__pyx_tuple__226; +static PyObject *__pyx_tuple__227; +static PyObject *__pyx_tuple__228; +static PyObject *__pyx_tuple__229; +static PyObject *__pyx_tuple__230; +static PyObject *__pyx_tuple__231; +static PyObject *__pyx_tuple__232; +static PyObject *__pyx_tuple__233; +static PyObject *__pyx_tuple__235; +static PyObject *__pyx_tuple__237; +static PyObject *__pyx_tuple__239; +static PyObject *__pyx_tuple__241; +static PyObject *__pyx_tuple__243; +static PyObject *__pyx_tuple__245; +static PyObject *__pyx_tuple__247; +static PyObject *__pyx_tuple__249; +static PyObject *__pyx_tuple__251; +static PyObject *__pyx_tuple__253; +static PyObject *__pyx_tuple__255; +static PyObject *__pyx_tuple__257; +static PyObject *__pyx_tuple__259; +static PyObject *__pyx_tuple__261; +static PyObject *__pyx_tuple__263; +static PyObject *__pyx_tuple__265; +static PyObject *__pyx_tuple__267; +static PyObject *__pyx_tuple__269; +static PyObject *__pyx_tuple__271; +static PyObject *__pyx_tuple__273; +static PyObject *__pyx_tuple__275; +static PyObject *__pyx_tuple__277; +static PyObject *__pyx_tuple__279; +static PyObject *__pyx_tuple__281; +static PyObject *__pyx_tuple__283; +static PyObject *__pyx_tuple__285; +static PyObject *__pyx_tuple__287; +static PyObject *__pyx_tuple__289; +static PyObject *__pyx_tuple__291; +static PyObject *__pyx_tuple__293; +static PyObject *__pyx_tuple__295; +static PyObject *__pyx_tuple__297; +static PyObject *__pyx_tuple__299; +static PyObject *__pyx_tuple__301; +static PyObject *__pyx_tuple__303; +static PyObject *__pyx_tuple__305; +static PyObject *__pyx_tuple__307; +static PyObject *__pyx_tuple__309; +static PyObject *__pyx_tuple__311; +static PyObject *__pyx_tuple__313; +static PyObject *__pyx_tuple__315; +static PyObject *__pyx_tuple__317; +static PyObject *__pyx_tuple__319; +static PyObject *__pyx_tuple__320; +static PyObject *__pyx_tuple__322; +static PyObject *__pyx_tuple__324; +static PyObject *__pyx_tuple__326; +static PyObject *__pyx_tuple__328; +static PyObject *__pyx_tuple__330; +static PyObject *__pyx_tuple__332; +static PyObject *__pyx_tuple__334; +static PyObject *__pyx_tuple__336; +static PyObject *__pyx_tuple__338; +static PyObject *__pyx_tuple__340; +static PyObject *__pyx_tuple__342; +static PyObject *__pyx_tuple__344; +static PyObject *__pyx_tuple__346; +static PyObject *__pyx_tuple__348; +static PyObject *__pyx_tuple__350; +static PyObject *__pyx_tuple__352; +static PyObject *__pyx_tuple__354; +static PyObject *__pyx_tuple__356; +static PyObject *__pyx_tuple__358; +static PyObject *__pyx_tuple__360; +static PyObject *__pyx_tuple__362; +static PyObject *__pyx_tuple__364; +static PyObject *__pyx_tuple__366; +static PyObject *__pyx_tuple__368; +static PyObject *__pyx_tuple__370; +static PyObject *__pyx_tuple__372; +static PyObject *__pyx_tuple__374; +static PyObject *__pyx_tuple__376; +static PyObject *__pyx_tuple__378; +static PyObject *__pyx_tuple__380; +static PyObject *__pyx_tuple__382; +static PyObject *__pyx_tuple__384; +static PyObject *__pyx_tuple__386; +static PyObject *__pyx_tuple__388; +static PyObject *__pyx_tuple__390; +static PyObject *__pyx_tuple__392; +static PyObject *__pyx_tuple__394; +static PyObject *__pyx_tuple__396; +static PyObject *__pyx_tuple__398; +static PyObject *__pyx_tuple__400; +static PyObject *__pyx_tuple__402; +static PyObject *__pyx_tuple__404; +static PyObject *__pyx_tuple__406; +static PyObject *__pyx_tuple__408; +static PyObject *__pyx_tuple__410; +static PyObject *__pyx_tuple__412; +static PyObject *__pyx_tuple__414; +static PyObject *__pyx_tuple__416; +static PyObject *__pyx_tuple__418; +static PyObject *__pyx_tuple__420; +static PyObject *__pyx_tuple__422; +static PyObject *__pyx_tuple__424; +static PyObject *__pyx_tuple__426; +static PyObject *__pyx_tuple__428; +static PyObject *__pyx_tuple__430; +static PyObject *__pyx_tuple__432; +static PyObject *__pyx_tuple__434; +static PyObject *__pyx_tuple__436; +static PyObject *__pyx_tuple__438; +static PyObject *__pyx_tuple__440; +static PyObject *__pyx_tuple__442; +static PyObject *__pyx_tuple__444; +static PyObject *__pyx_tuple__446; +static PyObject *__pyx_tuple__448; +static PyObject *__pyx_tuple__450; +static PyObject *__pyx_tuple__452; +static PyObject *__pyx_tuple__454; +static PyObject *__pyx_tuple__456; +static PyObject *__pyx_tuple__458; +static PyObject *__pyx_tuple__460; +static PyObject *__pyx_tuple__462; +static PyObject *__pyx_tuple__464; +static PyObject *__pyx_tuple__466; +static PyObject *__pyx_tuple__468; +static PyObject *__pyx_tuple__470; +static PyObject *__pyx_tuple__472; +static PyObject *__pyx_tuple__474; +static PyObject *__pyx_tuple__476; +static PyObject *__pyx_tuple__478; +static PyObject *__pyx_tuple__480; +static PyObject *__pyx_tuple__482; +static PyObject *__pyx_tuple__484; +static PyObject *__pyx_tuple__486; +static PyObject *__pyx_tuple__488; +static PyObject *__pyx_tuple__490; +static PyObject *__pyx_tuple__492; +static PyObject *__pyx_tuple__494; +static PyObject *__pyx_tuple__496; +static PyObject *__pyx_tuple__498; +static PyObject *__pyx_tuple__500; +static PyObject *__pyx_tuple__502; +static PyObject *__pyx_tuple__504; +static PyObject *__pyx_tuple__506; +static PyObject *__pyx_tuple__508; +static PyObject *__pyx_tuple__510; +static PyObject *__pyx_tuple__512; +static PyObject *__pyx_tuple__514; +static PyObject *__pyx_tuple__516; +static PyObject *__pyx_tuple__518; +static PyObject *__pyx_tuple__520; +static PyObject *__pyx_tuple__522; +static PyObject *__pyx_tuple__524; +static PyObject *__pyx_tuple__526; +static PyObject *__pyx_tuple__528; +static PyObject *__pyx_tuple__530; +static PyObject *__pyx_tuple__532; +static PyObject *__pyx_tuple__534; +static PyObject *__pyx_tuple__536; +static PyObject *__pyx_tuple__538; +static PyObject *__pyx_tuple__540; +static PyObject *__pyx_tuple__542; +static PyObject *__pyx_tuple__544; +static PyObject *__pyx_tuple__546; +static PyObject *__pyx_tuple__548; +static PyObject *__pyx_tuple__550; +static PyObject *__pyx_tuple__552; +static PyObject *__pyx_tuple__554; +static PyObject *__pyx_tuple__556; +static PyObject *__pyx_tuple__558; +static PyObject *__pyx_tuple__560; +static PyObject *__pyx_tuple__562; +static PyObject *__pyx_tuple__564; +static PyObject *__pyx_tuple__566; +static PyObject *__pyx_tuple__568; +static PyObject *__pyx_tuple__570; +static PyObject *__pyx_tuple__572; +static PyObject *__pyx_tuple__574; +static PyObject *__pyx_tuple__576; +static PyObject *__pyx_tuple__578; +static PyObject *__pyx_tuple__580; +static PyObject *__pyx_tuple__582; +static PyObject *__pyx_tuple__584; +static PyObject *__pyx_tuple__586; +static PyObject *__pyx_tuple__588; +static PyObject *__pyx_tuple__590; +static PyObject *__pyx_tuple__592; +static PyObject *__pyx_tuple__594; +static PyObject *__pyx_tuple__596; +static PyObject *__pyx_tuple__598; +static PyObject *__pyx_tuple__600; +static PyObject *__pyx_tuple__602; +static PyObject *__pyx_tuple__604; +static PyObject *__pyx_tuple__606; +static PyObject *__pyx_tuple__608; +static PyObject *__pyx_tuple__610; +static PyObject *__pyx_tuple__612; +static PyObject *__pyx_tuple__614; +static PyObject *__pyx_tuple__616; +static PyObject *__pyx_tuple__618; +static PyObject *__pyx_tuple__620; +static PyObject *__pyx_tuple__622; +static PyObject *__pyx_tuple__624; +static PyObject *__pyx_tuple__626; +static PyObject *__pyx_tuple__628; +static PyObject *__pyx_tuple__630; +static PyObject *__pyx_tuple__632; +static PyObject *__pyx_tuple__634; +static PyObject *__pyx_tuple__636; +static PyObject *__pyx_tuple__638; +static PyObject *__pyx_tuple__640; +static PyObject *__pyx_tuple__642; +static PyObject *__pyx_tuple__644; +static PyObject *__pyx_tuple__646; +static PyObject *__pyx_tuple__648; +static PyObject *__pyx_tuple__650; +static PyObject *__pyx_tuple__652; +static PyObject *__pyx_tuple__654; +static PyObject *__pyx_tuple__656; +static PyObject *__pyx_tuple__658; +static PyObject *__pyx_tuple__660; +static PyObject *__pyx_tuple__662; +static PyObject *__pyx_tuple__664; +static PyObject *__pyx_tuple__666; +static PyObject *__pyx_tuple__668; +static PyObject *__pyx_tuple__670; +static PyObject *__pyx_tuple__672; +static PyObject *__pyx_tuple__674; +static PyObject *__pyx_tuple__676; +static PyObject *__pyx_tuple__678; +static PyObject *__pyx_tuple__680; +static PyObject *__pyx_tuple__682; +static PyObject *__pyx_tuple__684; +static PyObject *__pyx_tuple__686; +static PyObject *__pyx_tuple__688; +static PyObject *__pyx_tuple__690; +static PyObject *__pyx_tuple__692; +static PyObject *__pyx_tuple__694; +static PyObject *__pyx_tuple__696; +static PyObject *__pyx_tuple__698; +static PyObject *__pyx_tuple__700; +static PyObject *__pyx_tuple__702; +static PyObject *__pyx_tuple__704; +static PyObject *__pyx_tuple__706; +static PyObject *__pyx_tuple__708; +static PyObject *__pyx_tuple__710; +static PyObject *__pyx_tuple__712; +static PyObject *__pyx_tuple__714; +static PyObject *__pyx_tuple__716; +static PyObject *__pyx_tuple__717; +static PyObject *__pyx_tuple__718; +static PyObject *__pyx_tuple__719; +static PyObject *__pyx_tuple__720; +static PyObject *__pyx_codeobj__234; +static PyObject *__pyx_codeobj__236; +static PyObject *__pyx_codeobj__238; +static PyObject *__pyx_codeobj__240; +static PyObject *__pyx_codeobj__242; +static PyObject *__pyx_codeobj__244; +static PyObject *__pyx_codeobj__246; +static PyObject *__pyx_codeobj__248; +static PyObject *__pyx_codeobj__250; +static PyObject *__pyx_codeobj__252; +static PyObject *__pyx_codeobj__254; +static PyObject *__pyx_codeobj__256; +static PyObject *__pyx_codeobj__258; +static PyObject *__pyx_codeobj__260; +static PyObject *__pyx_codeobj__262; +static PyObject *__pyx_codeobj__264; +static PyObject *__pyx_codeobj__266; +static PyObject *__pyx_codeobj__268; +static PyObject *__pyx_codeobj__270; +static PyObject *__pyx_codeobj__272; +static PyObject *__pyx_codeobj__274; +static PyObject *__pyx_codeobj__276; +static PyObject *__pyx_codeobj__278; +static PyObject *__pyx_codeobj__280; +static PyObject *__pyx_codeobj__282; +static PyObject *__pyx_codeobj__284; +static PyObject *__pyx_codeobj__286; +static PyObject *__pyx_codeobj__288; +static PyObject *__pyx_codeobj__290; +static PyObject *__pyx_codeobj__292; +static PyObject *__pyx_codeobj__294; +static PyObject *__pyx_codeobj__296; +static PyObject *__pyx_codeobj__298; +static PyObject *__pyx_codeobj__300; +static PyObject *__pyx_codeobj__302; +static PyObject *__pyx_codeobj__304; +static PyObject *__pyx_codeobj__306; +static PyObject *__pyx_codeobj__308; +static PyObject *__pyx_codeobj__310; +static PyObject *__pyx_codeobj__312; +static PyObject *__pyx_codeobj__314; +static PyObject *__pyx_codeobj__316; +static PyObject *__pyx_codeobj__318; +static PyObject *__pyx_codeobj__321; +static PyObject *__pyx_codeobj__323; +static PyObject *__pyx_codeobj__325; +static PyObject *__pyx_codeobj__327; +static PyObject *__pyx_codeobj__329; +static PyObject *__pyx_codeobj__331; +static PyObject *__pyx_codeobj__333; +static PyObject *__pyx_codeobj__335; +static PyObject *__pyx_codeobj__337; +static PyObject *__pyx_codeobj__339; +static PyObject *__pyx_codeobj__341; +static PyObject *__pyx_codeobj__343; +static PyObject *__pyx_codeobj__345; +static PyObject *__pyx_codeobj__347; +static PyObject *__pyx_codeobj__349; +static PyObject *__pyx_codeobj__351; +static PyObject *__pyx_codeobj__353; +static PyObject *__pyx_codeobj__355; +static PyObject *__pyx_codeobj__357; +static PyObject *__pyx_codeobj__359; +static PyObject *__pyx_codeobj__361; +static PyObject *__pyx_codeobj__363; +static PyObject *__pyx_codeobj__365; +static PyObject *__pyx_codeobj__367; +static PyObject *__pyx_codeobj__369; +static PyObject *__pyx_codeobj__371; +static PyObject *__pyx_codeobj__373; +static PyObject *__pyx_codeobj__375; +static PyObject *__pyx_codeobj__377; +static PyObject *__pyx_codeobj__379; +static PyObject *__pyx_codeobj__381; +static PyObject *__pyx_codeobj__383; +static PyObject *__pyx_codeobj__385; +static PyObject *__pyx_codeobj__387; +static PyObject *__pyx_codeobj__389; +static PyObject *__pyx_codeobj__391; +static PyObject *__pyx_codeobj__393; +static PyObject *__pyx_codeobj__395; +static PyObject *__pyx_codeobj__397; +static PyObject *__pyx_codeobj__399; +static PyObject *__pyx_codeobj__401; +static PyObject *__pyx_codeobj__403; +static PyObject *__pyx_codeobj__405; +static PyObject *__pyx_codeobj__407; +static PyObject *__pyx_codeobj__409; +static PyObject *__pyx_codeobj__411; +static PyObject *__pyx_codeobj__413; +static PyObject *__pyx_codeobj__415; +static PyObject *__pyx_codeobj__417; +static PyObject *__pyx_codeobj__419; +static PyObject *__pyx_codeobj__421; +static PyObject *__pyx_codeobj__423; +static PyObject *__pyx_codeobj__425; +static PyObject *__pyx_codeobj__427; +static PyObject *__pyx_codeobj__429; +static PyObject *__pyx_codeobj__431; +static PyObject *__pyx_codeobj__433; +static PyObject *__pyx_codeobj__435; +static PyObject *__pyx_codeobj__437; +static PyObject *__pyx_codeobj__439; +static PyObject *__pyx_codeobj__441; +static PyObject *__pyx_codeobj__443; +static PyObject *__pyx_codeobj__445; +static PyObject *__pyx_codeobj__447; +static PyObject *__pyx_codeobj__449; +static PyObject *__pyx_codeobj__451; +static PyObject *__pyx_codeobj__453; +static PyObject *__pyx_codeobj__455; +static PyObject *__pyx_codeobj__457; +static PyObject *__pyx_codeobj__459; +static PyObject *__pyx_codeobj__461; +static PyObject *__pyx_codeobj__463; +static PyObject *__pyx_codeobj__465; +static PyObject *__pyx_codeobj__467; +static PyObject *__pyx_codeobj__469; +static PyObject *__pyx_codeobj__471; +static PyObject *__pyx_codeobj__473; +static PyObject *__pyx_codeobj__475; +static PyObject *__pyx_codeobj__477; +static PyObject *__pyx_codeobj__479; +static PyObject *__pyx_codeobj__481; +static PyObject *__pyx_codeobj__483; +static PyObject *__pyx_codeobj__485; +static PyObject *__pyx_codeobj__487; +static PyObject *__pyx_codeobj__489; +static PyObject *__pyx_codeobj__491; +static PyObject *__pyx_codeobj__493; +static PyObject *__pyx_codeobj__495; +static PyObject *__pyx_codeobj__497; +static PyObject *__pyx_codeobj__499; +static PyObject *__pyx_codeobj__501; +static PyObject *__pyx_codeobj__503; +static PyObject *__pyx_codeobj__505; +static PyObject *__pyx_codeobj__507; +static PyObject *__pyx_codeobj__509; +static PyObject *__pyx_codeobj__511; +static PyObject *__pyx_codeobj__513; +static PyObject *__pyx_codeobj__515; +static PyObject *__pyx_codeobj__517; +static PyObject *__pyx_codeobj__519; +static PyObject *__pyx_codeobj__521; +static PyObject *__pyx_codeobj__523; +static PyObject *__pyx_codeobj__525; +static PyObject *__pyx_codeobj__527; +static PyObject *__pyx_codeobj__529; +static PyObject *__pyx_codeobj__531; +static PyObject *__pyx_codeobj__533; +static PyObject *__pyx_codeobj__535; +static PyObject *__pyx_codeobj__537; +static PyObject *__pyx_codeobj__539; +static PyObject *__pyx_codeobj__541; +static PyObject *__pyx_codeobj__543; +static PyObject *__pyx_codeobj__545; +static PyObject *__pyx_codeobj__547; +static PyObject *__pyx_codeobj__549; +static PyObject *__pyx_codeobj__551; +static PyObject *__pyx_codeobj__553; +static PyObject *__pyx_codeobj__555; +static PyObject *__pyx_codeobj__557; +static PyObject *__pyx_codeobj__559; +static PyObject *__pyx_codeobj__561; +static PyObject *__pyx_codeobj__563; +static PyObject *__pyx_codeobj__565; +static PyObject *__pyx_codeobj__567; +static PyObject *__pyx_codeobj__569; +static PyObject *__pyx_codeobj__571; +static PyObject *__pyx_codeobj__573; +static PyObject *__pyx_codeobj__575; +static PyObject *__pyx_codeobj__577; +static PyObject *__pyx_codeobj__579; +static PyObject *__pyx_codeobj__581; +static PyObject *__pyx_codeobj__583; +static PyObject *__pyx_codeobj__585; +static PyObject *__pyx_codeobj__587; +static PyObject *__pyx_codeobj__589; +static PyObject *__pyx_codeobj__591; +static PyObject *__pyx_codeobj__593; +static PyObject *__pyx_codeobj__595; +static PyObject *__pyx_codeobj__597; +static PyObject *__pyx_codeobj__599; +static PyObject *__pyx_codeobj__601; +static PyObject *__pyx_codeobj__603; +static PyObject *__pyx_codeobj__605; +static PyObject *__pyx_codeobj__607; +static PyObject *__pyx_codeobj__609; +static PyObject *__pyx_codeobj__611; +static PyObject *__pyx_codeobj__613; +static PyObject *__pyx_codeobj__615; +static PyObject *__pyx_codeobj__617; +static PyObject *__pyx_codeobj__619; +static PyObject *__pyx_codeobj__621; +static PyObject *__pyx_codeobj__623; +static PyObject *__pyx_codeobj__625; +static PyObject *__pyx_codeobj__627; +static PyObject *__pyx_codeobj__629; +static PyObject *__pyx_codeobj__631; +static PyObject *__pyx_codeobj__633; +static PyObject *__pyx_codeobj__635; +static PyObject *__pyx_codeobj__637; +static PyObject *__pyx_codeobj__639; +static PyObject *__pyx_codeobj__641; +static PyObject *__pyx_codeobj__643; +static PyObject *__pyx_codeobj__645; +static PyObject *__pyx_codeobj__647; +static PyObject *__pyx_codeobj__649; +static PyObject *__pyx_codeobj__651; +static PyObject *__pyx_codeobj__653; +static PyObject *__pyx_codeobj__655; +static PyObject *__pyx_codeobj__657; +static PyObject *__pyx_codeobj__659; +static PyObject *__pyx_codeobj__661; +static PyObject *__pyx_codeobj__663; +static PyObject *__pyx_codeobj__665; +static PyObject *__pyx_codeobj__667; +static PyObject *__pyx_codeobj__669; +static PyObject *__pyx_codeobj__671; +static PyObject *__pyx_codeobj__673; +static PyObject *__pyx_codeobj__675; +static PyObject *__pyx_codeobj__677; +static PyObject *__pyx_codeobj__679; +static PyObject *__pyx_codeobj__681; +static PyObject *__pyx_codeobj__683; +static PyObject *__pyx_codeobj__685; +static PyObject *__pyx_codeobj__687; +static PyObject *__pyx_codeobj__689; +static PyObject *__pyx_codeobj__691; +static PyObject *__pyx_codeobj__693; +static PyObject *__pyx_codeobj__695; +static PyObject *__pyx_codeobj__697; +static PyObject *__pyx_codeobj__699; +static PyObject *__pyx_codeobj__701; +static PyObject *__pyx_codeobj__703; +static PyObject *__pyx_codeobj__705; +static PyObject *__pyx_codeobj__707; +static PyObject *__pyx_codeobj__709; +static PyObject *__pyx_codeobj__711; +static PyObject *__pyx_codeobj__713; +static PyObject *__pyx_codeobj__715; + +/* "pandas/algos.pyx":565 + * return left != right + * + * _return_false = lambda self, other: False # <<<<<<<<<<<<<< + * _return_true = lambda self, other: True + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_510lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_510lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_6pandas_5algos_510lambda1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_510lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_other = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_6pandas_5algos_lambda1(__pyx_self, __pyx_v_self, __pyx_v_other); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":566 + * + * _return_false = lambda self, other: False + * _return_true = lambda self, other: True # <<<<<<<<<<<<<< + * + * class Infinity(object): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_511lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_511lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_pw_6pandas_5algos_511lambda2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_511lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_other = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("lambda2", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_6pandas_5algos_lambda2(__pyx_self, __pyx_v_self, __pyx_v_other); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6pandas_5algos_lambda2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda2", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":55 + * + * + * cdef inline int int_max(int a, int b): return a if a >= b else b # <<<<<<<<<<<<<< + * cdef inline int int_min(int a, int b): return a if a <= b else b + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_max(int __pyx_v_a, int __pyx_v_b) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("int_max", 0); + if (((__pyx_v_a >= __pyx_v_b) != 0)) { + __pyx_t_1 = __pyx_v_a; + } else { + __pyx_t_1 = __pyx_v_b; + } + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":56 + * + * cdef inline int int_max(int a, int b): return a if a >= b else b + * cdef inline int int_min(int a, int b): return a if a <= b else b # <<<<<<<<<<<<<< + * + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5algos_int_min(int __pyx_v_a, int __pyx_v_b) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("int_min", 0); + if (((__pyx_v_a <= __pyx_v_b) != 0)) { + __pyx_t_1 = __pyx_v_a; + } else { + __pyx_t_1 = __pyx_v_b; + } + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":18 + * # MSVC does not have log2! + * + * cdef double Log2(double x): # <<<<<<<<<<<<<< + * return log(x) / log(2.) + * + */ + +static double __pyx_f_6pandas_5algos_Log2(double __pyx_v_x) { + double __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + double __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("Log2", 0); + + /* "pandas/src/skiplist.pyx":19 + * + * cdef double Log2(double x): + * return log(x) / log(2.) # <<<<<<<<<<<<<< + * + * cimport numpy as np + */ + __pyx_t_1 = log(__pyx_v_x); + __pyx_t_2 = log(2.); + if (unlikely(__pyx_t_2 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = (__pyx_t_1 / __pyx_t_2); + goto __pyx_L0; + + /* "pandas/src/skiplist.pyx":18 + * # MSVC does not have log2! + * + * cdef double Log2(double x): # <<<<<<<<<<<<<< + * return log(x) / log(2.) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.algos.Log2", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":38 + * list width + * + * def __init__(self, double_t value, list next, list width): # <<<<<<<<<<<<<< + * self.value = value + * self.next = next + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_double_t __pyx_v_value; + PyObject *__pyx_v_next = 0; + PyObject *__pyx_v_width = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_next,&__pyx_n_s_width,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_next)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_value = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_value == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_next = ((PyObject*)values[1]); + __pyx_v_width = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.Node.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_next), (&PyList_Type), 1, "next", 1))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), (&PyList_Type), 1, "width", 1))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_4Node___init__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), __pyx_v_value, __pyx_v_next, __pyx_v_width); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node___init__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, __pyx_t_5numpy_double_t __pyx_v_value, PyObject *__pyx_v_next, PyObject *__pyx_v_width) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/skiplist.pyx":39 + * + * def __init__(self, double_t value, list next, list width): + * self.value = value # <<<<<<<<<<<<<< + * self.next = next + * self.width = width + */ + __pyx_v_self->value = __pyx_v_value; + + /* "pandas/src/skiplist.pyx":40 + * def __init__(self, double_t value, list next, list width): + * self.value = value + * self.next = next # <<<<<<<<<<<<<< + * self.width = width + * + */ + __Pyx_INCREF(__pyx_v_next); + __Pyx_GIVEREF(__pyx_v_next); + __Pyx_GOTREF(__pyx_v_self->next); + __Pyx_DECREF(__pyx_v_self->next); + __pyx_v_self->next = __pyx_v_next; + + /* "pandas/src/skiplist.pyx":41 + * self.value = value + * self.next = next + * self.width = width # <<<<<<<<<<<<<< + * + * # Singleton terminator node + */ + __Pyx_INCREF(__pyx_v_width); + __Pyx_GIVEREF(__pyx_v_width); + __Pyx_GOTREF(__pyx_v_self->width); + __Pyx_DECREF(__pyx_v_self->width); + __pyx_v_self->width = __pyx_v_width; + + /* "pandas/src/skiplist.pyx":38 + * list width + * + * def __init__(self, double_t value, list next, list width): # <<<<<<<<<<<<<< + * self.value = value + * self.next = next + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":34 + * cdef class Node: + * cdef public: + * double_t value # <<<<<<<<<<<<<< + * list next + * list width + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_4Node_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_4Node_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5value___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_4Node_5value___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.Node.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5value_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_5value_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_double_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->value = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.algos.Node.value.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":35 + * cdef public: + * double_t value + * list next # <<<<<<<<<<<<<< + * list width + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_4Node_4next_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_4Node_4next_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_4Node_4next___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->next); + __pyx_r = __pyx_v_self->next; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_4next_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_4next_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_4next_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->next); + __Pyx_DECREF(__pyx_v_self->next); + __pyx_v_self->next = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.Node.next.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_4next_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_4next_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_4next_4__del__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_4next_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->next); + __Pyx_DECREF(__pyx_v_self->next); + __pyx_v_self->next = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":36 + * double_t value + * list next + * list width # <<<<<<<<<<<<<< + * + * def __init__(self, double_t value, list next, list width): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_4Node_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_4Node_5width_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width___get__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_4Node_5width___get__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->width); + __pyx_r = __pyx_v_self->width; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width_2__set__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_5width_2__set__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->width); + __Pyx_DECREF(__pyx_v_self->width); + __pyx_v_self->width = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.Node.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_4Node_5width_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_5algos_4Node_5width_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_4Node_5width_4__del__(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_4Node_5width_4__del__(struct __pyx_obj_6pandas_5algos_Node *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->width); + __Pyx_DECREF(__pyx_v_self->width); + __pyx_v_self->width = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":55 + * Node head + * + * def __init__(self, expected_size=100): # <<<<<<<<<<<<<< + * self.size = 0 + * self.maxlevels = int(1 + Log2(expected_size)) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5algos_17IndexableSkiplist_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_5algos_17IndexableSkiplist_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_expected_size = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_expected_size,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_100); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_expected_size); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_expected_size = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), __pyx_v_expected_size); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5algos_17IndexableSkiplist___init__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_expected_size) { + int __pyx_r; + __Pyx_RefNannyDeclarations + double __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/skiplist.pyx":56 + * + * def __init__(self, expected_size=100): + * self.size = 0 # <<<<<<<<<<<<<< + * self.maxlevels = int(1 + Log2(expected_size)) + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) + */ + __pyx_v_self->size = 0; + + /* "pandas/src/skiplist.pyx":57 + * def __init__(self, expected_size=100): + * self.size = 0 + * self.maxlevels = int(1 + Log2(expected_size)) # <<<<<<<<<<<<<< + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) + * + */ + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_expected_size); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->maxlevels = ((Py_ssize_t)(1.0 + __pyx_f_6pandas_5algos_Log2(__pyx_t_1))); + + /* "pandas/src/skiplist.pyx":58 + * self.size = 0 + * self.maxlevels = int(1 + Log2(expected_size)) + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_1); + PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + } + } + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->head); + __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); + __pyx_v_self->head = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":55 + * Node head + * + * def __init__(self, expected_size=100): # <<<<<<<<<<<<<< + * self.size = 0 + * self.maxlevels = int(1 + Log2(expected_size)) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":60 + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.size + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_5algos_17IndexableSkiplist_2__len__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/src/skiplist.pyx":61 + * + * def __len__(self): + * return self.size # <<<<<<<<<<<<<< + * + * def __getitem__(self, i): + */ + __pyx_r = __pyx_v_self->size; + goto __pyx_L0; + + /* "pandas/src/skiplist.pyx":60 + * self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.size + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":63 + * return self.size + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * return self.get(i) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_4__getitem__(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "pandas/src/skiplist.pyx":64 + * + * def __getitem__(self, i): + * return self.get(i) # <<<<<<<<<<<<<< + * + * cpdef get(self, Py_ssize_t i): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/skiplist.pyx":63 + * return self.size + * + * def __getitem__(self, i): # <<<<<<<<<<<<<< + * return self.get(i) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":66 + * return self.get(i) + * + * cpdef get(self, Py_ssize_t i): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level + * cdef Node node + */ + +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_level; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_node = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":70 + * cdef Node node + * + * node = self.head # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":71 + * + * node = self.head + * i += 1 # <<<<<<<<<<<<<< + * + * for level in range(self.maxlevels - 1, -1, -1): + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/skiplist.pyx":73 + * i += 1 + * + * for level in range(self.maxlevels - 1, -1, -1): # <<<<<<<<<<<<<< + * while node.width[level] <= i: + * i -= node.width[level] + */ + for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) { + __pyx_v_level = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":74 + * + * for level in range(self.maxlevels - 1, -1, -1): + * while node.width[level] <= i: # <<<<<<<<<<<<<< + * i -= node.width[level] + * node = node.next[level] + */ + while (1) { + if (unlikely(__pyx_v_node->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_5) break; + + /* "pandas/src/skiplist.pyx":75 + * for level in range(self.maxlevels - 1, -1, -1): + * while node.width[level] <= i: + * i -= node.width[level] # <<<<<<<<<<<<<< + * node = node.next[level] + * + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_node->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/skiplist.pyx":76 + * while node.width[level] <= i: + * i -= node.width[level] + * node = node.next[level] # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_node, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + } + } + + /* "pandas/src/skiplist.pyx":79 + * + * + * return node.value # <<<<<<<<<<<<<< + * + * cpdef insert(self, double value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_node->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/skiplist.pyx":66 + * return self.get(i) + * + * cpdef get(self, Py_ssize_t i): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level + * cdef Node node + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_node); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) { + Py_ssize_t __pyx_v_i; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + assert(__pyx_arg_i); { + __pyx_v_i = __Pyx_PyIndex_AsSsize_t(__pyx_arg_i); if (unlikely((__pyx_v_i == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((Py_ssize_t)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_6get(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_v_i, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":81 + * return node.value + * + * cpdef insert(self, double value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level, steps, d + * cdef Node node, prevnode, newnode, next_at_level, tmp + */ + +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_insert(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_level; + Py_ssize_t __pyx_v_steps; + Py_ssize_t __pyx_v_d; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_node = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_prevnode = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_newnode = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_next_at_level = 0; + PyObject *__pyx_v_chain = 0; + PyObject *__pyx_v_steps_at_level = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + double __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("insert", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":87 + * + * # find first node on each level where node.next[levels].value > value + * chain = [None] * self.maxlevels # <<<<<<<<<<<<<< + * steps_at_level = [0] * self.maxlevels + * node = self.head + */ + __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + __pyx_v_chain = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":88 + * # find first node on each level where node.next[levels].value > value + * chain = [None] * self.maxlevels + * steps_at_level = [0] * self.maxlevels # <<<<<<<<<<<<<< + * node = self.head + * + */ + __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + } + } + __pyx_v_steps_at_level = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":89 + * chain = [None] * self.maxlevels + * steps_at_level = [0] * self.maxlevels + * node = self.head # <<<<<<<<<<<<<< + * + * for level in range(self.maxlevels - 1, -1, -1): + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":91 + * node = self.head + * + * for level in range(self.maxlevels - 1, -1, -1): # <<<<<<<<<<<<<< + * next_at_level = node.next[level] + * + */ + for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) { + __pyx_v_level = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":92 + * + * for level in range(self.maxlevels - 1, -1, -1): + * next_at_level = node.next[level] # <<<<<<<<<<<<<< + * + * while next_at_level.value <= value: + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":94 + * next_at_level = node.next[level] + * + * while next_at_level.value <= value: # <<<<<<<<<<<<<< + * steps_at_level[level] = (steps_at_level[level] + + * node.width[level]) + */ + while (1) { + __pyx_t_5 = ((__pyx_v_next_at_level->value <= __pyx_v_value) != 0); + if (!__pyx_t_5) break; + + /* "pandas/src/skiplist.pyx":95 + * + * while next_at_level.value <= value: + * steps_at_level[level] = (steps_at_level[level] + # <<<<<<<<<<<<<< + * node.width[level]) + * node = next_at_level + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_steps_at_level, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/skiplist.pyx":96 + * while next_at_level.value <= value: + * steps_at_level[level] = (steps_at_level[level] + + * node.width[level]) # <<<<<<<<<<<<<< + * node = next_at_level + * next_at_level = node.next[level] + */ + if (unlikely(__pyx_v_node->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_node->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/src/skiplist.pyx":95 + * + * while next_at_level.value <= value: + * steps_at_level[level] = (steps_at_level[level] + # <<<<<<<<<<<<<< + * node.width[level]) + * node = next_at_level + */ + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_steps_at_level, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/skiplist.pyx":97 + * steps_at_level[level] = (steps_at_level[level] + + * node.width[level]) + * node = next_at_level # <<<<<<<<<<<<<< + * next_at_level = node.next[level] + * + */ + __Pyx_INCREF(((PyObject *)__pyx_v_next_at_level)); + __Pyx_DECREF_SET(__pyx_v_node, __pyx_v_next_at_level); + + /* "pandas/src/skiplist.pyx":98 + * node.width[level]) + * node = next_at_level + * next_at_level = node.next[level] # <<<<<<<<<<<<<< + * + * chain[level] = node + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_3)); + __pyx_t_3 = 0; + } + + /* "pandas/src/skiplist.pyx":100 + * next_at_level = node.next[level] + * + * chain[level] = node # <<<<<<<<<<<<<< + * + * # insert a link to the newnode at each level + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_chain, __pyx_v_level, ((PyObject *)__pyx_v_node), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/skiplist.pyx":103 + * + * # insert a link to the newnode at each level + * d = min(self.maxlevels, 1 - int(Log2(random()))) # <<<<<<<<<<<<<< + * newnode = Node(value, [None] * d, [None] * d) + * steps = 0 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_random); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_f_6pandas_5algos_Log2(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_int_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_v_self->maxlevels; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + } else { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __pyx_t_7; + __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_d = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":104 + * # insert a link to the newnode at each level + * d = min(self.maxlevels, 1 - int(Log2(random()))) + * newnode = Node(value, [None] * d, [None] * d) # <<<<<<<<<<<<<< + * steps = 0 + * + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(1 * ((__pyx_v_d<0) ? 0:__pyx_v_d)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_d; __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + __pyx_t_7 = PyList_New(1 * ((__pyx_v_d<0) ? 0:__pyx_v_d)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_d; __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_newnode = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/src/skiplist.pyx":105 + * d = min(self.maxlevels, 1 - int(Log2(random()))) + * newnode = Node(value, [None] * d, [None] * d) + * steps = 0 # <<<<<<<<<<<<<< + * + * for level in range(d): + */ + __pyx_v_steps = 0; + + /* "pandas/src/skiplist.pyx":107 + * steps = 0 + * + * for level in range(d): # <<<<<<<<<<<<<< + * prevnode = chain[level] + * newnode.next[level] = prevnode.next[level] + */ + __pyx_t_4 = __pyx_v_d; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "pandas/src/skiplist.pyx":108 + * + * for level in range(d): + * prevnode = chain[level] # <<<<<<<<<<<<<< + * newnode.next[level] = prevnode.next[level] + * prevnode.next[level] = newnode + */ + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_prevnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)); + __pyx_t_7 = 0; + + /* "pandas/src/skiplist.pyx":109 + * for level in range(d): + * prevnode = chain[level] + * newnode.next[level] = prevnode.next[level] # <<<<<<<<<<<<<< + * prevnode.next[level] = newnode + * newnode.width[level] = (prevnode.width[level] - steps) + */ + if (unlikely(__pyx_v_prevnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_prevnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(__pyx_v_newnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_newnode->next, __pyx_v_level, __pyx_t_7, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/skiplist.pyx":110 + * prevnode = chain[level] + * newnode.next[level] = prevnode.next[level] + * prevnode.next[level] = newnode # <<<<<<<<<<<<<< + * newnode.width[level] = (prevnode.width[level] - steps) + * prevnode.width[level] = steps + 1 + */ + if (unlikely(__pyx_v_prevnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->next, __pyx_v_level, ((PyObject *)__pyx_v_newnode), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/skiplist.pyx":111 + * newnode.next[level] = prevnode.next[level] + * prevnode.next[level] = newnode + * newnode.width[level] = (prevnode.width[level] - steps) # <<<<<<<<<<<<<< + * prevnode.width[level] = steps + 1 + * steps += steps_at_level[level] + */ + if (unlikely(__pyx_v_prevnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_prevnode->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_steps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_v_newnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_newnode->width, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/skiplist.pyx":112 + * prevnode.next[level] = newnode + * newnode.width[level] = (prevnode.width[level] - steps) + * prevnode.width[level] = steps + 1 # <<<<<<<<<<<<<< + * steps += steps_at_level[level] + * + */ + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_steps + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_prevnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->width, __pyx_v_level, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/skiplist.pyx":113 + * newnode.width[level] = (prevnode.width[level] - steps) + * prevnode.width[level] = steps + 1 + * steps += steps_at_level[level] # <<<<<<<<<<<<<< + * + * for level in range(d, self.maxlevels): + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_steps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_steps_at_level, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_steps = __pyx_t_9; + } + + /* "pandas/src/skiplist.pyx":115 + * steps += steps_at_level[level] + * + * for level in range(d, self.maxlevels): # <<<<<<<<<<<<<< + * ( chain[level]).width[level] += 1 + * + */ + __pyx_t_4 = __pyx_v_self->maxlevels; + for (__pyx_t_8 = __pyx_v_d; __pyx_t_8 < __pyx_t_4; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "pandas/src/skiplist.pyx":116 + * + * for level in range(d, self.maxlevels): + * ( chain[level]).width[level] += 1 # <<<<<<<<<<<<<< + * + * self.size += 1 + */ + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width); + __pyx_t_10 = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_7)->width; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = __pyx_v_level; + if (unlikely(__pyx_t_10 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_t_10, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_10 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_t_10, __pyx_t_9, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + + /* "pandas/src/skiplist.pyx":118 + * ( chain[level]).width[level] += 1 + * + * self.size += 1 # <<<<<<<<<<<<<< + * + * cpdef remove(self, double value): + */ + __pyx_v_self->size = (__pyx_v_self->size + 1); + + /* "pandas/src/skiplist.pyx":81 + * return node.value + * + * cpdef insert(self, double value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level, steps, d + * cdef Node node, prevnode, newnode, next_at_level, tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_node); + __Pyx_XDECREF((PyObject *)__pyx_v_prevnode); + __Pyx_XDECREF((PyObject *)__pyx_v_newnode); + __Pyx_XDECREF((PyObject *)__pyx_v_next_at_level); + __Pyx_XDECREF(__pyx_v_chain); + __Pyx_XDECREF(__pyx_v_steps_at_level); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + double __pyx_v_value; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("insert (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((double)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_8insert(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("insert", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->insert(__pyx_v_self, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/skiplist.pyx":120 + * self.size += 1 + * + * cpdef remove(self, double value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level, d + * cdef Node node, prevnode, tmpnode, next_at_level + */ + +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_17IndexableSkiplist_remove(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_level; + Py_ssize_t __pyx_v_d; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_node = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_prevnode = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_tmpnode = 0; + struct __pyx_obj_6pandas_5algos_Node *__pyx_v_next_at_level = 0; + PyObject *__pyx_v_chain = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("remove", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":126 + * + * # find first node on each level where node.next[levels].value >= value + * chain = [None] * self.maxlevels # <<<<<<<<<<<<<< + * node = self.head + * + */ + __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->maxlevels<0) ? 0:__pyx_v_self->maxlevels)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->maxlevels; __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + __pyx_v_chain = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":127 + * # find first node on each level where node.next[levels].value >= value + * chain = [None] * self.maxlevels + * node = self.head # <<<<<<<<<<<<<< + * + * for level in range(self.maxlevels - 1, -1, -1): + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_node = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":129 + * node = self.head + * + * for level in range(self.maxlevels - 1, -1, -1): # <<<<<<<<<<<<<< + * next_at_level = node.next[level] + * while next_at_level.value < value: + */ + for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) { + __pyx_v_level = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":130 + * + * for level in range(self.maxlevels - 1, -1, -1): + * next_at_level = node.next[level] # <<<<<<<<<<<<<< + * while next_at_level.value < value: + * node = next_at_level + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":131 + * for level in range(self.maxlevels - 1, -1, -1): + * next_at_level = node.next[level] + * while next_at_level.value < value: # <<<<<<<<<<<<<< + * node = next_at_level + * next_at_level = node.next[level] + */ + while (1) { + __pyx_t_5 = ((__pyx_v_next_at_level->value < __pyx_v_value) != 0); + if (!__pyx_t_5) break; + + /* "pandas/src/skiplist.pyx":132 + * next_at_level = node.next[level] + * while next_at_level.value < value: + * node = next_at_level # <<<<<<<<<<<<<< + * next_at_level = node.next[level] + * + */ + __Pyx_INCREF(((PyObject *)__pyx_v_next_at_level)); + __Pyx_DECREF_SET(__pyx_v_node, __pyx_v_next_at_level); + + /* "pandas/src/skiplist.pyx":133 + * while next_at_level.value < value: + * node = next_at_level + * next_at_level = node.next[level] # <<<<<<<<<<<<<< + * + * chain[level] = node + */ + if (unlikely(__pyx_v_node->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_node->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_next_at_level, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":135 + * next_at_level = node.next[level] + * + * chain[level] = node # <<<<<<<<<<<<<< + * + * if value != ( ( ( chain[0]).next)[0]).value: + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_chain, __pyx_v_level, ((PyObject *)__pyx_v_node), Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/skiplist.pyx":137 + * chain[level] = node + * + * if value != ( ( ( chain[0]).next)[0]).value: # <<<<<<<<<<<<<< + * raise KeyError('Not Found') + * + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_chain, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)->next, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = ((__pyx_v_value != ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)->value) != 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/src/skiplist.pyx":138 + * + * if value != ( ( ( chain[0]).next)[0]).value: + * raise KeyError('Not Found') # <<<<<<<<<<<<<< + * + * # remove one link at each level + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/skiplist.pyx":141 + * + * # remove one link at each level + * d = len(( ( ( chain[0]).next)[0]).next) # <<<<<<<<<<<<<< + * + * for level in range(d): + */ + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_chain, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)->next, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)->next; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_d = __pyx_t_4; + + /* "pandas/src/skiplist.pyx":143 + * d = len(( ( ( chain[0]).next)[0]).next) + * + * for level in range(d): # <<<<<<<<<<<<<< + * prevnode = chain[level] + * tmpnode = prevnode.next[level] + */ + __pyx_t_4 = __pyx_v_d; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_4; __pyx_t_6+=1) { + __pyx_v_level = __pyx_t_6; + + /* "pandas/src/skiplist.pyx":144 + * + * for level in range(d): + * prevnode = chain[level] # <<<<<<<<<<<<<< + * tmpnode = prevnode.next[level] + * prevnode.width[level] += tmpnode.width[level] - 1 + */ + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_prevnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":145 + * for level in range(d): + * prevnode = chain[level] + * tmpnode = prevnode.next[level] # <<<<<<<<<<<<<< + * prevnode.width[level] += tmpnode.width[level] - 1 + * prevnode.next[level] = tmpnode.next[level] + */ + if (unlikely(__pyx_v_prevnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_prevnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_tmpnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":146 + * prevnode = chain[level] + * tmpnode = prevnode.next[level] + * prevnode.width[level] += tmpnode.width[level] - 1 # <<<<<<<<<<<<<< + * prevnode.next[level] = tmpnode.next[level] + * + */ + if (unlikely(__pyx_v_prevnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(__pyx_v_prevnode->width); + __pyx_t_7 = __pyx_v_prevnode->width; + __pyx_t_8 = __pyx_v_level; + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_t_7, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_tmpnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_tmpnode->width, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_t_8, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/skiplist.pyx":147 + * tmpnode = prevnode.next[level] + * prevnode.width[level] += tmpnode.width[level] - 1 + * prevnode.next[level] = tmpnode.next[level] # <<<<<<<<<<<<<< + * + * for level in range(d, self.maxlevels): + */ + if (unlikely(__pyx_v_tmpnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_tmpnode->next, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_prevnode->next == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_v_prevnode->next, __pyx_v_level, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/skiplist.pyx":149 + * prevnode.next[level] = tmpnode.next[level] + * + * for level in range(d, self.maxlevels): # <<<<<<<<<<<<<< + * tmpnode = chain[level] + * tmpnode.width[level] -= 1 + */ + __pyx_t_4 = __pyx_v_self->maxlevels; + for (__pyx_t_6 = __pyx_v_d; __pyx_t_6 < __pyx_t_4; __pyx_t_6+=1) { + __pyx_v_level = __pyx_t_6; + + /* "pandas/src/skiplist.pyx":150 + * + * for level in range(d, self.maxlevels): + * tmpnode = chain[level] # <<<<<<<<<<<<<< + * tmpnode.width[level] -= 1 + * + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_chain, __pyx_v_level, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5algos_Node))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_tmpnode, ((struct __pyx_obj_6pandas_5algos_Node *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":151 + * for level in range(d, self.maxlevels): + * tmpnode = chain[level] + * tmpnode.width[level] -= 1 # <<<<<<<<<<<<<< + * + * self.size -= 1 + */ + if (unlikely(__pyx_v_tmpnode->width == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(__pyx_v_tmpnode->width); + __pyx_t_7 = __pyx_v_tmpnode->width; + __pyx_t_8 = __pyx_v_level; + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_t_7, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_t_8, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + + /* "pandas/src/skiplist.pyx":153 + * tmpnode.width[level] -= 1 + * + * self.size -= 1 # <<<<<<<<<<<<<< + */ + __pyx_v_self->size = (__pyx_v_self->size - 1); + + /* "pandas/src/skiplist.pyx":120 + * self.size += 1 + * + * cpdef remove(self, double value): # <<<<<<<<<<<<<< + * cdef Py_ssize_t level, d + * cdef Node node, prevnode, tmpnode, next_at_level + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_node); + __Pyx_XDECREF((PyObject *)__pyx_v_prevnode); + __Pyx_XDECREF((PyObject *)__pyx_v_tmpnode); + __Pyx_XDECREF((PyObject *)__pyx_v_next_at_level); + __Pyx_XDECREF(__pyx_v_chain); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + double __pyx_v_value; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("remove (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_v_self), ((double)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_17IndexableSkiplist_10remove(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_self, double __pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("remove", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_self->__pyx_vtab)->remove(__pyx_v_self, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":93 + * # from cython cimport floating, integral + * + * cdef _take_2d_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_5algos__take_2d_float64(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_take_2d_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":97 + * cdef: + * Py_ssize_t i, j, N, K + * ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] result + * object val + */ + if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_idx; + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":101 + * object val + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * result = np.empty_like(values) + * for i in range(N): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":102 + * + * N, K = ( values).shape + * result = np.empty_like(values) # <<<<<<<<<<<<<< + * for i in range(N): + * for j in range(K): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":103 + * N, K = ( values).shape + * result = np.empty_like(values) + * for i in range(N): # <<<<<<<<<<<<<< + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + */ + __pyx_t_7 = __pyx_v_N; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/algos.pyx":104 + * result = np.empty_like(values) + * for i in range(N): + * for j in range(K): # <<<<<<<<<<<<<< + * result[i, j] = values[i, indexer[i, j]] + * return result + */ + __pyx_t_13 = __pyx_v_K; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "pandas/algos.pyx":105 + * for i in range(N): + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides)); + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + } + } + + /* "pandas/algos.pyx":106 + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + * return result # <<<<<<<<<<<<<< + * + * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":93 + * # from cython cimport floating, integral + * + * cdef _take_2d_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos._take_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":108 + * return result + * + * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_5algos__take_2d_int64(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_take_2d_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":112 + * cdef: + * Py_ssize_t i, j, N, K + * ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx # <<<<<<<<<<<<<< + * ndarray[int64_t, ndim=2] result + * object val + */ + if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_idx; + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":116 + * object val + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * result = np.empty_like(values) + * for i in range(N): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":117 + * + * N, K = ( values).shape + * result = np.empty_like(values) # <<<<<<<<<<<<<< + * for i in range(N): + * for j in range(K): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":118 + * N, K = ( values).shape + * result = np.empty_like(values) + * for i in range(N): # <<<<<<<<<<<<<< + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + */ + __pyx_t_7 = __pyx_v_N; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/algos.pyx":119 + * result = np.empty_like(values) + * for i in range(N): + * for j in range(K): # <<<<<<<<<<<<<< + * result[i, j] = values[i, indexer[i, j]] + * return result + */ + __pyx_t_13 = __pyx_v_K; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "pandas/algos.pyx":120 + * for i in range(N): + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides)); + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + } + } + + /* "pandas/algos.pyx":121 + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + * return result # <<<<<<<<<<<<<< + * + * cdef _take_2d_object(ndarray[object, ndim=2] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":108 + * return result + * + * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos._take_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":123 + * return result + * + * cdef _take_2d_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_5algos__take_2d_object(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + PyObject **__pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_take_2d_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":127 + * cdef: + * Py_ssize_t i, j, N, K + * ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx # <<<<<<<<<<<<<< + * ndarray[object, ndim=2] result + * object val + */ + if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_idx; + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_indexer.diminfo[1].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_indexer.diminfo[1].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":131 + * object val + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * result = values.copy() + * for i in range(N): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":132 + * + * N, K = ( values).shape + * result = values.copy() # <<<<<<<<<<<<<< + * for i in range(N): + * for j in range(K): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":133 + * N, K = ( values).shape + * result = values.copy() + * for i in range(N): # <<<<<<<<<<<<<< + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + */ + __pyx_t_7 = __pyx_v_N; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/algos.pyx":134 + * result = values.copy() + * for i in range(N): + * for j in range(K): # <<<<<<<<<<<<<< + * result[i, j] = values[i, indexer[i, j]] + * return result + */ + __pyx_t_13 = __pyx_v_K; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; + + /* "pandas/algos.pyx":135 + * for i in range(N): + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[1].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[1].strides)); + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_21); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_21); + *__pyx_t_21 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_21); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + } + + /* "pandas/algos.pyx":136 + * for j in range(K): + * result[i, j] = values[i, indexer[i, j]] + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":123 + * return result + * + * cdef _take_2d_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * object idx): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos._take_2d_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":139 + * + * + * cdef inline bint float64_are_diff(float64_t left, float64_t right): # <<<<<<<<<<<<<< + * cdef double abs_diff, allowed + * if right == MAXfloat64 or right == -MAXfloat64: + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5algos_float64_are_diff(__pyx_t_5numpy_float64_t __pyx_v_left, __pyx_t_5numpy_float64_t __pyx_v_right) { + double __pyx_v_abs_diff; + double __pyx_v_allowed; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("float64_are_diff", 0); + + /* "pandas/algos.pyx":141 + * cdef inline bint float64_are_diff(float64_t left, float64_t right): + * cdef double abs_diff, allowed + * if right == MAXfloat64 or right == -MAXfloat64: # <<<<<<<<<<<<<< + * if left == right: + * return False + */ + __pyx_t_1 = ((__pyx_v_right == __pyx_v_6pandas_5algos_MAXfloat64) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_right == (-__pyx_v_6pandas_5algos_MAXfloat64)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/algos.pyx":142 + * cdef double abs_diff, allowed + * if right == MAXfloat64 or right == -MAXfloat64: + * if left == right: # <<<<<<<<<<<<<< + * return False + * else: + */ + __pyx_t_3 = ((__pyx_v_left == __pyx_v_right) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":143 + * if right == MAXfloat64 or right == -MAXfloat64: + * if left == right: + * return False # <<<<<<<<<<<<<< + * else: + * return True + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":145 + * return False + * else: + * return True # <<<<<<<<<<<<<< + * else: + * abs_diff = fabs(left - right) + */ + __pyx_r = 1; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/algos.pyx":147 + * return True + * else: + * abs_diff = fabs(left - right) # <<<<<<<<<<<<<< + * allowed = REL_TOL * fabs(right) + * return abs_diff > allowed + */ + __pyx_v_abs_diff = fabs((__pyx_v_left - __pyx_v_right)); + + /* "pandas/algos.pyx":148 + * else: + * abs_diff = fabs(left - right) + * allowed = REL_TOL * fabs(right) # <<<<<<<<<<<<<< + * return abs_diff > allowed + * + */ + __pyx_v_allowed = (__pyx_v_6pandas_5algos_REL_TOL * fabs(__pyx_v_right)); + + /* "pandas/algos.pyx":149 + * abs_diff = fabs(left - right) + * allowed = REL_TOL * fabs(right) + * return abs_diff > allowed # <<<<<<<<<<<<<< + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, + */ + __pyx_r = (__pyx_v_abs_diff > __pyx_v_allowed); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":139 + * + * + * cdef inline bint float64_are_diff(float64_t left, float64_t right): # <<<<<<<<<<<<<< + * cdef double abs_diff, allowed + * if right == MAXfloat64 or right == -MAXfloat64: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_1rank_1d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_rank_1d_float64[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_1rank_1d_float64 = {__Pyx_NAMESTR("rank_1d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_1rank_1d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_rank_1d_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_1rank_1d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_1d_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_n_s_average); + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)__pyx_n_s_keep); + + /* "pandas/algos.pyx":152 + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, + * na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_float64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_ties_method = values[1]; + __pyx_v_ascending = values[2]; + __pyx_v_na_option = values[3]; + __pyx_v_pct = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_1d_float64", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_1d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_rank_1d_float64(__pyx_self, __pyx_v_in_arr, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_rank_1d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_sorted_data = 0; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_argsorted = 0; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_nan_value; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + int __pyx_v_keep_na; + float __pyx_v_count; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sorted_data; + __Pyx_Buffer __pyx_pybuffer_sorted_data; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __pyx_t_5numpy_float64_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + __pyx_t_5numpy_int64_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + __pyx_t_5numpy_int64_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + __pyx_t_5numpy_int64_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_1d_float64", 0); + __pyx_pybuffer_sorted_data.pybuffer.buf = NULL; + __pyx_pybuffer_sorted_data.refcount = 0; + __pyx_pybuffernd_sorted_data.data = NULL; + __pyx_pybuffernd_sorted_data.rcbuffer = &__pyx_pybuffer_sorted_data; + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":158 + * + * cdef: + * Py_ssize_t i, j, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t] sorted_data, ranks, values + * ndarray[int64_t] argsorted + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":162 + * ndarray[int64_t] argsorted + * float64_t val, nan_value + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * bint keep_na = 0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":163 + * float64_t val, nan_value + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * bint keep_na = 0 + * float count = 0.0 + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":164 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * bint keep_na = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_keep_na = 0; + + /* "pandas/algos.pyx":165 + * int tiebreak = 0 + * bint keep_na = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * tiebreak = tiebreakers[ties_method] + * + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":166 + * bint keep_na = 0 + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * values = np.asarray(in_arr).copy() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":168 + * tiebreak = tiebreakers[ties_method] + * + * values = np.asarray(in_arr).copy() # <<<<<<<<<<<<<< + * + * keep_na = na_option == 'keep' + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":170 + * values = np.asarray(in_arr).copy() + * + * keep_na = na_option == 'keep' # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_keep_na = __pyx_t_9; + + /* "pandas/algos.pyx":172 + * keep_na = na_option == 'keep' + * + * if ascending ^ (na_option == 'top'): # <<<<<<<<<<<<<< + * nan_value = np.inf + * else: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_9) { + + /* "pandas/algos.pyx":173 + * + * if ascending ^ (na_option == 'top'): + * nan_value = np.inf # <<<<<<<<<<<<<< + * else: + * nan_value = -np.inf + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_nan_value = __pyx_t_10; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":175 + * nan_value = np.inf + * else: + * nan_value = -np.inf # <<<<<<<<<<<<<< + * mask = np.isnan(values) + * np.putmask(values, mask, nan_value) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_nan_value = __pyx_t_10; + } + __pyx_L3:; + + /* "pandas/algos.pyx":176 + * else: + * nan_value = -np.inf + * mask = np.isnan(values) # <<<<<<<<<<<<<< + * np.putmask(values, mask, nan_value) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_mask = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":177 + * nan_value = -np.inf + * mask = np.isnan(values) + * np.putmask(values, mask, nan_value) # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nan_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":179 + * np.putmask(values, mask, nan_value) + * + * n = len(values) # <<<<<<<<<<<<<< + * ranks = np.empty(n, dtype='f8') + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_11; + + /* "pandas/algos.pyx":180 + * + * n = len(values) + * ranks = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * + * # py2.5/win32 hack, can't pass i8 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/algos.pyx":183 + * + * # py2.5/win32 hack, can't pass i8 + * if tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') + */ + __pyx_t_9 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_9) { + + /* "pandas/algos.pyx":185 + * if tiebreak == TIEBREAK_FIRST: + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') # <<<<<<<<<<<<<< + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":186 + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') + * if not ascending: # <<<<<<<<<<<<<< + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = ((!__pyx_t_9) != 0); + if (__pyx_t_13) { + + /* "pandas/algos.pyx":187 + * _as = values.argsort(kind='mergesort') + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING # <<<<<<<<<<<<<< + * else: + * _as = values.argsort() + */ + __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":189 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort() # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v__as = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "pandas/algos.pyx":191 + * _as = values.argsort() + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[::-1] + * + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((!__pyx_t_13) != 0); + if (__pyx_t_9) { + + /* "pandas/algos.pyx":192 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_t_1 = PyObject_GetItem(__pyx_v__as, __pyx_slice__2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/algos.pyx":194 + * _as = _as[::-1] + * + * sorted_data = values.take(_as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v__as); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__as); + __Pyx_GIVEREF(__pyx_v__as); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_sorted_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_sorted_data.diminfo[0].strides = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sorted_data.diminfo[0].shape = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/algos.pyx":195 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":197 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * sum_ranks += i + 1 + * dups += 1 + */ + __pyx_t_11 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_11; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/algos.pyx":198 + * + * for i in range(n): + * sum_ranks += i + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = sorted_data[i] + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1)); + + /* "pandas/algos.pyx":199 + * for i in range(n): + * sum_ranks += i + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = sorted_data[i] + * if (val == nan_value) and keep_na: + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":200 + * sum_ranks += i + 1 + * dups += 1 + * val = sorted_data[i] # <<<<<<<<<<<<<< + * if (val == nan_value) and keep_na: + * ranks[argsorted[i]] = nan + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_sorted_data.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_sorted_data.diminfo[0].strides)); + + /* "pandas/algos.pyx":201 + * dups += 1 + * val = sorted_data[i] + * if (val == nan_value) and keep_na: # <<<<<<<<<<<<<< + * ranks[argsorted[i]] = nan + * continue + */ + __pyx_t_9 = ((__pyx_v_val == __pyx_v_nan_value) != 0); + if (__pyx_t_9) { + __pyx_t_13 = (__pyx_v_keep_na != 0); + } else { + __pyx_t_13 = __pyx_t_9; + } + if (__pyx_t_13) { + + /* "pandas/algos.pyx":202 + * val = sorted_data[i] + * if (val == nan_value) and keep_na: + * ranks[argsorted[i]] = nan # <<<<<<<<<<<<<< + * continue + * count += 1.0 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_6pandas_5algos_nan; + + /* "pandas/algos.pyx":203 + * if (val == nan_value) and keep_na: + * ranks[argsorted[i]] = nan + * continue # <<<<<<<<<<<<<< + * count += 1.0 + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): + */ + goto __pyx_L7_continue; + } + + /* "pandas/algos.pyx":204 + * ranks[argsorted[i]] = nan + * continue + * count += 1.0 # <<<<<<<<<<<<<< + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":205 + * continue + * count += 1.0 + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_13 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0); + if (!__pyx_t_13) { + __pyx_t_19 = (__pyx_v_i + 1); + __pyx_t_3 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_sorted_data.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (__pyx_f_6pandas_5algos_float64_are_diff((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_sorted_data.diminfo[0].strides)), __pyx_v_val) != 0); + __pyx_t_20 = __pyx_t_9; + } else { + __pyx_t_20 = __pyx_t_13; + } + if (__pyx_t_20) { + + /* "pandas/algos.pyx":206 + * count += 1.0 + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":207 + * if i == n - 1 or float64_are_diff(sorted_data[i + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":208 + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":209 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":210 + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":211 + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":212 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":213 + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":214 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":215 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":216 + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":217 + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_29 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_j + 1); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":218 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":219 + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":220 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2); + } + goto __pyx_L11; + } + + /* "pandas/algos.pyx":221 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_20 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_20) { + + /* "pandas/algos.pyx":222 + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":223 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_21 = (__pyx_v_i + 1); + for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":224 + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_34 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":225 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * return ranks / count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L10; + } + __pyx_L10:; + __pyx_L7_continue:; + } + + /* "pandas/algos.pyx":226 + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * return ranks / count + * else: + */ + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_20) { + + /* "pandas/algos.pyx":227 + * sum_ranks = dups = 0 + * if pct: + * return ranks / count # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":229 + * return ranks / count + * else: + * return ranks # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_1d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data); + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_3rank_1d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_2rank_1d_int64[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_3rank_1d_int64 = {__Pyx_NAMESTR("rank_1d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_3rank_1d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_2rank_1d_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_3rank_1d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + CYTHON_UNUSED PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_1d_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_n_s_average); + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)__pyx_n_s_keep); + + /* "pandas/algos.pyx":233 + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, + * na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_ties_method = values[1]; + __pyx_v_ascending = values[2]; + __pyx_v_na_option = values[3]; + __pyx_v_pct = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_1d_int64", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_1d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_2rank_1d_int64(__pyx_self, __pyx_v_in_arr, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_2rank_1d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_sorted_data = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_argsorted = 0; + __pyx_t_5numpy_int64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + float __pyx_v_count; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sorted_data; + __Pyx_Buffer __pyx_pybuffer_sorted_data; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + __pyx_t_5numpy_int64_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + __pyx_t_5numpy_int64_t __pyx_t_32; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_1d_int64", 0); + __pyx_pybuffer_sorted_data.pybuffer.buf = NULL; + __pyx_pybuffer_sorted_data.refcount = 0; + __pyx_pybuffernd_sorted_data.data = NULL; + __pyx_pybuffernd_sorted_data.rcbuffer = &__pyx_pybuffer_sorted_data; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":239 + * + * cdef: + * Py_ssize_t i, j, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[int64_t] sorted_data, values + * ndarray[float64_t] ranks + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":244 + * ndarray[int64_t] argsorted + * int64_t val + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * float count = 0.0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":245 + * int64_t val + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":246 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * tiebreak = tiebreakers[ties_method] + * + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":247 + * int tiebreak = 0 + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * values = np.asarray(in_arr) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":249 + * tiebreak = tiebreakers[ties_method] + * + * values = np.asarray(in_arr) # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":251 + * values = np.asarray(in_arr) + * + * n = len(values) # <<<<<<<<<<<<<< + * ranks = np.empty(n, dtype='f8') + * + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_9; + + /* "pandas/algos.pyx":252 + * + * n = len(values) + * ranks = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * + * # py2.5/win32 hack, can't pass i8 + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/algos.pyx":255 + * + * # py2.5/win32 hack, can't pass i8 + * if tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') + */ + __pyx_t_12 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_12) { + + /* "pandas/algos.pyx":257 + * if tiebreak == TIEBREAK_FIRST: + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') # <<<<<<<<<<<<<< + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v__as = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":258 + * # need to use a stable sort here + * _as = values.argsort(kind='mergesort') + * if not ascending: # <<<<<<<<<<<<<< + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + */ + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = ((!__pyx_t_12) != 0); + if (__pyx_t_13) { + + /* "pandas/algos.pyx":259 + * _as = values.argsort(kind='mergesort') + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING # <<<<<<<<<<<<<< + * else: + * _as = values.argsort() + */ + __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":261 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort() # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/algos.pyx":263 + * _as = values.argsort() + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[::-1] + * + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((!__pyx_t_13) != 0); + if (__pyx_t_12) { + + /* "pandas/algos.pyx":264 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v__as, __pyx_slice__4); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":266 + * _as = _as[::-1] + * + * sorted_data = values.take(_as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__as); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__as); + __Pyx_GIVEREF(__pyx_v__as); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_sorted_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_sorted_data.diminfo[0].strides = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sorted_data.diminfo[0].shape = __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/algos.pyx":267 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":269 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * sum_ranks += i + 1 + * dups += 1 + */ + __pyx_t_9 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_9; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/algos.pyx":270 + * + * for i in range(n): + * sum_ranks += i + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = sorted_data[i] + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1)); + + /* "pandas/algos.pyx":271 + * for i in range(n): + * sum_ranks += i + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = sorted_data[i] + * count += 1.0 + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":272 + * sum_ranks += i + 1 + * dups += 1 + * val = sorted_data[i] # <<<<<<<<<<<<<< + * count += 1.0 + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_sorted_data.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_sorted_data.diminfo[0].strides)); + + /* "pandas/algos.pyx":273 + * dups += 1 + * val = sorted_data[i] + * count += 1.0 # <<<<<<<<<<<<<< + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":274 + * val = sorted_data[i] + * count += 1.0 + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_12 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0); + if (!__pyx_t_12) { + __pyx_t_17 = (__pyx_v_i + 1); + __pyx_t_3 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_sorted_data.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_sorted_data.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = ((fabs(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_sorted_data.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_sorted_data.diminfo[0].strides)) - __pyx_v_val)) > 0.0) != 0); + __pyx_t_18 = __pyx_t_13; + } else { + __pyx_t_18 = __pyx_t_12; + } + if (__pyx_t_18) { + + /* "pandas/algos.pyx":275 + * count += 1.0 + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":276 + * if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0: + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":277 + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":278 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":279 + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":280 + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":281 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":282 + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":283 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":284 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":285 + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":286 + * elif tiebreak == TIEBREAK_FIRST: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_j + 1); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":287 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":288 + * ranks[argsorted[j]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":289 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_29 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2); + } + goto __pyx_L9; + } + + /* "pandas/algos.pyx":290 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_18 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_18) { + + /* "pandas/algos.pyx":291 + * ranks[argsorted[j]] = 2 * i - j - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":292 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_19 = (__pyx_v_i + 1); + for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/algos.pyx":293 + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":294 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * return ranks / count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "pandas/algos.pyx":295 + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * return ranks / count + * else: + */ + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_18) { + + /* "pandas/algos.pyx":296 + * sum_ranks = dups = 0 + * if pct: + * return ranks / count # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":298 + * return ranks / count + * else: + * return ranks # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_1d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sorted_data.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_5rank_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_4rank_2d_float64[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_5rank_2d_float64 = {__Pyx_NAMESTR("rank_2d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_5rank_2d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_4rank_2d_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_5rank_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_2d_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_int_0); + values[2] = ((PyObject *)__pyx_n_s_average); + + /* "pandas/algos.pyx":302 + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', + * ascending=True, na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)__pyx_n_s_keep); + values[5] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_float64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_axis = values[1]; + __pyx_v_ties_method = values[2]; + __pyx_v_ascending = values[3]; + __pyx_v_na_option = values[4]; + __pyx_v_pct = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_2d_float64", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_4rank_2d_float64(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_4rank_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_z; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_argsorted = 0; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_nan_value; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + int __pyx_v_keep_na; + float __pyx_v_count; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + PyArrayObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + int __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + __pyx_t_5numpy_int64_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + __pyx_t_5numpy_int64_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + __pyx_t_5numpy_int64_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + __pyx_t_5numpy_int64_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_int64_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + __pyx_t_5numpy_int64_t __pyx_t_53; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_2d_float64", 0); + __Pyx_INCREF(__pyx_v_in_arr); + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":308 + * + * cdef: + * Py_ssize_t i, j, z, k, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] ranks, values + * ndarray[int64_t, ndim=2] argsorted + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":312 + * ndarray[int64_t, ndim=2] argsorted + * float64_t val, nan_value + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * bint keep_na = 0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":313 + * float64_t val, nan_value + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * bint keep_na = 0 + * float count = 0.0 + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":314 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * bint keep_na = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * + */ + __pyx_v_keep_na = 0; + + /* "pandas/algos.pyx":315 + * int tiebreak = 0 + * bint keep_na = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":317 + * float count = 0.0 + * + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * keep_na = na_option == 'keep' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":319 + * tiebreak = tiebreakers[ties_method] + * + * keep_na = na_option == 'keep' # <<<<<<<<<<<<<< + * + * in_arr = np.asarray(in_arr) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_keep_na = __pyx_t_4; + + /* "pandas/algos.pyx":321 + * keep_na = na_option == 'keep' + * + * in_arr = np.asarray(in_arr) # <<<<<<<<<<<<<< + * + * if axis == 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_in_arr, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":323 + * in_arr = np.asarray(in_arr) + * + * if axis == 0: # <<<<<<<<<<<<<< + * values = in_arr.T.copy() + * else: + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":324 + * + * if axis == 0: + * values = in_arr.T.copy() # <<<<<<<<<<<<<< + * else: + * values = in_arr.copy() + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":326 + * values = in_arr.T.copy() + * else: + * values = in_arr.copy() # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "pandas/algos.pyx":328 + * values = in_arr.copy() + * + * if ascending ^ (na_option == 'top'): # <<<<<<<<<<<<<< + * nan_value = np.inf + * else: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":329 + * + * if ascending ^ (na_option == 'top'): + * nan_value = np.inf # <<<<<<<<<<<<<< + * else: + * nan_value = -np.inf + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nan_value = __pyx_t_10; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":331 + * nan_value = np.inf + * else: + * nan_value = -np.inf # <<<<<<<<<<<<<< + * + * np.putmask(values, np.isnan(values), nan_value) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nan_value = __pyx_t_10; + } + __pyx_L4:; + + /* "pandas/algos.pyx":333 + * nan_value = -np.inf + * + * np.putmask(values, np.isnan(values), nan_value) # <<<<<<<<<<<<<< + * + * n, k = ( values).shape + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nan_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_11 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":335 + * np.putmask(values, np.isnan(values), nan_value) + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * ranks = np.empty((n, k), dtype='f8') + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_n = __pyx_t_13; + __pyx_v_k = __pyx_t_14; + + /* "pandas/algos.pyx":336 + * + * n, k = ( values).shape + * ranks = np.empty((n, k), dtype='f8') # <<<<<<<<<<<<<< + * + * if tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":338 + * ranks = np.empty((n, k), dtype='f8') + * + * if tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') + */ + __pyx_t_4 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":340 + * if tiebreak == TIEBREAK_FIRST: + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') # <<<<<<<<<<<<<< + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_axis, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v__as = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":341 + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') + * if not ascending: # <<<<<<<<<<<<<< + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((!__pyx_t_4) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":342 + * _as = values.argsort(axis=1, kind='mergesort') + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING # <<<<<<<<<<<<<< + * else: + * _as = values.argsort(1) + */ + __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; + goto __pyx_L8; + } + __pyx_L8:; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/algos.pyx":344 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_11; + __pyx_t_11 = 0; + } + __pyx_L7:; + + /* "pandas/algos.pyx":346 + * _as = values.argsort(1) + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[:, ::-1] + * + */ + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((!__pyx_t_15) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":347 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_float64(values, _as) + */ + __pyx_t_11 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__9); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":349 + * _as = _as[:, ::-1] + * + * values = _take_2d_float64(values, _as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_11 = __pyx_f_6pandas_5algos__take_2d_float64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_11)); + __pyx_t_11 = 0; + + /* "pandas/algos.pyx":350 + * + * values = _take_2d_float64(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":352 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * dups = sum_ranks = 0 + * total_tie_count = 0 + */ + __pyx_t_14 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":353 + * + * for i in range(n): + * dups = sum_ranks = 0 # <<<<<<<<<<<<<< + * total_tie_count = 0 + * count = 0.0 + */ + __pyx_v_dups = 0; + __pyx_v_sum_ranks = 0; + + /* "pandas/algos.pyx":354 + * for i in range(n): + * dups = sum_ranks = 0 + * total_tie_count = 0 # <<<<<<<<<<<<<< + * count = 0.0 + * for j in range(k): + */ + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":355 + * dups = sum_ranks = 0 + * total_tie_count = 0 + * count = 0.0 # <<<<<<<<<<<<<< + * for j in range(k): + * sum_ranks += j + 1 + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":356 + * total_tie_count = 0 + * count = 0.0 + * for j in range(k): # <<<<<<<<<<<<<< + * sum_ranks += j + 1 + * dups += 1 + */ + __pyx_t_17 = __pyx_v_k; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_j = __pyx_t_18; + + /* "pandas/algos.pyx":357 + * count = 0.0 + * for j in range(k): + * sum_ranks += j + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = values[i, j] + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_j + 1)); + + /* "pandas/algos.pyx":358 + * for j in range(k): + * sum_ranks += j + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = values[i, j] + * if val == nan_value and keep_na: + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":359 + * sum_ranks += j + 1 + * dups += 1 + * val = values[i, j] # <<<<<<<<<<<<<< + * if val == nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/algos.pyx":360 + * dups += 1 + * val = values[i, j] + * if val == nan_value and keep_na: # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, j]] = nan + * continue + */ + __pyx_t_4 = ((__pyx_v_val == __pyx_v_nan_value) != 0); + if (__pyx_t_4) { + __pyx_t_15 = (__pyx_v_keep_na != 0); + } else { + __pyx_t_15 = __pyx_t_4; + } + if (__pyx_t_15) { + + /* "pandas/algos.pyx":361 + * val = values[i, j] + * if val == nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan # <<<<<<<<<<<<<< + * continue + * count += 1.0 + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + + /* "pandas/algos.pyx":362 + * if val == nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan + * continue # <<<<<<<<<<<<<< + * count += 1.0 + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): + */ + goto __pyx_L12_continue; + } + + /* "pandas/algos.pyx":363 + * ranks[i, argsorted[i, j]] = nan + * continue + * count += 1.0 # <<<<<<<<<<<<<< + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":364 + * continue + * count += 1.0 + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_15 = ((__pyx_v_j == (__pyx_v_k - 1)) != 0); + if (!__pyx_t_15) { + __pyx_t_25 = __pyx_v_i; + __pyx_t_26 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (__pyx_f_6pandas_5algos_float64_are_diff((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_values.diminfo[1].strides)), __pyx_v_val) != 0); + __pyx_t_27 = __pyx_t_4; + } else { + __pyx_t_27 = __pyx_t_15; + } + if (__pyx_t_27) { + + /* "pandas/algos.pyx":365 + * count += 1.0 + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":366 + * if j == k - 1 or float64_are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":367 + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":368 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":369 + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":370 + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":371 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":372 + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":373 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":374 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":375 + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":376 + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_43 < 0) { + __pyx_t_43 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_z + 1); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":377 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":378 + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":379 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_46 = __pyx_v_i; + __pyx_t_47 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_46 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_47 < 0) { + __pyx_t_47 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_48 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_49 < 0) { + __pyx_t_49 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2); + } + goto __pyx_L16; + } + + /* "pandas/algos.pyx":380 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_27 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_27) { + + /* "pandas/algos.pyx":381 + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":382 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_28 = (__pyx_v_j + 1); + for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_z = __pyx_t_29; + + /* "pandas/algos.pyx":383 + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_50 = __pyx_v_i; + __pyx_t_51 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_50 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_50 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_51 < 0) { + __pyx_t_51 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_51 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_52 = __pyx_v_i; + __pyx_t_53 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_52 < 0) { + __pyx_t_52 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_52 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_53 < 0) { + __pyx_t_53 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_53 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/algos.pyx":384 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * ranks[i, :] /= count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L15; + } + __pyx_L15:; + __pyx_L12_continue:; + } + + /* "pandas/algos.pyx":385 + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * ranks[i, :] /= count + * if axis == 0: + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_27) { + + /* "pandas/algos.pyx":386 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_slice__11); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_slice__11); + __Pyx_GIVEREF(__pyx_slice__11); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_11); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_11, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L29; + } + __pyx_L29:; + } + + /* "pandas/algos.pyx":387 + * if pct: + * ranks[i, :] /= count + * if axis == 0: # <<<<<<<<<<<<<< + * return ranks.T + * else: + */ + __pyx_t_11 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_27) { + + /* "pandas/algos.pyx":388 + * ranks[i, :] /= count + * if axis == 0: + * return ranks.T # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":390 + * return ranks.T + * else: + * return ranks # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XDECREF(__pyx_v_in_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_7rank_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_6rank_2d_int64[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_7rank_2d_int64 = {__Pyx_NAMESTR("rank_2d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_7rank_2d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_6rank_2d_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_7rank_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + CYTHON_UNUSED PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_2d_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_int_0); + values[2] = ((PyObject *)__pyx_n_s_average); + + /* "pandas/algos.pyx":394 + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', + * ascending=True, na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)__pyx_n_s_keep); + values[5] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_axis = values[1]; + __pyx_v_ties_method = values[2]; + __pyx_v_ascending = values[3]; + __pyx_v_na_option = values[4]; + __pyx_v_pct = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_2d_int64", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_6rank_2d_int64(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_6rank_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, CYTHON_UNUSED PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_z; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_argsorted = 0; + PyArrayObject *__pyx_v_values = 0; + __pyx_t_5numpy_int64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + float __pyx_v_count; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyArrayObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + __pyx_t_5numpy_int64_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + __pyx_t_5numpy_int64_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + __pyx_t_5numpy_int64_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + __pyx_t_5numpy_int64_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + __pyx_t_5numpy_int64_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_int64_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_2d_int64", 0); + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + + /* "pandas/algos.pyx":400 + * + * cdef: + * Py_ssize_t i, j, z, k, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] ranks + * ndarray[int64_t, ndim=2] argsorted + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":405 + * ndarray[int64_t, ndim=2, cast=True] values + * int64_t val + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * float count = 0.0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":406 + * int64_t val + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":407 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * tiebreak = tiebreakers[ties_method] + * + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":408 + * int tiebreak = 0 + * float count = 0.0 + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * if axis == 0: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":410 + * tiebreak = tiebreakers[ties_method] + * + * if axis == 0: # <<<<<<<<<<<<<< + * values = np.asarray(in_arr).T + * else: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":411 + * + * if axis == 0: + * values = np.asarray(in_arr).T # <<<<<<<<<<<<<< + * else: + * values = np.asarray(in_arr) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":413 + * values = np.asarray(in_arr).T + * else: + * values = np.asarray(in_arr) # <<<<<<<<<<<<<< + * + * n, k = ( values).shape + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "pandas/algos.pyx":415 + * values = np.asarray(in_arr) + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * ranks = np.empty((n, k), dtype='f8') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_n = __pyx_t_12; + __pyx_v_k = __pyx_t_13; + + /* "pandas/algos.pyx":416 + * + * n, k = ( values).shape + * ranks = np.empty((n, k), dtype='f8') # <<<<<<<<<<<<<< + * + * if tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":418 + * ranks = np.empty((n, k), dtype='f8') + * + * if tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') + */ + __pyx_t_4 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":420 + * if tiebreak == TIEBREAK_FIRST: + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') # <<<<<<<<<<<<<< + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_axis, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_kind, __pyx_n_s_mergesort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v__as = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":421 + * # need to use a stable sort here + * _as = values.argsort(axis=1, kind='mergesort') + * if not ascending: # <<<<<<<<<<<<<< + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((!__pyx_t_4) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":422 + * _as = values.argsort(axis=1, kind='mergesort') + * if not ascending: + * tiebreak = TIEBREAK_FIRST_DESCENDING # <<<<<<<<<<<<<< + * else: + * _as = values.argsort(1) + */ + __pyx_v_tiebreak = __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING; + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/algos.pyx":424 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v__as = __pyx_t_10; + __pyx_t_10 = 0; + } + __pyx_L6:; + + /* "pandas/algos.pyx":426 + * _as = values.argsort(1) + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[:, ::-1] + * + */ + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((!__pyx_t_15) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":427 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_int64(values, _as) + */ + __pyx_t_10 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__15); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_10); + __pyx_t_10 = 0; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":429 + * _as = _as[:, ::-1] + * + * values = _take_2d_int64(values, _as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_10 = __pyx_f_6pandas_5algos__take_2d_int64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_10)); + __pyx_t_10 = 0; + + /* "pandas/algos.pyx":430 + * + * values = _take_2d_int64(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":432 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * dups = sum_ranks = 0 + * total_tie_count = 0 + */ + __pyx_t_13 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/algos.pyx":433 + * + * for i in range(n): + * dups = sum_ranks = 0 # <<<<<<<<<<<<<< + * total_tie_count = 0 + * count = 0.0 + */ + __pyx_v_dups = 0; + __pyx_v_sum_ranks = 0; + + /* "pandas/algos.pyx":434 + * for i in range(n): + * dups = sum_ranks = 0 + * total_tie_count = 0 # <<<<<<<<<<<<<< + * count = 0.0 + * for j in range(k): + */ + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":435 + * dups = sum_ranks = 0 + * total_tie_count = 0 + * count = 0.0 # <<<<<<<<<<<<<< + * for j in range(k): + * sum_ranks += j + 1 + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":436 + * total_tie_count = 0 + * count = 0.0 + * for j in range(k): # <<<<<<<<<<<<<< + * sum_ranks += j + 1 + * dups += 1 + */ + __pyx_t_17 = __pyx_v_k; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_j = __pyx_t_18; + + /* "pandas/algos.pyx":437 + * count = 0.0 + * for j in range(k): + * sum_ranks += j + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = values[i, j] + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_j + 1)); + + /* "pandas/algos.pyx":438 + * for j in range(k): + * sum_ranks += j + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = values[i, j] + * count += 1.0 + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":439 + * sum_ranks += j + 1 + * dups += 1 + * val = values[i, j] # <<<<<<<<<<<<<< + * count += 1.0 + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/algos.pyx":440 + * dups += 1 + * val = values[i, j] + * count += 1.0 # <<<<<<<<<<<<<< + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":441 + * val = values[i, j] + * count += 1.0 + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_4 = ((__pyx_v_j == (__pyx_v_k - 1)) != 0); + if (!__pyx_t_4) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = ((fabs(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)) - __pyx_v_val)) > __pyx_v_6pandas_5algos_FP_ERR) != 0); + __pyx_t_23 = __pyx_t_15; + } else { + __pyx_t_23 = __pyx_t_4; + } + if (__pyx_t_23) { + + /* "pandas/algos.pyx":442 + * count += 1.0 + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":443 + * if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR: + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":444 + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":445 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":446 + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":447 + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":448 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":449 + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":450 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":451 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":452 + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":453 + * elif tiebreak == TIEBREAK_FIRST: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_z + 1); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":454 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":455 + * ranks[i, argsorted[i, z]] = z + 1 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":456 + * elif tiebreak == TIEBREAK_FIRST_DESCENDING: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_43 < 0) { + __pyx_t_43 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2); + } + goto __pyx_L14; + } + + /* "pandas/algos.pyx":457 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_23 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_23) { + + /* "pandas/algos.pyx":458 + * ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":459 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_24 = (__pyx_v_j + 1); + for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_z = __pyx_t_25; + + /* "pandas/algos.pyx":460 + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_46 = __pyx_v_i; + __pyx_t_47 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_46 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_47 < 0) { + __pyx_t_47 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_48 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_49 < 0) { + __pyx_t_49 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/algos.pyx":461 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * ranks[i, :] /= count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/algos.pyx":462 + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * ranks[i, :] /= count + * if axis == 0: + */ + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_23 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_23) { + + /* "pandas/algos.pyx":463 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_slice__17); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_slice__17); + __Pyx_GIVEREF(__pyx_slice__17); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_10); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_10, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L27; + } + __pyx_L27:; + } + + /* "pandas/algos.pyx":464 + * if pct: + * ranks[i, :] /= count + * if axis == 0: # <<<<<<<<<<<<<< + * return ranks.T + * else: + */ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_23 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_23) { + + /* "pandas/algos.pyx":465 + * ranks[i, :] /= count + * if axis == 0: + * return ranks.T # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":467 + * return ranks.T + * else: + * return ranks # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_9rank_1d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_8rank_1d_generic[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_9rank_1d_generic = {__Pyx_NAMESTR("rank_1d_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_9rank_1d_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_8rank_1d_generic)}; +static PyObject *__pyx_pw_6pandas_5algos_9rank_1d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + int __pyx_v_retry; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_1d_generic (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_retry,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[2] = ((PyObject *)__pyx_n_s_average); + + /* "pandas/algos.pyx":471 + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', + * ascending=True, na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)__pyx_n_s_keep); + values[5] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_retry); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_1d_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + if (values[1]) { + __pyx_v_retry = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_retry == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_retry = ((int)1); + } + __pyx_v_ties_method = values[2]; + __pyx_v_ascending = values[3]; + __pyx_v_na_option = values[4]; + __pyx_v_pct = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_1d_generic", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_8rank_1d_generic(__pyx_self, __pyx_v_in_arr, __pyx_v_retry, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_8rank_1d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, int __pyx_v_retry, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_sorted_data = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_argsorted = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_nan_value = 0; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + int __pyx_v_keep_na; + float __pyx_v_count; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_v__as = NULL; + PyObject *__pyx_v_valid_locs = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + PyArrayObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + __pyx_t_5numpy_int64_t __pyx_t_20; + int __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + __pyx_t_5numpy_int64_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + __pyx_t_5numpy_int64_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + __pyx_t_5numpy_int64_t __pyx_t_31; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_1d_generic", 0); + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":477 + * + * cdef: + * Py_ssize_t i, j, n, dups = 0, total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t] ranks + * ndarray sorted_data, values + */ + __pyx_v_dups = 0; + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":482 + * ndarray[int64_t] argsorted + * object val, nan_value + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * bint keep_na = 0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":483 + * object val, nan_value + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * bint keep_na = 0 + * float count = 0.0 + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":484 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * bint keep_na = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * + */ + __pyx_v_keep_na = 0; + + /* "pandas/algos.pyx":485 + * int tiebreak = 0 + * bint keep_na = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":488 + * + * + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * keep_na = na_option == 'keep' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":490 + * tiebreak = tiebreakers[ties_method] + * + * keep_na = na_option == 'keep' # <<<<<<<<<<<<<< + * + * values = np.array(in_arr, copy=True) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_keep_na = __pyx_t_4; + + /* "pandas/algos.pyx":492 + * keep_na = na_option == 'keep' + * + * values = np.array(in_arr, copy=True) # <<<<<<<<<<<<<< + * + * if values.dtype != np.object_: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_values = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/algos.pyx":494 + * values = np.array(in_arr, copy=True) + * + * if values.dtype != np.object_: # <<<<<<<<<<<<<< + * values = values.astype('O') + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":495 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/algos.pyx":497 + * values = values.astype('O') + * + * if ascending ^ (na_option == 'top'): # <<<<<<<<<<<<<< + * # always greater than everything + * nan_value = Infinity() + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":499 + * if ascending ^ (na_option == 'top'): + * # always greater than everything + * nan_value = Infinity() # <<<<<<<<<<<<<< + * else: + * nan_value = NegInfinity() + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Infinity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_nan_value = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":501 + * nan_value = Infinity() + * else: + * nan_value = NegInfinity() # <<<<<<<<<<<<<< + * + * mask = lib.isnullobj(values) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NegInfinity); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nan_value = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L4:; + + /* "pandas/algos.pyx":503 + * nan_value = NegInfinity() + * + * mask = lib.isnullobj(values) # <<<<<<<<<<<<<< + * np.putmask(values, mask, nan_value) + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnullobj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_mask = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/algos.pyx":504 + * + * mask = lib.isnullobj(values) + * np.putmask(values, mask, nan_value) # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + __Pyx_INCREF(__pyx_v_nan_value); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_nan_value); + __Pyx_GIVEREF(__pyx_v_nan_value); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":506 + * np.putmask(values, mask, nan_value) + * + * n = len(values) # <<<<<<<<<<<<<< + * ranks = np.empty(n, dtype='f8') + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_7; + + /* "pandas/algos.pyx":507 + * + * n = len(values) + * ranks = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * + * # py2.5/win32 hack, can't pass i8 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":510 + * + * # py2.5/win32 hack, can't pass i8 + * try: # <<<<<<<<<<<<<< + * _as = values.argsort() + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/algos.pyx":511 + * # py2.5/win32 hack, can't pass i8 + * try: + * _as = values.argsort() # <<<<<<<<<<<<<< + * except TypeError: + * if not retry: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_2; + __pyx_t_2 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":512 + * try: + * _as = values.argsort() + * except TypeError: # <<<<<<<<<<<<<< + * if not retry: + * raise + */ + __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_3) { + __Pyx_AddTraceback("pandas.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/algos.pyx":513 + * _as = values.argsort() + * except TypeError: + * if not retry: # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_4 = ((!(__pyx_v_retry != 0)) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":514 + * except TypeError: + * if not retry: + * raise # <<<<<<<<<<<<<< + * + * valid_locs = (~mask).nonzero()[0] + */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_5); + __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + } + + /* "pandas/algos.pyx":516 + * raise + * + * valid_locs = (~mask).nonzero()[0] # <<<<<<<<<<<<<< + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, + * ties_method=ties_method, + */ + __pyx_t_6 = PyNumber_Invert(__pyx_v_mask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}; + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_valid_locs = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/algos.pyx":517 + * + * valid_locs = (~mask).nonzero()[0] + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, # <<<<<<<<<<<<<< + * ties_method=ties_method, + * ascending=ascending)) + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_put); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_generic); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_valid_locs); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_valid_locs); + __Pyx_GIVEREF(__pyx_v_valid_locs); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_15 = 0; + __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/algos.pyx":518 + * valid_locs = (~mask).nonzero()[0] + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, + * ties_method=ties_method, # <<<<<<<<<<<<<< + * ascending=ascending)) + * np.putmask(ranks, mask, np.nan) + */ + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_ties_method, __pyx_v_ties_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + + /* "pandas/algos.pyx":519 + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, + * ties_method=ties_method, + * ascending=ascending)) # <<<<<<<<<<<<<< + * np.putmask(ranks, mask, np.nan) + * return ranks + */ + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_ascending, __pyx_v_ascending) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + + /* "pandas/algos.pyx":517 + * + * valid_locs = (~mask).nonzero()[0] + * ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0, # <<<<<<<<<<<<<< + * ties_method=ties_method, + * ascending=ascending)) + */ + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_valid_locs); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_valid_locs); + __Pyx_GIVEREF(__pyx_v_valid_locs); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":520 + * ties_method=ties_method, + * ascending=ascending)) + * np.putmask(ranks, mask, np.nan) # <<<<<<<<<<<<<< + * return ranks + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_putmask); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_ranks)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_ranks)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":521 + * ascending=ascending)) + * np.putmask(ranks, mask, np.nan) + * return ranks # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L8_except_return; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L6_exception_handled; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L8_except_return:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L0; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + __pyx_L12_try_end:; + } + + /* "pandas/algos.pyx":523 + * return ranks + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[::-1] + * + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((!__pyx_t_4) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":524 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v__as, __pyx_slice__19); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/algos.pyx":526 + * _as = _as[::-1] + * + * sorted_data = values.take(_as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * for i in range(n): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_take); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__as); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__as); + __Pyx_GIVEREF(__pyx_v__as); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":527 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * sum_ranks += i + 1 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":528 + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') + * for i in range(n): # <<<<<<<<<<<<<< + * sum_ranks += i + 1 + * dups += 1 + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_7; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + + /* "pandas/algos.pyx":529 + * argsorted = _as.astype('i8') + * for i in range(n): + * sum_ranks += i + 1 # <<<<<<<<<<<<<< + * dups += 1 + * val = util.get_value_at(sorted_data, i) + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1)); + + /* "pandas/algos.pyx":530 + * for i in range(n): + * sum_ranks += i + 1 + * dups += 1 # <<<<<<<<<<<<<< + * val = util.get_value_at(sorted_data, i) + * if val is nan_value and keep_na: + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":531 + * sum_ranks += i + 1 + * dups += 1 + * val = util.get_value_at(sorted_data, i) # <<<<<<<<<<<<<< + * if val is nan_value and keep_na: + * ranks[argsorted[i]] = nan + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_sorted_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":532 + * dups += 1 + * val = util.get_value_at(sorted_data, i) + * if val is nan_value and keep_na: # <<<<<<<<<<<<<< + * ranks[argsorted[i]] = nan + * continue + */ + __pyx_t_16 = (__pyx_v_val == __pyx_v_nan_value); + if ((__pyx_t_16 != 0)) { + __pyx_t_4 = (__pyx_v_keep_na != 0); + } else { + __pyx_t_4 = (__pyx_t_16 != 0); + } + if (__pyx_t_4) { + + /* "pandas/algos.pyx":533 + * val = util.get_value_at(sorted_data, i) + * if val is nan_value and keep_na: + * ranks[argsorted[i]] = nan # <<<<<<<<<<<<<< + * continue + * if (i == n - 1 or + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_6pandas_5algos_nan; + + /* "pandas/algos.pyx":534 + * if val is nan_value and keep_na: + * ranks[argsorted[i]] = nan + * continue # <<<<<<<<<<<<<< + * if (i == n - 1 or + * are_diff(util.get_value_at(sorted_data, i + 1), val)): + */ + goto __pyx_L17_continue; + } + + /* "pandas/algos.pyx":535 + * ranks[argsorted[i]] = nan + * continue + * if (i == n - 1 or # <<<<<<<<<<<<<< + * are_diff(util.get_value_at(sorted_data, i + 1), val)): + * count += 1.0 + */ + __pyx_t_4 = (__pyx_v_i == (__pyx_v_n - 1)); + if (!__pyx_t_4) { + + /* "pandas/algos.pyx":536 + * continue + * if (i == n - 1 or + * are_diff(util.get_value_at(sorted_data, i + 1), val)): # <<<<<<<<<<<<<< + * count += 1.0 + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_i + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_f_4util_get_value_at(__pyx_v_sorted_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_f_6pandas_5algos_are_diff(__pyx_t_1, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_21 = __pyx_t_16; + } else { + __pyx_t_21 = __pyx_t_4; + } + if (__pyx_t_21) { + + /* "pandas/algos.pyx":537 + * if (i == n - 1 or + * are_diff(util.get_value_at(sorted_data, i + 1), val)): + * count += 1.0 # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":538 + * are_diff(util.get_value_at(sorted_data, i + 1), val)): + * count += 1.0 + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":539 + * count += 1.0 + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_22 = (__pyx_v_i + 1); + for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "pandas/algos.pyx":540 + * if tiebreak == TIEBREAK_AVERAGE: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L21; + } + + /* "pandas/algos.pyx":541 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":542 + * ranks[argsorted[j]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_22 = (__pyx_v_i + 1); + for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "pandas/algos.pyx":543 + * elif tiebreak == TIEBREAK_MIN: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_27 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_ranks.diminfo[0].strides) = ((__pyx_v_i - __pyx_v_dups) + 2); + } + goto __pyx_L21; + } + + /* "pandas/algos.pyx":544 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":545 + * ranks[argsorted[j]] = i - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_22 = (__pyx_v_i + 1); + for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "pandas/algos.pyx":546 + * elif tiebreak == TIEBREAK_MAX: + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for non-numeric data') + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[0].strides) = (__pyx_v_i + 1); + } + goto __pyx_L21; + } + + /* "pandas/algos.pyx":547 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * raise ValueError('first not supported for non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":548 + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for non-numeric data') # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":549 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + */ + __pyx_t_21 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":550 + * raise ValueError('first not supported for non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":551 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): # <<<<<<<<<<<<<< + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_22 = (__pyx_v_i + 1); + for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "pandas/algos.pyx":552 + * total_tie_count += 1 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_31 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_argsorted.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_ranks.diminfo[0].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/algos.pyx":553 + * for j in range(i - dups + 1, i + 1): + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * return ranks / count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L20; + } + __pyx_L20:; + __pyx_L17_continue:; + } + + /* "pandas/algos.pyx":554 + * ranks[argsorted[j]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * return ranks / count + * else: + */ + __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_21) { + + /* "pandas/algos.pyx":555 + * sum_ranks = dups = 0 + * if pct: + * return ranks / count # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ranks), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":557 + * return ranks / count + * else: + * return ranks # <<<<<<<<<<<<<< + * + * cdef inline are_diff(object left, object right): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_nan_value); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XDECREF(__pyx_v_valid_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":559 + * return ranks + * + * cdef inline are_diff(object left, object right): # <<<<<<<<<<<<<< + * try: + * return fabs(left - right) > FP_ERR + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_are_diff(PyObject *__pyx_v_left, PyObject *__pyx_v_right) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + double __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("are_diff", 0); + + /* "pandas/algos.pyx":560 + * + * cdef inline are_diff(object left, object right): + * try: # <<<<<<<<<<<<<< + * return fabs(left - right) > FP_ERR + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/algos.pyx":561 + * cdef inline are_diff(object left, object right): + * try: + * return fabs(left - right) > FP_ERR # <<<<<<<<<<<<<< + * except TypeError: + * return left != right + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyNumber_Subtract(__pyx_v_left, __pyx_v_right); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong((fabs(__pyx_t_5) > __pyx_v_6pandas_5algos_FP_ERR)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/algos.pyx":562 + * try: + * return fabs(left - right) > FP_ERR + * except TypeError: # <<<<<<<<<<<<<< + * return left != right + * + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_6) { + __Pyx_AddTraceback("pandas.algos.are_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/algos.pyx":563 + * return fabs(left - right) > FP_ERR + * except TypeError: + * return left != right # <<<<<<<<<<<<<< + * + * _return_false = lambda self, other: False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_left, __pyx_v_right, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/algos.pyx":559 + * return ranks + * + * cdef inline are_diff(object left, object right): # <<<<<<<<<<<<<< + * try: + * return fabs(left - right) > FP_ERR + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.algos.are_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_11rank_2d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_10rank_2d_generic[] = "\n Fast NaN-friendly version of scipy.stats.rankdata\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_11rank_2d_generic = {__Pyx_NAMESTR("rank_2d_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_11rank_2d_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_10rank_2d_generic)}; +static PyObject *__pyx_pw_6pandas_5algos_11rank_2d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_in_arr = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_ties_method = 0; + PyObject *__pyx_v_ascending = 0; + PyObject *__pyx_v_na_option = 0; + PyObject *__pyx_v_pct = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rank_2d_generic (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_arr,&__pyx_n_s_axis,&__pyx_n_s_ties_method,&__pyx_n_s_ascending,&__pyx_n_s_na_option,&__pyx_n_s_pct,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_int_0); + values[2] = ((PyObject *)__pyx_n_s_average); + + /* "pandas/algos.pyx":589 + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', + * ascending=True, na_option='keep', pct=False): # <<<<<<<<<<<<<< + * """ + * Fast NaN-friendly version of scipy.stats.rankdata + */ + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)__pyx_n_s_keep); + values[5] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_in_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ties_method); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ascending); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_option); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pct); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rank_2d_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_in_arr = values[0]; + __pyx_v_axis = values[1]; + __pyx_v_ties_method = values[2]; + __pyx_v_ascending = values[3]; + __pyx_v_na_option = values[4]; + __pyx_v_pct = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rank_2d_generic", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_10rank_2d_generic(__pyx_self, __pyx_v_in_arr, __pyx_v_axis, __pyx_v_ties_method, __pyx_v_ascending, __pyx_v_na_option, __pyx_v_pct); + + /* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_10rank_2d_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_arr, PyObject *__pyx_v_axis, PyObject *__pyx_v_ties_method, PyObject *__pyx_v_ascending, PyObject *__pyx_v_na_option, PyObject *__pyx_v_pct) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_z; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_infs; + Py_ssize_t __pyx_v_dups; + Py_ssize_t __pyx_v_total_tie_count; + PyArrayObject *__pyx_v_ranks = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_argsorted = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_nan_value = 0; + __pyx_t_5numpy_float64_t __pyx_v_sum_ranks; + int __pyx_v_tiebreak; + int __pyx_v_keep_na; + float __pyx_v_count; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_v__as = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_argsorted; + __Pyx_Buffer __pyx_pybuffer_argsorted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ranks; + __Pyx_Buffer __pyx_pybuffer_ranks; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_t_21; + PyArrayObject *__pyx_t_22 = NULL; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + int __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + __pyx_t_5numpy_int64_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + __pyx_t_5numpy_int64_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + __pyx_t_5numpy_int64_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + __pyx_t_5numpy_int64_t __pyx_t_51; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rank_2d_generic", 0); + __Pyx_INCREF(__pyx_v_in_arr); + __pyx_pybuffer_ranks.pybuffer.buf = NULL; + __pyx_pybuffer_ranks.refcount = 0; + __pyx_pybuffernd_ranks.data = NULL; + __pyx_pybuffernd_ranks.rcbuffer = &__pyx_pybuffer_ranks; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_argsorted.pybuffer.buf = NULL; + __pyx_pybuffer_argsorted.refcount = 0; + __pyx_pybuffernd_argsorted.data = NULL; + __pyx_pybuffernd_argsorted.rcbuffer = &__pyx_pybuffer_argsorted; + + /* "pandas/algos.pyx":595 + * + * cdef: + * Py_ssize_t i, j, z, k, n, infs, dups = 0 # <<<<<<<<<<<<<< + * Py_ssize_t total_tie_count = 0 + * ndarray[float64_t, ndim=2] ranks + */ + __pyx_v_dups = 0; + + /* "pandas/algos.pyx":596 + * cdef: + * Py_ssize_t i, j, z, k, n, infs, dups = 0 + * Py_ssize_t total_tie_count = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] ranks + * ndarray[object, ndim=2] values + */ + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":601 + * ndarray[int64_t, ndim=2] argsorted + * object val, nan_value + * float64_t sum_ranks = 0 # <<<<<<<<<<<<<< + * int tiebreak = 0 + * bint keep_na = 0 + */ + __pyx_v_sum_ranks = 0.0; + + /* "pandas/algos.pyx":602 + * object val, nan_value + * float64_t sum_ranks = 0 + * int tiebreak = 0 # <<<<<<<<<<<<<< + * bint keep_na = 0 + * float count = 0.0 + */ + __pyx_v_tiebreak = 0; + + /* "pandas/algos.pyx":603 + * float64_t sum_ranks = 0 + * int tiebreak = 0 + * bint keep_na = 0 # <<<<<<<<<<<<<< + * float count = 0.0 + * + */ + __pyx_v_keep_na = 0; + + /* "pandas/algos.pyx":604 + * int tiebreak = 0 + * bint keep_na = 0 + * float count = 0.0 # <<<<<<<<<<<<<< + * + * tiebreak = tiebreakers[ties_method] + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":606 + * float count = 0.0 + * + * tiebreak = tiebreakers[ties_method] # <<<<<<<<<<<<<< + * + * keep_na = na_option == 'keep' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tiebreak = __pyx_t_3; + + /* "pandas/algos.pyx":608 + * tiebreak = tiebreakers[ties_method] + * + * keep_na = na_option == 'keep' # <<<<<<<<<<<<<< + * + * in_arr = np.asarray(in_arr) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_keep, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_keep_na = __pyx_t_4; + + /* "pandas/algos.pyx":610 + * keep_na = na_option == 'keep' + * + * in_arr = np.asarray(in_arr) # <<<<<<<<<<<<<< + * + * if axis == 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_in_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr); + __Pyx_GIVEREF(__pyx_v_in_arr); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_in_arr, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":612 + * in_arr = np.asarray(in_arr) + * + * if axis == 0: # <<<<<<<<<<<<<< + * values = in_arr.T.copy() + * else: + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":613 + * + * if axis == 0: + * values = in_arr.T.copy() # <<<<<<<<<<<<<< + * else: + * values = in_arr.copy() + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":615 + * values = in_arr.T.copy() + * else: + * values = in_arr.copy() # <<<<<<<<<<<<<< + * + * if values.dtype != np.object_: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "pandas/algos.pyx":617 + * values = in_arr.copy() + * + * if values.dtype != np.object_: # <<<<<<<<<<<<<< + * values = values.astype('O') + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":618 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/algos.pyx":620 + * values = values.astype('O') + * + * if ascending ^ (na_option == 'top'): # <<<<<<<<<<<<<< + * # always greater than everything + * nan_value = Infinity() + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_na_option, __pyx_n_s_top, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Xor(__pyx_v_ascending, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":622 + * if ascending ^ (na_option == 'top'): + * # always greater than everything + * nan_value = Infinity() # <<<<<<<<<<<<<< + * else: + * nan_value = NegInfinity() + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Infinity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_nan_value = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/algos.pyx":624 + * nan_value = Infinity() + * else: + * nan_value = NegInfinity() # <<<<<<<<<<<<<< + * + * mask = lib.isnullobj2d(values) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NegInfinity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_nan_value = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L5:; + + /* "pandas/algos.pyx":626 + * nan_value = NegInfinity() + * + * mask = lib.isnullobj2d(values) # <<<<<<<<<<<<<< + * np.putmask(values, mask, nan_value) + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnullobj2d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_mask = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":627 + * + * mask = lib.isnullobj2d(values) + * np.putmask(values, mask, nan_value) # <<<<<<<<<<<<<< + * + * n, k = ( values).shape + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + __Pyx_INCREF(__pyx_v_nan_value); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_nan_value); + __Pyx_GIVEREF(__pyx_v_nan_value); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":629 + * np.putmask(values, mask, nan_value) + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * ranks = np.empty((n, k), dtype='f8') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_n = __pyx_t_12; + __pyx_v_k = __pyx_t_13; + + /* "pandas/algos.pyx":630 + * + * n, k = ( values).shape + * ranks = np.empty((n, k), dtype='f8') # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_ranks.diminfo[0].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ranks.diminfo[0].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ranks.diminfo[1].strides = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ranks.diminfo[1].shape = __pyx_pybuffernd_ranks.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":632 + * ranks = np.empty((n, k), dtype='f8') + * + * try: # <<<<<<<<<<<<<< + * _as = values.argsort(1) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/algos.pyx":633 + * + * try: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * except TypeError: + * values = in_arr + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__as = __pyx_t_10; + __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/algos.pyx":634 + * try: + * _as = values.argsort(1) + * except TypeError: # <<<<<<<<<<<<<< + * values = in_arr + * for i in range(len(values)): + */ + __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_3) { + __Pyx_AddTraceback("pandas.algos.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/algos.pyx":635 + * _as = values.argsort(1) + * except TypeError: + * values = in_arr # <<<<<<<<<<<<<< + * for i in range(len(values)): + * ranks[i] = rank_1d_generic(in_arr[i], + */ + if (!(likely(((__pyx_v_in_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_in_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __pyx_t_5 = __pyx_v_in_arr; + __Pyx_INCREF(__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + } + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":636 + * except TypeError: + * values = in_arr + * for i in range(len(values)): # <<<<<<<<<<<<<< + * ranks[i] = rank_1d_generic(in_arr[i], + * ties_method=ties_method, + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/algos.pyx":637 + * values = in_arr + * for i in range(len(values)): + * ranks[i] = rank_1d_generic(in_arr[i], # <<<<<<<<<<<<<< + * ties_method=ties_method, + * ascending=ascending, + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_generic); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_in_arr, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}; + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_18); + + /* "pandas/algos.pyx":638 + * for i in range(len(values)): + * ranks[i] = rank_1d_generic(in_arr[i], + * ties_method=ties_method, # <<<<<<<<<<<<<< + * ascending=ascending, + * pct=pct) + */ + if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_ties_method, __pyx_v_ties_method) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + + /* "pandas/algos.pyx":639 + * ranks[i] = rank_1d_generic(in_arr[i], + * ties_method=ties_method, + * ascending=ascending, # <<<<<<<<<<<<<< + * pct=pct) + * if axis == 0: + */ + if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_ascending, __pyx_v_ascending) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + + /* "pandas/algos.pyx":640 + * ties_method=ties_method, + * ascending=ascending, + * pct=pct) # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_pct, __pyx_v_pct) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + + /* "pandas/algos.pyx":637 + * values = in_arr + * for i in range(len(values)): + * ranks[i] = rank_1d_generic(in_arr[i], # <<<<<<<<<<<<<< + * ties_method=ties_method, + * ascending=ascending, + */ + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_19, __pyx_t_18); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_ranks), __pyx_v_i, __pyx_t_20, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + } + + /* "pandas/algos.pyx":641 + * ascending=ascending, + * pct=pct) + * if axis == 0: # <<<<<<<<<<<<<< + * return ranks.T + * else: + */ + __pyx_t_20 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (__pyx_t_4) { + + /* "pandas/algos.pyx":642 + * pct=pct) + * if axis == 0: + * return ranks.T # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_r = __pyx_t_20; + __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L11_except_return; + } + /*else*/ { + + /* "pandas/algos.pyx":644 + * return ranks.T + * else: + * return ranks # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L11_except_return; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L11_except_return:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L0; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L15_try_end:; + } + + /* "pandas/algos.pyx":646 + * return ranks + * + * if not ascending: # <<<<<<<<<<<<<< + * _as = _as[:, ::-1] + * + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((!__pyx_t_4) != 0); + if (__pyx_t_21) { + + /* "pandas/algos.pyx":647 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_object(values, _as) + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v__as, __pyx_tuple__26); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v__as, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/algos.pyx":649 + * _as = _as[:, ::-1] + * + * values = _take_2d_object(values, _as) # <<<<<<<<<<<<<< + * argsorted = _as.astype('i8') + * + */ + __pyx_t_2 = __pyx_f_6pandas_5algos__take_2d_object(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":650 + * + * values = _take_2d_object(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__as, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_argsorted.diminfo[0].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_argsorted.diminfo[0].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_argsorted.diminfo[1].strides = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_argsorted.diminfo[1].shape = __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":652 + * argsorted = _as.astype('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * dups = sum_ranks = infs = 0 + * total_tie_count = 0 + */ + __pyx_t_13 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/algos.pyx":653 + * + * for i in range(n): + * dups = sum_ranks = infs = 0 # <<<<<<<<<<<<<< + * total_tie_count = 0 + * count = 0.0 + */ + __pyx_v_dups = 0; + __pyx_v_sum_ranks = 0; + __pyx_v_infs = 0; + + /* "pandas/algos.pyx":654 + * for i in range(n): + * dups = sum_ranks = infs = 0 + * total_tie_count = 0 # <<<<<<<<<<<<<< + * count = 0.0 + * for j in range(k): + */ + __pyx_v_total_tie_count = 0; + + /* "pandas/algos.pyx":655 + * dups = sum_ranks = infs = 0 + * total_tie_count = 0 + * count = 0.0 # <<<<<<<<<<<<<< + * for j in range(k): + * val = values[i, j] + */ + __pyx_v_count = 0.0; + + /* "pandas/algos.pyx":656 + * total_tie_count = 0 + * count = 0.0 + * for j in range(k): # <<<<<<<<<<<<<< + * val = values[i, j] + * if val is nan_value and keep_na: + */ + __pyx_t_23 = __pyx_v_k; + for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { + __pyx_v_j = __pyx_t_24; + + /* "pandas/algos.pyx":657 + * count = 0.0 + * for j in range(k): + * val = values[i, j] # <<<<<<<<<<<<<< + * if val is nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_26 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":658 + * for j in range(k): + * val = values[i, j] + * if val is nan_value and keep_na: # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, j]] = nan + * infs += 1 + */ + __pyx_t_21 = (__pyx_v_val == __pyx_v_nan_value); + if ((__pyx_t_21 != 0)) { + __pyx_t_4 = (__pyx_v_keep_na != 0); + } else { + __pyx_t_4 = (__pyx_t_21 != 0); + } + if (__pyx_t_4) { + + /* "pandas/algos.pyx":659 + * val = values[i, j] + * if val is nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan # <<<<<<<<<<<<<< + * infs += 1 + * continue + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + + /* "pandas/algos.pyx":660 + * if val is nan_value and keep_na: + * ranks[i, argsorted[i, j]] = nan + * infs += 1 # <<<<<<<<<<<<<< + * continue + * count += 1.0 + */ + __pyx_v_infs = (__pyx_v_infs + 1); + + /* "pandas/algos.pyx":661 + * ranks[i, argsorted[i, j]] = nan + * infs += 1 + * continue # <<<<<<<<<<<<<< + * count += 1.0 + * sum_ranks += (j - infs) + 1 + */ + goto __pyx_L24_continue; + } + + /* "pandas/algos.pyx":662 + * infs += 1 + * continue + * count += 1.0 # <<<<<<<<<<<<<< + * sum_ranks += (j - infs) + 1 + * dups += 1 + */ + __pyx_v_count = (__pyx_v_count + 1.0); + + /* "pandas/algos.pyx":663 + * continue + * count += 1.0 + * sum_ranks += (j - infs) + 1 # <<<<<<<<<<<<<< + * dups += 1 + * if j == k - 1 or are_diff(values[i, j + 1], val): + */ + __pyx_v_sum_ranks = (__pyx_v_sum_ranks + ((__pyx_v_j - __pyx_v_infs) + 1)); + + /* "pandas/algos.pyx":664 + * count += 1.0 + * sum_ranks += (j - infs) + 1 + * dups += 1 # <<<<<<<<<<<<<< + * if j == k - 1 or are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + */ + __pyx_v_dups = (__pyx_v_dups + 1); + + /* "pandas/algos.pyx":665 + * sum_ranks += (j - infs) + 1 + * dups += 1 + * if j == k - 1 or are_diff(values[i, j + 1], val): # <<<<<<<<<<<<<< + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_4 = (__pyx_v_j == (__pyx_v_k - 1)); + if (!__pyx_t_4) { + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_2 = __pyx_f_6pandas_5algos_are_diff(__pyx_t_1, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_33 = __pyx_t_21; + } else { + __pyx_t_33 = __pyx_t_4; + } + if (__pyx_t_33) { + + /* "pandas/algos.pyx":666 + * dups += 1 + * if j == k - 1 or are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":667 + * if j == k - 1 or are_diff(values[i, j + 1], val): + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + */ + __pyx_t_34 = (__pyx_v_j + 1); + for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_z = __pyx_t_35; + + /* "pandas/algos.pyx":668 + * if tiebreak == TIEBREAK_AVERAGE: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + */ + if (unlikely(__pyx_v_dups == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_sum_ranks / __pyx_v_dups); + } + goto __pyx_L28; + } + + /* "pandas/algos.pyx":669 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MIN) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":670 + * ranks[i, argsorted[i, z]] = sum_ranks / dups + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + */ + __pyx_t_34 = (__pyx_v_j + 1); + for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_z = __pyx_t_35; + + /* "pandas/algos.pyx":671 + * elif tiebreak == TIEBREAK_MIN: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_43 < 0) { + __pyx_t_43 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_ranks.diminfo[1].strides) = ((__pyx_v_j - __pyx_v_dups) + 2); + } + goto __pyx_L28; + } + + /* "pandas/algos.pyx":672 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_MAX) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":673 + * ranks[i, argsorted[i, z]] = j - dups + 2 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + */ + __pyx_t_34 = (__pyx_v_j + 1); + for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_z = __pyx_t_35; + + /* "pandas/algos.pyx":674 + * elif tiebreak == TIEBREAK_MAX: + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for ' + */ + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_46 = __pyx_v_i; + __pyx_t_47 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_46 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_47 < 0) { + __pyx_t_47 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_ranks.diminfo[1].strides) = (__pyx_v_j + 1); + } + goto __pyx_L28; + } + + /* "pandas/algos.pyx":675 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: # <<<<<<<<<<<<<< + * raise ValueError('first not supported for ' + * 'non-numeric data') + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_FIRST) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":676 + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for ' # <<<<<<<<<<<<<< + * 'non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":678 + * raise ValueError('first not supported for ' + * 'non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: # <<<<<<<<<<<<<< + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + */ + __pyx_t_33 = ((__pyx_v_tiebreak == __pyx_v_6pandas_5algos_TIEBREAK_DENSE) != 0); + if (__pyx_t_33) { + + /* "pandas/algos.pyx":679 + * 'non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 # <<<<<<<<<<<<<< + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + */ + __pyx_v_total_tie_count = (__pyx_v_total_tie_count + 1); + + /* "pandas/algos.pyx":680 + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): # <<<<<<<<<<<<<< + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + */ + __pyx_t_34 = (__pyx_v_j + 1); + for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_z = __pyx_t_35; + + /* "pandas/algos.pyx":681 + * total_tie_count += 1 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count # <<<<<<<<<<<<<< + * sum_ranks = dups = 0 + * if pct: + */ + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = __pyx_v_z; + __pyx_t_3 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_48 += __pyx_pybuffernd_argsorted.diminfo[0].shape; + if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_argsorted.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_49 < 0) { + __pyx_t_49 += __pyx_pybuffernd_argsorted.diminfo[1].shape; + if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_argsorted.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_50 = __pyx_v_i; + __pyx_t_51 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_argsorted.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_argsorted.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_argsorted.diminfo[1].strides)); + __pyx_t_3 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_50 += __pyx_pybuffernd_ranks.diminfo[0].shape; + if (unlikely(__pyx_t_50 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_ranks.diminfo[0].shape)) __pyx_t_3 = 0; + if (__pyx_t_51 < 0) { + __pyx_t_51 += __pyx_pybuffernd_ranks.diminfo[1].shape; + if (unlikely(__pyx_t_51 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_ranks.diminfo[1].shape)) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_ranks.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_ranks.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_ranks.diminfo[1].strides) = __pyx_v_total_tie_count; + } + goto __pyx_L28; + } + __pyx_L28:; + + /* "pandas/algos.pyx":682 + * for z in range(j - dups + 1, j + 1): + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 # <<<<<<<<<<<<<< + * if pct: + * ranks[i, :] /= count + */ + __pyx_v_sum_ranks = 0; + __pyx_v_dups = 0; + goto __pyx_L27; + } + __pyx_L27:; + __pyx_L24_continue:; + } + + /* "pandas/algos.pyx":683 + * ranks[i, argsorted[i, z]] = total_tie_count + * sum_ranks = dups = 0 + * if pct: # <<<<<<<<<<<<<< + * ranks[i, :] /= count + * if axis == 0: + */ + __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_v_pct); if (unlikely(__pyx_t_33 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_33) { + + /* "pandas/algos.pyx":684 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_slice__29); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_ranks), __pyx_t_1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_20 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ranks), __pyx_t_1, __pyx_t_20) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L37; + } + __pyx_L37:; + } + + /* "pandas/algos.pyx":685 + * if pct: + * ranks[i, :] /= count + * if axis == 0: # <<<<<<<<<<<<<< + * return ranks.T + * else: + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_33 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_33) { + + /* "pandas/algos.pyx":686 + * ranks[i, :] /= count + * if axis == 0: + * return ranks.T # <<<<<<<<<<<<<< + * else: + * return ranks + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ranks), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":688 + * return ranks.T + * else: + * return ranks # <<<<<<<<<<<<<< + * + * # def _take_indexer_2d(ndarray[float64_t, ndim=2] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ranks)); + __pyx_r = ((PyObject *)__pyx_v_ranks); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_argsorted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ranks.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ranks); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_argsorted); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_nan_value); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v__as); + __Pyx_XDECREF(__pyx_v_in_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":715 + * # - + * + * def _check_minp(win, minp, N): # <<<<<<<<<<<<<< + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_13_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_13_check_minp = {__Pyx_NAMESTR("_check_minp"), (PyCFunction)__pyx_pw_6pandas_5algos_13_check_minp, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_13_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_win = 0; + PyObject *__pyx_v_minp = 0; + PyObject *__pyx_v_N = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_minp (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_N,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_minp") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_win = values[0]; + __pyx_v_minp = values[1]; + __pyx_v_N = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_12_check_minp(__pyx_self, __pyx_v_win, __pyx_v_minp, __pyx_v_N); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_12_check_minp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_N) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_minp", 0); + __Pyx_INCREF(__pyx_v_minp); + + /* "pandas/algos.pyx":716 + * + * def _check_minp(win, minp, N): + * if minp > win: # <<<<<<<<<<<<<< + * raise ValueError('min_periods (%d) must be <= window (%d)' + * % (minp, win)) + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_win, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/algos.pyx":718 + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + * % (minp, win)) # <<<<<<<<<<<<<< + * elif minp > N: + * minp = N + 1 + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_minp); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_minp); + __Pyx_GIVEREF(__pyx_v_minp); + __Pyx_INCREF(__pyx_v_win); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_win); + __Pyx_GIVEREF(__pyx_v_win); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_min_periods_d_must_be_window_d, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":717 + * def _check_minp(win, minp, N): + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' # <<<<<<<<<<<<<< + * % (minp, win)) + * elif minp > N: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":719 + * raise ValueError('min_periods (%d) must be <= window (%d)' + * % (minp, win)) + * elif minp > N: # <<<<<<<<<<<<<< + * minp = N + 1 + * elif minp == 0: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_N, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/algos.pyx":720 + * % (minp, win)) + * elif minp > N: + * minp = N + 1 # <<<<<<<<<<<<<< + * elif minp == 0: + * minp = 1 + */ + __pyx_t_3 = PyNumber_Add(__pyx_v_N, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_minp, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + + /* "pandas/algos.pyx":721 + * elif minp > N: + * minp = N + 1 + * elif minp == 0: # <<<<<<<<<<<<<< + * minp = 1 + * elif minp < 0: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/algos.pyx":722 + * minp = N + 1 + * elif minp == 0: + * minp = 1 # <<<<<<<<<<<<<< + * elif minp < 0: + * raise ValueError('min_periods must be >= 0') + */ + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF_SET(__pyx_v_minp, __pyx_int_1); + goto __pyx_L3; + } + + /* "pandas/algos.pyx":723 + * elif minp == 0: + * minp = 1 + * elif minp < 0: # <<<<<<<<<<<<<< + * raise ValueError('min_periods must be >= 0') + * return minp + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/algos.pyx":724 + * minp = 1 + * elif minp < 0: + * raise ValueError('min_periods must be >= 0') # <<<<<<<<<<<<<< + * return minp + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/algos.pyx":725 + * elif minp < 0: + * raise ValueError('min_periods must be >= 0') + * return minp # <<<<<<<<<<<<<< + * + * # original C implementation by N. Devillard. + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_minp); + __pyx_r = __pyx_v_minp; + goto __pyx_L0; + + /* "pandas/algos.pyx":715 + * # - + * + * def _check_minp(win, minp, N): # <<<<<<<<<<<<<< + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.algos._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_minp); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_0__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int8_t *__pyx_v_a, __pyx_t_5numpy_int8_t *__pyx_v_b) { + __pyx_t_5numpy_int8_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_0swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_1__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int16_t *__pyx_v_a, __pyx_t_5numpy_int16_t *__pyx_v_b) { + __pyx_t_5numpy_int16_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_1swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_2__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int32_t *__pyx_v_a, __pyx_t_5numpy_int32_t *__pyx_v_b) { + __pyx_t_5numpy_int32_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_2swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_3__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_int64_t *__pyx_v_a, __pyx_t_5numpy_int64_t *__pyx_v_b) { + __pyx_t_5numpy_int64_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_3swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_4__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint8_t *__pyx_v_a, __pyx_t_5numpy_uint8_t *__pyx_v_b) { + __pyx_t_5numpy_uint8_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_4swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_5__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint16_t *__pyx_v_a, __pyx_t_5numpy_uint16_t *__pyx_v_b) { + __pyx_t_5numpy_uint16_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_5swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_6__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint32_t *__pyx_v_a, __pyx_t_5numpy_uint32_t *__pyx_v_b) { + __pyx_t_5numpy_uint32_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_6swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_7__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_uint64_t *__pyx_v_a, __pyx_t_5numpy_uint64_t *__pyx_v_b) { + __pyx_t_5numpy_uint64_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_7swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_8__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float32_t *__pyx_v_a, __pyx_t_5numpy_float32_t *__pyx_v_b) { + __pyx_t_5numpy_float32_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_8swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static CYTHON_INLINE Py_ssize_t __pyx_fuse_9__pyx_f_6pandas_5algos_swap(__pyx_t_5numpy_float64_t *__pyx_v_a, __pyx_t_5numpy_float64_t *__pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_v_t; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_9swap", 0); + + /* "pandas/algos.pyx":762 + * + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] # <<<<<<<<<<<<<< + * a[0] = b[0] + * b[0] = t + */ + __pyx_v_t = (__pyx_v_a[0]); + + /* "pandas/algos.pyx":763 + * # cython doesn't allow pointer dereference so use array syntax + * t = a[0] + * a[0] = b[0] # <<<<<<<<<<<<<< + * b[0] = t + * return 0 + */ + (__pyx_v_a[0]) = (__pyx_v_b[0]); + + /* "pandas/algos.pyx":764 + * t = a[0] + * a[0] = b[0] + * b[0] = t # <<<<<<<<<<<<<< + * return 0 + * + */ + (__pyx_v_b[0]) = __pyx_v_t; + + /* "pandas/algos.pyx":765 + * a[0] = b[0] + * b[0] = t + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":758 + * + * + * cdef inline Py_ssize_t swap(numeric *a, numeric *b) except -1: # <<<<<<<<<<<<<< + * cdef numeric t + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_15kth_smallest = {__Pyx_NAMESTR("kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_15kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_signatures = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + CYTHON_UNUSED PyObject *__pyx_v_defaults = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_signatures = values[0]; + __pyx_v_args = values[1]; + __pyx_v_kwargs = values[2]; + __pyx_v_defaults = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_14kth_smallest(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_14kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { + PyObject *__pyx_v_dest_sig = NULL; + PyObject *__pyx_v_numpy = NULL; + __Pyx_memviewslice __pyx_v_memslice; + Py_ssize_t __pyx_v_itemsize; + int __pyx_v_dtype_signed; + char __pyx_v_kind; + int __pyx_v____pyx_int32_t_is_signed; + int __pyx_v____pyx_uint8_t_is_signed; + int __pyx_v____pyx_int64_t_is_signed; + int __pyx_v____pyx_uint16_t_is_signed; + int __pyx_v____pyx_uint64_t_is_signed; + int __pyx_v____pyx_int8_t_is_signed; + int __pyx_v____pyx_int16_t_is_signed; + int __pyx_v____pyx_uint32_t_is_signed; + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_v_dtype = NULL; + PyObject *__pyx_v_candidates = NULL; + PyObject *__pyx_v_sig = NULL; + int __pyx_v_match_found; + PyObject *__pyx_v_src_type = NULL; + PyObject *__pyx_v_dst_type = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + char __pyx_t_12; + int __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *(*__pyx_t_20)(PyObject *); + int __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("kth_smallest", 0); + __Pyx_INCREF(__pyx_v_kwargs); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_v_dest_sig = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_v_kwargs == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_numpy = __pyx_t_1; + __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_numpy, Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L11_try_end:; + } + __pyx_v_itemsize = -1; + __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0); + __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1) < 0); + __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0); + __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1) < 0); + __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1) < 0); + __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1) < 0); + __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0); + __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1) < 0); + __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((0 < __pyx_t_10) != 0); + if (__pyx_t_3) { + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_arg = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_a, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + __pyx_t_9 = PyObject_GetItem(__pyx_v_kwargs, __pyx_n_s_a); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_arg = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + /*else*/ { + __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L14:; + if (0) { + goto __pyx_L15; + } + /*else*/ { + while (1) { + if (!1) break; + __pyx_t_2 = (__pyx_v_numpy != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_dtype = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L19; + } + __pyx_t_2 = (__pyx_memoryview_check(__pyx_v_arg) != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyObject_IsInstance(__pyx_t_8, __pyx_t_9); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_3 != 0); + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dtype = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L19; + } + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_dtype = Py_None; + } + __pyx_L19:; + __pyx_v_itemsize = -1; + __pyx_t_11 = (__pyx_v_dtype != Py_None); + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_itemsize = __pyx_t_10; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_12 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_12 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_kind = __pyx_t_12; + __pyx_t_8 = __Pyx_PyInt_From_char(__pyx_v_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_105, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dtype_signed = __pyx_t_2; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_9, __pyx_tuple__31, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_2 != 0); + if (__pyx_t_11) { + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_3 = ((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize); + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + goto __pyx_L21; + } + __pyx_L21:; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L18; + } + __pyx_L18:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L32; + } + __pyx_L32:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L34; + } + __pyx_L34:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L36; + } + __pyx_L36:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L38; + } + __pyx_L38:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L40; + } + __pyx_L40:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L42; + } + __pyx_L42:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L44; + } + __pyx_L44:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L46; + } + __pyx_L46:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L48; + } + __pyx_L48:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L50; + } + __pyx_L50:; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_L17_break:; + } + __pyx_L15:; + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_candidates = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + if (PyList_CheckExact(__pyx_v_signatures) || PyTuple_CheckExact(__pyx_v_signatures)) { + __pyx_t_9 = __pyx_v_signatures; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_signatures); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; + } + for (;;) { + if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_14(__pyx_t_9); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_v_match_found = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_dest_sig); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dest_sig); + __Pyx_GIVEREF(__pyx_v_dest_sig); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_16(__pyx_t_8); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_17 = PyList_GET_ITEM(sequence, 0); + __pyx_t_18 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(__pyx_t_18); + #else + __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; + index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_17); + index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_18); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L57_unpacking_done; + __pyx_L56_unpacking_failed:; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L57_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17); + __pyx_t_17 = 0; + __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_11 = (__pyx_v_dst_type != Py_None); + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + __pyx_v_match_found = 1; + goto __pyx_L59; + } + /*else*/ { + __pyx_v_match_found = 0; + goto __pyx_L55_break; + } + __pyx_L59:; + goto __pyx_L58; + } + __pyx_L58:; + } + __pyx_L55_break:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = (__pyx_v_match_found != 0); + if (__pyx_t_2) { + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L60; + } + __pyx_L60:; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0); + __pyx_t_11 = ((!__pyx_t_2) != 0); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((__pyx_t_10 > 1) != 0); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyObject_GetItem(__pyx_v_signatures, PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dest_sig); + __Pyx_XDECREF(__pyx_v_numpy); + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XDECREF(__pyx_v_dtype); + __Pyx_XDECREF(__pyx_v_candidates); + __Pyx_XDECREF(__pyx_v_sig); + __Pyx_XDECREF(__pyx_v_src_type); + __Pyx_XDECREF(__pyx_v_dst_type); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int8_t __pyx_v_x; + __pyx_t_5numpy_int8_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_0kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_0__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5algos_513__pyx_fuse_0kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_0kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_513__pyx_fuse_0kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_0kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_512__pyx_fuse_0kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_0kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int8(__pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int16_t __pyx_v_x; + __pyx_t_5numpy_int16_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_1kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_1__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5algos_515__pyx_fuse_1kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_1kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_515__pyx_fuse_1kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_1kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_514__pyx_fuse_1kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_1kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int16(__pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int32_t __pyx_v_x; + __pyx_t_5numpy_int32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_2kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_2__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5algos_517__pyx_fuse_2kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_2kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_517__pyx_fuse_2kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_2kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_516__pyx_fuse_2kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_2kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_x; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_3kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_3__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5algos_519__pyx_fuse_3kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_3kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_519__pyx_fuse_3kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_3kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_518__pyx_fuse_3kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_3kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint8_t __pyx_v_x; + __pyx_t_5numpy_uint8_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_4kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_4__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5algos_521__pyx_fuse_4kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_4kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_521__pyx_fuse_4kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_4kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_4kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_520__pyx_fuse_4kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_4kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint16_t __pyx_v_x; + __pyx_t_5numpy_uint16_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_5kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_5__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5algos_523__pyx_fuse_5kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_5kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_523__pyx_fuse_5kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_5kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_5kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_522__pyx_fuse_5kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_5kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint16(__pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint32_t __pyx_v_x; + __pyx_t_5numpy_uint32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_6kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_6__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5algos_525__pyx_fuse_6kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_6kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_525__pyx_fuse_6kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_6kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_6kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_524__pyx_fuse_6kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_6kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint64_t __pyx_v_x; + __pyx_t_5numpy_uint64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_7kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_7__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5algos_527__pyx_fuse_7kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_7kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_527__pyx_fuse_7kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_7kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_7kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_526__pyx_fuse_7kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_7kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float32_t __pyx_v_x; + __pyx_t_5numpy_float32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_8kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_8__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5algos_529__pyx_fuse_8kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_8kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_529__pyx_fuse_8kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_8kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_8kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_8kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_8kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_528__pyx_fuse_8kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_8kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_15kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t __pyx_v_x; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_9kth_smallest", 0); + + /* "pandas/algos.pyx":772 + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): + * cdef: + * Py_ssize_t i, j, l, m, n = a.size # <<<<<<<<<<<<<< + * numeric x + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":775 + * numeric x + * + * l = 0 # <<<<<<<<<<<<<< + * m = n - 1 + * + */ + __pyx_v_l = 0; + + /* "pandas/algos.pyx":776 + * + * l = 0 + * m = n - 1 # <<<<<<<<<<<<<< + * + * while l < m: + */ + __pyx_v_m = (__pyx_v_n - 1); + + /* "pandas/algos.pyx":778 + * m = n - 1 + * + * while l < m: # <<<<<<<<<<<<<< + * x = a[k] + * i = l + */ + while (1) { + __pyx_t_4 = ((__pyx_v_l < __pyx_v_m) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":779 + * + * while l < m: + * x = a[k] # <<<<<<<<<<<<<< + * i = l + * j = m + */ + __pyx_t_3 = __pyx_v_k; + __pyx_v_x = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) ))); + + /* "pandas/algos.pyx":780 + * while l < m: + * x = a[k] + * i = l # <<<<<<<<<<<<<< + * j = m + * + */ + __pyx_v_i = __pyx_v_l; + + /* "pandas/algos.pyx":781 + * x = a[k] + * i = l + * j = m # <<<<<<<<<<<<<< + * + * while 1: + */ + __pyx_v_j = __pyx_v_m; + + /* "pandas/algos.pyx":783 + * j = m + * + * while 1: # <<<<<<<<<<<<<< + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + */ + while (1) { + + /* "pandas/algos.pyx":784 + * + * while 1: + * while a[i] < x: i += 1 # <<<<<<<<<<<<<< + * while x < a[j]: j -= 1 + * if i <= j: + */ + while (1) { + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) ))) < __pyx_v_x) != 0); + if (!__pyx_t_4) break; + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/algos.pyx":785 + * while 1: + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 # <<<<<<<<<<<<<< + * if i <= j: + * swap(&a[i], &a[j]) + */ + while (1) { + __pyx_t_6 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_x < (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_6 * __pyx_v_a.strides[0]) )))) != 0); + if (!__pyx_t_4) break; + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/algos.pyx":786 + * while a[i] < x: i += 1 + * while x < a[j]: j -= 1 + * if i <= j: # <<<<<<<<<<<<<< + * swap(&a[i], &a[j]) + * i += 1; j -= 1 + */ + __pyx_t_4 = ((__pyx_v_i <= __pyx_v_j) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":787 + * while x < a[j]: j -= 1 + * if i <= j: + * swap(&a[i], &a[j]) # <<<<<<<<<<<<<< + * i += 1; j -= 1 + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_j; + __pyx_t_9 = __pyx_fuse_9__pyx_f_6pandas_5algos_swap((&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )))), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) ))))); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":788 + * if i <= j: + * swap(&a[i], &a[j]) + * i += 1; j -= 1 # <<<<<<<<<<<<<< + * + * if i > j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":790 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_4 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_4) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":792 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_4 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_4) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":793 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_4 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_4) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":794 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_k; + __pyx_r = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) ))); + goto __pyx_L0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.algos.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5algos_531__pyx_fuse_9kth_smallest = {__Pyx_NAMESTR("__pyx_fuse_9kth_smallest"), (PyCFunction)__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_531__pyx_fuse_9kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_9kth_smallest (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_k,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_9kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_9kth_smallest") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fuse_9kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(__pyx_self, __pyx_v_a, __pyx_v_k); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_530__pyx_fuse_9kth_smallest(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_9kth_smallest", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_a, __pyx_v_k, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":797 + * + * + * cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i,j,l,m + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5algos_kth_smallest_c(__pyx_t_5numpy_float64_t *__pyx_v_a, Py_ssize_t __pyx_v_k, Py_ssize_t __pyx_v_n) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_l; + Py_ssize_t __pyx_v_m; + __pyx_t_5numpy_double_t __pyx_v_x; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("kth_smallest_c", 0); + + /* "pandas/algos.pyx":802 + * double_t x, t + * + * l = 0 # <<<<<<<<<<<<<< + * m = n-1 + * while (l j: break + */ + __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_j = (__pyx_v_j - 1); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":816 + * i += 1; j -= 1 + * + * if i > j: break # <<<<<<<<<<<<<< + * + * if j < k: l = i + */ + __pyx_t_1 = ((__pyx_v_i > __pyx_v_j) != 0); + if (__pyx_t_1) { + goto __pyx_L6_break; + } + } + __pyx_L6_break:; + + /* "pandas/algos.pyx":818 + * if i > j: break + * + * if j < k: l = i # <<<<<<<<<<<<<< + * if k < i: m = j + * return a[k] + */ + __pyx_t_1 = ((__pyx_v_j < __pyx_v_k) != 0); + if (__pyx_t_1) { + __pyx_v_l = __pyx_v_i; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/algos.pyx":819 + * + * if j < k: l = i + * if k < i: m = j # <<<<<<<<<<<<<< + * return a[k] + * + */ + __pyx_t_1 = ((__pyx_v_k < __pyx_v_i) != 0); + if (__pyx_t_1) { + __pyx_v_m = __pyx_v_j; + goto __pyx_L14; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":820 + * if j < k: l = i + * if k < i: m = j + * return a[k] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyFloat_FromDouble((__pyx_v_a[__pyx_v_k])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":797 + * + * + * cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i,j,l,m + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.algos.kth_smallest_c", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_16median[] = "\n A faster median\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_17median = {__Pyx_NAMESTR("median"), (PyCFunction)__pyx_pw_6pandas_5algos_17median, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_signatures = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + CYTHON_UNUSED PyObject *__pyx_v_defaults = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_signatures = values[0]; + __pyx_v_args = values[1]; + __pyx_v_kwargs = values[2]; + __pyx_v_defaults = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_16median(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_16median(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { + PyObject *__pyx_v_dest_sig = NULL; + PyObject *__pyx_v_numpy = NULL; + __Pyx_memviewslice __pyx_v_memslice; + Py_ssize_t __pyx_v_itemsize; + int __pyx_v_dtype_signed; + char __pyx_v_kind; + int __pyx_v____pyx_int16_t_is_signed; + int __pyx_v____pyx_int32_t_is_signed; + int __pyx_v____pyx_int64_t_is_signed; + int __pyx_v____pyx_uint8_t_is_signed; + int __pyx_v____pyx_uint16_t_is_signed; + int __pyx_v____pyx_uint32_t_is_signed; + int __pyx_v____pyx_uint64_t_is_signed; + int __pyx_v____pyx_int8_t_is_signed; + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_v_dtype = NULL; + PyObject *__pyx_v_candidates = NULL; + PyObject *__pyx_v_sig = NULL; + int __pyx_v_match_found; + PyObject *__pyx_v_src_type = NULL; + PyObject *__pyx_v_dst_type = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + char __pyx_t_12; + int __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *(*__pyx_t_20)(PyObject *); + int __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("median", 0); + __Pyx_INCREF(__pyx_v_kwargs); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_v_dest_sig = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_v_kwargs == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_numpy = __pyx_t_1; + __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_numpy, Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L11_try_end:; + } + __pyx_v_itemsize = -1; + __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0); + __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0); + __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0); + __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1) < 0); + __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1) < 0); + __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1) < 0); + __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1) < 0); + __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1) < 0); + __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((0 < __pyx_t_10) != 0); + if (__pyx_t_3) { + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_arg = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_arr, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + __pyx_t_9 = PyObject_GetItem(__pyx_v_kwargs, __pyx_n_s_arr); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_arg = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + /*else*/ { + __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L14:; + if (0) { + goto __pyx_L15; + } + /*else*/ { + while (1) { + if (!1) break; + __pyx_t_2 = (__pyx_v_numpy != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_dtype = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L19; + } + __pyx_t_2 = (__pyx_memoryview_check(__pyx_v_arg) != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyObject_IsInstance(__pyx_t_8, __pyx_t_9); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_3 != 0); + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dtype = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L19; + } + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_dtype = Py_None; + } + __pyx_L19:; + __pyx_v_itemsize = -1; + __pyx_t_11 = (__pyx_v_dtype != Py_None); + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_itemsize = __pyx_t_10; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_12 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_12 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_kind = __pyx_t_12; + __pyx_t_8 = __Pyx_PyInt_From_char(__pyx_v_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_105, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dtype_signed = __pyx_t_2; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_9, __pyx_tuple__38, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_2 != 0); + if (__pyx_t_11) { + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + __pyx_t_3 = (!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_13 = __pyx_t_3; + } else { + __pyx_t_13 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_11; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_2 = ((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_13 = (!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)); + __pyx_t_3 = __pyx_t_13; + } else { + __pyx_t_3 = __pyx_t_11; + } + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_11) { + __pyx_t_11 = ((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_t_3 = ((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize); + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + goto __pyx_L21; + } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + goto __pyx_L21; + } + __pyx_L21:; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L18; + } + __pyx_L18:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L32; + } + __pyx_L32:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L34; + } + __pyx_L34:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L36; + } + __pyx_L36:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L38; + } + __pyx_L38:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L40; + } + __pyx_L40:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L42; + } + __pyx_L42:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L44; + } + __pyx_L44:; + __pyx_t_11 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_11) { + __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_11; + } + if (__pyx_t_3) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg); + __pyx_t_3 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_3) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L46; + } + __pyx_L46:; + __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_3) { + __pyx_t_11 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg); + __pyx_t_2 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_2) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L48; + } + __pyx_L48:; + __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + __pyx_t_11 = __pyx_t_3; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg); + __pyx_t_11 = (__pyx_v_memslice.memview != 0); + if (__pyx_t_11) { + __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + /*else*/ { + PyErr_Clear(); + } + goto __pyx_L50; + } + __pyx_L50:; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17_break; + } + __pyx_L17_break:; + } + __pyx_L15:; + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_candidates = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + if (PyList_CheckExact(__pyx_v_signatures) || PyTuple_CheckExact(__pyx_v_signatures)) { + __pyx_t_9 = __pyx_v_signatures; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_signatures); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; + } + for (;;) { + if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_14(__pyx_t_9); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_v_match_found = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_dest_sig); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dest_sig); + __Pyx_GIVEREF(__pyx_v_dest_sig); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_16(__pyx_t_8); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_17 = PyList_GET_ITEM(sequence, 0); + __pyx_t_18 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(__pyx_t_18); + #else + __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; + index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_17); + index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L56_unpacking_failed; + __Pyx_GOTREF(__pyx_t_18); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L57_unpacking_done; + __pyx_L56_unpacking_failed:; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L57_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17); + __pyx_t_17 = 0; + __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_11 = (__pyx_v_dst_type != Py_None); + __pyx_t_2 = (__pyx_t_11 != 0); + if (__pyx_t_2) { + __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + __pyx_v_match_found = 1; + goto __pyx_L59; + } + /*else*/ { + __pyx_v_match_found = 0; + goto __pyx_L55_break; + } + __pyx_L59:; + goto __pyx_L58; + } + __pyx_L58:; + } + __pyx_L55_break:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = (__pyx_v_match_found != 0); + if (__pyx_t_2) { + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L60; + } + __pyx_L60:; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0); + __pyx_t_11 = ((!__pyx_t_2) != 0); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((__pyx_t_10 > 1) != 0); + if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyObject_GetItem(__pyx_v_signatures, __pyx_t_9); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("pandas.algos.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dest_sig); + __Pyx_XDECREF(__pyx_v_numpy); + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XDECREF(__pyx_v_dtype); + __Pyx_XDECREF(__pyx_v_candidates); + __Pyx_XDECREF(__pyx_v_sig); + __Pyx_XDECREF(__pyx_v_src_type); + __Pyx_XDECREF(__pyx_v_dst_type); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int8_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_int8_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_0median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int8_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_0__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5algos_535__pyx_fuse_0median = {__Pyx_NAMESTR("__pyx_fuse_0median"), (PyCFunction)__pyx_pw_6pandas_5algos_535__pyx_fuse_0median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_535__pyx_fuse_0median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_0median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_534__pyx_fuse_0median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_534__pyx_fuse_0median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_0median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int8(__pyx_fuse_0__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_0median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int16_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_int16_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_1median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int16_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_1__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5algos_537__pyx_fuse_1median = {__Pyx_NAMESTR("__pyx_fuse_1median"), (PyCFunction)__pyx_pw_6pandas_5algos_537__pyx_fuse_1median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_537__pyx_fuse_1median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_1median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_536__pyx_fuse_1median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_536__pyx_fuse_1median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_1median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int16(__pyx_fuse_1__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_1median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_int32_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_2median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_2__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5algos_539__pyx_fuse_2median = {__Pyx_NAMESTR("__pyx_fuse_2median"), (PyCFunction)__pyx_pw_6pandas_5algos_539__pyx_fuse_2median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_539__pyx_fuse_2median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_2median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_538__pyx_fuse_2median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_538__pyx_fuse_2median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_2median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_fuse_2__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_2median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_3median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_int64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div___pyx_t_5numpy_int64_t((__pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_3__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5algos_541__pyx_fuse_3median = {__Pyx_NAMESTR("__pyx_fuse_3median"), (PyCFunction)__pyx_pw_6pandas_5algos_541__pyx_fuse_3median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_541__pyx_fuse_3median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_3median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_540__pyx_fuse_3median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_540__pyx_fuse_3median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_3median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_fuse_3__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_3median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint8_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_4median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint8_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_4__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5algos_543__pyx_fuse_4median = {__Pyx_NAMESTR("__pyx_fuse_4median"), (PyCFunction)__pyx_pw_6pandas_5algos_543__pyx_fuse_4median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_543__pyx_fuse_4median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_4median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_542__pyx_fuse_4median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_542__pyx_fuse_4median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_4median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_fuse_4__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_4median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint16_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_uint16_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_5median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_uint16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint16_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_5__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5algos_545__pyx_fuse_5median = {__Pyx_NAMESTR("__pyx_fuse_5median"), (PyCFunction)__pyx_pw_6pandas_5algos_545__pyx_fuse_5median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_545__pyx_fuse_5median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_5median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_544__pyx_fuse_5median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_544__pyx_fuse_5median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_5median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint16(__pyx_fuse_5__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_5median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_uint32_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_6median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __Pyx_div_long((__pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_6__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)), 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5algos_547__pyx_fuse_6median = {__Pyx_NAMESTR("__pyx_fuse_6median"), (PyCFunction)__pyx_pw_6pandas_5algos_547__pyx_fuse_6median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_547__pyx_fuse_6median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_6median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_546__pyx_fuse_6median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_546__pyx_fuse_6median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_6median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_fuse_6__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_6median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_uint64_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_7median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_uint64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_uint64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((__pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_7__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5algos_549__pyx_fuse_7median = {__Pyx_NAMESTR("__pyx_fuse_7median"), (PyCFunction)__pyx_pw_6pandas_5algos_549__pyx_fuse_7median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_549__pyx_fuse_7median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_7median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_548__pyx_fuse_7median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_548__pyx_fuse_7median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_7median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyInt_From_npy_uint64(__pyx_fuse_7__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_7median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float32_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_float32_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_8median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float32_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((__pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_8__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2.0); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5algos_551__pyx_fuse_8median = {__Pyx_NAMESTR("__pyx_fuse_8median"), (PyCFunction)__pyx_pw_6pandas_5algos_551__pyx_fuse_8median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_551__pyx_fuse_8median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_8median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_550__pyx_fuse_8median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_550__pyx_fuse_8median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_8median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_8__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_8median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_17median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5algos_median(__Pyx_memviewslice __pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_9median", 0); + __PYX_INC_MEMVIEW(&__pyx_v_arr, 1); + + /* "pandas/algos.pyx":827 + * A faster median + * ''' + * cdef Py_ssize_t n = arr.size # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/algos.pyx":829 + * cdef Py_ssize_t n = arr.size + * + * if n == 0: # <<<<<<<<<<<<<< + * return np.NaN + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":830 + * + * if n == 0: + * return np.NaN # <<<<<<<<<<<<<< + * + * arr = arr.copy() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":832 + * return np.NaN + * + * arr = arr.copy() # <<<<<<<<<<<<<< + * + * if n % 2: + */ + __pyx_t_6 = __pyx_memoryview_copy_slice_dc_nn___pyx_t_5numpy_float64_t_c(__pyx_v_arr); if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __pyx_v_arr = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "pandas/algos.pyx":834 + * arr = arr.copy() + * + * if n % 2: # <<<<<<<<<<<<<< + * return kth_smallest(arr, n // 2) + * else: + */ + __pyx_t_4 = (__Pyx_mod_Py_ssize_t(__pyx_v_n, 2) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":835 + * + * if n % 2: + * return kth_smallest(arr, n // 2) # <<<<<<<<<<<<<< + * else: + * return (kth_smallest(arr, n // 2) + + */ + __pyx_r = __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":838 + * else: + * return (kth_smallest(arr, n // 2) + + * kth_smallest(arr, n // 2 - 1)) / 2 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((__pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, __Pyx_div_Py_ssize_t(__pyx_v_n, 2), 0) + __pyx_fuse_9__pyx_f_6pandas_5algos_kth_smallest(__pyx_v_arr, (__Pyx_div_Py_ssize_t(__pyx_v_n, 2) - 1), 0)) / 2.0); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_WriteUnraisable("pandas.algos.median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr); /*proto*/ +static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5algos_553__pyx_fuse_9median = {__Pyx_NAMESTR("__pyx_fuse_9median"), (PyCFunction)__pyx_pw_6pandas_5algos_553__pyx_fuse_9median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_16median)}; +static PyObject *__pyx_pw_6pandas_5algos_553__pyx_fuse_9median(PyObject *__pyx_self, PyObject *__pyx_arg_arr) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_fuse_9median (wrapper)", 0); + assert(__pyx_arg_arr); { + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_arg_arr); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_552__pyx_fuse_9median(__pyx_self, __pyx_v_arr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_552__pyx_fuse_9median(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_fuse_9median", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_arr.memview)) { __Pyx_RaiseUnboundLocalError("arr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyFloat_FromDouble(__pyx_fuse_9__pyx_f_6pandas_5algos_median(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.__pyx_fuse_9median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":843 + * # -------------- Min, Max subsequence + * + * def max_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_19max_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_19max_subseq = {__Pyx_NAMESTR("max_subseq"), (PyCFunction)__pyx_pw_6pandas_5algos_19max_subseq, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_19max_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("max_subseq (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_18max_subseq(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_18max_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_s; + Py_ssize_t __pyx_v_e; + Py_ssize_t __pyx_v_T; + Py_ssize_t __pyx_v_n; + double __pyx_v_m; + double __pyx_v_S; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("max_subseq", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":845 + * def max_subseq(ndarray[double_t] arr): + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n # <<<<<<<<<<<<<< + * double m, S + * + */ + __pyx_v_i = 0; + __pyx_v_s = 0; + __pyx_v_e = 0; + + /* "pandas/algos.pyx":848 + * double m, S + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if len(arr) == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/algos.pyx":850 + * n = len(arr) + * + * if len(arr) == 0: # <<<<<<<<<<<<<< + * return (-1,-1,None) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_t_1 == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":851 + * + * if len(arr) == 0: + * return (-1,-1,None) # <<<<<<<<<<<<<< + * + * m = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__43); + __pyx_r = __pyx_tuple__43; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":853 + * return (-1,-1,None) + * + * m = arr[0] # <<<<<<<<<<<<<< + * S = m + * T = 0 + */ + __pyx_t_3 = 0; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_m = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/algos.pyx":854 + * + * m = arr[0] + * S = m # <<<<<<<<<<<<<< + * T = 0 + * + */ + __pyx_v_S = __pyx_v_m; + + /* "pandas/algos.pyx":855 + * m = arr[0] + * S = m + * T = 0 # <<<<<<<<<<<<<< + * + * for i in range(1, n): + */ + __pyx_v_T = 0; + + /* "pandas/algos.pyx":857 + * T = 0 + * + * for i in range(1, n): # <<<<<<<<<<<<<< + * # S = max { S + A[i], A[i] ) + * if (S > 0): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/algos.pyx":859 + * for i in range(1, n): + * # S = max { S + A[i], A[i] ) + * if (S > 0): # <<<<<<<<<<<<<< + * S = S + arr[i] + * else: + */ + __pyx_t_2 = ((__pyx_v_S > 0.0) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":860 + * # S = max { S + A[i], A[i] ) + * if (S > 0): + * S = S + arr[i] # <<<<<<<<<<<<<< + * else: + * S = arr[i] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_S = (__pyx_v_S + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides))); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/algos.pyx":862 + * S = S + arr[i] + * else: + * S = arr[i] # <<<<<<<<<<<<<< + * T = i + * if S > m: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_S = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/algos.pyx":863 + * else: + * S = arr[i] + * T = i # <<<<<<<<<<<<<< + * if S > m: + * s = T + */ + __pyx_v_T = __pyx_v_i; + } + __pyx_L6:; + + /* "pandas/algos.pyx":864 + * S = arr[i] + * T = i + * if S > m: # <<<<<<<<<<<<<< + * s = T + * e = i + */ + __pyx_t_2 = ((__pyx_v_S > __pyx_v_m) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":865 + * T = i + * if S > m: + * s = T # <<<<<<<<<<<<<< + * e = i + * m = S + */ + __pyx_v_s = __pyx_v_T; + + /* "pandas/algos.pyx":866 + * if S > m: + * s = T + * e = i # <<<<<<<<<<<<<< + * m = S + * + */ + __pyx_v_e = __pyx_v_i; + + /* "pandas/algos.pyx":867 + * s = T + * e = i + * m = S # <<<<<<<<<<<<<< + * + * return (s, e, m) + */ + __pyx_v_m = __pyx_v_S; + goto __pyx_L7; + } + __pyx_L7:; + } + + /* "pandas/algos.pyx":869 + * m = S + * + * return (s, e, m) # <<<<<<<<<<<<<< + * + * def min_subseq(ndarray[double_t] arr): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_s); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_e); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_m); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":843 + * # -------------- Min, Max subsequence + * + * def max_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.max_subseq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":871 + * return (s, e, m) + * + * def min_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s, e + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_21min_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_21min_subseq = {__Pyx_NAMESTR("min_subseq"), (PyCFunction)__pyx_pw_6pandas_5algos_21min_subseq, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_21min_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("min_subseq (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_20min_subseq(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_20min_subseq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_s; + Py_ssize_t __pyx_v_e; + double __pyx_v_m; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + double __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("min_subseq", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":876 + * double m + * + * (s, e, m) = max_subseq(-arr) # <<<<<<<<<<<<<< + * + * return (s, e, -m) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_max_subseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Negative(((PyObject *)__pyx_v_arr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_s = __pyx_t_7; + __pyx_v_e = __pyx_t_8; + __pyx_v_m = __pyx_t_9; + + /* "pandas/algos.pyx":878 + * (s, e, m) = max_subseq(-arr) + * + * return (s, e, -m) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_e); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyFloat_FromDouble((-__pyx_v_m)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":871 + * return (s, e, m) + * + * def min_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s, e + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.min_subseq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":883 + * # Rolling sum + * + * def roll_sum(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_23roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_23roll_sum = {__Pyx_NAMESTR("roll_sum"), (PyCFunction)__pyx_pw_6pandas_5algos_23roll_sum, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_23roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_sum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_sum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_22roll_sum(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_22roll_sum(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_sum_x; + int __pyx_v_nobs; + int __pyx_v_i; + int __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_sum", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":884 + * + * def roll_sum(ndarray[double_t] input, int win, int minp): + * cdef double val, prev, sum_x = 0 # <<<<<<<<<<<<<< + * cdef int nobs = 0, i + * cdef int N = len(input) + */ + __pyx_v_sum_x = 0.0; + + /* "pandas/algos.pyx":885 + * def roll_sum(ndarray[double_t] input, int win, int minp): + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i # <<<<<<<<<<<<<< + * cdef int N = len(input) + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":886 + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + * cdef int N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":888 + * cdef int N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":890 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":892 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":893 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":896 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * sum_x += val + */ + __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":897 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * sum_x += val + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":898 + * if val == val: + * nobs += 1 + * sum_x += val # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":900 + * sum_x += val + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":902 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":903 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":905 + * val = input[i] + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * sum_x += val + */ + __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":906 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * sum_x += val + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":907 + * if val == val: + * nobs += 1 + * sum_x += val # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val); + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":909 + * sum_x += val + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * if prev == prev: + */ + __pyx_t_11 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":910 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * if prev == prev: + * sum_x -= prev + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_15 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_15 = 0; + if (unlikely(__pyx_t_15 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_15); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":911 + * if i > win - 1: + * prev = input[i - win] + * if prev == prev: # <<<<<<<<<<<<<< + * sum_x -= prev + * nobs -= 1 + */ + __pyx_t_11 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":912 + * prev = input[i - win] + * if prev == prev: + * sum_x -= prev # <<<<<<<<<<<<<< + * nobs -= 1 + * + */ + __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev); + + /* "pandas/algos.pyx":913 + * if prev == prev: + * sum_x -= prev + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":915 + * nobs -= 1 + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * output[i] = sum_x + * else: + */ + __pyx_t_11 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":916 + * + * if nobs >= minp: + * output[i] = sum_x # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_16 = 0; + if (unlikely(__pyx_t_16 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_16); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_sum_x; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":918 + * output[i] = sum_x + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_17 = 0; + if (unlikely(__pyx_t_17 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_17); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":920 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":883 + * # Rolling sum + * + * def roll_sum(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":925 + * # Rolling mean + * + * def roll_mean(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_25roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_25roll_mean = {__Pyx_NAMESTR("roll_mean"), (PyCFunction)__pyx_pw_6pandas_5algos_25roll_mean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_25roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_mean (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_mean") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_24roll_mean(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_24roll_mean(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_result; + double __pyx_v_sum_x; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_neg_ct; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_mean", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":928 + * int win, int minp): + * cdef: + * double val, prev, result, sum_x = 0 # <<<<<<<<<<<<<< + * Py_ssize_t nobs = 0, i, neg_ct = 0 + * Py_ssize_t N = len(input) + */ + __pyx_v_sum_x = 0.0; + + /* "pandas/algos.pyx":929 + * cdef: + * double val, prev, result, sum_x = 0 + * Py_ssize_t nobs = 0, i, neg_ct = 0 # <<<<<<<<<<<<<< + * Py_ssize_t N = len(input) + * + */ + __pyx_v_nobs = 0; + __pyx_v_neg_ct = 0; + + /* "pandas/algos.pyx":930 + * double val, prev, result, sum_x = 0 + * Py_ssize_t nobs = 0, i, neg_ct = 0 + * Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":932 + * Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * minp = _check_minp(win, minp, N) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":933 + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":935 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":936 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":939 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * sum_x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":940 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * sum_x += val + * if signbit(val): + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":941 + * if val == val: + * nobs += 1 + * sum_x += val # <<<<<<<<<<<<<< + * if signbit(val): + * neg_ct += 1 + */ + __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val); + + /* "pandas/algos.pyx":942 + * nobs += 1 + * sum_x += val + * if signbit(val): # <<<<<<<<<<<<<< + * neg_ct += 1 + * + */ + __pyx_t_10 = (signbit(__pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":943 + * sum_x += val + * if signbit(val): + * neg_ct += 1 # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_v_neg_ct = (__pyx_v_neg_ct + 1); + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":945 + * neg_ct += 1 + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":947 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":948 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":950 + * val = input[i] + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * sum_x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":951 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * sum_x += val + * if signbit(val): + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":952 + * if val == val: + * nobs += 1 + * sum_x += val # <<<<<<<<<<<<<< + * if signbit(val): + * neg_ct += 1 + */ + __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val); + + /* "pandas/algos.pyx":953 + * nobs += 1 + * sum_x += val + * if signbit(val): # <<<<<<<<<<<<<< + * neg_ct += 1 + * + */ + __pyx_t_10 = (signbit(__pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":954 + * sum_x += val + * if signbit(val): + * neg_ct += 1 # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_v_neg_ct = (__pyx_v_neg_ct + 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":956 + * neg_ct += 1 + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * if prev == prev: + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":957 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * if prev == prev: + * sum_x -= prev + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":958 + * if i > win - 1: + * prev = input[i - win] + * if prev == prev: # <<<<<<<<<<<<<< + * sum_x -= prev + * nobs -= 1 + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":959 + * prev = input[i - win] + * if prev == prev: + * sum_x -= prev # <<<<<<<<<<<<<< + * nobs -= 1 + * if signbit(prev): + */ + __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev); + + /* "pandas/algos.pyx":960 + * if prev == prev: + * sum_x -= prev + * nobs -= 1 # <<<<<<<<<<<<<< + * if signbit(prev): + * neg_ct -= 1 + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + + /* "pandas/algos.pyx":961 + * sum_x -= prev + * nobs -= 1 + * if signbit(prev): # <<<<<<<<<<<<<< + * neg_ct -= 1 + * + */ + __pyx_t_10 = (signbit(__pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":962 + * nobs -= 1 + * if signbit(prev): + * neg_ct -= 1 # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_neg_ct = (__pyx_v_neg_ct - 1); + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":964 + * neg_ct -= 1 + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * result = sum_x / nobs + * if neg_ct == 0 and result < 0: + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":965 + * + * if nobs >= minp: + * result = sum_x / nobs # <<<<<<<<<<<<<< + * if neg_ct == 0 and result < 0: + * # all positive + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_result = (__pyx_v_sum_x / __pyx_v_nobs); + + /* "pandas/algos.pyx":966 + * if nobs >= minp: + * result = sum_x / nobs + * if neg_ct == 0 and result < 0: # <<<<<<<<<<<<<< + * # all positive + * output[i] = 0 + */ + __pyx_t_10 = ((__pyx_v_neg_ct == 0) != 0); + if (__pyx_t_10) { + __pyx_t_15 = ((__pyx_v_result < 0.0) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_10; + } + if (__pyx_t_16) { + + /* "pandas/algos.pyx":968 + * if neg_ct == 0 and result < 0: + * # all positive + * output[i] = 0 # <<<<<<<<<<<<<< + * elif neg_ct == nobs and result > 0: + * # all negative + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = 0.0; + goto __pyx_L15; + } + + /* "pandas/algos.pyx":969 + * # all positive + * output[i] = 0 + * elif neg_ct == nobs and result > 0: # <<<<<<<<<<<<<< + * # all negative + * output[i] = 0 + */ + __pyx_t_16 = ((__pyx_v_neg_ct == __pyx_v_nobs) != 0); + if (__pyx_t_16) { + __pyx_t_10 = ((__pyx_v_result > 0.0) != 0); + __pyx_t_15 = __pyx_t_10; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (__pyx_t_15) { + + /* "pandas/algos.pyx":971 + * elif neg_ct == nobs and result > 0: + * # all negative + * output[i] = 0 # <<<<<<<<<<<<<< + * else: + * output[i] = result + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = 0.0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/algos.pyx":973 + * output[i] = 0 + * else: + * output[i] = result # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_result; + } + __pyx_L15:; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/algos.pyx":975 + * output[i] = result + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L14:; + } + + /* "pandas/algos.pyx":977 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":925 + * # Rolling mean + * + * def roll_mean(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":982 + * # Exponentially weighted moving average + * + * def ewma(ndarray[double_t] input, double_t com, int adjust): # <<<<<<<<<<<<<< + * ''' + * Compute exponentially-weighted moving average using center-of-mass. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_27ewma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_26ewma[] = "\n Compute exponentially-weighted moving average using center-of-mass.\n\n Parameters\n ----------\n input : ndarray (float64 type)\n com : float64\n\n Returns\n -------\n y : ndarray\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_27ewma = {__Pyx_NAMESTR("ewma"), (PyCFunction)__pyx_pw_6pandas_5algos_27ewma, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_26ewma)}; +static PyObject *__pyx_pw_6pandas_5algos_27ewma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + __pyx_t_5numpy_double_t __pyx_v_com; + int __pyx_v_adjust; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ewma (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_com,&__pyx_n_s_adjust,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_com)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_adjust)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ewma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_com = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_com == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_adjust = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_adjust == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.ewma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_26ewma(__pyx_self, __pyx_v_input, __pyx_v_com, __pyx_v_adjust); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_26ewma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust) { + double __pyx_v_cur; + double __pyx_v_prev; + double __pyx_v_neww; + double __pyx_v_oldw; + double __pyx_v_adj; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __pyx_t_5numpy_double_t __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + long __pyx_t_11; + long __pyx_t_12; + long __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + double __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ewma", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":998 + * cdef double cur, prev, neww, oldw, adj + * cdef Py_ssize_t i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1000 + * cdef Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * if N == 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1002 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * if N == 0: # <<<<<<<<<<<<<< + * return output + * + */ + __pyx_t_7 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1003 + * + * if N == 0: + * return output # <<<<<<<<<<<<<< + * + * neww = 1. / (1. + com) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1005 + * return output + * + * neww = 1. / (1. + com) # <<<<<<<<<<<<<< + * oldw = 1. - neww + * adj = oldw + */ + __pyx_t_8 = (1. + __pyx_v_com); + if (unlikely(__pyx_t_8 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_neww = (1. / __pyx_t_8); + + /* "pandas/algos.pyx":1006 + * + * neww = 1. / (1. + com) + * oldw = 1. - neww # <<<<<<<<<<<<<< + * adj = oldw + * + */ + __pyx_v_oldw = (1. - __pyx_v_neww); + + /* "pandas/algos.pyx":1007 + * neww = 1. / (1. + com) + * oldw = 1. - neww + * adj = oldw # <<<<<<<<<<<<<< + * + * if adjust: + */ + __pyx_v_adj = __pyx_v_oldw; + + /* "pandas/algos.pyx":1009 + * adj = oldw + * + * if adjust: # <<<<<<<<<<<<<< + * output[0] = neww * input[0] + * else: + */ + __pyx_t_7 = (__pyx_v_adjust != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1010 + * + * if adjust: + * output[0] = neww * input[0] # <<<<<<<<<<<<<< + * else: + * output[0] = input[0] + */ + __pyx_t_9 = 0; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_t_10 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_v_neww * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_input.diminfo[0].strides))); + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":1012 + * output[0] = neww * input[0] + * else: + * output[0] = input[0] # <<<<<<<<<<<<<< + * + * for i from 1 <= i < N: + */ + __pyx_t_12 = 0; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = 0; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_output.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_input.diminfo[0].strides)); + } + __pyx_L4:; + + /* "pandas/algos.pyx":1014 + * output[0] = input[0] + * + * for i from 1 <= i < N: # <<<<<<<<<<<<<< + * cur = input[i] + * prev = output[i - 1] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1015 + * + * for i from 1 <= i < N: + * cur = input[i] # <<<<<<<<<<<<<< + * prev = output[i - 1] + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1016 + * for i from 1 <= i < N: + * cur = input[i] + * prev = output[i - 1] # <<<<<<<<<<<<<< + * + * if cur == cur: + */ + __pyx_t_15 = (__pyx_v_i - 1); + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides)); + + /* "pandas/algos.pyx":1018 + * prev = output[i - 1] + * + * if cur == cur: # <<<<<<<<<<<<<< + * if prev == prev: + * output[i] = oldw * prev + neww * cur + */ + __pyx_t_7 = ((__pyx_v_cur == __pyx_v_cur) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1019 + * + * if cur == cur: + * if prev == prev: # <<<<<<<<<<<<<< + * output[i] = oldw * prev + neww * cur + * else: + */ + __pyx_t_7 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1020 + * if cur == cur: + * if prev == prev: + * output[i] = oldw * prev + neww * cur # <<<<<<<<<<<<<< + * else: + * output[i] = neww * cur + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = ((__pyx_v_oldw * __pyx_v_prev) + (__pyx_v_neww * __pyx_v_cur)); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/algos.pyx":1022 + * output[i] = oldw * prev + neww * cur + * else: + * output[i] = neww * cur # <<<<<<<<<<<<<< + * else: + * output[i] = prev + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_v_neww * __pyx_v_cur); + } + __pyx_L8:; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/algos.pyx":1024 + * output[i] = neww * cur + * else: + * output[i] = prev # <<<<<<<<<<<<<< + * + * if adjust: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_prev; + } + __pyx_L7:; + } + + /* "pandas/algos.pyx":1026 + * output[i] = prev + * + * if adjust: # <<<<<<<<<<<<<< + * for i from 0 <= i < N: + * cur = input[i] + */ + __pyx_t_7 = (__pyx_v_adjust != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1027 + * + * if adjust: + * for i from 0 <= i < N: # <<<<<<<<<<<<<< + * cur = input[i] + * + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1028 + * if adjust: + * for i from 0 <= i < N: + * cur = input[i] # <<<<<<<<<<<<<< + * + * if cur == cur: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1030 + * cur = input[i] + * + * if cur == cur: # <<<<<<<<<<<<<< + * output[i] = output[i] / (1. - adj) + * adj *= oldw + */ + __pyx_t_7 = ((__pyx_v_cur == __pyx_v_cur) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1031 + * + * if cur == cur: + * output[i] = output[i] / (1. - adj) # <<<<<<<<<<<<<< + * adj *= oldw + * else: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides)); + __pyx_t_21 = (1. - __pyx_v_adj); + if (unlikely(__pyx_t_21 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_t_8 / __pyx_t_21); + + /* "pandas/algos.pyx":1032 + * if cur == cur: + * output[i] = output[i] / (1. - adj) + * adj *= oldw # <<<<<<<<<<<<<< + * else: + * if i >= 1: + */ + __pyx_v_adj = (__pyx_v_adj * __pyx_v_oldw); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1034 + * adj *= oldw + * else: + * if i >= 1: # <<<<<<<<<<<<<< + * output[i] = output[i - 1] + * + */ + __pyx_t_7 = ((__pyx_v_i >= 1) != 0); + if (__pyx_t_7) { + + /* "pandas/algos.pyx":1035 + * else: + * if i >= 1: + * output[i] = output[i - 1] # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_t_10 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_output.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_output.diminfo[0].strides)); + goto __pyx_L13; + } + __pyx_L13:; + } + __pyx_L12:; + } + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1037 + * output[i] = output[i - 1] + * + * return output # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":982 + * # Exponentially weighted moving average + * + * def ewma(ndarray[double_t] input, double_t com, int adjust): # <<<<<<<<<<<<<< + * ''' + * Compute exponentially-weighted moving average using center-of-mass. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.ewma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1044 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_29nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_29nancorr = {__Pyx_NAMESTR("nancorr"), (PyCFunction)__pyx_pw_6pandas_5algos_29nancorr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_29nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_mat = 0; + PyObject *__pyx_v_cov = 0; + PyObject *__pyx_v_minp = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nancorr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_cov,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cov); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nancorr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_mat = ((PyArrayObject *)values[0]); + __pyx_v_cov = values[1]; + __pyx_v_minp = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("nancorr", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.nancorr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_5numpy_ndarray, 1, "mat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_28nancorr(__pyx_self, __pyx_v_mat, __pyx_v_cov, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_28nancorr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, PyObject *__pyx_v_cov, PyObject *__pyx_v_minp) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_mask = 0; + __pyx_t_5numpy_int64_t __pyx_v_nobs; + __pyx_t_5numpy_float64_t __pyx_v_vx; + __pyx_t_5numpy_float64_t __pyx_v_vy; + __pyx_t_5numpy_float64_t __pyx_v_sumx; + __pyx_t_5numpy_float64_t __pyx_v_sumy; + __pyx_t_5numpy_float64_t __pyx_v_sumxx; + __pyx_t_5numpy_float64_t __pyx_v_sumyy; + __pyx_t_5numpy_float64_t __pyx_v_meanx; + __pyx_t_5numpy_float64_t __pyx_v_meany; + __pyx_t_5numpy_float64_t __pyx_v_divisor; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mat; + __Pyx_Buffer __pyx_pybuffer_mat; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyArrayObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_float64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + double __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("nancorr", 0); + __Pyx_INCREF(__pyx_v_minp); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_mat.pybuffer.buf = NULL; + __pyx_pybuffer_mat.refcount = 0; + __pyx_pybuffernd_mat.data = NULL; + __pyx_pybuffernd_mat.rcbuffer = &__pyx_pybuffer_mat; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mat.rcbuffer->pybuffer, (PyObject*)__pyx_v_mat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mat.diminfo[0].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mat.diminfo[0].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mat.diminfo[1].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mat.diminfo[1].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":1049 + * ndarray[float64_t, ndim=2] result + * ndarray[uint8_t, ndim=2] mask + * int64_t nobs = 0 # <<<<<<<<<<<<<< + * float64_t vx, vy, sumx, sumy, sumxx, sumyy, meanx, meany, divisor + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1052 + * float64_t vx, vy, sumx, sumy, sumxx, sumyy, meanx, meany, divisor + * + * N, K = ( mat).shape # <<<<<<<<<<<<<< + * + * if minp is None: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":1054 + * N, K = ( mat).shape + * + * if minp is None: # <<<<<<<<<<<<<< + * minp = 1 + * + */ + __pyx_t_8 = (__pyx_v_minp == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/algos.pyx":1055 + * + * if minp is None: + * minp = 1 # <<<<<<<<<<<<<< + * + * result = np.empty((K, K), dtype=np.float64) + */ + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF_SET(__pyx_v_minp, __pyx_int_1); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1057 + * minp = 1 + * + * result = np.empty((K, K), dtype=np.float64) # <<<<<<<<<<<<<< + * mask = np.isfinite(mat).view(np.uint8) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/algos.pyx":1058 + * + * result = np.empty((K, K), dtype=np.float64) + * mask = np.isfinite(mat).view(np.uint8) # <<<<<<<<<<<<<< + * + * for xi in range(K): + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_mat)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_mat)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_mat)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13); + } + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = 0; + __pyx_v_mask = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":1060 + * mask = np.isfinite(mat).view(np.uint8) + * + * for xi in range(K): # <<<<<<<<<<<<<< + * for yi in range(xi + 1): + * nobs = sumxx = sumyy = sumx = sumy = 0 + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_xi = __pyx_t_6; + + /* "pandas/algos.pyx":1061 + * + * for xi in range(K): + * for yi in range(xi + 1): # <<<<<<<<<<<<<< + * nobs = sumxx = sumyy = sumx = sumy = 0 + * for i in range(N): + */ + __pyx_t_17 = (__pyx_v_xi + 1); + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_yi = __pyx_t_18; + + /* "pandas/algos.pyx":1062 + * for xi in range(K): + * for yi in range(xi + 1): + * nobs = sumxx = sumyy = sumx = sumy = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + */ + __pyx_v_nobs = 0; + __pyx_v_sumxx = 0; + __pyx_v_sumyy = 0; + __pyx_v_sumx = 0; + __pyx_v_sumy = 0; + + /* "pandas/algos.pyx":1063 + * for yi in range(xi + 1): + * nobs = sumxx = sumyy = sumx = sumy = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] + */ + __pyx_t_19 = __pyx_v_N; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_i = __pyx_t_20; + + /* "pandas/algos.pyx":1064 + * nobs = sumxx = sumyy = sumx = sumy = 0 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: # <<<<<<<<<<<<<< + * vx = mat[i, xi] + * vy = mat[i, yi] + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_xi; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_yi; + __pyx_t_8 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + __pyx_t_25 = __pyx_t_8; + } else { + __pyx_t_25 = __pyx_t_9; + } + if (__pyx_t_25) { + + /* "pandas/algos.pyx":1065 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] # <<<<<<<<<<<<<< + * vy = mat[i, yi] + * nobs += 1 + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = __pyx_v_xi; + __pyx_v_vx = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_mat.diminfo[1].strides)); + + /* "pandas/algos.pyx":1066 + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] + * vy = mat[i, yi] # <<<<<<<<<<<<<< + * nobs += 1 + * sumx += vx + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_yi; + __pyx_v_vy = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_mat.diminfo[1].strides)); + + /* "pandas/algos.pyx":1067 + * vx = mat[i, xi] + * vy = mat[i, yi] + * nobs += 1 # <<<<<<<<<<<<<< + * sumx += vx + * sumy += vy + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1068 + * vy = mat[i, yi] + * nobs += 1 + * sumx += vx # <<<<<<<<<<<<<< + * sumy += vy + * + */ + __pyx_v_sumx = (__pyx_v_sumx + __pyx_v_vx); + + /* "pandas/algos.pyx":1069 + * nobs += 1 + * sumx += vx + * sumy += vy # <<<<<<<<<<<<<< + * + * if nobs < minp: + */ + __pyx_v_sumy = (__pyx_v_sumy + __pyx_v_vy); + goto __pyx_L12; + } + __pyx_L12:; + } + + /* "pandas/algos.pyx":1071 + * sumy += vy + * + * if nobs < minp: # <<<<<<<<<<<<<< + * result[xi, yi] = result[yi, xi] = np.NaN + * else: + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_minp, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_25 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_25 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_25) { + + /* "pandas/algos.pyx":1072 + * + * if nobs < minp: + * result[xi, yi] = result[yi, xi] = np.NaN # <<<<<<<<<<<<<< + * else: + * meanx = sumx / nobs + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __pyx_v_xi; + __pyx_t_20 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_31 = __pyx_v_yi; + __pyx_t_32 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1074 + * result[xi, yi] = result[yi, xi] = np.NaN + * else: + * meanx = sumx / nobs # <<<<<<<<<<<<<< + * meany = sumy / nobs + * + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_meanx = (__pyx_v_sumx / __pyx_v_nobs); + + /* "pandas/algos.pyx":1075 + * else: + * meanx = sumx / nobs + * meany = sumy / nobs # <<<<<<<<<<<<<< + * + * # now the cov numerator + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_meany = (__pyx_v_sumy / __pyx_v_nobs); + + /* "pandas/algos.pyx":1078 + * + * # now the cov numerator + * sumx = 0 # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_v_sumx = 0.0; + + /* "pandas/algos.pyx":1080 + * sumx = 0 + * + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] - meanx + */ + __pyx_t_33 = __pyx_v_N; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_i = __pyx_t_34; + + /* "pandas/algos.pyx":1081 + * + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: # <<<<<<<<<<<<<< + * vx = mat[i, xi] - meanx + * vy = mat[i, yi] - meany + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_xi; + __pyx_t_25 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_25) { + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_yi; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + __pyx_t_8 = __pyx_t_9; + } else { + __pyx_t_8 = __pyx_t_25; + } + if (__pyx_t_8) { + + /* "pandas/algos.pyx":1082 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] - meanx # <<<<<<<<<<<<<< + * vy = mat[i, yi] - meany + * + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_xi; + __pyx_v_vx = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_mat.diminfo[1].strides)) - __pyx_v_meanx); + + /* "pandas/algos.pyx":1083 + * if mask[i, xi] and mask[i, yi]: + * vx = mat[i, xi] - meanx + * vy = mat[i, yi] - meany # <<<<<<<<<<<<<< + * + * sumx += vx * vy + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_yi; + __pyx_v_vy = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_mat.diminfo[1].strides)) - __pyx_v_meany); + + /* "pandas/algos.pyx":1085 + * vy = mat[i, yi] - meany + * + * sumx += vx * vy # <<<<<<<<<<<<<< + * sumxx += vx * vx + * sumyy += vy * vy + */ + __pyx_v_sumx = (__pyx_v_sumx + (__pyx_v_vx * __pyx_v_vy)); + + /* "pandas/algos.pyx":1086 + * + * sumx += vx * vy + * sumxx += vx * vx # <<<<<<<<<<<<<< + * sumyy += vy * vy + * + */ + __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx)); + + /* "pandas/algos.pyx":1087 + * sumx += vx * vy + * sumxx += vx * vx + * sumyy += vy * vy # <<<<<<<<<<<<<< + * + * divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy) + */ + __pyx_v_sumyy = (__pyx_v_sumyy + (__pyx_v_vy * __pyx_v_vy)); + goto __pyx_L16; + } + __pyx_L16:; + } + + /* "pandas/algos.pyx":1089 + * sumyy += vy * vy + * + * divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy) # <<<<<<<<<<<<<< + * + * if divisor != 0: + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_cov); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_8) { + __pyx_t_43 = (__pyx_v_nobs - 1.0); + } else { + __pyx_t_43 = sqrt((__pyx_v_sumxx * __pyx_v_sumyy)); + } + __pyx_v_divisor = __pyx_t_43; + + /* "pandas/algos.pyx":1091 + * divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy) + * + * if divisor != 0: # <<<<<<<<<<<<<< + * result[xi, yi] = result[yi, xi] = sumx / divisor + * else: + */ + __pyx_t_8 = ((__pyx_v_divisor != 0.0) != 0); + if (__pyx_t_8) { + + /* "pandas/algos.pyx":1092 + * + * if divisor != 0: + * result[xi, yi] = result[yi, xi] = sumx / divisor # <<<<<<<<<<<<<< + * else: + * result[xi, yi] = result[yi, xi] = np.NaN + */ + if (unlikely(__pyx_v_divisor == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = (__pyx_v_sumx / __pyx_v_divisor); + __pyx_t_33 = __pyx_v_xi; + __pyx_t_34 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __pyx_t_44 = __pyx_v_yi; + __pyx_t_45 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/algos.pyx":1094 + * result[xi, yi] = result[yi, xi] = sumx / divisor + * else: + * result[xi, yi] = result[yi, xi] = np.NaN # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_46 = __pyx_v_xi; + __pyx_t_47 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_48 = __pyx_v_yi; + __pyx_t_49 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_30; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L17:; + } + __pyx_L13:; + } + } + + /* "pandas/algos.pyx":1096 + * result[xi, yi] = result[yi, xi] = np.NaN + * + * return result # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":1044 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.nancorr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_mask); + __Pyx_XDECREF(__pyx_v_minp); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1103 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_31nancorr_spearman(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_31nancorr_spearman = {__Pyx_NAMESTR("nancorr_spearman"), (PyCFunction)__pyx_pw_6pandas_5algos_31nancorr_spearman, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_31nancorr_spearman(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_mat = 0; + Py_ssize_t __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nancorr_spearman (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_minp,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nancorr_spearman") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_mat = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_minp = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_minp == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_minp = ((Py_ssize_t)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("nancorr_spearman", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.nancorr_spearman", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_5numpy_ndarray, 1, "mat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_30nancorr_spearman(__pyx_self, __pyx_v_mat, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_30nancorr_spearman(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mat, Py_ssize_t __pyx_v_minp) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_maskedx = 0; + PyArrayObject *__pyx_v_maskedy = 0; + PyArrayObject *__pyx_v_mask = 0; + __pyx_t_5numpy_int64_t __pyx_v_nobs; + __pyx_t_5numpy_float64_t __pyx_v_vx; + __pyx_t_5numpy_float64_t __pyx_v_vy; + __pyx_t_5numpy_float64_t __pyx_v_sumx; + __pyx_t_5numpy_float64_t __pyx_v_sumxx; + __pyx_t_5numpy_float64_t __pyx_v_sumyy; + __pyx_t_5numpy_float64_t __pyx_v_mean; + __pyx_t_5numpy_float64_t __pyx_v_divisor; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maskedx; + __Pyx_Buffer __pyx_pybuffer_maskedx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maskedy; + __Pyx_Buffer __pyx_pybuffer_maskedy; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mat; + __Pyx_Buffer __pyx_pybuffer_mat; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_t_24; + int __pyx_t_25; + __pyx_t_5numpy_float64_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + PyArrayObject *__pyx_t_29 = NULL; + PyArrayObject *__pyx_t_30 = NULL; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + __pyx_t_5numpy_int64_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("nancorr_spearman", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_maskedx.pybuffer.buf = NULL; + __pyx_pybuffer_maskedx.refcount = 0; + __pyx_pybuffernd_maskedx.data = NULL; + __pyx_pybuffernd_maskedx.rcbuffer = &__pyx_pybuffer_maskedx; + __pyx_pybuffer_maskedy.pybuffer.buf = NULL; + __pyx_pybuffer_maskedy.refcount = 0; + __pyx_pybuffernd_maskedy.data = NULL; + __pyx_pybuffernd_maskedy.rcbuffer = &__pyx_pybuffer_maskedy; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_mat.pybuffer.buf = NULL; + __pyx_pybuffer_mat.refcount = 0; + __pyx_pybuffernd_mat.data = NULL; + __pyx_pybuffernd_mat.rcbuffer = &__pyx_pybuffer_mat; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mat.rcbuffer->pybuffer, (PyObject*)__pyx_v_mat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mat.diminfo[0].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mat.diminfo[0].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mat.diminfo[1].strides = __pyx_pybuffernd_mat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mat.diminfo[1].shape = __pyx_pybuffernd_mat.rcbuffer->pybuffer.shape[1]; + + /* "pandas/algos.pyx":1110 + * ndarray[float64_t, ndim=1] maskedy + * ndarray[uint8_t, ndim=2] mask + * int64_t nobs = 0 # <<<<<<<<<<<<<< + * float64_t vx, vy, sumx, sumxx, sumyy, mean, divisor + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1113 + * float64_t vx, vy, sumx, sumxx, sumyy, mean, divisor + * + * N, K = ( mat).shape # <<<<<<<<<<<<<< + * + * result = np.empty((K, K), dtype=np.float64) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_6; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":1115 + * N, K = ( mat).shape + * + * result = np.empty((K, K), dtype=np.float64) # <<<<<<<<<<<<<< + * mask = np.isfinite(mat).view(np.uint8) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/algos.pyx":1116 + * + * result = np.empty((K, K), dtype=np.float64) + * mask = np.isfinite(mat).view(np.uint8) # <<<<<<<<<<<<<< + * + * for xi in range(K): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_mat)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_mat)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_mat)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_mask = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":1118 + * mask = np.isfinite(mat).view(np.uint8) + * + * for xi in range(K): # <<<<<<<<<<<<<< + * for yi in range(xi + 1): + * nobs = 0 + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_xi = __pyx_t_6; + + /* "pandas/algos.pyx":1119 + * + * for xi in range(K): + * for yi in range(xi + 1): # <<<<<<<<<<<<<< + * nobs = 0 + * for i in range(N): + */ + __pyx_t_15 = (__pyx_v_xi + 1); + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_yi = __pyx_t_16; + + /* "pandas/algos.pyx":1120 + * for xi in range(K): + * for yi in range(xi + 1): + * nobs = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1121 + * for yi in range(xi + 1): + * nobs = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i, xi] and mask[i, yi]: + * nobs += 1 + */ + __pyx_t_17 = __pyx_v_N; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + + /* "pandas/algos.pyx":1122 + * nobs = 0 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: # <<<<<<<<<<<<<< + * nobs += 1 + * + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_xi; + __pyx_t_21 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_21) { + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_yi; + __pyx_t_24 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + __pyx_t_25 = __pyx_t_24; + } else { + __pyx_t_25 = __pyx_t_21; + } + if (__pyx_t_25) { + + /* "pandas/algos.pyx":1123 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + * nobs += 1 # <<<<<<<<<<<<<< + * + * if nobs < minp: + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":1125 + * nobs += 1 + * + * if nobs < minp: # <<<<<<<<<<<<<< + * result[xi, yi] = result[yi, xi] = np.NaN + * else: + */ + __pyx_t_25 = ((__pyx_v_nobs < __pyx_v_minp) != 0); + if (__pyx_t_25) { + + /* "pandas/algos.pyx":1126 + * + * if nobs < minp: + * result[xi, yi] = result[yi, xi] = np.NaN # <<<<<<<<<<<<<< + * else: + * maskedx = np.empty(nobs, dtype=np.float64) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __pyx_v_xi; + __pyx_t_18 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __pyx_v_yi; + __pyx_t_28 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1128 + * result[xi, yi] = result[yi, xi] = np.NaN + * else: + * maskedx = np.empty(nobs, dtype=np.float64) # <<<<<<<<<<<<<< + * maskedy = np.empty(nobs, dtype=np.float64) + * j = 0 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_29 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_maskedx.diminfo[0].strides = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedx.diminfo[0].shape = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = 0; + __Pyx_XDECREF_SET(__pyx_v_maskedx, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":1129 + * else: + * maskedx = np.empty(nobs, dtype=np.float64) + * maskedy = np.empty(nobs, dtype=np.float64) # <<<<<<<<<<<<<< + * j = 0 + * for i in range(N): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_nobs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_30 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_maskedy.diminfo[0].strides = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedy.diminfo[0].shape = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = 0; + __Pyx_XDECREF_SET(__pyx_v_maskedy, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1130 + * maskedx = np.empty(nobs, dtype=np.float64) + * maskedy = np.empty(nobs, dtype=np.float64) + * j = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + */ + __pyx_v_j = 0; + + /* "pandas/algos.pyx":1131 + * maskedy = np.empty(nobs, dtype=np.float64) + * j = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i, xi] and mask[i, yi]: + * maskedx[j] = mat[i, xi] + */ + __pyx_t_31 = __pyx_v_N; + for (__pyx_t_32 = 0; __pyx_t_32 < __pyx_t_31; __pyx_t_32+=1) { + __pyx_v_i = __pyx_t_32; + + /* "pandas/algos.pyx":1132 + * j = 0 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: # <<<<<<<<<<<<<< + * maskedx[j] = mat[i, xi] + * maskedy[j] = mat[i, yi] + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_xi; + __pyx_t_25 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_25) { + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_yi; + __pyx_t_21 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + __pyx_t_24 = __pyx_t_21; + } else { + __pyx_t_24 = __pyx_t_25; + } + if (__pyx_t_24) { + + /* "pandas/algos.pyx":1133 + * for i in range(N): + * if mask[i, xi] and mask[i, yi]: + * maskedx[j] = mat[i, xi] # <<<<<<<<<<<<<< + * maskedy[j] = mat[i, yi] + * j += 1 + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_xi; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_maskedx.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_mat.diminfo[1].strides)); + + /* "pandas/algos.pyx":1134 + * if mask[i, xi] and mask[i, yi]: + * maskedx[j] = mat[i, xi] + * maskedy[j] = mat[i, yi] # <<<<<<<<<<<<<< + * j += 1 + * maskedx = rank_1d_float64(maskedx) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_yi; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_maskedy.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_mat.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_mat.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_mat.diminfo[1].strides)); + + /* "pandas/algos.pyx":1135 + * maskedx[j] = mat[i, xi] + * maskedy[j] = mat[i, yi] + * j += 1 # <<<<<<<<<<<<<< + * maskedx = rank_1d_float64(maskedx) + * maskedy = rank_1d_float64(maskedy) + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L15; + } + __pyx_L15:; + } + + /* "pandas/algos.pyx":1136 + * maskedy[j] = mat[i, yi] + * j += 1 + * maskedx = rank_1d_float64(maskedx) # <<<<<<<<<<<<<< + * maskedy = rank_1d_float64(maskedy) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_maskedx)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_maskedx)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_maskedx)); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_29 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_maskedx.diminfo[0].strides = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedx.diminfo[0].shape = __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = 0; + __Pyx_DECREF_SET(__pyx_v_maskedx, ((PyArrayObject *)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "pandas/algos.pyx":1137 + * j += 1 + * maskedx = rank_1d_float64(maskedx) + * maskedy = rank_1d_float64(maskedy) # <<<<<<<<<<<<<< + * + * mean = (nobs + 1) / 2. + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_rank_1d_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_maskedy)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_maskedy)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_maskedy)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_30 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer, (PyObject*)__pyx_v_maskedy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_maskedy.diminfo[0].strides = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maskedy.diminfo[0].shape = __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = 0; + __Pyx_DECREF_SET(__pyx_v_maskedy, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1139 + * maskedy = rank_1d_float64(maskedy) + * + * mean = (nobs + 1) / 2. # <<<<<<<<<<<<<< + * + * # now the cov numerator + */ + __pyx_v_mean = ((__pyx_v_nobs + 1) / 2.); + + /* "pandas/algos.pyx":1142 + * + * # now the cov numerator + * sumx = sumxx = sumyy = 0 # <<<<<<<<<<<<<< + * + * for i in range(nobs): + */ + __pyx_v_sumx = 0; + __pyx_v_sumxx = 0; + __pyx_v_sumyy = 0; + + /* "pandas/algos.pyx":1144 + * sumx = sumxx = sumyy = 0 + * + * for i in range(nobs): # <<<<<<<<<<<<<< + * vx = maskedx[i] - mean + * vy = maskedy[i] - mean + */ + __pyx_t_43 = __pyx_v_nobs; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_43; __pyx_t_31+=1) { + __pyx_v_i = __pyx_t_31; + + /* "pandas/algos.pyx":1145 + * + * for i in range(nobs): + * vx = maskedx[i] - mean # <<<<<<<<<<<<<< + * vy = maskedy[i] - mean + * + */ + __pyx_t_32 = __pyx_v_i; + __pyx_v_vx = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maskedx.diminfo[0].strides)) - __pyx_v_mean); + + /* "pandas/algos.pyx":1146 + * for i in range(nobs): + * vx = maskedx[i] - mean + * vy = maskedy[i] - mean # <<<<<<<<<<<<<< + * + * sumx += vx * vy + */ + __pyx_t_44 = __pyx_v_i; + __pyx_v_vy = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maskedy.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_maskedy.diminfo[0].strides)) - __pyx_v_mean); + + /* "pandas/algos.pyx":1148 + * vy = maskedy[i] - mean + * + * sumx += vx * vy # <<<<<<<<<<<<<< + * sumxx += vx * vx + * sumyy += vy * vy + */ + __pyx_v_sumx = (__pyx_v_sumx + (__pyx_v_vx * __pyx_v_vy)); + + /* "pandas/algos.pyx":1149 + * + * sumx += vx * vy + * sumxx += vx * vx # <<<<<<<<<<<<<< + * sumyy += vy * vy + * + */ + __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx)); + + /* "pandas/algos.pyx":1150 + * sumx += vx * vy + * sumxx += vx * vx + * sumyy += vy * vy # <<<<<<<<<<<<<< + * + * divisor = sqrt(sumxx * sumyy) + */ + __pyx_v_sumyy = (__pyx_v_sumyy + (__pyx_v_vy * __pyx_v_vy)); + } + + /* "pandas/algos.pyx":1152 + * sumyy += vy * vy + * + * divisor = sqrt(sumxx * sumyy) # <<<<<<<<<<<<<< + * + * if divisor != 0: + */ + __pyx_v_divisor = sqrt((__pyx_v_sumxx * __pyx_v_sumyy)); + + /* "pandas/algos.pyx":1154 + * divisor = sqrt(sumxx * sumyy) + * + * if divisor != 0: # <<<<<<<<<<<<<< + * result[xi, yi] = result[yi, xi] = sumx / divisor + * else: + */ + __pyx_t_24 = ((__pyx_v_divisor != 0.0) != 0); + if (__pyx_t_24) { + + /* "pandas/algos.pyx":1155 + * + * if divisor != 0: + * result[xi, yi] = result[yi, xi] = sumx / divisor # <<<<<<<<<<<<<< + * else: + * result[xi, yi] = result[yi, xi] = np.NaN + */ + if (unlikely(__pyx_v_divisor == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = (__pyx_v_sumx / __pyx_v_divisor); + __pyx_t_31 = __pyx_v_xi; + __pyx_t_45 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __pyx_t_46 = __pyx_v_yi; + __pyx_t_47 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/algos.pyx":1157 + * result[xi, yi] = result[yi, xi] = sumx / divisor + * else: + * result[xi, yi] = result[yi, xi] = np.NaN # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_48 = __pyx_v_xi; + __pyx_t_49 = __pyx_v_yi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_26 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_50 = __pyx_v_yi; + __pyx_t_51 = __pyx_v_xi; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_result.diminfo[1].strides) = __pyx_t_26; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L18:; + } + __pyx_L12:; + } + } + + /* "pandas/algos.pyx":1159 + * result[xi, yi] = result[yi, xi] = np.NaN + * + * return result # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/algos.pyx":1103 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.nancorr_spearman", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maskedy.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mat.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_maskedx); + __Pyx_XDECREF((PyObject *)__pyx_v_maskedy); + __Pyx_XDECREF((PyObject *)__pyx_v_mask); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1164 + * # Rolling variance + * + * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1): # <<<<<<<<<<<<<< + * """ + * Numerically stable implementation using Welford's method. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_33roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_32roll_var[] = "\n Numerically stable implementation using Welford's method.\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_33roll_var = {__Pyx_NAMESTR("roll_var"), (PyCFunction)__pyx_pw_6pandas_5algos_33roll_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_32roll_var)}; +static PyObject *__pyx_pw_6pandas_5algos_33roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_v_ddof; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_var (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_ddof,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ddof); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[3]) { + __pyx_v_ddof = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_ddof == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_ddof = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_32roll_var(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_ddof); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_32roll_var(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, int __pyx_v_ddof) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_mean_x; + double __pyx_v_ssqdm_x; + double __pyx_v_nobs; + double __pyx_v_delta; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + double __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_var", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1168 + * Numerically stable implementation using Welford's method. + * """ + * cdef double val, prev, mean_x = 0, ssqdm_x = 0, nobs = 0, delta # <<<<<<<<<<<<<< + * cdef Py_ssize_t i + * cdef Py_ssize_t N = len(input) + */ + __pyx_v_mean_x = 0.0; + __pyx_v_ssqdm_x = 0.0; + __pyx_v_nobs = 0.0; + + /* "pandas/algos.pyx":1170 + * cdef double val, prev, mean_x = 0, ssqdm_x = 0, nobs = 0, delta + * cdef Py_ssize_t i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1172 + * cdef Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1174 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * # Check for windows larger than array, addresses #7297 + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1177 + * + * # Check for windows larger than array, addresses #7297 + * win = min(win, N) # <<<<<<<<<<<<<< + * + * # Over the first window, observations can only be added, never removed + */ + __pyx_t_1 = __pyx_v_N; + __pyx_t_8 = __pyx_v_win; + if (((__pyx_t_1 < __pyx_t_8) != 0)) { + __pyx_t_9 = __pyx_t_1; + } else { + __pyx_t_9 = __pyx_t_8; + } + __pyx_v_win = __pyx_t_9; + + /* "pandas/algos.pyx":1180 + * + * # Over the first window, observations can only be added, never removed + * for i from 0 <= i < win: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_8 = __pyx_v_win; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) { + + /* "pandas/algos.pyx":1181 + * # Over the first window, observations can only be added, never removed + * for i from 0 <= i < win: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1184 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * delta = (val - mean_x) + */ + __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1185 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * delta = (val - mean_x) + * mean_x += delta / nobs + */ + __pyx_v_nobs = (__pyx_v_nobs + 1.0); + + /* "pandas/algos.pyx":1186 + * if val == val: + * nobs += 1 + * delta = (val - mean_x) # <<<<<<<<<<<<<< + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) + */ + __pyx_v_delta = (__pyx_v_val - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1187 + * nobs += 1 + * delta = (val - mean_x) + * mean_x += delta / nobs # <<<<<<<<<<<<<< + * ssqdm_x += delta * (val - mean_x) + * + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs)); + + /* "pandas/algos.pyx":1188 + * delta = (val - mean_x) + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + (__pyx_v_delta * (__pyx_v_val - __pyx_v_mean_x))); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1190 + * ssqdm_x += delta * (val - mean_x) + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * #pathological case + * if nobs == 1: + */ + __pyx_t_11 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1192 + * if nobs >= minp: + * #pathological case + * if nobs == 1: # <<<<<<<<<<<<<< + * val = 0 + * else: + */ + __pyx_t_11 = ((__pyx_v_nobs == 1.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1193 + * #pathological case + * if nobs == 1: + * val = 0 # <<<<<<<<<<<<<< + * else: + * val = ssqdm_x / (nobs - ddof) + */ + __pyx_v_val = 0.0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/algos.pyx":1195 + * val = 0 + * else: + * val = ssqdm_x / (nobs - ddof) # <<<<<<<<<<<<<< + * if val < 0: + * val = 0 + */ + __pyx_t_12 = (__pyx_v_nobs - __pyx_v_ddof); + if (unlikely(__pyx_t_12 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (__pyx_v_ssqdm_x / __pyx_t_12); + + /* "pandas/algos.pyx":1196 + * else: + * val = ssqdm_x / (nobs - ddof) + * if val < 0: # <<<<<<<<<<<<<< + * val = 0 + * else: + */ + __pyx_t_11 = ((__pyx_v_val < 0.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1197 + * val = ssqdm_x / (nobs - ddof) + * if val < 0: + * val = 0 # <<<<<<<<<<<<<< + * else: + * val = NaN + */ + __pyx_v_val = 0.0; + goto __pyx_L8; + } + __pyx_L8:; + } + __pyx_L7:; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/algos.pyx":1199 + * val = 0 + * else: + * val = NaN # <<<<<<<<<<<<<< + * + * output[i] = val + */ + __pyx_v_val = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L6:; + + /* "pandas/algos.pyx":1201 + * val = NaN + * + * output[i] = val # <<<<<<<<<<<<<< + * + * # After the first window, observations can both be added and removed + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_val; + } + + /* "pandas/algos.pyx":1204 + * + * # After the first window, observations can both be added and removed + * for i from win <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * prev = input[i - win] + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_v_i = __pyx_v_win; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { + + /* "pandas/algos.pyx":1205 + * # After the first window, observations can both be added and removed + * for i from win <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * prev = input[i - win] + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1206 + * for i from win <= i < N: + * val = input[i] + * prev = input[i - win] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_15 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1208 + * prev = input[i - win] + * + * if val == val: # <<<<<<<<<<<<<< + * if prev == prev: + * # Adding one observation and removing another one + */ + __pyx_t_11 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1209 + * + * if val == val: + * if prev == prev: # <<<<<<<<<<<<<< + * # Adding one observation and removing another one + * delta = val - prev + */ + __pyx_t_11 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1211 + * if prev == prev: + * # Adding one observation and removing another one + * delta = val - prev # <<<<<<<<<<<<<< + * prev -= mean_x + * mean_x += delta / nobs + */ + __pyx_v_delta = (__pyx_v_val - __pyx_v_prev); + + /* "pandas/algos.pyx":1212 + * # Adding one observation and removing another one + * delta = val - prev + * prev -= mean_x # <<<<<<<<<<<<<< + * mean_x += delta / nobs + * val -= mean_x + */ + __pyx_v_prev = (__pyx_v_prev - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1213 + * delta = val - prev + * prev -= mean_x + * mean_x += delta / nobs # <<<<<<<<<<<<<< + * val -= mean_x + * ssqdm_x += (val + prev) * delta + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs)); + + /* "pandas/algos.pyx":1214 + * prev -= mean_x + * mean_x += delta / nobs + * val -= mean_x # <<<<<<<<<<<<<< + * ssqdm_x += (val + prev) * delta + * else: + */ + __pyx_v_val = (__pyx_v_val - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1215 + * mean_x += delta / nobs + * val -= mean_x + * ssqdm_x += (val + prev) * delta # <<<<<<<<<<<<<< + * else: + * # Adding one observation and not removing any + */ + __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + ((__pyx_v_val + __pyx_v_prev) * __pyx_v_delta)); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1218 + * else: + * # Adding one observation and not removing any + * nobs += 1 # <<<<<<<<<<<<<< + * delta = (val - mean_x) + * mean_x += delta / nobs + */ + __pyx_v_nobs = (__pyx_v_nobs + 1.0); + + /* "pandas/algos.pyx":1219 + * # Adding one observation and not removing any + * nobs += 1 + * delta = (val - mean_x) # <<<<<<<<<<<<<< + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) + */ + __pyx_v_delta = (__pyx_v_val - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1220 + * nobs += 1 + * delta = (val - mean_x) + * mean_x += delta / nobs # <<<<<<<<<<<<<< + * ssqdm_x += delta * (val - mean_x) + * elif prev == prev: + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs)); + + /* "pandas/algos.pyx":1221 + * delta = (val - mean_x) + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) # <<<<<<<<<<<<<< + * elif prev == prev: + * # Adding no new observation, but removing one + */ + __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + (__pyx_v_delta * (__pyx_v_val - __pyx_v_mean_x))); + } + __pyx_L12:; + goto __pyx_L11; + } + + /* "pandas/algos.pyx":1222 + * mean_x += delta / nobs + * ssqdm_x += delta * (val - mean_x) + * elif prev == prev: # <<<<<<<<<<<<<< + * # Adding no new observation, but removing one + * nobs -= 1 + */ + __pyx_t_11 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1224 + * elif prev == prev: + * # Adding no new observation, but removing one + * nobs -= 1 # <<<<<<<<<<<<<< + * if nobs: + * delta = (prev - mean_x) + */ + __pyx_v_nobs = (__pyx_v_nobs - 1.0); + + /* "pandas/algos.pyx":1225 + * # Adding no new observation, but removing one + * nobs -= 1 + * if nobs: # <<<<<<<<<<<<<< + * delta = (prev - mean_x) + * mean_x -= delta / nobs + */ + __pyx_t_11 = (__pyx_v_nobs != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1226 + * nobs -= 1 + * if nobs: + * delta = (prev - mean_x) # <<<<<<<<<<<<<< + * mean_x -= delta / nobs + * ssqdm_x -= delta * (prev - mean_x) + */ + __pyx_v_delta = (__pyx_v_prev - __pyx_v_mean_x); + + /* "pandas/algos.pyx":1227 + * if nobs: + * delta = (prev - mean_x) + * mean_x -= delta / nobs # <<<<<<<<<<<<<< + * ssqdm_x -= delta * (prev - mean_x) + * else: + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mean_x = (__pyx_v_mean_x - (__pyx_v_delta / __pyx_v_nobs)); + + /* "pandas/algos.pyx":1228 + * delta = (prev - mean_x) + * mean_x -= delta / nobs + * ssqdm_x -= delta * (prev - mean_x) # <<<<<<<<<<<<<< + * else: + * mean_x = 0 + */ + __pyx_v_ssqdm_x = (__pyx_v_ssqdm_x - (__pyx_v_delta * (__pyx_v_prev - __pyx_v_mean_x))); + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1230 + * ssqdm_x -= delta * (prev - mean_x) + * else: + * mean_x = 0 # <<<<<<<<<<<<<< + * ssqdm_x = 0 + * # Variance is unchanged if no observation is added or removed + */ + __pyx_v_mean_x = 0.0; + + /* "pandas/algos.pyx":1231 + * else: + * mean_x = 0 + * ssqdm_x = 0 # <<<<<<<<<<<<<< + * # Variance is unchanged if no observation is added or removed + * + */ + __pyx_v_ssqdm_x = 0.0; + } + __pyx_L13:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":1234 + * # Variance is unchanged if no observation is added or removed + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * #pathological case + * if nobs == 1: + */ + __pyx_t_11 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1236 + * if nobs >= minp: + * #pathological case + * if nobs == 1: # <<<<<<<<<<<<<< + * val = 0 + * else: + */ + __pyx_t_11 = ((__pyx_v_nobs == 1.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1237 + * #pathological case + * if nobs == 1: + * val = 0 # <<<<<<<<<<<<<< + * else: + * val = ssqdm_x / (nobs - ddof) + */ + __pyx_v_val = 0.0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/algos.pyx":1239 + * val = 0 + * else: + * val = ssqdm_x / (nobs - ddof) # <<<<<<<<<<<<<< + * if val < 0: + * val = 0 + */ + __pyx_t_12 = (__pyx_v_nobs - __pyx_v_ddof); + if (unlikely(__pyx_t_12 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (__pyx_v_ssqdm_x / __pyx_t_12); + + /* "pandas/algos.pyx":1240 + * else: + * val = ssqdm_x / (nobs - ddof) + * if val < 0: # <<<<<<<<<<<<<< + * val = 0 + * else: + */ + __pyx_t_11 = ((__pyx_v_val < 0.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1241 + * val = ssqdm_x / (nobs - ddof) + * if val < 0: + * val = 0 # <<<<<<<<<<<<<< + * else: + * val = NaN + */ + __pyx_v_val = 0.0; + goto __pyx_L16; + } + __pyx_L16:; + } + __pyx_L15:; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/algos.pyx":1243 + * val = 0 + * else: + * val = NaN # <<<<<<<<<<<<<< + * + * output[i] = val + */ + __pyx_v_val = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L14:; + + /* "pandas/algos.pyx":1245 + * val = NaN + * + * output[i] = val # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_val; + } + + /* "pandas/algos.pyx":1247 + * output[i] = val + * + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1164 + * # Rolling variance + * + * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1): # <<<<<<<<<<<<<< + * """ + * Numerically stable implementation using Welford's method. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1253 + * # Rolling skewness + * + * def roll_skew(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_35roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_35roll_skew = {__Pyx_NAMESTR("roll_skew"), (PyCFunction)__pyx_pw_6pandas_5algos_35roll_skew, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_35roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_skew (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_skew") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_34roll_skew(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_34roll_skew(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_x; + double __pyx_v_xx; + double __pyx_v_xxx; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + double __pyx_v_A; + double __pyx_v_B; + double __pyx_v_C; + double __pyx_v_R; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + double __pyx_t_18; + double __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_skew", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1255 + * def roll_skew(ndarray[double_t] input, int win, int minp): + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) + */ + __pyx_v_x = 0.0; + __pyx_v_xx = 0.0; + __pyx_v_xxx = 0.0; + + /* "pandas/algos.pyx":1256 + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + * cdef Py_ssize_t nobs = 0, i # <<<<<<<<<<<<<< + * cdef Py_ssize_t N = len(input) + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1257 + * cdef double x = 0, xx = 0, xxx = 0 + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1259 + * cdef Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * # 3 components of the skewness equation + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1264 + * cdef double A, B, C, R + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1266 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1267 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1270 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1271 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * x += val + * xx += val * val + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1272 + * if val == val: + * nobs += 1 + * x += val # <<<<<<<<<<<<<< + * xx += val * val + * xxx += val * val * val + */ + __pyx_v_x = (__pyx_v_x + __pyx_v_val); + + /* "pandas/algos.pyx":1273 + * nobs += 1 + * x += val + * xx += val * val # <<<<<<<<<<<<<< + * xxx += val * val * val + * + */ + __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val)); + + /* "pandas/algos.pyx":1274 + * x += val + * xx += val * val + * xxx += val * val * val # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1276 + * xxx += val * val * val + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1278 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1279 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1281 + * val = input[i] + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1282 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * x += val + * xx += val * val + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1283 + * if val == val: + * nobs += 1 + * x += val # <<<<<<<<<<<<<< + * xx += val * val + * xxx += val * val * val + */ + __pyx_v_x = (__pyx_v_x + __pyx_v_val); + + /* "pandas/algos.pyx":1284 + * nobs += 1 + * x += val + * xx += val * val # <<<<<<<<<<<<<< + * xxx += val * val * val + * + */ + __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val)); + + /* "pandas/algos.pyx":1285 + * x += val + * xx += val * val + * xxx += val * val * val # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1287 + * xxx += val * val * val + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * if prev == prev: + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1288 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * if prev == prev: + * x -= prev + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1289 + * if i > win - 1: + * prev = input[i - win] + * if prev == prev: # <<<<<<<<<<<<<< + * x -= prev + * xx -= prev * prev + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1290 + * prev = input[i - win] + * if prev == prev: + * x -= prev # <<<<<<<<<<<<<< + * xx -= prev * prev + * xxx -= prev * prev * prev + */ + __pyx_v_x = (__pyx_v_x - __pyx_v_prev); + + /* "pandas/algos.pyx":1291 + * if prev == prev: + * x -= prev + * xx -= prev * prev # <<<<<<<<<<<<<< + * xxx -= prev * prev * prev + * + */ + __pyx_v_xx = (__pyx_v_xx - (__pyx_v_prev * __pyx_v_prev)); + + /* "pandas/algos.pyx":1292 + * x -= prev + * xx -= prev * prev + * xxx -= prev * prev * prev # <<<<<<<<<<<<<< + * + * nobs -= 1 + */ + __pyx_v_xxx = (__pyx_v_xxx - ((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev)); + + /* "pandas/algos.pyx":1294 + * xxx -= prev * prev * prev + * + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1296 + * nobs -= 1 + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * A = x / nobs + * B = xx / nobs - A * A + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1297 + * + * if nobs >= minp: + * A = x / nobs # <<<<<<<<<<<<<< + * B = xx / nobs - A * A + * C = xxx / nobs - A * A * A - 3 * A * B + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_A = (__pyx_v_x / __pyx_v_nobs); + + /* "pandas/algos.pyx":1298 + * if nobs >= minp: + * A = x / nobs + * B = xx / nobs - A * A # <<<<<<<<<<<<<< + * C = xxx / nobs - A * A * A - 3 * A * B + * + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - (__pyx_v_A * __pyx_v_A)); + + /* "pandas/algos.pyx":1299 + * A = x / nobs + * B = xx / nobs - A * A + * C = xxx / nobs - A * A * A - 3 * A * B # <<<<<<<<<<<<<< + * + * R = sqrt(B) + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_C = (((__pyx_v_xxx / __pyx_v_nobs) - ((__pyx_v_A * __pyx_v_A) * __pyx_v_A)) - ((3.0 * __pyx_v_A) * __pyx_v_B)); + + /* "pandas/algos.pyx":1301 + * C = xxx / nobs - A * A * A - 3 * A * B + * + * R = sqrt(B) # <<<<<<<<<<<<<< + * + * if B == 0 or nobs < 3: + */ + __pyx_v_R = sqrt(__pyx_v_B); + + /* "pandas/algos.pyx":1303 + * R = sqrt(B) + * + * if B == 0 or nobs < 3: # <<<<<<<<<<<<<< + * output[i] = NaN + * else: + */ + __pyx_t_10 = ((__pyx_v_B == 0.0) != 0); + if (!__pyx_t_10) { + __pyx_t_15 = ((__pyx_v_nobs < 3) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_10; + } + if (__pyx_t_16) { + + /* "pandas/algos.pyx":1304 + * + * if B == 0 or nobs < 3: + * output[i] = NaN # <<<<<<<<<<<<<< + * else: + * output[i] = ((sqrt(nobs * (nobs - 1.)) * C) / + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1306 + * output[i] = NaN + * else: + * output[i] = ((sqrt(nobs * (nobs - 1.)) * C) / # <<<<<<<<<<<<<< + * ((nobs-2) * R * R * R)) + * else: + */ + __pyx_t_18 = (sqrt((__pyx_v_nobs * (__pyx_v_nobs - 1.))) * __pyx_v_C); + + /* "pandas/algos.pyx":1307 + * else: + * output[i] = ((sqrt(nobs * (nobs - 1.)) * C) / + * ((nobs-2) * R * R * R)) # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_19 = ((((__pyx_v_nobs - 2) * __pyx_v_R) * __pyx_v_R) * __pyx_v_R); + + /* "pandas/algos.pyx":1306 + * output[i] = NaN + * else: + * output[i] = ((sqrt(nobs * (nobs - 1.)) * C) / # <<<<<<<<<<<<<< + * ((nobs-2) * R * R * R)) + * else: + */ + if (unlikely(__pyx_t_19 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = (__pyx_t_18 / __pyx_t_19); + } + __pyx_L12:; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":1309 + * ((nobs-2) * R * R * R)) + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":1311 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1253 + * # Rolling skewness + * + * def roll_skew(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1317 + * + * + * def roll_kurt(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef double val, prev + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_37roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_37roll_kurt = {__Pyx_NAMESTR("roll_kurt"), (PyCFunction)__pyx_pw_6pandas_5algos_37roll_kurt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_37roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_kurt (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_kurt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_36roll_kurt(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_36roll_kurt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_prev; + double __pyx_v_x; + double __pyx_v_xx; + double __pyx_v_xxx; + double __pyx_v_xxxx; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + double __pyx_v_A; + double __pyx_v_B; + double __pyx_v_C; + double __pyx_v_D; + double __pyx_v_R; + double __pyx_v_K; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + double __pyx_t_18; + double __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_kurt", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1320 + * int win, int minp): + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0, xxxx = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) + */ + __pyx_v_x = 0.0; + __pyx_v_xx = 0.0; + __pyx_v_xxx = 0.0; + __pyx_v_xxxx = 0.0; + + /* "pandas/algos.pyx":1321 + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0, xxxx = 0 + * cdef Py_ssize_t nobs = 0, i # <<<<<<<<<<<<<< + * cdef Py_ssize_t N = len(input) + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1322 + * cdef double x = 0, xx = 0, xxx = 0, xxxx = 0 + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1324 + * cdef Py_ssize_t N = len(input) + * + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * # 5 components of the kurtosis equation + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1329 + * cdef double A, B, C, D, R, K + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1331 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1332 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1335 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1336 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * + * # seriously don't ask me why this is faster + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1339 + * + * # seriously don't ask me why this is faster + * x += val # <<<<<<<<<<<<<< + * xx += val * val + * xxx += val * val * val + */ + __pyx_v_x = (__pyx_v_x + __pyx_v_val); + + /* "pandas/algos.pyx":1340 + * # seriously don't ask me why this is faster + * x += val + * xx += val * val # <<<<<<<<<<<<<< + * xxx += val * val * val + * xxxx += val * val * val * val + */ + __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val)); + + /* "pandas/algos.pyx":1341 + * x += val + * xx += val * val + * xxx += val * val * val # <<<<<<<<<<<<<< + * xxxx += val * val * val * val + * + */ + __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); + + /* "pandas/algos.pyx":1342 + * xx += val * val + * xxx += val * val * val + * xxxx += val * val * val * val # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_v_xxxx = (__pyx_v_xxxx + (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val)); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1344 + * xxxx += val * val * val * val + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1346 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1347 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1349 + * val = input[i] + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * x += val + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1350 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * x += val + * xx += val * val + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1351 + * if val == val: + * nobs += 1 + * x += val # <<<<<<<<<<<<<< + * xx += val * val + * xxx += val * val * val + */ + __pyx_v_x = (__pyx_v_x + __pyx_v_val); + + /* "pandas/algos.pyx":1352 + * nobs += 1 + * x += val + * xx += val * val # <<<<<<<<<<<<<< + * xxx += val * val * val + * xxxx += val * val * val * val + */ + __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val)); + + /* "pandas/algos.pyx":1353 + * x += val + * xx += val * val + * xxx += val * val * val # <<<<<<<<<<<<<< + * xxxx += val * val * val * val + * + */ + __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); + + /* "pandas/algos.pyx":1354 + * xx += val * val + * xxx += val * val * val + * xxxx += val * val * val * val # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_v_xxxx = (__pyx_v_xxxx + (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val)); + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1356 + * xxxx += val * val * val * val + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * if prev == prev: + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1357 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * if prev == prev: + * x -= prev + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1358 + * if i > win - 1: + * prev = input[i - win] + * if prev == prev: # <<<<<<<<<<<<<< + * x -= prev + * xx -= prev * prev + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1359 + * prev = input[i - win] + * if prev == prev: + * x -= prev # <<<<<<<<<<<<<< + * xx -= prev * prev + * xxx -= prev * prev * prev + */ + __pyx_v_x = (__pyx_v_x - __pyx_v_prev); + + /* "pandas/algos.pyx":1360 + * if prev == prev: + * x -= prev + * xx -= prev * prev # <<<<<<<<<<<<<< + * xxx -= prev * prev * prev + * xxxx -= prev * prev * prev * prev + */ + __pyx_v_xx = (__pyx_v_xx - (__pyx_v_prev * __pyx_v_prev)); + + /* "pandas/algos.pyx":1361 + * x -= prev + * xx -= prev * prev + * xxx -= prev * prev * prev # <<<<<<<<<<<<<< + * xxxx -= prev * prev * prev * prev + * + */ + __pyx_v_xxx = (__pyx_v_xxx - ((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev)); + + /* "pandas/algos.pyx":1362 + * xx -= prev * prev + * xxx -= prev * prev * prev + * xxxx -= prev * prev * prev * prev # <<<<<<<<<<<<<< + * + * nobs -= 1 + */ + __pyx_v_xxxx = (__pyx_v_xxxx - (((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev) * __pyx_v_prev)); + + /* "pandas/algos.pyx":1364 + * xxxx -= prev * prev * prev * prev + * + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1366 + * nobs -= 1 + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * A = x / nobs + * R = A * A + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1367 + * + * if nobs >= minp: + * A = x / nobs # <<<<<<<<<<<<<< + * R = A * A + * B = xx / nobs - R + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_A = (__pyx_v_x / __pyx_v_nobs); + + /* "pandas/algos.pyx":1368 + * if nobs >= minp: + * A = x / nobs + * R = A * A # <<<<<<<<<<<<<< + * B = xx / nobs - R + * R = R * A + */ + __pyx_v_R = (__pyx_v_A * __pyx_v_A); + + /* "pandas/algos.pyx":1369 + * A = x / nobs + * R = A * A + * B = xx / nobs - R # <<<<<<<<<<<<<< + * R = R * A + * C = xxx / nobs - R - 3 * A * B + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - __pyx_v_R); + + /* "pandas/algos.pyx":1370 + * R = A * A + * B = xx / nobs - R + * R = R * A # <<<<<<<<<<<<<< + * C = xxx / nobs - R - 3 * A * B + * R = R * A + */ + __pyx_v_R = (__pyx_v_R * __pyx_v_A); + + /* "pandas/algos.pyx":1371 + * B = xx / nobs - R + * R = R * A + * C = xxx / nobs - R - 3 * A * B # <<<<<<<<<<<<<< + * R = R * A + * D = xxxx / nobs - R - 6*B*A*A - 4*C*A + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_C = (((__pyx_v_xxx / __pyx_v_nobs) - __pyx_v_R) - ((3.0 * __pyx_v_A) * __pyx_v_B)); + + /* "pandas/algos.pyx":1372 + * R = R * A + * C = xxx / nobs - R - 3 * A * B + * R = R * A # <<<<<<<<<<<<<< + * D = xxxx / nobs - R - 6*B*A*A - 4*C*A + * + */ + __pyx_v_R = (__pyx_v_R * __pyx_v_A); + + /* "pandas/algos.pyx":1373 + * C = xxx / nobs - R - 3 * A * B + * R = R * A + * D = xxxx / nobs - R - 6*B*A*A - 4*C*A # <<<<<<<<<<<<<< + * + * if B == 0 or nobs < 4: + */ + if (unlikely(__pyx_v_nobs == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_D = ((((__pyx_v_xxxx / __pyx_v_nobs) - __pyx_v_R) - (((6.0 * __pyx_v_B) * __pyx_v_A) * __pyx_v_A)) - ((4.0 * __pyx_v_C) * __pyx_v_A)); + + /* "pandas/algos.pyx":1375 + * D = xxxx / nobs - R - 6*B*A*A - 4*C*A + * + * if B == 0 or nobs < 4: # <<<<<<<<<<<<<< + * output[i] = NaN + * + */ + __pyx_t_10 = ((__pyx_v_B == 0.0) != 0); + if (!__pyx_t_10) { + __pyx_t_15 = ((__pyx_v_nobs < 4) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_10; + } + if (__pyx_t_16) { + + /* "pandas/algos.pyx":1376 + * + * if B == 0 or nobs < 4: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1379 + * + * else: + * K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2) # <<<<<<<<<<<<<< + * K = K / ((nobs - 2.)*(nobs-3.)) + * + */ + __pyx_t_18 = (((__pyx_v_nobs * __pyx_v_nobs) - 1.) * __pyx_v_D); + __pyx_t_19 = (__pyx_v_B * __pyx_v_B); + if (unlikely(__pyx_t_19 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_K = ((__pyx_t_18 / __pyx_t_19) - (3.0 * pow((__pyx_v_nobs - 1.), 2.0))); + + /* "pandas/algos.pyx":1380 + * else: + * K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2) + * K = K / ((nobs - 2.)*(nobs-3.)) # <<<<<<<<<<<<<< + * + * output[i] = K + */ + __pyx_t_19 = ((__pyx_v_nobs - 2.) * (__pyx_v_nobs - 3.)); + if (unlikely(__pyx_t_19 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_K = (__pyx_v_K / __pyx_t_19); + + /* "pandas/algos.pyx":1382 + * K = K / ((nobs - 2.)*(nobs-3.)) + * + * output[i] = K # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_K; + } + __pyx_L12:; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":1385 + * + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":1387 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1317 + * + * + * def roll_kurt(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef double val, prev + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1394 + * ctypedef double_t (* skiplist_f)(object sl, int n, int p) + * + * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op): # <<<<<<<<<<<<<< + * cdef ndarray[double_t] input = arg + * cdef double val, prev, midpoint + */ + +static PyObject *__pyx_f_6pandas_5algos__roll_skiplist_op(PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp, __pyx_t_6pandas_5algos_skiplist_f __pyx_v_op) { + PyArrayObject *__pyx_v_input = 0; + double __pyx_v_val; + double __pyx_v_prev; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_skiplist = 0; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_roll_skiplist_op", 0); + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + + /* "pandas/algos.pyx":1395 + * + * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op): + * cdef ndarray[double_t] input = arg # <<<<<<<<<<<<<< + * cdef double val, prev, midpoint + * cdef IndexableSkiplist skiplist + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_arg), &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_input = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + } + } + __Pyx_INCREF(((PyObject *)__pyx_v_arg)); + __pyx_v_input = ((PyArrayObject *)__pyx_v_arg); + + /* "pandas/algos.pyx":1398 + * cdef double val, prev, midpoint + * cdef IndexableSkiplist skiplist + * cdef Py_ssize_t nobs = 0, i # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t N = len(input) + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1400 + * cdef Py_ssize_t nobs = 0, i + * + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1401 + * + * cdef Py_ssize_t N = len(input) + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * skiplist = IndexableSkiplist(win) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1403 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * skiplist = IndexableSkiplist(win) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_IndexableSkiplist)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1405 + * skiplist = IndexableSkiplist(win) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1407 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1408 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1411 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist.insert(val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1412 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist.insert(val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1413 + * if val == val: + * nobs += 1 + * skiplist.insert(val) # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1415 + * skiplist.insert(val) + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1417 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1418 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1420 + * val = input[i] + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1421 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * + * if prev == prev: + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1423 + * prev = input[i - win] + * + * if prev == prev: # <<<<<<<<<<<<<< + * skiplist.remove(prev) + * nobs -= 1 + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1424 + * + * if prev == prev: + * skiplist.remove(prev) # <<<<<<<<<<<<<< + * nobs -= 1 + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1425 + * if prev == prev: + * skiplist.remove(prev) + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1427 + * nobs -= 1 + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist.insert(val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1428 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist.insert(val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1429 + * if val == val: + * nobs += 1 + * skiplist.insert(val) # <<<<<<<<<<<<<< + * + * output[i] = op(skiplist, nobs, minp) + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/algos.pyx":1431 + * skiplist.insert(val) + * + * output[i] = op(skiplist, nobs, minp) # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_op(((PyObject *)__pyx_v_skiplist), __pyx_v_nobs, __pyx_v_minp); + } + + /* "pandas/algos.pyx":1433 + * output[i] = op(skiplist, nobs, minp) + * + * return output # <<<<<<<<<<<<<< + * + * from skiplist cimport * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1394 + * ctypedef double_t (* skiplist_f)(object sl, int n, int p) + * + * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op): # <<<<<<<<<<<<<< + * cdef ndarray[double_t] input = arg + * cdef double val, prev, midpoint + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos._roll_skiplist_op", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_input); + __Pyx_XDECREF((PyObject *)__pyx_v_skiplist); + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1437 + * from skiplist cimport * + * + * def roll_median_c(ndarray[float64_t] arg, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, res, prev + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_39roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_39roll_median_c = {__Pyx_NAMESTR("roll_median_c"), (PyCFunction)__pyx_pw_6pandas_5algos_39roll_median_c, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_39roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arg = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_median_c (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arg,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_median_c") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_arg = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_5numpy_ndarray, 1, "arg", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_38roll_median_c(__pyx_self, __pyx_v_arg, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_38roll_median_c(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp) { + double __pyx_v_val; + double __pyx_v_res; + double __pyx_v_prev; + int __pyx_v_ret; + skiplist_t *__pyx_v_sl; + Py_ssize_t __pyx_v_midpoint; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arg; + __Pyx_Buffer __pyx_pybuffer_arg; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_median_c", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_arg.pybuffer.buf = NULL; + __pyx_pybuffer_arg.refcount = 0; + __pyx_pybuffernd_arg.data = NULL; + __pyx_pybuffernd_arg.rcbuffer = &__pyx_pybuffer_arg; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arg.rcbuffer->pybuffer, (PyObject*)__pyx_v_arg, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arg.diminfo[0].strides = __pyx_pybuffernd_arg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arg.diminfo[0].shape = __pyx_pybuffernd_arg.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1440 + * cdef double val, res, prev + * cdef: + * int ret=0 # <<<<<<<<<<<<<< + * skiplist_t *sl + * Py_ssize_t midpoint, nobs = 0, i + */ + __pyx_v_ret = 0; + + /* "pandas/algos.pyx":1442 + * int ret=0 + * skiplist_t *sl + * Py_ssize_t midpoint, nobs = 0, i # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1445 + * + * + * cdef Py_ssize_t N = len(arg) # <<<<<<<<<<<<<< + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arg)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1446 + * + * cdef Py_ssize_t N = len(arg) + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * sl = skiplist_init(win) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1448 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * sl = skiplist_init(win) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_v_sl = skiplist_init(__pyx_v_win); + + /* "pandas/algos.pyx":1450 + * sl = skiplist_init(win) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1452 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = arg[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1453 + * + * for i from 0 <= i < minp - 1: + * val = arg[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_arg.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_arg.diminfo[0].strides)); + + /* "pandas/algos.pyx":1456 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist_insert(sl, val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1457 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist_insert(sl, val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1458 + * if val == val: + * nobs += 1 + * skiplist_insert(sl, val) # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + skiplist_insert(__pyx_v_sl, __pyx_v_val); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1460 + * skiplist_insert(sl, val) + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1462 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = arg[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1463 + * + * for i from minp - 1 <= i < N: + * val = arg[i] # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_arg.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arg.diminfo[0].strides)); + + /* "pandas/algos.pyx":1465 + * val = arg[i] + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = arg[i - win] + * + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1466 + * + * if i > win - 1: + * prev = arg[i - win] # <<<<<<<<<<<<<< + * + * if prev == prev: + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arg.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arg.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arg.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arg.diminfo[0].strides)); + + /* "pandas/algos.pyx":1468 + * prev = arg[i - win] + * + * if prev == prev: # <<<<<<<<<<<<<< + * skiplist_remove(sl, prev) + * nobs -= 1 + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1469 + * + * if prev == prev: + * skiplist_remove(sl, prev) # <<<<<<<<<<<<<< + * nobs -= 1 + * + */ + skiplist_remove(__pyx_v_sl, __pyx_v_prev); + + /* "pandas/algos.pyx":1470 + * if prev == prev: + * skiplist_remove(sl, prev) + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1472 + * nobs -= 1 + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist_insert(sl, val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1473 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist_insert(sl, val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1474 + * if val == val: + * nobs += 1 + * skiplist_insert(sl, val) # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + skiplist_insert(__pyx_v_sl, __pyx_v_val); + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/algos.pyx":1476 + * skiplist_insert(sl, val) + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * midpoint = nobs / 2 + * if nobs % 2: + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1477 + * + * if nobs >= minp: + * midpoint = nobs / 2 # <<<<<<<<<<<<<< + * if nobs % 2: + * res = skiplist_get(sl, midpoint, &ret) + */ + __pyx_v_midpoint = __Pyx_div_Py_ssize_t(__pyx_v_nobs, 2); + + /* "pandas/algos.pyx":1478 + * if nobs >= minp: + * midpoint = nobs / 2 + * if nobs % 2: # <<<<<<<<<<<<<< + * res = skiplist_get(sl, midpoint, &ret) + * else: + */ + __pyx_t_10 = (__Pyx_mod_Py_ssize_t(__pyx_v_nobs, 2) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1479 + * midpoint = nobs / 2 + * if nobs % 2: + * res = skiplist_get(sl, midpoint, &ret) # <<<<<<<<<<<<<< + * else: + * res = (skiplist_get(sl, midpoint, &ret) + + */ + __pyx_v_res = skiplist_get(__pyx_v_sl, __pyx_v_midpoint, (&__pyx_v_ret)); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/algos.pyx":1482 + * else: + * res = (skiplist_get(sl, midpoint, &ret) + + * skiplist_get(sl, (midpoint - 1), &ret)) / 2 # <<<<<<<<<<<<<< + * else: + * res = NaN + */ + __pyx_v_res = ((skiplist_get(__pyx_v_sl, __pyx_v_midpoint, (&__pyx_v_ret)) + skiplist_get(__pyx_v_sl, (__pyx_v_midpoint - 1), (&__pyx_v_ret))) / 2.0); + } + __pyx_L12:; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":1484 + * skiplist_get(sl, (midpoint - 1), &ret)) / 2 + * else: + * res = NaN # <<<<<<<<<<<<<< + * + * output[i] = res + */ + __pyx_v_res = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + + /* "pandas/algos.pyx":1486 + * res = NaN + * + * output[i] = res # <<<<<<<<<<<<<< + * + * skiplist_destroy(sl) + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_res; + } + + /* "pandas/algos.pyx":1488 + * output[i] = res + * + * skiplist_destroy(sl) # <<<<<<<<<<<<<< + * + * return output + */ + skiplist_destroy(__pyx_v_sl); + + /* "pandas/algos.pyx":1490 + * skiplist_destroy(sl) + * + * return output # <<<<<<<<<<<<<< + * + * def roll_median_cython(ndarray input, int win, int minp): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1437 + * from skiplist cimport * + * + * def roll_median_c(ndarray[float64_t] arg, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, res, prev + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arg.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arg.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1492 + * return output + * + * def roll_median_cython(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_41roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_40roll_median_cython[] = "\n O(N log(window)) implementation using skip list\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_41roll_median_cython = {__Pyx_NAMESTR("roll_median_cython"), (PyCFunction)__pyx_pw_6pandas_5algos_41roll_median_cython, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_40roll_median_cython)}; +static PyObject *__pyx_pw_6pandas_5algos_41roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_median_cython (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_median_cython") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_median_cython", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_40roll_median_cython(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_40roll_median_cython(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_median_cython", 0); + + /* "pandas/algos.pyx":1496 + * O(N log(window)) implementation using skip list + * ''' + * return _roll_skiplist_op(input, win, minp, _get_median) # <<<<<<<<<<<<<< + * + * # Unfortunately had to resort to some hackery here, would like for + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_median); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1492 + * return output + * + * def roll_median_cython(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.roll_median_cython", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1501 + * # Cython to be able to get this right. + * + * cdef double_t _get_median(object sl, int nobs, int minp): # <<<<<<<<<<<<<< + * cdef Py_ssize_t midpoint + * cdef IndexableSkiplist skiplist = sl + */ + +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_median(PyObject *__pyx_v_sl, int __pyx_v_nobs, int __pyx_v_minp) { + Py_ssize_t __pyx_v_midpoint; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_skiplist = 0; + __pyx_t_5numpy_double_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __pyx_t_5numpy_double_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_median", 0); + + /* "pandas/algos.pyx":1503 + * cdef double_t _get_median(object sl, int nobs, int minp): + * cdef Py_ssize_t midpoint + * cdef IndexableSkiplist skiplist = sl # <<<<<<<<<<<<<< + * if nobs >= minp: + * midpoint = nobs / 2 + */ + __pyx_t_1 = __pyx_v_sl; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/algos.pyx":1504 + * cdef Py_ssize_t midpoint + * cdef IndexableSkiplist skiplist = sl + * if nobs >= minp: # <<<<<<<<<<<<<< + * midpoint = nobs / 2 + * if nobs % 2: + */ + __pyx_t_2 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":1505 + * cdef IndexableSkiplist skiplist = sl + * if nobs >= minp: + * midpoint = nobs / 2 # <<<<<<<<<<<<<< + * if nobs % 2: + * return skiplist.get(midpoint) + */ + __pyx_v_midpoint = __Pyx_div_long(__pyx_v_nobs, 2); + + /* "pandas/algos.pyx":1506 + * if nobs >= minp: + * midpoint = nobs / 2 + * if nobs % 2: # <<<<<<<<<<<<<< + * return skiplist.get(midpoint) + * else: + */ + __pyx_t_2 = (__Pyx_mod_long(__pyx_v_nobs, 2) != 0); + if (__pyx_t_2) { + + /* "pandas/algos.pyx":1507 + * midpoint = nobs / 2 + * if nobs % 2: + * return skiplist.get(midpoint) # <<<<<<<<<<<<<< + * else: + * return (skiplist.get(midpoint) + + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_v_midpoint, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":1509 + * return skiplist.get(midpoint) + * else: + * return (skiplist.get(midpoint) + # <<<<<<<<<<<<<< + * skiplist.get(midpoint - 1)) / 2 + * else: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_v_midpoint, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/algos.pyx":1510 + * else: + * return (skiplist.get(midpoint) + + * skiplist.get(midpoint - 1)) / 2 # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, (__pyx_v_midpoint - 1), 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/algos.pyx":1509 + * return skiplist.get(midpoint) + * else: + * return (skiplist.get(midpoint) + # <<<<<<<<<<<<<< + * skiplist.get(midpoint - 1)) / 2 + * else: + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/algos.pyx":1510 + * else: + * return (skiplist.get(midpoint) + + * skiplist.get(midpoint - 1)) / 2 # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_3 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/algos.pyx":1512 + * skiplist.get(midpoint - 1)) / 2 + * else: + * return NaN # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __pyx_r = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1501 + * # Cython to be able to get this right. + * + * cdef double_t _get_median(object sl, int nobs, int minp): # <<<<<<<<<<<<<< + * cdef Py_ssize_t midpoint + * cdef IndexableSkiplist skiplist = sl + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_WriteUnraisable("pandas.algos._get_median", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_skiplist); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1528 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_max2(ndarray[float64_t] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_43roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_42roll_max2[] = "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs."; +static PyMethodDef __pyx_mdef_6pandas_5algos_43roll_max2 = {__Pyx_NAMESTR("roll_max2"), (PyCFunction)__pyx_pw_6pandas_5algos_43roll_max2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_42roll_max2)}; +static PyObject *__pyx_pw_6pandas_5algos_43roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_a = 0; + int __pyx_v_window; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_max2 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_window,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_a = ((PyArrayObject *)values[0]); + __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_max2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_42roll_max2(__pyx_self, __pyx_v_a, __pyx_v_window, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_42roll_max2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp) { + __pyx_t_5numpy_float64_t __pyx_v_ai; + __pyx_t_5numpy_float64_t __pyx_v_aold; + Py_ssize_t __pyx_v_count; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_ring; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_minpair; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_end; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_last; + Py_ssize_t __pyx_v_i0; + npy_intp *__pyx_v_dim; + Py_ssize_t __pyx_v_n0; + npy_intp *__pyx_v_dims; + PyArrayObject *__pyx_v_y = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_a; + __Pyx_Buffer __pyx_pybuffer_a; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + npy_intp __pyx_t_1[1]; + PyObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + double __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + long __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_max2", 0); + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_a.pybuffer.buf = NULL; + __pyx_pybuffer_a.refcount = 0; + __pyx_pybuffernd_a.data = NULL; + __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1538 + * cdef Py_ssize_t i0 + * cdef np.npy_intp *dim + * dim = PyArray_DIMS(a) # <<<<<<<<<<<<<< + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] + */ + __pyx_v_dim = PyArray_DIMS(((PyArrayObject *)__pyx_v_a)); + + /* "pandas/algos.pyx":1539 + * cdef np.npy_intp *dim + * dim = PyArray_DIMS(a) + * cdef Py_ssize_t n0 = dim[0] # <<<<<<<<<<<<<< + * cdef np.npy_intp *dims = [n0] + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, + */ + __pyx_v_n0 = (__pyx_v_dim[0]); + + /* "pandas/algos.pyx":1540 + * dim = PyArray_DIMS(a) + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, + * NPY_float64, 0) + */ + __pyx_t_1[0] = __pyx_v_n0; + __pyx_v_dims = __pyx_t_1; + + /* "pandas/algos.pyx":1541 + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, # <<<<<<<<<<<<<< + * NPY_float64, 0) + * + */ + __pyx_t_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_y = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1544 + * NPY_float64, 0) + * + * if window < 1: # <<<<<<<<<<<<<< + * raise ValueError('Invalid window size %d' + * % (window)) + */ + __pyx_t_4 = ((__pyx_v_window < 1) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1546 + * if window < 1: + * raise ValueError('Invalid window size %d' + * % (window)) # <<<<<<<<<<<<<< + * + * if minp > window: + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_window_size_d, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1545 + * + * if window < 1: + * raise ValueError('Invalid window size %d' # <<<<<<<<<<<<<< + * % (window)) + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":1548 + * % (window)) + * + * if minp > window: # <<<<<<<<<<<<<< + * raise ValueError('Invalid min_periods size %d greater than window %d' + * % (minp, window)) + */ + __pyx_t_4 = ((__pyx_v_minp > __pyx_v_window) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1550 + * if minp > window: + * raise ValueError('Invalid min_periods size %d greater than window %d' + * % (minp, window)) # <<<<<<<<<<<<<< + * + * minp = _check_minp(window, minp, n0) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_5 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/algos.pyx":1549 + * + * if minp > window: + * raise ValueError('Invalid min_periods size %d greater than window %d' # <<<<<<<<<<<<<< + * % (minp, window)) + * + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":1552 + * % (minp, window)) + * + * minp = _check_minp(window, minp, n0) # <<<<<<<<<<<<<< + * + * window = min(window, n0) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_minp = __pyx_t_9; + + /* "pandas/algos.pyx":1554 + * minp = _check_minp(window, minp, n0) + * + * window = min(window, n0) # <<<<<<<<<<<<<< + * + * ring = stdlib.malloc(window * sizeof(pairs)) + */ + __pyx_t_10 = __pyx_v_n0; + __pyx_t_9 = __pyx_v_window; + if (((__pyx_t_10 < __pyx_t_9) != 0)) { + __pyx_t_11 = __pyx_t_10; + } else { + __pyx_t_11 = __pyx_t_9; + } + __pyx_v_window = __pyx_t_11; + + /* "pandas/algos.pyx":1556 + * window = min(window, n0) + * + * ring = stdlib.malloc(window * sizeof(pairs)) # <<<<<<<<<<<<<< + * end = ring + window + * last = ring + */ + __pyx_v_ring = ((struct __pyx_t_6pandas_5algos_pairs *)malloc((__pyx_v_window * (sizeof(struct __pyx_t_6pandas_5algos_pairs))))); + + /* "pandas/algos.pyx":1557 + * + * ring = stdlib.malloc(window * sizeof(pairs)) + * end = ring + window # <<<<<<<<<<<<<< + * last = ring + * + */ + __pyx_v_end = (__pyx_v_ring + __pyx_v_window); + + /* "pandas/algos.pyx":1558 + * ring = stdlib.malloc(window * sizeof(pairs)) + * end = ring + window + * last = ring # <<<<<<<<<<<<<< + * + * minpair = ring + */ + __pyx_v_last = __pyx_v_ring; + + /* "pandas/algos.pyx":1560 + * last = ring + * + * minpair = ring # <<<<<<<<<<<<<< + * ai = a[0] + * if ai == ai: + */ + __pyx_v_minpair = __pyx_v_ring; + + /* "pandas/algos.pyx":1561 + * + * minpair = ring + * ai = a[0] # <<<<<<<<<<<<<< + * if ai == ai: + * minpair.value = ai + */ + __pyx_t_12 = 0; + __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1562 + * minpair = ring + * ai = a[0] + * if ai == ai: # <<<<<<<<<<<<<< + * minpair.value = ai + * else: + */ + __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1563 + * ai = a[0] + * if ai == ai: + * minpair.value = ai # <<<<<<<<<<<<<< + * else: + * minpair.value = MINfloat64 + */ + __pyx_v_minpair->value = __pyx_v_ai; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/algos.pyx":1565 + * minpair.value = ai + * else: + * minpair.value = MINfloat64 # <<<<<<<<<<<<<< + * minpair.death = window + * + */ + __pyx_v_minpair->value = __pyx_v_6pandas_5algos_MINfloat64; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1566 + * else: + * minpair.value = MINfloat64 + * minpair.death = window # <<<<<<<<<<<<<< + * + * count = 0 + */ + __pyx_v_minpair->death = __pyx_v_window; + + /* "pandas/algos.pyx":1568 + * minpair.death = window + * + * count = 0 # <<<<<<<<<<<<<< + * for i0 in range(n0): + * ai = a[i0] + */ + __pyx_v_count = 0; + + /* "pandas/algos.pyx":1569 + * + * count = 0 + * for i0 in range(n0): # <<<<<<<<<<<<<< + * ai = a[i0] + * if ai == ai: + */ + __pyx_t_11 = __pyx_v_n0; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10+=1) { + __pyx_v_i0 = __pyx_t_10; + + /* "pandas/algos.pyx":1570 + * count = 0 + * for i0 in range(n0): + * ai = a[i0] # <<<<<<<<<<<<<< + * if ai == ai: + * count += 1 + */ + __pyx_t_13 = __pyx_v_i0; + __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1571 + * for i0 in range(n0): + * ai = a[i0] + * if ai == ai: # <<<<<<<<<<<<<< + * count += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1572 + * ai = a[i0] + * if ai == ai: + * count += 1 # <<<<<<<<<<<<<< + * else: + * ai = MINfloat64 + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/algos.pyx":1574 + * count += 1 + * else: + * ai = MINfloat64 # <<<<<<<<<<<<<< + * if i0 >= window: + * aold = a[i0 - window] + */ + __pyx_v_ai = __pyx_v_6pandas_5algos_MINfloat64; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1575 + * else: + * ai = MINfloat64 + * if i0 >= window: # <<<<<<<<<<<<<< + * aold = a[i0 - window] + * if aold == aold: + */ + __pyx_t_4 = ((__pyx_v_i0 >= __pyx_v_window) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1576 + * ai = MINfloat64 + * if i0 >= window: + * aold = a[i0 - window] # <<<<<<<<<<<<<< + * if aold == aold: + * count -= 1 + */ + __pyx_t_14 = (__pyx_v_i0 - __pyx_v_window); + __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1577 + * if i0 >= window: + * aold = a[i0 - window] + * if aold == aold: # <<<<<<<<<<<<<< + * count -= 1 + * if minpair.death == i0: + */ + __pyx_t_4 = ((__pyx_v_aold == __pyx_v_aold) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1578 + * aold = a[i0 - window] + * if aold == aold: + * count -= 1 # <<<<<<<<<<<<<< + * if minpair.death == i0: + * minpair += 1 + */ + __pyx_v_count = (__pyx_v_count - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1579 + * if aold == aold: + * count -= 1 + * if minpair.death == i0: # <<<<<<<<<<<<<< + * minpair += 1 + * if minpair >= end: + */ + __pyx_t_4 = ((__pyx_v_minpair->death == __pyx_v_i0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1580 + * count -= 1 + * if minpair.death == i0: + * minpair += 1 # <<<<<<<<<<<<<< + * if minpair >= end: + * minpair = ring + */ + __pyx_v_minpair = (__pyx_v_minpair + 1); + + /* "pandas/algos.pyx":1581 + * if minpair.death == i0: + * minpair += 1 + * if minpair >= end: # <<<<<<<<<<<<<< + * minpair = ring + * if ai >= minpair.value: + */ + __pyx_t_4 = ((__pyx_v_minpair >= __pyx_v_end) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1582 + * minpair += 1 + * if minpair >= end: + * minpair = ring # <<<<<<<<<<<<<< + * if ai >= minpair.value: + * minpair.value = ai + */ + __pyx_v_minpair = __pyx_v_ring; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":1583 + * if minpair >= end: + * minpair = ring + * if ai >= minpair.value: # <<<<<<<<<<<<<< + * minpair.value = ai + * minpair.death = i0 + window + */ + __pyx_t_4 = ((__pyx_v_ai >= __pyx_v_minpair->value) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1584 + * minpair = ring + * if ai >= minpair.value: + * minpair.value = ai # <<<<<<<<<<<<<< + * minpair.death = i0 + window + * last = minpair + */ + __pyx_v_minpair->value = __pyx_v_ai; + + /* "pandas/algos.pyx":1585 + * if ai >= minpair.value: + * minpair.value = ai + * minpair.death = i0 + window # <<<<<<<<<<<<<< + * last = minpair + * else: + */ + __pyx_v_minpair->death = (__pyx_v_i0 + __pyx_v_window); + + /* "pandas/algos.pyx":1586 + * minpair.value = ai + * minpair.death = i0 + window + * last = minpair # <<<<<<<<<<<<<< + * else: + * while last.value <= ai: + */ + __pyx_v_last = __pyx_v_minpair; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1588 + * last = minpair + * else: + * while last.value <= ai: # <<<<<<<<<<<<<< + * if last == ring: + * last = end + */ + while (1) { + __pyx_t_4 = ((__pyx_v_last->value <= __pyx_v_ai) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":1589 + * else: + * while last.value <= ai: + * if last == ring: # <<<<<<<<<<<<<< + * last = end + * last -= 1 + */ + __pyx_t_4 = ((__pyx_v_last == __pyx_v_ring) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1590 + * while last.value <= ai: + * if last == ring: + * last = end # <<<<<<<<<<<<<< + * last -= 1 + * last += 1 + */ + __pyx_v_last = __pyx_v_end; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/algos.pyx":1591 + * if last == ring: + * last = end + * last -= 1 # <<<<<<<<<<<<<< + * last += 1 + * if last == end: + */ + __pyx_v_last = (__pyx_v_last - 1); + } + + /* "pandas/algos.pyx":1592 + * last = end + * last -= 1 + * last += 1 # <<<<<<<<<<<<<< + * if last == end: + * last = ring + */ + __pyx_v_last = (__pyx_v_last + 1); + + /* "pandas/algos.pyx":1593 + * last -= 1 + * last += 1 + * if last == end: # <<<<<<<<<<<<<< + * last = ring + * last.value = ai + */ + __pyx_t_4 = ((__pyx_v_last == __pyx_v_end) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1594 + * last += 1 + * if last == end: + * last = ring # <<<<<<<<<<<<<< + * last.value = ai + * last.death = i0 + window + */ + __pyx_v_last = __pyx_v_ring; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/algos.pyx":1595 + * if last == end: + * last = ring + * last.value = ai # <<<<<<<<<<<<<< + * last.death = i0 + window + * if count >= minp: + */ + __pyx_v_last->value = __pyx_v_ai; + + /* "pandas/algos.pyx":1596 + * last = ring + * last.value = ai + * last.death = i0 + window # <<<<<<<<<<<<<< + * if count >= minp: + * y[i0] = minpair.value + */ + __pyx_v_last->death = (__pyx_v_i0 + __pyx_v_window); + } + __pyx_L13:; + + /* "pandas/algos.pyx":1597 + * last.value = ai + * last.death = i0 + window + * if count >= minp: # <<<<<<<<<<<<<< + * y[i0] = minpair.value + * else: + */ + __pyx_t_4 = ((__pyx_v_count >= __pyx_v_minp) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1598 + * last.death = i0 + window + * if count >= minp: + * y[i0] = minpair.value # <<<<<<<<<<<<<< + * else: + * y[i0] = NaN + */ + __pyx_t_15 = __pyx_v_minpair->value; + __pyx_t_16 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_15; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/algos.pyx":1600 + * y[i0] = minpair.value + * else: + * y[i0] = NaN # <<<<<<<<<<<<<< + * + * for i0 in range(minp - 1): + */ + __pyx_t_17 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L18:; + } + + /* "pandas/algos.pyx":1602 + * y[i0] = NaN + * + * for i0 in range(minp - 1): # <<<<<<<<<<<<<< + * y[i0] = NaN + * + */ + __pyx_t_18 = (__pyx_v_minp - 1); + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_18; __pyx_t_11+=1) { + __pyx_v_i0 = __pyx_t_11; + + /* "pandas/algos.pyx":1603 + * + * for i0 in range(minp - 1): + * y[i0] = NaN # <<<<<<<<<<<<<< + * + * stdlib.free(ring) + */ + __pyx_t_10 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1605 + * y[i0] = NaN + * + * stdlib.free(ring) # <<<<<<<<<<<<<< + * return y + * + */ + free(__pyx_v_ring); + + /* "pandas/algos.pyx":1606 + * + * stdlib.free(ring) + * return y # <<<<<<<<<<<<<< + * + * def roll_max(ndarray input, int win, int minp): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_y)); + __pyx_r = ((PyObject *)__pyx_v_y); + goto __pyx_L0; + + /* "pandas/algos.pyx":1528 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_max2(ndarray[float64_t] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_max2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1608 + * return y + * + * def roll_max(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_45roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_44roll_max[] = "\n O(N log(window)) implementation using skip list\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_45roll_max = {__Pyx_NAMESTR("roll_max"), (PyCFunction)__pyx_pw_6pandas_5algos_45roll_max, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_44roll_max)}; +static PyObject *__pyx_pw_6pandas_5algos_45roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_max (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_44roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_44roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_max", 0); + + /* "pandas/algos.pyx":1612 + * O(N log(window)) implementation using skip list + * ''' + * return _roll_skiplist_op(input, win, minp, _get_max) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1608 + * return y + * + * def roll_max(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1615 + * + * + * cdef double_t _get_max(object skiplist, int nobs, int minp): # <<<<<<<<<<<<<< + * if nobs >= minp: + * return skiplist.get(nobs - 1) + */ + +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_max(PyObject *__pyx_v_skiplist, int __pyx_v_nobs, int __pyx_v_minp) { + __pyx_t_5numpy_double_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __pyx_t_5numpy_double_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_max", 0); + + /* "pandas/algos.pyx":1616 + * + * cdef double_t _get_max(object skiplist, int nobs, int minp): + * if nobs >= minp: # <<<<<<<<<<<<<< + * return skiplist.get(nobs - 1) + * else: + */ + __pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_1) { + + /* "pandas/algos.pyx":1617 + * cdef double_t _get_max(object skiplist, int nobs, int minp): + * if nobs >= minp: + * return skiplist.get(nobs - 1) # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_skiplist, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_nobs - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":1619 + * return skiplist.get(nobs - 1) + * else: + * return NaN # <<<<<<<<<<<<<< + * + * def roll_min(ndarray input, int win, int minp): + */ + __pyx_r = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1615 + * + * + * cdef double_t _get_max(object skiplist, int nobs, int minp): # <<<<<<<<<<<<<< + * if nobs >= minp: + * return skiplist.get(nobs - 1) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.algos._get_max", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1621 + * return NaN + * + * def roll_min(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_47roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_46roll_min[] = "\n O(N log(window)) implementation using skip list\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_47roll_min = {__Pyx_NAMESTR("roll_min"), (PyCFunction)__pyx_pw_6pandas_5algos_47roll_min, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_46roll_min)}; +static PyObject *__pyx_pw_6pandas_5algos_47roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_min (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_46roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_46roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_min", 0); + + /* "pandas/algos.pyx":1625 + * O(N log(window)) implementation using skip list + * ''' + * return _roll_skiplist_op(input, win, minp, _get_min) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_5algos__get_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1621 + * return NaN + * + * def roll_min(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1629 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_49roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_48roll_min2[] = "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs."; +static PyMethodDef __pyx_mdef_6pandas_5algos_49roll_min2 = {__Pyx_NAMESTR("roll_min2"), (PyCFunction)__pyx_pw_6pandas_5algos_49roll_min2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_48roll_min2)}; +static PyObject *__pyx_pw_6pandas_5algos_49roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_a = 0; + int __pyx_v_window; + int __pyx_v_minp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_min2 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_window,&__pyx_n_s_minp,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_a = ((PyArrayObject *)values[0]); + __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_min2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_48roll_min2(__pyx_self, __pyx_v_a, __pyx_v_window, __pyx_v_minp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_48roll_min2(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_window, int __pyx_v_minp) { + __pyx_t_5numpy_float64_t __pyx_v_ai; + __pyx_t_5numpy_float64_t __pyx_v_aold; + Py_ssize_t __pyx_v_count; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_ring; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_minpair; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_end; + struct __pyx_t_6pandas_5algos_pairs *__pyx_v_last; + Py_ssize_t __pyx_v_i0; + npy_intp *__pyx_v_dim; + Py_ssize_t __pyx_v_n0; + npy_intp *__pyx_v_dims; + PyArrayObject *__pyx_v_y = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_a; + __Pyx_Buffer __pyx_pybuffer_a; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + npy_intp __pyx_t_1[1]; + PyObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + double __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + long __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_min2", 0); + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_a.pybuffer.buf = NULL; + __pyx_pybuffer_a.refcount = 0; + __pyx_pybuffernd_a.data = NULL; + __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1639 + * cdef Py_ssize_t i0 + * cdef np.npy_intp *dim + * dim = PyArray_DIMS(a) # <<<<<<<<<<<<<< + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] + */ + __pyx_v_dim = PyArray_DIMS(((PyArrayObject *)__pyx_v_a)); + + /* "pandas/algos.pyx":1640 + * cdef np.npy_intp *dim + * dim = PyArray_DIMS(a) + * cdef Py_ssize_t n0 = dim[0] # <<<<<<<<<<<<<< + * cdef np.npy_intp *dims = [n0] + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, + */ + __pyx_v_n0 = (__pyx_v_dim[0]); + + /* "pandas/algos.pyx":1641 + * dim = PyArray_DIMS(a) + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] # <<<<<<<<<<<<<< + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, + * NPY_float64, 0) + */ + __pyx_t_1[0] = __pyx_v_n0; + __pyx_v_dims = __pyx_t_1; + + /* "pandas/algos.pyx":1642 + * cdef Py_ssize_t n0 = dim[0] + * cdef np.npy_intp *dims = [n0] + * cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims, # <<<<<<<<<<<<<< + * NPY_float64, 0) + * + */ + __pyx_t_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_y.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_y = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1645 + * NPY_float64, 0) + * + * if window < 1: # <<<<<<<<<<<<<< + * raise ValueError('Invalid window size %d' + * % (window)) + */ + __pyx_t_4 = ((__pyx_v_window < 1) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1647 + * if window < 1: + * raise ValueError('Invalid window size %d' + * % (window)) # <<<<<<<<<<<<<< + * + * if minp > window: + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_window_size_d, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1646 + * + * if window < 1: + * raise ValueError('Invalid window size %d' # <<<<<<<<<<<<<< + * % (window)) + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":1649 + * % (window)) + * + * if minp > window: # <<<<<<<<<<<<<< + * raise ValueError('Invalid min_periods size %d greater than window %d' + * % (minp, window)) + */ + __pyx_t_4 = ((__pyx_v_minp > __pyx_v_window) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1651 + * if minp > window: + * raise ValueError('Invalid min_periods size %d greater than window %d' + * % (minp, window)) # <<<<<<<<<<<<<< + * + * window = min(window, n0) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_5 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/algos.pyx":1650 + * + * if minp > window: + * raise ValueError('Invalid min_periods size %d greater than window %d' # <<<<<<<<<<<<<< + * % (minp, window)) + * + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/algos.pyx":1653 + * % (minp, window)) + * + * window = min(window, n0) # <<<<<<<<<<<<<< + * + * minp = _check_minp(window, minp, n0) + */ + __pyx_t_7 = __pyx_v_n0; + __pyx_t_8 = __pyx_v_window; + if (((__pyx_t_7 < __pyx_t_8) != 0)) { + __pyx_t_9 = __pyx_t_7; + } else { + __pyx_t_9 = __pyx_t_8; + } + __pyx_v_window = __pyx_t_9; + + /* "pandas/algos.pyx":1655 + * window = min(window, n0) + * + * minp = _check_minp(window, minp, n0) # <<<<<<<<<<<<<< + * + * ring = stdlib.malloc(window * sizeof(pairs)) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_window); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1657 + * minp = _check_minp(window, minp, n0) + * + * ring = stdlib.malloc(window * sizeof(pairs)) # <<<<<<<<<<<<<< + * end = ring + window + * last = ring + */ + __pyx_v_ring = ((struct __pyx_t_6pandas_5algos_pairs *)malloc((__pyx_v_window * (sizeof(struct __pyx_t_6pandas_5algos_pairs))))); + + /* "pandas/algos.pyx":1658 + * + * ring = stdlib.malloc(window * sizeof(pairs)) + * end = ring + window # <<<<<<<<<<<<<< + * last = ring + * + */ + __pyx_v_end = (__pyx_v_ring + __pyx_v_window); + + /* "pandas/algos.pyx":1659 + * ring = stdlib.malloc(window * sizeof(pairs)) + * end = ring + window + * last = ring # <<<<<<<<<<<<<< + * + * minpair = ring + */ + __pyx_v_last = __pyx_v_ring; + + /* "pandas/algos.pyx":1661 + * last = ring + * + * minpair = ring # <<<<<<<<<<<<<< + * ai = a[0] + * if ai == ai: + */ + __pyx_v_minpair = __pyx_v_ring; + + /* "pandas/algos.pyx":1662 + * + * minpair = ring + * ai = a[0] # <<<<<<<<<<<<<< + * if ai == ai: + * minpair.value = ai + */ + __pyx_t_12 = 0; + __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1663 + * minpair = ring + * ai = a[0] + * if ai == ai: # <<<<<<<<<<<<<< + * minpair.value = ai + * else: + */ + __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1664 + * ai = a[0] + * if ai == ai: + * minpair.value = ai # <<<<<<<<<<<<<< + * else: + * minpair.value = MAXfloat64 + */ + __pyx_v_minpair->value = __pyx_v_ai; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/algos.pyx":1666 + * minpair.value = ai + * else: + * minpair.value = MAXfloat64 # <<<<<<<<<<<<<< + * minpair.death = window + * + */ + __pyx_v_minpair->value = __pyx_v_6pandas_5algos_MAXfloat64; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1667 + * else: + * minpair.value = MAXfloat64 + * minpair.death = window # <<<<<<<<<<<<<< + * + * count = 0 + */ + __pyx_v_minpair->death = __pyx_v_window; + + /* "pandas/algos.pyx":1669 + * minpair.death = window + * + * count = 0 # <<<<<<<<<<<<<< + * for i0 in range(n0): + * ai = a[i0] + */ + __pyx_v_count = 0; + + /* "pandas/algos.pyx":1670 + * + * count = 0 + * for i0 in range(n0): # <<<<<<<<<<<<<< + * ai = a[i0] + * if ai == ai: + */ + __pyx_t_9 = __pyx_v_n0; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_9; __pyx_t_7+=1) { + __pyx_v_i0 = __pyx_t_7; + + /* "pandas/algos.pyx":1671 + * count = 0 + * for i0 in range(n0): + * ai = a[i0] # <<<<<<<<<<<<<< + * if ai == ai: + * count += 1 + */ + __pyx_t_13 = __pyx_v_i0; + __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1672 + * for i0 in range(n0): + * ai = a[i0] + * if ai == ai: # <<<<<<<<<<<<<< + * count += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_ai == __pyx_v_ai) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1673 + * ai = a[i0] + * if ai == ai: + * count += 1 # <<<<<<<<<<<<<< + * else: + * ai = MAXfloat64 + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/algos.pyx":1675 + * count += 1 + * else: + * ai = MAXfloat64 # <<<<<<<<<<<<<< + * if i0 >= window: + * aold = a[i0 - window] + */ + __pyx_v_ai = __pyx_v_6pandas_5algos_MAXfloat64; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1676 + * else: + * ai = MAXfloat64 + * if i0 >= window: # <<<<<<<<<<<<<< + * aold = a[i0 - window] + * if aold == aold: + */ + __pyx_t_4 = ((__pyx_v_i0 >= __pyx_v_window) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1677 + * ai = MAXfloat64 + * if i0 >= window: + * aold = a[i0 - window] # <<<<<<<<<<<<<< + * if aold == aold: + * count -= 1 + */ + __pyx_t_14 = (__pyx_v_i0 - __pyx_v_window); + __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides)); + + /* "pandas/algos.pyx":1678 + * if i0 >= window: + * aold = a[i0 - window] + * if aold == aold: # <<<<<<<<<<<<<< + * count -= 1 + * if minpair.death == i0: + */ + __pyx_t_4 = ((__pyx_v_aold == __pyx_v_aold) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1679 + * aold = a[i0 - window] + * if aold == aold: + * count -= 1 # <<<<<<<<<<<<<< + * if minpair.death == i0: + * minpair += 1 + */ + __pyx_v_count = (__pyx_v_count - 1); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/algos.pyx":1680 + * if aold == aold: + * count -= 1 + * if minpair.death == i0: # <<<<<<<<<<<<<< + * minpair += 1 + * if minpair >= end: + */ + __pyx_t_4 = ((__pyx_v_minpair->death == __pyx_v_i0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1681 + * count -= 1 + * if minpair.death == i0: + * minpair += 1 # <<<<<<<<<<<<<< + * if minpair >= end: + * minpair = ring + */ + __pyx_v_minpair = (__pyx_v_minpair + 1); + + /* "pandas/algos.pyx":1682 + * if minpair.death == i0: + * minpair += 1 + * if minpair >= end: # <<<<<<<<<<<<<< + * minpair = ring + * if ai <= minpair.value: + */ + __pyx_t_4 = ((__pyx_v_minpair >= __pyx_v_end) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1683 + * minpair += 1 + * if minpair >= end: + * minpair = ring # <<<<<<<<<<<<<< + * if ai <= minpair.value: + * minpair.value = ai + */ + __pyx_v_minpair = __pyx_v_ring; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/algos.pyx":1684 + * if minpair >= end: + * minpair = ring + * if ai <= minpair.value: # <<<<<<<<<<<<<< + * minpair.value = ai + * minpair.death = i0 + window + */ + __pyx_t_4 = ((__pyx_v_ai <= __pyx_v_minpair->value) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1685 + * minpair = ring + * if ai <= minpair.value: + * minpair.value = ai # <<<<<<<<<<<<<< + * minpair.death = i0 + window + * last = minpair + */ + __pyx_v_minpair->value = __pyx_v_ai; + + /* "pandas/algos.pyx":1686 + * if ai <= minpair.value: + * minpair.value = ai + * minpair.death = i0 + window # <<<<<<<<<<<<<< + * last = minpair + * else: + */ + __pyx_v_minpair->death = (__pyx_v_i0 + __pyx_v_window); + + /* "pandas/algos.pyx":1687 + * minpair.value = ai + * minpair.death = i0 + window + * last = minpair # <<<<<<<<<<<<<< + * else: + * while last.value >= ai: + */ + __pyx_v_last = __pyx_v_minpair; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1689 + * last = minpair + * else: + * while last.value >= ai: # <<<<<<<<<<<<<< + * if last == ring: + * last = end + */ + while (1) { + __pyx_t_4 = ((__pyx_v_last->value >= __pyx_v_ai) != 0); + if (!__pyx_t_4) break; + + /* "pandas/algos.pyx":1690 + * else: + * while last.value >= ai: + * if last == ring: # <<<<<<<<<<<<<< + * last = end + * last -= 1 + */ + __pyx_t_4 = ((__pyx_v_last == __pyx_v_ring) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1691 + * while last.value >= ai: + * if last == ring: + * last = end # <<<<<<<<<<<<<< + * last -= 1 + * last += 1 + */ + __pyx_v_last = __pyx_v_end; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/algos.pyx":1692 + * if last == ring: + * last = end + * last -= 1 # <<<<<<<<<<<<<< + * last += 1 + * if last == end: + */ + __pyx_v_last = (__pyx_v_last - 1); + } + + /* "pandas/algos.pyx":1693 + * last = end + * last -= 1 + * last += 1 # <<<<<<<<<<<<<< + * if last == end: + * last = ring + */ + __pyx_v_last = (__pyx_v_last + 1); + + /* "pandas/algos.pyx":1694 + * last -= 1 + * last += 1 + * if last == end: # <<<<<<<<<<<<<< + * last = ring + * last.value = ai + */ + __pyx_t_4 = ((__pyx_v_last == __pyx_v_end) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1695 + * last += 1 + * if last == end: + * last = ring # <<<<<<<<<<<<<< + * last.value = ai + * last.death = i0 + window + */ + __pyx_v_last = __pyx_v_ring; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/algos.pyx":1696 + * if last == end: + * last = ring + * last.value = ai # <<<<<<<<<<<<<< + * last.death = i0 + window + * if count >= minp: + */ + __pyx_v_last->value = __pyx_v_ai; + + /* "pandas/algos.pyx":1697 + * last = ring + * last.value = ai + * last.death = i0 + window # <<<<<<<<<<<<<< + * if count >= minp: + * y[i0] = minpair.value + */ + __pyx_v_last->death = (__pyx_v_i0 + __pyx_v_window); + } + __pyx_L13:; + + /* "pandas/algos.pyx":1698 + * last.value = ai + * last.death = i0 + window + * if count >= minp: # <<<<<<<<<<<<<< + * y[i0] = minpair.value + * else: + */ + __pyx_t_4 = ((__pyx_v_count >= __pyx_v_minp) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1699 + * last.death = i0 + window + * if count >= minp: + * y[i0] = minpair.value # <<<<<<<<<<<<<< + * else: + * y[i0] = NaN + */ + __pyx_t_15 = __pyx_v_minpair->value; + __pyx_t_16 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_t_15; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/algos.pyx":1701 + * y[i0] = minpair.value + * else: + * y[i0] = NaN # <<<<<<<<<<<<<< + * + * for i0 in range(minp - 1): + */ + __pyx_t_17 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L18:; + } + + /* "pandas/algos.pyx":1703 + * y[i0] = NaN + * + * for i0 in range(minp - 1): # <<<<<<<<<<<<<< + * y[i0] = NaN + * + */ + __pyx_t_18 = (__pyx_v_minp - 1); + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_18; __pyx_t_9+=1) { + __pyx_v_i0 = __pyx_t_9; + + /* "pandas/algos.pyx":1704 + * + * for i0 in range(minp - 1): + * y[i0] = NaN # <<<<<<<<<<<<<< + * + * stdlib.free(ring) + */ + __pyx_t_7 = __pyx_v_i0; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_y.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1706 + * y[i0] = NaN + * + * stdlib.free(ring) # <<<<<<<<<<<<<< + * return y + * + */ + free(__pyx_v_ring); + + /* "pandas/algos.pyx":1707 + * + * stdlib.free(ring) + * return y # <<<<<<<<<<<<<< + * + * cdef double_t _get_min(object skiplist, int nobs, int minp): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_y)); + __pyx_r = ((PyObject *)__pyx_v_y); + goto __pyx_L0; + + /* "pandas/algos.pyx":1629 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_min2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1709 + * return y + * + * cdef double_t _get_min(object skiplist, int nobs, int minp): # <<<<<<<<<<<<<< + * if nobs >= minp: + * return skiplist.get(0) + */ + +static __pyx_t_5numpy_double_t __pyx_f_6pandas_5algos__get_min(PyObject *__pyx_v_skiplist, int __pyx_v_nobs, int __pyx_v_minp) { + __pyx_t_5numpy_double_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_double_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_min", 0); + + /* "pandas/algos.pyx":1710 + * + * cdef double_t _get_min(object skiplist, int nobs, int minp): + * if nobs >= minp: # <<<<<<<<<<<<<< + * return skiplist.get(0) + * else: + */ + __pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_1) { + + /* "pandas/algos.pyx":1711 + * cdef double_t _get_min(object skiplist, int nobs, int minp): + * if nobs >= minp: + * return skiplist.get(0) # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_skiplist, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/algos.pyx":1713 + * return skiplist.get(0) + * else: + * return NaN # <<<<<<<<<<<<<< + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, + */ + __pyx_r = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1709 + * return y + * + * cdef double_t _get_min(object skiplist, int nobs, int minp): # <<<<<<<<<<<<<< + * if nobs >= minp: + * return skiplist.get(0) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("pandas.algos._get_min", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1715 + * return NaN + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, double quantile): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_51roll_quantile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_50roll_quantile[] = "\n O(N log(window)) implementation using skip list\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_51roll_quantile = {__Pyx_NAMESTR("roll_quantile"), (PyCFunction)__pyx_pw_6pandas_5algos_51roll_quantile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_50roll_quantile)}; +static PyObject *__pyx_pw_6pandas_5algos_51roll_quantile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + double __pyx_v_quantile; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_quantile (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_quantile,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_quantile)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_quantile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_quantile = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_quantile == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_quantile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_50roll_quantile(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_quantile); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_50roll_quantile(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, double __pyx_v_quantile) { + double __pyx_v_val; + double __pyx_v_prev; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *__pyx_v_skiplist = 0; + Py_ssize_t __pyx_v_nobs; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyArrayObject *__pyx_v_output = 0; + PyObject *__pyx_v_idx = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_double_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_quantile", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1722 + * cdef double val, prev, midpoint + * cdef IndexableSkiplist skiplist + * cdef Py_ssize_t nobs = 0, i # <<<<<<<<<<<<<< + * cdef Py_ssize_t N = len(input) + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + */ + __pyx_v_nobs = 0; + + /* "pandas/algos.pyx":1723 + * cdef IndexableSkiplist skiplist + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) # <<<<<<<<<<<<<< + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/algos.pyx":1724 + * cdef Py_ssize_t nobs = 0, i + * cdef Py_ssize_t N = len(input) + * cdef ndarray[double_t] output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< + * + * skiplist = IndexableSkiplist(win) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1726 + * cdef ndarray[double_t] output = np.empty(N, dtype=float) + * + * skiplist = IndexableSkiplist(win) # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, N) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_IndexableSkiplist)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_skiplist = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1728 + * skiplist = IndexableSkiplist(win) + * + * minp = _check_minp(win, minp, N) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < minp - 1: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_minp = __pyx_t_8; + + /* "pandas/algos.pyx":1730 + * minp = _check_minp(win, minp, N) + * + * for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_9 = (__pyx_v_minp - 1); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) { + + /* "pandas/algos.pyx":1731 + * + * for i from 0 <= i < minp - 1: + * val = input[i] # <<<<<<<<<<<<<< + * + * # Not NaN + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1734 + * + * # Not NaN + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist.insert(val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1735 + * # Not NaN + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist.insert(val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1736 + * if val == val: + * nobs += 1 + * skiplist.insert(val) # <<<<<<<<<<<<<< + * + * output[i] = NaN + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/algos.pyx":1738 + * skiplist.insert(val) + * + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from minp - 1 <= i < N: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + + /* "pandas/algos.pyx":1740 + * output[i] = NaN + * + * for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< + * val = input[i] + * + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_12; __pyx_v_i++) { + + /* "pandas/algos.pyx":1741 + * + * for i from minp - 1 <= i < N: + * val = input[i] # <<<<<<<<<<<<<< + * + * if i > win - 1: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1743 + * val = input[i] + * + * if i > win - 1: # <<<<<<<<<<<<<< + * prev = input[i - win] + * + */ + __pyx_t_10 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1744 + * + * if i > win - 1: + * prev = input[i - win] # <<<<<<<<<<<<<< + * + * if prev == prev: + */ + __pyx_t_14 = (__pyx_v_i - __pyx_v_win); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1746 + * prev = input[i - win] + * + * if prev == prev: # <<<<<<<<<<<<<< + * skiplist.remove(prev) + * nobs -= 1 + */ + __pyx_t_10 = ((__pyx_v_prev == __pyx_v_prev) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1747 + * + * if prev == prev: + * skiplist.remove(prev) # <<<<<<<<<<<<<< + * nobs -= 1 + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1748 + * if prev == prev: + * skiplist.remove(prev) + * nobs -= 1 # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_v_nobs = (__pyx_v_nobs - 1); + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/algos.pyx":1750 + * nobs -= 1 + * + * if val == val: # <<<<<<<<<<<<<< + * nobs += 1 + * skiplist.insert(val) + */ + __pyx_t_10 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1751 + * + * if val == val: + * nobs += 1 # <<<<<<<<<<<<<< + * skiplist.insert(val) + * + */ + __pyx_v_nobs = (__pyx_v_nobs + 1); + + /* "pandas/algos.pyx":1752 + * if val == val: + * nobs += 1 + * skiplist.insert(val) # <<<<<<<<<<<<<< + * + * if nobs >= minp: + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/algos.pyx":1754 + * skiplist.insert(val) + * + * if nobs >= minp: # <<<<<<<<<<<<<< + * idx = int((quantile / 1.) * (nobs - 1)) + * output[i] = skiplist.get(idx) + */ + __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1755 + * + * if nobs >= minp: + * idx = int((quantile / 1.) * (nobs - 1)) # <<<<<<<<<<<<<< + * output[i] = skiplist.get(idx) + * else: + */ + __pyx_t_3 = PyFloat_FromDouble(((__pyx_v_quantile / 1.) * (__pyx_v_nobs - 1))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1756 + * if nobs >= minp: + * idx = int((quantile / 1.) * (nobs - 1)) + * output[i] = skiplist.get(idx) # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_t_15, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":1758 + * output[i] = skiplist.get(idx) + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L11:; + } + + /* "pandas/algos.pyx":1760 + * output[i] = NaN + * + * return output # <<<<<<<<<<<<<< + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1715 + * return NaN + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, double quantile): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_quantile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_skiplist); + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1762 + * return output + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, object func, object args, object kwargs): + * cdef ndarray[double_t] output, counts, bufarr + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_53roll_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_53roll_generic = {__Pyx_NAMESTR("roll_generic"), (PyCFunction)__pyx_pw_6pandas_5algos_53roll_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_53roll_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + int __pyx_v_win; + int __pyx_v_minp; + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_generic (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_func,&__pyx_n_s_args,&__pyx_n_s_kwargs,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_generic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_win = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_func = values[3]; + __pyx_v_args = values[4]; + __pyx_v_kwargs = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_52roll_generic(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_52roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, int __pyx_v_win, int __pyx_v_minp, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyArrayObject *__pyx_v_output = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_bufarr = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t *__pyx_v_buf; + __pyx_t_5numpy_float64_t *__pyx_v_oldbuf; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bufarr; + __Pyx_Buffer __pyx_pybuffer_bufarr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + __pyx_t_5numpy_double_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_generic", 0); + __Pyx_INCREF((PyObject *)__pyx_v_input); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_bufarr.pybuffer.buf = NULL; + __pyx_pybuffer_bufarr.refcount = 0; + __pyx_pybuffernd_bufarr.data = NULL; + __pyx_pybuffernd_bufarr.rcbuffer = &__pyx_pybuffer_bufarr; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1769 + * cdef float64_t *oldbuf + * + * if not input.flags.c_contiguous: # <<<<<<<<<<<<<< + * input = input.copy('C') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_input), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1770 + * + * if not input.flags.c_contiguous: + * input = input.copy('C') # <<<<<<<<<<<<<< + * + * buf = input.data + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_input), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_input, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/algos.pyx":1772 + * input = input.copy('C') + * + * buf = input.data # <<<<<<<<<<<<<< + * + * n = len(input) + */ + __pyx_v_buf = ((__pyx_t_5numpy_float64_t *)__pyx_v_input->data); + + /* "pandas/algos.pyx":1774 + * buf = input.data + * + * n = len(input) # <<<<<<<<<<<<<< + * if n == 0: + * return input + */ + __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_10; + + /* "pandas/algos.pyx":1775 + * + * n = len(input) + * if n == 0: # <<<<<<<<<<<<<< + * return input + * + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1776 + * n = len(input) + * if n == 0: + * return input # <<<<<<<<<<<<<< + * + * minp = _check_minp(win, minp, n) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_input)); + __pyx_r = ((PyObject *)__pyx_v_input); + goto __pyx_L0; + } + + /* "pandas/algos.pyx":1778 + * return input + * + * minp = _check_minp(win, minp, n) # <<<<<<<<<<<<<< + * output = np.empty(n, dtype=float) + * counts = roll_sum(np.isfinite(input).astype(float), win, minp) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_2 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_12); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_minp = __pyx_t_6; + + /* "pandas/algos.pyx":1779 + * + * minp = _check_minp(win, minp, n) + * output = np.empty(n, dtype=float) # <<<<<<<<<<<<<< + * counts = roll_sum(np.isfinite(input).astype(float), win, minp) + * + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/algos.pyx":1780 + * minp = _check_minp(win, minp, n) + * output = np.empty(n, dtype=float) + * counts = roll_sum(np.isfinite(input).astype(float), win, minp) # <<<<<<<<<<<<<< + * + * bufarr = np.empty(win, dtype=float) + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_roll_sum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)__pyx_v_input)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_input)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_input)); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)((PyObject*)(&PyFloat_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_1 = 0; + __pyx_t_13 = 0; + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/algos.pyx":1782 + * counts = roll_sum(np.isfinite(input).astype(float), win, minp) + * + * bufarr = np.empty(win, dtype=float) # <<<<<<<<<<<<<< + * oldbuf = bufarr.data + * + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_win); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_bufarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_bufarr.diminfo[0].strides = __pyx_pybuffernd_bufarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bufarr.diminfo[0].shape = __pyx_pybuffernd_bufarr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_bufarr = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1783 + * + * bufarr = np.empty(win, dtype=float) + * oldbuf = bufarr.data # <<<<<<<<<<<<<< + * + * n = len(input) + */ + __pyx_v_oldbuf = ((__pyx_t_5numpy_float64_t *)__pyx_v_bufarr->data); + + /* "pandas/algos.pyx":1785 + * oldbuf = bufarr.data + * + * n = len(input) # <<<<<<<<<<<<<< + * for i from 0 <= i < int_min(win, n): + * if counts[i] >= minp: + */ + __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_10; + + /* "pandas/algos.pyx":1786 + * + * n = len(input) + * for i from 0 <= i < int_min(win, n): # <<<<<<<<<<<<<< + * if counts[i] >= minp: + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, + */ + __pyx_t_6 = __pyx_f_6pandas_5algos_int_min(__pyx_v_win, __pyx_v_n); + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { + + /* "pandas/algos.pyx":1787 + * n = len(input) + * for i from 0 <= i < int_min(win, n): + * if counts[i] >= minp: # <<<<<<<<<<<<<< + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, + * **kwargs) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_15 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_15 = 0; + if (unlikely(__pyx_t_15 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_15); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_counts.diminfo[0].strides)) >= __pyx_v_minp) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1788 + * for i from 0 <= i < int_min(win, n): + * if counts[i] >= minp: + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, # <<<<<<<<<<<<<< + * **kwargs) + * else: + */ + __pyx_t_13 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_input), __pyx_f_6pandas_5algos_int_max(((__pyx_v_i - __pyx_v_win) + 1), 0), (__pyx_v_i + 1), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1789 + * if counts[i] >= minp: + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, + * **kwargs) # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (likely(PyDict_Check(__pyx_v_kwargs))) { + __pyx_t_13 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_13); + } else { + __pyx_t_13 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + } + + /* "pandas/algos.pyx":1788 + * for i from 0 <= i < int_min(win, n): + * if counts[i] >= minp: + * output[i] = func(input[int_max(i - win + 1, 0) : i + 1], *args, # <<<<<<<<<<<<<< + * **kwargs) + * else: + */ + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_15 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_15 = 0; + if (unlikely(__pyx_t_15 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_15); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/algos.pyx":1791 + * **kwargs) + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * for i from win <= i < n: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_15 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_15 = 0; + if (unlikely(__pyx_t_15 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_15); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L7:; + } + + /* "pandas/algos.pyx":1793 + * output[i] = NaN + * + * for i from win <= i < n: # <<<<<<<<<<<<<< + * buf = buf + 1 + * bufarr.data = buf + */ + __pyx_t_19 = __pyx_v_n; + for (__pyx_v_i = __pyx_v_win; __pyx_v_i < __pyx_t_19; __pyx_v_i++) { + + /* "pandas/algos.pyx":1794 + * + * for i from win <= i < n: + * buf = buf + 1 # <<<<<<<<<<<<<< + * bufarr.data = buf + * if counts[i] >= minp: + */ + __pyx_v_buf = (__pyx_v_buf + 1); + + /* "pandas/algos.pyx":1795 + * for i from win <= i < n: + * buf = buf + 1 + * bufarr.data = buf # <<<<<<<<<<<<<< + * if counts[i] >= minp: + * output[i] = func(bufarr, *args, **kwargs) + */ + __pyx_v_bufarr->data = ((char *)__pyx_v_buf); + + /* "pandas/algos.pyx":1796 + * buf = buf + 1 + * bufarr.data = buf + * if counts[i] >= minp: # <<<<<<<<<<<<<< + * output[i] = func(bufarr, *args, **kwargs) + * else: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides)) >= __pyx_v_minp) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1797 + * bufarr.data = buf + * if counts[i] >= minp: + * output[i] = func(bufarr, *args, **kwargs) # <<<<<<<<<<<<<< + * else: + * output[i] = NaN + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)__pyx_v_bufarr)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_bufarr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_bufarr)); + __pyx_t_13 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (likely(PyDict_Check(__pyx_v_kwargs))) { + __pyx_t_13 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_13); + } else { + __pyx_t_13 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + } + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_t_16; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/algos.pyx":1799 + * output[i] = func(bufarr, *args, **kwargs) + * else: + * output[i] = NaN # <<<<<<<<<<<<<< + * + * bufarr.data = oldbuf + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + } + __pyx_L10:; + } + + /* "pandas/algos.pyx":1801 + * output[i] = NaN + * + * bufarr.data = oldbuf # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_v_bufarr->data = ((char *)__pyx_v_oldbuf); + + /* "pandas/algos.pyx":1803 + * bufarr.data = oldbuf + * + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1762 + * return output + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, object func, object args, object kwargs): + * cdef ndarray[double_t] output, counts, bufarr + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_generic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bufarr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF((PyObject *)__pyx_v_bufarr); + __Pyx_XDECREF((PyObject *)__pyx_v_input); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_55roll_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_54roll_window[] = "\n Assume len(weights) << len(input)\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_55roll_window = {__Pyx_NAMESTR("roll_window"), (PyCFunction)__pyx_pw_6pandas_5algos_55roll_window, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_54roll_window)}; +static PyObject *__pyx_pw_6pandas_5algos_55roll_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_input = 0; + PyArrayObject *__pyx_v_weights = 0; + int __pyx_v_minp; + int __pyx_v_avg; + int __pyx_v_avg_wgt; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("roll_window (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_weights,&__pyx_n_s_minp,&__pyx_n_s_avg,&__pyx_n_s_avg_wgt,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_avg); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_avg_wgt); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_window") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_input = ((PyArrayObject *)values[0]); + __pyx_v_weights = ((PyArrayObject *)values[1]); + __pyx_v_minp = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[3]) { + __pyx_v_avg = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_avg == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + + /* "pandas/algos.pyx":1808 + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): # <<<<<<<<<<<<<< + * """ + * Assume len(weights) << len(input) + */ + __pyx_v_avg = ((int)1); + } + if (values[4]) { + __pyx_v_avg_wgt = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_avg_wgt == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_avg_wgt = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("roll_window", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.roll_window", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_54roll_window(__pyx_self, __pyx_v_input, __pyx_v_weights, __pyx_v_minp, __pyx_v_avg, __pyx_v_avg_wgt); + + /* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_54roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg, int __pyx_v_avg_wgt) { + PyArrayObject *__pyx_v_output = 0; + PyArrayObject *__pyx_v_tot_wgt = 0; + PyArrayObject *__pyx_v_counts = 0; + Py_ssize_t __pyx_v_in_i; + Py_ssize_t __pyx_v_win_i; + Py_ssize_t __pyx_v_win_n; + Py_ssize_t __pyx_v_in_n; + __pyx_t_5numpy_float64_t __pyx_v_val_in; + __pyx_t_5numpy_float64_t __pyx_v_val_win; + __pyx_t_5numpy_float64_t __pyx_v_c; + __pyx_t_5numpy_float64_t __pyx_v_w; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_input; + __Pyx_Buffer __pyx_pybuffer_input; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + __Pyx_LocalBuf_ND __pyx_pybuffernd_tot_wgt; + __Pyx_Buffer __pyx_pybuffer_tot_wgt; + __Pyx_LocalBuf_ND __pyx_pybuffernd_weights; + __Pyx_Buffer __pyx_pybuffer_weights; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("roll_window", 0); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + __pyx_pybuffer_tot_wgt.pybuffer.buf = NULL; + __pyx_pybuffer_tot_wgt.refcount = 0; + __pyx_pybuffernd_tot_wgt.data = NULL; + __pyx_pybuffernd_tot_wgt.rcbuffer = &__pyx_pybuffer_tot_wgt; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_input.pybuffer.buf = NULL; + __pyx_pybuffer_input.refcount = 0; + __pyx_pybuffernd_input.data = NULL; + __pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; + __pyx_pybuffer_weights.pybuffer.buf = NULL; + __pyx_pybuffer_weights.refcount = 0; + __pyx_pybuffernd_weights.data = NULL; + __pyx_pybuffernd_weights.rcbuffer = &__pyx_pybuffer_weights; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_weights.diminfo[0].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weights.diminfo[0].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1817 + * float64_t val_in, val_win, c, w + * + * in_n = len(input) # <<<<<<<<<<<<<< + * win_n = len(weights) + * output = np.zeros(in_n, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_in_n = __pyx_t_1; + + /* "pandas/algos.pyx":1818 + * + * in_n = len(input) + * win_n = len(weights) # <<<<<<<<<<<<<< + * output = np.zeros(in_n, dtype=float) + * counts = np.zeros(in_n, dtype=float) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_weights)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_win_n = __pyx_t_1; + + /* "pandas/algos.pyx":1819 + * in_n = len(input) + * win_n = len(weights) + * output = np.zeros(in_n, dtype=float) # <<<<<<<<<<<<<< + * counts = np.zeros(in_n, dtype=float) + * if avg: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1820 + * win_n = len(weights) + * output = np.zeros(in_n, dtype=float) + * counts = np.zeros(in_n, dtype=float) # <<<<<<<<<<<<<< + * if avg: + * tot_wgt = np.zeros(in_n, dtype=float) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/algos.pyx":1821 + * output = np.zeros(in_n, dtype=float) + * counts = np.zeros(in_n, dtype=float) + * if avg: # <<<<<<<<<<<<<< + * tot_wgt = np.zeros(in_n, dtype=float) + * + */ + __pyx_t_11 = (__pyx_v_avg != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1822 + * counts = np.zeros(in_n, dtype=float) + * if avg: + * tot_wgt = np.zeros(in_n, dtype=float) # <<<<<<<<<<<<<< + * + * minp = _check_minp(len(weights), minp, in_n) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer, (PyObject*)__pyx_v_tot_wgt, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_tot_wgt.diminfo[0].strides = __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tot_wgt.diminfo[0].shape = __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_tot_wgt = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/algos.pyx":1824 + * tot_wgt = np.zeros(in_n, dtype=float) + * + * minp = _check_minp(len(weights), minp, in_n) # <<<<<<<<<<<<<< + * + * if avg_wgt: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_weights)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_in_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_minp = __pyx_t_7; + + /* "pandas/algos.pyx":1826 + * minp = _check_minp(len(weights), minp, in_n) + * + * if avg_wgt: # <<<<<<<<<<<<<< + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] + */ + __pyx_t_11 = (__pyx_v_avg_wgt != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1827 + * + * if avg_wgt: + * for win_i from 0 <= win_i < win_n: # <<<<<<<<<<<<<< + * val_win = weights[win_i] + * if val_win != val_win: + */ + __pyx_t_1 = __pyx_v_win_n; + for (__pyx_v_win_i = 0; __pyx_v_win_i < __pyx_t_1; __pyx_v_win_i++) { + + /* "pandas/algos.pyx":1828 + * if avg_wgt: + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] # <<<<<<<<<<<<<< + * if val_win != val_win: + * continue + */ + __pyx_t_13 = __pyx_v_win_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_weights.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_weights.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val_win = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weights.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_weights.diminfo[0].strides)); + + /* "pandas/algos.pyx":1829 + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] + * if val_win != val_win: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_11 = ((__pyx_v_val_win != __pyx_v_val_win) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1830 + * val_win = weights[win_i] + * if val_win != val_win: + * continue # <<<<<<<<<<<<<< + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + */ + goto __pyx_L5_continue; + } + + /* "pandas/algos.pyx":1832 + * continue + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: # <<<<<<<<<<<<<< + * val_in = input[in_i] + * if val_in == val_in: + */ + __pyx_t_14 = ((__pyx_v_in_n - (__pyx_v_win_n - __pyx_v_win_i)) + 1); + for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_14; __pyx_v_in_i++) { + + /* "pandas/algos.pyx":1833 + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + * val_in = input[in_i] # <<<<<<<<<<<<<< + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + */ + __pyx_t_15 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val_in = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1834 + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + * val_in = input[in_i] + * if val_in == val_in: # <<<<<<<<<<<<<< + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 + */ + __pyx_t_11 = ((__pyx_v_val_in == __pyx_v_val_in) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1835 + * val_in = input[in_i] + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win # <<<<<<<<<<<<<< + * counts[in_i + (win_n - win_i) - 1] += 1 + * tot_wgt[in_i + (win_n - win_i) - 1] += val_win + */ + __pyx_t_16 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_output.diminfo[0].strides) += (__pyx_v_val_in * __pyx_v_val_win); + + /* "pandas/algos.pyx":1836 + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 # <<<<<<<<<<<<<< + * tot_wgt[in_i + (win_n - win_i) - 1] += val_win + * + */ + __pyx_t_17 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1.0; + + /* "pandas/algos.pyx":1837 + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 + * tot_wgt[in_i + (win_n - win_i) - 1] += val_win # <<<<<<<<<<<<<< + * + * for in_i from 0 <= in_i < in_n: + */ + __pyx_t_18 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_tot_wgt.diminfo[0].strides) += __pyx_v_val_win; + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L5_continue:; + } + + /* "pandas/algos.pyx":1839 + * tot_wgt[in_i + (win_n - win_i) - 1] += val_win + * + * for in_i from 0 <= in_i < in_n: # <<<<<<<<<<<<<< + * c = counts[in_i] + * if c < minp: + */ + __pyx_t_1 = __pyx_v_in_n; + for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_1; __pyx_v_in_i++) { + + /* "pandas/algos.pyx":1840 + * + * for in_i from 0 <= in_i < in_n: + * c = counts[in_i] # <<<<<<<<<<<<<< + * if c < minp: + * output[in_i] = NaN + */ + __pyx_t_14 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_c = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides)); + + /* "pandas/algos.pyx":1841 + * for in_i from 0 <= in_i < in_n: + * c = counts[in_i] + * if c < minp: # <<<<<<<<<<<<<< + * output[in_i] = NaN + * else: + */ + __pyx_t_11 = ((__pyx_v_c < __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1842 + * c = counts[in_i] + * if c < minp: + * output[in_i] = NaN # <<<<<<<<<<<<<< + * else: + * w = tot_wgt[in_i] + */ + __pyx_t_19 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/algos.pyx":1844 + * output[in_i] = NaN + * else: + * w = tot_wgt[in_i] # <<<<<<<<<<<<<< + * if w == 0: + * output[in_i] = NaN + */ + __pyx_t_20 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_w = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_tot_wgt.diminfo[0].strides)); + + /* "pandas/algos.pyx":1845 + * else: + * w = tot_wgt[in_i] + * if w == 0: # <<<<<<<<<<<<<< + * output[in_i] = NaN + * else: + */ + __pyx_t_11 = ((__pyx_v_w == 0.0) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1846 + * w = tot_wgt[in_i] + * if w == 0: + * output[in_i] = NaN # <<<<<<<<<<<<<< + * else: + * output[in_i] /= tot_wgt[in_i] + */ + __pyx_t_21 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/algos.pyx":1848 + * output[in_i] = NaN + * else: + * output[in_i] /= tot_wgt[in_i] # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_22 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_tot_wgt.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_tot_wgt.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_output.diminfo[0].strides) /= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_tot_wgt.diminfo[0].strides)); + } + __pyx_L14:; + } + __pyx_L13:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/algos.pyx":1851 + * + * else: + * for win_i from 0 <= win_i < win_n: # <<<<<<<<<<<<<< + * val_win = weights[win_i] + * if val_win != val_win: + */ + __pyx_t_1 = __pyx_v_win_n; + for (__pyx_v_win_i = 0; __pyx_v_win_i < __pyx_t_1; __pyx_v_win_i++) { + + /* "pandas/algos.pyx":1852 + * else: + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] # <<<<<<<<<<<<<< + * if val_win != val_win: + * continue + */ + __pyx_t_24 = __pyx_v_win_i; + __pyx_t_7 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_weights.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_weights.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val_win = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weights.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_weights.diminfo[0].strides)); + + /* "pandas/algos.pyx":1853 + * for win_i from 0 <= win_i < win_n: + * val_win = weights[win_i] + * if val_win != val_win: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_11 = ((__pyx_v_val_win != __pyx_v_val_win) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1854 + * val_win = weights[win_i] + * if val_win != val_win: + * continue # <<<<<<<<<<<<<< + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + */ + goto __pyx_L15_continue; + } + + /* "pandas/algos.pyx":1856 + * continue + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: # <<<<<<<<<<<<<< + * val_in = input[in_i] + * + */ + __pyx_t_25 = ((__pyx_v_in_n - (__pyx_v_win_n - __pyx_v_win_i)) + 1); + for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_25; __pyx_v_in_i++) { + + /* "pandas/algos.pyx":1857 + * + * for in_i from 0 <= in_i < in_n - (win_n - win_i) + 1: + * val_in = input[in_i] # <<<<<<<<<<<<<< + * + * if val_in == val_in: + */ + __pyx_t_26 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_input.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_input.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val_in = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_input.diminfo[0].strides)); + + /* "pandas/algos.pyx":1859 + * val_in = input[in_i] + * + * if val_in == val_in: # <<<<<<<<<<<<<< + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 + */ + __pyx_t_11 = ((__pyx_v_val_in == __pyx_v_val_in) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1860 + * + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win # <<<<<<<<<<<<<< + * counts[in_i + (win_n - win_i) - 1] += 1 + * + */ + __pyx_t_27 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_output.diminfo[0].strides) += (__pyx_v_val_in * __pyx_v_val_win); + + /* "pandas/algos.pyx":1861 + * if val_in == val_in: + * output[in_i + (win_n - win_i) - 1] += val_in * val_win + * counts[in_i + (win_n - win_i) - 1] += 1 # <<<<<<<<<<<<<< + * + * for in_i from 0 <= in_i < in_n: + */ + __pyx_t_28 = ((__pyx_v_in_i + (__pyx_v_win_n - __pyx_v_win_i)) - 1); + __pyx_t_7 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_counts.diminfo[0].strides) += 1.0; + goto __pyx_L20; + } + __pyx_L20:; + } + __pyx_L15_continue:; + } + + /* "pandas/algos.pyx":1863 + * counts[in_i + (win_n - win_i) - 1] += 1 + * + * for in_i from 0 <= in_i < in_n: # <<<<<<<<<<<<<< + * c = counts[in_i] + * if c < minp: + */ + __pyx_t_1 = __pyx_v_in_n; + for (__pyx_v_in_i = 0; __pyx_v_in_i < __pyx_t_1; __pyx_v_in_i++) { + + /* "pandas/algos.pyx":1864 + * + * for in_i from 0 <= in_i < in_n: + * c = counts[in_i] # <<<<<<<<<<<<<< + * if c < minp: + * output[in_i] = NaN + */ + __pyx_t_25 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_c = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_counts.diminfo[0].strides)); + + /* "pandas/algos.pyx":1865 + * for in_i from 0 <= in_i < in_n: + * c = counts[in_i] + * if c < minp: # <<<<<<<<<<<<<< + * output[in_i] = NaN + * elif avg: + */ + __pyx_t_11 = ((__pyx_v_c < __pyx_v_minp) != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1866 + * c = counts[in_i] + * if c < minp: + * output[in_i] = NaN # <<<<<<<<<<<<<< + * elif avg: + * output[in_i] /= c + */ + __pyx_t_29 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L23; + } + + /* "pandas/algos.pyx":1867 + * if c < minp: + * output[in_i] = NaN + * elif avg: # <<<<<<<<<<<<<< + * output[in_i] /= c + * + */ + __pyx_t_11 = (__pyx_v_avg != 0); + if (__pyx_t_11) { + + /* "pandas/algos.pyx":1868 + * output[in_i] = NaN + * elif avg: + * output[in_i] /= c # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_30 = __pyx_v_in_i; + __pyx_t_7 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) /= __pyx_v_c; + goto __pyx_L23; + } + __pyx_L23:; + } + } + __pyx_L4:; + + /* "pandas/algos.pyx":1870 + * output[in_i] /= c + * + * return output # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + __pyx_r = ((PyObject *)__pyx_v_output); + goto __pyx_L0; + + /* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.roll_window", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tot_wgt.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XDECREF((PyObject *)__pyx_v_tot_wgt); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1879 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_57is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_57is_lexsorted = {__Pyx_NAMESTR("is_lexsorted"), (PyCFunction)__pyx_pw_6pandas_5algos_57is_lexsorted, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_57is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_lexsorted (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_list_of_arrays), (&PyList_Type), 1, "list_of_arrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_56is_lexsorted(__pyx_self, ((PyObject*)__pyx_v_list_of_arrays)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_56is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) { + int __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_nlevels; + __pyx_t_5numpy_int64_t __pyx_v_k; + __pyx_t_5numpy_int64_t __pyx_v_cur; + __pyx_t_5numpy_int64_t __pyx_v_pre; + PyArrayObject *__pyx_v_arr = 0; + __pyx_t_5numpy_int64_t **__pyx_v_vecs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_lexsorted", 0); + + /* "pandas/algos.pyx":1886 + * ndarray arr + * + * nlevels = len(list_of_arrays) # <<<<<<<<<<<<<< + * n = len(list_of_arrays[0]) + * + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_list_of_arrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nlevels = __pyx_t_1; + + /* "pandas/algos.pyx":1887 + * + * nlevels = len(list_of_arrays) + * n = len(list_of_arrays[0]) # <<<<<<<<<<<<<< + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_1; + + /* "pandas/algos.pyx":1889 + * n = len(list_of_arrays[0]) + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) # <<<<<<<<<<<<<< + * for i from 0 <= i < nlevels: + * # vecs[i] = ( list_of_arrays[i]).data + */ + __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_v_nlevels * (sizeof(__pyx_t_5numpy_int64_t *))))); + + /* "pandas/algos.pyx":1890 + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) + * for i from 0 <= i < nlevels: # <<<<<<<<<<<<<< + * # vecs[i] = ( list_of_arrays[i]).data + * + */ + __pyx_t_1 = __pyx_v_nlevels; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1893 + * # vecs[i] = ( list_of_arrays[i]).data + * + * arr = list_of_arrays[i] # <<<<<<<<<<<<<< + * vecs[i] = arr.data + * # assume uniqueness?? + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1894 + * + * arr = list_of_arrays[i] + * vecs[i] = arr.data # <<<<<<<<<<<<<< + * # assume uniqueness?? + * + */ + (__pyx_v_vecs[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)__pyx_v_arr->data); + } + + /* "pandas/algos.pyx":1897 + * # assume uniqueness?? + * + * for i from 1 <= i < n: # <<<<<<<<<<<<<< + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1898 + * + * for i from 1 <= i < n: + * for k from 0 <= k < nlevels: # <<<<<<<<<<<<<< + * cur = vecs[k][i] + * pre = vecs[k][i-1] + */ + __pyx_t_3 = __pyx_v_nlevels; + for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { + + /* "pandas/algos.pyx":1899 + * for i from 1 <= i < n: + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] # <<<<<<<<<<<<<< + * pre = vecs[k][i-1] + * if cur == pre: + */ + __pyx_v_cur = ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_i]); + + /* "pandas/algos.pyx":1900 + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] + * pre = vecs[k][i-1] # <<<<<<<<<<<<<< + * if cur == pre: + * continue + */ + __pyx_v_pre = ((__pyx_v_vecs[__pyx_v_k])[(__pyx_v_i - 1)]); + + /* "pandas/algos.pyx":1901 + * cur = vecs[k][i] + * pre = vecs[k][i-1] + * if cur == pre: # <<<<<<<<<<<<<< + * continue + * elif cur > pre: + */ + __pyx_t_4 = ((__pyx_v_cur == __pyx_v_pre) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1902 + * pre = vecs[k][i-1] + * if cur == pre: + * continue # <<<<<<<<<<<<<< + * elif cur > pre: + * break + */ + goto __pyx_L7_continue; + } + + /* "pandas/algos.pyx":1903 + * if cur == pre: + * continue + * elif cur > pre: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_4 = ((__pyx_v_cur > __pyx_v_pre) != 0); + if (__pyx_t_4) { + + /* "pandas/algos.pyx":1904 + * continue + * elif cur > pre: + * break # <<<<<<<<<<<<<< + * else: + * return False + */ + goto __pyx_L8_break; + } + /*else*/ { + + /* "pandas/algos.pyx":1906 + * break + * else: + * return False # <<<<<<<<<<<<<< + * free(vecs) + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L7_continue:; + } + __pyx_L8_break:; + } + + /* "pandas/algos.pyx":1907 + * else: + * return False + * free(vecs) # <<<<<<<<<<<<<< + * return True + * + */ + free(__pyx_v_vecs); + + /* "pandas/algos.pyx":1908 + * return False + * free(vecs) + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/algos.pyx":1879 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.algos.is_lexsorted", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1912 + * + * @cython.boundscheck(False) + * def groupby_indices(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_59groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_59groupby_indices = {__Pyx_NAMESTR("groupby_indices"), (PyCFunction)__pyx_pw_6pandas_5algos_59groupby_indices, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_59groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_indices (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_58groupby_indices(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_58groupby_indices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_seen = 0; + __pyx_t_5numpy_int64_t __pyx_v_loc; + PyObject *__pyx_v_ids = 0; + __pyx_t_5numpy_int64_t __pyx_v_k; + __pyx_t_5numpy_int64_t **__pyx_v_vecs; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_seen; + __Pyx_Buffer __pyx_pybuffer_seen; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + __pyx_t_5numpy_int64_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_indices", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_seen.pybuffer.buf = NULL; + __pyx_pybuffer_seen.refcount = 0; + __pyx_pybuffernd_seen.data = NULL; + __pyx_pybuffernd_seen.rcbuffer = &__pyx_pybuffer_seen; + + /* "pandas/algos.pyx":1914 + * def groupby_indices(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, counts, arr, seen + * int64_t loc + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/algos.pyx":1917 + * ndarray[int64_t] labels, counts, arr, seen + * int64_t loc + * dict ids = {} # <<<<<<<<<<<<<< + * object val + * int64_t k + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_ids = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1921 + * int64_t k + * + * ids, labels, counts = group_labels(values) # <<<<<<<<<<<<<< + * seen = np.zeros_like(counts) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_group_labels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = PyList_GET_ITEM(sequence, 2); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_ids, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_8 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1922 + * + * ids, labels, counts = group_labels(values) + * seen = np.zeros_like(counts) # <<<<<<<<<<<<<< + * + * # try not to get in trouble here... + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_counts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_counts)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seen.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seen.rcbuffer->pybuffer, (PyObject*)__pyx_v_seen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_seen.diminfo[0].strides = __pyx_pybuffernd_seen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_seen.diminfo[0].shape = __pyx_pybuffernd_seen.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_seen = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1925 + * + * # try not to get in trouble here... + * cdef int64_t **vecs = malloc(len(ids) * sizeof(int64_t*)) # <<<<<<<<<<<<<< + * result = {} + * for i from 0 <= i < len(counts): + */ + if (unlikely(__pyx_v_ids == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyDict_Size(__pyx_v_ids); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_t_1 * (sizeof(__pyx_t_5numpy_int64_t *))))); + + /* "pandas/algos.pyx":1926 + * # try not to get in trouble here... + * cdef int64_t **vecs = malloc(len(ids) * sizeof(int64_t*)) + * result = {} # <<<<<<<<<<<<<< + * for i from 0 <= i < len(counts): + * arr = np.empty(counts[i], dtype=np.int64) + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1927 + * cdef int64_t **vecs = malloc(len(ids) * sizeof(int64_t*)) + * result = {} + * for i from 0 <= i < len(counts): # <<<<<<<<<<<<<< + * arr = np.empty(counts[i], dtype=np.int64) + * result[ids[i]] = arr + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1928 + * result = {} + * for i from 0 <= i < len(counts): + * arr = np.empty(counts[i], dtype=np.int64) # <<<<<<<<<<<<<< + * result[ids[i]] = arr + * vecs[i] = arr.data + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __pyx_v_i; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_counts.diminfo[0].shape; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "pandas/algos.pyx":1929 + * for i from 0 <= i < len(counts): + * arr = np.empty(counts[i], dtype=np.int64) + * result[ids[i]] = arr # <<<<<<<<<<<<<< + * vecs[i] = arr.data + * + */ + if (unlikely(__pyx_v_ids == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_ids, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_2, ((PyObject *)__pyx_v_arr)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":1930 + * arr = np.empty(counts[i], dtype=np.int64) + * result[ids[i]] = arr + * vecs[i] = arr.data # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + (__pyx_v_vecs[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)__pyx_v_arr->data); + } + + /* "pandas/algos.pyx":1932 + * vecs[i] = arr.data + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * k = labels[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1933 + * + * for i from 0 <= i < n: + * k = labels[i] # <<<<<<<<<<<<<< + * + * # was NaN + */ + __pyx_t_14 = __pyx_v_i; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_labels.diminfo[0].shape; + __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/algos.pyx":1936 + * + * # was NaN + * if k == -1: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_15 = ((__pyx_v_k == -1) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":1937 + * # was NaN + * if k == -1: + * continue # <<<<<<<<<<<<<< + * + * loc = seen[k] + */ + goto __pyx_L7_continue; + } + + /* "pandas/algos.pyx":1939 + * continue + * + * loc = seen[k] # <<<<<<<<<<<<<< + * vecs[k][loc] = i + * seen[k] = loc + 1 + */ + __pyx_t_16 = __pyx_v_k; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_seen.diminfo[0].shape; + __pyx_v_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_seen.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_seen.diminfo[0].strides)); + + /* "pandas/algos.pyx":1940 + * + * loc = seen[k] + * vecs[k][loc] = i # <<<<<<<<<<<<<< + * seen[k] = loc + 1 + * + */ + ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_loc]) = __pyx_v_i; + + /* "pandas/algos.pyx":1941 + * loc = seen[k] + * vecs[k][loc] = i + * seen[k] = loc + 1 # <<<<<<<<<<<<<< + * + * free(vecs) + */ + __pyx_t_17 = __pyx_v_k; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_seen.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_seen.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_seen.diminfo[0].strides) = (__pyx_v_loc + 1); + __pyx_L7_continue:; + } + + /* "pandas/algos.pyx":1943 + * seen[k] = loc + 1 + * + * free(vecs) # <<<<<<<<<<<<<< + * + * return result + */ + free(__pyx_v_vecs); + + /* "pandas/algos.pyx":1945 + * free(vecs) + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/algos.pyx":1912 + * + * @cython.boundscheck(False) + * def groupby_indices(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_indices", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seen.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XDECREF((PyObject *)__pyx_v_seen); + __Pyx_XDECREF(__pyx_v_ids); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1949 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_labels(ndarray[object] values): # <<<<<<<<<<<<<< + * ''' + * Compute label vector from input values and associated useful data + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_61group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static char __pyx_doc_6pandas_5algos_60group_labels[] = "\n Compute label vector from input values and associated useful data\n\n Returns\n -------\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_61group_labels = {__Pyx_NAMESTR("group_labels"), (PyCFunction)__pyx_pw_6pandas_5algos_61group_labels, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_60group_labels)}; +static PyObject *__pyx_pw_6pandas_5algos_61group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_labels (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_60group_labels(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_60group_labels(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + PyArrayObject *__pyx_v_counts = 0; + PyObject *__pyx_v_ids = 0; + PyObject *__pyx_v_reverse = 0; + __pyx_t_5numpy_int64_t __pyx_v_idx; + PyObject *__pyx_v_val = 0; + __pyx_t_5numpy_int64_t __pyx_v_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + __pyx_t_5numpy_int64_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + __pyx_t_5numpy_int64_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + __pyx_t_5numpy_int64_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_labels", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1957 + * ''' + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * ndarray[int64_t] counts = np.empty(n, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/algos.pyx":1958 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * ndarray[int64_t] counts = np.empty(n, dtype=np.int64) + * dict ids = {}, reverse = {} + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/algos.pyx":1959 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * ndarray[int64_t] counts = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * dict ids = {}, reverse = {} + * int64_t idx + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_8 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1960 + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * ndarray[int64_t] counts = np.empty(n, dtype=np.int64) + * dict ids = {}, reverse = {} # <<<<<<<<<<<<<< + * int64_t idx + * object val + */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_ids = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_reverse = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1963 + * int64_t idx + * object val + * int64_t count = 0 # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_v_count = 0; + + /* "pandas/algos.pyx":1965 + * int64_t count = 0 + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/algos.pyx":1966 + * + * for i from 0 <= i < n: + * val = values[i] # <<<<<<<<<<<<<< + * + * # is NaN + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1969 + * + * # is NaN + * if val != val: # <<<<<<<<<<<<<< + * labels[i] = -1 + * continue + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_10) { + + /* "pandas/algos.pyx":1970 + * # is NaN + * if val != val: + * labels[i] = -1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_labels.diminfo[0].strides) = -1; + + /* "pandas/algos.pyx":1971 + * if val != val: + * labels[i] = -1 + * continue # <<<<<<<<<<<<<< + * + * # for large number of groups, not doing try: except: makes a big + */ + goto __pyx_L3_continue; + } + + /* "pandas/algos.pyx":1975 + * # for large number of groups, not doing try: except: makes a big + * # difference + * if val in ids: # <<<<<<<<<<<<<< + * idx = ids[val] + * labels[i] = idx + */ + __pyx_t_10 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_ids, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (__pyx_t_10 != 0); + if (__pyx_t_12) { + + /* "pandas/algos.pyx":1976 + * # difference + * if val in ids: + * idx = ids[val] # <<<<<<<<<<<<<< + * labels[i] = idx + * counts[idx] = counts[idx] + 1 + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ids, __pyx_v_val); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_idx = __pyx_t_13; + + /* "pandas/algos.pyx":1977 + * if val in ids: + * idx = ids[val] + * labels[i] = idx # <<<<<<<<<<<<<< + * counts[idx] = counts[idx] + 1 + * else: + */ + __pyx_t_14 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + + /* "pandas/algos.pyx":1978 + * idx = ids[val] + * labels[i] = idx + * counts[idx] = counts[idx] + 1 # <<<<<<<<<<<<<< + * else: + * ids[val] = count + */ + __pyx_t_13 = __pyx_v_idx; + __pyx_t_15 = __pyx_v_idx; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides)) + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/algos.pyx":1980 + * counts[idx] = counts[idx] + 1 + * else: + * ids[val] = count # <<<<<<<<<<<<<< + * reverse[count] = val + * labels[i] = count + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_ids, __pyx_v_val, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1981 + * else: + * ids[val] = count + * reverse[count] = val # <<<<<<<<<<<<<< + * labels[i] = count + * counts[count] = 1 + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_reverse, __pyx_t_5, __pyx_v_val) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1982 + * ids[val] = count + * reverse[count] = val + * labels[i] = count # <<<<<<<<<<<<<< + * counts[count] = 1 + * count += 1 + */ + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/algos.pyx":1983 + * reverse[count] = val + * labels[i] = count + * counts[count] = 1 # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_17 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = 1; + + /* "pandas/algos.pyx":1984 + * labels[i] = count + * counts[count] = 1 + * count += 1 # <<<<<<<<<<<<<< + * + * return reverse, labels, counts[:count].copy() + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/algos.pyx":1986 + * count += 1 + * + * return reverse, labels, counts[:count].copy() # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1949 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_labels(ndarray[object] values): # <<<<<<<<<<<<<< + * ''' + * Compute label vector from input values and associated useful data + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF(__pyx_v_ids); + __Pyx_XDECREF(__pyx_v_reverse); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":1991 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, loc, label, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_63groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_63groupsort_indexer = {__Pyx_NAMESTR("groupsort_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_63groupsort_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_63groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + Py_ssize_t __pyx_v_ngroups; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupsort_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_ngroups,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ngroups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupsort_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupsort_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupsort_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupsort_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_62groupsort_indexer(__pyx_self, __pyx_v_index, __pyx_v_ngroups); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_62groupsort_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, Py_ssize_t __pyx_v_ngroups) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_label; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_where = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_where; + __Pyx_Buffer __pyx_pybuffer_where; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + __pyx_t_5numpy_int64_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_5numpy_int64_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupsort_indexer", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_where.pybuffer.buf = NULL; + __pyx_pybuffer_where.refcount = 0; + __pyx_pybuffernd_where.data = NULL; + __pyx_pybuffernd_where.rcbuffer = &__pyx_pybuffer_where; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":1997 + * + * # count group sizes, location 0 for NA + * counts = np.zeros(ngroups + 1, dtype=np.int64) # <<<<<<<<<<<<<< + * n = len(index) + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_ngroups + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":1998 + * # count group sizes, location 0 for NA + * counts = np.zeros(ngroups + 1, dtype=np.int64) + * n = len(index) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * counts[index[i] + 1] += 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_11; + + /* "pandas/algos.pyx":1999 + * counts = np.zeros(ngroups + 1, dtype=np.int64) + * n = len(index) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * counts[index[i] + 1] += 1 + * + */ + __pyx_t_11 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/algos.pyx":2000 + * n = len(index) + * for i from 0 <= i < n: + * counts[index[i] + 1] += 1 # <<<<<<<<<<<<<< + * + * # mark the start of each contiguous group of like-indexed data + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_index.diminfo[0].strides)) + 1); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + } + + /* "pandas/algos.pyx":2003 + * + * # mark the start of each contiguous group of like-indexed data + * where = np.zeros(ngroups + 1, dtype=np.int64) # <<<<<<<<<<<<<< + * for i from 1 <= i < ngroups + 1: + * where[i] = where[i - 1] + counts[i - 1] + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_ngroups + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_where.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_where.rcbuffer->pybuffer, (PyObject*)__pyx_v_where, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_where.diminfo[0].strides = __pyx_pybuffernd_where.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_where.diminfo[0].shape = __pyx_pybuffernd_where.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_where = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/algos.pyx":2004 + * # mark the start of each contiguous group of like-indexed data + * where = np.zeros(ngroups + 1, dtype=np.int64) + * for i from 1 <= i < ngroups + 1: # <<<<<<<<<<<<<< + * where[i] = where[i - 1] + counts[i - 1] + * + */ + __pyx_t_11 = (__pyx_v_ngroups + 1); + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/algos.pyx":2005 + * where = np.zeros(ngroups + 1, dtype=np.int64) + * for i from 1 <= i < ngroups + 1: + * where[i] = where[i - 1] + counts[i - 1] # <<<<<<<<<<<<<< + * + * # this is our indexer + */ + __pyx_t_14 = (__pyx_v_i - 1); + __pyx_t_15 = (__pyx_v_i - 1); + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_where.diminfo[0].strides) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_where.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides))); + } + + /* "pandas/algos.pyx":2008 + * + * # this is our indexer + * result = np.zeros(n, dtype=np.int64) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * label = index[i] + 1 + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2009 + * # this is our indexer + * result = np.zeros(n, dtype=np.int64) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * label = index[i] + 1 + * result[where[label]] = i + */ + __pyx_t_11 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/algos.pyx":2010 + * result = np.zeros(n, dtype=np.int64) + * for i from 0 <= i < n: + * label = index[i] + 1 # <<<<<<<<<<<<<< + * result[where[label]] = i + * where[label] += 1 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_v_label = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)) + 1); + + /* "pandas/algos.pyx":2011 + * for i from 0 <= i < n: + * label = index[i] + 1 + * result[where[label]] = i # <<<<<<<<<<<<<< + * where[label] += 1 + * + */ + __pyx_t_18 = __pyx_v_label; + __pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_where.diminfo[0].strides)); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/algos.pyx":2012 + * label = index[i] + 1 + * result[where[label]] = i + * where[label] += 1 # <<<<<<<<<<<<<< + * + * return result, counts + */ + __pyx_t_20 = __pyx_v_label; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_where.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_where.diminfo[0].strides) += 1; + } + + /* "pandas/algos.pyx":2014 + * where[label] += 1 + * + * return result, counts # <<<<<<<<<<<<<< + * + * # TODO: aggregate multiple columns in single pass + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_counts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_counts)); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/algos.pyx":1991 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, loc, label, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupsort_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF((PyObject *)__pyx_v_where); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2022 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_65group_nth_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_64group_nth_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_65group_nth_object = {__Pyx_NAMESTR("group_nth_object"), (PyCFunction)__pyx_pw_6pandas_5algos_65group_nth_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_64group_nth_object)}; +static PyObject *__pyx_pw_6pandas_5algos_65group_nth_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_object", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_64group_nth_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_64group_nth_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_resx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + PyObject **__pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_object", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2037 + * ndarray[object, ndim=2] resx + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty(( out).shape, dtype=object) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":2038 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty(( out).shape, dtype=object) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2040 + * resx = np.empty(( out).shape, dtype=object) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_13; + __pyx_v_K = __pyx_t_14; + + /* "pandas/algos.pyx":2042 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_14 = __pyx_v_N; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":2043 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/algos.pyx":2044 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_16 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2045 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L5_continue; + } + + /* "pandas/algos.pyx":2047 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/algos.pyx":2048 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/algos.pyx":2049 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2052 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2053 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if nobs[lab, j] == rank: + * resx[lab, j] = val + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/algos.pyx":2054 + * if val == val: + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2055 + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = __pyx_v_j; + __pyx_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_28); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_28); + *__pyx_t_28 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_28); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L5_continue:; + } + + /* "pandas/algos.pyx":2057 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":2058 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/algos.pyx":2059 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2060 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + __pyx_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_28); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_28); + *__pyx_t_28 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_28); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/algos.pyx":2062 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_28 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_28); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_28); + *__pyx_t_28 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_28); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L16:; + } + } + + /* "pandas/algos.pyx":2022 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2066 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_67group_nth_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_66group_nth_bin_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_67group_nth_bin_object = {__Pyx_NAMESTR("group_nth_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_67group_nth_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_66group_nth_bin_object)}; +static PyObject *__pyx_pw_6pandas_5algos_67group_nth_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_bin_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_bin_object", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_66group_nth_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_66group_nth_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + PyObject *(*__pyx_t_16)(PyObject *); + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + PyObject **__pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_bin_object", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2080 + * ndarray[float64_t, ndim=2] nobs + * + * nobs = np.zeros(( out).shape, dtype=np.float64) # <<<<<<<<<<<<<< + * resx = np.empty(( out).shape, dtype=object) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":2081 + * + * nobs = np.zeros(( out).shape, dtype=np.float64) + * resx = np.empty(( out).shape, dtype=object) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2083 + * resx = np.empty(( out).shape, dtype=object) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__pyx_t_12 - 1); + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_14) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":2084 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_14; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":2086 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_14 + 1); + } + __pyx_L3:; + + /* "pandas/algos.pyx":2088 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_3 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_14; + __pyx_v_K = __pyx_t_12; + + /* "pandas/algos.pyx":2090 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/algos.pyx":2091 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/algos.pyx":2092 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_15 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_15) { + __pyx_t_17 = __pyx_v_b; + __pyx_t_18 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_19 = __pyx_t_18; + } else { + __pyx_t_19 = __pyx_t_15; + } + if (!__pyx_t_19) break; + + /* "pandas/algos.pyx":2093 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/algos.pyx":2095 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/algos.pyx":2096 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_21 = __pyx_v_K; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":2097 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2100 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2101 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if nobs[b, j] == rank: + * resx[b, j] = val + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/algos.pyx":2102 + * if val == val: + * nobs[b, j] += 1 + * if nobs[b, j] == rank: # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + __pyx_t_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2103 + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_31); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_31); + *__pyx_t_31 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_31); + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/algos.pyx":2105 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_12 = __pyx_v_ngroups; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/algos.pyx":2106 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_21 = __pyx_v_K; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":2107 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2108 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_31); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_31); + *__pyx_t_31 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_31); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/algos.pyx":2110 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + __pyx_t_31 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_31); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_31); + *__pyx_t_31 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_31); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L18:; + } + } + + /* "pandas/algos.pyx":2066 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2114 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_69group_last_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_68group_last_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_69group_last_object = {__Pyx_NAMESTR("group_last_object"), (PyCFunction)__pyx_pw_6pandas_5algos_69group_last_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_68group_last_object)}; +static PyObject *__pyx_pw_6pandas_5algos_69group_last_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_68group_last_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_68group_last_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + PyObject **__pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_object", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2128 + * ndarray[int64_t, ndim=2] nobs + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty(( out).shape, dtype=object) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":2129 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty(( out).shape, dtype=object) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2131 + * resx = np.empty(( out).shape, dtype=object) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_13; + __pyx_v_K = __pyx_t_14; + + /* "pandas/algos.pyx":2133 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_14 = __pyx_v_N; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":2134 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/algos.pyx":2135 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_16 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2136 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L5_continue; + } + + /* "pandas/algos.pyx":2138 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/algos.pyx":2139 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/algos.pyx":2140 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2143 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * resx[lab, j] = val + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2144 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/algos.pyx":2145 + * if val == val: + * nobs[lab, j] += 1 + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_26); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L5_continue:; + } + + /* "pandas/algos.pyx":2147 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/algos.pyx":2148 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/algos.pyx":2149 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/algos.pyx":2150 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/algos.pyx":2152 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L15:; + } + } + + /* "pandas/algos.pyx":2114 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2156 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_71group_last_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_70group_last_bin_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_71group_last_bin_object = {__Pyx_NAMESTR("group_last_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_71group_last_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_70group_last_bin_object)}; +static PyObject *__pyx_pw_6pandas_5algos_71group_last_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_bin_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_bin_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_70group_last_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_70group_last_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + PyObject *(*__pyx_t_16)(PyObject *); + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + PyObject **__pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_bin_object", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2170 + * ndarray[float64_t, ndim=2] nobs + * + * nobs = np.zeros(( out).shape, dtype=np.float64) # <<<<<<<<<<<<<< + * resx = np.empty(( out).shape, dtype=object) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/algos.pyx":2171 + * + * nobs = np.zeros(( out).shape, dtype=np.float64) + * resx = np.empty(( out).shape, dtype=object) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2173 + * resx = np.empty(( out).shape, dtype=object) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__pyx_t_12 - 1); + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_14) != 0); + if (__pyx_t_15) { + + /* "pandas/algos.pyx":2174 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_14; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/algos.pyx":2176 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_14 + 1); + } + __pyx_L3:; + + /* "pandas/algos.pyx":2178 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_3 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_14; + __pyx_v_K = __pyx_t_12; + + /* "pandas/algos.pyx":2180 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/algos.pyx":2181 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_12 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/algos.pyx":2182 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_15 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_15) { + __pyx_t_17 = __pyx_v_b; + __pyx_t_18 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_19 = __pyx_t_18; + } else { + __pyx_t_19 = __pyx_t_15; + } + if (!__pyx_t_19) break; + + /* "pandas/algos.pyx":2183 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/algos.pyx":2185 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/algos.pyx":2186 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_21 = __pyx_v_K; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":2187 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2190 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * resx[b, j] = val + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2191 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/algos.pyx":2192 + * if val == val: + * nobs[b, j] += 1 + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_29); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_29); + *__pyx_t_29 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_29); + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/algos.pyx":2194 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_12 = __pyx_v_ngroups; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_12; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/algos.pyx":2195 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_21 = __pyx_v_K; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_j = __pyx_t_22; + + /* "pandas/algos.pyx":2196 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + __pyx_t_19 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_19) { + + /* "pandas/algos.pyx":2197 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6pandas_5algos_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_29); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_29); + *__pyx_t_29 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_29); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/algos.pyx":2199 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_resx.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_29 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_29); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_29); + *__pyx_t_29 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_29); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L17:; + } + } + + /* "pandas/algos.pyx":2156 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2206 + * # median + * + * def group_median(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_73group_median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_72group_median[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_73group_median = {__Pyx_NAMESTR("group_median"), (PyCFunction)__pyx_pw_6pandas_5algos_73group_median, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_72group_median)}; +static PyObject *__pyx_pw_6pandas_5algos_73group_median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_median (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_median") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_72group_median(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_72group_median(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_size; + PyArrayObject *__pyx_v__counts = 0; + PyArrayObject *__pyx_v_data = 0; + __pyx_t_5numpy_float64_t *__pyx_v_ptr; + PyObject *__pyx_v_indexer = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd__counts; + __Pyx_Buffer __pyx_pybuffer__counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + long __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_median", 0); + __pyx_pybuffer__counts.pybuffer.buf = NULL; + __pyx_pybuffer__counts.refcount = 0; + __pyx_pybuffernd__counts.data = NULL; + __pyx_pybuffernd__counts.rcbuffer = &__pyx_pybuffer__counts; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/algos.pyx":2218 + * ndarray data + * float64_t* ptr + * ngroups = len(counts) # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_1; + + /* "pandas/algos.pyx":2219 + * float64_t* ptr + * ngroups = len(counts) + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * indexer, _counts = groupsort_indexer(labels, ngroups) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_1; + __pyx_v_K = __pyx_t_7; + + /* "pandas/algos.pyx":2221 + * N, K = ( values).shape + * + * indexer, _counts = groupsort_indexer(labels, ngroups) # <<<<<<<<<<<<<< + * counts[:] = _counts[1:] + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_indexer = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__counts.rcbuffer->pybuffer, (PyObject*)__pyx_v__counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd__counts.diminfo[0].strides = __pyx_pybuffernd__counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__counts.diminfo[0].shape = __pyx_pybuffernd__counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v__counts = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2222 + * + * indexer, _counts = groupsort_indexer(labels, ngroups) + * counts[:] = _counts[1:] # <<<<<<<<<<<<<< + * + * data = np.empty((K, N), dtype=np.float64) + */ + __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v__counts), 1, 0, NULL, NULL, &__pyx_slice__46, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_counts), __pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__47, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/algos.pyx":2224 + * counts[:] = _counts[1:] + * + * data = np.empty((K, N), dtype=np.float64) # <<<<<<<<<<<<<< + * ptr = data.data + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_data = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2225 + * + * data = np.empty((K, N), dtype=np.float64) + * ptr = data.data # <<<<<<<<<<<<<< + * + * take_2d_axis1_float64_float64(values.T, indexer, out=data) + */ + __pyx_v_ptr = ((__pyx_t_5numpy_float64_t *)__pyx_v_data->data); + + /* "pandas/algos.pyx":2227 + * ptr = data.data + * + * take_2d_axis1_float64_float64(values.T, indexer, out=data) # <<<<<<<<<<<<<< + * + * for i in range(K): + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_take_2d_axis1_float64_float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_T); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_indexer); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_indexer); + __Pyx_GIVEREF(__pyx_v_indexer); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_out, ((PyObject *)__pyx_v_data)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":2229 + * take_2d_axis1_float64_float64(values.T, indexer, out=data) + * + * for i in range(K): # <<<<<<<<<<<<<< + * # exclude NA group + * ptr += _counts[0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_7; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "pandas/algos.pyx":2231 + * for i in range(K): + * # exclude NA group + * ptr += _counts[0] # <<<<<<<<<<<<<< + * for j in range(ngroups): + * size = _counts[j + 1] + */ + __pyx_t_14 = 0; + __pyx_t_9 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd__counts.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd__counts.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ptr = (__pyx_v_ptr + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd__counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd__counts.diminfo[0].strides))); + + /* "pandas/algos.pyx":2232 + * # exclude NA group + * ptr += _counts[0] + * for j in range(ngroups): # <<<<<<<<<<<<<< + * size = _counts[j + 1] + * out[j, i] = _median_linear(ptr, size) + */ + __pyx_t_15 = __pyx_v_ngroups; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/algos.pyx":2233 + * ptr += _counts[0] + * for j in range(ngroups): + * size = _counts[j + 1] # <<<<<<<<<<<<<< + * out[j, i] = _median_linear(ptr, size) + * ptr += size + */ + __pyx_t_17 = (__pyx_v_j + 1); + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd__counts.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd__counts.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_size = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd__counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd__counts.diminfo[0].strides)); + + /* "pandas/algos.pyx":2234 + * for j in range(ngroups): + * size = _counts[j + 1] + * out[j, i] = _median_linear(ptr, size) # <<<<<<<<<<<<<< + * ptr += size + * + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_f_6pandas_5algos__median_linear(__pyx_v_ptr, __pyx_v_size); + + /* "pandas/algos.pyx":2235 + * size = _counts[j + 1] + * out[j, i] = _median_linear(ptr, size) + * ptr += size # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_ptr = (__pyx_v_ptr + __pyx_v_size); + } + } + + /* "pandas/algos.pyx":2206 + * # median + * + * def group_median(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v__counts); + __Pyx_XDECREF((PyObject *)__pyx_v_data); + __Pyx_XDECREF(__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/algos.pyx":2238 + * + * + * cdef inline float64_t _median_linear(float64_t* a, int n): # <<<<<<<<<<<<<< + * cdef int i, j, na_count = 0 + * cdef float64_t result + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_5algos__median_linear(__pyx_t_5numpy_float64_t *__pyx_v_a, int __pyx_v_n) { + int __pyx_v_i; + int __pyx_v_j; + int __pyx_v_na_count; + __pyx_t_5numpy_float64_t __pyx_v_result; + __pyx_t_5numpy_float64_t *__pyx_v_tmp; + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_median_linear", 0); + + /* "pandas/algos.pyx":2239 + * + * cdef inline float64_t _median_linear(float64_t* a, int n): + * cdef int i, j, na_count = 0 # <<<<<<<<<<<<<< + * cdef float64_t result + * cdef float64_t* tmp + */ + __pyx_v_na_count = 0; + + /* "pandas/algos.pyx":2244 + * + * # count NAs + * for i in range(n): # <<<<<<<<<<<<<< + * if a[i] != a[i]: + * na_count += 1 + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/algos.pyx":2245 + * # count NAs + * for i in range(n): + * if a[i] != a[i]: # <<<<<<<<<<<<<< + * na_count += 1 + * + */ + __pyx_t_3 = (((__pyx_v_a[__pyx_v_i]) != (__pyx_v_a[__pyx_v_i])) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2246 + * for i in range(n): + * if a[i] != a[i]: + * na_count += 1 # <<<<<<<<<<<<<< + * + * if na_count: + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/algos.pyx":2248 + * na_count += 1 + * + * if na_count: # <<<<<<<<<<<<<< + * if na_count == n: + * return NaN + */ + __pyx_t_3 = (__pyx_v_na_count != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2249 + * + * if na_count: + * if na_count == n: # <<<<<<<<<<<<<< + * return NaN + * + */ + __pyx_t_3 = ((__pyx_v_na_count == __pyx_v_n) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2250 + * if na_count: + * if na_count == n: + * return NaN # <<<<<<<<<<<<<< + * + * tmp = malloc((n - na_count) * sizeof(float64_t)) + */ + __pyx_r = __pyx_v_6pandas_5algos_NaN; + goto __pyx_L0; + } + + /* "pandas/algos.pyx":2252 + * return NaN + * + * tmp = malloc((n - na_count) * sizeof(float64_t)) # <<<<<<<<<<<<<< + * + * j = 0 + */ + __pyx_v_tmp = ((__pyx_t_5numpy_float64_t *)malloc(((__pyx_v_n - __pyx_v_na_count) * (sizeof(__pyx_t_5numpy_float64_t))))); + + /* "pandas/algos.pyx":2254 + * tmp = malloc((n - na_count) * sizeof(float64_t)) + * + * j = 0 # <<<<<<<<<<<<<< + * for i in range(n): + * if a[i] == a[i]: + */ + __pyx_v_j = 0; + + /* "pandas/algos.pyx":2255 + * + * j = 0 + * for i in range(n): # <<<<<<<<<<<<<< + * if a[i] == a[i]: + * tmp[j] = a[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/algos.pyx":2256 + * j = 0 + * for i in range(n): + * if a[i] == a[i]: # <<<<<<<<<<<<<< + * tmp[j] = a[i] + * j += 1 + */ + __pyx_t_3 = (((__pyx_v_a[__pyx_v_i]) == (__pyx_v_a[__pyx_v_i])) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2257 + * for i in range(n): + * if a[i] == a[i]: + * tmp[j] = a[i] # <<<<<<<<<<<<<< + * j += 1 + * + */ + (__pyx_v_tmp[__pyx_v_j]) = (__pyx_v_a[__pyx_v_i]); + + /* "pandas/algos.pyx":2258 + * if a[i] == a[i]: + * tmp[j] = a[i] + * j += 1 # <<<<<<<<<<<<<< + * + * a = tmp + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + + /* "pandas/algos.pyx":2260 + * j += 1 + * + * a = tmp # <<<<<<<<<<<<<< + * n -= na_count + * + */ + __pyx_v_a = __pyx_v_tmp; + + /* "pandas/algos.pyx":2261 + * + * a = tmp + * n -= na_count # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_n = (__pyx_v_n - __pyx_v_na_count); + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/algos.pyx":2264 + * + * + * if n % 2: # <<<<<<<<<<<<<< + * result = kth_smallest_c( a, n / 2, n) + * else: + */ + __pyx_t_3 = (__Pyx_mod_long(__pyx_v_n, 2) != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2265 + * + * if n % 2: + * result = kth_smallest_c( a, n / 2, n) # <<<<<<<<<<<<<< + * else: + * result = (kth_smallest_c(a, n / 2, n) + + */ + __pyx_t_4 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, __Pyx_div_long(__pyx_v_n, 2), __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_5; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/algos.pyx":2267 + * result = kth_smallest_c( a, n / 2, n) + * else: + * result = (kth_smallest_c(a, n / 2, n) + # <<<<<<<<<<<<<< + * kth_smallest_c(a, n / 2 - 1, n)) / 2 + * + */ + __pyx_t_4 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, __Pyx_div_long(__pyx_v_n, 2), __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/algos.pyx":2268 + * else: + * result = (kth_smallest_c(a, n / 2, n) + + * kth_smallest_c(a, n / 2 - 1, n)) / 2 # <<<<<<<<<<<<<< + * + * if na_count: + */ + __pyx_t_6 = __pyx_f_6pandas_5algos_kth_smallest_c(__pyx_v_a, (__Pyx_div_long(__pyx_v_n, 2) - 1), __pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/algos.pyx":2267 + * result = kth_smallest_c( a, n / 2, n) + * else: + * result = (kth_smallest_c(a, n / 2, n) + # <<<<<<<<<<<<<< + * kth_smallest_c(a, n / 2 - 1, n)) / 2 + * + */ + __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/algos.pyx":2268 + * else: + * result = (kth_smallest_c(a, n / 2, n) + + * kth_smallest_c(a, n / 2 - 1, n)) / 2 # <<<<<<<<<<<<<< + * + * if na_count: + */ + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_5; + } + __pyx_L11:; + + /* "pandas/algos.pyx":2270 + * kth_smallest_c(a, n / 2 - 1, n)) / 2 + * + * if na_count: # <<<<<<<<<<<<<< + * free(a) + * + */ + __pyx_t_3 = (__pyx_v_na_count != 0); + if (__pyx_t_3) { + + /* "pandas/algos.pyx":2271 + * + * if na_count: + * free(a) # <<<<<<<<<<<<<< + * + * return result + */ + free(__pyx_v_a); + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/algos.pyx":2273 + * free(a) + * + * return result # <<<<<<<<<<<<<< + * + * include "join.pyx" + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/algos.pyx":2238 + * + * + * cdef inline float64_t _median_linear(float64_t* a, int n): # <<<<<<<<<<<<<< + * cdef int i, j, na_count = 0 + * cdef float64_t result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_WriteUnraisable("pandas.algos._median_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":1 + * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_75inner_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_75inner_join = {__Pyx_NAMESTR("inner_join"), (PyCFunction)__pyx_pw_6pandas_5algos_75inner_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_75inner_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + Py_ssize_t __pyx_v_max_groups; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_74inner_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_74inner_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_count; + PyArrayObject *__pyx_v_left_count = 0; + PyArrayObject *__pyx_v_right_count = 0; + PyArrayObject *__pyx_v_left_sorter = 0; + PyArrayObject *__pyx_v_right_sorter = 0; + PyArrayObject *__pyx_v_left_indexer = 0; + PyArrayObject *__pyx_v_right_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_lc; + __pyx_t_5numpy_int64_t __pyx_v_rc; + Py_ssize_t __pyx_v_left_pos; + Py_ssize_t __pyx_v_right_pos; + Py_ssize_t __pyx_v_position; + Py_ssize_t __pyx_v_offset; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count; + __Pyx_Buffer __pyx_pybuffer_left_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer; + __Pyx_Buffer __pyx_pybuffer_left_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_sorter; + __Pyx_Buffer __pyx_pybuffer_left_sorter; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count; + __Pyx_Buffer __pyx_pybuffer_right_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer; + __Pyx_Buffer __pyx_pybuffer_right_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_sorter; + __Pyx_Buffer __pyx_pybuffer_right_sorter; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + long __pyx_t_18; + long __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyArrayObject *__pyx_t_21 = NULL; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join", 0); + __pyx_pybuffer_left_count.pybuffer.buf = NULL; + __pyx_pybuffer_left_count.refcount = 0; + __pyx_pybuffernd_left_count.data = NULL; + __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count; + __pyx_pybuffer_right_count.pybuffer.buf = NULL; + __pyx_pybuffer_right_count.refcount = 0; + __pyx_pybuffernd_right_count.data = NULL; + __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count; + __pyx_pybuffer_left_sorter.pybuffer.buf = NULL; + __pyx_pybuffer_left_sorter.refcount = 0; + __pyx_pybuffernd_left_sorter.data = NULL; + __pyx_pybuffernd_left_sorter.rcbuffer = &__pyx_pybuffer_left_sorter; + __pyx_pybuffer_right_sorter.pybuffer.buf = NULL; + __pyx_pybuffer_right_sorter.refcount = 0; + __pyx_pybuffernd_right_sorter.data = NULL; + __pyx_pybuffernd_right_sorter.rcbuffer = &__pyx_pybuffer_right_sorter; + __pyx_pybuffer_left_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_left_indexer.refcount = 0; + __pyx_pybuffernd_left_indexer.data = NULL; + __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer; + __pyx_pybuffer_right_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_right_indexer.refcount = 0; + __pyx_pybuffernd_right_indexer.data = NULL; + __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":4 + * Py_ssize_t max_groups): + * cdef: + * Py_ssize_t i, j, k, count = 0 # <<<<<<<<<<<<<< + * ndarray[int64_t] left_count, right_count, left_sorter, right_sorter + * ndarray[int64_t] left_indexer, right_indexer + */ + __pyx_v_count = 0; + + /* "pandas/src/join.pyx":11 + * # NA group in location 0 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) # <<<<<<<<<<<<<< + * right_sorter, right_count = groupsort_indexer(right, max_groups) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_sorter.diminfo[0].strides = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_sorter.diminfo[0].shape = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/join.pyx":12 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) + * right_sorter, right_count = groupsort_indexer(right, max_groups) # <<<<<<<<<<<<<< + * + * # First pass, determine size of result set, do not use the NA group + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_right_sorter.diminfo[0].strides = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_sorter.diminfo[0].shape = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":15 + * + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":16 + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":17 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc > 0 and lc > 0: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":19 + * rc = right_count[i] + * + * if rc > 0 and lc > 0: # <<<<<<<<<<<<<< + * count += lc * rc + * + */ + __pyx_t_15 = ((__pyx_v_rc > 0) != 0); + if (__pyx_t_15) { + __pyx_t_16 = ((__pyx_v_lc > 0) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_15; + } + if (__pyx_t_17) { + + /* "pandas/src/join.pyx":20 + * + * if rc > 0 and lc > 0: + * count += lc * rc # <<<<<<<<<<<<<< + * + * # group 0 is the NA group + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_lc * __pyx_v_rc)); + goto __pyx_L9; + } + __pyx_L9:; + } + + /* "pandas/src/join.pyx":24 + * # group 0 is the NA group + * cdef: + * Py_ssize_t loc, left_pos = 0, right_pos = 0, position = 0 # <<<<<<<<<<<<<< + * Py_ssize_t offset + * + */ + __pyx_v_left_pos = 0; + __pyx_v_right_pos = 0; + __pyx_v_position = 0; + + /* "pandas/src/join.pyx":28 + * + * # exclude the NA group + * left_pos = left_count[0] # <<<<<<<<<<<<<< + * right_pos = right_count[0] + * + */ + __pyx_t_18 = 0; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":29 + * # exclude the NA group + * left_pos = left_count[0] + * right_pos = right_count[0] # <<<<<<<<<<<<<< + * + * left_indexer = np.empty(count, dtype=np.int64) + */ + __pyx_t_19 = 0; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":31 + * right_pos = right_count[0] + * + * left_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * right_indexer = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":32 + * + * left_indexer = np.empty(count, dtype=np.int64) + * right_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(1, max_groups + 1): + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":34 + * right_indexer = np.empty(count, dtype=np.int64) + * + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":35 + * + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":36 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc > 0 and lc > 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":38 + * rc = right_count[i] + * + * if rc > 0 and lc > 0: # <<<<<<<<<<<<<< + * for j in range(lc): + * offset = position + j * rc + */ + __pyx_t_17 = ((__pyx_v_rc > 0) != 0); + if (__pyx_t_17) { + __pyx_t_15 = ((__pyx_v_lc > 0) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (__pyx_t_16) { + + /* "pandas/src/join.pyx":39 + * + * if rc > 0 and lc > 0: + * for j in range(lc): # <<<<<<<<<<<<<< + * offset = position + j * rc + * for k in range(rc): + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":40 + * if rc > 0 and lc > 0: + * for j in range(lc): + * offset = position + j * rc # <<<<<<<<<<<<<< + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + */ + __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc)); + + /* "pandas/src/join.pyx":41 + * for j in range(lc): + * offset = position + j * rc + * for k in range(rc): # <<<<<<<<<<<<<< + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + */ + __pyx_t_26 = __pyx_v_rc; + for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { + __pyx_v_k = __pyx_t_27; + + /* "pandas/src/join.pyx":42 + * offset = position + j * rc + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + */ + __pyx_t_28 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":43 + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k # <<<<<<<<<<<<<< + * position += lc * rc + * left_pos += lc + */ + __pyx_t_29 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k); + } + } + + /* "pandas/src/join.pyx":44 + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + * position += lc * rc # <<<<<<<<<<<<<< + * left_pos += lc + * right_pos += rc + */ + __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc)); + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/join.pyx":45 + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + * left_pos += lc # <<<<<<<<<<<<<< + * right_pos += rc + * + */ + __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc); + + /* "pandas/src/join.pyx":46 + * position += lc * rc + * left_pos += lc + * right_pos += rc # <<<<<<<<<<<<<< + * + * return (_get_result_indexer(left_sorter, left_indexer), + */ + __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc); + } + + /* "pandas/src/join.pyx":48 + * right_pos += rc + * + * return (_get_result_indexer(left_sorter, left_indexer), # <<<<<<<<<<<<<< + * _get_result_indexer(right_sorter, right_indexer)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer)); + PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":49 + * + * return (_get_result_indexer(left_sorter, left_indexer), + * _get_result_indexer(right_sorter, right_indexer)) # <<<<<<<<<<<<<< + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_right_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":48 + * right_pos += rc + * + * return (_get_result_indexer(left_sorter, left_indexer), # <<<<<<<<<<<<<< + * _get_result_indexer(right_sorter, right_indexer)) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/join.pyx":1 + * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_left_count); + __Pyx_XDECREF((PyObject *)__pyx_v_right_count); + __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_77left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_77left_outer_join = {__Pyx_NAMESTR("left_outer_join"), (PyCFunction)__pyx_pw_6pandas_5algos_77left_outer_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_77left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + Py_ssize_t __pyx_v_max_groups; + PyObject *__pyx_v_sort = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_outer_join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,&__pyx_n_s_sort,0}; + PyObject* values[4] = {0,0,0,0}; + + /* "pandas/src/join.pyx":52 + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, + * Py_ssize_t max_groups, sort=True): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, count = 0 + */ + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sort); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_outer_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sort = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_76left_outer_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups, __pyx_v_sort); + + /* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_76left_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups, PyObject *__pyx_v_sort) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_count; + PyArrayObject *__pyx_v_left_count = 0; + PyArrayObject *__pyx_v_right_count = 0; + PyArrayObject *__pyx_v_left_sorter = 0; + PyArrayObject *__pyx_v_right_sorter = 0; + PyArrayObject *__pyx_v_rev = 0; + PyArrayObject *__pyx_v_left_indexer = 0; + PyArrayObject *__pyx_v_right_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_lc; + __pyx_t_5numpy_int64_t __pyx_v_rc; + Py_ssize_t __pyx_v_left_pos; + Py_ssize_t __pyx_v_right_pos; + Py_ssize_t __pyx_v_position; + Py_ssize_t __pyx_v_offset; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count; + __Pyx_Buffer __pyx_pybuffer_left_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer; + __Pyx_Buffer __pyx_pybuffer_left_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count; + __Pyx_Buffer __pyx_pybuffer_right_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer; + __Pyx_Buffer __pyx_pybuffer_right_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + long __pyx_t_18; + long __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyArrayObject *__pyx_t_21 = NULL; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + int __pyx_t_32; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_outer_join", 0); + __pyx_pybuffer_left_count.pybuffer.buf = NULL; + __pyx_pybuffer_left_count.refcount = 0; + __pyx_pybuffernd_left_count.data = NULL; + __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count; + __pyx_pybuffer_right_count.pybuffer.buf = NULL; + __pyx_pybuffer_right_count.refcount = 0; + __pyx_pybuffernd_right_count.data = NULL; + __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count; + __pyx_pybuffer_left_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_left_indexer.refcount = 0; + __pyx_pybuffernd_left_indexer.data = NULL; + __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer; + __pyx_pybuffer_right_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_right_indexer.refcount = 0; + __pyx_pybuffernd_right_indexer.data = NULL; + __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":54 + * Py_ssize_t max_groups, sort=True): + * cdef: + * Py_ssize_t i, j, k, count = 0 # <<<<<<<<<<<<<< + * ndarray[int64_t] left_count, right_count + * ndarray left_sorter, right_sorter, rev + */ + __pyx_v_count = 0; + + /* "pandas/src/join.pyx":62 + * # NA group in location 0 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) # <<<<<<<<<<<<<< + * right_sorter, right_count = groupsort_indexer(right, max_groups) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/join.pyx":63 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) + * right_sorter, right_count = groupsort_indexer(right, max_groups) # <<<<<<<<<<<<<< + * + * # First pass, determine size of result set, do not use the NA group + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":66 + * + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * if right_count[i] > 0: + * count += left_count[i] * right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":67 + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): + * if right_count[i] > 0: # <<<<<<<<<<<<<< + * count += left_count[i] * right_count[i] + * else: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right_count.diminfo[0].strides)) > 0) != 0); + if (__pyx_t_14) { + + /* "pandas/src/join.pyx":68 + * for i in range(1, max_groups + 1): + * if right_count[i] > 0: + * count += left_count[i] * right_count[i] # <<<<<<<<<<<<<< + * else: + * count += left_count[i] + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_count = (__pyx_v_count + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_left_count.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_right_count.diminfo[0].strides)))); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/join.pyx":70 + * count += left_count[i] * right_count[i] + * else: + * count += left_count[i] # <<<<<<<<<<<<<< + * + * # group 0 is the NA group + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_count = (__pyx_v_count + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_left_count.diminfo[0].strides))); + } + __pyx_L9:; + } + + /* "pandas/src/join.pyx":74 + * # group 0 is the NA group + * cdef: + * Py_ssize_t loc, left_pos = 0, right_pos = 0, position = 0 # <<<<<<<<<<<<<< + * Py_ssize_t offset + * + */ + __pyx_v_left_pos = 0; + __pyx_v_right_pos = 0; + __pyx_v_position = 0; + + /* "pandas/src/join.pyx":78 + * + * # exclude the NA group + * left_pos = left_count[0] # <<<<<<<<<<<<<< + * right_pos = right_count[0] + * + */ + __pyx_t_18 = 0; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":79 + * # exclude the NA group + * left_pos = left_count[0] + * right_pos = right_count[0] # <<<<<<<<<<<<<< + * + * left_indexer = np.empty(count, dtype=np.int64) + */ + __pyx_t_19 = 0; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":81 + * right_pos = right_count[0] + * + * left_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * right_indexer = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":82 + * + * left_indexer = np.empty(count, dtype=np.int64) + * right_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(1, max_groups + 1): + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":84 + * right_indexer = np.empty(count, dtype=np.int64) + * + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":85 + * + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":86 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc == 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":88 + * rc = right_count[i] + * + * if rc == 0: # <<<<<<<<<<<<<< + * for j in range(lc): + * left_indexer[position + j] = left_pos + j + */ + __pyx_t_14 = ((__pyx_v_rc == 0) != 0); + if (__pyx_t_14) { + + /* "pandas/src/join.pyx":89 + * + * if rc == 0: + * for j in range(lc): # <<<<<<<<<<<<<< + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":90 + * if rc == 0: + * for j in range(lc): + * left_indexer[position + j] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[position + j] = -1 + * position += lc + */ + __pyx_t_26 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":91 + * for j in range(lc): + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 # <<<<<<<<<<<<<< + * position += lc + * else: + */ + __pyx_t_27 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = -1; + } + + /* "pandas/src/join.pyx":92 + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 + * position += lc # <<<<<<<<<<<<<< + * else: + * for j in range(lc): + */ + __pyx_v_position = (__pyx_v_position + __pyx_v_lc); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/join.pyx":94 + * position += lc + * else: + * for j in range(lc): # <<<<<<<<<<<<<< + * offset = position + j * rc + * for k in range(rc): + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":95 + * else: + * for j in range(lc): + * offset = position + j * rc # <<<<<<<<<<<<<< + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + */ + __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc)); + + /* "pandas/src/join.pyx":96 + * for j in range(lc): + * offset = position + j * rc + * for k in range(rc): # <<<<<<<<<<<<<< + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + */ + __pyx_t_28 = __pyx_v_rc; + for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { + __pyx_v_k = __pyx_t_29; + + /* "pandas/src/join.pyx":97 + * offset = position + j * rc + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + */ + __pyx_t_30 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":98 + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k # <<<<<<<<<<<<<< + * position += lc * rc + * left_pos += lc + */ + __pyx_t_31 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k); + } + } + + /* "pandas/src/join.pyx":99 + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + * position += lc * rc # <<<<<<<<<<<<<< + * left_pos += lc + * right_pos += rc + */ + __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc)); + } + __pyx_L12:; + + /* "pandas/src/join.pyx":100 + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + * left_pos += lc # <<<<<<<<<<<<<< + * right_pos += rc + * + */ + __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc); + + /* "pandas/src/join.pyx":101 + * position += lc * rc + * left_pos += lc + * right_pos += rc # <<<<<<<<<<<<<< + * + * left_indexer = _get_result_indexer(left_sorter, left_indexer) + */ + __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc); + } + + /* "pandas/src/join.pyx":103 + * right_pos += rc + * + * left_indexer = _get_result_indexer(left_sorter, left_indexer) # <<<<<<<<<<<<<< + * right_indexer = _get_result_indexer(right_sorter, right_indexer) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer)); + PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v_left_indexer, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/src/join.pyx":104 + * + * left_indexer = _get_result_indexer(left_sorter, left_indexer) + * right_indexer = _get_result_indexer(right_sorter, right_indexer) # <<<<<<<<<<<<<< + * + * if not sort: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter)); + PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_right_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer)); + PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_right_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v_right_indexer, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":106 + * right_indexer = _get_result_indexer(right_sorter, right_indexer) + * + * if not sort: # <<<<<<<<<<<<<< + * if left_sorter.dtype != np.int_: + * left_sorter = left_sorter.astype(np.int_) + */ + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_32 = ((!__pyx_t_14) != 0); + if (__pyx_t_32) { + + /* "pandas/src/join.pyx":107 + * + * if not sort: + * if left_sorter.dtype != np.int_: # <<<<<<<<<<<<<< + * left_sorter = left_sorter.astype(np.int_) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_32 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_32 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (__pyx_t_32) { + + /* "pandas/src/join.pyx":108 + * if not sort: + * if left_sorter.dtype != np.int_: + * left_sorter = left_sorter.astype(np.int_) # <<<<<<<<<<<<<< + * + * rev = np.empty(len(left), dtype=np.int_) + */ + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s_astype); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_left_sorter, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/src/join.pyx":110 + * left_sorter = left_sorter.astype(np.int_) + * + * rev = np.empty(len(left), dtype=np.int_) # <<<<<<<<<<<<<< + * rev.put(left_sorter, np.arange(len(left))) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_rev = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":111 + * + * rev = np.empty(len(left), dtype=np.int_) + * rev.put(left_sorter, np.arange(len(left))) # <<<<<<<<<<<<<< + * + * right_indexer = right_indexer.take(rev) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rev), __pyx_n_s_put); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":113 + * rev.put(left_sorter, np.arange(len(left))) + * + * right_indexer = right_indexer.take(rev) # <<<<<<<<<<<<<< + * left_indexer = left_indexer.take(rev) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_right_indexer), __pyx_n_s_take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_rev)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_rev)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rev)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v_right_indexer, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":114 + * + * right_indexer = right_indexer.take(rev) + * left_indexer = left_indexer.take(rev) # <<<<<<<<<<<<<< + * + * return left_indexer, right_indexer + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_left_indexer), __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_rev)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_rev)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rev)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v_left_indexer, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + goto __pyx_L19; + } + __pyx_L19:; + + /* "pandas/src/join.pyx":116 + * left_indexer = left_indexer.take(rev) + * + * return left_indexer, right_indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_left_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer)); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_left_count); + __Pyx_XDECREF((PyObject *)__pyx_v_right_count); + __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_rev); + __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":120 + * + * + * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_79full_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_79full_outer_join = {__Pyx_NAMESTR("full_outer_join"), (PyCFunction)__pyx_pw_6pandas_5algos_79full_outer_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_79full_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + Py_ssize_t __pyx_v_max_groups; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full_outer_join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_max_groups,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_groups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "full_outer_join") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.full_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_78full_outer_join(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_max_groups); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_78full_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, Py_ssize_t __pyx_v_max_groups) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_count; + PyArrayObject *__pyx_v_left_count = 0; + PyArrayObject *__pyx_v_right_count = 0; + PyArrayObject *__pyx_v_left_sorter = 0; + PyArrayObject *__pyx_v_right_sorter = 0; + PyArrayObject *__pyx_v_left_indexer = 0; + PyArrayObject *__pyx_v_right_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_lc; + __pyx_t_5numpy_int64_t __pyx_v_rc; + __pyx_t_5numpy_int64_t __pyx_v_left_pos; + __pyx_t_5numpy_int64_t __pyx_v_right_pos; + Py_ssize_t __pyx_v_offset; + Py_ssize_t __pyx_v_position; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_count; + __Pyx_Buffer __pyx_pybuffer_left_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_indexer; + __Pyx_Buffer __pyx_pybuffer_left_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left_sorter; + __Pyx_Buffer __pyx_pybuffer_left_sorter; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_count; + __Pyx_Buffer __pyx_pybuffer_right_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_indexer; + __Pyx_Buffer __pyx_pybuffer_right_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right_sorter; + __Pyx_Buffer __pyx_pybuffer_right_sorter; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + long __pyx_t_18; + long __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyArrayObject *__pyx_t_21 = NULL; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("full_outer_join", 0); + __pyx_pybuffer_left_count.pybuffer.buf = NULL; + __pyx_pybuffer_left_count.refcount = 0; + __pyx_pybuffernd_left_count.data = NULL; + __pyx_pybuffernd_left_count.rcbuffer = &__pyx_pybuffer_left_count; + __pyx_pybuffer_right_count.pybuffer.buf = NULL; + __pyx_pybuffer_right_count.refcount = 0; + __pyx_pybuffernd_right_count.data = NULL; + __pyx_pybuffernd_right_count.rcbuffer = &__pyx_pybuffer_right_count; + __pyx_pybuffer_left_sorter.pybuffer.buf = NULL; + __pyx_pybuffer_left_sorter.refcount = 0; + __pyx_pybuffernd_left_sorter.data = NULL; + __pyx_pybuffernd_left_sorter.rcbuffer = &__pyx_pybuffer_left_sorter; + __pyx_pybuffer_right_sorter.pybuffer.buf = NULL; + __pyx_pybuffer_right_sorter.refcount = 0; + __pyx_pybuffernd_right_sorter.data = NULL; + __pyx_pybuffernd_right_sorter.rcbuffer = &__pyx_pybuffer_right_sorter; + __pyx_pybuffer_left_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_left_indexer.refcount = 0; + __pyx_pybuffernd_left_indexer.data = NULL; + __pyx_pybuffernd_left_indexer.rcbuffer = &__pyx_pybuffer_left_indexer; + __pyx_pybuffer_right_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_right_indexer.refcount = 0; + __pyx_pybuffernd_right_indexer.data = NULL; + __pyx_pybuffernd_right_indexer.rcbuffer = &__pyx_pybuffer_right_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":123 + * Py_ssize_t max_groups): + * cdef: + * Py_ssize_t i, j, k, count = 0 # <<<<<<<<<<<<<< + * ndarray[int64_t] left_count, right_count, left_sorter, right_sorter + * ndarray[int64_t] left_indexer, right_indexer + */ + __pyx_v_count = 0; + + /* "pandas/src/join.pyx":130 + * # NA group in location 0 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) # <<<<<<<<<<<<<< + * right_sorter, right_count = groupsort_indexer(right, max_groups) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_sorter.diminfo[0].strides = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_sorter.diminfo[0].shape = __pyx_pybuffernd_left_sorter.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_left_count.diminfo[0].strides = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_count.diminfo[0].shape = __pyx_pybuffernd_left_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/join.pyx":131 + * + * left_sorter, left_count = groupsort_indexer(left, max_groups) + * right_sorter, right_count = groupsort_indexer(right, max_groups) # <<<<<<<<<<<<<< + * + * # First pass, determine size of result set, do not use the NA group + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_right_sorter.diminfo[0].strides = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_sorter.diminfo[0].shape = __pyx_pybuffernd_right_sorter.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_count.diminfo[0].strides = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_count.diminfo[0].shape = __pyx_pybuffernd_right_count.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":134 + * + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":135 + * # First pass, determine size of result set, do not use the NA group + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":136 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc > 0 and lc > 0: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":138 + * rc = right_count[i] + * + * if rc > 0 and lc > 0: # <<<<<<<<<<<<<< + * count += lc * rc + * else: + */ + __pyx_t_15 = ((__pyx_v_rc > 0) != 0); + if (__pyx_t_15) { + __pyx_t_16 = ((__pyx_v_lc > 0) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_15; + } + if (__pyx_t_17) { + + /* "pandas/src/join.pyx":139 + * + * if rc > 0 and lc > 0: + * count += lc * rc # <<<<<<<<<<<<<< + * else: + * count += lc + rc + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_lc * __pyx_v_rc)); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/join.pyx":141 + * count += lc * rc + * else: + * count += lc + rc # <<<<<<<<<<<<<< + * + * # group 0 is the NA group + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_lc + __pyx_v_rc)); + } + __pyx_L9:; + } + + /* "pandas/src/join.pyx":145 + * # group 0 is the NA group + * cdef: + * int64_t left_pos = 0, right_pos = 0 # <<<<<<<<<<<<<< + * Py_ssize_t offset, position = 0 + * + */ + __pyx_v_left_pos = 0; + __pyx_v_right_pos = 0; + + /* "pandas/src/join.pyx":146 + * cdef: + * int64_t left_pos = 0, right_pos = 0 + * Py_ssize_t offset, position = 0 # <<<<<<<<<<<<<< + * + * # exclude the NA group + */ + __pyx_v_position = 0; + + /* "pandas/src/join.pyx":149 + * + * # exclude the NA group + * left_pos = left_count[0] # <<<<<<<<<<<<<< + * right_pos = right_count[0] + * + */ + __pyx_t_18 = 0; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":150 + * # exclude the NA group + * left_pos = left_count[0] + * right_pos = right_count[0] # <<<<<<<<<<<<<< + * + * left_indexer = np.empty(count, dtype=np.int64) + */ + __pyx_t_19 = 0; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":152 + * right_pos = right_count[0] + * + * left_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * right_indexer = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_left_indexer.diminfo[0].strides = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_indexer.diminfo[0].shape = __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":153 + * + * left_indexer = np.empty(count, dtype=np.int64) + * right_indexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(1, max_groups + 1): + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_right_indexer.diminfo[0].strides = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_indexer.diminfo[0].shape = __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = 0; + __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":155 + * right_indexer = np.empty(count, dtype=np.int64) + * + * for i in range(1, max_groups + 1): # <<<<<<<<<<<<<< + * lc = left_count[i] + * rc = right_count[i] + */ + __pyx_t_11 = (__pyx_v_max_groups + 1); + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":156 + * + * for i in range(1, max_groups + 1): + * lc = left_count[i] # <<<<<<<<<<<<<< + * rc = right_count[i] + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left_count.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_count.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":157 + * for i in range(1, max_groups + 1): + * lc = left_count[i] + * rc = right_count[i] # <<<<<<<<<<<<<< + * + * if rc == 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_right_count.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_right_count.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_right_count.diminfo[0].strides)); + + /* "pandas/src/join.pyx":159 + * rc = right_count[i] + * + * if rc == 0: # <<<<<<<<<<<<<< + * for j in range(lc): + * left_indexer[position + j] = left_pos + j + */ + __pyx_t_17 = ((__pyx_v_rc == 0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/join.pyx":160 + * + * if rc == 0: + * for j in range(lc): # <<<<<<<<<<<<<< + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":161 + * if rc == 0: + * for j in range(lc): + * left_indexer[position + j] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[position + j] = -1 + * position += lc + */ + __pyx_t_26 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":162 + * for j in range(lc): + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 # <<<<<<<<<<<<<< + * position += lc + * elif lc == 0: + */ + __pyx_t_27 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = -1; + } + + /* "pandas/src/join.pyx":163 + * left_indexer[position + j] = left_pos + j + * right_indexer[position + j] = -1 + * position += lc # <<<<<<<<<<<<<< + * elif lc == 0: + * for j in range(rc): + */ + __pyx_v_position = (__pyx_v_position + __pyx_v_lc); + goto __pyx_L12; + } + + /* "pandas/src/join.pyx":164 + * right_indexer[position + j] = -1 + * position += lc + * elif lc == 0: # <<<<<<<<<<<<<< + * for j in range(rc): + * left_indexer[position + j] = -1 + */ + __pyx_t_17 = ((__pyx_v_lc == 0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/join.pyx":165 + * position += lc + * elif lc == 0: + * for j in range(rc): # <<<<<<<<<<<<<< + * left_indexer[position + j] = -1 + * right_indexer[position + j] = right_pos + j + */ + __pyx_t_24 = __pyx_v_rc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":166 + * elif lc == 0: + * for j in range(rc): + * left_indexer[position + j] = -1 # <<<<<<<<<<<<<< + * right_indexer[position + j] = right_pos + j + * position += rc + */ + __pyx_t_28 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/join.pyx":167 + * for j in range(rc): + * left_indexer[position + j] = -1 + * right_indexer[position + j] = right_pos + j # <<<<<<<<<<<<<< + * position += rc + * else: + */ + __pyx_t_29 = (__pyx_v_position + __pyx_v_j); + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_j); + } + + /* "pandas/src/join.pyx":168 + * left_indexer[position + j] = -1 + * right_indexer[position + j] = right_pos + j + * position += rc # <<<<<<<<<<<<<< + * else: + * for j in range(lc): + */ + __pyx_v_position = (__pyx_v_position + __pyx_v_rc); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/join.pyx":170 + * position += rc + * else: + * for j in range(lc): # <<<<<<<<<<<<<< + * offset = position + j * rc + * for k in range(rc): + */ + __pyx_t_24 = __pyx_v_lc; + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { + __pyx_v_j = __pyx_t_25; + + /* "pandas/src/join.pyx":171 + * else: + * for j in range(lc): + * offset = position + j * rc # <<<<<<<<<<<<<< + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + */ + __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc)); + + /* "pandas/src/join.pyx":172 + * for j in range(lc): + * offset = position + j * rc + * for k in range(rc): # <<<<<<<<<<<<<< + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + */ + __pyx_t_30 = __pyx_v_rc; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_k = __pyx_t_31; + + /* "pandas/src/join.pyx":173 + * offset = position + j * rc + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j # <<<<<<<<<<<<<< + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + */ + __pyx_t_32 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_left_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_left_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left_indexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_left_indexer.diminfo[0].strides) = (__pyx_v_left_pos + __pyx_v_j); + + /* "pandas/src/join.pyx":174 + * for k in range(rc): + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k # <<<<<<<<<<<<<< + * position += lc * rc + * left_pos += lc + */ + __pyx_t_33 = (__pyx_v_offset + __pyx_v_k); + __pyx_t_7 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_right_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_right_indexer.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right_indexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_right_indexer.diminfo[0].strides) = (__pyx_v_right_pos + __pyx_v_k); + } + } + + /* "pandas/src/join.pyx":175 + * left_indexer[offset + k] = left_pos + j + * right_indexer[offset + k] = right_pos + k + * position += lc * rc # <<<<<<<<<<<<<< + * left_pos += lc + * right_pos += rc + */ + __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc)); + } + __pyx_L12:; + + /* "pandas/src/join.pyx":176 + * right_indexer[offset + k] = right_pos + k + * position += lc * rc + * left_pos += lc # <<<<<<<<<<<<<< + * right_pos += rc + * + */ + __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc); + + /* "pandas/src/join.pyx":177 + * position += lc * rc + * left_pos += lc + * right_pos += rc # <<<<<<<<<<<<<< + * + * return (_get_result_indexer(left_sorter, left_indexer), + */ + __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc); + } + + /* "pandas/src/join.pyx":179 + * right_pos += rc + * + * return (_get_result_indexer(left_sorter, left_indexer), # <<<<<<<<<<<<<< + * _get_result_indexer(right_sorter, right_indexer)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter)); + PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer)); + PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + + /* "pandas/src/join.pyx":180 + * + * return (_get_result_indexer(left_sorter, left_indexer), + * _get_result_indexer(right_sorter, right_indexer)) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_result_indexer); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_right_sorter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter)); + __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/join.pyx":179 + * right_pos += rc + * + * return (_get_result_indexer(left_sorter, left_indexer), # <<<<<<<<<<<<<< + * _get_result_indexer(right_sorter, right_indexer)) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/join.pyx":120 + * + * + * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.full_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_sorter.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_count.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_sorter.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_left_count); + __Pyx_XDECREF((PyObject *)__pyx_v_right_count); + __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter); + __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":184 + * + * + * def _get_result_indexer(sorter, indexer): # <<<<<<<<<<<<<< + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_81_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_81_get_result_indexer = {__Pyx_NAMESTR("_get_result_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_81_get_result_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_81_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_sorter = 0; + PyObject *__pyx_v_indexer = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_result_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sorter,&__pyx_n_s_indexer,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sorter)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_get_result_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_result_indexer") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_sorter = values[0]; + __pyx_v_indexer = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_result_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos._get_result_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5algos_80_get_result_indexer(__pyx_self, __pyx_v_sorter, __pyx_v_indexer); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_80_get_result_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sorter, PyObject *__pyx_v_indexer) { + PyObject *__pyx_v_res = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_result_indexer", 0); + __Pyx_INCREF(__pyx_v_indexer); + + /* "pandas/src/join.pyx":185 + * + * def _get_result_indexer(sorter, indexer): + * if indexer.dtype != np.int_: # <<<<<<<<<<<<<< + * indexer = indexer.astype(np.int_) + * if len(sorter) > 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_indexer, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "pandas/src/join.pyx":186 + * def _get_result_indexer(sorter, indexer): + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) # <<<<<<<<<<<<<< + * if len(sorter) > 0: + * res = sorter.take(indexer) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_indexer, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_indexer, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/join.pyx":187 + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + * if len(sorter) > 0: # <<<<<<<<<<<<<< + * res = sorter.take(indexer) + * np.putmask(res, indexer == -1, -1) + */ + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_t_5 > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/src/join.pyx":188 + * indexer = indexer.astype(np.int_) + * if len(sorter) > 0: + * res = sorter.take(indexer) # <<<<<<<<<<<<<< + * np.putmask(res, indexer == -1, -1) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sorter, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_indexer); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_indexer); + __Pyx_GIVEREF(__pyx_v_indexer); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_res = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/join.pyx":189 + * if len(sorter) > 0: + * res = sorter.take(indexer) + * np.putmask(res, indexer == -1, -1) # <<<<<<<<<<<<<< + * else: + * # length-0 case + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_v_indexer, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/join.pyx":192 + * else: + * # length-0 case + * res = np.empty(len(indexer), dtype=np.int64) # <<<<<<<<<<<<<< + * res.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_indexer); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_res = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/src/join.pyx":193 + * # length-0 case + * res = np.empty(len(indexer), dtype=np.int64) + * res.fill(-1) # <<<<<<<<<<<<<< + * + * return res + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_fill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "pandas/src/join.pyx":195 + * res.fill(-1) + * + * return res # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "pandas/src/join.pyx":184 + * + * + * def _get_result_indexer(sorter, indexer): # <<<<<<<<<<<<<< + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.algos._get_result_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF(__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":199 + * + * + * def ffill_indexer(ndarray[int64_t] indexer): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indexer) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_83ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_83ffill_indexer = {__Pyx_NAMESTR("ffill_indexer"), (PyCFunction)__pyx_pw_6pandas_5algos_83ffill_indexer, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_83ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ffill_indexer (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_82ffill_indexer(__pyx_self, ((PyArrayObject *)__pyx_v_indexer)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_82ffill_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_int64_t __pyx_v_val; + __pyx_t_5numpy_int64_t __pyx_v_last_obs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ffill_indexer", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":201 + * def ffill_indexer(ndarray[int64_t] indexer): + * cdef: + * Py_ssize_t i, n = len(indexer) # <<<<<<<<<<<<<< + * ndarray[int64_t] result + * int64_t val, last_obs + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/join.pyx":205 + * int64_t val, last_obs + * + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * last_obs = -1 + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/join.pyx":206 + * + * result = np.empty(n, dtype=np.int64) + * last_obs = -1 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_last_obs = -1; + + /* "pandas/src/join.pyx":208 + * last_obs = -1 + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = indexer[i] + * if val == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":209 + * + * for i in range(n): + * val = indexer[i] # <<<<<<<<<<<<<< + * if val == -1: + * result[i] = last_obs + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/join.pyx":210 + * for i in range(n): + * val = indexer[i] + * if val == -1: # <<<<<<<<<<<<<< + * result[i] = last_obs + * else: + */ + __pyx_t_14 = ((__pyx_v_val == -1) != 0); + if (__pyx_t_14) { + + /* "pandas/src/join.pyx":211 + * val = indexer[i] + * if val == -1: + * result[i] = last_obs # <<<<<<<<<<<<<< + * else: + * result[i] = val + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_last_obs; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/join.pyx":213 + * result[i] = last_obs + * else: + * result[i] = val # <<<<<<<<<<<<<< + * last_obs = val + * + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val; + + /* "pandas/src/join.pyx":214 + * else: + * result[i] = val + * last_obs = val # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_last_obs = __pyx_v_val; + } + __pyx_L5:; + } + + /* "pandas/src/join.pyx":216 + * last_obs = val + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/join.pyx":199 + * + * + * def ffill_indexer(ndarray[int64_t] indexer): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indexer) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.ffill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/join.pyx":219 + * + * + * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids, # <<<<<<<<<<<<<< + * int64_t max_group): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_85ffill_by_group(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_85ffill_by_group = {__Pyx_NAMESTR("ffill_by_group"), (PyCFunction)__pyx_pw_6pandas_5algos_85ffill_by_group, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_85ffill_by_group(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_group_ids = 0; + __pyx_t_5numpy_int64_t __pyx_v_max_group; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ffill_by_group (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indexer,&__pyx_n_s_group_ids,&__pyx_n_s_max_group,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_group_ids)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_group)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ffill_by_group") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_indexer = ((PyArrayObject *)values[0]); + __pyx_v_group_ids = ((PyArrayObject *)values[1]); + __pyx_v_max_group = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_max_group == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.ffill_by_group", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_group_ids), __pyx_ptype_5numpy_ndarray, 1, "group_ids", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_84ffill_by_group(__pyx_self, __pyx_v_indexer, __pyx_v_group_ids, __pyx_v_max_group); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_84ffill_by_group(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_group_ids, __pyx_t_5numpy_int64_t __pyx_v_max_group) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_last_obs = 0; + __pyx_t_5numpy_int64_t __pyx_v_gid; + __pyx_t_5numpy_int64_t __pyx_v_val; + __Pyx_LocalBuf_ND __pyx_pybuffernd_group_ids; + __Pyx_Buffer __pyx_pybuffer_group_ids; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_last_obs; + __Pyx_Buffer __pyx_pybuffer_last_obs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_5numpy_int64_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ffill_by_group", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_last_obs.pybuffer.buf = NULL; + __pyx_pybuffer_last_obs.refcount = 0; + __pyx_pybuffernd_last_obs.data = NULL; + __pyx_pybuffernd_last_obs.rcbuffer = &__pyx_pybuffer_last_obs; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_group_ids.pybuffer.buf = NULL; + __pyx_pybuffer_group_ids.refcount = 0; + __pyx_pybuffernd_group_ids.data = NULL; + __pyx_pybuffernd_group_ids.rcbuffer = &__pyx_pybuffer_group_ids; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_group_ids.rcbuffer->pybuffer, (PyObject*)__pyx_v_group_ids, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_group_ids.diminfo[0].strides = __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_group_ids.diminfo[0].shape = __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/join.pyx":222 + * int64_t max_group): + * cdef: + * Py_ssize_t i, n = len(indexer) # <<<<<<<<<<<<<< + * ndarray[int64_t] result, last_obs + * int64_t gid, val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/join.pyx":226 + * int64_t gid, val + * + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * last_obs = np.empty(max_group, dtype=np.int64) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/join.pyx":228 + * result = np.empty(n, dtype=np.int64) + * + * last_obs = np.empty(max_group, dtype=np.int64) # <<<<<<<<<<<<<< + * last_obs.fill(-1) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_max_group); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer, (PyObject*)__pyx_v_last_obs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_last_obs.diminfo[0].strides = __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_last_obs.diminfo[0].shape = __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_last_obs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/join.pyx":229 + * + * last_obs = np.empty(max_group, dtype=np.int64) + * last_obs.fill(-1) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_last_obs), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/join.pyx":231 + * last_obs.fill(-1) + * + * for i in range(n): # <<<<<<<<<<<<<< + * gid = group_ids[i] + * val = indexer[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/join.pyx":232 + * + * for i in range(n): + * gid = group_ids[i] # <<<<<<<<<<<<<< + * val = indexer[i] + * if val == -1: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_group_ids.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_group_ids.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_gid = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_group_ids.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_group_ids.diminfo[0].strides)); + + /* "pandas/src/join.pyx":233 + * for i in range(n): + * gid = group_ids[i] + * val = indexer[i] # <<<<<<<<<<<<<< + * if val == -1: + * result[i] = last_obs[gid] + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/join.pyx":234 + * gid = group_ids[i] + * val = indexer[i] + * if val == -1: # <<<<<<<<<<<<<< + * result[i] = last_obs[gid] + * else: + */ + __pyx_t_15 = ((__pyx_v_val == -1) != 0); + if (__pyx_t_15) { + + /* "pandas/src/join.pyx":235 + * val = indexer[i] + * if val == -1: + * result[i] = last_obs[gid] # <<<<<<<<<<<<<< + * else: + * result[i] = val + */ + __pyx_t_16 = __pyx_v_gid; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_last_obs.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_last_obs.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_last_obs.diminfo[0].strides)); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/join.pyx":237 + * result[i] = last_obs[gid] + * else: + * result[i] = val # <<<<<<<<<<<<<< + * last_obs[gid] = val + * + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val; + + /* "pandas/src/join.pyx":238 + * else: + * result[i] = val + * last_obs[gid] = val # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_19 = __pyx_v_gid; + __pyx_t_8 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_last_obs.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_last_obs.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_last_obs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_last_obs.diminfo[0].strides) = __pyx_v_val; + } + __pyx_L5:; + } + + /* "pandas/src/join.pyx":240 + * last_obs[gid] = val + * + * return result # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/join.pyx":219 + * + * + * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids, # <<<<<<<<<<<<<< + * int64_t max_group): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_group_ids.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.ffill_by_group", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_group_ids.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_obs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_last_obs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":43 + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num + * + * cpdef ensure_platform_int(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == PLATFORM_INT: + */ + +static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_platform_int(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_platform_int", 0); + + /* "pandas/src/generated.pyx":44 + * + * cpdef ensure_platform_int(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == PLATFORM_INT: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":45 + * cpdef ensure_platform_int(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == PLATFORM_INT: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == __pyx_v_6pandas_5algos_PLATFORM_INT) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":46 + * if util.is_array(arr): + * if ( arr).descr.type_num == PLATFORM_INT: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":48 + * return arr + * else: + * return arr.astype(np.int_) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int_) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":50 + * return arr.astype(np.int_) + * else: + * return np.array(arr, dtype=np.int_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":43 + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num + * + * cpdef ensure_platform_int(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == PLATFORM_INT: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_platform_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_87ensure_platform_int(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_platform_int (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_86ensure_platform_int(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_86ensure_platform_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_platform_int", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_platform_int(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_platform_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":54 + * + * + * cpdef ensure_float64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT64: + */ + +static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_float64(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_float64", 0); + + /* "pandas/src/generated.pyx":55 + * + * cpdef ensure_float64(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_FLOAT64: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":56 + * cpdef ensure_float64(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT64: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_FLOAT64) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":57 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT64: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.float64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":59 + * return arr + * else: + * return arr.astype(np.float64) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.float64) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":61 + * return arr.astype(np.float64) + * else: + * return np.array(arr, dtype=np.float64) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":54 + * + * + * cpdef ensure_float64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT64: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_89ensure_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_float64 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_88ensure_float64(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_88ensure_float64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_float64", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_float64(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":64 + * + * + * cpdef ensure_float32(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT32: + */ + +static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_float32(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_float32", 0); + + /* "pandas/src/generated.pyx":65 + * + * cpdef ensure_float32(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_FLOAT32: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":66 + * cpdef ensure_float32(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT32: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_FLOAT32) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":67 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT32: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.float32) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":69 + * return arr + * else: + * return arr.astype(np.float32) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.float32) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":71 + * return arr.astype(np.float32) + * else: + * return np.array(arr, dtype=np.float32) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":64 + * + * + * cpdef ensure_float32(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_FLOAT32: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_91ensure_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_float32 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_90ensure_float32(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_90ensure_float32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_float32", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_float32(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":74 + * + * + * cpdef ensure_int8(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT8: + */ + +static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int8(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int8", 0); + + /* "pandas/src/generated.pyx":75 + * + * cpdef ensure_int8(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT8: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":76 + * cpdef ensure_int8(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT8: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT8) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":77 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT8: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int8) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":79 + * return arr + * else: + * return arr.astype(np.int8) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int8) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":81 + * return arr.astype(np.int8) + * else: + * return np.array(arr, dtype=np.int8) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":74 + * + * + * cpdef ensure_int8(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT8: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_93ensure_int8(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_int8 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_92ensure_int8(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_92ensure_int8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int8", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int8(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":84 + * + * + * cpdef ensure_int16(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT16: + */ + +static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int16(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int16", 0); + + /* "pandas/src/generated.pyx":85 + * + * cpdef ensure_int16(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT16: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":86 + * cpdef ensure_int16(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT16: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT16) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":87 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT16: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int16) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":89 + * return arr + * else: + * return arr.astype(np.int16) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int16) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":91 + * return arr.astype(np.int16) + * else: + * return np.array(arr, dtype=np.int16) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":84 + * + * + * cpdef ensure_int16(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT16: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_95ensure_int16(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_int16 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_94ensure_int16(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_94ensure_int16(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int16", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int16(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":94 + * + * + * cpdef ensure_int32(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT32: + */ + +static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int32(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int32", 0); + + /* "pandas/src/generated.pyx":95 + * + * cpdef ensure_int32(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT32: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":96 + * cpdef ensure_int32(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT32: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT32) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":97 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT32: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int32) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":99 + * return arr + * else: + * return arr.astype(np.int32) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int32) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":101 + * return arr.astype(np.int32) + * else: + * return np.array(arr, dtype=np.int32) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":94 + * + * + * cpdef ensure_int32(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT32: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_97ensure_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_int32 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_96ensure_int32(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_96ensure_int32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int32", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int32(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":104 + * + * + * cpdef ensure_int64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + */ + +static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_int64(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int64", 0); + + /* "pandas/src/generated.pyx":105 + * + * cpdef ensure_int64(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT64: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":106 + * cpdef ensure_int64(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT64) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":107 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":109 + * return arr + * else: + * return arr.astype(np.int64) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":111 + * return arr.astype(np.int64) + * else: + * return np.array(arr, dtype=np.int64) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":104 + * + * + * cpdef ensure_int64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_99ensure_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_int64 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_98ensure_int64(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_98ensure_int64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_int64", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_int64(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":114 + * + * + * cpdef ensure_object(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_OBJECT: + */ + +static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_ensure_object(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_object", 0); + + /* "pandas/src/generated.pyx":115 + * + * cpdef ensure_object(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_OBJECT: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":116 + * cpdef ensure_object(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_OBJECT: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_OBJECT) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":117 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_OBJECT: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.object_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/generated.pyx":119 + * return arr + * else: + * return arr.astype(np.object_) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.object_) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/generated.pyx":121 + * return arr.astype(np.object_) + * else: + * return np.array(arr, dtype=np.object_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":114 + * + * + * cpdef ensure_object(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_OBJECT: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.algos.ensure_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_5algos_101ensure_object(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ensure_object (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5algos_100ensure_object(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_100ensure_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ensure_object", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_ensure_object(__pyx_v_arr, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.algos.ensure_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_float64(ndarray[float64_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_float64(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_float64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":137 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":139 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":141 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":142 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":144 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_float64(ndarray[float64_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_102map_indices_float64[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_103map_indices_float64(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_float64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_102map_indices_float64(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_102map_indices_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_float64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_float64(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_float32(ndarray[float32_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_float32(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_float32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":159 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":161 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":163 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":164 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":166 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_float32(ndarray[float32_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_104map_indices_float32[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_105map_indices_float32(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_float32 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_104map_indices_float32(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_104map_indices_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_float32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_float32(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":170 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_object(ndarray[object] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_object(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_object", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":181 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":183 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":185 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":186 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_4, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":188 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":170 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_object(ndarray[object] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_106map_indices_object[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_107map_indices_object(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_object (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_106map_indices_object(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_106map_indices_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_object", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_object(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":192 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_int32(ndarray[int32_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_int32(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_int32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":203 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":205 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":207 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":208 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":210 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":192 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_int32(ndarray[int32_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_108map_indices_int32[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_109map_indices_int32(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_int32 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_108map_indices_int32(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_108map_indices_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_int32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_int32(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":214 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_int64(ndarray[int64_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_int64(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_int64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":225 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":227 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":229 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":230 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":232 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":214 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_int64(ndarray[int64_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_110map_indices_int64[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_111map_indices_int64(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_int64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_110map_indices_int64(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_110map_indices_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_int64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_int64(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":236 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_bool(ndarray[uint8_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_5algos_map_indices_bool(PyArrayObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_bool", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":247 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":249 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":251 + * length = len(index) + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":252 + * + * for i in range(length): + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_5, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":254 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":236 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * cpdef map_indices_bool(ndarray[uint8_t] index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_5algos_112map_indices_bool[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_5algos_113map_indices_bool(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_bool (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_112map_indices_bool(__pyx_self, ((PyArrayObject *)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_112map_indices_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_bool", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5algos_map_indices_bool(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.map_indices_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_115pad_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_115pad_float64 = {__Pyx_NAMESTR("pad_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_115pad_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_115pad_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":260 + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_114pad_float64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_114pad_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float64_t __pyx_v_cur; + __pyx_t_5numpy_float64_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_float64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":264 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef float64_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":266 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":267 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":268 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":269 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":271 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":272 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":274 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":275 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":276 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":278 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":279 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":281 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":283 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":285 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":286 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":288 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":289 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":290 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":292 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":293 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":294 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":295 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":296 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":297 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":298 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":299 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":300 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":302 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":304 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":305 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":306 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":307 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":308 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":309 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":310 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":312 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":313 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":314 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":316 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_117pad_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_117pad_float32 = {__Pyx_NAMESTR("pad_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_117pad_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_117pad_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":321 + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_116pad_float32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_116pad_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float32_t __pyx_v_cur; + __pyx_t_5numpy_float32_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_float32_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":325 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef float32_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":327 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":328 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":329 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":330 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":332 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":333 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":335 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":336 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":337 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":339 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":340 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":342 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":344 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":346 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":347 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":349 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":350 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":351 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":353 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":354 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":355 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":356 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":357 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":358 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":359 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":360 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":361 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":363 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":365 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":366 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":367 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":368 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":369 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":370 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":371 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":373 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":374 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":375 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":377 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_119pad_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_119pad_object = {__Pyx_NAMESTR("pad_object"), (PyCFunction)__pyx_pw_6pandas_5algos_119pad_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_119pad_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":382 + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_118pad_object(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_118pad_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + PyObject *__pyx_v_cur = 0; + PyObject *__pyx_v_next = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":386 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef object cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":388 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":389 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":390 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":391 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":393 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":394 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":396 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":397 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":398 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":400 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = (__pyx_v_nleft == 0); + if (!__pyx_t_13) { + __pyx_t_12 = (__pyx_v_nright == 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_14 = 0; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":401 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":403 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":405 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_v_cur = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":407 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = (__pyx_v_j <= (__pyx_v_nright - 1)); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":408 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":410 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":411 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":412 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":414 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":415 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":416 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":417 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":418 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_16) { + __pyx_t_12 = (__pyx_v_fill_count < __pyx_v_lim); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":419 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":420 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":421 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":422 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":424 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_next, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":426 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = (__pyx_v_j < __pyx_v_nright); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_cur, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_PyObject_IsTrue(__pyx_t_4)) { + __Pyx_DECREF(__pyx_t_4); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_next, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":427 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":428 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":429 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":430 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":431 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":432 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":434 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":435 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":436 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __Pyx_INCREF(__pyx_v_next); + __Pyx_DECREF_SET(__pyx_v_cur, __pyx_v_next); + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":438 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF(__pyx_v_cur); + __Pyx_XDECREF(__pyx_v_next); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_121pad_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_121pad_int32 = {__Pyx_NAMESTR("pad_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_121pad_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_121pad_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":443 + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_120pad_int32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_120pad_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int32_t __pyx_v_cur; + __pyx_t_5numpy_int32_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int32_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":447 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef int32_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":449 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":450 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":451 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":452 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":454 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":455 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":457 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":458 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":459 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":461 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":462 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":464 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":466 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":468 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":469 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":471 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":472 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":473 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":475 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":476 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":477 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":478 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":479 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":480 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":481 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":482 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":483 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":485 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":487 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":488 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":489 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":490 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":491 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":492 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":493 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":495 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":496 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":497 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":499 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_123pad_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_123pad_int64 = {__Pyx_NAMESTR("pad_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_123pad_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_123pad_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":504 + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_122pad_int64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_122pad_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_cur; + __pyx_t_5numpy_int64_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":508 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef int64_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":510 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":511 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":512 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":513 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":515 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":516 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":518 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":519 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":520 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":522 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":523 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":525 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":527 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":529 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":530 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":532 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":533 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":534 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":536 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":537 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":538 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":539 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":540 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":541 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":542 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":543 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":544 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":546 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":548 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":549 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":550 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":551 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":552 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":553 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":554 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":556 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":557 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":558 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":560 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_125pad_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_125pad_bool = {__Pyx_NAMESTR("pad_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_125pad_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_125pad_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":565 + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_124pad_bool(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_124pad_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_uint8_t __pyx_v_cur; + __pyx_t_5numpy_uint8_t __pyx_v_next; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_uint8_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_bool", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":569 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef uint8_t cur, next + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":571 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":572 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":573 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":574 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":576 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":577 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":579 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":580 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":581 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":583 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_1 = (__pyx_v_nright - 1); + __pyx_t_14 = 0; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_new.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":584 + * + * if nleft == 0 or nright == 0 or new[nright - 1] < old[0]: + * return indexer # <<<<<<<<<<<<<< + * + * i = j = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":586 + * return indexer + * + * i = j = 0 # <<<<<<<<<<<<<< + * + * cur = old[0] + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":588 + * i = j = 0 + * + * cur = old[0] # <<<<<<<<<<<<<< + * + * while j <= nright - 1 and new[j] < cur: + */ + __pyx_t_17 = 0; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":590 + * cur = old[0] + * + * while j <= nright - 1 and new[j] < cur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j <= (__pyx_v_nright - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":591 + * + * while j <= nright - 1 and new[j] < cur: + * j += 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":593 + * j += 1 + * + * while True: # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":594 + * + * while True: + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":595 + * while True: + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * if i == nleft - 1: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":597 + * break + * + * if i == nleft - 1: # <<<<<<<<<<<<<< + * while j < nright: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":598 + * + * if i == nleft - 1: + * while j < nright: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":599 + * if i == nleft - 1: + * while j < nright: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":600 + * while j < nright: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":601 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":602 + * indexer[j] = i + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":603 + * elif new[j] > cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":604 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":605 + * fill_count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * + * next = old[i + 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":607 + * break + * + * next = old[i + 1] # <<<<<<<<<<<<<< + * + * while j < nright and cur <= new[j] < next: + */ + __pyx_t_23 = (__pyx_v_i + 1); + __pyx_v_next = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":609 + * next = old[i + 1] + * + * while j < nright and cur <= new[j] < next: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_cur <= __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 < __pyx_v_next); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":610 + * + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":611 + * while j < nright and cur <= new[j] < next: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":612 + * if new[j] == cur: + * indexer[j] = i + * elif fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":613 + * indexer[j] = i + * elif fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j += 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":614 + * elif fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":615 + * indexer[j] = i + * fill_count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":617 + * j += 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i += 1 + * cur = next + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":618 + * + * fill_count = 0 + * i += 1 # <<<<<<<<<<<<<< + * cur = next + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":619 + * fill_count = 0 + * i += 1 + * cur = next # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_next; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":621 + * cur = next + * + * return indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_127backfill_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_127backfill_float64 = {__Pyx_NAMESTR("backfill_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_127backfill_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_127backfill_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":627 + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_126backfill_float64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_126backfill_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float64_t __pyx_v_cur; + __pyx_t_5numpy_float64_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_float64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":631 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef float64_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":633 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":634 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":635 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":636 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":638 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":639 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":641 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":642 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":643 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":645 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":646 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":648 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":649 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":651 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":653 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":654 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":656 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":657 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":658 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":660 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":661 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":662 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":663 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":664 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":665 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":666 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":667 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":668 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":670 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":672 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":673 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":674 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":675 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":676 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":677 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":678 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":680 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":681 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":682 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":684 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_129backfill_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_129backfill_float32 = {__Pyx_NAMESTR("backfill_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_129backfill_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_129backfill_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":689 + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_128backfill_float32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_128backfill_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float32_t __pyx_v_cur; + __pyx_t_5numpy_float32_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_float32_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":693 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef float32_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":695 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":696 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":697 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":698 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":700 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":701 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":703 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":704 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":705 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":707 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":708 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":710 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":711 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":713 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":715 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":716 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":718 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":719 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":720 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":722 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":723 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":724 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":725 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":726 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":727 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":728 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":729 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":730 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":732 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":734 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":735 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":736 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":737 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":738 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":739 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":740 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":742 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":743 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":744 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":746 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_131backfill_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_131backfill_object = {__Pyx_NAMESTR("backfill_object"), (PyCFunction)__pyx_pw_6pandas_5algos_131backfill_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_131backfill_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":751 + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_130backfill_object(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_130backfill_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + PyObject *__pyx_v_cur = 0; + PyObject *__pyx_v_prev = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":755 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef object cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":757 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":758 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":759 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":760 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":762 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":763 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":765 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":766 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":767 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":769 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = (__pyx_v_nleft == 0); + if (!__pyx_t_13) { + __pyx_t_12 = (__pyx_v_nright == 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":770 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":772 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":773 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":775 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_v_cur = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":777 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = (__pyx_v_j >= 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":778 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":780 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":781 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":782 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":784 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":785 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":786 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":787 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":788 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_16) { + __pyx_t_12 = (__pyx_v_fill_count < __pyx_v_lim); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":789 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":790 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":791 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":792 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":794 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_prev, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":796 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = (__pyx_v_j >= 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_prev, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_PyObject_IsTrue(__pyx_t_4)) { + __Pyx_DECREF(__pyx_t_4); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":797 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_cur, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":798 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":799 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_new.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_cur, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_12) { + __pyx_t_13 = (__pyx_v_fill_count < __pyx_v_lim); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":800 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":801 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":802 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":804 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":805 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":806 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __Pyx_INCREF(__pyx_v_prev); + __Pyx_DECREF_SET(__pyx_v_cur, __pyx_v_prev); + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":808 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF(__pyx_v_cur); + __Pyx_XDECREF(__pyx_v_prev); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_133backfill_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_133backfill_int32 = {__Pyx_NAMESTR("backfill_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_133backfill_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_133backfill_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":813 + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_132backfill_int32(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_132backfill_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int32_t __pyx_v_cur; + __pyx_t_5numpy_int32_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int32_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":817 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef int32_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":819 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":820 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":821 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":822 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":824 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":825 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":827 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":828 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":829 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":831 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":832 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":834 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":835 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":837 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":839 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":840 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":842 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":843 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":844 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":846 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":847 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":848 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":849 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":850 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":851 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":852 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":853 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":854 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":856 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":858 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":859 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":860 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":861 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":862 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":863 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":864 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":866 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":867 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":868 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":870 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_135backfill_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_135backfill_int64 = {__Pyx_NAMESTR("backfill_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_135backfill_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_135backfill_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":875 + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_134backfill_int64(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_134backfill_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_cur; + __pyx_t_5numpy_int64_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":879 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef int64_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":881 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":882 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":883 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":884 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":886 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":887 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":889 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":890 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":891 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":893 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":894 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":896 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":897 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":899 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":901 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":902 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":904 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":905 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":906 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":908 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":909 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":910 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":911 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":912 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":913 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":914 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":915 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":916 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":918 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":920 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":921 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":922 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":923 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":924 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":925 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":926 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":928 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":929 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":930 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":932 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_137backfill_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_137backfill_bool = {__Pyx_NAMESTR("backfill_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_137backfill_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_137backfill_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_old = 0; + PyArrayObject *__pyx_v_new = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old,&__pyx_n_s_new,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":937 + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, nleft, nright + * cdef ndarray[int64_t, ndim=1] indexer + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_old = ((PyArrayObject *)values[0]); + __pyx_v_new = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old), __pyx_ptype_5numpy_ndarray, 1, "old", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new), __pyx_ptype_5numpy_ndarray, 1, "new", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_136backfill_bool(__pyx_self, __pyx_v_old, __pyx_v_new, __pyx_v_limit); + + /* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_136backfill_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_old, PyArrayObject *__pyx_v_new, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_uint8_t __pyx_v_cur; + __pyx_t_5numpy_uint8_t __pyx_v_prev; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new; + __Pyx_Buffer __pyx_pybuffer_new; + __Pyx_LocalBuf_ND __pyx_pybuffernd_old; + __Pyx_Buffer __pyx_pybuffer_old; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + __pyx_t_5numpy_uint8_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_bool", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_old.pybuffer.buf = NULL; + __pyx_pybuffer_old.refcount = 0; + __pyx_pybuffernd_old.data = NULL; + __pyx_pybuffernd_old.rcbuffer = &__pyx_pybuffer_old; + __pyx_pybuffer_new.pybuffer.buf = NULL; + __pyx_pybuffer_new.refcount = 0; + __pyx_pybuffernd_new.data = NULL; + __pyx_pybuffernd_new.rcbuffer = &__pyx_pybuffer_new; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_old.rcbuffer->pybuffer, (PyObject*)__pyx_v_old, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_old.diminfo[0].strides = __pyx_pybuffernd_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_old.diminfo[0].shape = __pyx_pybuffernd_old.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new.rcbuffer->pybuffer, (PyObject*)__pyx_v_new, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_new.diminfo[0].strides = __pyx_pybuffernd_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new.diminfo[0].shape = __pyx_pybuffernd_new.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":941 + * cdef ndarray[int64_t, ndim=1] indexer + * cdef uint8_t cur, prev + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * nleft = len(old) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":943 + * cdef int lim, fill_count = 0 + * + * nleft = len(old) # <<<<<<<<<<<<<< + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_old)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":944 + * + * nleft = len(old) + * nright = len(new) # <<<<<<<<<<<<<< + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_new)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":945 + * nleft = len(old) + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) # <<<<<<<<<<<<<< + * indexer.fill(-1) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":946 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":948 + * indexer.fill(-1) + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = nright + * else: + */ + __pyx_t_12 = (__pyx_v_limit == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":949 + * + * if limit is None: + * lim = nright # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_nright; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":951 + * lim = nright + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":952 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":953 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + */ + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_8; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":955 + * lim = limit + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_t_13 = ((__pyx_v_nleft == 0) != 0); + if (!__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_nright == 0) != 0); + if (!__pyx_t_12) { + __pyx_t_14 = 0; + __pyx_t_1 = (__pyx_v_nleft - 1); + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_new.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_old.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":956 + * + * if nleft == 0 or nright == 0 or new[0] > old[nleft - 1]: + * return indexer # <<<<<<<<<<<<<< + * + * i = nleft - 1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":958 + * return indexer + * + * i = nleft - 1 # <<<<<<<<<<<<<< + * j = nright - 1 + * + */ + __pyx_v_i = (__pyx_v_nleft - 1); + + /* "pandas/src/generated.pyx":959 + * + * i = nleft - 1 + * j = nright - 1 # <<<<<<<<<<<<<< + * + * cur = old[nleft - 1] + */ + __pyx_v_j = (__pyx_v_nright - 1); + + /* "pandas/src/generated.pyx":961 + * j = nright - 1 + * + * cur = old[nleft - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and new[j] > cur: + */ + __pyx_t_17 = (__pyx_v_nleft - 1); + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":963 + * cur = old[nleft - 1] + * + * while j >= 0 and new[j] > cur: # <<<<<<<<<<<<<< + * j -= 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_12) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_new.diminfo[0].strides)) > __pyx_v_cur) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":964 + * + * while j >= 0 and new[j] > cur: + * j -= 1 # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":966 + * j -= 1 + * + * while True: # <<<<<<<<<<<<<< + * if j < 0: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":967 + * + * while True: + * if j < 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j < 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":968 + * while True: + * if j < 0: + * break # <<<<<<<<<<<<<< + * + * if i == 0: + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":970 + * break + * + * if i == 0: # <<<<<<<<<<<<<< + * while j >= 0: + * if new[j] == cur: + */ + __pyx_t_16 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":971 + * + * if i == 0: + * while j >= 0: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_16 = ((__pyx_v_j >= 0) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":972 + * if i == 0: + * while j >= 0: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":973 + * while j >= 0: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L14; + } + + /* "pandas/src/generated.pyx":974 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_16) { + __pyx_t_12 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":975 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":976 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * break + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":977 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":978 + * fill_count += 1 + * j -= 1 + * break # <<<<<<<<<<<<<< + * + * prev = old[i - 1] + */ + goto __pyx_L9_break; + } + + /* "pandas/src/generated.pyx":980 + * break + * + * prev = old[i - 1] # <<<<<<<<<<<<<< + * + * while j >= 0 and prev < new[j] <= cur: + */ + __pyx_t_23 = (__pyx_v_i - 1); + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_old.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_old.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":982 + * prev = old[i - 1] + * + * while j >= 0 and prev < new[j] <= cur: # <<<<<<<<<<<<<< + * if new[j] == cur: + * indexer[j] = i + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_13) { + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_new.diminfo[0].strides)); + __pyx_t_16 = (__pyx_v_prev < __pyx_t_25); + if (__pyx_t_16) { + __pyx_t_16 = (__pyx_t_25 <= __pyx_v_cur); + } + __pyx_t_12 = (__pyx_t_16 != 0); + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/src/generated.pyx":983 + * + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: # <<<<<<<<<<<<<< + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_new.diminfo[0].strides)) == __pyx_v_cur) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":984 + * while j >= 0 and prev < new[j] <= cur: + * if new[j] == cur: + * indexer[j] = i # <<<<<<<<<<<<<< + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + */ + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L17; + } + + /* "pandas/src/generated.pyx":985 + * if new[j] == cur: + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: # <<<<<<<<<<<<<< + * indexer[j] = i + * fill_count += 1 + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_new.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_new.diminfo[0].strides)) < __pyx_v_cur) != 0); + if (__pyx_t_12) { + __pyx_t_13 = ((__pyx_v_fill_count < __pyx_v_lim) != 0); + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":986 + * indexer[j] = i + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i # <<<<<<<<<<<<<< + * fill_count += 1 + * j -= 1 + */ + __pyx_t_29 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":987 + * elif new[j] < cur and fill_count < lim: + * indexer[j] = i + * fill_count += 1 # <<<<<<<<<<<<<< + * j -= 1 + * + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/generated.pyx":988 + * indexer[j] = i + * fill_count += 1 + * j -= 1 # <<<<<<<<<<<<<< + * + * fill_count = 0 + */ + __pyx_v_j = (__pyx_v_j - 1); + } + + /* "pandas/src/generated.pyx":990 + * j -= 1 + * + * fill_count = 0 # <<<<<<<<<<<<<< + * i -= 1 + * cur = prev + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":991 + * + * fill_count = 0 + * i -= 1 # <<<<<<<<<<<<<< + * cur = prev + * + */ + __pyx_v_i = (__pyx_v_i - 1); + + /* "pandas/src/generated.pyx":992 + * fill_count = 0 + * i -= 1 + * cur = prev # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_v_cur = __pyx_v_prev; + } + __pyx_L9_break:; + + /* "pandas/src/generated.pyx":994 + * cur = prev + * + * return indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_old.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_139pad_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_139pad_inplace_float64 = {__Pyx_NAMESTR("pad_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_139pad_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_139pad_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1001 + * def pad_inplace_float64(ndarray[float64_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef float64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_138pad_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_138pad_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1004 + * cdef Py_ssize_t i, N + * cdef float64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1006 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1009 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1010 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1012 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1013 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1015 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1016 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1017 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1019 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1020 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1021 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1022 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1023 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1024 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1025 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1027 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1028 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_141pad_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_141pad_inplace_float32 = {__Pyx_NAMESTR("pad_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_141pad_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_141pad_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1034 + * def pad_inplace_float32(ndarray[float32_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef float32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_140pad_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_140pad_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_float32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1037 + * cdef Py_ssize_t i, N + * cdef float32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1039 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1042 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1043 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1045 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1046 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1048 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1049 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1050 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1052 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1053 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1054 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1055 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1056 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1057 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1058 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1060 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1061 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_143pad_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_143pad_inplace_object = {__Pyx_NAMESTR("pad_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_143pad_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_143pad_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1067 + * def pad_inplace_object(ndarray[object] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef object val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_142pad_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_142pad_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyObject *__pyx_v_val = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1070 + * cdef Py_ssize_t i, N + * cdef object val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1072 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1075 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1076 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1078 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1079 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1081 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1082 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1083 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1085 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_v_val = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":1086 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1087 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1088 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1089 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1090 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1091 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1093 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1094 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_145pad_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_145pad_inplace_int32 = {__Pyx_NAMESTR("pad_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_145pad_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_145pad_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1100 + * def pad_inplace_int32(ndarray[int32_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef int32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_144pad_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_144pad_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1103 + * cdef Py_ssize_t i, N + * cdef int32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1105 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1108 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1109 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1111 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1112 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1114 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1115 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1116 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1118 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1119 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1120 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1121 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1122 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1123 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1124 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1126 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1127 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_147pad_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_147pad_inplace_int64 = {__Pyx_NAMESTR("pad_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_147pad_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_147pad_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1133 + * def pad_inplace_int64(ndarray[int64_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef int64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_146pad_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_146pad_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1136 + * cdef Py_ssize_t i, N + * cdef int64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1138 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1141 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1142 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1144 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1145 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1147 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1148 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1149 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1151 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1152 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1153 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1154 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1155 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1156 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1157 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1159 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1160 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_149pad_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_149pad_inplace_bool = {__Pyx_NAMESTR("pad_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_149pad_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_149pad_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_inplace_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1166 + * def pad_inplace_bool(ndarray[uint8_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef uint8_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_148pad_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_148pad_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_uint8_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + long __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_inplace_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1169 + * cdef Py_ssize_t i, N + * cdef uint8_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1171 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1174 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1175 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1177 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1178 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1180 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1181 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1182 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[0] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1184 + * lim = limit + * + * val = values[0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[i]: + */ + __pyx_t_6 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1185 + * + * val = values[0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":1186 + * val = values[0] + * for i in range(N): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1187 + * for i in range(N): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1188 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1189 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1190 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_9 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1192 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1193 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_151backfill_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_151backfill_inplace_float64 = {__Pyx_NAMESTR("backfill_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_151backfill_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_151backfill_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1200 + * def backfill_inplace_float64(ndarray[float64_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef float64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_150backfill_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_150backfill_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1203 + * cdef Py_ssize_t i, N + * cdef float64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1205 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1208 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1209 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1211 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1212 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1214 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1215 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1216 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1218 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1219 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1220 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1221 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1222 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1223 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1224 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1226 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1227 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_153backfill_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_153backfill_inplace_float32 = {__Pyx_NAMESTR("backfill_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_153backfill_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_153backfill_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1232 + * def backfill_inplace_float32(ndarray[float32_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef float32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_152backfill_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_152backfill_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_float32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1235 + * cdef Py_ssize_t i, N + * cdef float32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1237 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1240 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1241 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1243 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1244 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1246 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1247 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1248 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1250 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1251 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1252 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1253 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1254 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1255 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1256 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1258 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1259 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_155backfill_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_155backfill_inplace_object = {__Pyx_NAMESTR("backfill_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_155backfill_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_155backfill_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1264 + * def backfill_inplace_object(ndarray[object] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef object val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_154backfill_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_154backfill_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + PyObject *__pyx_v_val = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject **__pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1267 + * cdef Py_ssize_t i, N + * cdef object val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1269 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1272 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1273 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1275 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1276 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1278 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1279 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1280 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1282 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_v_val = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":1283 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1284 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1285 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1286 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1287 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1288 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_9); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_9); + *__pyx_t_9 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_9); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1290 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1291 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_157backfill_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_157backfill_inplace_int32 = {__Pyx_NAMESTR("backfill_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_157backfill_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_157backfill_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1296 + * def backfill_inplace_int32(ndarray[int32_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef int32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_156backfill_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_156backfill_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1299 + * cdef Py_ssize_t i, N + * cdef int32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1301 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1304 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1305 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1307 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1308 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1310 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1311 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1312 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1314 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1315 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1316 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1317 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1318 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1319 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1320 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1322 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1323 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_159backfill_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_159backfill_inplace_int64 = {__Pyx_NAMESTR("backfill_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_159backfill_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_159backfill_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1328 + * def backfill_inplace_int64(ndarray[int64_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef int64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_158backfill_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_158backfill_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1331 + * cdef Py_ssize_t i, N + * cdef int64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1333 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1336 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1337 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1339 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1340 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1342 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1343 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1344 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1346 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1347 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1348 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1349 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1350 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1351 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1352 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1354 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1355 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_161backfill_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_161backfill_inplace_bool = {__Pyx_NAMESTR("backfill_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_161backfill_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_161backfill_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_inplace_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1360 + * def backfill_inplace_bool(ndarray[uint8_t] values, + * ndarray[uint8_t, cast=True] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, N + * cdef uint8_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_160backfill_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_160backfill_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + __pyx_t_5numpy_uint8_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_inplace_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1363 + * cdef Py_ssize_t i, N + * cdef uint8_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * N = len(values) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1365 + * cdef int lim, fill_count = 0 + * + * N = len(values) # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_1; + + /* "pandas/src/generated.pyx":1368 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1369 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1371 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_2 = (__pyx_v_limit == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1372 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1374 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1375 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1376 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * val = values[N - 1] + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/src/generated.pyx":1378 + * lim = limit + * + * val = values[N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[i]: + */ + __pyx_t_1 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1379 + * + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[i]: + * if fill_count >= lim: + */ + for (__pyx_t_6 = (__pyx_v_N - 1); __pyx_t_6 > -1; __pyx_t_6-=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":1380 + * val = values[N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1381 + * for i in range(N - 1, -1 , -1): + * if mask[i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_3 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1382 + * if mask[i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[i] = val + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":1383 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1384 + * continue + * fill_count += 1 + * values[i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_8 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides) = __pyx_v_val; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1386 + * values[i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1387 + * else: + * fill_count = 0 + * val = values[i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L8:; + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_163pad_2d_inplace_float64 = {__Pyx_NAMESTR("pad_2d_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_163pad_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1393 + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef float64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_162pad_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1396 + * cdef Py_ssize_t i, j, N, K + * cdef float64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1398 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1401 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1402 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1404 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1405 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1407 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1408 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1409 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1411 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1412 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1413 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1414 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1415 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1416 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1417 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1418 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1419 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1421 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1422 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_165pad_2d_inplace_float32 = {__Pyx_NAMESTR("pad_2d_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_165pad_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1427 + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef float32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_164pad_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1430 + * cdef Py_ssize_t i, j, N, K + * cdef float32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1432 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1435 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1436 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1438 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1439 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1441 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1442 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1443 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1445 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1446 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1447 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1448 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1449 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1450 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1451 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1452 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1453 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1455 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1456 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_167pad_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_167pad_2d_inplace_object = {__Pyx_NAMESTR("pad_2d_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_167pad_2d_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_167pad_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1461 + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef object val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_166pad_2d_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_166pad_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyObject *__pyx_v_val = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + PyObject **__pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1464 + * cdef Py_ssize_t i, j, N, K + * cdef object val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1466 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1469 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1470 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1472 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1473 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1475 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1476 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1477 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1479 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1480 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1481 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1482 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1483 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1484 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1485 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1486 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1487 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_19); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_19); + *__pyx_t_19 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_19); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1489 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1490 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_20 = __pyx_v_j; + __pyx_t_21 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_169pad_2d_inplace_int32 = {__Pyx_NAMESTR("pad_2d_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_169pad_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1495 + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef int32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_168pad_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1498 + * cdef Py_ssize_t i, j, N, K + * cdef int32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1500 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1503 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1504 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1506 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1507 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1509 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1510 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1511 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1513 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1514 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1515 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1516 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1517 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1518 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1519 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1520 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1521 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1523 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1524 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_171pad_2d_inplace_int64 = {__Pyx_NAMESTR("pad_2d_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_171pad_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1529 + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef int64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_170pad_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1532 + * cdef Py_ssize_t i, j, N, K + * cdef int64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1534 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1537 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1538 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1540 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1541 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1543 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1544 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1545 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1547 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1548 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1549 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1550 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1551 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1552 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1553 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1554 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1555 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1557 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1558 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_173pad_2d_inplace_bool = {__Pyx_NAMESTR("pad_2d_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_173pad_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pad_2d_inplace_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1563 + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef uint8_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pad_2d_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pad_2d_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_172pad_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_uint8_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + long __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pad_2d_inplace_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1566 + * cdef Py_ssize_t i, j, N, K + * cdef uint8_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1568 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1571 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1572 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1574 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1575 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1577 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1578 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1579 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1581 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, 0] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1582 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, 0] + * for i in range(N): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1583 + * for j in range(K): + * fill_count = 0 + * val = values[j, 0] # <<<<<<<<<<<<<< + * for i in range(N): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1584 + * fill_count = 0 + * val = values[j, 0] + * for i in range(N): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/src/generated.pyx":1585 + * val = values[j, 0] + * for i in range(N): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_15 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1586 + * for i in range(N): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1587 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1588 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1589 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1591 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1592 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.pad_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_175backfill_2d_inplace_float64 = {__Pyx_NAMESTR("backfill_2d_inplace_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_175backfill_2d_inplace_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1598 + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef float64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_174backfill_2d_inplace_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1601 + * cdef Py_ssize_t i, j, N, K + * cdef float64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1603 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1606 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1607 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1609 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1610 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1612 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1613 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1614 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1616 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1617 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1618 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1619 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1620 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1621 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1622 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1623 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1624 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1626 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1627 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_177backfill_2d_inplace_float32 = {__Pyx_NAMESTR("backfill_2d_inplace_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_177backfill_2d_inplace_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1632 + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef float32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_float32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_176backfill_2d_inplace_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1635 + * cdef Py_ssize_t i, j, N, K + * cdef float32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1637 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1640 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1641 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1643 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1644 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1646 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1647 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1648 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1650 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1651 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1652 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1653 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1654 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1655 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1656 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1657 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1658 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1660 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1661 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_179backfill_2d_inplace_object = {__Pyx_NAMESTR("backfill_2d_inplace_object"), (PyCFunction)__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_179backfill_2d_inplace_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1666 + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef object val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_object", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_object", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_178backfill_2d_inplace_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyObject *__pyx_v_val = 0; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject **__pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1669 + * cdef Py_ssize_t i, j, N, K + * cdef object val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1671 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1674 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1675 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1677 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1678 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1680 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1681 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1682 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1684 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1685 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1686 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1687 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1688 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1689 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1690 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1691 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1692 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_18); + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1694 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1695 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_181backfill_2d_inplace_int32 = {__Pyx_NAMESTR("backfill_2d_inplace_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_181backfill_2d_inplace_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1700 + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef int32_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int32", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int32", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_180backfill_2d_inplace_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1703 + * cdef Py_ssize_t i, j, N, K + * cdef int32_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1705 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1708 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1709 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1711 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1712 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1714 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1715 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1716 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1718 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1719 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1720 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1721 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1722 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1723 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1724 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1725 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1726 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1728 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1729 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_183backfill_2d_inplace_int64 = {__Pyx_NAMESTR("backfill_2d_inplace_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_183backfill_2d_inplace_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1734 + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef int64_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_int64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_182backfill_2d_inplace_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1737 + * cdef Py_ssize_t i, j, N, K + * cdef int64_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1739 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1742 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1743 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1745 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1746 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1748 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1749 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1750 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1752 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1753 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1754 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1755 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1756 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1757 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1758 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1759 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1760 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1762 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * @cython.boundscheck(False) + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1763 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_185backfill_2d_inplace_bool = {__Pyx_NAMESTR("backfill_2d_inplace_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_185backfill_2d_inplace_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("backfill_2d_inplace_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_limit,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/generated.pyx":1768 + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, + * ndarray[uint8_t, ndim=2] mask, + * limit=None): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, N, K + * cdef uint8_t val + */ + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_bool", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "backfill_2d_inplace_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + __pyx_v_limit = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("backfill_2d_inplace_bool", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_limit); + + /* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_184backfill_2d_inplace_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, PyObject *__pyx_v_limit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_uint8_t __pyx_v_val; + int __pyx_v_lim; + int __pyx_v_fill_count; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("backfill_2d_inplace_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":1771 + * cdef Py_ssize_t i, j, N, K + * cdef uint8_t val + * cdef int lim, fill_count = 0 # <<<<<<<<<<<<<< + * + * K, N = ( values).shape + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1773 + * cdef int lim, fill_count = 0 + * + * K, N = ( values).shape # <<<<<<<<<<<<<< + * + * # GH 2778 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_K = __pyx_t_6; + __pyx_v_N = __pyx_t_7; + + /* "pandas/src/generated.pyx":1776 + * + * # GH 2778 + * if N == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = ((__pyx_v_N == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":1777 + * # GH 2778 + * if N == 0: + * return # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1779 + * return + * + * if limit is None: # <<<<<<<<<<<<<< + * lim = N + * else: + */ + __pyx_t_8 = (__pyx_v_limit == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1780 + * + * if limit is None: + * lim = N # <<<<<<<<<<<<<< + * else: + * if limit < 0: + */ + __pyx_v_lim = __pyx_v_N; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1782 + * lim = N + * else: + * if limit < 0: # <<<<<<<<<<<<<< + * raise ValueError('Limit must be non-negative') + * lim = limit + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1783 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1784 + * if limit < 0: + * raise ValueError('Limit must be non-negative') + * lim = limit # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_limit); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lim = __pyx_t_10; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1786 + * lim = limit + * + * for j in range(K): # <<<<<<<<<<<<<< + * fill_count = 0 + * val = values[j, N - 1] + */ + __pyx_t_7 = __pyx_v_K; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":1787 + * + * for j in range(K): + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1788 + * for j in range(K): + * fill_count = 0 + * val = values[j, N - 1] # <<<<<<<<<<<<<< + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_12 = (__pyx_v_N - 1); + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":1789 + * fill_count = 0 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): # <<<<<<<<<<<<<< + * if mask[j, i]: + * if fill_count >= lim: + */ + for (__pyx_t_13 = (__pyx_v_N - 1); __pyx_t_13 > -1; __pyx_t_13-=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/src/generated.pyx":1790 + * val = values[j, N - 1] + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: # <<<<<<<<<<<<<< + * if fill_count >= lim: + * continue + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1791 + * for i in range(N - 1, -1 , -1): + * if mask[j, i]: + * if fill_count >= lim: # <<<<<<<<<<<<<< + * continue + * fill_count += 1 + */ + __pyx_t_9 = ((__pyx_v_fill_count >= __pyx_v_lim) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":1792 + * if mask[j, i]: + * if fill_count >= lim: + * continue # <<<<<<<<<<<<<< + * fill_count += 1 + * values[j, i] = val + */ + goto __pyx_L10_continue; + } + + /* "pandas/src/generated.pyx":1793 + * if fill_count >= lim: + * continue + * fill_count += 1 # <<<<<<<<<<<<<< + * values[j, i] = val + * else: + */ + __pyx_v_fill_count = (__pyx_v_fill_count + 1); + + /* "pandas/src/generated.pyx":1794 + * continue + * fill_count += 1 + * values[j, i] = val # <<<<<<<<<<<<<< + * else: + * fill_count = 0 + */ + __pyx_t_16 = __pyx_v_j; + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_values.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1796 + * values[j, i] = val + * else: + * fill_count = 0 # <<<<<<<<<<<<<< + * val = values[j, i] + * + */ + __pyx_v_fill_count = 0; + + /* "pandas/src/generated.pyx":1797 + * else: + * fill_count = 0 + * val = values[j, i] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L12:; + __pyx_L10_continue:; + } + } + + /* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.backfill_2d_inplace_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1801 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float64(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_187is_monotonic_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_186is_monotonic_float64[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_187is_monotonic_float64 = {__Pyx_NAMESTR("is_monotonic_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_187is_monotonic_float64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_186is_monotonic_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_187is_monotonic_float64(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_float64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_186is_monotonic_float64(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_186is_monotonic_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t __pyx_v_prev; + __pyx_t_5numpy_float64_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_float64", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1810 + * Py_ssize_t i, n + * float64_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1812 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1814 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1815 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__98); + __pyx_r = __pyx_tuple__98; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1817 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1818 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1819 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1820 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1821 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__99); + __pyx_r = __pyx_tuple__99; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1822 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1823 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1824 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1825 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1801 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float64(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1828 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float32(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_189is_monotonic_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_188is_monotonic_float32[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_189is_monotonic_float32 = {__Pyx_NAMESTR("is_monotonic_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_189is_monotonic_float32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_188is_monotonic_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_189is_monotonic_float32(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_float32 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_188is_monotonic_float32(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_188is_monotonic_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float32_t __pyx_v_prev; + __pyx_t_5numpy_float32_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_float32", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1837 + * Py_ssize_t i, n + * float32_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1839 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1841 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1842 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__100); + __pyx_r = __pyx_tuple__100; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1844 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1845 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1846 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1847 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1848 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__101); + __pyx_r = __pyx_tuple__101; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1849 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1850 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1851 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1852 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1828 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float32(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1855 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_object(ndarray[object] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_191is_monotonic_object(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_190is_monotonic_object[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_191is_monotonic_object = {__Pyx_NAMESTR("is_monotonic_object"), (PyCFunction)__pyx_pw_6pandas_5algos_191is_monotonic_object, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_190is_monotonic_object)}; +static PyObject *__pyx_pw_6pandas_5algos_191is_monotonic_object(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_object (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_190is_monotonic_object(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_190is_monotonic_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_prev = 0; + PyObject *__pyx_v_cur = 0; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_object", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1864 + * Py_ssize_t i, n + * object prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1866 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1868 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1869 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__102); + __pyx_r = __pyx_tuple__102; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1871 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_4 = 0; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_v_prev = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":1872 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/src/generated.pyx":1873 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_cur, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":1874 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1875 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__103); + __pyx_r = __pyx_tuple__103; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1876 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_cur, __pyx_v_prev, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1877 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1878 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __Pyx_INCREF(__pyx_v_cur); + __Pyx_DECREF_SET(__pyx_v_prev, __pyx_v_cur); + } + + /* "pandas/src/generated.pyx":1879 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1855 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_object(ndarray[object] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_prev); + __Pyx_XDECREF(__pyx_v_cur); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1882 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int32(ndarray[int32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_193is_monotonic_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_192is_monotonic_int32[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_193is_monotonic_int32 = {__Pyx_NAMESTR("is_monotonic_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_193is_monotonic_int32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_192is_monotonic_int32)}; +static PyObject *__pyx_pw_6pandas_5algos_193is_monotonic_int32(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_int32 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_192is_monotonic_int32(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_192is_monotonic_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int32_t __pyx_v_prev; + __pyx_t_5numpy_int32_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_int32", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1891 + * Py_ssize_t i, n + * int32_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1893 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1895 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1896 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__104); + __pyx_r = __pyx_tuple__104; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1898 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1899 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1900 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1901 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1902 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__105); + __pyx_r = __pyx_tuple__105; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1903 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1904 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1905 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1906 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1882 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int32(ndarray[int32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1909 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int64(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_195is_monotonic_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_194is_monotonic_int64[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_195is_monotonic_int64 = {__Pyx_NAMESTR("is_monotonic_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_195is_monotonic_int64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_194is_monotonic_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_195is_monotonic_int64(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_int64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_194is_monotonic_int64(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_194is_monotonic_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_prev; + __pyx_t_5numpy_int64_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_int64", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1918 + * Py_ssize_t i, n + * int64_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1920 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1922 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1923 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__106); + __pyx_r = __pyx_tuple__106; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1925 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1926 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1927 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1928 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1929 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__107); + __pyx_r = __pyx_tuple__107; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1930 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1931 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1932 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * @cython.boundscheck(False) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1933 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1909 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int64(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_bool(ndarray[uint8_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_197is_monotonic_bool(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_5algos_196is_monotonic_bool[] = "\n Returns\n -------\n is_monotonic, is_unique\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_197is_monotonic_bool = {__Pyx_NAMESTR("is_monotonic_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_197is_monotonic_bool, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_196is_monotonic_bool)}; +static PyObject *__pyx_pw_6pandas_5algos_197is_monotonic_bool(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_monotonic_bool (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_196is_monotonic_bool(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_196is_monotonic_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_uint8_t __pyx_v_prev; + __pyx_t_5numpy_uint8_t __pyx_v_cur; + int __pyx_v_is_unique; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_monotonic_bool", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1945 + * Py_ssize_t i, n + * uint8_t prev, cur + * bint is_unique = 1 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_is_unique = 1; + + /* "pandas/src/generated.pyx":1947 + * bint is_unique = 1 + * + * n = len(arr) # <<<<<<<<<<<<<< + * + * if n < 2: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":1949 + * n = len(arr) + * + * if n < 2: # <<<<<<<<<<<<<< + * return True, True + * + */ + __pyx_t_2 = ((__pyx_v_n < 2) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1950 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__108); + __pyx_r = __pyx_tuple__108; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1952 + * return True, True + * + * prev = arr[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * cur = arr[i] + */ + __pyx_t_3 = 0; + __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1953 + * + * prev = arr[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * cur = arr[i] + * if cur < prev: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1954 + * prev = arr[0] + * for i in range(1, n): + * cur = arr[i] # <<<<<<<<<<<<<< + * if cur < prev: + * return False, None + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":1955 + * for i in range(1, n): + * cur = arr[i] + * if cur < prev: # <<<<<<<<<<<<<< + * return False, None + * elif cur == prev: + */ + __pyx_t_2 = ((__pyx_v_cur < __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1956 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__109); + __pyx_r = __pyx_tuple__109; + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":1957 + * if cur < prev: + * return False, None + * elif cur == prev: # <<<<<<<<<<<<<< + * is_unique = 0 + * prev = cur + */ + __pyx_t_2 = ((__pyx_v_cur == __pyx_v_prev) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":1958 + * return False, None + * elif cur == prev: + * is_unique = 0 # <<<<<<<<<<<<<< + * prev = cur + * return True, is_unique + */ + __pyx_v_is_unique = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":1959 + * elif cur == prev: + * is_unique = 0 + * prev = cur # <<<<<<<<<<<<<< + * return True, is_unique + * + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/generated.pyx":1960 + * is_unique = 0 + * prev = cur + * return True, is_unique # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_is_unique); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_bool(ndarray[uint8_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.is_monotonic_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1964 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_199groupby_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_199groupby_float64 = {__Pyx_NAMESTR("groupby_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_199groupby_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_199groupby_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_198groupby_float64(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_198groupby_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_float64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1965 + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1970 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":1972 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1973 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":1975 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":1976 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1978 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":1979 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":1981 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1982 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":1983 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1984 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":1986 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":1988 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1964 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":1992 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_201groupby_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_201groupby_float32 = {__Pyx_NAMESTR("groupby_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_201groupby_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_201groupby_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_200groupby_float32(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_200groupby_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_float32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":1993 + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":1998 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2000 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2001 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2003 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2004 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2006 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2007 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2009 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2010 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2011 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2012 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2014 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2016 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":1992 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2020 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_203groupby_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_203groupby_object = {__Pyx_NAMESTR("groupby_object"), (PyCFunction)__pyx_pw_6pandas_5algos_203groupby_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_203groupby_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_202groupby_object(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_202groupby_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_object", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2021 + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2026 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2028 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2029 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2031 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2032 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2034 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2035 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2037 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2038 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2039 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2040 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2042 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2044 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2020 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2048 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_205groupby_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_205groupby_int32 = {__Pyx_NAMESTR("groupby_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_205groupby_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_205groupby_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_204groupby_int32(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_204groupby_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_int32", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2049 + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2054 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2056 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2057 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2059 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2060 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2062 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2063 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2065 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2066 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2067 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2068 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2070 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2072 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2048 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2076 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_207groupby_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_207groupby_int64 = {__Pyx_NAMESTR("groupby_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_207groupby_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_207groupby_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_206groupby_int64(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_206groupby_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_int64", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2077 + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2082 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2084 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2085 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2087 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2088 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2090 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2091 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2093 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2094 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2095 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2096 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2098 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2100 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2076 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2104 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_209groupby_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_209groupby_bool = {__Pyx_NAMESTR("groupby_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_209groupby_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_209groupby_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("groupby_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("groupby_bool", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("groupby_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.groupby_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_208groupby_bool(__pyx_self, __pyx_v_index, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_208groupby_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyArrayObject *__pyx_v_labels) { + PyObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_members = 0; + PyObject *__pyx_v_idx = 0; + PyObject *__pyx_v_key = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("groupby_bool", 0); + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2105 + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): + * cdef dict result = {} # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, length + * cdef list members + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2110 + * cdef object idx, key + * + * length = len(index) # <<<<<<<<<<<<<< + * + * if not length == len(labels): + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/src/generated.pyx":2112 + * length = len(index) + * + * if not length == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_v_length == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2113 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":2115 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(length): # <<<<<<<<<<<<<< + * key = util.get_value_1d(labels, i) + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/generated.pyx":2116 + * + * for i in range(length): + * key = util.get_value_1d(labels, i) # <<<<<<<<<<<<<< + * + * if _checknull(key): + */ + __pyx_t_1 = get_value_1d(__pyx_v_labels, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2118 + * key = util.get_value_1d(labels, i) + * + * if _checknull(key): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_key) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2119 + * + * if _checknull(key): + * continue # <<<<<<<<<<<<<< + * + * idx = index[i] + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":2121 + * continue + * + * idx = index[i] # <<<<<<<<<<<<<< + * if key in result: + * members = result[key] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2122 + * + * idx = index[i] + * if key in result: # <<<<<<<<<<<<<< + * members = result[key] + * members.append(idx) + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_key, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":2123 + * idx = index[i] + * if key in result: + * members = result[key] # <<<<<<<<<<<<<< + * members.append(idx) + * else: + */ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_members, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2124 + * if key in result: + * members = result[key] + * members.append(idx) # <<<<<<<<<<<<<< + * else: + * result[key] = [idx] + */ + if (unlikely(__pyx_v_members == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2126 + * members.append(idx) + * else: + * result[key] = [idx] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_idx); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx); + __Pyx_GIVEREF(__pyx_v_idx); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":2128 + * result[key] = [idx] + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2104 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.groupby_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_211arrmap_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_211arrmap_float64 = {__Pyx_NAMESTR("arrmap_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_211arrmap_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_211arrmap_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_210arrmap_float64(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_210arrmap_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_float64", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2134 + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2135 + * def arrmap_float64(ndarray[float64_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2137 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2139 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2141 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2142 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2144 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_213arrmap_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_213arrmap_float32 = {__Pyx_NAMESTR("arrmap_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_213arrmap_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_213arrmap_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_212arrmap_float32(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_212arrmap_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_float32", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2149 + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2150 + * def arrmap_float32(ndarray[float32_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2152 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2154 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2156 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2157 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2159 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_215arrmap_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_215arrmap_object = {__Pyx_NAMESTR("arrmap_object"), (PyCFunction)__pyx_pw_6pandas_5algos_215arrmap_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_215arrmap_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_214arrmap_object(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_214arrmap_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_object", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2164 + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2165 + * def arrmap_object(ndarray[object] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2167 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2169 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2171 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2172 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2174 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2178 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_217arrmap_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_217arrmap_int32 = {__Pyx_NAMESTR("arrmap_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_217arrmap_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_217arrmap_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_216arrmap_int32(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_216arrmap_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_int32", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2179 + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2180 + * def arrmap_int32(ndarray[int32_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2182 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2184 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2186 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2187 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2189 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2178 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2193 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_219arrmap_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_219arrmap_int64 = {__Pyx_NAMESTR("arrmap_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_219arrmap_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_219arrmap_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_218arrmap_int64(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_218arrmap_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_int64", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2194 + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2195 + * def arrmap_int64(ndarray[int64_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2197 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2199 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2201 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2202 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2204 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2193 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2208 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_221arrmap_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_221arrmap_bool = {__Pyx_NAMESTR("arrmap_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_221arrmap_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_221arrmap_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap_bool", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.arrmap_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_220arrmap_bool(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_220arrmap_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_maybe_convert_objects = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject **__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap_bool", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2209 + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/src/generated.pyx":2210 + * def arrmap_bool(ndarray[uint8_t] index, object func): + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":2212 + * cdef Py_ssize_t i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * from pandas.lib import maybe_convert_objects + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":2214 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * from pandas.lib import maybe_convert_objects # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_maybe_convert_objects); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_maybe_convert_objects); + __Pyx_GIVEREF(__pyx_n_s_maybe_convert_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_5, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_maybe_convert_objects = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":2216 + * from pandas.lib import maybe_convert_objects + * + * for i in range(length): # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/generated.pyx":2217 + * + * for i in range(length): + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(result) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_1 = __Pyx_PyInt_From_npy_uint8((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_index.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_11); + *__pyx_t_11 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/generated.pyx":2219 + * result[i] = func(index[i]) + * + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_maybe_convert_objects, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":2208 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.arrmap_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_maybe_convert_objects); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2223 + * + * @cython.wraparound(False) + * def take_1d_bool_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_223take_1d_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_223take_1d_bool_bool = {__Pyx_NAMESTR("take_1d_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_223take_1d_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_223take_1d_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_bool_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__116; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_222take_1d_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_222take_1d_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_uint8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_uint8_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_bool_bool", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2231 + * uint8_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2233 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2234 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2235 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2236 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2237 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2239 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2223 + * + * @cython.wraparound(False) + * def take_1d_bool_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2242 + * + * @cython.wraparound(False) + * def take_1d_bool_object(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_225take_1d_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_225take_1d_bool_object = {__Pyx_NAMESTR("take_1d_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_225take_1d_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_225take_1d_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_bool_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__117; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_224take_1d_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_224take_1d_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject **__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_bool_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2250 + * object fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2252 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":2253 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2254 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_2 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_2 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2255 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2256 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = True if values[idx] > 0 else False + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_6); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_6); + *__pyx_t_6 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_6); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2258 + * out[i] = fv + * else: + * out[i] = True if values[idx] > 0 else False # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides)) > 0) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_7 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_7 = Py_False; + } + __pyx_t_9 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_6); + *__pyx_t_6 = __pyx_t_7; + __Pyx_GIVEREF(*__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2242 + * + * @cython.wraparound(False) + * def take_1d_bool_object(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2261 + * + * @cython.wraparound(False) + * def take_1d_int8_int8(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_227take_1d_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_227take_1d_int8_int8 = {__Pyx_NAMESTR("take_1d_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_227take_1d_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_227take_1d_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int8_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__118; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_226take_1d_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_226take_1d_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int8_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int8_int8", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2269 + * int8_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2271 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2272 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2273 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2274 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2275 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2277 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2261 + * + * @cython.wraparound(False) + * def take_1d_int8_int8(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2280 + * + * @cython.wraparound(False) + * def take_1d_int8_int32(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_229take_1d_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_229take_1d_int8_int32 = {__Pyx_NAMESTR("take_1d_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_229take_1d_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_229take_1d_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int8_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__119; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_228take_1d_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_228take_1d_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int8_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2288 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2290 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2291 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2292 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2293 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2294 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2296 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2280 + * + * @cython.wraparound(False) + * def take_1d_int8_int32(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2299 + * + * @cython.wraparound(False) + * def take_1d_int8_int64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_231take_1d_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_231take_1d_int8_int64 = {__Pyx_NAMESTR("take_1d_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_231take_1d_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_231take_1d_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int8_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__120; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_230take_1d_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_230take_1d_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int8_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2307 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2309 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2310 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2311 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2312 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2313 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2315 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2299 + * + * @cython.wraparound(False) + * def take_1d_int8_int64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2318 + * + * @cython.wraparound(False) + * def take_1d_int8_float64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_233take_1d_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_233take_1d_int8_float64 = {__Pyx_NAMESTR("take_1d_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_233take_1d_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_233take_1d_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int8_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__121; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_232take_1d_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_232take_1d_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int8_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2326 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2328 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2329 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2330 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2331 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2332 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2334 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2318 + * + * @cython.wraparound(False) + * def take_1d_int8_float64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2337 + * + * @cython.wraparound(False) + * def take_1d_int16_int16(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_235take_1d_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_235take_1d_int16_int16 = {__Pyx_NAMESTR("take_1d_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_235take_1d_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_235take_1d_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int16_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__122; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_234take_1d_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_234take_1d_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int16_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int16_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int16_int16", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2345 + * int16_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2347 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2348 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2349 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2350 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2351 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2353 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2337 + * + * @cython.wraparound(False) + * def take_1d_int16_int16(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2356 + * + * @cython.wraparound(False) + * def take_1d_int16_int32(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_237take_1d_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_237take_1d_int16_int32 = {__Pyx_NAMESTR("take_1d_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_237take_1d_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_237take_1d_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int16_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__123; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_236take_1d_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_236take_1d_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int16_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2364 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2366 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2367 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2368 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2369 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2370 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2372 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2356 + * + * @cython.wraparound(False) + * def take_1d_int16_int32(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2375 + * + * @cython.wraparound(False) + * def take_1d_int16_int64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_239take_1d_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_239take_1d_int16_int64 = {__Pyx_NAMESTR("take_1d_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_239take_1d_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_239take_1d_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int16_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__124; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_238take_1d_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_238take_1d_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int16_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2383 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2385 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2386 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2387 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2388 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2389 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2391 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2375 + * + * @cython.wraparound(False) + * def take_1d_int16_int64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2394 + * + * @cython.wraparound(False) + * def take_1d_int16_float64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_241take_1d_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_241take_1d_int16_float64 = {__Pyx_NAMESTR("take_1d_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_241take_1d_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_241take_1d_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int16_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__125; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_240take_1d_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_240take_1d_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int16_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2402 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2404 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2405 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2406 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2407 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2408 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2410 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2394 + * + * @cython.wraparound(False) + * def take_1d_int16_float64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2413 + * + * @cython.wraparound(False) + * def take_1d_int32_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_243take_1d_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_243take_1d_int32_int32 = {__Pyx_NAMESTR("take_1d_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_243take_1d_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_243take_1d_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int32_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__126; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_242take_1d_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_242take_1d_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int32_int32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2421 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2423 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2424 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2425 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2426 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2427 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2429 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2413 + * + * @cython.wraparound(False) + * def take_1d_int32_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2432 + * + * @cython.wraparound(False) + * def take_1d_int32_int64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_245take_1d_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_245take_1d_int32_int64 = {__Pyx_NAMESTR("take_1d_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_245take_1d_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_245take_1d_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int32_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__127; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_244take_1d_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_244take_1d_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int32_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2440 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2442 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2443 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2444 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2445 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2446 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2448 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2432 + * + * @cython.wraparound(False) + * def take_1d_int32_int64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2451 + * + * @cython.wraparound(False) + * def take_1d_int32_float64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_247take_1d_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_247take_1d_int32_float64 = {__Pyx_NAMESTR("take_1d_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_247take_1d_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_247take_1d_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__128; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_246take_1d_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_246take_1d_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int32_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2459 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2461 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2462 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2463 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2464 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2465 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2467 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2451 + * + * @cython.wraparound(False) + * def take_1d_int32_float64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2470 + * + * @cython.wraparound(False) + * def take_1d_int64_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_249take_1d_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_249take_1d_int64_int64 = {__Pyx_NAMESTR("take_1d_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_249take_1d_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_249take_1d_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int64_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__129; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_248take_1d_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_248take_1d_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int64_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2478 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2480 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2481 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2482 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2483 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2484 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2486 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2470 + * + * @cython.wraparound(False) + * def take_1d_int64_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2489 + * + * @cython.wraparound(False) + * def take_1d_int64_float64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_251take_1d_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_251take_1d_int64_float64 = {__Pyx_NAMESTR("take_1d_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_251take_1d_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_251take_1d_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_int64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__130; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_250take_1d_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_250take_1d_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_int64_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2497 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2499 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2500 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2501 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2502 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2503 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2505 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2489 + * + * @cython.wraparound(False) + * def take_1d_int64_float64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2508 + * + * @cython.wraparound(False) + * def take_1d_float32_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_253take_1d_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_253take_1d_float32_float32 = {__Pyx_NAMESTR("take_1d_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_253take_1d_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_253take_1d_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_float32_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__131; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_252take_1d_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_252take_1d_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_float32_float32", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2516 + * float32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2518 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2519 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2520 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2521 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2522 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2524 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2508 + * + * @cython.wraparound(False) + * def take_1d_float32_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2527 + * + * @cython.wraparound(False) + * def take_1d_float32_float64(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_255take_1d_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_255take_1d_float32_float64 = {__Pyx_NAMESTR("take_1d_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_255take_1d_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_255take_1d_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_float32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__132; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_254take_1d_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_254take_1d_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_float32_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2535 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2537 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2538 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2539 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2540 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2541 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2543 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2527 + * + * @cython.wraparound(False) + * def take_1d_float32_float64(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2546 + * + * @cython.wraparound(False) + * def take_1d_float64_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_257take_1d_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_257take_1d_float64_float64 = {__Pyx_NAMESTR("take_1d_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_257take_1d_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_257take_1d_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_float64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__133; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_256take_1d_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_256take_1d_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_float64_float64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2554 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2556 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2557 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2558 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2559 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":2560 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_fv; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2562 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_7 = __pyx_v_idx; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides)); + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2546 + * + * @cython.wraparound(False) + * def take_1d_float64_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2565 + * + * @cython.wraparound(False) + * def take_1d_object_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_259take_1d_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_259take_1d_object_object = {__Pyx_NAMESTR("take_1d_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_259take_1d_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_259take_1d_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_1d_object_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__134; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_1d_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_1d_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_1d_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_258take_1d_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_258take_1d_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject **__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_1d_object_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2573 + * object fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2575 + * n = len(indexer) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = indexer[i] + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":2576 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2577 + * fv = fill_value + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i] = fv + */ + __pyx_t_2 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_2 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2578 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i] = fv + * else: + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2579 + * idx = indexer[i] + * if idx == -1: + * out[i] = fv # <<<<<<<<<<<<<< + * else: + * out[i] = values[idx] + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_6); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_6); + *__pyx_t_6 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_6); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2581 + * out[i] = fv + * else: + * out[i] = values[idx] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_9 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_6); + *__pyx_t_6 = __pyx_t_7; + __Pyx_GIVEREF(*__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2565 + * + * @cython.wraparound(False) + * def take_1d_object_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_1d_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2586 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_261take_2d_axis0_bool_bool = {__Pyx_NAMESTR("take_2d_axis0_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_261take_2d_axis0_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_bool_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__135; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_260take_2d_axis0_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_uint8_t __pyx_v_fv; + __pyx_t_5numpy_uint8_t *__pyx_v_v; + __pyx_t_5numpy_uint8_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_uint8_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_bool_bool", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2594 + * uint8_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2595 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2597 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2605 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(uint8_t) and + * sizeof(uint8_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2606 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(uint8_t) and # <<<<<<<<<<<<<< + * sizeof(uint8_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_uint8_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2607 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(uint8_t) and + * sizeof(uint8_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_uint8_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2609 + * sizeof(uint8_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2610 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2611 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2612 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2613 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2615 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(uint8_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":2616 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(uint8_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":2617 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(uint8_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_uint8_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":2618 + * o = &out[i, 0] + * memmove(o, v, (sizeof(uint8_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":2620 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2621 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2622 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2623 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2624 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2626 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2627 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":2586 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2631 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_263take_2d_axis0_bool_object = {__Pyx_NAMESTR("take_2d_axis0_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_263take_2d_axis0_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_bool_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__136; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_262take_2d_axis0_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject **__pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_bool_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2639 + * object fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2640 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2642 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":2665 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2666 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_2 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2667 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_3 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2668 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_4 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2669 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_6 = __pyx_v_j; + __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_5 * __pyx_v_out.strides[0]) ) + __pyx_t_6 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_7); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_7); + *__pyx_t_7 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_7); + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2671 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = True if values[idx, j] > 0 else False + * + */ + __pyx_t_4 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2672 + * else: + * for j from 0 <= j < k: + * out[i, j] = True if values[idx, j] > 0 else False # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_9 = __pyx_v_idx; + __pyx_t_10 = __pyx_v_j; + if ((((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_9 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) ))) > 0) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_8 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_8 = Py_False; + } + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_DECREF(*__pyx_t_7); + *__pyx_t_7 = __pyx_t_8; + __Pyx_GIVEREF(*__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2631 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_265take_2d_axis0_int8_int8 = {__Pyx_NAMESTR("take_2d_axis0_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_265take_2d_axis0_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__137; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_264take_2d_axis0_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int8_t __pyx_v_fv; + __pyx_t_5numpy_int8_t *__pyx_v_v; + __pyx_t_5numpy_int8_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int8_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int8", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2684 + * int8_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2685 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2687 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2695 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(int8_t) and + * sizeof(int8_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2696 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int8_t) and # <<<<<<<<<<<<<< + * sizeof(int8_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int8_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2697 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int8_t) and + * sizeof(int8_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int8_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2699 + * sizeof(int8_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2700 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2701 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2702 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2703 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2705 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(int8_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":2706 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(int8_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":2707 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(int8_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int8_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":2708 + * o = &out[i, 0] + * memmove(o, v, (sizeof(int8_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":2710 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2711 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2712 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2713 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2714 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2716 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2717 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":2676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_267take_2d_axis0_int8_int32 = {__Pyx_NAMESTR("take_2d_axis0_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_267take_2d_axis0_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__138; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_266take_2d_axis0_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2729 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2730 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2732 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2755 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2756 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2757 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2758 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2759 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2761 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2762 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2766 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_269take_2d_axis0_int8_int64 = {__Pyx_NAMESTR("take_2d_axis0_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_269take_2d_axis0_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__139; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_268take_2d_axis0_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int8_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2774 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2775 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2777 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2800 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2801 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2802 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2803 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2804 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2806 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2807 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2766 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2811 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_271take_2d_axis0_int8_float64 = {__Pyx_NAMESTR("take_2d_axis0_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_271take_2d_axis0_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int8_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__140; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2813; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_270take_2d_axis0_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int8_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2819 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2820 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2822 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2845 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2846 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2847 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2848 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2849 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2851 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2852 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2811 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2856 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_273take_2d_axis0_int16_int16 = {__Pyx_NAMESTR("take_2d_axis0_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_273take_2d_axis0_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__141; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_272take_2d_axis0_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int16_t __pyx_v_fv; + __pyx_t_5numpy_int16_t *__pyx_v_v; + __pyx_t_5numpy_int16_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int16_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int16", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2864 + * int16_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2865 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2867 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2875 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(int16_t) and + * sizeof(int16_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":2876 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int16_t) and # <<<<<<<<<<<<<< + * sizeof(int16_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int16_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2877 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int16_t) and + * sizeof(int16_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int16_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2879 + * sizeof(int16_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2880 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2881 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2882 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2883 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2885 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(int16_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":2886 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(int16_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":2887 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(int16_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int16_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":2888 + * o = &out[i, 0] + * memmove(o, v, (sizeof(int16_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":2890 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2891 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2892 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2893 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2894 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2896 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2897 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":2856 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2901 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_275take_2d_axis0_int16_int32 = {__Pyx_NAMESTR("take_2d_axis0_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_275take_2d_axis0_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__142; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2903; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_274take_2d_axis0_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2909 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2910 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2912 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2935 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2936 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2937 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2938 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2939 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2941 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2942 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2901 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2946 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_277take_2d_axis0_int16_int64 = {__Pyx_NAMESTR("take_2d_axis0_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_277take_2d_axis0_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__143; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_276take_2d_axis0_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int16_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2954 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":2955 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":2957 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":2980 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":2981 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":2982 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":2983 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2984 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":2986 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":2987 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2946 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":2991 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_279take_2d_axis0_int16_float64 = {__Pyx_NAMESTR("take_2d_axis0_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_279take_2d_axis0_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int16_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__144; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_278take_2d_axis0_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int16_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":2999 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3000 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3002 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3025 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3026 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3027 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3028 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3029 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3031 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3032 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":2991 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3036 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_281take_2d_axis0_int32_int32 = {__Pyx_NAMESTR("take_2d_axis0_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_281take_2d_axis0_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int32_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__145; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_280take_2d_axis0_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __pyx_t_5numpy_int32_t *__pyx_v_v; + __pyx_t_5numpy_int32_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int32_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int32_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3044 + * int32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3045 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3047 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3055 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(int32_t) and + * sizeof(int32_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3056 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int32_t) and # <<<<<<<<<<<<<< + * sizeof(int32_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int32_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3057 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int32_t) and + * sizeof(int32_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int32_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3059 + * sizeof(int32_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3060 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3061 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3062 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3063 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3065 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(int32_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":3066 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(int32_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":3067 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(int32_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int32_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":3068 + * o = &out[i, 0] + * memmove(o, v, (sizeof(int32_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3070 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3071 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3072 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3073 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3074 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3076 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3077 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":3036 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3081 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_283take_2d_axis0_int32_int64 = {__Pyx_NAMESTR("take_2d_axis0_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_283take_2d_axis0_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int32_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__146; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_282take_2d_axis0_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int32_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3089 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3090 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3092 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3115 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3116 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3117 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3118 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3119 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3121 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3122 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3081 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_285take_2d_axis0_int32_float64 = {__Pyx_NAMESTR("take_2d_axis0_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_285take_2d_axis0_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__147; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_284take_2d_axis0_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int32_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3134 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3135 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3137 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3160 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3161 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3162 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3163 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3164 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3166 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3167 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3171 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_287take_2d_axis0_int64_int64 = {__Pyx_NAMESTR("take_2d_axis0_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_287take_2d_axis0_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int64_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__148; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_286take_2d_axis0_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __pyx_t_5numpy_int64_t *__pyx_v_v; + __pyx_t_5numpy_int64_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int64_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3179 + * int64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3180 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3182 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3190 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(int64_t) and + * sizeof(int64_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3191 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int64_t) and # <<<<<<<<<<<<<< + * sizeof(int64_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_int64_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3192 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(int64_t) and + * sizeof(int64_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3194 + * sizeof(int64_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3195 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3196 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3197 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3198 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3200 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(int64_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":3201 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(int64_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":3202 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(int64_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":3203 + * o = &out[i, 0] + * memmove(o, v, (sizeof(int64_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3205 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3206 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3207 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3208 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3209 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3211 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3212 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":3171 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3216 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_289take_2d_axis0_int64_float64 = {__Pyx_NAMESTR("take_2d_axis0_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_289take_2d_axis0_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_int64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__149; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_288take_2d_axis0_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_int64_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3224 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3225 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3227 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3250 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3251 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3252 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3253 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3254 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3256 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3257 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3216 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3261 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_291take_2d_axis0_float32_float32 = {__Pyx_NAMESTR("take_2d_axis0_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_291take_2d_axis0_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_float32_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__150; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_290take_2d_axis0_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float32_t __pyx_v_fv; + __pyx_t_5numpy_float32_t *__pyx_v_v; + __pyx_t_5numpy_float32_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float32_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_float32_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3269 + * float32_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3270 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3272 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3280 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(float32_t) and + * sizeof(float32_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3281 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(float32_t) and # <<<<<<<<<<<<<< + * sizeof(float32_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_float32_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3282 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(float32_t) and + * sizeof(float32_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_float32_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3284 + * sizeof(float32_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3285 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3286 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3287 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3288 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3290 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(float32_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":3291 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(float32_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":3292 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(float32_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_float32_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":3293 + * o = &out[i, 0] + * memmove(o, v, (sizeof(float32_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3295 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3296 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3297 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3298 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3299 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3301 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3302 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":3261 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3306 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_293take_2d_axis0_float32_float64 = {__Pyx_NAMESTR("take_2d_axis0_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_293take_2d_axis0_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_float32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__151; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_292take_2d_axis0_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_float32_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3314 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3315 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3317 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3340 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3341 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3342 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3343 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3344 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_6 * __pyx_v_out.strides[0]) ) + __pyx_t_7 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3346 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_5 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3347 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_10 * __pyx_v_out.strides[0]) ) + __pyx_t_11 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_9 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3306 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3351 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_295take_2d_axis0_float64_float64 = {__Pyx_NAMESTR("take_2d_axis0_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_295take_2d_axis0_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_float64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__152; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_294take_2d_axis0_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __pyx_t_5numpy_float64_t *__pyx_v_v; + __pyx_t_5numpy_float64_t *__pyx_v_o; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __pyx_t_5numpy_float64_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_float64_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3359 + * float64_t fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3360 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3362 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF True: + */ + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_2; + + /* "pandas/src/generated.pyx":3370 + * + * #GH3130 + * if (values.strides[1] == out.strides[1] and # <<<<<<<<<<<<<< + * values.strides[1] == sizeof(float64_t) and + * sizeof(float64_t) * n >= 256): + */ + __pyx_t_3 = (((__pyx_v_values.strides[1]) == (__pyx_v_out.strides[1])) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3371 + * #GH3130 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(float64_t) and # <<<<<<<<<<<<<< + * sizeof(float64_t) * n >= 256): + * + */ + __pyx_t_4 = (((__pyx_v_values.strides[1]) == (sizeof(__pyx_t_5numpy_float64_t))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3372 + * if (values.strides[1] == out.strides[1] and + * values.strides[1] == sizeof(float64_t) and + * sizeof(float64_t) * n >= 256): # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_5 = ((((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_n) >= 256) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3374 + * sizeof(float64_t) * n >= 256): + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3375 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3376 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3377 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3378 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * v = &values[idx, 0] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3380 + * out[i, j] = fv + * else: + * v = &values[idx, 0] # <<<<<<<<<<<<<< + * o = &out[i, 0] + * memmove(o, v, (sizeof(float64_t) * k)) + */ + __pyx_t_8 = __pyx_v_idx; + __pyx_t_11 = 0; + __pyx_v_v = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )))); + + /* "pandas/src/generated.pyx":3381 + * else: + * v = &values[idx, 0] + * o = &out[i, 0] # <<<<<<<<<<<<<< + * memmove(o, v, (sizeof(float64_t) * k)) + * return + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_o = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )))); + + /* "pandas/src/generated.pyx":3382 + * v = &values[idx, 0] + * o = &out[i, 0] + * memmove(o, v, (sizeof(float64_t) * k)) # <<<<<<<<<<<<<< + * return + * + */ + memmove(__pyx_v_o, __pyx_v_v, ((size_t)((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_k))); + } + __pyx_L6:; + } + + /* "pandas/src/generated.pyx":3383 + * o = &out[i, 0] + * memmove(o, v, (sizeof(float64_t) * k)) + * return # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3385 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3386 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3387 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_4 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":3388 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3389 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) ) + __pyx_t_17 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3391 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3392 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_18 = __pyx_v_idx; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) ) + __pyx_t_21 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) ) + __pyx_t_19 * __pyx_v_values.strides[1]) ))); + } + } + __pyx_L11:; + } + + /* "pandas/src/generated.pyx":3351 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3396 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_297take_2d_axis0_object_object = {__Pyx_NAMESTR("take_2d_axis0_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_297take_2d_axis0_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis0_object_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__153; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis0_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis0_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_296take_2d_axis0_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject **__pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis0_object_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3404 + * object fv + * + * n = len(indexer) # <<<<<<<<<<<<<< + * k = values.shape[1] + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/generated.pyx":3405 + * + * n = len(indexer) + * k = values.shape[1] # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_v_k = (__pyx_v_values.shape[1]); + + /* "pandas/src/generated.pyx":3407 + * k = values.shape[1] + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * IF False: + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":3430 + * return + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx == -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3431 + * + * for i from 0 <= i < n: + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_2 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3432 + * for i from 0 <= i < n: + * idx = indexer[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_3 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":3433 + * idx = indexer[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_4 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3434 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_6 = __pyx_v_j; + __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_5 * __pyx_v_out.strides[0]) ) + __pyx_t_6 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_7); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_7); + *__pyx_t_7 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_7); + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3436 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = values[idx, j] + * + */ + __pyx_t_4 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3437 + * else: + * for j from 0 <= j < k: + * out[i, j] = values[idx, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __pyx_v_idx; + __pyx_t_10 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_9 * __pyx_v_values.strides[0]) ) + __pyx_t_10 * __pyx_v_values.strides[1]) )); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_7 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) ) + __pyx_t_12 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_DECREF(*__pyx_t_7); + *__pyx_t_7 = __pyx_t_8; + __Pyx_GIVEREF(*__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3396 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis0_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3442 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_299take_2d_axis1_bool_bool = {__Pyx_NAMESTR("take_2d_axis1_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_299take_2d_axis1_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_bool_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__154; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3444; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_298take_2d_axis1_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_uint8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_uint8_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_bool_bool", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3450 + * uint8_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3451 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3453 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3454 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3456 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3458 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3459 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3460 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3461 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3462 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3464 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3442 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3468 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_301take_2d_axis1_bool_object = {__Pyx_NAMESTR("take_2d_axis1_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_301take_2d_axis1_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_bool_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__155; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_300take_2d_axis1_bool_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_bool_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3476 + * object fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3477 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3479 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3480 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3482 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":3484 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3485 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_6 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3486 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_7 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3487 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3488 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = True if values[i, idx] > 0 else False + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_8 * __pyx_v_out.strides[0]) ) + __pyx_t_9 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3490 + * out[i, j] = fv + * else: + * out[i, j] = True if values[i, idx] > 0 else False # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + if ((((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))) > 0) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3468 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3494 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_303take_2d_axis1_int8_int8 = {__Pyx_NAMESTR("take_2d_axis1_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_303take_2d_axis1_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__156; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3496; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_302take_2d_axis1_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int8_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int8", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3502 + * int8_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3503 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3505 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3506 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3508 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3510 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3511 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3512 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3513 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3514 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3516 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3494 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3520 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_305take_2d_axis1_int8_int32 = {__Pyx_NAMESTR("take_2d_axis1_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_305take_2d_axis1_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__157; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3522; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_304take_2d_axis1_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3528 + * int32_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3529 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3531 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3532 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3534 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3536 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3537 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3538 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3539 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3540 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3542 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3520 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3546 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_307take_2d_axis1_int8_int64 = {__Pyx_NAMESTR("take_2d_axis1_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_307take_2d_axis1_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__158; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_306take_2d_axis1_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int8_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3554 + * int64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3555 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3557 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3558 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3560 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3562 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3563 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3564 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3565 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3566 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3568 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3546 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_309take_2d_axis1_int8_float64 = {__Pyx_NAMESTR("take_2d_axis1_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_309take_2d_axis1_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int8_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__159; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_308take_2d_axis1_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int8_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3580 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3581 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3583 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3584 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3586 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3588 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3589 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3590 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3591 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3592 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3594 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_311take_2d_axis1_int16_int16 = {__Pyx_NAMESTR("take_2d_axis1_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_311take_2d_axis1_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__160; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_310take_2d_axis1_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int16_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int16_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int16", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3606 + * int16_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3607 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3609 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3610 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3612 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3614 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3615 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3616 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3617 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3618 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3620 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3624 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_313take_2d_axis1_int16_int32 = {__Pyx_NAMESTR("take_2d_axis1_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_313take_2d_axis1_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__161; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_312take_2d_axis1_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3632 + * int32_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3633 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3635 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3636 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3638 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3640 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3641 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3642 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3643 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3644 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3646 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3624 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3650 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_315take_2d_axis1_int16_int64 = {__Pyx_NAMESTR("take_2d_axis1_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_315take_2d_axis1_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__162; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3652; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_314take_2d_axis1_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int16_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3658 + * int64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3659 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3661 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3662 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3664 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3666 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3667 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3668 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3669 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3670 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3672 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3650 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_317take_2d_axis1_int16_float64 = {__Pyx_NAMESTR("take_2d_axis1_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_317take_2d_axis1_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int16_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__163; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_316take_2d_axis1_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int16_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3684 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3685 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3687 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3688 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3690 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3692 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3693 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3694 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3695 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3696 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3698 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3702 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_319take_2d_axis1_int32_int32 = {__Pyx_NAMESTR("take_2d_axis1_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_319take_2d_axis1_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int32_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__164; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_318take_2d_axis1_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int32_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3710 + * int32_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3711 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3713 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3714 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3716 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3718 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3719 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3720 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3721 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3722 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3724 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3702 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3728 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_321take_2d_axis1_int32_int64 = {__Pyx_NAMESTR("take_2d_axis1_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_321take_2d_axis1_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int32_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__165; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_320take_2d_axis1_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int32_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3736 + * int64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3737 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3739 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3740 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3742 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3744 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3745 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3746 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3747 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3748 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3750 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3728 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3754 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_323take_2d_axis1_int32_float64 = {__Pyx_NAMESTR("take_2d_axis1_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_323take_2d_axis1_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__166; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_322take_2d_axis1_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int32_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3762 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3763 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3765 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3766 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3768 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3770 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3771 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3772 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3773 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3774 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3776 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3754 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3780 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_325take_2d_axis1_int64_int64 = {__Pyx_NAMESTR("take_2d_axis1_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_325take_2d_axis1_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int64_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__167; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3782; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_324take_2d_axis1_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_int64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int64_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3788 + * int64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3789 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3791 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3792 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3794 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3796 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3797 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3798 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3799 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3800 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3802 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3780 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3806 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_327take_2d_axis1_int64_float64 = {__Pyx_NAMESTR("take_2d_axis1_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_327take_2d_axis1_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_int64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__168; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3808; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_326take_2d_axis1_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_int64_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3814 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3815 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3817 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3818 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3820 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3822 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3823 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3824 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3825 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3826 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3828 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3806 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3832 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_329take_2d_axis1_float32_float32 = {__Pyx_NAMESTR("take_2d_axis1_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_329take_2d_axis1_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_float32_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__169; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_328take_2d_axis1_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_float32_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3840 + * float32_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3841 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3843 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3844 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3846 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3848 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3849 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3850 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3851 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3852 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3854 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3832 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3858 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_331take_2d_axis1_float32_float64 = {__Pyx_NAMESTR("take_2d_axis1_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_331take_2d_axis1_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_float32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__170; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_330take_2d_axis1_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_float32_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3866 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3867 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3869 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3870 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3872 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3874 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3875 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3876 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3877 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3878 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3880 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3858 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3884 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_333take_2d_axis1_float64_float64 = {__Pyx_NAMESTR("take_2d_axis1_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_333take_2d_axis1_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_float64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__171; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3886; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_332take_2d_axis1_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __pyx_t_5numpy_float64_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_float64_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3892 + * float64_t fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3893 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3895 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3896 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3898 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_6; + + /* "pandas/src/generated.pyx":3900 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3901 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3902 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3903 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3904 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_9 * __pyx_v_out.strides[0]) ) + __pyx_t_10 * __pyx_v_out.strides[1]) )) = __pyx_v_fv; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3906 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) ))); + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3884 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_335take_2d_axis1_object_object = {__Pyx_NAMESTR("take_2d_axis1_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_335take_2d_axis1_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_axis1_object_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__172; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_axis1_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indexer = ((PyArrayObject *)values[1]); + __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dsds_object(values[2]); if (unlikely(!__pyx_v_out.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3912; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_axis1_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_334take_2d_axis1_object_object(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyArrayObject *__pyx_v_indexer, __Pyx_memviewslice __pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_axis1_object_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":3918 + * object fv + * + * n = len(values) # <<<<<<<<<<<<<< + * k = len(indexer) + * + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 2, (PyObject *(*)(char *)) __pyx_memview_get_object, (int (*)(char *, PyObject *)) __pyx_memview_set_object, 1);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/generated.pyx":3919 + * + * n = len(values) + * k = len(indexer) # <<<<<<<<<<<<<< + * + * if n == 0 or k == 0: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_2; + + /* "pandas/src/generated.pyx":3921 + * k = len(indexer) + * + * if n == 0 or k == 0: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_k == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3922 + * + * if n == 0 or k == 0: + * return # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + + /* "pandas/src/generated.pyx":3924 + * return + * + * fv = fill_value # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":3926 + * fv = fill_value + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * idx = indexer[j] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3927 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * idx = indexer[j] + * if idx == -1: + */ + __pyx_t_6 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3928 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * idx = indexer[j] # <<<<<<<<<<<<<< + * if idx == -1: + * out[i, j] = fv + */ + __pyx_t_7 = __pyx_v_j; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3929 + * for j from 0 <= j < k: + * idx = indexer[j] + * if idx == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_5 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":3930 + * idx = indexer[j] + * if idx == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[i, idx] + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_8 * __pyx_v_out.strides[0]) ) + __pyx_t_9 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3932 + * out[i, j] = fv + * else: + * out[i, j] = values[i, idx] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_idx; + __pyx_t_1 = (PyObject *) *((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) ) + __pyx_t_12 * __pyx_v_values.strides[1]) )); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_10 = ((PyObject * *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) ) + __pyx_t_14 * __pyx_v_out.strides[1]) )); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L8:; + } + } + + /* "pandas/src/generated.pyx":3910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_axis1_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_fv); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3937 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[uint8_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_337take_2d_multi_bool_bool = {__Pyx_NAMESTR("take_2d_multi_bool_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_337take_2d_multi_bool_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_bool_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__173; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_bool_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_bool", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_336take_2d_multi_bool_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_uint8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_uint8_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_bool_bool", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":3943 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * uint8_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":3944 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * uint8_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":3947 + * uint8_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":3948 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":3950 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_uint8(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":3951 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3952 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3953 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":3954 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3955 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3957 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3958 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":3959 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3961 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3937 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[uint8_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3965 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_339take_2d_multi_bool_object = {__Pyx_NAMESTR("take_2d_multi_bool_object"), (PyCFunction)__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_339take_2d_multi_bool_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_bool_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__174; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_bool_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_bool_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_338take_2d_multi_bool_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_bool_object", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":3971 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * object fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":3972 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * object fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":3975 + * object fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":3976 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":3978 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":3979 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":3980 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":3981 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_6 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":3982 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3983 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3985 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":3986 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":3987 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = True if values[idx, idx1[j]] > 0 else False + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":3989 + * out[i, j] = fv + * else: + * out[i, j] = True if values[idx, idx1[j]] > 0 else False # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + if ((((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)) > 0) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3965 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_bool_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XDECREF(__pyx_v_fv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":3993 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int8_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_341take_2d_multi_int8_int8 = {__Pyx_NAMESTR("take_2d_multi_int8_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_341take_2d_multi_int8_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int8_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__175; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int8", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_340take_2d_multi_int8_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int8_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int8_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int8_int8", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":3999 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int8_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4000 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int8_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4003 + * int8_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4004 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4006 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int8(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4007 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4008 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4009 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4010 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4011 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4013 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4014 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4015 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4017 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":3993 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int8_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4021 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_343take_2d_multi_int8_int32 = {__Pyx_NAMESTR("take_2d_multi_int8_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_343take_2d_multi_int8_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int8_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__176; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_342take_2d_multi_int8_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int32_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int8_int32", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4027 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int32_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4028 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int32_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4031 + * int32_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4032 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4034 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4035 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4036 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4037 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4038 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4039 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4041 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4042 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4043 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4045 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4021 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4049 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_345take_2d_multi_int8_int64 = {__Pyx_NAMESTR("take_2d_multi_int8_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_345take_2d_multi_int8_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int8_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__177; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_344take_2d_multi_int8_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int8_int64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4055 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4056 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4059 + * int64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4060 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4062 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4063 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4064 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4065 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4066 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4067 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4069 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4070 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4071 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4073 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4049 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4077 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_347take_2d_multi_int8_float64 = {__Pyx_NAMESTR("take_2d_multi_int8_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_347take_2d_multi_int8_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int8_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__178; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int8_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int8_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_346take_2d_multi_int8_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int8_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4083 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4084 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4087 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4088 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4090 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4091 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4092 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4093 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4094 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4095 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4097 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4098 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4099 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4101 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4077 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int8_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4105 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int16_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_349take_2d_multi_int16_int16 = {__Pyx_NAMESTR("take_2d_multi_int16_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_349take_2d_multi_int16_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int16_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__179; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int16", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_348take_2d_multi_int16_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int16_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int16_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int16_int16", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4111 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int16_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4112 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int16_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4115 + * int16_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4116 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4118 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4119 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4120 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4121 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4122 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4123 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4125 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4126 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4127 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4129 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4105 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int16_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_351take_2d_multi_int16_int32 = {__Pyx_NAMESTR("take_2d_multi_int16_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_351take_2d_multi_int16_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int16_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__180; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_350take_2d_multi_int16_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int32_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int16_int32", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4139 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int32_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4140 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int32_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4143 + * int32_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4144 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4146 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4147 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4148 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4149 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4150 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4151 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4153 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4154 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4155 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4157 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4161 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_353take_2d_multi_int16_int64 = {__Pyx_NAMESTR("take_2d_multi_int16_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_353take_2d_multi_int16_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int16_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__181; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_352take_2d_multi_int16_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int16_int64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4167 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4168 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4171 + * int64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4172 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4174 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4175 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4176 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4177 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4178 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4179 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4181 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4182 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4183 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4185 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4161 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4189 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_355take_2d_multi_int16_float64 = {__Pyx_NAMESTR("take_2d_multi_int16_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_355take_2d_multi_int16_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int16_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__182; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int16_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int16_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_354take_2d_multi_int16_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int16_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4195 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4196 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4199 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4200 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4202 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4203 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4204 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4205 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4206 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4207 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4209 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4210 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4211 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4213 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4189 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int16_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4217 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_357take_2d_multi_int32_int32 = {__Pyx_NAMESTR("take_2d_multi_int32_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_357take_2d_multi_int32_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int32_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__183; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_356take_2d_multi_int32_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int32_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int32_int32", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4223 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int32_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4224 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int32_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4227 + * int32_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4228 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4230 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int32(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4231 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4232 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4233 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4234 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4235 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4237 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4238 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4239 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4241 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4217 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4245 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_359take_2d_multi_int32_int64 = {__Pyx_NAMESTR("take_2d_multi_int32_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_359take_2d_multi_int32_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int32_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__184; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_358take_2d_multi_int32_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int32_int64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4251 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4252 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4255 + * int64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4256 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4258 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4259 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4260 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4261 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4262 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4263 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4265 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4266 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4267 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4269 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4245 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4273 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_361take_2d_multi_int32_float64 = {__Pyx_NAMESTR("take_2d_multi_int32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_361take_2d_multi_int32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__185; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_360take_2d_multi_int32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int32_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4279 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4280 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4283 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4284 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4286 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4287 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4288 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4289 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4290 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4291 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4293 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4294 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4295 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4297 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4273 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_363take_2d_multi_int64_int64 = {__Pyx_NAMESTR("take_2d_multi_int64_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_363take_2d_multi_int64_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int64_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__186; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int64_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_int64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_362take_2d_multi_int64_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_int64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int64_int64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4307 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * int64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4308 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * int64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4311 + * int64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4312 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4314 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4315 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4316 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4317 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4318 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4319 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4321 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4322 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4323 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4325 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4329 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_365take_2d_multi_int64_float64 = {__Pyx_NAMESTR("take_2d_multi_int64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_365take_2d_multi_int64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_int64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__187; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_int64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_int64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_364take_2d_multi_int64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_int64_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4335 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4336 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4339 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4340 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4342 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4343 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4344 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4345 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4346 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4347 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4349 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4350 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4351 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4353 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4329 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_int64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4357 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float32_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_367take_2d_multi_float32_float32 = {__Pyx_NAMESTR("take_2d_multi_float32_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_367take_2d_multi_float32_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_float32_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__188; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float32_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float32", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_366take_2d_multi_float32_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float32_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float32_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_float32_float32", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4363 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float32_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4364 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float32_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4367 + * float32_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4368 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4370 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4371 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4372 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4373 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4374 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4375 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4377 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4378 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4379 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4381 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4357 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float32_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4385 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_369take_2d_multi_float32_float64 = {__Pyx_NAMESTR("take_2d_multi_float32_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_369take_2d_multi_float32_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_float32_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__189; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float32_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float32_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_368take_2d_multi_float32_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_float32_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4391 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4392 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4395 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4396 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4398 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4399 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4400 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4401 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4402 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4403 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4405 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4406 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4407 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4409 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4385 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float32_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4413 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_371take_2d_multi_float64_float64 = {__Pyx_NAMESTR("take_2d_multi_float64_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_371take_2d_multi_float64_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_float64_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__190; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_float64_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_float64_float64", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_370take_2d_multi_float64_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + __pyx_t_5numpy_float64_t __pyx_v_fv; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_float64_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_float64_float64", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4419 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * float64_t fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4420 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * float64_t fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4423 + * float64_t fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4424 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4426 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_fill_value); if (unlikely((__pyx_t_5 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fv = __pyx_t_5; + + /* "pandas/src/generated.pyx":4427 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4428 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_6 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4429 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_7 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4430 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4431 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4433 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4434 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":4435 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_fv; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4437 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides)); + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4413 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_float64_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4441 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_object_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_373take_2d_multi_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_373take_2d_multi_object_object = {__Pyx_NAMESTR("take_2d_multi_object_object"), (PyCFunction)__pyx_pw_6pandas_5algos_373take_2d_multi_object_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_373take_2d_multi_object_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take_2d_multi_object_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indexer,&__pyx_n_s_out,&__pyx_n_s_fill_value,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = __pyx_k__191; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_2d_multi_object_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indexer = values[1]; + __pyx_v_out = ((PyArrayObject *)values[2]); + __pyx_v_fill_value = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take_2d_multi_object_object", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.take_2d_multi_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_372take_2d_multi_object_object(__pyx_self, __pyx_v_values, __pyx_v_indexer, __pyx_v_out, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_372take_2d_multi_object_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_indexer, PyArrayObject *__pyx_v_out, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_idx; + PyArrayObject *__pyx_v_idx0 = 0; + PyArrayObject *__pyx_v_idx1 = 0; + PyObject *__pyx_v_fv = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx0; + __Pyx_Buffer __pyx_pybuffer_idx0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx1; + __Pyx_Buffer __pyx_pybuffer_idx1; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + PyArrayObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take_2d_multi_object_object", 0); + __pyx_pybuffer_idx0.pybuffer.buf = NULL; + __pyx_pybuffer_idx0.refcount = 0; + __pyx_pybuffernd_idx0.data = NULL; + __pyx_pybuffernd_idx0.rcbuffer = &__pyx_pybuffer_idx0; + __pyx_pybuffer_idx1.pybuffer.buf = NULL; + __pyx_pybuffer_idx1.refcount = 0; + __pyx_pybuffernd_idx1.data = NULL; + __pyx_pybuffernd_idx1.rcbuffer = &__pyx_pybuffer_idx1; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4447 + * cdef: + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] # <<<<<<<<<<<<<< + * ndarray[int64_t] idx1 = indexer[1] + * object fv + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx0.diminfo[0].strides = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx0.diminfo[0].shape = __pyx_pybuffernd_idx0.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_2 = 0; + __pyx_v_idx0 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4448 + * Py_ssize_t i, j, k, n, idx + * ndarray[int64_t] idx0 = indexer[0] + * ndarray[int64_t] idx1 = indexer[1] # <<<<<<<<<<<<<< + * object fv + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indexer, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_idx1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_idx1.diminfo[0].strides = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx1.diminfo[0].shape = __pyx_pybuffernd_idx1.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_3 = 0; + __pyx_v_idx1 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":4451 + * object fv + * + * n = len(idx0) # <<<<<<<<<<<<<< + * k = len(idx1) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx0)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_4; + + /* "pandas/src/generated.pyx":4452 + * + * n = len(idx0) + * k = len(idx1) # <<<<<<<<<<<<<< + * + * fv = fill_value + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_idx1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_4; + + /* "pandas/src/generated.pyx":4454 + * k = len(idx1) + * + * fv = fill_value # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * idx = idx0[i] + */ + __Pyx_INCREF(__pyx_v_fill_value); + __pyx_v_fv = __pyx_v_fill_value; + + /* "pandas/src/generated.pyx":4455 + * + * fv = fill_value + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * idx = idx0[i] + * if idx == -1: + */ + __pyx_t_4 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + + /* "pandas/src/generated.pyx":4456 + * fv = fill_value + * for i from 0 <= i < n: + * idx = idx0[i] # <<<<<<<<<<<<<< + * if idx == -1: + * for j from 0 <= j < k: + */ + __pyx_t_5 = __pyx_v_i; + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx0.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_idx0.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4457 + * for i from 0 <= i < n: + * idx = idx0[i] + * if idx == -1: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * out[i, j] = fv + */ + __pyx_t_6 = ((__pyx_v_idx == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":4458 + * idx = idx0[i] + * if idx == -1: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4459 + * if idx == -1: + * for j from 0 <= j < k: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * for j from 0 <= j < k: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4461 + * out[i, j] = fv + * else: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if idx1[j] == -1: + * out[i, j] = fv + */ + __pyx_t_7 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/src/generated.pyx":4462 + * else: + * for j from 0 <= j < k: + * if idx1[j] == -1: # <<<<<<<<<<<<<< + * out[i, j] = fv + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_idx1.diminfo[0].strides)) == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":4463 + * for j from 0 <= j < k: + * if idx1[j] == -1: + * out[i, j] = fv # <<<<<<<<<<<<<< + * else: + * out[i, j] = values[idx, idx1[j]] + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_fv); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_fv; + __Pyx_GIVEREF(*__pyx_t_10); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4465 + * out[i, j] = fv + * else: + * out[i, j] = values[idx, idx1[j]] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_idx; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_idx1.diminfo[0].strides)); + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_10 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L10:; + } + } + __pyx_L5:; + } + + /* "pandas/src/generated.pyx":4441 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_object_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.take_2d_multi_object_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx0.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx1.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_idx0); + __Pyx_XDECREF((PyObject *)__pyx_v_idx1); + __Pyx_XDECREF(__pyx_v_fv); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4470 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float64(ndarray[float64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_375diff_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_375diff_2d_float64 = {__Pyx_NAMESTR("diff_2d_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_375diff_2d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_375diff_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_374diff_2d_float64(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_374diff_2d_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_float64", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4476 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4477 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4478 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4479 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4480 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4482 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4483 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4484 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4485 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4487 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4488 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4490 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4491 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4492 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4493 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4495 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4496 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4497 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4499 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4500 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4501 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4502 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4504 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4505 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4507 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4508 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4509 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4510 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4470 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float64(ndarray[float64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4513 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float32(ndarray[float32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_377diff_2d_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_377diff_2d_float32 = {__Pyx_NAMESTR("diff_2d_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_377diff_2d_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_377diff_2d_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_376diff_2d_float32(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_376diff_2d_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_float32", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4519 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4520 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4521 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4522 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4523 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4525 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4526 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4527 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4528 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4530 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4531 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4533 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4534 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4535 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4536 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4538 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4539 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4540 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4542 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4543 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4544 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4545 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4547 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4548 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4550 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4551 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4552 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4553 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4513 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float32(ndarray[float32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4556 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int8(ndarray[int8_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_379diff_2d_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_379diff_2d_int8 = {__Pyx_NAMESTR("diff_2d_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_379diff_2d_int8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_379diff_2d_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_int8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int8") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4558; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4558; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_int8", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_378diff_2d_int8(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_378diff_2d_int8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_int8", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4562 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4563 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4564 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4565 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4566 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4568 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4569 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4570 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4571 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4573 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4574 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4576 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4577 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4578 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4579 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4581 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4582 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4583 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4585 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4586 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4587 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4588 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4590 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4591 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4593 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4594 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4595 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4596 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4556 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int8(ndarray[int8_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_int8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4599 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int16(ndarray[int16_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_381diff_2d_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_381diff_2d_int16 = {__Pyx_NAMESTR("diff_2d_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_381diff_2d_int16, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_381diff_2d_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_int16 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int16") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4601; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4601; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_int16", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_380diff_2d_int16(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_380diff_2d_int16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_int16", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4605 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4606 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4607 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4608 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4609 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4611 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4612 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4613 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4614 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4616 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4617 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4619 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4620 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4621 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4622 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4624 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4625 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4626 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4628 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4629 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4630 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4631 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4633 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4634 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4636 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4637 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4638 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4639 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4599 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int16(ndarray[int16_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4642 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int32(ndarray[int32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_383diff_2d_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_383diff_2d_int32 = {__Pyx_NAMESTR("diff_2d_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_383diff_2d_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_383diff_2d_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_int32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_382diff_2d_int32(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_382diff_2d_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_int32", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4648 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4649 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4650 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4651 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4652 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4654 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4655 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4656 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4657 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4659 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4660 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4662 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4663 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4664 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4665 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4667 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4668 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4669 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4671 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4672 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4673 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4674 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4676 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4677 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4679 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4680 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4681 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * @cython.boundscheck(False) + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4682 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4642 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int32(ndarray[int32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4685 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int64(ndarray[int64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_385diff_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_385diff_2d_int64 = {__Pyx_NAMESTR("diff_2d_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_385diff_2d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_385diff_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_periods; + int __pyx_v_axis; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("diff_2d_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_out,&__pyx_n_s_periods,&__pyx_n_s_axis,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periods)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diff_2d_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_out = ((PyArrayObject *)values[1]); + __pyx_v_periods = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_periods == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_axis = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_axis == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("diff_2d_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.diff_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_384diff_2d_int64(__pyx_self, __pyx_v_arr, __pyx_v_out, __pyx_v_periods, __pyx_v_axis); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_384diff_2d_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyArrayObject *__pyx_v_out, Py_ssize_t __pyx_v_periods, int __pyx_v_axis) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_sx; + Py_ssize_t __pyx_v_sy; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("diff_2d_int64", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + + /* "pandas/src/generated.pyx":4691 + * Py_ssize_t i, j, sx, sy + * + * sx, sy = ( arr).shape # <<<<<<<<<<<<<< + * if arr.flags.f_contiguous: + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sx = __pyx_t_6; + __pyx_v_sy = __pyx_t_7; + + /* "pandas/src/generated.pyx":4692 + * + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * if axis == 0: + * if periods >= 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4693 + * sx, sy = ( arr).shape + * if arr.flags.f_contiguous: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4694 + * if arr.flags.f_contiguous: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4695 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4697 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for j in range(sy): + * for i in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L7:; + + /* "pandas/src/generated.pyx":4698 + * else: + * start, stop = 0, sx + periods + * for j in range(sy): # <<<<<<<<<<<<<< + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_sy; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4699 + * start, stop = 0, sx + periods + * for j in range(sy): + * for i in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4700 + * for j in range(sy): + * for i in range(start, stop): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + __pyx_t_13 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_14 = __pyx_v_j; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4702 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4703 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4705 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for j in range(start, stop): + * for i in range(sx): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":4706 + * else: + * start, stop = 0, sy + periods + * for j in range(start, stop): # <<<<<<<<<<<<<< + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/src/generated.pyx":4707 + * start, stop = 0, sy + periods + * for j in range(start, stop): + * for i in range(sx): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + */ + __pyx_t_9 = __pyx_v_sx; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/generated.pyx":4708 + * for j in range(start, stop): + * for i in range(sx): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * else: + * if axis == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4710 + * out[i, j] = arr[i, j] - arr[i, j - periods] + * else: + * if axis == 0: # <<<<<<<<<<<<<< + * if periods >= 0: + * start, stop = periods, sx + */ + __pyx_t_8 = ((__pyx_v_axis == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4711 + * else: + * if axis == 0: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sx + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4712 + * if axis == 0: + * if periods >= 0: + * start, stop = periods, sx # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sx + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sx; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4714 + * start, stop = periods, sx + * else: + * start, stop = 0, sx + periods # <<<<<<<<<<<<<< + * for i in range(start, stop): + * for j in range(sy): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sx + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L18:; + + /* "pandas/src/generated.pyx":4715 + * else: + * start, stop = 0, sx + periods + * for i in range(start, stop): # <<<<<<<<<<<<<< + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] + */ + __pyx_t_7 = __pyx_v_stop; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4716 + * start, stop = 0, sx + periods + * for i in range(start, stop): + * for j in range(sy): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + */ + __pyx_t_9 = __pyx_v_sy; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4717 + * for i in range(start, stop): + * for j in range(sy): + * out[i, j] = arr[i, j] - arr[i - periods, j] # <<<<<<<<<<<<<< + * else: + * if periods >= 0: + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = (__pyx_v_i - __pyx_v_periods); + __pyx_t_26 = __pyx_v_j; + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4719 + * out[i, j] = arr[i, j] - arr[i - periods, j] + * else: + * if periods >= 0: # <<<<<<<<<<<<<< + * start, stop = periods, sy + * else: + */ + __pyx_t_8 = ((__pyx_v_periods >= 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":4720 + * else: + * if periods >= 0: + * start, stop = periods, sy # <<<<<<<<<<<<<< + * else: + * start, stop = 0, sy + periods + */ + __pyx_t_7 = __pyx_v_periods; + __pyx_t_6 = __pyx_v_sy; + __pyx_v_start = __pyx_t_7; + __pyx_v_stop = __pyx_t_6; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4722 + * start, stop = periods, sy + * else: + * start, stop = 0, sy + periods # <<<<<<<<<<<<<< + * for i in range(sx): + * for j in range(start, stop): + */ + __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_v_sy + __pyx_v_periods); + __pyx_v_start = __pyx_t_6; + __pyx_v_stop = __pyx_t_7; + } + __pyx_L23:; + + /* "pandas/src/generated.pyx":4723 + * else: + * start, stop = 0, sy + periods + * for i in range(sx): # <<<<<<<<<<<<<< + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] + */ + __pyx_t_7 = __pyx_v_sx; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/generated.pyx":4724 + * start, stop = 0, sy + periods + * for i in range(sx): + * for j in range(start, stop): # <<<<<<<<<<<<<< + * out[i, j] = arr[i, j] - arr[i, j - periods] + * + */ + __pyx_t_9 = __pyx_v_stop; + for (__pyx_t_10 = __pyx_v_start; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "pandas/src/generated.pyx":4725 + * for i in range(sx): + * for j in range(start, stop): + * out[i, j] = arr[i, j] - arr[i, j - periods] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = (__pyx_v_j - __pyx_v_periods); + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_arr.diminfo[1].strides)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_arr.diminfo[1].strides))); + } + } + } + __pyx_L17:; + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":4685 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int64(ndarray[int64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.diff_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4729 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_387group_last_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_386group_last_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_387group_last_float64 = {__Pyx_NAMESTR("group_last_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_387group_last_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_386group_last_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_387group_last_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_386group_last_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_386group_last_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_float64", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4742 + * ndarray[int64_t, ndim=2] nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4743 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":4745 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":4746 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":4748 + * resx = np.empty_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":4750 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4751 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4752 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4753 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":4755 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4756 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4757 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_21 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4760 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * resx[lab, j] = val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4761 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_23 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/src/generated.pyx":4762 + * if val == val: + * nobs[lab, j] += 1 + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":4764 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4765 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4766 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4767 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4769 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.wraparound(False) + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_33 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L16:; + } + } + + /* "pandas/src/generated.pyx":4729 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4772 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_389group_last_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_388group_last_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_389group_last_float32 = {__Pyx_NAMESTR("group_last_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_389group_last_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_388group_last_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_389group_last_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_388group_last_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_388group_last_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_float32", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4785 + * ndarray[int64_t, ndim=2] nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4786 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":4788 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":4789 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":4791 + * resx = np.empty_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":4793 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4794 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4795 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4796 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":4798 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4799 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4800 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_21 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4803 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * resx[lab, j] = val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4804 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_23 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/src/generated.pyx":4805 + * if val == val: + * nobs[lab, j] += 1 + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_25 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":4807 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4808 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4809 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_27 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4810 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_29 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4812 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_31 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_10 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_10 = 0; + if (__pyx_t_33 < 0) { + __pyx_t_10 = 1; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_10 = 1; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L16:; + } + } + + /* "pandas/src/generated.pyx":4772 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4816 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_391group_last_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_390group_last_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_391group_last_bin_float64 = {__Pyx_NAMESTR("group_last_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_391group_last_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_390group_last_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_391group_last_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_390group_last_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_390group_last_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_bin_float64", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4828 + * ndarray[float64_t, ndim=2] resx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":4829 + * + * nobs = np.zeros_like(out) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":4831 + * resx = np.empty_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_5 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":4832 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4834 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":4836 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":4838 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":4839 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":4840 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":4841 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":4843 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4844 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":4845 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4848 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * resx[b, j] = val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":4849 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":4850 + * if val == val: + * nobs[b, j] += 1 + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/src/generated.pyx":4852 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":4853 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":4854 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":4855 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4857 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.wraparound(False) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_34 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L17:; + } + } + + /* "pandas/src/generated.pyx":4816 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4860 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_393group_last_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_392group_last_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_393group_last_bin_float32 = {__Pyx_NAMESTR("group_last_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_393group_last_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_392group_last_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_393group_last_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_last_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_last_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_last_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_last_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_392group_last_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_392group_last_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_last_bin_float32", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4872 + * ndarray[float32_t, ndim=2] resx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":4873 + * + * nobs = np.zeros_like(out) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":4875 + * resx = np.empty_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_5 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":4876 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4878 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":4880 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":4882 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":4883 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":4884 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":4885 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":4887 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4888 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":4889 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4892 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * resx[b, j] = val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":4893 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":4894 + * if val == val: + * nobs[b, j] += 1 + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/src/generated.pyx":4896 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":4897 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":4898 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":4899 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4901 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_resx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_resx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_34 < 0) { + __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L17:; + } + } + + /* "pandas/src/generated.pyx":4860 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_last_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4905 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_395group_nth_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_394group_nth_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_395group_nth_float64 = {__Pyx_NAMESTR("group_nth_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_395group_nth_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_394group_nth_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_395group_nth_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_float64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_394group_nth_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_394group_nth_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_float64", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4918 + * ndarray[int64_t, ndim=2] nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4919 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":4921 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":4922 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":4924 + * resx = np.empty_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":4926 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4927 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4928 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4929 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":4931 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4932 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4933 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4936 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4937 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if nobs[lab, j] == rank: + * resx[lab, j] = val + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/src/generated.pyx":4938 + * if val == val: + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4939 + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":4941 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4942 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4943 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4944 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4946 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L17:; + } + } + + /* "pandas/src/generated.pyx":4905 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4949 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_397group_nth_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_396group_nth_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_397group_nth_float32 = {__Pyx_NAMESTR("group_nth_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_397group_nth_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_396group_nth_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_397group_nth_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4952; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_float32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_396group_nth_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_396group_nth_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_float32", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":4962 + * ndarray[int64_t, ndim=2] nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4963 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":4965 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros(( out).shape, dtype=np.int64) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":4966 + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":4968 + * resx = np.empty_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_8 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_4 = __pyx_t_15(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":4970 + * N, K = ( values).shape + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4971 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":4972 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4973 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L6_continue; + } + + /* "pandas/src/generated.pyx":4975 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":4976 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4977 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":4980 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4981 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if nobs[lab, j] == rank: + * resx[lab, j] = val + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1; + + /* "pandas/src/generated.pyx":4982 + * if val == val: + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: # <<<<<<<<<<<<<< + * resx[lab, j] = val + * + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4983 + * nobs[lab, j] += 1 + * if nobs[lab, j] == rank: + * resx[lab, j] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L6_continue:; + } + + /* "pandas/src/generated.pyx":4985 + * resx[lab, j] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":4986 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_18 = __pyx_v_K; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { + __pyx_v_j = __pyx_t_19; + + /* "pandas/src/generated.pyx":4987 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":4988 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_31 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":4990 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L17:; + } + } + + /* "pandas/src/generated.pyx":4949 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":4994 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_399group_nth_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_398group_nth_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_399group_nth_bin_float64 = {__Pyx_NAMESTR("group_nth_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_399group_nth_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_398group_nth_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_399group_nth_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_398group_nth_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_398group_nth_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_bin_float64", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5006 + * ndarray[float64_t, ndim=2] resx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5007 + * + * nobs = np.zeros_like(out) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5009 + * resx = np.empty_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5010 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5012 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5014 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5016 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5017 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5018 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5019 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5021 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5022 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5023 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5026 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5027 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if nobs[b, j] == rank: + * resx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5028 + * if val == val: + * nobs[b, j] += 1 + * if nobs[b, j] == rank: # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5029 + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/src/generated.pyx":5031 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5032 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5033 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5034 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5036 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L18:; + } + } + + /* "pandas/src/generated.pyx":4994 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5039 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_401group_nth_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_400group_nth_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_401group_nth_bin_float32 = {__Pyx_NAMESTR("group_nth_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_401group_nth_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_400group_nth_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_401group_nth_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + __pyx_t_5numpy_int64_t __pyx_v_rank; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_nth_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,&__pyx_n_s_rank,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_nth_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + __pyx_v_rank = __Pyx_PyInt_As_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5042; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_nth_bin_float32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_nth_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_400group_nth_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins, __pyx_v_rank); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_400group_nth_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins, __pyx_t_5numpy_int64_t __pyx_v_rank) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_resx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_resx; + __Pyx_Buffer __pyx_pybuffer_resx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_nth_bin_float32", 0); + __pyx_pybuffer_resx.pybuffer.buf = NULL; + __pyx_pybuffer_resx.refcount = 0; + __pyx_pybuffernd_resx.data = NULL; + __pyx_pybuffernd_resx.rcbuffer = &__pyx_pybuffer_resx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5051 + * ndarray[float32_t, ndim=2] resx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * resx = np.empty_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5052 + * + * nobs = np.zeros_like(out) + * resx = np.empty_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_resx.rcbuffer->pybuffer, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_resx.diminfo[0].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_resx.diminfo[0].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_resx.diminfo[1].strides = __pyx_pybuffernd_resx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_resx.diminfo[1].shape = __pyx_pybuffernd_resx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_resx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5054 + * resx = np.empty_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5055 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5057 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5059 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5061 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5062 + * + * b = 0 + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5063 + * b = 0 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5064 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5066 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5067 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5068 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5071 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5072 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if nobs[b, j] == rank: + * resx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5073 + * if val == val: + * nobs[b, j] += 1 + * if nobs[b, j] == rank: # <<<<<<<<<<<<<< + * resx[b, j] = val + * + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[1].strides)) == __pyx_v_rank) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5074 + * nobs[b, j] += 1 + * if nobs[b, j] == rank: + * resx[b, j] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_resx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + } + + /* "pandas/src/generated.pyx":5076 + * resx[b, j] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5077 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5078 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = __pyx_v_j; + __pyx_t_17 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5079 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = resx[i, j] + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5081 + * out[i, j] = nan + * else: + * out[i, j] = resx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_34 = __pyx_v_j; + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_resx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_resx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_resx.diminfo[1].strides)); + } + __pyx_L18:; + } + } + + /* "pandas/src/generated.pyx":5039 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_nth_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_resx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_resx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5085 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_403group_add_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_402group_add_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_403group_add_float64 = {__Pyx_NAMESTR("group_add_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_403group_add_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_402group_add_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_403group_add_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_add_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_add_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_add_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_402group_add_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_402group_add_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_add_float64", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5097 + * ndarray[float64_t, ndim=2] sumx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5098 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5100 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5101 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5103 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5105 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5106 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5107 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5108 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5109 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5111 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5112 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5113 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5116 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5117 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5118 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5120 + * sumx[lab, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5121 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5122 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5123 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5125 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5126 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5129 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5130 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5131 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5133 + * sumx[lab, 0] += val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5134 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5135 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5136 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5138 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_sumx.diminfo[1].strides)); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5085 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_add_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5141 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_405group_add_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_404group_add_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_405group_add_float32 = {__Pyx_NAMESTR("group_add_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_405group_add_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_404group_add_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_405group_add_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_add_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_add_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_add_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_404group_add_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_404group_add_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_add_float32", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5153 + * ndarray[float32_t, ndim=2] sumx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5154 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5156 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5157 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5159 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5161 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5162 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5163 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5164 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5165 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5167 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5168 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5169 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5172 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5173 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5174 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5176 + * sumx[lab, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5177 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5178 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5179 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5181 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5182 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5185 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5186 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5187 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5189 + * sumx[lab, 0] += val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5190 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5191 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5192 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5194 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_sumx.diminfo[1].strides)); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5141 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_add_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_407group_add_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_406group_add_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_407group_add_bin_float64 = {__Pyx_NAMESTR("group_add_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_407group_add_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_406group_add_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_407group_add_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_add_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_add_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_add_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_406group_add_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_406group_add_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_add_bin_float64", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5210 + * ndarray[float64_t, ndim=2] sumx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5211 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5213 + * sumx = np.zeros_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5214 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5216 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5217 + * else: + * ngroups = len(bins) + 1 + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5219 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5220 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5221 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5222 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5223 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5225 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5226 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5227 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5230 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5231 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5232 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5234 + * sumx[b, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5235 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5236 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5238 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5239 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5242 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5243 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5244 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5246 + * sumx[b, 0] += val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5247 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5248 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5249 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5251 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_sumx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_add_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5254 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_409group_add_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_408group_add_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_409group_add_bin_float32 = {__Pyx_NAMESTR("group_add_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_409group_add_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_408group_add_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_409group_add_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_add_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_add_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_add_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_add_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_408group_add_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_408group_add_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_add_bin_float32", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5266 + * ndarray[float32_t, ndim=2] sumx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5267 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5269 + * sumx = np.zeros_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5270 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5272 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5273 + * else: + * ngroups = len(bins) + 1 + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5275 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5276 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5277 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5278 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5279 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5281 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5282 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5283 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5286 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5287 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5288 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5290 + * sumx[b, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5291 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5292 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5294 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5295 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5298 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5299 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5300 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5302 + * sumx[b, 0] += val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5303 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5304 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5305 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5307 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_sumx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5254 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_add_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5311 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_411group_prod_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_410group_prod_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_411group_prod_float64 = {__Pyx_NAMESTR("group_prod_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_411group_prod_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_410group_prod_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_411group_prod_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_prod_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_prod_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_prod_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_410group_prod_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_410group_prod_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_prodx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx; + __Pyx_Buffer __pyx_pybuffer_prodx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_prod_float64", 0); + __pyx_pybuffer_prodx.pybuffer.buf = NULL; + __pyx_pybuffer_prodx.refcount = 0; + __pyx_pybuffernd_prodx.data = NULL; + __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5323 + * ndarray[float64_t, ndim=2] prodx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5324 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5326 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * prodx = np.ones_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5327 + * + * nobs = np.zeros_like(out) + * prodx = np.ones_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_prodx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5329 + * prodx = np.ones_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5331 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5332 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5333 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5334 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5335 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5337 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5338 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5339 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5342 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * prodx[lab, j] *= val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5343 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * prodx[lab, j] *= val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5344 + * if val == val: + * nobs[lab, j] += 1 + * prodx[lab, j] *= val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5346 + * prodx[lab, j] *= val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5347 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5348 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5349 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5351 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5352 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5355 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * prodx[lab, 0] *= val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5356 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * prodx[lab, 0] *= val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5357 + * if val == val: + * nobs[lab, 0] += 1 + * prodx[lab, 0] *= val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5359 + * prodx[lab, 0] *= val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5360 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5361 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5362 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = prodx[i, j] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5364 + * out[i, j] = nan + * else: + * out[i, j] = prodx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_prodx.diminfo[1].strides)); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5311 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_prod_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_prodx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5367 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_413group_prod_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_412group_prod_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_413group_prod_float32 = {__Pyx_NAMESTR("group_prod_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_413group_prod_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_412group_prod_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_413group_prod_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_prod_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_prod_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_prod_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_412group_prod_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_412group_prod_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_prodx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx; + __Pyx_Buffer __pyx_pybuffer_prodx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_prod_float32", 0); + __pyx_pybuffer_prodx.pybuffer.buf = NULL; + __pyx_pybuffer_prodx.refcount = 0; + __pyx_pybuffernd_prodx.data = NULL; + __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5379 + * ndarray[float32_t, ndim=2] prodx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5380 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5382 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * prodx = np.ones_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5383 + * + * nobs = np.zeros_like(out) + * prodx = np.ones_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_prodx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5385 + * prodx = np.ones_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5387 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5388 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5389 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5390 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5391 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5393 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5394 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5395 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5398 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * prodx[lab, j] *= val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5399 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * prodx[lab, j] *= val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5400 + * if val == val: + * nobs[lab, j] += 1 + * prodx[lab, j] *= val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5402 + * prodx[lab, j] *= val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5403 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5404 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5405 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5407 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5408 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5411 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * prodx[lab, 0] *= val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5412 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * prodx[lab, 0] *= val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5413 + * if val == val: + * nobs[lab, 0] += 1 + * prodx[lab, 0] *= val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5415 + * prodx[lab, 0] *= val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5416 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5417 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5418 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = prodx[i, j] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5420 + * out[i, j] = nan + * else: + * out[i, j] = prodx[i, j] # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_prodx.diminfo[1].strides)); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5367 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_prod_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_prodx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_415group_prod_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_414group_prod_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_415group_prod_bin_float64 = {__Pyx_NAMESTR("group_prod_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_415group_prod_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_414group_prod_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_415group_prod_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_prod_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_prod_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_414group_prod_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_414group_prod_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_prodx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx; + __Pyx_Buffer __pyx_pybuffer_prodx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_prod_bin_float64", 0); + __pyx_pybuffer_prodx.pybuffer.buf = NULL; + __pyx_pybuffer_prodx.refcount = 0; + __pyx_pybuffernd_prodx.data = NULL; + __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5436 + * ndarray[float64_t, ndim=2] prodx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * prodx = np.ones_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5437 + * + * nobs = np.zeros_like(out) + * prodx = np.ones_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_prodx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5439 + * prodx = np.ones_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5440 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5442 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5443 + * else: + * ngroups = len(bins) + 1 + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5445 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5446 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5447 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5448 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5449 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5451 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5452 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5453 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5456 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * prodx[b, j] *= val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5457 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * prodx[b, j] *= val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5458 + * if val == val: + * nobs[b, j] += 1 + * prodx[b, j] *= val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5460 + * prodx[b, j] *= val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5461 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5462 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5464 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5465 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5468 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * prodx[b, 0] *= val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5469 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * prodx[b, 0] *= val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5470 + * if val == val: + * nobs[b, 0] += 1 + * prodx[b, 0] *= val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5472 + * prodx[b, 0] *= val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5473 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5474 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5475 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = prodx[i, j] + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5477 + * out[i, j] = nan + * else: + * out[i, j] = prodx[i, j] # <<<<<<<<<<<<<< + * @cython.boundscheck(False) + * @cython.wraparound(False) + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_prodx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_prod_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_prodx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5480 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_417group_prod_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_416group_prod_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_417group_prod_bin_float32 = {__Pyx_NAMESTR("group_prod_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_417group_prod_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_416group_prod_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_417group_prod_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_prod_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_prod_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_prod_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_prod_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_416group_prod_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_416group_prod_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_prodx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_prodx; + __Pyx_Buffer __pyx_pybuffer_prodx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_prod_bin_float32", 0); + __pyx_pybuffer_prodx.pybuffer.buf = NULL; + __pyx_pybuffer_prodx.refcount = 0; + __pyx_pybuffernd_prodx.data = NULL; + __pyx_pybuffernd_prodx.rcbuffer = &__pyx_pybuffer_prodx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5492 + * ndarray[float32_t, ndim=2] prodx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * prodx = np.ones_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5493 + * + * nobs = np.zeros_like(out) + * prodx = np.ones_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_prodx.diminfo[0].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prodx.diminfo[0].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prodx.diminfo[1].strides = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prodx.diminfo[1].shape = __pyx_pybuffernd_prodx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_prodx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5495 + * prodx = np.ones_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5496 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5498 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * N, K = ( values).shape + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5499 + * else: + * ngroups = len(bins) + 1 + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5501 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5502 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5503 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5504 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5505 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5507 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5508 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5509 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5512 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * prodx[b, j] *= val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5513 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * prodx[b, j] *= val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5514 + * if val == val: + * nobs[b, j] += 1 + * prodx[b, j] *= val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5516 + * prodx[b, j] *= val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5517 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5518 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5520 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5521 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5524 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * prodx[b, 0] *= val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5525 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * prodx[b, 0] *= val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5526 + * if val == val: + * nobs[b, 0] += 1 + * prodx[b, 0] *= val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_prodx.diminfo[1].strides) *= __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5528 + * prodx[b, 0] *= val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5529 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5530 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5531 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = prodx[i, j] + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5533 + * out[i, j] = nan + * else: + * out[i, j] = prodx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_prodx.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_prodx.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_prodx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5480 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_prod_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prodx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_prodx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5537 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_419group_var_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_419group_var_float64 = {__Pyx_NAMESTR("group_var_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_419group_var_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_419group_var_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_var_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_var_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_var_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_418group_var_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_418group_var_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_ct; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_sumxx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx; + __Pyx_Buffer __pyx_pybuffer_sumxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + __pyx_t_5numpy_float64_t __pyx_t_46; + __pyx_t_5numpy_float64_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_var_float64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_sumxx.pybuffer.buf = NULL; + __pyx_pybuffer_sumxx.refcount = 0; + __pyx_pybuffernd_sumxx.data = NULL; + __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5546 + * ndarray[float64_t, ndim=2] nobs, sumx, sumxx + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5547 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__200, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5549 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5550 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumxx = np.zeros_like(out) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5551 + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":5553 + * sumxx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5555 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5556 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5558 + * for i in range(N): + * + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5559 + * + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5560 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5562 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5564 + * counts[lab] += 1 + * + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5565 + * + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5568 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5569 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * sumxx[lab, j] += val * val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5570 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * sumxx[lab, j] += val * val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5571 + * nobs[lab, j] += 1 + * sumx[lab, j] += val + * sumxx[lab, j] += val * val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5573 + * sumxx[lab, j] += val * val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5575 + * for i in range(N): + * + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5576 + * + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5577 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5579 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * # not nan + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5580 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5582 + * val = values[i, 0] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5583 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * sumxx[lab, 0] += val * val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5584 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * sumxx[lab, 0] += val * val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5585 + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + * sumxx[lab, 0] += val * val # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5588 + * + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * ct = nobs[i, j] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5589 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * ct = nobs[i, j] + * if ct < 2: + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":5590 + * for i in range(len(counts)): + * for j in range(K): + * ct = nobs[i, j] # <<<<<<<<<<<<<< + * if ct < 2: + * out[i, j] = nan + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5591 + * for j in range(K): + * ct = nobs[i, j] + * if ct < 2: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_3 = ((__pyx_v_ct < 2.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5592 + * ct = nobs[i, j] + * if ct < 2: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5594 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * @cython.wraparound(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + __pyx_t_46 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[1].strides)))); + + /* "pandas/src/generated.pyx":5595 + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + * (ct * ct - ct)) # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_47 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct); + + /* "pandas/src/generated.pyx":5594 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * @cython.wraparound(False) + */ + if (unlikely(__pyx_t_47 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_46 / __pyx_t_47); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5537 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_var_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_sumxx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_421group_var_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_421group_var_float32 = {__Pyx_NAMESTR("group_var_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_421group_var_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_421group_var_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_var_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_var_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_var_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_420group_var_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_420group_var_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_ct; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_sumxx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx; + __Pyx_Buffer __pyx_pybuffer_sumxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + __pyx_t_5numpy_float32_t __pyx_t_46; + __pyx_t_5numpy_float32_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_var_float32", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_sumxx.pybuffer.buf = NULL; + __pyx_pybuffer_sumxx.refcount = 0; + __pyx_pybuffernd_sumxx.data = NULL; + __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5607 + * ndarray[float32_t, ndim=2] nobs, sumx, sumxx + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5608 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5610 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5611 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumxx = np.zeros_like(out) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5612 + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":5614 + * sumxx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5616 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5617 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5619 + * for i in range(N): + * + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5620 + * + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5621 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5623 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5625 + * counts[lab] += 1 + * + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5626 + * + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5629 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5630 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * sumxx[lab, j] += val * val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5631 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * sumxx[lab, j] += val * val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5632 + * nobs[lab, j] += 1 + * sumx[lab, j] += val + * sumxx[lab, j] += val * val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5634 + * sumxx[lab, j] += val * val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5636 + * for i in range(N): + * + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5637 + * + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5638 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5640 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * # not nan + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5641 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5643 + * val = values[i, 0] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5644 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * sumxx[lab, 0] += val * val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5645 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * sumxx[lab, 0] += val * val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5646 + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + * sumxx[lab, 0] += val * val # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5649 + * + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * ct = nobs[i, j] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5650 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * ct = nobs[i, j] + * if ct < 2: + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":5651 + * for i in range(len(counts)): + * for j in range(K): + * ct = nobs[i, j] # <<<<<<<<<<<<<< + * if ct < 2: + * out[i, j] = nan + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5652 + * for j in range(K): + * ct = nobs[i, j] + * if ct < 2: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_3 = ((__pyx_v_ct < 2.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5653 + * ct = nobs[i, j] + * if ct < 2: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5655 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + __pyx_t_46 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[1].strides)))); + + /* "pandas/src/generated.pyx":5656 + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + * (ct * ct - ct)) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_47 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct); + + /* "pandas/src/generated.pyx":5655 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * + */ + if (unlikely(__pyx_t_47 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = __pyx_v_i; + __pyx_t_49 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_46 / __pyx_t_47); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_var_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_sumxx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5660 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_423group_var_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_423group_var_bin_float64 = {__Pyx_NAMESTR("group_var_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_423group_var_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_423group_var_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_var_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_var_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_var_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_422group_var_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_422group_var_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_ct; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_sumxx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx; + __Pyx_Buffer __pyx_pybuffer_sumxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_float64_t __pyx_t_49; + __pyx_t_5numpy_float64_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_var_bin_float64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_sumxx.pybuffer.buf = NULL; + __pyx_pybuffer_sumxx.refcount = 0; + __pyx_pybuffernd_sumxx.data = NULL; + __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5670 + * ndarray[float64_t, ndim=2] nobs, sumx, sumxx + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5671 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumxx = np.zeros_like(out) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5672 + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":5674 + * sumxx = np.zeros_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5675 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5677 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5679 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5681 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5682 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5683 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5684 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5685 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5687 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5689 + * counts[b] += 1 + * + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5690 + * + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5693 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5694 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * sumxx[b, j] += val * val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5695 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * sumxx[b, j] += val * val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5696 + * nobs[b, j] += 1 + * sumx[b, j] += val + * sumxx[b, j] += val * val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5698 + * sumxx[b, j] += val * val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5699 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5700 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5702 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5703 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5706 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5707 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * sumxx[b, 0] += val * val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5708 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * sumxx[b, 0] += val * val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5709 + * nobs[b, 0] += 1 + * sumx[b, 0] += val + * sumxx[b, 0] += val * val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5711 + * sumxx[b, 0] += val * val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * ct = nobs[i, j] + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5712 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * ct = nobs[i, j] + * if ct < 2: + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":5713 + * for i in range(ngroups): + * for j in range(K): + * ct = nobs[i, j] # <<<<<<<<<<<<<< + * if ct < 2: + * out[i, j] = nan + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5714 + * for j in range(K): + * ct = nobs[i, j] + * if ct < 2: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_16 = ((__pyx_v_ct < 2.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5715 + * ct = nobs[i, j] + * if ct < 2: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5717 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * @cython.wraparound(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + __pyx_t_47 = __pyx_v_i; + __pyx_t_48 = __pyx_v_j; + __pyx_t_49 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_sumx.diminfo[1].strides)))); + + /* "pandas/src/generated.pyx":5718 + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + * (ct * ct - ct)) # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_50 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct); + + /* "pandas/src/generated.pyx":5717 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * @cython.wraparound(False) + */ + if (unlikely(__pyx_t_50 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_51 = __pyx_v_i; + __pyx_t_52 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_49 / __pyx_t_50); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5660 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_var_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_sumxx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_425group_var_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_425group_var_bin_float32 = {__Pyx_NAMESTR("group_var_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_425group_var_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_425group_var_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_var_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_var_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_var_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_var_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_424group_var_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_424group_var_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_ct; + PyArrayObject *__pyx_v_nobs = 0; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_sumxx = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumxx; + __Pyx_Buffer __pyx_pybuffer_sumxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + __pyx_t_5numpy_float32_t __pyx_t_49; + __pyx_t_5numpy_float32_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_var_bin_float32", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_sumxx.pybuffer.buf = NULL; + __pyx_pybuffer_sumxx.refcount = 0; + __pyx_pybuffernd_sumxx.data = NULL; + __pyx_pybuffernd_sumxx.rcbuffer = &__pyx_pybuffer_sumxx; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5731 + * ndarray[float32_t, ndim=2] nobs, sumx, sumxx + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5732 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumxx = np.zeros_like(out) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5733 + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) + * sumxx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_sumxx.diminfo[0].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumxx.diminfo[0].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumxx.diminfo[1].strides = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumxx.diminfo[1].shape = __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":5735 + * sumxx = np.zeros_like(out) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5736 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5738 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":5740 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":5742 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5743 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":5744 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5745 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5746 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5748 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * + * for j in range(K): + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5750 + * counts[b] += 1 + * + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5751 + * + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5754 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5755 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * sumxx[b, j] += val * val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5756 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * sumxx[b, j] += val * val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5757 + * nobs[b, j] += 1 + * sumx[b, j] += val + * sumxx[b, j] += val * val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5759 + * sumxx[b, j] += val * val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5760 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5761 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5763 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5764 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5767 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5768 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * sumxx[b, 0] += val * val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5769 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * sumxx[b, 0] += val * val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + + /* "pandas/src/generated.pyx":5770 + * nobs[b, 0] += 1 + * sumx[b, 0] += val + * sumxx[b, 0] += val * val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_sumxx.diminfo[1].strides) += (__pyx_v_val * __pyx_v_val); + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5772 + * sumxx[b, 0] += val * val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * ct = nobs[i, j] + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":5773 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * ct = nobs[i, j] + * if ct < 2: + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":5774 + * for i in range(ngroups): + * for j in range(K): + * ct = nobs[i, j] # <<<<<<<<<<<<<< + * if ct < 2: + * out[i, j] = nan + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5775 + * for j in range(K): + * ct = nobs[i, j] + * if ct < 2: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_16 = ((__pyx_v_ct < 2.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5776 + * ct = nobs[i, j] + * if ct < 2: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5778 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + __pyx_t_47 = __pyx_v_i; + __pyx_t_48 = __pyx_v_j; + __pyx_t_49 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_sumxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_sumxx.diminfo[1].strides))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_sumx.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_sumx.diminfo[1].strides)))); + + /* "pandas/src/generated.pyx":5779 + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / + * (ct * ct - ct)) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_50 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct); + + /* "pandas/src/generated.pyx":5778 + * out[i, j] = nan + * else: + * out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) / # <<<<<<<<<<<<<< + * (ct * ct - ct)) + * + */ + if (unlikely(__pyx_t_50 == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_51 = __pyx_v_i; + __pyx_t_52 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_49 / __pyx_t_50); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_var_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_sumxx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5783 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_427group_mean_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_427group_mean_float64 = {__Pyx_NAMESTR("group_mean_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_427group_mean_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_427group_mean_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_mean_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_mean_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_mean_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_426group_mean_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_426group_mean_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_count; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + __pyx_t_5numpy_float64_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_mean_float64", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5792 + * ndarray[float64_t, ndim=2] sumx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5793 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5795 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5796 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5798 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5800 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5801 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5802 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5803 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5804 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5806 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5807 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * # not nan + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5808 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5810 + * val = values[i, j] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5811 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5812 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5814 + * sumx[lab, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5815 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5816 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5817 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5819 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * # not nan + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5820 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5822 + * val = values[i, 0] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5823 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5824 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5826 + * sumx[lab, 0] += val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * count = nobs[i, j] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5827 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * count = nobs[i, j] + * if nobs[i, j] == 0: + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5828 + * for i in range(len(counts)): + * for j in range(K): + * count = nobs[i, j] # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5829 + * for j in range(K): + * count = nobs[i, j] + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5830 + * count = nobs[i, j] + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] / count + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5832 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] / count # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + __pyx_t_40 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[1].strides)); + if (unlikely(__pyx_v_count == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_40 / __pyx_v_count); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5783 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_mean_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5835 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_429group_mean_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_429group_mean_float32 = {__Pyx_NAMESTR("group_mean_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_429group_mean_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_429group_mean_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_mean_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_mean_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_mean_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_428group_mean_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_428group_mean_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_count; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + __pyx_t_5numpy_float32_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_mean_float32", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5844 + * ndarray[float32_t, ndim=2] sumx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5845 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":5847 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":5848 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":5850 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":5852 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5853 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5854 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5855 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5856 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":5858 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5859 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * # not nan + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":5860 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5862 + * val = values[i, j] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * sumx[lab, j] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5863 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * sumx[lab, j] += val + * else: + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5864 + * if val == val: + * nobs[lab, j] += 1 + * sumx[lab, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5866 + * sumx[lab, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5867 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":5868 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5869 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L13_continue; + } + + /* "pandas/src/generated.pyx":5871 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * # not nan + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5872 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * # not nan + * if val == val: + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5874 + * val = values[i, 0] + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5875 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * sumx[lab, 0] += val + * + */ + __pyx_t_26 = __pyx_v_lab; + __pyx_t_27 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5876 + * if val == val: + * nobs[lab, 0] += 1 + * sumx[lab, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L13_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5878 + * sumx[lab, 0] += val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * count = nobs[i, j] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":5879 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * count = nobs[i, j] + * if nobs[i, j] == 0: + */ + __pyx_t_30 = __pyx_v_K; + for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { + __pyx_v_j = __pyx_t_31; + + /* "pandas/src/generated.pyx":5880 + * for i in range(len(counts)): + * for j in range(K): + * count = nobs[i, j] # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_j; + __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5881 + * for j in range(K): + * count = nobs[i, j] + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":5882 + * count = nobs[i, j] + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] / count + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5884 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] / count # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + __pyx_t_40 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_sumx.diminfo[1].strides)); + if (unlikely(__pyx_v_count == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_40 / __pyx_v_count); + } + __pyx_L21:; + } + } + + /* "pandas/src/generated.pyx":5835 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_mean_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5887 + * + * + * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_431group_mean_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_431group_mean_bin_float64 = {__Pyx_NAMESTR("group_mean_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_431group_mean_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_431group_mean_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_mean_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_mean_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_430group_mean_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_430group_mean_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_count; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + __pyx_t_5numpy_float64_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_mean_bin_float64", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5896 + * ndarray[float64_t, ndim=2] sumx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5897 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5899 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_12; + + /* "pandas/src/generated.pyx":5900 + * + * N, K = ( values).shape + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = (__pyx_t_12 - 1); + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0); + if (__pyx_t_14) { + + /* "pandas/src/generated.pyx":5901 + * N, K = ( values).shape + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_13; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5903 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_13 + 1); + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":5905 + * ngroups = len(bins) + 1 + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5906 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_14 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_14) { + + /* "pandas/src/generated.pyx":5907 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5908 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_14 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_14) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5909 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5911 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5912 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5913 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5916 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5917 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5918 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5920 + * sumx[b, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5921 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_14; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5922 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5924 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5925 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5928 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5929 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + __pyx_t_5 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5930 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + __pyx_t_5 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5932 + * sumx[b, 0] += val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * count = nobs[i, j] + */ + __pyx_t_13 = __pyx_v_ngroups; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5933 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * count = nobs[i, j] + * if nobs[i, j] == 0: + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5934 + * for i in range(ngroups): + * for j in range(K): + * count = nobs[i, j] # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5935 + * for j in range(K): + * count = nobs[i, j] + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5936 + * count = nobs[i, j] + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] / count + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5938 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] / count # <<<<<<<<<<<<<< + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[1].strides)); + if (unlikely(__pyx_v_count == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_43 / __pyx_v_count); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5887 + * + * + * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_mean_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5940 + * out[i, j] = sumx[i, j] / count + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_433group_mean_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_433group_mean_bin_float32 = {__Pyx_NAMESTR("group_mean_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_433group_mean_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_433group_mean_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_mean_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_mean_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_mean_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_mean_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_432group_mean_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_432group_mean_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_count; + PyArrayObject *__pyx_v_sumx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sumx; + __Pyx_Buffer __pyx_pybuffer_sumx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + __pyx_t_5numpy_float32_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_mean_bin_float32", 0); + __pyx_pybuffer_sumx.pybuffer.buf = NULL; + __pyx_pybuffer_sumx.refcount = 0; + __pyx_pybuffernd_sumx.data = NULL; + __pyx_pybuffernd_sumx.rcbuffer = &__pyx_pybuffer_sumx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":5949 + * ndarray[float32_t, ndim=2] sumx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * sumx = np.zeros_like(out) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":5950 + * + * nobs = np.zeros_like(out) + * sumx = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_sumx.diminfo[0].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sumx.diminfo[0].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sumx.diminfo[1].strides = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sumx.diminfo[1].shape = __pyx_pybuffernd_sumx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":5952 + * sumx = np.zeros_like(out) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_12; + + /* "pandas/src/generated.pyx":5953 + * + * N, K = ( values).shape + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = (__pyx_t_12 - 1); + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_13) != 0); + if (__pyx_t_14) { + + /* "pandas/src/generated.pyx":5954 + * N, K = ( values).shape + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_13; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5956 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_13 + 1); + } + __pyx_L5:; + + /* "pandas/src/generated.pyx":5958 + * ngroups = len(bins) + 1 + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":5959 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_14 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_14) { + + /* "pandas/src/generated.pyx":5960 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5961 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_14 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_14) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":5962 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5964 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5965 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":5966 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5969 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * sumx[b, j] += val + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":5970 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * sumx[b, j] += val + * else: + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5971 + * if val == val: + * nobs[b, j] += 1 + * sumx[b, j] += val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5973 + * sumx[b, j] += val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_13 = __pyx_v_N; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5974 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_bins.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_bins.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_14; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":5975 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":5977 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + __pyx_t_5 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":5978 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 0; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_values.diminfo[1].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_values.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5981 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * sumx[b, 0] += val + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5982 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * sumx[b, 0] += val + * + */ + __pyx_t_29 = __pyx_v_b; + __pyx_t_30 = 0; + __pyx_t_5 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":5983 + * if val == val: + * nobs[b, 0] += 1 + * sumx[b, 0] += val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + __pyx_t_5 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_sumx.diminfo[1].strides) += __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":5985 + * sumx[b, 0] += val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * count = nobs[i, j] + */ + __pyx_t_13 = __pyx_v_ngroups; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/generated.pyx":5986 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * count = nobs[i, j] + * if nobs[i, j] == 0: + */ + __pyx_t_33 = __pyx_v_K; + for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) { + __pyx_v_j = __pyx_t_34; + + /* "pandas/src/generated.pyx":5987 + * for i in range(ngroups): + * for j in range(K): + * count = nobs[i, j] # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_36 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":5988 + * for j in range(K): + * count = nobs[i, j] + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_nobs.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_nobs.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_nobs.diminfo[1].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_nobs.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":5989 + * count = nobs[i, j] + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = sumx[i, j] / count + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":5991 + * out[i, j] = nan + * else: + * out[i, j] = sumx[i, j] / count # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_41 < 0) { + __pyx_t_41 += __pyx_pybuffernd_sumx.diminfo[0].shape; + if (unlikely(__pyx_t_41 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_sumx.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_sumx.diminfo[1].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_sumx.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_sumx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_sumx.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_sumx.diminfo[1].strides)); + if (unlikely(__pyx_v_count == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_j; + __pyx_t_5 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_5 = 0; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_out.diminfo[1].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_5 = 1; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_out.diminfo[1].shape)) __pyx_t_5 = 1; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_out.diminfo[1].strides) = (__pyx_t_43 / __pyx_v_count); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5940 + * out[i, j] = sumx[i, j] / count + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_mean_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sumx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_sumx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":5995 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_435group_min_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_434group_min_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_435group_min_float64 = {__Pyx_NAMESTR("group_min_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_435group_min_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_434group_min_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_435group_min_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_min_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_min_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_min_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_434group_min_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_434group_min_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_minx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minx; + __Pyx_Buffer __pyx_pybuffer_minx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_min_float64", 0); + __pyx_pybuffer_minx.pybuffer.buf = NULL; + __pyx_pybuffer_minx.refcount = 0; + __pyx_pybuffernd_minx.data = NULL; + __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6007 + * ndarray[float64_t, ndim=2] minx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6008 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6010 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * minx = np.empty_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6012 + * nobs = np.zeros_like(out) + * + * minx = np.empty_like(out) # <<<<<<<<<<<<<< + * minx.fill(np.inf) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_minx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6013 + * + * minx = np.empty_like(out) + * minx.fill(np.inf) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":6015 + * minx.fill(np.inf) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6017 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6018 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6019 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6020 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6021 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":6023 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6024 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":6025 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6028 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if val < minx[lab, j]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6029 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if val < minx[lab, j]: + * minx[lab, j] = val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6030 + * if val == val: + * nobs[lab, j] += 1 + * if val < minx[lab, j]: # <<<<<<<<<<<<<< + * minx[lab, j] = val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6031 + * nobs[lab, j] += 1 + * if val < minx[lab, j]: + * minx[lab, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6033 + * minx[lab, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6034 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6035 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6036 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/generated.pyx":6038 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6039 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6042 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6043 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * if val < minx[lab, 0]: + * minx[lab, 0] = val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6044 + * if val == val: + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: # <<<<<<<<<<<<<< + * minx[lab, 0] = val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6045 + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: + * minx[lab, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6047 + * minx[lab, 0] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6048 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":6049 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6050 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = minx[i, j] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6052 + * out[i, j] = nan + * else: + * out[i, j] = minx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_minx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":5995 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_min_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_minx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6055 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_437group_min_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_436group_min_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_437group_min_float32 = {__Pyx_NAMESTR("group_min_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_437group_min_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_436group_min_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_437group_min_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_min_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_min_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_min_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_436group_min_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_436group_min_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_minx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minx; + __Pyx_Buffer __pyx_pybuffer_minx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_min_float32", 0); + __pyx_pybuffer_minx.pybuffer.buf = NULL; + __pyx_pybuffer_minx.refcount = 0; + __pyx_pybuffernd_minx.data = NULL; + __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6067 + * ndarray[float32_t, ndim=2] minx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6068 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6070 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * minx = np.empty_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6072 + * nobs = np.zeros_like(out) + * + * minx = np.empty_like(out) # <<<<<<<<<<<<<< + * minx.fill(np.inf) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_minx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6073 + * + * minx = np.empty_like(out) + * minx.fill(np.inf) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/generated.pyx":6075 + * minx.fill(np.inf) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6077 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6078 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6079 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6080 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6081 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":6083 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6084 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":6085 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6088 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if val < minx[lab, j]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6089 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if val < minx[lab, j]: + * minx[lab, j] = val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6090 + * if val == val: + * nobs[lab, j] += 1 + * if val < minx[lab, j]: # <<<<<<<<<<<<<< + * minx[lab, j] = val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6091 + * nobs[lab, j] += 1 + * if val < minx[lab, j]: + * minx[lab, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6093 + * minx[lab, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6094 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6095 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6096 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/generated.pyx":6098 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6099 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6102 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6103 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * if val < minx[lab, 0]: + * minx[lab, 0] = val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6104 + * if val == val: + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: # <<<<<<<<<<<<<< + * minx[lab, 0] = val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + __pyx_t_3 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6105 + * nobs[lab, 0] += 1 + * if val < minx[lab, 0]: + * minx[lab, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6107 + * minx[lab, 0] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6108 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":6109 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6110 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = minx[i, j] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6112 + * out[i, j] = nan + * else: + * out[i, j] = minx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_minx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":6055 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_min_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_minx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6116 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_439group_min_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_438group_min_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_439group_min_bin_float64 = {__Pyx_NAMESTR("group_min_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_439group_min_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_438group_min_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_439group_min_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_min_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_min_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_min_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_438group_min_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_438group_min_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_minx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minx; + __Pyx_Buffer __pyx_pybuffer_minx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_min_bin_float64", 0); + __pyx_pybuffer_minx.pybuffer.buf = NULL; + __pyx_pybuffer_minx.refcount = 0; + __pyx_pybuffernd_minx.data = NULL; + __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6128 + * ndarray[float64_t, ndim=2] minx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * minx = np.empty_like(out) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6130 + * nobs = np.zeros_like(out) + * + * minx = np.empty_like(out) # <<<<<<<<<<<<<< + * minx.fill(np.inf) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_minx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":6131 + * + * minx = np.empty_like(out) + * minx.fill(np.inf) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":6133 + * minx.fill(np.inf) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6134 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6136 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6138 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":6140 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6141 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6142 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6143 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":6144 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6146 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6147 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":6148 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6151 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if val < minx[b, j]: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6152 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if val < minx[b, j]: + * minx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6153 + * if val == val: + * nobs[b, j] += 1 + * if val < minx[b, j]: # <<<<<<<<<<<<<< + * minx[b, j] = val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6154 + * nobs[b, j] += 1 + * if val < minx[b, j]: + * minx[b, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6156 + * minx[b, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6157 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6158 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6160 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6161 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6164 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * if val < minx[b, 0]: + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6165 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * if val < minx[b, 0]: + * minx[b, 0] = val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6166 + * if val == val: + * nobs[b, 0] += 1 + * if val < minx[b, 0]: # <<<<<<<<<<<<<< + * minx[b, 0] = val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + __pyx_t_16 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6167 + * nobs[b, 0] += 1 + * if val < minx[b, 0]: + * minx[b, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6169 + * minx[b, 0] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6170 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":6171 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6172 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = minx[i, j] + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6174 + * out[i, j] = nan + * else: + * out[i, j] = minx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_minx.diminfo[1].strides)); + } + __pyx_L25:; + } + } + + /* "pandas/src/generated.pyx":6116 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_min_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_minx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6177 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_441group_min_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_440group_min_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_441group_min_bin_float32 = {__Pyx_NAMESTR("group_min_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_441group_min_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_440group_min_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_441group_min_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_min_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_min_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_min_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_min_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_440group_min_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_440group_min_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_minx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minx; + __Pyx_Buffer __pyx_pybuffer_minx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_min_bin_float32", 0); + __pyx_pybuffer_minx.pybuffer.buf = NULL; + __pyx_pybuffer_minx.refcount = 0; + __pyx_pybuffernd_minx.data = NULL; + __pyx_pybuffernd_minx.rcbuffer = &__pyx_pybuffer_minx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6189 + * ndarray[float32_t, ndim=2] minx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * minx = np.empty_like(out) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6191 + * nobs = np.zeros_like(out) + * + * minx = np.empty_like(out) # <<<<<<<<<<<<<< + * minx.fill(np.inf) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minx.rcbuffer->pybuffer, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_minx.diminfo[0].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minx.diminfo[0].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minx.diminfo[1].strides = __pyx_pybuffernd_minx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minx.diminfo[1].shape = __pyx_pybuffernd_minx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_minx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":6192 + * + * minx = np.empty_like(out) + * minx.fill(np.inf) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_minx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/generated.pyx":6194 + * minx.fill(np.inf) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6195 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6197 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6199 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":6201 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6202 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6203 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6204 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":6205 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6207 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6208 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":6209 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6212 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if val < minx[b, j]: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6213 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if val < minx[b, j]: + * minx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6214 + * if val == val: + * nobs[b, j] += 1 + * if val < minx[b, j]: # <<<<<<<<<<<<<< + * minx[b, j] = val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6215 + * nobs[b, j] += 1 + * if val < minx[b, j]: + * minx[b, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6217 + * minx[b, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6218 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6219 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6221 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6222 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6225 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * if val < minx[b, 0]: + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6226 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * if val < minx[b, 0]: + * minx[b, 0] = val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6227 + * if val == val: + * nobs[b, 0] += 1 + * if val < minx[b, 0]: # <<<<<<<<<<<<<< + * minx[b, 0] = val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + __pyx_t_16 = ((__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_minx.diminfo[1].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6228 + * nobs[b, 0] += 1 + * if val < minx[b, 0]: + * minx[b, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_minx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6230 + * minx[b, 0] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6231 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":6232 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6233 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = minx[i, j] + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6235 + * out[i, j] = nan + * else: + * out[i, j] = minx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_minx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_minx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_minx.diminfo[1].strides)); + } + __pyx_L25:; + } + } + + /* "pandas/src/generated.pyx":6177 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_min_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_minx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6239 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_443group_max_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_442group_max_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_443group_max_float64 = {__Pyx_NAMESTR("group_max_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_443group_max_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_442group_max_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_443group_max_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_max_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_max_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_max_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_442group_max_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_442group_max_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_maxx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx; + __Pyx_Buffer __pyx_pybuffer_maxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_max_float64", 0); + __pyx_pybuffer_maxx.pybuffer.buf = NULL; + __pyx_pybuffer_maxx.refcount = 0; + __pyx_pybuffernd_maxx.data = NULL; + __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6251 + * ndarray[float64_t, ndim=2] maxx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6252 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6254 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * maxx = np.empty_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6256 + * nobs = np.zeros_like(out) + * + * maxx = np.empty_like(out) # <<<<<<<<<<<<<< + * maxx.fill(-np.inf) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_maxx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6257 + * + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6259 + * maxx.fill(-np.inf) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6261 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6262 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6263 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6264 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6265 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":6267 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6268 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":6269 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6272 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6273 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if val > maxx[lab, j]: + * maxx[lab, j] = val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6274 + * if val == val: + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: # <<<<<<<<<<<<<< + * maxx[lab, j] = val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6275 + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: + * maxx[lab, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6277 + * maxx[lab, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6278 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6279 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6280 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/generated.pyx":6282 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6283 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6286 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6287 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * if val > maxx[lab, 0]: + * maxx[lab, 0] = val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6288 + * if val == val: + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: # <<<<<<<<<<<<<< + * maxx[lab, 0] = val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6289 + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: + * maxx[lab, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6291 + * maxx[lab, 0] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6292 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":6293 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6294 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = maxx[i, j] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6296 + * out[i, j] = nan + * else: + * out[i, j] = maxx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_maxx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":6239 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_max_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_maxx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6299 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_445group_max_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_444group_max_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_445group_max_float32 = {__Pyx_NAMESTR("group_max_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_445group_max_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_444group_max_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_445group_max_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_max_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_max_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_max_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_444group_max_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_444group_max_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_lab; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_maxx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx; + __Pyx_Buffer __pyx_pybuffer_maxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + long __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_max_float32", 0); + __pyx_pybuffer_maxx.pybuffer.buf = NULL; + __pyx_pybuffer_maxx.refcount = 0; + __pyx_pybuffernd_maxx.data = NULL; + __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6311 + * ndarray[float32_t, ndim=2] maxx, nobs + * + * if not len(values) == len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((!((__pyx_t_1 == __pyx_t_2) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6312 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6314 + * raise AssertionError("len(index) != len(labels)") + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * + * maxx = np.empty_like(out) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6316 + * nobs = np.zeros_like(out) + * + * maxx = np.empty_like(out) # <<<<<<<<<<<<<< + * maxx.fill(-np.inf) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_maxx = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6317 + * + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6319 + * maxx.fill(-np.inf) + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if K > 1: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_N = __pyx_t_2; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6321 + * N, K = ( values).shape + * + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * lab = labels[i] + */ + __pyx_t_3 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6322 + * + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6323 + * if K > 1: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6324 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6325 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L7_continue; + } + + /* "pandas/src/generated.pyx":6327 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_15 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6328 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_16 = __pyx_v_K; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/src/generated.pyx":6329 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6332 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6333 + * # not nan + * if val == val: + * nobs[lab, j] += 1 # <<<<<<<<<<<<<< + * if val > maxx[lab, j]: + * maxx[lab, j] = val + */ + __pyx_t_20 = __pyx_v_lab; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6334 + * if val == val: + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: # <<<<<<<<<<<<<< + * maxx[lab, j] = val + * else: + */ + __pyx_t_22 = __pyx_v_lab; + __pyx_t_23 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6335 + * nobs[lab, j] += 1 + * if val > maxx[lab, j]: + * maxx[lab, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_24 = __pyx_v_lab; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + __pyx_L12:; + } + __pyx_L7_continue:; + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6337 + * maxx[lab, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6338 + * else: + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6339 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6340 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/generated.pyx":6342 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_17 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6343 + * + * counts[lab] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_27 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6346 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6347 + * # not nan + * if val == val: + * nobs[lab, 0] += 1 # <<<<<<<<<<<<<< + * if val > maxx[lab, 0]: + * maxx[lab, 0] = val + */ + __pyx_t_28 = __pyx_v_lab; + __pyx_t_29 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6348 + * if val == val: + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: # <<<<<<<<<<<<<< + * maxx[lab, 0] = val + * + */ + __pyx_t_30 = __pyx_v_lab; + __pyx_t_31 = 0; + __pyx_t_3 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6349 + * nobs[lab, 0] += 1 + * if val > maxx[lab, 0]: + * maxx[lab, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_32 = __pyx_v_lab; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6351 + * maxx[lab, 0] = val + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/generated.pyx":6352 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_34 = __pyx_v_K; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "pandas/src/generated.pyx":6353 + * for i in range(len(counts)): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_37 = __pyx_v_j; + __pyx_t_3 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":6354 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = maxx[i, j] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6356 + * out[i, j] = nan + * else: + * out[i, j] = maxx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_41 = __pyx_v_j; + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_maxx.diminfo[1].strides)); + } + __pyx_L23:; + } + } + + /* "pandas/src/generated.pyx":6299 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_max_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_maxx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6360 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_447group_max_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_446group_max_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_447group_max_bin_float64 = {__Pyx_NAMESTR("group_max_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_447group_max_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_446group_max_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_447group_max_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_max_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_max_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_max_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_446group_max_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_446group_max_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_maxx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx; + __Pyx_Buffer __pyx_pybuffer_maxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_max_bin_float64", 0); + __pyx_pybuffer_maxx.pybuffer.buf = NULL; + __pyx_pybuffer_maxx.refcount = 0; + __pyx_pybuffernd_maxx.data = NULL; + __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6372 + * ndarray[float64_t, ndim=2] maxx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6373 + * + * nobs = np.zeros_like(out) + * maxx = np.empty_like(out) # <<<<<<<<<<<<<< + * maxx.fill(-np.inf) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_maxx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":6374 + * nobs = np.zeros_like(out) + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6376 + * maxx.fill(-np.inf) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6377 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6379 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6381 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":6383 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6384 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6385 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6386 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":6387 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6389 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6390 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":6391 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6394 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if val > maxx[b, j]: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6395 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if val > maxx[b, j]: + * maxx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6396 + * if val == val: + * nobs[b, j] += 1 + * if val > maxx[b, j]: # <<<<<<<<<<<<<< + * maxx[b, j] = val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6397 + * nobs[b, j] += 1 + * if val > maxx[b, j]: + * maxx[b, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6399 + * maxx[b, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6400 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6401 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6403 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6404 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6407 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6408 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * if val > maxx[b, 0]: + * maxx[b, 0] = val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6409 + * if val == val: + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: # <<<<<<<<<<<<<< + * maxx[b, 0] = val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + __pyx_t_16 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6410 + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: + * maxx[b, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6412 + * maxx[b, 0] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6413 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":6414 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6415 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = maxx[i, j] + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6417 + * out[i, j] = nan + * else: + * out[i, j] = maxx[i, j] # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_maxx.diminfo[1].strides)); + } + __pyx_L25:; + } + } + + /* "pandas/src/generated.pyx":6360 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_max_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_maxx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6420 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_449group_max_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_448group_max_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_449group_max_bin_float32 = {__Pyx_NAMESTR("group_max_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_449group_max_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_448group_max_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_449group_max_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_max_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_max_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_max_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_max_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_448group_max_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_448group_max_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_maxx = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_maxx; + __Pyx_Buffer __pyx_pybuffer_maxx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyArrayObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + long __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_max_bin_float32", 0); + __pyx_pybuffer_maxx.pybuffer.buf = NULL; + __pyx_pybuffer_maxx.refcount = 0; + __pyx_pybuffernd_maxx.data = NULL; + __pyx_pybuffernd_maxx.rcbuffer = &__pyx_pybuffer_maxx; + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6432 + * ndarray[float32_t, ndim=2] maxx, nobs + * + * nobs = np.zeros_like(out) # <<<<<<<<<<<<<< + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6433 + * + * nobs = np.zeros_like(out) + * maxx = np.empty_like(out) # <<<<<<<<<<<<<< + * maxx.fill(-np.inf) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_maxx.diminfo[0].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_maxx.diminfo[0].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_maxx.diminfo[1].strides = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_maxx.diminfo[1].shape = __pyx_pybuffernd_maxx.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = 0; + __pyx_v_maxx = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/generated.pyx":6434 + * nobs = np.zeros_like(out) + * maxx = np.empty_like(out) + * maxx.fill(-np.inf) # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_maxx), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":6436 + * maxx.fill(-np.inf) + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 - 1); + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_11) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6437 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_11; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6439 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_11 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6441 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_N = __pyx_t_11; + __pyx_v_K = __pyx_t_9; + + /* "pandas/src/generated.pyx":6443 + * N, K = ( values).shape + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * for i in range(N): + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6444 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + */ + __pyx_t_12 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6445 + * b = 0 + * if K > 1: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6446 + * if K > 1: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_12 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_12; + } + if (!__pyx_t_17) break; + + /* "pandas/src/generated.pyx":6447 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6449 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_18 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6450 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_19 = __pyx_v_K; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "pandas/src/generated.pyx":6451 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6454 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, j] += 1 + * if val > maxx[b, j]: + */ + __pyx_t_17 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6455 + * # not nan + * if val == val: + * nobs[b, j] += 1 # <<<<<<<<<<<<<< + * if val > maxx[b, j]: + * maxx[b, j] = val + */ + __pyx_t_23 = __pyx_v_b; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6456 + * if val == val: + * nobs[b, j] += 1 + * if val > maxx[b, j]: # <<<<<<<<<<<<<< + * maxx[b, j] = val + * else: + */ + __pyx_t_25 = __pyx_v_b; + __pyx_t_26 = __pyx_v_j; + __pyx_t_17 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_17) { + + /* "pandas/src/generated.pyx":6457 + * nobs[b, j] += 1 + * if val > maxx[b, j]: + * maxx[b, j] = val # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __pyx_t_27 = __pyx_v_b; + __pyx_t_28 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + } + } + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6459 + * maxx[b, j] = val + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_9 = __pyx_v_N; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6460 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_17 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_17) { + __pyx_t_19 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_17; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6461 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6463 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_20 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6464 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6467 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: + */ + __pyx_t_16 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6468 + * # not nan + * if val == val: + * nobs[b, 0] += 1 # <<<<<<<<<<<<<< + * if val > maxx[b, 0]: + * maxx[b, 0] = val + */ + __pyx_t_31 = __pyx_v_b; + __pyx_t_32 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_nobs.diminfo[1].strides) += 1.0; + + /* "pandas/src/generated.pyx":6469 + * if val == val: + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: # <<<<<<<<<<<<<< + * maxx[b, 0] = val + * + */ + __pyx_t_33 = __pyx_v_b; + __pyx_t_34 = 0; + __pyx_t_16 = ((__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_maxx.diminfo[1].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6470 + * nobs[b, 0] += 1 + * if val > maxx[b, 0]: + * maxx[b, 0] = val # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_maxx.diminfo[1].strides) = __pyx_v_val; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + } + } + __pyx_L6:; + + /* "pandas/src/generated.pyx":6472 + * maxx[b, 0] = val + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * if nobs[i, j] == 0: + */ + __pyx_t_9 = __pyx_v_ngroups; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/generated.pyx":6473 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * if nobs[i, j] == 0: + * out[i, j] = nan + */ + __pyx_t_37 = __pyx_v_K; + for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) { + __pyx_v_j = __pyx_t_38; + + /* "pandas/src/generated.pyx":6474 + * for i in range(ngroups): + * for j in range(K): + * if nobs[i, j] == 0: # <<<<<<<<<<<<<< + * out[i, j] = nan + * else: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_nobs.diminfo[1].strides)) == 0.0) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6475 + * for j in range(K): + * if nobs[i, j] == 0: + * out[i, j] = nan # <<<<<<<<<<<<<< + * else: + * out[i, j] = maxx[i, j] + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_6pandas_5algos_nan; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6477 + * out[i, j] = nan + * else: + * out[i, j] = maxx[i, j] # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_44 = __pyx_v_j; + __pyx_t_45 = __pyx_v_i; + __pyx_t_46 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_maxx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_maxx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_maxx.diminfo[1].strides)); + } + __pyx_L25:; + } + } + + /* "pandas/src/generated.pyx":6420 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_max_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_maxx.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_maxx); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6481 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_451group_ohlc_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_450group_ohlc_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_451group_ohlc_float64 = {__Pyx_NAMESTR("group_ohlc_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_451group_ohlc_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_450group_ohlc_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_451group_ohlc_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_ohlc_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_ohlc_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_ohlc_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_ohlc_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_450group_ohlc_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_450group_ohlc_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + __pyx_t_5numpy_float64_t __pyx_v_vopen; + __pyx_t_5numpy_float64_t __pyx_v_vhigh; + __pyx_t_5numpy_float64_t __pyx_v_vlow; + __pyx_t_5numpy_float64_t __pyx_v_vclose; + __pyx_t_5numpy_float64_t __pyx_v_NA; + int __pyx_v_got_first; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + __pyx_t_5numpy_float64_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + long __pyx_t_15; + Py_ssize_t __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + long __pyx_t_19; + Py_ssize_t __pyx_t_20; + long __pyx_t_21; + Py_ssize_t __pyx_t_22; + long __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + long __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + long __pyx_t_38; + Py_ssize_t __pyx_t_39; + long __pyx_t_40; + Py_ssize_t __pyx_t_41; + long __pyx_t_42; + Py_ssize_t __pyx_t_43; + long __pyx_t_44; + Py_ssize_t __pyx_t_45; + long __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_ohlc_float64", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6492 + * float64_t val, count + * float64_t vopen, vhigh, vlow, vclose, NA + * bint got_first = 0 # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_v_got_first = 0; + + /* "pandas/src/generated.pyx":6494 + * bint got_first = 0 + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 - 1); + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6495 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_3; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6497 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_3 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6499 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if out.shape[1] != 4: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_N = __pyx_t_3; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6501 + * N, K = ( values).shape + * + * if out.shape[1] != 4: # <<<<<<<<<<<<<< + * raise ValueError('Output array must have 4 columns') + * + */ + __pyx_t_4 = (((__pyx_v_out->dimensions[1]) != 4) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6502 + * + * if out.shape[1] != 4: + * raise ValueError('Output array must have 4 columns') # <<<<<<<<<<<<<< + * + * NA = np.nan + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6504 + * raise ValueError('Output array must have 4 columns') + * + * NA = np.nan # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_NA = __pyx_t_10; + + /* "pandas/src/generated.pyx":6506 + * NA = np.nan + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * raise NotImplementedError + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6507 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * raise NotImplementedError + * else: + */ + __pyx_t_4 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6508 + * b = 0 + * if K > 1: + * raise NotImplementedError # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/src/generated.pyx":6510 + * raise NotImplementedError + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":6511 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * if not got_first: + * out[b, 0] = NA + */ + while (1) { + __pyx_t_4 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_4; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6512 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: # <<<<<<<<<<<<<< + * out[b, 0] = NA + * out[b, 1] = NA + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6513 + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: + * out[b, 0] = NA # <<<<<<<<<<<<<< + * out[b, 1] = NA + * out[b, 2] = NA + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_15 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6514 + * if not got_first: + * out[b, 0] = NA + * out[b, 1] = NA # <<<<<<<<<<<<<< + * out[b, 2] = NA + * out[b, 3] = NA + */ + __pyx_t_16 = __pyx_v_b; + __pyx_t_17 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6515 + * out[b, 0] = NA + * out[b, 1] = NA + * out[b, 2] = NA # <<<<<<<<<<<<<< + * out[b, 3] = NA + * else: + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_19 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6516 + * out[b, 1] = NA + * out[b, 2] = NA + * out[b, 3] = NA # <<<<<<<<<<<<<< + * else: + * out[b, 0] = vopen + */ + __pyx_t_20 = __pyx_v_b; + __pyx_t_21 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6518 + * out[b, 3] = NA + * else: + * out[b, 0] = vopen # <<<<<<<<<<<<<< + * out[b, 1] = vhigh + * out[b, 2] = vlow + */ + __pyx_t_22 = __pyx_v_b; + __pyx_t_23 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen; + + /* "pandas/src/generated.pyx":6519 + * else: + * out[b, 0] = vopen + * out[b, 1] = vhigh # <<<<<<<<<<<<<< + * out[b, 2] = vlow + * out[b, 3] = vclose + */ + __pyx_t_24 = __pyx_v_b; + __pyx_t_25 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh; + + /* "pandas/src/generated.pyx":6520 + * out[b, 0] = vopen + * out[b, 1] = vhigh + * out[b, 2] = vlow # <<<<<<<<<<<<<< + * out[b, 3] = vclose + * b += 1 + */ + __pyx_t_26 = __pyx_v_b; + __pyx_t_27 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow; + + /* "pandas/src/generated.pyx":6521 + * out[b, 1] = vhigh + * out[b, 2] = vlow + * out[b, 3] = vclose # <<<<<<<<<<<<<< + * b += 1 + * got_first = 0 + */ + __pyx_t_28 = __pyx_v_b; + __pyx_t_29 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":6522 + * out[b, 2] = vlow + * out[b, 3] = vclose + * b += 1 # <<<<<<<<<<<<<< + * got_first = 0 + * + */ + __pyx_v_b = (__pyx_v_b + 1); + + /* "pandas/src/generated.pyx":6523 + * out[b, 3] = vclose + * b += 1 + * got_first = 0 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_got_first = 0; + } + + /* "pandas/src/generated.pyx":6525 + * got_first = 0 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_30 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6526 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6529 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * if not got_first: + * got_first = 1 + */ + __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6530 + * # not nan + * if val == val: + * if not got_first: # <<<<<<<<<<<<<< + * got_first = 1 + * vopen = val + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6531 + * if val == val: + * if not got_first: + * got_first = 1 # <<<<<<<<<<<<<< + * vopen = val + * vlow = val + */ + __pyx_v_got_first = 1; + + /* "pandas/src/generated.pyx":6532 + * if not got_first: + * got_first = 1 + * vopen = val # <<<<<<<<<<<<<< + * vlow = val + * vhigh = val + */ + __pyx_v_vopen = __pyx_v_val; + + /* "pandas/src/generated.pyx":6533 + * got_first = 1 + * vopen = val + * vlow = val # <<<<<<<<<<<<<< + * vhigh = val + * else: + */ + __pyx_v_vlow = __pyx_v_val; + + /* "pandas/src/generated.pyx":6534 + * vopen = val + * vlow = val + * vhigh = val # <<<<<<<<<<<<<< + * else: + * if val < vlow: + */ + __pyx_v_vhigh = __pyx_v_val; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6536 + * vhigh = val + * else: + * if val < vlow: # <<<<<<<<<<<<<< + * vlow = val + * if val > vhigh: + */ + __pyx_t_13 = ((__pyx_v_val < __pyx_v_vlow) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6537 + * else: + * if val < vlow: + * vlow = val # <<<<<<<<<<<<<< + * if val > vhigh: + * vhigh = val + */ + __pyx_v_vlow = __pyx_v_val; + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/src/generated.pyx":6538 + * if val < vlow: + * vlow = val + * if val > vhigh: # <<<<<<<<<<<<<< + * vhigh = val + * vclose = val + */ + __pyx_t_13 = ((__pyx_v_val > __pyx_v_vhigh) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6539 + * vlow = val + * if val > vhigh: + * vhigh = val # <<<<<<<<<<<<<< + * vclose = val + * + */ + __pyx_v_vhigh = __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":6540 + * if val > vhigh: + * vhigh = val + * vclose = val # <<<<<<<<<<<<<< + * + * if not got_first: + */ + __pyx_v_vclose = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/src/generated.pyx":6542 + * vclose = val + * + * if not got_first: # <<<<<<<<<<<<<< + * out[b, 0] = NA + * out[b, 1] = NA + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6543 + * + * if not got_first: + * out[b, 0] = NA # <<<<<<<<<<<<<< + * out[b, 1] = NA + * out[b, 2] = NA + */ + __pyx_t_1 = __pyx_v_b; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6544 + * if not got_first: + * out[b, 0] = NA + * out[b, 1] = NA # <<<<<<<<<<<<<< + * out[b, 2] = NA + * out[b, 3] = NA + */ + __pyx_t_3 = __pyx_v_b; + __pyx_t_34 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6545 + * out[b, 0] = NA + * out[b, 1] = NA + * out[b, 2] = NA # <<<<<<<<<<<<<< + * out[b, 3] = NA + * else: + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6546 + * out[b, 1] = NA + * out[b, 2] = NA + * out[b, 3] = NA # <<<<<<<<<<<<<< + * else: + * out[b, 0] = vopen + */ + __pyx_t_37 = __pyx_v_b; + __pyx_t_38 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6548 + * out[b, 3] = NA + * else: + * out[b, 0] = vopen # <<<<<<<<<<<<<< + * out[b, 1] = vhigh + * out[b, 2] = vlow + */ + __pyx_t_39 = __pyx_v_b; + __pyx_t_40 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen; + + /* "pandas/src/generated.pyx":6549 + * else: + * out[b, 0] = vopen + * out[b, 1] = vhigh # <<<<<<<<<<<<<< + * out[b, 2] = vlow + * out[b, 3] = vclose + */ + __pyx_t_41 = __pyx_v_b; + __pyx_t_42 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh; + + /* "pandas/src/generated.pyx":6550 + * out[b, 0] = vopen + * out[b, 1] = vhigh + * out[b, 2] = vlow # <<<<<<<<<<<<<< + * out[b, 3] = vclose + * @cython.wraparound(False) + */ + __pyx_t_43 = __pyx_v_b; + __pyx_t_44 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow; + + /* "pandas/src/generated.pyx":6551 + * out[b, 1] = vhigh + * out[b, 2] = vlow + * out[b, 3] = vclose # <<<<<<<<<<<<<< + * @cython.wraparound(False) + * @cython.boundscheck(False) + */ + __pyx_t_45 = __pyx_v_b; + __pyx_t_46 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose; + } + __pyx_L17:; + } + + /* "pandas/src/generated.pyx":6481 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_ohlc_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6554 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_453group_ohlc_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_452group_ohlc_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_453group_ohlc_float32 = {__Pyx_NAMESTR("group_ohlc_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_453group_ohlc_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_452group_ohlc_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_453group_ohlc_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_ohlc_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_ohlc_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_ohlc_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_ohlc_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_452group_ohlc_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_452group_ohlc_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + __pyx_t_5numpy_float32_t __pyx_v_vopen; + __pyx_t_5numpy_float32_t __pyx_v_vhigh; + __pyx_t_5numpy_float32_t __pyx_v_vlow; + __pyx_t_5numpy_float32_t __pyx_v_vclose; + __pyx_t_5numpy_float32_t __pyx_v_NA; + int __pyx_v_got_first; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + __pyx_t_5numpy_float32_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + long __pyx_t_15; + Py_ssize_t __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + long __pyx_t_19; + Py_ssize_t __pyx_t_20; + long __pyx_t_21; + Py_ssize_t __pyx_t_22; + long __pyx_t_23; + Py_ssize_t __pyx_t_24; + long __pyx_t_25; + Py_ssize_t __pyx_t_26; + long __pyx_t_27; + Py_ssize_t __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + long __pyx_t_33; + long __pyx_t_34; + Py_ssize_t __pyx_t_35; + long __pyx_t_36; + Py_ssize_t __pyx_t_37; + long __pyx_t_38; + Py_ssize_t __pyx_t_39; + long __pyx_t_40; + Py_ssize_t __pyx_t_41; + long __pyx_t_42; + Py_ssize_t __pyx_t_43; + long __pyx_t_44; + Py_ssize_t __pyx_t_45; + long __pyx_t_46; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_ohlc_float32", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6565 + * float32_t val, count + * float32_t vopen, vhigh, vlow, vclose, NA + * bint got_first = 0 # <<<<<<<<<<<<<< + * + * if bins[len(bins) - 1] == len(values): + */ + __pyx_v_got_first = 0; + + /* "pandas/src/generated.pyx":6567 + * bint got_first = 0 + * + * if bins[len(bins) - 1] == len(values): # <<<<<<<<<<<<<< + * ngroups = len(bins) + * else: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 - 1); + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_bins.diminfo[0].strides)) == __pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6568 + * + * if bins[len(bins) - 1] == len(values): + * ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * ngroups = len(bins) + 1 + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = __pyx_t_3; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6570 + * ngroups = len(bins) + * else: + * ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * N, K = ( values).shape + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ngroups = (__pyx_t_3 + 1); + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":6572 + * ngroups = len(bins) + 1 + * + * N, K = ( values).shape # <<<<<<<<<<<<<< + * + * if out.shape[1] != 4: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_N = __pyx_t_3; + __pyx_v_K = __pyx_t_1; + + /* "pandas/src/generated.pyx":6574 + * N, K = ( values).shape + * + * if out.shape[1] != 4: # <<<<<<<<<<<<<< + * raise ValueError('Output array must have 4 columns') + * + */ + __pyx_t_4 = (((__pyx_v_out->dimensions[1]) != 4) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6575 + * + * if out.shape[1] != 4: + * raise ValueError('Output array must have 4 columns') # <<<<<<<<<<<<<< + * + * NA = np.nan + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6577 + * raise ValueError('Output array must have 4 columns') + * + * NA = np.nan # <<<<<<<<<<<<<< + * + * b = 0 + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_10 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_NA = __pyx_t_10; + + /* "pandas/src/generated.pyx":6579 + * NA = np.nan + * + * b = 0 # <<<<<<<<<<<<<< + * if K > 1: + * raise NotImplementedError + */ + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6580 + * + * b = 0 + * if K > 1: # <<<<<<<<<<<<<< + * raise NotImplementedError + * else: + */ + __pyx_t_4 = ((__pyx_v_K > 1) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":6581 + * b = 0 + * if K > 1: + * raise NotImplementedError # <<<<<<<<<<<<<< + * else: + * for i in range(N): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/src/generated.pyx":6583 + * raise NotImplementedError + * else: + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: + */ + __pyx_t_1 = __pyx_v_N; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/generated.pyx":6584 + * else: + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * if not got_first: + * out[b, 0] = NA + */ + while (1) { + __pyx_t_4 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_4; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6585 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: # <<<<<<<<<<<<<< + * out[b, 0] = NA + * out[b, 1] = NA + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6586 + * while b < ngroups - 1 and i >= bins[b]: + * if not got_first: + * out[b, 0] = NA # <<<<<<<<<<<<<< + * out[b, 1] = NA + * out[b, 2] = NA + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_15 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6587 + * if not got_first: + * out[b, 0] = NA + * out[b, 1] = NA # <<<<<<<<<<<<<< + * out[b, 2] = NA + * out[b, 3] = NA + */ + __pyx_t_16 = __pyx_v_b; + __pyx_t_17 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6588 + * out[b, 0] = NA + * out[b, 1] = NA + * out[b, 2] = NA # <<<<<<<<<<<<<< + * out[b, 3] = NA + * else: + */ + __pyx_t_18 = __pyx_v_b; + __pyx_t_19 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6589 + * out[b, 1] = NA + * out[b, 2] = NA + * out[b, 3] = NA # <<<<<<<<<<<<<< + * else: + * out[b, 0] = vopen + */ + __pyx_t_20 = __pyx_v_b; + __pyx_t_21 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6591 + * out[b, 3] = NA + * else: + * out[b, 0] = vopen # <<<<<<<<<<<<<< + * out[b, 1] = vhigh + * out[b, 2] = vlow + */ + __pyx_t_22 = __pyx_v_b; + __pyx_t_23 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen; + + /* "pandas/src/generated.pyx":6592 + * else: + * out[b, 0] = vopen + * out[b, 1] = vhigh # <<<<<<<<<<<<<< + * out[b, 2] = vlow + * out[b, 3] = vclose + */ + __pyx_t_24 = __pyx_v_b; + __pyx_t_25 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh; + + /* "pandas/src/generated.pyx":6593 + * out[b, 0] = vopen + * out[b, 1] = vhigh + * out[b, 2] = vlow # <<<<<<<<<<<<<< + * out[b, 3] = vclose + * b += 1 + */ + __pyx_t_26 = __pyx_v_b; + __pyx_t_27 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow; + + /* "pandas/src/generated.pyx":6594 + * out[b, 1] = vhigh + * out[b, 2] = vlow + * out[b, 3] = vclose # <<<<<<<<<<<<<< + * b += 1 + * got_first = 0 + */ + __pyx_t_28 = __pyx_v_b; + __pyx_t_29 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":6595 + * out[b, 2] = vlow + * out[b, 3] = vclose + * b += 1 # <<<<<<<<<<<<<< + * got_first = 0 + * + */ + __pyx_v_b = (__pyx_v_b + 1); + + /* "pandas/src/generated.pyx":6596 + * out[b, 3] = vclose + * b += 1 + * got_first = 0 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_got_first = 0; + } + + /* "pandas/src/generated.pyx":6598 + * got_first = 0 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * val = values[i, 0] + * + */ + __pyx_t_30 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6599 + * + * counts[b] += 1 + * val = values[i, 0] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_32 = 0; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6602 + * + * # not nan + * if val == val: # <<<<<<<<<<<<<< + * if not got_first: + * got_first = 1 + */ + __pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6603 + * # not nan + * if val == val: + * if not got_first: # <<<<<<<<<<<<<< + * got_first = 1 + * vopen = val + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6604 + * if val == val: + * if not got_first: + * got_first = 1 # <<<<<<<<<<<<<< + * vopen = val + * vlow = val + */ + __pyx_v_got_first = 1; + + /* "pandas/src/generated.pyx":6605 + * if not got_first: + * got_first = 1 + * vopen = val # <<<<<<<<<<<<<< + * vlow = val + * vhigh = val + */ + __pyx_v_vopen = __pyx_v_val; + + /* "pandas/src/generated.pyx":6606 + * got_first = 1 + * vopen = val + * vlow = val # <<<<<<<<<<<<<< + * vhigh = val + * else: + */ + __pyx_v_vlow = __pyx_v_val; + + /* "pandas/src/generated.pyx":6607 + * vopen = val + * vlow = val + * vhigh = val # <<<<<<<<<<<<<< + * else: + * if val < vlow: + */ + __pyx_v_vhigh = __pyx_v_val; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6609 + * vhigh = val + * else: + * if val < vlow: # <<<<<<<<<<<<<< + * vlow = val + * if val > vhigh: + */ + __pyx_t_13 = ((__pyx_v_val < __pyx_v_vlow) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6610 + * else: + * if val < vlow: + * vlow = val # <<<<<<<<<<<<<< + * if val > vhigh: + * vhigh = val + */ + __pyx_v_vlow = __pyx_v_val; + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/src/generated.pyx":6611 + * if val < vlow: + * vlow = val + * if val > vhigh: # <<<<<<<<<<<<<< + * vhigh = val + * vclose = val + */ + __pyx_t_13 = ((__pyx_v_val > __pyx_v_vhigh) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6612 + * vlow = val + * if val > vhigh: + * vhigh = val # <<<<<<<<<<<<<< + * vclose = val + * + */ + __pyx_v_vhigh = __pyx_v_val; + goto __pyx_L16; + } + __pyx_L16:; + } + __pyx_L14:; + + /* "pandas/src/generated.pyx":6613 + * if val > vhigh: + * vhigh = val + * vclose = val # <<<<<<<<<<<<<< + * + * if not got_first: + */ + __pyx_v_vclose = __pyx_v_val; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/src/generated.pyx":6615 + * vclose = val + * + * if not got_first: # <<<<<<<<<<<<<< + * out[b, 0] = NA + * out[b, 1] = NA + */ + __pyx_t_13 = ((!(__pyx_v_got_first != 0)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/generated.pyx":6616 + * + * if not got_first: + * out[b, 0] = NA # <<<<<<<<<<<<<< + * out[b, 1] = NA + * out[b, 2] = NA + */ + __pyx_t_1 = __pyx_v_b; + __pyx_t_33 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6617 + * if not got_first: + * out[b, 0] = NA + * out[b, 1] = NA # <<<<<<<<<<<<<< + * out[b, 2] = NA + * out[b, 3] = NA + */ + __pyx_t_3 = __pyx_v_b; + __pyx_t_34 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6618 + * out[b, 0] = NA + * out[b, 1] = NA + * out[b, 2] = NA # <<<<<<<<<<<<<< + * out[b, 3] = NA + * else: + */ + __pyx_t_35 = __pyx_v_b; + __pyx_t_36 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + + /* "pandas/src/generated.pyx":6619 + * out[b, 1] = NA + * out[b, 2] = NA + * out[b, 3] = NA # <<<<<<<<<<<<<< + * else: + * out[b, 0] = vopen + */ + __pyx_t_37 = __pyx_v_b; + __pyx_t_38 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_NA; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6621 + * out[b, 3] = NA + * else: + * out[b, 0] = vopen # <<<<<<<<<<<<<< + * out[b, 1] = vhigh + * out[b, 2] = vlow + */ + __pyx_t_39 = __pyx_v_b; + __pyx_t_40 = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vopen; + + /* "pandas/src/generated.pyx":6622 + * else: + * out[b, 0] = vopen + * out[b, 1] = vhigh # <<<<<<<<<<<<<< + * out[b, 2] = vlow + * out[b, 3] = vclose + */ + __pyx_t_41 = __pyx_v_b; + __pyx_t_42 = 1; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vhigh; + + /* "pandas/src/generated.pyx":6623 + * out[b, 0] = vopen + * out[b, 1] = vhigh + * out[b, 2] = vlow # <<<<<<<<<<<<<< + * out[b, 3] = vclose + * + */ + __pyx_t_43 = __pyx_v_b; + __pyx_t_44 = 2; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vlow; + + /* "pandas/src/generated.pyx":6624 + * out[b, 1] = vhigh + * out[b, 2] = vlow + * out[b, 3] = vclose # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_t_45 = __pyx_v_b; + __pyx_t_46 = 3; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_out.diminfo[1].strides) = __pyx_v_vclose; + } + __pyx_L17:; + } + + /* "pandas/src/generated.pyx":6554 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_ohlc_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6628 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_455group_count_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_454group_count_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_455group_count_float64 = {__Pyx_NAMESTR("group_count_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_455group_count_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_454group_count_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_455group_count_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_454group_count_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_454group_count_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_float64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6637 + * cdef: + * Py_ssize_t i, j, lab + * Py_ssize_t N = values.shape[0], K = values.shape[1] # <<<<<<<<<<<<<< + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + + /* "pandas/src/generated.pyx":6639 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6640 + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * if len(values) != len(labels): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6639 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6642 + * dtype=np.int64) + * + * if len(values) != len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6643 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6645 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6646 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6647 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6648 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":6650 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_11 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6651 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6652 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6655 + * + * # not nan + * nobs[lab, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_9 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_9) { + __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_9; + } + __pyx_t_18 = __pyx_v_lab; + __pyx_t_19 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17; + } + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":6657 + * nobs[lab, j] += val == val and val != iNaT + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6658 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6659 + * for i in range(len(counts)): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6628 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_457group_count_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_456group_count_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_457group_count_float32 = {__Pyx_NAMESTR("group_count_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_457group_count_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_456group_count_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_457group_count_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_456group_count_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_456group_count_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_float32", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6673 + * cdef: + * Py_ssize_t i, j, lab + * Py_ssize_t N = values.shape[0], K = values.shape[1] # <<<<<<<<<<<<<< + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + + /* "pandas/src/generated.pyx":6675 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6676 + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * if len(values) != len(labels): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6675 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6678 + * dtype=np.int64) + * + * if len(values) != len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6679 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6681 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6682 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6683 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6684 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":6686 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_11 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6687 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6688 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6691 + * + * # not nan + * nobs[lab, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_9 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_9) { + __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_9; + } + __pyx_t_18 = __pyx_v_lab; + __pyx_t_19 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17; + } + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":6693 + * nobs[lab, j] += val == val and val != iNaT + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6694 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6695 + * for i in range(len(counts)): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6700 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_459group_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_458group_count_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_459group_count_object = {__Pyx_NAMESTR("group_count_object"), (PyCFunction)__pyx_pw_6pandas_5algos_459group_count_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_458group_count_object)}; +static PyObject *__pyx_pw_6pandas_5algos_459group_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_458group_count_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_458group_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + PyObject **__pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_object", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6709 + * cdef: + * Py_ssize_t i, j, lab + * Py_ssize_t N = values.shape[0], K = values.shape[1] # <<<<<<<<<<<<<< + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + + /* "pandas/src/generated.pyx":6711 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6712 + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * if len(values) != len(labels): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6711 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6714 + * dtype=np.int64) + * + * if len(values) != len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6715 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6717 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6718 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6719 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6720 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":6722 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_11 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6723 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6724 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6727 + * + * # not nan + * nobs[lab, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_16 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_16 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_17 = __pyx_v_lab; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_16; + } + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":6729 + * nobs[lab, j] += val == val and val != iNaT + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6730 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6731 + * for i in range(len(counts)): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_23 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_23); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_23); + *__pyx_t_23 = __pyx_t_4; + __Pyx_GIVEREF(*__pyx_t_23); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + + /* "pandas/src/generated.pyx":6700 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6736 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_461group_count_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_460group_count_int64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_461group_count_int64 = {__Pyx_NAMESTR("group_count_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_461group_count_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_460group_count_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_461group_count_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_labels = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_460group_count_int64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_460group_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + __pyx_t_5numpy_int64_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_int64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6745 + * cdef: + * Py_ssize_t i, j, lab + * Py_ssize_t N = values.shape[0], K = values.shape[1] # <<<<<<<<<<<<<< + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + + /* "pandas/src/generated.pyx":6747 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6748 + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * if len(values) != len(labels): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6747 + * Py_ssize_t N = values.shape[0], K = values.shape[1] + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6750 + * dtype=np.int64) + * + * if len(values) != len(labels): # <<<<<<<<<<<<<< + * raise AssertionError("len(index) != len(labels)") + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6751 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/generated.pyx":6753 + * raise AssertionError("len(index) != len(labels)") + * + * for i in range(N): # <<<<<<<<<<<<<< + * lab = labels[i] + * if lab < 0: + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6754 + * + * for i in range(N): + * lab = labels[i] # <<<<<<<<<<<<<< + * if lab < 0: + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6755 + * for i in range(N): + * lab = labels[i] + * if lab < 0: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_lab < 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":6756 + * lab = labels[i] + * if lab < 0: + * continue # <<<<<<<<<<<<<< + * + * counts[lab] += 1 + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/generated.pyx":6758 + * continue + * + * counts[lab] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_11 = __pyx_v_lab; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6759 + * + * counts[lab] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6760 + * counts[lab] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6763 + * + * # not nan + * nobs[lab, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(len(counts)): + */ + __pyx_t_9 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_9) { + __pyx_t_16 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_9; + } + __pyx_t_18 = __pyx_v_lab; + __pyx_t_19 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_17; + } + __pyx_L4_continue:; + } + + /* "pandas/src/generated.pyx":6765 + * nobs[lab, j] += val == val and val != iNaT + * + * for i in range(len(counts)): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6766 + * + * for i in range(len(counts)): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_12 = __pyx_v_K; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/src/generated.pyx":6767 + * for i in range(len(counts)): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_j; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6736 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6773 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_463group_count_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_462group_count_bin_float64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_463group_count_bin_float64 = {__Pyx_NAMESTR("group_count_bin_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_463group_count_bin_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_462group_count_bin_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_463group_count_bin_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_bin_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_bin_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_462group_count_bin_float64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_462group_count_bin_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float64_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_bin_float64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6782 + * cdef: + * Py_ssize_t i, j, ngroups + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 # <<<<<<<<<<<<<< + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6784 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6785 + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6784 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * float64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6787 + * dtype=np.int64) + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_8 - 1); + __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N)); + + /* "pandas/src/generated.pyx":6789 + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + * + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6790 + * + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_10) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_10; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6791 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6793 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_14 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6794 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6795 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6798 + * + * # not nan + * nobs[b, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_13 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_13) { + __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_12 = __pyx_t_10; + } else { + __pyx_t_12 = __pyx_t_13; + } + __pyx_t_19 = __pyx_v_b; + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12; + } + } + + /* "pandas/src/generated.pyx":6800 + * nobs[b, j] += val == val and val != iNaT + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = __pyx_v_ngroups; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6801 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6802 + * for i in range(ngroups): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6773 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_bin_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6807 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_465group_count_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_464group_count_bin_float32[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_465group_count_bin_float32 = {__Pyx_NAMESTR("group_count_bin_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_465group_count_bin_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_464group_count_bin_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_465group_count_bin_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_bin_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_bin_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_464group_count_bin_float32(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_464group_count_bin_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_float32_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_bin_float32", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6816 + * cdef: + * Py_ssize_t i, j, ngroups + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 # <<<<<<<<<<<<<< + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6818 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6819 + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6818 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * float32_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6821 + * dtype=np.int64) + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_8 - 1); + __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N)); + + /* "pandas/src/generated.pyx":6823 + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + * + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6824 + * + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_10) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_10; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6825 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6827 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_14 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6828 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6829 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6832 + * + * # not nan + * nobs[b, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_13 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_13) { + __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_12 = __pyx_t_10; + } else { + __pyx_t_12 = __pyx_t_13; + } + __pyx_t_19 = __pyx_v_b; + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12; + } + } + + /* "pandas/src/generated.pyx":6834 + * nobs[b, j] += val == val and val != iNaT + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = __pyx_v_ngroups; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6835 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6836 + * for i in range(ngroups): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6807 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_bin_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6841 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_467group_count_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_466group_count_bin_object[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_467group_count_bin_object = {__Pyx_NAMESTR("group_count_bin_object"), (PyCFunction)__pyx_pw_6pandas_5algos_467group_count_bin_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_466group_count_bin_object)}; +static PyObject *__pyx_pw_6pandas_5algos_467group_count_bin_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_bin_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_bin_object", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_466group_count_bin_object(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_466group_count_bin_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_b; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_5numpy_int64_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + PyObject **__pyx_t_26; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_bin_object", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6850 + * cdef: + * Py_ssize_t i, j, ngroups + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 # <<<<<<<<<<<<<< + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6852 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6853 + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6852 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * object val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6855 + * dtype=np.int64) + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_8 - 1); + __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N)); + + /* "pandas/src/generated.pyx":6857 + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + * + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6858 + * + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_10) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_10; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6859 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6861 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_14 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6862 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6863 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6866 + * + * # not nan + * nobs[b, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5algos_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_19 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_20 = __pyx_v_b; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_19; + } + } + + /* "pandas/src/generated.pyx":6868 + * nobs[b, j] += val == val and val != iNaT + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = __pyx_v_ngroups; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6869 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6870 + * for i in range(ngroups): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_j; + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_nobs.diminfo[1].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_4; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + + /* "pandas/src/generated.pyx":6841 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_bin_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6875 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_469group_count_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_468group_count_bin_int64[] = "\n Only aggregates on axis=0\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_469group_count_bin_int64 = {__Pyx_NAMESTR("group_count_bin_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_469group_count_bin_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_468group_count_bin_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_469group_count_bin_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v_counts = 0; + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_bins = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count_bin_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,&__pyx_n_s_counts,&__pyx_n_s_values,&__pyx_n_s_bins,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count_bin_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_out = ((PyArrayObject *)values[0]); + __pyx_v_counts = ((PyArrayObject *)values[1]); + __pyx_v_values = ((PyArrayObject *)values[2]); + __pyx_v_bins = ((PyArrayObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count_bin_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.group_count_bin_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_468group_count_bin_int64(__pyx_self, __pyx_v_out, __pyx_v_counts, __pyx_v_values, __pyx_v_bins); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_468group_count_bin_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_out, PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_bins) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ngroups; + Py_ssize_t __pyx_v_N; + Py_ssize_t __pyx_v_K; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_int64_t __pyx_v_val; + PyArrayObject *__pyx_v_nobs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_nobs; + __Pyx_Buffer __pyx_pybuffer_nobs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count_bin_int64", 0); + __pyx_pybuffer_nobs.pybuffer.buf = NULL; + __pyx_pybuffer_nobs.refcount = 0; + __pyx_pybuffernd_nobs.data = NULL; + __pyx_pybuffernd_nobs.rcbuffer = &__pyx_pybuffer_nobs; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6884 + * cdef: + * Py_ssize_t i, j, ngroups + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 # <<<<<<<<<<<<<< + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + */ + __pyx_v_N = (__pyx_v_values->dimensions[0]); + __pyx_v_K = (__pyx_v_values->dimensions[1]); + __pyx_v_b = 0; + + /* "pandas/src/generated.pyx":6886 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_out->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/generated.pyx":6887 + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), + * dtype=np.int64) # <<<<<<<<<<<<<< + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6886 + * Py_ssize_t N = values.shape[0], K = values.shape[1], b = 0 + * int64_t val + * ndarray[int64_t, ndim=2] nobs = np.zeros((out.shape[0], out.shape[1]), # <<<<<<<<<<<<<< + * dtype=np.int64) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_nobs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_nobs.diminfo[0].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nobs.diminfo[0].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_nobs.diminfo[1].strides = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_nobs.diminfo[1].shape = __pyx_pybuffernd_nobs.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":6889 + * dtype=np.int64) + * + * ngroups = len(bins) + (bins[len(bins) - 1] != N) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_8 - 1); + __pyx_v_ngroups = (__pyx_t_7 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_bins.diminfo[0].strides)) != __pyx_v_N)); + + /* "pandas/src/generated.pyx":6891 + * ngroups = len(bins) + (bins[len(bins) - 1] != N) + * + * for i in range(N): # <<<<<<<<<<<<<< + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 + */ + __pyx_t_8 = __pyx_v_N; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6892 + * + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: # <<<<<<<<<<<<<< + * b += 1 + * + */ + while (1) { + __pyx_t_10 = ((__pyx_v_b < (__pyx_v_ngroups - 1)) != 0); + if (__pyx_t_10) { + __pyx_t_11 = __pyx_v_b; + __pyx_t_12 = ((__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_bins.diminfo[0].strides))) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_10; + } + if (!__pyx_t_13) break; + + /* "pandas/src/generated.pyx":6893 + * for i in range(N): + * while b < ngroups - 1 and i >= bins[b]: + * b += 1 # <<<<<<<<<<<<<< + * + * counts[b] += 1 + */ + __pyx_v_b = (__pyx_v_b + 1); + } + + /* "pandas/src/generated.pyx":6895 + * b += 1 + * + * counts[b] += 1 # <<<<<<<<<<<<<< + * for j in range(K): + * val = values[i, j] + */ + __pyx_t_14 = __pyx_v_b; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + + /* "pandas/src/generated.pyx":6896 + * + * counts[b] += 1 + * for j in range(K): # <<<<<<<<<<<<<< + * val = values[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6897 + * counts[b] += 1 + * for j in range(K): + * val = values[i, j] # <<<<<<<<<<<<<< + * + * # not nan + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides)); + + /* "pandas/src/generated.pyx":6900 + * + * # not nan + * nobs[b, j] += val == val and val != iNaT # <<<<<<<<<<<<<< + * + * for i in range(ngroups): + */ + __pyx_t_13 = (__pyx_v_val == __pyx_v_val); + if (__pyx_t_13) { + __pyx_t_10 = (__pyx_v_val != __pyx_v_6pandas_5algos_iNaT); + __pyx_t_12 = __pyx_t_10; + } else { + __pyx_t_12 = __pyx_t_13; + } + __pyx_t_19 = __pyx_v_b; + __pyx_t_20 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_nobs.diminfo[1].strides) += __pyx_t_12; + } + } + + /* "pandas/src/generated.pyx":6902 + * nobs[b, j] += val == val and val != iNaT + * + * for i in range(ngroups): # <<<<<<<<<<<<<< + * for j in range(K): + * out[i, j] = nobs[i, j] + */ + __pyx_t_8 = __pyx_v_ngroups; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/generated.pyx":6903 + * + * for i in range(ngroups): + * for j in range(K): # <<<<<<<<<<<<<< + * out[i, j] = nobs[i, j] + * + */ + __pyx_t_15 = __pyx_v_K; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/src/generated.pyx":6904 + * for i in range(ngroups): + * for j in range(K): + * out[i, j] = nobs[i, j] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_22 = __pyx_v_j; + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_nobs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_nobs.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_nobs.diminfo[1].strides)); + } + } + + /* "pandas/src/generated.pyx":6875 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.group_count_bin_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nobs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_nobs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_471left_join_indexer_unique_float64 = {__Pyx_NAMESTR("left_join_indexer_unique_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_471left_join_indexer_unique_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_470left_join_indexer_unique_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float64_t __pyx_v_rval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_float64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6917 + * float64_t lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":6918 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":6919 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":6920 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":6922 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6923 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":6924 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6925 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":6927 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6928 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6929 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":6930 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":6932 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6934 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6935 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6936 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":6938 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6939 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6940 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":6941 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":6942 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6943 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":6944 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":6945 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0); + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":6946 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6947 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6949 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6950 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":6951 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":6910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":6955 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_473left_join_indexer_unique_float32 = {__Pyx_NAMESTR("left_join_indexer_unique_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_473left_join_indexer_unique_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_472left_join_indexer_unique_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_float32_t __pyx_v_rval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_float32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":6962 + * float32_t lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":6963 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":6964 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":6965 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":6967 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":6968 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":6969 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6970 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":6972 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":6973 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6974 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":6975 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":6977 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":6979 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":6980 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6981 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":6983 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":6984 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6985 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":6986 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":6987 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":6988 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":6989 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":6990 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0); + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":6991 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6992 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":6994 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":6995 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":6996 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":6955 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7000 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_475left_join_indexer_unique_object = {__Pyx_NAMESTR("left_join_indexer_unique_object"), (PyCFunction)__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_475left_join_indexer_unique_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_474left_join_indexer_unique_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + PyObject *__pyx_v_rval = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_object", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7007 + * object lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7008 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7009 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7010 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7012 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7013 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":7014 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7015 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":7017 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7018 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7019 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7020 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":7022 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7024 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = (__pyx_v_i < (__pyx_v_nleft - 1)); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":7025 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7026 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7028 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_19 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":7029 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7030 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7031 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = (__pyx_v_i < (__pyx_v_nleft - 1)); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":7032 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7033 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7034 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7035 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":7036 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7037 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7039 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7040 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":7041 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7000 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF(__pyx_v_rval); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7045 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_477left_join_indexer_unique_int32 = {__Pyx_NAMESTR("left_join_indexer_unique_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_477left_join_indexer_unique_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_476left_join_indexer_unique_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int32_t __pyx_v_rval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_int32", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7052 + * int32_t lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7053 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7054 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7055 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7057 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7058 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":7059 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7060 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":7062 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7063 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7064 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7065 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":7067 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7069 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":7070 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7071 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7073 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":7074 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7075 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7076 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":7077 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7078 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7079 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7080 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0); + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":7081 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7082 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7084 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7085 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":7086 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7045 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7090 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_479left_join_indexer_unique_int64 = {__Pyx_NAMESTR("left_join_indexer_unique_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_479left_join_indexer_unique_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_unique_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_unique_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_unique_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_478left_join_indexer_unique_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_nright; + PyArrayObject *__pyx_v_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_rval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_unique_int64", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7097 + * int64_t lval, rval + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * nleft = len(left) + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7098 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * nleft = len(left) + * nright = len(right) + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7099 + * i = 0 + * j = 0 + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7100 + * j = 0 + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * indexer = np.empty(nleft, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7102 + * nright = len(right) + * + * indexer = np.empty(nleft, dtype=np.int64) # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_nleft); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7103 + * + * indexer = np.empty(nleft, dtype=np.int64) + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":7104 + * indexer = np.empty(nleft, dtype=np.int64) + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7105 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * + * if j == nright: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/generated.pyx":7107 + * break + * + * if j == nright: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * i += 1 + */ + __pyx_t_12 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_12) { + + /* "pandas/src/generated.pyx":7108 + * + * if j == nright: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * continue + */ + __pyx_t_1 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7109 + * if j == nright: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7110 + * indexer[i] = -1 + * i += 1 + * continue # <<<<<<<<<<<<<< + * + * rval = right[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/generated.pyx":7112 + * continue + * + * rval = right[j] # <<<<<<<<<<<<<< + * + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_13 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7114 + * rval = right[j] + * + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_12 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_12) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_12; + } + if (!__pyx_t_16) break; + + /* "pandas/src/generated.pyx":7115 + * + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7116 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * + * if left[i] == right[j]: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7118 + * i += 1 + * + * if left[i] == right[j]: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_left.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/generated.pyx":7119 + * + * if left[i] == right[j]: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * while i < nleft - 1 and left[i] == rval: + */ + __pyx_t_20 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7120 + * if left[i] == right[j]: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7121 + * indexer[i] = j + * i += 1 + * while i < nleft - 1 and left[i] == rval: # <<<<<<<<<<<<<< + * indexer[i] = j + * i += 1 + */ + while (1) { + __pyx_t_16 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_16) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_left.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_16; + } + if (!__pyx_t_15) break; + + /* "pandas/src/generated.pyx":7122 + * i += 1 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j # <<<<<<<<<<<<<< + * i += 1 + * j += 1 + */ + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7123 + * while i < nleft - 1 and left[i] == rval: + * indexer[i] = j + * i += 1 # <<<<<<<<<<<<<< + * j += 1 + * elif left[i] > rval: + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7124 + * indexer[i] = j + * i += 1 + * j += 1 # <<<<<<<<<<<<<< + * elif left[i] > rval: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7125 + * i += 1 + * j += 1 + * elif left[i] > rval: # <<<<<<<<<<<<<< + * indexer[i] = -1 + * j += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_left.diminfo[0].strides)) > __pyx_v_rval) != 0); + if (__pyx_t_15) { + + /* "pandas/src/generated.pyx":7126 + * j += 1 + * elif left[i] > rval: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_24 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7127 + * elif left[i] > rval: + * indexer[i] = -1 + * j += 1 # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7129 + * j += 1 + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * i += 1 + * return indexer + */ + __pyx_t_25 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7130 + * else: + * indexer[i] = -1 + * i += 1 # <<<<<<<<<<<<<< + * return indexer + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L9:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/generated.pyx":7131 + * indexer[i] = -1 + * i += 1 + * return indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7090 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_unique_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7135 + * + * + * def left_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_481left_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_480left_join_indexer_float64[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_481left_join_indexer_float64 = {__Pyx_NAMESTR("left_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_481left_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_480left_join_indexer_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_481left_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_480left_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_480left_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float64_t __pyx_v_lval; + __pyx_t_5numpy_float64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_float64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7146 + * ndarray[float64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7147 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7149 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7150 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7151 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7152 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7153 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7154 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7155 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7156 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7158 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7159 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7161 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7162 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7163 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7164 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7165 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7167 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7168 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7169 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7170 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7171 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7172 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_9 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7173 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7176 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7177 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7178 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7179 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7181 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7185 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7186 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float64) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7187 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/generated.pyx":7189 + * result = np.empty(count, dtype=np.float64) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7190 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7191 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7192 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_7 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7193 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7194 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7195 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7196 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7197 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7198 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7199 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7200 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7201 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7203 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7204 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7206 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7207 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_26 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7208 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7209 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7210 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7211 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7212 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + __pyx_t_29 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7213 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7215 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7216 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7217 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7218 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7219 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7220 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7221 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7224 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7225 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7226 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7227 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7228 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_35 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7229 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7230 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7232 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7234 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7135 + * + * + * def left_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7237 + * + * + * def left_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_483left_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_482left_join_indexer_float32[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_483left_join_indexer_float32 = {__Pyx_NAMESTR("left_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_483left_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_482left_join_indexer_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_483left_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_482left_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_482left_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float32_t __pyx_v_lval; + __pyx_t_5numpy_float32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_float32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7248 + * ndarray[float32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7249 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7251 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7252 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7253 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7254 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7255 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7256 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7257 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7258 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7260 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7261 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7263 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7264 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7265 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7266 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7267 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7269 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7270 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7271 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7272 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7273 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7274 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_9 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7275 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7278 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7279 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7280 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7281 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7283 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7287 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7288 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float32) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7289 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/generated.pyx":7291 + * result = np.empty(count, dtype=np.float32) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7292 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7293 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7294 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_7 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7295 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7296 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7297 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7298 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7299 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7300 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7301 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7302 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7303 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7305 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7306 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7308 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7309 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_26 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7310 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7311 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7312 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7313 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7314 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + __pyx_t_29 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7315 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7317 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7318 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7319 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7320 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7321 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7322 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7323 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7326 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7327 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7328 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7329 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7330 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_35 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7331 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7332 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7334 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7336 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7237 + * + * + * def left_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7339 + * + * + * def left_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_485left_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_484left_join_indexer_object[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_485left_join_indexer_object = {__Pyx_NAMESTR("left_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_485left_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_484left_join_indexer_object)}; +static PyObject *__pyx_pw_6pandas_5algos_485left_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_484left_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_484left_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + PyObject *__pyx_v_lval = 0; + PyObject *__pyx_v_rval = 0; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + PyObject **__pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_object", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7350 + * ndarray[object] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7351 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7353 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7354 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7355 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7356 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7357 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7358 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7359 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7360 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7362 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":7363 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_5 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":7365 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7366 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7367 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7368 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_2) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_4 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_2; + } + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7369 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7371 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7372 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7373 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7374 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_9 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7375 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7376 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_11 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7377 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7380 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7381 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7382 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7383 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7385 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7389 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7390 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=object) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7391 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/src/generated.pyx":7393 + * result = np.empty(count, dtype=object) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7394 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7395 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7396 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_9 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7397 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_9 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_9) break; + + /* "pandas/src/generated.pyx":7398 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_9 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7399 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_9 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_9) break; + + /* "pandas/src/generated.pyx":7400 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7401 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7402 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_23 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_24); + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_24); + *__pyx_t_24 = __pyx_t_7; + __Pyx_GIVEREF(*__pyx_t_24); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/generated.pyx":7403 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7404 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7405 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7407 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/src/generated.pyx":7408 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_26 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/src/generated.pyx":7410 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7411 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7412 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7413 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_29 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_24); + __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_24); + *__pyx_t_24 = __pyx_v_lval; + __Pyx_GIVEREF(*__pyx_t_24); + + /* "pandas/src/generated.pyx":7414 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7415 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_9 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/generated.pyx":7416 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_9 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_9) { + __pyx_t_30 = (__pyx_v_j + 1); + __pyx_t_4 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_13 = PyObject_RichCompare(__pyx_t_7, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_8 = __pyx_t_2; + } else { + __pyx_t_8 = __pyx_t_9; + } + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7417 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7419 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7420 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_13); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_13, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7421 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7422 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_8 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7423 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7424 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_32 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __pyx_t_13 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7425 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7428 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7429 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_13 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7430 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7431 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_34 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7432 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_13); + __pyx_t_36 = __pyx_v_count; + __pyx_t_4 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_24); + __Pyx_INCREF(__pyx_t_13); __Pyx_DECREF(*__pyx_t_24); + *__pyx_t_24 = __pyx_t_13; + __Pyx_GIVEREF(*__pyx_t_24); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7433 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7434 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7436 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7438 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_13, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7339 + * + * + * def left_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_lval); + __Pyx_XDECREF(__pyx_v_rval); + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7441 + * + * + * def left_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_487left_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_486left_join_indexer_int32[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_487left_join_indexer_int32 = {__Pyx_NAMESTR("left_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_487left_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_486left_join_indexer_int32)}; +static PyObject *__pyx_pw_6pandas_5algos_487left_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_486left_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_486left_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int32_t __pyx_v_lval; + __pyx_t_5numpy_int32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_int32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7452 + * ndarray[int32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7453 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7455 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7456 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7457 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7458 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7459 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7460 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7461 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7462 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7464 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7465 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7467 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7468 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7469 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7470 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7471 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7473 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7474 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7475 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7476 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7477 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7478 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_9 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7479 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7482 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7483 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7484 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7485 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7487 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7491 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7492 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int32) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7493 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/generated.pyx":7495 + * result = np.empty(count, dtype=np.int32) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7496 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7497 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7498 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_7 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7499 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7500 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7501 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7502 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7503 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7504 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7505 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7506 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7507 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7509 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7510 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7512 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7513 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_26 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7514 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7515 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7516 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7517 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7518 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + __pyx_t_29 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7519 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7521 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7522 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7523 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7524 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7525 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7526 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7527 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7530 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7531 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7532 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7533 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7534 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_35 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7535 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7536 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7538 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7540 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7441 + * + * + * def left_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7543 + * + * + * def left_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_489left_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_488left_join_indexer_int64[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_489left_join_indexer_int64 = {__Pyx_NAMESTR("left_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_489left_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_488left_join_indexer_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_489left_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("left_join_indexer_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("left_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("left_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.left_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_488left_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_488left_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int64_t __pyx_v_lval; + __pyx_t_5numpy_int64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("left_join_indexer_int64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7554 + * ndarray[int64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7555 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7557 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7558 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7559 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7560 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7561 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + while (1) { + __pyx_t_2 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_2) break; + + /* "pandas/src/generated.pyx":7562 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7563 + * while i < nleft: + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7564 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7566 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7567 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7569 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7570 + * + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7571 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7572 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7573 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7575 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7576 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7577 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + __pyx_L10:; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7578 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7579 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7580 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_9 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7581 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7584 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/generated.pyx":7585 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_7 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7586 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7587 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7589 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L7:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7593 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":7594 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7595 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/generated.pyx":7597 + * result = np.empty(count, dtype=np.int64) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7598 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7599 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0: + * while i < nleft: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7600 + * j = 0 + * count = 0 + * if nleft > 0: # <<<<<<<<<<<<<< + * while i < nleft: + * if j == nright: + */ + __pyx_t_7 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7601 + * count = 0 + * if nleft > 0: + * while i < nleft: # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7602 + * if nleft > 0: + * while i < nleft: + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_7 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7603 + * while i < nleft: + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_7 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_7) break; + + /* "pandas/src/generated.pyx":7604 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_20 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7605 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * i += 1 + */ + __pyx_t_21 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7606 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * i += 1 + * count += 1 + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7607 + * rindexer[count] = -1 + * result[count] = left[i] + * i += 1 # <<<<<<<<<<<<<< + * count += 1 + * break + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7608 + * result[count] = left[i] + * i += 1 + * count += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + 1); + } + + /* "pandas/src/generated.pyx":7609 + * i += 1 + * count += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L14_break; + } + + /* "pandas/src/generated.pyx":7611 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7612 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_25 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7614 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_7 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7615 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_26 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7616 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_27 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7617 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_28 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7618 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7619 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_7 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":7620 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + __pyx_t_29 = (__pyx_v_j + 1); + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7621 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7623 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7624 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7625 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":7626 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7627 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7628 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_3 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_right.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_right.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7629 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7632 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L14_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":7633 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7634 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_lindexer.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_lindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7635 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_rindexer.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rindexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7636 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_left.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_left.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_35 = __pyx_v_count; + __pyx_t_3 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7637 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7638 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7640 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L14_break:; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/generated.pyx":7642 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7543 + * + * + * def left_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.left_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7647 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_491outer_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_491outer_join_indexer_float64 = {__Pyx_NAMESTR("outer_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_491outer_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_491outer_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_490outer_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_490outer_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float64_t __pyx_v_lval; + __pyx_t_5numpy_float64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_float64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7655 + * ndarray[float64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7656 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7658 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7659 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7660 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7661 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7662 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":7663 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7664 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7666 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":7667 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7668 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":7669 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7670 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7671 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7672 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7674 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7675 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_3 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7676 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7677 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7678 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7679 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_4 = (__pyx_v_j + 1); + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7680 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7682 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7683 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7684 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7685 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7686 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7687 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7688 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7691 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7692 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7693 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7694 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7696 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7697 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7699 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7700 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":7701 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":7705 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7706 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7707 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7708 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_6 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7709 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":7710 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7711 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7712 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)); + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":7713 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_6 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7714 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":7715 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_26 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7716 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7717 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides)); + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7719 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":7720 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7721 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":7722 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7723 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7724 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7725 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7726 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":7727 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7728 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7729 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":7730 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7731 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7732 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7733 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7734 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7735 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7737 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7738 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_37 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7740 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7741 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_38 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7742 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7743 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7744 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7745 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7746 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + __pyx_t_41 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7747 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7749 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7750 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7751 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":7752 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7753 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7754 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_43 = __pyx_v_j; + __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7755 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7758 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":7759 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7760 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_44 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7761 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7762 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7763 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7764 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7766 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_47 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7767 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7768 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":7769 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7770 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":7772 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7647 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7776 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_493outer_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_493outer_join_indexer_float32 = {__Pyx_NAMESTR("outer_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_493outer_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_493outer_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_492outer_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_492outer_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float32_t __pyx_v_lval; + __pyx_t_5numpy_float32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_float32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7784 + * ndarray[float32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7785 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7787 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7788 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7789 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7790 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7791 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":7792 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7793 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7795 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":7796 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7797 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":7798 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7799 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7800 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7801 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7803 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7804 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_3 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7805 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7806 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7807 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7808 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_4 = (__pyx_v_j + 1); + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7809 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7811 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7812 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7813 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7814 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7815 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7816 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7817 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7820 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7821 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7822 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7823 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7825 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7826 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7828 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7829 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float32) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":7830 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":7834 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7835 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7836 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7837 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_6 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7838 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":7839 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7840 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7841 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)); + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":7842 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_6 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7843 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":7844 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_26 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7845 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7846 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides)); + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7848 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":7849 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7850 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":7851 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7852 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7853 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7854 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7855 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":7856 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7857 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7858 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":7859 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7860 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7861 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7862 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7863 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7864 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7866 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7867 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_37 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":7869 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7870 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_38 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7871 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7872 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7873 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7874 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":7875 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + __pyx_t_41 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7876 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7878 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7879 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7880 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":7881 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7882 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7883 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_43 = __pyx_v_j; + __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7884 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7887 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":7888 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":7889 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_44 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7890 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7891 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":7892 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7893 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7895 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_47 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7896 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7897 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":7898 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7899 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":7901 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7776 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":7905 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_495outer_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_495outer_join_indexer_object = {__Pyx_NAMESTR("outer_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_495outer_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_495outer_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_494outer_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_494outer_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + PyObject *__pyx_v_lval = 0; + PyObject *__pyx_v_rval = 0; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + PyObject **__pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_object", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":7913 + * ndarray[object] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":7914 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":7916 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7917 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7918 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7919 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7920 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":7921 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7922 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7924 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":7925 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7926 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":7927 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7928 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7929 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":7930 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":7932 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":7933 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_4 = __pyx_v_j; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/generated.pyx":7934 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7935 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7936 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":7937 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_2) { + __pyx_t_5 = (__pyx_v_j + 1); + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_2; + } + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7938 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7940 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":7941 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7942 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":7943 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_8 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7944 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":7945 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_10 = __pyx_v_j; + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7946 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7949 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":7950 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7951 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7952 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7954 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7955 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":7957 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":7958 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=object) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":7959 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7963 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":7964 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":7965 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":7966 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_8 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7967 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":7968 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7969 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7970 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_25 = __pyx_v_j; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_6; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":7971 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_8 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7972 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":7973 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7974 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_28 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7975 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_30 = __pyx_v_i; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_6; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":7977 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":7978 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_8 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7979 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_8 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_8) break; + + /* "pandas/src/generated.pyx":7980 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7981 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":7982 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_31 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_32 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_6; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7983 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7984 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":7985 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7986 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_8 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7987 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_8 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_8) break; + + /* "pandas/src/generated.pyx":7988 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":7989 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_34 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":7990 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_36 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_t_6; + __Pyx_GIVEREF(*__pyx_t_26); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7991 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":7992 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":7993 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":7995 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7996 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_38 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/generated.pyx":7998 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":7999 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8000 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8001 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_41 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_v_lval; + __Pyx_GIVEREF(*__pyx_t_26); + + /* "pandas/src/generated.pyx":8002 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8003 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_8 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_8) { + + /* "pandas/src/generated.pyx":8004 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_8 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_8) { + __pyx_t_42 = (__pyx_v_j + 1); + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_6, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __pyx_t_2; + } else { + __pyx_t_7 = __pyx_t_8; + } + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8005 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8007 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8008 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_12 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_12); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_12, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8009 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":8010 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_7 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8011 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8012 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_44 = __pyx_v_j; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8013 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8016 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":8017 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_7) { + + /* "pandas/src/generated.pyx":8018 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8019 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8020 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_47 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_v_lval); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_v_lval; + __Pyx_GIVEREF(*__pyx_t_26); + + /* "pandas/src/generated.pyx":8021 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8022 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8024 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8025 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8026 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_50 = __pyx_v_count; + __pyx_t_26 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_26); + __Pyx_INCREF(__pyx_v_rval); __Pyx_DECREF(*__pyx_t_26); + *__pyx_t_26 = __pyx_v_rval; + __Pyx_GIVEREF(*__pyx_t_26); + + /* "pandas/src/generated.pyx":8027 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8028 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8030 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":7905 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_lval); + __Pyx_XDECREF(__pyx_v_rval); + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8034 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_497outer_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_497outer_join_indexer_int32 = {__Pyx_NAMESTR("outer_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_497outer_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_497outer_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_496outer_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_496outer_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int32_t __pyx_v_lval; + __pyx_t_5numpy_int32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_int32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8042 + * ndarray[int32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8043 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8045 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8046 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8047 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8048 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8049 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":8050 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8051 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8053 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":8054 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8055 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":8056 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8057 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8058 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":8059 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8061 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8062 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_3 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8063 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8064 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8065 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8066 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_4 = (__pyx_v_j + 1); + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8067 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8069 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8070 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8071 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8072 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8073 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8074 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8075 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8078 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8079 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8080 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8081 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8083 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8084 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8086 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8087 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int32) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8088 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8092 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8093 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8094 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8095 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_6 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8096 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":8097 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8098 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8099 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)); + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":8100 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_6 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8101 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":8102 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_26 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8103 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8104 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides)); + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8106 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":8107 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8108 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":8109 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8110 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8111 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8112 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8113 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":8114 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":8115 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8116 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":8117 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8118 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8119 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8120 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8121 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":8122 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":8124 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8125 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_37 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8127 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8128 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_38 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8129 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8130 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":8131 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8132 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8133 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + __pyx_t_41 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8134 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8136 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8137 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8138 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":8139 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8140 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8141 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_43 = __pyx_v_j; + __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8142 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8145 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":8146 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8147 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_44 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8148 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8149 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":8150 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8151 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8153 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_47 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8154 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8155 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8156 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8157 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8159 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8034 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_499outer_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5algos_499outer_join_indexer_int64 = {__Pyx_NAMESTR("outer_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_499outer_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5algos_499outer_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("outer_join_indexer_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outer_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("outer_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_498outer_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_498outer_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int64_t __pyx_v_lval; + __pyx_t_5numpy_int64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("outer_join_indexer_int64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8171 + * ndarray[int64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8172 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8174 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8175 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8176 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * count = nright + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8177 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * count = nright + * elif nright == 0: + */ + __pyx_t_2 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8178 + * count = 0 + * if nleft == 0: + * count = nright # <<<<<<<<<<<<<< + * elif nright == 0: + * count = nleft + */ + __pyx_v_count = __pyx_v_nright; + goto __pyx_L3; + } + + /* "pandas/src/generated.pyx":8179 + * if nleft == 0: + * count = nright + * elif nright == 0: # <<<<<<<<<<<<<< + * count = nleft + * else: + */ + __pyx_t_2 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8180 + * count = nright + * elif nright == 0: + * count = nleft # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_v_count = __pyx_v_nleft; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8182 + * count = nleft + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * count += nright - j + */ + while (1) { + + /* "pandas/src/generated.pyx":8183 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * count += nright - j + * break + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8184 + * while True: + * if i == nleft: + * count += nright - j # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nright - __pyx_v_j)); + + /* "pandas/src/generated.pyx":8185 + * if i == nleft: + * count += nright - j + * break # <<<<<<<<<<<<<< + * if j == nright: + * count += nleft - i + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8186 + * count += nright - j + * break + * if j == nright: # <<<<<<<<<<<<<< + * count += nleft - i + * break + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8187 + * break + * if j == nright: + * count += nleft - i # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_count = (__pyx_v_count + (__pyx_v_nleft - __pyx_v_i)); + + /* "pandas/src/generated.pyx":8188 + * if j == nright: + * count += nleft - i + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8190 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8191 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_3 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8192 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8193 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8194 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8195 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_4 = (__pyx_v_j + 1); + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8196 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8198 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8199 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8200 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8201 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8202 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8203 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_6 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8204 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8207 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * count += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8208 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_6 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8209 + * break + * elif lval < rval: + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8210 + * elif lval < rval: + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * count += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8212 + * i += 1 + * else: + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8213 + * else: + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * lindexer = np.empty(count, dtype=np.int64) + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8215 + * j += 1 + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8216 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8217 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * # do it again, but populate the indexers / result + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8221 + * # do it again, but populate the indexers / result + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8222 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft == 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8223 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft == 0: + * for j in range(nright): + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8224 + * j = 0 + * count = 0 + * if nleft == 0: # <<<<<<<<<<<<<< + * for j in range(nright): + * lindexer[j] = -1 + */ + __pyx_t_6 = ((__pyx_v_nleft == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8225 + * count = 0 + * if nleft == 0: + * for j in range(nright): # <<<<<<<<<<<<<< + * lindexer[j] = -1 + * rindexer[j] = j + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_j = __pyx_t_21; + + /* "pandas/src/generated.pyx":8226 + * if nleft == 0: + * for j in range(nright): + * lindexer[j] = -1 # <<<<<<<<<<<<<< + * rindexer[j] = j + * result[j] = right[j] + */ + __pyx_t_22 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8227 + * for j in range(nright): + * lindexer[j] = -1 + * rindexer[j] = j # <<<<<<<<<<<<<< + * result[j] = right[j] + * elif nright == 0: + */ + __pyx_t_23 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8228 + * lindexer[j] = -1 + * rindexer[j] = j + * result[j] = right[j] # <<<<<<<<<<<<<< + * elif nright == 0: + * for i in range(nright): + */ + __pyx_t_24 = __pyx_v_j; + __pyx_t_25 = __pyx_v_j; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_right.diminfo[0].strides)); + } + goto __pyx_L13; + } + + /* "pandas/src/generated.pyx":8229 + * rindexer[j] = j + * result[j] = right[j] + * elif nright == 0: # <<<<<<<<<<<<<< + * for i in range(nright): + * lindexer[i] = i + */ + __pyx_t_6 = ((__pyx_v_nright == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8230 + * result[j] = right[j] + * elif nright == 0: + * for i in range(nright): # <<<<<<<<<<<<<< + * lindexer[i] = i + * rindexer[i] = -1 + */ + __pyx_t_20 = __pyx_v_nright; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/src/generated.pyx":8231 + * elif nright == 0: + * for i in range(nright): + * lindexer[i] = i # <<<<<<<<<<<<<< + * rindexer[i] = -1 + * result[i] = left[i] + */ + __pyx_t_26 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8232 + * for i in range(nright): + * lindexer[i] = i + * rindexer[i] = -1 # <<<<<<<<<<<<<< + * result[i] = left[i] + * else: + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8233 + * lindexer[i] = i + * rindexer[i] = -1 + * result[i] = left[i] # <<<<<<<<<<<<<< + * else: + * while True: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_left.diminfo[0].strides)); + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8235 + * result[i] = left[i] + * else: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * while j < nright: + */ + while (1) { + + /* "pandas/src/generated.pyx":8236 + * else: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * while j < nright: + * lindexer[count] = -1 + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8237 + * while True: + * if i == nleft: + * while j < nright: # <<<<<<<<<<<<<< + * lindexer[count] = -1 + * rindexer[count] = j + */ + while (1) { + __pyx_t_6 = ((__pyx_v_j < __pyx_v_nright) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":8238 + * if i == nleft: + * while j < nright: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = right[j] + */ + __pyx_t_20 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8239 + * while j < nright: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = right[j] + * count += 1 + */ + __pyx_t_21 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8240 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = right[j] # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_30 = __pyx_v_j; + __pyx_t_31 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8241 + * rindexer[count] = j + * result[count] = right[j] + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8242 + * result[count] = right[j] + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/generated.pyx":8243 + * count += 1 + * j += 1 + * break # <<<<<<<<<<<<<< + * if j == nright: + * while i < nleft: + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":8244 + * j += 1 + * break + * if j == nright: # <<<<<<<<<<<<<< + * while i < nleft: + * lindexer[count] = i + */ + __pyx_t_6 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8245 + * break + * if j == nright: + * while i < nleft: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_i < __pyx_v_nleft) != 0); + if (!__pyx_t_6) break; + + /* "pandas/src/generated.pyx":8246 + * if j == nright: + * while i < nleft: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = left[i] + */ + __pyx_t_32 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8247 + * while i < nleft: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = left[i] + * count += 1 + */ + __pyx_t_33 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8248 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = left[i] # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8249 + * rindexer[count] = -1 + * result[count] = left[i] + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * break + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8250 + * result[count] = left[i] + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "pandas/src/generated.pyx":8251 + * count += 1 + * i += 1 + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L19_break; + } + + /* "pandas/src/generated.pyx":8253 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8254 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * + * if lval == rval: + */ + __pyx_t_37 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8256 + * rval = right[j] + * + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_6 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8257 + * + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = lval + */ + __pyx_t_38 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8258 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_39 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8259 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_40 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":8260 + * rindexer[count] = j + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8261 + * result[count] = lval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_6 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_6) { + + /* "pandas/src/generated.pyx":8262 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_6 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_6) { + __pyx_t_41 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8263 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L28; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8265 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8266 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8267 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L29; + } + __pyx_L29:; + } + __pyx_L28:; + goto __pyx_L27; + } + + /* "pandas/src/generated.pyx":8268 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_5 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8269 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8270 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_43 = __pyx_v_j; + __pyx_t_5 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8271 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L30; + } + __pyx_L30:; + goto __pyx_L27; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8274 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * lindexer[count] = i + */ + goto __pyx_L19_break; + } + __pyx_L27:; + goto __pyx_L26; + } + + /* "pandas/src/generated.pyx":8275 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = -1 + */ + __pyx_t_5 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_5) { + + /* "pandas/src/generated.pyx":8276 + * break + * elif lval < rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = -1 + * result[count] = lval + */ + __pyx_t_44 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8277 + * elif lval < rval: + * lindexer[count] = i + * rindexer[count] = -1 # <<<<<<<<<<<<<< + * result[count] = lval + * count += 1 + */ + __pyx_t_45 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8278 + * lindexer[count] = i + * rindexer[count] = -1 + * result[count] = lval # <<<<<<<<<<<<<< + * count += 1 + * i += 1 + */ + __pyx_t_46 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_lval; + + /* "pandas/src/generated.pyx":8279 + * rindexer[count] = -1 + * result[count] = lval + * count += 1 # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8280 + * result[count] = lval + * count += 1 + * i += 1 # <<<<<<<<<<<<<< + * else: + * lindexer[count] = -1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8282 + * i += 1 + * else: + * lindexer[count] = -1 # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_47 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lindexer.diminfo[0].strides) = -1; + + /* "pandas/src/generated.pyx":8283 + * else: + * lindexer[count] = -1 + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_48 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8284 + * lindexer[count] = -1 + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * j += 1 + */ + __pyx_t_49 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8285 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8286 + * result[count] = rval + * count += 1 + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L26:; + } + __pyx_L19_break:; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8288 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.outer_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8293 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_501inner_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_500inner_join_indexer_float64[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_501inner_join_indexer_float64 = {__Pyx_NAMESTR("inner_join_indexer_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_501inner_join_indexer_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_500inner_join_indexer_float64)}; +static PyObject *__pyx_pw_6pandas_5algos_501inner_join_indexer_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_float64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_float64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_500inner_join_indexer_float64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_500inner_join_indexer_float64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float64_t __pyx_v_lval; + __pyx_t_5numpy_float64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_float64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8304 + * ndarray[float64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8305 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8307 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8308 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8309 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8310 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8311 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8312 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8313 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8314 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8315 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8317 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8318 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_5 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8319 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8320 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8321 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8322 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8323 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8325 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8326 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8327 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8328 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8329 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8330 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8331 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8334 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8335 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8336 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8338 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8342 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8343 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8344 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float64) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8346 + * result = np.empty(count, dtype=np.float64) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8347 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8348 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8349 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8350 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8351 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8352 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8353 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8354 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8356 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8357 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8358 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8359 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8360 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8361 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8362 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8363 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8364 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_25 = (__pyx_v_j + 1); + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8365 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8367 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8368 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8369 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8370 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8371 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8372 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8373 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8376 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8377 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8378 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8380 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8382 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8293 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8386 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_503inner_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_502inner_join_indexer_float32[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_503inner_join_indexer_float32 = {__Pyx_NAMESTR("inner_join_indexer_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_503inner_join_indexer_float32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_502inner_join_indexer_float32)}; +static PyObject *__pyx_pw_6pandas_5algos_503inner_join_indexer_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_float32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_float32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_float32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_502inner_join_indexer_float32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_502inner_join_indexer_float32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_float32_t __pyx_v_lval; + __pyx_t_5numpy_float32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_float32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8397 + * ndarray[float32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8398 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8400 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8401 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8402 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8403 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8404 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8405 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8406 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8407 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8408 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8410 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8411 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_5 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8412 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8413 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8414 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8415 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8416 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8418 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8419 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8420 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8421 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8422 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8423 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8424 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8427 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8428 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8429 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8431 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8435 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8436 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.float32) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8437 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.float32) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8439 + * result = np.empty(count, dtype=np.float32) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8440 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8441 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8442 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8443 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8444 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8445 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8446 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8447 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8449 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8450 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8451 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8452 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8453 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8454 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8455 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8456 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8457 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_25 = (__pyx_v_j + 1); + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8458 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8460 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8461 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8462 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8463 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8464 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8465 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8466 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8469 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8470 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8471 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8473 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8475 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8386 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_float32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8479 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_505inner_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_504inner_join_indexer_object[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_505inner_join_indexer_object = {__Pyx_NAMESTR("inner_join_indexer_object"), (PyCFunction)__pyx_pw_6pandas_5algos_505inner_join_indexer_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_504inner_join_indexer_object)}; +static PyObject *__pyx_pw_6pandas_5algos_505inner_join_indexer_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_object") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_504inner_join_indexer_object(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_504inner_join_indexer_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + PyObject *__pyx_v_lval = 0; + PyObject *__pyx_v_rval = 0; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + PyObject **__pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_object", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8490 + * ndarray[object] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8491 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8493 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8494 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8495 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8496 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8497 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8498 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8499 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8500 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8501 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8503 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":8504 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_6 = __pyx_v_j; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/generated.pyx":8505 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8506 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8507 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8508 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_4) { + __pyx_t_7 = (__pyx_v_j + 1); + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_5, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8509 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8511 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8512 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8513 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8514 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8515 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8516 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_10 = __pyx_v_j; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8517 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8520 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8521 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8522 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8524 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8528 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8529 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=object) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8530 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=object) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":8532 + * result = np.empty(count, dtype=object) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8533 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8534 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8535 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8536 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8537 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8538 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8539 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8540 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8542 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_lval, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":8543 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_rval, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/generated.pyx":8544 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_8 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8545 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8546 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8547 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + __pyx_t_25 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_25); + __Pyx_INCREF(__pyx_v_rval); __Pyx_DECREF(*__pyx_t_25); + *__pyx_t_25 = __pyx_v_rval; + __Pyx_GIVEREF(*__pyx_t_25); + + /* "pandas/src/generated.pyx":8548 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8549 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8550 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = (__pyx_v_j < (__pyx_v_nright - 1)); + if (__pyx_t_2) { + __pyx_t_26 = (__pyx_v_j + 1); + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_8, __pyx_v_rval, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8551 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8553 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8554 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_12 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_12); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_12, __pyx_v_rval, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8555 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8556 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8557 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8558 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_28 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8559 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8562 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8563 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_12 = PyObject_RichCompare(__pyx_v_lval, __pyx_v_rval, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8564 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8566 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8568 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8479 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_lval); + __Pyx_XDECREF(__pyx_v_rval); + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_507inner_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_506inner_join_indexer_int32[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_507inner_join_indexer_int32 = {__Pyx_NAMESTR("inner_join_indexer_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_507inner_join_indexer_int32, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_506inner_join_indexer_int32)}; +static PyObject *__pyx_pw_6pandas_5algos_507inner_join_indexer_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_int32 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int32", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_int32") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int32", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_506inner_join_indexer_int32(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_506inner_join_indexer_int32(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int32_t __pyx_v_lval; + __pyx_t_5numpy_int32_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_int32", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8583 + * ndarray[int32_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8584 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8586 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8587 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8588 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8589 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8590 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8591 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8592 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8593 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8594 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8596 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8597 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_5 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8598 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8599 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8600 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8601 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8602 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8604 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8605 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8606 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8607 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8608 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8609 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8610 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8613 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8614 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8615 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8617 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8621 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8622 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int32) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8623 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int32) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8625 + * result = np.empty(count, dtype=np.int32) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8626 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8627 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8628 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8629 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8630 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8631 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8632 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8633 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8635 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8636 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8637 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8638 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8639 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8640 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8641 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8642 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8643 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_25 = (__pyx_v_j + 1); + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8644 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8646 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8647 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8648 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8649 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8650 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8651 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8652 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8655 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8656 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8657 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8659 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8661 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/generated.pyx":8665 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5algos_509inner_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5algos_508inner_join_indexer_int64[] = "\n Two-pass algorithm for monotonic indexes. Handles many-to-one merges\n "; +static PyMethodDef __pyx_mdef_6pandas_5algos_509inner_join_indexer_int64 = {__Pyx_NAMESTR("inner_join_indexer_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_509inner_join_indexer_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_508inner_join_indexer_int64)}; +static PyObject *__pyx_pw_6pandas_5algos_509inner_join_indexer_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("inner_join_indexer_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner_join_indexer_int64") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("inner_join_indexer_int64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5algos_508inner_join_indexer_int64(__pyx_self, __pyx_v_left, __pyx_v_right); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5algos_508inner_join_indexer_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_nright; + Py_ssize_t __pyx_v_nleft; + Py_ssize_t __pyx_v_count; + __pyx_t_5numpy_int64_t __pyx_v_lval; + __pyx_t_5numpy_int64_t __pyx_v_rval; + PyArrayObject *__pyx_v_lindexer = 0; + PyArrayObject *__pyx_v_rindexer = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lindexer; + __Pyx_Buffer __pyx_pybuffer_lindexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rindexer; + __Pyx_Buffer __pyx_pybuffer_rindexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("inner_join_indexer_int64", 0); + __pyx_pybuffer_lindexer.pybuffer.buf = NULL; + __pyx_pybuffer_lindexer.refcount = 0; + __pyx_pybuffernd_lindexer.data = NULL; + __pyx_pybuffernd_lindexer.rcbuffer = &__pyx_pybuffer_lindexer; + __pyx_pybuffer_rindexer.pybuffer.buf = NULL; + __pyx_pybuffer_rindexer.refcount = 0; + __pyx_pybuffernd_rindexer.data = NULL; + __pyx_pybuffernd_rindexer.rcbuffer = &__pyx_pybuffer_rindexer; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/generated.pyx":8676 + * ndarray[int64_t] result + * + * nleft = len(left) # <<<<<<<<<<<<<< + * nright = len(right) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nleft = __pyx_t_1; + + /* "pandas/src/generated.pyx":8677 + * + * nleft = len(left) + * nright = len(right) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nright = __pyx_t_1; + + /* "pandas/src/generated.pyx":8679 + * nright = len(right) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8680 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8681 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8682 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_2 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_nright > 0) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8683 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8684 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_4 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8685 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8686 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8687 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/generated.pyx":8689 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_1 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8690 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * count += 1 + */ + __pyx_t_5 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8691 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_4 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8692 + * rval = right[j] + * if lval == rval: + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8693 + * if lval == rval: + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_4 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8694 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + __pyx_t_6 = (__pyx_v_j + 1); + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8695 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8697 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8698 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8699 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L9; + } + + /* "pandas/src/generated.pyx":8700 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_3 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8701 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8702 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_3 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8703 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8706 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L5_break; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "pandas/src/generated.pyx":8707 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_3 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_3) { + + /* "pandas/src/generated.pyx":8708 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8710 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * # do it again now that result size is known + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L8:; + } + __pyx_L5_break:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/generated.pyx":8714 + * # do it again now that result size is known + * + * lindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_lindexer.diminfo[0].strides = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lindexer.diminfo[0].shape = __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_lindexer = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":8715 + * + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * result = np.empty(count, dtype=np.int64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_12); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + } + __pyx_pybuffernd_rindexer.diminfo[0].strides = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rindexer.diminfo[0].shape = __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_rindexer = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/src/generated.pyx":8716 + * lindexer = np.empty(count, dtype=np.int64) + * rindexer = np.empty(count, dtype=np.int64) + * result = np.empty(count, dtype=np.int64) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/src/generated.pyx":8718 + * result = np.empty(count, dtype=np.int64) + * + * i = 0 # <<<<<<<<<<<<<< + * j = 0 + * count = 0 + */ + __pyx_v_i = 0; + + /* "pandas/src/generated.pyx":8719 + * + * i = 0 + * j = 0 # <<<<<<<<<<<<<< + * count = 0 + * if nleft > 0 and nright > 0: + */ + __pyx_v_j = 0; + + /* "pandas/src/generated.pyx":8720 + * i = 0 + * j = 0 + * count = 0 # <<<<<<<<<<<<<< + * if nleft > 0 and nright > 0: + * while True: + */ + __pyx_v_count = 0; + + /* "pandas/src/generated.pyx":8721 + * j = 0 + * count = 0 + * if nleft > 0 and nright > 0: # <<<<<<<<<<<<<< + * while True: + * if i == nleft: + */ + __pyx_t_3 = ((__pyx_v_nleft > 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_nright > 0) != 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8722 + * count = 0 + * if nleft > 0 and nright > 0: + * while True: # <<<<<<<<<<<<<< + * if i == nleft: + * break + */ + while (1) { + + /* "pandas/src/generated.pyx":8723 + * if nleft > 0 and nright > 0: + * while True: + * if i == nleft: # <<<<<<<<<<<<<< + * break + * if j == nright: + */ + __pyx_t_2 = ((__pyx_v_i == __pyx_v_nleft) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8724 + * while True: + * if i == nleft: + * break # <<<<<<<<<<<<<< + * if j == nright: + * break + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8725 + * if i == nleft: + * break + * if j == nright: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((__pyx_v_j == __pyx_v_nright) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8726 + * break + * if j == nright: + * break # <<<<<<<<<<<<<< + * + * lval = left[i] + */ + goto __pyx_L15_break; + } + + /* "pandas/src/generated.pyx":8728 + * break + * + * lval = left[i] # <<<<<<<<<<<<<< + * rval = right[j] + * if lval == rval: + */ + __pyx_t_20 = __pyx_v_i; + __pyx_v_lval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_left.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8729 + * + * lval = left[i] + * rval = right[j] # <<<<<<<<<<<<<< + * if lval == rval: + * lindexer[count] = i + */ + __pyx_t_21 = __pyx_v_j; + __pyx_v_rval = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_right.diminfo[0].strides)); + + /* "pandas/src/generated.pyx":8730 + * lval = left[i] + * rval = right[j] + * if lval == rval: # <<<<<<<<<<<<<< + * lindexer[count] = i + * rindexer[count] = j + */ + __pyx_t_2 = ((__pyx_v_lval == __pyx_v_rval) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8731 + * rval = right[j] + * if lval == rval: + * lindexer[count] = i # <<<<<<<<<<<<<< + * rindexer[count] = j + * result[count] = rval + */ + __pyx_t_22 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_lindexer.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lindexer.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/src/generated.pyx":8732 + * if lval == rval: + * lindexer[count] = i + * rindexer[count] = j # <<<<<<<<<<<<<< + * result[count] = rval + * count += 1 + */ + __pyx_t_23 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rindexer.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_rindexer.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/src/generated.pyx":8733 + * lindexer[count] = i + * rindexer[count] = j + * result[count] = rval # <<<<<<<<<<<<<< + * count += 1 + * if i < nleft - 1: + */ + __pyx_t_24 = __pyx_v_count; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_rval; + + /* "pandas/src/generated.pyx":8734 + * rindexer[count] = j + * result[count] = rval + * count += 1 # <<<<<<<<<<<<<< + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/src/generated.pyx":8735 + * result[count] = rval + * count += 1 + * if i < nleft - 1: # <<<<<<<<<<<<<< + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 + */ + __pyx_t_2 = ((__pyx_v_i < (__pyx_v_nleft - 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/generated.pyx":8736 + * count += 1 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: # <<<<<<<<<<<<<< + * j += 1 + * else: + */ + __pyx_t_2 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_2) { + __pyx_t_25 = (__pyx_v_j + 1); + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_right.diminfo[0].strides)) == __pyx_v_rval) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8737 + * if i < nleft - 1: + * if j < nright - 1 and right[j + 1] == rval: + * j += 1 # <<<<<<<<<<<<<< + * else: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8739 + * j += 1 + * else: + * i += 1 # <<<<<<<<<<<<<< + * if left[i] != rval: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "pandas/src/generated.pyx":8740 + * else: + * i += 1 + * if left[i] != rval: # <<<<<<<<<<<<<< + * j += 1 + * elif j < nright - 1: + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_left.diminfo[0].strides)) != __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8741 + * i += 1 + * if left[i] != rval: + * j += 1 # <<<<<<<<<<<<<< + * elif j < nright - 1: + * j += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L21; + } + __pyx_L21:; + } + __pyx_L20:; + goto __pyx_L19; + } + + /* "pandas/src/generated.pyx":8742 + * if left[i] != rval: + * j += 1 + * elif j < nright - 1: # <<<<<<<<<<<<<< + * j += 1 + * if lval != right[j]: + */ + __pyx_t_4 = ((__pyx_v_j < (__pyx_v_nright - 1)) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8743 + * j += 1 + * elif j < nright - 1: + * j += 1 # <<<<<<<<<<<<<< + * if lval != right[j]: + * i += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "pandas/src/generated.pyx":8744 + * elif j < nright - 1: + * j += 1 + * if lval != right[j]: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_27 = __pyx_v_j; + __pyx_t_4 = ((__pyx_v_lval != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_right.diminfo[0].strides))) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8745 + * j += 1 + * if lval != right[j]: + * i += 1 # <<<<<<<<<<<<<< + * else: + * # end of the road + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L22; + } + __pyx_L22:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8748 + * else: + * # end of the road + * break # <<<<<<<<<<<<<< + * elif lval < rval: + * i += 1 + */ + goto __pyx_L15_break; + } + __pyx_L19:; + goto __pyx_L18; + } + + /* "pandas/src/generated.pyx":8749 + * # end of the road + * break + * elif lval < rval: # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_4 = ((__pyx_v_lval < __pyx_v_rval) != 0); + if (__pyx_t_4) { + + /* "pandas/src/generated.pyx":8750 + * break + * elif lval < rval: + * i += 1 # <<<<<<<<<<<<<< + * else: + * j += 1 + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/generated.pyx":8752 + * i += 1 + * else: + * j += 1 # <<<<<<<<<<<<<< + * + * return result, lindexer, rindexer + */ + __pyx_v_j = (__pyx_v_j + 1); + } + __pyx_L18:; + } + __pyx_L15_break:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/src/generated.pyx":8754 + * j += 1 + * + * return result, lindexer, rindexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_lindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_lindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_lindexer)); + __Pyx_INCREF(((PyObject *)__pyx_v_rindexer)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_rindexer)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_rindexer)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/src/generated.pyx":8665 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.algos.inner_join_indexer_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lindexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rindexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_lindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_rindexer); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__219, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_result; + char *__pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_to_dts", 0); + __Pyx_INCREF(__pyx_v_val); + + /* "datetime.pxd":130 + * cdef char *tmp + * + * if PyUnicode_Check(val): # <<<<<<<<<<<<<< + * val = PyUnicode_AsASCIIString(val); + * + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":131 + * + * if PyUnicode_Check(val): + * val = PyUnicode_AsASCIIString(val); # <<<<<<<<<<<<<< + * + * tmp = val + */ + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "datetime.pxd":133 + * val = PyUnicode_AsASCIIString(val); + * + * tmp = val # <<<<<<<<<<<<<< + * result = _cstring_to_dts(tmp, len(val), dts) + * + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmp = __pyx_t_3; + + /* "datetime.pxd":134 + * + * tmp = val + * result = _cstring_to_dts(tmp, len(val), dts) # <<<<<<<<<<<<<< + * + * if result == -1: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts); + + /* "datetime.pxd":136 + * result = _cstring_to_dts(tmp, len(val), dts) + * + * if result == -1: # <<<<<<<<<<<<<< + * raise ValueError('Unable to parse %s' % str(val)) + * + */ + __pyx_t_1 = ((__pyx_v_result == -1) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":137 + * + * if result == -1: + * raise ValueError('Unable to parse %s' % str(val)) # <<<<<<<<<<<<<< + * + * cdef inline int _cstring_to_dts(char *val, int length, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("datetime._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts) { + npy_bool __pyx_v_islocal; + npy_bool __pyx_v_special; + PANDAS_DATETIMEUNIT __pyx_v_out_bestunit; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cstring_to_dts", 0); + + /* "datetime.pxd":146 + * int result + * + * result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns, # <<<<<<<<<<<<<< + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + */ + __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special)); + + /* "datetime.pxd":149 + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime64_to_datetime", 0); + + /* "datetime.pxd":154 + * cdef inline object _datetime64_to_datetime(int64_t val): + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * return _dts_to_pydatetime(&dts) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "datetime.pxd":155 + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * return _dts_to_pydatetime(&dts) # <<<<<<<<<<<<<< + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dts_to_pydatetime", 0); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_XDECREF(__pyx_r); + + /* "datetime.pxd":160 + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + */ + __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0); + + /* "datetime.pxd":163 + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":164 + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":165 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":166 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) # <<<<<<<<<<<<<< + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + */ + __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val); + + /* "datetime.pxd":167 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) # <<<<<<<<<<<<<< + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + */ + __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val); + + /* "datetime.pxd":168 + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) # <<<<<<<<<<<<<< + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + */ + __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val); + + /* "datetime.pxd":169 + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val); + + /* "datetime.pxd":170 + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":171 + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _dtlike_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + npy_int64 __pyx_t_2; + npy_int32 __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dtlike_to_datetime64", 0); + + /* "datetime.pxd":175 + * cdef inline int64_t _dtlike_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = val.year # <<<<<<<<<<<<<< + * dts.month = val.month + * dts.day = val.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->year = __pyx_t_2; + + /* "datetime.pxd":176 + * pandas_datetimestruct *dts): + * dts.year = val.year + * dts.month = val.month # <<<<<<<<<<<<<< + * dts.day = val.day + * dts.hour = val.hour + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->month = __pyx_t_3; + + /* "datetime.pxd":177 + * dts.year = val.year + * dts.month = val.month + * dts.day = val.day # <<<<<<<<<<<<<< + * dts.hour = val.hour + * dts.min = val.minute + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->day = __pyx_t_3; + + /* "datetime.pxd":178 + * dts.month = val.month + * dts.day = val.day + * dts.hour = val.hour # <<<<<<<<<<<<<< + * dts.min = val.minute + * dts.sec = val.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->hour = __pyx_t_3; + + /* "datetime.pxd":179 + * dts.day = val.day + * dts.hour = val.hour + * dts.min = val.minute # <<<<<<<<<<<<<< + * dts.sec = val.second + * dts.us = val.microsecond + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->min = __pyx_t_3; + + /* "datetime.pxd":180 + * dts.hour = val.hour + * dts.min = val.minute + * dts.sec = val.second # <<<<<<<<<<<<<< + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->sec = __pyx_t_3; + + /* "datetime.pxd":181 + * dts.min = val.minute + * dts.sec = val.second + * dts.us = val.microsecond # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->us = __pyx_t_3; + + /* "datetime.pxd":182 + * dts.sec = val.second + * dts.us = val.microsecond + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":183 + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _date_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_to_datetime64", 0); + + /* "datetime.pxd":187 + * cdef inline int64_t _date_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":188 + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":189 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":190 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->hour = 0; + __pyx_v_dts->min = 0; + __pyx_v_dts->sec = 0; + __pyx_v_dts->us = 0; + + /* "datetime.pxd":191 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":192 + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + + /* "View.MemoryView":117 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":123 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize + * + */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":124 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":126 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":127 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__222, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":129 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":130 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if isinstance(format, unicode): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__223, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":132 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if isinstance(format, unicode): # <<<<<<<<<<<<<< + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyUnicode_Check(__pyx_v_format); + __pyx_t_4 = (__pyx_t_2 != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":133 + * + * if isinstance(format, unicode): + * format = (format).encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + if (unlikely(__pyx_v_format == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyUnicode_AsASCIIString(((PyObject*)__pyx_v_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "View.MemoryView":134 + * if isinstance(format, unicode): + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":135 + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->format = __pyx_t_5; + + /* "View.MemoryView":138 + * + * + * self._shape = PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * + */ + __pyx_v_self->_shape = ((Py_ssize_t *)PyMem_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + + /* "View.MemoryView":139 + * + * self._shape = PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: + */ + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + + /* "View.MemoryView":141 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":142 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__224, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":145 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_6 = 0; + __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_dim = __pyx_t_8; + __pyx_v_idx = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":146 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":147 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_7 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":148 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< + * + * cdef char order + */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":151 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":152 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":153 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + goto __pyx_L10; + } + + /* "View.MemoryView":154 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":155 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":156 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + goto __pyx_L10; + } + /*else*/ { + + /* "View.MemoryView":158 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L10:; + + /* "View.MemoryView":160 + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + * + * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< + * itemsize, self.ndim, order) + * + */ + __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); + + /* "View.MemoryView":163 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":164 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":165 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":168 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":169 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":170 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":172 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":173 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":174 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":175 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":176 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":179 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":180 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":181 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":182 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + goto __pyx_L3; + } + + /* "View.MemoryView":183 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":184 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":185 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":186 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":187 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":188 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":189 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":190 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":191 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":192 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":193 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":194 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":196 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":197 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":199 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":201 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":179 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":205 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":206 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":207 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + goto __pyx_L3; + } + + /* "View.MemoryView":208 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":209 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":210 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":212 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyMem_Free(self._shape) + * + */ + free(__pyx_v_self->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":213 + * self._strides, self.ndim, False) + * free(self.data) + * PyMem_Free(self._shape) # <<<<<<<<<<<<<< + * + * property memview: + */ + PyMem_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":205 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":217 + * property memview: + * @cname('get_memview') + * def __get__(self): # <<<<<<<<<<<<<< + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + */ + +/* Python wrapper */ +static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/ +static PyObject *get_memview(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":219 + * def __get__(self): + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":220 + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":217 + * property memview: + * @cname('get_memview') + * def __get__(self): # <<<<<<<<<<<<<< + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":223 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":224 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":223 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":226 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":227 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":226 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":229 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":230 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":229 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":234 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":238 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":239 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":241 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":242 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":241 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":243 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":245 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":234 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":271 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":272 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":271 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":273 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":274 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":273 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":288 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":290 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset + * + */ + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + + /* "View.MemoryView":294 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":296 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":297 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p + */ + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":299 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview') + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":288 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":317 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":318 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":319 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":320 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type))); + if (!(__pyx_t_1 != 0)) { + __pyx_t_2 = (__pyx_v_obj != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "View.MemoryView":321 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":322 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_3 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":323 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + + /* "View.MemoryView":324 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * self.lock = PyThread_allocate_lock() + */ + Py_INCREF(Py_None); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":326 + * Py_INCREF(Py_None) + * + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock == NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":327 + * + * self.lock = PyThread_allocate_lock() + * if self.lock == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_3 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":328 + * self.lock = PyThread_allocate_lock() + * if self.lock == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":330 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = self.view.format == b'O' + * else: + */ + __pyx_t_3 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":331 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_3; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":333 + * self.dtype_is_object = self.view.format == b'O' + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L6:; + + /* "View.MemoryView":335 + * self.dtype_is_object = dtype_is_object + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":337 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(memoryview self): + */ + __pyx_v_self->typeinfo = NULL; + + /* "View.MemoryView":317 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":339 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":340 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":341 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * + * if self.lock != NULL: + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":343 + * __Pyx_ReleaseBuffer(&self.view) + * + * if self.lock != NULL: # <<<<<<<<<<<<<< + * PyThread_free_lock(self.lock) + * + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":344 + * + * if self.lock != NULL: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":339 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":346 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":348 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * + * for dim, idx in enumerate(index): + */ + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + + /* "View.MemoryView":350 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_v_index) || PyTuple_CheckExact(__pyx_v_index)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":351 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":353 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":346 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":356 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":357 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":358 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + } + + /* "View.MemoryView":360 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":363 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + + /* "View.MemoryView":364 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":366 + * return memview_slice(self, indices) + * else: + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) + * + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":367 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":356 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":369 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":370 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":372 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":373 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":374 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":375 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":377 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":379 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":369 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":381 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":382 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type)); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":384 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":385 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":384 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":386 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":387 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":389 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":381 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":391 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":395 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":396 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":397 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":395 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":391 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":399 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[128]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + char const *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":401 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":406 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): + */ + __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + + /* "View.MemoryView":408 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":409 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":410 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":411 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":412 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":414 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":416 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":417 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":418 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + goto __pyx_L8; + } + /*else*/ { + + /* "View.MemoryView":420 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":424 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":425 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":426 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":429 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":399 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":431 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":432 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":433 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":431 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":435 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":438 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":441 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":442 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":443 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + } + /*else:*/ { + + /* "View.MemoryView":447 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + __pyx_t_7 = strlen(__pyx_v_self->view.format); + __pyx_t_8 = ((__pyx_t_7 == 1) != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":448 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L6_except_return; + } + + /* "View.MemoryView":449 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "View.MemoryView":444 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":445 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__227, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L10_try_end:; + } + + /* "View.MemoryView":435 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":451 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + char *__pyx_t_10; + char *__pyx_t_11; + char *__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":454 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":459 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":460 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":462 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":464 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_7 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_8 = __pyx_v_bytesvalue; + __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8); + __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8)); + for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) { + __pyx_t_9 = __pyx_t_12; + __pyx_v_c = (__pyx_t_9[0]); + + /* "View.MemoryView":465 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_7; + + /* "View.MemoryView":464 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_7 = (__pyx_t_7 + 1); + + /* "View.MemoryView":465 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "View.MemoryView":451 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":468 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":469 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":470 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":472 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":474 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":475 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":477 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":479 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":480 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":482 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":484 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":485 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":487 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":489 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":490 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":491 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":492 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":493 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":494 + * info.len = self.view.len + * info.readonly = 0 + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":468 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":501 + * property T: + * @cname('__pyx_memoryview_transpose') + * def __get__(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":502 + * @cname('__pyx_memoryview_transpose') + * def __get__(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":503 + * def __get__(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":504 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * property base: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":501 + * property T: + * @cname('__pyx_memoryview_transpose') + * def __get__(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":508 + * property base: + * @cname('__pyx_memoryview__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":509 + * @cname('__pyx_memoryview__get__base') + * def __get__(self): + * return self.obj # <<<<<<<<<<<<<< + * + * property shape: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":508 + * property base: + * @cname('__pyx_memoryview__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":513 + * property shape: + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): # <<<<<<<<<<<<<< + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":514 + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property strides: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_self->view.ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "View.MemoryView":513 + * property shape: + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): # <<<<<<<<<<<<<< + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":518 + * property strides: + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":519 + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":521 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__228, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":523 + * raise ValueError("Buffer view does not expose strides") + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property suboffsets: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_self->view.ndim; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":518 + * property strides: + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":527 + * property suboffsets: + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":528 + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return [-1] * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":529 + * def __get__(self): + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_neg_1); + PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + } + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":531 + * return [-1] * self.view.ndim + * + * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property ndim: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_self->view.ndim; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":527 + * property suboffsets: + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":535 + * property ndim: + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":536 + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * property itemsize: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":535 + * property ndim: + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":540 + * property itemsize: + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":541 + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * property nbytes: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":540 + * property itemsize: + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":545 + * property nbytes: + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":546 + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * property size: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":545 + * property nbytes: + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":550 + * property size: + * @cname('__pyx_memoryview_get_size') + * def __get__(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":551 + * @cname('__pyx_memoryview_get_size') + * def __get__(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":552 + * def __get__(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.shape: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":554 + * result = 1 + * + * for length in self.shape: # <<<<<<<<<<<<<< + * result *= length + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":555 + * + * for length in self.shape: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":557 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":559 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":550 + * property size: + * @cname('__pyx_memoryview_get_size') + * def __get__(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":561 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":562 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< + * + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + } + + /* "View.MemoryView":565 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":567 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":568 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":569 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":568 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":567 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":571 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":572 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":571 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":575 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":578 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":579 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<< + * + * def is_f_contig(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":575 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":581 + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":584 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":585 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":581 + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":587 + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":589 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &mslice) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + + /* "View.MemoryView":591 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":592 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":597 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":587 + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":599 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":601 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &src) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + + /* "View.MemoryView":603 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":604 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":609 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":599 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":613 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":614 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":615 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":616 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":613 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":619 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":620 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":619 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":622 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":627 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":628 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":630 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":632 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":633 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":634 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":635 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_tup) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":636 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":637 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":638 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__229, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_9, __pyx_temp, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "View.MemoryView":639 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":641 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__230, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_L7:; + + /* "View.MemoryView":642 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":644 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + __pyx_t_1 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_1 = ((!(__Pyx_PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_11 = __pyx_t_1; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + + /* "View.MemoryView":645 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":647 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + if (!__pyx_v_have_slices) { + __pyx_t_11 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_v_have_slices; + } + __pyx_v_have_slices = __pyx_t_2; + + /* "View.MemoryView":648 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":650 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":651 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_2 = (__pyx_v_nslices != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":652 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__231, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":654 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_2) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_9 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_9 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":622 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":656 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(ndim): + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":658 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * cdef int i + * for i in range(ndim): # <<<<<<<<<<<<<< + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":659 + * cdef int i + * for i in range(ndim): + * if suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":660 + * for i in range(ndim): + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + + /* "View.MemoryView":656 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(ndim): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":667 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":668 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":675 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":679 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "View.MemoryView":681 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":682 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":683 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":685 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":686 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":692 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data + * + */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; + + /* "View.MemoryView":693 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; + + /* "View.MemoryView":698 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":699 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":703 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (PyList_CheckExact(__pyx_v_indices) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":704 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (__Pyx_PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":708 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":705 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + + /* "View.MemoryView":711 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":712 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":713 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":714 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1; + + /* "View.MemoryView":715 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":717 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_12 = __pyx_int_0; + } else { + __pyx_t_12 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":718 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_9 = __pyx_int_0; + } else { + __pyx_t_9 = __pyx_t_12; + __pyx_t_12 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":719 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_12 = __pyx_int_0; + } else { + __pyx_t_12 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":721 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":722 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":723 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":725 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":731 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":733 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":734 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":735 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "View.MemoryView":736 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "View.MemoryView":734 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":739 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":740 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":739 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":667 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":764 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":784 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":786 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":787 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":788 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":789 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":792 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + __pyx_t_2 = (__pyx_v_have_step != 0); + if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_step < 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_v_negative_step = __pyx_t_4; + + /* "View.MemoryView":794 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + if ((__pyx_v_have_step != 0)) { + __pyx_t_4 = (__pyx_v_step == 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = (__pyx_v_have_step != 0); + } + if (__pyx_t_2) { + + /* "View.MemoryView":795 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + + /* "View.MemoryView":798 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":799 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":800 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":801 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":802 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "View.MemoryView":803 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":804 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":805 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + goto __pyx_L10; + } + /*else*/ { + + /* "View.MemoryView":807 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_start = __pyx_v_shape; + } + __pyx_L10:; + goto __pyx_L8; + } + __pyx_L8:; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":809 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":810 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + goto __pyx_L11; + } + /*else*/ { + + /* "View.MemoryView":812 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + __pyx_v_start = 0; + } + __pyx_L11:; + } + __pyx_L7:; + + /* "View.MemoryView":814 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":815 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":816 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":817 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":818 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + + /* "View.MemoryView":819 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":820 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + /*else*/ { + + /* "View.MemoryView":822 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":823 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1; + goto __pyx_L15; + } + /*else*/ { + + /* "View.MemoryView":825 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L15:; + } + __pyx_L12:; + + /* "View.MemoryView":827 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + goto __pyx_L16; + } + __pyx_L16:; + + /* "View.MemoryView":832 + * + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + * + * if (stop - start) - step * new_shape: + */ + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + + /* "View.MemoryView":834 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":835 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "View.MemoryView":837 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + goto __pyx_L18; + } + __pyx_L18:; + + /* "View.MemoryView":841 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":842 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":843 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; + + /* "View.MemoryView":846 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":847 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + goto __pyx_L19; + } + /*else*/ { + + /* "View.MemoryView":849 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L19:; + + /* "View.MemoryView":851 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":854 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + goto __pyx_L22; + } + /*else*/ { + + /* "View.MemoryView":856 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L22:; + goto __pyx_L21; + } + /*else*/ { + + /* "View.MemoryView":859 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L21:; + goto __pyx_L20; + } + __pyx_L20:; + + /* "View.MemoryView":861 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":764 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":867 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":869 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1; + + /* "View.MemoryView":870 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":873 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":874 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":875 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":877 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":878 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":879 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":880 + * stride = view.strides[dim] + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + * + * if index < 0: + */ + __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + goto __pyx_L4; + } + __pyx_L4:; + } + __pyx_L3:; + + /* "View.MemoryView":882 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":883 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":884 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":885 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "View.MemoryView":887 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":888 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":890 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":891 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":892 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + * + * return resultp + */ + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + goto __pyx_L8; + } + __pyx_L8:; + + /* "View.MemoryView":894 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":867 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":900 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":901 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":903 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * + */ + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; + + /* "View.MemoryView":904 + * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; + + /* "View.MemoryView":908 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":909 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":910 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":911 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":913 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_6 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_6) { + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "View.MemoryView":914 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "View.MemoryView":916 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":900 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":933 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":934 + * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + + /* "View.MemoryView":933 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":936 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":937 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":938 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":940 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_vtabptr_memoryview->convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":936 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":942 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":943 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":944 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":946 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * property base: + */ + __pyx_t_3 = __pyx_vtabptr_memoryview->assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":942 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":950 + * property base: + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":951 + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":950 + * property base: + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":957 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":966 + * cdef int i + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":967 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "View.MemoryView":972 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":974 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; + + /* "View.MemoryView":975 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":977 + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< + * result.typeinfo = memviewslice.memview.typeinfo + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":978 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":980 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":981 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":982 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":983 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":984 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":986 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":988 + * result.flags = PyBUF_RECORDS + * + * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< + * result.view.strides = result.from_slice.strides + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + + /* "View.MemoryView":989 + * + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * + */ + __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + + /* "View.MemoryView":990 + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":992 + * result.view.suboffsets = result.from_slice.suboffsets + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for i in range(ndim): + * result.view.len *= result.view.shape[i] + */ + __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_6; + + /* "View.MemoryView":993 + * + * result.view.len = result.view.itemsize + * for i in range(ndim): # <<<<<<<<<<<<<< + * result.view.len *= result.view.shape[i] + * + */ + __pyx_t_7 = __pyx_v_ndim; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":994 + * result.view.len = result.view.itemsize + * for i in range(ndim): + * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<< + * + * result.to_object_func = to_object_func + */ + __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i])); + } + + /* "View.MemoryView":996 + * result.view.len *= result.view.shape[i] + * + * result.to_object_func = to_object_func # <<<<<<<<<<<<<< + * result.to_dtype_func = to_dtype_func + * + */ + __pyx_v_result->to_object_func = __pyx_v_to_object_func; + + /* "View.MemoryView":997 + * + * result.to_object_func = to_object_func + * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; + + /* "View.MemoryView":999 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":957 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1002 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1005 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1006 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1007 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1009 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1010 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1002 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1013 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1017 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1018 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1019 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1021 + * suboffsets = memview.view.suboffsets + * + * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< + * dst.data = memview.view.buf + * + */ + __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + + /* "View.MemoryView":1022 + * + * dst.memview = <__pyx_memoryview *> memview + * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * + * for dim in range(memview.view.ndim): + */ + __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + + /* "View.MemoryView":1024 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1025 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1026 + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< + * if suboffsets == NULL: + * dst.suboffsets[dim] = -1 + */ + (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + + /* "View.MemoryView":1027 + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: # <<<<<<<<<<<<<< + * dst.suboffsets[dim] = -1 + * else: + */ + __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1028 + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: + * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[dim] = suboffsets[dim] + */ + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":1030 + * dst.suboffsets[dim] = -1 + * else: + * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object') + */ + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]); + } + __pyx_L5:; + } + + /* "View.MemoryView":1013 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1033 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1036 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1037 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1033 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1040 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1047 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1048 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1049 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1051 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1052 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1054 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1056 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1040 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1062 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1063 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1064 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1066 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1062 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1069 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1074 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1075 + * cdef int i + * cdef Py_ssize_t c_stride = 0 + * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_f_stride = 0; + + /* "View.MemoryView":1077 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1078 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1079 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1080 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1082 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1083 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1084 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1085 + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + */ + goto __pyx_L7_break; + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1087 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1088 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1090 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1069 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1093 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1100 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1101 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1102 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1103 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1105 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1106 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_1 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1107 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_3 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_3) { + __pyx_t_3 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_4 = (__pyx_t_3 != 0); + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (__pyx_t_2) { + + /* "View.MemoryView":1108 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":1110 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + __pyx_t_5 = __pyx_v_dst_extent; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1111 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1112 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1113 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1115 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + __pyx_t_5 = __pyx_v_dst_extent; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1116 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1120 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1121 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1093 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1123 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1126 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1123 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1130 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1133 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1135 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1136 + * + * for i in range(ndim): + * size *= src.shape[i] # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); + } + + /* "View.MemoryView":1138 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1130 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1141 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1150 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1151 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1152 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1153 + * for idx in range(ndim): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1155 + * stride = stride * shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1156 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1157 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1159 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1141 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1162 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1173 + * cdef void *result + * + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef size_t size = slice_get_size(src, ndim) + * + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1174 + * + * cdef size_t itemsize = src.memview.view.itemsize + * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + * + * result = malloc(size) + */ + __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + + /* "View.MemoryView":1176 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1177 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1178 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1181 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1182 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1183 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1184 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1185 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1; + } + + /* "View.MemoryView":1187 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1191 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1192 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1193 + * for i in range(ndim): + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + * + * if slice_is_contig(src, order, ndim): + */ + (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "View.MemoryView":1195 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1196 + * + * if slice_is_contig(src, order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + goto __pyx_L9; + } + /*else*/ { + + /* "View.MemoryView":1198 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1200 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1162 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1205 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1208 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1207 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1205 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1211 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1212 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyUnicode_Format(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1211 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1215 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1216 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1217 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "View.MemoryView":1219 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":1215 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1222 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1230 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1231 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1233 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1234 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1235 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1238 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1239 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + goto __pyx_L3; + } + + /* "View.MemoryView":1240 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1241 + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + * + * cdef int ndim = max(src_ndim, dst_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1243 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1245 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1246 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1247 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1248 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1249 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":1251 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L7:; + goto __pyx_L6; + } + __pyx_L6:; + + /* "View.MemoryView":1253 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1254 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "View.MemoryView":1256 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(&src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1258 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1259 + * + * if not slice_is_contig(&src, order, ndim): + * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + goto __pyx_L10; + } + __pyx_L10:; + + /* "View.MemoryView":1261 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1262 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":1264 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1267 + * + * + * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1268 + * + * if slice_is_contig(&src, 'C', ndim): + * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(&src, 'F', ndim): + * direct_copy = slice_is_contig(&dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim); + goto __pyx_L12; + } + + /* "View.MemoryView":1269 + * if slice_is_contig(&src, 'C', ndim): + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(&dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1270 + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): + * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim); + goto __pyx_L12; + } + __pyx_L12:; + + /* "View.MemoryView":1272 + * direct_copy = slice_is_contig(&dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1274 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1275 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1276 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1277 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1278 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "View.MemoryView":1280 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1283 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1284 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L14; + } + __pyx_L14:; + + /* "View.MemoryView":1286 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1287 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1288 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1290 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1291 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1222 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1294 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + + /* "View.MemoryView":1298 + * int ndim_other) nogil: + * cdef int i + * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + + /* "View.MemoryView":1300 + * cdef int offset = ndim_other - ndim + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1301 + * + * for i in range(ndim - 1, -1, -1): + * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<< + * slice.strides[i + offset] = slice.strides[i] + * slice.suboffsets[i + offset] = slice.suboffsets[i] + */ + (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]); + + /* "View.MemoryView":1302 + * for i in range(ndim - 1, -1, -1): + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<< + * slice.suboffsets[i + offset] = slice.suboffsets[i] + * + */ + (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]); + + /* "View.MemoryView":1303 + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] + * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1305 + * slice.suboffsets[i + offset] = slice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1306 + * + * for i in range(offset): + * slice.shape[i] = 1 # <<<<<<<<<<<<<< + * slice.strides[i] = slice.strides[0] + * slice.suboffsets[i] = -1 + */ + (__pyx_v_slice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1307 + * for i in range(offset): + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<< + * slice.suboffsets[i] = -1 + * + */ + (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]); + + /* "View.MemoryView":1308 + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] + * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1; + } + + /* "View.MemoryView":1294 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1316 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { + int __pyx_t_1; + + /* "View.MemoryView":1320 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1321 + * + * if dtype_is_object: + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< + * dst.strides, ndim, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1316 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + + /* function exit code */ +} + +/* "View.MemoryView":1325 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1328 + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1325 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1331 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1335 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1337 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1338 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":1340 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":1342 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1345 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1331 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1351 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1354 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1355 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1357 + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1351 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1365 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1366 + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] + * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_extent = (__pyx_v_shape[0]); + + /* "View.MemoryView":1368 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1369 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1370 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1371 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1373 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1374 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1376 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +static PyObject *__pyx_tp_new_6pandas_5algos_Node(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_5algos_Node *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5algos_Node *)o); + p->next = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->width = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5algos_Node(PyObject *o) { + struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_Node *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->next); + Py_CLEAR(p->width); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_5algos_Node(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_Node *)o; + if (p->next) { + e = (*v)(p->next, a); if (e) return e; + } + if (p->width) { + e = (*v)(p->width, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5algos_Node(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5algos_Node *p = (struct __pyx_obj_6pandas_5algos_Node *)o; + tmp = ((PyObject*)p->next); + p->next = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->width); + p->width = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_5algos_4Node_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5algos_4Node_5value_1__get__(o); +} + +static int __pyx_setprop_6pandas_5algos_4Node_value(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_5algos_4Node_5value_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_5algos_4Node_next(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5algos_4Node_4next_1__get__(o); +} + +static int __pyx_setprop_6pandas_5algos_4Node_next(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_5algos_4Node_4next_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_5algos_4Node_4next_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_5algos_4Node_width(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5algos_4Node_5width_1__get__(o); +} + +static int __pyx_setprop_6pandas_5algos_4Node_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_5algos_4Node_5width_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_5algos_4Node_5width_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_5algos_Node[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_5algos_Node[] = { + {(char *)"value", __pyx_getprop_6pandas_5algos_4Node_value, __pyx_setprop_6pandas_5algos_4Node_value, 0, 0}, + {(char *)"next", __pyx_getprop_6pandas_5algos_4Node_next, __pyx_setprop_6pandas_5algos_4Node_next, 0, 0}, + {(char *)"width", __pyx_getprop_6pandas_5algos_4Node_width, __pyx_setprop_6pandas_5algos_4Node_width, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5algos_Node = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.Node"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5algos_Node), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5algos_Node, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5algos_Node, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5algos_Node, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5algos_Node, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_5algos_Node, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_5algos_4Node_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5algos_Node, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5algos_IndexableSkiplist __pyx_vtable_6pandas_5algos_IndexableSkiplist; + +static PyObject *__pyx_tp_new_6pandas_5algos_IndexableSkiplist(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_5algos_IndexableSkiplist; + p->head = ((struct __pyx_obj_6pandas_5algos_Node *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5algos_IndexableSkiplist(PyObject *o) { + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->head); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_5algos_IndexableSkiplist(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o; + if (p->head) { + e = (*v)(((PyObject*)p->head), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5algos_IndexableSkiplist(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5algos_IndexableSkiplist *p = (struct __pyx_obj_6pandas_5algos_IndexableSkiplist *)o; + tmp = ((PyObject*)p->head); + p->head = ((struct __pyx_obj_6pandas_5algos_Node *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +static PyObject *__pyx_sq_item_6pandas_5algos_IndexableSkiplist(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static PyMethodDef __pyx_methods_6pandas_5algos_IndexableSkiplist[] = { + {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_7get, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_9insert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("remove"), (PyCFunction)__pyx_pw_6pandas_5algos_17IndexableSkiplist_11remove, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_IndexableSkiplist = { + __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_6pandas_5algos_IndexableSkiplist, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_IndexableSkiplist = { + __pyx_pw_6pandas_5algos_17IndexableSkiplist_3__len__, /*mp_length*/ + __pyx_pw_6pandas_5algos_17IndexableSkiplist_5__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_5algos_IndexableSkiplist = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.IndexableSkiplist"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5algos_IndexableSkiplist), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5algos_IndexableSkiplist, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_IndexableSkiplist, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_IndexableSkiplist, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Sorted collection supporting O(lg n) insertion, removal, and\n lookup by rank.\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_5algos_IndexableSkiplist, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5algos_IndexableSkiplist, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5algos_IndexableSkiplist, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_5algos_17IndexableSkiplist_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5algos_IndexableSkiplist, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_array___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return get_memview(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_array_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.array"), /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.Enum"), /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryview___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_transpose(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview__get__base(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_shape(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_strides(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_suboffsets(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_ndim(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_itemsize(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_nbytes(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_size(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos.memoryview"), /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryviewslice___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryviewslice__get__base(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.algos._memoryviewslice"), /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Internal class for passing memoryview slices to Python"), /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("ensure_platform_int"), (PyCFunction)__pyx_pw_6pandas_5algos_87ensure_platform_int, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_89ensure_float64, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_91ensure_float32, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_int8"), (PyCFunction)__pyx_pw_6pandas_5algos_93ensure_int8, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_int16"), (PyCFunction)__pyx_pw_6pandas_5algos_95ensure_int16, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_97ensure_int32, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_99ensure_int64, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ensure_object"), (PyCFunction)__pyx_pw_6pandas_5algos_101ensure_object, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_indices_float64"), (PyCFunction)__pyx_pw_6pandas_5algos_103map_indices_float64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_102map_indices_float64)}, + {__Pyx_NAMESTR("map_indices_float32"), (PyCFunction)__pyx_pw_6pandas_5algos_105map_indices_float32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_104map_indices_float32)}, + {__Pyx_NAMESTR("map_indices_object"), (PyCFunction)__pyx_pw_6pandas_5algos_107map_indices_object, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_106map_indices_object)}, + {__Pyx_NAMESTR("map_indices_int32"), (PyCFunction)__pyx_pw_6pandas_5algos_109map_indices_int32, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_108map_indices_int32)}, + {__Pyx_NAMESTR("map_indices_int64"), (PyCFunction)__pyx_pw_6pandas_5algos_111map_indices_int64, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_110map_indices_int64)}, + {__Pyx_NAMESTR("map_indices_bool"), (PyCFunction)__pyx_pw_6pandas_5algos_113map_indices_bool, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5algos_112map_indices_bool)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("algos"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_at_least_d_arguments, __pyx_k_Expected_at_least_d_arguments, sizeof(__pyx_k_Expected_at_least_d_arguments), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_n_s_Infinity, __pyx_k_Infinity, sizeof(__pyx_k_Infinity), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_min_periods_size_d_great, __pyx_k_Invalid_min_periods_size_d_great, sizeof(__pyx_k_Invalid_min_periods_size_d_great), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_window_size_d, __pyx_k_Invalid_window_size_d, sizeof(__pyx_k_Invalid_window_size_d), 0, 0, 1, 0}, + {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_kp_s_Limit_must_be_non_negative, __pyx_k_Limit_must_be_non_negative, sizeof(__pyx_k_Limit_must_be_non_negative), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 1, 1}, + {&__pyx_n_s_NIL, __pyx_k_NIL, sizeof(__pyx_k_NIL), 0, 0, 1, 1}, + {&__pyx_n_s_NINF, __pyx_k_NINF, sizeof(__pyx_k_NINF), 0, 0, 1, 1}, + {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1}, + {&__pyx_n_s_NegInfinity, __pyx_k_NegInfinity, sizeof(__pyx_k_NegInfinity), 0, 0, 1, 1}, + {&__pyx_kp_s_No_matching_signature_found, __pyx_k_No_matching_signature_found, sizeof(__pyx_k_No_matching_signature_found), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_kp_s_Not_Found, __pyx_k_Not_Found, sizeof(__pyx_k_Not_Found), 0, 0, 1, 0}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_kp_s_Output_array_must_have_4_columns, __pyx_k_Output_array_must_have_4_columns, sizeof(__pyx_k_Output_array_must_have_4_columns), 0, 0, 1, 0}, + {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 0}, + {&__pyx_kp_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_adj, __pyx_k_adj, sizeof(__pyx_k_adj), 0, 0, 1, 1}, + {&__pyx_n_s_adjust, __pyx_k_adjust, sizeof(__pyx_k_adjust), 0, 0, 1, 1}, + {&__pyx_n_s_ai, __pyx_k_ai, sizeof(__pyx_k_ai), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_aold, __pyx_k_aold, sizeof(__pyx_k_aold), 0, 0, 1, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, + {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, + {&__pyx_n_s_argsorted, __pyx_k_argsorted, sizeof(__pyx_k_argsorted), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_bool, __pyx_k_arrmap_bool, sizeof(__pyx_k_arrmap_bool), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_float32, __pyx_k_arrmap_float32, sizeof(__pyx_k_arrmap_float32), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_float64, __pyx_k_arrmap_float64, sizeof(__pyx_k_arrmap_float64), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_int32, __pyx_k_arrmap_int32, sizeof(__pyx_k_arrmap_int32), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_int64, __pyx_k_arrmap_int64, sizeof(__pyx_k_arrmap_int64), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap_object, __pyx_k_arrmap_object, sizeof(__pyx_k_arrmap_object), 0, 0, 1, 1}, + {&__pyx_n_s_as, __pyx_k_as, sizeof(__pyx_k_as), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, + {&__pyx_n_s_ascending, __pyx_k_ascending, sizeof(__pyx_k_ascending), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_average, __pyx_k_average, sizeof(__pyx_k_average), 0, 0, 1, 1}, + {&__pyx_n_s_avg, __pyx_k_avg, sizeof(__pyx_k_avg), 0, 0, 1, 1}, + {&__pyx_n_s_avg_wgt, __pyx_k_avg_wgt, sizeof(__pyx_k_avg_wgt), 0, 0, 1, 1}, + {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_bool, __pyx_k_backfill_2d_inplace_bool, sizeof(__pyx_k_backfill_2d_inplace_bool), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_float32, __pyx_k_backfill_2d_inplace_float32, sizeof(__pyx_k_backfill_2d_inplace_float32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_float64, __pyx_k_backfill_2d_inplace_float64, sizeof(__pyx_k_backfill_2d_inplace_float64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_int32, __pyx_k_backfill_2d_inplace_int32, sizeof(__pyx_k_backfill_2d_inplace_int32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_int64, __pyx_k_backfill_2d_inplace_int64, sizeof(__pyx_k_backfill_2d_inplace_int64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_2d_inplace_object, __pyx_k_backfill_2d_inplace_object, sizeof(__pyx_k_backfill_2d_inplace_object), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_bool, __pyx_k_backfill_bool, sizeof(__pyx_k_backfill_bool), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_float32, __pyx_k_backfill_float32, sizeof(__pyx_k_backfill_float32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_float64, __pyx_k_backfill_float64, sizeof(__pyx_k_backfill_float64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_bool, __pyx_k_backfill_inplace_bool, sizeof(__pyx_k_backfill_inplace_bool), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_float32, __pyx_k_backfill_inplace_float32, sizeof(__pyx_k_backfill_inplace_float32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_float64, __pyx_k_backfill_inplace_float64, sizeof(__pyx_k_backfill_inplace_float64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_int32, __pyx_k_backfill_inplace_int32, sizeof(__pyx_k_backfill_inplace_int32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_int64, __pyx_k_backfill_inplace_int64, sizeof(__pyx_k_backfill_inplace_int64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_inplace_object, __pyx_k_backfill_inplace_object, sizeof(__pyx_k_backfill_inplace_object), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_int32, __pyx_k_backfill_int32, sizeof(__pyx_k_backfill_int32), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_int64, __pyx_k_backfill_int64, sizeof(__pyx_k_backfill_int64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_object, __pyx_k_backfill_object, sizeof(__pyx_k_backfill_object), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_bins, __pyx_k_bins, sizeof(__pyx_k_bins), 0, 0, 1, 1}, + {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, + {&__pyx_n_s_bufarr, __pyx_k_bufarr, sizeof(__pyx_k_bufarr), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_c_contiguous, __pyx_k_c_contiguous, sizeof(__pyx_k_c_contiguous), 0, 0, 1, 1}, + {&__pyx_n_s_check_minp, __pyx_k_check_minp, sizeof(__pyx_k_check_minp), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cmp, __pyx_k_cmp, sizeof(__pyx_k_cmp), 0, 0, 1, 1}, + {&__pyx_n_s_com, __pyx_k_com, sizeof(__pyx_k_com), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1}, + {&__pyx_n_s_counts_2, __pyx_k_counts_2, sizeof(__pyx_k_counts_2), 0, 0, 1, 1}, + {&__pyx_n_s_cov, __pyx_k_cov, sizeof(__pyx_k_cov), 0, 0, 1, 1}, + {&__pyx_n_s_ct, __pyx_k_ct, sizeof(__pyx_k_ct), 0, 0, 1, 1}, + {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_ddof, __pyx_k_ddof, sizeof(__pyx_k_ddof), 0, 0, 1, 1}, + {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1}, + {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1}, + {&__pyx_n_s_dense, __pyx_k_dense, sizeof(__pyx_k_dense), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_float32, __pyx_k_diff_2d_float32, sizeof(__pyx_k_diff_2d_float32), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_float64, __pyx_k_diff_2d_float64, sizeof(__pyx_k_diff_2d_float64), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_int16, __pyx_k_diff_2d_int16, sizeof(__pyx_k_diff_2d_int16), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_int32, __pyx_k_diff_2d_int32, sizeof(__pyx_k_diff_2d_int32), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_int64, __pyx_k_diff_2d_int64, sizeof(__pyx_k_diff_2d_int64), 0, 0, 1, 1}, + {&__pyx_n_s_diff_2d_int8, __pyx_k_diff_2d_int8, sizeof(__pyx_k_diff_2d_int8), 0, 0, 1, 1}, + {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1}, + {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, + {&__pyx_n_s_divisor, __pyx_k_divisor, sizeof(__pyx_k_divisor), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_dups, __pyx_k_dups, sizeof(__pyx_k_dups), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_empty_like, __pyx_k_empty_like, sizeof(__pyx_k_empty_like), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_ewma, __pyx_k_ewma, sizeof(__pyx_k_ewma), 0, 0, 1, 1}, + {&__pyx_n_s_expected_size, __pyx_k_expected_size, sizeof(__pyx_k_expected_size), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 1}, + {&__pyx_n_s_f_contiguous, __pyx_k_f_contiguous, sizeof(__pyx_k_f_contiguous), 0, 0, 1, 1}, + {&__pyx_n_s_ffill_by_group, __pyx_k_ffill_by_group, sizeof(__pyx_k_ffill_by_group), 0, 0, 1, 1}, + {&__pyx_n_s_ffill_indexer, __pyx_k_ffill_indexer, sizeof(__pyx_k_ffill_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, + {&__pyx_n_s_fill_count, __pyx_k_fill_count, sizeof(__pyx_k_fill_count), 0, 0, 1, 1}, + {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1}, + {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, + {&__pyx_kp_s_first_not_supported_for_non_nume, __pyx_k_first_not_supported_for_non_nume, sizeof(__pyx_k_first_not_supported_for_non_nume), 0, 0, 1, 0}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_float32_t, __pyx_k_float32_t, sizeof(__pyx_k_float32_t), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_float64_t, __pyx_k_float64_t, sizeof(__pyx_k_float64_t), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_full_outer_join, __pyx_k_full_outer_join, sizeof(__pyx_k_full_outer_join), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_fv, __pyx_k_fv, sizeof(__pyx_k_fv), 0, 0, 1, 1}, + {&__pyx_n_s_ge, __pyx_k_ge, sizeof(__pyx_k_ge), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_result_indexer, __pyx_k_get_result_indexer, sizeof(__pyx_k_get_result_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_gid, __pyx_k_gid, sizeof(__pyx_k_gid), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_got_first, __pyx_k_got_first, sizeof(__pyx_k_got_first), 0, 0, 1, 1}, + {&__pyx_n_s_group_add_bin_float32, __pyx_k_group_add_bin_float32, sizeof(__pyx_k_group_add_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_add_bin_float64, __pyx_k_group_add_bin_float64, sizeof(__pyx_k_group_add_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_add_float32, __pyx_k_group_add_float32, sizeof(__pyx_k_group_add_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_add_float64, __pyx_k_group_add_float64, sizeof(__pyx_k_group_add_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_bin_float32, __pyx_k_group_count_bin_float32, sizeof(__pyx_k_group_count_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_bin_float64, __pyx_k_group_count_bin_float64, sizeof(__pyx_k_group_count_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_bin_int64, __pyx_k_group_count_bin_int64, sizeof(__pyx_k_group_count_bin_int64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_bin_object, __pyx_k_group_count_bin_object, sizeof(__pyx_k_group_count_bin_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_float32, __pyx_k_group_count_float32, sizeof(__pyx_k_group_count_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_float64, __pyx_k_group_count_float64, sizeof(__pyx_k_group_count_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_int64, __pyx_k_group_count_int64, sizeof(__pyx_k_group_count_int64), 0, 0, 1, 1}, + {&__pyx_n_s_group_count_object, __pyx_k_group_count_object, sizeof(__pyx_k_group_count_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_ids, __pyx_k_group_ids, sizeof(__pyx_k_group_ids), 0, 0, 1, 1}, + {&__pyx_n_s_group_labels, __pyx_k_group_labels, sizeof(__pyx_k_group_labels), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_bin_float32, __pyx_k_group_last_bin_float32, sizeof(__pyx_k_group_last_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_bin_float64, __pyx_k_group_last_bin_float64, sizeof(__pyx_k_group_last_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_bin_object, __pyx_k_group_last_bin_object, sizeof(__pyx_k_group_last_bin_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_float32, __pyx_k_group_last_float32, sizeof(__pyx_k_group_last_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_float64, __pyx_k_group_last_float64, sizeof(__pyx_k_group_last_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_last_object, __pyx_k_group_last_object, sizeof(__pyx_k_group_last_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_max_bin_float32, __pyx_k_group_max_bin_float32, sizeof(__pyx_k_group_max_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_max_bin_float64, __pyx_k_group_max_bin_float64, sizeof(__pyx_k_group_max_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_max_float32, __pyx_k_group_max_float32, sizeof(__pyx_k_group_max_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_max_float64, __pyx_k_group_max_float64, sizeof(__pyx_k_group_max_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_mean_bin_float32, __pyx_k_group_mean_bin_float32, sizeof(__pyx_k_group_mean_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_mean_bin_float64, __pyx_k_group_mean_bin_float64, sizeof(__pyx_k_group_mean_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_mean_float32, __pyx_k_group_mean_float32, sizeof(__pyx_k_group_mean_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_mean_float64, __pyx_k_group_mean_float64, sizeof(__pyx_k_group_mean_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_median, __pyx_k_group_median, sizeof(__pyx_k_group_median), 0, 0, 1, 1}, + {&__pyx_n_s_group_min_bin_float32, __pyx_k_group_min_bin_float32, sizeof(__pyx_k_group_min_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_min_bin_float64, __pyx_k_group_min_bin_float64, sizeof(__pyx_k_group_min_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_min_float32, __pyx_k_group_min_float32, sizeof(__pyx_k_group_min_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_min_float64, __pyx_k_group_min_float64, sizeof(__pyx_k_group_min_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_bin_float32, __pyx_k_group_nth_bin_float32, sizeof(__pyx_k_group_nth_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_bin_float64, __pyx_k_group_nth_bin_float64, sizeof(__pyx_k_group_nth_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_bin_object, __pyx_k_group_nth_bin_object, sizeof(__pyx_k_group_nth_bin_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_float32, __pyx_k_group_nth_float32, sizeof(__pyx_k_group_nth_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_float64, __pyx_k_group_nth_float64, sizeof(__pyx_k_group_nth_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_nth_object, __pyx_k_group_nth_object, sizeof(__pyx_k_group_nth_object), 0, 0, 1, 1}, + {&__pyx_n_s_group_ohlc_float32, __pyx_k_group_ohlc_float32, sizeof(__pyx_k_group_ohlc_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_ohlc_float64, __pyx_k_group_ohlc_float64, sizeof(__pyx_k_group_ohlc_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_prod_bin_float32, __pyx_k_group_prod_bin_float32, sizeof(__pyx_k_group_prod_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_prod_bin_float64, __pyx_k_group_prod_bin_float64, sizeof(__pyx_k_group_prod_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_prod_float32, __pyx_k_group_prod_float32, sizeof(__pyx_k_group_prod_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_prod_float64, __pyx_k_group_prod_float64, sizeof(__pyx_k_group_prod_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_var_bin_float32, __pyx_k_group_var_bin_float32, sizeof(__pyx_k_group_var_bin_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_var_bin_float64, __pyx_k_group_var_bin_float64, sizeof(__pyx_k_group_var_bin_float64), 0, 0, 1, 1}, + {&__pyx_n_s_group_var_float32, __pyx_k_group_var_float32, sizeof(__pyx_k_group_var_float32), 0, 0, 1, 1}, + {&__pyx_n_s_group_var_float64, __pyx_k_group_var_float64, sizeof(__pyx_k_group_var_float64), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_bool, __pyx_k_groupby_bool, sizeof(__pyx_k_groupby_bool), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_float32, __pyx_k_groupby_float32, sizeof(__pyx_k_groupby_float32), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_float64, __pyx_k_groupby_float64, sizeof(__pyx_k_groupby_float64), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_indices, __pyx_k_groupby_indices, sizeof(__pyx_k_groupby_indices), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_int32, __pyx_k_groupby_int32, sizeof(__pyx_k_groupby_int32), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_int64, __pyx_k_groupby_int64, sizeof(__pyx_k_groupby_int64), 0, 0, 1, 1}, + {&__pyx_n_s_groupby_object, __pyx_k_groupby_object, sizeof(__pyx_k_groupby_object), 0, 0, 1, 1}, + {&__pyx_n_s_groupsort_indexer, __pyx_k_groupsort_indexer, sizeof(__pyx_k_groupsort_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_gt, __pyx_k_gt, sizeof(__pyx_k_gt), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i0, __pyx_k_i0, sizeof(__pyx_k_i0), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_ids, __pyx_k_ids, sizeof(__pyx_k_ids), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_idx0, __pyx_k_idx0, sizeof(__pyx_k_idx0), 0, 0, 1, 1}, + {&__pyx_n_s_idx1, __pyx_k_idx1, sizeof(__pyx_k_idx1), 0, 0, 1, 1}, + {&__pyx_n_s_iinfo, __pyx_k_iinfo, sizeof(__pyx_k_iinfo), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_in_arr, __pyx_k_in_arr, sizeof(__pyx_k_in_arr), 0, 0, 1, 1}, + {&__pyx_n_s_in_i, __pyx_k_in_i, sizeof(__pyx_k_in_i), 0, 0, 1, 1}, + {&__pyx_n_s_in_k, __pyx_k_in_k, sizeof(__pyx_k_in_k), 0, 0, 1, 1}, + {&__pyx_n_s_in_n, __pyx_k_in_n, sizeof(__pyx_k_in_n), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_indexer, __pyx_k_indexer, sizeof(__pyx_k_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_infs, __pyx_k_infs, sizeof(__pyx_k_infs), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join, __pyx_k_inner_join, sizeof(__pyx_k_inner_join), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_float32, __pyx_k_inner_join_indexer_float32, sizeof(__pyx_k_inner_join_indexer_float32), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_float64, __pyx_k_inner_join_indexer_float64, sizeof(__pyx_k_inner_join_indexer_float64), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_int32, __pyx_k_inner_join_indexer_int32, sizeof(__pyx_k_inner_join_indexer_int32), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_int64, __pyx_k_inner_join_indexer_int64, sizeof(__pyx_k_inner_join_indexer_int64), 0, 0, 1, 1}, + {&__pyx_n_s_inner_join_indexer_object, __pyx_k_inner_join_indexer_object, sizeof(__pyx_k_inner_join_indexer_object), 0, 0, 1, 1}, + {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1}, + {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1}, + {&__pyx_n_s_int16_t, __pyx_k_int16_t, sizeof(__pyx_k_int16_t), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int32_t, __pyx_k_int32_t, sizeof(__pyx_k_int32_t), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int64_t, __pyx_k_int64_t, sizeof(__pyx_k_int64_t), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_int8_t, __pyx_k_int8_t, sizeof(__pyx_k_int8_t), 0, 0, 1, 1}, + {&__pyx_n_s_is_lexsorted, __pyx_k_is_lexsorted, sizeof(__pyx_k_is_lexsorted), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_bool, __pyx_k_is_monotonic_bool, sizeof(__pyx_k_is_monotonic_bool), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_float32, __pyx_k_is_monotonic_float32, sizeof(__pyx_k_is_monotonic_float32), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_float64, __pyx_k_is_monotonic_float64, sizeof(__pyx_k_is_monotonic_float64), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_int32, __pyx_k_is_monotonic_int32, sizeof(__pyx_k_is_monotonic_int32), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_int64, __pyx_k_is_monotonic_int64, sizeof(__pyx_k_is_monotonic_int64), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_object, __pyx_k_is_monotonic_object, sizeof(__pyx_k_is_monotonic_object), 0, 0, 1, 1}, + {&__pyx_n_s_is_unique, __pyx_k_is_unique, sizeof(__pyx_k_is_unique), 0, 0, 1, 1}, + {&__pyx_n_s_isfinite, __pyx_k_isfinite, sizeof(__pyx_k_isfinite), 0, 0, 1, 1}, + {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj, __pyx_k_isnullobj, sizeof(__pyx_k_isnullobj), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj2d, __pyx_k_isnullobj2d, sizeof(__pyx_k_isnullobj2d), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_keep, __pyx_k_keep, sizeof(__pyx_k_keep), 0, 0, 1, 1}, + {&__pyx_n_s_keep_na, __pyx_k_keep_na, sizeof(__pyx_k_keep_na), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, + {&__pyx_n_s_kth_smallest, __pyx_k_kth_smallest, sizeof(__pyx_k_kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lab, __pyx_k_lab, sizeof(__pyx_k_lab), 0, 0, 1, 1}, + {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, + {&__pyx_n_s_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, + {&__pyx_n_s_last_obs, __pyx_k_last_obs, sizeof(__pyx_k_last_obs), 0, 0, 1, 1}, + {&__pyx_n_s_lc, __pyx_k_lc, sizeof(__pyx_k_lc), 0, 0, 1, 1}, + {&__pyx_n_s_le, __pyx_k_le, sizeof(__pyx_k_le), 0, 0, 1, 1}, + {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, + {&__pyx_n_s_left_count, __pyx_k_left_count, sizeof(__pyx_k_left_count), 0, 0, 1, 1}, + {&__pyx_n_s_left_indexer, __pyx_k_left_indexer, sizeof(__pyx_k_left_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_float32, __pyx_k_left_join_indexer_float32, sizeof(__pyx_k_left_join_indexer_float32), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_float64, __pyx_k_left_join_indexer_float64, sizeof(__pyx_k_left_join_indexer_float64), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_int32, __pyx_k_left_join_indexer_int32, sizeof(__pyx_k_left_join_indexer_int32), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_int64, __pyx_k_left_join_indexer_int64, sizeof(__pyx_k_left_join_indexer_int64), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_object, __pyx_k_left_join_indexer_object, sizeof(__pyx_k_left_join_indexer_object), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_float32, __pyx_k_left_join_indexer_unique_float32, sizeof(__pyx_k_left_join_indexer_unique_float32), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_float64, __pyx_k_left_join_indexer_unique_float64, sizeof(__pyx_k_left_join_indexer_unique_float64), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_int32, __pyx_k_left_join_indexer_unique_int32, sizeof(__pyx_k_left_join_indexer_unique_int32), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_int64, __pyx_k_left_join_indexer_unique_int64, sizeof(__pyx_k_left_join_indexer_unique_int64), 0, 0, 1, 1}, + {&__pyx_n_s_left_join_indexer_unique_object, __pyx_k_left_join_indexer_unique_object, sizeof(__pyx_k_left_join_indexer_unique_object), 0, 0, 1, 1}, + {&__pyx_n_s_left_outer_join, __pyx_k_left_outer_join, sizeof(__pyx_k_left_outer_join), 0, 0, 1, 1}, + {&__pyx_n_s_left_pos, __pyx_k_left_pos, sizeof(__pyx_k_left_pos), 0, 0, 1, 1}, + {&__pyx_n_s_left_sorter, __pyx_k_left_sorter, sizeof(__pyx_k_left_sorter), 0, 0, 1, 1}, + {&__pyx_kp_s_len_index_len_labels, __pyx_k_len_index_len_labels, sizeof(__pyx_k_len_index_len_labels), 0, 0, 1, 0}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1}, + {&__pyx_n_s_lim, __pyx_k_lim, sizeof(__pyx_k_lim), 0, 0, 1, 1}, + {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1}, + {&__pyx_n_s_lindexer, __pyx_k_lindexer, sizeof(__pyx_k_lindexer), 0, 0, 1, 1}, + {&__pyx_n_s_list_of_arrays, __pyx_k_list_of_arrays, sizeof(__pyx_k_list_of_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1}, + {&__pyx_n_s_lt, __pyx_k_lt, sizeof(__pyx_k_lt), 0, 0, 1, 1}, + {&__pyx_n_s_lval, __pyx_k_lval, sizeof(__pyx_k_lval), 0, 0, 1, 1}, + {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_maskedx, __pyx_k_maskedx, sizeof(__pyx_k_maskedx), 0, 0, 1, 1}, + {&__pyx_n_s_maskedy, __pyx_k_maskedy, sizeof(__pyx_k_maskedy), 0, 0, 1, 1}, + {&__pyx_n_s_mat, __pyx_k_mat, sizeof(__pyx_k_mat), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_max_group, __pyx_k_max_group, sizeof(__pyx_k_max_group), 0, 0, 1, 1}, + {&__pyx_n_s_max_groups, __pyx_k_max_groups, sizeof(__pyx_k_max_groups), 0, 0, 1, 1}, + {&__pyx_n_s_max_subseq, __pyx_k_max_subseq, sizeof(__pyx_k_max_subseq), 0, 0, 1, 1}, + {&__pyx_n_s_maxx, __pyx_k_maxx, sizeof(__pyx_k_maxx), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_objects, __pyx_k_maybe_convert_objects, sizeof(__pyx_k_maybe_convert_objects), 0, 0, 1, 1}, + {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1}, + {&__pyx_n_s_mean_x, __pyx_k_mean_x, sizeof(__pyx_k_mean_x), 0, 0, 1, 1}, + {&__pyx_n_s_meanx, __pyx_k_meanx, sizeof(__pyx_k_meanx), 0, 0, 1, 1}, + {&__pyx_n_s_meany, __pyx_k_meany, sizeof(__pyx_k_meany), 0, 0, 1, 1}, + {&__pyx_n_s_median, __pyx_k_median, sizeof(__pyx_k_median), 0, 0, 1, 1}, + {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mergesort, __pyx_k_mergesort, sizeof(__pyx_k_mergesort), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, + {&__pyx_n_s_midpoint, __pyx_k_midpoint, sizeof(__pyx_k_midpoint), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_kp_s_min_periods_d_must_be_window_d, __pyx_k_min_periods_d_must_be_window_d, sizeof(__pyx_k_min_periods_d_must_be_window_d), 0, 0, 1, 0}, + {&__pyx_kp_s_min_periods_must_be_0, __pyx_k_min_periods_must_be_0, sizeof(__pyx_k_min_periods_must_be_0), 0, 0, 1, 0}, + {&__pyx_n_s_min_subseq, __pyx_k_min_subseq, sizeof(__pyx_k_min_subseq), 0, 0, 1, 1}, + {&__pyx_n_s_minp, __pyx_k_minp, sizeof(__pyx_k_minp), 0, 0, 1, 1}, + {&__pyx_n_s_minpair, __pyx_k_minpair, sizeof(__pyx_k_minpair), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_minx, __pyx_k_minx, sizeof(__pyx_k_minx), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_n0, __pyx_k_n0, sizeof(__pyx_k_n0), 0, 0, 1, 1}, + {&__pyx_n_s_na_option, __pyx_k_na_option, sizeof(__pyx_k_na_option), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_n_s_nan_value, __pyx_k_nan_value, sizeof(__pyx_k_nan_value), 0, 0, 1, 1}, + {&__pyx_n_s_nancorr, __pyx_k_nancorr, sizeof(__pyx_k_nancorr), 0, 0, 1, 1}, + {&__pyx_n_s_nancorr_spearman, __pyx_k_nancorr_spearman, sizeof(__pyx_k_nancorr_spearman), 0, 0, 1, 1}, + {&__pyx_n_s_nbins, __pyx_k_nbins, sizeof(__pyx_k_nbins), 0, 0, 1, 1}, + {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, + {&__pyx_n_s_neg_ct, __pyx_k_neg_ct, sizeof(__pyx_k_neg_ct), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_neww, __pyx_k_neww, sizeof(__pyx_k_neww), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_ngroups, __pyx_k_ngroups, sizeof(__pyx_k_ngroups), 0, 0, 1, 1}, + {&__pyx_n_s_nleft, __pyx_k_nleft, sizeof(__pyx_k_nleft), 0, 0, 1, 1}, + {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1}, + {&__pyx_n_s_nobs, __pyx_k_nobs, sizeof(__pyx_k_nobs), 0, 0, 1, 1}, + {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_nright, __pyx_k_nright, sizeof(__pyx_k_nright), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1}, + {&__pyx_n_s_oldbuf, __pyx_k_oldbuf, sizeof(__pyx_k_oldbuf), 0, 0, 1, 1}, + {&__pyx_n_s_oldw, __pyx_k_oldw, sizeof(__pyx_k_oldw), 0, 0, 1, 1}, + {&__pyx_n_s_ones_like, __pyx_k_ones_like, sizeof(__pyx_k_ones_like), 0, 0, 1, 1}, + {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_float32, __pyx_k_outer_join_indexer_float32, sizeof(__pyx_k_outer_join_indexer_float32), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_float64, __pyx_k_outer_join_indexer_float64, sizeof(__pyx_k_outer_join_indexer_float64), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_int32, __pyx_k_outer_join_indexer_int32, sizeof(__pyx_k_outer_join_indexer_int32), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_int64, __pyx_k_outer_join_indexer_int64, sizeof(__pyx_k_outer_join_indexer_int64), 0, 0, 1, 1}, + {&__pyx_n_s_outer_join_indexer_object, __pyx_k_outer_join_indexer_object, sizeof(__pyx_k_outer_join_indexer_object), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_bool, __pyx_k_pad_2d_inplace_bool, sizeof(__pyx_k_pad_2d_inplace_bool), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_float32, __pyx_k_pad_2d_inplace_float32, sizeof(__pyx_k_pad_2d_inplace_float32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_float64, __pyx_k_pad_2d_inplace_float64, sizeof(__pyx_k_pad_2d_inplace_float64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_int32, __pyx_k_pad_2d_inplace_int32, sizeof(__pyx_k_pad_2d_inplace_int32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_int64, __pyx_k_pad_2d_inplace_int64, sizeof(__pyx_k_pad_2d_inplace_int64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_2d_inplace_object, __pyx_k_pad_2d_inplace_object, sizeof(__pyx_k_pad_2d_inplace_object), 0, 0, 1, 1}, + {&__pyx_n_s_pad_bool, __pyx_k_pad_bool, sizeof(__pyx_k_pad_bool), 0, 0, 1, 1}, + {&__pyx_n_s_pad_float32, __pyx_k_pad_float32, sizeof(__pyx_k_pad_float32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_float64, __pyx_k_pad_float64, sizeof(__pyx_k_pad_float64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_bool, __pyx_k_pad_inplace_bool, sizeof(__pyx_k_pad_inplace_bool), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_float32, __pyx_k_pad_inplace_float32, sizeof(__pyx_k_pad_inplace_float32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_float64, __pyx_k_pad_inplace_float64, sizeof(__pyx_k_pad_inplace_float64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_int32, __pyx_k_pad_inplace_int32, sizeof(__pyx_k_pad_inplace_int32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_int64, __pyx_k_pad_inplace_int64, sizeof(__pyx_k_pad_inplace_int64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_inplace_object, __pyx_k_pad_inplace_object, sizeof(__pyx_k_pad_inplace_object), 0, 0, 1, 1}, + {&__pyx_n_s_pad_int32, __pyx_k_pad_int32, sizeof(__pyx_k_pad_int32), 0, 0, 1, 1}, + {&__pyx_n_s_pad_int64, __pyx_k_pad_int64, sizeof(__pyx_k_pad_int64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_object, __pyx_k_pad_object, sizeof(__pyx_k_pad_object), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_algos, __pyx_k_pandas_algos, sizeof(__pyx_k_pandas_algos), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_lib, __pyx_k_pandas_lib, sizeof(__pyx_k_pandas_lib), 0, 0, 1, 1}, + {&__pyx_kp_s_pandas_src_generated_pyx, __pyx_k_pandas_src_generated_pyx, sizeof(__pyx_k_pandas_src_generated_pyx), 0, 0, 1, 0}, + {&__pyx_kp_s_pandas_src_join_pyx, __pyx_k_pandas_src_join_pyx, sizeof(__pyx_k_pandas_src_join_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_pct, __pyx_k_pct, sizeof(__pyx_k_pct), 0, 0, 1, 1}, + {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1}, + {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1}, + {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_prev, __pyx_k_prev, sizeof(__pyx_k_prev), 0, 0, 1, 1}, + {&__pyx_n_s_prodx, __pyx_k_prodx, sizeof(__pyx_k_prodx), 0, 0, 1, 1}, + {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_putmask, __pyx_k_putmask, sizeof(__pyx_k_putmask), 0, 0, 1, 1}, + {&__pyx_n_s_pydatetime, __pyx_k_pydatetime, sizeof(__pyx_k_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_0kth_smallest, __pyx_k_pyx_fuse_0kth_smallest, sizeof(__pyx_k_pyx_fuse_0kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_0median, __pyx_k_pyx_fuse_0median, sizeof(__pyx_k_pyx_fuse_0median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_1kth_smallest, __pyx_k_pyx_fuse_1kth_smallest, sizeof(__pyx_k_pyx_fuse_1kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_1median, __pyx_k_pyx_fuse_1median, sizeof(__pyx_k_pyx_fuse_1median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_2kth_smallest, __pyx_k_pyx_fuse_2kth_smallest, sizeof(__pyx_k_pyx_fuse_2kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_2median, __pyx_k_pyx_fuse_2median, sizeof(__pyx_k_pyx_fuse_2median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_3kth_smallest, __pyx_k_pyx_fuse_3kth_smallest, sizeof(__pyx_k_pyx_fuse_3kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_3median, __pyx_k_pyx_fuse_3median, sizeof(__pyx_k_pyx_fuse_3median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_4kth_smallest, __pyx_k_pyx_fuse_4kth_smallest, sizeof(__pyx_k_pyx_fuse_4kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_4median, __pyx_k_pyx_fuse_4median, sizeof(__pyx_k_pyx_fuse_4median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_5kth_smallest, __pyx_k_pyx_fuse_5kth_smallest, sizeof(__pyx_k_pyx_fuse_5kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_5median, __pyx_k_pyx_fuse_5median, sizeof(__pyx_k_pyx_fuse_5median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_6kth_smallest, __pyx_k_pyx_fuse_6kth_smallest, sizeof(__pyx_k_pyx_fuse_6kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_6median, __pyx_k_pyx_fuse_6median, sizeof(__pyx_k_pyx_fuse_6median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_7kth_smallest, __pyx_k_pyx_fuse_7kth_smallest, sizeof(__pyx_k_pyx_fuse_7kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_7median, __pyx_k_pyx_fuse_7median, sizeof(__pyx_k_pyx_fuse_7median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_8kth_smallest, __pyx_k_pyx_fuse_8kth_smallest, sizeof(__pyx_k_pyx_fuse_8kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_8median, __pyx_k_pyx_fuse_8median, sizeof(__pyx_k_pyx_fuse_8median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_9kth_smallest, __pyx_k_pyx_fuse_9kth_smallest, sizeof(__pyx_k_pyx_fuse_9kth_smallest), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_fuse_9median, __pyx_k_pyx_fuse_9median, sizeof(__pyx_k_pyx_fuse_9median), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_quantile, __pyx_k_quantile, sizeof(__pyx_k_quantile), 0, 0, 1, 1}, + {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1}, + {&__pyx_n_s_rank_1d_float64, __pyx_k_rank_1d_float64, sizeof(__pyx_k_rank_1d_float64), 0, 0, 1, 1}, + {&__pyx_n_s_rank_1d_generic, __pyx_k_rank_1d_generic, sizeof(__pyx_k_rank_1d_generic), 0, 0, 1, 1}, + {&__pyx_n_s_rank_1d_int64, __pyx_k_rank_1d_int64, sizeof(__pyx_k_rank_1d_int64), 0, 0, 1, 1}, + {&__pyx_n_s_rank_2d_float64, __pyx_k_rank_2d_float64, sizeof(__pyx_k_rank_2d_float64), 0, 0, 1, 1}, + {&__pyx_n_s_rank_2d_generic, __pyx_k_rank_2d_generic, sizeof(__pyx_k_rank_2d_generic), 0, 0, 1, 1}, + {&__pyx_n_s_rank_2d_int64, __pyx_k_rank_2d_int64, sizeof(__pyx_k_rank_2d_int64), 0, 0, 1, 1}, + {&__pyx_n_s_ranks, __pyx_k_ranks, sizeof(__pyx_k_ranks), 0, 0, 1, 1}, + {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1}, + {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, + {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_resx, __pyx_k_resx, sizeof(__pyx_k_resx), 0, 0, 1, 1}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_retry, __pyx_k_retry, sizeof(__pyx_k_retry), 0, 0, 1, 1}, + {&__pyx_n_s_return_false, __pyx_k_return_false, sizeof(__pyx_k_return_false), 0, 0, 1, 1}, + {&__pyx_n_s_return_true, __pyx_k_return_true, sizeof(__pyx_k_return_true), 0, 0, 1, 1}, + {&__pyx_n_s_rev, __pyx_k_rev, sizeof(__pyx_k_rev), 0, 0, 1, 1}, + {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_right_count, __pyx_k_right_count, sizeof(__pyx_k_right_count), 0, 0, 1, 1}, + {&__pyx_n_s_right_indexer, __pyx_k_right_indexer, sizeof(__pyx_k_right_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_right_pos, __pyx_k_right_pos, sizeof(__pyx_k_right_pos), 0, 0, 1, 1}, + {&__pyx_n_s_right_sorter, __pyx_k_right_sorter, sizeof(__pyx_k_right_sorter), 0, 0, 1, 1}, + {&__pyx_n_s_rindexer, __pyx_k_rindexer, sizeof(__pyx_k_rindexer), 0, 0, 1, 1}, + {&__pyx_n_s_ring, __pyx_k_ring, sizeof(__pyx_k_ring), 0, 0, 1, 1}, + {&__pyx_n_s_roll_generic, __pyx_k_roll_generic, sizeof(__pyx_k_roll_generic), 0, 0, 1, 1}, + {&__pyx_n_s_roll_kurt, __pyx_k_roll_kurt, sizeof(__pyx_k_roll_kurt), 0, 0, 1, 1}, + {&__pyx_n_s_roll_max, __pyx_k_roll_max, sizeof(__pyx_k_roll_max), 0, 0, 1, 1}, + {&__pyx_n_s_roll_max2, __pyx_k_roll_max2, sizeof(__pyx_k_roll_max2), 0, 0, 1, 1}, + {&__pyx_n_s_roll_mean, __pyx_k_roll_mean, sizeof(__pyx_k_roll_mean), 0, 0, 1, 1}, + {&__pyx_n_s_roll_median_c, __pyx_k_roll_median_c, sizeof(__pyx_k_roll_median_c), 0, 0, 1, 1}, + {&__pyx_n_s_roll_median_cython, __pyx_k_roll_median_cython, sizeof(__pyx_k_roll_median_cython), 0, 0, 1, 1}, + {&__pyx_n_s_roll_min, __pyx_k_roll_min, sizeof(__pyx_k_roll_min), 0, 0, 1, 1}, + {&__pyx_n_s_roll_min2, __pyx_k_roll_min2, sizeof(__pyx_k_roll_min2), 0, 0, 1, 1}, + {&__pyx_n_s_roll_quantile, __pyx_k_roll_quantile, sizeof(__pyx_k_roll_quantile), 0, 0, 1, 1}, + {&__pyx_n_s_roll_skew, __pyx_k_roll_skew, sizeof(__pyx_k_roll_skew), 0, 0, 1, 1}, + {&__pyx_n_s_roll_sum, __pyx_k_roll_sum, sizeof(__pyx_k_roll_sum), 0, 0, 1, 1}, + {&__pyx_n_s_roll_var, __pyx_k_roll_var, sizeof(__pyx_k_roll_var), 0, 0, 1, 1}, + {&__pyx_n_s_roll_window, __pyx_k_roll_window, sizeof(__pyx_k_roll_window), 0, 0, 1, 1}, + {&__pyx_n_s_rval, __pyx_k_rval, sizeof(__pyx_k_rval), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_skiplist, __pyx_k_skiplist, sizeof(__pyx_k_skiplist), 0, 0, 1, 1}, + {&__pyx_n_s_sl, __pyx_k_sl, sizeof(__pyx_k_sl), 0, 0, 1, 1}, + {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, + {&__pyx_n_s_sorted_data, __pyx_k_sorted_data, sizeof(__pyx_k_sorted_data), 0, 0, 1, 1}, + {&__pyx_n_s_sorter, __pyx_k_sorter, sizeof(__pyx_k_sorter), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_ssqdm_x, __pyx_k_ssqdm_x, sizeof(__pyx_k_ssqdm_x), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_sum_ranks, __pyx_k_sum_ranks, sizeof(__pyx_k_sum_ranks), 0, 0, 1, 1}, + {&__pyx_n_s_sum_x, __pyx_k_sum_x, sizeof(__pyx_k_sum_x), 0, 0, 1, 1}, + {&__pyx_n_s_sumx, __pyx_k_sumx, sizeof(__pyx_k_sumx), 0, 0, 1, 1}, + {&__pyx_n_s_sumxx, __pyx_k_sumxx, sizeof(__pyx_k_sumxx), 0, 0, 1, 1}, + {&__pyx_n_s_sumy, __pyx_k_sumy, sizeof(__pyx_k_sumy), 0, 0, 1, 1}, + {&__pyx_n_s_sumyy, __pyx_k_sumyy, sizeof(__pyx_k_sumyy), 0, 0, 1, 1}, + {&__pyx_n_s_sx, __pyx_k_sx, sizeof(__pyx_k_sx), 0, 0, 1, 1}, + {&__pyx_n_s_sy, __pyx_k_sy, sizeof(__pyx_k_sy), 0, 0, 1, 1}, + {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_bool_bool, __pyx_k_take_1d_bool_bool, sizeof(__pyx_k_take_1d_bool_bool), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_bool_object, __pyx_k_take_1d_bool_object, sizeof(__pyx_k_take_1d_bool_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_float32_float32, __pyx_k_take_1d_float32_float32, sizeof(__pyx_k_take_1d_float32_float32), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_float32_float64, __pyx_k_take_1d_float32_float64, sizeof(__pyx_k_take_1d_float32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_float64_float64, __pyx_k_take_1d_float64_float64, sizeof(__pyx_k_take_1d_float64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int16_float64, __pyx_k_take_1d_int16_float64, sizeof(__pyx_k_take_1d_int16_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int16_int16, __pyx_k_take_1d_int16_int16, sizeof(__pyx_k_take_1d_int16_int16), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int16_int32, __pyx_k_take_1d_int16_int32, sizeof(__pyx_k_take_1d_int16_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int16_int64, __pyx_k_take_1d_int16_int64, sizeof(__pyx_k_take_1d_int16_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int32_float64, __pyx_k_take_1d_int32_float64, sizeof(__pyx_k_take_1d_int32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int32_int32, __pyx_k_take_1d_int32_int32, sizeof(__pyx_k_take_1d_int32_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int32_int64, __pyx_k_take_1d_int32_int64, sizeof(__pyx_k_take_1d_int32_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int64_float64, __pyx_k_take_1d_int64_float64, sizeof(__pyx_k_take_1d_int64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int64_int64, __pyx_k_take_1d_int64_int64, sizeof(__pyx_k_take_1d_int64_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int8_float64, __pyx_k_take_1d_int8_float64, sizeof(__pyx_k_take_1d_int8_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int8_int32, __pyx_k_take_1d_int8_int32, sizeof(__pyx_k_take_1d_int8_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int8_int64, __pyx_k_take_1d_int8_int64, sizeof(__pyx_k_take_1d_int8_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_int8_int8, __pyx_k_take_1d_int8_int8, sizeof(__pyx_k_take_1d_int8_int8), 0, 0, 1, 1}, + {&__pyx_n_s_take_1d_object_object, __pyx_k_take_1d_object_object, sizeof(__pyx_k_take_1d_object_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_bool_bool, __pyx_k_take_2d_axis0_bool_bool, sizeof(__pyx_k_take_2d_axis0_bool_bool), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_bool_object, __pyx_k_take_2d_axis0_bool_object, sizeof(__pyx_k_take_2d_axis0_bool_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_float32_float32, __pyx_k_take_2d_axis0_float32_float32, sizeof(__pyx_k_take_2d_axis0_float32_float32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_float32_float64, __pyx_k_take_2d_axis0_float32_float64, sizeof(__pyx_k_take_2d_axis0_float32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_float64_float64, __pyx_k_take_2d_axis0_float64_float64, sizeof(__pyx_k_take_2d_axis0_float64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int16_float64, __pyx_k_take_2d_axis0_int16_float64, sizeof(__pyx_k_take_2d_axis0_int16_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int16_int16, __pyx_k_take_2d_axis0_int16_int16, sizeof(__pyx_k_take_2d_axis0_int16_int16), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int16_int32, __pyx_k_take_2d_axis0_int16_int32, sizeof(__pyx_k_take_2d_axis0_int16_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int16_int64, __pyx_k_take_2d_axis0_int16_int64, sizeof(__pyx_k_take_2d_axis0_int16_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int32_float64, __pyx_k_take_2d_axis0_int32_float64, sizeof(__pyx_k_take_2d_axis0_int32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int32_int32, __pyx_k_take_2d_axis0_int32_int32, sizeof(__pyx_k_take_2d_axis0_int32_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int32_int64, __pyx_k_take_2d_axis0_int32_int64, sizeof(__pyx_k_take_2d_axis0_int32_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int64_float64, __pyx_k_take_2d_axis0_int64_float64, sizeof(__pyx_k_take_2d_axis0_int64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int64_int64, __pyx_k_take_2d_axis0_int64_int64, sizeof(__pyx_k_take_2d_axis0_int64_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int8_float64, __pyx_k_take_2d_axis0_int8_float64, sizeof(__pyx_k_take_2d_axis0_int8_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int8_int32, __pyx_k_take_2d_axis0_int8_int32, sizeof(__pyx_k_take_2d_axis0_int8_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int8_int64, __pyx_k_take_2d_axis0_int8_int64, sizeof(__pyx_k_take_2d_axis0_int8_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_int8_int8, __pyx_k_take_2d_axis0_int8_int8, sizeof(__pyx_k_take_2d_axis0_int8_int8), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis0_object_object, __pyx_k_take_2d_axis0_object_object, sizeof(__pyx_k_take_2d_axis0_object_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_bool_bool, __pyx_k_take_2d_axis1_bool_bool, sizeof(__pyx_k_take_2d_axis1_bool_bool), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_bool_object, __pyx_k_take_2d_axis1_bool_object, sizeof(__pyx_k_take_2d_axis1_bool_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_float32_float32, __pyx_k_take_2d_axis1_float32_float32, sizeof(__pyx_k_take_2d_axis1_float32_float32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_float32_float64, __pyx_k_take_2d_axis1_float32_float64, sizeof(__pyx_k_take_2d_axis1_float32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_float64_float64, __pyx_k_take_2d_axis1_float64_float64, sizeof(__pyx_k_take_2d_axis1_float64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int16_float64, __pyx_k_take_2d_axis1_int16_float64, sizeof(__pyx_k_take_2d_axis1_int16_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int16_int16, __pyx_k_take_2d_axis1_int16_int16, sizeof(__pyx_k_take_2d_axis1_int16_int16), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int16_int32, __pyx_k_take_2d_axis1_int16_int32, sizeof(__pyx_k_take_2d_axis1_int16_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int16_int64, __pyx_k_take_2d_axis1_int16_int64, sizeof(__pyx_k_take_2d_axis1_int16_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int32_float64, __pyx_k_take_2d_axis1_int32_float64, sizeof(__pyx_k_take_2d_axis1_int32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int32_int32, __pyx_k_take_2d_axis1_int32_int32, sizeof(__pyx_k_take_2d_axis1_int32_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int32_int64, __pyx_k_take_2d_axis1_int32_int64, sizeof(__pyx_k_take_2d_axis1_int32_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int64_float64, __pyx_k_take_2d_axis1_int64_float64, sizeof(__pyx_k_take_2d_axis1_int64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int64_int64, __pyx_k_take_2d_axis1_int64_int64, sizeof(__pyx_k_take_2d_axis1_int64_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int8_float64, __pyx_k_take_2d_axis1_int8_float64, sizeof(__pyx_k_take_2d_axis1_int8_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int8_int32, __pyx_k_take_2d_axis1_int8_int32, sizeof(__pyx_k_take_2d_axis1_int8_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int8_int64, __pyx_k_take_2d_axis1_int8_int64, sizeof(__pyx_k_take_2d_axis1_int8_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_int8_int8, __pyx_k_take_2d_axis1_int8_int8, sizeof(__pyx_k_take_2d_axis1_int8_int8), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_axis1_object_object, __pyx_k_take_2d_axis1_object_object, sizeof(__pyx_k_take_2d_axis1_object_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_bool_bool, __pyx_k_take_2d_multi_bool_bool, sizeof(__pyx_k_take_2d_multi_bool_bool), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_bool_object, __pyx_k_take_2d_multi_bool_object, sizeof(__pyx_k_take_2d_multi_bool_object), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_float32_float32, __pyx_k_take_2d_multi_float32_float32, sizeof(__pyx_k_take_2d_multi_float32_float32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_float32_float64, __pyx_k_take_2d_multi_float32_float64, sizeof(__pyx_k_take_2d_multi_float32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_float64_float64, __pyx_k_take_2d_multi_float64_float64, sizeof(__pyx_k_take_2d_multi_float64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int16_float64, __pyx_k_take_2d_multi_int16_float64, sizeof(__pyx_k_take_2d_multi_int16_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int16_int16, __pyx_k_take_2d_multi_int16_int16, sizeof(__pyx_k_take_2d_multi_int16_int16), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int16_int32, __pyx_k_take_2d_multi_int16_int32, sizeof(__pyx_k_take_2d_multi_int16_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int16_int64, __pyx_k_take_2d_multi_int16_int64, sizeof(__pyx_k_take_2d_multi_int16_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int32_float64, __pyx_k_take_2d_multi_int32_float64, sizeof(__pyx_k_take_2d_multi_int32_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int32_int32, __pyx_k_take_2d_multi_int32_int32, sizeof(__pyx_k_take_2d_multi_int32_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int32_int64, __pyx_k_take_2d_multi_int32_int64, sizeof(__pyx_k_take_2d_multi_int32_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int64_float64, __pyx_k_take_2d_multi_int64_float64, sizeof(__pyx_k_take_2d_multi_int64_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int64_int64, __pyx_k_take_2d_multi_int64_int64, sizeof(__pyx_k_take_2d_multi_int64_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int8_float64, __pyx_k_take_2d_multi_int8_float64, sizeof(__pyx_k_take_2d_multi_int8_float64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int8_int32, __pyx_k_take_2d_multi_int8_int32, sizeof(__pyx_k_take_2d_multi_int8_int32), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int8_int64, __pyx_k_take_2d_multi_int8_int64, sizeof(__pyx_k_take_2d_multi_int8_int64), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_int8_int8, __pyx_k_take_2d_multi_int8_int8, sizeof(__pyx_k_take_2d_multi_int8_int8), 0, 0, 1, 1}, + {&__pyx_n_s_take_2d_multi_object_object, __pyx_k_take_2d_multi_object_object, sizeof(__pyx_k_take_2d_multi_object_object), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_tiebreak, __pyx_k_tiebreak, sizeof(__pyx_k_tiebreak), 0, 0, 1, 1}, + {&__pyx_n_s_tiebreakers, __pyx_k_tiebreakers, sizeof(__pyx_k_tiebreakers), 0, 0, 1, 1}, + {&__pyx_n_s_ties_method, __pyx_k_ties_method, sizeof(__pyx_k_ties_method), 0, 0, 1, 1}, + {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1}, + {&__pyx_n_s_tot_wgt, __pyx_k_tot_wgt, sizeof(__pyx_k_tot_wgt), 0, 0, 1, 1}, + {&__pyx_n_s_total_tie_count, __pyx_k_total_tie_count, sizeof(__pyx_k_total_tie_count), 0, 0, 1, 1}, + {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, + {&__pyx_n_s_uint16_t, __pyx_k_uint16_t, sizeof(__pyx_k_uint16_t), 0, 0, 1, 1}, + {&__pyx_n_s_uint32_t, __pyx_k_uint32_t, sizeof(__pyx_k_uint32_t), 0, 0, 1, 1}, + {&__pyx_n_s_uint64_t, __pyx_k_uint64_t, sizeof(__pyx_k_uint64_t), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_n_s_uint8_t, __pyx_k_uint8_t, sizeof(__pyx_k_uint8_t), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_val_in, __pyx_k_val_in, sizeof(__pyx_k_val_in), 0, 0, 1, 1}, + {&__pyx_n_s_val_win, __pyx_k_val_win, sizeof(__pyx_k_val_win), 0, 0, 1, 1}, + {&__pyx_n_s_valid_locs, __pyx_k_valid_locs, sizeof(__pyx_k_valid_locs), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_vclose, __pyx_k_vclose, sizeof(__pyx_k_vclose), 0, 0, 1, 1}, + {&__pyx_n_s_vecs, __pyx_k_vecs, sizeof(__pyx_k_vecs), 0, 0, 1, 1}, + {&__pyx_n_s_vhigh, __pyx_k_vhigh, sizeof(__pyx_k_vhigh), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_vlow, __pyx_k_vlow, sizeof(__pyx_k_vlow), 0, 0, 1, 1}, + {&__pyx_n_s_vopen, __pyx_k_vopen, sizeof(__pyx_k_vopen), 0, 0, 1, 1}, + {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1}, + {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_n_s_weights, __pyx_k_weights, sizeof(__pyx_k_weights), 0, 0, 1, 1}, + {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1}, + {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, + {&__pyx_n_s_win, __pyx_k_win, sizeof(__pyx_k_win), 0, 0, 1, 1}, + {&__pyx_n_s_win_i, __pyx_k_win_i, sizeof(__pyx_k_win_i), 0, 0, 1, 1}, + {&__pyx_n_s_win_k, __pyx_k_win_k, sizeof(__pyx_k_win_k), 0, 0, 1, 1}, + {&__pyx_n_s_win_n, __pyx_k_win_n, sizeof(__pyx_k_win_n), 0, 0, 1, 1}, + {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xi, __pyx_k_xi, sizeof(__pyx_k_xi), 0, 0, 1, 1}, + {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, + {&__pyx_n_s_xx, __pyx_k_xx, sizeof(__pyx_k_xx), 0, 0, 1, 1}, + {&__pyx_n_s_xxx, __pyx_k_xxx, sizeof(__pyx_k_xxx), 0, 0, 1, 1}, + {&__pyx_n_s_xxxx, __pyx_k_xxxx, sizeof(__pyx_k_xxxx), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {&__pyx_n_s_yi, __pyx_k_yi, sizeof(__pyx_k_yi), 0, 0, 1, 1}, + {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {&__pyx_n_s_zeros_like, __pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION >= 3 + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/src/skiplist.pyx":138 + * + * if value != ( ( ( chain[0]).next)[0]).value: + * raise KeyError('Not Found') # <<<<<<<<<<<<<< + * + * # remove one link at each level + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Not_Found); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/algos.pyx":192 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_slice__2 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__2); + __Pyx_GIVEREF(__pyx_slice__2); + + /* "pandas/algos.pyx":195 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/algos.pyx":264 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_slice__4 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__4); + __Pyx_GIVEREF(__pyx_slice__4); + + /* "pandas/algos.pyx":267 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/algos.pyx":344 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/algos.pyx":347 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_float64(values, _as) + */ + __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__7); + __Pyx_GIVEREF(__pyx_slice__7); + __pyx_slice__8 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__8); + __Pyx_GIVEREF(__pyx_slice__8); + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_slice__7, __pyx_slice__8); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/algos.pyx":350 + * + * values = _take_2d_float64(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "pandas/algos.pyx":386 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__11); + __Pyx_GIVEREF(__pyx_slice__11); + + /* "pandas/algos.pyx":424 + * tiebreak = TIEBREAK_FIRST_DESCENDING + * else: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * + * if not ascending: + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/algos.pyx":427 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_int64(values, _as) + */ + __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__13); + __Pyx_GIVEREF(__pyx_slice__13); + __pyx_slice__14 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__14); + __Pyx_GIVEREF(__pyx_slice__14); + __pyx_tuple__15 = PyTuple_Pack(2, __pyx_slice__13, __pyx_slice__14); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/algos.pyx":430 + * + * values = _take_2d_int64(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "pandas/algos.pyx":463 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__17); + __Pyx_GIVEREF(__pyx_slice__17); + + /* "pandas/algos.pyx":495 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "pandas/algos.pyx":524 + * + * if not ascending: + * _as = _as[::-1] # <<<<<<<<<<<<<< + * + * sorted_data = values.take(_as) + */ + __pyx_slice__19 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__19); + __Pyx_GIVEREF(__pyx_slice__19); + + /* "pandas/algos.pyx":527 + * + * sorted_data = values.take(_as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * sum_ranks += i + 1 + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "pandas/algos.pyx":548 + * ranks[argsorted[j]] = i + 1 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for non-numeric data') # <<<<<<<<<<<<<< + * elif tiebreak == TIEBREAK_DENSE: + * total_tie_count += 1 + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_first_not_supported_for_non_nume); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "pandas/algos.pyx":618 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * if ascending ^ (na_option == 'top'): + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "pandas/algos.pyx":633 + * + * try: + * _as = values.argsort(1) # <<<<<<<<<<<<<< + * except TypeError: + * values = in_arr + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "pandas/algos.pyx":647 + * + * if not ascending: + * _as = _as[:, ::-1] # <<<<<<<<<<<<<< + * + * values = _take_2d_object(values, _as) + */ + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); + __pyx_slice__25 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + __pyx_tuple__26 = PyTuple_Pack(2, __pyx_slice__24, __pyx_slice__25); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "pandas/algos.pyx":650 + * + * values = _take_2d_object(values, _as) + * argsorted = _as.astype('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "pandas/algos.pyx":676 + * ranks[i, argsorted[i, z]] = j + 1 + * elif tiebreak == TIEBREAK_FIRST: + * raise ValueError('first not supported for ' # <<<<<<<<<<<<<< + * 'non-numeric data') + * elif tiebreak == TIEBREAK_DENSE: + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_first_not_supported_for_non_nume); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/algos.pyx":684 + * sum_ranks = dups = 0 + * if pct: + * ranks[i, :] /= count # <<<<<<<<<<<<<< + * if axis == 0: + * return ranks.T + */ + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + + /* "pandas/algos.pyx":724 + * minp = 1 + * elif minp < 0: + * raise ValueError('min_periods must be >= 0') # <<<<<<<<<<<<<< + * return minp + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_min_periods_must_be_0); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_i, __pyx_n_s_u); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s__32); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__34); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_i, __pyx_n_s_u); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s__32); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s__34); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "pandas/algos.pyx":851 + * + * if len(arr) == 0: + * return (-1,-1,None) # <<<<<<<<<<<<<< + * + * m = arr[0] + */ + __pyx_tuple__43 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "pandas/algos.pyx":1711 + * cdef double_t _get_min(object skiplist, int nobs, int minp): + * if nobs >= minp: + * return skiplist.get(0) # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "pandas/algos.pyx":1770 + * + * if not input.flags.c_contiguous: + * input = input.copy('C') # <<<<<<<<<<<<<< + * + * buf = input.data + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "pandas/algos.pyx":2222 + * + * indexer, _counts = groupsort_indexer(labels, ngroups) + * counts[:] = _counts[1:] # <<<<<<<<<<<<<< + * + * data = np.empty((K, N), dtype=np.float64) + */ + __pyx_slice__46 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__46); + __Pyx_GIVEREF(__pyx_slice__46); + __pyx_slice__47 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__47); + __Pyx_GIVEREF(__pyx_slice__47); + + /* "pandas/src/join.pyx":193 + * # length-0 case + * res = np.empty(len(indexer), dtype=np.int64) + * res.fill(-1) # <<<<<<<<<<<<<< + * + * return res + */ + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "pandas/src/join.pyx":229 + * + * last_obs = np.empty(max_group, dtype=np.int64) + * last_obs.fill(-1) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + + /* "pandas/src/generated.pyx":269 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + + /* "pandas/src/generated.pyx":275 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "pandas/src/generated.pyx":330 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + + /* "pandas/src/generated.pyx":336 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + + /* "pandas/src/generated.pyx":391 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + + /* "pandas/src/generated.pyx":397 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "pandas/src/generated.pyx":452 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "pandas/src/generated.pyx":458 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "pandas/src/generated.pyx":513 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "pandas/src/generated.pyx":519 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "pandas/src/generated.pyx":574 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "pandas/src/generated.pyx":580 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "pandas/src/generated.pyx":636 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "pandas/src/generated.pyx":642 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + + /* "pandas/src/generated.pyx":698 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + + /* "pandas/src/generated.pyx":704 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "pandas/src/generated.pyx":760 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "pandas/src/generated.pyx":766 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "pandas/src/generated.pyx":822 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "pandas/src/generated.pyx":828 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "pandas/src/generated.pyx":884 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "pandas/src/generated.pyx":890 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "pandas/src/generated.pyx":946 + * nright = len(new) + * indexer = np.empty(nright, dtype=np.int64) + * indexer.fill(-1) # <<<<<<<<<<<<<< + * + * if limit is None: + */ + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "pandas/src/generated.pyx":952 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "pandas/src/generated.pyx":1016 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + + /* "pandas/src/generated.pyx":1049 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + + /* "pandas/src/generated.pyx":1082 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + + /* "pandas/src/generated.pyx":1115 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + + /* "pandas/src/generated.pyx":1148 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + + /* "pandas/src/generated.pyx":1181 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + + /* "pandas/src/generated.pyx":1215 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + + /* "pandas/src/generated.pyx":1247 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + + /* "pandas/src/generated.pyx":1279 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + + /* "pandas/src/generated.pyx":1311 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + + /* "pandas/src/generated.pyx":1343 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + + /* "pandas/src/generated.pyx":1375 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + + /* "pandas/src/generated.pyx":1408 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + + /* "pandas/src/generated.pyx":1442 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + + /* "pandas/src/generated.pyx":1476 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + + /* "pandas/src/generated.pyx":1510 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + + /* "pandas/src/generated.pyx":1544 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + + /* "pandas/src/generated.pyx":1578 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + + /* "pandas/src/generated.pyx":1613 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + + /* "pandas/src/generated.pyx":1647 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + + /* "pandas/src/generated.pyx":1681 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + + /* "pandas/src/generated.pyx":1715 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + + /* "pandas/src/generated.pyx":1749 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + + /* "pandas/src/generated.pyx":1783 + * else: + * if limit < 0: + * raise ValueError('Limit must be non-negative') # <<<<<<<<<<<<<< + * lim = limit + * + */ + __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_Limit_must_be_non_negative); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + + /* "pandas/src/generated.pyx":1815 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__98 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + + /* "pandas/src/generated.pyx":1821 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__99 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + + /* "pandas/src/generated.pyx":1842 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__100 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + + /* "pandas/src/generated.pyx":1848 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__101 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + + /* "pandas/src/generated.pyx":1869 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__102 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + + /* "pandas/src/generated.pyx":1875 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__103 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + + /* "pandas/src/generated.pyx":1896 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__104 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + + /* "pandas/src/generated.pyx":1902 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__105 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + + /* "pandas/src/generated.pyx":1923 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__106 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + + /* "pandas/src/generated.pyx":1929 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__107 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + + /* "pandas/src/generated.pyx":1950 + * + * if n < 2: + * return True, True # <<<<<<<<<<<<<< + * + * prev = arr[0] + */ + __pyx_tuple__108 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + + /* "pandas/src/generated.pyx":1956 + * cur = arr[i] + * if cur < prev: + * return False, None # <<<<<<<<<<<<<< + * elif cur == prev: + * is_unique = 0 + */ + __pyx_tuple__109 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__109); + __Pyx_GIVEREF(__pyx_tuple__109); + + /* "pandas/src/generated.pyx":1973 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + + /* "pandas/src/generated.pyx":2001 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + + /* "pandas/src/generated.pyx":2029 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + + /* "pandas/src/generated.pyx":2057 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__113); + __Pyx_GIVEREF(__pyx_tuple__113); + + /* "pandas/src/generated.pyx":2085 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + + /* "pandas/src/generated.pyx":2113 + * + * if not length == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(length): + */ + __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + + /* "pandas/src/generated.pyx":4743 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__192)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__192); + __Pyx_GIVEREF(__pyx_tuple__192); + + /* "pandas/src/generated.pyx":4786 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__193); + __Pyx_GIVEREF(__pyx_tuple__193); + + /* "pandas/src/generated.pyx":4919 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__194)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__194); + __Pyx_GIVEREF(__pyx_tuple__194); + + /* "pandas/src/generated.pyx":4963 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros(( out).shape, dtype=np.int64) + */ + __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__195); + __Pyx_GIVEREF(__pyx_tuple__195); + + /* "pandas/src/generated.pyx":5098 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__196); + __Pyx_GIVEREF(__pyx_tuple__196); + + /* "pandas/src/generated.pyx":5154 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__197)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__197); + __Pyx_GIVEREF(__pyx_tuple__197); + + /* "pandas/src/generated.pyx":5324 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__198); + __Pyx_GIVEREF(__pyx_tuple__198); + + /* "pandas/src/generated.pyx":5380 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__199); + __Pyx_GIVEREF(__pyx_tuple__199); + + /* "pandas/src/generated.pyx":5547 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__200 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__200)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__200); + __Pyx_GIVEREF(__pyx_tuple__200); + + /* "pandas/src/generated.pyx":5608 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + + /* "pandas/src/generated.pyx":5793 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__202)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__202); + __Pyx_GIVEREF(__pyx_tuple__202); + + /* "pandas/src/generated.pyx":5845 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__203 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__203); + __Pyx_GIVEREF(__pyx_tuple__203); + + /* "pandas/src/generated.pyx":6008 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__204 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__204)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__204); + __Pyx_GIVEREF(__pyx_tuple__204); + + /* "pandas/src/generated.pyx":6068 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__205); + __Pyx_GIVEREF(__pyx_tuple__205); + + /* "pandas/src/generated.pyx":6252 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__206)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__206); + __Pyx_GIVEREF(__pyx_tuple__206); + + /* "pandas/src/generated.pyx":6312 + * + * if not len(values) == len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * nobs = np.zeros_like(out) + */ + __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__207); + __Pyx_GIVEREF(__pyx_tuple__207); + + /* "pandas/src/generated.pyx":6502 + * + * if out.shape[1] != 4: + * raise ValueError('Output array must have 4 columns') # <<<<<<<<<<<<<< + * + * NA = np.nan + */ + __pyx_tuple__208 = PyTuple_Pack(1, __pyx_kp_s_Output_array_must_have_4_columns); if (unlikely(!__pyx_tuple__208)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__208); + __Pyx_GIVEREF(__pyx_tuple__208); + + /* "pandas/src/generated.pyx":6575 + * + * if out.shape[1] != 4: + * raise ValueError('Output array must have 4 columns') # <<<<<<<<<<<<<< + * + * NA = np.nan + */ + __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s_Output_array_must_have_4_columns); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__209); + __Pyx_GIVEREF(__pyx_tuple__209); + + /* "pandas/src/generated.pyx":6643 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__210)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__210); + __Pyx_GIVEREF(__pyx_tuple__210); + + /* "pandas/src/generated.pyx":6679 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__211); + __Pyx_GIVEREF(__pyx_tuple__211); + + /* "pandas/src/generated.pyx":6715 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__212)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__212); + __Pyx_GIVEREF(__pyx_tuple__212); + + /* "pandas/src/generated.pyx":6751 + * + * if len(values) != len(labels): + * raise AssertionError("len(index) != len(labels)") # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_len_index_len_labels); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__213); + __Pyx_GIVEREF(__pyx_tuple__213); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__214 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__214)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__214); + __Pyx_GIVEREF(__pyx_tuple__214); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__215); + __Pyx_GIVEREF(__pyx_tuple__215); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__216 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__216)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__216); + __Pyx_GIVEREF(__pyx_tuple__216); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__217 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__217); + __Pyx_GIVEREF(__pyx_tuple__217); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__218 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__218)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__218); + __Pyx_GIVEREF(__pyx_tuple__218); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__219 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__219)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__219); + __Pyx_GIVEREF(__pyx_tuple__219); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__220)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__220); + __Pyx_GIVEREF(__pyx_tuple__220); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__221)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__221); + __Pyx_GIVEREF(__pyx_tuple__221); + + /* "View.MemoryView":127 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__222)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__222); + __Pyx_GIVEREF(__pyx_tuple__222); + + /* "View.MemoryView":130 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if isinstance(format, unicode): + */ + __pyx_tuple__223 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__223)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__223); + __Pyx_GIVEREF(__pyx_tuple__223); + + /* "View.MemoryView":142 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__224 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__224)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__224); + __Pyx_GIVEREF(__pyx_tuple__224); + + /* "View.MemoryView":170 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__225 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__225)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__225); + __Pyx_GIVEREF(__pyx_tuple__225); + + /* "View.MemoryView":186 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__226 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__226)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__226); + __Pyx_GIVEREF(__pyx_tuple__226); + + /* "View.MemoryView":445 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__227)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__227); + __Pyx_GIVEREF(__pyx_tuple__227); + + /* "View.MemoryView":521 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) + */ + __pyx_tuple__228 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__228)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__228); + __Pyx_GIVEREF(__pyx_tuple__228); + + /* "View.MemoryView":638 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_tuple__229 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__229)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__229); + __Pyx_GIVEREF(__pyx_tuple__229); + + /* "View.MemoryView":641 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_tuple__230 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__230)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__230); + __Pyx_GIVEREF(__pyx_tuple__230); + + /* "View.MemoryView":652 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_tuple__231 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__231)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__231); + __Pyx_GIVEREF(__pyx_tuple__231); + + /* "View.MemoryView":660 + * for i in range(ndim): + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__232)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__232); + __Pyx_GIVEREF(__pyx_tuple__232); + + /* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + __pyx_tuple__233 = PyTuple_Pack(22, __pyx_n_s_in_arr, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_sorted_data, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as); if (unlikely(!__pyx_tuple__233)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__233); + __Pyx_GIVEREF(__pyx_tuple__233); + __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(5, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_float64, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + __pyx_tuple__235 = PyTuple_Pack(19, __pyx_n_s_in_arr, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_sorted_data, __pyx_n_s_values, __pyx_n_s_ranks, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__235)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__235); + __Pyx_GIVEREF(__pyx_tuple__235); + __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_int64, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_tuple__237 = PyTuple_Pack(23, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__237)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__237); + __Pyx_GIVEREF(__pyx_tuple__237); + __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(6, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_float64, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_tuple__239 = PyTuple_Pack(21, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_argsorted, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_count, __pyx_n_s_as); if (unlikely(!__pyx_tuple__239)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__239); + __Pyx_GIVEREF(__pyx_tuple__239); + __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(6, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_int64, 393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_tuple__241 = PyTuple_Pack(24, __pyx_n_s_in_arr, __pyx_n_s_retry, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_sorted_data, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as, __pyx_n_s_valid_locs); if (unlikely(!__pyx_tuple__241)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__241); + __Pyx_GIVEREF(__pyx_tuple__241); + __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(6, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_1d_generic, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_tuple__243 = PyTuple_Pack(25, __pyx_n_s_in_arr, __pyx_n_s_axis, __pyx_n_s_ties_method, __pyx_n_s_ascending, __pyx_n_s_na_option, __pyx_n_s_pct, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_z, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_infs, __pyx_n_s_dups, __pyx_n_s_total_tie_count, __pyx_n_s_ranks, __pyx_n_s_values, __pyx_n_s_argsorted, __pyx_n_s_val, __pyx_n_s_nan_value, __pyx_n_s_sum_ranks, __pyx_n_s_tiebreak, __pyx_n_s_keep_na, __pyx_n_s_count, __pyx_n_s_mask, __pyx_n_s_as); if (unlikely(!__pyx_tuple__243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__243); + __Pyx_GIVEREF(__pyx_tuple__243); + __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(6, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_rank_2d_generic, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":715 + * # - + * + * def _check_minp(win, minp, N): # <<<<<<<<<<<<<< + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + */ + __pyx_tuple__245 = PyTuple_Pack(3, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_N); if (unlikely(!__pyx_tuple__245)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__245); + __Pyx_GIVEREF(__pyx_tuple__245); + __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_check_minp, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + __pyx_tuple__247 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_k); if (unlikely(!__pyx_tuple__247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__247); + __Pyx_GIVEREF(__pyx_tuple__247); + __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pyx_fuse_0kth_smallest, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + __pyx_tuple__249 = PyTuple_Pack(2, __pyx_n_s_arr, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__249)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__249); + __Pyx_GIVEREF(__pyx_tuple__249); + __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pyx_fuse_0median, 823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":843 + * # -------------- Min, Max subsequence + * + * def max_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n + */ + __pyx_tuple__251 = PyTuple_Pack(8, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_s, __pyx_n_s_e, __pyx_n_s_T, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_S); if (unlikely(!__pyx_tuple__251)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__251); + __Pyx_GIVEREF(__pyx_tuple__251); + __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_max_subseq, 843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":871 + * return (s, e, m) + * + * def min_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s, e + */ + __pyx_tuple__253 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_s, __pyx_n_s_e, __pyx_n_s_m); if (unlikely(!__pyx_tuple__253)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__253); + __Pyx_GIVEREF(__pyx_tuple__253); + __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_min_subseq, 871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":883 + * # Rolling sum + * + * def roll_sum(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + */ + __pyx_tuple__255 = PyTuple_Pack(10, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_sum_x, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__255); + __Pyx_GIVEREF(__pyx_tuple__255); + __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_sum, 883, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":925 + * # Rolling mean + * + * def roll_mean(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef: + */ + __pyx_tuple__257 = PyTuple_Pack(12, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_result, __pyx_n_s_sum_x, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_neg_ct, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__257)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__257); + __Pyx_GIVEREF(__pyx_tuple__257); + __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_mean, 925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":982 + * # Exponentially weighted moving average + * + * def ewma(ndarray[double_t] input, double_t com, int adjust): # <<<<<<<<<<<<<< + * ''' + * Compute exponentially-weighted moving average using center-of-mass. + */ + __pyx_tuple__259 = PyTuple_Pack(11, __pyx_n_s_input, __pyx_n_s_com, __pyx_n_s_adjust, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_neww, __pyx_n_s_oldw, __pyx_n_s_adj, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__259)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__259); + __Pyx_GIVEREF(__pyx_tuple__259); + __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ewma, 982, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1044 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + __pyx_tuple__261 = PyTuple_Pack(21, __pyx_n_s_mat, __pyx_n_s_cov, __pyx_n_s_minp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_result, __pyx_n_s_mask, __pyx_n_s_nobs, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_sumx, __pyx_n_s_sumy, __pyx_n_s_sumxx, __pyx_n_s_sumyy, __pyx_n_s_meanx, __pyx_n_s_meany, __pyx_n_s_divisor); if (unlikely(!__pyx_tuple__261)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__261); + __Pyx_GIVEREF(__pyx_tuple__261); + __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(3, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_nancorr, 1044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1103 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + __pyx_tuple__263 = PyTuple_Pack(20, __pyx_n_s_mat, __pyx_n_s_minp, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_result, __pyx_n_s_maskedx, __pyx_n_s_maskedy, __pyx_n_s_mask, __pyx_n_s_nobs, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_sumx, __pyx_n_s_sumxx, __pyx_n_s_sumyy, __pyx_n_s_mean, __pyx_n_s_divisor); if (unlikely(!__pyx_tuple__263)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__263); + __Pyx_GIVEREF(__pyx_tuple__263); + __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_nancorr_spearman, 1103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1164 + * # Rolling variance + * + * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1): # <<<<<<<<<<<<<< + * """ + * Numerically stable implementation using Welford's method. + */ + __pyx_tuple__265 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_ddof, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_mean_x, __pyx_n_s_ssqdm_x, __pyx_n_s_nobs, __pyx_n_s_delta, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__265)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__265); + __Pyx_GIVEREF(__pyx_tuple__265); + __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_var, 1164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1253 + * # Rolling skewness + * + * def roll_skew(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + */ + __pyx_tuple__267 = PyTuple_Pack(16, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_x, __pyx_n_s_xx, __pyx_n_s_xxx, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_R); if (unlikely(!__pyx_tuple__267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__267); + __Pyx_GIVEREF(__pyx_tuple__267); + __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_skew, 1253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1317 + * + * + * def roll_kurt(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef double val, prev + */ + __pyx_tuple__269 = PyTuple_Pack(19, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_x, __pyx_n_s_xx, __pyx_n_s_xxx, __pyx_n_s_xxxx, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_D, __pyx_n_s_R, __pyx_n_s_K); if (unlikely(!__pyx_tuple__269)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__269); + __Pyx_GIVEREF(__pyx_tuple__269); + __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_kurt, 1317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1437 + * from skiplist cimport * + * + * def roll_median_c(ndarray[float64_t] arg, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, res, prev + * cdef: + */ + __pyx_tuple__271 = PyTuple_Pack(13, __pyx_n_s_arg, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_val, __pyx_n_s_res, __pyx_n_s_prev, __pyx_n_s_ret, __pyx_n_s_sl, __pyx_n_s_midpoint, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output); if (unlikely(!__pyx_tuple__271)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__271); + __Pyx_GIVEREF(__pyx_tuple__271); + __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_median_c, 1437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1492 + * return output + * + * def roll_median_cython(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_tuple__273 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__273); + __Pyx_GIVEREF(__pyx_tuple__273); + __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_median_cython, 1492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1528 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_max2(ndarray[float64_t] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + __pyx_tuple__275 = PyTuple_Pack(15, __pyx_n_s_a, __pyx_n_s_window, __pyx_n_s_minp, __pyx_n_s_ai, __pyx_n_s_aold, __pyx_n_s_count, __pyx_n_s_ring, __pyx_n_s_minpair, __pyx_n_s_end, __pyx_n_s_last, __pyx_n_s_i0, __pyx_n_s_dim, __pyx_n_s_n0, __pyx_n_s_dims, __pyx_n_s_y); if (unlikely(!__pyx_tuple__275)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__275); + __Pyx_GIVEREF(__pyx_tuple__275); + __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_max2, 1528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1608 + * return y + * + * def roll_max(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_tuple__277 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__277)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__277); + __Pyx_GIVEREF(__pyx_tuple__277); + __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_max, 1608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1621 + * return NaN + * + * def roll_min(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_tuple__279 = PyTuple_Pack(3, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp); if (unlikely(!__pyx_tuple__279)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__279); + __Pyx_GIVEREF(__pyx_tuple__279); + __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_min, 1621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1629 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + __pyx_tuple__281 = PyTuple_Pack(15, __pyx_n_s_a, __pyx_n_s_window, __pyx_n_s_minp, __pyx_n_s_ai, __pyx_n_s_aold, __pyx_n_s_count, __pyx_n_s_ring, __pyx_n_s_minpair, __pyx_n_s_end, __pyx_n_s_last, __pyx_n_s_i0, __pyx_n_s_dim, __pyx_n_s_n0, __pyx_n_s_dims, __pyx_n_s_y); if (unlikely(!__pyx_tuple__281)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__281); + __Pyx_GIVEREF(__pyx_tuple__281); + __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_min2, 1629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1715 + * return NaN + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, double quantile): + * ''' + */ + __pyx_tuple__283 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_quantile, __pyx_n_s_val, __pyx_n_s_prev, __pyx_n_s_midpoint, __pyx_n_s_skiplist, __pyx_n_s_nobs, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_output, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__283)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__283); + __Pyx_GIVEREF(__pyx_tuple__283); + __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_quantile, 1715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1762 + * return output + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, object func, object args, object kwargs): + * cdef ndarray[double_t] output, counts, bufarr + */ + __pyx_tuple__285 = PyTuple_Pack(13, __pyx_n_s_input, __pyx_n_s_win, __pyx_n_s_minp, __pyx_n_s_func, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_output, __pyx_n_s_counts, __pyx_n_s_bufarr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_buf, __pyx_n_s_oldbuf); if (unlikely(!__pyx_tuple__285)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__285); + __Pyx_GIVEREF(__pyx_tuple__285); + __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_generic, 1762, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + __pyx_tuple__287 = PyTuple_Pack(18, __pyx_n_s_input, __pyx_n_s_weights, __pyx_n_s_minp, __pyx_n_s_avg, __pyx_n_s_avg_wgt, __pyx_n_s_output, __pyx_n_s_tot_wgt, __pyx_n_s_counts, __pyx_n_s_in_i, __pyx_n_s_win_i, __pyx_n_s_win_n, __pyx_n_s_win_k, __pyx_n_s_in_n, __pyx_n_s_in_k, __pyx_n_s_val_in, __pyx_n_s_val_win, __pyx_n_s_c, __pyx_n_s_w); if (unlikely(!__pyx_tuple__287)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__287); + __Pyx_GIVEREF(__pyx_tuple__287); + __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_roll_window, 1806, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1879 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + __pyx_tuple__289 = PyTuple_Pack(9, __pyx_n_s_list_of_arrays, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nlevels, __pyx_n_s_k, __pyx_n_s_cur, __pyx_n_s_pre, __pyx_n_s_arr, __pyx_n_s_vecs); if (unlikely(!__pyx_tuple__289)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__289); + __Pyx_GIVEREF(__pyx_tuple__289); + __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_lexsorted, 1879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1912 + * + * @cython.boundscheck(False) + * def groupby_indices(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__291 = PyTuple_Pack(13, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_labels, __pyx_n_s_counts, __pyx_n_s_arr, __pyx_n_s_seen, __pyx_n_s_loc, __pyx_n_s_ids, __pyx_n_s_val, __pyx_n_s_k, __pyx_n_s_vecs, __pyx_n_s_result); if (unlikely(!__pyx_tuple__291)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__291); + __Pyx_GIVEREF(__pyx_tuple__291); + __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_groupby_indices, 1912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1949 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_labels(ndarray[object] values): # <<<<<<<<<<<<<< + * ''' + * Compute label vector from input values and associated useful data + */ + __pyx_tuple__293 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_labels, __pyx_n_s_counts, __pyx_n_s_ids, __pyx_n_s_reverse, __pyx_n_s_idx, __pyx_n_s_val, __pyx_n_s_count); if (unlikely(!__pyx_tuple__293)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__293); + __Pyx_GIVEREF(__pyx_tuple__293); + __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_labels, 1949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":1991 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, loc, label, n + */ + __pyx_tuple__295 = PyTuple_Pack(9, __pyx_n_s_index, __pyx_n_s_ngroups, __pyx_n_s_i, __pyx_n_s_loc, __pyx_n_s_label, __pyx_n_s_n, __pyx_n_s_counts, __pyx_n_s_where, __pyx_n_s_result); if (unlikely(!__pyx_tuple__295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__295); + __Pyx_GIVEREF(__pyx_tuple__295); + __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_groupsort_indexer, 1991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2022 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__297 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_nobs, __pyx_n_s_resx); if (unlikely(!__pyx_tuple__297)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__297); + __Pyx_GIVEREF(__pyx_tuple__297); + __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_nth_object, 2022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2066 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__299 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__299)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__299); + __Pyx_GIVEREF(__pyx_tuple__299); + __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_nth_bin_object, 2066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2114 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__301 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__301)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__301); + __Pyx_GIVEREF(__pyx_tuple__301); + __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_last_object, 2114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2156 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__303 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__303)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__303); + __Pyx_GIVEREF(__pyx_tuple__303); + __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_last_bin_object, 2156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/algos.pyx":2206 + * # median + * + * def group_median(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__305 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_size, __pyx_n_s_counts_2, __pyx_n_s_data, __pyx_n_s_ptr, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__305); + __Pyx_GIVEREF(__pyx_tuple__305); + __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_median, 2206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":1 + * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + __pyx_tuple__307 = PyTuple_Pack(20, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_loc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_position, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__307)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__307); + __Pyx_GIVEREF(__pyx_tuple__307); + __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(3, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_inner_join, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + __pyx_tuple__309 = PyTuple_Pack(22, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_sort, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_rev, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_loc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_position, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__309)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__309); + __Pyx_GIVEREF(__pyx_tuple__309); + __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(4, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_left_outer_join, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":120 + * + * + * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + __pyx_tuple__311 = PyTuple_Pack(19, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_max_groups, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_count, __pyx_n_s_left_count, __pyx_n_s_right_count, __pyx_n_s_left_sorter, __pyx_n_s_right_sorter, __pyx_n_s_left_indexer, __pyx_n_s_right_indexer, __pyx_n_s_lc, __pyx_n_s_rc, __pyx_n_s_left_pos, __pyx_n_s_right_pos, __pyx_n_s_offset, __pyx_n_s_position); if (unlikely(!__pyx_tuple__311)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__311); + __Pyx_GIVEREF(__pyx_tuple__311); + __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_full_outer_join, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":184 + * + * + * def _get_result_indexer(sorter, indexer): # <<<<<<<<<<<<<< + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + */ + __pyx_tuple__313 = PyTuple_Pack(3, __pyx_n_s_sorter, __pyx_n_s_indexer, __pyx_n_s_res); if (unlikely(!__pyx_tuple__313)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__313); + __Pyx_GIVEREF(__pyx_tuple__313); + __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_get_result_indexer, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":199 + * + * + * def ffill_indexer(ndarray[int64_t] indexer): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indexer) + */ + __pyx_tuple__315 = PyTuple_Pack(6, __pyx_n_s_indexer, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val, __pyx_n_s_last_obs); if (unlikely(!__pyx_tuple__315)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__315); + __Pyx_GIVEREF(__pyx_tuple__315); + __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_ffill_indexer, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/join.pyx":219 + * + * + * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids, # <<<<<<<<<<<<<< + * int64_t max_group): + * cdef: + */ + __pyx_tuple__317 = PyTuple_Pack(9, __pyx_n_s_indexer, __pyx_n_s_group_ids, __pyx_n_s_max_group, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_last_obs, __pyx_n_s_gid, __pyx_n_s_val); if (unlikely(!__pyx_tuple__317)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__317); + __Pyx_GIVEREF(__pyx_tuple__317); + __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_join_pyx, __pyx_n_s_ffill_by_group, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":41 + * import_ufunc() + * + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num # <<<<<<<<<<<<<< + * + * cpdef ensure_platform_int(object arr): + */ + __pyx_tuple__319 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__319)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__319); + __Pyx_GIVEREF(__pyx_tuple__319); + + /* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__320 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__320)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__320); + __Pyx_GIVEREF(__pyx_tuple__320); + __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_float64, 259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__322 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__322)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__322); + __Pyx_GIVEREF(__pyx_tuple__322); + __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_float32, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__324 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__324)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__324); + __Pyx_GIVEREF(__pyx_tuple__324); + __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__324, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_object, 381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__326 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__326)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__326); + __Pyx_GIVEREF(__pyx_tuple__326); + __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_int32, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__328 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__328)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__328); + __Pyx_GIVEREF(__pyx_tuple__328); + __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_int64, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__330 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_next, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__330)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__330); + __Pyx_GIVEREF(__pyx_tuple__330); + __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_bool, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__332 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__332)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__332); + __Pyx_GIVEREF(__pyx_tuple__332); + __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_float64, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__334 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__334)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__334); + __Pyx_GIVEREF(__pyx_tuple__334); + __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_float32, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__336 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__336)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__336); + __Pyx_GIVEREF(__pyx_tuple__336); + __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_object, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__338 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__338)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__338); + __Pyx_GIVEREF(__pyx_tuple__338); + __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_int32, 812, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__340 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__340)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__340); + __Pyx_GIVEREF(__pyx_tuple__340); + __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_int64, 874, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_tuple__342 = PyTuple_Pack(12, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_cur, __pyx_n_s_prev, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__342)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__342); + __Pyx_GIVEREF(__pyx_tuple__342); + __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_bool, 936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__344 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__344)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__344); + __Pyx_GIVEREF(__pyx_tuple__344); + __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_float64, 999, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__346 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__346)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__346); + __Pyx_GIVEREF(__pyx_tuple__346); + __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__346, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_float32, 1032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__348 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__348)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__348); + __Pyx_GIVEREF(__pyx_tuple__348); + __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__348, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_object, 1065, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__350 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__350)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__350); + __Pyx_GIVEREF(__pyx_tuple__350); + __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_int32, 1098, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__352 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__352)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__352); + __Pyx_GIVEREF(__pyx_tuple__352); + __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__352, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_int64, 1131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__354 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__354)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__354); + __Pyx_GIVEREF(__pyx_tuple__354); + __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__354, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_inplace_bool, 1164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__356 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__356)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__356); + __Pyx_GIVEREF(__pyx_tuple__356); + __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_float64, 1198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__358 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__358)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__358); + __Pyx_GIVEREF(__pyx_tuple__358); + __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_float32, 1230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__360 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__360)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__360); + __Pyx_GIVEREF(__pyx_tuple__360); + __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_object, 1262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__362 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__362)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__362); + __Pyx_GIVEREF(__pyx_tuple__362); + __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_int32, 1294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__364 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__364)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__364); + __Pyx_GIVEREF(__pyx_tuple__364); + __pyx_codeobj__365 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__364, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_int64, 1326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__365)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_tuple__366 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_N, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__366)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__366); + __Pyx_GIVEREF(__pyx_tuple__366); + __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__366, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_inplace_bool, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__368 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__368)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__368); + __Pyx_GIVEREF(__pyx_tuple__368); + __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_float64, 1391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__370 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__370)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__370); + __Pyx_GIVEREF(__pyx_tuple__370); + __pyx_codeobj__371 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__370, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_float32, 1425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__371)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__372 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__372)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__372); + __Pyx_GIVEREF(__pyx_tuple__372); + __pyx_codeobj__373 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__372, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_object, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__373)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__374 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__374)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__374); + __Pyx_GIVEREF(__pyx_tuple__374); + __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_int32, 1493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__376 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__376)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__376); + __Pyx_GIVEREF(__pyx_tuple__376); + __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_int64, 1527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__378 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__378)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__378); + __Pyx_GIVEREF(__pyx_tuple__378); + __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_pad_2d_inplace_bool, 1561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__380 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__380)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__380); + __Pyx_GIVEREF(__pyx_tuple__380); + __pyx_codeobj__381 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_float64, 1596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__381)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__382 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__382)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__382); + __Pyx_GIVEREF(__pyx_tuple__382); + __pyx_codeobj__383 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__382, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_float32, 1630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__383)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__384 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__384)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__384); + __Pyx_GIVEREF(__pyx_tuple__384); + __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__384, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_object, 1664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__386 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__386)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__386); + __Pyx_GIVEREF(__pyx_tuple__386); + __pyx_codeobj__387 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__386, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_int32, 1698, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__387)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__388 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__388)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__388); + __Pyx_GIVEREF(__pyx_tuple__388); + __pyx_codeobj__389 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__388, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_int64, 1732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__389)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_tuple__390 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_limit, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_lim, __pyx_n_s_fill_count); if (unlikely(!__pyx_tuple__390)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__390); + __Pyx_GIVEREF(__pyx_tuple__390); + __pyx_codeobj__391 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__390, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_backfill_2d_inplace_bool, 1766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__391)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1801 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float64(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__392 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__392)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__392); + __Pyx_GIVEREF(__pyx_tuple__392); + __pyx_codeobj__393 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__392, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_float64, 1801, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__393)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1828 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float32(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__394 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__394)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__394); + __Pyx_GIVEREF(__pyx_tuple__394); + __pyx_codeobj__395 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__394, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_float32, 1828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__395)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1855 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_object(ndarray[object] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__396 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__396)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__396); + __Pyx_GIVEREF(__pyx_tuple__396); + __pyx_codeobj__397 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__396, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_object, 1855, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__397)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1882 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int32(ndarray[int32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__398 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__398)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__398); + __Pyx_GIVEREF(__pyx_tuple__398); + __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__398, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_int32, 1882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1909 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int64(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__400 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__400)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__400); + __Pyx_GIVEREF(__pyx_tuple__400); + __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__400, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_int64, 1909, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_bool(ndarray[uint8_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_tuple__402 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_prev, __pyx_n_s_cur, __pyx_n_s_is_unique); if (unlikely(!__pyx_tuple__402)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__402); + __Pyx_GIVEREF(__pyx_tuple__402); + __pyx_codeobj__403 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__402, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_is_monotonic_bool, 1936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__403)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1964 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__404 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__404)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__404); + __Pyx_GIVEREF(__pyx_tuple__404); + __pyx_codeobj__405 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__404, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_float64, 1964, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__405)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":1992 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__406 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__406)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__406); + __Pyx_GIVEREF(__pyx_tuple__406); + __pyx_codeobj__407 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__406, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_float32, 1992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__407)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2020 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__408 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__408)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__408); + __Pyx_GIVEREF(__pyx_tuple__408); + __pyx_codeobj__409 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__408, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_object, 2020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__409)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2048 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__410 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__410)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__410); + __Pyx_GIVEREF(__pyx_tuple__410); + __pyx_codeobj__411 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__410, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_int32, 2048, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__411)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2076 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__412 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__412)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__412); + __Pyx_GIVEREF(__pyx_tuple__412); + __pyx_codeobj__413 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__412, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_int64, 2076, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__413)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2104 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_tuple__414 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_length, __pyx_n_s_members, __pyx_n_s_idx, __pyx_n_s_key); if (unlikely(!__pyx_tuple__414)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__414); + __Pyx_GIVEREF(__pyx_tuple__414); + __pyx_codeobj__415 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__414, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_groupby_bool, 2104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__415)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__416 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__416)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__416); + __Pyx_GIVEREF(__pyx_tuple__416); + __pyx_codeobj__417 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__416, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_float64, 2133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__417)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__418 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__418)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__418); + __Pyx_GIVEREF(__pyx_tuple__418); + __pyx_codeobj__419 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__418, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_float32, 2148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__419)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__420 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__420)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__420); + __Pyx_GIVEREF(__pyx_tuple__420); + __pyx_codeobj__421 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__420, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_object, 2163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__421)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2178 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__422 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__422)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__422); + __Pyx_GIVEREF(__pyx_tuple__422); + __pyx_codeobj__423 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__422, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_int32, 2178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__423)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2193 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__424 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__424)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__424); + __Pyx_GIVEREF(__pyx_tuple__424); + __pyx_codeobj__425 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__424, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_int64, 2193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__425)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2208 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_tuple__426 = PyTuple_Pack(6, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_tuple__426)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__426); + __Pyx_GIVEREF(__pyx_tuple__426); + __pyx_codeobj__427 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__426, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_arrmap_bool, 2208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__427)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2223 + * + * @cython.wraparound(False) + * def take_1d_bool_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + */ + __pyx_tuple__428 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__428)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__428); + __Pyx_GIVEREF(__pyx_tuple__428); + __pyx_codeobj__429 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__428, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_bool_bool, 2223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__429)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2242 + * + * @cython.wraparound(False) + * def take_1d_bool_object(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + __pyx_tuple__430 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__430)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__430); + __Pyx_GIVEREF(__pyx_tuple__430); + __pyx_codeobj__431 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__430, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_bool_object, 2242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__431)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2261 + * + * @cython.wraparound(False) + * def take_1d_int8_int8(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + */ + __pyx_tuple__432 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__432)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__432); + __Pyx_GIVEREF(__pyx_tuple__432); + __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int8, 2261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2280 + * + * @cython.wraparound(False) + * def take_1d_int8_int32(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_tuple__434 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__434)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__434); + __Pyx_GIVEREF(__pyx_tuple__434); + __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int32, 2280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2299 + * + * @cython.wraparound(False) + * def take_1d_int8_int64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_tuple__436 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__436)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__436); + __Pyx_GIVEREF(__pyx_tuple__436); + __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__436, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_int64, 2299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2318 + * + * @cython.wraparound(False) + * def take_1d_int8_float64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__438 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__438)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__438); + __Pyx_GIVEREF(__pyx_tuple__438); + __pyx_codeobj__439 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__438, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int8_float64, 2318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__439)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2337 + * + * @cython.wraparound(False) + * def take_1d_int16_int16(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + */ + __pyx_tuple__440 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__440)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__440); + __Pyx_GIVEREF(__pyx_tuple__440); + __pyx_codeobj__441 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__440, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int16, 2337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__441)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2356 + * + * @cython.wraparound(False) + * def take_1d_int16_int32(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_tuple__442 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__442)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__442); + __Pyx_GIVEREF(__pyx_tuple__442); + __pyx_codeobj__443 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__442, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int32, 2356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__443)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2375 + * + * @cython.wraparound(False) + * def take_1d_int16_int64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_tuple__444 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__444)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__444); + __Pyx_GIVEREF(__pyx_tuple__444); + __pyx_codeobj__445 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__444, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_int64, 2375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__445)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2394 + * + * @cython.wraparound(False) + * def take_1d_int16_float64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__446 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__446)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__446); + __Pyx_GIVEREF(__pyx_tuple__446); + __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int16_float64, 2394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2413 + * + * @cython.wraparound(False) + * def take_1d_int32_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_tuple__448 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__448)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__448); + __Pyx_GIVEREF(__pyx_tuple__448); + __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_int32, 2413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2432 + * + * @cython.wraparound(False) + * def take_1d_int32_int64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_tuple__450 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__450)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__450); + __Pyx_GIVEREF(__pyx_tuple__450); + __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__450, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_int64, 2432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2451 + * + * @cython.wraparound(False) + * def take_1d_int32_float64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__452 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__452)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__452); + __Pyx_GIVEREF(__pyx_tuple__452); + __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__452, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int32_float64, 2451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2470 + * + * @cython.wraparound(False) + * def take_1d_int64_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_tuple__454 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__454)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__454); + __Pyx_GIVEREF(__pyx_tuple__454); + __pyx_codeobj__455 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__454, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int64_int64, 2470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__455)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2489 + * + * @cython.wraparound(False) + * def take_1d_int64_float64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__456 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__456)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__456); + __Pyx_GIVEREF(__pyx_tuple__456); + __pyx_codeobj__457 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__456, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_int64_float64, 2489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__457)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2508 + * + * @cython.wraparound(False) + * def take_1d_float32_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + */ + __pyx_tuple__458 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__458)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__458); + __Pyx_GIVEREF(__pyx_tuple__458); + __pyx_codeobj__459 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__458, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float32_float32, 2508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__459)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2527 + * + * @cython.wraparound(False) + * def take_1d_float32_float64(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__460 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__460)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__460); + __Pyx_GIVEREF(__pyx_tuple__460); + __pyx_codeobj__461 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__460, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float32_float64, 2527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__461)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2546 + * + * @cython.wraparound(False) + * def take_1d_float64_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_tuple__462 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__462)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__462); + __Pyx_GIVEREF(__pyx_tuple__462); + __pyx_codeobj__463 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__462, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_float64_float64, 2546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__463)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2565 + * + * @cython.wraparound(False) + * def take_1d_object_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + __pyx_tuple__464 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__464)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__464); + __Pyx_GIVEREF(__pyx_tuple__464); + __pyx_codeobj__465 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__464, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_1d_object_object, 2565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__465)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2586 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + __pyx_tuple__466 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__466)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__466); + __Pyx_GIVEREF(__pyx_tuple__466); + __pyx_codeobj__467 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__466, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_bool_bool, 2586, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__467)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2631 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_tuple__468 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__468)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__468); + __Pyx_GIVEREF(__pyx_tuple__468); + __pyx_codeobj__469 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__468, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_bool_object, 2631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__469)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + __pyx_tuple__470 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__470)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__470); + __Pyx_GIVEREF(__pyx_tuple__470); + __pyx_codeobj__471 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__470, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int8, 2676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__471)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__472 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__472)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__472); + __Pyx_GIVEREF(__pyx_tuple__472); + __pyx_codeobj__473 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__472, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int32, 2721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__473)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2766 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__474 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__474)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__474); + __Pyx_GIVEREF(__pyx_tuple__474); + __pyx_codeobj__475 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__474, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_int64, 2766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__475)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2811 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__476 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__476)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__476); + __Pyx_GIVEREF(__pyx_tuple__476); + __pyx_codeobj__477 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__476, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int8_float64, 2811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__477)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2856 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + __pyx_tuple__478 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__478)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__478); + __Pyx_GIVEREF(__pyx_tuple__478); + __pyx_codeobj__479 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__478, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int16, 2856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__479)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2901 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__480 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__480)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__480); + __Pyx_GIVEREF(__pyx_tuple__480); + __pyx_codeobj__481 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__480, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int32, 2901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__481)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2946 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__482 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__482)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__482); + __Pyx_GIVEREF(__pyx_tuple__482); + __pyx_codeobj__483 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__482, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_int64, 2946, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__483)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":2991 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__484 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__484)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__484); + __Pyx_GIVEREF(__pyx_tuple__484); + __pyx_codeobj__485 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__484, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int16_float64, 2991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__485)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3036 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__486 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__486)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__486); + __Pyx_GIVEREF(__pyx_tuple__486); + __pyx_codeobj__487 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__486, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_int32, 3036, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__487)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3081 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__488 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__488)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__488); + __Pyx_GIVEREF(__pyx_tuple__488); + __pyx_codeobj__489 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__488, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_int64, 3081, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__489)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__490 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__490)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__490); + __Pyx_GIVEREF(__pyx_tuple__490); + __pyx_codeobj__491 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__490, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int32_float64, 3126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__491)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3171 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__492 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__492)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__492); + __Pyx_GIVEREF(__pyx_tuple__492); + __pyx_codeobj__493 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__492, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int64_int64, 3171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__493)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3216 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__494 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__494)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__494); + __Pyx_GIVEREF(__pyx_tuple__494); + __pyx_codeobj__495 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__494, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_int64_float64, 3216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__495)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3261 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + __pyx_tuple__496 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__496)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__496); + __Pyx_GIVEREF(__pyx_tuple__496); + __pyx_codeobj__497 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__496, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float32_float32, 3261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__497)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3306 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__498 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__498)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__498); + __Pyx_GIVEREF(__pyx_tuple__498); + __pyx_codeobj__499 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__498, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float32_float64, 3306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__499)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3351 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__500 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv, __pyx_n_s_v, __pyx_n_s_o); if (unlikely(!__pyx_tuple__500)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__500); + __Pyx_GIVEREF(__pyx_tuple__500); + __pyx_codeobj__501 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__500, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_float64_float64, 3351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__501)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3396 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_tuple__502 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__502)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__502); + __Pyx_GIVEREF(__pyx_tuple__502); + __pyx_codeobj__503 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__502, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis0_object_object, 3396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__503)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3442 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + __pyx_tuple__504 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__504)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__504); + __Pyx_GIVEREF(__pyx_tuple__504); + __pyx_codeobj__505 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__504, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_bool_bool, 3442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__505)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3468 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_tuple__506 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__506)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__506); + __Pyx_GIVEREF(__pyx_tuple__506); + __pyx_codeobj__507 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__506, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_bool_object, 3468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__507)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3494 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + __pyx_tuple__508 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__508)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__508); + __Pyx_GIVEREF(__pyx_tuple__508); + __pyx_codeobj__509 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__508, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int8, 3494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__509)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3520 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__510 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__510)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__510); + __Pyx_GIVEREF(__pyx_tuple__510); + __pyx_codeobj__511 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__510, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int32, 3520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__511)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3546 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__512 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__512)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__512); + __Pyx_GIVEREF(__pyx_tuple__512); + __pyx_codeobj__513 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__512, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_int64, 3546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__513)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__514 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__514)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__514); + __Pyx_GIVEREF(__pyx_tuple__514); + __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int8_float64, 3572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + __pyx_tuple__516 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__516)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__516); + __Pyx_GIVEREF(__pyx_tuple__516); + __pyx_codeobj__517 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__516, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int16, 3598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__517)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3624 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__518 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__518)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__518); + __Pyx_GIVEREF(__pyx_tuple__518); + __pyx_codeobj__519 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__518, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int32, 3624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__519)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3650 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__520 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__520)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__520); + __Pyx_GIVEREF(__pyx_tuple__520); + __pyx_codeobj__521 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__520, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_int64, 3650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__521)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__522 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__522)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__522); + __Pyx_GIVEREF(__pyx_tuple__522); + __pyx_codeobj__523 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int16_float64, 3676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__523)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3702 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_tuple__524 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__524)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__524); + __Pyx_GIVEREF(__pyx_tuple__524); + __pyx_codeobj__525 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__524, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_int32, 3702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__525)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3728 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__526 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__526)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__526); + __Pyx_GIVEREF(__pyx_tuple__526); + __pyx_codeobj__527 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__526, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_int64, 3728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__527)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3754 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__528 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__528)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__528); + __Pyx_GIVEREF(__pyx_tuple__528); + __pyx_codeobj__529 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__528, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int32_float64, 3754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__529)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3780 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_tuple__530 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__530)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__530); + __Pyx_GIVEREF(__pyx_tuple__530); + __pyx_codeobj__531 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__530, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int64_int64, 3780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__531)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3806 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__532 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__532)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__532); + __Pyx_GIVEREF(__pyx_tuple__532); + __pyx_codeobj__533 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__532, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_int64_float64, 3806, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__533)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3832 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + __pyx_tuple__534 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__534)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__534); + __Pyx_GIVEREF(__pyx_tuple__534); + __pyx_codeobj__535 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__534, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float32_float32, 3832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__535)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3858 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__536 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__536)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__536); + __Pyx_GIVEREF(__pyx_tuple__536); + __pyx_codeobj__537 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__536, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float32_float64, 3858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__537)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3884 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_tuple__538 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__538)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__538); + __Pyx_GIVEREF(__pyx_tuple__538); + __pyx_codeobj__539 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__538, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_float64_float64, 3884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__539)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_tuple__540 = PyTuple_Pack(10, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__540)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__540); + __Pyx_GIVEREF(__pyx_tuple__540); + __pyx_codeobj__541 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__540, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_axis1_object_object, 3910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__541)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3937 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[uint8_t, ndim=2] out, + */ + __pyx_tuple__542 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__542)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__542); + __Pyx_GIVEREF(__pyx_tuple__542); + __pyx_codeobj__543 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__542, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_bool_bool, 3937, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__543)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3965 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + __pyx_tuple__544 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__544)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__544); + __Pyx_GIVEREF(__pyx_tuple__544); + __pyx_codeobj__545 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__544, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_bool_object, 3965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__545)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":3993 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int8_t, ndim=2] out, + */ + __pyx_tuple__546 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__546)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__546); + __Pyx_GIVEREF(__pyx_tuple__546); + __pyx_codeobj__547 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__546, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int8, 3993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__547)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4021 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_tuple__548 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__548)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__548); + __Pyx_GIVEREF(__pyx_tuple__548); + __pyx_codeobj__549 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__548, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int32, 4021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__549)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4049 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_tuple__550 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__550)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__550); + __Pyx_GIVEREF(__pyx_tuple__550); + __pyx_codeobj__551 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__550, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_int64, 4049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__551)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4077 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__552 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__552)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__552); + __Pyx_GIVEREF(__pyx_tuple__552); + __pyx_codeobj__553 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__552, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int8_float64, 4077, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__553)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4105 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int16_t, ndim=2] out, + */ + __pyx_tuple__554 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__554)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__554); + __Pyx_GIVEREF(__pyx_tuple__554); + __pyx_codeobj__555 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__554, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int16, 4105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__555)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_tuple__556 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__556)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__556); + __Pyx_GIVEREF(__pyx_tuple__556); + __pyx_codeobj__557 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__556, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int32, 4133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__557)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4161 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_tuple__558 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__558)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__558); + __Pyx_GIVEREF(__pyx_tuple__558); + __pyx_codeobj__559 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__558, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_int64, 4161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__559)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4189 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__560 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__560)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__560); + __Pyx_GIVEREF(__pyx_tuple__560); + __pyx_codeobj__561 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__560, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int16_float64, 4189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__561)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4217 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_tuple__562 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__562)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__562); + __Pyx_GIVEREF(__pyx_tuple__562); + __pyx_codeobj__563 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__562, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_int32, 4217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__563)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4245 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_tuple__564 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__564)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__564); + __Pyx_GIVEREF(__pyx_tuple__564); + __pyx_codeobj__565 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__564, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_int64, 4245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__565)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4273 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__566 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__566)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__566); + __Pyx_GIVEREF(__pyx_tuple__566); + __pyx_codeobj__567 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__566, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int32_float64, 4273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__567)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_tuple__568 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__568)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__568); + __Pyx_GIVEREF(__pyx_tuple__568); + __pyx_codeobj__569 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__568, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int64_int64, 4301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__569)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4329 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__570 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__570)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__570); + __Pyx_GIVEREF(__pyx_tuple__570); + __pyx_codeobj__571 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__570, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_int64_float64, 4329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__571)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4357 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float32_t, ndim=2] out, + */ + __pyx_tuple__572 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__572)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__572); + __Pyx_GIVEREF(__pyx_tuple__572); + __pyx_codeobj__573 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__572, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float32_float32, 4357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__573)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4385 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__574 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__574)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__574); + __Pyx_GIVEREF(__pyx_tuple__574); + __pyx_codeobj__575 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__574, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float32_float64, 4385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__575)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4413 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_tuple__576 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__576)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__576); + __Pyx_GIVEREF(__pyx_tuple__576); + __pyx_codeobj__577 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__576, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_float64_float64, 4413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__577)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4441 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_object_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + __pyx_tuple__578 = PyTuple_Pack(12, __pyx_n_s_values, __pyx_n_s_indexer, __pyx_n_s_out, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_idx, __pyx_n_s_idx0, __pyx_n_s_idx1, __pyx_n_s_fv); if (unlikely(!__pyx_tuple__578)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__578); + __Pyx_GIVEREF(__pyx_tuple__578); + __pyx_codeobj__579 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__578, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_take_2d_multi_object_object, 4441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__579)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4470 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float64(ndarray[float64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__580 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__580)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__580); + __Pyx_GIVEREF(__pyx_tuple__580); + __pyx_codeobj__581 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__580, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_float64, 4470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__581)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4513 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float32(ndarray[float32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__582 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__582)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__582); + __Pyx_GIVEREF(__pyx_tuple__582); + __pyx_codeobj__583 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__582, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_float32, 4513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__583)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4556 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int8(ndarray[int8_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__584 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__584)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__584); + __Pyx_GIVEREF(__pyx_tuple__584); + __pyx_codeobj__585 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__584, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int8, 4556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__585)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4599 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int16(ndarray[int16_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__586 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__586)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__586); + __Pyx_GIVEREF(__pyx_tuple__586); + __pyx_codeobj__587 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__586, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int16, 4599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__587)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4642 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int32(ndarray[int32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__588 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__588)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__588); + __Pyx_GIVEREF(__pyx_tuple__588); + __pyx_codeobj__589 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__588, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int32, 4642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__589)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4685 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int64(ndarray[int64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_tuple__590 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_out, __pyx_n_s_periods, __pyx_n_s_axis, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__590)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__590); + __Pyx_GIVEREF(__pyx_tuple__590); + __pyx_codeobj__591 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__590, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_diff_2d_int64, 4685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__591)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4729 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__592 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__592)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__592); + __Pyx_GIVEREF(__pyx_tuple__592); + __pyx_codeobj__593 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__592, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_float64, 4729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__593)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4772 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__594 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__594)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__594); + __Pyx_GIVEREF(__pyx_tuple__594); + __pyx_codeobj__595 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__594, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_float32, 4772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__595)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4816 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__596 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__596)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__596); + __Pyx_GIVEREF(__pyx_tuple__596); + __pyx_codeobj__597 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__596, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_float64, 4816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__597)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4860 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__598 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__598)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__598); + __Pyx_GIVEREF(__pyx_tuple__598); + __pyx_codeobj__599 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__598, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_last_bin_float32, 4860, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__599)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4905 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__600 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__600)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__600); + __Pyx_GIVEREF(__pyx_tuple__600); + __pyx_codeobj__601 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__600, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_float64, 4905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__601)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4949 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__602 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__602)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__602); + __Pyx_GIVEREF(__pyx_tuple__602); + __pyx_codeobj__603 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__602, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_float32, 4949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__603)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":4994 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__604 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__604)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__604); + __Pyx_GIVEREF(__pyx_tuple__604); + __pyx_codeobj__605 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__604, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_float64, 4994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__605)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5039 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__606 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_rank, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_resx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__606)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__606); + __Pyx_GIVEREF(__pyx_tuple__606); + __pyx_codeobj__607 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__606, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_nth_bin_float32, 5039, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__607)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5085 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__608 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__608)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__608); + __Pyx_GIVEREF(__pyx_tuple__608); + __pyx_codeobj__609 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__608, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_float64, 5085, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__609)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5141 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__610 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__610)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__610); + __Pyx_GIVEREF(__pyx_tuple__610); + __pyx_codeobj__611 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__610, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_float32, 5141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__611)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__612 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_nbins, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__612)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__612); + __Pyx_GIVEREF(__pyx_tuple__612); + __pyx_codeobj__613 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__612, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_bin_float64, 5198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__613)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5254 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__614 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_nbins, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__614)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__614); + __Pyx_GIVEREF(__pyx_tuple__614); + __pyx_codeobj__615 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__614, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_add_bin_float32, 5254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__615)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5311 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__616 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__616)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__616); + __Pyx_GIVEREF(__pyx_tuple__616); + __pyx_codeobj__617 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__616, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_float64, 5311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__617)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5367 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__618 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__618)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__618); + __Pyx_GIVEREF(__pyx_tuple__618); + __pyx_codeobj__619 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__618, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_float32, 5367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__619)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__620 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__620)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__620); + __Pyx_GIVEREF(__pyx_tuple__620); + __pyx_codeobj__621 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__620, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_bin_float64, 5424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__621)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5480 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__622 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_prodx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__622)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__622); + __Pyx_GIVEREF(__pyx_tuple__622); + __pyx_codeobj__623 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__622, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_prod_bin_float32, 5480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__623)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5537 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__624 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__624)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__624); + __Pyx_GIVEREF(__pyx_tuple__624); + __pyx_codeobj__625 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__624, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_float64, 5537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__625)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__626 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__626)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__626); + __Pyx_GIVEREF(__pyx_tuple__626); + __pyx_codeobj__627 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__626, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_float32, 5598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__627)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5660 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__628 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__628)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__628); + __Pyx_GIVEREF(__pyx_tuple__628); + __pyx_codeobj__629 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__628, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_bin_float64, 5660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__629)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__630 = PyTuple_Pack(15, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_ct, __pyx_n_s_nobs, __pyx_n_s_sumx, __pyx_n_s_sumxx); if (unlikely(!__pyx_tuple__630)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__630); + __Pyx_GIVEREF(__pyx_tuple__630); + __pyx_codeobj__631 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__630, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_var_bin_float32, 5721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__631)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5783 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__632 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__632)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__632); + __Pyx_GIVEREF(__pyx_tuple__632); + __pyx_codeobj__633 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__632, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_float64, 5783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__633)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5835 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__634 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__634)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__634); + __Pyx_GIVEREF(__pyx_tuple__634); + __pyx_codeobj__635 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__634, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_float32, 5835, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__635)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5887 + * + * + * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__636 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__636)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__636); + __Pyx_GIVEREF(__pyx_tuple__636); + __pyx_codeobj__637 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__636, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_bin_float64, 5887, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__637)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5940 + * out[i, j] = sumx[i, j] / count + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__638 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_sumx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__638)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__638); + __Pyx_GIVEREF(__pyx_tuple__638); + __pyx_codeobj__639 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__638, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_mean_bin_float32, 5940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__639)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":5995 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__640 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__640)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__640); + __Pyx_GIVEREF(__pyx_tuple__640); + __pyx_codeobj__641 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__640, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_float64, 5995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__641)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6055 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__642 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__642)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__642); + __Pyx_GIVEREF(__pyx_tuple__642); + __pyx_codeobj__643 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__642, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_float32, 6055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__643)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6116 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__644 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__644)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__644); + __Pyx_GIVEREF(__pyx_tuple__644); + __pyx_codeobj__645 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__644, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_float64, 6116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__645)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6177 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__646 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_minx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__646)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__646); + __Pyx_GIVEREF(__pyx_tuple__646); + __pyx_codeobj__647 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__646, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_min_bin_float32, 6177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__647)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6239 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__648 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__648)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__648); + __Pyx_GIVEREF(__pyx_tuple__648); + __pyx_codeobj__649 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__648, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_float64, 6239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__649)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6299 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__650 = PyTuple_Pack(13, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_lab, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__650)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__650); + __Pyx_GIVEREF(__pyx_tuple__650); + __pyx_codeobj__651 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__650, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_float32, 6299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__651)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6360 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__652 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__652)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__652); + __Pyx_GIVEREF(__pyx_tuple__652); + __pyx_codeobj__653 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__652, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_float64, 6360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__653)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6420 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__654 = PyTuple_Pack(14, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_maxx, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__654)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__654); + __Pyx_GIVEREF(__pyx_tuple__654); + __pyx_codeobj__655 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__654, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_max_bin_float32, 6420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__655)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6481 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__656 = PyTuple_Pack(18, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_vopen, __pyx_n_s_vhigh, __pyx_n_s_vlow, __pyx_n_s_vclose, __pyx_n_s_NA, __pyx_n_s_got_first); if (unlikely(!__pyx_tuple__656)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__656); + __Pyx_GIVEREF(__pyx_tuple__656); + __pyx_codeobj__657 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__656, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_ohlc_float64, 6481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__657)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6554 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__658 = PyTuple_Pack(18, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_ngroups, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_count, __pyx_n_s_vopen, __pyx_n_s_vhigh, __pyx_n_s_vlow, __pyx_n_s_vclose, __pyx_n_s_NA, __pyx_n_s_got_first); if (unlikely(!__pyx_tuple__658)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__658); + __Pyx_GIVEREF(__pyx_tuple__658); + __pyx_codeobj__659 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__658, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_ohlc_float32, 6554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__659)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6628 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__660 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__660)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__660); + __Pyx_GIVEREF(__pyx_tuple__660); + __pyx_codeobj__661 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__660, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_float64, 6628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__661)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__662 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__662)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__662); + __Pyx_GIVEREF(__pyx_tuple__662); + __pyx_codeobj__663 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__662, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_float32, 6664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__663)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6700 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__664 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__664)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__664); + __Pyx_GIVEREF(__pyx_tuple__664); + __pyx_codeobj__665 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__664, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_object, 6700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__665)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6736 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + __pyx_tuple__666 = PyTuple_Pack(11, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_lab, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__666)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__666); + __Pyx_GIVEREF(__pyx_tuple__666); + __pyx_codeobj__667 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__666, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_int64, 6736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__667)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6773 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_tuple__668 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__668)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__668); + __Pyx_GIVEREF(__pyx_tuple__668); + __pyx_codeobj__669 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__668, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_float64, 6773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__669)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6807 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_tuple__670 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__670)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__670); + __Pyx_GIVEREF(__pyx_tuple__670); + __pyx_codeobj__671 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__670, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_float32, 6807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__671)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6841 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_tuple__672 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__672)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__672); + __Pyx_GIVEREF(__pyx_tuple__672); + __pyx_codeobj__673 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__672, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_object, 6841, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__673)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6875 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + __pyx_tuple__674 = PyTuple_Pack(12, __pyx_n_s_out, __pyx_n_s_counts, __pyx_n_s_values, __pyx_n_s_bins, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_ngroups, __pyx_n_s_N, __pyx_n_s_K, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_nobs); if (unlikely(!__pyx_tuple__674)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__674); + __Pyx_GIVEREF(__pyx_tuple__674); + __pyx_codeobj__675 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__674, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_group_count_bin_int64, 6875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__675)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + __pyx_tuple__676 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__676)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__676); + __Pyx_GIVEREF(__pyx_tuple__676); + __pyx_codeobj__677 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__676, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_float64, 6910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__677)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":6955 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + __pyx_tuple__678 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__678)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__678); + __Pyx_GIVEREF(__pyx_tuple__678); + __pyx_codeobj__679 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__678, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_float32, 6955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__679)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7000 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + __pyx_tuple__680 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__680)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__680); + __Pyx_GIVEREF(__pyx_tuple__680); + __pyx_codeobj__681 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__680, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_object, 7000, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__681)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7045 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + __pyx_tuple__682 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__682)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__682); + __Pyx_GIVEREF(__pyx_tuple__682); + __pyx_codeobj__683 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__682, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_int32, 7045, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__683)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7090 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + __pyx_tuple__684 = PyTuple_Pack(9, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nleft, __pyx_n_s_nright, __pyx_n_s_indexer, __pyx_n_s_lval, __pyx_n_s_rval); if (unlikely(!__pyx_tuple__684)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__684); + __Pyx_GIVEREF(__pyx_tuple__684); + __pyx_codeobj__685 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__684, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_unique_int64, 7090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__685)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7135 + * + * + * def left_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + __pyx_tuple__686 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__686)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__686); + __Pyx_GIVEREF(__pyx_tuple__686); + __pyx_codeobj__687 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__686, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_float64, 7135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__687)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7237 + * + * + * def left_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + __pyx_tuple__688 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__688)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__688); + __Pyx_GIVEREF(__pyx_tuple__688); + __pyx_codeobj__689 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__688, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_float32, 7237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__689)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7339 + * + * + * def left_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + __pyx_tuple__690 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__690)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__690); + __Pyx_GIVEREF(__pyx_tuple__690); + __pyx_codeobj__691 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__690, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_object, 7339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__691)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7441 + * + * + * def left_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + __pyx_tuple__692 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__692)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__692); + __Pyx_GIVEREF(__pyx_tuple__692); + __pyx_codeobj__693 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__692, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_int32, 7441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__693)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7543 + * + * + * def left_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + __pyx_tuple__694 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__694)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__694); + __Pyx_GIVEREF(__pyx_tuple__694); + __pyx_codeobj__695 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__694, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_left_join_indexer_int64, 7543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__695)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7647 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + __pyx_tuple__696 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__696)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__696); + __Pyx_GIVEREF(__pyx_tuple__696); + __pyx_codeobj__697 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__696, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_float64, 7647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__697)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7776 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + __pyx_tuple__698 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__698)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__698); + __Pyx_GIVEREF(__pyx_tuple__698); + __pyx_codeobj__699 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__698, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_float32, 7776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__699)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":7905 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + __pyx_tuple__700 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__700)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__700); + __Pyx_GIVEREF(__pyx_tuple__700); + __pyx_codeobj__701 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__700, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_object, 7905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__701)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8034 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + __pyx_tuple__702 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__702)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__702); + __Pyx_GIVEREF(__pyx_tuple__702); + __pyx_codeobj__703 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__702, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_int32, 8034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__703)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + __pyx_tuple__704 = PyTuple_Pack(12, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__704)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__704); + __Pyx_GIVEREF(__pyx_tuple__704); + __pyx_codeobj__705 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__704, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_outer_join_indexer_int64, 8163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__705)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8293 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + __pyx_tuple__706 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__706)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__706); + __Pyx_GIVEREF(__pyx_tuple__706); + __pyx_codeobj__707 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__706, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_float64, 8293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__707)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8386 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + __pyx_tuple__708 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__708)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__708); + __Pyx_GIVEREF(__pyx_tuple__708); + __pyx_codeobj__709 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__708, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_float32, 8386, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__709)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8479 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + __pyx_tuple__710 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__710)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__710); + __Pyx_GIVEREF(__pyx_tuple__710); + __pyx_codeobj__711 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__710, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_object, 8479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__711)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + __pyx_tuple__712 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__712)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__712); + __Pyx_GIVEREF(__pyx_tuple__712); + __pyx_codeobj__713 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__712, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_int32, 8572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__713)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/generated.pyx":8665 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + __pyx_tuple__714 = PyTuple_Pack(13, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_nright, __pyx_n_s_nleft, __pyx_n_s_count, __pyx_n_s_lval, __pyx_n_s_rval, __pyx_n_s_lindexer, __pyx_n_s_rindexer, __pyx_n_s_result); if (unlikely(!__pyx_tuple__714)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__714); + __Pyx_GIVEREF(__pyx_tuple__714); + __pyx_codeobj__715 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__714, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_generated_pyx, __pyx_n_s_inner_join_indexer_int64, 8665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__715)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":276 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__716 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__716)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__716); + __Pyx_GIVEREF(__pyx_tuple__716); + + /* "View.MemoryView":277 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__717 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__717)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__717); + __Pyx_GIVEREF(__pyx_tuple__717); + + /* "View.MemoryView":278 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__718 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__718)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__718); + __Pyx_GIVEREF(__pyx_tuple__718); + + /* "View.MemoryView":281 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__719 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__719)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__719); + __Pyx_GIVEREF(__pyx_tuple__719); + + /* "View.MemoryView":282 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__720 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__720)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__720); + __Pyx_GIVEREF(__pyx_tuple__720); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initalgos(void); /*proto*/ +PyMODINIT_FUNC initalgos(void) +#else +PyMODINIT_FUNC PyInit_algos(void); /*proto*/ +PyMODINIT_FUNC PyInit_algos(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_int8_t __pyx_t_4; + __pyx_t_5numpy_int16_t __pyx_t_5; + __pyx_t_5numpy_int32_t __pyx_t_6; + __pyx_t_5numpy_int64_t __pyx_t_7; + __pyx_t_5numpy_float16_t __pyx_t_8; + __pyx_t_5numpy_float32_t __pyx_t_9; + __pyx_t_5numpy_float64_t __pyx_t_10; + double __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_algos(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("algos"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__algos) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.algos")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.algos", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6pandas_5algos_Node) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5algos_Node.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Node", (PyObject *)&__pyx_type_6pandas_5algos_Node) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5algos_Node = &__pyx_type_6pandas_5algos_Node; + __pyx_vtabptr_6pandas_5algos_IndexableSkiplist = &__pyx_vtable_6pandas_5algos_IndexableSkiplist; + __pyx_vtable_6pandas_5algos_IndexableSkiplist.get = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_get; + __pyx_vtable_6pandas_5algos_IndexableSkiplist.insert = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_insert; + __pyx_vtable_6pandas_5algos_IndexableSkiplist.remove = (PyObject *(*)(struct __pyx_obj_6pandas_5algos_IndexableSkiplist *, double, int __pyx_skip_dispatch))__pyx_f_6pandas_5algos_17IndexableSkiplist_remove; + if (PyType_Ready(&__pyx_type_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5algos_IndexableSkiplist.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5algos_IndexableSkiplist.tp_dict, __pyx_vtabptr_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "IndexableSkiplist", (PyObject *)&__pyx_type_6pandas_5algos_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5algos_IndexableSkiplist = &__pyx_type_6pandas_5algos_IndexableSkiplist; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_array.tp_print = 0; + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_MemviewEnum.tp_print = 0; + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/algos.pyx":3 + * from numpy cimport * + * cimport numpy as np + * import numpy as np # <<<<<<<<<<<<<< + * + * cimport cython + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":7 + * cimport cython + * + * import_array() # <<<<<<<<<<<<<< + * + * cdef float64_t FP_ERR = 1e-13 + */ + import_array(); + + /* "pandas/algos.pyx":9 + * import_array() + * + * cdef float64_t FP_ERR = 1e-13 # <<<<<<<<<<<<<< + * cdef float64_t REL_TOL = 1e-07 + * + */ + __pyx_v_6pandas_5algos_FP_ERR = 1e-13; + + /* "pandas/algos.pyx":10 + * + * cdef float64_t FP_ERR = 1e-13 + * cdef float64_t REL_TOL = 1e-07 # <<<<<<<<<<<<<< + * + * cimport util + */ + __pyx_v_6pandas_5algos_REL_TOL = 1e-07; + + /* "pandas/algos.pyx":27 + * uint32_t, uint64_t, float16_t, float32_t, float64_t) + * + * int8 = np.dtype(np.int8) # <<<<<<<<<<<<<< + * int16 = np.dtype(np.int16) + * int32 = np.dtype(np.int32) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_int8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":28 + * + * int8 = np.dtype(np.int8) + * int16 = np.dtype(np.int16) # <<<<<<<<<<<<<< + * int32 = np.dtype(np.int32) + * int64 = np.dtype(np.int64) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_int16, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":29 + * int8 = np.dtype(np.int8) + * int16 = np.dtype(np.int16) + * int32 = np.dtype(np.int32) # <<<<<<<<<<<<<< + * int64 = np.dtype(np.int64) + * float16 = np.dtype(np.float16) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_int32, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":30 + * int16 = np.dtype(np.int16) + * int32 = np.dtype(np.int32) + * int64 = np.dtype(np.int64) # <<<<<<<<<<<<<< + * float16 = np.dtype(np.float16) + * float32 = np.dtype(np.float32) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_int64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":31 + * int32 = np.dtype(np.int32) + * int64 = np.dtype(np.int64) + * float16 = np.dtype(np.float16) # <<<<<<<<<<<<<< + * float32 = np.dtype(np.float32) + * float64 = np.dtype(np.float64) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_float16, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":32 + * int64 = np.dtype(np.int64) + * float16 = np.dtype(np.float16) + * float32 = np.dtype(np.float32) # <<<<<<<<<<<<<< + * float64 = np.dtype(np.float64) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_float32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/algos.pyx":33 + * float16 = np.dtype(np.float16) + * float32 = np.dtype(np.float32) + * float64 = np.dtype(np.float64) # <<<<<<<<<<<<<< + * + * cdef np.int8_t MINint8 = np.iinfo(np.int8).min + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_float64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":35 + * float64 = np.dtype(np.float64) + * + * cdef np.int8_t MINint8 = np.iinfo(np.int8).min # <<<<<<<<<<<<<< + * cdef np.int16_t MINint16 = np.iinfo(np.int16).min + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_int8(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINint8 = __pyx_t_4; + + /* "pandas/algos.pyx":36 + * + * cdef np.int8_t MINint8 = np.iinfo(np.int8).min + * cdef np.int16_t MINint16 = np.iinfo(np.int16).min # <<<<<<<<<<<<<< + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_t_2); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINint16 = __pyx_t_5; + + /* "pandas/algos.pyx":37 + * cdef np.int8_t MINint8 = np.iinfo(np.int8).min + * cdef np.int16_t MINint16 = np.iinfo(np.int16).min + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min # <<<<<<<<<<<<<< + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min + * cdef np.float16_t MINfloat16 = np.NINF + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINint32 = __pyx_t_6; + + /* "pandas/algos.pyx":38 + * cdef np.int16_t MINint16 = np.iinfo(np.int16).min + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min # <<<<<<<<<<<<<< + * cdef np.float16_t MINfloat16 = np.NINF + * cdef np.float32_t MINfloat32 = np.NINF + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINint64 = __pyx_t_7; + + /* "pandas/algos.pyx":39 + * cdef np.int32_t MINint32 = np.iinfo(np.int32).min + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min + * cdef np.float16_t MINfloat16 = np.NINF # <<<<<<<<<<<<<< + * cdef np.float32_t MINfloat32 = np.NINF + * cdef np.float64_t MINfloat64 = np.NINF + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NINF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_8 == (npy_float16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MINfloat16 = __pyx_t_8; + + /* "pandas/algos.pyx":40 + * cdef np.int64_t MINint64 = np.iinfo(np.int64).min + * cdef np.float16_t MINfloat16 = np.NINF + * cdef np.float32_t MINfloat32 = np.NINF # <<<<<<<<<<<<<< + * cdef np.float64_t MINfloat64 = np.NINF + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NINF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_9 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MINfloat32 = __pyx_t_9; + + /* "pandas/algos.pyx":41 + * cdef np.float16_t MINfloat16 = np.NINF + * cdef np.float32_t MINfloat32 = np.NINF + * cdef np.float64_t MINfloat64 = np.NINF # <<<<<<<<<<<<<< + * + * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NINF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MINfloat64 = __pyx_t_10; + + /* "pandas/algos.pyx":43 + * cdef np.float64_t MINfloat64 = np.NINF + * + * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max # <<<<<<<<<<<<<< + * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_int8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXint8 = __pyx_t_4; + + /* "pandas/algos.pyx":44 + * + * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max + * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max # <<<<<<<<<<<<<< + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int16(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXint16 = __pyx_t_5; + + /* "pandas/algos.pyx":45 + * cdef np.int8_t MAXint8 = np.iinfo(np.int8).max + * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max # <<<<<<<<<<<<<< + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max + * cdef np.float16_t MAXfloat16 = np.inf + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXint32 = __pyx_t_6; + + /* "pandas/algos.pyx":46 + * cdef np.int16_t MAXint16 = np.iinfo(np.int16).max + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max # <<<<<<<<<<<<<< + * cdef np.float16_t MAXfloat16 = np.inf + * cdef np.float32_t MAXfloat32 = np.inf + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXint64 = __pyx_t_7; + + /* "pandas/algos.pyx":47 + * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max + * cdef np.float16_t MAXfloat16 = np.inf # <<<<<<<<<<<<<< + * cdef np.float32_t MAXfloat32 = np.inf + * cdef np.float64_t MAXfloat64 = np.inf + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (npy_float16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MAXfloat16 = __pyx_t_8; + + /* "pandas/algos.pyx":48 + * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max + * cdef np.float16_t MAXfloat16 = np.inf + * cdef np.float32_t MAXfloat32 = np.inf # <<<<<<<<<<<<<< + * cdef np.float64_t MAXfloat64 = np.inf + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_9 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_MAXfloat32 = __pyx_t_9; + + /* "pandas/algos.pyx":49 + * cdef np.float16_t MAXfloat16 = np.inf + * cdef np.float32_t MAXfloat32 = np.inf + * cdef np.float64_t MAXfloat64 = np.inf # <<<<<<<<<<<<<< + * + * cdef double NaN = np.NaN + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_5algos_MAXfloat64 = __pyx_t_10; + + /* "pandas/algos.pyx":51 + * cdef np.float64_t MAXfloat64 = np.inf + * + * cdef double NaN = np.NaN # <<<<<<<<<<<<<< + * cdef double nan = NaN + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5algos_NaN = ((double)__pyx_t_11); + + /* "pandas/algos.pyx":52 + * + * cdef double NaN = np.NaN + * cdef double nan = NaN # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6pandas_5algos_nan = __pyx_v_6pandas_5algos_NaN; + + /* "pandas/algos.pyx":64 + * int signbit(double) + * + * from pandas import lib # <<<<<<<<<<<<<< + * + * include "skiplist.pyx" + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_lib); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_lib); + __Pyx_GIVEREF(__pyx_n_s_lib); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":23 + * cimport numpy as np + * from numpy cimport * + * import numpy as np # <<<<<<<<<<<<<< + * + * from random import random + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/skiplist.pyx":25 + * import numpy as np + * + * from random import random # <<<<<<<<<<<<<< + * + * # initialize numpy + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_random); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_random); + __Pyx_GIVEREF(__pyx_n_s_random); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/skiplist.pyx":28 + * + * # initialize numpy + * import_array() # <<<<<<<<<<<<<< + * + * # TODO: optimize this, make less messy + */ + import_array(); + + /* "pandas/src/skiplist.pyx":44 + * + * # Singleton terminator node + * NIL = Node(np.inf, [], []) # <<<<<<<<<<<<<< + * + * cdef class IndexableSkiplist: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5algos_Node)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NIL, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":70 + * + * cdef: + * int TIEBREAK_AVERAGE = 0 # <<<<<<<<<<<<<< + * int TIEBREAK_MIN = 1 + * int TIEBREAK_MAX = 2 + */ + __pyx_v_6pandas_5algos_TIEBREAK_AVERAGE = 0; + + /* "pandas/algos.pyx":71 + * cdef: + * int TIEBREAK_AVERAGE = 0 + * int TIEBREAK_MIN = 1 # <<<<<<<<<<<<<< + * int TIEBREAK_MAX = 2 + * int TIEBREAK_FIRST = 3 + */ + __pyx_v_6pandas_5algos_TIEBREAK_MIN = 1; + + /* "pandas/algos.pyx":72 + * int TIEBREAK_AVERAGE = 0 + * int TIEBREAK_MIN = 1 + * int TIEBREAK_MAX = 2 # <<<<<<<<<<<<<< + * int TIEBREAK_FIRST = 3 + * int TIEBREAK_FIRST_DESCENDING = 4 + */ + __pyx_v_6pandas_5algos_TIEBREAK_MAX = 2; + + /* "pandas/algos.pyx":73 + * int TIEBREAK_MIN = 1 + * int TIEBREAK_MAX = 2 + * int TIEBREAK_FIRST = 3 # <<<<<<<<<<<<<< + * int TIEBREAK_FIRST_DESCENDING = 4 + * int TIEBREAK_DENSE = 5 + */ + __pyx_v_6pandas_5algos_TIEBREAK_FIRST = 3; + + /* "pandas/algos.pyx":74 + * int TIEBREAK_MAX = 2 + * int TIEBREAK_FIRST = 3 + * int TIEBREAK_FIRST_DESCENDING = 4 # <<<<<<<<<<<<<< + * int TIEBREAK_DENSE = 5 + * + */ + __pyx_v_6pandas_5algos_TIEBREAK_FIRST_DESCENDING = 4; + + /* "pandas/algos.pyx":75 + * int TIEBREAK_FIRST = 3 + * int TIEBREAK_FIRST_DESCENDING = 4 + * int TIEBREAK_DENSE = 5 # <<<<<<<<<<<<<< + * + * tiebreakers = { + */ + __pyx_v_6pandas_5algos_TIEBREAK_DENSE = 5; + + /* "pandas/algos.pyx":77 + * int TIEBREAK_DENSE = 5 + * + * tiebreakers = { # <<<<<<<<<<<<<< + * 'average' : TIEBREAK_AVERAGE, + * 'min' : TIEBREAK_MIN, + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/algos.pyx":78 + * + * tiebreakers = { + * 'average' : TIEBREAK_AVERAGE, # <<<<<<<<<<<<<< + * 'min' : TIEBREAK_MIN, + * 'max' : TIEBREAK_MAX, + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_AVERAGE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_average, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":79 + * tiebreakers = { + * 'average' : TIEBREAK_AVERAGE, + * 'min' : TIEBREAK_MIN, # <<<<<<<<<<<<<< + * 'max' : TIEBREAK_MAX, + * 'first' : TIEBREAK_FIRST, + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_MIN); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":80 + * 'average' : TIEBREAK_AVERAGE, + * 'min' : TIEBREAK_MIN, + * 'max' : TIEBREAK_MAX, # <<<<<<<<<<<<<< + * 'first' : TIEBREAK_FIRST, + * 'dense' : TIEBREAK_DENSE, + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_MAX); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_max, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":81 + * 'min' : TIEBREAK_MIN, + * 'max' : TIEBREAK_MAX, + * 'first' : TIEBREAK_FIRST, # <<<<<<<<<<<<<< + * 'dense' : TIEBREAK_DENSE, + * } + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_FIRST); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_first, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":82 + * 'max' : TIEBREAK_MAX, + * 'first' : TIEBREAK_FIRST, + * 'dense' : TIEBREAK_DENSE, # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_6pandas_5algos_TIEBREAK_DENSE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dense, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tiebreakers, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":151 + * return abs_diff > allowed + * + * def rank_1d_float64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_1rank_1d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_float64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":232 + * + * + * def rank_1d_int64(object in_arr, ties_method='average', ascending=True, # <<<<<<<<<<<<<< + * na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_3rank_1d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_int64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":301 + * + * + * def rank_2d_float64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_5rank_2d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_float64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":393 + * + * + * def rank_2d_int64(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_7rank_2d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_int64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":470 + * + * + * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_9rank_1d_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_1d_generic, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":565 + * return left != right + * + * _return_false = lambda self, other: False # <<<<<<<<<<<<<< + * _return_true = lambda self, other: True + * + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5algos_510lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_false, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":566 + * + * _return_false = lambda self, other: False + * _return_true = lambda self, other: True # <<<<<<<<<<<<<< + * + * class Infinity(object): + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5algos_511lambda2, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_true, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":568 + * _return_true = lambda self, other: True + * + * class Infinity(object): # <<<<<<<<<<<<<< + * + * __lt__ = _return_false + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __pyx_t_3, __pyx_n_s_Infinity, __pyx_n_s_Infinity, (PyObject *) NULL, __pyx_n_s_pandas_algos, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/algos.pyx":570 + * class Infinity(object): + * + * __lt__ = _return_false # <<<<<<<<<<<<<< + * __le__ = _return_false + * __eq__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_lt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":571 + * + * __lt__ = _return_false + * __le__ = _return_false # <<<<<<<<<<<<<< + * __eq__ = _return_false + * __ne__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_le, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":572 + * __lt__ = _return_false + * __le__ = _return_false + * __eq__ = _return_false # <<<<<<<<<<<<<< + * __ne__ = _return_true + * __gt__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_eq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":573 + * __le__ = _return_false + * __eq__ = _return_false + * __ne__ = _return_true # <<<<<<<<<<<<<< + * __gt__ = _return_true + * __ge__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ne, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":574 + * __eq__ = _return_false + * __ne__ = _return_true + * __gt__ = _return_true # <<<<<<<<<<<<<< + * __ge__ = _return_true + * __cmp__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_gt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":575 + * __ne__ = _return_true + * __gt__ = _return_true + * __ge__ = _return_true # <<<<<<<<<<<<<< + * __cmp__ = _return_false + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ge, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":576 + * __gt__ = _return_true + * __ge__ = _return_true + * __cmp__ = _return_false # <<<<<<<<<<<<<< + * + * class NegInfinity(object): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_cmp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":568 + * _return_true = lambda self, other: True + * + * class Infinity(object): # <<<<<<<<<<<<<< + * + * __lt__ = _return_false + */ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_Infinity, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Infinity, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":578 + * __cmp__ = _return_false + * + * class NegInfinity(object): # <<<<<<<<<<<<<< + * + * __lt__ = _return_true + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __pyx_t_3, __pyx_n_s_NegInfinity, __pyx_n_s_NegInfinity, (PyObject *) NULL, __pyx_n_s_pandas_algos, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/algos.pyx":580 + * class NegInfinity(object): + * + * __lt__ = _return_true # <<<<<<<<<<<<<< + * __le__ = _return_true + * __eq__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_lt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":581 + * + * __lt__ = _return_true + * __le__ = _return_true # <<<<<<<<<<<<<< + * __eq__ = _return_false + * __ne__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_le, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":582 + * __lt__ = _return_true + * __le__ = _return_true + * __eq__ = _return_false # <<<<<<<<<<<<<< + * __ne__ = _return_true + * __gt__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_eq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":583 + * __le__ = _return_true + * __eq__ = _return_false + * __ne__ = _return_true # <<<<<<<<<<<<<< + * __gt__ = _return_false + * __ge__ = _return_false + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ne, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":584 + * __eq__ = _return_false + * __ne__ = _return_true + * __gt__ = _return_false # <<<<<<<<<<<<<< + * __ge__ = _return_false + * __cmp__ = _return_true + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_gt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":585 + * __ne__ = _return_true + * __gt__ = _return_false + * __ge__ = _return_false # <<<<<<<<<<<<<< + * __cmp__ = _return_true + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ge, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":586 + * __gt__ = _return_false + * __ge__ = _return_false + * __cmp__ = _return_true # <<<<<<<<<<<<<< + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_return_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_cmp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":578 + * __cmp__ = _return_false + * + * class NegInfinity(object): # <<<<<<<<<<<<<< + * + * __lt__ = _return_true + */ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_NegInfinity, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NegInfinity, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":588 + * __cmp__ = _return_true + * + * def rank_2d_generic(object in_arr, axis=0, ties_method='average', # <<<<<<<<<<<<<< + * ascending=True, na_option='keep', pct=False): + * """ + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_11rank_2d_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rank_2d_generic, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":715 + * # - + * + * def _check_minp(win, minp, N): # <<<<<<<<<<<<<< + * if minp > win: + * raise ValueError('min_periods (%d) must be <= window (%d)' + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_13_check_minp, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_minp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/algos.pyx":770 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef numeric kth_smallest(numeric[:] a, Py_ssize_t k): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, l, m, n = a.size + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_6pandas_5algos_513__pyx_fuse_0kth_smallest, 0, __pyx_n_s_pyx_fuse_0kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_6pandas_5algos_515__pyx_fuse_1kth_smallest, 0, __pyx_n_s_pyx_fuse_1kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_6pandas_5algos_517__pyx_fuse_2kth_smallest, 0, __pyx_n_s_pyx_fuse_2kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_6pandas_5algos_519__pyx_fuse_3kth_smallest, 0, __pyx_n_s_pyx_fuse_3kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_6pandas_5algos_521__pyx_fuse_4kth_smallest, 0, __pyx_n_s_pyx_fuse_4kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_6pandas_5algos_523__pyx_fuse_5kth_smallest, 0, __pyx_n_s_pyx_fuse_5kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_6pandas_5algos_525__pyx_fuse_6kth_smallest, 0, __pyx_n_s_pyx_fuse_6kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_6pandas_5algos_527__pyx_fuse_7kth_smallest, 0, __pyx_n_s_pyx_fuse_7kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_6pandas_5algos_529__pyx_fuse_8kth_smallest, 0, __pyx_n_s_pyx_fuse_8kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float32_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_6pandas_5algos_531__pyx_fuse_9kth_smallest, 0, __pyx_n_s_pyx_fuse_9kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_float64_t, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6pandas_5algos_15kth_smallest, 0, __pyx_n_s_kth_smallest, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple); + ((__pyx_FusedFunctionObject *) __pyx_t_12)->__signatures__ = __pyx_t_3; + __Pyx_GIVEREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_kth_smallest, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/algos.pyx":823 + * + * + * cpdef numeric median(numeric[:] arr): # <<<<<<<<<<<<<< + * ''' + * A faster median + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_6pandas_5algos_535__pyx_fuse_0median, 0, __pyx_n_s_pyx_fuse_0median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_6pandas_5algos_537__pyx_fuse_1median, 0, __pyx_n_s_pyx_fuse_1median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_6pandas_5algos_539__pyx_fuse_2median, 0, __pyx_n_s_pyx_fuse_2median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_6pandas_5algos_541__pyx_fuse_3median, 0, __pyx_n_s_pyx_fuse_3median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_6pandas_5algos_543__pyx_fuse_4median, 0, __pyx_n_s_pyx_fuse_4median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_6pandas_5algos_545__pyx_fuse_5median, 0, __pyx_n_s_pyx_fuse_5median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_6pandas_5algos_547__pyx_fuse_6median, 0, __pyx_n_s_pyx_fuse_6median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_6pandas_5algos_549__pyx_fuse_7median, 0, __pyx_n_s_pyx_fuse_7median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_6pandas_5algos_551__pyx_fuse_8median, 0, __pyx_n_s_pyx_fuse_8median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_6pandas_5algos_553__pyx_fuse_9median, 0, __pyx_n_s_pyx_fuse_9median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_6pandas_5algos_17median, 0, __pyx_n_s_median, NULL, __pyx_n_s_pandas_algos, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); + ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_median, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/algos.pyx":843 + * # -------------- Min, Max subsequence + * + * def max_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i=0,s=0,e=0,T,n + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_19max_subseq, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_max_subseq, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":871 + * return (s, e, m) + * + * def min_subseq(ndarray[double_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s, e + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_21min_subseq, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_subseq, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":883 + * # Rolling sum + * + * def roll_sum(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev, sum_x = 0 + * cdef int nobs = 0, i + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_23roll_sum, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_sum, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":925 + * # Rolling mean + * + * def roll_mean(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_25roll_mean, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_mean, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":982 + * # Exponentially weighted moving average + * + * def ewma(ndarray[double_t] input, double_t com, int adjust): # <<<<<<<<<<<<<< + * ''' + * Compute exponentially-weighted moving average using center-of-mass. + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_27ewma, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ewma, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1044 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False, minp=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_29nancorr, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nancorr, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1103 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, xi, yi, N, K + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_31nancorr_spearman, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nancorr_spearman, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1164 + * # Rolling variance + * + * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1): # <<<<<<<<<<<<<< + * """ + * Numerically stable implementation using Welford's method. + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_33roll_var, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_var, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1253 + * # Rolling skewness + * + * def roll_skew(ndarray[double_t] input, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, prev + * cdef double x = 0, xx = 0, xxx = 0 + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_35roll_skew, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_skew, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1317 + * + * + * def roll_kurt(ndarray[double_t] input, # <<<<<<<<<<<<<< + * int win, int minp): + * cdef double val, prev + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_37roll_kurt, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_kurt, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1437 + * from skiplist cimport * + * + * def roll_median_c(ndarray[float64_t] arg, int win, int minp): # <<<<<<<<<<<<<< + * cdef double val, res, prev + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_39roll_median_c, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_median_c, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1492 + * return output + * + * def roll_median_cython(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_41roll_median_cython, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_median_cython, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1528 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_max2(ndarray[float64_t] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_43roll_max2, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_max2, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1608 + * return y + * + * def roll_max(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_45roll_max, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_max, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1621 + * return NaN + * + * def roll_min(ndarray input, int win, int minp): # <<<<<<<<<<<<<< + * ''' + * O(N log(window)) implementation using skip list + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_47roll_min, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_min, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1629 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp): # <<<<<<<<<<<<<< + * "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs." + * cdef np.float64_t ai, aold + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_49roll_min2, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_min2, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1715 + * return NaN + * + * def roll_quantile(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, double quantile): + * ''' + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_51roll_quantile, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_quantile, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1762 + * return output + * + * def roll_generic(ndarray[float64_t, cast=True] input, int win, # <<<<<<<<<<<<<< + * int minp, object func, object args, object kwargs): + * cdef ndarray[double_t] output, counts, bufarr + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_53roll_generic, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_generic, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1806 + * + * + * def roll_window(ndarray[float64_t, ndim=1, cast=True] input, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=1, cast=True] weights, + * int minp, bint avg=True, bint avg_wgt=False): + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_55roll_window, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_roll_window, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1879 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_57is_lexsorted, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_lexsorted, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1912 + * + * @cython.boundscheck(False) + * def groupby_indices(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_59groupby_indices, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_indices, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1949 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_labels(ndarray[object] values): # <<<<<<<<<<<<<< + * ''' + * Compute label vector from input values and associated useful data + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_61group_labels, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_labels, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":1991 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, loc, label, n + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_63groupsort_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupsort_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2022 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_65group_nth_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2066 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_67group_nth_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2114 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_69group_last_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2156 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_last_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_71group_last_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/algos.pyx":2206 + * # median + * + * def group_median(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_73group_median, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_median, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":1 + * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_75inner_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":51 + * _get_result_indexer(right_sorter, right_indexer)) + * + * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups, sort=True): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_77left_outer_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_outer_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":120 + * + * + * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right, # <<<<<<<<<<<<<< + * Py_ssize_t max_groups): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_79full_outer_join, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_full_outer_join, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":184 + * + * + * def _get_result_indexer(sorter, indexer): # <<<<<<<<<<<<<< + * if indexer.dtype != np.int_: + * indexer = indexer.astype(np.int_) + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_81_get_result_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_result_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":199 + * + * + * def ffill_indexer(ndarray[int64_t] indexer): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indexer) + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_83ffill_indexer, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ffill_indexer, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/join.pyx":219 + * + * + * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids, # <<<<<<<<<<<<<< + * int64_t max_group): + * cdef: + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_85ffill_by_group, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ffill_by_group, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":17 + * cimport cpython + * + * import numpy as np # <<<<<<<<<<<<<< + * isnan = np.isnan + * + */ + __pyx_t_13 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":18 + * + * import numpy as np + * isnan = np.isnan # <<<<<<<<<<<<<< + * + * from datetime import datetime as pydatetime + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_isnan); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnan, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "pandas/src/generated.pyx":20 + * isnan = np.isnan + * + * from datetime import datetime as pydatetime # <<<<<<<<<<<<<< + * + * # this is our datetime.pxd + */ + __pyx_t_14 = PyList_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_14, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_13 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_14, -1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_ImportFrom(__pyx_t_13, __pyx_n_s_datetime); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydatetime, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":32 + * from util cimport is_array, _checknull, _checknan, get_nat + * + * cdef int64_t iNaT = get_nat() # <<<<<<<<<<<<<< + * + * # import datetime C API + */ + __pyx_v_6pandas_5algos_iNaT = get_nat(); + + /* "pandas/src/generated.pyx":35 + * + * # import datetime C API + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * # initialize numpy + */ + PyDateTime_IMPORT; + + /* "pandas/src/generated.pyx":38 + * + * # initialize numpy + * import_array() # <<<<<<<<<<<<<< + * import_ufunc() + * + */ + import_array(); + + /* "pandas/src/generated.pyx":39 + * # initialize numpy + * import_array() + * import_ufunc() # <<<<<<<<<<<<<< + * + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num + */ + import_ufunc(); + + /* "pandas/src/generated.pyx":41 + * import_ufunc() + * + * cdef int PLATFORM_INT = ( np.arange(0, dtype=np.int_)).descr.type_num # <<<<<<<<<<<<<< + * + * cpdef ensure_platform_int(object arr): + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_arange); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__319, __pyx_t_13); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_17 = ((PyArrayObject *)__pyx_t_16)->descr->type_num; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_6pandas_5algos_PLATFORM_INT = __pyx_t_17; + + /* "pandas/src/generated.pyx":259 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_115pad_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":320 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_117pad_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":381 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_119pad_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":442 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_121pad_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":503 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_123pad_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":564 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_125pad_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":626 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float64(ndarray[float64_t] old, ndarray[float64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_127backfill_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":688 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_float32(ndarray[float32_t] old, ndarray[float32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_129backfill_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":750 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_object(ndarray[object] old, ndarray[object] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_131backfill_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":812 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int32(ndarray[int32_t] old, ndarray[int32_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_133backfill_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":874 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_int64(ndarray[int64_t] old, ndarray[int64_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_135backfill_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_bool(ndarray[uint8_t] old, ndarray[uint8_t] new, # <<<<<<<<<<<<<< + * limit=None): + * cdef Py_ssize_t i, j, nleft, nright + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_137backfill_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":999 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_139pad_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1032 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_141pad_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1065 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_143pad_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1098 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_145pad_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1131 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_147pad_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1164 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_149pad_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_151backfill_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1230 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_153backfill_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1262 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_155backfill_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1294 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_157backfill_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1326 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_159backfill_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1358 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_inplace_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_161backfill_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1391 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_163pad_2d_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1425 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_165pad_2d_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1459 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_167pad_2d_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1493 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_169pad_2d_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1527 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_171pad_2d_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1561 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def pad_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_173pad_2d_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_2d_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1596 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_175backfill_2d_inplace_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1630 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_177backfill_2d_inplace_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_179backfill_2d_inplace_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1698 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_181backfill_2d_inplace_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1732 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_183backfill_2d_inplace_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1766 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def backfill_2d_inplace_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, ndim=2] mask, + * limit=None): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_185backfill_2d_inplace_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_2d_inplace_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1801 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float64(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_187is_monotonic_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1828 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_float32(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_189is_monotonic_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1855 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_object(ndarray[object] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_191is_monotonic_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1882 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int32(ndarray[int32_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_193is_monotonic_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1909 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_int64(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_195is_monotonic_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1936 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def is_monotonic_bool(ndarray[uint8_t] arr): # <<<<<<<<<<<<<< + * ''' + * Returns + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_197is_monotonic_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_monotonic_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1964 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float64(ndarray[float64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_199groupby_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":1992 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_float32(ndarray[float32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_201groupby_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2020 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_object(ndarray[object] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_203groupby_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2048 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int32(ndarray[int32_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_205groupby_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2076 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_int64(ndarray[int64_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_207groupby_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2104 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def groupby_bool(ndarray[uint8_t] index, ndarray labels): # <<<<<<<<<<<<<< + * cdef dict result = {} + * cdef Py_ssize_t i, length + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_209groupby_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float64(ndarray[float64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_211arrmap_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2148 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_float32(ndarray[float32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_213arrmap_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_object(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_215arrmap_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2178 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int32(ndarray[int32_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_217arrmap_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2193 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_int64(ndarray[int64_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_219arrmap_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2208 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def arrmap_bool(ndarray[uint8_t] index, object func): # <<<<<<<<<<<<<< + * cdef Py_ssize_t length = index.shape[0] + * cdef Py_ssize_t i = 0 + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_221arrmap_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2226 + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__116 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2223 + * + * @cython.wraparound(False) + * def take_1d_bool_bool(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[uint8_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_223take_1d_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_bool_bool, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2245 + * ndarray[int64_t] indexer, + * ndarray[object] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__117 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2242 + * + * @cython.wraparound(False) + * def take_1d_bool_object(ndarray[uint8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_225take_1d_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_bool_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2264 + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__118 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2261 + * + * @cython.wraparound(False) + * def take_1d_int8_int8(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int8_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_227take_1d_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int8, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2283 + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__119 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2280 + * + * @cython.wraparound(False) + * def take_1d_int8_int32(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_229take_1d_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2302 + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__120 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2299 + * + * @cython.wraparound(False) + * def take_1d_int8_int64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_231take_1d_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2321 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__121 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2318 + * + * @cython.wraparound(False) + * def take_1d_int8_float64(ndarray[int8_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_233take_1d_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int8_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2340 + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__122 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2337 + * + * @cython.wraparound(False) + * def take_1d_int16_int16(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int16_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_235take_1d_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int16, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2359 + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__123 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2356 + * + * @cython.wraparound(False) + * def take_1d_int16_int32(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_237take_1d_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2378 + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__124 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2375 + * + * @cython.wraparound(False) + * def take_1d_int16_int64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_239take_1d_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2397 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__125 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2394 + * + * @cython.wraparound(False) + * def take_1d_int16_float64(ndarray[int16_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_241take_1d_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int16_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2416 + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__126 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2413 + * + * @cython.wraparound(False) + * def take_1d_int32_int32(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int32_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_243take_1d_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2435 + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__127 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2432 + * + * @cython.wraparound(False) + * def take_1d_int32_int64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_245take_1d_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2454 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__128 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2451 + * + * @cython.wraparound(False) + * def take_1d_int32_float64(ndarray[int32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_247take_1d_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2473 + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__129 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2470 + * + * @cython.wraparound(False) + * def take_1d_int64_int64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[int64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_249take_1d_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int64_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2492 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__130 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2489 + * + * @cython.wraparound(False) + * def take_1d_int64_float64(ndarray[int64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_251take_1d_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_int64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2511 + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__131 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2508 + * + * @cython.wraparound(False) + * def take_1d_float32_float32(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float32_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_253take_1d_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float32_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2530 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__132 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2527 + * + * @cython.wraparound(False) + * def take_1d_float32_float64(ndarray[float32_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_255take_1d_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2549 + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__133 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2546 + * + * @cython.wraparound(False) + * def take_1d_float64_float64(ndarray[float64_t] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[float64_t] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_257take_1d_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_float64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2568 + * ndarray[int64_t] indexer, + * ndarray[object] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__134 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2565 + * + * @cython.wraparound(False) + * def take_1d_object_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * ndarray[object] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_259take_1d_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_1d_object_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2589 + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__135 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2586 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_261take_2d_axis0_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_bool_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2634 + * ndarray[int64_t] indexer, + * object[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__136 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2631 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_263take_2d_axis0_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_bool_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2679 + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__137 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_265take_2d_axis0_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2724 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__138 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_267take_2d_axis0_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2769 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__139 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2766 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_269take_2d_axis0_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2814 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__140 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2811 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_271take_2d_axis0_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int8_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2859 + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__141 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2856 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_273take_2d_axis0_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2904 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__142 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2901 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_275take_2d_axis0_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2949 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__143 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2946 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_277take_2d_axis0_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":2994 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__144 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":2991 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_279take_2d_axis0_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int16_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3039 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__145 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3036 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_281take_2d_axis0_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3084 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__146 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3081 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_283take_2d_axis0_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3129 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__147 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3126 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_285take_2d_axis0_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3174 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__148 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3171 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_287take_2d_axis0_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int64_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3219 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__149 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3216 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_289take_2d_axis0_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_int64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3264 + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__150 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3261 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_291take_2d_axis0_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float32_float32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3309 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__151 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3306 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_293take_2d_axis0_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3354 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__152 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3351 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_295take_2d_axis0_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_float64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3399 + * ndarray[int64_t] indexer, + * object[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__153 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3396 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis0_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_297take_2d_axis0_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis0_object_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3445 + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__154 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3442 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_bool(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * uint8_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_299take_2d_axis1_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_bool_bool, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3471 + * ndarray[int64_t] indexer, + * object[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__155 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3468 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_bool_object(uint8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_301take_2d_axis1_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_bool_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3497 + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__156 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3494 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int8(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int8_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_303take_2d_axis1_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int8, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3523 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__157 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3520 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int32(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_305take_2d_axis1_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3549 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__158 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3546 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_int64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_307take_2d_axis1_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3575 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__159 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int8_float64(int8_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_309take_2d_axis1_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int8_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3601 + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__160 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int16(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int16_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_311take_2d_axis1_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int16, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3627 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__161 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3624 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int32(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_313take_2d_axis1_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3653 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__162 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3650 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_int64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_315take_2d_axis1_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3679 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__163 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3676 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int16_float64(int16_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_317take_2d_axis1_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int16_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3705 + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__164 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3702 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int32(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int32_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_319take_2d_axis1_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3731 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__165 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3728 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_int64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_321take_2d_axis1_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3757 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__166 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3754 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int32_float64(int32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_323take_2d_axis1_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3783 + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__167 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3780 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_int64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * int64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_325take_2d_axis1_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int64_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3809 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__168 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3806 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_int64_float64(int64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_327take_2d_axis1_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_int64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3835 + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__169 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3832 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float32(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float32_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_329take_2d_axis1_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float32_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3861 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__170 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3858 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float32_float64(float32_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_331take_2d_axis1_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float32_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3887 + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__171 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3884 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_float64_float64(float64_t[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * float64_t[:, :] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_333take_2d_axis1_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_float64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3913 + * ndarray[int64_t] indexer, + * object[:, :] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__172 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_axis1_object_object(object[:, :] values, # <<<<<<<<<<<<<< + * ndarray[int64_t] indexer, + * object[:, :] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_335take_2d_axis1_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_axis1_object_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3940 + * indexer, + * ndarray[uint8_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__173 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3937 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_bool(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[uint8_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_337take_2d_multi_bool_bool, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_bool_bool, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3968 + * indexer, + * ndarray[object, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__174 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3965 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_bool_object(ndarray[uint8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_339take_2d_multi_bool_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_bool_object, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":3996 + * indexer, + * ndarray[int8_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__175 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":3993 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int8(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int8_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_341take_2d_multi_int8_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4024 + * indexer, + * ndarray[int32_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__176 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4021 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int32(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_343take_2d_multi_int8_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4052 + * indexer, + * ndarray[int64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__177 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4049 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_int64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_345take_2d_multi_int8_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4080 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__178 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4077 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int8_float64(ndarray[int8_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_347take_2d_multi_int8_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int8_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4108 + * indexer, + * ndarray[int16_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__179 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4105 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int16(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int16_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_349take_2d_multi_int16_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4136 + * indexer, + * ndarray[int32_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__180 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4133 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int32(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_351take_2d_multi_int16_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4164 + * indexer, + * ndarray[int64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__181 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4161 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_int64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_353take_2d_multi_int16_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4192 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__182 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4189 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int16_float64(ndarray[int16_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_355take_2d_multi_int16_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int16_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4220 + * indexer, + * ndarray[int32_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__183 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4217 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int32(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int32_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_357take_2d_multi_int32_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4248 + * indexer, + * ndarray[int64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__184 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4245 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_int64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_359take_2d_multi_int32_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4276 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__185 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4273 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int32_float64(ndarray[int32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_361take_2d_multi_int32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4304 + * indexer, + * ndarray[int64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__186 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_int64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[int64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_363take_2d_multi_int64_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int64_int64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4332 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__187 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4329 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_int64_float64(ndarray[int64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_365take_2d_multi_int64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_int64_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4360 + * indexer, + * ndarray[float32_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__188 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4357 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float32(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float32_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_367take_2d_multi_float32_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float32_float32, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4388 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__189 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4385 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float32_float64(ndarray[float32_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_369take_2d_multi_float32_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float32_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4416 + * indexer, + * ndarray[float64_t, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_k__190 = __pyx_t_13; + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4413 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_float64_float64(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[float64_t, ndim=2] out, + */ + __pyx_t_13 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_371take_2d_multi_float64_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_float64_float64, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/src/generated.pyx":4444 + * indexer, + * ndarray[object, ndim=2] out, + * fill_value=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n, idx + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_k__191 = __pyx_t_16; + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4441 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def take_2d_multi_object_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * indexer, + * ndarray[object, ndim=2] out, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_373take_2d_multi_object_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_2d_multi_object_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4470 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float64(ndarray[float64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_375diff_2d_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4513 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_float32(ndarray[float32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_377diff_2d_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4556 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int8(ndarray[int8_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_379diff_2d_int8, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int8, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4599 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int16(ndarray[int16_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float32_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_381diff_2d_int16, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int16, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4642 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int32(ndarray[int32_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_383diff_2d_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4685 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def diff_2d_int64(ndarray[int64_t, ndim=2] arr, # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out, + * Py_ssize_t periods, int axis): + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_385diff_2d_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff_2d_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4729 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_387group_last_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4772 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_389group_last_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4816 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_391group_last_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4860 + * @cython.wraparound(False) + * @cython.wraparound(False) + * def group_last_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_393group_last_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_last_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4905 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_395group_nth_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4949 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_397group_nth_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":4994 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_399group_nth_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5039 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_nth_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_401group_nth_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_nth_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5085 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_403group_add_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5141 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_405group_add_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5198 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_407group_add_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5254 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_add_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_409group_add_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_add_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5311 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_411group_prod_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5367 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_413group_prod_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5424 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_415group_prod_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5480 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_prod_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_417group_prod_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_prod_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5537 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_419group_var_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5598 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_421group_var_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5660 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_423group_var_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5721 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_var_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_425group_var_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_var_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5783 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_427group_mean_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5835 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_mean_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_429group_mean_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5887 + * + * + * def group_mean_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_431group_mean_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5940 + * out[i, j] = sumx[i, j] / count + * + * def group_mean_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_433group_mean_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_mean_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":5995 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_435group_min_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6055 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_437group_min_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6116 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_439group_min_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6177 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_min_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_441group_min_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_min_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6239 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_443group_max_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6299 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_445group_max_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6360 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_447group_max_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6420 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_max_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_449group_max_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_max_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6481 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_451group_ohlc_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_ohlc_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6554 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def group_ohlc_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_453group_ohlc_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_ohlc_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6628 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_455group_count_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6664 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_457group_count_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6700 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_459group_count_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6736 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_461group_count_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6773 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_463group_count_bin_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6807 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_float32(ndarray[float32_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[float32_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_465group_count_bin_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6841 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_object(ndarray[object, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[object, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_467group_count_bin_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6875 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def group_count_bin_int64(ndarray[float64_t, ndim=2] out, # <<<<<<<<<<<<<< + * ndarray[int64_t] counts, + * ndarray[int64_t, ndim=2] values, + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_469group_count_bin_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count_bin_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6910 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_471left_join_indexer_unique_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":6955 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_473left_join_indexer_unique_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7000 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_475left_join_indexer_unique_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7045 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_477left_join_indexer_unique_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7090 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def left_join_indexer_unique_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_479left_join_indexer_unique_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_unique_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7135 + * + * + * def left_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_481left_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7237 + * + * + * def left_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_483left_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7339 + * + * + * def left_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_485left_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7441 + * + * + * def left_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_487left_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7543 + * + * + * def left_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_489left_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_left_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7647 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_491outer_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7776 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_493outer_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":7905 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_495outer_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8034 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_497outer_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8163 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def outer_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * cdef: + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_499outer_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_outer_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8293 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float64(ndarray[float64_t] left, # <<<<<<<<<<<<<< + * ndarray[float64_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_501inner_join_indexer_float64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_float64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8386 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_float32(ndarray[float32_t] left, # <<<<<<<<<<<<<< + * ndarray[float32_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_503inner_join_indexer_float32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_float32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8479 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_object(ndarray[object] left, # <<<<<<<<<<<<<< + * ndarray[object] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_505inner_join_indexer_object, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_object, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8572 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int32(ndarray[int32_t] left, # <<<<<<<<<<<<<< + * ndarray[int32_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_507inner_join_indexer_int32, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_int32, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/src/generated.pyx":8665 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def inner_join_indexer_int64(ndarray[int64_t] left, # <<<<<<<<<<<<<< + * ndarray[int64_t] right): + * ''' + */ + __pyx_t_16 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5algos_509inner_join_indexer_int64, NULL, __pyx_n_s_pandas_algos); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inner_join_indexer_int64, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/algos.pyx":1 + * from numpy cimport * # <<<<<<<<<<<<<< + * cimport numpy as np + * import numpy as np + */ + __pyx_t_16 = PyDict_New(); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "View.MemoryView":203 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":276 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__716, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":277 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__717, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":278 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__718, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":281 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__719, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":282 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__720, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "View.MemoryView":496 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":953 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "__pyxutil":2 + * + * cdef extern from *: # <<<<<<<<<<<<<< + * void __pyx_PyErr_Clear "PyErr_Clear" () + * __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(object) + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.algos", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.algos"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (!buf) { + PyErr_SetString(PyExc_ValueError, + "buf is NULL."); + goto fail; + } else if (memviewslice->memview || memviewslice->data) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; + va_start(vargs, fmt); +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; /* allow uninitialized memoryview assignment */ + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) { + __pyx_t_5numpy_int64_t q = a / b; + __pyx_t_5numpy_int64_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { + long r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_ass_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_ass_slice(obj, cstart, cstop, value); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_ass_subscript)) +#endif + { + int result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_ass_subscript(obj, py_slice, value); +#else + result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object does not support slice %.10s", + Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); +bad: + return -1; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + length = strlen(cstring); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyObject * +__pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, + PyObject *qualname, PyObject *self, + PyObject *module, PyObject *globals, + PyObject *code) +{ + __pyx_FusedFunctionObject *fusedfunc = + (__pyx_FusedFunctionObject *) __Pyx_CyFunction_New(type, ml, flags, qualname, + self, module, globals, code); + if (!fusedfunc) + return NULL; + fusedfunc->__signatures__ = NULL; + fusedfunc->type = NULL; + fusedfunc->self = NULL; + return (PyObject *) fusedfunc; +} +static void __pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject *self) { + __pyx_FusedFunction_clear(self); + __pyx_FusedFunctionType->tp_free((PyObject *) self); +} +static int +__pyx_FusedFunction_traverse(__pyx_FusedFunctionObject *self, + visitproc visit, + void *arg) +{ + Py_VISIT(self->self); + Py_VISIT(self->type); + Py_VISIT(self->__signatures__); + return __Pyx_CyFunction_traverse((__pyx_CyFunctionObject *) self, visit, arg); +} +static int +__pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self) +{ + Py_CLEAR(self->self); + Py_CLEAR(self->type); + Py_CLEAR(self->__signatures__); + return __Pyx_CyFunction_clear((__pyx_CyFunctionObject *) self); +} +static PyObject * +__pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type) +{ + __pyx_FusedFunctionObject *func, *meth; + func = (__pyx_FusedFunctionObject *) self; + if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(self); + return self; + } + if (obj == Py_None) + obj = NULL; + meth = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_NewEx( + ((PyCFunctionObject *) func)->m_ml, + ((__pyx_CyFunctionObject *) func)->flags, + ((__pyx_CyFunctionObject *) func)->func_qualname, + ((__pyx_CyFunctionObject *) func)->func_closure, + ((PyCFunctionObject *) func)->m_module, + ((__pyx_CyFunctionObject *) func)->func_globals, + ((__pyx_CyFunctionObject *) func)->func_code); + if (!meth) + return NULL; + Py_XINCREF(func->func.func_classobj); + meth->func.func_classobj = func->func.func_classobj; + Py_XINCREF(func->__signatures__); + meth->__signatures__ = func->__signatures__; + Py_XINCREF(type); + meth->type = type; + Py_XINCREF(func->func.defaults_tuple); + meth->func.defaults_tuple = func->func.defaults_tuple; + if (func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD) + obj = type; + Py_XINCREF(obj); + meth->self = obj; + return (PyObject *) meth; +} +static PyObject * +_obj_to_str(PyObject *obj) +{ + if (PyType_Check(obj)) + return PyObject_GetAttr(obj, __pyx_n_s_name_2); + else + return PyObject_Str(obj); +} +static PyObject * +__pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx) +{ + PyObject *signature = NULL; + PyObject *unbound_result_func; + PyObject *result_func = NULL; + if (self->__signatures__ == NULL) { + PyErr_SetString(PyExc_TypeError, "Function is not fused"); + return NULL; + } + if (PyTuple_Check(idx)) { + PyObject *list = PyList_New(0); + Py_ssize_t n = PyTuple_GET_SIZE(idx); + PyObject *string = NULL; + PyObject *sep = NULL; + int i; + if (!list) + return NULL; + for (i = 0; i < n; i++) { + PyObject *item = PyTuple_GET_ITEM(idx, i); + string = _obj_to_str(item); + if (!string || PyList_Append(list, string) < 0) + goto __pyx_err; + Py_DECREF(string); + } + sep = PyUnicode_FromString("|"); + if (sep) + signature = PyUnicode_Join(sep, list); +__pyx_err: +; + Py_DECREF(list); + Py_XDECREF(sep); + } else { + signature = _obj_to_str(idx); + } + if (!signature) + return NULL; + unbound_result_func = PyObject_GetItem(self->__signatures__, signature); + if (unbound_result_func) { + if (self->self || self->type) { + __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func; + Py_CLEAR(unbound->func.func_classobj); + Py_XINCREF(self->func.func_classobj); + unbound->func.func_classobj = self->func.func_classobj; + result_func = __pyx_FusedFunction_descr_get(unbound_result_func, + self->self, self->type); + } else { + result_func = unbound_result_func; + Py_INCREF(result_func); + } + } + Py_DECREF(signature); + Py_XDECREF(unbound_result_func); + return result_func; +} +static PyObject * +__pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + PyObject *result; + int static_specialized = (cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD && + !((__pyx_FusedFunctionObject *) func)->__signatures__); + if (cyfunc->flags & __Pyx_CYFUNCTION_CCLASS && !static_specialized) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + PyObject *m_self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (!new_args) + return NULL; + self = PyTuple_GetItem(args, 0); + if (!self) + return NULL; + m_self = cyfunc->func.m_self; + cyfunc->func.m_self = self; + result = __Pyx_CyFunction_Call(func, new_args, kw); + cyfunc->func.m_self = m_self; + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +/* Note: the 'self' from method binding is passed in in the args tuple, + whereas PyCFunctionObject's m_self is passed in as the first + argument to the C function. For extension methods we need + to pass 'self' as 'm_self' and not as the first element of the + args tuple. +*/ +static PyObject * +__pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw) +{ + __pyx_FusedFunctionObject *binding_func = (__pyx_FusedFunctionObject *) func; + Py_ssize_t argc = PyTuple_GET_SIZE(args); + PyObject *new_args = NULL; + __pyx_FusedFunctionObject *new_func = NULL; + PyObject *result = NULL; + PyObject *self = NULL; + int is_staticmethod = binding_func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD; + int is_classmethod = binding_func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD; + if (binding_func->self) { + Py_ssize_t i; + new_args = PyTuple_New(argc + 1); + if (!new_args) + return NULL; + self = binding_func->self; + Py_INCREF(self); + PyTuple_SET_ITEM(new_args, 0, self); + for (i = 0; i < argc; i++) { + PyObject *item = PyTuple_GET_ITEM(args, i); + Py_INCREF(item); + PyTuple_SET_ITEM(new_args, i + 1, item); + } + args = new_args; + } else if (binding_func->type) { + if (argc < 1) { + PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given."); + return NULL; + } + self = PyTuple_GET_ITEM(args, 0); + } + if (self && !is_classmethod && !is_staticmethod && + !PyObject_IsInstance(self, binding_func->type)) { + PyErr_Format(PyExc_TypeError, + "First argument should be of type %.200s, got %.200s.", + ((PyTypeObject *) binding_func->type)->tp_name, + self->ob_type->tp_name); + goto __pyx_err; + } + if (binding_func->__signatures__) { + PyObject *tup = PyTuple_Pack(4, binding_func->__signatures__, args, + kw == NULL ? Py_None : kw, + binding_func->func.defaults_tuple); + if (!tup) + goto __pyx_err; + new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL); + Py_DECREF(tup); + if (!new_func) + goto __pyx_err; + Py_XINCREF(binding_func->func.func_classobj); + Py_CLEAR(new_func->func.func_classobj); + new_func->func.func_classobj = binding_func->func.func_classobj; + func = (PyObject *) new_func; + } + result = __pyx_FusedFunction_callfunction(func, args, kw); +__pyx_err: + Py_XDECREF(new_args); + Py_XDECREF((PyObject *) new_func); + return result; +} +static PyMemberDef __pyx_FusedFunction_members[] = { + {(char *) "__signatures__", + T_OBJECT, + offsetof(__pyx_FusedFunctionObject, __signatures__), + READONLY, + __Pyx_DOCSTR(0)}, + {0, 0, 0, 0, 0}, +}; +static PyMappingMethods __pyx_FusedFunction_mapping_methods = { + 0, + (binaryfunc) __pyx_FusedFunction_getitem, + 0, +}; +static PyTypeObject __pyx_FusedFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("fused_cython_function"), /*tp_name*/ + sizeof(__pyx_FusedFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __pyx_FusedFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + &__pyx_FusedFunction_mapping_methods, /*tp_as_mapping*/ + 0, /*tp_hash*/ + (ternaryfunc) __pyx_FusedFunction_call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __pyx_FusedFunction_traverse, /*tp_traverse*/ + (inquiry) __pyx_FusedFunction_clear,/*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + __pyx_FusedFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + &__pyx_CyFunctionType_type, /*tp_base*/ + 0, /*tp_dict*/ + __pyx_FusedFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __pyx_FusedFunction_init(void) { + __pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type); + if (__pyx_FusedFunctionType == NULL) { + return -1; + } + return 0; +} + +static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (buf->strides[dim] != sizeof(void *)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (buf->strides[dim] != buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (stride < buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (spec & (__Pyx_MEMVIEW_PTR)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (buf->suboffsets) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (buf->suboffsets && buf->suboffsets[dim] >= 0) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) + { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (buf->ndim != ndim) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned) buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (!__pyx_check_strides(buf, i, ndim, spec)) + goto fail; + if (!__pyx_check_suboffsets(buf, i, ndim, spec)) + goto fail; + } + if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *x) { + const npy_int8 neg_one = (npy_int8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int8"); + return (npy_int8) -1; + } + return (npy_int8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int8"); + return (npy_int8) -1; + } + if (sizeof(npy_int8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int8) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, long, PyLong_AsLong) + } else if (sizeof(npy_int8) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int8, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int8 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int8) -1; + } + } else { + npy_int8 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int8) -1; + val = __Pyx_PyInt_As_npy_int8(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int16 __Pyx_PyInt_As_npy_int16(PyObject *x) { + const npy_int16 neg_one = (npy_int16) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int16) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int16"); + return (npy_int16) -1; + } + return (npy_int16) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int16)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int16) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int16"); + return (npy_int16) -1; + } + if (sizeof(npy_int16) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int16)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int16) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int16) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int16) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, long, PyLong_AsLong) + } else if (sizeof(npy_int16) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int16, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int16 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int16) -1; + } + } else { + npy_int16 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int16) -1; + val = __Pyx_PyInt_As_npy_int16(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_object(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_object, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(char) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(char) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong) + } else if (sizeof(char) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(char, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) { + const char neg_one = (char) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(char) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(char) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(char) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(char) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(char) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(char), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value) { + const npy_int8 neg_one = (npy_int8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int8) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int8) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int8) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int8) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int8), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int8_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int8(*(__pyx_t_5numpy_int8_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int8_t value = __Pyx_PyInt_As_npy_int8(obj); + if ((value == (npy_int8)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int8_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int16(npy_int16 value) { + const npy_int16 neg_one = (npy_int16) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int16) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int16) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int16) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int16) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int16), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int16_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int16(*(__pyx_t_5numpy_int16_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int16_t value = __Pyx_PyInt_As_npy_int16(obj); + if ((value == (npy_int16)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int16_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int32(*(__pyx_t_5numpy_int32_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int32_t value = __Pyx_PyInt_As_npy_int32(obj); + if ((value == (npy_int32)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int32_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj); + if ((value == (npy_int64)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int64_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint8) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint8) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint8) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint8), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + return (npy_uint8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong) + } else if (sizeof(npy_uint8) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint8 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint8) -1; + } + } else { + npy_uint8 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj); + if ((value == (npy_uint8)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint8_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint16(npy_uint16 value) { + const npy_uint16 neg_one = (npy_uint16) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint16) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint16) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint16) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint16) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint16) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint16), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint16 __Pyx_PyInt_As_npy_uint16(PyObject *x) { + const npy_uint16 neg_one = (npy_uint16) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint16) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint16"); + return (npy_uint16) -1; + } + return (npy_uint16) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint16)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint16) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint16"); + return (npy_uint16) -1; + } + if (sizeof(npy_uint16) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint16) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint16)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint16) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint16) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint16) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, long, PyLong_AsLong) + } else if (sizeof(npy_uint16) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint16, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint16 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint16) -1; + } + } else { + npy_uint16 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint16) -1; + val = __Pyx_PyInt_As_npy_uint16(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint16_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint16(*(__pyx_t_5numpy_uint16_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_uint16_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint16_t value = __Pyx_PyInt_As_npy_uint16(obj); + if ((value == (npy_uint16)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint16_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value) { + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint32), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint32"); + return (npy_uint32) -1; + } + return (npy_uint32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint32"); + return (npy_uint32) -1; + } + if (sizeof(npy_uint32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyLong_AsLong) + } else if (sizeof(npy_uint32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint32) -1; + } + } else { + npy_uint32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint32) -1; + val = __Pyx_PyInt_As_npy_uint32(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint32_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint32(*(__pyx_t_5numpy_uint32_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint32_t value = __Pyx_PyInt_As_npy_uint32(obj); + if ((value == (npy_uint32)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint32_t *) itemp = value; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint64), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) { + const npy_uint64 neg_one = (npy_uint64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; + } + return (npy_uint64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint64"); + return (npy_uint64) -1; + } + if (sizeof(npy_uint64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyLong_AsLong) + } else if (sizeof(npy_uint64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint64) -1; + } + } else { + npy_uint64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint64) -1; + val = __Pyx_PyInt_As_npy_uint64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_uint64(*(__pyx_t_5numpy_uint64_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_uint64_t value = __Pyx_PyInt_As_npy_uint64(obj); + if ((value == (npy_uint64)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_uint64_t *) itemp = value; + return 1; +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float32_t(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float32_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_float32_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_float32_t value = __pyx_PyFloat_AsFloat(obj); + if ((value == (npy_float32)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_float32_t *) itemp = value; + return 1; +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj); + if ((value == (npy_float64)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_float64_t *) itemp = value; + return 1; +} + +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +static PyObject *__pyx_memview_get_object(const char *itemp) { + PyObject *result = *(PyObject **) itemp; + Py_INCREF(result); + return result; +} +static int __pyx_memview_set_object(const char *itemp, PyObject *obj) { + Py_INCREF(obj); + Py_DECREF(*(PyObject **) itemp); + *(PyObject **) itemp = obj; + return 1; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(Py_intptr_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(Py_intptr_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), + little, !is_unsigned); + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs->memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize) + return 0; + itemsize *= mvs->shape[index]; + } + return 1; +} + +static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0) + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/pandas/hashtable.c b/cythonized-files3/pandas/hashtable.c new file mode 100644 index 00000000..d0db3f0f --- /dev/null +++ b/cythonized-files3/pandas/hashtable.c @@ -0,0 +1,25417 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__hashtable +#define __PYX_HAVE_API__pandas__hashtable +#include "string.h" +#include "stdio.h" +#include "pythread.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "khash_python.h" +#include "numpy_helper.h" +#include "datetime.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "hashtable.pyx", + "util.pxd", + "numpy.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_9hashtable_HashTable; +struct __pyx_obj_6pandas_9hashtable_Int64HashTable; +struct __pyx_obj_6pandas_9hashtable_Float64HashTable; +struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable; +struct __pyx_obj_6pandas_9hashtable_ObjectVector; +struct __pyx_obj_6pandas_9hashtable_Int64Vector; +struct __pyx_obj_6pandas_9hashtable_Float64Vector; +struct __pyx_obj_6pandas_9hashtable_StringHashTable; +struct __pyx_obj_6pandas_9hashtable_Int32HashTable; +struct __pyx_obj_6pandas_9hashtable_Factorizer; +struct __pyx_obj_6pandas_9hashtable_Int64Factorizer; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "pandas/hashtable.pxd":5 + * # prototypes for sharing + * + * cdef class HashTable: # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6pandas_9hashtable_HashTable { + PyObject_HEAD +}; + + +/* "pandas/hashtable.pxd":8 + * pass + * + * cdef class Int64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int64_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Int64HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *__pyx_vtab; + kh_int64_t *table; +}; + + +/* "pandas/hashtable.pxd":14 + * cpdef set_item(self, int64_t key, Py_ssize_t val) + * + * cdef class Float64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_float64_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Float64HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *__pyx_vtab; + kh_float64_t *table; +}; + + +/* "pandas/hashtable.pxd":20 + * cpdef set_item(self, float64_t key, Py_ssize_t val) + * + * cdef class PyObjectHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_pymap_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *__pyx_vtab; + kh_pymap_t *table; +}; + + +/* "pandas/hashtable.pyx":51 + * cdef size_t _INIT_VEC_CAP = 32 + * + * cdef class ObjectVector: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_obj_6pandas_9hashtable_ObjectVector { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_9hashtable_ObjectVector *__pyx_vtab; + size_t n; + size_t m; + PyArrayObject *ao; + PyObject **data; +}; + + +/* "pandas/hashtable.pyx":83 + * + * + * cdef class Int64Vector: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_obj_6pandas_9hashtable_Int64Vector { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_9hashtable_Int64Vector *__pyx_vtab; + size_t n; + size_t m; + PyArrayObject *ao; + __pyx_t_5numpy_int64_t *data; +}; + + +/* "pandas/hashtable.pyx":113 + * self.n += 1 + * + * cdef class Float64Vector: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_obj_6pandas_9hashtable_Float64Vector { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_9hashtable_Float64Vector *__pyx_vtab; + size_t n; + size_t m; + PyArrayObject *ao; + __pyx_t_5numpy_float64_t *data; +}; + + +/* "pandas/hashtable.pyx":148 + * + * + * cdef class StringHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_str_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_StringHashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable *__pyx_vtab; + kh_str_t *table; +}; + + +/* "pandas/hashtable.pyx":263 + * return reverse, labels + * + * cdef class Int32HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int32_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Int32HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable *__pyx_vtab; + kh_int32_t *table; +}; + + +/* "pandas/hashtable.pyx":846 + * + * + * cdef class Factorizer: # <<<<<<<<<<<<<< + * cdef public PyObjectHashTable table + * cdef public ObjectVector uniques + */ +struct __pyx_obj_6pandas_9hashtable_Factorizer { + PyObject_HEAD + struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *table; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *uniques; + Py_ssize_t count; +}; + + +/* "pandas/hashtable.pyx":885 + * + * + * cdef class Int64Factorizer: # <<<<<<<<<<<<<< + * cdef public Int64HashTable table + * cdef public Int64Vector uniques + */ +struct __pyx_obj_6pandas_9hashtable_Int64Factorizer { + PyObject_HEAD + struct __pyx_obj_6pandas_9hashtable_Int64HashTable *table; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *uniques; + Py_ssize_t count; +}; + + + +/* "pandas/hashtable.pyx":362 + * return reverse, labels + * + * cdef class Int64HashTable: #(HashTable): # <<<<<<<<<<<<<< + * # cdef kh_int64_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *__pyx_vtabptr_6pandas_9hashtable_Int64HashTable; + + +/* "pandas/hashtable.pyx":540 + * + * + * cdef class Float64HashTable(HashTable): # <<<<<<<<<<<<<< + * def __cinit__(self, size_hint=1): + * self.table = kh_init_float64() + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *__pyx_vtabptr_6pandas_9hashtable_Float64HashTable; + + +/* "pandas/hashtable.pyx":670 + * na_sentinel = object + * + * cdef class PyObjectHashTable(HashTable): # <<<<<<<<<<<<<< + * # cdef kh_pymap_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *__pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable; + + +/* "pandas/hashtable.pyx":51 + * cdef size_t _INIT_VEC_CAP = 32 + * + * cdef class ObjectVector: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_ObjectVector { + PyObject *(*append)(struct __pyx_obj_6pandas_9hashtable_ObjectVector *, PyObject *); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_ObjectVector *__pyx_vtabptr_6pandas_9hashtable_ObjectVector; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_12ObjectVector_append(struct __pyx_obj_6pandas_9hashtable_ObjectVector *, PyObject *); + + +/* "pandas/hashtable.pyx":83 + * + * + * cdef class Int64Vector: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Int64Vector { + PyObject *(*append)(struct __pyx_obj_6pandas_9hashtable_Int64Vector *, __pyx_t_5numpy_int64_t); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64Vector *__pyx_vtabptr_6pandas_9hashtable_Int64Vector; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_11Int64Vector_append(struct __pyx_obj_6pandas_9hashtable_Int64Vector *, __pyx_t_5numpy_int64_t); + + +/* "pandas/hashtable.pyx":113 + * self.n += 1 + * + * cdef class Float64Vector: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Float64Vector { + PyObject *(*append)(struct __pyx_obj_6pandas_9hashtable_Float64Vector *, __pyx_t_5numpy_float64_t); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64Vector *__pyx_vtabptr_6pandas_9hashtable_Float64Vector; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_13Float64Vector_append(struct __pyx_obj_6pandas_9hashtable_Float64Vector *, __pyx_t_5numpy_float64_t); + + +/* "pandas/hashtable.pyx":148 + * + * + * cdef class StringHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_str_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable { + int (*check_type)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *); + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable *__pyx_vtabptr_6pandas_9hashtable_StringHashTable; +static CYTHON_INLINE int __pyx_f_6pandas_9hashtable_15StringHashTable_check_type(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *); + + +/* "pandas/hashtable.pyx":263 + * return reverse, labels + * + * cdef class Int32HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int32_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable { + int (*check_type)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, PyObject *); + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, __pyx_t_5numpy_int32_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, __pyx_t_5numpy_int32_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable *__pyx_vtabptr_6pandas_9hashtable_Int32HashTable; +static CYTHON_INLINE int __pyx_f_6pandas_9hashtable_14Int32HashTable_check_type(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, PyObject *); +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*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); /*proto*/ + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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 CYTHON_INLINE 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); + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* 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); + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'util' */ +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'pandas.hashtable' */ +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int64HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Float64HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_PyObjectHashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_ObjectVector = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int64Vector = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Float64Vector = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_StringHashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int32HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Factorizer = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int64Factorizer = 0; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_9hashtable_iNaT; +static size_t __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; +static PyObject *__pyx_f_6pandas_9hashtable_build_count_table_int64(PyArrayObject *, kh_int64_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_value_count_int64(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_build_count_table_object(PyArrayObject *, PyArrayObject *, kh_pymap_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_value_count_object(PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +#define __Pyx_MODULE_NAME "pandas.hashtable" +int __pyx_module_is_main_pandas__hashtable = 0; + +/* Implementation of 'pandas.hashtable' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_pf_6pandas_9hashtable_list_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static int __pyx_pf_6pandas_9hashtable_12ObjectVector___cinit__(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_12ObjectVector_2__len__(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_12ObjectVector_4to_array(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_11Int64Vector___cinit__(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_11Int64Vector_2__len__(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_11Int64Vector_4to_array(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_13Float64Vector___cinit__(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_13Float64Vector_2__len__(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_13Float64Vector_4to_array(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15StringHashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, int __pyx_v_size_hint); /* proto */ +static void __pyx_pf_6pandas_9hashtable_15StringHashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_4get_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_6get_iter_test(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_iterations); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_8set_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_10get_indexer(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_12unique(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_14factorize(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_6pandas_9hashtable_14Int32HashTable___init__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static int __pyx_pf_6pandas_9hashtable_14Int32HashTable_2__cinit__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self); /* proto */ +static void __pyx_pf_6pandas_9hashtable_14Int32HashTable_4__dealloc__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_6get_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_8get_iter_test(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_iterations); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_10set_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_12map_locations(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_14lookup(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_16factorize(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_6pandas_9hashtable_14Int64HashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static void __pyx_pf_6pandas_9hashtable_14Int64HashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_14Int64HashTable_4__contains__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_14Int64HashTable_6__len__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_8get_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_10get_iter_test(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_iterations); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_12set_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_14map(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_keys, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_20factorize(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_22get_labels(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, CYTHON_UNUSED Py_ssize_t __pyx_v_na_sentinel); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_24get_labels_groupby(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_26unique(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_6pandas_9hashtable_16Float64HashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_16Float64HashTable_2__len__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_4get_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_6set_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static void __pyx_pf_6pandas_9hashtable_16Float64HashTable_8__dealloc__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_16Float64HashTable_10__contains__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_12factorize(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_14get_labels(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_20unique(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_6pandas_9hashtable_17PyObjectHashTable___init__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static void __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_4__len__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_6__contains__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_8destroy(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_10get_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_12get_iter_test(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_iterations); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_14set_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_20lookup2(CYTHON_UNUSED struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_22unique(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_24get_labels(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer___init__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_2get_count(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_4factorize(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_sort, PyObject *__pyx_v_na_sentinel); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_6unique(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_5table___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5table_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5table_4__del__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_7uniques___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_4__del__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_5count___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5count_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer___init__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_size_hint); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_2get_count(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_4factorize(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_sort, PyObject *__pyx_v_na_sentinel); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_4__del__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_4__del__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_2value_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_4value_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_6mode_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_9hashtable_8mode_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_9hashtable_HashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64HashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Float64HashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_PyObjectHashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_ObjectVector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64Vector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Float64Vector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_StringHashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int32HashTable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Factorizer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64Factorizer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_int[] = "int_"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_put[] = "put"; +static char __pyx_k_ret[] = "ret"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_ONAN[] = "ONAN"; +static char __pyx_k_clip[] = "clip"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mask[] = "mask"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_sort[] = "sort"; +static char __pyx_k_take[] = "take"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_count[] = "count"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_modes[] = "modes"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_table[] = "table"; +static char __pyx_k_zeros[] = "zeros"; +static char __pyx_k_arange[] = "arange"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_resize[] = "resize"; +static char __pyx_k_unique[] = "unique"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_argsort[] = "argsort"; +static char __pyx_k_destroy[] = "destroy"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_max_val[] = "max_val"; +static char __pyx_k_uniques[] = "uniques"; +static char __pyx_k_KeyError[] = "KeyError"; +static char __pyx_k_get_item[] = "get_item"; +static char __pyx_k_object_2[] = "object_"; +static char __pyx_k_set_item[] = "set_item"; +static char __pyx_k_to_array[] = "to_array"; +static char __pyx_k_max_count[] = "max_count"; +static char __pyx_k_size_hint[] = "size_hint"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_get_labels[] = "get_labels"; +static char __pyx_k_iterations[] = "iterations"; +static char __pyx_k_mode_int64[] = "mode_int64"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_count_prior[] = "count_prior"; +static char __pyx_k_mode_object[] = "mode_object"; +static char __pyx_k_na_sentinel[] = "na_sentinel"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_pandas_hashtable[] = "pandas.hashtable"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_list_to_object_array[] = "list_to_object_array"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_Factorizer_factorize_line_859[] = "Factorizer.factorize (line 859)"; +static char __pyx_k_Factorize_values_with_nans_repl[] = "\n Factorize values with nans replaced by na_sentinel\n >>> factorize(np.array([1,2,np.nan], dtype='O'), na_sentinel=20)\n array([ 0, 1, 20])\n "; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/hashtable.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_kp_u_Factorize_values_with_nans_repl; +static PyObject *__pyx_kp_u_Factorizer_factorize_line_859; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_ONAN; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_arange; +static PyObject *__pyx_n_s_argsort; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_clip; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_count_prior; +static PyObject *__pyx_n_s_destroy; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_get_item; +static PyObject *__pyx_n_s_get_labels; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_int; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_iterations; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_list_to_object_array; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mask; +static PyObject *__pyx_n_s_max_count; +static PyObject *__pyx_n_s_max_val; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_mode_int64; +static PyObject *__pyx_n_s_mode_object; +static PyObject *__pyx_n_s_modes; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_na_sentinel; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_object_2; +static PyObject *__pyx_n_s_pandas_hashtable; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_resize; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_set_item; +static PyObject *__pyx_n_s_size_hint; +static PyObject *__pyx_n_s_sort; +static PyObject *__pyx_n_s_table; +static PyObject *__pyx_n_s_take; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_to_array; +static PyObject *__pyx_n_s_unique; +static PyObject *__pyx_n_s_uniques; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; + +/* "pandas/hashtable.pyx":31 + * + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_1list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6pandas_9hashtable_list_to_object_array[] = "\n Convert list to object ndarray. Seriously can't believe I had to write this\n function\n "; +static PyMethodDef __pyx_mdef_6pandas_9hashtable_1list_to_object_array = {__Pyx_NAMESTR("list_to_object_array"), (PyCFunction)__pyx_pw_6pandas_9hashtable_1list_to_object_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_9hashtable_list_to_object_array)}; +static PyObject *__pyx_pw_6pandas_9hashtable_1list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_to_object_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_list_to_object_array(__pyx_self, ((PyObject*)__pyx_v_obj)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_list_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_arr = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject **__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_to_object_array", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + + /* "pandas/hashtable.pyx":40 + * ndarray[object] arr + * + * n = len(obj) # <<<<<<<<<<<<<< + * arr = np.empty(n, dtype=object) + * + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":41 + * + * n = len(obj) + * arr = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_arr = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":43 + * arr = np.empty(n, dtype=object) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * arr[i] = obj[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/hashtable.pyx":44 + * + * for i from 0 <= i < n: + * arr[i] = obj[i] # <<<<<<<<<<<<<< + * + * return arr + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_12); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_12); + *__pyx_t_12 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/hashtable.pyx":46 + * arr[i] = obj[i] + * + * return arr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":31 + * + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.list_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":58 + * PyObject **data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_12ObjectVector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_12ObjectVector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_9hashtable_12ObjectVector___cinit__(((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_12ObjectVector___cinit__(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":59 + * + * def __cinit__(self): + * self.n = 0 # <<<<<<<<<<<<<< + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=object) + */ + __pyx_v_self->n = 0; + + /* "pandas/hashtable.pyx":60 + * def __cinit__(self): + * self.n = 0 + * self.m = _INIT_VEC_CAP # <<<<<<<<<<<<<< + * self.ao = np.empty(_INIT_VEC_CAP, dtype=object) + * self.data = self.ao.data + */ + __pyx_v_self->m = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + + /* "pandas/hashtable.pyx":61 + * self.n = 0 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=object) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_6pandas_9hashtable__INIT_VEC_CAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->ao); + __Pyx_DECREF(((PyObject *)__pyx_v_self->ao)); + __pyx_v_self->ao = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/hashtable.pyx":62 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=object) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_v_self->data = ((PyObject **)__pyx_v_self->ao->data); + + /* "pandas/hashtable.pyx":58 + * PyObject **data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.hashtable.ObjectVector.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":64 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_12ObjectVector_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_12ObjectVector_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_12ObjectVector_2__len__(((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_12ObjectVector_2__len__(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":65 + * + * def __len__(self): + * return self.n # <<<<<<<<<<<<<< + * + * def to_array(self): + */ + __pyx_r = __pyx_v_self->n; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":64 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":67 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_12ObjectVector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_12ObjectVector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_12ObjectVector_4to_array(((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_12ObjectVector_4to_array(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_array", 0); + + /* "pandas/hashtable.pyx":68 + * + * def to_array(self): + * self.ao.resize(self.n) # <<<<<<<<<<<<<< + * self.m = self.n + * return self.ao + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":69 + * def to_array(self): + * self.ao.resize(self.n) + * self.m = self.n # <<<<<<<<<<<<<< + * return self.ao + * + */ + __pyx_t_4 = __pyx_v_self->n; + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":70 + * self.ao.resize(self.n) + * self.m = self.n + * return self.ao # <<<<<<<<<<<<<< + * + * cdef inline append(self, object o): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->ao)); + __pyx_r = ((PyObject *)__pyx_v_self->ao); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":67 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.ObjectVector.to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":72 + * return self.ao + * + * cdef inline append(self, object o): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_12ObjectVector_append(struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "pandas/hashtable.pyx":73 + * + * cdef inline append(self, object o): + * if self.n == self.m: # <<<<<<<<<<<<<< + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + */ + __pyx_t_1 = ((__pyx_v_self->n == __pyx_v_self->m) != 0); + if (__pyx_t_1) { + + /* "pandas/hashtable.pyx":74 + * cdef inline append(self, object o): + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) # <<<<<<<<<<<<<< + * self.ao.resize(self.m) + * self.data = self.ao.data + */ + __pyx_t_2 = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + __pyx_t_3 = (__pyx_v_self->m * 2); + if (((__pyx_t_2 > __pyx_t_3) != 0)) { + __pyx_t_4 = __pyx_t_2; + } else { + __pyx_t_4 = __pyx_t_3; + } + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":75 + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_self->m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":76 + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * Py_INCREF(o) + */ + __pyx_v_self->data = ((PyObject **)__pyx_v_self->ao->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":78 + * self.data = self.ao.data + * + * Py_INCREF(o) # <<<<<<<<<<<<<< + * self.data[self.n] = o + * self.n += 1 + */ + Py_INCREF(__pyx_v_o); + + /* "pandas/hashtable.pyx":79 + * + * Py_INCREF(o) + * self.data[self.n] = o # <<<<<<<<<<<<<< + * self.n += 1 + * + */ + (__pyx_v_self->data[__pyx_v_self->n]) = ((PyObject *)__pyx_v_o); + + /* "pandas/hashtable.pyx":80 + * Py_INCREF(o) + * self.data[self.n] = o + * self.n += 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->n = (__pyx_v_self->n + 1); + + /* "pandas/hashtable.pyx":72 + * return self.ao + * + * cdef inline append(self, object o): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.hashtable.ObjectVector.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":90 + * int64_t *data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_11Int64Vector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_11Int64Vector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_9hashtable_11Int64Vector___cinit__(((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_11Int64Vector___cinit__(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":91 + * + * def __cinit__(self): + * self.n = 0 # <<<<<<<<<<<<<< + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.int64) + */ + __pyx_v_self->n = 0; + + /* "pandas/hashtable.pyx":92 + * def __cinit__(self): + * self.n = 0 + * self.m = _INIT_VEC_CAP # <<<<<<<<<<<<<< + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.int64) + * self.data = self.ao.data + */ + __pyx_v_self->m = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + + /* "pandas/hashtable.pyx":93 + * self.n = 0 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.int64) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_6pandas_9hashtable__INIT_VEC_CAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->ao); + __Pyx_DECREF(((PyObject *)__pyx_v_self->ao)); + __pyx_v_self->ao = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":94 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.int64) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_v_self->data = ((__pyx_t_5numpy_int64_t *)__pyx_v_self->ao->data); + + /* "pandas/hashtable.pyx":90 + * int64_t *data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.hashtable.Int64Vector.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":96 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_11Int64Vector_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_11Int64Vector_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_11Int64Vector_2__len__(((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_11Int64Vector_2__len__(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":97 + * + * def __len__(self): + * return self.n # <<<<<<<<<<<<<< + * + * def to_array(self): + */ + __pyx_r = __pyx_v_self->n; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":96 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":99 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_11Int64Vector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_11Int64Vector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_11Int64Vector_4to_array(((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_11Int64Vector_4to_array(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_array", 0); + + /* "pandas/hashtable.pyx":100 + * + * def to_array(self): + * self.ao.resize(self.n) # <<<<<<<<<<<<<< + * self.m = self.n + * return self.ao + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":101 + * def to_array(self): + * self.ao.resize(self.n) + * self.m = self.n # <<<<<<<<<<<<<< + * return self.ao + * + */ + __pyx_t_4 = __pyx_v_self->n; + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":102 + * self.ao.resize(self.n) + * self.m = self.n + * return self.ao # <<<<<<<<<<<<<< + * + * cdef inline append(self, int64_t x): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->ao)); + __pyx_r = ((PyObject *)__pyx_v_self->ao); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":99 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Int64Vector.to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":104 + * return self.ao + * + * cdef inline append(self, int64_t x): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_11Int64Vector_append(struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "pandas/hashtable.pyx":105 + * + * cdef inline append(self, int64_t x): + * if self.n == self.m: # <<<<<<<<<<<<<< + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + */ + __pyx_t_1 = ((__pyx_v_self->n == __pyx_v_self->m) != 0); + if (__pyx_t_1) { + + /* "pandas/hashtable.pyx":106 + * cdef inline append(self, int64_t x): + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) # <<<<<<<<<<<<<< + * self.ao.resize(self.m) + * self.data = self.ao.data + */ + __pyx_t_2 = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + __pyx_t_3 = (__pyx_v_self->m * 2); + if (((__pyx_t_2 > __pyx_t_3) != 0)) { + __pyx_t_4 = __pyx_t_2; + } else { + __pyx_t_4 = __pyx_t_3; + } + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":107 + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_self->m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":108 + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * self.data[self.n] = x + */ + __pyx_v_self->data = ((__pyx_t_5numpy_int64_t *)__pyx_v_self->ao->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":110 + * self.data = self.ao.data + * + * self.data[self.n] = x # <<<<<<<<<<<<<< + * self.n += 1 + * + */ + (__pyx_v_self->data[__pyx_v_self->n]) = __pyx_v_x; + + /* "pandas/hashtable.pyx":111 + * + * self.data[self.n] = x + * self.n += 1 # <<<<<<<<<<<<<< + * + * cdef class Float64Vector: + */ + __pyx_v_self->n = (__pyx_v_self->n + 1); + + /* "pandas/hashtable.pyx":104 + * return self.ao + * + * cdef inline append(self, int64_t x): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.hashtable.Int64Vector.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":120 + * float64_t *data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_13Float64Vector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_13Float64Vector_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_9hashtable_13Float64Vector___cinit__(((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_13Float64Vector___cinit__(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":121 + * + * def __cinit__(self): + * self.n = 0 # <<<<<<<<<<<<<< + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.float64) + */ + __pyx_v_self->n = 0; + + /* "pandas/hashtable.pyx":122 + * def __cinit__(self): + * self.n = 0 + * self.m = _INIT_VEC_CAP # <<<<<<<<<<<<<< + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.float64) + * self.data = self.ao.data + */ + __pyx_v_self->m = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + + /* "pandas/hashtable.pyx":123 + * self.n = 0 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.float64) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_6pandas_9hashtable__INIT_VEC_CAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->ao); + __Pyx_DECREF(((PyObject *)__pyx_v_self->ao)); + __pyx_v_self->ao = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":124 + * self.m = _INIT_VEC_CAP + * self.ao = np.empty(_INIT_VEC_CAP, dtype=np.float64) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_v_self->data = ((__pyx_t_5numpy_float64_t *)__pyx_v_self->ao->data); + + /* "pandas/hashtable.pyx":120 + * float64_t *data + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.n = 0 + * self.m = _INIT_VEC_CAP + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.hashtable.Float64Vector.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":126 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_13Float64Vector_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_13Float64Vector_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_13Float64Vector_2__len__(((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_13Float64Vector_2__len__(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":127 + * + * def __len__(self): + * return self.n # <<<<<<<<<<<<<< + * + * def to_array(self): + */ + __pyx_r = __pyx_v_self->n; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":126 + * self.data = self.ao.data + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.n + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":129 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_13Float64Vector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_13Float64Vector_5to_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_13Float64Vector_4to_array(((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_13Float64Vector_4to_array(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_array", 0); + + /* "pandas/hashtable.pyx":130 + * + * def to_array(self): + * self.ao.resize(self.n) # <<<<<<<<<<<<<< + * self.m = self.n + * return self.ao + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":131 + * def to_array(self): + * self.ao.resize(self.n) + * self.m = self.n # <<<<<<<<<<<<<< + * return self.ao + * + */ + __pyx_t_4 = __pyx_v_self->n; + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":132 + * self.ao.resize(self.n) + * self.m = self.n + * return self.ao # <<<<<<<<<<<<<< + * + * cdef inline append(self, float64_t x): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->ao)); + __pyx_r = ((PyObject *)__pyx_v_self->ao); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":129 + * return self.n + * + * def to_array(self): # <<<<<<<<<<<<<< + * self.ao.resize(self.n) + * self.m = self.n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Float64Vector.to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":134 + * return self.ao + * + * cdef inline append(self, float64_t x): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_9hashtable_13Float64Vector_append(struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "pandas/hashtable.pyx":135 + * + * cdef inline append(self, float64_t x): + * if self.n == self.m: # <<<<<<<<<<<<<< + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + */ + __pyx_t_1 = ((__pyx_v_self->n == __pyx_v_self->m) != 0); + if (__pyx_t_1) { + + /* "pandas/hashtable.pyx":136 + * cdef inline append(self, float64_t x): + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) # <<<<<<<<<<<<<< + * self.ao.resize(self.m) + * self.data = self.ao.data + */ + __pyx_t_2 = __pyx_v_6pandas_9hashtable__INIT_VEC_CAP; + __pyx_t_3 = (__pyx_v_self->m * 2); + if (((__pyx_t_2 > __pyx_t_3) != 0)) { + __pyx_t_4 = __pyx_t_2; + } else { + __pyx_t_4 = __pyx_t_3; + } + __pyx_v_self->m = __pyx_t_4; + + /* "pandas/hashtable.pyx":137 + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) # <<<<<<<<<<<<<< + * self.data = self.ao.data + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->ao), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_self->m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":138 + * self.m = max(self.m * 2, _INIT_VEC_CAP) + * self.ao.resize(self.m) + * self.data = self.ao.data # <<<<<<<<<<<<<< + * + * self.data[self.n] = x + */ + __pyx_v_self->data = ((__pyx_t_5numpy_float64_t *)__pyx_v_self->ao->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":140 + * self.data = self.ao.data + * + * self.data[self.n] = x # <<<<<<<<<<<<<< + * self.n += 1 + * + */ + (__pyx_v_self->data[__pyx_v_self->n]) = __pyx_v_x; + + /* "pandas/hashtable.pyx":141 + * + * self.data[self.n] = x + * self.n += 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->n = (__pyx_v_self->n + 1); + + /* "pandas/hashtable.pyx":134 + * return self.ao + * + * cdef inline append(self, float64_t x): # <<<<<<<<<<<<<< + * if self.n == self.m: + * self.m = max(self.m * 2, _INIT_VEC_CAP) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.hashtable.Float64Vector.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":151 + * cdef kh_str_t *table + * + * def __cinit__(self, int size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_str() + * if size_hint is not None: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15StringHashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15StringHashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_size_hint; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_size_hint = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_size_hint == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_size_hint = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable___cinit__(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15StringHashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, int __pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":152 + * + * def __cinit__(self, int size_hint=1): + * self.table = kh_init_str() # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_str(self.table, size_hint) + */ + __pyx_v_self->table = kh_init_str(); + + /* "pandas/hashtable.pyx":153 + * def __cinit__(self, int size_hint=1): + * self.table = kh_init_str() + * if size_hint is not None: # <<<<<<<<<<<<<< + * kh_resize_str(self.table, size_hint) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size_hint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/hashtable.pyx":154 + * self.table = kh_init_str() + * if size_hint is not None: + * kh_resize_str(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + kh_resize_str(__pyx_v_self->table, __pyx_v_size_hint); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":151 + * cdef kh_str_t *table + * + * def __cinit__(self, int size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_str() + * if size_hint is not None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":156 + * kh_resize_str(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_str(self.table) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_15StringHashTable_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_15StringHashTable_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_15StringHashTable_2__dealloc__(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_15StringHashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":157 + * + * def __dealloc__(self): + * kh_destroy_str(self.table) # <<<<<<<<<<<<<< + * + * cdef inline int check_type(self, object val): + */ + kh_destroy_str(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":156 + * kh_resize_str(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_str(self.table) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":159 + * kh_destroy_str(self.table) + * + * cdef inline int check_type(self, object val): # <<<<<<<<<<<<<< + * return util.is_string_object(val) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_9hashtable_15StringHashTable_check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_type", 0); + + /* "pandas/hashtable.pyx":160 + * + * cdef inline int check_type(self, object val): + * return util.is_string_object(val) # <<<<<<<<<<<<<< + * + * cpdef get_item(self, object val): + */ + __pyx_r = is_string_object(__pyx_v_val); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":159 + * kh_destroy_str(self.table) + * + * cdef inline int check_type(self, object val): # <<<<<<<<<<<<<< + * return util.is_string_object(val) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":162 + * return util.is_string_object(val) + * + * cpdef get_item(self, object val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_str(self.table, util.get_c_string(val)) + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_15StringHashTable_get_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":164 + * cpdef get_item(self, object val): + * cdef khiter_t k + * k = kh_get_str(self.table, util.get_c_string(val)) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_str(__pyx_v_self->table, get_c_string(__pyx_v_val)); + + /* "pandas/hashtable.pyx":165 + * cdef khiter_t k + * k = kh_get_str(self.table, util.get_c_string(val)) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":166 + * k = kh_get_str(self.table, util.get_c_string(val)) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":168 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_iter_test(self, object key, Py_ssize_t iterations): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":162 + * return util.is_string_object(val) + * + * cpdef get_item(self, object val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_str(self.table, util.get_c_string(val)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_4get_item(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_4get_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":170 + * raise KeyError(val) + * + * def get_iter_test(self, object key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val + * for i in range(iterations): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_7get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_7get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + Py_ssize_t __pyx_v_iterations; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_iter_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_iterations,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iterations)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_iter_test") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_6get_iter_test(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_iterations); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_6get_iter_test(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_iterations) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_val; + khint_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_iter_test", 0); + + /* "pandas/hashtable.pyx":172 + * def get_iter_test(self, object key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val + * for i in range(iterations): # <<<<<<<<<<<<<< + * k = kh_get_str(self.table, util.get_c_string(key)) + * if k != self.table.n_buckets: + */ + __pyx_t_1 = __pyx_v_iterations; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":173 + * cdef Py_ssize_t i, val + * for i in range(iterations): + * k = kh_get_str(self.table, util.get_c_string(key)) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * val = self.table.vals[k] + */ + __pyx_v_k = kh_get_str(__pyx_v_self->table, get_c_string(__pyx_v_key)); + + /* "pandas/hashtable.pyx":174 + * for i in range(iterations): + * k = kh_get_str(self.table, util.get_c_string(key)) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * val = self.table.vals[k] + * + */ + __pyx_t_3 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_3) { + + /* "pandas/hashtable.pyx":175 + * k = kh_get_str(self.table, util.get_c_string(key)) + * if k != self.table.n_buckets: + * val = self.table.vals[k] # <<<<<<<<<<<<<< + * + * cpdef set_item(self, object key, Py_ssize_t val): + */ + __pyx_v_val = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":170 + * raise KeyError(val) + * + * def get_iter_test(self, object key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val + * for i in range(iterations): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":177 + * val = self.table.vals[k] + * + * cpdef set_item(self, object key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_15StringHashTable_set_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + char *__pyx_v_buf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + kh_cstr_t __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":180 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * char* buf + * + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":183 + * char* buf + * + * buf = util.get_c_string(key) # <<<<<<<<<<<<<< + * + * k = kh_put_str(self.table, buf, &ret) + */ + __pyx_v_buf = get_c_string(__pyx_v_key); + + /* "pandas/hashtable.pyx":185 + * buf = util.get_c_string(key) + * + * k = kh_put_str(self.table, buf, &ret) # <<<<<<<<<<<<<< + * self.table.keys[k] = key + * if kh_exist_str(self.table, k): + */ + __pyx_v_k = kh_put_str(__pyx_v_self->table, __pyx_v_buf, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":186 + * + * k = kh_put_str(self.table, buf, &ret) + * self.table.keys[k] = key # <<<<<<<<<<<<<< + * if kh_exist_str(self.table, k): + * self.table.vals[k] = val + */ + __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((__pyx_t_4 == (kh_cstr_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_t_4; + + /* "pandas/hashtable.pyx":187 + * k = kh_put_str(self.table, buf, &ret) + * self.table.keys[k] = key + * if kh_exist_str(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_5 = (kh_exist_str(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":188 + * self.table.keys[k] = key + * if kh_exist_str(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/hashtable.pyx":190 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def get_indexer(self, ndarray[object] values): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":177 + * val = self.table.vals[k] + * + * cpdef set_item(self, object key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_8set_item(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_8set_item(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":192 + * raise KeyError(key) + * + * def get_indexer(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_11get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_11get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indexer (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_10get_indexer(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_10get_indexer(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + char *__pyx_v_buf; + __pyx_t_5numpy_int64_t *__pyx_v_resbuf; + khiter_t __pyx_v_k; + kh_str_t *__pyx_v_table; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + kh_str_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_indexer", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":194 + * def get_indexer(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * char *buf + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":195 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * char *buf + * int64_t *resbuf = labels.data + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":197 + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * char *buf + * int64_t *resbuf = labels.data # <<<<<<<<<<<<<< + * khiter_t k + * kh_str_t *table = self.table + */ + __pyx_v_resbuf = ((__pyx_t_5numpy_int64_t *)__pyx_v_labels->data); + + /* "pandas/hashtable.pyx":199 + * int64_t *resbuf = labels.data + * khiter_t k + * kh_str_t *table = self.table # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_8 = __pyx_v_self->table; + __pyx_v_table = __pyx_t_8; + + /* "pandas/hashtable.pyx":201 + * kh_str_t *table = self.table + * + * for i in range(n): # <<<<<<<<<<<<<< + * buf = util.get_c_string(values[i]) + * k = kh_get_str(table, buf) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/hashtable.pyx":202 + * + * for i in range(n): + * buf = util.get_c_string(values[i]) # <<<<<<<<<<<<<< + * k = kh_get_str(table, buf) + * if k != table.n_buckets: + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_v_buf = get_c_string(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":203 + * for i in range(n): + * buf = util.get_c_string(values[i]) + * k = kh_get_str(table, buf) # <<<<<<<<<<<<<< + * if k != table.n_buckets: + * resbuf[i] = table.vals[k] + */ + __pyx_v_k = kh_get_str(__pyx_v_table, __pyx_v_buf); + + /* "pandas/hashtable.pyx":204 + * buf = util.get_c_string(values[i]) + * k = kh_get_str(table, buf) + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * resbuf[i] = table.vals[k] + * else: + */ + __pyx_t_12 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_12) { + + /* "pandas/hashtable.pyx":205 + * k = kh_get_str(table, buf) + * if k != table.n_buckets: + * resbuf[i] = table.vals[k] # <<<<<<<<<<<<<< + * else: + * resbuf[i] = -1 + */ + (__pyx_v_resbuf[__pyx_v_i]) = (__pyx_v_table->vals[__pyx_v_k]); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":207 + * resbuf[i] = table.vals[k] + * else: + * resbuf[i] = -1 # <<<<<<<<<<<<<< + * return labels + * + */ + (__pyx_v_resbuf[__pyx_v_i]) = -1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":208 + * else: + * resbuf[i] = -1 + * return labels # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + __pyx_r = ((PyObject *)__pyx_v_labels); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":192 + * raise KeyError(key) + * + * def get_indexer(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":210 + * return labels + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_13unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_13unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_12unique(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_12unique(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + char *__pyx_v_buf; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":212 + * def unique(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":213 + * cdef: + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":214 + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * char *buf + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":218 + * char *buf + * khiter_t k + * ObjectVector uniques = ObjectVector() # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_ObjectVector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":220 + * ObjectVector uniques = ObjectVector() + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * buf = util.get_c_string(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/hashtable.pyx":221 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":222 + * for i in range(n): + * val = values[i] + * buf = util.get_c_string(val) # <<<<<<<<<<<<<< + * k = kh_get_str(self.table, buf) + * if k == self.table.n_buckets: + */ + __pyx_v_buf = get_c_string(__pyx_v_val); + + /* "pandas/hashtable.pyx":223 + * val = values[i] + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) # <<<<<<<<<<<<<< + * if k == self.table.n_buckets: + * k = kh_put_str(self.table, buf, &ret) + */ + __pyx_v_k = kh_get_str(__pyx_v_self->table, __pyx_v_buf); + + /* "pandas/hashtable.pyx":224 + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) + * if k == self.table.n_buckets: # <<<<<<<<<<<<<< + * k = kh_put_str(self.table, buf, &ret) + * # print 'putting %s, %s' % (val, count) + */ + __pyx_t_6 = ((__pyx_v_k == __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":225 + * k = kh_get_str(self.table, buf) + * if k == self.table.n_buckets: + * k = kh_put_str(self.table, buf, &ret) # <<<<<<<<<<<<<< + * # print 'putting %s, %s' % (val, count) + * count += 1 + */ + __pyx_v_k = kh_put_str(__pyx_v_self->table, __pyx_v_buf, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":227 + * k = kh_put_str(self.table, buf, &ret) + * # print 'putting %s, %s' % (val, count) + * count += 1 # <<<<<<<<<<<<<< + * uniques.append(val) + * + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/hashtable.pyx":228 + * # print 'putting %s, %s' % (val, count) + * count += 1 + * uniques.append(val) # <<<<<<<<<<<<<< + * + * # return None + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_12ObjectVector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":231 + * + * # return None + * return uniques.to_array() # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":210 + * return labels + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":233 + * return uniques.to_array() + * + * def factorize(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_15factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15StringHashTable_15factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_15StringHashTable_14factorize(((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15StringHashTable_14factorize(struct __pyx_obj_6pandas_9hashtable_StringHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + PyObject *__pyx_v_reverse = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + char *__pyx_v_buf; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":235 + * def factorize(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":236 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * dict reverse = {} + * Py_ssize_t idx, count = 0 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":237 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_reverse = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":238 + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":239 + * dict reverse = {} + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * char *buf + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":244 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * buf = util.get_c_string(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":245 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":246 + * for i in range(n): + * val = values[i] + * buf = util.get_c_string(val) # <<<<<<<<<<<<<< + * k = kh_get_str(self.table, buf) + * if k != self.table.n_buckets: + */ + __pyx_v_buf = get_c_string(__pyx_v_val); + + /* "pandas/hashtable.pyx":247 + * val = values[i] + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_str(__pyx_v_self->table, __pyx_v_buf); + + /* "pandas/hashtable.pyx":248 + * buf = util.get_c_string(val) + * k = kh_get_str(self.table, buf) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":249 + * k = kh_get_str(self.table, buf) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":250 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_str(self.table, buf, &ret) + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":252 + * labels[i] = idx + * else: + * k = kh_put_str(self.table, buf, &ret) # <<<<<<<<<<<<<< + * # print 'putting %s, %s' % (val, count) + * + */ + __pyx_v_k = kh_put_str(__pyx_v_self->table, __pyx_v_buf, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":255 + * # print 'putting %s, %s' % (val, count) + * + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * reverse[count] = val + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":256 + * + * self.table.vals[k] = count + * reverse[count] = val # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyDict_SetItem(__pyx_v_reverse, __pyx_t_6, __pyx_v_val) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":257 + * self.table.vals[k] = count + * reverse[count] = val + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":258 + * reverse[count] = val + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * # return None + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":261 + * + * # return None + * return reverse, labels # <<<<<<<<<<<<<< + * + * cdef class Int32HashTable(HashTable): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":233 + * return uniques.to_array() + * + * def factorize(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.StringHashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_reverse); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":266 + * cdef kh_int32_t *table + * + * def __init__(self, size_hint=1): # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_int32(self.table, size_hint) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_14Int32HashTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_14Int32HashTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable___init__(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_14Int32HashTable___init__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + khint_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/hashtable.pyx":267 + * + * def __init__(self, size_hint=1): + * if size_hint is not None: # <<<<<<<<<<<<<< + * kh_resize_int32(self.table, size_hint) + * + */ + __pyx_t_1 = (__pyx_v_size_hint != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/hashtable.pyx":268 + * def __init__(self, size_hint=1): + * if size_hint is not None: + * kh_resize_int32(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __cinit__(self): + */ + __pyx_t_3 = __Pyx_PyInt_As_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_3 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + kh_resize_int32(__pyx_v_self->table, __pyx_t_3); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":266 + * cdef kh_int32_t *table + * + * def __init__(self, size_hint=1): # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_int32(self.table, size_hint) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":270 + * kh_resize_int32(self.table, size_hint) + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.table = kh_init_int32() + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_14Int32HashTable_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_14Int32HashTable_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_2__cinit__(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_14Int32HashTable_2__cinit__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":271 + * + * def __cinit__(self): + * self.table = kh_init_int32() # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->table = kh_init_int32(); + + /* "pandas/hashtable.pyx":270 + * kh_resize_int32(self.table, size_hint) + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.table = kh_init_int32() + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":273 + * self.table = kh_init_int32() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_int32(self.table) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_14Int32HashTable_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_14Int32HashTable_5__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_14Int32HashTable_4__dealloc__(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_14Int32HashTable_4__dealloc__(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":274 + * + * def __dealloc__(self): + * kh_destroy_int32(self.table) # <<<<<<<<<<<<<< + * + * cdef inline int check_type(self, object val): + */ + kh_destroy_int32(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":273 + * self.table = kh_init_int32() + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_int32(self.table) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":276 + * kh_destroy_int32(self.table) + * + * cdef inline int check_type(self, object val): # <<<<<<<<<<<<<< + * return util.is_string_object(val) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_9hashtable_14Int32HashTable_check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_type", 0); + + /* "pandas/hashtable.pyx":277 + * + * cdef inline int check_type(self, object val): + * return util.is_string_object(val) # <<<<<<<<<<<<<< + * + * cpdef get_item(self, int32_t val): + */ + __pyx_r = is_string_object(__pyx_v_val); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":276 + * kh_destroy_int32(self.table) + * + * cdef inline int check_type(self, object val): # <<<<<<<<<<<<<< + * return util.is_string_object(val) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":279 + * return util.is_string_object(val) + * + * cpdef get_item(self, int32_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int32(self.table, val) + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_14Int32HashTable_get_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":281 + * cpdef get_item(self, int32_t val): + * cdef khiter_t k + * k = kh_get_int32(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":282 + * cdef khiter_t k + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":283 + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":285 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":279 + * return util.is_string_object(val) + * + * cpdef get_item(self, int32_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int32(self.table, val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { + __pyx_t_5numpy_int32_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + assert(__pyx_arg_val); { + __pyx_v_val = __Pyx_PyInt_As_npy_int32(__pyx_arg_val); if (unlikely((__pyx_v_val == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_6get_item(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), ((__pyx_t_5numpy_int32_t)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_6get_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":287 + * raise KeyError(val) + * + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_9get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_9get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_key; + Py_ssize_t __pyx_v_iterations; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_iter_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_iterations,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iterations)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_iter_test") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __Pyx_PyInt_As_npy_int32(values[0]); if (unlikely((__pyx_v_key == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_8get_iter_test(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_iterations); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_8get_iter_test(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_iterations) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_val; + khint_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_iter_test", 0); + + /* "pandas/hashtable.pyx":288 + * + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val=0 # <<<<<<<<<<<<<< + * for i in range(iterations): + * k = kh_get_int32(self.table, val) + */ + __pyx_v_val = 0; + + /* "pandas/hashtable.pyx":289 + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): # <<<<<<<<<<<<<< + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_1 = __pyx_v_iterations; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":290 + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + * k = kh_get_int32(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * val = self.table.vals[k] + */ + __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":291 + * for i in range(iterations): + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * val = self.table.vals[k] + * + */ + __pyx_t_3 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_3) { + + /* "pandas/hashtable.pyx":292 + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + * val = self.table.vals[k] # <<<<<<<<<<<<<< + * + * cpdef set_item(self, int32_t key, Py_ssize_t val): + */ + __pyx_v_val = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":287 + * raise KeyError(val) + * + * def get_iter_test(self, int32_t key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":294 + * val = self.table.vals[k] + * + * cpdef set_item(self, int32_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_14Int32HashTable_set_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":297 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * + * k = kh_put_int32(self.table, key, &ret) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":299 + * int ret = 0 + * + * k = kh_put_int32(self.table, key, &ret) # <<<<<<<<<<<<<< + * self.table.keys[k] = key + * if kh_exist_int32(self.table, k): + */ + __pyx_v_k = kh_put_int32(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":300 + * + * k = kh_put_int32(self.table, key, &ret) + * self.table.keys[k] = key # <<<<<<<<<<<<<< + * if kh_exist_int32(self.table, k): + * self.table.vals[k] = val + */ + (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_v_key; + + /* "pandas/hashtable.pyx":301 + * k = kh_put_int32(self.table, key, &ret) + * self.table.keys[k] = key + * if kh_exist_int32(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_5 = (kh_exist_int32(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":302 + * self.table.keys[k] = key + * if kh_exist_int32(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/hashtable.pyx":304 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def map_locations(self, ndarray[int32_t] values): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":294 + * val = self.table.vals[k] + * + * cpdef set_item(self, int32_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int32_t __pyx_v_key; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __Pyx_PyInt_As_npy_int32(values[0]); if (unlikely((__pyx_v_key == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_10set_item(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_10set_item(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":306 + * raise KeyError(key) + * + * def map_locations(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_13map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_13map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_locations (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_12map_locations(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_12map_locations(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + __pyx_t_5numpy_int32_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_locations", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":308 + * def map_locations(self, ndarray[int32_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int32_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":309 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int32_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":313 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_put_int32(self.table, val, &ret) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":314 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_put_int32(self.table, val, &ret) + * self.table.vals[k] = i + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":315 + * for i in range(n): + * val = values[i] + * k = kh_put_int32(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = i + * + */ + __pyx_v_k = kh_put_int32(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":316 + * val = values[i] + * k = kh_put_int32(self.table, val, &ret) + * self.table.vals[k] = i # <<<<<<<<<<<<<< + * + * def lookup(self, ndarray[int32_t] values): + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_i; + } + + /* "pandas/hashtable.pyx":306 + * raise KeyError(key) + * + * def map_locations(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":318 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_15lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_15lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_14lookup(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_14lookup(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + __pyx_t_5numpy_int32_t __pyx_v_val; + khiter_t __pyx_v_k; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":320 + * def lookup(self, ndarray[int32_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int32_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":321 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int32_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":324 + * int32_t val + * khiter_t k + * ndarray[int32_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":326 + * ndarray[int32_t] locs = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int32(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":327 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":328 + * for i in range(n): + * val = values[i] + * k = kh_get_int32(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] + */ + __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":329 + * val = values[i] + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * locs[i] = self.table.vals[k] + * else: + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":330 + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * locs[i] = -1 + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides) = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":332 + * locs[i] = self.table.vals[k] + * else: + * locs[i] = -1 # <<<<<<<<<<<<<< + * + * return locs + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_locs.diminfo[0].strides) = -1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":334 + * locs[i] = -1 + * + * return locs # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[int32_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":318 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":336 + * return locs + * + * def factorize(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_17factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int32HashTable_17factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int32HashTable_16factorize(((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int32HashTable_16factorize(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + PyObject *__pyx_v_reverse = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_int32_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":338 + * def factorize(self, ndarray[int32_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":339 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * dict reverse = {} + * Py_ssize_t idx, count = 0 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":340 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_reverse = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":341 + * ndarray[int64_t] labels = np.empty(n, dtype=np.int64) + * dict reverse = {} + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * int32_t val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":342 + * dict reverse = {} + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * int32_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":346 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int32(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":347 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":348 + * for i in range(n): + * val = values[i] + * k = kh_get_int32(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":349 + * val = values[i] + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":350 + * k = kh_get_int32(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":351 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_int32(self.table, val, &ret) + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":353 + * labels[i] = idx + * else: + * k = kh_put_int32(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * reverse[count] = val + */ + __pyx_v_k = kh_put_int32(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":354 + * else: + * k = kh_put_int32(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * reverse[count] = val + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":355 + * k = kh_put_int32(self.table, val, &ret) + * self.table.vals[k] = count + * reverse[count] = val # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_v_reverse, __pyx_t_2, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":356 + * self.table.vals[k] = count + * reverse[count] = val + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":357 + * reverse[count] = val + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * # return None + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":360 + * + * # return None + * return reverse, labels # <<<<<<<<<<<<<< + * + * cdef class Int64HashTable: #(HashTable): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":336 + * return locs + * + * def factorize(self, ndarray[int32_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int32HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_reverse); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":365 + * # cdef kh_int64_t *table + * + * def __cinit__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_int64() + * if size_hint is not None: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_14Int64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_14Int64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable___cinit__(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_14Int64HashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + khint_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":366 + * + * def __cinit__(self, size_hint=1): + * self.table = kh_init_int64() # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_int64(self.table, size_hint) + */ + __pyx_v_self->table = kh_init_int64(); + + /* "pandas/hashtable.pyx":367 + * def __cinit__(self, size_hint=1): + * self.table = kh_init_int64() + * if size_hint is not None: # <<<<<<<<<<<<<< + * kh_resize_int64(self.table, size_hint) + * + */ + __pyx_t_1 = (__pyx_v_size_hint != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/hashtable.pyx":368 + * self.table = kh_init_int64() + * if size_hint is not None: + * kh_resize_int64(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_3 = __Pyx_PyInt_As_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_3 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + kh_resize_int64(__pyx_v_self->table, __pyx_t_3); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":365 + * # cdef kh_int64_t *table + * + * def __cinit__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_int64() + * if size_hint is not None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":370 + * kh_resize_int64(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_int64(self.table) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_14Int64HashTable_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_14Int64HashTable_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_14Int64HashTable_2__dealloc__(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_14Int64HashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":371 + * + * def __dealloc__(self): + * kh_destroy_int64(self.table) # <<<<<<<<<<<<<< + * + * def __contains__(self, object key): + */ + kh_destroy_int64(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":370 + * kh_resize_int64(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_int64(self.table) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":373 + * kh_destroy_int64(self.table) + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int64(self.table, key) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_14Int64HashTable_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_14Int64HashTable_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_4__contains__(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_14Int64HashTable_4__contains__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyObject *__pyx_v_key) { + khiter_t __pyx_v_k; + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_int64_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + + /* "pandas/hashtable.pyx":375 + * def __contains__(self, object key): + * cdef khiter_t k + * k = kh_get_int64(self.table, key) # <<<<<<<<<<<<<< + * return k != self.table.n_buckets + * + */ + __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_key); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_t_1); + + /* "pandas/hashtable.pyx":376 + * cdef khiter_t k + * k = kh_get_int64(self.table, key) + * return k != self.table.n_buckets # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_r = (__pyx_v_k != __pyx_v_self->table->n_buckets); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":373 + * kh_destroy_int64(self.table) + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int64(self.table, key) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":378 + * return k != self.table.n_buckets + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_14Int64HashTable_7__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_14Int64HashTable_7__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_6__len__(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_14Int64HashTable_6__len__(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":379 + * + * def __len__(self): + * return self.table.size # <<<<<<<<<<<<<< + * + * cpdef get_item(self, int64_t val): + */ + __pyx_r = __pyx_v_self->table->size; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":378 + * return k != self.table.n_buckets + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":381 + * return self.table.size + * + * cpdef get_item(self, int64_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int64(self.table, val) + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_14Int64HashTable_get_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":383 + * cpdef get_item(self, int64_t val): + * cdef khiter_t k + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":384 + * cdef khiter_t k + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":385 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":387 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":381 + * return self.table.size + * + * cpdef get_item(self, int64_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_int64(self.table, val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { + __pyx_t_5numpy_int64_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + assert(__pyx_arg_val); { + __pyx_v_val = __Pyx_PyInt_As_npy_int64(__pyx_arg_val); if (unlikely((__pyx_v_val == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_8get_item(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((__pyx_t_5numpy_int64_t)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_8get_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":389 + * raise KeyError(val) + * + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_11get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_11get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_key; + Py_ssize_t __pyx_v_iterations; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_iter_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_iterations,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iterations)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_iter_test") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_key == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_10get_iter_test(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_iterations); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_10get_iter_test(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_iterations) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_val; + khint_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_iter_test", 0); + + /* "pandas/hashtable.pyx":390 + * + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val=0 # <<<<<<<<<<<<<< + * for i in range(iterations): + * k = kh_get_int64(self.table, val) + */ + __pyx_v_val = 0; + + /* "pandas/hashtable.pyx":391 + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): # <<<<<<<<<<<<<< + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_1 = __pyx_v_iterations; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":392 + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * val = self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":393 + * for i in range(iterations): + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * val = self.table.vals[k] + * + */ + __pyx_t_3 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_3) { + + /* "pandas/hashtable.pyx":394 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * val = self.table.vals[k] # <<<<<<<<<<<<<< + * + * cpdef set_item(self, int64_t key, Py_ssize_t val): + */ + __pyx_v_val = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":389 + * raise KeyError(val) + * + * def get_iter_test(self, int64_t key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val=0 + * for i in range(iterations): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":396 + * val = self.table.vals[k] + * + * cpdef set_item(self, int64_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_14Int64HashTable_set_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":399 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * + * k = kh_put_int64(self.table, key, &ret) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":401 + * int ret = 0 + * + * k = kh_put_int64(self.table, key, &ret) # <<<<<<<<<<<<<< + * self.table.keys[k] = key + * if kh_exist_int64(self.table, k): + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":402 + * + * k = kh_put_int64(self.table, key, &ret) + * self.table.keys[k] = key # <<<<<<<<<<<<<< + * if kh_exist_int64(self.table, k): + * self.table.vals[k] = val + */ + (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_v_key; + + /* "pandas/hashtable.pyx":403 + * k = kh_put_int64(self.table, key, &ret) + * self.table.keys[k] = key + * if kh_exist_int64(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_5 = (kh_exist_int64(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":404 + * self.table.keys[k] = key + * if kh_exist_int64(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/hashtable.pyx":406 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def map(self, ndarray[int64_t] keys, ndarray[int64_t] values): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":396 + * val = self.table.vals[k] + * + * cpdef set_item(self, int64_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_key; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_key == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_12set_item(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_12set_item(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":408 + * raise KeyError(key) + * + * def map(self, ndarray[int64_t] keys, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_15map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_15map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_keys = 0; + PyArrayObject *__pyx_v_values = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_keys,&__pyx_n_s_values,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_keys = ((PyArrayObject *)values[0]); + __pyx_v_values = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_14map(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_keys, __pyx_v_values); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_14map(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_keys, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_key; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_keys; + __Pyx_Buffer __pyx_pybuffer_keys; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map", 0); + __pyx_pybuffer_keys.pybuffer.buf = NULL; + __pyx_pybuffer_keys.refcount = 0; + __pyx_pybuffernd_keys.data = NULL; + __pyx_pybuffernd_keys.rcbuffer = &__pyx_pybuffer_keys; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":410 + * def map(self, ndarray[int64_t] keys, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t key + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":411 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t key + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":415 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * key = keys[i] + * k = kh_put_int64(self.table, key, &ret) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":416 + * + * for i in range(n): + * key = keys[i] # <<<<<<<<<<<<<< + * k = kh_put_int64(self.table, key, &ret) + * self.table.vals[k] = values[i] + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_keys.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_keys.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_key = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_keys.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_keys.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":417 + * for i in range(n): + * key = keys[i] + * k = kh_put_int64(self.table, key, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = values[i] + * + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":418 + * key = keys[i] + * k = kh_put_int64(self.table, key, &ret) + * self.table.vals[k] = values[i] # <<<<<<<<<<<<<< + * + * def map_locations(self, ndarray[int64_t] values): + */ + __pyx_t_5 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + (__pyx_v_self->table->vals[__pyx_v_k]) = ((Py_ssize_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_values.diminfo[0].strides))); + } + + /* "pandas/hashtable.pyx":408 + * raise KeyError(key) + * + * def map(self, ndarray[int64_t] keys, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_keys.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_keys.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":420 + * self.table.vals[k] = values[i] + * + * def map_locations(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_locations (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_16map_locations(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_locations", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":422 + * def map_locations(self, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":423 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":427 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_put_int64(self.table, val, &ret) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":428 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = i + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":429 + * for i in range(n): + * val = values[i] + * k = kh_put_int64(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = i + * + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":430 + * val = values[i] + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = i # <<<<<<<<<<<<<< + * + * def lookup(self, ndarray[int64_t] values): + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_i; + } + + /* "pandas/hashtable.pyx":420 + * self.table.vals[k] = values[i] + * + * def map_locations(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":432 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_18lookup(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":434 + * def lookup(self, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":435 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":438 + * int64_t val + * khiter_t k + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":440 + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int64(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":441 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":442 + * for i in range(n): + * val = values[i] + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":443 + * val = values[i] + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * locs[i] = self.table.vals[k] + * else: + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":444 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * locs[i] = -1 + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides) = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":446 + * locs[i] = self.table.vals[k] + * else: + * locs[i] = -1 # <<<<<<<<<<<<<< + * + * return locs + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_locs.diminfo[0].strides) = -1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":448 + * locs[i] = -1 + * + * return locs # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":432 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":450 + * return locs + * + * def factorize(self, ndarray[object] values): # <<<<<<<<<<<<<< + * reverse = {} + * labels = self.get_labels(values, reverse, 0) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_21factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_21factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_20factorize(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_20factorize(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + PyObject *__pyx_v_reverse = NULL; + PyObject *__pyx_v_labels = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":451 + * + * def factorize(self, ndarray[object] values): + * reverse = {} # <<<<<<<<<<<<<< + * labels = self.get_labels(values, reverse, 0) + * return reverse, labels + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_reverse = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":452 + * def factorize(self, ndarray[object] values): + * reverse = {} + * labels = self.get_labels(values, reverse, 0) # <<<<<<<<<<<<<< + * return reverse, labels + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_labels = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/hashtable.pyx":453 + * reverse = {} + * labels = self.get_labels(values, reverse, 0) + * return reverse, labels # <<<<<<<<<<<<<< + * + * def get_labels(self, ndarray[int64_t] values, Int64Vector uniques, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_reverse); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_reverse); + __Pyx_GIVEREF(__pyx_v_reverse); + __Pyx_INCREF(__pyx_v_labels); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":450 + * return locs + * + * def factorize(self, ndarray[object] values): # <<<<<<<<<<<<<< + * reverse = {} + * labels = self.get_labels(values, reverse, 0) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_reverse); + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":455 + * return reverse, labels + * + * def get_labels(self, ndarray[int64_t] values, Int64Vector uniques, # <<<<<<<<<<<<<< + * Py_ssize_t count_prior, Py_ssize_t na_sentinel): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_23get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_23get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques = 0; + Py_ssize_t __pyx_v_count_prior; + CYTHON_UNUSED Py_ssize_t __pyx_v_na_sentinel; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_labels (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_uniques,&__pyx_n_s_count_prior,&__pyx_n_s_na_sentinel,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_uniques)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_prior)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_labels") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)values[1]); + __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_na_sentinel = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_na_sentinel == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), __pyx_ptype_6pandas_9hashtable_Int64Vector, 1, "uniques", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_22get_labels(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), __pyx_v_values, __pyx_v_uniques, __pyx_v_count_prior, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_22get_labels(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, CYTHON_UNUSED Py_ssize_t __pyx_v_na_sentinel) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_labels", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":458 + * Py_ssize_t count_prior, Py_ssize_t na_sentinel): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":460 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t val + */ + __pyx_v_count = __pyx_v_count_prior; + + /* "pandas/hashtable.pyx":461 + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":465 + * khiter_t k + * + * labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":467 + * labels = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int64(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/hashtable.pyx":468 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":469 + * for i in range(n): + * val = values[i] + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":470 + * val = values[i] + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_14 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":471 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":472 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_int64(self.table, val, &ret) + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":474 + * labels[i] = idx + * else: + * k = kh_put_int64(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * uniques.append(val) + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":475 + * else: + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * uniques.append(val) + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":476 + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = count + * uniques.append(val) # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __pyx_f_6pandas_9hashtable_11Int64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":477 + * self.table.vals[k] = count + * uniques.append(val) + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":478 + * uniques.append(val) + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * return labels + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":480 + * count += 1 + * + * return labels # <<<<<<<<<<<<<< + * + * def get_labels_groupby(self, ndarray[int64_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + __pyx_r = ((PyObject *)__pyx_v_labels); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":455 + * return reverse, labels + * + * def get_labels(self, ndarray[int64_t] values, Int64Vector uniques, # <<<<<<<<<<<<<< + * Py_ssize_t count_prior, Py_ssize_t na_sentinel): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":482 + * return labels + * + * def get_labels_groupby(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_25get_labels_groupby(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_25get_labels_groupby(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_labels_groupby (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_24get_labels_groupby(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_24get_labels_groupby(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques = 0; + PyObject *__pyx_v_arr_uniques = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_labels_groupby", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":484 + * def get_labels_groupby(self, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels + * Py_ssize_t idx, count = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":486 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * int64_t val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":487 + * ndarray[int64_t] labels + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":490 + * int64_t val + * khiter_t k + * Int64Vector uniques = Int64Vector() # <<<<<<<<<<<<<< + * + * labels = np.empty(n, dtype=np.int64) + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Int64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":492 + * Int64Vector uniques = Int64Vector() + * + * labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":494 + * labels = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/hashtable.pyx":495 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * # specific for groupby + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":498 + * + * # specific for groupby + * if val < 0: # <<<<<<<<<<<<<< + * labels[i] = -1 + * continue + */ + __pyx_t_14 = ((__pyx_v_val < 0) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":499 + * # specific for groupby + * if val < 0: + * labels[i] = -1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides) = -1; + + /* "pandas/hashtable.pyx":500 + * if val < 0: + * labels[i] = -1 + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_int64(self.table, val) + */ + goto __pyx_L3_continue; + } + + /* "pandas/hashtable.pyx":502 + * continue + * + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":503 + * + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_14 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":504 + * k = kh_get_int64(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":505 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_int64(self.table, val, &ret) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":507 + * labels[i] = idx + * else: + * k = kh_put_int64(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * uniques.append(val) + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":508 + * else: + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * uniques.append(val) + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":509 + * k = kh_put_int64(self.table, val, &ret) + * self.table.vals[k] = count + * uniques.append(val) # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __pyx_f_6pandas_9hashtable_11Int64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":510 + * self.table.vals[k] = count + * uniques.append(val) + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":511 + * uniques.append(val) + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * arr_uniques = uniques.to_array() + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":513 + * count += 1 + * + * arr_uniques = uniques.to_array() # <<<<<<<<<<<<<< + * + * return labels, arr_uniques + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_arr_uniques = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":515 + * arr_uniques = uniques.to_array() + * + * return labels, arr_uniques # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[int64_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_labels)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_labels)); + __Pyx_INCREF(__pyx_v_arr_uniques); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_arr_uniques); + __Pyx_GIVEREF(__pyx_v_arr_uniques); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":482 + * return labels + * + * def get_labels_groupby(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.get_labels_groupby", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_arr_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":517 + * return labels, arr_uniques + * + * def unique(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_27unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_14Int64HashTable_27unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_14Int64HashTable_26unique(((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_14Int64HashTable_26unique(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *__pyx_v_uniques = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":519 + * def unique(self, ndarray[int64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":520 + * cdef: + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * ndarray result + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":521 + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * ndarray result + * int64_t val + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":525 + * int64_t val + * khiter_t k + * Int64Vector uniques = Int64Vector() # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Int64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":527 + * Int64Vector uniques = Int64Vector() + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int64(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/hashtable.pyx":528 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(self.table, val) + * if k == self.table.n_buckets: + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":529 + * for i in range(n): + * val = values[i] + * k = kh_get_int64(self.table, val) # <<<<<<<<<<<<<< + * if k == self.table.n_buckets: + * k = kh_put_int64(self.table, val, &ret) + */ + __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":530 + * val = values[i] + * k = kh_get_int64(self.table, val) + * if k == self.table.n_buckets: # <<<<<<<<<<<<<< + * k = kh_put_int64(self.table, val, &ret) + * uniques.append(val) + */ + __pyx_t_6 = ((__pyx_v_k == __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":531 + * k = kh_get_int64(self.table, val) + * if k == self.table.n_buckets: + * k = kh_put_int64(self.table, val, &ret) # <<<<<<<<<<<<<< + * uniques.append(val) + * count += 1 + */ + __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":532 + * if k == self.table.n_buckets: + * k = kh_put_int64(self.table, val, &ret) + * uniques.append(val) # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_11Int64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":533 + * k = kh_put_int64(self.table, val, &ret) + * uniques.append(val) + * count += 1 # <<<<<<<<<<<<<< + * + * result = uniques.to_array() + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":535 + * count += 1 + * + * result = uniques.to_array() # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/hashtable.pyx":537 + * result = uniques.to_array() + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":517 + * return labels, arr_uniques + * + * def unique(self, ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64HashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":541 + * + * cdef class Float64HashTable(HashTable): + * def __cinit__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_float64() + * if size_hint is not None: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_16Float64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_16Float64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable___cinit__(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_16Float64HashTable___cinit__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + khint_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/hashtable.pyx":542 + * cdef class Float64HashTable(HashTable): + * def __cinit__(self, size_hint=1): + * self.table = kh_init_float64() # <<<<<<<<<<<<<< + * if size_hint is not None: + * kh_resize_float64(self.table, size_hint) + */ + __pyx_v_self->table = kh_init_float64(); + + /* "pandas/hashtable.pyx":543 + * def __cinit__(self, size_hint=1): + * self.table = kh_init_float64() + * if size_hint is not None: # <<<<<<<<<<<<<< + * kh_resize_float64(self.table, size_hint) + * + */ + __pyx_t_1 = (__pyx_v_size_hint != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/hashtable.pyx":544 + * self.table = kh_init_float64() + * if size_hint is not None: + * kh_resize_float64(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_t_3 = __Pyx_PyInt_As_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_3 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + kh_resize_float64(__pyx_v_self->table, __pyx_t_3); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":541 + * + * cdef class Float64HashTable(HashTable): + * def __cinit__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_float64() + * if size_hint is not None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":546 + * kh_resize_float64(self.table, size_hint) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_16Float64HashTable_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_16Float64HashTable_3__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_2__len__(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_16Float64HashTable_2__len__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":547 + * + * def __len__(self): + * return self.table.size # <<<<<<<<<<<<<< + * + * cpdef get_item(self, float64_t val): + */ + __pyx_r = __pyx_v_self->table->size; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":546 + * kh_resize_float64(self.table, size_hint) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":549 + * return self.table.size + * + * cpdef get_item(self, float64_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_float64(self.table, val) + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_16Float64HashTable_get_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":551 + * cpdef get_item(self, float64_t val): + * cdef khiter_t k + * k = kh_get_float64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":552 + * cdef khiter_t k + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":553 + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":555 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * cpdef set_item(self, float64_t key, Py_ssize_t val): + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":549 + * return self.table.size + * + * cpdef get_item(self, float64_t val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_float64(self.table, val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { + __pyx_t_5numpy_float64_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + assert(__pyx_arg_val); { + __pyx_v_val = __pyx_PyFloat_AsDouble(__pyx_arg_val); if (unlikely((__pyx_v_val == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_4get_item(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_4get_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":557 + * raise KeyError(val) + * + * cpdef set_item(self, float64_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_16Float64HashTable_set_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":560 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * + * k = kh_put_float64(self.table, key, &ret) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":562 + * int ret = 0 + * + * k = kh_put_float64(self.table, key, &ret) # <<<<<<<<<<<<<< + * self.table.keys[k] = key + * if kh_exist_float64(self.table, k): + */ + __pyx_v_k = kh_put_float64(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":563 + * + * k = kh_put_float64(self.table, key, &ret) + * self.table.keys[k] = key # <<<<<<<<<<<<<< + * if kh_exist_float64(self.table, k): + * self.table.vals[k] = val + */ + (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_v_key; + + /* "pandas/hashtable.pyx":564 + * k = kh_put_float64(self.table, key, &ret) + * self.table.keys[k] = key + * if kh_exist_float64(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_5 = (kh_exist_float64(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":565 + * self.table.keys[k] = key + * if kh_exist_float64(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/hashtable.pyx":567 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":557 + * raise KeyError(val) + * + * cpdef set_item(self, float64_t key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_float64_t __pyx_v_key; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_key == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_6set_item(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_6set_item(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":569 + * raise KeyError(key) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_float64(self.table) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_16Float64HashTable_9__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_16Float64HashTable_9__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_16Float64HashTable_8__dealloc__(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_16Float64HashTable_8__dealloc__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":570 + * + * def __dealloc__(self): + * kh_destroy_float64(self.table) # <<<<<<<<<<<<<< + * + * def __contains__(self, object key): + */ + kh_destroy_float64(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":569 + * raise KeyError(key) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * kh_destroy_float64(self.table) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":572 + * kh_destroy_float64(self.table) + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_float64(self.table, key) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_16Float64HashTable_11__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_16Float64HashTable_11__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_10__contains__(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_16Float64HashTable_10__contains__(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyObject *__pyx_v_key) { + khiter_t __pyx_v_k; + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_float64_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + + /* "pandas/hashtable.pyx":574 + * def __contains__(self, object key): + * cdef khiter_t k + * k = kh_get_float64(self.table, key) # <<<<<<<<<<<<<< + * return k != self.table.n_buckets + * + */ + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_key); if (unlikely((__pyx_t_1 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_t_1); + + /* "pandas/hashtable.pyx":575 + * cdef khiter_t k + * k = kh_get_float64(self.table, key) + * return k != self.table.n_buckets # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[float64_t] values): + */ + __pyx_r = (__pyx_v_k != __pyx_v_self->table->n_buckets); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":572 + * kh_destroy_float64(self.table) + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * k = kh_get_float64(self.table, key) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":577 + * return k != self.table.n_buckets + * + * def factorize(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * uniques = Float64Vector() + * labels = self.get_labels(values, uniques, 0, -1) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_13factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_13factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_12factorize(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_12factorize(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques = NULL; + PyObject *__pyx_v_labels = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":578 + * + * def factorize(self, ndarray[float64_t] values): + * uniques = Float64Vector() # <<<<<<<<<<<<<< + * labels = self.get_labels(values, uniques, 0, -1) + * return uniques.to_array(), labels + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Float64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":579 + * def factorize(self, ndarray[float64_t] values): + * uniques = Float64Vector() + * labels = self.get_labels(values, uniques, 0, -1) # <<<<<<<<<<<<<< + * return uniques.to_array(), labels + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_uniques)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_uniques)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_uniques)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_labels = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/hashtable.pyx":580 + * uniques = Float64Vector() + * labels = self.get_labels(values, uniques, 0, -1) + * return uniques.to_array(), labels # <<<<<<<<<<<<<< + * + * def get_labels(self, ndarray[float64_t] values, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_labels); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":577 + * return k != self.table.n_buckets + * + * def factorize(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * uniques = Float64Vector() + * labels = self.get_labels(values, uniques, 0, -1) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":582 + * return uniques.to_array(), labels + * + * def get_labels(self, ndarray[float64_t] values, # <<<<<<<<<<<<<< + * Float64Vector uniques, + * Py_ssize_t count_prior, int64_t na_sentinel): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_15get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_15get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques = 0; + Py_ssize_t __pyx_v_count_prior; + __pyx_t_5numpy_int64_t __pyx_v_na_sentinel; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_labels (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_uniques,&__pyx_n_s_count_prior,&__pyx_n_s_na_sentinel,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_uniques)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_prior)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_labels") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)values[1]); + __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_na_sentinel = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_na_sentinel == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), __pyx_ptype_6pandas_9hashtable_Float64Vector, 1, "uniques", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_14get_labels(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), __pyx_v_values, __pyx_v_uniques, __pyx_v_count_prior, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_14get_labels(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_float64_t __pyx_v_val; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_labels", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":586 + * Py_ssize_t count_prior, int64_t na_sentinel): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":588 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior # <<<<<<<<<<<<<< + * int ret = 0 + * float64_t val + */ + __pyx_v_count = __pyx_v_count_prior; + + /* "pandas/hashtable.pyx":589 + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + * int ret = 0 # <<<<<<<<<<<<<< + * float64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":593 + * khiter_t k + * + * labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":595 + * labels = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/hashtable.pyx":596 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * if val != val: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":598 + * val = values[i] + * + * if val != val: # <<<<<<<<<<<<<< + * labels[i] = na_sentinel + * continue + */ + __pyx_t_14 = ((__pyx_v_val != __pyx_v_val) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":599 + * + * if val != val: + * labels[i] = na_sentinel # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_na_sentinel; + + /* "pandas/hashtable.pyx":600 + * if val != val: + * labels[i] = na_sentinel + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_float64(self.table, val) + */ + goto __pyx_L3_continue; + } + + /* "pandas/hashtable.pyx":602 + * continue + * + * k = kh_get_float64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":603 + * + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_14 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":604 + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":605 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_float64(self.table, val, &ret) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":607 + * labels[i] = idx + * else: + * k = kh_put_float64(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * uniques.append(val) + */ + __pyx_v_k = kh_put_float64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":608 + * else: + * k = kh_put_float64(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * uniques.append(val) + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":609 + * k = kh_put_float64(self.table, val, &ret) + * self.table.vals[k] = count + * uniques.append(val) # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __pyx_f_6pandas_9hashtable_13Float64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":610 + * self.table.vals[k] = count + * uniques.append(val) + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":611 + * uniques.append(val) + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * return labels + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":613 + * count += 1 + * + * return labels # <<<<<<<<<<<<<< + * + * def map_locations(self, ndarray[float64_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + __pyx_r = ((PyObject *)__pyx_v_labels); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":582 + * return uniques.to_array(), labels + * + * def get_labels(self, ndarray[float64_t] values, # <<<<<<<<<<<<<< + * Float64Vector uniques, + * Py_ssize_t count_prior, int64_t na_sentinel): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":615 + * return labels + * + * def map_locations(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_locations (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_16map_locations(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_locations", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":617 + * def map_locations(self, ndarray[float64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * khiter_t k + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":618 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":621 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * k = kh_put_float64(self.table, values[i], &ret) + * self.table.vals[k] = i + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":622 + * + * for i in range(n): + * k = kh_put_float64(self.table, values[i], &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = i + * + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_k = kh_put_float64(__pyx_v_self->table, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides)), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":623 + * for i in range(n): + * k = kh_put_float64(self.table, values[i], &ret) + * self.table.vals[k] = i # <<<<<<<<<<<<<< + * + * def lookup(self, ndarray[float64_t] values): + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_i; + } + + /* "pandas/hashtable.pyx":615 + * return labels + * + * def map_locations(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":625 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_18lookup(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + __pyx_t_5numpy_float64_t __pyx_v_val; + khiter_t __pyx_v_k; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":627 + * def lookup(self, ndarray[float64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * float64_t val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":628 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * float64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":631 + * float64_t val + * khiter_t k + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":633 + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_float64(self.table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":634 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":635 + * for i in range(n): + * val = values[i] + * k = kh_get_float64(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] + */ + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":636 + * val = values[i] + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * locs[i] = self.table.vals[k] + * else: + */ + __pyx_t_11 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_11) { + + /* "pandas/hashtable.pyx":637 + * k = kh_get_float64(self.table, val) + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * locs[i] = -1 + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides) = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":639 + * locs[i] = self.table.vals[k] + * else: + * locs[i] = -1 # <<<<<<<<<<<<<< + * + * return locs + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_locs.diminfo[0].strides) = -1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":641 + * locs[i] = -1 + * + * return locs # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[float64_t] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":625 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":643 + * return locs + * + * def unique(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_21unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_16Float64HashTable_21unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_16Float64HashTable_20unique(((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_16Float64HashTable_20unique(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + __pyx_t_5numpy_float64_t __pyx_v_val; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_Float64Vector *__pyx_v_uniques = 0; + int __pyx_v_seen_na; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + __pyx_t_5numpy_float64_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":645 + * def unique(self, ndarray[float64_t] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":646 + * cdef: + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * float64_t val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":647 + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * float64_t val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":650 + * float64_t val + * khiter_t k + * Float64Vector uniques = Float64Vector() # <<<<<<<<<<<<<< + * bint seen_na = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Float64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":651 + * khiter_t k + * Float64Vector uniques = Float64Vector() + * bint seen_na = 0 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_seen_na = 0; + + /* "pandas/hashtable.pyx":653 + * bint seen_na = 0 + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/hashtable.pyx":654 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * if val == val: + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/hashtable.pyx":656 + * val = values[i] + * + * if val == val: # <<<<<<<<<<<<<< + * k = kh_get_float64(self.table, val) + * if k == self.table.n_buckets: + */ + __pyx_t_6 = ((__pyx_v_val == __pyx_v_val) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":657 + * + * if val == val: + * k = kh_get_float64(self.table, val) # <<<<<<<<<<<<<< + * if k == self.table.n_buckets: + * k = kh_put_float64(self.table, val, &ret) + */ + __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val); + + /* "pandas/hashtable.pyx":658 + * if val == val: + * k = kh_get_float64(self.table, val) + * if k == self.table.n_buckets: # <<<<<<<<<<<<<< + * k = kh_put_float64(self.table, val, &ret) + * uniques.append(val) + */ + __pyx_t_6 = ((__pyx_v_k == __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":659 + * k = kh_get_float64(self.table, val) + * if k == self.table.n_buckets: + * k = kh_put_float64(self.table, val, &ret) # <<<<<<<<<<<<<< + * uniques.append(val) + * count += 1 + */ + __pyx_v_k = kh_put_float64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":660 + * if k == self.table.n_buckets: + * k = kh_put_float64(self.table, val, &ret) + * uniques.append(val) # <<<<<<<<<<<<<< + * count += 1 + * elif not seen_na: + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_13Float64Vector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":661 + * k = kh_put_float64(self.table, val, &ret) + * uniques.append(val) + * count += 1 # <<<<<<<<<<<<<< + * elif not seen_na: + * seen_na = 1 + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + + /* "pandas/hashtable.pyx":662 + * uniques.append(val) + * count += 1 + * elif not seen_na: # <<<<<<<<<<<<<< + * seen_na = 1 + * uniques.append(ONAN) + */ + __pyx_t_6 = ((!(__pyx_v_seen_na != 0)) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":663 + * count += 1 + * elif not seen_na: + * seen_na = 1 # <<<<<<<<<<<<<< + * uniques.append(ONAN) + * + */ + __pyx_v_seen_na = 1; + + /* "pandas/hashtable.pyx":664 + * elif not seen_na: + * seen_na = 1 + * uniques.append(ONAN) # <<<<<<<<<<<<<< + * + * return uniques.to_array() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ONAN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_f_6pandas_9hashtable_13Float64Vector_append(__pyx_v_uniques, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":666 + * uniques.append(ONAN) + * + * return uniques.to_array() # <<<<<<<<<<<<<< + * + * na_sentinel = object + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":643 + * return locs + * + * def unique(self, ndarray[float64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Float64HashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":673 + * # cdef kh_pymap_t *table + * + * def __init__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_pymap() + * kh_resize_pymap(self.table, size_hint) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable___init__(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_17PyObjectHashTable___init__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + khint_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/hashtable.pyx":674 + * + * def __init__(self, size_hint=1): + * self.table = kh_init_pymap() # <<<<<<<<<<<<<< + * kh_resize_pymap(self.table, size_hint) + * + */ + __pyx_v_self->table = kh_init_pymap(); + + /* "pandas/hashtable.pyx":675 + * def __init__(self, size_hint=1): + * self.table = kh_init_pymap() + * kh_resize_pymap(self.table, size_hint) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_1 = __Pyx_PyInt_As_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_1 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + kh_resize_pymap(__pyx_v_self->table, __pyx_t_1); + + /* "pandas/hashtable.pyx":673 + * # cdef kh_pymap_t *table + * + * def __init__(self, size_hint=1): # <<<<<<<<<<<<<< + * self.table = kh_init_pymap() + * kh_resize_pymap(self.table, size_hint) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":677 + * kh_resize_pymap(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.table is not NULL: + * self.destroy() + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_2__dealloc__(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_2__dealloc__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/hashtable.pyx":678 + * + * def __dealloc__(self): + * if self.table is not NULL: # <<<<<<<<<<<<<< + * self.destroy() + * + */ + __pyx_t_1 = ((__pyx_v_self->table != NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/hashtable.pyx":679 + * def __dealloc__(self): + * if self.table is not NULL: + * self.destroy() # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":677 + * kh_resize_pymap(self.table, size_hint) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.table is not NULL: + * self.destroy() + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("pandas.hashtable.PyObjectHashTable.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/hashtable.pyx":681 + * self.destroy() + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_5__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_5__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_4__len__(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_4__len__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/hashtable.pyx":682 + * + * def __len__(self): + * return self.table.size # <<<<<<<<<<<<<< + * + * def __contains__(self, object key): + */ + __pyx_r = __pyx_v_self->table->size; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":681 + * self.destroy() + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self.table.size + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":684 + * return self.table.size + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * hash(key) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_7__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_6__contains__(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyObject *)__pyx_v_key)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_6__contains__(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key) { + khiter_t __pyx_v_k; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_hash_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + __Pyx_INCREF(__pyx_v_key); + + /* "pandas/hashtable.pyx":686 + * def __contains__(self, object key): + * cdef khiter_t k + * hash(key) # <<<<<<<<<<<<<< + * if key != key or key is None: + * key = na_sentinel + */ + __pyx_t_1 = PyObject_Hash(__pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":687 + * cdef khiter_t k + * hash(key) + * if key != key or key is None: # <<<<<<<<<<<<<< + * key = na_sentinel + * k = kh_get_pymap(self.table, key) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_v_key, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) { + __pyx_t_4 = (__pyx_v_key == Py_None); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":688 + * hash(key) + * if key != key or key is None: + * key = na_sentinel # <<<<<<<<<<<<<< + * k = kh_get_pymap(self.table, key) + * return k != self.table.n_buckets + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":689 + * if key != key or key is None: + * key = na_sentinel + * k = kh_get_pymap(self.table, key) # <<<<<<<<<<<<<< + * return k != self.table.n_buckets + * + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_key)); + + /* "pandas/hashtable.pyx":690 + * key = na_sentinel + * k = kh_get_pymap(self.table, key) + * return k != self.table.n_buckets # <<<<<<<<<<<<<< + * + * def destroy(self): + */ + __pyx_r = (__pyx_v_k != __pyx_v_self->table->n_buckets); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":684 + * return self.table.size + * + * def __contains__(self, object key): # <<<<<<<<<<<<<< + * cdef khiter_t k + * hash(key) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":692 + * return k != self.table.n_buckets + * + * def destroy(self): # <<<<<<<<<<<<<< + * kh_destroy_pymap(self.table) + * self.table = NULL + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_9destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_9destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_8destroy(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_8destroy(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy", 0); + + /* "pandas/hashtable.pyx":693 + * + * def destroy(self): + * kh_destroy_pymap(self.table) # <<<<<<<<<<<<<< + * self.table = NULL + * + */ + kh_destroy_pymap(__pyx_v_self->table); + + /* "pandas/hashtable.pyx":694 + * def destroy(self): + * kh_destroy_pymap(self.table) + * self.table = NULL # <<<<<<<<<<<<<< + * + * cpdef get_item(self, object val): + */ + __pyx_v_self->table = NULL; + + /* "pandas/hashtable.pyx":692 + * return k != self.table.n_buckets + * + * def destroy(self): # <<<<<<<<<<<<<< + * kh_destroy_pymap(self.table) + * self.table = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":696 + * self.table = NULL + * + * cpdef get_item(self, object val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * if val != val or val is None: + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_17PyObjectHashTable_get_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_INCREF(__pyx_v_val); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":698 + * cpdef get_item(self, object val): + * cdef khiter_t k + * if val != val or val is None: # <<<<<<<<<<<<<< + * val = na_sentinel + * k = kh_get_pymap(self.table, val) + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_4) { + __pyx_t_5 = (__pyx_v_val == Py_None); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":699 + * cdef khiter_t k + * if val != val or val is None: + * val = na_sentinel # <<<<<<<<<<<<<< + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":700 + * if val != val or val is None: + * val = na_sentinel + * k = kh_get_pymap(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * return self.table.vals[k] + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":701 + * val = na_sentinel + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * return self.table.vals[k] + * else: + */ + __pyx_t_6 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_6) { + + /* "pandas/hashtable.pyx":702 + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: + * return self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/hashtable.pyx":704 + * return self.table.vals[k] + * else: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_iter_test(self, object key, Py_ssize_t iterations): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/hashtable.pyx":696 + * self.table = NULL + * + * cpdef get_item(self, object val): # <<<<<<<<<<<<<< + * cdef khiter_t k + * if val != val or val is None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_item (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_10get_item(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_10get_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self->__pyx_vtab)->get_item(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":706 + * raise KeyError(val) + * + * def get_iter_test(self, object key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val + * if key != key or key is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_13get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_13get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + Py_ssize_t __pyx_v_iterations; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_iter_test (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_iterations,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iterations)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_iter_test") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_12get_iter_test(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_iterations); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_12get_iter_test(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_iterations) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_val; + khint_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_iter_test", 0); + __Pyx_INCREF(__pyx_v_key); + + /* "pandas/hashtable.pyx":708 + * def get_iter_test(self, object key, Py_ssize_t iterations): + * cdef Py_ssize_t i, val + * if key != key or key is None: # <<<<<<<<<<<<<< + * key = na_sentinel + * for i in range(iterations): + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_v_key, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __pyx_t_3 = (__pyx_v_key == Py_None); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":709 + * cdef Py_ssize_t i, val + * if key != key or key is None: + * key = na_sentinel # <<<<<<<<<<<<<< + * for i in range(iterations): + * k = kh_get_pymap(self.table, key) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":710 + * if key != key or key is None: + * key = na_sentinel + * for i in range(iterations): # <<<<<<<<<<<<<< + * k = kh_get_pymap(self.table, key) + * if k != self.table.n_buckets: + */ + __pyx_t_5 = __pyx_v_iterations; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/hashtable.pyx":711 + * key = na_sentinel + * for i in range(iterations): + * k = kh_get_pymap(self.table, key) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * val = self.table.vals[k] + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_key)); + + /* "pandas/hashtable.pyx":712 + * for i in range(iterations): + * k = kh_get_pymap(self.table, key) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * val = self.table.vals[k] + * + */ + __pyx_t_4 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":713 + * k = kh_get_pymap(self.table, key) + * if k != self.table.n_buckets: + * val = self.table.vals[k] # <<<<<<<<<<<<<< + * + * cpdef set_item(self, object key, Py_ssize_t val): + */ + __pyx_v_val = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L6; + } + __pyx_L6:; + } + + /* "pandas/hashtable.pyx":706 + * raise KeyError(val) + * + * def get_iter_test(self, object key, Py_ssize_t iterations): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, val + * if key != key or key is None: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":715 + * val = self.table.vals[k] + * + * cpdef set_item(self, object key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_17PyObjectHashTable_set_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) { + khiter_t __pyx_v_k; + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_hash_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_INCREF(__pyx_v_key); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/hashtable.pyx":718 + * cdef: + * khiter_t k + * int ret = 0 # <<<<<<<<<<<<<< + * char* buf + * + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":721 + * char* buf + * + * hash(key) # <<<<<<<<<<<<<< + * if key != key or key is None: + * key = na_sentinel + */ + __pyx_t_4 = PyObject_Hash(__pyx_v_key); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":722 + * + * hash(key) + * if key != key or key is None: # <<<<<<<<<<<<<< + * key = na_sentinel + * k = kh_put_pymap(self.table, key, &ret) + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_v_key, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_5) { + __pyx_t_6 = (__pyx_v_key == Py_None); + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_5; + } + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":723 + * hash(key) + * if key != key or key is None: + * key = na_sentinel # <<<<<<<<<<<<<< + * k = kh_put_pymap(self.table, key, &ret) + * # self.table.keys[k] = key + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":724 + * if key != key or key is None: + * key = na_sentinel + * k = kh_put_pymap(self.table, key, &ret) # <<<<<<<<<<<<<< + * # self.table.keys[k] = key + * if kh_exist_pymap(self.table, k): + */ + __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_key), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":726 + * k = kh_put_pymap(self.table, key, &ret) + * # self.table.keys[k] = key + * if kh_exist_pymap(self.table, k): # <<<<<<<<<<<<<< + * self.table.vals[k] = val + * else: + */ + __pyx_t_7 = (kh_exist_pymap(__pyx_v_self->table, __pyx_v_k) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":727 + * # self.table.keys[k] = key + * if kh_exist_pymap(self.table, k): + * self.table.vals[k] = val # <<<<<<<<<<<<<< + * else: + * raise KeyError(key) + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/hashtable.pyx":729 + * self.table.vals[k] = val + * else: + * raise KeyError(key) # <<<<<<<<<<<<<< + * + * def map_locations(self, ndarray[object] values): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + + /* "pandas/hashtable.pyx":715 + * val = self.table.vals[k] + * + * cpdef set_item(self, object key, Py_ssize_t val): # <<<<<<<<<<<<<< + * cdef: + * khiter_t k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + Py_ssize_t __pyx_v_val; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_item (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_val,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_item") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_key = values[0]; + __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_14set_item(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_14set_item(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_item", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self->__pyx_vtab)->set_item(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":731 + * raise KeyError(key) + * + * def map_locations(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_17map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_locations (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_16map_locations(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_16map_locations(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_hash_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_locations", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":733 + * def map_locations(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":734 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":738 + * khiter_t k + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * hash(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":739 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * hash(val) + * if val != val or val is None: + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/hashtable.pyx":740 + * for i in range(n): + * val = values[i] + * hash(val) # <<<<<<<<<<<<<< + * if val != val or val is None: + * val = na_sentinel + */ + __pyx_t_6 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":741 + * val = values[i] + * hash(val) + * if val != val or val is None: # <<<<<<<<<<<<<< + * val = na_sentinel + * + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_7) { + __pyx_t_8 = (__pyx_v_val == Py_None); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":742 + * hash(val) + * if val != val or val is None: + * val = na_sentinel # <<<<<<<<<<<<<< + * + * k = kh_put_pymap(self.table, val, &ret) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/hashtable.pyx":744 + * val = na_sentinel + * + * k = kh_put_pymap(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = i + * + */ + __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":745 + * + * k = kh_put_pymap(self.table, val, &ret) + * self.table.vals[k] = i # <<<<<<<<<<<<<< + * + * def lookup(self, ndarray[object] values): + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_i; + } + + /* "pandas/hashtable.pyx":731 + * raise KeyError(key) + * + * def map_locations(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":747 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_19lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_18lookup(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_18lookup(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + khiter_t __pyx_v_k; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_hash_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":749 + * def lookup(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":750 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":753 + * object val + * khiter_t k + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":755 + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * hash(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/hashtable.pyx":756 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * hash(val) + * if val != val or val is None: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":757 + * for i in range(n): + * val = values[i] + * hash(val) # <<<<<<<<<<<<<< + * if val != val or val is None: + * val = na_sentinel + */ + __pyx_t_11 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":758 + * val = values[i] + * hash(val) + * if val != val or val is None: # <<<<<<<<<<<<<< + * val = na_sentinel + * + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_12) { + __pyx_t_13 = (__pyx_v_val == Py_None); + __pyx_t_14 = __pyx_t_13; + } else { + __pyx_t_14 = __pyx_t_12; + } + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":759 + * hash(val) + * if val != val or val is None: + * val = na_sentinel # <<<<<<<<<<<<<< + * + * k = kh_get_pymap(self.table, val) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_sentinel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/hashtable.pyx":761 + * val = na_sentinel + * + * k = kh_get_pymap(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":762 + * + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * locs[i] = self.table.vals[k] + * else: + */ + __pyx_t_14 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_14) { + + /* "pandas/hashtable.pyx":763 + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: + * locs[i] = self.table.vals[k] # <<<<<<<<<<<<<< + * else: + * locs[i] = -1 + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_locs.diminfo[0].strides) = (__pyx_v_self->table->vals[__pyx_v_k]); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":765 + * locs[i] = self.table.vals[k] + * else: + * locs[i] = -1 # <<<<<<<<<<<<<< + * + * return locs + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_locs.diminfo[0].strides) = -1; + } + __pyx_L6:; + } + + /* "pandas/hashtable.pyx":767 + * locs[i] = -1 + * + * return locs # <<<<<<<<<<<<<< + * + * def lookup2(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":747 + * self.table.vals[k] = i + * + * def lookup(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":769 + * return locs + * + * def lookup2(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_21lookup2(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_21lookup2(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup2 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_20lookup2(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_20lookup2(CYTHON_UNUSED struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED int __pyx_v_ret; + PyArrayObject *__pyx_v_locs = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup2", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":771 + * def lookup2(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":772 + * cdef: + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":776 + * khiter_t k + * long hval + * ndarray[int64_t] locs = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * # for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_locs = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":783 + * # k = kh_get_pymap(self.table, val) + * + * return locs # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_locs)); + __pyx_r = ((PyObject *)__pyx_v_locs); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":769 + * return locs + * + * def lookup2(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.lookup2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":785 + * return locs + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_23unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_23unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_22unique(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_22unique(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_result = 0; + khiter_t __pyx_v_k; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques = 0; + int __pyx_v_seen_na; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_hash_t __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":787 + * def unique(self, ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * Py_ssize_t idx, count = 0 + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":788 + * cdef: + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_v_count = 0; + + /* "pandas/hashtable.pyx":789 + * Py_ssize_t i, n = len(values) + * Py_ssize_t idx, count = 0 + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * ndarray result + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":793 + * ndarray result + * khiter_t k + * ObjectVector uniques = ObjectVector() # <<<<<<<<<<<<<< + * bint seen_na = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_ObjectVector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":794 + * khiter_t k + * ObjectVector uniques = ObjectVector() + * bint seen_na = 0 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_seen_na = 0; + + /* "pandas/hashtable.pyx":796 + * bint seen_na = 0 + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * hash(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/hashtable.pyx":797 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * hash(val) + * if not _checknan(val): + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":798 + * for i in range(n): + * val = values[i] + * hash(val) # <<<<<<<<<<<<<< + * if not _checknan(val): + * k = kh_get_pymap(self.table, val) + */ + __pyx_t_6 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":799 + * val = values[i] + * hash(val) + * if not _checknan(val): # <<<<<<<<<<<<<< + * k = kh_get_pymap(self.table, val) + * if k == self.table.n_buckets: + */ + __pyx_t_7 = ((!(__pyx_f_4util__checknan(__pyx_v_val) != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":800 + * hash(val) + * if not _checknan(val): + * k = kh_get_pymap(self.table, val) # <<<<<<<<<<<<<< + * if k == self.table.n_buckets: + * k = kh_put_pymap(self.table, val, &ret) + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":801 + * if not _checknan(val): + * k = kh_get_pymap(self.table, val) + * if k == self.table.n_buckets: # <<<<<<<<<<<<<< + * k = kh_put_pymap(self.table, val, &ret) + * uniques.append(val) + */ + __pyx_t_7 = ((__pyx_v_k == __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":802 + * k = kh_get_pymap(self.table, val) + * if k == self.table.n_buckets: + * k = kh_put_pymap(self.table, val, &ret) # <<<<<<<<<<<<<< + * uniques.append(val) + * elif not seen_na: + */ + __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":803 + * if k == self.table.n_buckets: + * k = kh_put_pymap(self.table, val, &ret) + * uniques.append(val) # <<<<<<<<<<<<<< + * elif not seen_na: + * seen_na = 1 + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_12ObjectVector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + + /* "pandas/hashtable.pyx":804 + * k = kh_put_pymap(self.table, val, &ret) + * uniques.append(val) + * elif not seen_na: # <<<<<<<<<<<<<< + * seen_na = 1 + * uniques.append(ONAN) + */ + __pyx_t_7 = ((!(__pyx_v_seen_na != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":805 + * uniques.append(val) + * elif not seen_na: + * seen_na = 1 # <<<<<<<<<<<<<< + * uniques.append(ONAN) + * + */ + __pyx_v_seen_na = 1; + + /* "pandas/hashtable.pyx":806 + * elif not seen_na: + * seen_na = 1 + * uniques.append(ONAN) # <<<<<<<<<<<<<< + * + * result = uniques.to_array() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ONAN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __pyx_f_6pandas_9hashtable_12ObjectVector_append(__pyx_v_uniques, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":808 + * uniques.append(ONAN) + * + * result = uniques.to_array() # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":810 + * result = uniques.to_array() + * + * return result # <<<<<<<<<<<<<< + * + * def get_labels(self, ndarray[object] values, ObjectVector uniques, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":785 + * return locs + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_uniques); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":812 + * return result + * + * def get_labels(self, ndarray[object] values, ObjectVector uniques, # <<<<<<<<<<<<<< + * Py_ssize_t count_prior, int64_t na_sentinel): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_25get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_25get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques = 0; + Py_ssize_t __pyx_v_count_prior; + __pyx_t_5numpy_int64_t __pyx_v_na_sentinel; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_labels (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_uniques,&__pyx_n_s_count_prior,&__pyx_n_s_na_sentinel,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_uniques)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count_prior)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_labels") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)values[1]); + __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_na_sentinel = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_na_sentinel == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), __pyx_ptype_6pandas_9hashtable_ObjectVector, 1, "uniques", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_17PyObjectHashTable_24get_labels(((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_v_self), __pyx_v_values, __pyx_v_uniques, __pyx_v_count_prior, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_17PyObjectHashTable_24get_labels(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, struct __pyx_obj_6pandas_9hashtable_ObjectVector *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_idx; + Py_ssize_t __pyx_v_count; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_hash_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_labels", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":815 + * Py_ssize_t count_prior, int64_t na_sentinel): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":817 + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior # <<<<<<<<<<<<<< + * int ret = 0 + * object val + */ + __pyx_v_count = __pyx_v_count_prior; + + /* "pandas/hashtable.pyx":818 + * ndarray[int64_t] labels + * Py_ssize_t idx, count = count_prior + * int ret = 0 # <<<<<<<<<<<<<< + * object val + * khiter_t k + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":822 + * khiter_t k + * + * labels = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_labels = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":824 + * labels = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * hash(val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/hashtable.pyx":825 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * hash(val) + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":826 + * for i in range(n): + * val = values[i] + * hash(val) # <<<<<<<<<<<<<< + * + * if val != val or val is None: + */ + __pyx_t_14 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":828 + * hash(val) + * + * if val != val or val is None: # <<<<<<<<<<<<<< + * labels[i] = na_sentinel + * continue + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_15) { + __pyx_t_16 = (__pyx_v_val == Py_None); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_15; + } + if (__pyx_t_17) { + + /* "pandas/hashtable.pyx":829 + * + * if val != val or val is None: + * labels[i] = na_sentinel # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_na_sentinel; + + /* "pandas/hashtable.pyx":830 + * if val != val or val is None: + * labels[i] = na_sentinel + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_pymap(self.table, val) + */ + goto __pyx_L3_continue; + } + + /* "pandas/hashtable.pyx":832 + * continue + * + * k = kh_get_pymap(self.table, val) # <<<<<<<<<<<<<< + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + */ + __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":833 + * + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: # <<<<<<<<<<<<<< + * idx = self.table.vals[k] + * labels[i] = idx + */ + __pyx_t_17 = ((__pyx_v_k != __pyx_v_self->table->n_buckets) != 0); + if (__pyx_t_17) { + + /* "pandas/hashtable.pyx":834 + * k = kh_get_pymap(self.table, val) + * if k != self.table.n_buckets: + * idx = self.table.vals[k] # <<<<<<<<<<<<<< + * labels[i] = idx + * else: + */ + __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":835 + * if k != self.table.n_buckets: + * idx = self.table.vals[k] + * labels[i] = idx # <<<<<<<<<<<<<< + * else: + * k = kh_put_pymap(self.table, val, &ret) + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_idx; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":837 + * labels[i] = idx + * else: + * k = kh_put_pymap(self.table, val, &ret) # <<<<<<<<<<<<<< + * self.table.vals[k] = count + * uniques.append(val) + */ + __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":838 + * else: + * k = kh_put_pymap(self.table, val, &ret) + * self.table.vals[k] = count # <<<<<<<<<<<<<< + * uniques.append(val) + * labels[i] = count + */ + (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count; + + /* "pandas/hashtable.pyx":839 + * k = kh_put_pymap(self.table, val, &ret) + * self.table.vals[k] = count + * uniques.append(val) # <<<<<<<<<<<<<< + * labels[i] = count + * count += 1 + */ + __pyx_t_6 = __pyx_f_6pandas_9hashtable_12ObjectVector_append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":840 + * self.table.vals[k] = count + * uniques.append(val) + * labels[i] = count # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_labels.diminfo[0].strides) = __pyx_v_count; + + /* "pandas/hashtable.pyx":841 + * uniques.append(val) + * labels[i] = count + * count += 1 # <<<<<<<<<<<<<< + * + * return labels + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":843 + * count += 1 + * + * return labels # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_labels)); + __pyx_r = ((PyObject *)__pyx_v_labels); + goto __pyx_L0; + + /* "pandas/hashtable.pyx":812 + * return result + * + * def get_labels(self, ndarray[object] values, ObjectVector uniques, # <<<<<<<<<<<<<< + * Py_ssize_t count_prior, int64_t na_sentinel): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.PyObjectHashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":851 + * cdef public Py_ssize_t count + * + * def __init__(self, size_hint): # <<<<<<<<<<<<<< + * self.table = PyObjectHashTable(size_hint) + * self.uniques = ObjectVector() + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer___init__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer___init__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/hashtable.pyx":852 + * + * def __init__(self, size_hint): + * self.table = PyObjectHashTable(size_hint) # <<<<<<<<<<<<<< + * self.uniques = ObjectVector() + * self.count = 0 + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_size_hint); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size_hint); + __Pyx_GIVEREF(__pyx_v_size_hint); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_PyObjectHashTable)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":853 + * def __init__(self, size_hint): + * self.table = PyObjectHashTable(size_hint) + * self.uniques = ObjectVector() # <<<<<<<<<<<<<< + * self.count = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_ObjectVector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":854 + * self.table = PyObjectHashTable(size_hint) + * self.uniques = ObjectVector() + * self.count = 0 # <<<<<<<<<<<<<< + * + * def get_count(self): + */ + __pyx_v_self->count = 0; + + /* "pandas/hashtable.pyx":851 + * cdef public Py_ssize_t count + * + * def __init__(self, size_hint): # <<<<<<<<<<<<<< + * self.table = PyObjectHashTable(size_hint) + * self.uniques = ObjectVector() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":856 + * self.count = 0 + * + * def get_count(self): # <<<<<<<<<<<<<< + * return self.count + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_3get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_3get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_count (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_2get_count(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_2get_count(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_count", 0); + + /* "pandas/hashtable.pyx":857 + * + * def get_count(self): + * return self.count # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":856 + * self.count = 0 + * + * def get_count(self): # <<<<<<<<<<<<<< + * return self.count + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":859 + * return self.count + * + * def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1): # <<<<<<<<<<<<<< + * """ + * Factorize values with nans replaced by na_sentinel + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_9hashtable_10Factorizer_4factorize[] = "\n Factorize values with nans replaced by na_sentinel\n >>> factorize(np.array([1,2,np.nan], dtype='O'), na_sentinel=20)\n array([ 0, 1, 20])\n "; +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_sort = 0; + PyObject *__pyx_v_na_sentinel = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_sort,&__pyx_n_s_na_sentinel,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)__pyx_int_neg_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sort); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_sort = values[1]; + __pyx_v_na_sentinel = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("factorize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_4factorize(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), __pyx_v_values, __pyx_v_sort, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_4factorize(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_sort, PyObject *__pyx_v_na_sentinel) { + PyObject *__pyx_v_labels = NULL; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_v_sorter = NULL; + PyObject *__pyx_v_reverse_indexer = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":865 + * array([ 0, 1, 20]) + * """ + * labels = self.table.get_labels(values, self.uniques, # <<<<<<<<<<<<<< + * self.count, na_sentinel) + * mask = (labels == na_sentinel) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->table), __pyx_n_s_get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/hashtable.pyx":866 + * """ + * labels = self.table.get_labels(values, self.uniques, + * self.count, na_sentinel) # <<<<<<<<<<<<<< + * mask = (labels == na_sentinel) + * # sort on + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/hashtable.pyx":865 + * array([ 0, 1, 20]) + * """ + * labels = self.table.get_labels(values, self.uniques, # <<<<<<<<<<<<<< + * self.count, na_sentinel) + * mask = (labels == na_sentinel) + */ + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->uniques)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->uniques)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->uniques)); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_na_sentinel); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_na_sentinel); + __Pyx_GIVEREF(__pyx_v_na_sentinel); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_labels = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":867 + * labels = self.table.get_labels(values, self.uniques, + * self.count, na_sentinel) + * mask = (labels == na_sentinel) # <<<<<<<<<<<<<< + * # sort on + * if sort: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_labels, __pyx_v_na_sentinel, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_mask = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":869 + * mask = (labels == na_sentinel) + * # sort on + * if sort: # <<<<<<<<<<<<<< + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":870 + * # sort on + * if sort: + * if labels.dtype != np.int_: # <<<<<<<<<<<<<< + * labels = labels.astype(np.int_) + * sorter = self.uniques.to_array().argsort() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":871 + * if sort: + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) # <<<<<<<<<<<<<< + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/hashtable.pyx":872 + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) + * sorter = self.uniques.to_array().argsort() # <<<<<<<<<<<<<< + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_sorter = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":873 + * labels = labels.astype(np.int_) + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) # <<<<<<<<<<<<<< + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * labels = reverse_indexer.take(labels, mode='clip') + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_reverse_indexer = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/hashtable.pyx":874 + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) # <<<<<<<<<<<<<< + * labels = reverse_indexer.take(labels, mode='clip') + * labels[mask] = na_sentinel + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse_indexer, __pyx_n_s_put); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_sorter); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sorter); + __Pyx_GIVEREF(__pyx_v_sorter); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":875 + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * labels = reverse_indexer.take(labels, mode='clip') # <<<<<<<<<<<<<< + * labels[mask] = na_sentinel + * self.count = len(self.uniques) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse_indexer, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_labels); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_s_clip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/hashtable.pyx":876 + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * labels = reverse_indexer.take(labels, mode='clip') + * labels[mask] = na_sentinel # <<<<<<<<<<<<<< + * self.count = len(self.uniques) + * return labels + */ + if (unlikely(PyObject_SetItem(__pyx_v_labels, __pyx_v_mask, __pyx_v_na_sentinel) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":877 + * labels = reverse_indexer.take(labels, mode='clip') + * labels[mask] = na_sentinel + * self.count = len(self.uniques) # <<<<<<<<<<<<<< + * return labels + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->uniques); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->count = __pyx_t_5; + + /* "pandas/hashtable.pyx":878 + * labels[mask] = na_sentinel + * self.count = len(self.uniques) + * return labels # <<<<<<<<<<<<<< + * + * def unique(self, ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_labels); + __pyx_r = __pyx_v_labels; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":859 + * return self.count + * + * def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1): # <<<<<<<<<<<<<< + * """ + * Factorize values with nans replaced by na_sentinel + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v_sorter); + __Pyx_XDECREF(__pyx_v_reverse_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":880 + * return labels + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * # just for fun + * return self.table.unique(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_7unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_7unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_6unique(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_6unique(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":882 + * def unique(self, ndarray[object] values): + * # just for fun + * return self.table.unique(values) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->table), __pyx_n_s_unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":880 + * return labels + * + * def unique(self, ndarray[object] values): # <<<<<<<<<<<<<< + * # just for fun + * return self.table.unique(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Factorizer.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":847 + * + * cdef class Factorizer: + * cdef public PyObjectHashTable table # <<<<<<<<<<<<<< + * cdef public ObjectVector uniques + * cdef public Py_ssize_t count + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5table_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5table_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5table___get__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_5table___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->table)); + __pyx_r = ((PyObject *)__pyx_v_self->table); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5table_2__set__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5table_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_9hashtable_PyObjectHashTable))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5table_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5table_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5table_4__del__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5table_4__del__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":848 + * cdef class Factorizer: + * cdef public PyObjectHashTable table + * cdef public ObjectVector uniques # <<<<<<<<<<<<<< + * cdef public Py_ssize_t count + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques___get__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_7uniques___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_r = ((PyObject *)__pyx_v_self->uniques); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_2__set__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_9hashtable_ObjectVector))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.uniques.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_4__del__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_7uniques_4__del__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":849 + * cdef public PyObjectHashTable table + * cdef public ObjectVector uniques + * cdef public Py_ssize_t count # <<<<<<<<<<<<<< + * + * def __init__(self, size_hint): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5count_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_10Factorizer_5count_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5count___get__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_10Factorizer_5count___get__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Factorizer.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_10Factorizer_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_10Factorizer_5count_2__set__(((struct __pyx_obj_6pandas_9hashtable_Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_10Factorizer_5count_2__set__(struct __pyx_obj_6pandas_9hashtable_Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->count = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Factorizer.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":890 + * cdef public Py_ssize_t count + * + * def __init__(self, size_hint): # <<<<<<<<<<<<<< + * self.table = Int64HashTable(size_hint) + * self.uniques = Int64Vector() + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_size_hint = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size_hint,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size_hint)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_size_hint = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer___init__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), __pyx_v_size_hint); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer___init__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_size_hint) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/hashtable.pyx":891 + * + * def __init__(self, size_hint): + * self.table = Int64HashTable(size_hint) # <<<<<<<<<<<<<< + * self.uniques = Int64Vector() + * self.count = 0 + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_size_hint); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size_hint); + __Pyx_GIVEREF(__pyx_v_size_hint); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Int64HashTable)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":892 + * def __init__(self, size_hint): + * self.table = Int64HashTable(size_hint) + * self.uniques = Int64Vector() # <<<<<<<<<<<<<< + * self.count = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_9hashtable_Int64Vector)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":893 + * self.table = Int64HashTable(size_hint) + * self.uniques = Int64Vector() + * self.count = 0 # <<<<<<<<<<<<<< + * + * def get_count(self): + */ + __pyx_v_self->count = 0; + + /* "pandas/hashtable.pyx":890 + * cdef public Py_ssize_t count + * + * def __init__(self, size_hint): # <<<<<<<<<<<<<< + * self.table = Int64HashTable(size_hint) + * self.uniques = Int64Vector() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":895 + * self.count = 0 + * + * def get_count(self): # <<<<<<<<<<<<<< + * return self.count + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_3get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_3get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_count (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_2get_count(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_2get_count(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_count", 0); + + /* "pandas/hashtable.pyx":896 + * + * def get_count(self): + * return self.count # <<<<<<<<<<<<<< + * + * def factorize(self, ndarray[int64_t] values, sort=False, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":895 + * self.count = 0 + * + * def get_count(self): # <<<<<<<<<<<<<< + * return self.count + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":898 + * return self.count + * + * def factorize(self, ndarray[int64_t] values, sort=False, # <<<<<<<<<<<<<< + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_sort = 0; + PyObject *__pyx_v_na_sentinel = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("factorize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_sort,&__pyx_n_s_na_sentinel,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)__pyx_int_neg_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sort); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_sentinel); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_sort = values[1]; + __pyx_v_na_sentinel = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("factorize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_4factorize(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), __pyx_v_values, __pyx_v_sort, __pyx_v_na_sentinel); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_4factorize(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_sort, PyObject *__pyx_v_na_sentinel) { + PyObject *__pyx_v_labels = NULL; + PyObject *__pyx_v_sorter = NULL; + PyObject *__pyx_v_reverse_indexer = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("factorize", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":900 + * def factorize(self, ndarray[int64_t] values, sort=False, + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, # <<<<<<<<<<<<<< + * self.count, na_sentinel) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->table), __pyx_n_s_get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/hashtable.pyx":901 + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, + * self.count, na_sentinel) # <<<<<<<<<<<<<< + * + * # sort on + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/hashtable.pyx":900 + * def factorize(self, ndarray[int64_t] values, sort=False, + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, # <<<<<<<<<<<<<< + * self.count, na_sentinel) + * + */ + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->uniques)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->uniques)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->uniques)); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_na_sentinel); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_na_sentinel); + __Pyx_GIVEREF(__pyx_v_na_sentinel); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_labels = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":904 + * + * # sort on + * if sort: # <<<<<<<<<<<<<< + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":905 + * # sort on + * if sort: + * if labels.dtype != np.int_: # <<<<<<<<<<<<<< + * labels = labels.astype(np.int_) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/hashtable.pyx":906 + * if sort: + * if labels.dtype != np.int_: + * labels = labels.astype(np.int_) # <<<<<<<<<<<<<< + * + * sorter = self.uniques.to_array().argsort() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/hashtable.pyx":908 + * labels = labels.astype(np.int_) + * + * sorter = self.uniques.to_array().argsort() # <<<<<<<<<<<<<< + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->uniques), __pyx_n_s_to_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_sorter = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":909 + * + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) # <<<<<<<<<<<<<< + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_reverse_indexer = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/hashtable.pyx":910 + * sorter = self.uniques.to_array().argsort() + * reverse_indexer = np.empty(len(sorter), dtype=np.int_) + * reverse_indexer.put(sorter, np.arange(len(sorter))) # <<<<<<<<<<<<<< + * + * labels = reverse_indexer.take(labels) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse_indexer, __pyx_n_s_put); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_sorter); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sorter); + __Pyx_GIVEREF(__pyx_v_sorter); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":912 + * reverse_indexer.put(sorter, np.arange(len(sorter))) + * + * labels = reverse_indexer.take(labels) # <<<<<<<<<<<<<< + * + * self.count = len(self.uniques) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse_indexer, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_labels); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/hashtable.pyx":914 + * labels = reverse_indexer.take(labels) + * + * self.count = len(self.uniques) # <<<<<<<<<<<<<< + * return labels + * + */ + __pyx_t_7 = ((PyObject *)__pyx_v_self->uniques); + __Pyx_INCREF(__pyx_t_7); + __pyx_t_5 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_self->count = __pyx_t_5; + + /* "pandas/hashtable.pyx":915 + * + * self.count = len(self.uniques) + * return labels # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_labels); + __pyx_r = __pyx_v_labels; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":898 + * return self.count + * + * def factorize(self, ndarray[int64_t] values, sort=False, # <<<<<<<<<<<<<< + * na_sentinel=-1): + * labels = self.table.get_labels(values, self.uniques, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_sorter); + __Pyx_XDECREF(__pyx_v_reverse_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":886 + * + * cdef class Int64Factorizer: + * cdef public Int64HashTable table # <<<<<<<<<<<<<< + * cdef public Int64Vector uniques + * cdef public Py_ssize_t count + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table___get__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->table)); + __pyx_r = ((PyObject *)__pyx_v_self->table); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_2__set__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_9hashtable_Int64HashTable))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_4__del__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5table_4__del__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->table); + __Pyx_DECREF(((PyObject *)__pyx_v_self->table)); + __pyx_v_self->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":887 + * cdef class Int64Factorizer: + * cdef public Int64HashTable table + * cdef public Int64Vector uniques # <<<<<<<<<<<<<< + * cdef public Py_ssize_t count + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques___get__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_r = ((PyObject *)__pyx_v_self->uniques); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_2__set__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_9hashtable_Int64Vector))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.uniques.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_4__del__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_7uniques_4__del__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->uniques); + __Pyx_DECREF(((PyObject *)__pyx_v_self->uniques)); + __pyx_v_self->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":888 + * cdef public Int64HashTable table + * cdef public Int64Vector uniques + * cdef public Py_ssize_t count # <<<<<<<<<<<<<< + * + * def __init__(self, size_hint): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count___get__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count___get__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count_2__set__(((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_9hashtable_15Int64Factorizer_5count_2__set__(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->count = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.hashtable.Int64Factorizer.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":918 + * + * + * cdef build_count_table_int64(ndarray[int64_t] values, kh_int64_t *table): # <<<<<<<<<<<<<< + * cdef: + * int k + */ + +static PyObject *__pyx_f_6pandas_9hashtable_build_count_table_int64(PyArrayObject *__pyx_v_values, kh_int64_t *__pyx_v_table) { + int __pyx_v_k; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + PyObject *__pyx_v_val = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("build_count_table_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":921 + * cdef: + * int k + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":922 + * int k + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * + * kh_resize_int64(table, n) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":924 + * int ret = 0 + * + * kh_resize_int64(table, n) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + kh_resize_int64(__pyx_v_table, __pyx_v_n); + + /* "pandas/hashtable.pyx":926 + * kh_resize_int64(table, n) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * k = kh_get_int64(table, val) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":927 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(table, val) + * if k != table.n_buckets: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":928 + * for i in range(n): + * val = values[i] + * k = kh_get_int64(table, val) # <<<<<<<<<<<<<< + * if k != table.n_buckets: + * table.vals[k] += 1 + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_get_int64(__pyx_v_table, __pyx_t_6); + + /* "pandas/hashtable.pyx":929 + * val = values[i] + * k = kh_get_int64(table, val) + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * table.vals[k] += 1 + * else: + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/hashtable.pyx":930 + * k = kh_get_int64(table, val) + * if k != table.n_buckets: + * table.vals[k] += 1 # <<<<<<<<<<<<<< + * else: + * k = kh_put_int64(table, val, &ret) + */ + __pyx_t_4 = __pyx_v_k; + (__pyx_v_table->vals[__pyx_t_4]) = ((__pyx_v_table->vals[__pyx_t_4]) + 1); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/hashtable.pyx":932 + * table.vals[k] += 1 + * else: + * k = kh_put_int64(table, val, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = 1 + * + */ + __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_put_int64(__pyx_v_table, __pyx_t_6, (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":933 + * else: + * k = kh_put_int64(table, val, &ret) + * table.vals[k] = 1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_table->vals[__pyx_v_k]) = 1; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":918 + * + * + * cdef build_count_table_int64(ndarray[int64_t] values, kh_int64_t *table): # <<<<<<<<<<<<<< + * cdef: + * int k + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.build_count_table_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":936 + * + * + * cpdef value_count_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_3value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_value_count_int64(PyArrayObject *__pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + kh_int64_t *__pyx_v_table; + CYTHON_UNUSED int __pyx_v_ret; + int __pyx_v_k; + PyObject *__pyx_v_result_keys = NULL; + PyObject *__pyx_v_result_counts = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + khint_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("value_count_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":940 + * Py_ssize_t i + * kh_int64_t *table + * int ret = 0 # <<<<<<<<<<<<<< + * int k + * + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":943 + * int k + * + * table = kh_init_int64() # <<<<<<<<<<<<<< + * build_count_table_int64(values, table) + * + */ + __pyx_v_table = kh_init_int64(); + + /* "pandas/hashtable.pyx":944 + * + * table = kh_init_int64() + * build_count_table_int64(values, table) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_1 = __pyx_f_6pandas_9hashtable_build_count_table_int64(((PyArrayObject *)__pyx_v_values), __pyx_v_table); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":946 + * build_count_table_int64(values, table) + * + * i = 0 # <<<<<<<<<<<<<< + * result_keys = np.empty(table.n_occupied, dtype=np.int64) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + */ + __pyx_v_i = 0; + + /* "pandas/hashtable.pyx":947 + * + * i = 0 + * result_keys = np.empty(table.n_occupied, dtype=np.int64) # <<<<<<<<<<<<<< + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result_keys = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":948 + * i = 0 + * result_keys = np.empty(table.n_occupied, dtype=np.int64) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) # <<<<<<<<<<<<<< + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result_counts = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/hashtable.pyx":949 + * result_keys = np.empty(table.n_occupied, dtype=np.int64) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): # <<<<<<<<<<<<<< + * if kh_exist_int64(table, k): + * result_keys[i] = table.keys[k] + */ + __pyx_t_6 = __pyx_v_table->n_buckets; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_k = __pyx_t_7; + + /* "pandas/hashtable.pyx":950 + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): # <<<<<<<<<<<<<< + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] + */ + __pyx_t_8 = (kh_exist_int64(__pyx_v_table, __pyx_v_k) != 0); + if (__pyx_t_8) { + + /* "pandas/hashtable.pyx":951 + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): + * result_keys[i] = table.keys[k] # <<<<<<<<<<<<<< + * result_counts[i] = table.vals[k] + * i += 1 + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((__pyx_v_table->keys[__pyx_v_k])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_SetItemInt(__pyx_v_result_keys, __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/hashtable.pyx":952 + * if kh_exist_int64(table, k): + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] # <<<<<<<<<<<<<< + * i += 1 + * kh_destroy_int64(table) + */ + __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_SetItemInt(__pyx_v_result_counts, __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/hashtable.pyx":953 + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] + * i += 1 # <<<<<<<<<<<<<< + * kh_destroy_int64(table) + * + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":954 + * result_counts[i] = table.vals[k] + * i += 1 + * kh_destroy_int64(table) # <<<<<<<<<<<<<< + * + * return result_keys, result_counts + */ + kh_destroy_int64(__pyx_v_table); + + /* "pandas/hashtable.pyx":956 + * kh_destroy_int64(table) + * + * return result_keys, result_counts # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result_keys); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result_keys); + __Pyx_GIVEREF(__pyx_v_result_keys); + __Pyx_INCREF(__pyx_v_result_counts); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_result_counts); + __Pyx_GIVEREF(__pyx_v_result_counts); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":936 + * + * + * cpdef value_count_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.value_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result_keys); + __Pyx_XDECREF(__pyx_v_result_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_3value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_3value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("value_count_int64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_2value_count_int64(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_2value_count_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("value_count_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_9hashtable_value_count_int64(__pyx_v_values, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.value_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":959 + * + * + * cdef build_count_table_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * kh_pymap_t *table): + */ + +static PyObject *__pyx_f_6pandas_9hashtable_build_count_table_object(PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, kh_pymap_t *__pyx_v_table) { + int __pyx_v_k; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_ret; + PyObject *__pyx_v_val = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("build_count_table_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":964 + * cdef: + * int k + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * int ret = 0 + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":965 + * int k + * Py_ssize_t i, n = len(values) + * int ret = 0 # <<<<<<<<<<<<<< + * + * kh_resize_pymap(table, n // 10) + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":967 + * int ret = 0 + * + * kh_resize_pymap(table, n // 10) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + kh_resize_pymap(__pyx_v_table, __Pyx_div_Py_ssize_t(__pyx_v_n, 10)); + + /* "pandas/hashtable.pyx":969 + * kh_resize_pymap(table, n // 10) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/hashtable.pyx":970 + * + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":971 + * for i in range(n): + * if mask[i]: + * continue # <<<<<<<<<<<<<< + * + * val = values[i] + */ + goto __pyx_L3_continue; + } + + /* "pandas/hashtable.pyx":973 + * continue + * + * val = values[i] # <<<<<<<<<<<<<< + * k = kh_get_pymap(table, val) + * if k != table.n_buckets: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":974 + * + * val = values[i] + * k = kh_get_pymap(table, val) # <<<<<<<<<<<<<< + * if k != table.n_buckets: + * table.vals[k] += 1 + */ + __pyx_v_k = kh_get_pymap(__pyx_v_table, ((PyObject *)__pyx_v_val)); + + /* "pandas/hashtable.pyx":975 + * val = values[i] + * k = kh_get_pymap(table, val) + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * table.vals[k] += 1 + * else: + */ + __pyx_t_5 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_5) { + + /* "pandas/hashtable.pyx":976 + * k = kh_get_pymap(table, val) + * if k != table.n_buckets: + * table.vals[k] += 1 # <<<<<<<<<<<<<< + * else: + * k = kh_put_pymap(table, val, &ret) + */ + __pyx_t_4 = __pyx_v_k; + (__pyx_v_table->vals[__pyx_t_4]) = ((__pyx_v_table->vals[__pyx_t_4]) + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":978 + * table.vals[k] += 1 + * else: + * k = kh_put_pymap(table, val, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = 1 + * + */ + __pyx_v_k = kh_put_pymap(__pyx_v_table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret)); + + /* "pandas/hashtable.pyx":979 + * else: + * k = kh_put_pymap(table, val, &ret) + * table.vals[k] = 1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_table->vals[__pyx_v_k]) = 1; + } + __pyx_L6:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":959 + * + * + * cdef build_count_table_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask, + * kh_pymap_t *table): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.build_count_table_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":982 + * + * + * cpdef value_count_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + +static PyObject *__pyx_pw_6pandas_9hashtable_5value_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_9hashtable_value_count_object(PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + kh_pymap_t *__pyx_v_table; + int __pyx_v_k; + PyObject *__pyx_v_result_keys = NULL; + PyObject *__pyx_v_result_counts = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + khint_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("value_count_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":985 + * ndarray[uint8_t, cast=True] mask): + * cdef: + * Py_ssize_t i = len(values) # <<<<<<<<<<<<<< + * kh_pymap_t *table + * int k + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = __pyx_t_1; + + /* "pandas/hashtable.pyx":989 + * int k + * + * table = kh_init_pymap() # <<<<<<<<<<<<<< + * build_count_table_object(values, mask, table) + * + */ + __pyx_v_table = kh_init_pymap(); + + /* "pandas/hashtable.pyx":990 + * + * table = kh_init_pymap() + * build_count_table_object(values, mask, table) # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_build_count_table_object(((PyArrayObject *)__pyx_v_values), ((PyArrayObject *)__pyx_v_mask), __pyx_v_table); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":992 + * build_count_table_object(values, mask, table) + * + * i = 0 # <<<<<<<<<<<<<< + * result_keys = np.empty(table.n_occupied, dtype=object) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + */ + __pyx_v_i = 0; + + /* "pandas/hashtable.pyx":993 + * + * i = 0 + * result_keys = np.empty(table.n_occupied, dtype=object) # <<<<<<<<<<<<<< + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result_keys = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":994 + * i = 0 + * result_keys = np.empty(table.n_occupied, dtype=object) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) # <<<<<<<<<<<<<< + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result_counts = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":995 + * result_keys = np.empty(table.n_occupied, dtype=object) + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): # <<<<<<<<<<<<<< + * if kh_exist_pymap(table, k): + * result_keys[i] = table.keys[k] + */ + __pyx_t_7 = __pyx_v_table->n_buckets; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_k = __pyx_t_8; + + /* "pandas/hashtable.pyx":996 + * result_counts = np.zeros(table.n_occupied, dtype=np.int64) + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): # <<<<<<<<<<<<<< + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] + */ + __pyx_t_9 = (kh_exist_pymap(__pyx_v_table, __pyx_v_k) != 0); + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":997 + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): + * result_keys[i] = table.keys[k] # <<<<<<<<<<<<<< + * result_counts[i] = table.vals[k] + * i += 1 + */ + __pyx_t_6 = ((PyObject *)(__pyx_v_table->keys[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_v_result_keys, __pyx_v_i, __pyx_t_6, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":998 + * if kh_exist_pymap(table, k): + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] # <<<<<<<<<<<<<< + * i += 1 + * kh_destroy_pymap(table) + */ + __pyx_t_6 = __Pyx_PyInt_FromSize_t((__pyx_v_table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_v_result_counts, __pyx_v_i, __pyx_t_6, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":999 + * result_keys[i] = table.keys[k] + * result_counts[i] = table.vals[k] + * i += 1 # <<<<<<<<<<<<<< + * kh_destroy_pymap(table) + * + */ + __pyx_v_i = (__pyx_v_i + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/hashtable.pyx":1000 + * result_counts[i] = table.vals[k] + * i += 1 + * kh_destroy_pymap(table) # <<<<<<<<<<<<<< + * + * return result_keys, result_counts + */ + kh_destroy_pymap(__pyx_v_table); + + /* "pandas/hashtable.pyx":1002 + * kh_destroy_pymap(table) + * + * return result_keys, result_counts # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result_keys); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result_keys); + __Pyx_GIVEREF(__pyx_v_result_keys); + __Pyx_INCREF(__pyx_v_result_counts); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_result_counts); + __Pyx_GIVEREF(__pyx_v_result_counts); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":982 + * + * + * cpdef value_count_object(ndarray[object] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.value_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result_keys); + __Pyx_XDECREF(__pyx_v_result_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_5value_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_9hashtable_5value_count_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("value_count_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("value_count_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "value_count_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("value_count_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.value_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_4value_count_object(__pyx_self, __pyx_v_values, __pyx_v_mask); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_4value_count_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("value_count_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_9hashtable_value_count_object(__pyx_v_values, __pyx_v_mask, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.value_count_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":1005 + * + * + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): # <<<<<<<<<<<<<< + * cdef: + * int count, max_count = 2 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_7mode_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_9hashtable_7mode_object = {__Pyx_NAMESTR("mode_object"), (PyCFunction)__pyx_pw_6pandas_9hashtable_7mode_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_9hashtable_7mode_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mode_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("mode_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mode_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.hashtable.mode_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_6mode_object(__pyx_self, __pyx_v_values, __pyx_v_mask); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_6mode_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask) { + int __pyx_v_count; + int __pyx_v_max_count; + int __pyx_v_j; + int __pyx_v_k; + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + kh_pymap_t *__pyx_v_table; + CYTHON_UNUSED int __pyx_v_ret; + PyObject *__pyx_v_modes = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + khint_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mode_object", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":1007 + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): + * cdef: + * int count, max_count = 2 # <<<<<<<<<<<<<< + * int j = -1 # so you can do += + * int k + */ + __pyx_v_max_count = 2; + + /* "pandas/hashtable.pyx":1008 + * cdef: + * int count, max_count = 2 + * int j = -1 # so you can do += # <<<<<<<<<<<<<< + * int k + * Py_ssize_t i, n = len(values) + */ + __pyx_v_j = -1; + + /* "pandas/hashtable.pyx":1010 + * int j = -1 # so you can do += + * int k + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * kh_pymap_t *table + * int ret = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/hashtable.pyx":1012 + * Py_ssize_t i, n = len(values) + * kh_pymap_t *table + * int ret = 0 # <<<<<<<<<<<<<< + * + * table = kh_init_pymap() + */ + __pyx_v_ret = 0; + + /* "pandas/hashtable.pyx":1014 + * int ret = 0 + * + * table = kh_init_pymap() # <<<<<<<<<<<<<< + * build_count_table_object(values, mask, table) + * + */ + __pyx_v_table = kh_init_pymap(); + + /* "pandas/hashtable.pyx":1015 + * + * table = kh_init_pymap() + * build_count_table_object(values, mask, table) # <<<<<<<<<<<<<< + * + * modes = np.empty(table.n_buckets, dtype=np.object_) + */ + __pyx_t_2 = __pyx_f_6pandas_9hashtable_build_count_table_object(((PyArrayObject *)__pyx_v_values), ((PyArrayObject *)__pyx_v_mask), __pyx_v_table); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":1017 + * build_count_table_object(values, mask, table) + * + * modes = np.empty(table.n_buckets, dtype=np.object_) # <<<<<<<<<<<<<< + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_buckets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_modes = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/hashtable.pyx":1018 + * + * modes = np.empty(table.n_buckets, dtype=np.object_) + * for k in range(table.n_buckets): # <<<<<<<<<<<<<< + * if kh_exist_pymap(table, k): + * count = table.vals[k] + */ + __pyx_t_7 = __pyx_v_table->n_buckets; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_k = __pyx_t_8; + + /* "pandas/hashtable.pyx":1019 + * modes = np.empty(table.n_buckets, dtype=np.object_) + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): # <<<<<<<<<<<<<< + * count = table.vals[k] + * + */ + __pyx_t_9 = (kh_exist_pymap(__pyx_v_table, __pyx_v_k) != 0); + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":1020 + * for k in range(table.n_buckets): + * if kh_exist_pymap(table, k): + * count = table.vals[k] # <<<<<<<<<<<<<< + * + * if count == max_count: + */ + __pyx_v_count = (__pyx_v_table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":1022 + * count = table.vals[k] + * + * if count == max_count: # <<<<<<<<<<<<<< + * j += 1 + * elif count > max_count: + */ + __pyx_t_9 = ((__pyx_v_count == __pyx_v_max_count) != 0); + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":1023 + * + * if count == max_count: + * j += 1 # <<<<<<<<<<<<<< + * elif count > max_count: + * max_count = count + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L6; + } + + /* "pandas/hashtable.pyx":1024 + * if count == max_count: + * j += 1 + * elif count > max_count: # <<<<<<<<<<<<<< + * max_count = count + * j = 0 + */ + __pyx_t_9 = ((__pyx_v_count > __pyx_v_max_count) != 0); + if (__pyx_t_9) { + + /* "pandas/hashtable.pyx":1025 + * j += 1 + * elif count > max_count: + * max_count = count # <<<<<<<<<<<<<< + * j = 0 + * else: + */ + __pyx_v_max_count = __pyx_v_count; + + /* "pandas/hashtable.pyx":1026 + * elif count > max_count: + * max_count = count + * j = 0 # <<<<<<<<<<<<<< + * else: + * continue + */ + __pyx_v_j = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":1028 + * j = 0 + * else: + * continue # <<<<<<<<<<<<<< + * modes[j] = table.keys[k] + * + */ + goto __pyx_L3_continue; + } + __pyx_L6:; + + /* "pandas/hashtable.pyx":1029 + * else: + * continue + * modes[j] = table.keys[k] # <<<<<<<<<<<<<< + * + * kh_destroy_pymap(table) + */ + __pyx_t_6 = ((PyObject *)(__pyx_v_table->keys[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_6); + if (unlikely(__Pyx_SetItemInt(__pyx_v_modes, __pyx_v_j, __pyx_t_6, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":1031 + * modes[j] = table.keys[k] + * + * kh_destroy_pymap(table) # <<<<<<<<<<<<<< + * + * return modes[:j+1] + */ + kh_destroy_pymap(__pyx_v_table); + + /* "pandas/hashtable.pyx":1033 + * kh_destroy_pymap(table) + * + * return modes[:j+1] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_modes, 0, (__pyx_v_j + 1), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":1005 + * + * + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): # <<<<<<<<<<<<<< + * cdef: + * int count, max_count = 2 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.mode_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_modes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/hashtable.pyx":1036 + * + * + * def mode_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * int val, max_val = 2 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_9hashtable_9mode_int64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_9hashtable_9mode_int64 = {__Pyx_NAMESTR("mode_int64"), (PyCFunction)__pyx_pw_6pandas_9hashtable_9mode_int64, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_9hashtable_9mode_int64(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mode_int64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_9hashtable_8mode_int64(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_9hashtable_8mode_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_val; + int __pyx_v_max_val; + int __pyx_v_j; + int __pyx_v_k; + kh_int64_t *__pyx_v_table; + CYTHON_UNUSED PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_modes = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + khint_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mode_int64", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/hashtable.pyx":1038 + * def mode_int64(ndarray[int64_t] values): + * cdef: + * int val, max_val = 2 # <<<<<<<<<<<<<< + * int j = -1 # so you can do += + * int k + */ + __pyx_v_max_val = 2; + + /* "pandas/hashtable.pyx":1039 + * cdef: + * int val, max_val = 2 + * int j = -1 # so you can do += # <<<<<<<<<<<<<< + * int k + * kh_int64_t *table + */ + __pyx_v_j = -1; + + /* "pandas/hashtable.pyx":1042 + * int k + * kh_int64_t *table + * list uniques = [] # <<<<<<<<<<<<<< + * + * table = kh_init_int64() + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_uniques = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":1044 + * list uniques = [] + * + * table = kh_init_int64() # <<<<<<<<<<<<<< + * + * build_count_table_int64(values, table) + */ + __pyx_v_table = kh_init_int64(); + + /* "pandas/hashtable.pyx":1046 + * table = kh_init_int64() + * + * build_count_table_int64(values, table) # <<<<<<<<<<<<<< + * + * modes = np.empty(table.n_buckets, dtype=np.int64) + */ + __pyx_t_1 = __pyx_f_6pandas_9hashtable_build_count_table_int64(((PyArrayObject *)__pyx_v_values), __pyx_v_table); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":1048 + * build_count_table_int64(values, table) + * + * modes = np.empty(table.n_buckets, dtype=np.int64) # <<<<<<<<<<<<<< + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_table->n_buckets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_modes = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/hashtable.pyx":1049 + * + * modes = np.empty(table.n_buckets, dtype=np.int64) + * for k in range(table.n_buckets): # <<<<<<<<<<<<<< + * if kh_exist_int64(table, k): + * val = table.vals[k] + */ + __pyx_t_6 = __pyx_v_table->n_buckets; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_k = __pyx_t_7; + + /* "pandas/hashtable.pyx":1050 + * modes = np.empty(table.n_buckets, dtype=np.int64) + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): # <<<<<<<<<<<<<< + * val = table.vals[k] + * + */ + __pyx_t_8 = (kh_exist_int64(__pyx_v_table, __pyx_v_k) != 0); + if (__pyx_t_8) { + + /* "pandas/hashtable.pyx":1051 + * for k in range(table.n_buckets): + * if kh_exist_int64(table, k): + * val = table.vals[k] # <<<<<<<<<<<<<< + * + * if val == max_val: + */ + __pyx_v_val = (__pyx_v_table->vals[__pyx_v_k]); + + /* "pandas/hashtable.pyx":1053 + * val = table.vals[k] + * + * if val == max_val: # <<<<<<<<<<<<<< + * j += 1 + * elif val > max_val: + */ + __pyx_t_8 = ((__pyx_v_val == __pyx_v_max_val) != 0); + if (__pyx_t_8) { + + /* "pandas/hashtable.pyx":1054 + * + * if val == max_val: + * j += 1 # <<<<<<<<<<<<<< + * elif val > max_val: + * max_val = val + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L6; + } + + /* "pandas/hashtable.pyx":1055 + * if val == max_val: + * j += 1 + * elif val > max_val: # <<<<<<<<<<<<<< + * max_val = val + * j = 0 + */ + __pyx_t_8 = ((__pyx_v_val > __pyx_v_max_val) != 0); + if (__pyx_t_8) { + + /* "pandas/hashtable.pyx":1056 + * j += 1 + * elif val > max_val: + * max_val = val # <<<<<<<<<<<<<< + * j = 0 + * else: + */ + __pyx_v_max_val = __pyx_v_val; + + /* "pandas/hashtable.pyx":1057 + * elif val > max_val: + * max_val = val + * j = 0 # <<<<<<<<<<<<<< + * else: + * continue + */ + __pyx_v_j = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/hashtable.pyx":1059 + * j = 0 + * else: + * continue # <<<<<<<<<<<<<< + * modes[j] = table.keys[k] + * + */ + goto __pyx_L3_continue; + } + __pyx_L6:; + + /* "pandas/hashtable.pyx":1060 + * else: + * continue + * modes[j] = table.keys[k] # <<<<<<<<<<<<<< + * + * kh_destroy_int64(table) + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((__pyx_v_table->keys[__pyx_v_k])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_SetItemInt(__pyx_v_modes, __pyx_v_j, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_L3_continue:; + } + + /* "pandas/hashtable.pyx":1062 + * modes[j] = table.keys[k] + * + * kh_destroy_int64(table) # <<<<<<<<<<<<<< + * + * return modes[:j+1] + */ + kh_destroy_int64(__pyx_v_table); + + /* "pandas/hashtable.pyx":1064 + * kh_destroy_int64(table) + * + * return modes[:j+1] # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_modes, 0, (__pyx_v_j + 1), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/hashtable.pyx":1036 + * + * + * def mode_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * int val, max_val = 2 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.hashtable.mode_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_modes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6pandas_9hashtable_HashTable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_HashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyTypeObject __pyx_type_6pandas_9hashtable_HashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.HashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_HashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_HashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_HashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable __pyx_vtable_6pandas_9hashtable_Int64HashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64HashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Int64HashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Int64HashTable; + if (unlikely(__pyx_pw_6pandas_9hashtable_14Int64HashTable_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Int64HashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_14Int64HashTable_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Int64HashTable[] = { + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_9get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_11get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_13set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_15map, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_17map_locations, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_19lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_21factorize, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_23get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_labels_groupby"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_25get_labels_groupby, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int64HashTable_27unique, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Int64HashTable = { + __pyx_pw_6pandas_9hashtable_14Int64HashTable_7__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_9hashtable_14Int64HashTable_5__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Int64HashTable = { + __pyx_pw_6pandas_9hashtable_14Int64HashTable_7__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Int64HashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Int64HashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Int64HashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Int64HashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_Int64HashTable, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Int64HashTable, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Int64HashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Int64HashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable __pyx_vtable_6pandas_9hashtable_Float64HashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Float64HashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Float64HashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Float64HashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Float64HashTable; + if (unlikely(__pyx_pw_6pandas_9hashtable_16Float64HashTable_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Float64HashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_16Float64HashTable_9__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Float64HashTable[] = { + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_5get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_7set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_13factorize, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_15get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_17map_locations, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_19lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_16Float64HashTable_21unique, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Float64HashTable = { + __pyx_pw_6pandas_9hashtable_16Float64HashTable_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_9hashtable_16Float64HashTable_11__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Float64HashTable = { + __pyx_pw_6pandas_9hashtable_16Float64HashTable_3__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Float64HashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Float64HashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Float64HashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Float64HashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_Float64HashTable, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Float64HashTable, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Float64HashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Float64HashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable __pyx_vtable_6pandas_9hashtable_PyObjectHashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_PyObjectHashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable; + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_PyObjectHashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_PyObjectHashTable[] = { + {__Pyx_NAMESTR("destroy"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_9destroy, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_11get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_13get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_15set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_17map_locations, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_19lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup2"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_21lookup2, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_23unique, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pw_6pandas_9hashtable_17PyObjectHashTable_25get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_PyObjectHashTable = { + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_5__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_7__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_PyObjectHashTable = { + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_5__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_PyObjectHashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.PyObjectHashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_PyObjectHashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_PyObjectHashTable, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_PyObjectHashTable, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_PyObjectHashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_9hashtable_17PyObjectHashTable_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_PyObjectHashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_ObjectVector __pyx_vtable_6pandas_9hashtable_ObjectVector; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_ObjectVector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_ObjectVector *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_ObjectVector; + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_9hashtable_12ObjectVector_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_ObjectVector(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_ObjectVector *p = (struct __pyx_obj_6pandas_9hashtable_ObjectVector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->ao); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_ObjectVector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *p = (struct __pyx_obj_6pandas_9hashtable_ObjectVector *)o; + if (p->ao) { + e = (*v)(((PyObject*)p->ao), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_ObjectVector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_ObjectVector *p = (struct __pyx_obj_6pandas_9hashtable_ObjectVector *)o; + tmp = ((PyObject*)p->ao); + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_ObjectVector[] = { + {__Pyx_NAMESTR("to_array"), (PyCFunction)__pyx_pw_6pandas_9hashtable_12ObjectVector_5to_array, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_ObjectVector = { + __pyx_pw_6pandas_9hashtable_12ObjectVector_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_ObjectVector = { + __pyx_pw_6pandas_9hashtable_12ObjectVector_3__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_ObjectVector = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.ObjectVector"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_ObjectVector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_ObjectVector, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_ObjectVector, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_ObjectVector, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_ObjectVector, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_ObjectVector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_ObjectVector, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_ObjectVector, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64Vector __pyx_vtable_6pandas_9hashtable_Int64Vector; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64Vector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Int64Vector *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Int64Vector; + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_9hashtable_11Int64Vector_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Int64Vector(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_Int64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Int64Vector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->ao); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_Int64Vector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Int64Vector *)o; + if (p->ao) { + e = (*v)(((PyObject*)p->ao), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_Int64Vector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_Int64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Int64Vector *)o; + tmp = ((PyObject*)p->ao); + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Int64Vector[] = { + {__Pyx_NAMESTR("to_array"), (PyCFunction)__pyx_pw_6pandas_9hashtable_11Int64Vector_5to_array, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Int64Vector = { + __pyx_pw_6pandas_9hashtable_11Int64Vector_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Int64Vector = { + __pyx_pw_6pandas_9hashtable_11Int64Vector_3__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Int64Vector = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Int64Vector"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Int64Vector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Int64Vector, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_Int64Vector, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Int64Vector, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_Int64Vector, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_Int64Vector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Int64Vector, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Int64Vector, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64Vector __pyx_vtable_6pandas_9hashtable_Float64Vector; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Float64Vector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Float64Vector *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Float64Vector *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Float64Vector; + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_9hashtable_13Float64Vector_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Float64Vector(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_Float64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Float64Vector *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->ao); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_Float64Vector(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_Float64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Float64Vector *)o; + if (p->ao) { + e = (*v)(((PyObject*)p->ao), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_Float64Vector(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_Float64Vector *p = (struct __pyx_obj_6pandas_9hashtable_Float64Vector *)o; + tmp = ((PyObject*)p->ao); + p->ao = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Float64Vector[] = { + {__Pyx_NAMESTR("to_array"), (PyCFunction)__pyx_pw_6pandas_9hashtable_13Float64Vector_5to_array, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_Float64Vector = { + __pyx_pw_6pandas_9hashtable_13Float64Vector_3__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Float64Vector = { + __pyx_pw_6pandas_9hashtable_13Float64Vector_3__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Float64Vector = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Float64Vector"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Float64Vector), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Float64Vector, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_Float64Vector, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Float64Vector, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_Float64Vector, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_Float64Vector, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Float64Vector, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Float64Vector, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_StringHashTable __pyx_vtable_6pandas_9hashtable_StringHashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_StringHashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_StringHashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_StringHashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_StringHashTable; + if (unlikely(__pyx_pw_6pandas_9hashtable_15StringHashTable_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_StringHashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_15StringHashTable_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_StringHashTable[] = { + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_5get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_7get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_9set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_11get_indexer, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_13unique, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15StringHashTable_15factorize, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_StringHashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.StringHashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_StringHashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_StringHashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_StringHashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_StringHashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int32HashTable __pyx_vtable_6pandas_9hashtable_Int32HashTable; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int32HashTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Int32HashTable *p; + PyObject *o = __pyx_tp_new_6pandas_9hashtable_HashTable(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Int32HashTable *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_9hashtable_Int32HashTable; + if (unlikely(__pyx_pw_6pandas_9hashtable_14Int32HashTable_3__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Int32HashTable(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_9hashtable_14Int32HashTable_5__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + __pyx_tp_dealloc_6pandas_9hashtable_HashTable(o); +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Int32HashTable[] = { + {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_7get_item, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_9get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_11set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_13map_locations, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_15lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_14Int32HashTable_17factorize, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Int32HashTable = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Int32HashTable"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Int32HashTable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Int32HashTable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Int32HashTable, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_9hashtable_14Int32HashTable_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Int32HashTable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Factorizer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Factorizer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Factorizer *)o); + p->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)Py_None); Py_INCREF(Py_None); + p->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Factorizer(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Factorizer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->table); + Py_CLEAR(p->uniques); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_Factorizer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Factorizer *)o; + if (p->table) { + e = (*v)(((PyObject*)p->table), a); if (e) return e; + } + if (p->uniques) { + e = (*v)(((PyObject*)p->uniques), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_Factorizer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Factorizer *)o; + tmp = ((PyObject*)p->table); + p->table = ((struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->uniques); + p->uniques = ((struct __pyx_obj_6pandas_9hashtable_ObjectVector *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_10Factorizer_table(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5table_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_10Factorizer_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5table_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5table_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_10Factorizer_uniques(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_10Factorizer_uniques(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_9hashtable_10Factorizer_7uniques_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_10Factorizer_count(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5count_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_10Factorizer_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_10Factorizer_5count_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Factorizer[] = { + {__Pyx_NAMESTR("get_count"), (PyCFunction)__pyx_pw_6pandas_9hashtable_10Factorizer_3get_count, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_10Factorizer_5factorize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_9hashtable_10Factorizer_4factorize)}, + {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_6pandas_9hashtable_10Factorizer_7unique, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_9hashtable_Factorizer[] = { + {(char *)"table", __pyx_getprop_6pandas_9hashtable_10Factorizer_table, __pyx_setprop_6pandas_9hashtable_10Factorizer_table, 0, 0}, + {(char *)"uniques", __pyx_getprop_6pandas_9hashtable_10Factorizer_uniques, __pyx_setprop_6pandas_9hashtable_10Factorizer_uniques, 0, 0}, + {(char *)"count", __pyx_getprop_6pandas_9hashtable_10Factorizer_count, __pyx_setprop_6pandas_9hashtable_10Factorizer_count, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Factorizer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Factorizer"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Factorizer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Factorizer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_Factorizer, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_Factorizer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Factorizer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_9hashtable_Factorizer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_9hashtable_10Factorizer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Factorizer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_9hashtable_Int64Factorizer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)o); + p->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)Py_None); Py_INCREF(Py_None); + p->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_9hashtable_Int64Factorizer(PyObject *o) { + struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->table); + Py_CLEAR(p->uniques); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_9hashtable_Int64Factorizer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)o; + if (p->table) { + e = (*v)(((PyObject*)p->table), a); if (e) return e; + } + if (p->uniques) { + e = (*v)(((PyObject*)p->uniques), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_9hashtable_Int64Factorizer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *p = (struct __pyx_obj_6pandas_9hashtable_Int64Factorizer *)o; + tmp = ((PyObject*)p->table); + p->table = ((struct __pyx_obj_6pandas_9hashtable_Int64HashTable *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->uniques); + p->uniques = ((struct __pyx_obj_6pandas_9hashtable_Int64Vector *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_15Int64Factorizer_table(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5table_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_15Int64Factorizer_uniques(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_uniques(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_7uniques_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_9hashtable_15Int64Factorizer_count(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_1__get__(o); +} + +static int __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_9hashtable_15Int64Factorizer_5count_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6pandas_9hashtable_Int64Factorizer[] = { + {__Pyx_NAMESTR("get_count"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15Int64Factorizer_3get_count, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pw_6pandas_9hashtable_15Int64Factorizer_5factorize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_9hashtable_Int64Factorizer[] = { + {(char *)"table", __pyx_getprop_6pandas_9hashtable_15Int64Factorizer_table, __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_table, 0, 0}, + {(char *)"uniques", __pyx_getprop_6pandas_9hashtable_15Int64Factorizer_uniques, __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_uniques, 0, 0}, + {(char *)"count", __pyx_getprop_6pandas_9hashtable_15Int64Factorizer_count, __pyx_setprop_6pandas_9hashtable_15Int64Factorizer_count, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_9hashtable_Int64Factorizer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.hashtable.Int64Factorizer"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_9hashtable_Int64Factorizer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_9hashtable_Int64Factorizer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_9hashtable_Int64Factorizer, /*tp_traverse*/ + __pyx_tp_clear_6pandas_9hashtable_Int64Factorizer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_9hashtable_Int64Factorizer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_9hashtable_Int64Factorizer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_9hashtable_15Int64Factorizer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_9hashtable_Int64Factorizer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("value_count_int64"), (PyCFunction)__pyx_pw_6pandas_9hashtable_3value_count_int64, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("value_count_object"), (PyCFunction)__pyx_pw_6pandas_9hashtable_5value_count_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("hashtable"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_Factorize_values_with_nans_repl, __pyx_k_Factorize_values_with_nans_repl, sizeof(__pyx_k_Factorize_values_with_nans_repl), 0, 1, 0, 0}, + {&__pyx_kp_u_Factorizer_factorize_line_859, __pyx_k_Factorizer_factorize_line_859, sizeof(__pyx_k_Factorizer_factorize_line_859), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_ONAN, __pyx_k_ONAN, sizeof(__pyx_k_ONAN), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, + {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_count_prior, __pyx_k_count_prior, sizeof(__pyx_k_count_prior), 0, 0, 1, 1}, + {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_get_item, __pyx_k_get_item, sizeof(__pyx_k_get_item), 0, 0, 1, 1}, + {&__pyx_n_s_get_labels, __pyx_k_get_labels, sizeof(__pyx_k_get_labels), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_iterations, __pyx_k_iterations, sizeof(__pyx_k_iterations), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_list_to_object_array, __pyx_k_list_to_object_array, sizeof(__pyx_k_list_to_object_array), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_max_count, __pyx_k_max_count, sizeof(__pyx_k_max_count), 0, 0, 1, 1}, + {&__pyx_n_s_max_val, __pyx_k_max_val, sizeof(__pyx_k_max_val), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_mode_int64, __pyx_k_mode_int64, sizeof(__pyx_k_mode_int64), 0, 0, 1, 1}, + {&__pyx_n_s_mode_object, __pyx_k_mode_object, sizeof(__pyx_k_mode_object), 0, 0, 1, 1}, + {&__pyx_n_s_modes, __pyx_k_modes, sizeof(__pyx_k_modes), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_na_sentinel, __pyx_k_na_sentinel, sizeof(__pyx_k_na_sentinel), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_hashtable, __pyx_k_pandas_hashtable, sizeof(__pyx_k_pandas_hashtable), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_set_item, __pyx_k_set_item, sizeof(__pyx_k_set_item), 0, 0, 1, 1}, + {&__pyx_n_s_size_hint, __pyx_k_size_hint, sizeof(__pyx_k_size_hint), 0, 0, 1, 1}, + {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, + {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, + {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_to_array, __pyx_k_to_array, sizeof(__pyx_k_to_array), 0, 0, 1, 1}, + {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1}, + {&__pyx_n_s_uniques, __pyx_k_uniques, sizeof(__pyx_k_uniques), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/hashtable.pyx":31 + * + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_list_to_object_array, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":1005 + * + * + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): # <<<<<<<<<<<<<< + * cdef: + * int count, max_count = 2 + */ + __pyx_tuple__11 = PyTuple_Pack(11, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_count, __pyx_n_s_max_count, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_table, __pyx_n_s_ret, __pyx_n_s_modes); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_mode_object, 1005, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":1036 + * + * + * def mode_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * int val, max_val = 2 + */ + __pyx_tuple__13 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_max_val, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_table, __pyx_n_s_uniques, __pyx_n_s_modes); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_mode_int64, 1036, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC inithashtable(void); /*proto*/ +PyMODINIT_FUNC inithashtable(void) +#else +PyMODINIT_FUNC PyInit_hashtable(void); /*proto*/ +PyMODINIT_FUNC PyInit_hashtable(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_hashtable(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("hashtable"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__hashtable) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.hashtable")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.hashtable", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_HashTable.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "HashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_HashTable = &__pyx_type_6pandas_9hashtable_HashTable; + __pyx_vtabptr_6pandas_9hashtable_Int64HashTable = &__pyx_vtable_6pandas_9hashtable_Int64HashTable; + __pyx_vtable_6pandas_9hashtable_Int64HashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_14Int64HashTable_get_item; + __pyx_vtable_6pandas_9hashtable_Int64HashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_14Int64HashTable_set_item; + __pyx_type_6pandas_9hashtable_Int64HashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Int64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Int64HashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Int64HashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Int64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Int64HashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_Int64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int64HashTable = &__pyx_type_6pandas_9hashtable_Int64HashTable; + __pyx_vtabptr_6pandas_9hashtable_Float64HashTable = &__pyx_vtable_6pandas_9hashtable_Float64HashTable; + __pyx_vtable_6pandas_9hashtable_Float64HashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_16Float64HashTable_get_item; + __pyx_vtable_6pandas_9hashtable_Float64HashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_16Float64HashTable_set_item; + __pyx_type_6pandas_9hashtable_Float64HashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Float64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Float64HashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Float64HashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Float64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Float64HashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_Float64HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Float64HashTable = &__pyx_type_6pandas_9hashtable_Float64HashTable; + __pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable = &__pyx_vtable_6pandas_9hashtable_PyObjectHashTable; + __pyx_vtable_6pandas_9hashtable_PyObjectHashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_17PyObjectHashTable_get_item; + __pyx_vtable_6pandas_9hashtable_PyObjectHashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_17PyObjectHashTable_set_item; + __pyx_type_6pandas_9hashtable_PyObjectHashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_PyObjectHashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_PyObjectHashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "PyObjectHashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_PyObjectHashTable = &__pyx_type_6pandas_9hashtable_PyObjectHashTable; + __pyx_vtabptr_6pandas_9hashtable_ObjectVector = &__pyx_vtable_6pandas_9hashtable_ObjectVector; + __pyx_vtable_6pandas_9hashtable_ObjectVector.append = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_ObjectVector *, PyObject *))__pyx_f_6pandas_9hashtable_12ObjectVector_append; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_ObjectVector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_ObjectVector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_ObjectVector.tp_dict, __pyx_vtabptr_6pandas_9hashtable_ObjectVector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ObjectVector", (PyObject *)&__pyx_type_6pandas_9hashtable_ObjectVector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_ObjectVector = &__pyx_type_6pandas_9hashtable_ObjectVector; + __pyx_vtabptr_6pandas_9hashtable_Int64Vector = &__pyx_vtable_6pandas_9hashtable_Int64Vector; + __pyx_vtable_6pandas_9hashtable_Int64Vector.append = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int64Vector *, __pyx_t_5numpy_int64_t))__pyx_f_6pandas_9hashtable_11Int64Vector_append; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Int64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Int64Vector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Int64Vector.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Int64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Int64Vector", (PyObject *)&__pyx_type_6pandas_9hashtable_Int64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int64Vector = &__pyx_type_6pandas_9hashtable_Int64Vector; + __pyx_vtabptr_6pandas_9hashtable_Float64Vector = &__pyx_vtable_6pandas_9hashtable_Float64Vector; + __pyx_vtable_6pandas_9hashtable_Float64Vector.append = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Float64Vector *, __pyx_t_5numpy_float64_t))__pyx_f_6pandas_9hashtable_13Float64Vector_append; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Float64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Float64Vector.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Float64Vector.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Float64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Float64Vector", (PyObject *)&__pyx_type_6pandas_9hashtable_Float64Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Float64Vector = &__pyx_type_6pandas_9hashtable_Float64Vector; + __pyx_vtabptr_6pandas_9hashtable_StringHashTable = &__pyx_vtable_6pandas_9hashtable_StringHashTable; + __pyx_vtable_6pandas_9hashtable_StringHashTable.check_type = (int (*)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *))__pyx_f_6pandas_9hashtable_15StringHashTable_check_type; + __pyx_vtable_6pandas_9hashtable_StringHashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_15StringHashTable_get_item; + __pyx_vtable_6pandas_9hashtable_StringHashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_StringHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_15StringHashTable_set_item; + __pyx_type_6pandas_9hashtable_StringHashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_StringHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_StringHashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_StringHashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_StringHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "StringHashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_StringHashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_StringHashTable = &__pyx_type_6pandas_9hashtable_StringHashTable; + __pyx_vtabptr_6pandas_9hashtable_Int32HashTable = &__pyx_vtable_6pandas_9hashtable_Int32HashTable; + __pyx_vtable_6pandas_9hashtable_Int32HashTable.check_type = (int (*)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, PyObject *))__pyx_f_6pandas_9hashtable_14Int32HashTable_check_type; + __pyx_vtable_6pandas_9hashtable_Int32HashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, __pyx_t_5numpy_int32_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_14Int32HashTable_get_item; + __pyx_vtable_6pandas_9hashtable_Int32HashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_9hashtable_Int32HashTable *, __pyx_t_5numpy_int32_t, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_9hashtable_14Int32HashTable_set_item; + __pyx_type_6pandas_9hashtable_Int32HashTable.tp_base = __pyx_ptype_6pandas_9hashtable_HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Int32HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Int32HashTable.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_9hashtable_Int32HashTable.tp_dict, __pyx_vtabptr_6pandas_9hashtable_Int32HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Int32HashTable", (PyObject *)&__pyx_type_6pandas_9hashtable_Int32HashTable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int32HashTable = &__pyx_type_6pandas_9hashtable_Int32HashTable; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Factorizer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Factorizer.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Factorizer", (PyObject *)&__pyx_type_6pandas_9hashtable_Factorizer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Factorizer = &__pyx_type_6pandas_9hashtable_Factorizer; + if (PyType_Ready(&__pyx_type_6pandas_9hashtable_Int64Factorizer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_9hashtable_Int64Factorizer.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Int64Factorizer", (PyObject *)&__pyx_type_6pandas_9hashtable_Int64Factorizer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int64Factorizer = &__pyx_type_6pandas_9hashtable_Int64Factorizer; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/hashtable.pyx":9 + * cimport util + * + * import numpy as np # <<<<<<<<<<<<<< + * + * ONAN = np.nan + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/hashtable.pyx":11 + * import numpy as np + * + * ONAN = np.nan # <<<<<<<<<<<<<< + * + * cimport cython + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ONAN, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":16 + * cimport numpy as cnp + * + * cnp.import_array() # <<<<<<<<<<<<<< + * cnp.import_ufunc() + * + */ + import_array(); + + /* "pandas/hashtable.pyx":17 + * + * cnp.import_array() + * cnp.import_ufunc() # <<<<<<<<<<<<<< + * + * cdef int64_t iNaT = util.get_nat() + */ + import_ufunc(); + + /* "pandas/hashtable.pyx":19 + * cnp.import_ufunc() + * + * cdef int64_t iNaT = util.get_nat() # <<<<<<<<<<<<<< + * + * cdef extern from "datetime.h": + */ + __pyx_v_6pandas_9hashtable_iNaT = get_nat(); + + /* "pandas/hashtable.pyx":25 + * void PyDateTime_IMPORT() + * + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + PyDateTime_IMPORT; + + /* "pandas/hashtable.pyx":31 + * + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_9hashtable_1list_to_object_array, NULL, __pyx_n_s_pandas_hashtable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_to_object_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":49 + * + * + * cdef size_t _INIT_VEC_CAP = 32 # <<<<<<<<<<<<<< + * + * cdef class ObjectVector: + */ + __pyx_v_6pandas_9hashtable__INIT_VEC_CAP = 32; + + /* "pandas/hashtable.pyx":668 + * return uniques.to_array() + * + * na_sentinel = object # <<<<<<<<<<<<<< + * + * cdef class PyObjectHashTable(HashTable): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_na_sentinel, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/hashtable.pyx":1005 + * + * + * def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask): # <<<<<<<<<<<<<< + * cdef: + * int count, max_count = 2 + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_9hashtable_7mode_object, NULL, __pyx_n_s_pandas_hashtable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_object, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":1036 + * + * + * def mode_int64(ndarray[int64_t] values): # <<<<<<<<<<<<<< + * cdef: + * int val, max_val = 2 + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_9hashtable_9mode_int64, NULL, __pyx_n_s_pandas_hashtable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_int64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/hashtable.pyx":1 + * from cpython cimport PyObject, Py_INCREF, PyList_Check, PyTuple_Check # <<<<<<<<<<<<<< + * + * from khash cimport * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Factorizer_factorize_line_859, __pyx_kp_u_Factorize_values_with_nans_repl) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.hashtable", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.hashtable"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint32"); + return (npy_uint32) -1; + } + return (npy_uint32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint32"); + return (npy_uint32) -1; + } + if (sizeof(npy_uint32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyLong_AsLong) + } else if (sizeof(npy_uint32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint32) -1; + } + } else { + npy_uint32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint32) -1; + val = __Pyx_PyInt_As_npy_uint32(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value) { + const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_uint32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_uint32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_uint32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint32), + little, !is_unsigned); + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/pandas/index.c b/cythonized-files3/pandas/index.c new file mode 100644 index 00000000..43545785 --- /dev/null +++ b/cythonized-files3/pandas/index.c @@ -0,0 +1,19180 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__index +#define __PYX_HAVE_API__pandas__index +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "numpy_helper.h" +#include "khash_python.h" +#include "headers/stdint.h" +#include "datetime.h" +#include "datetime_helper.h" +#include "numpy/ndarrayobject.h" +#include "numpy/npy_common.h" +#include "datetime/np_datetime.h" +#include "datetime/np_datetime_strings.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "index.pyx", + "numpy.pxd", + "util.pxd", + "datetime.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", + "hashtable.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_9hashtable_HashTable; +struct __pyx_obj_6pandas_9hashtable_Int64HashTable; +struct __pyx_obj_6pandas_9hashtable_Float64HashTable; +struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable; +struct __pyx_obj_6pandas_5index_IndexEngine; +struct __pyx_obj_6pandas_5index_Int64Engine; +struct __pyx_obj_6pandas_5index_Float64Engine; +struct __pyx_obj_6pandas_5index_ObjectEngine; +struct __pyx_obj_6pandas_5index_DatetimeEngine; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "hashtable.pxd":5 + * # prototypes for sharing + * + * cdef class HashTable: # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6pandas_9hashtable_HashTable { + PyObject_HEAD +}; + + +/* "hashtable.pxd":8 + * pass + * + * cdef class Int64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int64_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Int64HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *__pyx_vtab; + kh_int64_t *table; +}; + + +/* "hashtable.pxd":14 + * cpdef set_item(self, int64_t key, Py_ssize_t val) + * + * cdef class Float64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_float64_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_Float64HashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *__pyx_vtab; + kh_float64_t *table; +}; + + +/* "hashtable.pxd":20 + * cpdef set_item(self, float64_t key, Py_ssize_t val) + * + * cdef class PyObjectHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_pymap_t *table + * + */ +struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable { + struct __pyx_obj_6pandas_9hashtable_HashTable __pyx_base; + struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *__pyx_vtab; + kh_pymap_t *table; +}; + + +/* "pandas/index.pyx":70 + * + * + * cdef class IndexEngine: # <<<<<<<<<<<<<< + * + * cdef readonly: + */ +struct __pyx_obj_6pandas_5index_IndexEngine { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_5index_IndexEngine *__pyx_vtab; + PyObject *vgetter; + struct __pyx_obj_6pandas_9hashtable_HashTable *mapping; + int over_size_threshold; + int unique; + int monotonic; + int initialized; + int monotonic_check; + int unique_check; +}; + + +/* "pandas/index.pyx":335 + * return result[0:count], missing[0:count_missing] + * + * cdef class Int64Engine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ +struct __pyx_obj_6pandas_5index_Int64Engine { + struct __pyx_obj_6pandas_5index_IndexEngine __pyx_base; +}; + + +/* "pandas/index.pyx":396 + * return result + * + * cdef class Float64Engine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ +struct __pyx_obj_6pandas_5index_Float64Engine { + struct __pyx_obj_6pandas_5index_IndexEngine __pyx_base; +}; + + +/* "pandas/index.pyx":482 + * } + * + * cdef class ObjectEngine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ +struct __pyx_obj_6pandas_5index_ObjectEngine { + struct __pyx_obj_6pandas_5index_IndexEngine __pyx_base; +}; + + +/* "pandas/index.pyx":499 + * + * + * cdef class DatetimeEngine(Int64Engine): # <<<<<<<<<<<<<< + * + * def __contains__(self, object val): + */ +struct __pyx_obj_6pandas_5index_DatetimeEngine { + struct __pyx_obj_6pandas_5index_Int64Engine __pyx_base; +}; + + + +/* "hashtable.pxd":8 + * pass + * + * cdef class Int64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_int64_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Int64HashTable *, __pyx_t_5numpy_int64_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable *__pyx_vtabptr_6pandas_9hashtable_Int64HashTable; + + +/* "hashtable.pxd":14 + * cpdef set_item(self, int64_t key, Py_ssize_t val) + * + * cdef class Float64HashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_float64_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_Float64HashTable *, __pyx_t_5numpy_float64_t, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable *__pyx_vtabptr_6pandas_9hashtable_Float64HashTable; + + +/* "hashtable.pxd":20 + * cpdef set_item(self, float64_t key, Py_ssize_t val) + * + * cdef class PyObjectHashTable(HashTable): # <<<<<<<<<<<<<< + * cdef kh_pymap_t *table + * + */ + +struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable { + PyObject *(*get_item)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*set_item)(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable *__pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable; + + +/* "pandas/index.pyx":70 + * + * + * cdef class IndexEngine: # <<<<<<<<<<<<<< + * + * cdef readonly: + */ + +struct __pyx_vtabstruct_6pandas_5index_IndexEngine { + PyObject *(*get_value)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*set_value)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyArrayObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*get_loc)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_get_loc_duplicates)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); + PyObject *(*_maybe_get_bool_indexer)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); + PyObject *(*_do_monotonic_check)(struct __pyx_obj_6pandas_5index_IndexEngine *); + PyObject *(*_get_index_values)(struct __pyx_obj_6pandas_5index_IndexEngine *); + PyObject *(*_do_unique_check)(struct __pyx_obj_6pandas_5index_IndexEngine *); + PyObject *(*_make_hash_table)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); + PyObject *(*_check_type)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); + PyObject *(*_ensure_mapping_populated)(struct __pyx_obj_6pandas_5index_IndexEngine *); + PyObject *(*initialize)(struct __pyx_obj_6pandas_5index_IndexEngine *); +}; +static struct __pyx_vtabstruct_6pandas_5index_IndexEngine *__pyx_vtabptr_6pandas_5index_IndexEngine; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *); +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__do_monotonic_check(struct __pyx_obj_6pandas_5index_IndexEngine *); +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__do_unique_check(struct __pyx_obj_6pandas_5index_IndexEngine *); +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(struct __pyx_obj_6pandas_5index_IndexEngine *); + + +/* "pandas/index.pyx":335 + * return result[0:count], missing[0:count_missing] + * + * cdef class Int64Engine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ + +struct __pyx_vtabstruct_6pandas_5index_Int64Engine { + struct __pyx_vtabstruct_6pandas_5index_IndexEngine __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_5index_Int64Engine *__pyx_vtabptr_6pandas_5index_Int64Engine; + + +/* "pandas/index.pyx":396 + * return result + * + * cdef class Float64Engine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ + +struct __pyx_vtabstruct_6pandas_5index_Float64Engine { + struct __pyx_vtabstruct_6pandas_5index_IndexEngine __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_5index_Float64Engine *__pyx_vtabptr_6pandas_5index_Float64Engine; + + +/* "pandas/index.pyx":482 + * } + * + * cdef class ObjectEngine(IndexEngine): # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ + +struct __pyx_vtabstruct_6pandas_5index_ObjectEngine { + struct __pyx_vtabstruct_6pandas_5index_IndexEngine __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_5index_ObjectEngine *__pyx_vtabptr_6pandas_5index_ObjectEngine; + + +/* "pandas/index.pyx":499 + * + * + * cdef class DatetimeEngine(Int64Engine): # <<<<<<<<<<<<<< + * + * def __contains__(self, object val): + */ + +struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine { + struct __pyx_vtabstruct_6pandas_5index_Int64Engine __pyx_base; + PyObject *(*_date_check_type)(struct __pyx_obj_6pandas_5index_DatetimeEngine *, PyObject *); +}; +static struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *__pyx_vtabptr_6pandas_5index_DatetimeEngine; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_14DatetimeEngine__date_check_type(struct __pyx_obj_6pandas_5index_DatetimeEngine *, PyObject *); +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +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); + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static void* __Pyx_GetVtable(PyObject *dict); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'util' */ +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *, PyObject *, PyObject *); /*proto*/ + +/* Module declarations from 'pandas.tslib' */ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'pandas.hashtable' */ +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Int64HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_Float64HashTable = 0; +static PyTypeObject *__pyx_ptype_6pandas_9hashtable_PyObjectHashTable = 0; + +/* Module declarations from 'datetime' */ + +/* Module declarations from 'datetime' */ +static PyTypeObject *__pyx_ptype_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0; +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *, pandas_datetimestruct *); /*proto*/ + +/* Module declarations from 'pandas.index' */ +static PyTypeObject *__pyx_ptype_6pandas_5index_IndexEngine = 0; +static PyTypeObject *__pyx_ptype_6pandas_5index_Int64Engine = 0; +static PyTypeObject *__pyx_ptype_6pandas_5index_Float64Engine = 0; +static PyTypeObject *__pyx_ptype_6pandas_5index_ObjectEngine = 0; +static PyTypeObject *__pyx_ptype_6pandas_5index_DatetimeEngine = 0; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5index_iNaT; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_is_definitely_invalid_key(PyObject *); /*proto*/ +static Py_ssize_t __pyx_f_6pandas_5index__bin_search(PyArrayObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_convert_scalar(PyArrayObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index__to_i8(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5index__is_utc(PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +#define __Pyx_MODULE_NAME "pandas.index" +int __pyx_module_is_main_pandas__index = 0; + +/* Implementation of 'pandas.index' */ +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_pf_6pandas_5index_get_value_at(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_2set_value_at(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_val); /* proto */ +static int __pyx_pf_6pandas_5index_11IndexEngine___init__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_vgetter, PyObject *__pyx_v_n); /* proto */ +static int __pyx_pf_6pandas_5index_11IndexEngine_2__contains__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_4get_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_6set_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_8get_loc(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_9is_unique___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_12is_monotonic___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_10_call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_12clear_mapping(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_14get_indexer(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_16get_indexer_non_unique(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_targets); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_7vgetter___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_7mapping___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_19over_size_threshold___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static int __pyx_pf_6pandas_5index_14DatetimeEngine___contains__(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_2_call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_4get_loc(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_6get_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_8get_pad_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_10get_backfill_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit); /* proto */ +static PyObject *__pyx_pf_6pandas_5index_4convert_scalar(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_5index_IndexEngine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5index_Int64Engine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5index_Float64Engine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5index_ObjectEngine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5index_DatetimeEngine(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_i4[] = "i4"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_UTC[] = "UTC"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_loc[] = "loc"; +static char __pyx_k_utc[] = "utc"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_bool[] = "bool_"; +static char __pyx_k_data[] = "_data"; +static char __pyx_k_hash[] = "_hash"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_left[] = "left"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_pytz[] = "pytz"; +static char __pyx_k_side[] = "side"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_type[] = "type"; +static char __pyx_k_view[] = "view"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_M8_ns[] = "M8[ns]"; +static char __pyx_k_algos[] = "algos"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_limit[] = "limit"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_other[] = "other"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_right[] = "right"; +static char __pyx_k_tslib[] = "tslib"; +static char __pyx_k_tzutc[] = "tzutc"; +static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_du_utc[] = "_du_utc"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_lookup[] = "lookup"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_pandas[] = "pandas"; +static char __pyx_k_repeat[] = "repeat"; +static char __pyx_k_resize[] = "resize"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_tzinfo[] = "tzinfo"; +static char __pyx_k_asarray[] = "asarray"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_get_loc[] = "get_loc"; +static char __pyx_k_integer[] = "integer"; +static char __pyx_k_ndarray[] = "ndarray"; +static char __pyx_k_vgetter[] = "vgetter"; +static char __pyx_k_KeyError[] = "KeyError"; +static char __pyx_k_get_item[] = "get_item"; +static char __pyx_k_Timestamp[] = "Timestamp"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_get_value[] = "get_value"; +static char __pyx_k_hashtable[] = "hashtable"; +static char __pyx_k_have_pytz[] = "have_pytz"; +static char __pyx_k_is_unique[] = "is_unique"; +static char __pyx_k_pad_int64[] = "pad_int64"; +static char __pyx_k_set_value[] = "set_value"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_pad_object[] = "pad_object"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_ImportError[] = "ImportError"; +static char __pyx_k_SIZE_CUTOFF[] = "_SIZE_CUTOFF"; +static char __pyx_k_dateutil_tz[] = "dateutil.tz"; +static char __pyx_k_microsecond[] = "microsecond"; +static char __pyx_k_pad_float64[] = "pad_float64"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_ensure_int64[] = "ensure_int64"; +static char __pyx_k_get_value_at[] = "get_value_at"; +static char __pyx_k_is_monotonic[] = "is_monotonic"; +static char __pyx_k_pandas_index[] = "pandas.index"; +static char __pyx_k_pandas_tslib[] = "pandas.tslib"; +static char __pyx_k_searchsorted[] = "searchsorted"; +static char __pyx_k_set_value_at[] = "set_value_at"; +static char __pyx_k_get_utcoffset[] = "_get_utcoffset"; +static char __pyx_k_map_locations[] = "map_locations"; +static char __pyx_k_pad_functions[] = "_pad_functions"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_AttributeError[] = "AttributeError"; +static char __pyx_k_Int64HashTable[] = "Int64HashTable"; +static char __pyx_k_backfill_int64[] = "backfill_int64"; +static char __pyx_k_call_monotonic[] = "_call_monotonic"; +static char __pyx_k_ensure_float64[] = "ensure_float64"; +static char __pyx_k_backfill_object[] = "backfill_object"; +static char __pyx_k_Float64HashTable[] = "Float64HashTable"; +static char __pyx_k_backfill_float64[] = "backfill_float64"; +static char __pyx_k_PyObjectHashTable[] = "PyObjectHashTable"; +static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_backfill_functions[] = "_backfill_functions"; +static char __pyx_k_is_monotonic_int64[] = "is_monotonic_int64"; +static char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_is_monotonic_object[] = "is_monotonic_object"; +static char __pyx_k_delta_to_nanoseconds[] = "_delta_to_nanoseconds"; +static char __pyx_k_is_monotonic_float64[] = "is_monotonic_float64"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/index.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_Cannot_assign_nan_to_integer_ser[] = "Cannot assign nan to integer series"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Cannot_assign_nan_to_integer_ser; +static PyObject *__pyx_n_s_Float64HashTable; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_n_s_Int64HashTable; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_kp_s_M8_ns; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_s_PyObjectHashTable; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_SIZE_CUTOFF; +static PyObject *__pyx_n_s_Timestamp; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_UTC; +static PyObject *__pyx_kp_s_Unable_to_parse_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_algos; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_backfill_float64; +static PyObject *__pyx_n_s_backfill_functions; +static PyObject *__pyx_n_s_backfill_int64; +static PyObject *__pyx_n_s_backfill_object; +static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_call_monotonic; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_dateutil_tz; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_delta_to_nanoseconds; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_du_utc; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_ensure_float64; +static PyObject *__pyx_n_s_ensure_int64; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_get_item; +static PyObject *__pyx_n_s_get_loc; +static PyObject *__pyx_n_s_get_utcoffset; +static PyObject *__pyx_n_s_get_value; +static PyObject *__pyx_n_s_get_value_at; +static PyObject *__pyx_n_s_hash; +static PyObject *__pyx_n_s_hashtable; +static PyObject *__pyx_n_s_have_pytz; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_i4; +static PyObject *__pyx_n_s_i8; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_integer; +static PyObject *__pyx_n_s_is_monotonic; +static PyObject *__pyx_n_s_is_monotonic_float64; +static PyObject *__pyx_n_s_is_monotonic_int64; +static PyObject *__pyx_n_s_is_monotonic_object; +static PyObject *__pyx_n_s_is_unique; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_left; +static PyObject *__pyx_n_s_limit; +static PyObject *__pyx_n_s_loc; +static PyObject *__pyx_n_s_lookup; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_map_locations; +static PyObject *__pyx_n_s_microsecond; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_ndarray; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_other; +static PyObject *__pyx_n_s_pad_float64; +static PyObject *__pyx_n_s_pad_functions; +static PyObject *__pyx_n_s_pad_int64; +static PyObject *__pyx_n_s_pad_object; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_pandas_index; +static PyObject *__pyx_n_s_pandas_tslib; +static PyObject *__pyx_n_s_pytz; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_repeat; +static PyObject *__pyx_n_s_resize; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_searchsorted; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_set_value; +static PyObject *__pyx_n_s_set_value_at; +static PyObject *__pyx_n_s_side; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_tslib; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_tzinfo; +static PyObject *__pyx_n_s_tzutc; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_utc; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_vgetter; +static PyObject *__pyx_n_s_view; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_1000000; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; + +/* "pandas/index.pyx":46 + * + * + * cdef inline is_definitely_invalid_key(object val): # <<<<<<<<<<<<<< + * if PyTuple_Check(val): + * try: + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_is_definitely_invalid_key(PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_hash_t __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_definitely_invalid_key", 0); + + /* "pandas/index.pyx":47 + * + * cdef inline is_definitely_invalid_key(object val): + * if PyTuple_Check(val): # <<<<<<<<<<<<<< + * try: + * hash(val) + */ + __pyx_t_1 = (PyTuple_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":48 + * cdef inline is_definitely_invalid_key(object val): + * if PyTuple_Check(val): + * try: # <<<<<<<<<<<<<< + * hash(val) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/index.pyx":49 + * if PyTuple_Check(val): + * try: + * hash(val) # <<<<<<<<<<<<<< + * except TypeError: + * return True + */ + __pyx_t_5 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + + /* "pandas/index.pyx":50 + * try: + * hash(val) + * except TypeError: # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_6) { + __Pyx_AddTraceback("pandas.index.is_definitely_invalid_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/index.pyx":51 + * hash(val) + * except TypeError: + * return True # <<<<<<<<<<<<<< + * + * # we have a _data, means we are a NDFrame + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":54 + * + * # we have a _data, means we are a NDFrame + * return (PySlice_Check(val) or cnp.PyArray_Check(val) # <<<<<<<<<<<<<< + * or PyList_Check(val) or hasattr(val,'_data')) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_PyInt_From_int(PySlice_Check(__pyx_v_val)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/index.pyx":55 + * # we have a _data, means we are a NDFrame + * return (PySlice_Check(val) or cnp.PyArray_Check(val) + * or PyList_Check(val) or hasattr(val,'_data')) # <<<<<<<<<<<<<< + * + * def get_value_at(ndarray arr, object loc): + */ + __pyx_t_1 = PyArray_Check(__pyx_v_val); + if (!__pyx_t_1) { + __pyx_t_10 = PyList_Check(__pyx_v_val); + if (!__pyx_t_10) { + __pyx_t_11 = PyObject_HasAttr(__pyx_v_val, __pyx_n_s_data); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_t_11; + } else { + __pyx_t_12 = __pyx_t_10; + } + __pyx_t_10 = __pyx_t_12; + } else { + __pyx_t_10 = __pyx_t_1; + } + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":46 + * + * + * cdef inline is_definitely_invalid_key(object val): # <<<<<<<<<<<<<< + * if PyTuple_Check(val): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.index.is_definitely_invalid_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":57 + * or PyList_Check(val) or hasattr(val,'_data')) + * + * def get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_1get_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5index_1get_value_at = {__Pyx_NAMESTR("get_value_at"), (PyCFunction)__pyx_pw_6pandas_5index_1get_value_at, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5index_1get_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_loc = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_value_at (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_loc,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_value_at", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_value_at") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_loc = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_value_at", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_get_value_at(__pyx_self, __pyx_v_arr, __pyx_v_loc); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_get_value_at(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + + /* "pandas/index.pyx":58 + * + * def get_value_at(ndarray arr, object loc): + * if arr.descr.type_num == NPY_DATETIME: # <<<<<<<<<<<<<< + * return Timestamp(util.get_value_at(arr, loc)) + * return util.get_value_at(arr, loc) + */ + __pyx_t_1 = ((__pyx_v_arr->descr->type_num == NPY_DATETIME) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":59 + * def get_value_at(ndarray arr, object loc): + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) # <<<<<<<<<<<<<< + * return util.get_value_at(arr, loc) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":60 + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + * return util.get_value_at(arr, loc) # <<<<<<<<<<<<<< + * + * def set_value_at(ndarray arr, object loc, object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":57 + * or PyList_Check(val) or hasattr(val,'_data')) + * + * def get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":62 + * return util.get_value_at(arr, loc) + * + * def set_value_at(ndarray arr, object loc, object val): # <<<<<<<<<<<<<< + * return util.set_value_at(arr, loc, val) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_3set_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5index_3set_value_at = {__Pyx_NAMESTR("set_value_at"), (PyCFunction)__pyx_pw_6pandas_5index_3set_value_at, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5index_3set_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_loc = 0; + PyObject *__pyx_v_val = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_value_at (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_loc,&__pyx_n_s_val,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_value_at") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_loc = values[1]; + __pyx_v_val = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_2set_value_at(__pyx_self, __pyx_v_arr, __pyx_v_loc, __pyx_v_val); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_2set_value_at(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + + /* "pandas/index.pyx":63 + * + * def set_value_at(ndarray arr, object loc, object val): + * return util.set_value_at(arr, loc, val) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_4util_set_value_at(__pyx_v_arr, __pyx_v_loc, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":62 + * return util.get_value_at(arr, loc) + * + * def set_value_at(ndarray arr, object loc, object val): # <<<<<<<<<<<<<< + * return util.set_value_at(arr, loc, val) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":81 + * bint initialized, monotonic_check, unique_check + * + * def __init__(self, vgetter, n): # <<<<<<<<<<<<<< + * self.vgetter = vgetter + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5index_11IndexEngine_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_5index_11IndexEngine_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_vgetter = 0; + PyObject *__pyx_v_n = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vgetter,&__pyx_n_s_n,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vgetter)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_vgetter = values[0]; + __pyx_v_n = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine___init__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_vgetter, __pyx_v_n); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5index_11IndexEngine___init__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_vgetter, PyObject *__pyx_v_n) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/index.pyx":82 + * + * def __init__(self, vgetter, n): + * self.vgetter = vgetter # <<<<<<<<<<<<<< + * + * self.over_size_threshold = n >= _SIZE_CUTOFF + */ + __Pyx_INCREF(__pyx_v_vgetter); + __Pyx_GIVEREF(__pyx_v_vgetter); + __Pyx_GOTREF(__pyx_v_self->vgetter); + __Pyx_DECREF(__pyx_v_self->vgetter); + __pyx_v_self->vgetter = __pyx_v_vgetter; + + /* "pandas/index.pyx":84 + * self.vgetter = vgetter + * + * self.over_size_threshold = n >= _SIZE_CUTOFF # <<<<<<<<<<<<<< + * + * self.initialized = 0 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SIZE_CUTOFF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->over_size_threshold = __pyx_t_3; + + /* "pandas/index.pyx":86 + * self.over_size_threshold = n >= _SIZE_CUTOFF + * + * self.initialized = 0 # <<<<<<<<<<<<<< + * self.monotonic_check = 0 + * + */ + __pyx_v_self->initialized = 0; + + /* "pandas/index.pyx":87 + * + * self.initialized = 0 + * self.monotonic_check = 0 # <<<<<<<<<<<<<< + * + * self.unique = 0 + */ + __pyx_v_self->monotonic_check = 0; + + /* "pandas/index.pyx":89 + * self.monotonic_check = 0 + * + * self.unique = 0 # <<<<<<<<<<<<<< + * self.monotonic = 0 + * + */ + __pyx_v_self->unique = 0; + + /* "pandas/index.pyx":90 + * + * self.unique = 0 + * self.monotonic = 0 # <<<<<<<<<<<<<< + * + * def __contains__(self, object val): + */ + __pyx_v_self->monotonic = 0; + + /* "pandas/index.pyx":81 + * bint initialized, monotonic_check, unique_check + * + * def __init__(self, vgetter, n): # <<<<<<<<<<<<<< + * self.vgetter = vgetter + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.IndexEngine.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":92 + * self.monotonic = 0 + * + * def __contains__(self, object val): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * hash(val) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5index_11IndexEngine_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static int __pyx_pw_6pandas_5index_11IndexEngine_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_2__contains__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5index_11IndexEngine_2__contains__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_hash_t __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + + /* "pandas/index.pyx":93 + * + * def __contains__(self, object val): + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * hash(val) + * return val in self.mapping + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":94 + * def __contains__(self, object val): + * self._ensure_mapping_populated() + * hash(val) # <<<<<<<<<<<<<< + * return val in self.mapping + * + */ + __pyx_t_2 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":95 + * self._ensure_mapping_populated() + * hash(val) + * return val in self.mapping # <<<<<<<<<<<<<< + * + * cpdef get_value(self, ndarray arr, object key): + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_val, ((PyObject *)__pyx_v_self->mapping), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/index.pyx":92 + * self.monotonic = 0 + * + * def __contains__(self, object val): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * hash(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":97 + * return val in self.mapping + * + * cpdef get_value(self, ndarray arr, object key): # <<<<<<<<<<<<<< + * ''' + * arr : 1-dimensional ndarray + */ + +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_5get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_11IndexEngine_get_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, int __pyx_skip_dispatch) { + PyObject *__pyx_v_loc = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_5get_value)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_arr)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/index.pyx":105 + * void* data_ptr + * + * loc = self.get_loc(key) # <<<<<<<<<<<<<< + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): + * return arr[loc] + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_loc(__pyx_v_self, __pyx_v_key, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_loc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":106 + * + * loc = self.get_loc(key) + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): # <<<<<<<<<<<<<< + * return arr[loc] + * else: + */ + if (!(PySlice_Check(__pyx_v_loc) != 0)) { + __pyx_t_4 = PyArray_Check(__pyx_v_loc); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = (PySlice_Check(__pyx_v_loc) != 0); + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":107 + * loc = self.get_loc(key) + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): + * return arr[loc] # <<<<<<<<<<<<<< + * else: + * if arr.descr.type_num == NPY_DATETIME: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_v_loc); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/index.pyx":109 + * return arr[loc] + * else: + * if arr.descr.type_num == NPY_DATETIME: # <<<<<<<<<<<<<< + * return Timestamp(util.get_value_at(arr, loc)) + * return util.get_value_at(arr, loc) + */ + __pyx_t_5 = ((__pyx_v_arr->descr->type_num == NPY_DATETIME) != 0); + if (__pyx_t_5) { + + /* "pandas/index.pyx":110 + * else: + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) # <<<<<<<<<<<<<< + * return util.get_value_at(arr, loc) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":111 + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + * return util.get_value_at(arr, loc) # <<<<<<<<<<<<<< + * + * cpdef set_value(self, ndarray arr, object key, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":97 + * return val in self.mapping + * + * cpdef get_value(self, ndarray arr, object key): # <<<<<<<<<<<<<< + * ''' + * arr : 1-dimensional ndarray + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_5get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5index_11IndexEngine_4get_value[] = "\n arr : 1-dimensional ndarray\n "; +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_5get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_value (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_key,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_key = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_4get_value(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_arr, __pyx_v_key); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_4get_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_value(__pyx_v_self, __pyx_v_arr, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":113 + * return util.get_value_at(arr, loc) + * + * cpdef set_value(self, ndarray arr, object key, object value): # <<<<<<<<<<<<<< + * ''' + * arr : 1-dimensional ndarray + */ + +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_11IndexEngine_set_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch) { + PyObject *__pyx_v_loc = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value", 0); + __Pyx_INCREF(__pyx_v_value); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_7set_value)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_arr)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/index.pyx":121 + * void* data_ptr + * + * loc = self.get_loc(key) # <<<<<<<<<<<<<< + * value = convert_scalar(arr, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_loc(__pyx_v_self, __pyx_v_key, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_loc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":122 + * + * loc = self.get_loc(key) + * value = convert_scalar(arr, value) # <<<<<<<<<<<<<< + * + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): + */ + __pyx_t_1 = __pyx_f_6pandas_5index_convert_scalar(__pyx_v_arr, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":124 + * value = convert_scalar(arr, value) + * + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): # <<<<<<<<<<<<<< + * arr[loc] = value + * else: + */ + if (!(PySlice_Check(__pyx_v_loc) != 0)) { + __pyx_t_4 = PyArray_Check(__pyx_v_loc); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = (PySlice_Check(__pyx_v_loc) != 0); + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":125 + * + * if PySlice_Check(loc) or cnp.PyArray_Check(loc): + * arr[loc] = value # <<<<<<<<<<<<<< + * else: + * util.set_value_at(arr, loc, value) + */ + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_arr), __pyx_v_loc, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/index.pyx":127 + * arr[loc] = value + * else: + * util.set_value_at(arr, loc, value) # <<<<<<<<<<<<<< + * + * cpdef get_loc(self, object val): + */ + __pyx_t_1 = __pyx_f_4util_set_value_at(__pyx_v_arr, __pyx_v_loc, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "pandas/index.pyx":113 + * return util.get_value_at(arr, loc) + * + * cpdef set_value(self, ndarray arr, object key, object value): # <<<<<<<<<<<<<< + * ''' + * arr : 1-dimensional ndarray + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5index_11IndexEngine_6set_value[] = "\n arr : 1-dimensional ndarray\n "; +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_value (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_key,&__pyx_n_s_value,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_6set_value(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_arr, __pyx_v_key, __pyx_v_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_6set_value(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->set_value(__pyx_v_self, __pyx_v_arr, __pyx_v_key, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":129 + * util.set_value_at(arr, loc, value) + * + * cpdef get_loc(self, object val): # <<<<<<<<<<<<<< + * if is_definitely_invalid_key(val): + * raise TypeError + */ + +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_11IndexEngine_get_loc(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) { + PyObject *__pyx_v_values = NULL; + Py_ssize_t __pyx_v_loc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_loc", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_9get_loc)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/index.pyx":130 + * + * cpdef get_loc(self, object val): + * if is_definitely_invalid_key(val): # <<<<<<<<<<<<<< + * raise TypeError + * + */ + __pyx_t_1 = __pyx_f_6pandas_5index_is_definitely_invalid_key(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "pandas/index.pyx":131 + * cpdef get_loc(self, object val): + * if is_definitely_invalid_key(val): + * raise TypeError # <<<<<<<<<<<<<< + * + * if self.over_size_threshold and self.is_monotonic: + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":133 + * raise TypeError + * + * if self.over_size_threshold and self.is_monotonic: # <<<<<<<<<<<<<< + * if not self.is_unique: + * return self._get_loc_duplicates(val) + */ + __pyx_t_4 = __pyx_v_self->over_size_threshold; + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/index.pyx":134 + * + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = ((!__pyx_t_6) != 0); + if (__pyx_t_4) { + + /* "pandas/index.pyx":135 + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * values = self._get_index_values() + * loc = _bin_search(values, val) # .searchsorted(val, side='left') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":136 + * if not self.is_unique: + * return self._get_loc_duplicates(val) + * values = self._get_index_values() # <<<<<<<<<<<<<< + * loc = _bin_search(values, val) # .searchsorted(val, side='left') + * if util.get_value_at(values, loc) != val: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":137 + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + * loc = _bin_search(values, val) # .searchsorted(val, side='left') # <<<<<<<<<<<<<< + * if util.get_value_at(values, loc) != val: + * raise KeyError(val) + */ + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_f_6pandas_5index__bin_search(((PyArrayObject *)__pyx_v_values), __pyx_v_val); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_loc = __pyx_t_7; + + /* "pandas/index.pyx":138 + * values = self._get_index_values() + * loc = _bin_search(values, val) # .searchsorted(val, side='left') + * if util.get_value_at(values, loc) != val: # <<<<<<<<<<<<<< + * raise KeyError(val) + * return loc + */ + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_v_values), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "pandas/index.pyx":139 + * loc = _bin_search(values, val) # .searchsorted(val, side='left') + * if util.get_value_at(values, loc) != val: + * raise KeyError(val) # <<<<<<<<<<<<<< + * return loc + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":140 + * if util.get_value_at(values, loc) != val: + * raise KeyError(val) + * return loc # <<<<<<<<<<<<<< + * + * self._ensure_mapping_populated() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":142 + * return loc + * + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * if not self.unique: + * return self._get_loc_duplicates(val) + */ + __pyx_t_3 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/index.pyx":143 + * + * self._ensure_mapping_populated() + * if not self.unique: # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * + */ + __pyx_t_4 = ((!(__pyx_v_self->unique != 0)) != 0); + if (__pyx_t_4) { + + /* "pandas/index.pyx":144 + * self._ensure_mapping_populated() + * if not self.unique: + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * + * self._check_type(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":146 + * return self._get_loc_duplicates(val) + * + * self._check_type(val) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_check_type(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/index.pyx":148 + * self._check_type(val) + * + * try: # <<<<<<<<<<<<<< + * return self.mapping.get_item(val) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/index.pyx":149 + * + * try: + * return self.mapping.get_item(val) # <<<<<<<<<<<<<< + * except TypeError: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->mapping), __pyx_n_s_get_item); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L12_try_return; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":150 + * try: + * return self.mapping.get_item(val) + * except TypeError: # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_11) { + __Pyx_AddTraceback("pandas.index.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/index.pyx":151 + * return self.mapping.get_item(val) + * except TypeError: + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * cdef inline _get_loc_duplicates(self, object val): + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_Raise(__pyx_t_13, 0, 0, 0); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L12_try_return:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L0; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L15_try_end:; + } + + /* "pandas/index.pyx":129 + * util.set_value_at(arr, loc, value) + * + * cpdef get_loc(self, object val): # <<<<<<<<<<<<<< + * if is_definitely_invalid_key(val): + * raise TypeError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_loc (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_8get_loc(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_8get_loc(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_loc", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_loc(__pyx_v_self, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":153 + * raise KeyError(val) + * + * cdef inline _get_loc_duplicates(self, object val): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t diff + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + Py_ssize_t __pyx_v_diff; + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_left = NULL; + PyObject *__pyx_v_right = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_loc_duplicates", 0); + + /* "pandas/index.pyx":157 + * Py_ssize_t diff + * + * if self.is_monotonic: # <<<<<<<<<<<<<< + * values = self._get_index_values() + * left = values.searchsorted(val, side='left') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/index.pyx":158 + * + * if self.is_monotonic: + * values = self._get_index_values() # <<<<<<<<<<<<<< + * left = values.searchsorted(val, side='left') + * right = values.searchsorted(val, side='right') + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":159 + * if self.is_monotonic: + * values = self._get_index_values() + * left = values.searchsorted(val, side='left') # <<<<<<<<<<<<<< + * right = values.searchsorted(val, side='right') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_side, __pyx_n_s_left) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_left = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/index.pyx":160 + * values = self._get_index_values() + * left = values.searchsorted(val, side='left') + * right = values.searchsorted(val, side='right') # <<<<<<<<<<<<<< + * + * diff = right - left + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_right = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":162 + * right = values.searchsorted(val, side='right') + * + * diff = right - left # <<<<<<<<<<<<<< + * if diff == 0: + * raise KeyError(val) + */ + __pyx_t_1 = PyNumber_Subtract(__pyx_v_right, __pyx_v_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_diff = __pyx_t_6; + + /* "pandas/index.pyx":165 + * if diff == 0: + * raise KeyError(val) + * elif diff == 1: # <<<<<<<<<<<<<< + * return left + * else: + */ + switch (__pyx_v_diff) { + + /* "pandas/index.pyx":163 + * + * diff = right - left + * if diff == 0: # <<<<<<<<<<<<<< + * raise KeyError(val) + * elif diff == 1: + */ + case 0: + + /* "pandas/index.pyx":164 + * diff = right - left + * if diff == 0: + * raise KeyError(val) # <<<<<<<<<<<<<< + * elif diff == 1: + * return left + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + + /* "pandas/index.pyx":165 + * if diff == 0: + * raise KeyError(val) + * elif diff == 1: # <<<<<<<<<<<<<< + * return left + * else: + */ + case 1: + + /* "pandas/index.pyx":166 + * raise KeyError(val) + * elif diff == 1: + * return left # <<<<<<<<<<<<<< + * else: + * return slice(left, right) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_left); + __pyx_r = __pyx_v_left; + goto __pyx_L0; + break; + default: + + /* "pandas/index.pyx":168 + * return left + * else: + * return slice(left, right) # <<<<<<<<<<<<<< + * else: + * return self._maybe_get_bool_indexer(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_left); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_left); + __Pyx_GIVEREF(__pyx_v_left); + __Pyx_INCREF(__pyx_v_right); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_right); + __Pyx_GIVEREF(__pyx_v_right); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + break; + } + } + /*else*/ { + + /* "pandas/index.pyx":170 + * return slice(left, right) + * else: + * return self._maybe_get_bool_indexer(val) # <<<<<<<<<<<<<< + * + * cdef _maybe_get_bool_indexer(self, object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_maybe_get_bool_indexer(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":153 + * raise KeyError(val) + * + * cdef inline _get_loc_duplicates(self, object val): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t diff + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.index.IndexEngine._get_loc_duplicates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_left); + __Pyx_XDECREF(__pyx_v_right); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":172 + * return self._maybe_get_bool_indexer(val) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t] indexer + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine__maybe_get_bool_indexer(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_values = 0; + int __pyx_v_count; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_last_true; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_get_bool_indexer", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + + /* "pandas/index.pyx":176 + * ndarray[uint8_t] indexer + * ndarray[object] values + * int count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, n + * int last_true + */ + __pyx_v_count = 0; + + /* "pandas/index.pyx":180 + * int last_true + * + * values = self._get_index_values() # <<<<<<<<<<<<<< + * n = len(values) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":181 + * + * values = self._get_index_values() + * n = len(values) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool) + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_7; + + /* "pandas/index.pyx":183 + * n = len(values) + * + * result = np.empty(n, dtype=bool) # <<<<<<<<<<<<<< + * indexer = result.view(np.uint8) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; + + /* "pandas/index.pyx":184 + * + * result = np.empty(n, dtype=bool) + * indexer = result.view(np.uint8) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/index.pyx":186 + * indexer = result.view(np.uint8) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if values[i] == val: + * count += 1 + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/index.pyx":187 + * + * for i in range(n): + * if values[i] == val: # <<<<<<<<<<<<<< + * count += 1 + * indexer[i] = 1 + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_9); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_14) { + + /* "pandas/index.pyx":188 + * for i in range(n): + * if values[i] == val: + * count += 1 # <<<<<<<<<<<<<< + * indexer[i] = 1 + * last_true = i + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/index.pyx":189 + * if values[i] == val: + * count += 1 + * indexer[i] = 1 # <<<<<<<<<<<<<< + * last_true = i + * else: + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides) = 1; + + /* "pandas/index.pyx":190 + * count += 1 + * indexer[i] = 1 + * last_true = i # <<<<<<<<<<<<<< + * else: + * indexer[i] = 0 + */ + __pyx_v_last_true = __pyx_v_i; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/index.pyx":192 + * last_true = i + * else: + * indexer[i] = 0 # <<<<<<<<<<<<<< + * + * if count == 0: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = 0; + } + __pyx_L5:; + } + + /* "pandas/index.pyx":194 + * indexer[i] = 0 + * + * if count == 0: # <<<<<<<<<<<<<< + * raise KeyError(val) + * if count == 1: + */ + __pyx_t_14 = ((__pyx_v_count == 0) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":195 + * + * if count == 0: + * raise KeyError(val) # <<<<<<<<<<<<<< + * if count == 1: + * return last_true + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":196 + * if count == 0: + * raise KeyError(val) + * if count == 1: # <<<<<<<<<<<<<< + * return last_true + * + */ + __pyx_t_14 = ((__pyx_v_count == 1) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":197 + * raise KeyError(val) + * if count == 1: + * return last_true # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_last_true); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":199 + * return last_true + * + * return result # <<<<<<<<<<<<<< + * + * property is_unique: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/index.pyx":172 + * return self._maybe_get_bool_indexer(val) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t] indexer + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.index.IndexEngine._maybe_get_bool_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":203 + * property is_unique: + * + * def __get__(self): # <<<<<<<<<<<<<< + * if not self.unique_check: + * self._do_unique_check() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9is_unique_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_9is_unique_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_9is_unique___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_9is_unique___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/index.pyx":204 + * + * def __get__(self): + * if not self.unique_check: # <<<<<<<<<<<<<< + * self._do_unique_check() + * + */ + __pyx_t_1 = ((!(__pyx_v_self->unique_check != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":205 + * def __get__(self): + * if not self.unique_check: + * self._do_unique_check() # <<<<<<<<<<<<<< + * + * return self.unique == 1 + */ + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__do_unique_check(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":207 + * self._do_unique_check() + * + * return self.unique == 1 # <<<<<<<<<<<<<< + * + * property is_monotonic: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->unique == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":203 + * property is_unique: + * + * def __get__(self): # <<<<<<<<<<<<<< + * if not self.unique_check: + * self._do_unique_check() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.IndexEngine.is_unique.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":211 + * property is_monotonic: + * + * def __get__(self): # <<<<<<<<<<<<<< + * if not self.monotonic_check: + * self._do_monotonic_check() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_12is_monotonic_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_12is_monotonic_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_12is_monotonic___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_12is_monotonic___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/index.pyx":212 + * + * def __get__(self): + * if not self.monotonic_check: # <<<<<<<<<<<<<< + * self._do_monotonic_check() + * + */ + __pyx_t_1 = ((!(__pyx_v_self->monotonic_check != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":213 + * def __get__(self): + * if not self.monotonic_check: + * self._do_monotonic_check() # <<<<<<<<<<<<<< + * + * return self.monotonic == 1 + */ + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__do_monotonic_check(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":215 + * self._do_monotonic_check() + * + * return self.monotonic == 1 # <<<<<<<<<<<<<< + * + * cdef inline _do_monotonic_check(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_self->monotonic == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":211 + * property is_monotonic: + * + * def __get__(self): # <<<<<<<<<<<<<< + * if not self.monotonic_check: + * self._do_monotonic_check() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.IndexEngine.is_monotonic.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":217 + * return self.monotonic == 1 + * + * cdef inline _do_monotonic_check(self): # <<<<<<<<<<<<<< + * try: + * values = self._get_index_values() + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__do_monotonic_check(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_unique = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_do_monotonic_check", 0); + + /* "pandas/index.pyx":218 + * + * cdef inline _do_monotonic_check(self): + * try: # <<<<<<<<<<<<<< + * values = self._get_index_values() + * self.monotonic, unique = self._call_monotonic(values) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/index.pyx":219 + * cdef inline _do_monotonic_check(self): + * try: + * values = self._get_index_values() # <<<<<<<<<<<<<< + * self.monotonic, unique = self._call_monotonic(values) + * + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_values = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/index.pyx":220 + * try: + * values = self._get_index_values() + * self.monotonic, unique = self._call_monotonic(values) # <<<<<<<<<<<<<< + * + * if unique is not None: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_call_monotonic); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_unpacking_done; + __pyx_L11_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L12_unpacking_done:; + } + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->monotonic = __pyx_t_9; + __pyx_v_unique = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/index.pyx":222 + * self.monotonic, unique = self._call_monotonic(values) + * + * if unique is not None: # <<<<<<<<<<<<<< + * self.unique = unique + * self.unique_check = 1 + */ + __pyx_t_9 = (__pyx_v_unique != Py_None); + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "pandas/index.pyx":223 + * + * if unique is not None: + * self.unique = unique # <<<<<<<<<<<<<< + * self.unique_check = 1 + * + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_unique); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_self->unique = __pyx_t_10; + + /* "pandas/index.pyx":224 + * if unique is not None: + * self.unique = unique + * self.unique_check = 1 # <<<<<<<<<<<<<< + * + * except TypeError: + */ + __pyx_v_self->unique_check = 1; + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/index.pyx":226 + * self.unique_check = 1 + * + * except TypeError: # <<<<<<<<<<<<<< + * self.monotonic = 0 + * self.monotonic_check = 1 + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_11) { + __Pyx_AddTraceback("pandas.index.IndexEngine._do_monotonic_check", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/index.pyx":227 + * + * except TypeError: + * self.monotonic = 0 # <<<<<<<<<<<<<< + * self.monotonic_check = 1 + * + */ + __pyx_v_self->monotonic = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/index.pyx":228 + * except TypeError: + * self.monotonic = 0 + * self.monotonic_check = 1 # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ + __pyx_v_self->monotonic_check = 1; + + /* "pandas/index.pyx":217 + * return self.monotonic == 1 + * + * cdef inline _do_monotonic_check(self): # <<<<<<<<<<<<<< + * try: + * values = self._get_index_values() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.index.IndexEngine._do_monotonic_check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_unique); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":230 + * self.monotonic_check = 1 + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return self.vgetter() + * + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine__get_index_values(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_index_values", 0); + + /* "pandas/index.pyx":231 + * + * cdef _get_index_values(self): + * return self.vgetter() # <<<<<<<<<<<<<< + * + * cdef inline _do_unique_check(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->vgetter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":230 + * self.monotonic_check = 1 + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return self.vgetter() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":233 + * return self.vgetter() + * + * cdef inline _do_unique_check(self): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__do_unique_check(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_do_unique_check", 0); + + /* "pandas/index.pyx":234 + * + * cdef inline _do_unique_check(self): + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":233 + * return self.vgetter() + * + * cdef inline _do_unique_check(self): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine._do_unique_check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":236 + * self._ensure_mapping_populated() + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_11_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_11_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_10_call_monotonic(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_10_call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":237 + * + * def _call_monotonic(self, values): + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":236 + * self._ensure_mapping_populated() + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":239 + * raise NotImplementedError + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine__make_hash_table(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_n) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_hash_table", 0); + + /* "pandas/index.pyx":240 + * + * cdef _make_hash_table(self, n): + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef _check_type(self, object val): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":239 + * raise NotImplementedError + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":242 + * raise NotImplementedError + * + * cdef _check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine__check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_hash_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_type", 0); + + /* "pandas/index.pyx":243 + * + * cdef _check_type(self, object val): + * hash(val) # <<<<<<<<<<<<<< + * + * cdef inline _ensure_mapping_populated(self): + */ + __pyx_t_1 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":242 + * raise NotImplementedError + * + * cdef _check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.index.IndexEngine._check_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":245 + * hash(val) + * + * cdef inline _ensure_mapping_populated(self): # <<<<<<<<<<<<<< + * if not self.initialized: + * self.initialize() + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ensure_mapping_populated", 0); + + /* "pandas/index.pyx":246 + * + * cdef inline _ensure_mapping_populated(self): + * if not self.initialized: # <<<<<<<<<<<<<< + * self.initialize() + * + */ + __pyx_t_1 = ((!(__pyx_v_self->initialized != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":247 + * cdef inline _ensure_mapping_populated(self): + * if not self.initialized: + * self.initialize() # <<<<<<<<<<<<<< + * + * cdef initialize(self): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->initialize(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":245 + * hash(val) + * + * cdef inline _ensure_mapping_populated(self): # <<<<<<<<<<<<<< + * if not self.initialized: + * self.initialize() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.IndexEngine._ensure_mapping_populated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":249 + * self.initialize() + * + * cdef initialize(self): # <<<<<<<<<<<<<< + * values = self._get_index_values() + * + */ + +static PyObject *__pyx_f_6pandas_5index_11IndexEngine_initialize(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("initialize", 0); + + /* "pandas/index.pyx":250 + * + * cdef initialize(self): + * values = self._get_index_values() # <<<<<<<<<<<<<< + * + * self.mapping = self._make_hash_table(len(values)) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":252 + * values = self._get_index_values() + * + * self.mapping = self._make_hash_table(len(values)) # <<<<<<<<<<<<<< + * self.mapping.map_locations(values) + * + */ + __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_make_hash_table(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_9hashtable_HashTable))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->mapping); + __Pyx_DECREF(((PyObject *)__pyx_v_self->mapping)); + __pyx_v_self->mapping = ((struct __pyx_obj_6pandas_9hashtable_HashTable *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":253 + * + * self.mapping = self._make_hash_table(len(values)) + * self.mapping.map_locations(values) # <<<<<<<<<<<<<< + * + * if len(self.mapping) == len(values): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->mapping), __pyx_n_s_map_locations); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/index.pyx":255 + * self.mapping.map_locations(values) + * + * if len(self.mapping) == len(values): # <<<<<<<<<<<<<< + * self.unique = 1 + * self.unique_check = 1 + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->mapping); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((__pyx_t_2 == __pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "pandas/index.pyx":256 + * + * if len(self.mapping) == len(values): + * self.unique = 1 # <<<<<<<<<<<<<< + * self.unique_check = 1 + * + */ + __pyx_v_self->unique = 1; + + /* "pandas/index.pyx":257 + * if len(self.mapping) == len(values): + * self.unique = 1 + * self.unique_check = 1 # <<<<<<<<<<<<<< + * + * self.initialized = 1 + */ + __pyx_v_self->unique_check = 1; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":259 + * self.unique_check = 1 + * + * self.initialized = 1 # <<<<<<<<<<<<<< + * + * def clear_mapping(self): + */ + __pyx_v_self->initialized = 1; + + /* "pandas/index.pyx":249 + * self.initialize() + * + * cdef initialize(self): # <<<<<<<<<<<<<< + * values = self._get_index_values() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.IndexEngine.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":261 + * self.initialized = 1 + * + * def clear_mapping(self): # <<<<<<<<<<<<<< + * self.mapping = None + * self.initialized = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_13clear_mapping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_13clear_mapping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear_mapping (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_12clear_mapping(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_12clear_mapping(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear_mapping", 0); + + /* "pandas/index.pyx":262 + * + * def clear_mapping(self): + * self.mapping = None # <<<<<<<<<<<<<< + * self.initialized = 0 + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->mapping); + __Pyx_DECREF(((PyObject *)__pyx_v_self->mapping)); + __pyx_v_self->mapping = ((struct __pyx_obj_6pandas_9hashtable_HashTable *)Py_None); + + /* "pandas/index.pyx":263 + * def clear_mapping(self): + * self.mapping = None + * self.initialized = 0 # <<<<<<<<<<<<<< + * + * def get_indexer(self, values): + */ + __pyx_v_self->initialized = 0; + + /* "pandas/index.pyx":261 + * self.initialized = 1 + * + * def clear_mapping(self): # <<<<<<<<<<<<<< + * self.mapping = None + * self.initialized = 0 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":265 + * self.initialized = 0 + * + * def get_indexer(self, values): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * return self.mapping.lookup(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_15get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_15get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indexer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_14get_indexer(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_14get_indexer(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_indexer", 0); + + /* "pandas/index.pyx":266 + * + * def get_indexer(self, values): + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * return self.mapping.lookup(values) + * + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":267 + * def get_indexer(self, values): + * self._ensure_mapping_populated() + * return self.mapping.lookup(values) # <<<<<<<<<<<<<< + * + * def get_indexer_non_unique(self, targets): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->mapping), __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":265 + * self.initialized = 0 + * + * def get_indexer(self, values): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * return self.mapping.lookup(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.IndexEngine.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":269 + * return self.mapping.lookup(values) + * + * def get_indexer_non_unique(self, targets): # <<<<<<<<<<<<<< + * """ return an indexer suitable for takng from a non unique index + * return the labels in the same order ast the target + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_17get_indexer_non_unique(PyObject *__pyx_v_self, PyObject *__pyx_v_targets); /*proto*/ +static char __pyx_doc_6pandas_5index_11IndexEngine_16get_indexer_non_unique[] = " return an indexer suitable for takng from a non unique index\n return the labels in the same order ast the target\n and a missing indexer into the targets (which correspond\n to the -1 indicies in the results "; +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_17get_indexer_non_unique(PyObject *__pyx_v_self, PyObject *__pyx_v_targets) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indexer_non_unique (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_16get_indexer_non_unique(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), ((PyObject *)__pyx_v_targets)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_16get_indexer_non_unique(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self, PyObject *__pyx_v_targets) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_missing = 0; + PyObject *__pyx_v_stargets = 0; + PyObject *__pyx_v_d = 0; + PyObject *__pyx_v_val = 0; + int __pyx_v_count; + int __pyx_v_count_missing; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_n_t; + Py_ssize_t __pyx_v_n_alloc; + CYTHON_UNUSED PyObject *__pyx_v_members = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_missing; + __Pyx_Buffer __pyx_pybuffer_missing; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject *(*__pyx_t_17)(PyObject *); + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + int __pyx_t_20; + int __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_indexer_non_unique", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_missing.pybuffer.buf = NULL; + __pyx_pybuffer_missing.refcount = 0; + __pyx_pybuffernd_missing.data = NULL; + __pyx_pybuffernd_missing.rcbuffer = &__pyx_pybuffer_missing; + + /* "pandas/index.pyx":279 + * ndarray[int64_t] result, missing + * set stargets + * dict d = {} # <<<<<<<<<<<<<< + * object val + * int count = 0, count_missing = 0 + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_d = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":281 + * dict d = {} + * object val + * int count = 0, count_missing = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, j, n, n_t, n_alloc + * + */ + __pyx_v_count = 0; + __pyx_v_count_missing = 0; + + /* "pandas/index.pyx":284 + * Py_ssize_t i, j, n, n_t, n_alloc + * + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * values = self._get_index_values() + * stargets = set(targets) + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":285 + * + * self._ensure_mapping_populated() + * values = self._get_index_values() # <<<<<<<<<<<<<< + * stargets = set(targets) + * n = len(values) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_values = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":286 + * self._ensure_mapping_populated() + * values = self._get_index_values() + * stargets = set(targets) # <<<<<<<<<<<<<< + * n = len(values) + * n_t = len(targets) + */ + __pyx_t_1 = PySet_New(__pyx_v_targets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_stargets = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":287 + * values = self._get_index_values() + * stargets = set(targets) + * n = len(values) # <<<<<<<<<<<<<< + * n_t = len(targets) + * if n > 10000: + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/index.pyx":288 + * stargets = set(targets) + * n = len(values) + * n_t = len(targets) # <<<<<<<<<<<<<< + * if n > 10000: + * n_alloc = 10000 + */ + __pyx_t_2 = PyObject_Length(__pyx_v_targets); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n_t = __pyx_t_2; + + /* "pandas/index.pyx":289 + * n = len(values) + * n_t = len(targets) + * if n > 10000: # <<<<<<<<<<<<<< + * n_alloc = 10000 + * else: + */ + __pyx_t_3 = ((__pyx_v_n > 10000) != 0); + if (__pyx_t_3) { + + /* "pandas/index.pyx":290 + * n_t = len(targets) + * if n > 10000: + * n_alloc = 10000 # <<<<<<<<<<<<<< + * else: + * n_alloc = n + */ + __pyx_v_n_alloc = 10000; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/index.pyx":292 + * n_alloc = 10000 + * else: + * n_alloc = n # <<<<<<<<<<<<<< + * + * result = np.empty(n_alloc, dtype=np.int64) + */ + __pyx_v_n_alloc = __pyx_v_n; + } + __pyx_L3:; + + /* "pandas/index.pyx":294 + * n_alloc = n + * + * result = np.empty(n_alloc, dtype=np.int64) # <<<<<<<<<<<<<< + * missing = np.empty(n_t, dtype=np.int64) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_alloc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/index.pyx":295 + * + * result = np.empty(n_alloc, dtype=np.int64) + * missing = np.empty(n_t, dtype=np.int64) # <<<<<<<<<<<<<< + * + * # form the set of the results (like ismember) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n_t); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_missing.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_missing.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_missing.rcbuffer->pybuffer, (PyObject*)__pyx_v_missing, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + } + } + __pyx_pybuffernd_missing.diminfo[0].strides = __pyx_pybuffernd_missing.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_missing.diminfo[0].shape = __pyx_pybuffernd_missing.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_missing = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/index.pyx":298 + * + * # form the set of the results (like ismember) + * members = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i in range(n): + * val = util.get_value_1d(values, i) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_members = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/index.pyx":299 + * # form the set of the results (like ismember) + * members = np.empty(n, dtype=np.uint8) + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(values, i) + * if val in stargets: + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/index.pyx":300 + * members = np.empty(n, dtype=np.uint8) + * for i in range(n): + * val = util.get_value_1d(values, i) # <<<<<<<<<<<<<< + * if val in stargets: + * if val not in d: + */ + __pyx_t_4 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/index.pyx":301 + * for i in range(n): + * val = util.get_value_1d(values, i) + * if val in stargets: # <<<<<<<<<<<<<< + * if val not in d: + * d[val] = [] + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_stargets, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (__pyx_t_3 != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":302 + * val = util.get_value_1d(values, i) + * if val in stargets: + * if val not in d: # <<<<<<<<<<<<<< + * d[val] = [] + * d[val].append(i) + */ + __pyx_t_14 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_d, Py_NE)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__pyx_t_14 != 0); + if (__pyx_t_3) { + + /* "pandas/index.pyx":303 + * if val in stargets: + * if val not in d: + * d[val] = [] # <<<<<<<<<<<<<< + * d[val].append(i) + * + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_v_val, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/index.pyx":304 + * if val not in d: + * d[val] = [] + * d[val].append(i) # <<<<<<<<<<<<<< + * + * for i in range(n_t): + */ + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_d, __pyx_v_val); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_6); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + __pyx_L6:; + } + + /* "pandas/index.pyx":306 + * d[val].append(i) + * + * for i in range(n_t): # <<<<<<<<<<<<<< + * + * val = util.get_value_1d(targets, i) + */ + __pyx_t_2 = __pyx_v_n_t; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/index.pyx":308 + * for i in range(n_t): + * + * val = util.get_value_1d(targets, i) # <<<<<<<<<<<<<< + * + * # found + */ + if (!(likely(((__pyx_v_targets) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_targets, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = get_value_1d(((PyArrayObject *)__pyx_v_targets), __pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/index.pyx":311 + * + * # found + * if val in d: # <<<<<<<<<<<<<< + * for j in d[val]: + * + */ + __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_d, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (__pyx_t_3 != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":312 + * # found + * if val in d: + * for j in d[val]: # <<<<<<<<<<<<<< + * + * # realloc if needed + */ + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_d, __pyx_v_val); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + } else { + __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_17(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_j = __pyx_t_18; + + /* "pandas/index.pyx":315 + * + * # realloc if needed + * if count >= n_alloc: # <<<<<<<<<<<<<< + * n_alloc += 10000 + * result = np.resize(result, n_alloc) + */ + __pyx_t_14 = ((__pyx_v_count >= __pyx_v_n_alloc) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":316 + * # realloc if needed + * if count >= n_alloc: + * n_alloc += 10000 # <<<<<<<<<<<<<< + * result = np.resize(result, n_alloc) + * + */ + __pyx_v_n_alloc = (__pyx_v_n_alloc + 10000); + + /* "pandas/index.pyx":317 + * if count >= n_alloc: + * n_alloc += 10000 + * result = np.resize(result, n_alloc) # <<<<<<<<<<<<<< + * + * result[count] = j + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n_alloc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_6)); + __pyx_t_6 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/index.pyx":319 + * result = np.resize(result, n_alloc) + * + * result[count] = j # <<<<<<<<<<<<<< + * count += 1 + * + */ + __pyx_t_9 = __pyx_v_count; + __pyx_t_19 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/index.pyx":320 + * + * result[count] = j + * count += 1 # <<<<<<<<<<<<<< + * + * # value not found + */ + __pyx_v_count = (__pyx_v_count + 1); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/index.pyx":325 + * else: + * + * if count >= n_alloc: # <<<<<<<<<<<<<< + * n_alloc += 10000 + * result = np.resize(result, n_alloc) + */ + __pyx_t_14 = ((__pyx_v_count >= __pyx_v_n_alloc) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":326 + * + * if count >= n_alloc: + * n_alloc += 10000 # <<<<<<<<<<<<<< + * result = np.resize(result, n_alloc) + * result[count] = -1 + */ + __pyx_v_n_alloc = (__pyx_v_n_alloc + 10000); + + /* "pandas/index.pyx":327 + * if count >= n_alloc: + * n_alloc += 10000 + * result = np.resize(result, n_alloc) # <<<<<<<<<<<<<< + * result[count] = -1 + * count += 1 + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_alloc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_19 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/index.pyx":328 + * n_alloc += 10000 + * result = np.resize(result, n_alloc) + * result[count] = -1 # <<<<<<<<<<<<<< + * count += 1 + * missing[count_missing] = i + */ + __pyx_t_19 = __pyx_v_count; + __pyx_t_20 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_20 = 0; + if (unlikely(__pyx_t_20 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_20); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = -1; + + /* "pandas/index.pyx":329 + * result = np.resize(result, n_alloc) + * result[count] = -1 + * count += 1 # <<<<<<<<<<<<<< + * missing[count_missing] = i + * count_missing += 1 + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/index.pyx":330 + * result[count] = -1 + * count += 1 + * missing[count_missing] = i # <<<<<<<<<<<<<< + * count_missing += 1 + * + */ + __pyx_t_20 = __pyx_v_count_missing; + __pyx_t_21 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_missing.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_21 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_missing.diminfo[0].shape)) __pyx_t_21 = 0; + if (unlikely(__pyx_t_21 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_21); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_missing.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_missing.diminfo[0].strides) = __pyx_v_i; + + /* "pandas/index.pyx":331 + * count += 1 + * missing[count_missing] = i + * count_missing += 1 # <<<<<<<<<<<<<< + * + * return result[0:count], missing[0:count_missing] + */ + __pyx_v_count_missing = (__pyx_v_count_missing + 1); + } + __pyx_L10:; + } + + /* "pandas/index.pyx":333 + * count_missing += 1 + * + * return result[0:count], missing[0:count_missing] # <<<<<<<<<<<<<< + * + * cdef class Int64Engine(IndexEngine): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_result), 0, __pyx_v_count, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_missing), 0, __pyx_v_count_missing, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":269 + * return self.mapping.lookup(values) + * + * def get_indexer_non_unique(self, targets): # <<<<<<<<<<<<<< + * """ return an indexer suitable for takng from a non unique index + * return the labels in the same order ast the target + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_missing.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.index.IndexEngine.get_indexer_non_unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_missing.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_missing); + __Pyx_XDECREF(__pyx_v_stargets); + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_members); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":73 + * + * cdef readonly: + * object vgetter # <<<<<<<<<<<<<< + * HashTable mapping + * bint over_size_threshold + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7vgetter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7vgetter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_7vgetter___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_7vgetter___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->vgetter); + __pyx_r = __pyx_v_self->vgetter; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":74 + * cdef readonly: + * object vgetter + * HashTable mapping # <<<<<<<<<<<<<< + * bint over_size_threshold + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7mapping_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_7mapping_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_7mapping___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_7mapping___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->mapping)); + __pyx_r = ((PyObject *)__pyx_v_self->mapping); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":75 + * object vgetter + * HashTable mapping + * bint over_size_threshold # <<<<<<<<<<<<<< + * + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_19over_size_threshold_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11IndexEngine_19over_size_threshold_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11IndexEngine_19over_size_threshold___get__(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11IndexEngine_19over_size_threshold___get__(struct __pyx_obj_6pandas_5index_IndexEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->over_size_threshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.IndexEngine.over_size_threshold.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":337 + * cdef class Int64Engine(IndexEngine): + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return algos.ensure_int64(self.vgetter()) + * + */ + +static PyObject *__pyx_f_6pandas_5index_11Int64Engine__get_index_values(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_index_values", 0); + + /* "pandas/index.pyx":338 + * + * cdef _get_index_values(self): + * return algos.ensure_int64(self.vgetter()) # <<<<<<<<<<<<<< + * + * cdef _make_hash_table(self, n): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ensure_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.vgetter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":337 + * cdef class Int64Engine(IndexEngine): + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return algos.ensure_int64(self.vgetter()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Int64Engine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":340 + * return algos.ensure_int64(self.vgetter()) + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.Int64HashTable(n) + * + */ + +static PyObject *__pyx_f_6pandas_5index_11Int64Engine__make_hash_table(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_n) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_hash_table", 0); + + /* "pandas/index.pyx":341 + * + * cdef _make_hash_table(self, n): + * return _hash.Int64HashTable(n) # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Int64HashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":340 + * return algos.ensure_int64(self.vgetter()) + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.Int64HashTable(n) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Int64Engine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":343 + * return _hash.Int64HashTable(n) + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_int64(values) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_11Int64Engine__call_monotonic(((struct __pyx_obj_6pandas_5index_Int64Engine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":344 + * + * def _call_monotonic(self, values): + * return algos.is_monotonic_int64(values) # <<<<<<<<<<<<<< + * + * def get_pad_indexer(self, other, limit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_monotonic_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":343 + * return _hash.Int64HashTable(n) + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_int64(values) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Int64Engine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":346 + * return algos.is_monotonic_int64(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pad_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.Int64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_11Int64Engine_2get_pad_indexer(((struct __pyx_obj_6pandas_5index_Int64Engine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_pad_indexer", 0); + + /* "pandas/index.pyx":347 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pad_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Int64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":348 + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * def get_backfill_indexer(self, other, limit=None): + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":347 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":346 + * return algos.is_monotonic_int64(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Int64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":350 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_11Int64Engine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_backfill_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.Int64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_11Int64Engine_4get_backfill_indexer(((struct __pyx_obj_6pandas_5index_Int64Engine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_11Int64Engine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_backfill_indexer", 0); + + /* "pandas/index.pyx":351 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Int64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":352 + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * cdef _check_type(self, object val): + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":351 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":350 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Int64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":354 + * limit=limit) + * + * cdef _check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * if util.is_bool_object(val): + */ + +static PyObject *__pyx_f_6pandas_5index_11Int64Engine__check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_hash_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_type", 0); + + /* "pandas/index.pyx":355 + * + * cdef _check_type(self, object val): + * hash(val) # <<<<<<<<<<<<<< + * if util.is_bool_object(val): + * raise KeyError(val) + */ + __pyx_t_1 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":356 + * cdef _check_type(self, object val): + * hash(val) + * if util.is_bool_object(val): # <<<<<<<<<<<<<< + * raise KeyError(val) + * elif util.is_float_object(val): + */ + __pyx_t_2 = (is_bool_object(__pyx_v_val) != 0); + if (__pyx_t_2) { + + /* "pandas/index.pyx":357 + * hash(val) + * if util.is_bool_object(val): + * raise KeyError(val) # <<<<<<<<<<<<<< + * elif util.is_float_object(val): + * raise KeyError(val) + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":358 + * if util.is_bool_object(val): + * raise KeyError(val) + * elif util.is_float_object(val): # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_2 = (is_float_object(__pyx_v_val) != 0); + if (__pyx_t_2) { + + /* "pandas/index.pyx":359 + * raise KeyError(val) + * elif util.is_float_object(val): + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * cdef _maybe_get_bool_indexer(self, object val): + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":354 + * limit=limit) + * + * cdef _check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * if util.is_bool_object(val): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Int64Engine._check_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":361 + * raise KeyError(val) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t, cast=True] indexer + */ + +static PyObject *__pyx_f_6pandas_5index_11Int64Engine__maybe_get_bool_indexer(struct __pyx_obj_6pandas_5index_Int64Engine *__pyx_v_self, PyObject *__pyx_v_val) { + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_values = 0; + int __pyx_v_count; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_ival; + int __pyx_v_last_true; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_4; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyArrayObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_get_bool_indexer", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + + /* "pandas/index.pyx":365 + * ndarray[uint8_t, cast=True] indexer + * ndarray[int64_t] values + * int count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, n + * int64_t ival + */ + __pyx_v_count = 0; + + /* "pandas/index.pyx":370 + * int last_true + * + * if not util.is_integer_object(val): # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_1 = ((!(is_integer_object(__pyx_v_val) != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":371 + * + * if not util.is_integer_object(val): + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * ival = val + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":373 + * raise KeyError(val) + * + * ival = val # <<<<<<<<<<<<<< + * + * values = self._get_index_values() + */ + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_4 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ival = __pyx_t_4; + + /* "pandas/index.pyx":375 + * ival = val + * + * values = self._get_index_values() # <<<<<<<<<<<<<< + * n = len(values) + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_Int64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":376 + * + * values = self._get_index_values() + * n = len(values) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool) + */ + __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_10; + + /* "pandas/index.pyx":378 + * n = len(values) + * + * result = np.empty(n, dtype=bool) # <<<<<<<<<<<<<< + * indexer = result.view(np.uint8) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/index.pyx":379 + * + * result = np.empty(n, dtype=bool) + * indexer = result.view(np.uint8) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/index.pyx":381 + * indexer = result.view(np.uint8) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if values[i] == val: + * count += 1 + */ + __pyx_t_10 = __pyx_v_n; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/index.pyx":382 + * + * for i in range(n): + * if values[i] == val: # <<<<<<<<<<<<<< + * count += 1 + * indexer[i] = 1 + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_values.diminfo[0].strides))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_11, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/index.pyx":383 + * for i in range(n): + * if values[i] == val: + * count += 1 # <<<<<<<<<<<<<< + * indexer[i] = 1 + * last_true = i + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/index.pyx":384 + * if values[i] == val: + * count += 1 + * indexer[i] = 1 # <<<<<<<<<<<<<< + * last_true = i + * else: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = 1; + + /* "pandas/index.pyx":385 + * count += 1 + * indexer[i] = 1 + * last_true = i # <<<<<<<<<<<<<< + * else: + * indexer[i] = 0 + */ + __pyx_v_last_true = __pyx_v_i; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/index.pyx":387 + * last_true = i + * else: + * indexer[i] = 0 # <<<<<<<<<<<<<< + * + * if count == 0: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = 0; + } + __pyx_L6:; + } + + /* "pandas/index.pyx":389 + * indexer[i] = 0 + * + * if count == 0: # <<<<<<<<<<<<<< + * raise KeyError(val) + * if count == 1: + */ + __pyx_t_1 = ((__pyx_v_count == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":390 + * + * if count == 0: + * raise KeyError(val) # <<<<<<<<<<<<<< + * if count == 1: + * return last_true + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":391 + * if count == 0: + * raise KeyError(val) + * if count == 1: # <<<<<<<<<<<<<< + * return last_true + * + */ + __pyx_t_1 = ((__pyx_v_count == 1) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":392 + * raise KeyError(val) + * if count == 1: + * return last_true # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_last_true); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":394 + * return last_true + * + * return result # <<<<<<<<<<<<<< + * + * cdef class Float64Engine(IndexEngine): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/index.pyx":361 + * raise KeyError(val) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t, cast=True] indexer + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.index.Int64Engine._maybe_get_bool_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":398 + * cdef class Float64Engine(IndexEngine): + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.Float64HashTable(n) + * + */ + +static PyObject *__pyx_f_6pandas_5index_13Float64Engine__make_hash_table(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_n) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_hash_table", 0); + + /* "pandas/index.pyx":399 + * + * cdef _make_hash_table(self, n): + * return _hash.Float64HashTable(n) # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Float64HashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":398 + * cdef class Float64Engine(IndexEngine): + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.Float64HashTable(n) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Float64Engine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":401 + * return _hash.Float64HashTable(n) + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return algos.ensure_float64(self.vgetter()) + * + */ + +static PyObject *__pyx_f_6pandas_5index_13Float64Engine__get_index_values(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_index_values", 0); + + /* "pandas/index.pyx":402 + * + * cdef _get_index_values(self): + * return algos.ensure_float64(self.vgetter()) # <<<<<<<<<<<<<< + * + * cdef _maybe_get_bool_indexer(self, object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ensure_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.vgetter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":401 + * return _hash.Float64HashTable(n) + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return algos.ensure_float64(self.vgetter()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Float64Engine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":404 + * return algos.ensure_float64(self.vgetter()) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t] indexer + */ + +static PyObject *__pyx_f_6pandas_5index_13Float64Engine__maybe_get_bool_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_val) { + PyArrayObject *__pyx_v_indexer = 0; + PyArrayObject *__pyx_v_values = 0; + int __pyx_v_count; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_last_true; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyArrayObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_get_bool_indexer", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + + /* "pandas/index.pyx":408 + * ndarray[uint8_t] indexer + * ndarray[float64_t] values + * int count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, n + * int last_true + */ + __pyx_v_count = 0; + + /* "pandas/index.pyx":412 + * int last_true + * + * values = self._get_index_values() # <<<<<<<<<<<<<< + * n = len(values) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Float64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = 0; + __pyx_v_values = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":413 + * + * values = self._get_index_values() + * n = len(values) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool) + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_7; + + /* "pandas/index.pyx":415 + * n = len(values) + * + * result = np.empty(n, dtype=bool) # <<<<<<<<<<<<<< + * indexer = result.view(np.uint8) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; + + /* "pandas/index.pyx":416 + * + * result = np.empty(n, dtype=bool) + * indexer = result.view(np.uint8) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/index.pyx":418 + * indexer = result.view(np.uint8) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if values[i] == val: + * count += 1 + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/index.pyx":419 + * + * for i in range(n): + * if values[i] == val: # <<<<<<<<<<<<<< + * count += 1 + * indexer[i] = 1 + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_14) { + + /* "pandas/index.pyx":420 + * for i in range(n): + * if values[i] == val: + * count += 1 # <<<<<<<<<<<<<< + * indexer[i] = 1 + * last_true = i + */ + __pyx_v_count = (__pyx_v_count + 1); + + /* "pandas/index.pyx":421 + * if values[i] == val: + * count += 1 + * indexer[i] = 1 # <<<<<<<<<<<<<< + * last_true = i + * else: + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_indexer.diminfo[0].strides) = 1; + + /* "pandas/index.pyx":422 + * count += 1 + * indexer[i] = 1 + * last_true = i # <<<<<<<<<<<<<< + * else: + * indexer[i] = 0 + */ + __pyx_v_last_true = __pyx_v_i; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/index.pyx":424 + * last_true = i + * else: + * indexer[i] = 0 # <<<<<<<<<<<<<< + * + * if count == 0: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_indexer.diminfo[0].strides) = 0; + } + __pyx_L5:; + } + + /* "pandas/index.pyx":426 + * indexer[i] = 0 + * + * if count == 0: # <<<<<<<<<<<<<< + * raise KeyError(val) + * if count == 1: + */ + __pyx_t_14 = ((__pyx_v_count == 0) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":427 + * + * if count == 0: + * raise KeyError(val) # <<<<<<<<<<<<<< + * if count == 1: + * return last_true + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":428 + * if count == 0: + * raise KeyError(val) + * if count == 1: # <<<<<<<<<<<<<< + * return last_true + * + */ + __pyx_t_14 = ((__pyx_v_count == 1) != 0); + if (__pyx_t_14) { + + /* "pandas/index.pyx":429 + * raise KeyError(val) + * if count == 1: + * return last_true # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_last_true); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":431 + * return last_true + * + * return result # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/index.pyx":404 + * return algos.ensure_float64(self.vgetter()) + * + * cdef _maybe_get_bool_indexer(self, object val): # <<<<<<<<<<<<<< + * cdef: + * ndarray[uint8_t] indexer + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.index.Float64Engine._maybe_get_bool_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":433 + * return result + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_float64(values) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_13Float64Engine__call_monotonic(((struct __pyx_obj_6pandas_5index_Float64Engine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":434 + * + * def _call_monotonic(self, values): + * return algos.is_monotonic_float64(values) # <<<<<<<<<<<<<< + * + * def get_pad_indexer(self, other, limit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_monotonic_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":433 + * return result + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_float64(values) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.Float64Engine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":436 + * return algos.is_monotonic_float64(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_float64(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pad_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.Float64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_13Float64Engine_2get_pad_indexer(((struct __pyx_obj_6pandas_5index_Float64Engine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_pad_indexer", 0); + + /* "pandas/index.pyx":437 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_float64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pad_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Float64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":438 + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_float64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * def get_backfill_indexer(self, other, limit=None): + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":437 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_float64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":436 + * return algos.is_monotonic_float64(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_float64(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Float64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":440 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_float64(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_13Float64Engine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_backfill_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.Float64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_13Float64Engine_4get_backfill_indexer(((struct __pyx_obj_6pandas_5index_Float64Engine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_13Float64Engine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_Float64Engine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_backfill_indexer", 0); + + /* "pandas/index.pyx":441 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_float64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_Float64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":442 + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_float64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":441 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_float64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":440 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_float64(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.Float64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":445 + * + * + * cdef Py_ssize_t _bin_search(ndarray values, object val) except -1: # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t mid, lo = 0, hi = len(values) - 1 + */ + +static Py_ssize_t __pyx_f_6pandas_5index__bin_search(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val) { + Py_ssize_t __pyx_v_mid; + Py_ssize_t __pyx_v_lo; + Py_ssize_t __pyx_v_hi; + PyObject *__pyx_v_pval = 0; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_bin_search", 0); + + /* "pandas/index.pyx":447 + * cdef Py_ssize_t _bin_search(ndarray values, object val) except -1: + * cdef: + * Py_ssize_t mid, lo = 0, hi = len(values) - 1 # <<<<<<<<<<<<<< + * object pval + * + */ + __pyx_v_lo = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_hi = (__pyx_t_1 - 1); + + /* "pandas/index.pyx":450 + * object pval + * + * if hi >= 0 and val > util.get_value_at(values, hi): # <<<<<<<<<<<<<< + * return len(values) + * + */ + __pyx_t_2 = (__pyx_v_hi >= 0); + if (__pyx_t_2) { + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_hi); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_f_4util_get_value_at(__pyx_v_values, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/index.pyx":451 + * + * if hi >= 0 and val > util.get_value_at(values, hi): + * return len(values) # <<<<<<<<<<<<<< + * + * while lo < hi: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_1; + goto __pyx_L0; + } + + /* "pandas/index.pyx":453 + * return len(values) + * + * while lo < hi: # <<<<<<<<<<<<<< + * mid = (lo + hi) // 2 + * pval = util.get_value_at(values, mid) + */ + while (1) { + __pyx_t_6 = ((__pyx_v_lo < __pyx_v_hi) != 0); + if (!__pyx_t_6) break; + + /* "pandas/index.pyx":454 + * + * while lo < hi: + * mid = (lo + hi) // 2 # <<<<<<<<<<<<<< + * pval = util.get_value_at(values, mid) + * if val < pval: + */ + __pyx_v_mid = __Pyx_div_Py_ssize_t((__pyx_v_lo + __pyx_v_hi), 2); + + /* "pandas/index.pyx":455 + * while lo < hi: + * mid = (lo + hi) // 2 + * pval = util.get_value_at(values, mid) # <<<<<<<<<<<<<< + * if val < pval: + * hi = mid + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_mid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_f_4util_get_value_at(__pyx_v_values, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_pval, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/index.pyx":456 + * mid = (lo + hi) // 2 + * pval = util.get_value_at(values, mid) + * if val < pval: # <<<<<<<<<<<<<< + * hi = mid + * elif val > pval: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_pval, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "pandas/index.pyx":457 + * pval = util.get_value_at(values, mid) + * if val < pval: + * hi = mid # <<<<<<<<<<<<<< + * elif val > pval: + * lo = mid + 1 + */ + __pyx_v_hi = __pyx_v_mid; + goto __pyx_L6; + } + + /* "pandas/index.pyx":458 + * if val < pval: + * hi = mid + * elif val > pval: # <<<<<<<<<<<<<< + * lo = mid + 1 + * else: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_pval, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "pandas/index.pyx":459 + * hi = mid + * elif val > pval: + * lo = mid + 1 # <<<<<<<<<<<<<< + * else: + * while mid > 0 and val == util.get_value_at(values, mid - 1): + */ + __pyx_v_lo = (__pyx_v_mid + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/index.pyx":461 + * lo = mid + 1 + * else: + * while mid > 0 and val == util.get_value_at(values, mid - 1): # <<<<<<<<<<<<<< + * mid -= 1 + * return mid + */ + while (1) { + __pyx_t_6 = (__pyx_v_mid > 0); + if (__pyx_t_6) { + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_mid - 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_values, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_6; + } + if (!__pyx_t_5) break; + + /* "pandas/index.pyx":462 + * else: + * while mid > 0 and val == util.get_value_at(values, mid - 1): + * mid -= 1 # <<<<<<<<<<<<<< + * return mid + * + */ + __pyx_v_mid = (__pyx_v_mid - 1); + } + + /* "pandas/index.pyx":463 + * while mid > 0 and val == util.get_value_at(values, mid - 1): + * mid -= 1 + * return mid # <<<<<<<<<<<<<< + * + * if val <= util.get_value_at(values, mid): + */ + __pyx_r = __pyx_v_mid; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/index.pyx":465 + * return mid + * + * if val <= util.get_value_at(values, mid): # <<<<<<<<<<<<<< + * return mid + * else: + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_mid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_values, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "pandas/index.pyx":466 + * + * if val <= util.get_value_at(values, mid): + * return mid # <<<<<<<<<<<<<< + * else: + * return mid + 1 + */ + __pyx_r = __pyx_v_mid; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/index.pyx":468 + * return mid + * else: + * return mid + 1 # <<<<<<<<<<<<<< + * + * _pad_functions = { + */ + __pyx_r = (__pyx_v_mid + 1); + goto __pyx_L0; + } + + /* "pandas/index.pyx":445 + * + * + * cdef Py_ssize_t _bin_search(ndarray values, object val) except -1: # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t mid, lo = 0, hi = len(values) - 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index._bin_search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_pval); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":484 + * cdef class ObjectEngine(IndexEngine): + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.PyObjectHashTable(n) + * + */ + +static PyObject *__pyx_f_6pandas_5index_12ObjectEngine__make_hash_table(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_n) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_hash_table", 0); + + /* "pandas/index.pyx":485 + * + * cdef _make_hash_table(self, n): + * return _hash.PyObjectHashTable(n) # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PyObjectHashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":484 + * cdef class ObjectEngine(IndexEngine): + * + * cdef _make_hash_table(self, n): # <<<<<<<<<<<<<< + * return _hash.PyObjectHashTable(n) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.ObjectEngine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":487 + * return _hash.PyObjectHashTable(n) + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_object(values) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_12ObjectEngine__call_monotonic(((struct __pyx_obj_6pandas_5index_ObjectEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine__call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":488 + * + * def _call_monotonic(self, values): + * return algos.is_monotonic_object(values) # <<<<<<<<<<<<<< + * + * def get_pad_indexer(self, other, limit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_monotonic_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":487 + * return _hash.PyObjectHashTable(n) + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_object(values) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.ObjectEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":490 + * return algos.is_monotonic_object(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_object(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_3get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pad_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.ObjectEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_12ObjectEngine_2get_pad_indexer(((struct __pyx_obj_6pandas_5index_ObjectEngine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine_2get_pad_indexer(struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_pad_indexer", 0); + + /* "pandas/index.pyx":491 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_object(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pad_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_ObjectEngine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":492 + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_object(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * def get_backfill_indexer(self, other, limit=None): + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":491 + * + * def get_pad_indexer(self, other, limit=None): + * return algos.pad_object(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":490 + * return algos.is_monotonic_object(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.pad_object(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.ObjectEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":494 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_object(self._get_index_values(), other, + * limit=limit) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_12ObjectEngine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_backfill_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.ObjectEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_12ObjectEngine_4get_backfill_indexer(((struct __pyx_obj_6pandas_5index_ObjectEngine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_12ObjectEngine_4get_backfill_indexer(struct __pyx_obj_6pandas_5index_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_backfill_indexer", 0); + + /* "pandas/index.pyx":495 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_object(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_ObjectEngine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/index.pyx":496 + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_object(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":495 + * + * def get_backfill_indexer(self, other, limit=None): + * return algos.backfill_object(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":494 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * return algos.backfill_object(self._get_index_values(), other, + * limit=limit) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.ObjectEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":501 + * cdef class DatetimeEngine(Int64Engine): + * + * def __contains__(self, object val): # <<<<<<<<<<<<<< + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_5index_14DatetimeEngine_1__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static int __pyx_pw_6pandas_5index_14DatetimeEngine_1__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine___contains__(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_5index_14DatetimeEngine___contains__(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_conv = NULL; + PyObject *__pyx_v_loc = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__contains__", 0); + + /* "pandas/index.pyx":502 + * + * def __contains__(self, object val): + * if self.over_size_threshold and self.is_monotonic: # <<<<<<<<<<<<<< + * if not self.is_unique: + * return self._get_loc_duplicates(val) + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.over_size_threshold; + if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monotonic); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_1; + } + if (__pyx_t_4) { + + /* "pandas/index.pyx":503 + * def __contains__(self, object val): + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_unique); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = ((!__pyx_t_4) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":504 + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * values = self._get_index_values() + * conv = _to_i8(val) + */ + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/index.pyx":505 + * if not self.is_unique: + * return self._get_loc_duplicates(val) + * values = self._get_index_values() # <<<<<<<<<<<<<< + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_values = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/index.pyx":506 + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + * conv = _to_i8(val) # <<<<<<<<<<<<<< + * loc = values.searchsorted(conv, side='left') + * return util.get_value_at(values, loc) == conv + */ + __pyx_t_2 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_conv = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/index.pyx":507 + * values = self._get_index_values() + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') # <<<<<<<<<<<<<< + * return util.get_value_at(values, loc) == conv + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_conv); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_conv); + __Pyx_GIVEREF(__pyx_v_conv); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_side, __pyx_n_s_left) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_loc = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/index.pyx":508 + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') + * return util.get_value_at(values, loc) == conv # <<<<<<<<<<<<<< + * + * self._ensure_mapping_populated() + */ + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_v_values), __pyx_v_loc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_conv, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/index.pyx":510 + * return util.get_value_at(values, loc) == conv + * + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * return _to_i8(val) in self.mapping + * + */ + __pyx_t_7 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":511 + * + * self._ensure_mapping_populated() + * return _to_i8(val) in self.mapping # <<<<<<<<<<<<<< + * + * cdef _get_index_values(self): + */ + __pyx_t_7 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_t_7, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "pandas/index.pyx":501 + * cdef class DatetimeEngine(Int64Engine): + * + * def __contains__(self, object val): # <<<<<<<<<<<<<< + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_conv); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":513 + * return _to_i8(val) in self.mapping + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return self.vgetter().view('i8') + * + */ + +static PyObject *__pyx_f_6pandas_5index_14DatetimeEngine__get_index_values(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_index_values", 0); + + /* "pandas/index.pyx":514 + * + * cdef _get_index_values(self): + * return self.vgetter().view('i8') # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.__pyx_base.vgetter, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":513 + * return _to_i8(val) in self.mapping + * + * cdef _get_index_values(self): # <<<<<<<<<<<<<< + * return self.vgetter().view('i8') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.index.DatetimeEngine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":516 + * return self.vgetter().view('i8') + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_int64(values) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_3_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_3_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_call_monotonic (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_2_call_monotonic(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_2_call_monotonic(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_call_monotonic", 0); + + /* "pandas/index.pyx":517 + * + * def _call_monotonic(self, values): + * return algos.is_monotonic_int64(values) # <<<<<<<<<<<<<< + * + * cpdef get_loc(self, object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_is_monotonic_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":516 + * return self.vgetter().view('i8') + * + * def _call_monotonic(self, values): # <<<<<<<<<<<<<< + * return algos.is_monotonic_int64(values) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.index.DatetimeEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":519 + * return algos.is_monotonic_int64(values) + * + * cpdef get_loc(self, object val): # <<<<<<<<<<<<<< + * if is_definitely_invalid_key(val): + * raise TypeError + */ + +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_14DatetimeEngine_get_loc(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_conv = NULL; + PyObject *__pyx_v_loc = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_loc", 0); + __Pyx_INCREF(__pyx_v_val); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/index.pyx":520 + * + * cpdef get_loc(self, object val): + * if is_definitely_invalid_key(val): # <<<<<<<<<<<<<< + * raise TypeError + * + */ + __pyx_t_1 = __pyx_f_6pandas_5index_is_definitely_invalid_key(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "pandas/index.pyx":521 + * cpdef get_loc(self, object val): + * if is_definitely_invalid_key(val): + * raise TypeError # <<<<<<<<<<<<<< + * + * # Welcome to the spaghetti factory + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":525 + * # Welcome to the spaghetti factory + * + * if self.over_size_threshold and self.is_monotonic: # <<<<<<<<<<<<<< + * if not self.is_unique: + * val = _to_i8(val) + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.over_size_threshold; + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/index.pyx":526 + * + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: # <<<<<<<<<<<<<< + * val = _to_i8(val) + * return self._get_loc_duplicates(val) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = ((!__pyx_t_6) != 0); + if (__pyx_t_4) { + + /* "pandas/index.pyx":527 + * if self.over_size_threshold and self.is_monotonic: + * if not self.is_unique: + * val = _to_i8(val) # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + */ + __pyx_t_1 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/index.pyx":528 + * if not self.is_unique: + * val = _to_i8(val) + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * values = self._get_index_values() + * conv = _to_i8(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":529 + * val = _to_i8(val) + * return self._get_loc_duplicates(val) + * values = self._get_index_values() # <<<<<<<<<<<<<< + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":530 + * return self._get_loc_duplicates(val) + * values = self._get_index_values() + * conv = _to_i8(val) # <<<<<<<<<<<<<< + * loc = values.searchsorted(conv, side='left') + * if loc == len(values) or util.get_value_at(values, loc) != conv: + */ + __pyx_t_1 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_conv = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/index.pyx":531 + * values = self._get_index_values() + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') # <<<<<<<<<<<<<< + * if loc == len(values) or util.get_value_at(values, loc) != conv: + * raise KeyError(val) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_conv); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_conv); + __Pyx_GIVEREF(__pyx_v_conv); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_side, __pyx_n_s_left) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_loc = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/index.pyx":532 + * conv = _to_i8(val) + * loc = values.searchsorted(conv, side='left') + * if loc == len(values) or util.get_value_at(values, loc) != conv: # <<<<<<<<<<<<<< + * raise KeyError(val) + * return loc + */ + __pyx_t_8 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_loc, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_4) { + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_v_values), __pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_v_conv, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_4; + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":533 + * loc = values.searchsorted(conv, side='left') + * if loc == len(values) or util.get_value_at(values, loc) != conv: + * raise KeyError(val) # <<<<<<<<<<<<<< + * return loc + * + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":534 + * if loc == len(values) or util.get_value_at(values, loc) != conv: + * raise KeyError(val) + * return loc # <<<<<<<<<<<<<< + * + * self._ensure_mapping_populated() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_loc); + __pyx_r = __pyx_v_loc; + goto __pyx_L0; + } + + /* "pandas/index.pyx":536 + * return loc + * + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * if not self.unique: + * val = _to_i8(val) + */ + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":537 + * + * self._ensure_mapping_populated() + * if not self.unique: # <<<<<<<<<<<<<< + * val = _to_i8(val) + * return self._get_loc_duplicates(val) + */ + __pyx_t_5 = ((!(__pyx_v_self->__pyx_base.__pyx_base.unique != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/index.pyx":538 + * self._ensure_mapping_populated() + * if not self.unique: + * val = _to_i8(val) # <<<<<<<<<<<<<< + * return self._get_loc_duplicates(val) + * + */ + __pyx_t_2 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/index.pyx":539 + * if not self.unique: + * val = _to_i8(val) + * return self._get_loc_duplicates(val) # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":541 + * return self._get_loc_duplicates(val) + * + * try: # <<<<<<<<<<<<<< + * return self.mapping.get_item(val.value) + * except KeyError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "pandas/index.pyx":542 + * + * try: + * return self.mapping.get_item(val.value) # <<<<<<<<<<<<<< + * except KeyError: + * raise KeyError(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), __pyx_n_s_get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L12_try_return; + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":543 + * try: + * return self.mapping.get_item(val.value) + * except KeyError: # <<<<<<<<<<<<<< + * raise KeyError(val) + * except AttributeError: + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/index.pyx":544 + * return self.mapping.get_item(val.value) + * except KeyError: + * raise KeyError(val) # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_13, 0, 0, 0); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L9_exception_handled; + } + + /* "pandas/index.pyx":545 + * except KeyError: + * raise KeyError(val) + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_12) { + PyErr_Restore(0,0,0); + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L1_error; + __pyx_L12_try_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L0; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L15_try_end:; + } + + /* "pandas/index.pyx":548 + * pass + * + * try: # <<<<<<<<<<<<<< + * val = _to_i8(val) + * return self.mapping.get_item(val) + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/index.pyx":549 + * + * try: + * val = _to_i8(val) # <<<<<<<<<<<<<< + * return self.mapping.get_item(val) + * except TypeError: + */ + __pyx_t_2 = __pyx_f_6pandas_5index__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/index.pyx":550 + * try: + * val = _to_i8(val) + * return self.mapping.get_item(val) # <<<<<<<<<<<<<< + * except TypeError: + * self._date_check_type(val) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), __pyx_n_s_get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L22_try_return; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":551 + * val = _to_i8(val) + * return self.mapping.get_item(val) + * except TypeError: # <<<<<<<<<<<<<< + * self._date_check_type(val) + * raise KeyError(val) + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/index.pyx":552 + * return self.mapping.get_item(val) + * except TypeError: + * self._date_check_type(val) # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_13 = __pyx_f_6pandas_5index_14DatetimeEngine__date_check_type(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/index.pyx":553 + * except TypeError: + * self._date_check_type(val) + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * cdef inline _date_check_type(self, object val): + */ + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L19_exception_handled; + } + goto __pyx_L20_except_error; + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L22_try_return:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L0; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + __pyx_L25_try_end:; + } + + /* "pandas/index.pyx":519 + * return algos.is_monotonic_int64(values) + * + * cpdef get_loc(self, object val): # <<<<<<<<<<<<<< + * if is_definitely_invalid_key(val): + * raise TypeError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_conv); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_loc (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_4get_loc(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_4get_loc(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_loc", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.get_loc(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":555 + * raise KeyError(val) + * + * cdef inline _date_check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * if not util.is_integer_object(val): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index_14DatetimeEngine__date_check_type(CYTHON_UNUSED struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_hash_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_check_type", 0); + + /* "pandas/index.pyx":556 + * + * cdef inline _date_check_type(self, object val): + * hash(val) # <<<<<<<<<<<<<< + * if not util.is_integer_object(val): + * raise KeyError(val) + */ + __pyx_t_1 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":557 + * cdef inline _date_check_type(self, object val): + * hash(val) + * if not util.is_integer_object(val): # <<<<<<<<<<<<<< + * raise KeyError(val) + * + */ + __pyx_t_2 = ((!(is_integer_object(__pyx_v_val) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/index.pyx":558 + * hash(val) + * if not util.is_integer_object(val): + * raise KeyError(val) # <<<<<<<<<<<<<< + * + * def get_indexer(self, values): + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/index.pyx":555 + * raise KeyError(val) + * + * cdef inline _date_check_type(self, object val): # <<<<<<<<<<<<<< + * hash(val) + * if not util.is_integer_object(val): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.index.DatetimeEngine._date_check_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":560 + * raise KeyError(val) + * + * def get_indexer(self, values): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_7get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_7get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indexer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_6get_indexer(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_6get_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_indexer", 0); + __Pyx_INCREF(__pyx_v_values); + + /* "pandas/index.pyx":561 + * + * def get_indexer(self, values): + * self._ensure_mapping_populated() # <<<<<<<<<<<<<< + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') + */ + __pyx_t_1 = __pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":562 + * def get_indexer(self, values): + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': # <<<<<<<<<<<<<< + * return np.repeat(-1, len(values)).astype('i4') + * values = np.asarray(values).view('i8') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_M8_ns, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/index.pyx":563 + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') # <<<<<<<<<<<<<< + * values = np.asarray(values).view('i8') + * return self.mapping.lookup(values) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":564 + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') + * values = np.asarray(values).view('i8') # <<<<<<<<<<<<<< + * return self.mapping.lookup(values) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":565 + * return np.repeat(-1, len(values)).astype('i4') + * values = np.asarray(values).view('i8') + * return self.mapping.lookup(values) # <<<<<<<<<<<<<< + * + * def get_pad_indexer(self, other, limit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":560 + * raise KeyError(val) + * + * def get_indexer(self, values): # <<<<<<<<<<<<<< + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":567 + * return self.mapping.lookup(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_9get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_9get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pad_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_8get_pad_indexer(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_8get_pad_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_pad_indexer", 0); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/index.pyx":568 + * + * def get_pad_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': # <<<<<<<<<<<<<< + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_M8_ns, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/index.pyx":569 + * def get_pad_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') # <<<<<<<<<<<<<< + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_Length(__pyx_v_other); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":570 + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') # <<<<<<<<<<<<<< + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":571 + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pad_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/index.pyx":572 + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * def get_backfill_indexer(self, other, limit=None): + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":571 + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":567 + * return self.mapping.lookup(values) + * + * def get_pad_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":574 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_11get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_14DatetimeEngine_11get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_other = 0; + PyObject *__pyx_v_limit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_backfill_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_limit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_other = values[0]; + __pyx_v_limit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5index_14DatetimeEngine_10get_backfill_indexer(((struct __pyx_obj_6pandas_5index_DatetimeEngine *)__pyx_v_self), __pyx_v_other, __pyx_v_limit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_14DatetimeEngine_10get_backfill_indexer(struct __pyx_obj_6pandas_5index_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_limit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_backfill_indexer", 0); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/index.pyx":575 + * + * def get_backfill_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': # <<<<<<<<<<<<<< + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_M8_ns, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/index.pyx":576 + * def get_backfill_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') # <<<<<<<<<<<<<< + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_Length(__pyx_v_other); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":577 + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') # <<<<<<<<<<<<<< + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/index.pyx":578 + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_backfill_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_5index_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/index.pyx":579 + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_limit, __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":578 + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, # <<<<<<<<<<<<<< + * limit=limit) + * + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/index.pyx":574 + * limit=limit) + * + * def get_backfill_indexer(self, other, limit=None): # <<<<<<<<<<<<<< + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.index.DatetimeEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":582 + * + * + * cpdef convert_scalar(ndarray arr, object value): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * if isinstance(value,np.ndarray): + */ + +static PyObject *__pyx_pw_6pandas_5index_5convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5index_convert_scalar(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_scalar", 0); + + /* "pandas/index.pyx":583 + * + * cpdef convert_scalar(ndarray arr, object value): + * if arr.descr.type_num == NPY_DATETIME: # <<<<<<<<<<<<<< + * if isinstance(value,np.ndarray): + * pass + */ + __pyx_t_1 = ((__pyx_v_arr->descr->type_num == NPY_DATETIME) != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":584 + * cpdef convert_scalar(ndarray arr, object value): + * if arr.descr.type_num == NPY_DATETIME: + * if isinstance(value,np.ndarray): # <<<<<<<<<<<<<< + * pass + * elif isinstance(value, Timestamp): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_value, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + goto __pyx_L4; + } + + /* "pandas/index.pyx":586 + * if isinstance(value,np.ndarray): + * pass + * elif isinstance(value, Timestamp): # <<<<<<<<<<<<<< + * return value.value + * elif value is None or value != value: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_IsInstance(__pyx_v_value, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":587 + * pass + * elif isinstance(value, Timestamp): + * return value.value # <<<<<<<<<<<<<< + * elif value is None or value != value: + * return iNaT + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/index.pyx":588 + * elif isinstance(value, Timestamp): + * return value.value + * elif value is None or value != value: # <<<<<<<<<<<<<< + * return iNaT + * else: + */ + __pyx_t_1 = (__pyx_v_value == Py_None); + if (!__pyx_t_1) { + __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_v_value, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":589 + * return value.value + * elif value is None or value != value: + * return iNaT # <<<<<<<<<<<<<< + * else: + * return Timestamp(value).value + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5index_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/index.pyx":591 + * return iNaT + * else: + * return Timestamp(value).value # <<<<<<<<<<<<<< + * + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/index.pyx":593 + * return Timestamp(value).value + * + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): # <<<<<<<<<<<<<< + * if util.is_float_object(value) and value != value: + * raise ValueError('Cannot assign nan to integer series') + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_3 = 0; + __pyx_t_7 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_6, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "pandas/index.pyx":594 + * + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): + * if util.is_float_object(value) and value != value: # <<<<<<<<<<<<<< + * raise ValueError('Cannot assign nan to integer series') + * + */ + if ((is_float_object(__pyx_v_value) != 0)) { + __pyx_t_2 = PyObject_RichCompare(__pyx_v_value, __pyx_v_value, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __pyx_t_1; + } else { + __pyx_t_5 = (is_float_object(__pyx_v_value) != 0); + } + if (__pyx_t_5) { + + /* "pandas/index.pyx":595 + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): + * if util.is_float_object(value) and value != value: + * raise ValueError('Cannot assign nan to integer series') # <<<<<<<<<<<<<< + * + * return value + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/index.pyx":597 + * raise ValueError('Cannot assign nan to integer series') + * + * return value # <<<<<<<<<<<<<< + * + * cdef inline _to_i8(object val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + goto __pyx_L0; + + /* "pandas/index.pyx":582 + * + * + * cpdef convert_scalar(ndarray arr, object value): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * if isinstance(value,np.ndarray): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.index.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5index_5convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5index_5convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_scalar (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_value,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("convert_scalar", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert_scalar") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_value = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("convert_scalar", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.index.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5index_4convert_scalar(__pyx_self, __pyx_v_arr, __pyx_v_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5index_4convert_scalar(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_scalar", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5index_convert_scalar(__pyx_v_arr, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.index.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":599 + * return value + * + * cdef inline _to_i8(object val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * try: + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5index__to_i8(PyObject *__pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_v_tzinfo = NULL; + PyObject *__pyx_v_ival = NULL; + PyObject *__pyx_v_offset = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_to_i8", 0); + + /* "pandas/index.pyx":601 + * cdef inline _to_i8(object val): + * cdef pandas_datetimestruct dts + * try: # <<<<<<<<<<<<<< + * return val.value + * except AttributeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/index.pyx":602 + * cdef pandas_datetimestruct dts + * try: + * return val.value # <<<<<<<<<<<<<< + * except AttributeError: + * if util.is_datetime64_object(val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/index.pyx":603 + * try: + * return val.value + * except AttributeError: # <<<<<<<<<<<<<< + * if util.is_datetime64_object(val): + * return get_datetime64_value(val) + */ + __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_5) { + __Pyx_AddTraceback("pandas.index._to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/index.pyx":604 + * return val.value + * except AttributeError: + * if util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * return get_datetime64_value(val) + * elif PyDateTime_Check(val): + */ + __pyx_t_8 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_8) { + + /* "pandas/index.pyx":605 + * except AttributeError: + * if util.is_datetime64_object(val): + * return get_datetime64_value(val) # <<<<<<<<<<<<<< + * elif PyDateTime_Check(val): + * tzinfo = getattr(val, 'tzinfo', None) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(get_datetime64_value(__pyx_v_val)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + } + + /* "pandas/index.pyx":606 + * if util.is_datetime64_object(val): + * return get_datetime64_value(val) + * elif PyDateTime_Check(val): # <<<<<<<<<<<<<< + * tzinfo = getattr(val, 'tzinfo', None) + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. + */ + __pyx_t_8 = (PyDateTime_Check(__pyx_v_val) != 0); + if (__pyx_t_8) { + + /* "pandas/index.pyx":607 + * return get_datetime64_value(val) + * elif PyDateTime_Check(val): + * tzinfo = getattr(val, 'tzinfo', None) # <<<<<<<<<<<<<< + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. + * if tzinfo is not None and not _is_utc(tzinfo): + */ + __pyx_t_9 = __Pyx_GetAttr3(__pyx_v_val, __pyx_n_s_tzinfo, Py_None); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_tzinfo = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/index.pyx":608 + * elif PyDateTime_Check(val): + * tzinfo = getattr(val, 'tzinfo', None) + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. # <<<<<<<<<<<<<< + * if tzinfo is not None and not _is_utc(tzinfo): + * offset = tslib._get_utcoffset(tzinfo, val) + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_f_8datetime__pydatetime_to_dts(__pyx_v_val, (&__pyx_v_dts))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_ival = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/index.pyx":609 + * tzinfo = getattr(val, 'tzinfo', None) + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. + * if tzinfo is not None and not _is_utc(tzinfo): # <<<<<<<<<<<<<< + * offset = tslib._get_utcoffset(tzinfo, val) + * ival -= tslib._delta_to_nanoseconds(offset) + */ + __pyx_t_8 = (__pyx_v_tzinfo != Py_None); + if ((__pyx_t_8 != 0)) { + __pyx_t_10 = ((!(__pyx_f_6pandas_5index__is_utc(__pyx_v_tzinfo) != 0)) != 0); + __pyx_t_11 = __pyx_t_10; + } else { + __pyx_t_11 = (__pyx_t_8 != 0); + } + if (__pyx_t_11) { + + /* "pandas/index.pyx":610 + * ival = _pydatetime_to_dts(val, &dts) # Save the original date value so we can get the utcoffset from it. + * if tzinfo is not None and not _is_utc(tzinfo): + * offset = tslib._get_utcoffset(tzinfo, val) # <<<<<<<<<<<<<< + * ival -= tslib._delta_to_nanoseconds(offset) + * return ival + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_get_utcoffset); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_tzinfo); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_tzinfo); + __Pyx_GIVEREF(__pyx_v_tzinfo); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_offset = __pyx_t_13; + __pyx_t_13 = 0; + + /* "pandas/index.pyx":611 + * if tzinfo is not None and not _is_utc(tzinfo): + * offset = tslib._get_utcoffset(tzinfo, val) + * ival -= tslib._delta_to_nanoseconds(offset) # <<<<<<<<<<<<<< + * return ival + * return val + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_tslib); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_offset); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_offset); + __Pyx_GIVEREF(__pyx_v_offset); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_InPlaceSubtract(__pyx_v_ival, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_ival, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/index.pyx":612 + * offset = tslib._get_utcoffset(tzinfo, val) + * ival -= tslib._delta_to_nanoseconds(offset) + * return ival # <<<<<<<<<<<<<< + * return val + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ival); + __pyx_r = __pyx_v_ival; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + } + + /* "pandas/index.pyx":613 + * ival -= tslib._delta_to_nanoseconds(offset) + * return ival + * return val # <<<<<<<<<<<<<< + * + * cdef inline bint _is_utc(object tz): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_val); + __pyx_r = __pyx_v_val; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/index.pyx":599 + * return value + * + * cdef inline _to_i8(object val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.index._to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tzinfo); + __Pyx_XDECREF(__pyx_v_ival); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/index.pyx":615 + * return val + * + * cdef inline bint _is_utc(object tz): # <<<<<<<<<<<<<< + * return tz is UTC or isinstance(tz, _du_utc) + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5index__is_utc(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_utc", 0); + + /* "pandas/index.pyx":616 + * + * cdef inline bint _is_utc(object tz): + * return tz is UTC or isinstance(tz, _du_utc) # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UTC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_v_tz == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_du_utc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_r = __pyx_t_4; + goto __pyx_L0; + + /* "pandas/index.pyx":615 + * return val + * + * cdef inline bint _is_utc(object tz): # <<<<<<<<<<<<<< + * return tz is UTC or isinstance(tz, _du_utc) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("pandas.index._is_utc", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_result; + char *__pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_to_dts", 0); + __Pyx_INCREF(__pyx_v_val); + + /* "datetime.pxd":130 + * cdef char *tmp + * + * if PyUnicode_Check(val): # <<<<<<<<<<<<<< + * val = PyUnicode_AsASCIIString(val); + * + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":131 + * + * if PyUnicode_Check(val): + * val = PyUnicode_AsASCIIString(val); # <<<<<<<<<<<<<< + * + * tmp = val + */ + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "datetime.pxd":133 + * val = PyUnicode_AsASCIIString(val); + * + * tmp = val # <<<<<<<<<<<<<< + * result = _cstring_to_dts(tmp, len(val), dts) + * + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmp = __pyx_t_3; + + /* "datetime.pxd":134 + * + * tmp = val + * result = _cstring_to_dts(tmp, len(val), dts) # <<<<<<<<<<<<<< + * + * if result == -1: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts); + + /* "datetime.pxd":136 + * result = _cstring_to_dts(tmp, len(val), dts) + * + * if result == -1: # <<<<<<<<<<<<<< + * raise ValueError('Unable to parse %s' % str(val)) + * + */ + __pyx_t_1 = ((__pyx_v_result == -1) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":137 + * + * if result == -1: + * raise ValueError('Unable to parse %s' % str(val)) # <<<<<<<<<<<<<< + * + * cdef inline int _cstring_to_dts(char *val, int length, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("datetime._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts) { + npy_bool __pyx_v_islocal; + npy_bool __pyx_v_special; + PANDAS_DATETIMEUNIT __pyx_v_out_bestunit; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cstring_to_dts", 0); + + /* "datetime.pxd":146 + * int result + * + * result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns, # <<<<<<<<<<<<<< + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + */ + __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special)); + + /* "datetime.pxd":149 + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime64_to_datetime", 0); + + /* "datetime.pxd":154 + * cdef inline object _datetime64_to_datetime(int64_t val): + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * return _dts_to_pydatetime(&dts) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "datetime.pxd":155 + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * return _dts_to_pydatetime(&dts) # <<<<<<<<<<<<<< + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dts_to_pydatetime", 0); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_XDECREF(__pyx_r); + + /* "datetime.pxd":160 + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + */ + __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0); + + /* "datetime.pxd":163 + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":164 + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":165 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":166 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) # <<<<<<<<<<<<<< + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + */ + __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val); + + /* "datetime.pxd":167 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) # <<<<<<<<<<<<<< + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + */ + __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val); + + /* "datetime.pxd":168 + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) # <<<<<<<<<<<<<< + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + */ + __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val); + + /* "datetime.pxd":169 + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val); + + /* "datetime.pxd":170 + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":171 + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _dtlike_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + npy_int64 __pyx_t_2; + npy_int32 __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dtlike_to_datetime64", 0); + + /* "datetime.pxd":175 + * cdef inline int64_t _dtlike_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = val.year # <<<<<<<<<<<<<< + * dts.month = val.month + * dts.day = val.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->year = __pyx_t_2; + + /* "datetime.pxd":176 + * pandas_datetimestruct *dts): + * dts.year = val.year + * dts.month = val.month # <<<<<<<<<<<<<< + * dts.day = val.day + * dts.hour = val.hour + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->month = __pyx_t_3; + + /* "datetime.pxd":177 + * dts.year = val.year + * dts.month = val.month + * dts.day = val.day # <<<<<<<<<<<<<< + * dts.hour = val.hour + * dts.min = val.minute + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->day = __pyx_t_3; + + /* "datetime.pxd":178 + * dts.month = val.month + * dts.day = val.day + * dts.hour = val.hour # <<<<<<<<<<<<<< + * dts.min = val.minute + * dts.sec = val.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->hour = __pyx_t_3; + + /* "datetime.pxd":179 + * dts.day = val.day + * dts.hour = val.hour + * dts.min = val.minute # <<<<<<<<<<<<<< + * dts.sec = val.second + * dts.us = val.microsecond + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->min = __pyx_t_3; + + /* "datetime.pxd":180 + * dts.hour = val.hour + * dts.min = val.minute + * dts.sec = val.second # <<<<<<<<<<<<<< + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->sec = __pyx_t_3; + + /* "datetime.pxd":181 + * dts.min = val.minute + * dts.sec = val.second + * dts.us = val.microsecond # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->us = __pyx_t_3; + + /* "datetime.pxd":182 + * dts.sec = val.second + * dts.us = val.microsecond + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":183 + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _date_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_to_datetime64", 0); + + /* "datetime.pxd":187 + * cdef inline int64_t _date_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":188 + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":189 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":190 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->hour = 0; + __pyx_v_dts->min = 0; + __pyx_v_dts->sec = 0; + __pyx_v_dts->us = 0; + + /* "datetime.pxd":191 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":192 + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6pandas_5index_IndexEngine __pyx_vtable_6pandas_5index_IndexEngine; + +static PyObject *__pyx_tp_new_6pandas_5index_IndexEngine(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_5index_IndexEngine *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_IndexEngine *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_5index_IndexEngine; + p->vgetter = Py_None; Py_INCREF(Py_None); + p->mapping = ((struct __pyx_obj_6pandas_9hashtable_HashTable *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5index_IndexEngine(PyObject *o) { + struct __pyx_obj_6pandas_5index_IndexEngine *p = (struct __pyx_obj_6pandas_5index_IndexEngine *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->vgetter); + Py_CLEAR(p->mapping); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_5index_IndexEngine(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5index_IndexEngine *p = (struct __pyx_obj_6pandas_5index_IndexEngine *)o; + if (p->vgetter) { + e = (*v)(p->vgetter, a); if (e) return e; + } + if (p->mapping) { + e = (*v)(((PyObject*)p->mapping), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5index_IndexEngine(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5index_IndexEngine *p = (struct __pyx_obj_6pandas_5index_IndexEngine *)o; + tmp = ((PyObject*)p->vgetter); + p->vgetter = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->mapping); + p->mapping = ((struct __pyx_obj_6pandas_9hashtable_HashTable *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_is_unique(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_9is_unique_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_is_monotonic(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_12is_monotonic_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_vgetter(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_7vgetter_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_mapping(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_7mapping_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5index_11IndexEngine_over_size_threshold(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5index_11IndexEngine_19over_size_threshold_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_5index_IndexEngine[] = { + {__Pyx_NAMESTR("get_value"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_5get_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5index_11IndexEngine_4get_value)}, + {__Pyx_NAMESTR("set_value"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_7set_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5index_11IndexEngine_6set_value)}, + {__Pyx_NAMESTR("get_loc"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_9get_loc, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_11_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("clear_mapping"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_13clear_mapping, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_15get_indexer, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_indexer_non_unique"), (PyCFunction)__pyx_pw_6pandas_5index_11IndexEngine_17get_indexer_non_unique, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5index_11IndexEngine_16get_indexer_non_unique)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_5index_IndexEngine[] = { + {(char *)"is_unique", __pyx_getprop_6pandas_5index_11IndexEngine_is_unique, 0, 0, 0}, + {(char *)"is_monotonic", __pyx_getprop_6pandas_5index_11IndexEngine_is_monotonic, 0, 0, 0}, + {(char *)"vgetter", __pyx_getprop_6pandas_5index_11IndexEngine_vgetter, 0, 0, 0}, + {(char *)"mapping", __pyx_getprop_6pandas_5index_11IndexEngine_mapping, 0, 0, 0}, + {(char *)"over_size_threshold", __pyx_getprop_6pandas_5index_11IndexEngine_over_size_threshold, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_IndexEngine = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_5index_11IndexEngine_3__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyTypeObject __pyx_type_6pandas_5index_IndexEngine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.IndexEngine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_IndexEngine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_IndexEngine, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_IndexEngine, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_5index_IndexEngine, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_IndexEngine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5index_Int64Engine __pyx_vtable_6pandas_5index_Int64Engine; + +static PyObject *__pyx_tp_new_6pandas_5index_Int64Engine(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5index_Int64Engine *p; + PyObject *o = __pyx_tp_new_6pandas_5index_IndexEngine(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_Int64Engine *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5index_IndexEngine*)__pyx_vtabptr_6pandas_5index_Int64Engine; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5index_Int64Engine[] = { + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_11Int64Engine_1_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_11Int64Engine_3get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_11Int64Engine_5get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5index_Int64Engine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.Int64Engine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_Int64Engine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_Int64Engine, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_Int64Engine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5index_Float64Engine __pyx_vtable_6pandas_5index_Float64Engine; + +static PyObject *__pyx_tp_new_6pandas_5index_Float64Engine(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5index_Float64Engine *p; + PyObject *o = __pyx_tp_new_6pandas_5index_IndexEngine(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_Float64Engine *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5index_IndexEngine*)__pyx_vtabptr_6pandas_5index_Float64Engine; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5index_Float64Engine[] = { + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_13Float64Engine_1_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_13Float64Engine_3get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_13Float64Engine_5get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5index_Float64Engine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.Float64Engine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_Float64Engine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_Float64Engine, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_Float64Engine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5index_ObjectEngine __pyx_vtable_6pandas_5index_ObjectEngine; + +static PyObject *__pyx_tp_new_6pandas_5index_ObjectEngine(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5index_ObjectEngine *p; + PyObject *o = __pyx_tp_new_6pandas_5index_IndexEngine(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_ObjectEngine *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5index_IndexEngine*)__pyx_vtabptr_6pandas_5index_ObjectEngine; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5index_ObjectEngine[] = { + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_12ObjectEngine_1_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_12ObjectEngine_3get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_12ObjectEngine_5get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5index_ObjectEngine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.ObjectEngine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_ObjectEngine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_ObjectEngine, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_ObjectEngine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5index_DatetimeEngine __pyx_vtable_6pandas_5index_DatetimeEngine; + +static PyObject *__pyx_tp_new_6pandas_5index_DatetimeEngine(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5index_DatetimeEngine *p; + PyObject *o = __pyx_tp_new_6pandas_5index_Int64Engine(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5index_DatetimeEngine *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5index_IndexEngine*)__pyx_vtabptr_6pandas_5index_DatetimeEngine; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5index_DatetimeEngine[] = { + {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_3_call_monotonic, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_loc"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_5get_loc, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_7get_indexer, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_9get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pw_6pandas_5index_14DatetimeEngine_11get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_DatetimeEngine = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + __pyx_pw_6pandas_5index_14DatetimeEngine_1__contains__, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyTypeObject __pyx_type_6pandas_5index_DatetimeEngine = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.index.DatetimeEngine"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5index_DatetimeEngine), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5index_IndexEngine, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_DatetimeEngine, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5index_IndexEngine, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5index_IndexEngine, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5index_DatetimeEngine, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_5index_11IndexEngine_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5index_DatetimeEngine, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("convert_scalar"), (PyCFunction)__pyx_pw_6pandas_5index_5convert_scalar, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("index"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Cannot_assign_nan_to_integer_ser, __pyx_k_Cannot_assign_nan_to_integer_ser, sizeof(__pyx_k_Cannot_assign_nan_to_integer_ser), 0, 0, 1, 0}, + {&__pyx_n_s_Float64HashTable, __pyx_k_Float64HashTable, sizeof(__pyx_k_Float64HashTable), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_n_s_Int64HashTable, __pyx_k_Int64HashTable, sizeof(__pyx_k_Int64HashTable), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_kp_s_M8_ns, __pyx_k_M8_ns, sizeof(__pyx_k_M8_ns), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_PyObjectHashTable, __pyx_k_PyObjectHashTable, sizeof(__pyx_k_PyObjectHashTable), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_SIZE_CUTOFF, __pyx_k_SIZE_CUTOFF, sizeof(__pyx_k_SIZE_CUTOFF), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_algos, __pyx_k_algos, sizeof(__pyx_k_algos), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_float64, __pyx_k_backfill_float64, sizeof(__pyx_k_backfill_float64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_functions, __pyx_k_backfill_functions, sizeof(__pyx_k_backfill_functions), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_int64, __pyx_k_backfill_int64, sizeof(__pyx_k_backfill_int64), 0, 0, 1, 1}, + {&__pyx_n_s_backfill_object, __pyx_k_backfill_object, sizeof(__pyx_k_backfill_object), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_call_monotonic, __pyx_k_call_monotonic, sizeof(__pyx_k_call_monotonic), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tz, __pyx_k_dateutil_tz, sizeof(__pyx_k_dateutil_tz), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_delta_to_nanoseconds, __pyx_k_delta_to_nanoseconds, sizeof(__pyx_k_delta_to_nanoseconds), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_du_utc, __pyx_k_du_utc, sizeof(__pyx_k_du_utc), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_ensure_float64, __pyx_k_ensure_float64, sizeof(__pyx_k_ensure_float64), 0, 0, 1, 1}, + {&__pyx_n_s_ensure_int64, __pyx_k_ensure_int64, sizeof(__pyx_k_ensure_int64), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_get_item, __pyx_k_get_item, sizeof(__pyx_k_get_item), 0, 0, 1, 1}, + {&__pyx_n_s_get_loc, __pyx_k_get_loc, sizeof(__pyx_k_get_loc), 0, 0, 1, 1}, + {&__pyx_n_s_get_utcoffset, __pyx_k_get_utcoffset, sizeof(__pyx_k_get_utcoffset), 0, 0, 1, 1}, + {&__pyx_n_s_get_value, __pyx_k_get_value, sizeof(__pyx_k_get_value), 0, 0, 1, 1}, + {&__pyx_n_s_get_value_at, __pyx_k_get_value_at, sizeof(__pyx_k_get_value_at), 0, 0, 1, 1}, + {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1}, + {&__pyx_n_s_hashtable, __pyx_k_hashtable, sizeof(__pyx_k_hashtable), 0, 0, 1, 1}, + {&__pyx_n_s_have_pytz, __pyx_k_have_pytz, sizeof(__pyx_k_have_pytz), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic, __pyx_k_is_monotonic, sizeof(__pyx_k_is_monotonic), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_float64, __pyx_k_is_monotonic_float64, sizeof(__pyx_k_is_monotonic_float64), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_int64, __pyx_k_is_monotonic_int64, sizeof(__pyx_k_is_monotonic_int64), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic_object, __pyx_k_is_monotonic_object, sizeof(__pyx_k_is_monotonic_object), 0, 0, 1, 1}, + {&__pyx_n_s_is_unique, __pyx_k_is_unique, sizeof(__pyx_k_is_unique), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, + {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1}, + {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_map_locations, __pyx_k_map_locations, sizeof(__pyx_k_map_locations), 0, 0, 1, 1}, + {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_pad_float64, __pyx_k_pad_float64, sizeof(__pyx_k_pad_float64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_functions, __pyx_k_pad_functions, sizeof(__pyx_k_pad_functions), 0, 0, 1, 1}, + {&__pyx_n_s_pad_int64, __pyx_k_pad_int64, sizeof(__pyx_k_pad_int64), 0, 0, 1, 1}, + {&__pyx_n_s_pad_object, __pyx_k_pad_object, sizeof(__pyx_k_pad_object), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_index, __pyx_k_pandas_index, sizeof(__pyx_k_pandas_index), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_tslib, __pyx_k_pandas_tslib, sizeof(__pyx_k_pandas_tslib), 0, 0, 1, 1}, + {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, + {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_searchsorted, __pyx_k_searchsorted, sizeof(__pyx_k_searchsorted), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_set_value, __pyx_k_set_value, sizeof(__pyx_k_set_value), 0, 0, 1, 1}, + {&__pyx_n_s_set_value_at, __pyx_k_set_value_at, sizeof(__pyx_k_set_value_at), 0, 0, 1, 1}, + {&__pyx_n_s_side, __pyx_k_side, sizeof(__pyx_k_side), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_tslib, __pyx_k_tslib, sizeof(__pyx_k_tslib), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1}, + {&__pyx_n_s_tzutc, __pyx_k_tzutc, sizeof(__pyx_k_tzutc), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_vgetter, __pyx_k_vgetter, sizeof(__pyx_k_vgetter), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/index.pyx":514 + * + * cdef _get_index_values(self): + * return self.vgetter().view('i8') # <<<<<<<<<<<<<< + * + * def _call_monotonic(self, values): + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/index.pyx":563 + * self._ensure_mapping_populated() + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') # <<<<<<<<<<<<<< + * values = np.asarray(values).view('i8') + * return self.mapping.lookup(values) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/index.pyx":564 + * if values.dtype != 'M8[ns]': + * return np.repeat(-1, len(values)).astype('i4') + * values = np.asarray(values).view('i8') # <<<<<<<<<<<<<< + * return self.mapping.lookup(values) + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/index.pyx":569 + * def get_pad_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') # <<<<<<<<<<<<<< + * other = np.asarray(other).view('i8') + * return algos.pad_int64(self._get_index_values(), other, + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/index.pyx":570 + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') # <<<<<<<<<<<<<< + * return algos.pad_int64(self._get_index_values(), other, + * limit=limit) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/index.pyx":576 + * def get_backfill_indexer(self, other, limit=None): + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') # <<<<<<<<<<<<<< + * other = np.asarray(other).view('i8') + * return algos.backfill_int64(self._get_index_values(), other, + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/index.pyx":577 + * if other.dtype != 'M8[ns]': + * return np.repeat(-1, len(other)).astype('i4') + * other = np.asarray(other).view('i8') # <<<<<<<<<<<<<< + * return algos.backfill_int64(self._get_index_values(), other, + * limit=limit) + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/index.pyx":595 + * if issubclass(arr.dtype.type, (np.integer, np.bool_)): + * if util.is_float_object(value) and value != value: + * raise ValueError('Cannot assign nan to integer series') # <<<<<<<<<<<<<< + * + * return value + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_nan_to_integer_ser); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_arr, __pyx_n_s_loc); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_value_at, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":62 + * return util.get_value_at(arr, loc) + * + * def set_value_at(ndarray arr, object loc, object val): # <<<<<<<<<<<<<< + * return util.set_value_at(arr, loc, val) + * + */ + __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_arr, __pyx_n_s_loc, __pyx_n_s_val); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_set_value_at, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initindex(void); /*proto*/ +PyMODINIT_FUNC initindex(void) +#else +PyMODINIT_FUNC PyInit_index(void); /*proto*/ +PyMODINIT_FUNC PyInit_index(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_index(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("index"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__index) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.index")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.index", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_6pandas_5index_IndexEngine = &__pyx_vtable_6pandas_5index_IndexEngine; + __pyx_vtable_6pandas_5index_IndexEngine.get_value = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5index_11IndexEngine_get_value; + __pyx_vtable_6pandas_5index_IndexEngine.set_value = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyArrayObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5index_11IndexEngine_set_value; + __pyx_vtable_6pandas_5index_IndexEngine.get_loc = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5index_11IndexEngine_get_loc; + __pyx_vtable_6pandas_5index_IndexEngine._get_loc_duplicates = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11IndexEngine__get_loc_duplicates; + __pyx_vtable_6pandas_5index_IndexEngine._maybe_get_bool_indexer = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11IndexEngine__maybe_get_bool_indexer; + __pyx_vtable_6pandas_5index_IndexEngine._do_monotonic_check = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine__do_monotonic_check; + __pyx_vtable_6pandas_5index_IndexEngine._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine__get_index_values; + __pyx_vtable_6pandas_5index_IndexEngine._do_unique_check = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine__do_unique_check; + __pyx_vtable_6pandas_5index_IndexEngine._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11IndexEngine__make_hash_table; + __pyx_vtable_6pandas_5index_IndexEngine._check_type = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11IndexEngine__check_type; + __pyx_vtable_6pandas_5index_IndexEngine._ensure_mapping_populated = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine__ensure_mapping_populated; + __pyx_vtable_6pandas_5index_IndexEngine.initialize = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11IndexEngine_initialize; + if (PyType_Ready(&__pyx_type_6pandas_5index_IndexEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_IndexEngine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_IndexEngine.tp_dict, __pyx_vtabptr_6pandas_5index_IndexEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "IndexEngine", (PyObject *)&__pyx_type_6pandas_5index_IndexEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_IndexEngine = &__pyx_type_6pandas_5index_IndexEngine; + __pyx_vtabptr_6pandas_5index_Int64Engine = &__pyx_vtable_6pandas_5index_Int64Engine; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base = *__pyx_vtabptr_6pandas_5index_IndexEngine; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base._maybe_get_bool_indexer = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11Int64Engine__maybe_get_bool_indexer; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_11Int64Engine__get_index_values; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11Int64Engine__make_hash_table; + __pyx_vtable_6pandas_5index_Int64Engine.__pyx_base._check_type = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_11Int64Engine__check_type; + __pyx_type_6pandas_5index_Int64Engine.tp_base = __pyx_ptype_6pandas_5index_IndexEngine; + if (PyType_Ready(&__pyx_type_6pandas_5index_Int64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_Int64Engine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_Int64Engine.tp_dict, __pyx_vtabptr_6pandas_5index_Int64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Int64Engine", (PyObject *)&__pyx_type_6pandas_5index_Int64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_Int64Engine = &__pyx_type_6pandas_5index_Int64Engine; + __pyx_vtabptr_6pandas_5index_Float64Engine = &__pyx_vtable_6pandas_5index_Float64Engine; + __pyx_vtable_6pandas_5index_Float64Engine.__pyx_base = *__pyx_vtabptr_6pandas_5index_IndexEngine; + __pyx_vtable_6pandas_5index_Float64Engine.__pyx_base._maybe_get_bool_indexer = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_13Float64Engine__maybe_get_bool_indexer; + __pyx_vtable_6pandas_5index_Float64Engine.__pyx_base._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_13Float64Engine__get_index_values; + __pyx_vtable_6pandas_5index_Float64Engine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_13Float64Engine__make_hash_table; + __pyx_type_6pandas_5index_Float64Engine.tp_base = __pyx_ptype_6pandas_5index_IndexEngine; + if (PyType_Ready(&__pyx_type_6pandas_5index_Float64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_Float64Engine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_Float64Engine.tp_dict, __pyx_vtabptr_6pandas_5index_Float64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Float64Engine", (PyObject *)&__pyx_type_6pandas_5index_Float64Engine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_Float64Engine = &__pyx_type_6pandas_5index_Float64Engine; + __pyx_vtabptr_6pandas_5index_ObjectEngine = &__pyx_vtable_6pandas_5index_ObjectEngine; + __pyx_vtable_6pandas_5index_ObjectEngine.__pyx_base = *__pyx_vtabptr_6pandas_5index_IndexEngine; + __pyx_vtable_6pandas_5index_ObjectEngine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *))__pyx_f_6pandas_5index_12ObjectEngine__make_hash_table; + __pyx_type_6pandas_5index_ObjectEngine.tp_base = __pyx_ptype_6pandas_5index_IndexEngine; + if (PyType_Ready(&__pyx_type_6pandas_5index_ObjectEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_ObjectEngine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_ObjectEngine.tp_dict, __pyx_vtabptr_6pandas_5index_ObjectEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ObjectEngine", (PyObject *)&__pyx_type_6pandas_5index_ObjectEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_ObjectEngine = &__pyx_type_6pandas_5index_ObjectEngine; + __pyx_vtabptr_6pandas_5index_DatetimeEngine = &__pyx_vtable_6pandas_5index_DatetimeEngine; + __pyx_vtable_6pandas_5index_DatetimeEngine.__pyx_base = *__pyx_vtabptr_6pandas_5index_Int64Engine; + __pyx_vtable_6pandas_5index_DatetimeEngine.__pyx_base.__pyx_base.get_loc = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5index_14DatetimeEngine_get_loc; + __pyx_vtable_6pandas_5index_DatetimeEngine.__pyx_base.__pyx_base._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_5index_IndexEngine *))__pyx_f_6pandas_5index_14DatetimeEngine__get_index_values; + __pyx_vtable_6pandas_5index_DatetimeEngine._date_check_type = (PyObject *(*)(struct __pyx_obj_6pandas_5index_DatetimeEngine *, PyObject *))__pyx_f_6pandas_5index_14DatetimeEngine__date_check_type; + __pyx_type_6pandas_5index_DatetimeEngine.tp_base = __pyx_ptype_6pandas_5index_Int64Engine; + if (PyType_Ready(&__pyx_type_6pandas_5index_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5index_DatetimeEngine.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5index_DatetimeEngine.tp_dict, __pyx_vtabptr_6pandas_5index_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DatetimeEngine", (PyObject *)&__pyx_type_6pandas_5index_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5index_DatetimeEngine = &__pyx_type_6pandas_5index_DatetimeEngine; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_HashTable = __Pyx_ImportType("pandas.hashtable", "HashTable", sizeof(struct __pyx_obj_6pandas_9hashtable_HashTable), 1); if (unlikely(!__pyx_ptype_6pandas_9hashtable_HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Int64HashTable = __Pyx_ImportType("pandas.hashtable", "Int64HashTable", sizeof(struct __pyx_obj_6pandas_9hashtable_Int64HashTable), 1); if (unlikely(!__pyx_ptype_6pandas_9hashtable_Int64HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_6pandas_9hashtable_Int64HashTable = (struct __pyx_vtabstruct_6pandas_9hashtable_Int64HashTable*)__Pyx_GetVtable(__pyx_ptype_6pandas_9hashtable_Int64HashTable->tp_dict); if (unlikely(!__pyx_vtabptr_6pandas_9hashtable_Int64HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_Float64HashTable = __Pyx_ImportType("pandas.hashtable", "Float64HashTable", sizeof(struct __pyx_obj_6pandas_9hashtable_Float64HashTable), 1); if (unlikely(!__pyx_ptype_6pandas_9hashtable_Float64HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_6pandas_9hashtable_Float64HashTable = (struct __pyx_vtabstruct_6pandas_9hashtable_Float64HashTable*)__Pyx_GetVtable(__pyx_ptype_6pandas_9hashtable_Float64HashTable->tp_dict); if (unlikely(!__pyx_vtabptr_6pandas_9hashtable_Float64HashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_9hashtable_PyObjectHashTable = __Pyx_ImportType("pandas.hashtable", "PyObjectHashTable", sizeof(struct __pyx_obj_6pandas_9hashtable_PyObjectHashTable), 1); if (unlikely(!__pyx_ptype_6pandas_9hashtable_PyObjectHashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable = (struct __pyx_vtabstruct_6pandas_9hashtable_PyObjectHashTable*)__Pyx_GetVtable(__pyx_ptype_6pandas_9hashtable_PyObjectHashTable->tp_dict); if (unlikely(!__pyx_vtabptr_6pandas_9hashtable_PyObjectHashTable)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/index.pyx":9 + * cimport numpy as cnp + * + * cnp.import_array() # <<<<<<<<<<<<<< + * cnp.import_ufunc() + * + */ + import_array(); + + /* "pandas/index.pyx":10 + * + * cnp.import_array() + * cnp.import_ufunc() # <<<<<<<<<<<<<< + * + * cimport util + */ + import_ufunc(); + + /* "pandas/index.pyx":14 + * cimport util + * + * import numpy as np # <<<<<<<<<<<<<< + * + * cimport tslib + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":18 + * cimport tslib + * from hashtable cimport * + * from pandas import algos, tslib, hashtable as _hash # <<<<<<<<<<<<<< + * from pandas.tslib import Timestamp + * + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_algos); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_algos); + __Pyx_GIVEREF(__pyx_n_s_algos); + __Pyx_INCREF(__pyx_n_s_tslib); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_tslib); + __Pyx_GIVEREF(__pyx_n_s_tslib); + __Pyx_INCREF(__pyx_n_s_hashtable); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_hashtable); + __Pyx_GIVEREF(__pyx_n_s_hashtable); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_algos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tslib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_hashtable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hash, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":19 + * from hashtable cimport * + * from pandas import algos, tslib, hashtable as _hash + * from pandas.tslib import Timestamp # <<<<<<<<<<<<<< + * + * from datetime cimport (get_datetime64_value, _pydatetime_to_dts, + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Timestamp); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Timestamp); + __Pyx_GIVEREF(__pyx_n_s_Timestamp); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_tslib, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":30 + * void PyDateTime_IMPORT() + * + * cdef int64_t iNaT = util.get_nat() # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_v_6pandas_5index_iNaT = get_nat(); + + /* "pandas/index.pyx":32 + * cdef int64_t iNaT = util.get_nat() + * + * try: # <<<<<<<<<<<<<< + * from dateutil.tz import tzutc as _du_utc + * import pytz + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "pandas/index.pyx":33 + * + * try: + * from dateutil.tz import tzutc as _du_utc # <<<<<<<<<<<<<< + * import pytz + * UTC = pytz.utc + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_tzutc); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_tzutc); + __Pyx_GIVEREF(__pyx_n_s_tzutc); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_dateutil_tz, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzutc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_du_utc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":34 + * try: + * from dateutil.tz import tzutc as _du_utc + * import pytz # <<<<<<<<<<<<<< + * UTC = pytz.utc + * have_pytz = True + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":35 + * from dateutil.tz import tzutc as _du_utc + * import pytz + * UTC = pytz.utc # <<<<<<<<<<<<<< + * have_pytz = True + * except ImportError: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_utc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTC, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":36 + * import pytz + * UTC = pytz.utc + * have_pytz = True # <<<<<<<<<<<<<< + * except ImportError: + * have_pytz = False + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_pytz, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":37 + * UTC = pytz.utc + * have_pytz = True + * except ImportError: # <<<<<<<<<<<<<< + * have_pytz = False + * + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_6) { + __Pyx_AddTraceback("pandas.index", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/index.pyx":38 + * have_pytz = True + * except ImportError: + * have_pytz = False # <<<<<<<<<<<<<< + * + * PyDateTime_IMPORT + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_pytz, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L9_try_end:; + } + + /* "pandas/index.pyx":40 + * have_pytz = False + * + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + PyDateTime_IMPORT; + + /* "pandas/index.pyx":57 + * or PyList_Check(val) or hasattr(val,'_data')) + * + * def get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_at(arr, loc)) + */ + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5index_1get_value_at, NULL, __pyx_n_s_pandas_index); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_value_at, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":62 + * return util.get_value_at(arr, loc) + * + * def set_value_at(ndarray arr, object loc, object val): # <<<<<<<<<<<<<< + * return util.set_value_at(arr, loc, val) + * + */ + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5index_3set_value_at, NULL, __pyx_n_s_pandas_index); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_value_at, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":67 + * + * # Don't populate hash tables in monotonic indexes larger than this + * _SIZE_CUTOFF = 1000000 # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIZE_CUTOFF, __pyx_int_1000000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/index.pyx":470 + * return mid + 1 + * + * _pad_functions = { # <<<<<<<<<<<<<< + * 'object' : algos.pad_object, + * 'int64' : algos.pad_int64, + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/index.pyx":471 + * + * _pad_functions = { + * 'object' : algos.pad_object, # <<<<<<<<<<<<<< + * 'int64' : algos.pad_int64, + * 'float64' : algos.pad_float64 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pad_object); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_object, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":472 + * _pad_functions = { + * 'object' : algos.pad_object, + * 'int64' : algos.pad_int64, # <<<<<<<<<<<<<< + * 'float64' : algos.pad_float64 + * } + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pad_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":473 + * 'object' : algos.pad_object, + * 'int64' : algos.pad_int64, + * 'float64' : algos.pad_float64 # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pad_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_float64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pad_functions, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":476 + * } + * + * _backfill_functions = { # <<<<<<<<<<<<<< + * 'object': algos.backfill_object, + * 'int64': algos.backfill_int64, + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/index.pyx":477 + * + * _backfill_functions = { + * 'object': algos.backfill_object, # <<<<<<<<<<<<<< + * 'int64': algos.backfill_int64, + * 'float64': algos.backfill_float64 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_object, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/index.pyx":478 + * _backfill_functions = { + * 'object': algos.backfill_object, + * 'int64': algos.backfill_int64, # <<<<<<<<<<<<<< + * 'float64': algos.backfill_float64 + * } + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_backfill_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/index.pyx":479 + * 'object': algos.backfill_object, + * 'int64': algos.backfill_int64, + * 'float64': algos.backfill_float64 # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_backfill_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_float64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_backfill_functions, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/index.pyx":1 + * from numpy cimport ndarray # <<<<<<<<<<<<<< + * + * from numpy cimport (float64_t, int32_t, int64_t, uint8_t, + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.index", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.index"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/pandas/lib.c b/cythonized-files3/pandas/lib.c new file mode 100644 index 00000000..9ae1f8bb --- /dev/null +++ b/cythonized-files3/pandas/lib.c @@ -0,0 +1,81711 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__lib +#define __PYX_HAVE_API__pandas__lib +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "headers/stdint.h" +#include "datetime.h" +#include "datetime_helper.h" +#include "numpy/ndarrayobject.h" +#include "numpy_helper.h" +#include "numpy/npy_common.h" +#include "datetime/np_datetime.h" +#include "datetime/np_datetime_strings.h" +#include "math.h" +#include "parse_helper.h" +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "lib.pyx", + "reduce.pyx", + "inference.pyx", + "properties.pyx", + "numpy.pxd", + "util.pxd", + "datetime.pxd", + "stringsource", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; + +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && MSC_VER + #include + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using MSVC atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview) \ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview) \ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#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 + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; + +/* "pandas/lib.pyx":53 + * cdef int64_t NPY_NAT = util.get_nat() + * + * ctypedef unsigned char UChar # <<<<<<<<<<<<<< + * + * cimport util + */ +typedef unsigned char __pyx_t_6pandas_3lib_UChar; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_3lib__PandasNull; +struct __pyx_obj_6pandas_3lib_BlockPlacement; +struct __pyx_obj_6pandas_3lib_Reducer; +struct __pyx_obj_6pandas_3lib_SeriesBinGrouper; +struct __pyx_obj_6pandas_3lib_SeriesGrouper; +struct __pyx_obj_6pandas_3lib_Slider; +struct __pyx_obj_6pandas_3lib_BlockSlider; +struct __pyx_obj_6pandas_3lib_cache_readonly; +struct __pyx_obj_6pandas_3lib_AxisProperty; +struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers; +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr; +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates; +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex; +struct __pyx_opt_args_6pandas_3lib_slice_len; + +/* "pandas/lib.pyx":1443 + * + * + * cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX): # <<<<<<<<<<<<<< + * """ + * Get (start, stop, step, length) tuple for a slice. + */ +struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex { + int __pyx_n; + Py_ssize_t objlen; +}; + +/* "pandas/lib.pyx":1462 + * + * + * cpdef Py_ssize_t slice_len(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX) except -1: # <<<<<<<<<<<<<< + * """ + * Get length of a bounded slice. + */ +struct __pyx_opt_args_6pandas_3lib_slice_len { + int __pyx_n; + Py_ssize_t objlen; +}; + +/* "pandas/lib.pyx":1119 + * return counts + * + * cdef class _PandasNull: # <<<<<<<<<<<<<< + * + * def __richcmp__(_PandasNull self, object other, int op): + */ +struct __pyx_obj_6pandas_3lib__PandasNull { + PyObject_HEAD +}; + + +/* "pandas/lib.pyx":1519 + * + * + * cdef class BlockPlacement: # <<<<<<<<<<<<<< + * # __slots__ = '_as_slice', '_as_array', '_len' + * cdef slice _as_slice + */ +struct __pyx_obj_6pandas_3lib_BlockPlacement { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *__pyx_vtab; + PyObject *_as_slice; + PyObject *_as_array; + int _has_slice; + int _has_array; + int _is_known_slice_like; +}; + + +/* "pandas/src/reduce.pyx":9 + * is_numpy_prior_1_6_2 = LooseVersion(np.__version__) < '1.6.2' + * + * cdef class Reducer: # <<<<<<<<<<<<<< + * ''' + * Performs generic reduction operation on a C or Fortran-contiguous ndarray + */ +struct __pyx_obj_6pandas_3lib_Reducer { + PyObject_HEAD + Py_ssize_t increment; + Py_ssize_t chunksize; + Py_ssize_t nresults; + PyObject *arr; + PyObject *dummy; + PyObject *f; + PyObject *labels; + PyObject *typ; + PyObject *index; +}; + + +/* "pandas/src/reduce.pyx":157 + * + * + * cdef class SeriesBinGrouper: # <<<<<<<<<<<<<< + * ''' + * Performs grouping operation according to bin edges, rather than labels + */ +struct __pyx_obj_6pandas_3lib_SeriesBinGrouper { + PyObject_HEAD + Py_ssize_t nresults; + Py_ssize_t ngroups; + int passed_dummy; + PyObject *arr; + PyObject *index; + PyObject *dummy_arr; + PyObject *dummy_index; + PyObject *values; + PyObject *f; + PyObject *bins; + PyObject *typ; + PyObject *name; +}; + + +/* "pandas/src/reduce.pyx":285 + * + * + * cdef class SeriesGrouper: # <<<<<<<<<<<<<< + * ''' + * Performs generic grouping operation while avoiding ndarray construction + */ +struct __pyx_obj_6pandas_3lib_SeriesGrouper { + PyObject_HEAD + Py_ssize_t nresults; + Py_ssize_t ngroups; + int passed_dummy; + PyObject *arr; + PyObject *index; + PyObject *dummy_arr; + PyObject *dummy_index; + PyObject *f; + PyObject *labels; + PyObject *values; + PyObject *typ; + PyObject *name; +}; + + +/* "pandas/src/reduce.pyx":426 + * return res + * + * cdef class Slider: # <<<<<<<<<<<<<< + * ''' + * Only handles contiguous data for now + */ +struct __pyx_obj_6pandas_3lib_Slider { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_3lib_Slider *__pyx_vtab; + PyArrayObject *values; + PyArrayObject *buf; + Py_ssize_t stride; + Py_ssize_t orig_len; + Py_ssize_t orig_stride; + char *orig_data; +}; + + +/* "pandas/src/reduce.pyx":529 + * return results, mutated + * + * cdef class BlockSlider: # <<<<<<<<<<<<<< + * ''' + * Only capable of sliding on axis=0 + */ +struct __pyx_obj_6pandas_3lib_BlockSlider { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *__pyx_vtab; + PyObject *frame; + PyObject *dummy; + int nblocks; + struct __pyx_obj_6pandas_3lib_Slider *idx_slider; + PyObject *blocks; + char **base_ptrs; +}; + + +/* "pandas/src/properties.pyx":4 + * + * + * cdef class cache_readonly(object): # <<<<<<<<<<<<<< + * + * cdef readonly: + */ +struct __pyx_obj_6pandas_3lib_cache_readonly { + PyObject_HEAD + PyObject *func; + PyObject *name; + PyObject *allow_setting; +}; + + +/* "pandas/src/properties.pyx":53 + * PyDict_SetItem(cache, self.name, value) + * + * cdef class AxisProperty(object): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t axis + */ +struct __pyx_obj_6pandas_3lib_AxisProperty { + PyObject_HEAD + Py_ssize_t axis; +}; + + +/* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ +struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers { + PyObject_HEAD + PyObject *__pyx_v_blkno; + __Pyx_memviewslice __pyx_v_blknos; + __pyx_t_5numpy_int64_t __pyx_v_cur_blkno; + Py_ssize_t __pyx_v_diff; + PyObject *__pyx_v_genexpr; + int __pyx_v_group; + PyObject *__pyx_v_group_dict; + PyObject *__pyx_v_group_order; + PyObject *__pyx_v_group_slices; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __Pyx_memviewslice __pyx_v_res_view; + PyObject *__pyx_v_result; + PyObject *__pyx_v_slices; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + PyObject *__pyx_v_tot_len; + Py_ssize_t __pyx_t_0; + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; +}; + + +/* "pandas/lib.pyx":1345 + * yield blkno, slice(slices[0][0], slices[0][1]) + * else: + * tot_len = sum(stop - start for start, stop in slices) # <<<<<<<<<<<<<< + * result = np.empty(tot_len, dtype=np.int64) + * res_view = result + */ +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr { + PyObject_HEAD + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *__pyx_outer_scope; + PyObject *__pyx_v_start; + PyObject *__pyx_v_stop; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; + PyObject *(*__pyx_t_2)(PyObject *); +}; + + +/* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates { + PyObject_HEAD + PyObject *__pyx_v_dayfirst; + PyObject *__pyx_v_default; + PyObject *__pyx_v_parse; +}; + + +/* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ +struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time { + PyObject_HEAD + PyObject *__pyx_v_date; + PyObject *__pyx_v_dayfirst; + PyObject *__pyx_v_default; + PyObject *__pyx_v_parse; + PyObject *__pyx_v_time; +}; + + +/* "View.MemoryView":99 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":269 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":302 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":922 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "pandas/lib.pyx":1519 + * + * + * cdef class BlockPlacement: # <<<<<<<<<<<<<< + * # __slots__ = '_as_slice', '_as_array', '_len' + * cdef slice _as_slice + */ + +struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement { + PyObject *(*iadd)(struct __pyx_obj_6pandas_3lib_BlockPlacement *, PyObject *); + struct __pyx_obj_6pandas_3lib_BlockPlacement *(*copy)(struct __pyx_obj_6pandas_3lib_BlockPlacement *); + PyObject *(*_ensure_has_slice)(struct __pyx_obj_6pandas_3lib_BlockPlacement *); +}; +static struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *__pyx_vtabptr_6pandas_3lib_BlockPlacement; + + +/* "pandas/src/reduce.pyx":426 + * return res + * + * cdef class Slider: # <<<<<<<<<<<<<< + * ''' + * Only handles contiguous data for now + */ + +struct __pyx_vtabstruct_6pandas_3lib_Slider { + PyObject *(*advance)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch); + PyObject *(*move)(struct __pyx_obj_6pandas_3lib_Slider *, int, int); + PyObject *(*set_length)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch); + PyObject *(*reset)(struct __pyx_obj_6pandas_3lib_Slider *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_3lib_Slider *__pyx_vtabptr_6pandas_3lib_Slider; + + +/* "pandas/src/reduce.pyx":529 + * return results, mutated + * + * cdef class BlockSlider: # <<<<<<<<<<<<<< + * ''' + * Only capable of sliding on axis=0 + */ + +struct __pyx_vtabstruct_6pandas_3lib_BlockSlider { + PyObject *(*move)(struct __pyx_obj_6pandas_3lib_BlockSlider *, int, int, int __pyx_skip_dispatch); + PyObject *(*reset)(struct __pyx_obj_6pandas_3lib_BlockSlider *); +}; +static struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *__pyx_vtabptr_6pandas_3lib_BlockSlider; + + +/* "View.MemoryView":302 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":922 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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 CYTHON_INLINE 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); + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE int __Pyx_mod_int(int, int); /* proto */ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +#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); + +static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +#else +#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#endif + +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); + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +#if CYTHON_COMPILING_IN_CPYTHON +#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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) + +static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ +#if CYTHON_COMPILING_IN_PYPY +#define __Pyx_PyObject_AsDouble(obj) \ +(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \ + likely(PyInt_CheckExact(obj)) ? \ + PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) +#else +#define __Pyx_PyObject_AsDouble(obj) \ +((likely(PyFloat_CheckExact(obj))) ? \ + PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +#endif + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_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 { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +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(void); + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + 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 +} + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); /*proto*/ + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_object(PyObject *); + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp); /* proto */ +static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj); /* proto */ + +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); + +static PyObject *__pyx_memview_get_object(const char *itemp); /* proto */ +static int __pyx_memview_set_object(const char *itemp, PyObject *obj); /* proto */ + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*); + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, + char order, int ndim); + +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +#define __Pyx_Generator_USED +#include +#include +typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *); +typedef struct { + PyObject_HEAD + __pyx_generator_body_t body; + PyObject *closure; + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + int resume_label; + char is_running; +} __pyx_GeneratorObject; +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure); +static int __pyx_Generator_init(void); +static int __Pyx_Generator_clear(PyObject* self); +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) +#endif + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython.view' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'datetime' */ + +/* Module declarations from 'datetime' */ +static PyTypeObject *__pyx_ptype_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0; +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/ + +/* Module declarations from 'pandas.tslib' */ +static PyObject *(*__pyx_f_6pandas_5tslib_convert_to_tsobject)(PyObject *, PyObject *, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_6pandas_5tslib_convert_to_timedelta64)(PyObject *, PyObject *, PyObject *); /*proto*/ + +/* Module declarations from 'util' */ +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *); /*proto*/ + +/* Module declarations from 'pandas.lib' */ +static PyTypeObject *__pyx_ptype_6pandas_3lib__PandasNull = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_BlockPlacement = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_Reducer = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_SeriesBinGrouper = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_SeriesGrouper = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_Slider = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_BlockSlider = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_cache_readonly = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib_AxisProperty = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct__get_blkno_indexers = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct_1_genexpr = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct_2_try_parse_dates = 0; +static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static double __pyx_v_6pandas_3lib_NaN; +static double __pyx_v_6pandas_3lib_nan; +static double __pyx_v_6pandas_3lib_NAN; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_3lib_NPY_NAT; +static int __pyx_v_6pandas_3lib__EPOCH_ORD; +static double __pyx_v_6pandas_3lib_INF; +static double __pyx_v_6pandas_3lib_NEGINF; +static double __pyx_v_6pandas_3lib_fINT64_MAX; +static double __pyx_v_6pandas_3lib_fINT64_MIN; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static PyObject *__pyx_f_6pandas_3lib_map_indices_list(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_gmtime(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_to_datetime(__pyx_t_5numpy_int64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_to_timestamp(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_get_timedelta64_value(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_checknull(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_checknull_old(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_3lib_astype_str(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_indexer_as_slice(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_slice_canonize(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_slice_get_indices_ex(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex *__pyx_optional_args); /*proto*/ +static Py_ssize_t __pyx_f_6pandas_3lib_slice_len(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_slice_len *__pyx_optional_args); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__extract_result(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_null_datetimelike(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_datetime(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_date(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_time(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_timedelta(PyObject *); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 }; +#define __Pyx_MODULE_NAME "pandas.lib" +int __pyx_module_is_main_pandas__lib = 0; + +/* Implementation of 'pandas.lib' */ +static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_sum; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_OverflowError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_xrange; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_pf_6pandas_3lib_values_from_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_2map_indices_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_4ismember_nans(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr, PyObject *__pyx_v_values, int __pyx_v_hasnans); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_6ismember(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_8to_datetime(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_timestamp); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_10to_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dt); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_12array_to_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14time64_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16checknull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_18checknull_old(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_20isscalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_22isnullobj(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_24isnullobj_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_26isnullobj2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_28isnullobj_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_30isnullobj2d_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_32list_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_34fast_unique(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_36fast_unique_multiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_38fast_unique_multiple_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lists); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_40fast_unique_multiple_list_gen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gen); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_42dicts_to_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dicts, PyObject *__pyx_v_columns); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_44fast_zip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ndarrays); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_46get_reverse_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, Py_ssize_t __pyx_v_length); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_48has_infs_f4(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_50has_infs_f8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_52convert_timestamps(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_54maybe_indices_to_slice(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_56maybe_booleans_to_slice(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_58scalar_compare(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val, PyObject *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_60vec_compare(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, PyObject *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_62scalar_binop(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val, PyObject *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_64vec_binop(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, PyObject *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_66astype_intsafe(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_new_dtype); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_68astype_str(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_70clean_index_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_72max_len_string_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_74string_array_replace_from_nan_rep(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_nan_rep, PyObject *__pyx_v_replace); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_76write_csv_rows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_data_index, int __pyx_v_nlevels, PyObject *__pyx_v_cols, PyObject *__pyx_v_writer); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_78arrmap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_80is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_82generate_bins_dt64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_binner, PyObject *__pyx_v_closed, int __pyx_v_hasnans); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_84row_bool_subset(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_86row_bool_subset_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_88group_count(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, Py_ssize_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_90lookup_values(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_mapping); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_92count_level_1d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_max_bin); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_94count_level_2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_max_bin); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11_PandasNull___richcmp__(CYTHON_UNUSED struct __pyx_obj_6pandas_3lib__PandasNull *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ +static Py_hash_t __pyx_pf_6pandas_3lib_11_PandasNull_2__hash__(CYTHON_UNUSED struct __pyx_obj_6pandas_3lib__PandasNull *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_96fast_zip_fillna(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ndarrays, PyObject *__pyx_v_fill_value); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_98duplicated(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_take_last); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_100generate_slices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_ngroups); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_102indices_fast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_keys, PyObject *__pyx_v_sorted_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_18get_blkno_indexers_genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_104get_blkno_indexers(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_blknos, int __pyx_v_group); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_107indexer_as_slice(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_vals); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_109slice_canonize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_111slice_get_indices_ex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, Py_ssize_t __pyx_v_objlen); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_113slice_len(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, Py_ssize_t __pyx_v_objlen); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_115slice_getitem(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, PyObject *__pyx_v_ind); /* proto */ +static int __pyx_pf_6pandas_3lib_14BlockPlacement___init__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_2__unicode__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6pandas_3lib_14BlockPlacement_4__len__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_6__iter__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_8as_slice(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_10indexer(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_12isin(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_14as_array(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_16is_slice_like(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_18__getitem__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_20delete(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_22append(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_others); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_24add(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_26sub(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static int __pyx_pf_6pandas_3lib_7Reducer___init__(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_f, PyObject *__pyx_v_axis, PyObject *__pyx_v_dummy, PyObject *__pyx_v_labels); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_2_check_dummy(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_4get_result(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_6_get_result_array(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_res); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_series, PyObject *__pyx_v_f, PyObject *__pyx_v_bins, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_2_check_dummy(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4get_result(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_6_get_result_array(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_res); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper___init__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_series, PyObject *__pyx_v_f, PyObject *__pyx_v_labels, Py_ssize_t __pyx_v_ngroups, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_2_check_dummy(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_dummy); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_4get_result(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6_get_result_array(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_res); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6values___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3typ___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_4name___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_6Slider___init__(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, PyObject *__pyx_v_values, PyObject *__pyx_v_buf); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_6Slider_2advance(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_k); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_6Slider_4set_length(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_length); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_6Slider_6reset(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_117apply_frame_axis0(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frame, PyObject *__pyx_v_f, PyObject *__pyx_v_names, PyArrayObject *__pyx_v_starts, PyArrayObject *__pyx_v_ends); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider___init__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_frame); /* proto */ +static void __pyx_pf_6pandas_3lib_11BlockSlider_2__dealloc__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_4move(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, int __pyx_v_start, int __pyx_v_end); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_5frame___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_5frame_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_5frame_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_5dummy___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_7nblocks___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_7nblocks_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_6blocks___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_119reduce(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_f, PyObject *__pyx_v_axis, PyObject *__pyx_v_dummy, PyObject *__pyx_v_labels); /* proto */ +static int __pyx_pf_6pandas_3lib_14cache_readonly___init__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_allow_setting); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_2__call__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_func, CYTHON_UNUSED PyObject *__pyx_v_doc); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4__get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_typ); /* proto */ +static int __pyx_pf_6pandas_3lib_14cache_readonly_6__set__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4func___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_13allow_setting___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_3lib_12AxisProperty___init__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_axis); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_12AxisProperty_2__get__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_type); /* proto */ +static int __pyx_pf_6pandas_3lib_12AxisProperty_4__set__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_121is_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_123is_integer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_125is_bool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_127is_complex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_129infer_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_131infer_dtype_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_133is_possible_datetimelike_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_135is_bool_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_137is_integer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_139is_integer_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_141is_integer_float_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_143is_float_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_145is_string_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_147is_unicode_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_149is_datetime_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_151is_datetime64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_153is_timedelta_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_155is_timedelta64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_157is_timedelta_or_timedelta64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_159is_date_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_161is_time_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_163is_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_165is_period_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_167maybe_convert_numeric(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyObject *__pyx_v_na_values, int __pyx_v_convert_empty, int __pyx_v_coerce_numeric); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_169maybe_convert_objects(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_objects, int __pyx_v_try_float, int __pyx_v_safe, int __pyx_v_convert_datetime, int __pyx_v_convert_timedelta); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_171convert_sql_column(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_15try_parse_dates_parse_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_173try_parse_dates(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_parser, PyObject *__pyx_v_dayfirst, PyObject *__pyx_v_default); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_2parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_175try_parse_date_and_time(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dates, PyArrayObject *__pyx_v_times, PyObject *__pyx_v_date_parser, PyObject *__pyx_v_time_parser, PyObject *__pyx_v_dayfirst, PyObject *__pyx_v_default); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_177try_parse_year_month_day(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_years, PyArrayObject *__pyx_v_months, PyArrayObject *__pyx_v_days); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_179try_parse_datetime_components(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_years, PyArrayObject *__pyx_v_months, PyArrayObject *__pyx_v_days, PyArrayObject *__pyx_v_hours, PyArrayObject *__pyx_v_minutes, PyArrayObject *__pyx_v_seconds); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_181sanitize_objects(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_na_values, PyObject *__pyx_v_convert_empty); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_183maybe_convert_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_true_values, PyObject *__pyx_v_false_values); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_185map_infer_mask(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_f, PyArrayObject *__pyx_v_mask, int __pyx_v_convert); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_187map_infer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_f, int __pyx_v_convert); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_189to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rows); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_191tuples_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tuples); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_193to_object_array_tuples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rows); /* proto */ +static PyObject *__pyx_pf_6pandas_3lib_195fast_multiget(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping, PyArrayObject *__pyx_v_keys, PyObject *__pyx_v_default); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6pandas_3lib__PandasNull(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_BlockPlacement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_Reducer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_SeriesBinGrouper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_SeriesGrouper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_Slider(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_BlockSlider(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_cache_readonly(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib_AxisProperty(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_C[] = "C"; +static char __pyx_k_F[] = "F"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_M[] = "M"; +static char __pyx_k_N[] = "N"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_S[] = "S"; +static char __pyx_k_U[] = "U"; +static char __pyx_k_W[] = "W"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_c[] = "c"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_m[] = "m"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_o[] = "o"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_s[] = "s"; +static char __pyx_k_t[] = "t"; +static char __pyx_k_u[] = "u"; +static char __pyx_k_v[] = "v"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_bc[] = "bc"; +static char __pyx_k_eq[] = "eq"; +static char __pyx_k_f8[] = "f8"; +static char __pyx_k_ge[] = "ge"; +static char __pyx_k_gt[] = "gt"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_id[] = "id"; +static char __pyx_k_it[] = "it"; +static char __pyx_k_le[] = "le"; +static char __pyx_k_lt[] = "lt"; +static char __pyx_k_ne[] = "ne"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_ns[] = "ns"; +static char __pyx_k_op[] = "op"; +static char __pyx_k_u1[] = "u1"; +static char __pyx_k_vc[] = "vc"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k_NaT[] = "NaT"; +static char __pyx_k__46[] = "."; +static char __pyx_k__49[] = ""; +static char __pyx_k_add[] = "add"; +static char __pyx_k_any[] = "any"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_buf[] = "buf"; +static char __pyx_k_c16[] = "c16"; +static char __pyx_k_col[] = "col"; +static char __pyx_k_cur[] = "cur"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_doc[] = "doc"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_gen[] = "gen"; +static char __pyx_k_gin[] = "gin"; +static char __pyx_k_idx[] = "idx"; +static char __pyx_k_ind[] = "ind"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_lab[] = "lab"; +static char __pyx_k_len[] = "__len__"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_now[] = "now"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_out[] = "out"; +static char __pyx_k_pos[] = "pos"; +static char __pyx_k_pre[] = "pre"; +static char __pyx_k_row[] = "row"; +static char __pyx_k_s_r[] = "%s(%r)"; +static char __pyx_k_slc[] = "slc"; +static char __pyx_k_sum[] = "sum"; +static char __pyx_k_tmp[] = "tmp"; +static char __pyx_k_tup[] = "tup"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_TRUE[] = "TRUE"; +static char __pyx_k_True[] = "True"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_axes[] = "axes"; +static char __pyx_k_axis[] = "axis"; +static char __pyx_k_base[] = "base"; +static char __pyx_k_bins[] = "bins"; +static char __pyx_k_bool[] = "bool_"; +static char __pyx_k_cols[] = "cols"; +static char __pyx_k_copy[] = "copy"; +static char __pyx_k_data[] = "data"; +static char __pyx_k_date[] = "date"; +static char __pyx_k_days[] = "days"; +static char __pyx_k_diff[] = "diff"; +static char __pyx_k_ends[] = "ends"; +static char __pyx_k_fill[] = "fill"; +static char __pyx_k_flag[] = "flag"; +static char __pyx_k_fnan[] = "fnan"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_fval[] = "fval"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_iNaT[] = "iNaT"; +static char __pyx_k_int8[] = "int8"; +static char __pyx_k_ints[] = "ints"; +static char __pyx_k_isin[] = "isin"; +static char __pyx_k_item[] = "item"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_kind[] = "kind"; +static char __pyx_k_left[] = "left"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mask[] = "mask"; +static char __pyx_k_memo[] = "memo"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_move[] = "move"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_ndim[] = "ndim"; +static char __pyx_k_onan[] = "onan"; +static char __pyx_k_pack[] = "pack"; +static char __pyx_k_rows[] = "rows"; +static char __pyx_k_safe[] = "safe"; +static char __pyx_k_secs[] = "secs"; +static char __pyx_k_seen[] = "seen"; +static char __pyx_k_send[] = "send"; +static char __pyx_k_size[] = "size"; +static char __pyx_k_step[] = "step"; +static char __pyx_k_stop[] = "stop"; +static char __pyx_k_stub[] = "stub"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_time[] = "time"; +static char __pyx_k_true[] = "true"; +static char __pyx_k_type[] = "type"; +static char __pyx_k_vecs[] = "vecs"; +static char __pyx_k_view[] = "view"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_1_6_2[] = "1.6.2"; +static char __pyx_k_FALSE[] = "FALSE"; +static char __pyx_k_False[] = "False"; +static char __pyx_k_H_M_S[] = "%H:%M:%S"; +static char __pyx_k_M8_ns[] = "M8[ns]"; +static char __pyx_k_arobj[] = "arobj"; +static char __pyx_k_blkno[] = "blkno"; +static char __pyx_k_block[] = "_block"; +static char __pyx_k_bools[] = "bools"; +static char __pyx_k_cache[] = "_cache"; +static char __pyx_k_chunk[] = "chunk"; +static char __pyx_k_class[] = "__class__"; +static char __pyx_k_close[] = "close"; +static char __pyx_k_dates[] = "dates"; +static char __pyx_k_dicts[] = "dicts"; +static char __pyx_k_doc_2[] = "__doc__"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_dummy[] = "dummy"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_error[] = "error"; +static char __pyx_k_false[] = "false"; +static char __pyx_k_flags[] = "flags"; +static char __pyx_k_frame[] = "frame"; +static char __pyx_k_group[] = "group"; +static char __pyx_k_hours[] = "hours"; +static char __pyx_k_index[] = "index"; +static char __pyx_k_int16[] = "int16"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_isnan[] = "isnan"; +static char __pyx_k_l_bin[] = "l_bin"; +static char __pyx_k_lists[] = "lists"; +static char __pyx_k_m8_ns[] = "m8[ns]"; +static char __pyx_k_m_d_Y[] = "%m/%d/%Y"; +static char __pyx_k_mixed[] = "mixed"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_names[] = "names"; +static char __pyx_k_ncols[] = "ncols"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_parse[] = "parse"; +static char __pyx_k_piece[] = "piece"; +static char __pyx_k_r_bin[] = "r_bin"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_ravel[] = "ravel"; +static char __pyx_k_reset[] = "reset"; +static char __pyx_k_right[] = "right"; +static char __pyx_k_s_len[] = "s_len"; +static char __pyx_k_shape[] = "shape"; +static char __pyx_k_slobj[] = "slobj"; +static char __pyx_k_start[] = "start"; +static char __pyx_k_table[] = "table"; +static char __pyx_k_throw[] = "throw"; +static char __pyx_k_times[] = "times"; +static char __pyx_k_tslib[] = "tslib"; +static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_years[] = "years"; +static char __pyx_k_zeros[] = "zeros"; +static char __pyx_k_Period[] = "Period"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_arange[] = "arange"; +static char __pyx_k_arrays[] = "arrays"; +static char __pyx_k_arrmap[] = "arrmap"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_binner[] = "binner"; +static char __pyx_k_blknos[] = "blknos"; +static char __pyx_k_blocks[] = "blocks"; +static char __pyx_k_bool_2[] = "bool"; +static char __pyx_k_closed[] = "closed"; +static char __pyx_k_counts[] = "counts"; +static char __pyx_k_data_2[] = "_data"; +static char __pyx_k_delete[] = "delete"; +static char __pyx_k_engine[] = "_engine"; +static char __pyx_k_floats[] = "floats"; +static char __pyx_k_format[] = "format"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_insert[] = "insert"; +static char __pyx_k_labels[] = "labels"; +static char __pyx_k_lenbin[] = "lenbin"; +static char __pyx_k_length[] = "length"; +static char __pyx_k_lenidx[] = "lenidx"; +static char __pyx_k_micros[] = "micros"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_months[] = "months"; +static char __pyx_k_name_2[] = "name"; +static char __pyx_k_neginf[] = "neginf"; +static char __pyx_k_objbuf[] = "objbuf"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_objlen[] = "objlen"; +static char __pyx_k_output[] = "output"; +static char __pyx_k_pandas[] = "pandas"; +static char __pyx_k_parser[] = "parser"; +static char __pyx_k_period[] = "period"; +static char __pyx_k_pydate[] = "pydate"; +static char __pyx_k_reduce[] = "reduce"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_s_step[] = "s_step"; +static char __pyx_k_s_stop[] = "s_stop"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_series[] = "series"; +static char __pyx_k_slices[] = "slices"; +static char __pyx_k_slider[] = "slider"; +static char __pyx_k_starts[] = "starts"; +static char __pyx_k_status[] = "status"; +static char __pyx_k_string[] = "string"; +static char __pyx_k_struct[] = "struct"; +static char __pyx_k_tuples[] = "tuples"; +static char __pyx_k_uint16[] = "uint16"; +static char __pyx_k_uint32[] = "uint32"; +static char __pyx_k_uint64[] = "uint64"; +static char __pyx_k_unpack[] = "unpack"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_writer[] = "writer"; +static char __pyx_k_xrange[] = "xrange"; +static char __pyx_k_advance[] = "advance"; +static char __pyx_k_boolean[] = "boolean"; +static char __pyx_k_cache_2[] = "cache"; +static char __pyx_k_columns[] = "columns"; +static char __pyx_k_complex[] = "complex"; +static char __pyx_k_convert[] = "convert"; +static char __pyx_k_default[] = "default"; +static char __pyx_k_float16[] = "float16"; +static char __pyx_k_float32[] = "float32"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_fortran[] = "fortran"; +static char __pyx_k_genexpr[] = "genexpr"; +static char __pyx_k_hasnans[] = "hasnans"; +static char __pyx_k_ind_len[] = "ind_len"; +static char __pyx_k_index_2[] = "_index"; +static char __pyx_k_indexer[] = "indexer"; +static char __pyx_k_indices[] = "indices"; +static char __pyx_k_integer[] = "integer"; +static char __pyx_k_is_bool[] = "is_bool"; +static char __pyx_k_mapping[] = "mapping"; +static char __pyx_k_max_bin[] = "max_bin"; +static char __pyx_k_memview[] = "memview"; +static char __pyx_k_minutes[] = "minutes"; +static char __pyx_k_mutated[] = "mutated"; +static char __pyx_k_nan_rep[] = "nan_rep"; +static char __pyx_k_ngroups[] = "ngroups"; +static char __pyx_k_nlevels[] = "nlevels"; +static char __pyx_k_objects[] = "objects"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_putmask[] = "putmask"; +static char __pyx_k_reducer[] = "reducer"; +static char __pyx_k_replace[] = "replace"; +static char __pyx_k_require[] = "require"; +static char __pyx_k_results[] = "results"; +static char __pyx_k_s_start[] = "s_start"; +static char __pyx_k_seconds[] = "seconds"; +static char __pyx_k_setattr[] = "__setattr__"; +static char __pyx_k_started[] = "started"; +static char __pyx_k_strides[] = "strides"; +static char __pyx_k_tot_len[] = "tot_len"; +static char __pyx_k_unicode[] = "unicode"; +static char __pyx_k_uniques[] = "uniques"; +static char __pyx_k_version[] = "__version__"; +static char __pyx_k_Ellipsis[] = "Ellipsis"; +static char __pyx_k_TYPE_MAP[] = "_TYPE_MAP"; +static char __pyx_k_as_array[] = "as_array"; +static char __pyx_k_as_slice[] = "as_slice"; +static char __pyx_k_datetime[] = "datetime"; +static char __pyx_k_dayfirst[] = "dayfirst"; +static char __pyx_k_fast_zip[] = "fast_zip"; +static char __pyx_k_finished[] = "finished"; +static char __pyx_k_float128[] = "float128"; +static char __pyx_k_floating[] = "floating"; +static char __pyx_k_ind_step[] = "ind_step"; +static char __pyx_k_ind_stop[] = "ind_stop"; +static char __pyx_k_is_float[] = "is_float"; +static char __pyx_k_ismember[] = "ismember"; +static char __pyx_k_isscalar[] = "isscalar"; +static char __pyx_k_itemsize[] = "itemsize"; +static char __pyx_k_na_count[] = "na_count"; +static char __pyx_k_ndarrays[] = "ndarrays"; +static char __pyx_k_object_2[] = "object_"; +static char __pyx_k_operator[] = "operator"; +static char __pyx_k_property[] = "property"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_res_view[] = "res_view"; +static char __pyx_k_seen_int[] = "seen_int"; +static char __pyx_k_set_axis[] = "_set_axis"; +static char __pyx_k_string_2[] = "string_"; +static char __pyx_k_strptime[] = "strptime"; +static char __pyx_k_val_kind[] = "val_kind"; +static char __pyx_k_val_name[] = "val_name"; +static char __pyx_k_values_2[] = "_values"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_Timestamp[] = "Timestamp"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_complexes[] = "complexes"; +static char __pyx_k_converted[] = "converted"; +static char __pyx_k_cur_blkno[] = "cur_blkno"; +static char __pyx_k_datetimes[] = "datetimes"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_ind_start[] = "ind_start"; +static char __pyx_k_is_period[] = "is_period"; +static char __pyx_k_isnullobj[] = "isnullobj"; +static char __pyx_k_map_infer[] = "map_infer"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_na_values[] = "na_values"; +static char __pyx_k_nat_count[] = "nat_count"; +static char __pyx_k_new_dtype[] = "new_dtype"; +static char __pyx_k_seen_bool[] = "seen_bool"; +static char __pyx_k_seen_null[] = "seen_null"; +static char __pyx_k_take_last[] = "take_last"; +static char __pyx_k_timedelta[] = "timedelta"; +static char __pyx_k_toordinal[] = "toordinal"; +static char __pyx_k_true_vals[] = "true_vals"; +static char __pyx_k_try_float[] = "try_float"; +static char __pyx_k_unicode_2[] = "unicode_"; +static char __pyx_k_vec_binop[] = "vec_binop"; +static char __pyx_k_writerows[] = "writerows"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_Int64Index[] = "Int64Index"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_all_arrays[] = "all_arrays"; +static char __pyx_k_complex128[] = "complex128"; +static char __pyx_k_complex256[] = "complex256"; +static char __pyx_k_contiguous[] = "contiguous"; +static char __pyx_k_data_index[] = "data_index"; +static char __pyx_k_datetime64[] = "datetime64"; +static char __pyx_k_duplicated[] = "duplicated"; +static char __pyx_k_false_vals[] = "false_vals"; +static char __pyx_k_fill_value[] = "fill_value"; +static char __pyx_k_float_secs[] = "float_secs"; +static char __pyx_k_get_result[] = "get_result"; +static char __pyx_k_get_values[] = "get_values"; +static char __pyx_k_group_dict[] = "group_dict"; +static char __pyx_k_group_size[] = "group_size"; +static char __pyx_k_idatetimes[] = "idatetimes"; +static char __pyx_k_is_complex[] = "is_complex"; +static char __pyx_k_is_integer[] = "is_integer"; +static char __pyx_k_item_cache[] = "_item_cache"; +static char __pyx_k_null_count[] = "null_count"; +static char __pyx_k_pandas_lib[] = "pandas.lib"; +static char __pyx_k_parse_date[] = "parse_date"; +static char __pyx_k_parse_time[] = "parse_time"; +static char __pyx_k_pydatetime[] = "pydatetime"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_seen_float[] = "seen_float"; +static char __pyx_k_set_length[] = "set_length"; +static char __pyx_k_timedeltas[] = "timedeltas"; +static char __pyx_k_ImportError[] = "ImportError"; +static char __pyx_k_MemoryError[] = "MemoryError"; +static char __pyx_k_check_dummy[] = "_check_dummy"; +static char __pyx_k_concatenate[] = "concatenate"; +static char __pyx_k_date_parser[] = "date_parser"; +static char __pyx_k_fast_unique[] = "fast_unique"; +static char __pyx_k_group_count[] = "group_count"; +static char __pyx_k_group_order[] = "group_order"; +static char __pyx_k_has_infs_f4[] = "has_infs_f4"; +static char __pyx_k_has_infs_f8[] = "has_infs_f8"; +static char __pyx_k_infer_dtype[] = "infer_dtype"; +static char __pyx_k_is_datelike[] = "is_datelike"; +static char __pyx_k_isnullobj2d[] = "isnullobj2d"; +static char __pyx_k_itimedeltas[] = "itimedeltas"; +static char __pyx_k_microsecond[] = "microsecond"; +static char __pyx_k_pandas_null[] = "pandas_null"; +static char __pyx_k_rev_indexer[] = "rev_indexer"; +static char __pyx_k_seen_object[] = "seen_object"; +static char __pyx_k_time_parser[] = "time_parser"; +static char __pyx_k_timedelta64[] = "timedelta64"; +static char __pyx_k_true_values[] = "true_values"; +static char __pyx_k_vec_compare[] = "vec_compare"; +static char __pyx_k_InvalidApply[] = "InvalidApply"; +static char __pyx_k_LooseVersion[] = "LooseVersion"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_c_contiguous[] = "c_contiguous"; +static char __pyx_k_f_contiguous[] = "f_contiguous"; +static char __pyx_k_false_values[] = "false_values"; +static char __pyx_k_group_slices[] = "group_slices"; +static char __pyx_k_indices_fast[] = "indices_fast"; +static char __pyx_k_is_lexsorted[] = "is_lexsorted"; +static char __pyx_k_item_cache_2[] = "item_cache"; +static char __pyx_k_requirements[] = "requirements"; +static char __pyx_k_right_closed[] = "right_closed"; +static char __pyx_k_scalar_binop[] = "scalar_binop"; +static char __pyx_k_seen_complex[] = "seen_complex"; +static char __pyx_k_seen_numeric[] = "seen_numeric"; +static char __pyx_k_shape_before[] = "shape_before"; +static char __pyx_k_OverflowError[] = "OverflowError"; +static char __pyx_k_allow_setting[] = "allow_setting"; +static char __pyx_k_clear_mapping[] = "clear_mapping"; +static char __pyx_k_convert_empty[] = "convert_empty"; +static char __pyx_k_datetime64_ns[] = "datetime64[ns]"; +static char __pyx_k_fast_multiget[] = "fast_multiget"; +static char __pyx_k_fromtimestamp[] = "fromtimestamp"; +static char __pyx_k_is_bool_array[] = "is_bool_array"; +static char __pyx_k_is_date_array[] = "is_date_array"; +static char __pyx_k_is_slice_like[] = "is_slice_like"; +static char __pyx_k_is_time_array[] = "is_time_array"; +static char __pyx_k_ismember_nans[] = "ismember_nans"; +static char __pyx_k_isnullobj_old[] = "isnullobj_old"; +static char __pyx_k_lookup_values[] = "lookup_values"; +static char __pyx_k_mixed_integer[] = "mixed-integer"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_seen_datetime[] = "seen_datetime"; +static char __pyx_k_slice_getitem[] = "slice_getitem"; +static char __pyx_k_sorted_labels[] = "sorted_labels"; +static char __pyx_k_AttributeError[] = "AttributeError"; +static char __pyx_k_Not_slice_like[] = "Not slice-like"; +static char __pyx_k_astype_intsafe[] = "astype_intsafe"; +static char __pyx_k_coerce_numeric[] = "coerce_numeric"; +static char __pyx_k_count_level_1d[] = "count_level_1d"; +static char __pyx_k_count_level_2d[] = "count_level_2d"; +static char __pyx_k_dicts_to_array[] = "dicts_to_array"; +static char __pyx_k_is_float_array[] = "is_float_array"; +static char __pyx_k_list_of_arrays[] = "list_of_arrays"; +static char __pyx_k_map_infer_mask[] = "map_infer_mask"; +static char __pyx_k_scalar_compare[] = "scalar_compare"; +static char __pyx_k_seen_timedelta[] = "seen_timedelta"; +static char __pyx_k_timedelta64_ns[] = "timedelta64[ns]"; +static char __pyx_k_write_csv_rows[] = "write_csv_rows"; +static char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static char __pyx_k_dateutil_parser[] = "dateutil.parser"; +static char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static char __pyx_k_fast_zip_fillna[] = "fast_zip_fillna"; +static char __pyx_k_generate_slices[] = "generate_slices"; +static char __pyx_k_is_period_array[] = "is_period_array"; +static char __pyx_k_is_string_array[] = "is_string_array"; +static char __pyx_k_isnullobj2d_old[] = "isnullobj2d_old"; +static char __pyx_k_row_bool_subset[] = "row_bool_subset"; +static char __pyx_k_to_object_array[] = "to_object_array"; +static char __pyx_k_try_parse_dates[] = "try_parse_dates"; +static char __pyx_k_unbounded_slice[] = "unbounded slice"; +static char __pyx_k_clean_index_list[] = "clean_index_list"; +static char __pyx_k_convert_datetime[] = "convert_datetime"; +static char __pyx_k_get_result_array[] = "_get_result_array"; +static char __pyx_k_infer_dtype_list[] = "infer_dtype_list"; +static char __pyx_k_is_integer_array[] = "is_integer_array"; +static char __pyx_k_is_unicode_array[] = "is_unicode_array"; +static char __pyx_k_repr_timedelta64[] = "repr_timedelta64"; +static char __pyx_k_sanitize_objects[] = "sanitize_objects"; +static char __pyx_k_utcfromtimestamp[] = "utcfromtimestamp"; +static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s"; +static char __pyx_k_apply_frame_axis0[] = "apply_frame_axis0"; +static char __pyx_k_convert_timedelta[] = "convert_timedelta"; +static char __pyx_k_distutils_version[] = "distutils.version"; +static char __pyx_k_is_datetime_array[] = "is_datetime_array"; +static char __pyx_k_pandas_core_index[] = "pandas.core.index"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_slc_must_be_slice[] = "slc must be slice"; +static char __pyx_k_array_to_timestamp[] = "array_to_timestamp"; +static char __pyx_k_convert_sql_column[] = "convert_sql_column"; +static char __pyx_k_convert_timestamps[] = "convert_timestamps"; +static char __pyx_k_generate_bins_dt64[] = "generate_bins_dt64"; +static char __pyx_k_get_blkno_indexers[] = "get_blkno_indexers"; +static char __pyx_k_is_timedelta_array[] = "is_timedelta_array"; +static char __pyx_k_maybe_convert_bool[] = "maybe_convert_bool"; +static char __pyx_k_strided_and_direct[] = ""; +static char __pyx_k_time64_to_datetime[] = "time64_to_datetime"; +static char __pyx_k_values_from_object[] = "values_from_object"; +static char __pyx_k_Cannot_use_shortcut[] = "Cannot use shortcut"; +static char __pyx_k_get_reverse_indexer[] = "get_reverse_indexer"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_is_datetime64_array[] = "is_datetime64_array"; +static char __pyx_k_mixed_integer_float[] = "mixed-integer-float"; +static char __pyx_k_fast_unique_multiple[] = "fast_unique_multiple"; +static char __pyx_k_is_numpy_prior_1_6_2[] = "is_numpy_prior_1_6_2"; +static char __pyx_k_is_timedelta64_array[] = "is_timedelta64_array"; +static char __pyx_k_list_to_object_array[] = "list_to_object_array"; +static char __pyx_k_max_len_string_array[] = "max_len_string_array"; +static char __pyx_k_strided_and_indirect[] = ""; +static char __pyx_k_vals_must_be_ndarray[] = "vals must be ndarray"; +static char __pyx_k_Unrecognized_operator[] = "Unrecognized operator"; +static char __pyx_k_contiguous_and_direct[] = ""; +static char __pyx_k_has_complex_internals[] = "_has_complex_internals"; +static char __pyx_k_maybe_convert_numeric[] = "maybe_convert_numeric"; +static char __pyx_k_maybe_convert_objects[] = "maybe_convert_objects"; +static char __pyx_k_pandas_src_reduce_pyx[] = "pandas/src/reduce.pyx"; +static char __pyx_k_pandas_tseries_period[] = "pandas.tseries.period"; +static char __pyx_k_slc_should_be_a_slice[] = "slc should be a slice"; +static char __pyx_k_MemoryView_of_r_object[] = ""; +static char __pyx_k_is_integer_float_array[] = "is_integer_float_array"; +static char __pyx_k_maybe_indices_to_slice[] = "maybe_indices_to_slice"; +static char __pyx_k_row_bool_subset_object[] = "row_bool_subset_object"; +static char __pyx_k_to_object_array_tuples[] = "to_object_array_tuples"; +static char __pyx_k_tuples_to_object_array[] = "tuples_to_object_array"; +static char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static char __pyx_k_cannot_set_values_for_s[] = "cannot set values for [%s]"; +static char __pyx_k_contiguous_and_indirect[] = ""; +static char __pyx_k_maybe_booleans_to_slice[] = "maybe_booleans_to_slice"; +static char __pyx_k_try_parse_date_and_time[] = "try_parse_date_and_time"; +static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static char __pyx_k_Empty_string_encountered[] = "Empty string encountered"; +static char __pyx_k_function_does_not_reduce[] = "function does not reduce"; +static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)"; +static char __pyx_k_pandas_src_inference_pyx[] = "pandas/src/inference.pyx"; +static char __pyx_k_try_parse_year_month_day[] = "try_parse_year_month_day"; +static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct"; +static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static char __pyx_k_fast_unique_multiple_list[] = "fast_unique_multiple_list"; +static char __pyx_k_iadd_causes_length_change[] = "iadd causes length change"; +static char __pyx_k_slice_step_cannot_be_zero[] = "slice step cannot be zero"; +static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)"; +static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)"; +static char __pyx_k_Values_falls_after_last_bin[] = "Values falls after last bin"; +static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_Dummy_array_must_be_length_d[] = "Dummy array must be length %d"; +static char __pyx_k_Let_this_error_raise_above_us[] = "Let this error raise above us"; +static char __pyx_k_Values_falls_before_first_bin[] = "Values falls before first bin"; +static char __pyx_k_fast_unique_multiple_list_gen[] = "fast_unique_multiple_list_gen"; +static char __pyx_k_try_parse_dates_locals_lambda[] = "try_parse_dates.."; +static char __pyx_k_try_parse_datetime_components[] = "try_parse_datetime_components"; +static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static char __pyx_k_Dummy_array_must_be_same_dtype[] = "Dummy array must be same dtype"; +static char __pyx_k_Function_unsafe_for_fast_apply[] = "Function unsafe for fast apply"; +static char __pyx_k_all_arrays_must_be_same_length[] = "all arrays must be same length"; +static char __pyx_k_is_possible_datetimelike_array[] = "is_possible_datetimelike_array"; +static char __pyx_k_strided_and_direct_or_indirect[] = ""; +static char __pyx_k_Arrays_were_different_lengths_d[] = "Arrays were different lengths: %d vs %d"; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/lib.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; +static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static char __pyx_k_Cannot_modify_frame_index_intern[] = "Cannot modify frame index internals"; +static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions"; +static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static char __pyx_k_Invalid_length_for_values_or_for[] = "Invalid length for values or for binner"; +static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static char __pyx_k_Length_of_all_datetime_component[] = "Length of all datetime components must be equal"; +static char __pyx_k_Length_of_dates_and_times_must_b[] = "Length of dates and times must be equal"; +static char __pyx_k_Length_of_years_months_days_must[] = "Length of years/months/days must all be equal"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static char __pyx_k_is_timedelta_or_timedelta64_arra[] = "is_timedelta_or_timedelta64_array"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_string_array_replace_from_nan_re[] = "string_array_replace_from_nan_rep"; +static char __pyx_k_try_parse_date_and_time_locals_l[] = "try_parse_date_and_time.."; +static char __pyx_k_try_parse_date_and_time_locals_p[] = "try_parse_date_and_time..parse_date"; +static char __pyx_k_try_parse_dates_locals_parse_dat[] = "try_parse_dates..parse_date"; +static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static char __pyx_k_try_parse_date_and_time_locals_p_2[] = "try_parse_date_and_time..parse_time"; +static PyObject *__pyx_kp_s_1_6_2; +static PyObject *__pyx_kp_s_Arrays_were_different_lengths_d; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_n_s_C; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_kp_s_Cannot_modify_frame_index_intern; +static PyObject *__pyx_kp_s_Cannot_use_shortcut; +static PyObject *__pyx_kp_s_Dummy_array_must_be_length_d; +static PyObject *__pyx_kp_s_Dummy_array_must_be_same_dtype; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_kp_s_Empty_string_encountered; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_F; +static PyObject *__pyx_n_s_FALSE; +static PyObject *__pyx_n_s_False; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_kp_s_Function_unsafe_for_fast_apply; +static PyObject *__pyx_kp_s_H_M_S; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_n_s_Int64Index; +static PyObject *__pyx_n_s_InvalidApply; +static PyObject *__pyx_kp_s_Invalid_length_for_values_or_for; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_kp_s_Length_of_all_datetime_component; +static PyObject *__pyx_kp_s_Length_of_dates_and_times_must_b; +static PyObject *__pyx_kp_s_Length_of_years_months_days_must; +static PyObject *__pyx_kp_s_Let_this_error_raise_above_us; +static PyObject *__pyx_n_s_LooseVersion; +static PyObject *__pyx_n_s_M; +static PyObject *__pyx_kp_s_M8_ns; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_N; +static PyObject *__pyx_n_s_NaN; +static PyObject *__pyx_n_s_NaT; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_kp_s_Not_slice_like; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_n_s_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_OverflowError; +static PyObject *__pyx_n_s_Period; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_S; +static PyObject *__pyx_n_s_TRUE; +static PyObject *__pyx_n_s_TYPE_MAP; +static PyObject *__pyx_n_s_Timestamp; +static PyObject *__pyx_n_s_True; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_U; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_kp_s_Unable_to_parse_s; +static PyObject *__pyx_kp_s_Unrecognized_operator; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s_Values_falls_after_last_bin; +static PyObject *__pyx_kp_s_Values_falls_before_first_bin; +static PyObject *__pyx_n_s_W; +static PyObject *__pyx_kp_s__46; +static PyObject *__pyx_kp_s__49; +static PyObject *__pyx_n_s_add; +static PyObject *__pyx_n_s_advance; +static PyObject *__pyx_n_s_all_arrays; +static PyObject *__pyx_kp_s_all_arrays_must_be_same_length; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_allow_setting; +static PyObject *__pyx_n_s_any; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_apply_frame_axis0; +static PyObject *__pyx_n_s_arange; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_arobj; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_array_to_timestamp; +static PyObject *__pyx_n_s_arrays; +static PyObject *__pyx_n_s_arrmap; +static PyObject *__pyx_n_s_as_array; +static PyObject *__pyx_n_s_as_slice; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_astype_intsafe; +static PyObject *__pyx_n_s_axes; +static PyObject *__pyx_n_s_axis; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_bc; +static PyObject *__pyx_n_s_binner; +static PyObject *__pyx_n_s_bins; +static PyObject *__pyx_n_s_blkno; +static PyObject *__pyx_n_s_blknos; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_blocks; +static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_bool_2; +static PyObject *__pyx_n_s_boolean; +static PyObject *__pyx_n_s_bools; +static PyObject *__pyx_n_s_buf; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_c16; +static PyObject *__pyx_n_s_c_contiguous; +static PyObject *__pyx_n_s_cache; +static PyObject *__pyx_n_s_cache_2; +static PyObject *__pyx_kp_s_cannot_set_values_for_s; +static PyObject *__pyx_n_s_check_dummy; +static PyObject *__pyx_n_s_chunk; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_clean_index_list; +static PyObject *__pyx_n_s_clear_mapping; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_closed; +static PyObject *__pyx_n_s_coerce_numeric; +static PyObject *__pyx_n_s_col; +static PyObject *__pyx_n_s_cols; +static PyObject *__pyx_n_s_columns; +static PyObject *__pyx_n_s_complex; +static PyObject *__pyx_n_s_complex128; +static PyObject *__pyx_n_s_complex256; +static PyObject *__pyx_n_s_complexes; +static PyObject *__pyx_n_s_concatenate; +static PyObject *__pyx_n_s_contiguous; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_convert; +static PyObject *__pyx_n_s_convert_datetime; +static PyObject *__pyx_n_s_convert_empty; +static PyObject *__pyx_n_s_convert_sql_column; +static PyObject *__pyx_n_s_convert_timedelta; +static PyObject *__pyx_n_s_convert_timestamps; +static PyObject *__pyx_n_s_converted; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_count_level_1d; +static PyObject *__pyx_n_s_count_level_2d; +static PyObject *__pyx_n_s_counts; +static PyObject *__pyx_n_s_cur; +static PyObject *__pyx_n_s_cur_blkno; +static PyObject *__pyx_n_s_d; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_data_2; +static PyObject *__pyx_n_s_data_index; +static PyObject *__pyx_n_s_date; +static PyObject *__pyx_n_s_date_parser; +static PyObject *__pyx_n_s_dates; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_datetime64; +static PyObject *__pyx_kp_s_datetime64_ns; +static PyObject *__pyx_n_s_datetimes; +static PyObject *__pyx_n_s_dateutil_parser; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_dayfirst; +static PyObject *__pyx_n_s_days; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_n_s_delete; +static PyObject *__pyx_n_s_dicts; +static PyObject *__pyx_n_s_dicts_to_array; +static PyObject *__pyx_n_s_diff; +static PyObject *__pyx_n_s_distutils_version; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_doc_2; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_dummy; +static PyObject *__pyx_n_s_duplicated; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_ends; +static PyObject *__pyx_n_s_engine; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_eq; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_f8; +static PyObject *__pyx_n_s_f_contiguous; +static PyObject *__pyx_n_s_false; +static PyObject *__pyx_n_s_false_vals; +static PyObject *__pyx_n_s_false_values; +static PyObject *__pyx_n_s_fast_multiget; +static PyObject *__pyx_n_s_fast_unique; +static PyObject *__pyx_n_s_fast_unique_multiple; +static PyObject *__pyx_n_s_fast_unique_multiple_list; +static PyObject *__pyx_n_s_fast_unique_multiple_list_gen; +static PyObject *__pyx_n_s_fast_zip; +static PyObject *__pyx_n_s_fast_zip_fillna; +static PyObject *__pyx_n_s_fill; +static PyObject *__pyx_n_s_fill_value; +static PyObject *__pyx_n_s_finished; +static PyObject *__pyx_n_s_flag; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float128; +static PyObject *__pyx_n_s_float16; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_float_secs; +static PyObject *__pyx_n_s_floating; +static PyObject *__pyx_n_s_floats; +static PyObject *__pyx_n_s_fnan; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_frame; +static PyObject *__pyx_n_s_fromtimestamp; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_kp_s_function_does_not_reduce; +static PyObject *__pyx_n_s_fval; +static PyObject *__pyx_n_s_ge; +static PyObject *__pyx_n_s_gen; +static PyObject *__pyx_n_s_generate_bins_dt64; +static PyObject *__pyx_n_s_generate_slices; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_get_blkno_indexers; +static PyObject *__pyx_n_s_get_result; +static PyObject *__pyx_n_s_get_result_array; +static PyObject *__pyx_n_s_get_reverse_indexer; +static PyObject *__pyx_n_s_get_values; +static PyObject *__pyx_n_s_gin; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_group; +static PyObject *__pyx_n_s_group_count; +static PyObject *__pyx_n_s_group_dict; +static PyObject *__pyx_n_s_group_order; +static PyObject *__pyx_n_s_group_size; +static PyObject *__pyx_n_s_group_slices; +static PyObject *__pyx_n_s_gt; +static PyObject *__pyx_n_s_has_complex_internals; +static PyObject *__pyx_n_s_has_infs_f4; +static PyObject *__pyx_n_s_has_infs_f8; +static PyObject *__pyx_n_s_hasnans; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_hours; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_i8; +static PyObject *__pyx_n_s_iNaT; +static PyObject *__pyx_kp_s_iadd_causes_length_change; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_idatetimes; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_ind; +static PyObject *__pyx_n_s_ind_len; +static PyObject *__pyx_n_s_ind_start; +static PyObject *__pyx_n_s_ind_step; +static PyObject *__pyx_n_s_ind_stop; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_n_s_index_2; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_indexer; +static PyObject *__pyx_n_s_indices; +static PyObject *__pyx_n_s_indices_fast; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_infer_dtype; +static PyObject *__pyx_n_s_infer_dtype_list; +static PyObject *__pyx_n_s_insert; +static PyObject *__pyx_n_s_int16; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_integer; +static PyObject *__pyx_n_s_ints; +static PyObject *__pyx_n_s_is_bool; +static PyObject *__pyx_n_s_is_bool_array; +static PyObject *__pyx_n_s_is_complex; +static PyObject *__pyx_n_s_is_date_array; +static PyObject *__pyx_n_s_is_datelike; +static PyObject *__pyx_n_s_is_datetime64_array; +static PyObject *__pyx_n_s_is_datetime_array; +static PyObject *__pyx_n_s_is_float; +static PyObject *__pyx_n_s_is_float_array; +static PyObject *__pyx_n_s_is_integer; +static PyObject *__pyx_n_s_is_integer_array; +static PyObject *__pyx_n_s_is_integer_float_array; +static PyObject *__pyx_n_s_is_lexsorted; +static PyObject *__pyx_n_s_is_numpy_prior_1_6_2; +static PyObject *__pyx_n_s_is_period; +static PyObject *__pyx_n_s_is_period_array; +static PyObject *__pyx_n_s_is_possible_datetimelike_array; +static PyObject *__pyx_n_s_is_slice_like; +static PyObject *__pyx_n_s_is_string_array; +static PyObject *__pyx_n_s_is_time_array; +static PyObject *__pyx_n_s_is_timedelta64_array; +static PyObject *__pyx_n_s_is_timedelta_array; +static PyObject *__pyx_n_s_is_timedelta_or_timedelta64_arra; +static PyObject *__pyx_n_s_is_unicode_array; +static PyObject *__pyx_n_s_isin; +static PyObject *__pyx_n_s_ismember; +static PyObject *__pyx_n_s_ismember_nans; +static PyObject *__pyx_n_s_isnan; +static PyObject *__pyx_n_s_isnullobj; +static PyObject *__pyx_n_s_isnullobj2d; +static PyObject *__pyx_n_s_isnullobj2d_old; +static PyObject *__pyx_n_s_isnullobj_old; +static PyObject *__pyx_n_s_isscalar; +static PyObject *__pyx_n_s_it; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_item_cache; +static PyObject *__pyx_n_s_item_cache_2; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_itimedeltas; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_kind; +static PyObject *__pyx_n_s_l; +static PyObject *__pyx_n_s_l_bin; +static PyObject *__pyx_n_s_lab; +static PyObject *__pyx_n_s_labels; +static PyObject *__pyx_n_s_le; +static PyObject *__pyx_n_s_left; +static PyObject *__pyx_n_s_len; +static PyObject *__pyx_n_s_lenbin; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_lenidx; +static PyObject *__pyx_n_s_list_of_arrays; +static PyObject *__pyx_n_s_list_to_object_array; +static PyObject *__pyx_n_s_lists; +static PyObject *__pyx_n_s_lookup_values; +static PyObject *__pyx_n_s_lt; +static PyObject *__pyx_n_s_m; +static PyObject *__pyx_kp_s_m8_ns; +static PyObject *__pyx_kp_s_m_d_Y; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_map_infer; +static PyObject *__pyx_n_s_map_infer_mask; +static PyObject *__pyx_n_s_mapping; +static PyObject *__pyx_n_s_mask; +static PyObject *__pyx_n_s_max_bin; +static PyObject *__pyx_n_s_max_len_string_array; +static PyObject *__pyx_n_s_maybe_booleans_to_slice; +static PyObject *__pyx_n_s_maybe_convert_bool; +static PyObject *__pyx_n_s_maybe_convert_numeric; +static PyObject *__pyx_n_s_maybe_convert_objects; +static PyObject *__pyx_n_s_maybe_indices_to_slice; +static PyObject *__pyx_n_s_memo; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_micros; +static PyObject *__pyx_n_s_microsecond; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_minutes; +static PyObject *__pyx_n_s_mixed; +static PyObject *__pyx_kp_s_mixed_integer; +static PyObject *__pyx_kp_s_mixed_integer_float; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_months; +static PyObject *__pyx_n_s_move; +static PyObject *__pyx_n_s_mutated; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_na_count; +static PyObject *__pyx_n_s_na_values; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_names; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_n_s_nan_rep; +static PyObject *__pyx_n_s_nat_count; +static PyObject *__pyx_n_s_ncols; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndarrays; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_ne; +static PyObject *__pyx_n_s_neginf; +static PyObject *__pyx_n_s_new_dtype; +static PyObject *__pyx_n_s_ngroups; +static PyObject *__pyx_n_s_nlevels; +static PyObject *__pyx_n_s_now; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_ns; +static PyObject *__pyx_n_s_null_count; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_o; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_objbuf; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_object_2; +static PyObject *__pyx_n_s_objects; +static PyObject *__pyx_n_s_objlen; +static PyObject *__pyx_n_s_onan; +static PyObject *__pyx_n_s_op; +static PyObject *__pyx_n_s_operator; +static PyObject *__pyx_n_s_out; +static PyObject *__pyx_n_s_output; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_pandas_core_index; +static PyObject *__pyx_n_s_pandas_lib; +static PyObject *__pyx_n_s_pandas_null; +static PyObject *__pyx_kp_s_pandas_src_inference_pyx; +static PyObject *__pyx_kp_s_pandas_src_reduce_pyx; +static PyObject *__pyx_n_s_pandas_tseries_period; +static PyObject *__pyx_n_s_parse; +static PyObject *__pyx_n_s_parse_date; +static PyObject *__pyx_n_s_parse_time; +static PyObject *__pyx_n_s_parser; +static PyObject *__pyx_n_s_period; +static PyObject *__pyx_n_s_piece; +static PyObject *__pyx_n_s_pos; +static PyObject *__pyx_n_s_pre; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_property; +static PyObject *__pyx_n_s_putmask; +static PyObject *__pyx_n_s_pydate; +static PyObject *__pyx_n_s_pydatetime; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_r_bin; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_ravel; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reducer; +static PyObject *__pyx_n_s_replace; +static PyObject *__pyx_n_s_repr_timedelta64; +static PyObject *__pyx_n_s_require; +static PyObject *__pyx_n_s_requirements; +static PyObject *__pyx_n_s_res_view; +static PyObject *__pyx_n_s_reset; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_results; +static PyObject *__pyx_n_s_rev_indexer; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_right_closed; +static PyObject *__pyx_n_s_row; +static PyObject *__pyx_n_s_row_bool_subset; +static PyObject *__pyx_n_s_row_bool_subset_object; +static PyObject *__pyx_n_s_rows; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_n_s_s_len; +static PyObject *__pyx_kp_s_s_r; +static PyObject *__pyx_n_s_s_start; +static PyObject *__pyx_n_s_s_step; +static PyObject *__pyx_n_s_s_stop; +static PyObject *__pyx_n_s_safe; +static PyObject *__pyx_n_s_sanitize_objects; +static PyObject *__pyx_n_s_scalar_binop; +static PyObject *__pyx_n_s_scalar_compare; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_seconds; +static PyObject *__pyx_n_s_secs; +static PyObject *__pyx_n_s_seen; +static PyObject *__pyx_n_s_seen_bool; +static PyObject *__pyx_n_s_seen_complex; +static PyObject *__pyx_n_s_seen_datetime; +static PyObject *__pyx_n_s_seen_float; +static PyObject *__pyx_n_s_seen_int; +static PyObject *__pyx_n_s_seen_null; +static PyObject *__pyx_n_s_seen_numeric; +static PyObject *__pyx_n_s_seen_object; +static PyObject *__pyx_n_s_seen_timedelta; +static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_series; +static PyObject *__pyx_n_s_set_axis; +static PyObject *__pyx_n_s_set_length; +static PyObject *__pyx_n_s_setattr; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_shape_before; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_slc; +static PyObject *__pyx_kp_s_slc_must_be_slice; +static PyObject *__pyx_kp_s_slc_should_be_a_slice; +static PyObject *__pyx_n_s_slice_getitem; +static PyObject *__pyx_kp_s_slice_step_cannot_be_zero; +static PyObject *__pyx_n_s_slices; +static PyObject *__pyx_n_s_slider; +static PyObject *__pyx_n_s_slobj; +static PyObject *__pyx_n_s_sorted_labels; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_started; +static PyObject *__pyx_n_s_starts; +static PyObject *__pyx_n_s_status; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_n_s_strides; +static PyObject *__pyx_n_s_string; +static PyObject *__pyx_n_s_string_2; +static PyObject *__pyx_n_s_string_array_replace_from_nan_re; +static PyObject *__pyx_n_s_strptime; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_stub; +static PyObject *__pyx_n_s_sum; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_table; +static PyObject *__pyx_n_s_take_last; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_time64_to_datetime; +static PyObject *__pyx_n_s_time_parser; +static PyObject *__pyx_n_s_timedelta; +static PyObject *__pyx_n_s_timedelta64; +static PyObject *__pyx_kp_s_timedelta64_ns; +static PyObject *__pyx_n_s_timedeltas; +static PyObject *__pyx_n_s_times; +static PyObject *__pyx_n_s_tmp; +static PyObject *__pyx_n_s_to_object_array; +static PyObject *__pyx_n_s_to_object_array_tuples; +static PyObject *__pyx_n_s_toordinal; +static PyObject *__pyx_n_s_tot_len; +static PyObject *__pyx_n_s_true; +static PyObject *__pyx_n_s_true_vals; +static PyObject *__pyx_n_s_true_values; +static PyObject *__pyx_n_s_try_float; +static PyObject *__pyx_n_s_try_parse_date_and_time; +static PyObject *__pyx_n_s_try_parse_date_and_time_locals_l; +static PyObject *__pyx_n_s_try_parse_date_and_time_locals_p; +static PyObject *__pyx_n_s_try_parse_date_and_time_locals_p_2; +static PyObject *__pyx_n_s_try_parse_dates; +static PyObject *__pyx_n_s_try_parse_dates_locals_lambda; +static PyObject *__pyx_n_s_try_parse_dates_locals_parse_dat; +static PyObject *__pyx_n_s_try_parse_datetime_components; +static PyObject *__pyx_n_s_try_parse_year_month_day; +static PyObject *__pyx_n_s_tslib; +static PyObject *__pyx_n_s_tup; +static PyObject *__pyx_n_s_tuples; +static PyObject *__pyx_n_s_tuples_to_object_array; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_u; +static PyObject *__pyx_n_s_u1; +static PyObject *__pyx_n_s_uint16; +static PyObject *__pyx_n_s_uint32; +static PyObject *__pyx_n_s_uint64; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_kp_s_unbounded_slice; +static PyObject *__pyx_n_s_unicode; +static PyObject *__pyx_n_s_unicode_2; +static PyObject *__pyx_n_s_uniques; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_utcfromtimestamp; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_val_kind; +static PyObject *__pyx_n_s_val_name; +static PyObject *__pyx_kp_s_vals_must_be_ndarray; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_values_2; +static PyObject *__pyx_n_s_values_from_object; +static PyObject *__pyx_n_s_vc; +static PyObject *__pyx_n_s_vec_binop; +static PyObject *__pyx_n_s_vec_compare; +static PyObject *__pyx_n_s_vecs; +static PyObject *__pyx_n_s_version; +static PyObject *__pyx_n_s_view; +static PyObject *__pyx_n_s_write_csv_rows; +static PyObject *__pyx_n_s_writer; +static PyObject *__pyx_n_s_writerows; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xrange; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_n_s_years; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_k__10; +static Py_ssize_t __pyx_k__17; +static Py_ssize_t __pyx_k__19; +static PyObject *__pyx_k__57; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__40; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__74; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__100; +static PyObject *__pyx_tuple__102; +static PyObject *__pyx_tuple__104; +static PyObject *__pyx_tuple__106; +static PyObject *__pyx_tuple__108; +static PyObject *__pyx_tuple__110; +static PyObject *__pyx_tuple__112; +static PyObject *__pyx_tuple__114; +static PyObject *__pyx_tuple__116; +static PyObject *__pyx_tuple__118; +static PyObject *__pyx_tuple__120; +static PyObject *__pyx_tuple__122; +static PyObject *__pyx_tuple__124; +static PyObject *__pyx_tuple__126; +static PyObject *__pyx_tuple__128; +static PyObject *__pyx_tuple__130; +static PyObject *__pyx_tuple__132; +static PyObject *__pyx_tuple__134; +static PyObject *__pyx_tuple__136; +static PyObject *__pyx_tuple__138; +static PyObject *__pyx_tuple__140; +static PyObject *__pyx_tuple__142; +static PyObject *__pyx_tuple__144; +static PyObject *__pyx_tuple__146; +static PyObject *__pyx_tuple__148; +static PyObject *__pyx_tuple__150; +static PyObject *__pyx_tuple__152; +static PyObject *__pyx_tuple__154; +static PyObject *__pyx_tuple__156; +static PyObject *__pyx_tuple__158; +static PyObject *__pyx_tuple__160; +static PyObject *__pyx_tuple__162; +static PyObject *__pyx_tuple__164; +static PyObject *__pyx_tuple__166; +static PyObject *__pyx_tuple__168; +static PyObject *__pyx_tuple__170; +static PyObject *__pyx_tuple__172; +static PyObject *__pyx_tuple__174; +static PyObject *__pyx_tuple__176; +static PyObject *__pyx_tuple__178; +static PyObject *__pyx_tuple__180; +static PyObject *__pyx_tuple__182; +static PyObject *__pyx_tuple__184; +static PyObject *__pyx_tuple__186; +static PyObject *__pyx_tuple__188; +static PyObject *__pyx_tuple__190; +static PyObject *__pyx_tuple__192; +static PyObject *__pyx_tuple__194; +static PyObject *__pyx_tuple__196; +static PyObject *__pyx_tuple__198; +static PyObject *__pyx_tuple__200; +static PyObject *__pyx_tuple__202; +static PyObject *__pyx_tuple__204; +static PyObject *__pyx_tuple__206; +static PyObject *__pyx_tuple__208; +static PyObject *__pyx_tuple__210; +static PyObject *__pyx_tuple__212; +static PyObject *__pyx_tuple__214; +static PyObject *__pyx_tuple__216; +static PyObject *__pyx_tuple__218; +static PyObject *__pyx_tuple__220; +static PyObject *__pyx_tuple__222; +static PyObject *__pyx_tuple__224; +static PyObject *__pyx_tuple__226; +static PyObject *__pyx_tuple__228; +static PyObject *__pyx_tuple__230; +static PyObject *__pyx_tuple__232; +static PyObject *__pyx_tuple__234; +static PyObject *__pyx_tuple__236; +static PyObject *__pyx_tuple__238; +static PyObject *__pyx_tuple__240; +static PyObject *__pyx_tuple__242; +static PyObject *__pyx_tuple__244; +static PyObject *__pyx_tuple__246; +static PyObject *__pyx_tuple__248; +static PyObject *__pyx_tuple__250; +static PyObject *__pyx_tuple__252; +static PyObject *__pyx_tuple__254; +static PyObject *__pyx_tuple__255; +static PyObject *__pyx_tuple__256; +static PyObject *__pyx_tuple__257; +static PyObject *__pyx_tuple__258; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__79; +static PyObject *__pyx_codeobj__81; +static PyObject *__pyx_codeobj__83; +static PyObject *__pyx_codeobj__85; +static PyObject *__pyx_codeobj__87; +static PyObject *__pyx_codeobj__89; +static PyObject *__pyx_codeobj__91; +static PyObject *__pyx_codeobj__93; +static PyObject *__pyx_codeobj__95; +static PyObject *__pyx_codeobj__97; +static PyObject *__pyx_codeobj__99; +static PyObject *__pyx_codeobj__101; +static PyObject *__pyx_codeobj__103; +static PyObject *__pyx_codeobj__105; +static PyObject *__pyx_codeobj__107; +static PyObject *__pyx_codeobj__109; +static PyObject *__pyx_codeobj__111; +static PyObject *__pyx_codeobj__113; +static PyObject *__pyx_codeobj__115; +static PyObject *__pyx_codeobj__117; +static PyObject *__pyx_codeobj__119; +static PyObject *__pyx_codeobj__121; +static PyObject *__pyx_codeobj__123; +static PyObject *__pyx_codeobj__125; +static PyObject *__pyx_codeobj__127; +static PyObject *__pyx_codeobj__129; +static PyObject *__pyx_codeobj__131; +static PyObject *__pyx_codeobj__133; +static PyObject *__pyx_codeobj__135; +static PyObject *__pyx_codeobj__137; +static PyObject *__pyx_codeobj__139; +static PyObject *__pyx_codeobj__141; +static PyObject *__pyx_codeobj__143; +static PyObject *__pyx_codeobj__145; +static PyObject *__pyx_codeobj__147; +static PyObject *__pyx_codeobj__149; +static PyObject *__pyx_codeobj__151; +static PyObject *__pyx_codeobj__153; +static PyObject *__pyx_codeobj__155; +static PyObject *__pyx_codeobj__157; +static PyObject *__pyx_codeobj__159; +static PyObject *__pyx_codeobj__161; +static PyObject *__pyx_codeobj__163; +static PyObject *__pyx_codeobj__165; +static PyObject *__pyx_codeobj__167; +static PyObject *__pyx_codeobj__169; +static PyObject *__pyx_codeobj__171; +static PyObject *__pyx_codeobj__173; +static PyObject *__pyx_codeobj__175; +static PyObject *__pyx_codeobj__177; +static PyObject *__pyx_codeobj__179; +static PyObject *__pyx_codeobj__181; +static PyObject *__pyx_codeobj__183; +static PyObject *__pyx_codeobj__185; +static PyObject *__pyx_codeobj__187; +static PyObject *__pyx_codeobj__189; +static PyObject *__pyx_codeobj__191; +static PyObject *__pyx_codeobj__193; +static PyObject *__pyx_codeobj__195; +static PyObject *__pyx_codeobj__197; +static PyObject *__pyx_codeobj__199; +static PyObject *__pyx_codeobj__201; +static PyObject *__pyx_codeobj__203; +static PyObject *__pyx_codeobj__205; +static PyObject *__pyx_codeobj__207; +static PyObject *__pyx_codeobj__209; +static PyObject *__pyx_codeobj__211; +static PyObject *__pyx_codeobj__213; +static PyObject *__pyx_codeobj__215; +static PyObject *__pyx_codeobj__217; +static PyObject *__pyx_codeobj__219; +static PyObject *__pyx_codeobj__221; +static PyObject *__pyx_codeobj__223; +static PyObject *__pyx_codeobj__225; +static PyObject *__pyx_codeobj__227; +static PyObject *__pyx_codeobj__229; +static PyObject *__pyx_codeobj__231; +static PyObject *__pyx_codeobj__233; +static PyObject *__pyx_codeobj__235; +static PyObject *__pyx_codeobj__237; +static PyObject *__pyx_codeobj__239; +static PyObject *__pyx_codeobj__241; +static PyObject *__pyx_codeobj__243; +static PyObject *__pyx_codeobj__245; +static PyObject *__pyx_codeobj__247; +static PyObject *__pyx_codeobj__249; +static PyObject *__pyx_codeobj__251; +static PyObject *__pyx_codeobj__253; + +/* "pandas/lib.pyx":75 + * import_ufunc() + * + * def values_from_object(object o): # <<<<<<<<<<<<<< + * """ return my values or the object if we are say an ndarray """ + * cdef f + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_1values_from_object(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/ +static char __pyx_doc_6pandas_3lib_values_from_object[] = " return my values or the object if we are say an ndarray "; +static PyMethodDef __pyx_mdef_6pandas_3lib_1values_from_object = {__Pyx_NAMESTR("values_from_object"), (PyCFunction)__pyx_pw_6pandas_3lib_1values_from_object, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_values_from_object)}; +static PyObject *__pyx_pw_6pandas_3lib_1values_from_object(PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("values_from_object (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_values_from_object(__pyx_self, ((PyObject *)__pyx_v_o)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_values_from_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_v_f = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("values_from_object", 0); + __Pyx_INCREF(__pyx_v_o); + + /* "pandas/lib.pyx":79 + * cdef f + * + * f = getattr(o, 'get_values', None) # <<<<<<<<<<<<<< + * if f is not None: + * o = f() + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_o, __pyx_n_s_get_values, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_f = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":80 + * + * f = getattr(o, 'get_values', None) + * if f is not None: # <<<<<<<<<<<<<< + * o = f() + * + */ + __pyx_t_2 = (__pyx_v_f != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":81 + * f = getattr(o, 'get_values', None) + * if f is not None: + * o = f() # <<<<<<<<<<<<<< + * + * return o + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_o, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":83 + * o = f() + * + * return o # <<<<<<<<<<<<<< + * + * cpdef map_indices_list(list index): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_o); + __pyx_r = __pyx_v_o; + goto __pyx_L0; + + /* "pandas/lib.pyx":75 + * import_ufunc() + * + * def values_from_object(object o): # <<<<<<<<<<<<<< + * """ return my values or the object if we are say an ndarray """ + * cdef f + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.values_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":85 + * return o + * + * cpdef map_indices_list(list index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + +static PyObject *__pyx_pw_6pandas_3lib_3map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_map_indices_list(PyObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_list", 0); + + /* "pandas/lib.pyx":96 + * ''' + * cdef Py_ssize_t i, length + * cdef dict result = {} # <<<<<<<<<<<<<< + * + * length = len(index) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":98 + * cdef dict result = {} + * + * length = len(index) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < length: + */ + if (unlikely(__pyx_v_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(__pyx_v_index); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_2; + + /* "pandas/lib.pyx":100 + * length = len(index) + * + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * result[index[i]] = i + * + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/lib.pyx":101 + * + * for i from 0 <= i < length: + * result[index[i]] = i # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_index, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_3, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/lib.pyx":103 + * result[index[i]] = i + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/lib.pyx":85 + * return o + * + * cpdef map_indices_list(list index): # <<<<<<<<<<<<<< + * ''' + * Produce a dict mapping the values of the input array to their respective + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.map_indices_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_3map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ +static char __pyx_doc_6pandas_3lib_2map_indices_list[] = "\n Produce a dict mapping the values of the input array to their respective\n locations.\n\n Example:\n array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n Better to do this with Cython because of the enormous speed boost.\n "; +static PyObject *__pyx_pw_6pandas_3lib_3map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_indices_list (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyList_Type), 1, "index", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_2map_indices_list(__pyx_self, ((PyObject*)__pyx_v_index)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_2map_indices_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_indices_list", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_map_indices_list(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.map_indices_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":109 + * + * + * def ismember_nans(float64_t[:] arr, set values, bint hasnans): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_5ismember_nans(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_5ismember_nans = {__Pyx_NAMESTR("ismember_nans"), (PyCFunction)__pyx_pw_6pandas_3lib_5ismember_nans, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_5ismember_nans(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_arr = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_values = 0; + int __pyx_v_hasnans; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ismember_nans (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_values,&__pyx_n_s_hasnans,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ismember_nans", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hasnans)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ismember_nans", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ismember_nans") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_arr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_arr.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_values = ((PyObject*)values[1]); + __pyx_v_hasnans = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_hasnans == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ismember_nans", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.ismember_nans", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PySet_Type), 1, "values", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_4ismember_nans(__pyx_self, __pyx_v_arr, __pyx_v_values, __pyx_v_hasnans); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_4ismember_nans(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_arr, PyObject *__pyx_v_values, int __pyx_v_hasnans) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_float64_t __pyx_v_val; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + __pyx_t_5numpy_uint8_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ismember_nans", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":115 + * float64_t val + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_arr, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":116 + * + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i in range(n): + * val = arr[i] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":117 + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * result[i] = val in values or hasnans and isnan(val) + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":118 + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * result[i] = val in values or hasnans and isnan(val) + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_v_arr.shape[0]; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_v_arr.shape[0])) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_arr.data + __pyx_t_13 * __pyx_v_arr.strides[0]) ))); + + /* "pandas/lib.pyx":119 + * for i in range(n): + * val = arr[i] + * result[i] = val in values or hasnans and isnan(val) # <<<<<<<<<<<<<< + * + * return result.view(np.bool_) + */ + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = (__Pyx_PySequence_Contains(__pyx_t_6, __pyx_v_values, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_14); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_14) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_hasnans); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_14) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_5 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_15 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_15 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + } + + /* "pandas/lib.pyx":121 + * result[i] = val in values or hasnans and isnan(val) + * + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":109 + * + * + * def ismember_nans(float64_t[:] arr, set values, bint hasnans): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.ismember_nans", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __PYX_XDEC_MEMVIEW(&__pyx_v_arr, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":124 + * + * + * def ismember(ndarray arr, set values): # <<<<<<<<<<<<<< + * ''' + * Checks whether + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_7ismember(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_6ismember[] = "\n Checks whether\n\n Parameters\n ----------\n arr : ndarray\n values : set\n\n Returns\n -------\n ismember : ndarray (boolean dtype)\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_7ismember = {__Pyx_NAMESTR("ismember"), (PyCFunction)__pyx_pw_6pandas_3lib_7ismember, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_6ismember)}; +static PyObject *__pyx_pw_6pandas_3lib_7ismember(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_values = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ismember (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_values,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ismember", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ismember") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_values = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ismember", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.ismember", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PySet_Type), 1, "values", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_6ismember(__pyx_self, __pyx_v_arr, __pyx_v_values); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_6ismember(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ismember", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":142 + * object val + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":143 + * + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i in range(n): + * val = util.get_value_at(arr, i) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":144 + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_at(arr, i) + * result[i] = val in values + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":145 + * result = np.empty(n, dtype=np.uint8) + * for i in range(n): + * val = util.get_value_at(arr, i) # <<<<<<<<<<<<<< + * result[i] = val in values + * + */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":146 + * for i in range(n): + * val = util.get_value_at(arr, i) + * result[i] = val in values # <<<<<<<<<<<<<< + * + * return result.view(np.bool_) + */ + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_values, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_13; + } + + /* "pandas/lib.pyx":148 + * result[i] = val in values + * + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":124 + * + * + * def ismember(ndarray arr, set values): # <<<<<<<<<<<<<< + * ''' + * Checks whether + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.ismember", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":157 + * from datetime import date as pydate + * + * cdef inline int64_t gmtime(object date): # <<<<<<<<<<<<<< + * cdef int y, m, d, h, mn, s, days + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_gmtime(PyObject *__pyx_v_date) { + int __pyx_v_y; + int __pyx_v_m; + int __pyx_v_d; + int __pyx_v_h; + int __pyx_v_mn; + int __pyx_v_s; + int __pyx_v_days; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("gmtime", 0); + + /* "pandas/lib.pyx":160 + * cdef int y, m, d, h, mn, s, days + * + * y = PyDateTime_GET_YEAR(date) # <<<<<<<<<<<<<< + * m = PyDateTime_GET_MONTH(date) + * d = PyDateTime_GET_DAY(date) + */ + if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_y = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_date)); + + /* "pandas/lib.pyx":161 + * + * y = PyDateTime_GET_YEAR(date) + * m = PyDateTime_GET_MONTH(date) # <<<<<<<<<<<<<< + * d = PyDateTime_GET_DAY(date) + * h = PyDateTime_DATE_GET_HOUR(date) + */ + if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_m = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_date)); + + /* "pandas/lib.pyx":162 + * y = PyDateTime_GET_YEAR(date) + * m = PyDateTime_GET_MONTH(date) + * d = PyDateTime_GET_DAY(date) # <<<<<<<<<<<<<< + * h = PyDateTime_DATE_GET_HOUR(date) + * mn = PyDateTime_DATE_GET_MINUTE(date) + */ + if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_d = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_date)); + + /* "pandas/lib.pyx":163 + * m = PyDateTime_GET_MONTH(date) + * d = PyDateTime_GET_DAY(date) + * h = PyDateTime_DATE_GET_HOUR(date) # <<<<<<<<<<<<<< + * mn = PyDateTime_DATE_GET_MINUTE(date) + * s = PyDateTime_DATE_GET_SECOND(date) + */ + __pyx_v_h = PyDateTime_DATE_GET_HOUR(__pyx_v_date); + + /* "pandas/lib.pyx":164 + * d = PyDateTime_GET_DAY(date) + * h = PyDateTime_DATE_GET_HOUR(date) + * mn = PyDateTime_DATE_GET_MINUTE(date) # <<<<<<<<<<<<<< + * s = PyDateTime_DATE_GET_SECOND(date) + * + */ + __pyx_v_mn = PyDateTime_DATE_GET_MINUTE(__pyx_v_date); + + /* "pandas/lib.pyx":165 + * h = PyDateTime_DATE_GET_HOUR(date) + * mn = PyDateTime_DATE_GET_MINUTE(date) + * s = PyDateTime_DATE_GET_SECOND(date) # <<<<<<<<<<<<<< + * + * days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1 + */ + __pyx_v_s = PyDateTime_DATE_GET_SECOND(__pyx_v_date); + + /* "pandas/lib.pyx":167 + * s = PyDateTime_DATE_GET_SECOND(date) + * + * days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1 # <<<<<<<<<<<<<< + * return (( (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000 + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_6pandas_3lib__EPOCH_ORD); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_d); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_days = __pyx_t_5; + + /* "pandas/lib.pyx":168 + * + * days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1 + * return (( (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000 # <<<<<<<<<<<<<< + * + * cpdef object to_datetime(int64_t timestamp): + */ + __pyx_r = (((((__pyx_t_5numpy_int64_t)((((__pyx_v_days * 24) + __pyx_v_h) * 60) + __pyx_v_mn)) * 60) + __pyx_v_s) * 1000); + goto __pyx_L0; + + /* "pandas/lib.pyx":157 + * from datetime import date as pydate + * + * cdef inline int64_t gmtime(object date): # <<<<<<<<<<<<<< + * cdef int y, m, d, h, mn, s, days + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.lib.gmtime", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":170 + * return (( (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000 + * + * cpdef object to_datetime(int64_t timestamp): # <<<<<<<<<<<<<< + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) + * + */ + +static PyObject *__pyx_pw_6pandas_3lib_9to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_timestamp, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_datetime", 0); + + /* "pandas/lib.pyx":171 + * + * cpdef object to_datetime(int64_t timestamp): + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) # <<<<<<<<<<<<<< + * + * cpdef object to_timestamp(object dt): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydatetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_utcfromtimestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_timestamp / 1000.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":170 + * return (( (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000 + * + * cpdef object to_datetime(int64_t timestamp): # <<<<<<<<<<<<<< + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_9to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_9to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp) { + __pyx_t_5numpy_int64_t __pyx_v_timestamp; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_datetime (wrapper)", 0); + assert(__pyx_arg_timestamp); { + __pyx_v_timestamp = __Pyx_PyInt_As_npy_int64(__pyx_arg_timestamp); if (unlikely((__pyx_v_timestamp == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_8to_datetime(__pyx_self, ((__pyx_t_5numpy_int64_t)__pyx_v_timestamp)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_8to_datetime(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_timestamp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_datetime", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_to_datetime(__pyx_v_timestamp, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":173 + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) + * + * cpdef object to_timestamp(object dt): # <<<<<<<<<<<<<< + * return gmtime(dt) + * + */ + +static PyObject *__pyx_pw_6pandas_3lib_11to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_to_timestamp(PyObject *__pyx_v_dt, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_timestamp", 0); + + /* "pandas/lib.pyx":174 + * + * cpdef object to_timestamp(object dt): + * return gmtime(dt) # <<<<<<<<<<<<<< + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_f_6pandas_3lib_gmtime(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":173 + * return pydatetime.utcfromtimestamp(timestamp / 1000.0) + * + * cpdef object to_timestamp(object dt): # <<<<<<<<<<<<<< + * return gmtime(dt) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_timestamp (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_10to_timestamp(__pyx_self, ((PyObject *)__pyx_v_dt)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_10to_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dt) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_timestamp", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_to_timestamp(__pyx_v_dt, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":176 + * return gmtime(dt) + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[int64_t, ndim=1] result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13array_to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_13array_to_timestamp = {__Pyx_NAMESTR("array_to_timestamp"), (PyCFunction)__pyx_pw_6pandas_3lib_13array_to_timestamp, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_13array_to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("array_to_timestamp (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_12array_to_timestamp(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_12array_to_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + int __pyx_v_i; + int __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_to_timestamp", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":180 + * cdef ndarray[int64_t, ndim=1] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.int64) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":181 + * + * n = len(arr) + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":183 + * result = np.empty(n, dtype=np.int64) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = gmtime(arr[i]) + * + */ + __pyx_t_8 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) { + + /* "pandas/lib.pyx":184 + * + * for i from 0 <= i < n: + * result[i] = gmtime(arr[i]) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_3lib_gmtime(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "pandas/lib.pyx":186 + * result[i] = gmtime(arr[i]) + * + * return result # <<<<<<<<<<<<<< + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":176 + * return gmtime(dt) + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[int64_t, ndim=1] result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.array_to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":188 + * return result + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[object, ndim=1] result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_15time64_to_datetime(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_15time64_to_datetime = {__Pyx_NAMESTR("time64_to_datetime"), (PyCFunction)__pyx_pw_6pandas_3lib_15time64_to_datetime, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_15time64_to_datetime(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time64_to_datetime (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_14time64_to_datetime(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14time64_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + int __pyx_v_i; + int __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + PyObject **__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("time64_to_datetime", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":192 + * cdef ndarray[object, ndim=1] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=object) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":193 + * + * n = len(arr) + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":195 + * result = np.empty(n, dtype=object) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = to_datetime(arr[i]) + * + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":196 + * + * for i from 0 <= i < n: + * result[i] = to_datetime(arr[i]) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __pyx_f_6pandas_3lib_to_datetime((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)), 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_14); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_14); + *__pyx_t_14 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_14); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/lib.pyx":198 + * result[i] = to_datetime(arr[i]) + * + * return result # <<<<<<<<<<<<<< + * + * cdef inline int64_t get_timedelta64_value(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":188 + * return result + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[object, ndim=1] result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.time64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":200 + * return result + * + * cdef inline int64_t get_timedelta64_value(val): # <<<<<<<<<<<<<< + * return val.view('i8') + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_get_timedelta64_value(PyObject *__pyx_v_val) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_timedelta64_value", 0); + + /* "pandas/lib.pyx":201 + * + * cdef inline int64_t get_timedelta64_value(val): + * return val.view('i8') # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/lib.pyx":200 + * return result + * + * cdef inline int64_t get_timedelta64_value(val): # <<<<<<<<<<<<<< + * return val.view('i8') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.lib.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":209 + * cdef double NEGINF = -INF + * + * cpdef checknull(object val): # <<<<<<<<<<<<<< + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val # and val != INF and val != NEGINF + */ + +static PyObject *__pyx_pw_6pandas_3lib_17checknull(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_checknull(PyObject *__pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("checknull", 0); + + /* "pandas/lib.pyx":210 + * + * cpdef checknull(object val): + * if util.is_float_object(val) or util.is_complex_object(val): # <<<<<<<<<<<<<< + * return val != val # and val != INF and val != NEGINF + * elif util.is_datetime64_object(val): + */ + __pyx_t_1 = (is_float_object(__pyx_v_val) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = (is_complex_object(__pyx_v_val) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/lib.pyx":211 + * cpdef checknull(object val): + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val # and val != INF and val != NEGINF # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":212 + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val # and val != INF and val != NEGINF + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: + */ + __pyx_t_3 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":213 + * return val != val # and val != INF and val != NEGINF + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT # <<<<<<<<<<<<<< + * elif val is NaT: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong((get_datetime64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":214 + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: # <<<<<<<<<<<<<< + * return True + * elif util.is_timedelta64_object(val): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_val == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":215 + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: + * return True # <<<<<<<<<<<<<< + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":216 + * elif val is NaT: + * return True + * elif util.is_timedelta64_object(val): # <<<<<<<<<<<<<< + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): + */ + __pyx_t_1 = (is_timedelta64_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":217 + * return True + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT # <<<<<<<<<<<<<< + * elif is_array(val): + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_f_6pandas_3lib_get_timedelta64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":218 + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): # <<<<<<<<<<<<<< + * return False + * else: + */ + __pyx_t_4 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "pandas/lib.pyx":219 + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): + * return False # <<<<<<<<<<<<<< + * else: + * return _checknull(val) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":221 + * return False + * else: + * return _checknull(val) # <<<<<<<<<<<<<< + * + * cpdef checknull_old(object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_f_4util__checknull(__pyx_v_val)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":209 + * cdef double NEGINF = -INF + * + * cpdef checknull(object val): # <<<<<<<<<<<<<< + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val # and val != INF and val != NEGINF + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_17checknull(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_17checknull(PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("checknull (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16checknull(__pyx_self, ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16checknull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("checknull", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_checknull(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":223 + * return _checknull(val) + * + * cpdef checknull_old(object val): # <<<<<<<<<<<<<< + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val or val == INF or val == NEGINF + */ + +static PyObject *__pyx_pw_6pandas_3lib_19checknull_old(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_checknull_old(PyObject *__pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("checknull_old", 0); + + /* "pandas/lib.pyx":224 + * + * cpdef checknull_old(object val): + * if util.is_float_object(val) or util.is_complex_object(val): # <<<<<<<<<<<<<< + * return val != val or val == INF or val == NEGINF + * elif util.is_datetime64_object(val): + */ + __pyx_t_1 = (is_float_object(__pyx_v_val) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = (is_complex_object(__pyx_v_val) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/lib.pyx":225 + * cpdef checknull_old(object val): + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_3) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_6pandas_3lib_INF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_val, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_3) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_6pandas_3lib_NEGINF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_5 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __pyx_t_6 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":226 + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val or val == INF or val == NEGINF + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: + */ + __pyx_t_3 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":227 + * return val != val or val == INF or val == NEGINF + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT # <<<<<<<<<<<<<< + * elif val is NaT: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong((get_datetime64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":228 + * elif util.is_datetime64_object(val): + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: # <<<<<<<<<<<<<< + * return True + * elif util.is_timedelta64_object(val): + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__pyx_v_val == __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":229 + * return get_datetime64_value(val) == NPY_NAT + * elif val is NaT: + * return True # <<<<<<<<<<<<<< + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":230 + * elif val is NaT: + * return True + * elif util.is_timedelta64_object(val): # <<<<<<<<<<<<<< + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): + */ + __pyx_t_1 = (is_timedelta64_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":231 + * return True + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT # <<<<<<<<<<<<<< + * elif is_array(val): + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong((__pyx_f_6pandas_3lib_get_timedelta64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":232 + * elif util.is_timedelta64_object(val): + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): # <<<<<<<<<<<<<< + * return False + * else: + */ + __pyx_t_6 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_1) { + + /* "pandas/lib.pyx":233 + * return get_timedelta64_value(val) == NPY_NAT + * elif is_array(val): + * return False # <<<<<<<<<<<<<< + * else: + * return util._checknull(val) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":235 + * return False + * else: + * return util._checknull(val) # <<<<<<<<<<<<<< + * + * def isscalar(object val): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_f_4util__checknull(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":223 + * return _checknull(val) + * + * cpdef checknull_old(object val): # <<<<<<<<<<<<<< + * if util.is_float_object(val) or util.is_complex_object(val): + * return val != val or val == INF or val == NEGINF + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_19checknull_old(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_19checknull_old(PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("checknull_old (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_18checknull_old(__pyx_self, ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_18checknull_old(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("checknull_old", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_checknull_old(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":237 + * return util._checknull(val) + * + * def isscalar(object val): # <<<<<<<<<<<<<< + * return np.isscalar(val) or val is None or PyDateTime_Check(val) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_21isscalar(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_21isscalar = {__Pyx_NAMESTR("isscalar"), (PyCFunction)__pyx_pw_6pandas_3lib_21isscalar, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_21isscalar(PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isscalar (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_20isscalar(__pyx_self, ((PyObject *)__pyx_v_val)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_20isscalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isscalar", 0); + + /* "pandas/lib.pyx":238 + * + * def isscalar(object val): + * return np.isscalar(val) or val is None or PyDateTime_Check(val) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = (__pyx_v_val == Py_None); + if (!__pyx_t_4) { + __pyx_t_5 = PyDateTime_Check(__pyx_v_val); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":237 + * return util._checknull(val) + * + * def isscalar(object val): # <<<<<<<<<<<<<< + * return np.isscalar(val) or val is None or PyDateTime_Check(val) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.isscalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":243 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23isnullobj(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23isnullobj = {__Pyx_NAMESTR("isnullobj"), (PyCFunction)__pyx_pw_6pandas_3lib_23isnullobj, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23isnullobj(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_22isnullobj(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_22isnullobj(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_arobj = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":248 + * cdef ndarray[uint8_t] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":249 + * + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * arobj = arr[i] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":250 + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * arobj = arr[i] + * result[i] = arobj is NaT or _checknull(arobj) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":251 + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + * arobj = arr[i] # <<<<<<<<<<<<<< + * result[i] = arobj is NaT or _checknull(arobj) + * return result.view(np.bool_) + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_arobj, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":252 + * for i from 0 <= i < n: + * arobj = arr[i] + * result[i] = arobj is NaT or _checknull(arobj) # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = (__pyx_v_arobj == __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_13) { + __pyx_t_14 = __pyx_f_4util__checknull(__pyx_v_arobj); + __pyx_t_15 = __pyx_t_14; + } else { + __pyx_t_15 = __pyx_t_13; + } + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + } + + /* "pandas/lib.pyx":253 + * arobj = arr[i] + * result[i] = arobj is NaT or _checknull(arobj) + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":243 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_arobj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":257 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_25isnullobj_old(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_25isnullobj_old = {__Pyx_NAMESTR("isnullobj_old"), (PyCFunction)__pyx_pw_6pandas_3lib_25isnullobj_old, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_25isnullobj_old(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj_old (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_24isnullobj_old(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_24isnullobj_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj_old", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":262 + * cdef ndarray[uint8_t] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":263 + * + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":264 + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = util._checknull_old(arr[i]) + * return result.view(np.bool_) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":265 + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_13 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_4util__checknull_old(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "pandas/lib.pyx":266 + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":257 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":271 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_27isnullobj2d(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_27isnullobj2d = {__Pyx_NAMESTR("isnullobj2d"), (PyCFunction)__pyx_pw_6pandas_3lib_27isnullobj2d, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_27isnullobj2d(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj2d (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_26isnullobj2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_26isnullobj2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_m; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj2d", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + + /* "pandas/lib.pyx":276 + * cdef ndarray[uint8_t, ndim=2] result + * + * n, m = ( arr).shape # <<<<<<<<<<<<<< + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_m = __pyx_t_7; + + /* "pandas/lib.pyx":277 + * + * n, m = ( arr).shape + * result = np.zeros((n, m), dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * for j from 0 <= j < m: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":278 + * n, m = ( arr).shape + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < m: + * val = arr[i, j] + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":279 + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: + * for j from 0 <= j < m: # <<<<<<<<<<<<<< + * val = arr[i, j] + * if checknull(val): + */ + __pyx_t_6 = __pyx_v_m; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/lib.pyx":280 + * for i from 0 <= i < n: + * for j from 0 <= j < m: + * val = arr[i, j] # <<<<<<<<<<<<<< + * if checknull(val): + * result[i, j] = 1 + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_arr.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":281 + * for j from 0 <= j < m: + * val = arr[i, j] + * if checknull(val): # <<<<<<<<<<<<<< + * result[i, j] = 1 + * return result.view(np.bool_) + */ + __pyx_t_8 = __pyx_f_6pandas_3lib_checknull(__pyx_v_val, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_16) { + + /* "pandas/lib.pyx":282 + * val = arr[i, j] + * if checknull(val): + * result[i, j] = 1 # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_result.diminfo[1].strides) = 1; + goto __pyx_L9; + } + __pyx_L9:; + } + } + + /* "pandas/lib.pyx":283 + * if checknull(val): + * result[i, j] = 1 + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":271 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj2d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":287 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_29isnullobj_old(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_29isnullobj_old = {__Pyx_NAMESTR("isnullobj_old"), (PyCFunction)__pyx_pw_6pandas_3lib_29isnullobj_old, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_29isnullobj_old(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj_old (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_28isnullobj_old(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_28isnullobj_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj_old", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":292 + * cdef ndarray[uint8_t] result + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":293 + * + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":294 + * n = len(arr) + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = util._checknull_old(arr[i]) + * return result.view(np.bool_) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":295 + * result = np.zeros(n, dtype=np.uint8) + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __pyx_t_13 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_4util__checknull_old(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "pandas/lib.pyx":296 + * for i from 0 <= i < n: + * result[i] = util._checknull_old(arr[i]) + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":287 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d_old(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_31isnullobj2d_old(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_31isnullobj2d_old = {__Pyx_NAMESTR("isnullobj2d_old"), (PyCFunction)__pyx_pw_6pandas_3lib_31isnullobj2d_old, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_31isnullobj2d_old(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isnullobj2d_old (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_30isnullobj2d_old(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_30isnullobj2d_old(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_m; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isnullobj2d_old", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; + + /* "pandas/lib.pyx":306 + * cdef ndarray[uint8_t, ndim=2] result + * + * n, m = ( arr).shape # <<<<<<<<<<<<<< + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_m = __pyx_t_7; + + /* "pandas/lib.pyx":307 + * + * n, m = ( arr).shape + * result = np.zeros((n, m), dtype=np.uint8) # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * for j from 0 <= j < m: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":308 + * n, m = ( arr).shape + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < m: + * val = arr[i, j] + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":309 + * result = np.zeros((n, m), dtype=np.uint8) + * for i from 0 <= i < n: + * for j from 0 <= j < m: # <<<<<<<<<<<<<< + * val = arr[i, j] + * if checknull_old(val): + */ + __pyx_t_6 = __pyx_v_m; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/lib.pyx":310 + * for i from 0 <= i < n: + * for j from 0 <= j < m: + * val = arr[i, j] # <<<<<<<<<<<<<< + * if checknull_old(val): + * result[i, j] = 1 + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_arr.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":311 + * for j from 0 <= j < m: + * val = arr[i, j] + * if checknull_old(val): # <<<<<<<<<<<<<< + * result[i, j] = 1 + * return result.view(np.bool_) + */ + __pyx_t_8 = __pyx_f_6pandas_3lib_checknull_old(__pyx_v_val, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_16) { + + /* "pandas/lib.pyx":312 + * val = arr[i, j] + * if checknull_old(val): + * result[i, j] = 1 # <<<<<<<<<<<<<< + * return result.view(np.bool_) + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_result.diminfo[1].strides) = 1; + goto __pyx_L9; + } + __pyx_L9:; + } + } + + /* "pandas/lib.pyx":313 + * if checknull_old(val): + * result[i, j] = 1 + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * def list_to_object_array(list obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d_old(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.isnullobj2d_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":315 + * return result.view(np.bool_) + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_33list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6pandas_3lib_32list_to_object_array[] = "\n Convert list to object ndarray. Seriously can't believe I had to write this\n function\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_33list_to_object_array = {__Pyx_NAMESTR("list_to_object_array"), (PyCFunction)__pyx_pw_6pandas_3lib_33list_to_object_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_32list_to_object_array)}; +static PyObject *__pyx_pw_6pandas_3lib_33list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_to_object_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_32list_to_object_array(__pyx_self, ((PyObject*)__pyx_v_obj)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_32list_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_arr = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject **__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_to_object_array", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + + /* "pandas/lib.pyx":324 + * ndarray[object] arr + * + * n = len(obj) # <<<<<<<<<<<<<< + * arr = np.empty(n, dtype=object) + * + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":325 + * + * n = len(obj) + * arr = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_arr = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":327 + * arr = np.empty(n, dtype=object) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * arr[i] = obj[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":328 + * + * for i from 0 <= i < n: + * arr[i] = obj[i] # <<<<<<<<<<<<<< + * + * return arr + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_12); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_12); + *__pyx_t_12 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/lib.pyx":330 + * arr[i] = obj[i] + * + * return arr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/lib.pyx":315 + * return result.view(np.bool_) + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.list_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":335 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_35fast_unique(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_35fast_unique = {__Pyx_NAMESTR("fast_unique"), (PyCFunction)__pyx_pw_6pandas_3lib_35fast_unique, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_35fast_unique(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_unique (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_34fast_unique(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_34fast_unique(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_table = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_stub = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_unique", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":337 + * def fast_unique(ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * list uniques = [] + * dict table = {} + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":338 + * cdef: + * Py_ssize_t i, n = len(values) + * list uniques = [] # <<<<<<<<<<<<<< + * dict table = {} + * object val, stub = 0 + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":339 + * Py_ssize_t i, n = len(values) + * list uniques = [] + * dict table = {} # <<<<<<<<<<<<<< + * object val, stub = 0 + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_table = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":340 + * list uniques = [] + * dict table = {} + * object val, stub = 0 # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_stub = __pyx_int_0; + + /* "pandas/lib.pyx":342 + * object val, stub = 0 + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = values[i] + * if val not in table: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":343 + * + * for i from 0 <= i < n: + * val = values[i] # <<<<<<<<<<<<<< + * if val not in table: + * table[val] = stub + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":344 + * for i from 0 <= i < n: + * val = values[i] + * if val not in table: # <<<<<<<<<<<<<< + * table[val] = stub + * uniques.append(val) + */ + __pyx_t_4 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_table, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":345 + * val = values[i] + * if val not in table: + * table[val] = stub # <<<<<<<<<<<<<< + * uniques.append(val) + * try: + */ + if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_v_val, __pyx_v_stub) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":346 + * if val not in table: + * table[val] = stub + * uniques.append(val) # <<<<<<<<<<<<<< + * try: + * uniques.sort() + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":347 + * table[val] = stub + * uniques.append(val) + * try: # <<<<<<<<<<<<<< + * uniques.sort() + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/lib.pyx":348 + * uniques.append(val) + * try: + * uniques.sort() # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_6 = PyList_Sort(__pyx_v_uniques); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":349 + * try: + * uniques.sort() + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L13_try_end:; + } + + /* "pandas/lib.pyx":352 + * pass + * + * return uniques # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_uniques); + __pyx_r = __pyx_v_uniques; + goto __pyx_L0; + + /* "pandas/lib.pyx":335 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_unique", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_table); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_stub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":356 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple(list arrays): # <<<<<<<<<<<<<< + * cdef: + * ndarray[object] buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_37fast_unique_multiple(PyObject *__pyx_self, PyObject *__pyx_v_arrays); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_37fast_unique_multiple = {__Pyx_NAMESTR("fast_unique_multiple"), (PyCFunction)__pyx_pw_6pandas_3lib_37fast_unique_multiple, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_37fast_unique_multiple(PyObject *__pyx_self, PyObject *__pyx_v_arrays) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_unique_multiple (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arrays), (&PyList_Type), 1, "arrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_36fast_unique_multiple(__pyx_self, ((PyObject*)__pyx_v_arrays)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_36fast_unique_multiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays) { + PyArrayObject *__pyx_v_buf = 0; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_table = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_stub = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_buf; + __Pyx_Buffer __pyx_pybuffer_buf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_unique_multiple", 0); + __pyx_pybuffer_buf.pybuffer.buf = NULL; + __pyx_pybuffer_buf.refcount = 0; + __pyx_pybuffernd_buf.data = NULL; + __pyx_pybuffernd_buf.rcbuffer = &__pyx_pybuffer_buf; + + /* "pandas/lib.pyx":359 + * cdef: + * ndarray[object] buf + * Py_ssize_t k = len(arrays) # <<<<<<<<<<<<<< + * Py_ssize_t i, j, n + * list uniques = [] + */ + if (unlikely(__pyx_v_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":361 + * Py_ssize_t k = len(arrays) + * Py_ssize_t i, j, n + * list uniques = [] # <<<<<<<<<<<<<< + * dict table = {} + * object val, stub = 0 + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":362 + * Py_ssize_t i, j, n + * list uniques = [] + * dict table = {} # <<<<<<<<<<<<<< + * object val, stub = 0 + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_table = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":363 + * list uniques = [] + * dict table = {} + * object val, stub = 0 # <<<<<<<<<<<<<< + * + * for i from 0 <= i < k: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_stub = __pyx_int_0; + + /* "pandas/lib.pyx":365 + * object val, stub = 0 + * + * for i from 0 <= i < k: # <<<<<<<<<<<<<< + * buf = arrays[i] + * n = len(buf) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":366 + * + * for i from 0 <= i < k: + * buf = arrays[i] # <<<<<<<<<<<<<< + * n = len(buf) + * for j from 0 <= j < n: + */ + if (unlikely(__pyx_v_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buf.rcbuffer->pybuffer, (PyObject*)__pyx_v_buf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_buf.diminfo[0].strides = __pyx_pybuffernd_buf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buf.diminfo[0].shape = __pyx_pybuffernd_buf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_XDECREF_SET(__pyx_v_buf, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":367 + * for i from 0 <= i < k: + * buf = arrays[i] + * n = len(buf) # <<<<<<<<<<<<<< + * for j from 0 <= j < n: + * val = buf[j] + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_buf)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_7; + + /* "pandas/lib.pyx":368 + * buf = arrays[i] + * n = len(buf) + * for j from 0 <= j < n: # <<<<<<<<<<<<<< + * val = buf[j] + * if val not in table: + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { + + /* "pandas/lib.pyx":369 + * n = len(buf) + * for j from 0 <= j < n: + * val = buf[j] # <<<<<<<<<<<<<< + * if val not in table: + * table[val] = stub + */ + __pyx_t_8 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_buf.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_buf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":370 + * for j from 0 <= j < n: + * val = buf[j] + * if val not in table: # <<<<<<<<<<<<<< + * table[val] = stub + * uniques.append(val) + */ + __pyx_t_9 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_table, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "pandas/lib.pyx":371 + * val = buf[j] + * if val not in table: + * table[val] = stub # <<<<<<<<<<<<<< + * uniques.append(val) + * try: + */ + if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_v_val, __pyx_v_stub) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":372 + * if val not in table: + * table[val] = stub + * uniques.append(val) # <<<<<<<<<<<<<< + * try: + * uniques.sort() + */ + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + __pyx_L7:; + } + } + + /* "pandas/lib.pyx":373 + * table[val] = stub + * uniques.append(val) + * try: # <<<<<<<<<<<<<< + * uniques.sort() + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/lib.pyx":374 + * uniques.append(val) + * try: + * uniques.sort() # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_11 = PyList_Sort(__pyx_v_uniques); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":375 + * try: + * uniques.sort() + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_3) { + PyErr_Restore(0,0,0); + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_L15_try_end:; + } + + /* "pandas/lib.pyx":378 + * pass + * + * return uniques # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_uniques); + __pyx_r = __pyx_v_uniques; + goto __pyx_L0; + + /* "pandas/lib.pyx":356 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple(list arrays): # <<<<<<<<<<<<<< + * cdef: + * ndarray[object] buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_unique_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_buf); + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_table); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_stub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":382 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list(list lists): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_39fast_unique_multiple_list(PyObject *__pyx_self, PyObject *__pyx_v_lists); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_39fast_unique_multiple_list = {__Pyx_NAMESTR("fast_unique_multiple_list"), (PyCFunction)__pyx_pw_6pandas_3lib_39fast_unique_multiple_list, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_39fast_unique_multiple_list(PyObject *__pyx_self, PyObject *__pyx_v_lists) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_unique_multiple_list (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lists), (&PyList_Type), 1, "lists", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_38fast_unique_multiple_list(__pyx_self, ((PyObject*)__pyx_v_lists)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_38fast_unique_multiple_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lists) { + PyObject *__pyx_v_buf = 0; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_table = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_stub = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_unique_multiple_list", 0); + + /* "pandas/lib.pyx":385 + * cdef: + * list buf + * Py_ssize_t k = len(lists) # <<<<<<<<<<<<<< + * Py_ssize_t i, j, n + * list uniques = [] + */ + if (unlikely(__pyx_v_lists == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_lists); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":387 + * Py_ssize_t k = len(lists) + * Py_ssize_t i, j, n + * list uniques = [] # <<<<<<<<<<<<<< + * dict table = {} + * object val, stub = 0 + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":388 + * Py_ssize_t i, j, n + * list uniques = [] + * dict table = {} # <<<<<<<<<<<<<< + * object val, stub = 0 + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_table = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":389 + * list uniques = [] + * dict table = {} + * object val, stub = 0 # <<<<<<<<<<<<<< + * + * for i from 0 <= i < k: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_stub = __pyx_int_0; + + /* "pandas/lib.pyx":391 + * object val, stub = 0 + * + * for i from 0 <= i < k: # <<<<<<<<<<<<<< + * buf = lists[i] + * n = len(buf) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":392 + * + * for i from 0 <= i < k: + * buf = lists[i] # <<<<<<<<<<<<<< + * n = len(buf) + * for j from 0 <= j < n: + */ + if (unlikely(__pyx_v_lists == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(PyList_CheckExact(PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i)))||((PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_buf, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":393 + * for i from 0 <= i < k: + * buf = lists[i] + * n = len(buf) # <<<<<<<<<<<<<< + * for j from 0 <= j < n: + * val = buf[j] + */ + if (unlikely(__pyx_v_buf == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_buf); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/lib.pyx":394 + * buf = lists[i] + * n = len(buf) + * for j from 0 <= j < n: # <<<<<<<<<<<<<< + * val = buf[j] + * if val not in table: + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { + + /* "pandas/lib.pyx":395 + * n = len(buf) + * for j from 0 <= j < n: + * val = buf[j] # <<<<<<<<<<<<<< + * if val not in table: + * table[val] = stub + */ + if (unlikely(__pyx_v_buf == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_buf, __pyx_v_j); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":396 + * for j from 0 <= j < n: + * val = buf[j] + * if val not in table: # <<<<<<<<<<<<<< + * table[val] = stub + * uniques.append(val) + */ + __pyx_t_4 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_table, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":397 + * val = buf[j] + * if val not in table: + * table[val] = stub # <<<<<<<<<<<<<< + * uniques.append(val) + * try: + */ + if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_v_val, __pyx_v_stub) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":398 + * if val not in table: + * table[val] = stub + * uniques.append(val) # <<<<<<<<<<<<<< + * try: + * uniques.sort() + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + __pyx_L7:; + } + } + + /* "pandas/lib.pyx":399 + * table[val] = stub + * uniques.append(val) + * try: # <<<<<<<<<<<<<< + * uniques.sort() + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/lib.pyx":400 + * uniques.append(val) + * try: + * uniques.sort() # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_6 = PyList_Sort(__pyx_v_uniques); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":401 + * try: + * uniques.sort() + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L15_try_end:; + } + + /* "pandas/lib.pyx":404 + * pass + * + * return uniques # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_uniques); + __pyx_r = __pyx_v_uniques; + goto __pyx_L0; + + /* "pandas/lib.pyx":382 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list(list lists): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.fast_unique_multiple_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_table); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_stub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":408 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list_gen(object gen): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_41fast_unique_multiple_list_gen(PyObject *__pyx_self, PyObject *__pyx_v_gen); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_41fast_unique_multiple_list_gen = {__Pyx_NAMESTR("fast_unique_multiple_list_gen"), (PyCFunction)__pyx_pw_6pandas_3lib_41fast_unique_multiple_list_gen, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_41fast_unique_multiple_list_gen(PyObject *__pyx_self, PyObject *__pyx_v_gen) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_unique_multiple_list_gen (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_40fast_unique_multiple_list_gen(__pyx_self, ((PyObject *)__pyx_v_gen)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_40fast_unique_multiple_list_gen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gen) { + PyObject *__pyx_v_buf = 0; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_table = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_stub = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_unique_multiple_list_gen", 0); + + /* "pandas/lib.pyx":412 + * list buf + * Py_ssize_t j, n + * list uniques = [] # <<<<<<<<<<<<<< + * dict table = {} + * object val, stub = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_uniques = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":413 + * Py_ssize_t j, n + * list uniques = [] + * dict table = {} # <<<<<<<<<<<<<< + * object val, stub = 0 + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_table = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":414 + * list uniques = [] + * dict table = {} + * object val, stub = 0 # <<<<<<<<<<<<<< + * + * for buf in gen: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_stub = __pyx_int_0; + + /* "pandas/lib.pyx":416 + * object val, stub = 0 + * + * for buf in gen: # <<<<<<<<<<<<<< + * n = len(buf) + * for j from 0 <= j < n: + */ + if (PyList_CheckExact(__pyx_v_gen) || PyTuple_CheckExact(__pyx_v_gen)) { + __pyx_t_1 = __pyx_v_gen; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_gen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_buf, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/lib.pyx":417 + * + * for buf in gen: + * n = len(buf) # <<<<<<<<<<<<<< + * for j from 0 <= j < n: + * val = buf[j] + */ + if (unlikely(__pyx_v_buf == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_buf); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_5; + + /* "pandas/lib.pyx":418 + * for buf in gen: + * n = len(buf) + * for j from 0 <= j < n: # <<<<<<<<<<<<<< + * val = buf[j] + * if val not in table: + */ + __pyx_t_5 = __pyx_v_n; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) { + + /* "pandas/lib.pyx":419 + * n = len(buf) + * for j from 0 <= j < n: + * val = buf[j] # <<<<<<<<<<<<<< + * if val not in table: + * table[val] = stub + */ + if (unlikely(__pyx_v_buf == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_ITEM(__pyx_v_buf, __pyx_v_j); + __Pyx_INCREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/lib.pyx":420 + * for j from 0 <= j < n: + * val = buf[j] + * if val not in table: # <<<<<<<<<<<<<< + * table[val] = stub + * uniques.append(val) + */ + __pyx_t_6 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_table, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + + /* "pandas/lib.pyx":421 + * val = buf[j] + * if val not in table: + * table[val] = stub # <<<<<<<<<<<<<< + * uniques.append(val) + * + */ + if (unlikely(PyDict_SetItem(__pyx_v_table, __pyx_v_val, __pyx_v_stub) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":422 + * if val not in table: + * table[val] = stub + * uniques.append(val) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L7; + } + __pyx_L7:; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/lib.pyx":424 + * uniques.append(val) + * + * try: # <<<<<<<<<<<<<< + * uniques.sort() + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "pandas/lib.pyx":425 + * + * try: + * uniques.sort() # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_8 = PyList_Sort(__pyx_v_uniques); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L15_try_end; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/lib.pyx":426 + * try: + * uniques.sort() + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + PyErr_Restore(0,0,0); + goto __pyx_L9_exception_handled; + } + goto __pyx_L10_except_error; + __pyx_L10_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L1_error; + __pyx_L9_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L15_try_end:; + } + + /* "pandas/lib.pyx":429 + * pass + * + * return uniques # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_uniques); + __pyx_r = __pyx_v_uniques; + goto __pyx_L0; + + /* "pandas/lib.pyx":408 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list_gen(object gen): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.fast_unique_multiple_list_gen", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_table); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_stub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":433 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def dicts_to_array(list dicts, list columns): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_43dicts_to_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_43dicts_to_array = {__Pyx_NAMESTR("dicts_to_array"), (PyCFunction)__pyx_pw_6pandas_3lib_43dicts_to_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_43dicts_to_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dicts = 0; + PyObject *__pyx_v_columns = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dicts_to_array (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dicts,&__pyx_n_s_columns,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dicts)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("dicts_to_array", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dicts_to_array") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_dicts = ((PyObject*)values[0]); + __pyx_v_columns = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dicts_to_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.dicts_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dicts), (&PyList_Type), 1, "dicts", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_columns), (&PyList_Type), 1, "columns", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_42dicts_to_array(__pyx_self, __pyx_v_dicts, __pyx_v_columns); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_42dicts_to_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dicts, PyObject *__pyx_v_columns) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_row = 0; + PyObject *__pyx_v_col = 0; + PyObject *__pyx_v_onan = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject **__pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dicts_to_array", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":438 + * ndarray[object, ndim=2] result + * dict row + * object col, onan = np.nan # <<<<<<<<<<<<<< + * + * k = len(columns) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_onan = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":440 + * object col, onan = np.nan + * + * k = len(columns) # <<<<<<<<<<<<<< + * n = len(dicts) + * + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_3; + + /* "pandas/lib.pyx":441 + * + * k = len(columns) + * n = len(dicts) # <<<<<<<<<<<<<< + * + * result = np.empty((n, k), dtype='O') + */ + if (unlikely(__pyx_v_dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_dicts); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/lib.pyx":443 + * n = len(dicts) + * + * result = np.empty((n, k), dtype='O') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":445 + * result = np.empty((n, k), dtype='O') + * + * for i in range(n): # <<<<<<<<<<<<<< + * row = dicts[i] + * for j in range(k): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_3; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/lib.pyx":446 + * + * for i in range(n): + * row = dicts[i] # <<<<<<<<<<<<<< + * for j in range(k): + * col = columns[j] + */ + if (unlikely(__pyx_v_dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(PyDict_CheckExact(PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i)))||((PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":447 + * for i in range(n): + * row = dicts[i] + * for j in range(k): # <<<<<<<<<<<<<< + * col = columns[j] + * if col in row: + */ + __pyx_t_12 = __pyx_v_k; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { + __pyx_v_j = __pyx_t_13; + + /* "pandas/lib.pyx":448 + * row = dicts[i] + * for j in range(k): + * col = columns[j] # <<<<<<<<<<<<<< + * if col in row: + * result[i, j] = row[col] + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_columns, __pyx_v_j); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":449 + * for j in range(k): + * col = columns[j] + * if col in row: # <<<<<<<<<<<<<< + * result[i, j] = row[col] + * else: + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (__Pyx_PyDict_Contains(__pyx_v_col, __pyx_v_row, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = (__pyx_t_14 != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":450 + * col = columns[j] + * if col in row: + * result[i, j] = row[col] # <<<<<<<<<<<<<< + * else: + * result[i, j] = onan + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_row, __pyx_v_col); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/lib.pyx":452 + * result[i, j] = row[col] + * else: + * result[i, j] = onan # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = __pyx_v_j; + __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_v_onan); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_v_onan; + __Pyx_GIVEREF(*__pyx_t_18); + } + __pyx_L7:; + } + } + + /* "pandas/lib.pyx":454 + * result[i, j] = onan + * + * return result # <<<<<<<<<<<<<< + * + * def fast_zip(list ndarrays): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":433 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def dicts_to_array(list dicts, list columns): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.dicts_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XDECREF(__pyx_v_col); + __Pyx_XDECREF(__pyx_v_onan); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":456 + * return result + * + * def fast_zip(list ndarrays): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_45fast_zip(PyObject *__pyx_self, PyObject *__pyx_v_ndarrays); /*proto*/ +static char __pyx_doc_6pandas_3lib_44fast_zip[] = "\n For zipping multiple ndarrays into an ndarray of tuples\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_45fast_zip = {__Pyx_NAMESTR("fast_zip"), (PyCFunction)__pyx_pw_6pandas_3lib_45fast_zip, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_44fast_zip)}; +static PyObject *__pyx_pw_6pandas_3lib_45fast_zip(PyObject *__pyx_self, PyObject *__pyx_v_ndarrays) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_zip (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ndarrays), (&PyList_Type), 1, "ndarrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_44fast_zip(__pyx_self, ((PyObject*)__pyx_v_ndarrays)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_44fast_zip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ndarrays) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayIterObject *__pyx_v_it = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_tup = 0; + PyObject *__pyx_v_arr = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject **__pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_zip", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":466 + * object val, tup + * + * k = len(ndarrays) # <<<<<<<<<<<<<< + * n = len(ndarrays[0]) + * + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_ndarrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":467 + * + * k = len(ndarrays) + * n = len(ndarrays[0]) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=object) + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":469 + * n = len(ndarrays[0]) + * + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * # initialize tuples on first pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":472 + * + * # initialize tuples on first pass + * arr = ndarrays[0] # <<<<<<<<<<<<<< + * it = PyArray_IterNew(arr) + * for i in range(n): + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_arr = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":473 + * # initialize tuples on first pass + * arr = ndarrays[0] + * it = PyArray_IterNew(arr) # <<<<<<<<<<<<<< + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + */ + __pyx_t_5 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_t_5; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_it = ((PyArrayIterObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":474 + * arr = ndarrays[0] + * it = PyArray_IterNew(arr) + * for i in range(n): # <<<<<<<<<<<<<< + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * tup = PyTuple_New(k) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/lib.pyx":475 + * it = PyArray_IterNew(arr) + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) # <<<<<<<<<<<<<< + * tup = PyTuple_New(k) + * + */ + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyArray_GETITEM(((PyArrayObject *)__pyx_v_arr), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":476 + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * tup = PyTuple_New(k) # <<<<<<<<<<<<<< + * + * PyTuple_SET_ITEM(tup, 0, val) + */ + __pyx_t_2 = PyTuple_New(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_tup, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":478 + * tup = PyTuple_New(k) + * + * PyTuple_SET_ITEM(tup, 0, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * result[i] = tup + */ + PyTuple_SET_ITEM(__pyx_v_tup, 0, __pyx_v_val); + + /* "pandas/lib.pyx":479 + * + * PyTuple_SET_ITEM(tup, 0, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * result[i] = tup + * PyArray_ITER_NEXT(it) + */ + Py_INCREF(__pyx_v_val); + + /* "pandas/lib.pyx":480 + * PyTuple_SET_ITEM(tup, 0, val) + * Py_INCREF(val) + * result[i] = tup # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_v_tup); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_v_tup; + __Pyx_GIVEREF(*__pyx_t_13); + + /* "pandas/lib.pyx":481 + * Py_INCREF(val) + * result[i] = tup + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * + * for j in range(1, k): + */ + PyArray_ITER_NEXT(__pyx_v_it); + } + + /* "pandas/lib.pyx":483 + * PyArray_ITER_NEXT(it) + * + * for j in range(1, k): # <<<<<<<<<<<<<< + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_j = __pyx_t_11; + + /* "pandas/lib.pyx":484 + * + * for j in range(1, k): + * arr = ndarrays[j] # <<<<<<<<<<<<<< + * it = PyArray_IterNew(arr) + * if len(arr) != n: + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":485 + * for j in range(1, k): + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) # <<<<<<<<<<<<<< + * if len(arr) != n: + * raise ValueError('all arrays must be same length') + */ + __pyx_t_2 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_it, ((PyArrayIterObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":486 + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) + * if len(arr) != n: # <<<<<<<<<<<<<< + * raise ValueError('all arrays must be same length') + * + */ + __pyx_t_14 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = ((__pyx_t_14 != __pyx_v_n) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":487 + * it = PyArray_IterNew(arr) + * if len(arr) != n: + * raise ValueError('all arrays must be same length') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":489 + * raise ValueError('all arrays must be same length') + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * PyTuple_SET_ITEM(result[i], j, val) + */ + __pyx_t_14 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_14; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/lib.pyx":490 + * + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) + */ + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyArray_GETITEM(((PyArrayObject *)__pyx_v_arr), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":491 + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * PyTuple_SET_ITEM(result[i], j, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * PyArray_ITER_NEXT(it) + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, __pyx_v_j, __pyx_v_val); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":492 + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * + */ + Py_INCREF(__pyx_v_val); + + /* "pandas/lib.pyx":493 + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * + * return result + */ + PyArray_ITER_NEXT(__pyx_v_it); + } + } + + /* "pandas/lib.pyx":495 + * PyArray_ITER_NEXT(it) + * + * return result # <<<<<<<<<<<<<< + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":456 + * return result + * + * def fast_zip(list ndarrays): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_zip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_it); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":497 + * return result + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): # <<<<<<<<<<<<<< + * """ + * Reverse indexing operation. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_47get_reverse_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_46get_reverse_indexer[] = "\n Reverse indexing operation.\n\n Given `indexer`, make `indexer_inv` of it, such that::\n\n indexer_inv[indexer[x]] = x\n\n .. note:: If indexer is not unique, only first occurrence is accounted.\n\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_47get_reverse_indexer = {__Pyx_NAMESTR("get_reverse_indexer"), (PyCFunction)__pyx_pw_6pandas_3lib_47get_reverse_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_46get_reverse_indexer)}; +static PyObject *__pyx_pw_6pandas_3lib_47get_reverse_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_indexer = 0; + Py_ssize_t __pyx_v_length; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_reverse_indexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indexer,&__pyx_n_s_length,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_reverse_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reverse_indexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_indexer = ((PyArrayObject *)values[0]); + __pyx_v_length = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_reverse_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.get_reverse_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_46get_reverse_indexer(__pyx_self, __pyx_v_indexer, __pyx_v_length); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_46get_reverse_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indexer, Py_ssize_t __pyx_v_length) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_rev_indexer = 0; + __pyx_t_5numpy_int64_t __pyx_v_idx; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_rev_indexer; + __Pyx_Buffer __pyx_pybuffer_rev_indexer; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + __pyx_t_5numpy_int64_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_reverse_indexer", 0); + __pyx_pybuffer_rev_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_rev_indexer.refcount = 0; + __pyx_pybuffernd_rev_indexer.data = NULL; + __pyx_pybuffernd_rev_indexer.rcbuffer = &__pyx_pybuffer_rev_indexer; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":510 + * + * cdef: + * Py_ssize_t i, n = len(indexer) # <<<<<<<<<<<<<< + * ndarray[int64_t] rev_indexer + * int64_t idx + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":514 + * int64_t idx + * + * rev_indexer = np.empty(length, dtype=np.int64) # <<<<<<<<<<<<<< + * rev_indexer.fill(-1) + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_rev_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_rev_indexer.diminfo[0].strides = __pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rev_indexer.diminfo[0].shape = __pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_rev_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":515 + * + * rev_indexer = np.empty(length, dtype=np.int64) + * rev_indexer.fill(-1) # <<<<<<<<<<<<<< + * for i in range(n): + * idx = indexer[i] + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rev_indexer), __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":516 + * rev_indexer = np.empty(length, dtype=np.int64) + * rev_indexer.fill(-1) + * for i in range(n): # <<<<<<<<<<<<<< + * idx = indexer[i] + * if idx != -1: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":517 + * rev_indexer.fill(-1) + * for i in range(n): + * idx = indexer[i] # <<<<<<<<<<<<<< + * if idx != -1: + * rev_indexer[idx] = i + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indexer.diminfo[0].strides)); + + /* "pandas/lib.pyx":518 + * for i in range(n): + * idx = indexer[i] + * if idx != -1: # <<<<<<<<<<<<<< + * rev_indexer[idx] = i + * + */ + __pyx_t_14 = ((__pyx_v_idx != -1) != 0); + if (__pyx_t_14) { + + /* "pandas/lib.pyx":519 + * idx = indexer[i] + * if idx != -1: + * rev_indexer[idx] = i # <<<<<<<<<<<<<< + * + * return rev_indexer + */ + __pyx_t_15 = __pyx_v_idx; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_rev_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_rev_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_rev_indexer.diminfo[0].strides) = __pyx_v_i; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":521 + * rev_indexer[idx] = i + * + * return rev_indexer # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_rev_indexer)); + __pyx_r = ((PyObject *)__pyx_v_rev_indexer); + goto __pyx_L0; + + /* "pandas/lib.pyx":497 + * return result + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): # <<<<<<<<<<<<<< + * """ + * Reverse indexing operation. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.get_reverse_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rev_indexer.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_rev_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":524 + * + * + * def has_infs_f4(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_49has_infs_f4(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_49has_infs_f4 = {__Pyx_NAMESTR("has_infs_f4"), (PyCFunction)__pyx_pw_6pandas_3lib_49has_infs_f4, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_49has_infs_f4(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("has_infs_f4 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_48has_infs_f4(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_48has_infs_f4(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float32_t __pyx_v_inf; + __pyx_t_5numpy_float32_t __pyx_v_neginf; + __pyx_t_5numpy_float32_t __pyx_v_val; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float32_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("has_infs_f4", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":526 + * def has_infs_f4(ndarray[float32_t] arr): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * float32_t inf, neginf, val + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":529 + * float32_t inf, neginf, val + * + * inf = np.inf # <<<<<<<<<<<<<< + * neginf = -inf + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_inf = __pyx_t_4; + + /* "pandas/lib.pyx":530 + * + * inf = np.inf + * neginf = -inf # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_neginf = (-__pyx_v_inf); + + /* "pandas/lib.pyx":532 + * neginf = -inf + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * if val == inf or val == neginf: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/lib.pyx":533 + * + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * if val == inf or val == neginf: + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/lib.pyx":534 + * for i in range(n): + * val = arr[i] + * if val == inf or val == neginf: # <<<<<<<<<<<<<< + * return True + * return False + */ + __pyx_t_8 = ((__pyx_v_val == __pyx_v_inf) != 0); + if (!__pyx_t_8) { + __pyx_t_9 = ((__pyx_v_val == __pyx_v_neginf) != 0); + __pyx_t_10 = __pyx_t_9; + } else { + __pyx_t_10 = __pyx_t_8; + } + if (__pyx_t_10) { + + /* "pandas/lib.pyx":535 + * val = arr[i] + * if val == inf or val == neginf: + * return True # <<<<<<<<<<<<<< + * return False + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + } + + /* "pandas/lib.pyx":536 + * if val == inf or val == neginf: + * return True + * return False # <<<<<<<<<<<<<< + * + * def has_infs_f8(ndarray[float64_t] arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "pandas/lib.pyx":524 + * + * + * def has_infs_f4(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.has_infs_f4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":538 + * return False + * + * def has_infs_f8(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_51has_infs_f8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_51has_infs_f8 = {__Pyx_NAMESTR("has_infs_f8"), (PyCFunction)__pyx_pw_6pandas_3lib_51has_infs_f8, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_51has_infs_f8(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("has_infs_f8 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_50has_infs_f8(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_50has_infs_f8(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_float64_t __pyx_v_inf; + __pyx_t_5numpy_float64_t __pyx_v_neginf; + __pyx_t_5numpy_float64_t __pyx_v_val; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("has_infs_f8", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":540 + * def has_infs_f8(ndarray[float64_t] arr): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * float64_t inf, neginf, val + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":543 + * float64_t inf, neginf, val + * + * inf = np.inf # <<<<<<<<<<<<<< + * neginf = -inf + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_inf = __pyx_t_4; + + /* "pandas/lib.pyx":544 + * + * inf = np.inf + * neginf = -inf # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_neginf = (-__pyx_v_inf); + + /* "pandas/lib.pyx":546 + * neginf = -inf + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * if val == inf or val == neginf: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/lib.pyx":547 + * + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * if val == inf or val == neginf: + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/lib.pyx":548 + * for i in range(n): + * val = arr[i] + * if val == inf or val == neginf: # <<<<<<<<<<<<<< + * return True + * return False + */ + __pyx_t_8 = ((__pyx_v_val == __pyx_v_inf) != 0); + if (!__pyx_t_8) { + __pyx_t_9 = ((__pyx_v_val == __pyx_v_neginf) != 0); + __pyx_t_10 = __pyx_t_9; + } else { + __pyx_t_10 = __pyx_t_8; + } + if (__pyx_t_10) { + + /* "pandas/lib.pyx":549 + * val = arr[i] + * if val == inf or val == neginf: + * return True # <<<<<<<<<<<<<< + * return False + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + } + + /* "pandas/lib.pyx":550 + * if val == inf or val == neginf: + * return True + * return False # <<<<<<<<<<<<<< + * + * def convert_timestamps(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "pandas/lib.pyx":538 + * return False + * + * def has_infs_f8(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.has_infs_f8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":552 + * return False + * + * def convert_timestamps(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * object val, f, result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_53convert_timestamps(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_53convert_timestamps = {__Pyx_NAMESTR("convert_timestamps"), (PyCFunction)__pyx_pw_6pandas_3lib_53convert_timestamps, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_53convert_timestamps(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_timestamps (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_52convert_timestamps(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_52convert_timestamps(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_cache = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_out = 0; + PyObject *__pyx_v_datetime = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_timestamps", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/lib.pyx":555 + * cdef: + * object val, f, result + * dict cache = {} # <<<<<<<<<<<<<< + * Py_ssize_t i, n = len(values) + * ndarray[object] out + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cache = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":556 + * object val, f, result + * dict cache = {} + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] out + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":561 + * # for HDFStore, a bit temporary but... + * + * from datetime import datetime # <<<<<<<<<<<<<< + * f = datetime.fromtimestamp + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_datetime = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":562 + * + * from datetime import datetime + * f = datetime.fromtimestamp # <<<<<<<<<<<<<< + * + * out = np.empty(n, dtype='O') + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_f = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":564 + * f = datetime.fromtimestamp + * + * out = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":566 + * out = np.empty(n, dtype='O') + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(values, i) + * if val in cache: + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_2; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/lib.pyx":567 + * + * for i in range(n): + * val = util.get_value_1d(values, i) # <<<<<<<<<<<<<< + * if val in cache: + * out[i] = cache[val] + */ + __pyx_t_5 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":568 + * for i in range(n): + * val = util.get_value_1d(values, i) + * if val in cache: # <<<<<<<<<<<<<< + * out[i] = cache[val] + * else: + */ + __pyx_t_12 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_cache, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":569 + * val = util.get_value_1d(values, i) + * if val in cache: + * out[i] = cache[val] # <<<<<<<<<<<<<< + * else: + * cache[val] = out[i] = f(val) + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_cache, __pyx_v_val); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":571 + * out[i] = cache[val] + * else: + * cache[val] = out[i] = f(val) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(PyDict_SetItem(__pyx_v_cache, __pyx_v_val, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":573 + * cache[val] = out[i] = f(val) + * + * return out # <<<<<<<<<<<<<< + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/lib.pyx":552 + * return False + * + * def convert_timestamps(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * object val, f, result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.convert_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_cache); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XDECREF(__pyx_v_datetime); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":575 + * return out + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indices) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_55maybe_indices_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_55maybe_indices_to_slice = {__Pyx_NAMESTR("maybe_indices_to_slice"), (PyCFunction)__pyx_pw_6pandas_3lib_55maybe_indices_to_slice, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_55maybe_indices_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_indices) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_indices_to_slice (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_54maybe_indices_to_slice(__pyx_self, ((PyArrayObject *)__pyx_v_indices)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_54maybe_indices_to_slice(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + long __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + long __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_indices_to_slice", 0); + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":577 + * def maybe_indices_to_slice(ndarray[int64_t] indices): + * cdef: + * Py_ssize_t i, n = len(indices) # <<<<<<<<<<<<<< + * + * if not n or indices[0] < 0: + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indices)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":579 + * Py_ssize_t i, n = len(indices) + * + * if not n or indices[0] < 0: # <<<<<<<<<<<<<< + * return indices + * + */ + __pyx_t_2 = ((!(__pyx_v_n != 0)) != 0); + if (!__pyx_t_2) { + __pyx_t_3 = 0; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_indices.diminfo[0].strides)) < 0) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":580 + * + * if not n or indices[0] < 0: + * return indices # <<<<<<<<<<<<<< + * + * for i in range(1, n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + __pyx_r = ((PyObject *)__pyx_v_indices); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":582 + * return indices + * + * for i in range(1, n): # <<<<<<<<<<<<<< + * if indices[i] - indices[i - 1] != 1: + * return indices + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":583 + * + * for i in range(1, n): + * if indices[i] - indices[i - 1] != 1: # <<<<<<<<<<<<<< + * return indices + * return slice(indices[0], indices[n - 1] + 1) + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (__pyx_v_i - 1); + __pyx_t_4 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_indices.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indices.diminfo[0].strides))) != 1) != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":584 + * for i in range(1, n): + * if indices[i] - indices[i - 1] != 1: + * return indices # <<<<<<<<<<<<<< + * return slice(indices[0], indices[n - 1] + 1) + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + __pyx_r = ((PyObject *)__pyx_v_indices); + goto __pyx_L0; + } + } + + /* "pandas/lib.pyx":585 + * if indices[i] - indices[i - 1] != 1: + * return indices + * return slice(indices[0], indices[n - 1] + 1) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = 0; + __pyx_t_4 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_indices.diminfo[0].strides))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = (__pyx_v_n - 1); + __pyx_t_4 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_PyInt_From_npy_int64(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_indices.diminfo[0].strides)) + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":575 + * return out + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indices) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_indices_to_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":588 + * + * + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(mask) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_57maybe_booleans_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_mask); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_57maybe_booleans_to_slice = {__Pyx_NAMESTR("maybe_booleans_to_slice"), (PyCFunction)__pyx_pw_6pandas_3lib_57maybe_booleans_to_slice, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_57maybe_booleans_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_mask) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_booleans_to_slice (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_56maybe_booleans_to_slice(__pyx_self, ((PyArrayObject *)__pyx_v_mask)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_56maybe_booleans_to_slice(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_end; + int __pyx_v_started; + int __pyx_v_finished; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_booleans_to_slice", 0); + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":590 + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): + * cdef: + * Py_ssize_t i, n = len(mask) # <<<<<<<<<<<<<< + * Py_ssize_t start, end + * bint started = 0, finished = 0 + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":592 + * Py_ssize_t i, n = len(mask) + * Py_ssize_t start, end + * bint started = 0, finished = 0 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_started = 0; + __pyx_v_finished = 0; + + /* "pandas/lib.pyx":594 + * bint started = 0, finished = 0 + * + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * if finished: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/lib.pyx":595 + * + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * if finished: + * return mask.view(np.bool_) + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":596 + * for i in range(n): + * if mask[i]: + * if finished: # <<<<<<<<<<<<<< + * return mask.view(np.bool_) + * if not started: + */ + __pyx_t_5 = (__pyx_v_finished != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":597 + * if mask[i]: + * if finished: + * return mask.view(np.bool_) # <<<<<<<<<<<<<< + * if not started: + * started = 1 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_bool); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":598 + * if finished: + * return mask.view(np.bool_) + * if not started: # <<<<<<<<<<<<<< + * started = 1 + * start = i + */ + __pyx_t_5 = ((!(__pyx_v_started != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":599 + * return mask.view(np.bool_) + * if not started: + * started = 1 # <<<<<<<<<<<<<< + * start = i + * else: + */ + __pyx_v_started = 1; + + /* "pandas/lib.pyx":600 + * if not started: + * started = 1 + * start = i # <<<<<<<<<<<<<< + * else: + * if finished: + */ + __pyx_v_start = __pyx_v_i; + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":602 + * start = i + * else: + * if finished: # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_5 = (__pyx_v_finished != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":603 + * else: + * if finished: + * continue # <<<<<<<<<<<<<< + * + * if started: + */ + goto __pyx_L3_continue; + } + + /* "pandas/lib.pyx":605 + * continue + * + * if started: # <<<<<<<<<<<<<< + * end = i + * finished = 1 + */ + __pyx_t_5 = (__pyx_v_started != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":606 + * + * if started: + * end = i # <<<<<<<<<<<<<< + * finished = 1 + * + */ + __pyx_v_end = __pyx_v_i; + + /* "pandas/lib.pyx":607 + * if started: + * end = i + * finished = 1 # <<<<<<<<<<<<<< + * + * if not started: + */ + __pyx_v_finished = 1; + goto __pyx_L9; + } + __pyx_L9:; + } + __pyx_L5:; + __pyx_L3_continue:; + } + + /* "pandas/lib.pyx":609 + * finished = 1 + * + * if not started: # <<<<<<<<<<<<<< + * return slice(0, 0) + * if not finished: + */ + __pyx_t_5 = ((!(__pyx_v_started != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":610 + * + * if not started: + * return slice(0, 0) # <<<<<<<<<<<<<< + * if not finished: + * return slice(start, None) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":611 + * if not started: + * return slice(0, 0) + * if not finished: # <<<<<<<<<<<<<< + * return slice(start, None) + * else: + */ + __pyx_t_5 = ((!(__pyx_v_finished != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":612 + * return slice(0, 0) + * if not finished: + * return slice(start, None) # <<<<<<<<<<<<<< + * else: + * return slice(start, end) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_7, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":614 + * return slice(start, None) + * else: + * return slice(start, end) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_end); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":588 + * + * + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(mask) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_booleans_to_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":619 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_59scalar_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_59scalar_compare = {__Pyx_NAMESTR("scalar_compare"), (PyCFunction)__pyx_pw_6pandas_3lib_59scalar_compare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_59scalar_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_op = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("scalar_compare (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_val,&__pyx_n_s_op,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scalar_compare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_val = values[1]; + __pyx_v_op = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.scalar_compare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_58scalar_compare(__pyx_self, __pyx_v_values, __pyx_v_val, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_58scalar_compare(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val, PyObject *__pyx_v_op) { + PyObject *__pyx_v_operator = NULL; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_flag; + PyObject *__pyx_v_x = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("scalar_compare", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":620 + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): + * import operator # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_operator = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":622 + * import operator + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] result + * int flag + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":627 + * object x + * + * if op is operator.lt: # <<<<<<<<<<<<<< + * flag = cpython.Py_LT + * elif op is operator.le: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_lt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":628 + * + * if op is operator.lt: + * flag = cpython.Py_LT # <<<<<<<<<<<<<< + * elif op is operator.le: + * flag = cpython.Py_LE + */ + __pyx_v_flag = Py_LT; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":629 + * if op is operator.lt: + * flag = cpython.Py_LT + * elif op is operator.le: # <<<<<<<<<<<<<< + * flag = cpython.Py_LE + * elif op is operator.gt: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_le); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":630 + * flag = cpython.Py_LT + * elif op is operator.le: + * flag = cpython.Py_LE # <<<<<<<<<<<<<< + * elif op is operator.gt: + * flag = cpython.Py_GT + */ + __pyx_v_flag = Py_LE; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":631 + * elif op is operator.le: + * flag = cpython.Py_LE + * elif op is operator.gt: # <<<<<<<<<<<<<< + * flag = cpython.Py_GT + * elif op is operator.ge: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_gt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":632 + * flag = cpython.Py_LE + * elif op is operator.gt: + * flag = cpython.Py_GT # <<<<<<<<<<<<<< + * elif op is operator.ge: + * flag = cpython.Py_GE + */ + __pyx_v_flag = Py_GT; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":633 + * elif op is operator.gt: + * flag = cpython.Py_GT + * elif op is operator.ge: # <<<<<<<<<<<<<< + * flag = cpython.Py_GE + * elif op is operator.eq: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_ge); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":634 + * flag = cpython.Py_GT + * elif op is operator.ge: + * flag = cpython.Py_GE # <<<<<<<<<<<<<< + * elif op is operator.eq: + * flag = cpython.Py_EQ + */ + __pyx_v_flag = Py_GE; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":635 + * elif op is operator.ge: + * flag = cpython.Py_GE + * elif op is operator.eq: # <<<<<<<<<<<<<< + * flag = cpython.Py_EQ + * elif op is operator.ne: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_eq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":636 + * flag = cpython.Py_GE + * elif op is operator.eq: + * flag = cpython.Py_EQ # <<<<<<<<<<<<<< + * elif op is operator.ne: + * flag = cpython.Py_NE + */ + __pyx_v_flag = Py_EQ; + goto __pyx_L3; + } + + /* "pandas/lib.pyx":637 + * elif op is operator.eq: + * flag = cpython.Py_EQ + * elif op is operator.ne: # <<<<<<<<<<<<<< + * flag = cpython.Py_NE + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_ne); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_v_op == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":638 + * flag = cpython.Py_EQ + * elif op is operator.ne: + * flag = cpython.Py_NE # <<<<<<<<<<<<<< + * else: + * raise ValueError('Unrecognized operator') + */ + __pyx_v_flag = Py_NE; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":640 + * flag = cpython.Py_NE + * else: + * raise ValueError('Unrecognized operator') # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool).view(np.uint8) + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/lib.pyx":642 + * raise ValueError('Unrecognized operator') + * + * result = np.empty(n, dtype=bool).view(np.uint8) # <<<<<<<<<<<<<< + * + * if flag == cpython.Py_NE: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":644 + * result = np.empty(n, dtype=bool).view(np.uint8) + * + * if flag == cpython.Py_NE: # <<<<<<<<<<<<<< + * for i in range(n): + * x = values[i] + */ + __pyx_t_3 = ((__pyx_v_flag == Py_NE) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":645 + * + * if flag == cpython.Py_NE: + * for i in range(n): # <<<<<<<<<<<<<< + * x = values[i] + * if _checknull(x): + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/lib.pyx":646 + * if flag == cpython.Py_NE: + * for i in range(n): + * x = values[i] # <<<<<<<<<<<<<< + * if _checknull(x): + * result[i] = True + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":647 + * for i in range(n): + * x = values[i] + * if _checknull(x): # <<<<<<<<<<<<<< + * result[i] = True + * else: + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":648 + * x = values[i] + * if _checknull(x): + * result[i] = True # <<<<<<<<<<<<<< + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) + */ + __pyx_t_15 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/lib.pyx":650 + * result[i] = True + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_3 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_val, __pyx_v_flag); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_3; + } + __pyx_L7:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/lib.pyx":652 + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * x = values[i] + * if _checknull(x): + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/lib.pyx":653 + * else: + * for i in range(n): + * x = values[i] # <<<<<<<<<<<<<< + * if _checknull(x): + * result[i] = False + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":654 + * for i in range(n): + * x = values[i] + * if _checknull(x): # <<<<<<<<<<<<<< + * result[i] = False + * else: + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":655 + * x = values[i] + * if _checknull(x): + * result[i] = False # <<<<<<<<<<<<<< + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) + */ + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/lib.pyx":657 + * result[i] = False + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) # <<<<<<<<<<<<<< + * + * return result.view(bool) + */ + __pyx_t_3 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_val, __pyx_v_flag); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_3; + } + __pyx_L10:; + } + } + __pyx_L4:; + + /* "pandas/lib.pyx":659 + * result[i] = cpython.PyObject_RichCompareBool(x, val, flag) + * + * return result.view(bool) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":619 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.scalar_compare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_operator); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":663 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_61vec_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_61vec_compare = {__Pyx_NAMESTR("vec_compare"), (PyCFunction)__pyx_pw_6pandas_3lib_61vec_compare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_61vec_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + PyObject *__pyx_v_op = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vec_compare (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_op,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vec_compare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_op = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.vec_compare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_60vec_compare(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_60vec_compare(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, PyObject *__pyx_v_op) { + PyObject *__pyx_v_operator = NULL; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_flag; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("vec_compare", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":664 + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): + * import operator # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_operator = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":666 + * import operator + * cdef: + * Py_ssize_t i, n = len(left) # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] result + * int flag + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":670 + * int flag + * + * if n != len(right): # <<<<<<<<<<<<<< + * raise ValueError('Arrays were different lengths: %d vs %d' + * % (n, len(right))) + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_v_n != __pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":672 + * if n != len(right): + * raise ValueError('Arrays were different lengths: %d vs %d' + * % (n, len(right))) # <<<<<<<<<<<<<< + * + * if op is operator.lt: + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Arrays_were_different_lengths_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":671 + * + * if n != len(right): + * raise ValueError('Arrays were different lengths: %d vs %d' # <<<<<<<<<<<<<< + * % (n, len(right))) + * + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":674 + * % (n, len(right))) + * + * if op is operator.lt: # <<<<<<<<<<<<<< + * flag = cpython.Py_LT + * elif op is operator.le: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_lt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":675 + * + * if op is operator.lt: + * flag = cpython.Py_LT # <<<<<<<<<<<<<< + * elif op is operator.le: + * flag = cpython.Py_LE + */ + __pyx_v_flag = Py_LT; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":676 + * if op is operator.lt: + * flag = cpython.Py_LT + * elif op is operator.le: # <<<<<<<<<<<<<< + * flag = cpython.Py_LE + * elif op is operator.gt: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_le); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_6 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":677 + * flag = cpython.Py_LT + * elif op is operator.le: + * flag = cpython.Py_LE # <<<<<<<<<<<<<< + * elif op is operator.gt: + * flag = cpython.Py_GT + */ + __pyx_v_flag = Py_LE; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":678 + * elif op is operator.le: + * flag = cpython.Py_LE + * elif op is operator.gt: # <<<<<<<<<<<<<< + * flag = cpython.Py_GT + * elif op is operator.ge: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_gt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":679 + * flag = cpython.Py_LE + * elif op is operator.gt: + * flag = cpython.Py_GT # <<<<<<<<<<<<<< + * elif op is operator.ge: + * flag = cpython.Py_GE + */ + __pyx_v_flag = Py_GT; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":680 + * elif op is operator.gt: + * flag = cpython.Py_GT + * elif op is operator.ge: # <<<<<<<<<<<<<< + * flag = cpython.Py_GE + * elif op is operator.eq: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_ge); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_6 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":681 + * flag = cpython.Py_GT + * elif op is operator.ge: + * flag = cpython.Py_GE # <<<<<<<<<<<<<< + * elif op is operator.eq: + * flag = cpython.Py_EQ + */ + __pyx_v_flag = Py_GE; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":682 + * elif op is operator.ge: + * flag = cpython.Py_GE + * elif op is operator.eq: # <<<<<<<<<<<<<< + * flag = cpython.Py_EQ + * elif op is operator.ne: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_eq); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":683 + * flag = cpython.Py_GE + * elif op is operator.eq: + * flag = cpython.Py_EQ # <<<<<<<<<<<<<< + * elif op is operator.ne: + * flag = cpython.Py_NE + */ + __pyx_v_flag = Py_EQ; + goto __pyx_L4; + } + + /* "pandas/lib.pyx":684 + * elif op is operator.eq: + * flag = cpython.Py_EQ + * elif op is operator.ne: # <<<<<<<<<<<<<< + * flag = cpython.Py_NE + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_operator, __pyx_n_s_ne); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = (__pyx_v_op == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_6 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":685 + * flag = cpython.Py_EQ + * elif op is operator.ne: + * flag = cpython.Py_NE # <<<<<<<<<<<<<< + * else: + * raise ValueError('Unrecognized operator') + */ + __pyx_v_flag = Py_NE; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/lib.pyx":687 + * flag = cpython.Py_NE + * else: + * raise ValueError('Unrecognized operator') # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool).view(np.uint8) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + + /* "pandas/lib.pyx":689 + * raise ValueError('Unrecognized operator') + * + * result = np.empty(n, dtype=bool).view(np.uint8) # <<<<<<<<<<<<<< + * + * if flag == cpython.Py_NE: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":691 + * result = np.empty(n, dtype=bool).view(np.uint8) + * + * if flag == cpython.Py_NE: # <<<<<<<<<<<<<< + * for i in range(n): + * x = left[i] + */ + __pyx_t_3 = ((__pyx_v_flag == Py_NE) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":692 + * + * if flag == cpython.Py_NE: + * for i in range(n): # <<<<<<<<<<<<<< + * x = left[i] + * y = right[i] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/lib.pyx":693 + * if flag == cpython.Py_NE: + * for i in range(n): + * x = left[i] # <<<<<<<<<<<<<< + * y = right[i] + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":694 + * for i in range(n): + * x = left[i] + * y = right[i] # <<<<<<<<<<<<<< + * + * if _checknull(x) or _checknull(y): + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":696 + * y = right[i] + * + * if _checknull(x) or _checknull(y): # <<<<<<<<<<<<<< + * result[i] = True + * else: + */ + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (!__pyx_t_3) { + __pyx_t_6 = (__pyx_f_4util__checknull(__pyx_v_y) != 0); + __pyx_t_16 = __pyx_t_6; + } else { + __pyx_t_16 = __pyx_t_3; + } + if (__pyx_t_16) { + + /* "pandas/lib.pyx":697 + * + * if _checknull(x) or _checknull(y): + * result[i] = True # <<<<<<<<<<<<<< + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) + */ + __pyx_t_17 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/lib.pyx":699 + * result[i] = True + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_16 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_y, __pyx_v_flag); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_16; + } + __pyx_L8:; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":701 + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * x = left[i] + * y = right[i] + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_2; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/lib.pyx":702 + * else: + * for i in range(n): + * x = left[i] # <<<<<<<<<<<<<< + * y = right[i] + * + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":703 + * for i in range(n): + * x = left[i] + * y = right[i] # <<<<<<<<<<<<<< + * + * if _checknull(x) or _checknull(y): + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":705 + * y = right[i] + * + * if _checknull(x) or _checknull(y): # <<<<<<<<<<<<<< + * result[i] = False + * else: + */ + __pyx_t_16 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (!__pyx_t_16) { + __pyx_t_3 = (__pyx_f_4util__checknull(__pyx_v_y) != 0); + __pyx_t_6 = __pyx_t_3; + } else { + __pyx_t_6 = __pyx_t_16; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":706 + * + * if _checknull(x) or _checknull(y): + * result[i] = False # <<<<<<<<<<<<<< + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) + */ + __pyx_t_21 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/lib.pyx":708 + * result[i] = False + * else: + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) # <<<<<<<<<<<<<< + * + * return result.view(bool) + */ + __pyx_t_6 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_y, __pyx_v_flag); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_6; + } + __pyx_L11:; + } + } + __pyx_L5:; + + /* "pandas/lib.pyx":710 + * result[i] = cpython.PyObject_RichCompareBool(x, y, flag) + * + * return result.view(bool) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":663 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.vec_compare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_operator); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":715 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_binop(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_63scalar_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_63scalar_binop = {__Pyx_NAMESTR("scalar_binop"), (PyCFunction)__pyx_pw_6pandas_3lib_63scalar_binop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_63scalar_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_op = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("scalar_binop (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_val,&__pyx_n_s_op,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scalar_binop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_val = values[1]; + __pyx_v_op = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.scalar_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_62scalar_binop(__pyx_self, __pyx_v_values, __pyx_v_val, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_62scalar_binop(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_val, PyObject *__pyx_v_op) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_x = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("scalar_binop", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":717 + * def scalar_binop(ndarray[object] values, object val, object op): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] result + * object x + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":721 + * object x + * + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * if util._checknull(val): + * result.fill(val) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":722 + * + * result = np.empty(n, dtype=object) + * if util._checknull(val): # <<<<<<<<<<<<<< + * result.fill(val) + * return result + */ + __pyx_t_11 = (__pyx_f_4util__checknull(__pyx_v_val) != 0); + if (__pyx_t_11) { + + /* "pandas/lib.pyx":723 + * result = np.empty(n, dtype=object) + * if util._checknull(val): + * result.fill(val) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/lib.pyx":724 + * if util._checknull(val): + * result.fill(val) + * return result # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":726 + * return result + * + * for i in range(n): # <<<<<<<<<<<<<< + * x = values[i] + * if util._checknull(x): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":727 + * + * for i in range(n): + * x = values[i] # <<<<<<<<<<<<<< + * if util._checknull(x): + * result[i] = x + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/lib.pyx":728 + * for i in range(n): + * x = values[i] + * if util._checknull(x): # <<<<<<<<<<<<<< + * result[i] = x + * else: + */ + __pyx_t_11 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (__pyx_t_11) { + + /* "pandas/lib.pyx":729 + * x = values[i] + * if util._checknull(x): + * result[i] = x # <<<<<<<<<<<<<< + * else: + * result[i] = op(x, val) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_x); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_x; + __Pyx_GIVEREF(*__pyx_t_15); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/lib.pyx":731 + * result[i] = x + * else: + * result[i] = op(x, val) # <<<<<<<<<<<<<< + * + * return maybe_convert_bool(result) + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L6:; + } + + /* "pandas/lib.pyx":733 + * result[i] = op(x, val) + * + * return maybe_convert_bool(result) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":715 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_binop(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.scalar_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":737 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_65vec_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_65vec_binop = {__Pyx_NAMESTR("vec_binop"), (PyCFunction)__pyx_pw_6pandas_3lib_65vec_binop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_65vec_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_left = 0; + PyArrayObject *__pyx_v_right = 0; + PyObject *__pyx_v_op = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("vec_binop (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,&__pyx_n_s_op,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vec_binop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_left = ((PyArrayObject *)values[0]); + __pyx_v_right = ((PyArrayObject *)values[1]); + __pyx_v_op = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_64vec_binop(__pyx_self, __pyx_v_left, __pyx_v_right, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_64vec_binop(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_left, PyArrayObject *__pyx_v_right, PyObject *__pyx_v_op) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_left; + __Pyx_Buffer __pyx_pybuffer_left; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_right; + __Pyx_Buffer __pyx_pybuffer_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyObject **__pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("vec_binop", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_left.pybuffer.buf = NULL; + __pyx_pybuffer_left.refcount = 0; + __pyx_pybuffernd_left.data = NULL; + __pyx_pybuffernd_left.rcbuffer = &__pyx_pybuffer_left; + __pyx_pybuffer_right.pybuffer.buf = NULL; + __pyx_pybuffer_right.refcount = 0; + __pyx_pybuffernd_right.data = NULL; + __pyx_pybuffernd_right.rcbuffer = &__pyx_pybuffer_right; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left.rcbuffer->pybuffer, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_left.diminfo[0].strides = __pyx_pybuffernd_left.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left.diminfo[0].shape = __pyx_pybuffernd_left.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right.rcbuffer->pybuffer, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_right.diminfo[0].strides = __pyx_pybuffernd_right.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right.diminfo[0].shape = __pyx_pybuffernd_right.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":739 + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): + * cdef: + * Py_ssize_t i, n = len(left) # <<<<<<<<<<<<<< + * ndarray[object] result + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":742 + * ndarray[object] result + * + * if n != len(right): # <<<<<<<<<<<<<< + * raise ValueError('Arrays were different lengths: %d vs %d' + * % (n, len(right))) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_v_n != __pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":744 + * if n != len(right): + * raise ValueError('Arrays were different lengths: %d vs %d' + * % (n, len(right))) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=object) + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Arrays_were_different_lengths_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":743 + * + * if n != len(right): + * raise ValueError('Arrays were different lengths: %d vs %d' # <<<<<<<<<<<<<< + * % (n, len(right))) + * + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":746 + * % (n, len(right))) + * + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":748 + * result = np.empty(n, dtype=object) + * + * for i in range(n): # <<<<<<<<<<<<<< + * x = left[i] + * y = right[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":749 + * + * for i in range(n): + * x = left[i] # <<<<<<<<<<<<<< + * y = right[i] + * try: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_left.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_left.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":750 + * for i in range(n): + * x = left[i] + * y = right[i] # <<<<<<<<<<<<<< + * try: + * result[i] = op(x, y) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_right.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_right.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":751 + * x = left[i] + * y = right[i] + * try: # <<<<<<<<<<<<<< + * result[i] = op(x, y) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/lib.pyx":752 + * y = right[i] + * try: + * result[i] = op(x, y) # <<<<<<<<<<<<<< + * except TypeError: + * if util._checknull(x): + */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_y); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_y); + __Pyx_GIVEREF(__pyx_v_y); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_t_4; + __Pyx_GIVEREF(*__pyx_t_16); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/lib.pyx":753 + * try: + * result[i] = op(x, y) + * except TypeError: # <<<<<<<<<<<<<< + * if util._checknull(x): + * result[i] = x + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/lib.pyx":754 + * result[i] = op(x, y) + * except TypeError: + * if util._checknull(x): # <<<<<<<<<<<<<< + * result[i] = x + * elif util._checknull(y): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_x) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":755 + * except TypeError: + * if util._checknull(x): + * result[i] = x # <<<<<<<<<<<<<< + * elif util._checknull(y): + * result[i] = y + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_v_x); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_v_x; + __Pyx_GIVEREF(*__pyx_t_16); + goto __pyx_L16; + } + + /* "pandas/lib.pyx":756 + * if util._checknull(x): + * result[i] = x + * elif util._checknull(y): # <<<<<<<<<<<<<< + * result[i] = y + * else: + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_y) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":757 + * result[i] = x + * elif util._checknull(y): + * result[i] = y # <<<<<<<<<<<<<< + * else: + * raise + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_v_y); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_v_y; + __Pyx_GIVEREF(*__pyx_t_16); + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/lib.pyx":759 + * result[i] = y + * else: + * raise # <<<<<<<<<<<<<< + * + * return maybe_convert_bool(result) + */ + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_3); + __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + } + __pyx_L16:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + __pyx_L13_try_end:; + } + } + + /* "pandas/lib.pyx":761 + * raise + * + * return maybe_convert_bool(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_bool); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":737 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":764 + * + * + * def astype_intsafe(ndarray[object] arr, new_dtype): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_67astype_intsafe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_67astype_intsafe = {__Pyx_NAMESTR("astype_intsafe"), (PyCFunction)__pyx_pw_6pandas_3lib_67astype_intsafe, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_67astype_intsafe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_new_dtype = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("astype_intsafe (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_new_dtype,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_dtype)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("astype_intsafe", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "astype_intsafe") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_new_dtype = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("astype_intsafe", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.astype_intsafe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_66astype_intsafe(__pyx_self, __pyx_v_arr, __pyx_v_new_dtype); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_66astype_intsafe(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_new_dtype) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_v = 0; + int __pyx_v_is_datelike; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("astype_intsafe", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":766 + * def astype_intsafe(ndarray[object] arr, new_dtype): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * object v + * bint is_datelike + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":772 + * + * # on 32-bit, 1.6.2 numpy M8[ns] is a subdtype of integer, which is weird + * is_datelike = new_dtype in ['M8[ns]','m8[ns]'] # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=new_dtype) + */ + __Pyx_INCREF(__pyx_v_new_dtype); + __pyx_t_2 = __pyx_v_new_dtype; + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_M8_ns, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_3) { + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_m8_ns, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_is_datelike = __pyx_t_5; + + /* "pandas/lib.pyx":774 + * is_datelike = new_dtype in ['M8[ns]','m8[ns]'] + * + * result = np.empty(n, dtype=new_dtype) # <<<<<<<<<<<<<< + * for i in range(n): + * v = arr[i] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_new_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":775 + * + * result = np.empty(n, dtype=new_dtype) + * for i in range(n): # <<<<<<<<<<<<<< + * v = arr[i] + * if is_datelike and checknull(v): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/lib.pyx":776 + * result = np.empty(n, dtype=new_dtype) + * for i in range(n): + * v = arr[i] # <<<<<<<<<<<<<< + * if is_datelike and checknull(v): + * result[i] = NPY_NAT + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":777 + * for i in range(n): + * v = arr[i] + * if is_datelike and checknull(v): # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * else: + */ + __pyx_t_5 = __pyx_v_is_datelike; + if (__pyx_t_5) { + __pyx_t_8 = __pyx_f_6pandas_3lib_checknull(__pyx_v_v, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "pandas/lib.pyx":778 + * v = arr[i] + * if is_datelike and checknull(v): + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * else: + * util.set_value_at(result, i, v) + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_3lib_NPY_NAT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_result), __pyx_v_i, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":780 + * result[i] = NPY_NAT + * else: + * util.set_value_at(result, i, v) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __pyx_f_4util_set_value_at(__pyx_v_result, __pyx_t_8, __pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":782 + * util.set_value_at(result, i, v) + * + * return result # <<<<<<<<<<<<<< + * + * cpdef ndarray[object] astype_str(ndarray arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":764 + * + * + * def astype_intsafe(ndarray[object] arr, new_dtype): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.astype_intsafe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":784 + * return result + * + * cpdef ndarray[object] astype_str(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + +static PyObject *__pyx_pw_6pandas_3lib_69astype_str(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_3lib_astype_str(PyArrayObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("astype_str", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":786 + * cpdef ndarray[object] astype_str(ndarray arr): + * cdef: + * Py_ssize_t i, n = arr.size # <<<<<<<<<<<<<< + * ndarray[object] result = np.empty(n, dtype=object) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":787 + * cdef: + * Py_ssize_t i, n = arr.size + * ndarray[object] result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":789 + * ndarray[object] result = np.empty(n, dtype=object) + * + * for i in range(n): # <<<<<<<<<<<<<< + * util.set_value_at(result, i, str(arr[i])) + * + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_2; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":790 + * + * for i in range(n): + * util.set_value_at(result, i, str(arr[i])) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_f_4util_set_value_at(((PyArrayObject *)__pyx_v_result), __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "pandas/lib.pyx":792 + * util.set_value_at(result, i, str(arr[i])) + * + * return result # <<<<<<<<<<<<<< + * + * def clean_index_list(list obj): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyArrayObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":784 + * return result + * + * cpdef ndarray[object] astype_str(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.astype_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_69astype_str(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_69astype_str(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("astype_str (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_68astype_str(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_68astype_str(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("astype_str", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_3lib_astype_str(__pyx_v_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.astype_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":794 + * return result + * + * def clean_index_list(list obj): # <<<<<<<<<<<<<< + * ''' + * Utility used in pandas.core.index._ensure_index + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_71clean_index_list(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6pandas_3lib_70clean_index_list[] = "\n Utility used in pandas.core.index._ensure_index\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_71clean_index_list = {__Pyx_NAMESTR("clean_index_list"), (PyCFunction)__pyx_pw_6pandas_3lib_71clean_index_list, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_70clean_index_list)}; +static PyObject *__pyx_pw_6pandas_3lib_71clean_index_list(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clean_index_list (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_70clean_index_list(__pyx_self, ((PyObject*)__pyx_v_obj)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_70clean_index_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyArrayObject *__pyx_v_converted = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_v = 0; + int __pyx_v_all_arrays; + __Pyx_LocalBuf_ND __pyx_pybuffernd_converted; + __Pyx_Buffer __pyx_pybuffer_converted; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + PyObject **__pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("clean_index_list", 0); + __pyx_pybuffer_converted.pybuffer.buf = NULL; + __pyx_pybuffer_converted.refcount = 0; + __pyx_pybuffernd_converted.data = NULL; + __pyx_pybuffernd_converted.rcbuffer = &__pyx_pybuffer_converted; + + /* "pandas/lib.pyx":800 + * cdef: + * ndarray[object] converted + * Py_ssize_t i, n = len(obj) # <<<<<<<<<<<<<< + * object v + * bint all_arrays = 1 + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":802 + * Py_ssize_t i, n = len(obj) + * object v + * bint all_arrays = 1 # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_v_all_arrays = 1; + + /* "pandas/lib.pyx":804 + * bint all_arrays = 1 + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = obj[i] + * if not (PyList_Check(v) or np.PyArray_Check(v)): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/lib.pyx":805 + * + * for i in range(n): + * v = obj[i] # <<<<<<<<<<<<<< + * if not (PyList_Check(v) or np.PyArray_Check(v)): + * all_arrays = 0 + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":806 + * for i in range(n): + * v = obj[i] + * if not (PyList_Check(v) or np.PyArray_Check(v)): # <<<<<<<<<<<<<< + * all_arrays = 0 + * break + */ + __pyx_t_4 = (PyList_Check(__pyx_v_v) != 0); + if (!__pyx_t_4) { + __pyx_t_5 = (PyArray_Check(__pyx_v_v) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + __pyx_t_4 = ((!__pyx_t_6) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":807 + * v = obj[i] + * if not (PyList_Check(v) or np.PyArray_Check(v)): + * all_arrays = 0 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_all_arrays = 0; + + /* "pandas/lib.pyx":808 + * if not (PyList_Check(v) or np.PyArray_Check(v)): + * all_arrays = 0 + * break # <<<<<<<<<<<<<< + * + * if all_arrays: + */ + goto __pyx_L4_break; + } + } + __pyx_L4_break:; + + /* "pandas/lib.pyx":810 + * break + * + * if all_arrays: # <<<<<<<<<<<<<< + * return obj, all_arrays + * + */ + __pyx_t_4 = (__pyx_v_all_arrays != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":811 + * + * if all_arrays: + * return obj, all_arrays # <<<<<<<<<<<<<< + * + * converted = np.empty(n, dtype=object) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_all_arrays); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":813 + * return obj, all_arrays + * + * converted = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * v = obj[i] + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_converted.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_converted.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_converted.rcbuffer->pybuffer, (PyObject*)__pyx_v_converted, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_converted.diminfo[0].strides = __pyx_pybuffernd_converted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_converted.diminfo[0].shape = __pyx_pybuffernd_converted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_converted = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/lib.pyx":814 + * + * converted = np.empty(n, dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * v = obj[i] + * if PyList_Check(v) or np.PyArray_Check(v): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/lib.pyx":815 + * converted = np.empty(n, dtype=object) + * for i in range(n): + * v = obj[i] # <<<<<<<<<<<<<< + * if PyList_Check(v) or np.PyArray_Check(v): + * converted[i] = tuple(v) + */ + if (unlikely(__pyx_v_obj == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/lib.pyx":816 + * for i in range(n): + * v = obj[i] + * if PyList_Check(v) or np.PyArray_Check(v): # <<<<<<<<<<<<<< + * converted[i] = tuple(v) + * else: + */ + __pyx_t_4 = (PyList_Check(__pyx_v_v) != 0); + if (!__pyx_t_4) { + __pyx_t_6 = (PyArray_Check(__pyx_v_v) != 0); + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_4; + } + if (__pyx_t_5) { + + /* "pandas/lib.pyx":817 + * v = obj[i] + * if PyList_Check(v) or np.PyArray_Check(v): + * converted[i] = tuple(v) # <<<<<<<<<<<<<< + * else: + * converted[i] = v + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_converted.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_converted.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_converted.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_converted.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_t_7; + __Pyx_GIVEREF(*__pyx_t_16); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/lib.pyx":819 + * converted[i] = tuple(v) + * else: + * converted[i] = v # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(converted), 0 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_converted.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_converted.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_converted.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_converted.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_v_v); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_v_v; + __Pyx_GIVEREF(*__pyx_t_16); + } + __pyx_L9:; + } + + /* "pandas/lib.pyx":821 + * converted[i] = v + * + * return maybe_convert_objects(converted), 0 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_converted)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_converted)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_converted)); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_8 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":794 + * return result + * + * def clean_index_list(list obj): # <<<<<<<<<<<<<< + * ''' + * Utility used in pandas.core.index._ensure_index + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_converted.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.clean_index_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_converted.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_converted); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":825 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def max_len_string_array(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * """ return the maximum size of elements in a 1-dim string array """ + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_73max_len_string_array(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_3lib_72max_len_string_array[] = " return the maximum size of elements in a 1-dim string array "; +static PyMethodDef __pyx_mdef_6pandas_3lib_73max_len_string_array = {__Pyx_NAMESTR("max_len_string_array"), (PyCFunction)__pyx_pw_6pandas_3lib_73max_len_string_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_72max_len_string_array)}; +static PyObject *__pyx_pw_6pandas_3lib_73max_len_string_array(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("max_len_string_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_72max_len_string_array(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_72max_len_string_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + int __pyx_v_i; + int __pyx_v_m; + int __pyx_v_l; + PyObject *__pyx_v_length = 0; + PyObject *__pyx_v_v = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("max_len_string_array", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":829 + * cdef: + * int i, m, l + * length = arr.shape[0] # <<<<<<<<<<<<<< + * object v + * + */ + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_arr->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_length = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":832 + * object v + * + * m = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < length: + * v = arr[i] + */ + __pyx_v_m = 0; + + /* "pandas/lib.pyx":833 + * + * m = 0 + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * v = arr[i] + * if PyString_Check(v) or PyBytes_Check(v): + */ + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_length); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/lib.pyx":834 + * m = 0 + * for i from 0 <= i < length: + * v = arr[i] # <<<<<<<<<<<<<< + * if PyString_Check(v) or PyBytes_Check(v): + * l = len(v) + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":835 + * for i from 0 <= i < length: + * v = arr[i] + * if PyString_Check(v) or PyBytes_Check(v): # <<<<<<<<<<<<<< + * l = len(v) + * + */ + __pyx_t_4 = (PyString_Check(__pyx_v_v) != 0); + if (!__pyx_t_4) { + __pyx_t_5 = (PyBytes_Check(__pyx_v_v) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":836 + * v = arr[i] + * if PyString_Check(v) or PyBytes_Check(v): + * l = len(v) # <<<<<<<<<<<<<< + * + * if l > m: + */ + __pyx_t_7 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_l = __pyx_t_7; + + /* "pandas/lib.pyx":838 + * l = len(v) + * + * if l > m: # <<<<<<<<<<<<<< + * m = l + * + */ + __pyx_t_6 = ((__pyx_v_l > __pyx_v_m) != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":839 + * + * if l > m: + * m = l # <<<<<<<<<<<<<< + * + * return m + */ + __pyx_v_m = __pyx_v_l; + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":841 + * m = l + * + * return m # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":825 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def max_len_string_array(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * """ return the maximum size of elements in a 1-dim string array """ + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.max_len_string_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":845 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def string_array_replace_from_nan_rep(ndarray[object, ndim=1] arr, object nan_rep, object replace = None): # <<<<<<<<<<<<<< + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_75string_array_replace_from_nan_rep(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_74string_array_replace_from_nan_rep[] = " replace the values in the array with replacement if they are nan_rep; return the same array "; +static PyMethodDef __pyx_mdef_6pandas_3lib_75string_array_replace_from_nan_rep = {__Pyx_NAMESTR("string_array_replace_from_nan_rep"), (PyCFunction)__pyx_pw_6pandas_3lib_75string_array_replace_from_nan_rep, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_74string_array_replace_from_nan_rep)}; +static PyObject *__pyx_pw_6pandas_3lib_75string_array_replace_from_nan_rep(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_nan_rep = 0; + PyObject *__pyx_v_replace = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("string_array_replace_from_nan_rep (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_nan_rep,&__pyx_n_s_replace,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nan_rep)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("string_array_replace_from_nan_rep", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_replace); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "string_array_replace_from_nan_rep") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_nan_rep = values[1]; + __pyx_v_replace = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("string_array_replace_from_nan_rep", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.string_array_replace_from_nan_rep", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_74string_array_replace_from_nan_rep(__pyx_self, __pyx_v_arr, __pyx_v_nan_rep, __pyx_v_replace); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_74string_array_replace_from_nan_rep(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_nan_rep, PyObject *__pyx_v_replace) { + int __pyx_v_length; + int __pyx_v_i; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject **__pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("string_array_replace_from_nan_rep", 0); + __Pyx_INCREF(__pyx_v_replace); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":848 + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + * cdef int length = arr.shape[0], i = 0 # <<<<<<<<<<<<<< + * if replace is None: + * replace = np.nan + */ + __pyx_v_length = (__pyx_v_arr->dimensions[0]); + __pyx_v_i = 0; + + /* "pandas/lib.pyx":849 + * + * cdef int length = arr.shape[0], i = 0 + * if replace is None: # <<<<<<<<<<<<<< + * replace = np.nan + * + */ + __pyx_t_1 = (__pyx_v_replace == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":850 + * cdef int length = arr.shape[0], i = 0 + * if replace is None: + * replace = np.nan # <<<<<<<<<<<<<< + * + * for i from 0 <= i < length: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_replace, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":852 + * replace = np.nan + * + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * if arr[i] == nan_rep: + * arr[i] = replace + */ + __pyx_t_5 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { + + /* "pandas/lib.pyx":853 + * + * for i from 0 <= i < length: + * if arr[i] == nan_rep: # <<<<<<<<<<<<<< + * arr[i] = replace + * + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_nan_rep, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/lib.pyx":854 + * for i from 0 <= i < length: + * if arr[i] == nan_rep: + * arr[i] = replace # <<<<<<<<<<<<<< + * + * return arr + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_8); + __Pyx_INCREF(__pyx_v_replace); __Pyx_DECREF(*__pyx_t_8); + *__pyx_t_8 = __pyx_v_replace; + __Pyx_GIVEREF(*__pyx_t_8); + goto __pyx_L6; + } + __pyx_L6:; + } + + /* "pandas/lib.pyx":856 + * arr[i] = replace + * + * return arr # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/lib.pyx":845 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def string_array_replace_from_nan_rep(ndarray[object, ndim=1] arr, object nan_rep, object replace = None): # <<<<<<<<<<<<<< + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.string_array_replace_from_nan_rep", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_replace); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":860 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def write_csv_rows(list data, list data_index, int nlevels, list cols, object writer): # <<<<<<<<<<<<<< + * + * cdef int N, j, i, ncols + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_77write_csv_rows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_77write_csv_rows = {__Pyx_NAMESTR("write_csv_rows"), (PyCFunction)__pyx_pw_6pandas_3lib_77write_csv_rows, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_77write_csv_rows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_data = 0; + PyObject *__pyx_v_data_index = 0; + int __pyx_v_nlevels; + PyObject *__pyx_v_cols = 0; + PyObject *__pyx_v_writer = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_csv_rows (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_data_index,&__pyx_n_s_nlevels,&__pyx_n_s_cols,&__pyx_n_s_writer,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data_index)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nlevels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_writer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_csv_rows") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_data = ((PyObject*)values[0]); + __pyx_v_data_index = ((PyObject*)values[1]); + __pyx_v_nlevels = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nlevels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_cols = ((PyObject*)values[3]); + __pyx_v_writer = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write_csv_rows", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.write_csv_rows", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyList_Type), 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data_index), (&PyList_Type), 1, "data_index", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cols), (&PyList_Type), 1, "cols", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_76write_csv_rows(__pyx_self, __pyx_v_data, __pyx_v_data_index, __pyx_v_nlevels, __pyx_v_cols, __pyx_v_writer); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_76write_csv_rows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_data_index, int __pyx_v_nlevels, PyObject *__pyx_v_cols, PyObject *__pyx_v_writer) { + int __pyx_v_N; + int __pyx_v_j; + int __pyx_v_i; + int __pyx_v_ncols; + PyObject *__pyx_v_rows = 0; + PyObject *__pyx_v_row = NULL; + CYTHON_UNUSED int __pyx_v_x; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write_csv_rows", 0); + + /* "pandas/lib.pyx":867 + * + * # In crude testing, N>100 yields little marginal improvement + * N=100 # <<<<<<<<<<<<<< + * + * # pre-allocate rows + */ + __pyx_v_N = 100; + + /* "pandas/lib.pyx":870 + * + * # pre-allocate rows + * ncols = len(cols) # <<<<<<<<<<<<<< + * rows = [[None]*(nlevels+ncols) for x in range(N)] + * + */ + if (unlikely(__pyx_v_cols == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_cols); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ncols = __pyx_t_1; + + /* "pandas/lib.pyx":871 + * # pre-allocate rows + * ncols = len(cols) + * rows = [[None]*(nlevels+ncols) for x in range(N)] # <<<<<<<<<<<<<< + * + * j = -1 + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_N; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_x = __pyx_t_4; + __pyx_t_5 = PyList_New(1 * (((__pyx_v_nlevels + __pyx_v_ncols)<0) ? 0:(__pyx_v_nlevels + __pyx_v_ncols))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (__pyx_v_nlevels + __pyx_v_ncols); __pyx_temp++) { + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_5, __pyx_temp, Py_None); + __Pyx_GIVEREF(Py_None); + } + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_v_rows = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":873 + * rows = [[None]*(nlevels+ncols) for x in range(N)] + * + * j = -1 # <<<<<<<<<<<<<< + * if nlevels == 1: + * for j in range(len(data_index)): + */ + __pyx_v_j = -1; + + /* "pandas/lib.pyx":874 + * + * j = -1 + * if nlevels == 1: # <<<<<<<<<<<<<< + * for j in range(len(data_index)): + * row = rows[j % N] + */ + __pyx_t_6 = ((__pyx_v_nlevels == 1) != 0); + if (__pyx_t_6) { + + /* "pandas/lib.pyx":875 + * j = -1 + * if nlevels == 1: + * for j in range(len(data_index)): # <<<<<<<<<<<<<< + * row = rows[j % N] + * row[0] = data_index[j] + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_data_index); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_j = __pyx_t_3; + + /* "pandas/lib.pyx":876 + * if nlevels == 1: + * for j in range(len(data_index)): + * row = rows[j % N] # <<<<<<<<<<<<<< + * row[0] = data_index[j] + * for i in range(ncols): + */ + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_mod_int(__pyx_v_j, __pyx_v_N); + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_rows, __pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":877 + * for j in range(len(data_index)): + * row = rows[j % N] + * row[0] = data_index[j] # <<<<<<<<<<<<<< + * for i in range(ncols): + * row[1+i] = data[i][j] + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_data_index, __pyx_v_j); + __Pyx_INCREF(__pyx_t_2); + if (unlikely(__Pyx_SetItemInt(__pyx_v_row, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":878 + * row = rows[j % N] + * row[0] = data_index[j] + * for i in range(ncols): # <<<<<<<<<<<<<< + * row[1+i] = data[i][j] + * + */ + __pyx_t_4 = __pyx_v_ncols; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_4; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":879 + * row[0] = data_index[j] + * for i in range(ncols): + * row[1+i] = data[i][j] # <<<<<<<<<<<<<< + * + * if j >= N-1 and j % N == N-1: + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_data, __pyx_v_i), __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (1 + __pyx_v_i); + if (unlikely(__Pyx_SetItemInt(__pyx_v_row, __pyx_t_8, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "pandas/lib.pyx":881 + * row[1+i] = data[i][j] + * + * if j >= N-1 and j % N == N-1: # <<<<<<<<<<<<<< + * writer.writerows(rows) + * elif nlevels > 1: + */ + __pyx_t_6 = ((__pyx_v_j >= (__pyx_v_N - 1)) != 0); + if (__pyx_t_6) { + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = ((__Pyx_mod_int(__pyx_v_j, __pyx_v_N) == (__pyx_v_N - 1)) != 0); + __pyx_t_10 = __pyx_t_9; + } else { + __pyx_t_10 = __pyx_t_6; + } + if (__pyx_t_10) { + + /* "pandas/lib.pyx":882 + * + * if j >= N-1 and j % N == N-1: + * writer.writerows(rows) # <<<<<<<<<<<<<< + * elif nlevels > 1: + * for j in range(len(data_index)): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_writerows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_rows); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_rows); + __Pyx_GIVEREF(__pyx_v_rows); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L10; + } + __pyx_L10:; + } + goto __pyx_L5; + } + + /* "pandas/lib.pyx":883 + * if j >= N-1 and j % N == N-1: + * writer.writerows(rows) + * elif nlevels > 1: # <<<<<<<<<<<<<< + * for j in range(len(data_index)): + * row = rows[j % N] + */ + __pyx_t_10 = ((__pyx_v_nlevels > 1) != 0); + if (__pyx_t_10) { + + /* "pandas/lib.pyx":884 + * writer.writerows(rows) + * elif nlevels > 1: + * for j in range(len(data_index)): # <<<<<<<<<<<<<< + * row = rows[j % N] + * row[:nlevels] = list(data_index[j]) + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_data_index); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_j = __pyx_t_3; + + /* "pandas/lib.pyx":885 + * elif nlevels > 1: + * for j in range(len(data_index)): + * row = rows[j % N] # <<<<<<<<<<<<<< + * row[:nlevels] = list(data_index[j]) + * for i in range(ncols): + */ + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_mod_int(__pyx_v_j, __pyx_v_N); + __pyx_t_11 = PyList_GET_ITEM(__pyx_v_rows, __pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/lib.pyx":886 + * for j in range(len(data_index)): + * row = rows[j % N] + * row[:nlevels] = list(data_index[j]) # <<<<<<<<<<<<<< + * for i in range(ncols): + * row[nlevels+i] = data[i][j] + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_data_index, __pyx_v_j)); + PyTuple_SET_ITEM(__pyx_t_11, 0, PyList_GET_ITEM(__pyx_v_data_index, __pyx_v_j)); + __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_data_index, __pyx_v_j)); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_PyObject_SetSlice(__pyx_v_row, __pyx_t_5, 0, __pyx_v_nlevels, NULL, NULL, NULL, 0, 1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":887 + * row = rows[j % N] + * row[:nlevels] = list(data_index[j]) + * for i in range(ncols): # <<<<<<<<<<<<<< + * row[nlevels+i] = data[i][j] + * + */ + __pyx_t_4 = __pyx_v_ncols; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_4; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":888 + * row[:nlevels] = list(data_index[j]) + * for i in range(ncols): + * row[nlevels+i] = data[i][j] # <<<<<<<<<<<<<< + * + * if j >= N-1 and j % N == N-1: + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_data, __pyx_v_i), __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = (__pyx_v_nlevels + __pyx_v_i); + if (unlikely(__Pyx_SetItemInt(__pyx_v_row, __pyx_t_12, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/lib.pyx":890 + * row[nlevels+i] = data[i][j] + * + * if j >= N-1 and j % N == N-1: # <<<<<<<<<<<<<< + * writer.writerows(rows) + * else: + */ + __pyx_t_10 = ((__pyx_v_j >= (__pyx_v_N - 1)) != 0); + if (__pyx_t_10) { + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = ((__Pyx_mod_int(__pyx_v_j, __pyx_v_N) == (__pyx_v_N - 1)) != 0); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_10; + } + if (__pyx_t_9) { + + /* "pandas/lib.pyx":891 + * + * if j >= N-1 and j % N == N-1: + * writer.writerows(rows) # <<<<<<<<<<<<<< + * else: + * for j in range(len(data_index)): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_writerows); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_rows); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_rows); + __Pyx_GIVEREF(__pyx_v_rows); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L15; + } + __pyx_L15:; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":893 + * writer.writerows(rows) + * else: + * for j in range(len(data_index)): # <<<<<<<<<<<<<< + * row = rows[j % N] + * for i in range(ncols): + */ + if (unlikely(__pyx_v_data_index == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_data_index); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_j = __pyx_t_3; + + /* "pandas/lib.pyx":894 + * else: + * for j in range(len(data_index)): + * row = rows[j % N] # <<<<<<<<<<<<<< + * for i in range(ncols): + * row[i] = data[i][j] + */ + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_mod_int(__pyx_v_j, __pyx_v_N); + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_rows, __pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":895 + * for j in range(len(data_index)): + * row = rows[j % N] + * for i in range(ncols): # <<<<<<<<<<<<<< + * row[i] = data[i][j] + * + */ + __pyx_t_4 = __pyx_v_ncols; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_4; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/lib.pyx":896 + * row = rows[j % N] + * for i in range(ncols): + * row[i] = data[i][j] # <<<<<<<<<<<<<< + * + * if j >= N-1 and j % N == N-1: + */ + if (unlikely(__pyx_v_data == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_data, __pyx_v_i), __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_SetItemInt(__pyx_v_row, __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "pandas/lib.pyx":898 + * row[i] = data[i][j] + * + * if j >= N-1 and j % N == N-1: # <<<<<<<<<<<<<< + * writer.writerows(rows) + * + */ + __pyx_t_9 = ((__pyx_v_j >= (__pyx_v_N - 1)) != 0); + if (__pyx_t_9) { + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = ((__Pyx_mod_int(__pyx_v_j, __pyx_v_N) == (__pyx_v_N - 1)) != 0); + __pyx_t_6 = __pyx_t_10; + } else { + __pyx_t_6 = __pyx_t_9; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":899 + * + * if j >= N-1 and j % N == N-1: + * writer.writerows(rows) # <<<<<<<<<<<<<< + * + * if j >= 0 and (j < N-1 or (j % N) != N-1 ): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_writerows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_rows); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_rows); + __Pyx_GIVEREF(__pyx_v_rows); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L20; + } + __pyx_L20:; + } + } + __pyx_L5:; + + /* "pandas/lib.pyx":901 + * writer.writerows(rows) + * + * if j >= 0 and (j < N-1 or (j % N) != N-1 ): # <<<<<<<<<<<<<< + * writer.writerows(rows[:((j+1) % N)]) + * + */ + __pyx_t_6 = ((__pyx_v_j >= 0) != 0); + if (__pyx_t_6) { + __pyx_t_9 = ((__pyx_v_j < (__pyx_v_N - 1)) != 0); + if (!__pyx_t_9) { + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = ((__Pyx_mod_int(__pyx_v_j, __pyx_v_N) != (__pyx_v_N - 1)) != 0); + __pyx_t_13 = __pyx_t_10; + } else { + __pyx_t_13 = __pyx_t_9; + } + __pyx_t_9 = __pyx_t_13; + } else { + __pyx_t_9 = __pyx_t_6; + } + if (__pyx_t_9) { + + /* "pandas/lib.pyx":902 + * + * if j >= 0 and (j < N-1 or (j % N) != N-1 ): + * writer.writerows(rows[:((j+1) % N)]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_writerows); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = (__pyx_v_j + 1); + if (unlikely(__pyx_v_N == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = __Pyx_PyList_GetSlice(__pyx_v_rows, 0, __Pyx_mod_long(__pyx_t_8, __pyx_v_N)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/lib.pyx":860 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def write_csv_rows(list data, list data_index, int nlevels, list cols, object writer): # <<<<<<<<<<<<<< + * + * cdef int N, j, i, ncols + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.lib.write_csv_rows", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rows); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":908 + * + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef int length = index.shape[0] + * cdef int i = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_79arrmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_79arrmap = {__Pyx_NAMESTR("arrmap"), (PyCFunction)__pyx_pw_6pandas_3lib_79arrmap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_79arrmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_index = 0; + PyObject *__pyx_v_func = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("arrmap (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_func,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("arrmap", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrmap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_index = ((PyArrayObject *)values[0]); + __pyx_v_func = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("arrmap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.arrmap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_78arrmap(__pyx_self, __pyx_v_index, __pyx_v_func); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_78arrmap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_func) { + int __pyx_v_length; + int __pyx_v_i; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_index; + __Pyx_Buffer __pyx_pybuffer_index; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject **__pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("arrmap", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_index.pybuffer.buf = NULL; + __pyx_pybuffer_index.refcount = 0; + __pyx_pybuffernd_index.data = NULL; + __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":909 + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): + * cdef int length = index.shape[0] # <<<<<<<<<<<<<< + * cdef int i = 0 + * + */ + __pyx_v_length = (__pyx_v_index->dimensions[0]); + + /* "pandas/lib.pyx":910 + * def arrmap(ndarray[object] index, object func): + * cdef int length = index.shape[0] + * cdef int i = 0 # <<<<<<<<<<<<<< + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + */ + __pyx_v_i = 0; + + /* "pandas/lib.pyx":912 + * cdef int i = 0 + * + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < length: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":914 + * cdef ndarray[object] result = np.empty(length, dtype=np.object_) + * + * for i from 0 <= i < length: # <<<<<<<<<<<<<< + * result[i] = func(index[i]) + * + */ + __pyx_t_7 = __pyx_v_length; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":915 + * + * for i from 0 <= i < length: + * result[i] = func(index[i]) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_8 = __pyx_v_i; + if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_pybuffernd_index.diminfo[0].shape; + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_index.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __pyx_v_i; + if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_pybuffernd_result.diminfo[0].shape; + __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "pandas/lib.pyx":917 + * result[i] = func(index[i]) + * + * return result # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":908 + * + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef int length = index.shape[0] + * cdef int i = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.arrmap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":921 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_81is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_81is_lexsorted = {__Pyx_NAMESTR("is_lexsorted"), (PyCFunction)__pyx_pw_6pandas_3lib_81is_lexsorted, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_81is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_lexsorted (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_list_of_arrays), (&PyList_Type), 1, "list_of_arrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_80is_lexsorted(__pyx_self, ((PyObject*)__pyx_v_list_of_arrays)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_80is_lexsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) { + int __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_nlevels; + __pyx_t_5numpy_int64_t __pyx_v_k; + __pyx_t_5numpy_int64_t __pyx_v_cur; + __pyx_t_5numpy_int64_t __pyx_v_pre; + PyArrayObject *__pyx_v_arr = 0; + __pyx_t_5numpy_int64_t **__pyx_v_vecs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_lexsorted", 0); + + /* "pandas/lib.pyx":928 + * ndarray arr + * + * nlevels = len(list_of_arrays) # <<<<<<<<<<<<<< + * n = len(list_of_arrays[0]) + * + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_list_of_arrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nlevels = __pyx_t_1; + + /* "pandas/lib.pyx":929 + * + * nlevels = len(list_of_arrays) + * n = len(list_of_arrays[0]) # <<<<<<<<<<<<<< + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":931 + * n = len(list_of_arrays[0]) + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) # <<<<<<<<<<<<<< + * for i from 0 <= i < nlevels: + * # vecs[i] = ( list_of_arrays[i]).data + */ + __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_v_nlevels * (sizeof(__pyx_t_5numpy_int64_t *))))); + + /* "pandas/lib.pyx":932 + * + * cdef int64_t **vecs = malloc(nlevels * sizeof(int64_t*)) + * for i from 0 <= i < nlevels: # <<<<<<<<<<<<<< + * # vecs[i] = ( list_of_arrays[i]).data + * + */ + __pyx_t_1 = __pyx_v_nlevels; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":935 + * # vecs[i] = ( list_of_arrays[i]).data + * + * arr = list_of_arrays[i] # <<<<<<<<<<<<<< + * vecs[i] = arr.data + * # assume uniqueness?? + */ + if (unlikely(__pyx_v_list_of_arrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":936 + * + * arr = list_of_arrays[i] + * vecs[i] = arr.data # <<<<<<<<<<<<<< + * # assume uniqueness?? + * + */ + (__pyx_v_vecs[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)__pyx_v_arr->data); + } + + /* "pandas/lib.pyx":939 + * # assume uniqueness?? + * + * for i from 1 <= i < n: # <<<<<<<<<<<<<< + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/lib.pyx":940 + * + * for i from 1 <= i < n: + * for k from 0 <= k < nlevels: # <<<<<<<<<<<<<< + * cur = vecs[k][i] + * pre = vecs[k][i-1] + */ + __pyx_t_3 = __pyx_v_nlevels; + for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) { + + /* "pandas/lib.pyx":941 + * for i from 1 <= i < n: + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] # <<<<<<<<<<<<<< + * pre = vecs[k][i-1] + * if cur == pre: + */ + __pyx_v_cur = ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_i]); + + /* "pandas/lib.pyx":942 + * for k from 0 <= k < nlevels: + * cur = vecs[k][i] + * pre = vecs[k][i-1] # <<<<<<<<<<<<<< + * if cur == pre: + * continue + */ + __pyx_v_pre = ((__pyx_v_vecs[__pyx_v_k])[(__pyx_v_i - 1)]); + + /* "pandas/lib.pyx":943 + * cur = vecs[k][i] + * pre = vecs[k][i-1] + * if cur == pre: # <<<<<<<<<<<<<< + * continue + * elif cur > pre: + */ + __pyx_t_4 = ((__pyx_v_cur == __pyx_v_pre) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":944 + * pre = vecs[k][i-1] + * if cur == pre: + * continue # <<<<<<<<<<<<<< + * elif cur > pre: + * break + */ + goto __pyx_L7_continue; + } + + /* "pandas/lib.pyx":945 + * if cur == pre: + * continue + * elif cur > pre: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_4 = ((__pyx_v_cur > __pyx_v_pre) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":946 + * continue + * elif cur > pre: + * break # <<<<<<<<<<<<<< + * else: + * return False + */ + goto __pyx_L8_break; + } + /*else*/ { + + /* "pandas/lib.pyx":948 + * break + * else: + * return False # <<<<<<<<<<<<<< + * free(vecs) + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L7_continue:; + } + __pyx_L8_break:; + } + + /* "pandas/lib.pyx":949 + * else: + * return False + * free(vecs) # <<<<<<<<<<<<<< + * return True + * + */ + free(__pyx_v_vecs); + + /* "pandas/lib.pyx":950 + * return False + * free(vecs) + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/lib.pyx":921 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.is_lexsorted", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":960 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner, # <<<<<<<<<<<<<< + * object closed='left', bint hasnans=0): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_83generate_bins_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_82generate_bins_dt64[] = "\n Int64 (datetime64) version of generic python version in groupby.py\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_83generate_bins_dt64 = {__Pyx_NAMESTR("generate_bins_dt64"), (PyCFunction)__pyx_pw_6pandas_3lib_83generate_bins_dt64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_82generate_bins_dt64)}; +static PyObject *__pyx_pw_6pandas_3lib_83generate_bins_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_binner = 0; + PyObject *__pyx_v_closed = 0; + int __pyx_v_hasnans; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("generate_bins_dt64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_binner,&__pyx_n_s_closed,&__pyx_n_s_hasnans,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)__pyx_n_s_left); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_binner)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("generate_bins_dt64", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hasnans); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generate_bins_dt64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_binner = ((PyArrayObject *)values[1]); + __pyx_v_closed = values[2]; + if (values[3]) { + __pyx_v_hasnans = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_hasnans == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_hasnans = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("generate_bins_dt64", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.generate_bins_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_binner), __pyx_ptype_5numpy_ndarray, 1, "binner", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_82generate_bins_dt64(__pyx_self, __pyx_v_values, __pyx_v_binner, __pyx_v_closed, __pyx_v_hasnans); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_82generate_bins_dt64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_binner, PyObject *__pyx_v_closed, int __pyx_v_hasnans) { + Py_ssize_t __pyx_v_lenidx; + Py_ssize_t __pyx_v_lenbin; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_bc; + PyArrayObject *__pyx_v_bins = 0; + __pyx_t_5numpy_int64_t __pyx_v_r_bin; + __pyx_t_5numpy_int64_t __pyx_v_nat_count; + int __pyx_v_right_closed; + PyObject *__pyx_v_mask = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_binner; + __Pyx_Buffer __pyx_pybuffer_binner; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bins; + __Pyx_Buffer __pyx_pybuffer_bins; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_5; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + long __pyx_t_14; + long __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyArrayObject *__pyx_t_19 = NULL; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("generate_bins_dt64", 0); + __Pyx_INCREF((PyObject *)__pyx_v_values); + __pyx_pybuffer_bins.pybuffer.buf = NULL; + __pyx_pybuffer_bins.refcount = 0; + __pyx_pybuffernd_bins.data = NULL; + __pyx_pybuffernd_bins.rcbuffer = &__pyx_pybuffer_bins; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_binner.pybuffer.buf = NULL; + __pyx_pybuffer_binner.refcount = 0; + __pyx_pybuffernd_binner.data = NULL; + __pyx_pybuffernd_binner.rcbuffer = &__pyx_pybuffer_binner; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_binner.rcbuffer->pybuffer, (PyObject*)__pyx_v_binner, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_binner.diminfo[0].strides = __pyx_pybuffernd_binner.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_binner.diminfo[0].shape = __pyx_pybuffernd_binner.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":969 + * ndarray[int64_t] bins + * int64_t l_bin, r_bin, nat_count + * bint right_closed = closed == 'right' # <<<<<<<<<<<<<< + * + * nat_count = 0 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_closed, __pyx_n_s_right, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_right_closed = __pyx_t_2; + + /* "pandas/lib.pyx":971 + * bint right_closed = closed == 'right' + * + * nat_count = 0 # <<<<<<<<<<<<<< + * if hasnans: + * mask = values == iNaT + */ + __pyx_v_nat_count = 0; + + /* "pandas/lib.pyx":972 + * + * nat_count = 0 + * if hasnans: # <<<<<<<<<<<<<< + * mask = values == iNaT + * nat_count = np.sum(mask) + */ + __pyx_t_2 = (__pyx_v_hasnans != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":973 + * nat_count = 0 + * if hasnans: + * mask = values == iNaT # <<<<<<<<<<<<<< + * nat_count = np.sum(mask) + * values = values[~mask] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_values), __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_mask = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":974 + * if hasnans: + * mask = values == iNaT + * nat_count = np.sum(mask) # <<<<<<<<<<<<<< + * values = values[~mask] + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_nat_count = __pyx_t_5; + + /* "pandas/lib.pyx":975 + * mask = values == iNaT + * nat_count = np.sum(mask) + * values = values[~mask] # <<<<<<<<<<<<<< + * + * lenidx = len(values) + */ + __pyx_t_4 = PyNumber_Invert(__pyx_v_mask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_values), __pyx_t_4); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":977 + * values = values[~mask] + * + * lenidx = len(values) # <<<<<<<<<<<<<< + * lenbin = len(binner) + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lenidx = __pyx_t_11; + + /* "pandas/lib.pyx":978 + * + * lenidx = len(values) + * lenbin = len(binner) # <<<<<<<<<<<<<< + * + * if lenidx <= 0 or lenbin <= 0: + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_binner)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_lenbin = __pyx_t_11; + + /* "pandas/lib.pyx":980 + * lenbin = len(binner) + * + * if lenidx <= 0 or lenbin <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid length for values or for binner") + * + */ + __pyx_t_2 = ((__pyx_v_lenidx <= 0) != 0); + if (!__pyx_t_2) { + __pyx_t_12 = ((__pyx_v_lenbin <= 0) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_2; + } + if (__pyx_t_13) { + + /* "pandas/lib.pyx":981 + * + * if lenidx <= 0 or lenbin <= 0: + * raise ValueError("Invalid length for values or for binner") # <<<<<<<<<<<<<< + * + * # check binner fits data + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":984 + * + * # check binner fits data + * if values[0] < binner[0]: # <<<<<<<<<<<<<< + * raise ValueError("Values falls before first bin") + * + */ + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_binner.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_binner.diminfo[0].strides))) != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":985 + * # check binner fits data + * if values[0] < binner[0]: + * raise ValueError("Values falls before first bin") # <<<<<<<<<<<<<< + * + * if values[lenidx-1] > binner[lenbin-1]: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":987 + * raise ValueError("Values falls before first bin") + * + * if values[lenidx-1] > binner[lenbin-1]: # <<<<<<<<<<<<<< + * raise ValueError("Values falls after last bin") + * + */ + __pyx_t_11 = (__pyx_v_lenidx - 1); + __pyx_t_16 = (__pyx_v_lenbin - 1); + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_binner.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_binner.diminfo[0].strides))) != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":988 + * + * if values[lenidx-1] > binner[lenbin-1]: + * raise ValueError("Values falls after last bin") # <<<<<<<<<<<<<< + * + * bins = np.empty(lenbin - 1, dtype=np.int64) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":990 + * raise ValueError("Values falls after last bin") + * + * bins = np.empty(lenbin - 1, dtype=np.int64) # <<<<<<<<<<<<<< + * + * j = 0 # index into values + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_lenbin - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_int64); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_bins = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/lib.pyx":992 + * bins = np.empty(lenbin - 1, dtype=np.int64) + * + * j = 0 # index into values # <<<<<<<<<<<<<< + * bc = 0 # bin count + * + */ + __pyx_v_j = 0; + + /* "pandas/lib.pyx":993 + * + * j = 0 # index into values + * bc = 0 # bin count # <<<<<<<<<<<<<< + * + * # linear scan + */ + __pyx_v_bc = 0; + + /* "pandas/lib.pyx":996 + * + * # linear scan + * if right_closed: # <<<<<<<<<<<<<< + * for i in range(0, lenbin - 1): + * r_bin = binner[i+1] + */ + __pyx_t_13 = (__pyx_v_right_closed != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":997 + * # linear scan + * if right_closed: + * for i in range(0, lenbin - 1): # <<<<<<<<<<<<<< + * r_bin = binner[i+1] + * # count values in current bin, advance to next bin + */ + __pyx_t_20 = (__pyx_v_lenbin - 1); + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/lib.pyx":998 + * if right_closed: + * for i in range(0, lenbin - 1): + * r_bin = binner[i+1] # <<<<<<<<<<<<<< + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] <= r_bin: + */ + __pyx_t_22 = (__pyx_v_i + 1); + __pyx_v_r_bin = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_binner.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_binner.diminfo[0].strides)); + + /* "pandas/lib.pyx":1000 + * r_bin = binner[i+1] + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] <= r_bin: # <<<<<<<<<<<<<< + * j += 1 + * bins[bc] = j + */ + while (1) { + __pyx_t_13 = ((__pyx_v_j < __pyx_v_lenidx) != 0); + if (__pyx_t_13) { + __pyx_t_23 = __pyx_v_j; + __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_values.diminfo[0].strides)) <= __pyx_v_r_bin) != 0); + __pyx_t_12 = __pyx_t_2; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) break; + + /* "pandas/lib.pyx":1001 + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] <= r_bin: + * j += 1 # <<<<<<<<<<<<<< + * bins[bc] = j + * bc += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/lib.pyx":1002 + * while j < lenidx and values[j] <= r_bin: + * j += 1 + * bins[bc] = j # <<<<<<<<<<<<<< + * bc += 1 + * else: + */ + __pyx_t_24 = __pyx_v_bc; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_bins.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/lib.pyx":1003 + * j += 1 + * bins[bc] = j + * bc += 1 # <<<<<<<<<<<<<< + * else: + * for i in range(0, lenbin - 1): + */ + __pyx_v_bc = (__pyx_v_bc + 1); + } + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/lib.pyx":1005 + * bc += 1 + * else: + * for i in range(0, lenbin - 1): # <<<<<<<<<<<<<< + * r_bin = binner[i+1] + * # count values in current bin, advance to next bin + */ + __pyx_t_20 = (__pyx_v_lenbin - 1); + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_i = __pyx_t_21; + + /* "pandas/lib.pyx":1006 + * else: + * for i in range(0, lenbin - 1): + * r_bin = binner[i+1] # <<<<<<<<<<<<<< + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] < r_bin: + */ + __pyx_t_25 = (__pyx_v_i + 1); + __pyx_v_r_bin = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_binner.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_binner.diminfo[0].strides)); + + /* "pandas/lib.pyx":1008 + * r_bin = binner[i+1] + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] < r_bin: # <<<<<<<<<<<<<< + * j += 1 + * bins[bc] = j + */ + while (1) { + __pyx_t_12 = ((__pyx_v_j < __pyx_v_lenidx) != 0); + if (__pyx_t_12) { + __pyx_t_26 = __pyx_v_j; + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides)) < __pyx_v_r_bin) != 0); + __pyx_t_2 = __pyx_t_13; + } else { + __pyx_t_2 = __pyx_t_12; + } + if (!__pyx_t_2) break; + + /* "pandas/lib.pyx":1009 + * # count values in current bin, advance to next bin + * while j < lenidx and values[j] < r_bin: + * j += 1 # <<<<<<<<<<<<<< + * bins[bc] = j + * bc += 1 + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/lib.pyx":1010 + * while j < lenidx and values[j] < r_bin: + * j += 1 + * bins[bc] = j # <<<<<<<<<<<<<< + * bc += 1 + * + */ + __pyx_t_27 = __pyx_v_bc; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_bins.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_bins.diminfo[0].strides) = __pyx_v_j; + + /* "pandas/lib.pyx":1011 + * j += 1 + * bins[bc] = j + * bc += 1 # <<<<<<<<<<<<<< + * + * if nat_count > 0: + */ + __pyx_v_bc = (__pyx_v_bc + 1); + } + } + __pyx_L7:; + + /* "pandas/lib.pyx":1013 + * bc += 1 + * + * if nat_count > 0: # <<<<<<<<<<<<<< + * # shift bins by the number of NaT + * bins = bins + nat_count + */ + __pyx_t_2 = ((__pyx_v_nat_count > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1015 + * if nat_count > 0: + * # shift bins by the number of NaT + * bins = bins + nat_count # <<<<<<<<<<<<<< + * bins = np.insert(bins, 0, nat_count) + * + */ + __pyx_t_18 = __Pyx_PyInt_From_npy_int64(__pyx_v_nat_count); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_bins), __pyx_t_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __Pyx_DECREF_SET(__pyx_v_bins, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":1016 + * # shift bins by the number of NaT + * bins = bins + nat_count + * bins = np.insert(bins, 0, nat_count) # <<<<<<<<<<<<<< + * + * return bins + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_insert); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_nat_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_bins)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_bins)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_bins)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bins.rcbuffer->pybuffer, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_bins.diminfo[0].strides = __pyx_pybuffernd_bins.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bins.diminfo[0].shape = __pyx_pybuffernd_bins.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __Pyx_DECREF_SET(__pyx_v_bins, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/lib.pyx":1018 + * bins = np.insert(bins, 0, nat_count) + * + * return bins # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_bins)); + __pyx_r = ((PyObject *)__pyx_v_bins); + goto __pyx_L0; + + /* "pandas/lib.pyx":960 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner, # <<<<<<<<<<<<<< + * object closed='left', bint hasnans=0): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_binner.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.generate_bins_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_binner.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bins.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_bins); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1025 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_85row_bool_subset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_85row_bool_subset = {__Pyx_NAMESTR("row_bool_subset"), (PyCFunction)__pyx_pw_6pandas_3lib_85row_bool_subset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_85row_bool_subset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("row_bool_subset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("row_bool_subset", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "row_bool_subset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("row_bool_subset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.row_bool_subset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_84row_bool_subset(__pyx_self, __pyx_v_values, __pyx_v_mask); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_84row_bool_subset(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_pos; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("row_bool_subset", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1028 + * ndarray[uint8_t, cast=True] mask): + * cdef: + * Py_ssize_t i, j, n, k, pos = 0 # <<<<<<<<<<<<<< + * ndarray[float64_t, ndim=2] out + * + */ + __pyx_v_pos = 0; + + /* "pandas/lib.pyx":1031 + * ndarray[float64_t, ndim=2] out + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * assert(n == len(mask)) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_k = __pyx_t_7; + + /* "pandas/lib.pyx":1032 + * + * n, k = ( values).shape + * assert(n == len(mask)) # <<<<<<<<<<<<<< + * + * out = np.empty((mask.sum(), k), dtype=np.float64) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!((__pyx_v_n == __pyx_t_7) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/lib.pyx":1034 + * assert(n == len(mask)) + * + * out = np.empty((mask.sum(), k), dtype=np.float64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/lib.pyx":1036 + * out = np.empty((mask.sum(), k), dtype=np.float64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * for j in range(k): + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/lib.pyx":1037 + * + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * for j in range(k): + * out[pos, j] = values[i, j] + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1038 + * for i in range(n): + * if mask[i]: + * for j in range(k): # <<<<<<<<<<<<<< + * out[pos, j] = values[i, j] + * pos += 1 + */ + __pyx_t_16 = __pyx_v_k; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_j = __pyx_t_17; + + /* "pandas/lib.pyx":1039 + * if mask[i]: + * for j in range(k): + * out[pos, j] = values[i, j] # <<<<<<<<<<<<<< + * pos += 1 + * + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_20 = __pyx_v_pos; + __pyx_t_21 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_out.diminfo[1].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_values.diminfo[1].strides)); + } + + /* "pandas/lib.pyx":1040 + * for j in range(k): + * out[pos, j] = values[i, j] + * pos += 1 # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_v_pos = (__pyx_v_pos + 1); + goto __pyx_L7; + } + __pyx_L7:; + } + + /* "pandas/lib.pyx":1042 + * pos += 1 + * + * return out # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/lib.pyx":1025 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.row_bool_subset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1046 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_87row_bool_subset_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_87row_bool_subset_object = {__Pyx_NAMESTR("row_bool_subset_object"), (PyCFunction)__pyx_pw_6pandas_3lib_87row_bool_subset_object, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_87row_bool_subset_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("row_bool_subset_object (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("row_bool_subset_object", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "row_bool_subset_object") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mask = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("row_bool_subset_object", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.row_bool_subset_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_86row_bool_subset_object(__pyx_self, __pyx_v_values, __pyx_v_mask); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_86row_bool_subset_object(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_mask) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_pos; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + PyObject **__pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("row_bool_subset_object", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_values.diminfo[1].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_values.diminfo[1].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1049 + * ndarray[uint8_t, cast=True] mask): + * cdef: + * Py_ssize_t i, j, n, k, pos = 0 # <<<<<<<<<<<<<< + * ndarray[object, ndim=2] out + * + */ + __pyx_v_pos = 0; + + /* "pandas/lib.pyx":1052 + * ndarray[object, ndim=2] out + * + * n, k = ( values).shape # <<<<<<<<<<<<<< + * assert(n == len(mask)) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_k = __pyx_t_7; + + /* "pandas/lib.pyx":1053 + * + * n, k = ( values).shape + * assert(n == len(mask)) # <<<<<<<<<<<<<< + * + * out = np.empty((mask.sum(), k), dtype=object) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!((__pyx_v_n == __pyx_t_7) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/lib.pyx":1055 + * assert(n == len(mask)) + * + * out = np.empty((mask.sum(), k), dtype=object) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_out.diminfo[1].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_out.diminfo[1].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1057 + * out = np.empty((mask.sum(), k), dtype=object) + * + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * for j in range(k): + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/lib.pyx":1058 + * + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * for j in range(k): + * out[pos, j] = values[i, j] + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_14) { + + /* "pandas/lib.pyx":1059 + * for i in range(n): + * if mask[i]: + * for j in range(k): # <<<<<<<<<<<<<< + * out[pos, j] = values[i, j] + * pos += 1 + */ + __pyx_t_15 = __pyx_v_k; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_j = __pyx_t_16; + + /* "pandas/lib.pyx":1060 + * if mask[i]: + * for j in range(k): + * out[pos, j] = values[i, j] # <<<<<<<<<<<<<< + * pos += 1 + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_values.diminfo[1].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_19 = __pyx_v_pos; + __pyx_t_20 = __pyx_v_j; + __pyx_t_21 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_out.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_21); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_21); + *__pyx_t_21 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_21); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "pandas/lib.pyx":1061 + * for j in range(k): + * out[pos, j] = values[i, j] + * pos += 1 # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_v_pos = (__pyx_v_pos + 1); + goto __pyx_L7; + } + __pyx_L7:; + } + + /* "pandas/lib.pyx":1063 + * pos += 1 + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/lib.pyx":1046 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.row_bool_subset_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1066 + * + * + * def group_count(ndarray[int64_t] values, Py_ssize_t size): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_89group_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_89group_count = {__Pyx_NAMESTR("group_count"), (PyCFunction)__pyx_pw_6pandas_3lib_89group_count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_89group_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + Py_ssize_t __pyx_v_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_count (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_size,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_count", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_count") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_count", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.group_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_88group_count(__pyx_self, __pyx_v_values, __pyx_v_size); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_88group_count(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, Py_ssize_t __pyx_v_size) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_counts = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + __pyx_t_5numpy_int64_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_count", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1068 + * def group_count(ndarray[int64_t] values, Py_ssize_t size): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] counts + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1071 + * ndarray[int64_t] counts + * + * counts = np.zeros(size, dtype=np.int64) # <<<<<<<<<<<<<< + * for i in range(n): + * counts[values[i]] += 1 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1072 + * + * counts = np.zeros(size, dtype=np.int64) + * for i in range(n): # <<<<<<<<<<<<<< + * counts[values[i]] += 1 + * return counts + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":1073 + * counts = np.zeros(size, dtype=np.int64) + * for i in range(n): + * counts[values[i]] += 1 # <<<<<<<<<<<<<< + * return counts + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides)); + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + } + + /* "pandas/lib.pyx":1074 + * for i in range(n): + * counts[values[i]] += 1 + * return counts # <<<<<<<<<<<<<< + * + * def lookup_values(ndarray[object] values, dict mapping): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + __pyx_r = ((PyObject *)__pyx_v_counts); + goto __pyx_L0; + + /* "pandas/lib.pyx":1066 + * + * + * def group_count(ndarray[int64_t] values, Py_ssize_t size): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.group_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1076 + * return counts + * + * def lookup_values(ndarray[object] values, dict mapping): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_91lookup_values(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_91lookup_values = {__Pyx_NAMESTR("lookup_values"), (PyCFunction)__pyx_pw_6pandas_3lib_91lookup_values, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_91lookup_values(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_mapping = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup_values (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mapping,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapping)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("lookup_values", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup_values") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_mapping = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lookup_values", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.lookup_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapping), (&PyDict_Type), 1, "mapping", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_90lookup_values(__pyx_self, __pyx_v_values, __pyx_v_mapping); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_90lookup_values(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_mapping) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup_values", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1078 + * def lookup_values(ndarray[object] values, dict mapping): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype='O') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1080 + * Py_ssize_t i, n = len(values) + * + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * for i in range(n): + * result[i] = mapping[values[i]] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1081 + * + * result = np.empty(n, dtype='O') + * for i in range(n): # <<<<<<<<<<<<<< + * result[i] = mapping[values[i]] + * return maybe_convert_objects(result) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/lib.pyx":1082 + * result = np.empty(n, dtype='O') + * for i in range(n): + * result[i] = mapping[values[i]] # <<<<<<<<<<<<<< + * return maybe_convert_objects(result) + * + */ + if (unlikely(__pyx_v_mapping == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_mapping, __pyx_t_5); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_result, __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "pandas/lib.pyx":1083 + * for i in range(n): + * result[i] = mapping[values[i]] + * return maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1076 + * return counts + * + * def lookup_values(ndarray[object] values, dict mapping): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.lookup_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1086 + * + * + * def count_level_1d(ndarray[uint8_t, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_93count_level_1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_93count_level_1d = {__Pyx_NAMESTR("count_level_1d"), (PyCFunction)__pyx_pw_6pandas_3lib_93count_level_1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_93count_level_1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_mask = 0; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_max_bin; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count_level_1d (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,&__pyx_n_s_labels,&__pyx_n_s_max_bin,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_bin)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_level_1d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_mask = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + __pyx_v_max_bin = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_bin == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.count_level_1d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_92count_level_1d(__pyx_self, __pyx_v_mask, __pyx_v_labels, __pyx_v_max_bin); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_92count_level_1d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_max_bin) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_counts = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + __pyx_t_5numpy_int64_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count_level_1d", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1092 + * ndarray[int64_t] counts + * + * counts = np.zeros(max_bin, dtype='i8') # <<<<<<<<<<<<<< + * + * n = len(mask) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_bin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/lib.pyx":1094 + * counts = np.zeros(max_bin, dtype='i8') + * + * n = len(mask) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_10; + + /* "pandas/lib.pyx":1096 + * n = len(mask) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * if mask[i]: + * counts[labels[i]] += 1 + */ + __pyx_t_10 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) { + + /* "pandas/lib.pyx":1097 + * + * for i from 0 <= i < n: + * if mask[i]: # <<<<<<<<<<<<<< + * counts[labels[i]] += 1 + * + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1098 + * for i from 0 <= i < n: + * if mask[i]: + * counts[labels[i]] += 1 # <<<<<<<<<<<<<< + * + * return counts + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides)); + __pyx_t_6 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":1100 + * counts[labels[i]] += 1 + * + * return counts # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + __pyx_r = ((PyObject *)__pyx_v_counts); + goto __pyx_L0; + + /* "pandas/lib.pyx":1086 + * + * + * def count_level_1d(ndarray[uint8_t, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.count_level_1d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1103 + * + * + * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_95count_level_2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_95count_level_2d = {__Pyx_NAMESTR("count_level_2d"), (PyCFunction)__pyx_pw_6pandas_3lib_95count_level_2d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_95count_level_2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_mask = 0; + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_max_bin; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count_level_2d (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,&__pyx_n_s_labels,&__pyx_n_s_max_bin,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_bin)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_level_2d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_mask = ((PyArrayObject *)values[0]); + __pyx_v_labels = ((PyArrayObject *)values[1]); + __pyx_v_max_bin = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_bin == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.count_level_2d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_94count_level_2d(__pyx_self, __pyx_v_mask, __pyx_v_labels, __pyx_v_max_bin); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_94count_level_2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mask, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_max_bin) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_counts = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + __pyx_t_5numpy_int64_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count_level_2d", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1109 + * ndarray[int64_t, ndim=2] counts + * + * n, k = ( mask).shape # <<<<<<<<<<<<<< + * counts = np.zeros((max_bin, k), dtype='i8') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_n = __pyx_t_6; + __pyx_v_k = __pyx_t_7; + + /* "pandas/lib.pyx":1110 + * + * n, k = ( mask).shape + * counts = np.zeros((max_bin, k), dtype='i8') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_bin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_counts.diminfo[1].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_counts.diminfo[1].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1112 + * counts = np.zeros((max_bin, k), dtype='i8') + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * for j from 0 <= j < k: + * if mask[i, j]: + */ + __pyx_t_7 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { + + /* "pandas/lib.pyx":1113 + * + * for i from 0 <= i < n: + * for j from 0 <= j < k: # <<<<<<<<<<<<<< + * if mask[i, j]: + * counts[labels[i], j] += 1 + */ + __pyx_t_6 = __pyx_v_k; + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { + + /* "pandas/lib.pyx":1114 + * for i from 0 <= i < n: + * for j from 0 <= j < k: + * if mask[i, j]: # <<<<<<<<<<<<<< + * counts[labels[i], j] += 1 + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_mask.diminfo[1].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_mask.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[1].strides)) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1115 + * for j from 0 <= j < k: + * if mask[i, j]: + * counts[labels[i], j] += 1 # <<<<<<<<<<<<<< + * + * return counts + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_labels.diminfo[0].strides)); + __pyx_t_18 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[1].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[1].strides) += 1; + goto __pyx_L9; + } + __pyx_L9:; + } + } + + /* "pandas/lib.pyx":1117 + * counts[labels[i], j] += 1 + * + * return counts # <<<<<<<<<<<<<< + * + * cdef class _PandasNull: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + __pyx_r = ((PyObject *)__pyx_v_counts); + goto __pyx_L0; + + /* "pandas/lib.pyx":1103 + * + * + * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.count_level_2d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1121 + * cdef class _PandasNull: + * + * def __richcmp__(_PandasNull self, object other, int op): # <<<<<<<<<<<<<< + * if op == 2: # == + * return isinstance(other, _PandasNull) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11_PandasNull_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11_PandasNull_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_3lib__PandasNull, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_11_PandasNull___richcmp__(((struct __pyx_obj_6pandas_3lib__PandasNull *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11_PandasNull___richcmp__(CYTHON_UNUSED struct __pyx_obj_6pandas_3lib__PandasNull *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__richcmp__", 0); + + /* "pandas/lib.pyx":1124 + * if op == 2: # == + * return isinstance(other, _PandasNull) + * elif op == 3: # != # <<<<<<<<<<<<<< + * return not isinstance(other, _PandasNull) + * else: + */ + switch (__pyx_v_op) { + + /* "pandas/lib.pyx":1122 + * + * def __richcmp__(_PandasNull self, object other, int op): + * if op == 2: # == # <<<<<<<<<<<<<< + * return isinstance(other, _PandasNull) + * elif op == 3: # != + */ + case 2: + + /* "pandas/lib.pyx":1123 + * def __richcmp__(_PandasNull self, object other, int op): + * if op == 2: # == + * return isinstance(other, _PandasNull) # <<<<<<<<<<<<<< + * elif op == 3: # != + * return not isinstance(other, _PandasNull) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull)); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + break; + + /* "pandas/lib.pyx":1124 + * if op == 2: # == + * return isinstance(other, _PandasNull) + * elif op == 3: # != # <<<<<<<<<<<<<< + * return not isinstance(other, _PandasNull) + * else: + */ + case 3: + + /* "pandas/lib.pyx":1125 + * return isinstance(other, _PandasNull) + * elif op == 3: # != + * return not isinstance(other, _PandasNull) # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull)); + __pyx_t_2 = __Pyx_PyBool_FromLong((!(__pyx_t_1 != 0))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + break; + default: + + /* "pandas/lib.pyx":1127 + * return not isinstance(other, _PandasNull) + * else: + * return False # <<<<<<<<<<<<<< + * + * def __hash__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + break; + } + + /* "pandas/lib.pyx":1121 + * cdef class _PandasNull: + * + * def __richcmp__(_PandasNull self, object other, int op): # <<<<<<<<<<<<<< + * if op == 2: # == + * return isinstance(other, _PandasNull) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib._PandasNull.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1129 + * return False + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + +/* Python wrapper */ +static Py_hash_t __pyx_pw_6pandas_3lib_11_PandasNull_3__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_6pandas_3lib_11_PandasNull_3__hash__(PyObject *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11_PandasNull_2__hash__(((struct __pyx_obj_6pandas_3lib__PandasNull *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_hash_t __pyx_pf_6pandas_3lib_11_PandasNull_2__hash__(CYTHON_UNUSED struct __pyx_obj_6pandas_3lib__PandasNull *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "pandas/lib.pyx":1130 + * + * def __hash__(self): + * return 0 # <<<<<<<<<<<<<< + * + * pandas_null = _PandasNull() + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1129 + * return False + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + + /* function exit code */ + __pyx_L0:; + if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1134 + * pandas_null = _PandasNull() + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_97fast_zip_fillna(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_96fast_zip_fillna[] = "\n For zipping multiple ndarrays into an ndarray of tuples\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_97fast_zip_fillna = {__Pyx_NAMESTR("fast_zip_fillna"), (PyCFunction)__pyx_pw_6pandas_3lib_97fast_zip_fillna, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_96fast_zip_fillna)}; +static PyObject *__pyx_pw_6pandas_3lib_97fast_zip_fillna(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ndarrays = 0; + PyObject *__pyx_v_fill_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_zip_fillna (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ndarrays,&__pyx_n_s_fill_value,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__10; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ndarrays)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fast_zip_fillna") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ndarrays = ((PyObject*)values[0]); + __pyx_v_fill_value = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fast_zip_fillna", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.fast_zip_fillna", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ndarrays), (&PyList_Type), 1, "ndarrays", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_96fast_zip_fillna(__pyx_self, __pyx_v_ndarrays, __pyx_v_fill_value); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_96fast_zip_fillna(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ndarrays, PyObject *__pyx_v_fill_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayIterObject *__pyx_v_it = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_tup = 0; + PyObject *__pyx_v_arr = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyObject **__pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_zip_fillna", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/lib.pyx":1144 + * object val, tup + * + * k = len(ndarrays) # <<<<<<<<<<<<<< + * n = len(ndarrays[0]) + * + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_ndarrays); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":1145 + * + * k = len(ndarrays) + * n = len(ndarrays[0]) # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=object) + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1147 + * n = len(ndarrays[0]) + * + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * # initialize tuples on first pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1150 + * + * # initialize tuples on first pass + * arr = ndarrays[0] # <<<<<<<<<<<<<< + * it = PyArray_IterNew(arr) + * for i in range(n): + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_arr = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1151 + * # initialize tuples on first pass + * arr = ndarrays[0] + * it = PyArray_IterNew(arr) # <<<<<<<<<<<<<< + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + */ + __pyx_t_5 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_t_5; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_it = ((PyArrayIterObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1152 + * arr = ndarrays[0] + * it = PyArray_IterNew(arr) + * for i in range(n): # <<<<<<<<<<<<<< + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * tup = PyTuple_New(k) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/lib.pyx":1153 + * it = PyArray_IterNew(arr) + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) # <<<<<<<<<<<<<< + * tup = PyTuple_New(k) + * + */ + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyArray_GETITEM(((PyArrayObject *)__pyx_v_arr), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1154 + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * tup = PyTuple_New(k) # <<<<<<<<<<<<<< + * + * if val != val: + */ + __pyx_t_2 = PyTuple_New(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_tup, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1156 + * tup = PyTuple_New(k) + * + * if val != val: # <<<<<<<<<<<<<< + * val = fill_value + * + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1157 + * + * if val != val: + * val = fill_value # <<<<<<<<<<<<<< + * + * PyTuple_SET_ITEM(tup, 0, val) + */ + __Pyx_INCREF(__pyx_v_fill_value); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_v_fill_value); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/lib.pyx":1159 + * val = fill_value + * + * PyTuple_SET_ITEM(tup, 0, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * result[i] = tup + */ + PyTuple_SET_ITEM(__pyx_v_tup, 0, __pyx_v_val); + + /* "pandas/lib.pyx":1160 + * + * PyTuple_SET_ITEM(tup, 0, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * result[i] = tup + * PyArray_ITER_NEXT(it) + */ + Py_INCREF(__pyx_v_val); + + /* "pandas/lib.pyx":1161 + * PyTuple_SET_ITEM(tup, 0, val) + * Py_INCREF(val) + * result[i] = tup # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_14); + __Pyx_INCREF(__pyx_v_tup); __Pyx_DECREF(*__pyx_t_14); + *__pyx_t_14 = __pyx_v_tup; + __Pyx_GIVEREF(*__pyx_t_14); + + /* "pandas/lib.pyx":1162 + * Py_INCREF(val) + * result[i] = tup + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * + * for j in range(1, k): + */ + PyArray_ITER_NEXT(__pyx_v_it); + } + + /* "pandas/lib.pyx":1164 + * PyArray_ITER_NEXT(it) + * + * for j in range(1, k): # <<<<<<<<<<<<<< + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_j = __pyx_t_11; + + /* "pandas/lib.pyx":1165 + * + * for j in range(1, k): + * arr = ndarrays[j] # <<<<<<<<<<<<<< + * it = PyArray_IterNew(arr) + * if len(arr) != n: + */ + if (unlikely(__pyx_v_ndarrays == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ndarrays, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1166 + * for j in range(1, k): + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) # <<<<<<<<<<<<<< + * if len(arr) != n: + * raise ValueError('all arrays must be same length') + */ + __pyx_t_2 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_it, ((PyArrayIterObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1167 + * arr = ndarrays[j] + * it = PyArray_IterNew(arr) + * if len(arr) != n: # <<<<<<<<<<<<<< + * raise ValueError('all arrays must be same length') + * + */ + __pyx_t_15 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((__pyx_t_15 != __pyx_v_n) != 0); + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1168 + * it = PyArray_IterNew(arr) + * if len(arr) != n: + * raise ValueError('all arrays must be same length') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1170 + * raise ValueError('all arrays must be same length') + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * if val != val: + */ + __pyx_t_15 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/lib.pyx":1171 + * + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) # <<<<<<<<<<<<<< + * if val != val: + * val = fill_value + */ + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyArray_GETITEM(((PyArrayObject *)__pyx_v_arr), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1172 + * for i in range(n): + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * if val != val: # <<<<<<<<<<<<<< + * val = fill_value + * + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1173 + * val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it)) + * if val != val: + * val = fill_value # <<<<<<<<<<<<<< + * + * PyTuple_SET_ITEM(result[i], j, val) + */ + __Pyx_INCREF(__pyx_v_fill_value); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_v_fill_value); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/lib.pyx":1175 + * val = fill_value + * + * PyTuple_SET_ITEM(result[i], j, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * PyArray_ITER_NEXT(it) + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, __pyx_v_j, __pyx_v_val); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1176 + * + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * + */ + Py_INCREF(__pyx_v_val); + + /* "pandas/lib.pyx":1177 + * PyTuple_SET_ITEM(result[i], j, val) + * Py_INCREF(val) + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * + * return result + */ + PyArray_ITER_NEXT(__pyx_v_it); + } + } + + /* "pandas/lib.pyx":1179 + * PyArray_ITER_NEXT(it) + * + * return result # <<<<<<<<<<<<<< + * + * def duplicated(ndarray[object] values, take_last=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/lib.pyx":1134 + * pandas_null = _PandasNull() + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_zip_fillna", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_it); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1181 + * return result + * + * def duplicated(ndarray[object] values, take_last=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_99duplicated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_99duplicated = {__Pyx_NAMESTR("duplicated"), (PyCFunction)__pyx_pw_6pandas_3lib_99duplicated, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_99duplicated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_take_last = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("duplicated (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_take_last,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_take_last); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "duplicated") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_take_last = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("duplicated", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.duplicated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_98duplicated(__pyx_self, __pyx_v_values, __pyx_v_take_last); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_98duplicated(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_take_last) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_seen = 0; + PyObject *__pyx_v_row = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("duplicated", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1184 + * cdef: + * Py_ssize_t i, n + * dict seen = {} # <<<<<<<<<<<<<< + * object row + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_seen = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1187 + * object row + * + * n = len(values) # <<<<<<<<<<<<<< + * cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8) + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/lib.pyx":1188 + * + * n = len(values) + * cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * + * if take_last: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1190 + * cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8) + * + * if take_last: # <<<<<<<<<<<<<< + * for i from n > i >= 0: + * row = values[i] + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_take_last); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_8) { + + /* "pandas/lib.pyx":1191 + * + * if take_last: + * for i from n > i >= 0: # <<<<<<<<<<<<<< + * row = values[i] + * + */ + for (__pyx_v_i = __pyx_v_n-1; __pyx_v_i >= 0; __pyx_v_i--) { + + /* "pandas/lib.pyx":1192 + * if take_last: + * for i from n > i >= 0: + * row = values[i] # <<<<<<<<<<<<<< + * + * if row in seen: + */ + __pyx_t_2 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_2 < 0) { + __pyx_t_2 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_2 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_2 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1194 + * row = values[i] + * + * if row in seen: # <<<<<<<<<<<<<< + * result[i] = 1 + * else: + */ + __pyx_t_8 = (__Pyx_PyDict_Contains(__pyx_v_row, __pyx_v_seen, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = (__pyx_t_8 != 0); + if (__pyx_t_10) { + + /* "pandas/lib.pyx":1195 + * + * if row in seen: + * result[i] = 1 # <<<<<<<<<<<<<< + * else: + * seen[row] = None + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/lib.pyx":1197 + * result[i] = 1 + * else: + * seen[row] = None # <<<<<<<<<<<<<< + * result[i] = 0 + * else: + */ + if (unlikely(PyDict_SetItem(__pyx_v_seen, __pyx_v_row, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1198 + * else: + * seen[row] = None + * result[i] = 0 # <<<<<<<<<<<<<< + * else: + * for i from 0 <= i < n: + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + } + __pyx_L6:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1200 + * result[i] = 0 + * else: + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * row = values[i] + * if row in seen: + */ + __pyx_t_13 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { + + /* "pandas/lib.pyx":1201 + * else: + * for i from 0 <= i < n: + * row = values[i] # <<<<<<<<<<<<<< + * if row in seen: + * result[i] = 1 + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1202 + * for i from 0 <= i < n: + * row = values[i] + * if row in seen: # <<<<<<<<<<<<<< + * result[i] = 1 + * else: + */ + __pyx_t_10 = (__Pyx_PyDict_Contains(__pyx_v_row, __pyx_v_seen, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_10 != 0); + if (__pyx_t_8) { + + /* "pandas/lib.pyx":1203 + * row = values[i] + * if row in seen: + * result[i] = 1 # <<<<<<<<<<<<<< + * else: + * seen[row] = None + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/lib.pyx":1205 + * result[i] = 1 + * else: + * seen[row] = None # <<<<<<<<<<<<<< + * result[i] = 0 + * + */ + if (unlikely(PyDict_SetItem(__pyx_v_seen, __pyx_v_row, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1206 + * else: + * seen[row] = None + * result[i] = 0 # <<<<<<<<<<<<<< + * + * return result.view(np.bool_) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + } + __pyx_L9:; + } + } + __pyx_L3:; + + /* "pandas/lib.pyx":1208 + * result[i] = 0 + * + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1181 + * return result + * + * def duplicated(ndarray[object] values, take_last=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.duplicated", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_seen); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1210 + * return result.view(np.bool_) + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, group_size, n, lab, start + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_101generate_slices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_101generate_slices = {__Pyx_NAMESTR("generate_slices"), (PyCFunction)__pyx_pw_6pandas_3lib_101generate_slices, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_101generate_slices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_ngroups; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("generate_slices (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_labels,&__pyx_n_s_ngroups,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ngroups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("generate_slices", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generate_slices") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_labels = ((PyArrayObject *)values[0]); + __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("generate_slices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.generate_slices", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_100generate_slices(__pyx_self, __pyx_v_labels, __pyx_v_ngroups); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_100generate_slices(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_labels, Py_ssize_t __pyx_v_ngroups) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_group_size; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_start; + PyArrayObject *__pyx_v_starts = 0; + PyObject *__pyx_v_ends = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_starts; + __Pyx_Buffer __pyx_pybuffer_starts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("generate_slices", 0); + __pyx_pybuffer_starts.pybuffer.buf = NULL; + __pyx_pybuffer_starts.refcount = 0; + __pyx_pybuffernd_starts.data = NULL; + __pyx_pybuffernd_starts.rcbuffer = &__pyx_pybuffer_starts; + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1216 + * ndarray[int64_t] starts + * + * n = len(labels) # <<<<<<<<<<<<<< + * + * starts = np.zeros(ngroups, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1218 + * n = len(labels) + * + * starts = np.zeros(ngroups, dtype=np.int64) # <<<<<<<<<<<<<< + * ends = np.zeros(ngroups, dtype=np.int64) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_starts.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_starts.rcbuffer->pybuffer, (PyObject*)__pyx_v_starts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_starts.diminfo[0].strides = __pyx_pybuffernd_starts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_starts.diminfo[0].shape = __pyx_pybuffernd_starts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_starts = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1219 + * + * starts = np.zeros(ngroups, dtype=np.int64) + * ends = np.zeros(ngroups, dtype=np.int64) # <<<<<<<<<<<<<< + * + * start = 0 + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_ends = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1221 + * ends = np.zeros(ngroups, dtype=np.int64) + * + * start = 0 # <<<<<<<<<<<<<< + * group_size = 0 + * for i in range(n): + */ + __pyx_v_start = 0; + + /* "pandas/lib.pyx":1222 + * + * start = 0 + * group_size = 0 # <<<<<<<<<<<<<< + * for i in range(n): + * group_size += 1 + */ + __pyx_v_group_size = 0; + + /* "pandas/lib.pyx":1223 + * start = 0 + * group_size = 0 + * for i in range(n): # <<<<<<<<<<<<<< + * group_size += 1 + * lab = labels[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/lib.pyx":1224 + * group_size = 0 + * for i in range(n): + * group_size += 1 # <<<<<<<<<<<<<< + * lab = labels[i] + * if i == n - 1 or lab != labels[i + 1]: + */ + __pyx_v_group_size = (__pyx_v_group_size + 1); + + /* "pandas/lib.pyx":1225 + * for i in range(n): + * group_size += 1 + * lab = labels[i] # <<<<<<<<<<<<<< + * if i == n - 1 or lab != labels[i + 1]: + * starts[lab] = start + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/lib.pyx":1226 + * group_size += 1 + * lab = labels[i] + * if i == n - 1 or lab != labels[i + 1]: # <<<<<<<<<<<<<< + * starts[lab] = start + * ends[lab] = start + group_size + */ + __pyx_t_14 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0); + if (!__pyx_t_14) { + __pyx_t_15 = (__pyx_v_i + 1); + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((__pyx_v_lab != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (__pyx_t_17) { + + /* "pandas/lib.pyx":1227 + * lab = labels[i] + * if i == n - 1 or lab != labels[i + 1]: + * starts[lab] = start # <<<<<<<<<<<<<< + * ends[lab] = start + group_size + * start += group_size + */ + __pyx_t_18 = __pyx_v_lab; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_starts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_starts.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_starts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_starts.diminfo[0].strides) = __pyx_v_start; + + /* "pandas/lib.pyx":1228 + * if i == n - 1 or lab != labels[i + 1]: + * starts[lab] = start + * ends[lab] = start + group_size # <<<<<<<<<<<<<< + * start += group_size + * group_size = 0 + */ + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_start + __pyx_v_group_size)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_SetItemInt(__pyx_v_ends, __pyx_v_lab, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/lib.pyx":1229 + * starts[lab] = start + * ends[lab] = start + group_size + * start += group_size # <<<<<<<<<<<<<< + * group_size = 0 + * + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_group_size); + + /* "pandas/lib.pyx":1230 + * ends[lab] = start + group_size + * start += group_size + * group_size = 0 # <<<<<<<<<<<<<< + * + * return starts, ends + */ + __pyx_v_group_size = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/lib.pyx":1232 + * group_size = 0 + * + * return starts, ends # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_starts)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_starts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_starts)); + __Pyx_INCREF(__pyx_v_ends); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ends); + __Pyx_GIVEREF(__pyx_v_ends); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1210 + * return result.view(np.bool_) + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, group_size, n, lab, start + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.generate_slices", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_starts); + __Pyx_XDECREF(__pyx_v_ends); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1235 + * + * + * def indices_fast(object index, ndarray[int64_t] labels, list keys, # <<<<<<<<<<<<<< + * list sorted_labels): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_103indices_fast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_103indices_fast = {__Pyx_NAMESTR("indices_fast"), (PyCFunction)__pyx_pw_6pandas_3lib_103indices_fast, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_103indices_fast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_index = 0; + PyArrayObject *__pyx_v_labels = 0; + PyObject *__pyx_v_keys = 0; + PyObject *__pyx_v_sorted_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("indices_fast (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_labels,&__pyx_n_s_keys,&__pyx_n_s_sorted_labels,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sorted_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "indices_fast") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_index = values[0]; + __pyx_v_labels = ((PyArrayObject *)values[1]); + __pyx_v_keys = ((PyObject*)values[2]); + __pyx_v_sorted_labels = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.indices_fast", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sorted_labels), (&PyList_Type), 1, "sorted_labels", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_102indices_fast(__pyx_self, __pyx_v_index, __pyx_v_labels, __pyx_v_keys, __pyx_v_sorted_labels); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_102indices_fast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_keys, PyObject *__pyx_v_sorted_labels) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_lab; + Py_ssize_t __pyx_v_cur; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_tup = 0; + PyObject *__pyx_v_val = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + long __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("indices_fast", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + + /* "pandas/lib.pyx":1238 + * list sorted_labels): + * cdef: + * Py_ssize_t i, j, k, lab, cur, start, n = len(labels) # <<<<<<<<<<<<<< + * dict result = {} + * object tup + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/lib.pyx":1239 + * cdef: + * Py_ssize_t i, j, k, lab, cur, start, n = len(labels) + * dict result = {} # <<<<<<<<<<<<<< + * object tup + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1242 + * object tup + * + * k = len(keys) # <<<<<<<<<<<<<< + * + * if n == 0: + */ + if (unlikely(__pyx_v_keys == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = __pyx_t_1; + + /* "pandas/lib.pyx":1244 + * k = len(keys) + * + * if n == 0: # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_3 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1245 + * + * if n == 0: + * return result # <<<<<<<<<<<<<< + * + * start = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1247 + * return result + * + * start = 0 # <<<<<<<<<<<<<< + * cur = labels[0] + * for i in range(1, n): + */ + __pyx_v_start = 0; + + /* "pandas/lib.pyx":1248 + * + * start = 0 + * cur = labels[0] # <<<<<<<<<<<<<< + * for i in range(1, n): + * lab = labels[i] + */ + __pyx_t_4 = 0; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/lib.pyx":1249 + * start = 0 + * cur = labels[0] + * for i in range(1, n): # <<<<<<<<<<<<<< + * lab = labels[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/lib.pyx":1250 + * cur = labels[0] + * for i in range(1, n): + * lab = labels[i] # <<<<<<<<<<<<<< + * + * if lab != cur: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/lib.pyx":1252 + * lab = labels[i] + * + * if lab != cur: # <<<<<<<<<<<<<< + * if lab != -1: + * tup = PyTuple_New(k) + */ + __pyx_t_3 = ((__pyx_v_lab != __pyx_v_cur) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1253 + * + * if lab != cur: + * if lab != -1: # <<<<<<<<<<<<<< + * tup = PyTuple_New(k) + * for j in range(k): + */ + __pyx_t_3 = ((__pyx_v_lab != -1) != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1254 + * if lab != cur: + * if lab != -1: + * tup = PyTuple_New(k) # <<<<<<<<<<<<<< + * for j in range(k): + * val = util.get_value_at(keys[j], + */ + __pyx_t_2 = PyTuple_New(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_tup, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1255 + * if lab != -1: + * tup = PyTuple_New(k) + * for j in range(k): # <<<<<<<<<<<<<< + * val = util.get_value_at(keys[j], + * sorted_labels[j][i-1]) + */ + __pyx_t_8 = __pyx_v_k; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_j = __pyx_t_9; + + /* "pandas/lib.pyx":1256 + * tup = PyTuple_New(k) + * for j in range(k): + * val = util.get_value_at(keys[j], # <<<<<<<<<<<<<< + * sorted_labels[j][i-1]) + * PyTuple_SET_ITEM(tup, j, val) + */ + if (unlikely(__pyx_v_keys == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_keys, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1257 + * for j in range(k): + * val = util.get_value_at(keys[j], + * sorted_labels[j][i-1]) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) + */ + if (unlikely(__pyx_v_sorted_labels == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_sorted_labels, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = (__pyx_v_i - 1); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_10, __pyx_t_11, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/lib.pyx":1256 + * tup = PyTuple_New(k) + * for j in range(k): + * val = util.get_value_at(keys[j], # <<<<<<<<<<<<<< + * sorted_labels[j][i-1]) + * PyTuple_SET_ITEM(tup, j, val) + */ + __pyx_t_10 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_2), __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/lib.pyx":1258 + * val = util.get_value_at(keys[j], + * sorted_labels[j][i-1]) + * PyTuple_SET_ITEM(tup, j, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * + */ + PyTuple_SET_ITEM(__pyx_v_tup, __pyx_v_j, __pyx_v_val); + + /* "pandas/lib.pyx":1259 + * sorted_labels[j][i-1]) + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * + * result[tup] = index[start:i] + */ + Py_INCREF(__pyx_v_val); + } + + /* "pandas/lib.pyx":1261 + * Py_INCREF(val) + * + * result[tup] = index[start:i] # <<<<<<<<<<<<<< + * start = i + * cur = lab + */ + __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_index, __pyx_v_start, __pyx_v_i, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_tup, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/lib.pyx":1262 + * + * result[tup] = index[start:i] + * start = i # <<<<<<<<<<<<<< + * cur = lab + * + */ + __pyx_v_start = __pyx_v_i; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/lib.pyx":1263 + * result[tup] = index[start:i] + * start = i + * cur = lab # <<<<<<<<<<<<<< + * + * tup = PyTuple_New(k) + */ + __pyx_v_cur = __pyx_v_lab; + } + + /* "pandas/lib.pyx":1265 + * cur = lab + * + * tup = PyTuple_New(k) # <<<<<<<<<<<<<< + * for j in range(k): + * val = util.get_value_at(keys[j], + */ + __pyx_t_10 = PyTuple_New(__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_XDECREF_SET(__pyx_v_tup, __pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/lib.pyx":1266 + * + * tup = PyTuple_New(k) + * for j in range(k): # <<<<<<<<<<<<<< + * val = util.get_value_at(keys[j], + * sorted_labels[j][n - 1]) + */ + __pyx_t_1 = __pyx_v_k; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) { + __pyx_v_j = __pyx_t_6; + + /* "pandas/lib.pyx":1267 + * tup = PyTuple_New(k) + * for j in range(k): + * val = util.get_value_at(keys[j], # <<<<<<<<<<<<<< + * sorted_labels[j][n - 1]) + * PyTuple_SET_ITEM(tup, j, val) + */ + if (unlikely(__pyx_v_keys == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_keys, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1268 + * for j in range(k): + * val = util.get_value_at(keys[j], + * sorted_labels[j][n - 1]) # <<<<<<<<<<<<<< + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) + */ + if (unlikely(__pyx_v_sorted_labels == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_sorted_labels, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = (__pyx_v_n - 1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_12, __pyx_t_8, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/lib.pyx":1267 + * tup = PyTuple_New(k) + * for j in range(k): + * val = util.get_value_at(keys[j], # <<<<<<<<<<<<<< + * sorted_labels[j][n - 1]) + * PyTuple_SET_ITEM(tup, j, val) + */ + __pyx_t_12 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_10), __pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_12); + __pyx_t_12 = 0; + + /* "pandas/lib.pyx":1269 + * val = util.get_value_at(keys[j], + * sorted_labels[j][n - 1]) + * PyTuple_SET_ITEM(tup, j, val) # <<<<<<<<<<<<<< + * Py_INCREF(val) + * result[tup] = index[start:] + */ + PyTuple_SET_ITEM(__pyx_v_tup, __pyx_v_j, __pyx_v_val); + + /* "pandas/lib.pyx":1270 + * sorted_labels[j][n - 1]) + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) # <<<<<<<<<<<<<< + * result[tup] = index[start:] + * + */ + Py_INCREF(__pyx_v_val); + } + + /* "pandas/lib.pyx":1271 + * PyTuple_SET_ITEM(tup, j, val) + * Py_INCREF(val) + * result[tup] = index[start:] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_index, __pyx_v_start, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_tup, __pyx_t_12) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/lib.pyx":1273 + * result[tup] = index[start:] + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/lib.pyx":1235 + * + * + * def indices_fast(object index, ndarray[int64_t] labels, list keys, # <<<<<<<<<<<<<< + * list sorted_labels): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.indices_fast", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_6pandas_3lib_106generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + +/* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_105get_blkno_indexers(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_104get_blkno_indexers[] = "\n Enumerate contiguous runs of integers in ndarray.\n\n Iterate over elements of `blknos` yielding ``(blkno, slice(start, stop))``\n pairs for each contiguous run found.\n\n If `group` is True and there is more than one run for a certain blkno,\n ``(blkno, array)`` with an array containing positions of all elements equal\n to blkno.\n\n Returns\n -------\n iter : iterator of (int, slice or array)\n\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_105get_blkno_indexers = {__Pyx_NAMESTR("get_blkno_indexers"), (PyCFunction)__pyx_pw_6pandas_3lib_105get_blkno_indexers, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_104get_blkno_indexers)}; +static PyObject *__pyx_pw_6pandas_3lib_105get_blkno_indexers(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_blknos = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_group; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_blkno_indexers (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_blknos,&__pyx_n_s_group,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blknos)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_group); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_blkno_indexers") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_blknos = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_blknos.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[1]) { + __pyx_v_group = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_group == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_group = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_blkno_indexers", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.get_blkno_indexers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_104get_blkno_indexers(__pyx_self, __pyx_v_blknos, __pyx_v_group); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_6pandas_3lib_18get_blkno_indexers_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + +/* "pandas/lib.pyx":1345 + * yield blkno, slice(slices[0][0], slices[0][1]) + * else: + * tot_len = sum(stop - start for start, stop in slices) # <<<<<<<<<<<<<< + * result = np.empty(tot_len, dtype=np.int64) + * res_view = result + */ + +static PyObject *__pyx_pf_6pandas_3lib_18get_blkno_indexers_genexpr(PyObject *__pyx_self) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_genexpr(__pyx_ptype_6pandas_3lib___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *) __pyx_self; + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6pandas_3lib_18get_blkno_indexers_2generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.get_blkno_indexers.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6pandas_3lib_18get_blkno_indexers_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L8_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices)) { __Pyx_RaiseClosureNameError("slices"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_slices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_start); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_start, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_stop); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_stop, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_4 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop, __pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L8_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return NULL; +} + +/* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + +static PyObject *__pyx_pf_6pandas_3lib_104get_blkno_indexers(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_blknos, int __pyx_v_group) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_blkno_indexers", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)__pyx_tp_new_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(__pyx_ptype_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_blknos = __pyx_v_blknos; + __pyx_cur_scope->__pyx_v_group = __pyx_v_group; + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6pandas_3lib_106generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.get_blkno_indexers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_blknos, 1); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6pandas_3lib_106generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *__pyx_cur_scope = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *(*__pyx_t_18)(PyObject *); + PyObject *(*__pyx_t_19)(PyObject *); + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L9_resume_from_yield; + case 2: goto __pyx_L10_resume_from_yield; + case 3: goto __pyx_L19_resume_from_yield; + case 4: goto __pyx_L26_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1304 + * int64_t[:] res_view + * + * n = blknos.shape[0] # <<<<<<<<<<<<<< + * + * if n > 0: + */ + __pyx_cur_scope->__pyx_v_n = (__pyx_cur_scope->__pyx_v_blknos.shape[0]); + + /* "pandas/lib.pyx":1306 + * n = blknos.shape[0] + * + * if n > 0: # <<<<<<<<<<<<<< + * start = 0 + * cur_blkno = blknos[start] + */ + __pyx_t_1 = ((__pyx_cur_scope->__pyx_v_n > 0) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1307 + * + * if n > 0: + * start = 0 # <<<<<<<<<<<<<< + * cur_blkno = blknos[start] + * + */ + __pyx_cur_scope->__pyx_v_start = 0; + + /* "pandas/lib.pyx":1308 + * if n > 0: + * start = 0 + * cur_blkno = blknos[start] # <<<<<<<<<<<<<< + * + * if group == False: + */ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_start; + __pyx_cur_scope->__pyx_v_cur_blkno = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_2 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))); + + /* "pandas/lib.pyx":1310 + * cur_blkno = blknos[start] + * + * if group == False: # <<<<<<<<<<<<<< + * for i in range(1, n): + * if blknos[i] != cur_blkno: + */ + __pyx_t_1 = ((__pyx_cur_scope->__pyx_v_group == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1311 + * + * if group == False: + * for i in range(1, n): # <<<<<<<<<<<<<< + * if blknos[i] != cur_blkno: + * yield cur_blkno, slice(start, i) + */ + __pyx_t_3 = __pyx_cur_scope->__pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_cur_scope->__pyx_v_i = __pyx_t_4; + + /* "pandas/lib.pyx":1312 + * if group == False: + * for i in range(1, n): + * if blknos[i] != cur_blkno: # <<<<<<<<<<<<<< + * yield cur_blkno, slice(start, i) + * + */ + __pyx_t_5 = __pyx_cur_scope->__pyx_v_i; + __pyx_t_1 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_5 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))) != __pyx_cur_scope->__pyx_v_cur_blkno) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1313 + * for i in range(1, n): + * if blknos[i] != cur_blkno: + * yield cur_blkno, slice(start, i) # <<<<<<<<<<<<<< + * + * start = i + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_6 = 0; + __pyx_t_8 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_3; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_4; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_5; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L9_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_4 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_3; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1315 + * yield cur_blkno, slice(start, i) + * + * start = i # <<<<<<<<<<<<<< + * cur_blkno = blknos[i] + * + */ + __pyx_cur_scope->__pyx_v_start = __pyx_cur_scope->__pyx_v_i; + + /* "pandas/lib.pyx":1316 + * + * start = i + * cur_blkno = blknos[i] # <<<<<<<<<<<<<< + * + * yield cur_blkno, slice(start, n) + */ + __pyx_t_10 = __pyx_cur_scope->__pyx_v_i; + __pyx_cur_scope->__pyx_v_cur_blkno = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_10 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))); + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "pandas/lib.pyx":1318 + * cur_blkno = blknos[i] + * + * yield cur_blkno, slice(start, n) # <<<<<<<<<<<<<< + * else: + * group_order = [] + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_8 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_9 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_10; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 2; + return __pyx_r; + __pyx_L10_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_10 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/lib.pyx":1320 + * yield cur_blkno, slice(start, n) + * else: + * group_order = [] # <<<<<<<<<<<<<< + * group_dict = {} + * + */ + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_cur_scope->__pyx_v_group_order = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1321 + * else: + * group_order = [] + * group_dict = {} # <<<<<<<<<<<<<< + * + * for i in range(1, n): + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_cur_scope->__pyx_v_group_dict = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1323 + * group_dict = {} + * + * for i in range(1, n): # <<<<<<<<<<<<<< + * if blknos[i] != cur_blkno: + * if cur_blkno not in group_dict: + */ + __pyx_t_3 = __pyx_cur_scope->__pyx_v_n; + for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_cur_scope->__pyx_v_i = __pyx_t_4; + + /* "pandas/lib.pyx":1324 + * + * for i in range(1, n): + * if blknos[i] != cur_blkno: # <<<<<<<<<<<<<< + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) + */ + __pyx_t_11 = __pyx_cur_scope->__pyx_v_i; + __pyx_t_1 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_11 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))) != __pyx_cur_scope->__pyx_v_cur_blkno) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1325 + * for i in range(1, n): + * if blknos[i] != cur_blkno: + * if cur_blkno not in group_dict: # <<<<<<<<<<<<<< + * group_order.append(cur_blkno) + * group_dict[cur_blkno] = [(start, i)] + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__Pyx_PyDict_Contains(__pyx_t_7, __pyx_cur_scope->__pyx_v_group_dict, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = (__pyx_t_1 != 0); + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1326 + * if blknos[i] != cur_blkno: + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) # <<<<<<<<<<<<<< + * group_dict[cur_blkno] = [(start, i)] + * else: + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_group_order, __pyx_t_7); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1327 + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) + * group_dict[cur_blkno] = [(start, i)] # <<<<<<<<<<<<<< + * else: + * group_dict[cur_blkno].append((start, i)) + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_t_9, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/lib.pyx":1329 + * group_dict[cur_blkno] = [(start, i)] + * else: + * group_dict[cur_blkno].append((start, i)) # <<<<<<<<<<<<<< + * + * start = i + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_t_6); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_9, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_L14:; + + /* "pandas/lib.pyx":1331 + * group_dict[cur_blkno].append((start, i)) + * + * start = i # <<<<<<<<<<<<<< + * cur_blkno = blknos[i] + * + */ + __pyx_cur_scope->__pyx_v_start = __pyx_cur_scope->__pyx_v_i; + + /* "pandas/lib.pyx":1332 + * + * start = i + * cur_blkno = blknos[i] # <<<<<<<<<<<<<< + * + * if cur_blkno not in group_dict: + */ + __pyx_t_14 = __pyx_cur_scope->__pyx_v_i; + __pyx_cur_scope->__pyx_v_cur_blkno = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_blknos.data + __pyx_t_14 * __pyx_cur_scope->__pyx_v_blknos.strides[0]) ))); + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/lib.pyx":1334 + * cur_blkno = blknos[i] + * + * if cur_blkno not in group_dict: # <<<<<<<<<<<<<< + * group_order.append(cur_blkno) + * group_dict[cur_blkno] = [(start, n)] + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = (__Pyx_PyDict_Contains(__pyx_t_8, __pyx_cur_scope->__pyx_v_group_dict, Py_NE)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = (__pyx_t_12 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1335 + * + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) # <<<<<<<<<<<<<< + * group_dict[cur_blkno] = [(start, n)] + * else: + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_group_order, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/lib.pyx":1336 + * if cur_blkno not in group_dict: + * group_order.append(cur_blkno) + * group_dict[cur_blkno] = [(start, n)] # <<<<<<<<<<<<<< + * else: + * group_dict[cur_blkno].append((start, n)) + */ + __pyx_t_8 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_t_7, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/lib.pyx":1338 + * group_dict[cur_blkno] = [(start, n)] + * else: + * group_dict[cur_blkno].append((start, n)) # <<<<<<<<<<<<<< + * + * for blkno in group_order: + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_cur_scope->__pyx_v_cur_blkno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_t_9); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_6); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_L15:; + + /* "pandas/lib.pyx":1340 + * group_dict[cur_blkno].append((start, n)) + * + * for blkno in group_order: # <<<<<<<<<<<<<< + * slices = group_dict[blkno] + * if len(slices) == 1: + */ + __pyx_t_6 = __pyx_cur_scope->__pyx_v_group_order; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_blkno); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_blkno, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1341 + * + * for blkno in group_order: + * slices = group_dict[blkno] # <<<<<<<<<<<<<< + * if len(slices) == 1: + * yield blkno, slice(slices[0][0], slices[0][1]) + */ + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_group_dict, __pyx_cur_scope->__pyx_v_blkno); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_slices); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_slices, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1342 + * for blkno in group_order: + * slices = group_dict[blkno] + * if len(slices) == 1: # <<<<<<<<<<<<<< + * yield blkno, slice(slices[0][0], slices[0][1]) + * else: + */ + __pyx_t_7 = __pyx_cur_scope->__pyx_v_slices; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_4 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = ((__pyx_t_4 == 1) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1343 + * slices = group_dict[blkno] + * if len(slices) == 1: + * yield blkno, slice(slices[0][0], slices[0][1]) # <<<<<<<<<<<<<< + * else: + * tot_len = sum(stop - start for start, stop in slices) + */ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_slices, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_slices, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_blkno); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_blkno); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_blkno); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_3; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; + __Pyx_XGIVEREF(__pyx_t_6); + __pyx_cur_scope->__pyx_t_4 = __pyx_t_6; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; + __pyx_cur_scope->__pyx_t_6 = __pyx_t_14; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 3; + return __pyx_r; + __pyx_L19_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = 0; + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; + __pyx_t_14 = __pyx_cur_scope->__pyx_t_6; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/lib.pyx":1345 + * yield blkno, slice(slices[0][0], slices[0][1]) + * else: + * tot_len = sum(stop - start for start, stop in slices) # <<<<<<<<<<<<<< + * result = np.empty(tot_len, dtype=np.int64) + * res_view = result + */ + __pyx_t_7 = __pyx_pf_6pandas_3lib_18get_blkno_indexers_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tot_len); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tot_len, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1346 + * else: + * tot_len = sum(stop - start for start, stop in slices) + * result = np.empty(tot_len, dtype=np.int64) # <<<<<<<<<<<<<< + * res_view = result + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tot_len); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_tot_len); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tot_len); + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int64); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_result); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_result, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/lib.pyx":1347 + * tot_len = sum(stop - start for start, stop in slices) + * result = np.empty(tot_len, dtype=np.int64) + * res_view = result # <<<<<<<<<<<<<< + * + * i = 0 + */ + __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_cur_scope->__pyx_v_result); + if (unlikely(!__pyx_t_17.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_res_view, 1); + __pyx_cur_scope->__pyx_v_res_view = __pyx_t_17; + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; + + /* "pandas/lib.pyx":1349 + * res_view = result + * + * i = 0 # <<<<<<<<<<<<<< + * for start, stop in slices: + * for diff in range(start, stop): + */ + __pyx_cur_scope->__pyx_v_i = 0; + + /* "pandas/lib.pyx":1350 + * + * i = 0 + * for start, stop in slices: # <<<<<<<<<<<<<< + * for diff in range(start, stop): + * res_view[i] = diff + */ + if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_slices) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_slices)) { + __pyx_t_16 = __pyx_cur_scope->__pyx_v_slices; __Pyx_INCREF(__pyx_t_16); __pyx_t_4 = 0; + __pyx_t_18 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_slices); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = Py_TYPE(__pyx_t_16)->tp_iternext; + } + for (;;) { + if (!__pyx_t_18 && PyList_CheckExact(__pyx_t_16)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_16)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_18 && PyTuple_CheckExact(__pyx_t_16)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_16)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_18(__pyx_t_16); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { + PyObject* sequence = __pyx_t_8; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_7 = PyList_GET_ITEM(sequence, 0); + __pyx_t_9 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_9); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_15 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_19 = Py_TYPE(__pyx_t_15)->tp_iternext; + index = 0; __pyx_t_7 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_9 = __pyx_t_19(__pyx_t_15); if (unlikely(!__pyx_t_9)) goto __pyx_L22_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = NULL; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L23_unpacking_done; + __pyx_L22_unpacking_failed:; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_19 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L23_unpacking_done:; + } + __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_cur_scope->__pyx_v_start = __pyx_t_20; + __pyx_cur_scope->__pyx_v_stop = __pyx_t_21; + + /* "pandas/lib.pyx":1351 + * i = 0 + * for start, stop in slices: + * for diff in range(start, stop): # <<<<<<<<<<<<<< + * res_view[i] = diff + * i += 1 + */ + __pyx_t_21 = __pyx_cur_scope->__pyx_v_stop; + for (__pyx_t_20 = __pyx_cur_scope->__pyx_v_start; __pyx_t_20 < __pyx_t_21; __pyx_t_20+=1) { + __pyx_cur_scope->__pyx_v_diff = __pyx_t_20; + + /* "pandas/lib.pyx":1352 + * for start, stop in slices: + * for diff in range(start, stop): + * res_view[i] = diff # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_22 = __pyx_cur_scope->__pyx_v_i; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_res_view.data + __pyx_t_22 * __pyx_cur_scope->__pyx_v_res_view.strides[0]) )) = __pyx_cur_scope->__pyx_v_diff; + + /* "pandas/lib.pyx":1353 + * for diff in range(start, stop): + * res_view[i] = diff + * i += 1 # <<<<<<<<<<<<<< + * + * yield blkno, result + */ + __pyx_cur_scope->__pyx_v_i = (__pyx_cur_scope->__pyx_v_i + 1); + } + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/lib.pyx":1355 + * i += 1 + * + * yield blkno, result # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_blkno); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_cur_scope->__pyx_v_blkno); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_blkno); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_result); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_result); + __pyx_r = __pyx_t_16; + __pyx_t_16 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_3; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; + __Pyx_XGIVEREF(__pyx_t_6); + __pyx_cur_scope->__pyx_t_4 = __pyx_t_6; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; + __pyx_cur_scope->__pyx_t_6 = __pyx_t_14; + __pyx_cur_scope->__pyx_t_7 = __pyx_t_22; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 4; + return __pyx_r; + __pyx_L26_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = 0; + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; + __pyx_t_14 = __pyx_cur_scope->__pyx_t_6; + __pyx_t_22 = __pyx_cur_scope->__pyx_t_7; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L18:; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_L5:; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __Pyx_AddTraceback("get_blkno_indexers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return NULL; +} + +/* "pandas/lib.pyx":1360 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef slice indexer_as_slice(int64_t[:] vals): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, start, stop + */ + +static PyObject *__pyx_pw_6pandas_3lib_108indexer_as_slice(PyObject *__pyx_self, PyObject *__pyx_arg_vals); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_indexer_as_slice(__Pyx_memviewslice __pyx_v_vals, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + __pyx_t_5numpy_int64_t __pyx_v_d; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("indexer_as_slice", 0); + + /* "pandas/lib.pyx":1365 + * int64_t d + * + * if vals is None: # <<<<<<<<<<<<<< + * raise TypeError("vals must be ndarray") + * + */ + __pyx_t_1 = ((((PyObject *) __pyx_v_vals.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1366 + * + * if vals is None: + * raise TypeError("vals must be ndarray") # <<<<<<<<<<<<<< + * + * n = vals.shape[0] + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1368 + * raise TypeError("vals must be ndarray") + * + * n = vals.shape[0] # <<<<<<<<<<<<<< + * + * if n == 0 or vals[0] < 0: + */ + __pyx_v_n = (__pyx_v_vals.shape[0]); + + /* "pandas/lib.pyx":1370 + * n = vals.shape[0] + * + * if n == 0 or vals[0] < 0: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((__pyx_v_n == 0) != 0); + if (!__pyx_t_1) { + __pyx_t_3 = 0; + __pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_3 * __pyx_v_vals.strides[0]) ))) < 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/lib.pyx":1371 + * + * if n == 0 or vals[0] < 0: + * return None # <<<<<<<<<<<<<< + * + * if n == 1: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = ((PyObject*)Py_None); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1373 + * return None + * + * if n == 1: # <<<<<<<<<<<<<< + * return slice(vals[0], vals[0] + 1, 1) + * + */ + __pyx_t_5 = ((__pyx_v_n == 1) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":1374 + * + * if n == 1: + * return slice(vals[0], vals[0] + 1, 1) # <<<<<<<<<<<<<< + * + * if vals[1] < 0: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_6 * __pyx_v_vals.strides[0]) )))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_7 * __pyx_v_vals.strides[0]) ))) + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(PySlice_Check(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1376 + * return slice(vals[0], vals[0] + 1, 1) + * + * if vals[1] < 0: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_10 = 1; + __pyx_t_5 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_10 * __pyx_v_vals.strides[0]) ))) < 0) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":1377 + * + * if vals[1] < 0: + * return None # <<<<<<<<<<<<<< + * + * # n > 2 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = ((PyObject*)Py_None); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1380 + * + * # n > 2 + * d = vals[1] - vals[0] # <<<<<<<<<<<<<< + * + * if d == 0: + */ + __pyx_t_11 = 1; + __pyx_t_12 = 0; + __pyx_v_d = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_11 * __pyx_v_vals.strides[0]) ))) - (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_12 * __pyx_v_vals.strides[0]) )))); + + /* "pandas/lib.pyx":1382 + * d = vals[1] - vals[0] + * + * if d == 0: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_5 = ((__pyx_v_d == 0) != 0); + if (__pyx_t_5) { + + /* "pandas/lib.pyx":1383 + * + * if d == 0: + * return None # <<<<<<<<<<<<<< + * + * for i in range(2, n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = ((PyObject*)Py_None); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1385 + * return None + * + * for i in range(2, n): # <<<<<<<<<<<<<< + * if vals[i] < 0 or vals[i] - vals[i-1] != d: + * return None + */ + __pyx_t_13 = __pyx_v_n; + for (__pyx_t_14 = 2; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/lib.pyx":1386 + * + * for i in range(2, n): + * if vals[i] < 0 or vals[i] - vals[i-1] != d: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_5 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_15 * __pyx_v_vals.strides[0]) ))) < 0) != 0); + if (!__pyx_t_5) { + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = (__pyx_v_i - 1); + __pyx_t_1 = ((((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_16 * __pyx_v_vals.strides[0]) ))) - (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_17 * __pyx_v_vals.strides[0]) )))) != __pyx_v_d) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1387 + * for i in range(2, n): + * if vals[i] < 0 or vals[i] - vals[i-1] != d: + * return None # <<<<<<<<<<<<<< + * + * start = vals[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = ((PyObject*)Py_None); + goto __pyx_L0; + } + } + + /* "pandas/lib.pyx":1389 + * return None + * + * start = vals[0] # <<<<<<<<<<<<<< + * stop = start + n * d + * if stop < 0 and d < 0: + */ + __pyx_t_13 = 0; + __pyx_v_start = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_vals.data + __pyx_t_13 * __pyx_v_vals.strides[0]) ))); + + /* "pandas/lib.pyx":1390 + * + * start = vals[0] + * stop = start + n * d # <<<<<<<<<<<<<< + * if stop < 0 and d < 0: + * return slice(start, None, d) + */ + __pyx_v_stop = (__pyx_v_start + (__pyx_v_n * __pyx_v_d)); + + /* "pandas/lib.pyx":1391 + * start = vals[0] + * stop = start + n * d + * if stop < 0 and d < 0: # <<<<<<<<<<<<<< + * return slice(start, None, d) + * else: + */ + __pyx_t_4 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_4) { + __pyx_t_5 = ((__pyx_v_d < 0) != 0); + __pyx_t_1 = __pyx_t_5; + } else { + __pyx_t_1 = __pyx_t_4; + } + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1392 + * stop = start + n * d + * if stop < 0 and d < 0: + * return slice(start, None, d) # <<<<<<<<<<<<<< + * else: + * return slice(start, stop, d) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_d); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PySlice_Check(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1394 + * return slice(start, None, d) + * else: + * return slice(start, stop, d) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_d); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_9 = 0; + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (!(likely(PySlice_Check(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1360 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cpdef slice indexer_as_slice(int64_t[:] vals): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n, start, stop + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_AddTraceback("pandas.lib.indexer_as_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_108indexer_as_slice(PyObject *__pyx_self, PyObject *__pyx_arg_vals); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_108indexer_as_slice(PyObject *__pyx_self, PyObject *__pyx_arg_vals) { + __Pyx_memviewslice __pyx_v_vals = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("indexer_as_slice (wrapper)", 0); + assert(__pyx_arg_vals); { + __pyx_v_vals = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_arg_vals); if (unlikely(!__pyx_v_vals.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.indexer_as_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_107indexer_as_slice(__pyx_self, __pyx_v_vals); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_107indexer_as_slice(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_vals) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("indexer_as_slice", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_vals.memview)) { __Pyx_RaiseUnboundLocalError("vals"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __pyx_f_6pandas_3lib_indexer_as_slice(__pyx_v_vals, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.indexer_as_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_vals, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1397 + * + * + * cpdef slice_canonize(slice s): # <<<<<<<<<<<<<< + * """ + * Convert slice to canonical bounded form. + */ + +static PyObject *__pyx_pw_6pandas_3lib_110slice_canonize(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_slice_canonize(PyObject *__pyx_v_s, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_canonize", 0); + + /* "pandas/lib.pyx":1404 + * Py_ssize_t start, stop, step, length + * + * if s.step is None: # <<<<<<<<<<<<<< + * step = 1 + * else: + */ + __pyx_t_1 = (((PySliceObject*)__pyx_v_s)->step == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1405 + * + * if s.step is None: + * step = 1 # <<<<<<<<<<<<<< + * else: + * step = s.step + */ + __pyx_v_step = 1; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1407 + * step = 1 + * else: + * step = s.step # <<<<<<<<<<<<<< + * if step == 0: + * raise ValueError("slice step cannot be zero") + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->step); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_step = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1408 + * else: + * step = s.step + * if step == 0: # <<<<<<<<<<<<<< + * raise ValueError("slice step cannot be zero") + * + */ + __pyx_t_2 = ((__pyx_v_step == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1409 + * step = s.step + * if step == 0: + * raise ValueError("slice step cannot be zero") # <<<<<<<<<<<<<< + * + * if step > 0: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L3:; + + /* "pandas/lib.pyx":1411 + * raise ValueError("slice step cannot be zero") + * + * if step > 0: # <<<<<<<<<<<<<< + * if s.stop is None: + * raise ValueError("unbounded slice") + */ + __pyx_t_2 = ((__pyx_v_step > 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1412 + * + * if step > 0: + * if s.stop is None: # <<<<<<<<<<<<<< + * raise ValueError("unbounded slice") + * + */ + __pyx_t_2 = (((PySliceObject*)__pyx_v_s)->stop == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1413 + * if step > 0: + * if s.stop is None: + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * stop = s.stop + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1415 + * raise ValueError("unbounded slice") + * + * stop = s.stop # <<<<<<<<<<<<<< + * if s.start is None: + * start = 0 + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->stop); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_stop = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1416 + * + * stop = s.stop + * if s.start is None: # <<<<<<<<<<<<<< + * start = 0 + * else: + */ + __pyx_t_1 = (((PySliceObject*)__pyx_v_s)->start == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1417 + * stop = s.stop + * if s.start is None: + * start = 0 # <<<<<<<<<<<<<< + * else: + * start = s.start + */ + __pyx_v_start = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/lib.pyx":1419 + * start = 0 + * else: + * start = s.start # <<<<<<<<<<<<<< + * if start > stop: + * start = stop + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->start); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_start = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1420 + * else: + * start = s.start + * if start > stop: # <<<<<<<<<<<<<< + * start = stop + * elif step < 0: + */ + __pyx_t_2 = ((__pyx_v_start > __pyx_v_stop) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1421 + * start = s.start + * if start > stop: + * start = stop # <<<<<<<<<<<<<< + * elif step < 0: + * if s.start is None: + */ + __pyx_v_start = __pyx_v_stop; + goto __pyx_L8; + } + __pyx_L8:; + } + __pyx_L7:; + goto __pyx_L5; + } + + /* "pandas/lib.pyx":1422 + * if start > stop: + * start = stop + * elif step < 0: # <<<<<<<<<<<<<< + * if s.start is None: + * raise ValueError("unbounded slice") + */ + __pyx_t_2 = ((__pyx_v_step < 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1423 + * start = stop + * elif step < 0: + * if s.start is None: # <<<<<<<<<<<<<< + * raise ValueError("unbounded slice") + * + */ + __pyx_t_2 = (((PySliceObject*)__pyx_v_s)->start == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1424 + * elif step < 0: + * if s.start is None: + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * start = s.start + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1426 + * raise ValueError("unbounded slice") + * + * start = s.start # <<<<<<<<<<<<<< + * if s.stop is None: + * stop = -1 + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->start); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_start = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1427 + * + * start = s.start + * if s.stop is None: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + __pyx_t_1 = (((PySliceObject*)__pyx_v_s)->stop == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1428 + * start = s.start + * if s.stop is None: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = s.stop + */ + __pyx_v_stop = -1; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/lib.pyx":1430 + * stop = -1 + * else: + * stop = s.stop # <<<<<<<<<<<<<< + * if stop > start: + * stop = start + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_s)->stop); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_stop = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/lib.pyx":1431 + * else: + * stop = s.stop + * if stop > start: # <<<<<<<<<<<<<< + * stop = start + * + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_start) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1432 + * stop = s.stop + * if stop > start: + * stop = start # <<<<<<<<<<<<<< + * + * if start < 0 or (stop < 0 and s.stop is not None): + */ + __pyx_v_stop = __pyx_v_start; + goto __pyx_L11; + } + __pyx_L11:; + } + __pyx_L10:; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/lib.pyx":1434 + * stop = start + * + * if start < 0 or (stop < 0 and s.stop is not None): # <<<<<<<<<<<<<< + * raise ValueError("unbounded slice") + * + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (!__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_1) { + __pyx_t_5 = (((PySliceObject*)__pyx_v_s)->stop != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + } else { + __pyx_t_6 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_6; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1435 + * + * if start < 0 or (stop < 0 and s.stop is not None): + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * if stop < 0: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1437 + * raise ValueError("unbounded slice") + * + * if stop < 0: # <<<<<<<<<<<<<< + * return slice(start, None, step) + * else: + */ + __pyx_t_1 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1438 + * + * if stop < 0: + * return slice(start, None, step) # <<<<<<<<<<<<<< + * else: + * return slice(start, stop, step) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 1, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1440 + * return slice(start, None, step) + * else: + * return slice(start, stop, step) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1397 + * + * + * cpdef slice_canonize(slice s): # <<<<<<<<<<<<<< + * """ + * Convert slice to canonical bounded form. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.lib.slice_canonize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_110slice_canonize(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static char __pyx_doc_6pandas_3lib_109slice_canonize[] = "\n Convert slice to canonical bounded form.\n "; +static PyObject *__pyx_pw_6pandas_3lib_110slice_canonize(PyObject *__pyx_self, PyObject *__pyx_v_s) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("slice_canonize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PySlice_Type), 1, "s", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_109slice_canonize(__pyx_self, ((PyObject*)__pyx_v_s)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_109slice_canonize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_canonize", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_canonize(__pyx_v_s, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.slice_canonize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1443 + * + * + * cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX): # <<<<<<<<<<<<<< + * """ + * Get (start, stop, step, length) tuple for a slice. + */ + +static PyObject *__pyx_pw_6pandas_3lib_112slice_get_indices_ex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_slice_get_indices_ex(PyObject *__pyx_v_slc, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex *__pyx_optional_args) { + Py_ssize_t __pyx_v_objlen = __pyx_k__17; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_get_indices_ex", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_objlen = __pyx_optional_args->objlen; + } + } + + /* "pandas/lib.pyx":1454 + * Py_ssize_t start, stop, step, length + * + * if slc is None: # <<<<<<<<<<<<<< + * raise TypeError("slc should be a slice") + * + */ + __pyx_t_1 = (__pyx_v_slc == ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1455 + * + * if slc is None: + * raise TypeError("slc should be a slice") # <<<<<<<<<<<<<< + * + * PySlice_GetIndicesEx(slc, objlen, + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1457 + * raise TypeError("slc should be a slice") + * + * PySlice_GetIndicesEx(slc, objlen, # <<<<<<<<<<<<<< + * &start, &stop, &step, &length) + * return start, stop, step, length + */ + __pyx_t_4 = PySlice_GetIndicesEx(((PySliceObject *)__pyx_v_slc), __pyx_v_objlen, (&__pyx_v_start), (&__pyx_v_stop), (&__pyx_v_step), (&__pyx_v_length)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1459 + * PySlice_GetIndicesEx(slc, objlen, + * &start, &stop, &step, &length) + * return start, stop, step, length # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1443 + * + * + * cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX): # <<<<<<<<<<<<<< + * """ + * Get (start, stop, step, length) tuple for a slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.lib.slice_get_indices_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_112slice_get_indices_ex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_111slice_get_indices_ex[] = "\n Get (start, stop, step, length) tuple for a slice.\n\n If `objlen` is not specified, slice must be bounded, otherwise the result\n will be wrong.\n\n "; +static PyObject *__pyx_pw_6pandas_3lib_112slice_get_indices_ex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_slc = 0; + Py_ssize_t __pyx_v_objlen; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("slice_get_indices_ex (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_slc,&__pyx_n_s_objlen,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_objlen); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice_get_indices_ex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_slc = ((PyObject*)values[0]); + if (values[1]) { + __pyx_v_objlen = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_objlen == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_objlen = __pyx_k__17; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("slice_get_indices_ex", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.slice_get_indices_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slc), (&PySlice_Type), 1, "slc", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_111slice_get_indices_ex(__pyx_self, __pyx_v_slc, __pyx_v_objlen); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_111slice_get_indices_ex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, Py_ssize_t __pyx_v_objlen) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_get_indices_ex", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.objlen = __pyx_v_objlen; + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(__pyx_v_slc, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.slice_get_indices_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1462 + * + * + * cpdef Py_ssize_t slice_len(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX) except -1: # <<<<<<<<<<<<<< + * """ + * Get length of a bounded slice. + */ + +static PyObject *__pyx_pw_6pandas_3lib_114slice_len(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static Py_ssize_t __pyx_f_6pandas_3lib_slice_len(PyObject *__pyx_v_slc, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_slice_len *__pyx_optional_args) { + Py_ssize_t __pyx_v_objlen = __pyx_k__19; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + Py_ssize_t __pyx_v_length; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_len", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_objlen = __pyx_optional_args->objlen; + } + } + + /* "pandas/lib.pyx":1477 + * Py_ssize_t start, stop, step, length + * + * if slc is None: # <<<<<<<<<<<<<< + * raise TypeError("slc must be slice") + * + */ + __pyx_t_1 = (__pyx_v_slc == ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1478 + * + * if slc is None: + * raise TypeError("slc must be slice") # <<<<<<<<<<<<<< + * + * PySlice_GetIndicesEx(slc, objlen, + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1480 + * raise TypeError("slc must be slice") + * + * PySlice_GetIndicesEx(slc, objlen, # <<<<<<<<<<<<<< + * &start, &stop, &step, &length) + * + */ + __pyx_t_4 = PySlice_GetIndicesEx(((PySliceObject *)__pyx_v_slc), __pyx_v_objlen, (&__pyx_v_start), (&__pyx_v_stop), (&__pyx_v_step), (&__pyx_v_length)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1483 + * &start, &stop, &step, &length) + * + * return length # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_length; + goto __pyx_L0; + + /* "pandas/lib.pyx":1462 + * + * + * cpdef Py_ssize_t slice_len(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX) except -1: # <<<<<<<<<<<<<< + * """ + * Get length of a bounded slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.slice_len", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_114slice_len(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_113slice_len[] = "\n Get length of a bounded slice.\n\n The slice must not have any \"open\" bounds that would create dependency on\n container size, i.e.:\n - if ``s.step is None or s.step > 0``, ``s.stop`` is not ``None``\n - if ``s.step < 0``, ``s.start`` is not ``None``\n\n Otherwise, the result is unreliable.\n\n "; +static PyObject *__pyx_pw_6pandas_3lib_114slice_len(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_slc = 0; + Py_ssize_t __pyx_v_objlen; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("slice_len (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_slc,&__pyx_n_s_objlen,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_objlen); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice_len") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_slc = ((PyObject*)values[0]); + if (values[1]) { + __pyx_v_objlen = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_objlen == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_objlen = __pyx_k__19; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("slice_len", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.slice_len", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slc), (&PySlice_Type), 1, "slc", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_113slice_len(__pyx_self, __pyx_v_slc, __pyx_v_objlen); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_113slice_len(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, Py_ssize_t __pyx_v_objlen) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + struct __pyx_opt_args_6pandas_3lib_slice_len __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_len", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.objlen = __pyx_v_objlen; + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_len(__pyx_v_slc, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.slice_len", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1486 + * + * + * def slice_getitem(slice slc not None, ind): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s_start, s_stop, s_step, s_len + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_116slice_getitem(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_116slice_getitem = {__Pyx_NAMESTR("slice_getitem"), (PyCFunction)__pyx_pw_6pandas_3lib_116slice_getitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_116slice_getitem(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_slc = 0; + PyObject *__pyx_v_ind = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("slice_getitem (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_slc,&__pyx_n_s_ind,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("slice_getitem", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice_getitem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_slc = ((PyObject*)values[0]); + __pyx_v_ind = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("slice_getitem", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.slice_getitem", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slc), (&PySlice_Type), 0, "slc", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_115slice_getitem(__pyx_self, __pyx_v_slc, __pyx_v_ind); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_115slice_getitem(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_slc, PyObject *__pyx_v_ind) { + Py_ssize_t __pyx_v_s_start; + Py_ssize_t __pyx_v_s_stop; + Py_ssize_t __pyx_v_s_step; + Py_ssize_t __pyx_v_s_len; + Py_ssize_t __pyx_v_ind_start; + Py_ssize_t __pyx_v_ind_stop; + Py_ssize_t __pyx_v_ind_step; + Py_ssize_t __pyx_v_ind_len; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + struct __pyx_opt_args_6pandas_3lib_slice_get_indices_ex __pyx_t_14; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("slice_getitem", 0); + + /* "pandas/lib.pyx":1491 + * Py_ssize_t ind_start, ind_stop, ind_step, ind_len + * + * s_start, s_stop, s_step, s_len = slice_get_indices_ex(slc) # <<<<<<<<<<<<<< + * + * if isinstance(ind, slice): + */ + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(__pyx_v_slc, 0, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_5 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_s_start = __pyx_t_8; + __pyx_v_s_stop = __pyx_t_9; + __pyx_v_s_step = __pyx_t_10; + __pyx_v_s_len = __pyx_t_11; + + /* "pandas/lib.pyx":1493 + * s_start, s_stop, s_step, s_len = slice_get_indices_ex(slc) + * + * if isinstance(ind, slice): # <<<<<<<<<<<<<< + * ind_start, ind_stop, ind_step, ind_len = slice_get_indices_ex(ind, + * s_len) + */ + __pyx_t_12 = PySlice_Check(__pyx_v_ind); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/lib.pyx":1494 + * + * if isinstance(ind, slice): + * ind_start, ind_stop, ind_step, ind_len = slice_get_indices_ex(ind, # <<<<<<<<<<<<<< + * s_len) + * + */ + if (!(likely(PySlice_Check(__pyx_v_ind))||((__pyx_v_ind) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_v_ind)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1495 + * if isinstance(ind, slice): + * ind_start, ind_stop, ind_step, ind_len = slice_get_indices_ex(ind, + * s_len) # <<<<<<<<<<<<<< + * + * if ind_step > 0 and ind_len == s_len: + */ + __pyx_t_14.__pyx_n = 1; + __pyx_t_14.objlen = __pyx_v_s_len; + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(((PyObject*)__pyx_v_ind), 0, &__pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_2}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_2}; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + + /* "pandas/lib.pyx":1494 + * + * if isinstance(ind, slice): + * ind_start, ind_stop, ind_step, ind_len = slice_get_indices_ex(ind, # <<<<<<<<<<<<<< + * s_len) + * + */ + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ind_start = __pyx_t_11; + __pyx_v_ind_stop = __pyx_t_10; + __pyx_v_ind_step = __pyx_t_9; + __pyx_v_ind_len = __pyx_t_8; + + /* "pandas/lib.pyx":1497 + * s_len) + * + * if ind_step > 0 and ind_len == s_len: # <<<<<<<<<<<<<< + * # short-cut for no-op slice + * if ind_len == s_len: + */ + __pyx_t_13 = ((__pyx_v_ind_step > 0) != 0); + if (__pyx_t_13) { + __pyx_t_12 = ((__pyx_v_ind_len == __pyx_v_s_len) != 0); + __pyx_t_15 = __pyx_t_12; + } else { + __pyx_t_15 = __pyx_t_13; + } + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1499 + * if ind_step > 0 and ind_len == s_len: + * # short-cut for no-op slice + * if ind_len == s_len: # <<<<<<<<<<<<<< + * return slc + * + */ + __pyx_t_15 = ((__pyx_v_ind_len == __pyx_v_s_len) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1500 + * # short-cut for no-op slice + * if ind_len == s_len: + * return slc # <<<<<<<<<<<<<< + * + * if ind_step < 0: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_slc); + __pyx_r = __pyx_v_slc; + goto __pyx_L0; + } + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/lib.pyx":1502 + * return slc + * + * if ind_step < 0: # <<<<<<<<<<<<<< + * s_start = s_stop - s_step + * ind_step = -ind_step + */ + __pyx_t_15 = ((__pyx_v_ind_step < 0) != 0); + if (__pyx_t_15) { + + /* "pandas/lib.pyx":1503 + * + * if ind_step < 0: + * s_start = s_stop - s_step # <<<<<<<<<<<<<< + * ind_step = -ind_step + * + */ + __pyx_v_s_start = (__pyx_v_s_stop - __pyx_v_s_step); + + /* "pandas/lib.pyx":1504 + * if ind_step < 0: + * s_start = s_stop - s_step + * ind_step = -ind_step # <<<<<<<<<<<<<< + * + * s_step *= ind_step + */ + __pyx_v_ind_step = (-__pyx_v_ind_step); + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/lib.pyx":1506 + * ind_step = -ind_step + * + * s_step *= ind_step # <<<<<<<<<<<<<< + * s_stop = s_start + ind_stop * s_step + * s_start = s_start + ind_start * s_step + */ + __pyx_v_s_step = (__pyx_v_s_step * __pyx_v_ind_step); + + /* "pandas/lib.pyx":1507 + * + * s_step *= ind_step + * s_stop = s_start + ind_stop * s_step # <<<<<<<<<<<<<< + * s_start = s_start + ind_start * s_step + * + */ + __pyx_v_s_stop = (__pyx_v_s_start + (__pyx_v_ind_stop * __pyx_v_s_step)); + + /* "pandas/lib.pyx":1508 + * s_step *= ind_step + * s_stop = s_start + ind_stop * s_step + * s_start = s_start + ind_start * s_step # <<<<<<<<<<<<<< + * + * if s_step < 0 and s_stop < 0: + */ + __pyx_v_s_start = (__pyx_v_s_start + (__pyx_v_ind_start * __pyx_v_s_step)); + + /* "pandas/lib.pyx":1510 + * s_start = s_start + ind_start * s_step + * + * if s_step < 0 and s_stop < 0: # <<<<<<<<<<<<<< + * return slice(s_start, None, s_step) + * else: + */ + __pyx_t_15 = ((__pyx_v_s_step < 0) != 0); + if (__pyx_t_15) { + __pyx_t_13 = ((__pyx_v_s_stop < 0) != 0); + __pyx_t_12 = __pyx_t_13; + } else { + __pyx_t_12 = __pyx_t_15; + } + if (__pyx_t_12) { + + /* "pandas/lib.pyx":1511 + * + * if s_step < 0 and s_stop < 0: + * return slice(s_start, None, s_step) # <<<<<<<<<<<<<< + * else: + * return slice(s_start, s_stop, s_step) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_s_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s_step); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1513 + * return slice(s_start, None, s_step) + * else: + * return slice(s_start, s_stop, s_step) # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_s_stop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_s_step); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/lib.pyx":1516 + * + * else: + * return np.arange(s_start, s_stop, s_step, dtype=np.int64)[ind] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_s_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_s_stop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s_step); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ind); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1486 + * + * + * def slice_getitem(slice slc not None, ind): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s_start, s_stop, s_step, s_len + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.slice_getitem", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1526 + * cdef bint _has_slice, _has_array, _is_known_slice_like + * + * def __init__(self, val): # <<<<<<<<<<<<<< + * cdef slice slc + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_14BlockPlacement_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_14BlockPlacement_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_val = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_val = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement___init__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), __pyx_v_val); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_14BlockPlacement___init__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_val) { + PyObject *__pyx_v_slc = 0; + PyObject *__pyx_v_arr = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/lib.pyx":1529 + * cdef slice slc + * + * self._has_slice = False # <<<<<<<<<<<<<< + * self._has_array = False + * + */ + __pyx_v_self->_has_slice = 0; + + /* "pandas/lib.pyx":1530 + * + * self._has_slice = False + * self._has_array = False # <<<<<<<<<<<<<< + * + * if isinstance(val, slice): + */ + __pyx_v_self->_has_array = 0; + + /* "pandas/lib.pyx":1532 + * self._has_array = False + * + * if isinstance(val, slice): # <<<<<<<<<<<<<< + * slc = slice_canonize(val) + * + */ + __pyx_t_1 = PySlice_Check(__pyx_v_val); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1533 + * + * if isinstance(val, slice): + * slc = slice_canonize(val) # <<<<<<<<<<<<<< + * + * if slc.start != slc.stop: + */ + if (!(likely(PySlice_Check(__pyx_v_val))||((__pyx_v_val) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_v_val)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_6pandas_3lib_slice_canonize(((PyObject*)__pyx_v_val), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PySlice_Check(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_slc = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":1535 + * slc = slice_canonize(val) + * + * if slc.start != slc.stop: # <<<<<<<<<<<<<< + * self._as_slice = slc + * self._has_slice = True + */ + __pyx_t_3 = PyObject_RichCompare(((PySliceObject*)__pyx_v_slc)->start, ((PySliceObject*)__pyx_v_slc)->stop, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1536 + * + * if slc.start != slc.stop: + * self._as_slice = slc # <<<<<<<<<<<<<< + * self._has_slice = True + * else: + */ + __Pyx_INCREF(__pyx_v_slc); + __Pyx_GIVEREF(__pyx_v_slc); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = __pyx_v_slc; + + /* "pandas/lib.pyx":1537 + * if slc.start != slc.stop: + * self._as_slice = slc + * self._has_slice = True # <<<<<<<<<<<<<< + * else: + * arr = np.empty(0, dtype=np.int64) + */ + __pyx_v_self->_has_slice = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/lib.pyx":1539 + * self._has_slice = True + * else: + * arr = np.empty(0, dtype=np.int64) # <<<<<<<<<<<<<< + * self._as_array = arr + * self._has_array = True + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__21, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1540 + * else: + * arr = np.empty(0, dtype=np.int64) + * self._as_array = arr # <<<<<<<<<<<<<< + * self._has_array = True + * else: + */ + __Pyx_INCREF(__pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = __pyx_v_arr; + + /* "pandas/lib.pyx":1541 + * arr = np.empty(0, dtype=np.int64) + * self._as_array = arr + * self._has_array = True # <<<<<<<<<<<<<< + * else: + * # Cython memoryview interface requires ndarray to be writeable. + */ + __pyx_v_self->_has_array = 1; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1544 + * else: + * # Cython memoryview interface requires ndarray to be writeable. + * arr = np.require(val, dtype=np.int64, requirements='W') # <<<<<<<<<<<<<< + * assert arr.ndim == 1 + * self._as_array = arr + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_require); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_requirements, __pyx_n_s_W) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_arr = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1545 + * # Cython memoryview interface requires ndarray to be writeable. + * arr = np.require(val, dtype=np.int64, requirements='W') + * assert arr.ndim == 1 # <<<<<<<<<<<<<< + * self._as_array = arr + * self._has_array = True + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/lib.pyx":1546 + * arr = np.require(val, dtype=np.int64, requirements='W') + * assert arr.ndim == 1 + * self._as_array = arr # <<<<<<<<<<<<<< + * self._has_array = True + * + */ + __Pyx_INCREF(__pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = __pyx_v_arr; + + /* "pandas/lib.pyx":1547 + * assert arr.ndim == 1 + * self._as_array = arr + * self._has_array = True # <<<<<<<<<<<<<< + * + * def __unicode__(self): + */ + __pyx_v_self->_has_array = 1; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1526 + * cdef bint _has_slice, _has_array, _is_known_slice_like + * + * def __init__(self, val): # <<<<<<<<<<<<<< + * cdef slice slc + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_slc); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1549 + * self._has_array = True + * + * def __unicode__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_3__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_3__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_2__unicode__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_2__unicode__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__unicode__", 0); + + /* "pandas/lib.pyx":1550 + * + * def __unicode__(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * v = self._as_slice + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1551 + * def __unicode__(self): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * v = self._as_slice + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1552 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * v = self._as_slice # <<<<<<<<<<<<<< + * else: + * v = self._as_array + */ + __pyx_t_1 = __pyx_v_self->_as_slice; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_v = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1554 + * v = self._as_slice + * else: + * v = self._as_array # <<<<<<<<<<<<<< + * + * return '%s(%r)' % (self.__class__.__name__, v) + */ + __pyx_t_1 = __pyx_v_self->_as_array; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_v = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1556 + * v = self._as_array + * + * return '%s(%r)' % (self.__class__.__name__, v) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1549 + * self._has_array = True + * + * def __unicode__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1558 + * return '%s(%r)' % (self.__class__.__name__, v) + * + * def __len__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6pandas_3lib_14BlockPlacement_5__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6pandas_3lib_14BlockPlacement_5__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_4__len__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6pandas_3lib_14BlockPlacement_4__len__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "pandas/lib.pyx":1559 + * + * def __len__(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * return slice_len(s) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1560 + * def __len__(self): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * return slice_len(s) + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1561 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * return slice_len(s) # <<<<<<<<<<<<<< + * else: + * return len(self._as_array) + */ + __pyx_t_4 = __pyx_f_6pandas_3lib_slice_len(__pyx_v_s, 0, NULL); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_4; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1563 + * return slice_len(s) + * else: + * return len(self._as_array) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_1 = __pyx_v_self->_as_array; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1558 + * return '%s(%r)' % (self.__class__.__name__, v) + * + * def __len__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1565 + * return len(self._as_array) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t start, stop, step, _ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_7__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_7__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_6__iter__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_6__iter__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + CYTHON_UNUSED Py_ssize_t __pyx_v__; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "pandas/lib.pyx":1566 + * + * def __iter__(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step, _ + * if s is not None: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1568 + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t start, stop, step, _ + * if s is not None: # <<<<<<<<<<<<<< + * start, stop, step, _ = slice_get_indices_ex(s) + * return iter(range(start, stop, step)) + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1569 + * cdef Py_ssize_t start, stop, step, _ + * if s is not None: + * start, stop, step, _ = slice_get_indices_ex(s) # <<<<<<<<<<<<<< + * return iter(range(start, stop, step)) + * else: + */ + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(__pyx_v_s, 0, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = PyList_GET_ITEM(sequence, 2); + __pyx_t_7 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; + __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_start = __pyx_t_10; + __pyx_v_stop = __pyx_t_11; + __pyx_v_step = __pyx_t_12; + __pyx_v__ = __pyx_t_13; + + /* "pandas/lib.pyx":1570 + * if s is not None: + * start, stop, step, _ = slice_get_indices_ex(s) + * return iter(range(start, stop, step)) # <<<<<<<<<<<<<< + * else: + * return iter(self._as_array) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1572 + * return iter(range(start, stop, step)) + * else: + * return iter(self._as_array) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __pyx_v_self->_as_array; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1565 + * return len(self._as_array) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t start, stop, step, _ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1575 + * + * @property + * def as_slice(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_9as_slice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_9as_slice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("as_slice (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_8as_slice(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_8as_slice(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("as_slice", 0); + + /* "pandas/lib.pyx":1576 + * @property + * def as_slice(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is None: + * raise TypeError('Not slice-like') + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1577 + * def as_slice(self): + * cdef slice s = self._ensure_has_slice() + * if s is None: # <<<<<<<<<<<<<< + * raise TypeError('Not slice-like') + * else: + */ + __pyx_t_2 = (__pyx_v_s == ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1578 + * cdef slice s = self._ensure_has_slice() + * if s is None: + * raise TypeError('Not slice-like') # <<<<<<<<<<<<<< + * else: + * return s + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/lib.pyx":1580 + * raise TypeError('Not slice-like') + * else: + * return s # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1575 + * + * @property + * def as_slice(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.as_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1583 + * + * @property + * def indexer(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_11indexer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_11indexer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("indexer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_10indexer(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_10indexer(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("indexer", 0); + + /* "pandas/lib.pyx":1584 + * @property + * def indexer(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * return s + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1585 + * def indexer(self): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * return s + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1586 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * return s # <<<<<<<<<<<<<< + * else: + * return self._as_array + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1588 + * return s + * else: + * return self._as_array # <<<<<<<<<<<<<< + * + * def isin(self, arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_as_array); + __pyx_r = __pyx_v_self->_as_array; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1583 + * + * @property + * def indexer(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1590 + * return self._as_array + * + * def isin(self, arr): # <<<<<<<<<<<<<< + * from pandas.core.index import Int64Index + * return Int64Index(self.as_array, copy=False).isin(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_13isin(PyObject *__pyx_v_self, PyObject *__pyx_v_arr); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_13isin(PyObject *__pyx_v_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isin (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_12isin(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_12isin(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_v_Int64Index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isin", 0); + + /* "pandas/lib.pyx":1591 + * + * def isin(self, arr): + * from pandas.core.index import Int64Index # <<<<<<<<<<<<<< + * return Int64Index(self.as_array, copy=False).isin(arr) + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Int64Index); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Int64Index); + __Pyx_GIVEREF(__pyx_n_s_Int64Index); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas_core_index, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Int64Index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_Int64Index = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1592 + * def isin(self, arr): + * from pandas.core.index import Int64Index + * return Int64Index(self.as_array, copy=False).isin(arr) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_Int64Index, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1590 + * return self._as_array + * + * def isin(self, arr): # <<<<<<<<<<<<<< + * from pandas.core.index import Int64Index + * return Int64Index(self.as_array, copy=False).isin(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.isin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Int64Index); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1595 + * + * @property + * def as_array(self): # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_15as_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_15as_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("as_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_14as_array(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_14as_array(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + CYTHON_UNUSED Py_ssize_t __pyx_v__; + PyObject *__pyx_v_step = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("as_array", 0); + + /* "pandas/lib.pyx":1597 + * def as_array(self): + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: # <<<<<<<<<<<<<< + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) + * self._as_array = np.arange(start, stop, step, + */ + __pyx_t_1 = ((!(__pyx_v_self->_has_array != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1598 + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) # <<<<<<<<<<<<<< + * self._as_array = np.arange(start, stop, step, + * dtype=np.int64) + */ + __pyx_t_2 = __pyx_v_self->_as_slice; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_f_6pandas_3lib_slice_get_indices_ex(((PyObject*)__pyx_t_2), 0, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = PyList_GET_ITEM(sequence, 2); + __pyx_t_6 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_start = __pyx_t_9; + __pyx_v_stop = __pyx_t_10; + __pyx_v_step = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v__ = __pyx_t_11; + + /* "pandas/lib.pyx":1599 + * if not self._has_array: + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) + * self._as_array = np.arange(start, stop, step, # <<<<<<<<<<<<<< + * dtype=np.int64) + * self._has_array = True + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_step); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_step); + __Pyx_GIVEREF(__pyx_v_step); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/lib.pyx":1600 + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) + * self._as_array = np.arange(start, stop, step, + * dtype=np.int64) # <<<<<<<<<<<<<< + * self._has_array = True + * return self._as_array + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1599 + * if not self._has_array: + * start, stop, step, _ = slice_get_indices_ex(self._as_slice) + * self._as_array = np.arange(start, stop, step, # <<<<<<<<<<<<<< + * dtype=np.int64) + * self._has_array = True + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1601 + * self._as_array = np.arange(start, stop, step, + * dtype=np.int64) + * self._has_array = True # <<<<<<<<<<<<<< + * return self._as_array + * + */ + __pyx_v_self->_has_array = 1; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1602 + * dtype=np.int64) + * self._has_array = True + * return self._as_array # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_as_array); + __pyx_r = __pyx_v_self->_as_array; + goto __pyx_L0; + + /* "pandas/lib.pyx":1595 + * + * @property + * def as_array(self): # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.as_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_step); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1605 + * + * @property + * def is_slice_like(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * return s is not None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_17is_slice_like(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_17is_slice_like(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_slice_like (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_16is_slice_like(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_16is_slice_like(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice_like", 0); + + /* "pandas/lib.pyx":1606 + * @property + * def is_slice_like(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * return s is not None + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1607 + * def is_slice_like(self): + * cdef slice s = self._ensure_has_slice() + * return s is not None # <<<<<<<<<<<<<< + * + * def __getitem__(self, loc): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1605 + * + * @property + * def is_slice_like(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * return s is not None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.is_slice_like", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1609 + * return s is not None + * + * def __getitem__(self, loc): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_19__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_19__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_18__getitem__(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_18__getitem__(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_loc) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "pandas/lib.pyx":1610 + * + * def __getitem__(self, loc): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * val = slice_getitem(s, loc) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1611 + * def __getitem__(self, loc): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * val = slice_getitem(s, loc) + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1612 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * val = slice_getitem(s, loc) # <<<<<<<<<<<<<< + * else: + * val = self._as_array[loc] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_slice_getitem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __Pyx_INCREF(__pyx_v_loc); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_loc); + __Pyx_GIVEREF(__pyx_v_loc); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_val = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1614 + * val = slice_getitem(s, loc) + * else: + * val = self._as_array[loc] # <<<<<<<<<<<<<< + * + * if not isinstance(val, slice) and val.ndim == 0: + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_self->_as_array, __pyx_v_loc); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_val = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1616 + * val = self._as_array[loc] + * + * if not isinstance(val, slice) and val.ndim == 0: # <<<<<<<<<<<<<< + * return val + * + */ + __pyx_t_3 = PySlice_Check(__pyx_v_val); + __pyx_t_2 = (!(__pyx_t_3 != 0)); + if (__pyx_t_2) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __pyx_t_3; + } else { + __pyx_t_6 = __pyx_t_2; + } + if (__pyx_t_6) { + + /* "pandas/lib.pyx":1617 + * + * if not isinstance(val, slice) and val.ndim == 0: + * return val # <<<<<<<<<<<<<< + * + * return BlockPlacement(val) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_val); + __pyx_r = __pyx_v_val; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1619 + * return val + * + * return BlockPlacement(val) # <<<<<<<<<<<<<< + * + * def delete(self, loc): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1609 + * return s is not None + * + * def __getitem__(self, loc): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1621 + * return BlockPlacement(val) + * + * def delete(self, loc): # <<<<<<<<<<<<<< + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_21delete(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_21delete(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("delete (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_20delete(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_20delete(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("delete", 0); + + /* "pandas/lib.pyx":1622 + * + * def delete(self, loc): + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) # <<<<<<<<<<<<<< + * + * def append(self, others): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_delete); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_loc); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_loc); + __Pyx_GIVEREF(__pyx_v_loc); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1621 + * return BlockPlacement(val) + * + * def delete(self, loc): # <<<<<<<<<<<<<< + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1624 + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) + * + * def append(self, others): # <<<<<<<<<<<<<< + * if len(others) == 0: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_23append(PyObject *__pyx_v_self, PyObject *__pyx_v_others); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_23append(PyObject *__pyx_v_self, PyObject *__pyx_v_others) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("append (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_22append(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_others)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_22append(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_others) { + PyObject *__pyx_v_o = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "pandas/lib.pyx":1625 + * + * def append(self, others): + * if len(others) == 0: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = PyObject_Length(__pyx_v_others); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_t_1 == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/lib.pyx":1626 + * def append(self, others): + * if len(others) == 0: + * return self # <<<<<<<<<<<<<< + * + * return BlockPlacement(np.concatenate([self.as_array] + + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1628 + * return self + * + * return BlockPlacement(np.concatenate([self.as_array] + # <<<<<<<<<<<<<< + * [o.as_array for o in others])) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":1629 + * + * return BlockPlacement(np.concatenate([self.as_array] + + * [o.as_array for o in others])) # <<<<<<<<<<<<<< + * + * cdef iadd(self, other): + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyList_CheckExact(__pyx_v_others) || PyTuple_CheckExact(__pyx_v_others)) { + __pyx_t_6 = __pyx_v_others; __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_others); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + } + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_7(__pyx_t_6); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_as_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/lib.pyx":1628 + * return self + * + * return BlockPlacement(np.concatenate([self.as_array] + # <<<<<<<<<<<<<< + * [o.as_array for o in others])) + * + */ + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1624 + * return BlockPlacement(np.delete(self.as_array, loc, axis=0)) + * + * def append(self, others): # <<<<<<<<<<<<<< + * if len(others) == 0: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1631 + * [o.as_array for o in others])) + * + * cdef iadd(self, other): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t other_int, start, stop, step, l + */ + +static PyObject *__pyx_f_6pandas_3lib_14BlockPlacement_iadd(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_s = 0; + Py_ssize_t __pyx_v_other_int; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + CYTHON_UNUSED Py_ssize_t __pyx_v_l; + PyObject *__pyx_v_newarr = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("iadd", 0); + + /* "pandas/lib.pyx":1632 + * + * cdef iadd(self, other): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * cdef Py_ssize_t other_int, start, stop, step, l + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1635 + * cdef Py_ssize_t other_int, start, stop, step, l + * + * if isinstance(other, int) and s is not None: # <<<<<<<<<<<<<< + * other_int = other + * + */ + __pyx_t_2 = PyInt_Check(__pyx_v_other); + if ((__pyx_t_2 != 0)) { + __pyx_t_3 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_4 = (__pyx_t_3 != 0); + } else { + __pyx_t_4 = (__pyx_t_2 != 0); + } + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1636 + * + * if isinstance(other, int) and s is not None: + * other_int = other # <<<<<<<<<<<<<< + * + * if other_int == 0: + */ + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_other); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_other_int = ((Py_ssize_t)__pyx_t_5); + + /* "pandas/lib.pyx":1638 + * other_int = other + * + * if other_int == 0: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_4 = ((__pyx_v_other_int == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1639 + * + * if other_int == 0: + * return self # <<<<<<<<<<<<<< + * + * start, stop, step, l = slice_get_indices_ex(s) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1641 + * return self + * + * start, stop, step, l = slice_get_indices_ex(s) # <<<<<<<<<<<<<< + * start += other_int + * stop += other_int + */ + __pyx_t_1 = __pyx_f_6pandas_3lib_slice_get_indices_ex(__pyx_v_s, 0, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_8 = PyList_GET_ITEM(sequence, 2); + __pyx_t_9 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_start = __pyx_t_5; + __pyx_v_stop = __pyx_t_12; + __pyx_v_step = __pyx_t_13; + __pyx_v_l = __pyx_t_14; + + /* "pandas/lib.pyx":1642 + * + * start, stop, step, l = slice_get_indices_ex(s) + * start += other_int # <<<<<<<<<<<<<< + * stop += other_int + * + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_other_int); + + /* "pandas/lib.pyx":1643 + * start, stop, step, l = slice_get_indices_ex(s) + * start += other_int + * stop += other_int # <<<<<<<<<<<<<< + * + * if ((step > 0 and start < 0) or + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_other_int); + + /* "pandas/lib.pyx":1645 + * stop += other_int + * + * if ((step > 0 and start < 0) or # <<<<<<<<<<<<<< + * (step < 0 and stop < step)): + * raise ValueError("iadd causes length change") + */ + __pyx_t_4 = ((__pyx_v_step > 0) != 0); + if (__pyx_t_4) { + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (!__pyx_t_3) { + + /* "pandas/lib.pyx":1646 + * + * if ((step > 0 and start < 0) or + * (step < 0 and stop < step)): # <<<<<<<<<<<<<< + * raise ValueError("iadd causes length change") + * + */ + __pyx_t_4 = ((__pyx_v_step < 0) != 0); + if (__pyx_t_4) { + __pyx_t_2 = ((__pyx_v_stop < __pyx_v_step) != 0); + __pyx_t_15 = __pyx_t_2; + } else { + __pyx_t_15 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_15; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1647 + * if ((step > 0 and start < 0) or + * (step < 0 and stop < step)): + * raise ValueError("iadd causes length change") # <<<<<<<<<<<<<< + * + * if stop < 0: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1649 + * raise ValueError("iadd causes length change") + * + * if stop < 0: # <<<<<<<<<<<<<< + * self._as_slice = slice(start, None, step) + * else: + */ + __pyx_t_4 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1650 + * + * if stop < 0: + * self._as_slice = slice(start, None, step) # <<<<<<<<<<<<<< + * else: + * self._as_slice = slice(start, stop, step) + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 1, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_1 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(PySlice_Check(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/lib.pyx":1652 + * self._as_slice = slice(start, None, step) + * else: + * self._as_slice = slice(start, stop, step) # <<<<<<<<<<<<<< + * + * self._has_array = False + */ + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_stop); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(PySlice_Check(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "slice", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L8:; + + /* "pandas/lib.pyx":1654 + * self._as_slice = slice(start, stop, step) + * + * self._has_array = False # <<<<<<<<<<<<<< + * self._as_array = None + * else: + */ + __pyx_v_self->_has_array = 0; + + /* "pandas/lib.pyx":1655 + * + * self._has_array = False + * self._as_array = None # <<<<<<<<<<<<<< + * else: + * newarr = self.as_array + other + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = Py_None; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/lib.pyx":1657 + * self._as_array = None + * else: + * newarr = self.as_array + other # <<<<<<<<<<<<<< + * if (newarr < 0).any(): + * raise ValueError("iadd causes length change") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_other); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_newarr = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/lib.pyx":1658 + * else: + * newarr = self.as_array + other + * if (newarr < 0).any(): # <<<<<<<<<<<<<< + * raise ValueError("iadd causes length change") + * + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_newarr, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_4) { + + /* "pandas/lib.pyx":1659 + * newarr = self.as_array + other + * if (newarr < 0).any(): + * raise ValueError("iadd causes length change") # <<<<<<<<<<<<<< + * + * self._as_array = newarr + */ + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/lib.pyx":1661 + * raise ValueError("iadd causes length change") + * + * self._as_array = newarr # <<<<<<<<<<<<<< + * self._has_array = True + * self._has_slice = False + */ + __Pyx_INCREF(__pyx_v_newarr); + __Pyx_GIVEREF(__pyx_v_newarr); + __Pyx_GOTREF(__pyx_v_self->_as_array); + __Pyx_DECREF(__pyx_v_self->_as_array); + __pyx_v_self->_as_array = __pyx_v_newarr; + + /* "pandas/lib.pyx":1662 + * + * self._as_array = newarr + * self._has_array = True # <<<<<<<<<<<<<< + * self._has_slice = False + * self._as_slice = None + */ + __pyx_v_self->_has_array = 1; + + /* "pandas/lib.pyx":1663 + * self._as_array = newarr + * self._has_array = True + * self._has_slice = False # <<<<<<<<<<<<<< + * self._as_slice = None + * + */ + __pyx_v_self->_has_slice = 0; + + /* "pandas/lib.pyx":1664 + * self._has_array = True + * self._has_slice = False + * self._as_slice = None # <<<<<<<<<<<<<< + * + * return self + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = ((PyObject*)Py_None); + } + __pyx_L3:; + + /* "pandas/lib.pyx":1666 + * self._as_slice = None + * + * return self # <<<<<<<<<<<<<< + * + * cdef BlockPlacement copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/lib.pyx":1631 + * [o.as_array for o in others])) + * + * cdef iadd(self, other): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * cdef Py_ssize_t other_int, start, stop, step, l + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.iadd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_newarr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1668 + * return self + * + * cdef BlockPlacement copy(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + +static struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_f_6pandas_3lib_14BlockPlacement_copy(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_v_s = 0; + struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "pandas/lib.pyx":1669 + * + * cdef BlockPlacement copy(self): + * cdef slice s = self._ensure_has_slice() # <<<<<<<<<<<<<< + * if s is not None: + * return BlockPlacement(s) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->_ensure_has_slice(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/lib.pyx":1670 + * cdef BlockPlacement copy(self): + * cdef slice s = self._ensure_has_slice() + * if s is not None: # <<<<<<<<<<<<<< + * return BlockPlacement(s) + * else: + */ + __pyx_t_2 = (__pyx_v_s != ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/lib.pyx":1671 + * cdef slice s = self._ensure_has_slice() + * if s is not None: + * return BlockPlacement(s) # <<<<<<<<<<<<<< + * else: + * return BlockPlacement(self._as_array) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/lib.pyx":1673 + * return BlockPlacement(s) + * else: + * return BlockPlacement(self._as_array) # <<<<<<<<<<<<<< + * + * def add(self, other): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->_as_array); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_as_array); + __Pyx_GIVEREF(__pyx_v_self->_as_array); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockPlacement)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/lib.pyx":1668 + * return self + * + * cdef BlockPlacement copy(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1675 + * return BlockPlacement(self._as_array) + * + * def add(self, other): # <<<<<<<<<<<<<< + * return self.copy().iadd(other) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_25add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_25add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("add (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_24add(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_24add(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("add", 0); + + /* "pandas/lib.pyx":1676 + * + * def add(self, other): + * return self.copy().iadd(other) # <<<<<<<<<<<<<< + * + * def sub(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)__pyx_v_self->__pyx_vtab)->copy(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement *)((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_t_1)->__pyx_vtab)->iadd(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_t_1), __pyx_v_other); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1675 + * return BlockPlacement(self._as_array) + * + * def add(self, other): # <<<<<<<<<<<<<< + * return self.copy().iadd(other) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1678 + * return self.copy().iadd(other) + * + * def sub(self, other): # <<<<<<<<<<<<<< + * return self.add(-other) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_27sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14BlockPlacement_27sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sub (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14BlockPlacement_26sub(((struct __pyx_obj_6pandas_3lib_BlockPlacement *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14BlockPlacement_26sub(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sub", 0); + + /* "pandas/lib.pyx":1679 + * + * def sub(self, other): + * return self.add(-other) # <<<<<<<<<<<<<< + * + * cdef slice _ensure_has_slice(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Negative(__pyx_v_other); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/lib.pyx":1678 + * return self.copy().iadd(other) + * + * def sub(self, other): # <<<<<<<<<<<<<< + * return self.add(-other) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockPlacement.sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/lib.pyx":1681 + * return self.add(-other) + * + * cdef slice _ensure_has_slice(self): # <<<<<<<<<<<<<< + * if not self._has_slice: + * self._as_slice = indexer_as_slice(self._as_array) + */ + +static PyObject *__pyx_f_6pandas_3lib_14BlockPlacement__ensure_has_slice(struct __pyx_obj_6pandas_3lib_BlockPlacement *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ensure_has_slice", 0); + + /* "pandas/lib.pyx":1682 + * + * cdef slice _ensure_has_slice(self): + * if not self._has_slice: # <<<<<<<<<<<<<< + * self._as_slice = indexer_as_slice(self._as_array) + * self._has_slice = True + */ + __pyx_t_1 = ((!(__pyx_v_self->_has_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/lib.pyx":1683 + * cdef slice _ensure_has_slice(self): + * if not self._has_slice: + * self._as_slice = indexer_as_slice(self._as_array) # <<<<<<<<<<<<<< + * self._has_slice = True + * return self._as_slice + */ + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_self->_as_array); + if (unlikely(!__pyx_t_2.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_6pandas_3lib_indexer_as_slice(__pyx_t_2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_as_slice); + __Pyx_DECREF(__pyx_v_self->_as_slice); + __pyx_v_self->_as_slice = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/lib.pyx":1684 + * if not self._has_slice: + * self._as_slice = indexer_as_slice(self._as_array) + * self._has_slice = True # <<<<<<<<<<<<<< + * return self._as_slice + * + */ + __pyx_v_self->_has_slice = 1; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/lib.pyx":1685 + * self._as_slice = indexer_as_slice(self._as_array) + * self._has_slice = True + * return self._as_slice # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_as_slice); + __pyx_r = __pyx_v_self->_as_slice; + goto __pyx_L0; + + /* "pandas/lib.pyx":1681 + * return self.add(-other) + * + * cdef slice _ensure_has_slice(self): # <<<<<<<<<<<<<< + * if not self._has_slice: + * self._as_slice = indexer_as_slice(self._as_array) + */ + + /* function exit code */ + __pyx_L1_error:; + __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockPlacement._ensure_has_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":18 + * object arr, dummy, f, labels, typ, index + * + * def __init__(self, object arr, object f, axis=1, dummy=None, # <<<<<<<<<<<<<< + * labels=None): + * n, k = arr.shape + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_7Reducer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_7Reducer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_arr = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_dummy = 0; + PyObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_f,&__pyx_n_s_axis,&__pyx_n_s_dummy,&__pyx_n_s_labels,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)__pyx_int_1); + values[3] = ((PyObject *)Py_None); + + /* "pandas/src/reduce.pyx":19 + * + * def __init__(self, object arr, object f, axis=1, dummy=None, + * labels=None): # <<<<<<<<<<<<<< + * n, k = arr.shape + * + */ + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = values[0]; + __pyx_v_f = values[1]; + __pyx_v_axis = values[2]; + __pyx_v_dummy = values[3]; + __pyx_v_labels = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Reducer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_7Reducer___init__(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self), __pyx_v_arr, __pyx_v_f, __pyx_v_axis, __pyx_v_dummy, __pyx_v_labels); + + /* "pandas/src/reduce.pyx":18 + * object arr, dummy, f, labels, typ, index + * + * def __init__(self, object arr, object f, axis=1, dummy=None, # <<<<<<<<<<<<<< + * labels=None): + * n, k = arr.shape + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_7Reducer___init__(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_f, PyObject *__pyx_v_axis, PyObject *__pyx_v_dummy, PyObject *__pyx_v_labels) { + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_index = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_arr); + + /* "pandas/src/reduce.pyx":20 + * def __init__(self, object arr, object f, axis=1, dummy=None, + * labels=None): + * n, k = arr.shape # <<<<<<<<<<<<<< + * + * if axis == 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_v_n = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_k = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":22 + * n, k = arr.shape + * + * if axis == 0: # <<<<<<<<<<<<<< + * if not arr.flags.f_contiguous: + * arr = arr.copy('F') + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "pandas/src/reduce.pyx":23 + * + * if axis == 0: + * if not arr.flags.f_contiguous: # <<<<<<<<<<<<<< + * arr = arr.copy('F') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "pandas/src/reduce.pyx":24 + * if axis == 0: + * if not arr.flags.f_contiguous: + * arr = arr.copy('F') # <<<<<<<<<<<<<< + * + * self.nresults = k + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/reduce.pyx":26 + * arr = arr.copy('F') + * + * self.nresults = k # <<<<<<<<<<<<<< + * self.chunksize = n + * self.increment = n * arr.dtype.itemsize + */ + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->nresults = __pyx_t_8; + + /* "pandas/src/reduce.pyx":27 + * + * self.nresults = k + * self.chunksize = n # <<<<<<<<<<<<<< + * self.increment = n * arr.dtype.itemsize + * else: + */ + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->chunksize = __pyx_t_8; + + /* "pandas/src/reduce.pyx":28 + * self.nresults = k + * self.chunksize = n + * self.increment = n * arr.dtype.itemsize # <<<<<<<<<<<<<< + * else: + * if not arr.flags.c_contiguous: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->increment = __pyx_t_8; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":30 + * self.increment = n * arr.dtype.itemsize + * else: + * if not arr.flags.c_contiguous: # <<<<<<<<<<<<<< + * arr = arr.copy('C') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((!__pyx_t_7) != 0); + if (__pyx_t_6) { + + /* "pandas/src/reduce.pyx":31 + * else: + * if not arr.flags.c_contiguous: + * arr = arr.copy('C') # <<<<<<<<<<<<<< + * + * self.nresults = n + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/src/reduce.pyx":33 + * arr = arr.copy('C') + * + * self.nresults = n # <<<<<<<<<<<<<< + * self.chunksize = k + * self.increment = k * arr.dtype.itemsize + */ + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->nresults = __pyx_t_8; + + /* "pandas/src/reduce.pyx":34 + * + * self.nresults = n + * self.chunksize = k # <<<<<<<<<<<<<< + * self.increment = k * arr.dtype.itemsize + * + */ + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->chunksize = __pyx_t_8; + + /* "pandas/src/reduce.pyx":35 + * self.nresults = n + * self.chunksize = k + * self.increment = k * arr.dtype.itemsize # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_k, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->increment = __pyx_t_8; + } + __pyx_L5:; + + /* "pandas/src/reduce.pyx":38 + * + * + * self.f = f # <<<<<<<<<<<<<< + * self.arr = arr + * self.typ = None + */ + __Pyx_INCREF(__pyx_v_f); + __Pyx_GIVEREF(__pyx_v_f); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_f; + + /* "pandas/src/reduce.pyx":39 + * + * self.f = f + * self.arr = arr # <<<<<<<<<<<<<< + * self.typ = None + * self.labels = labels + */ + __Pyx_INCREF(__pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_arr; + + /* "pandas/src/reduce.pyx":40 + * self.f = f + * self.arr = arr + * self.typ = None # <<<<<<<<<<<<<< + * self.labels = labels + * self.dummy, index = self._check_dummy(dummy=dummy) + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = Py_None; + + /* "pandas/src/reduce.pyx":41 + * self.arr = arr + * self.typ = None + * self.labels = labels # <<<<<<<<<<<<<< + * self.dummy, index = self._check_dummy(dummy=dummy) + * + */ + __Pyx_INCREF(__pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = __pyx_v_labels; + + /* "pandas/src/reduce.pyx":42 + * self.typ = None + * self.labels = labels + * self.dummy, index = self._check_dummy(dummy=dummy) # <<<<<<<<<<<<<< + * + * self.labels = labels + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_dummy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dummy, __pyx_v_dummy) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L9_unpacking_done:; + } + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->dummy); + __Pyx_DECREF(__pyx_v_self->dummy); + __pyx_v_self->dummy = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_index = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":44 + * self.dummy, index = self._check_dummy(dummy=dummy) + * + * self.labels = labels # <<<<<<<<<<<<<< + * self.index = index + * + */ + __Pyx_INCREF(__pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = __pyx_v_labels; + + /* "pandas/src/reduce.pyx":45 + * + * self.labels = labels + * self.index = index # <<<<<<<<<<<<<< + * + * def _check_dummy(self, dummy=None): + */ + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_v_index; + + /* "pandas/src/reduce.pyx":18 + * object arr, dummy, f, labels, typ, index + * + * def __init__(self, object arr, object f, axis=1, dummy=None, # <<<<<<<<<<<<<< + * labels=None): + * n, k = arr.shape + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.Reducer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":47 + * self.index = index + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * cdef object index + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_dummy (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dummy,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_dummy") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dummy = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Reducer._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_7Reducer_2_check_dummy(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self), __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_2_check_dummy(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_dummy) { + PyObject *__pyx_v_index = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_dummy", 0); + __Pyx_INCREF(__pyx_v_dummy); + + /* "pandas/src/reduce.pyx":50 + * cdef object index + * + * if dummy is None: # <<<<<<<<<<<<<< + * dummy = np.empty(self.chunksize, dtype=self.arr.dtype) + * index = None + */ + __pyx_t_1 = (__pyx_v_dummy == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":51 + * + * if dummy is None: + * dummy = np.empty(self.chunksize, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->chunksize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_dummy, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/reduce.pyx":52 + * if dummy is None: + * dummy = np.empty(self.chunksize, dtype=self.arr.dtype) + * index = None # <<<<<<<<<<<<<< + * + * # our ref is stolen later since we are creating this array + */ + __Pyx_INCREF(Py_None); + __pyx_v_index = Py_None; + + /* "pandas/src/reduce.pyx":56 + * # our ref is stolen later since we are creating this array + * # in cython, so increment first + * Py_INCREF(dummy) # <<<<<<<<<<<<<< + * else: + * # we passed a series-like + */ + Py_INCREF(__pyx_v_dummy); + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":59 + * else: + * # we passed a series-like + * if hasattr(dummy,'values'): # <<<<<<<<<<<<<< + * + * self.typ = type(dummy) + */ + __pyx_t_2 = PyObject_HasAttr(__pyx_v_dummy, __pyx_n_s_values); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":61 + * if hasattr(dummy,'values'): + * + * self.typ = type(dummy) # <<<<<<<<<<<<<< + * index = getattr(dummy,'index',None) + * dummy = dummy.values + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_dummy))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_dummy))); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = ((PyObject *)Py_TYPE(__pyx_v_dummy)); + + /* "pandas/src/reduce.pyx":62 + * + * self.typ = type(dummy) + * index = getattr(dummy,'index',None) # <<<<<<<<<<<<<< + * dummy = dummy.values + * + */ + __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_dummy, __pyx_n_s_index, Py_None); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_index = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/src/reduce.pyx":63 + * self.typ = type(dummy) + * index = getattr(dummy,'index',None) + * dummy = dummy.values # <<<<<<<<<<<<<< + * + * if dummy.dtype != self.arr.dtype: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_dummy, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/reduce.pyx":65 + * dummy = dummy.values + * + * if dummy.dtype != self.arr.dtype: # <<<<<<<<<<<<<< + * raise ValueError('Dummy array must be same dtype') + * if len(dummy) != self.chunksize: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":66 + * + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if len(dummy) != self.chunksize: + * raise ValueError('Dummy array must be length %d' % + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":67 + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + * if len(dummy) != self.chunksize: # <<<<<<<<<<<<<< + * raise ValueError('Dummy array must be length %d' % + * self.chunksize) + */ + __pyx_t_7 = PyObject_Length(__pyx_v_dummy); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((__pyx_t_7 != __pyx_v_self->chunksize) != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":69 + * if len(dummy) != self.chunksize: + * raise ValueError('Dummy array must be length %d' % + * self.chunksize) # <<<<<<<<<<<<<< + * + * return dummy, index + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->chunksize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/src/reduce.pyx":68 + * raise ValueError('Dummy array must be same dtype') + * if len(dummy) != self.chunksize: + * raise ValueError('Dummy array must be length %d' % # <<<<<<<<<<<<<< + * self.chunksize) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Dummy_array_must_be_length_d, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":71 + * self.chunksize) + * + * return dummy, index # <<<<<<<<<<<<<< + * + * def get_result(self): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_index)) { __Pyx_RaiseUnboundLocalError("index"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_dummy); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy); + __Pyx_GIVEREF(__pyx_v_dummy); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":47 + * self.index = index + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * cdef object index + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.Reducer._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_dummy); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":73 + * return dummy, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * char* dummy_buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_result (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_7Reducer_4get_result(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_4get_result(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self) { + char *__pyx_v_dummy_buf; + PyArrayObject *__pyx_v_arr = 0; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_chunk = 0; + Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_incr; + PyArrayIterObject *__pyx_v_it = 0; + PyObject *__pyx_v_res = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_labels = 0; + PyObject *__pyx_v_index = 0; + PyObject *__pyx_v_cached_typ = 0; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char *__pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + char const *__pyx_t_17; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_result", 0); + + /* "pandas/src/reduce.pyx":80 + * flatiter it + * object res, name, labels, index + * object cached_typ = None # <<<<<<<<<<<<<< + * + * arr = self.arr + */ + __Pyx_INCREF(Py_None); + __pyx_v_cached_typ = Py_None; + + /* "pandas/src/reduce.pyx":82 + * object cached_typ = None + * + * arr = self.arr # <<<<<<<<<<<<<< + * chunk = self.dummy + * dummy_buf = chunk.data + */ + if (!(likely(((__pyx_v_self->arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_self->arr; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":83 + * + * arr = self.arr + * chunk = self.dummy # <<<<<<<<<<<<<< + * dummy_buf = chunk.data + * chunk.data = arr.data + */ + if (!(likely(((__pyx_v_self->dummy) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->dummy, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_self->dummy; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_chunk = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":84 + * arr = self.arr + * chunk = self.dummy + * dummy_buf = chunk.data # <<<<<<<<<<<<<< + * chunk.data = arr.data + * labels = self.labels + */ + __pyx_t_2 = __pyx_v_chunk->data; + __pyx_v_dummy_buf = __pyx_t_2; + + /* "pandas/src/reduce.pyx":85 + * chunk = self.dummy + * dummy_buf = chunk.data + * chunk.data = arr.data # <<<<<<<<<<<<<< + * labels = self.labels + * index = self.index + */ + __pyx_t_2 = __pyx_v_arr->data; + __pyx_v_chunk->data = __pyx_t_2; + + /* "pandas/src/reduce.pyx":86 + * dummy_buf = chunk.data + * chunk.data = arr.data + * labels = self.labels # <<<<<<<<<<<<<< + * index = self.index + * incr = self.increment + */ + __pyx_t_1 = __pyx_v_self->labels; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_labels = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":87 + * chunk.data = arr.data + * labels = self.labels + * index = self.index # <<<<<<<<<<<<<< + * incr = self.increment + * + */ + __pyx_t_1 = __pyx_v_self->index; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_index = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":88 + * labels = self.labels + * index = self.index + * incr = self.increment # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_3 = __pyx_v_self->increment; + __pyx_v_incr = __pyx_t_3; + + /* "pandas/src/reduce.pyx":90 + * incr = self.increment + * + * try: # <<<<<<<<<<<<<< + * for i in range(self.nresults): + * + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/src/reduce.pyx":91 + * + * try: + * for i in range(self.nresults): # <<<<<<<<<<<<<< + * + * if labels is not None: + */ + __pyx_t_3 = __pyx_v_self->nresults; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/reduce.pyx":93 + * for i in range(self.nresults): + * + * if labels is not None: # <<<<<<<<<<<<<< + * name = util.get_value_at(labels, i) + * else: + */ + __pyx_t_8 = (__pyx_v_labels != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":94 + * + * if labels is not None: + * name = util.get_value_at(labels, i) # <<<<<<<<<<<<<< + * else: + * name = None + */ + if (!(likely(((__pyx_v_labels) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_labels, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_v_labels), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_10); + __pyx_t_10 = 0; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":96 + * name = util.get_value_at(labels, i) + * else: + * name = None # <<<<<<<<<<<<<< + * + * # create the cached type + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_name, Py_None); + } + __pyx_L16:; + + /* "pandas/src/reduce.pyx":100 + * # create the cached type + * # each time just reassign the data + * if i == 0: # <<<<<<<<<<<<<< + * + * if self.typ is not None: + */ + __pyx_t_9 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":102 + * if i == 0: + * + * if self.typ is not None: # <<<<<<<<<<<<<< + * + * # recreate with the index if supplied + */ + __pyx_t_9 = (__pyx_v_self->typ != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "pandas/src/reduce.pyx":105 + * + * # recreate with the index if supplied + * if index is not None: # <<<<<<<<<<<<<< + * + * cached_typ = self.typ(chunk, index=index, name=name) + */ + __pyx_t_8 = (__pyx_v_index != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":107 + * if index is not None: + * + * cached_typ = self.typ(chunk, index=index, name=name) # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_chunk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk)); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, __pyx_v_index) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_v_self->typ, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_cached_typ, __pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":112 + * + * # use the passsed typ, sans index + * cached_typ = self.typ(chunk, name=name) # <<<<<<<<<<<<<< + * + * # use the cached_typ if possible + */ + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); + PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_chunk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk)); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_self->typ, __pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_cached_typ, __pyx_t_10); + __pyx_t_10 = 0; + } + __pyx_L19:; + goto __pyx_L18; + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/src/reduce.pyx":115 + * + * # use the cached_typ if possible + * if cached_typ is not None: # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ._data._block, 'values', chunk) + * object.__setattr__(cached_typ, 'name', name) + */ + __pyx_t_9 = (__pyx_v_cached_typ != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "pandas/src/reduce.pyx":116 + * # use the cached_typ if possible + * if cached_typ is not None: + * object.__setattr__(cached_typ._data._block, 'values', chunk) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, 'name', name) + * res = self.f(cached_typ) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cached_typ, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_block); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __Pyx_INCREF(__pyx_n_s_values); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_values); + __Pyx_GIVEREF(__pyx_n_s_values); + __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_chunk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk)); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "pandas/src/reduce.pyx":117 + * if cached_typ is not None: + * object.__setattr__(cached_typ._data._block, 'values', chunk) + * object.__setattr__(cached_typ, 'name', name) # <<<<<<<<<<<<<< + * res = self.f(cached_typ) + * else: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_name_2); + __Pyx_GIVEREF(__pyx_n_s_name_2); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/src/reduce.pyx":118 + * object.__setattr__(cached_typ._data._block, 'values', chunk) + * object.__setattr__(cached_typ, 'name', name) + * res = self.f(cached_typ) # <<<<<<<<<<<<<< + * else: + * res = self.f(chunk) + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->f, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":120 + * res = self.f(cached_typ) + * else: + * res = self.f(chunk) # <<<<<<<<<<<<<< + * + * if hasattr(res,'values'): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_chunk)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chunk)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk)); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_self->f, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_10); + __pyx_t_10 = 0; + } + __pyx_L20:; + + /* "pandas/src/reduce.pyx":122 + * res = self.f(chunk) + * + * if hasattr(res,'values'): # <<<<<<<<<<<<<< + * res = res.values + * + */ + __pyx_t_8 = PyObject_HasAttr(__pyx_v_res, __pyx_n_s_values); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":123 + * + * if hasattr(res,'values'): + * res = res.values # <<<<<<<<<<<<<< + * + * if i == 0: + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_values); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_10); + __pyx_t_10 = 0; + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/src/reduce.pyx":125 + * res = res.values + * + * if i == 0: # <<<<<<<<<<<<<< + * result = self._get_result_array(res) + * it = PyArray_IterNew(result) + */ + __pyx_t_9 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":126 + * + * if i == 0: + * result = self._get_result_array(res) # <<<<<<<<<<<<<< + * it = PyArray_IterNew(result) + * + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_result_array); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_11)); + __pyx_t_11 = 0; + + /* "pandas/src/reduce.pyx":127 + * if i == 0: + * result = self._get_result_array(res) + * it = PyArray_IterNew(result) # <<<<<<<<<<<<<< + * + * PyArray_SETITEM(result, PyArray_ITER_DATA(it), res) + */ + __pyx_t_11 = PyArray_IterNew(((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __pyx_t_11; + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_v_it, ((PyArrayIterObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L22; + } + __pyx_L22:; + + /* "pandas/src/reduce.pyx":129 + * it = PyArray_IterNew(result) + * + * PyArray_SETITEM(result, PyArray_ITER_DATA(it), res) # <<<<<<<<<<<<<< + * chunk.data = chunk.data + self.increment + * PyArray_ITER_NEXT(it) + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } + if (unlikely(!__pyx_v_it)) { __Pyx_RaiseUnboundLocalError("it"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } + PyArray_SETITEM(__pyx_v_result, PyArray_ITER_DATA(__pyx_v_it), __pyx_v_res); + + /* "pandas/src/reduce.pyx":130 + * + * PyArray_SETITEM(result, PyArray_ITER_DATA(it), res) + * chunk.data = chunk.data + self.increment # <<<<<<<<<<<<<< + * PyArray_ITER_NEXT(it) + * except Exception, e: + */ + __pyx_v_chunk->data = (__pyx_v_chunk->data + __pyx_v_self->increment); + + /* "pandas/src/reduce.pyx":131 + * PyArray_SETITEM(result, PyArray_ITER_DATA(it), res) + * chunk.data = chunk.data + self.increment + * PyArray_ITER_NEXT(it) # <<<<<<<<<<<<<< + * except Exception, e: + * if hasattr(e, 'args'): + */ + if (unlikely(!__pyx_v_it)) { __Pyx_RaiseUnboundLocalError("it"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } + PyArray_ITER_NEXT(__pyx_v_it); + } + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":132 + * chunk.data = chunk.data + self.increment + * PyArray_ITER_NEXT(it) + * except Exception, e: # <<<<<<<<<<<<<< + * if hasattr(e, 'args'): + * e.args = e.args + (i,) + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.lib.Reducer.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_e = __pyx_t_11; + + /* "pandas/src/reduce.pyx":133 + * PyArray_ITER_NEXT(it) + * except Exception, e: + * if hasattr(e, 'args'): # <<<<<<<<<<<<<< + * e.args = e.args + (i,) + * raise + */ + __pyx_t_9 = PyObject_HasAttr(__pyx_v_e, __pyx_n_s_args); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "pandas/src/reduce.pyx":134 + * except Exception, e: + * if hasattr(e, 'args'): + * e.args = e.args + (i,) # <<<<<<<<<<<<<< + * raise + * finally: + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyNumber_Add(__pyx_t_13, __pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_e, __pyx_n_s_args, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L25; + } + __pyx_L25:; + + /* "pandas/src/reduce.pyx":135 + * if hasattr(e, 'args'): + * e.args = e.args + (i,) + * raise # <<<<<<<<<<<<<< + * finally: + * # so we don't free the wrong memory + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_11, __pyx_t_10); + __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L4_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L13_try_end:; + } + } + + /* "pandas/src/reduce.pyx":138 + * finally: + * # so we don't free the wrong memory + * chunk.data = dummy_buf # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_v_chunk->data = __pyx_v_dummy_buf; + goto __pyx_L5; + } + /*exception exit:*/{ + __pyx_L4_error:; + __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __pyx_t_12 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename; + { + __pyx_v_chunk->data = __pyx_v_dummy_buf; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; + __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "pandas/src/reduce.pyx":140 + * chunk.data = dummy_buf + * + * if result.dtype == np.object_: # <<<<<<<<<<<<<< + * result = maybe_convert_objects(result) + * + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_8) { + + /* "pandas/src/reduce.pyx":141 + * + * if result.dtype == np.object_: + * result = maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_10)); + __pyx_t_10 = 0; + goto __pyx_L28; + } + __pyx_L28:; + + /* "pandas/src/reduce.pyx":143 + * result = maybe_convert_objects(result) + * + * return result # <<<<<<<<<<<<<< + * + * def _get_result_array(self, object res): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":73 + * return dummy, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * char* dummy_buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("pandas.lib.Reducer.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_chunk); + __Pyx_XDECREF((PyObject *)__pyx_v_it); + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_labels); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_cached_typ); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":145 + * return result + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_7Reducer_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_result_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_7Reducer_6_get_result_array(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self), ((PyObject *)__pyx_v_res)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_7Reducer_6_get_result_array(struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_result_array", 0); + + /* "pandas/src/reduce.pyx":146 + * + * def _get_result_array(self, object res): + * try: # <<<<<<<<<<<<<< + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy))) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/reduce.pyx":147 + * def _get_result_array(self, object res): + * try: + * assert(not isinstance(res, np.ndarray)) # <<<<<<<<<<<<<< + * assert(not (isinstance(res, list) and len(res) == len(self.dummy))) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_res, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + if (unlikely(!((!(__pyx_t_4 != 0)) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":148 + * try: + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy))) # <<<<<<<<<<<<<< + * + * result = np.empty(self.nresults, dtype='O') + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyList_Check(__pyx_v_res); + if ((__pyx_t_4 != 0)) { + __pyx_t_5 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __pyx_v_self->dummy; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = ((__pyx_t_5 == __pyx_t_7) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = (__pyx_t_4 != 0); + } + if (unlikely(!((!__pyx_t_9) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":150 + * assert(not (isinstance(res, list) and len(res) == len(self.dummy))) + * + * result = np.empty(self.nresults, dtype='O') # <<<<<<<<<<<<<< + * result[0] = res + * except Exception: + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->nresults); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":151 + * + * result = np.empty(self.nresults, dtype='O') + * result[0] = res # <<<<<<<<<<<<<< + * except Exception: + * raise ValueError('function does not reduce') + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_result, 0, __pyx_v_res, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":152 + * result = np.empty(self.nresults, dtype='O') + * result[0] = res + * except Exception: # <<<<<<<<<<<<<< + * raise ValueError('function does not reduce') + * return result + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("pandas.lib.Reducer._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_6, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/src/reduce.pyx":153 + * result[0] = res + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/reduce.pyx":154 + * except Exception: + * raise ValueError('function does not reduce') + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":145 + * return result + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("pandas.lib.Reducer._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":168 + * object arr, index, dummy_arr, dummy_index, values, f, bins, typ, name + * + * def __init__(self, object series, object f, object bins, object dummy): # <<<<<<<<<<<<<< + * n = len(series) + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_series = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_bins = 0; + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_series,&__pyx_n_s_f,&__pyx_n_s_bins,&__pyx_n_s_dummy,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_series)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_series = values[0]; + __pyx_v_f = values[1]; + __pyx_v_bins = values[2]; + __pyx_v_dummy = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), __pyx_v_series, __pyx_v_f, __pyx_v_bins, __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_series, PyObject *__pyx_v_f, PyObject *__pyx_v_bins, PyObject *__pyx_v_dummy) { + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_values = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/reduce.pyx":169 + * + * def __init__(self, object series, object f, object bins, object dummy): + * n = len(series) # <<<<<<<<<<<<<< + * + * self.bins = bins + */ + __pyx_t_1 = PyObject_Length(__pyx_v_series); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/reduce.pyx":171 + * n = len(series) + * + * self.bins = bins # <<<<<<<<<<<<<< + * self.f = f + * + */ + __Pyx_INCREF(__pyx_v_bins); + __Pyx_GIVEREF(__pyx_v_bins); + __Pyx_GOTREF(__pyx_v_self->bins); + __Pyx_DECREF(__pyx_v_self->bins); + __pyx_v_self->bins = __pyx_v_bins; + + /* "pandas/src/reduce.pyx":172 + * + * self.bins = bins + * self.f = f # <<<<<<<<<<<<<< + * + * values = series.values + */ + __Pyx_INCREF(__pyx_v_f); + __Pyx_GIVEREF(__pyx_v_f); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_f; + + /* "pandas/src/reduce.pyx":174 + * self.f = f + * + * values = series.values # <<<<<<<<<<<<<< + * if not values.flags.c_contiguous: + * values = values.copy('C') + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_values = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":175 + * + * values = series.values + * if not values.flags.c_contiguous: # <<<<<<<<<<<<<< + * values = values.copy('C') + * self.arr = values + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "pandas/src/reduce.pyx":176 + * values = series.values + * if not values.flags.c_contiguous: + * values = values.copy('C') # <<<<<<<<<<<<<< + * self.arr = values + * self.index = series.index + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":177 + * if not values.flags.c_contiguous: + * values = values.copy('C') + * self.arr = values # <<<<<<<<<<<<<< + * self.index = series.index + * self.typ = type(series) + */ + __Pyx_INCREF(__pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_values; + + /* "pandas/src/reduce.pyx":178 + * values = values.copy('C') + * self.arr = values + * self.index = series.index # <<<<<<<<<<<<<< + * self.typ = type(series) + * self.name = getattr(series,'name',None) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":179 + * self.arr = values + * self.index = series.index + * self.typ = type(series) # <<<<<<<<<<<<<< + * self.name = getattr(series,'name',None) + * + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_series))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_series))); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = ((PyObject *)Py_TYPE(__pyx_v_series)); + + /* "pandas/src/reduce.pyx":180 + * self.index = series.index + * self.typ = type(series) + * self.name = getattr(series,'name',None) # <<<<<<<<<<<<<< + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_series, __pyx_n_s_name_2, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":182 + * self.name = getattr(series,'name',None) + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) # <<<<<<<<<<<<<< + * self.passed_dummy = dummy is not None + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_dummy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_dummy); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy); + __Pyx_GIVEREF(__pyx_v_dummy); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":183 + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + * self.passed_dummy = dummy is not None # <<<<<<<<<<<<<< + * + * # kludge for #1688 + */ + __pyx_t_5 = (__pyx_v_dummy != Py_None); + __pyx_v_self->passed_dummy = __pyx_t_5; + + /* "pandas/src/reduce.pyx":186 + * + * # kludge for #1688 + * if len(bins) > 0 and bins[-1] == len(series): # <<<<<<<<<<<<<< + * self.ngroups = len(bins) + * else: + */ + __pyx_t_1 = PyObject_Length(__pyx_v_bins); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_1 > 0); + if (__pyx_t_5) { + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_bins, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_Length(__pyx_v_series); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __pyx_t_4; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "pandas/src/reduce.pyx":187 + * # kludge for #1688 + * if len(bins) > 0 and bins[-1] == len(series): + * self.ngroups = len(bins) # <<<<<<<<<<<<<< + * else: + * self.ngroups = len(bins) + 1 + */ + __pyx_t_1 = PyObject_Length(__pyx_v_bins); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->ngroups = __pyx_t_1; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":189 + * self.ngroups = len(bins) + * else: + * self.ngroups = len(bins) + 1 # <<<<<<<<<<<<<< + * + * def _check_dummy(self, dummy=None): + */ + __pyx_t_1 = PyObject_Length(__pyx_v_bins); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->ngroups = (__pyx_t_1 + 1); + } + __pyx_L6:; + + /* "pandas/src/reduce.pyx":168 + * object arr, index, dummy_arr, dummy_index, values, f, bins, typ, name + * + * def __init__(self, object series, object f, object bins, object dummy): # <<<<<<<<<<<<<< + * n = len(series) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":191 + * self.ngroups = len(bins) + 1 + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_dummy (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dummy,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_dummy") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dummy = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_2_check_dummy(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_2_check_dummy(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_dummy) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_dummy", 0); + + /* "pandas/src/reduce.pyx":192 + * + * def _check_dummy(self, dummy=None): + * if dummy is None: # <<<<<<<<<<<<<< + * values = np.empty(0, dtype=self.arr.dtype) + * index = None + */ + __pyx_t_1 = (__pyx_v_dummy == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":193 + * def _check_dummy(self, dummy=None): + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__30, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":194 + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + * index = None # <<<<<<<<<<<<<< + * else: + * values = dummy.values + */ + __Pyx_INCREF(Py_None); + __pyx_v_index = Py_None; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":196 + * index = None + * else: + * values = dummy.values # <<<<<<<<<<<<<< + * if values.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":197 + * else: + * values = dummy.values + * if values.dtype != self.arr.dtype: # <<<<<<<<<<<<<< + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":198 + * values = dummy.values + * if values.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":199 + * if values.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: # <<<<<<<<<<<<<< + * values = values.copy() + * index = dummy.index + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((!__pyx_t_2) != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":200 + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: + * values = values.copy() # <<<<<<<<<<<<<< + * index = dummy.index + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/reduce.pyx":201 + * if not values.flags.contiguous: + * values = values.copy() + * index = dummy.index # <<<<<<<<<<<<<< + * + * return values, index + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_index = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":203 + * index = dummy.index + * + * return values, index # <<<<<<<<<<<<<< + * + * def get_result(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":191 + * self.ngroups = len(bins) + 1 + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":205 + * return values, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr, result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_result (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4get_result(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4get_result(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_counts = 0; + Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_group_size; + PyObject *__pyx_v_res = 0; + int __pyx_v_initialized; + struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_vslider = 0; + struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_islider = 0; + PyObject *__pyx_v_gin = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_cached_typ = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + __pyx_t_5numpy_int64_t __pyx_t_12; + long __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + int __pyx_t_20; + char const *__pyx_t_21; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_result", 0); + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + + /* "pandas/src/reduce.pyx":211 + * Py_ssize_t i, n, group_size + * object res + * bint initialized = 0 # <<<<<<<<<<<<<< + * Slider vslider, islider + * object gin, typ, name + */ + __pyx_v_initialized = 0; + + /* "pandas/src/reduce.pyx":214 + * Slider vslider, islider + * object gin, typ, name + * object cached_typ = None # <<<<<<<<<<<<<< + * + * counts = np.zeros(self.ngroups, dtype=np.int64) + */ + __Pyx_INCREF(Py_None); + __pyx_v_cached_typ = Py_None; + + /* "pandas/src/reduce.pyx":216 + * object cached_typ = None + * + * counts = np.zeros(self.ngroups, dtype=np.int64) # <<<<<<<<<<<<<< + * + * if self.ngroups > 0: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->ngroups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":218 + * counts = np.zeros(self.ngroups, dtype=np.int64) + * + * if self.ngroups > 0: # <<<<<<<<<<<<<< + * counts[0] = self.bins[0] + * for i in range(1, self.ngroups): + */ + __pyx_t_11 = ((__pyx_v_self->ngroups > 0) != 0); + if (__pyx_t_11) { + + /* "pandas/src/reduce.pyx":219 + * + * if self.ngroups > 0: + * counts[0] = self.bins[0] # <<<<<<<<<<<<<< + * for i in range(1, self.ngroups): + * if i == self.ngroups - 1: + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->bins, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = 0; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_t_12; + + /* "pandas/src/reduce.pyx":220 + * if self.ngroups > 0: + * counts[0] = self.bins[0] + * for i in range(1, self.ngroups): # <<<<<<<<<<<<<< + * if i == self.ngroups - 1: + * counts[i] = len(self.arr) - self.bins[i-1] + */ + __pyx_t_14 = __pyx_v_self->ngroups; + for (__pyx_t_15 = 1; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/src/reduce.pyx":221 + * counts[0] = self.bins[0] + * for i in range(1, self.ngroups): + * if i == self.ngroups - 1: # <<<<<<<<<<<<<< + * counts[i] = len(self.arr) - self.bins[i-1] + * else: + */ + __pyx_t_11 = ((__pyx_v_i == (__pyx_v_self->ngroups - 1)) != 0); + if (__pyx_t_11) { + + /* "pandas/src/reduce.pyx":222 + * for i in range(1, self.ngroups): + * if i == self.ngroups - 1: + * counts[i] = len(self.arr) - self.bins[i-1] # <<<<<<<<<<<<<< + * else: + * counts[i] = self.bins[i] - self.bins[i-1] + */ + __pyx_t_5 = __pyx_v_self->arr; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_16 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = (__pyx_v_i - 1); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->bins, __pyx_t_16, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_t_12; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":224 + * counts[i] = len(self.arr) - self.bins[i-1] + * else: + * counts[i] = self.bins[i] - self.bins[i-1] # <<<<<<<<<<<<<< + * + * group_size = 0 + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->bins, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = (__pyx_v_i - 1); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->bins, __pyx_t_17, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_t_12; + } + __pyx_L6:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":226 + * counts[i] = self.bins[i] - self.bins[i-1] + * + * group_size = 0 # <<<<<<<<<<<<<< + * n = len(self.arr) + * name = self.name + */ + __pyx_v_group_size = 0; + + /* "pandas/src/reduce.pyx":227 + * + * group_size = 0 + * n = len(self.arr) # <<<<<<<<<<<<<< + * name = self.name + * + */ + __pyx_t_5 = __pyx_v_self->arr; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_14 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_n = __pyx_t_14; + + /* "pandas/src/reduce.pyx":228 + * group_size = 0 + * n = len(self.arr) + * name = self.name # <<<<<<<<<<<<<< + * + * vslider = Slider(self.arr, self.dummy_arr) + */ + __pyx_t_5 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_5); + __pyx_v_name = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":230 + * name = self.name + * + * vslider = Slider(self.arr, self.dummy_arr) # <<<<<<<<<<<<<< + * islider = Slider(self.index, self.dummy_index) + * + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self->arr); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->arr); + __Pyx_GIVEREF(__pyx_v_self->arr); + __Pyx_INCREF(__pyx_v_self->dummy_arr); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->dummy_arr); + __Pyx_GIVEREF(__pyx_v_self->dummy_arr); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_vslider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":231 + * + * vslider = Slider(self.arr, self.dummy_arr) + * islider = Slider(self.index, self.dummy_index) # <<<<<<<<<<<<<< + * + * gin = self.dummy_index._engine + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->index); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->index); + __Pyx_GIVEREF(__pyx_v_self->index); + __Pyx_INCREF(__pyx_v_self->dummy_index); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->dummy_index); + __Pyx_GIVEREF(__pyx_v_self->dummy_index); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_islider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":233 + * islider = Slider(self.index, self.dummy_index) + * + * gin = self.dummy_index._engine # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dummy_index, __pyx_n_s_engine); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_gin = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":235 + * gin = self.dummy_index._engine + * + * try: # <<<<<<<<<<<<<< + * for i in range(self.ngroups): + * group_size = counts[i] + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/reduce.pyx":236 + * + * try: + * for i in range(self.ngroups): # <<<<<<<<<<<<<< + * group_size = counts[i] + * + */ + __pyx_t_14 = __pyx_v_self->ngroups; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/src/reduce.pyx":237 + * try: + * for i in range(self.ngroups): + * group_size = counts[i] # <<<<<<<<<<<<<< + * + * islider.set_length(group_size) + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + } + __pyx_v_group_size = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides)); + + /* "pandas/src/reduce.pyx":239 + * group_size = counts[i] + * + * islider.set_length(group_size) # <<<<<<<<<<<<<< + * vslider.set_length(group_size) + * + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->set_length(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":240 + * + * islider.set_length(group_size) + * vslider.set_length(group_size) # <<<<<<<<<<<<<< + * + * if cached_typ is None: + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->set_length(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":242 + * vslider.set_length(group_size) + * + * if cached_typ is None: # <<<<<<<<<<<<<< + * cached_typ = self.typ(vslider.buf, index=islider.buf, + * name=name) + */ + __pyx_t_11 = (__pyx_v_cached_typ == Py_None); + __pyx_t_19 = (__pyx_t_11 != 0); + if (__pyx_t_19) { + + /* "pandas/src/reduce.pyx":243 + * + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, # <<<<<<<<<<<<<< + * name=name) + * else: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_vslider->buf)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_vslider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vslider->buf)); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, ((PyObject *)__pyx_v_islider->buf)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + + /* "pandas/src/reduce.pyx":244 + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, + * name=name) # <<<<<<<<<<<<<< + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + + /* "pandas/src/reduce.pyx":243 + * + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, # <<<<<<<<<<<<<< + * name=name) + * else: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_self->typ, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_cached_typ, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L20; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":246 + * name=name) + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, '_index', islider.buf) + * object.__setattr__(cached_typ, 'name', name) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cached_typ, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_block); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_values); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_values); + __Pyx_GIVEREF(__pyx_n_s_values); + __Pyx_INCREF(((PyObject *)__pyx_v_vslider->buf)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_vslider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vslider->buf)); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":247 + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + * object.__setattr__(cached_typ, '_index', islider.buf) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, 'name', name) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_index_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_index_2); + __Pyx_GIVEREF(__pyx_n_s_index_2); + __Pyx_INCREF(((PyObject *)__pyx_v_islider->buf)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_islider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_islider->buf)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":248 + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + * object.__setattr__(cached_typ, '_index', islider.buf) + * object.__setattr__(cached_typ, 'name', name) # <<<<<<<<<<<<<< + * + * res = self.f(cached_typ) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_name_2); + __Pyx_GIVEREF(__pyx_n_s_name_2); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L20:; + + /* "pandas/src/reduce.pyx":250 + * object.__setattr__(cached_typ, 'name', name) + * + * res = self.f(cached_typ) # <<<<<<<<<<<<<< + * res = _extract_result(res) + * if not initialized: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":251 + * + * res = self.f(cached_typ) + * res = _extract_result(res) # <<<<<<<<<<<<<< + * if not initialized: + * result = self._get_result_array(res) + */ + __pyx_t_1 = __pyx_f_6pandas_3lib__extract_result(__pyx_v_res); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":252 + * res = self.f(cached_typ) + * res = _extract_result(res) + * if not initialized: # <<<<<<<<<<<<<< + * result = self._get_result_array(res) + * initialized = 1 + */ + __pyx_t_19 = ((!(__pyx_v_initialized != 0)) != 0); + if (__pyx_t_19) { + + /* "pandas/src/reduce.pyx":253 + * res = _extract_result(res) + * if not initialized: + * result = self._get_result_array(res) # <<<<<<<<<<<<<< + * initialized = 1 + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_result_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":254 + * if not initialized: + * result = self._get_result_array(res) + * initialized = 1 # <<<<<<<<<<<<<< + * + * util.assign_value_1d(result, i, res) + */ + __pyx_v_initialized = 1; + goto __pyx_L21; + } + __pyx_L21:; + + /* "pandas/src/reduce.pyx":256 + * initialized = 1 + * + * util.assign_value_1d(result, i, res) # <<<<<<<<<<<<<< + * + * islider.advance(group_size) + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L10_error;} } + __pyx_t_7 = assign_value_1d(__pyx_v_result, __pyx_v_i, __pyx_v_res); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + + /* "pandas/src/reduce.pyx":258 + * util.assign_value_1d(result, i, res) + * + * islider.advance(group_size) # <<<<<<<<<<<<<< + * vslider.advance(group_size) + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":259 + * + * islider.advance(group_size) + * vslider.advance(group_size) # <<<<<<<<<<<<<< + * + * gin.clear_mapping() + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":261 + * vslider.advance(group_size) + * + * gin.clear_mapping() # <<<<<<<<<<<<<< + * except: + * raise + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_gin, __pyx_n_s_clear_mapping); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L17_try_end; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":262 + * + * gin.clear_mapping() + * except: # <<<<<<<<<<<<<< + * raise + * finally: + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/reduce.pyx":263 + * gin.clear_mapping() + * except: + * raise # <<<<<<<<<<<<<< + * finally: + * # so we don't free the wrong memory + */ + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_3, __pyx_t_1); + __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L11_exception_handled; + } + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L8_error; + __pyx_L11_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L17_try_end:; + } + } + + /* "pandas/src/reduce.pyx":266 + * finally: + * # so we don't free the wrong memory + * islider.reset() # <<<<<<<<<<<<<< + * vslider.reset() + * + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->reset(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":267 + * # so we don't free the wrong memory + * islider.reset() + * vslider.reset() # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->reset(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L9; + } + /*exception exit:*/{ + __pyx_L8_error:; + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __Pyx_XGOTREF(__pyx_t_24); + __pyx_t_7 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; + { + + /* "pandas/src/reduce.pyx":266 + * finally: + * # so we don't free the wrong memory + * islider.reset() # <<<<<<<<<<<<<< + * vslider.reset() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->reset(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L25_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":267 + * # so we don't free the wrong memory + * islider.reset() + * vslider.reset() # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->reset(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L25_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_24); + __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); + } + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; + goto __pyx_L1_error; + __pyx_L25_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_24); + __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; + goto __pyx_L1_error; + } + __pyx_L9:; + } + + /* "pandas/src/reduce.pyx":269 + * vslider.reset() + * + * if result.dtype == np.object_: # <<<<<<<<<<<<<< + * result = maybe_convert_objects(result) + * + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_19) { + + /* "pandas/src/reduce.pyx":270 + * + * if result.dtype == np.object_: + * result = maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * return result, counts + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L26; + } + __pyx_L26:; + + /* "pandas/src/reduce.pyx":272 + * result = maybe_convert_objects(result) + * + * return result, counts # <<<<<<<<<<<<<< + * + * def _get_result_array(self, object res): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_counts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_counts)); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":205 + * return values, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr, result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF((PyObject *)__pyx_v_vslider); + __Pyx_XDECREF((PyObject *)__pyx_v_islider); + __Pyx_XDECREF(__pyx_v_gin); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_cached_typ); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":274 + * return result, counts + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_result_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6_get_result_array(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_res)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_6_get_result_array(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_result_array", 0); + + /* "pandas/src/reduce.pyx":275 + * + * def _get_result_array(self, object res): + * try: # <<<<<<<<<<<<<< + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/reduce.pyx":276 + * def _get_result_array(self, object res): + * try: + * assert(not isinstance(res, np.ndarray)) # <<<<<<<<<<<<<< + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_res, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + if (unlikely(!((!(__pyx_t_4 != 0)) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":277 + * try: + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) # <<<<<<<<<<<<<< + * + * result = np.empty(self.ngroups, dtype='O') + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyList_Check(__pyx_v_res); + if ((__pyx_t_4 != 0)) { + __pyx_t_5 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __pyx_v_self->dummy_arr; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = ((__pyx_t_5 == __pyx_t_7) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = (__pyx_t_4 != 0); + } + if (unlikely(!((!__pyx_t_9) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":279 + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + * + * result = np.empty(self.ngroups, dtype='O') # <<<<<<<<<<<<<< + * except Exception: + * raise ValueError('function does not reduce') + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->ngroups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":280 + * + * result = np.empty(self.ngroups, dtype='O') + * except Exception: # <<<<<<<<<<<<<< + * raise ValueError('function does not reduce') + * return result + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_6, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/src/reduce.pyx":281 + * result = np.empty(self.ngroups, dtype='O') + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/reduce.pyx":282 + * except Exception: + * raise ValueError('function does not reduce') + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":274 + * return result, counts + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":166 + * + * cdef public: + * object arr, index, dummy_arr, dummy_index, values, f, bins, typ, name # <<<<<<<<<<<<<< + * + * def __init__(self, object series, object f, object bins, object dummy): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->arr); + __pyx_r = __pyx_v_self->arr; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->index); + __pyx_r = __pyx_v_self->index; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy_arr); + __pyx_r = __pyx_v_self->dummy_arr; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy_index); + __pyx_r = __pyx_v_self->dummy_index; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_11dummy_index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->values); + __pyx_r = __pyx_v_self->values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_6values_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->f); + __pyx_r = __pyx_v_self->f; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->bins); + __pyx_r = __pyx_v_self->bins; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->bins); + __Pyx_DECREF(__pyx_v_self->bins); + __pyx_v_self->bins = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->bins); + __Pyx_DECREF(__pyx_v_self->bins); + __pyx_v_self->bins = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->typ); + __pyx_r = __pyx_v_self->typ; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3typ_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name___get__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name___get__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_2__set__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4name_4__del__(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":297 + * object arr, index, dummy_arr, dummy_index, f, labels, values, typ, name + * + * def __init__(self, object series, object f, object labels, # <<<<<<<<<<<<<< + * Py_ssize_t ngroups, object dummy): + * n = len(series) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_series = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_labels = 0; + Py_ssize_t __pyx_v_ngroups; + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_series,&__pyx_n_s_f,&__pyx_n_s_labels,&__pyx_n_s_ngroups,&__pyx_n_s_dummy,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_series)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ngroups)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_series = values[0]; + __pyx_v_f = values[1]; + __pyx_v_labels = values[2]; + __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_dummy = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.SeriesGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper___init__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), __pyx_v_series, __pyx_v_f, __pyx_v_labels, __pyx_v_ngroups, __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper___init__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_series, PyObject *__pyx_v_f, PyObject *__pyx_v_labels, Py_ssize_t __pyx_v_ngroups, PyObject *__pyx_v_dummy) { + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_values = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/reduce.pyx":299 + * def __init__(self, object series, object f, object labels, + * Py_ssize_t ngroups, object dummy): + * n = len(series) # <<<<<<<<<<<<<< + * + * self.labels = labels + */ + __pyx_t_1 = PyObject_Length(__pyx_v_series); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/reduce.pyx":301 + * n = len(series) + * + * self.labels = labels # <<<<<<<<<<<<<< + * self.f = f + * + */ + __Pyx_INCREF(__pyx_v_labels); + __Pyx_GIVEREF(__pyx_v_labels); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = __pyx_v_labels; + + /* "pandas/src/reduce.pyx":302 + * + * self.labels = labels + * self.f = f # <<<<<<<<<<<<<< + * + * values = series.values + */ + __Pyx_INCREF(__pyx_v_f); + __Pyx_GIVEREF(__pyx_v_f); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_f; + + /* "pandas/src/reduce.pyx":304 + * self.f = f + * + * values = series.values # <<<<<<<<<<<<<< + * if not values.flags.c_contiguous: + * values = values.copy('C') + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_values = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":305 + * + * values = series.values + * if not values.flags.c_contiguous: # <<<<<<<<<<<<<< + * values = values.copy('C') + * self.arr = values + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "pandas/src/reduce.pyx":306 + * values = series.values + * if not values.flags.c_contiguous: + * values = values.copy('C') # <<<<<<<<<<<<<< + * self.arr = values + * self.index = series.index + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":307 + * if not values.flags.c_contiguous: + * values = values.copy('C') + * self.arr = values # <<<<<<<<<<<<<< + * self.index = series.index + * self.typ = type(series) + */ + __Pyx_INCREF(__pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_values; + + /* "pandas/src/reduce.pyx":308 + * values = values.copy('C') + * self.arr = values + * self.index = series.index # <<<<<<<<<<<<<< + * self.typ = type(series) + * self.name = getattr(series,'name',None) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_series, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":309 + * self.arr = values + * self.index = series.index + * self.typ = type(series) # <<<<<<<<<<<<<< + * self.name = getattr(series,'name',None) + * + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_series))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_series))); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = ((PyObject *)Py_TYPE(__pyx_v_series)); + + /* "pandas/src/reduce.pyx":310 + * self.index = series.index + * self.typ = type(series) + * self.name = getattr(series,'name',None) # <<<<<<<<<<<<<< + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_series, __pyx_n_s_name_2, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":312 + * self.name = getattr(series,'name',None) + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) # <<<<<<<<<<<<<< + * self.passed_dummy = dummy is not None + * self.ngroups = ngroups + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_dummy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_dummy); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy); + __Pyx_GIVEREF(__pyx_v_dummy); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":313 + * + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + * self.passed_dummy = dummy is not None # <<<<<<<<<<<<<< + * self.ngroups = ngroups + * + */ + __pyx_t_5 = (__pyx_v_dummy != Py_None); + __pyx_v_self->passed_dummy = __pyx_t_5; + + /* "pandas/src/reduce.pyx":314 + * self.dummy_arr, self.dummy_index = self._check_dummy(dummy) + * self.passed_dummy = dummy is not None + * self.ngroups = ngroups # <<<<<<<<<<<<<< + * + * def _check_dummy(self, dummy=None): + */ + __pyx_v_self->ngroups = __pyx_v_ngroups; + + /* "pandas/src/reduce.pyx":297 + * object arr, index, dummy_arr, dummy_index, f, labels, values, typ, name + * + * def __init__(self, object series, object f, object labels, # <<<<<<<<<<<<<< + * Py_ssize_t ngroups, object dummy): + * n = len(series) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.lib.SeriesGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":316 + * self.ngroups = ngroups + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dummy = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_dummy (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dummy,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_dummy") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dummy = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.SeriesGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_2_check_dummy(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), __pyx_v_dummy); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_2_check_dummy(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_dummy) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_dummy", 0); + + /* "pandas/src/reduce.pyx":317 + * + * def _check_dummy(self, dummy=None): + * if dummy is None: # <<<<<<<<<<<<<< + * values = np.empty(0, dtype=self.arr.dtype) + * index = None + */ + __pyx_t_1 = (__pyx_v_dummy == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":318 + * def _check_dummy(self, dummy=None): + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__34, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":319 + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + * index = None # <<<<<<<<<<<<<< + * else: + * values = dummy.values + */ + __Pyx_INCREF(Py_None); + __pyx_v_index = Py_None; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":321 + * index = None + * else: + * values = dummy.values # <<<<<<<<<<<<<< + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":322 + * else: + * values = dummy.values + * if dummy.dtype != self.arr.dtype: # <<<<<<<<<<<<<< + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":323 + * values = dummy.values + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":324 + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: # <<<<<<<<<<<<<< + * values = values.copy() + * index = dummy.index + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((!__pyx_t_2) != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":325 + * raise ValueError('Dummy array must be same dtype') + * if not values.flags.contiguous: + * values = values.copy() # <<<<<<<<<<<<<< + * index = dummy.index + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/reduce.pyx":326 + * if not values.flags.contiguous: + * values = values.copy() + * index = dummy.index # <<<<<<<<<<<<<< + * + * return values, index + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_index = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":328 + * index = dummy.index + * + * return values, index # <<<<<<<<<<<<<< + * + * def get_result(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":316 + * self.ngroups = ngroups + * + * def _check_dummy(self, dummy=None): # <<<<<<<<<<<<<< + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.SeriesGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":330 + * return values, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr, result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_5get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_result (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_4get_result(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_4get_result(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_labels = 0; + PyArrayObject *__pyx_v_counts = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_group_size; + Py_ssize_t __pyx_v_lab; + PyObject *__pyx_v_res = 0; + int __pyx_v_initialized; + struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_vslider = 0; + struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_islider = 0; + PyObject *__pyx_v_gin = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_cached_typ = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_counts; + __Pyx_Buffer __pyx_pybuffer_counts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; + __Pyx_Buffer __pyx_pybuffer_labels; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + char const *__pyx_t_20; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_result", 0); + __pyx_pybuffer_labels.pybuffer.buf = NULL; + __pyx_pybuffer_labels.refcount = 0; + __pyx_pybuffernd_labels.data = NULL; + __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_counts.pybuffer.buf = NULL; + __pyx_pybuffer_counts.refcount = 0; + __pyx_pybuffernd_counts.data = NULL; + __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts; + + /* "pandas/src/reduce.pyx":336 + * Py_ssize_t i, n, group_size, lab + * object res + * bint initialized = 0 # <<<<<<<<<<<<<< + * Slider vslider, islider + * object gin, typ, name + */ + __pyx_v_initialized = 0; + + /* "pandas/src/reduce.pyx":339 + * Slider vslider, islider + * object gin, typ, name + * object cached_typ = None # <<<<<<<<<<<<<< + * + * labels = self.labels + */ + __Pyx_INCREF(Py_None); + __pyx_v_cached_typ = Py_None; + + /* "pandas/src/reduce.pyx":341 + * object cached_typ = None + * + * labels = self.labels # <<<<<<<<<<<<<< + * counts = np.zeros(self.ngroups, dtype=np.int64) + * group_size = 0 + */ + if (!(likely(((__pyx_v_self->labels) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->labels, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_self->labels; + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5); + } + } + __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_labels = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":342 + * + * labels = self.labels + * counts = np.zeros(self.ngroups, dtype=np.int64) # <<<<<<<<<<<<<< + * group_size = 0 + * n = len(self.arr) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->ngroups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3); + } + } + __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_counts = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":343 + * labels = self.labels + * counts = np.zeros(self.ngroups, dtype=np.int64) + * group_size = 0 # <<<<<<<<<<<<<< + * n = len(self.arr) + * name = self.name + */ + __pyx_v_group_size = 0; + + /* "pandas/src/reduce.pyx":344 + * counts = np.zeros(self.ngroups, dtype=np.int64) + * group_size = 0 + * n = len(self.arr) # <<<<<<<<<<<<<< + * name = self.name + * + */ + __pyx_t_9 = __pyx_v_self->arr; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_11 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_n = __pyx_t_11; + + /* "pandas/src/reduce.pyx":345 + * group_size = 0 + * n = len(self.arr) + * name = self.name # <<<<<<<<<<<<<< + * + * vslider = Slider(self.arr, self.dummy_arr) + */ + __pyx_t_9 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_9); + __pyx_v_name = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":347 + * name = self.name + * + * vslider = Slider(self.arr, self.dummy_arr) # <<<<<<<<<<<<<< + * islider = Slider(self.index, self.dummy_index) + * + */ + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_self->arr); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_self->arr); + __Pyx_GIVEREF(__pyx_v_self->arr); + __Pyx_INCREF(__pyx_v_self->dummy_arr); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_self->dummy_arr); + __Pyx_GIVEREF(__pyx_v_self->dummy_arr); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_vslider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":348 + * + * vslider = Slider(self.arr, self.dummy_arr) + * islider = Slider(self.index, self.dummy_index) # <<<<<<<<<<<<<< + * + * gin = self.dummy_index._engine + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->index); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->index); + __Pyx_GIVEREF(__pyx_v_self->index); + __Pyx_INCREF(__pyx_v_self->dummy_index); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->dummy_index); + __Pyx_GIVEREF(__pyx_v_self->dummy_index); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_islider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":350 + * islider = Slider(self.index, self.dummy_index) + * + * gin = self.dummy_index._engine # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dummy_index, __pyx_n_s_engine); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_gin = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":352 + * gin = self.dummy_index._engine + * + * try: # <<<<<<<<<<<<<< + * for i in range(n): + * group_size += 1 + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "pandas/src/reduce.pyx":353 + * + * try: + * for i in range(n): # <<<<<<<<<<<<<< + * group_size += 1 + * + */ + __pyx_t_11 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/reduce.pyx":354 + * try: + * for i in range(n): + * group_size += 1 # <<<<<<<<<<<<<< + * + * lab = labels[i] + */ + __pyx_v_group_size = (__pyx_v_group_size + 1); + + /* "pandas/src/reduce.pyx":356 + * group_size += 1 + * + * lab = labels[i] # <<<<<<<<<<<<<< + * + * if i == n - 1 or lab != labels[i + 1]: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_2 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_labels.diminfo[0].strides)); + + /* "pandas/src/reduce.pyx":358 + * lab = labels[i] + * + * if i == n - 1 or lab != labels[i + 1]: # <<<<<<<<<<<<<< + * if lab == -1: + * islider.advance(group_size) + */ + __pyx_t_14 = ((__pyx_v_i == (__pyx_v_n - 1)) != 0); + if (!__pyx_t_14) { + __pyx_t_15 = (__pyx_v_i + 1); + __pyx_t_2 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_labels.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_16 = ((__pyx_v_lab != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (__pyx_t_17) { + + /* "pandas/src/reduce.pyx":359 + * + * if i == n - 1 or lab != labels[i + 1]: + * if lab == -1: # <<<<<<<<<<<<<< + * islider.advance(group_size) + * vslider.advance(group_size) + */ + __pyx_t_17 = ((__pyx_v_lab == -1) != 0); + if (__pyx_t_17) { + + /* "pandas/src/reduce.pyx":360 + * if i == n - 1 or lab != labels[i + 1]: + * if lab == -1: + * islider.advance(group_size) # <<<<<<<<<<<<<< + * vslider.advance(group_size) + * group_size = 0 + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":361 + * if lab == -1: + * islider.advance(group_size) + * vslider.advance(group_size) # <<<<<<<<<<<<<< + * group_size = 0 + * continue + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":362 + * islider.advance(group_size) + * vslider.advance(group_size) + * group_size = 0 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_group_size = 0; + + /* "pandas/src/reduce.pyx":363 + * vslider.advance(group_size) + * group_size = 0 + * continue # <<<<<<<<<<<<<< + * + * islider.set_length(group_size) + */ + goto __pyx_L14_continue; + } + + /* "pandas/src/reduce.pyx":365 + * continue + * + * islider.set_length(group_size) # <<<<<<<<<<<<<< + * vslider.set_length(group_size) + * + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->set_length(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":366 + * + * islider.set_length(group_size) + * vslider.set_length(group_size) # <<<<<<<<<<<<<< + * + * if cached_typ is None: + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->set_length(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":368 + * vslider.set_length(group_size) + * + * if cached_typ is None: # <<<<<<<<<<<<<< + * cached_typ = self.typ(vslider.buf, index=islider.buf, + * name=name) + */ + __pyx_t_17 = (__pyx_v_cached_typ == Py_None); + __pyx_t_14 = (__pyx_t_17 != 0); + if (__pyx_t_14) { + + /* "pandas/src/reduce.pyx":369 + * + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, # <<<<<<<<<<<<<< + * name=name) + * else: + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_vslider->buf)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_vslider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vslider->buf)); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, ((PyObject *)__pyx_v_islider->buf)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + + /* "pandas/src/reduce.pyx":370 + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, + * name=name) # <<<<<<<<<<<<<< + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + + /* "pandas/src/reduce.pyx":369 + * + * if cached_typ is None: + * cached_typ = self.typ(vslider.buf, index=islider.buf, # <<<<<<<<<<<<<< + * name=name) + * else: + */ + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_self->typ, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_cached_typ, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":372 + * name=name) + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, '_index', islider.buf) + * object.__setattr__(cached_typ, 'name', name) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cached_typ, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_block); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_s_values); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_values); + __Pyx_GIVEREF(__pyx_n_s_values); + __Pyx_INCREF(((PyObject *)__pyx_v_vslider->buf)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_vslider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vslider->buf)); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":373 + * else: + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + * object.__setattr__(cached_typ, '_index', islider.buf) # <<<<<<<<<<<<<< + * object.__setattr__(cached_typ, 'name', name) + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_index_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_index_2); + __Pyx_GIVEREF(__pyx_n_s_index_2); + __Pyx_INCREF(((PyObject *)__pyx_v_islider->buf)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_islider->buf)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_islider->buf)); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/reduce.pyx":374 + * object.__setattr__(cached_typ._data._block, 'values', vslider.buf) + * object.__setattr__(cached_typ, '_index', islider.buf) + * object.__setattr__(cached_typ, 'name', name) # <<<<<<<<<<<<<< + * + * res = self.f(cached_typ) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __Pyx_INCREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_name_2); + __Pyx_GIVEREF(__pyx_n_s_name_2); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_L18:; + + /* "pandas/src/reduce.pyx":376 + * object.__setattr__(cached_typ, 'name', name) + * + * res = self.f(cached_typ) # <<<<<<<<<<<<<< + * res = _extract_result(res) + * if not initialized: + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_cached_typ); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_cached_typ); + __Pyx_GIVEREF(__pyx_v_cached_typ); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->f, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":377 + * + * res = self.f(cached_typ) + * res = _extract_result(res) # <<<<<<<<<<<<<< + * if not initialized: + * result = self._get_result_array(res) + */ + __pyx_t_1 = __pyx_f_6pandas_3lib__extract_result(__pyx_v_res); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":378 + * res = self.f(cached_typ) + * res = _extract_result(res) + * if not initialized: # <<<<<<<<<<<<<< + * result = self._get_result_array(res) + * initialized = 1 + */ + __pyx_t_14 = ((!(__pyx_v_initialized != 0)) != 0); + if (__pyx_t_14) { + + /* "pandas/src/reduce.pyx":379 + * res = _extract_result(res) + * if not initialized: + * result = self._get_result_array(res) # <<<<<<<<<<<<<< + * initialized = 1 + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_result_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_7)); + __pyx_t_7 = 0; + + /* "pandas/src/reduce.pyx":380 + * if not initialized: + * result = self._get_result_array(res) + * initialized = 1 # <<<<<<<<<<<<<< + * + * util.assign_value_1d(result, lab, res) + */ + __pyx_v_initialized = 1; + goto __pyx_L19; + } + __pyx_L19:; + + /* "pandas/src/reduce.pyx":382 + * initialized = 1 + * + * util.assign_value_1d(result, lab, res) # <<<<<<<<<<<<<< + * counts[lab] = group_size + * islider.advance(group_size) + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } + __pyx_t_2 = assign_value_1d(__pyx_v_result, __pyx_v_lab, __pyx_v_res); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + + /* "pandas/src/reduce.pyx":383 + * + * util.assign_value_1d(result, lab, res) + * counts[lab] = group_size # <<<<<<<<<<<<<< + * islider.advance(group_size) + * vslider.advance(group_size) + */ + __pyx_t_18 = __pyx_v_lab; + __pyx_t_2 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_counts.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_group_size; + + /* "pandas/src/reduce.pyx":384 + * util.assign_value_1d(result, lab, res) + * counts[lab] = group_size + * islider.advance(group_size) # <<<<<<<<<<<<<< + * vslider.advance(group_size) + * + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/reduce.pyx":385 + * counts[lab] = group_size + * islider.advance(group_size) + * vslider.advance(group_size) # <<<<<<<<<<<<<< + * + * group_size = 0 + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/src/reduce.pyx":387 + * vslider.advance(group_size) + * + * group_size = 0 # <<<<<<<<<<<<<< + * + * gin.clear_mapping() + */ + __pyx_v_group_size = 0; + + /* "pandas/src/reduce.pyx":389 + * group_size = 0 + * + * gin.clear_mapping() # <<<<<<<<<<<<<< + * + * except: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gin, __pyx_n_s_clear_mapping); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L16; + } + __pyx_L16:; + __pyx_L14_continue:; + } + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/reduce.pyx":391 + * gin.clear_mapping() + * + * except: # <<<<<<<<<<<<<< + * raise + * finally: + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.lib.SeriesGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_7, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/reduce.pyx":392 + * + * except: + * raise # <<<<<<<<<<<<<< + * finally: + * # so we don't free the wrong memory + */ + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_7, __pyx_t_1); + __pyx_t_9 = 0; __pyx_t_7 = 0; __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L7_exception_handled; + } + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L4_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L13_try_end:; + } + } + + /* "pandas/src/reduce.pyx":395 + * finally: + * # so we don't free the wrong memory + * islider.reset() # <<<<<<<<<<<<<< + * vslider.reset() + * + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->reset(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":396 + * # so we don't free the wrong memory + * islider.reset() + * vslider.reset() # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->reset(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5; + } + /*exception exit:*/{ + __pyx_L4_error:; + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __pyx_t_2 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; + { + + /* "pandas/src/reduce.pyx":395 + * finally: + * # so we don't free the wrong memory + * islider.reset() # <<<<<<<<<<<<<< + * vslider.reset() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->reset(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L23_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":396 + * # so we don't free the wrong memory + * islider.reset() + * vslider.reset() # <<<<<<<<<<<<<< + * + * if result.dtype == np.object_: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->reset(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L23_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_3); + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; + goto __pyx_L1_error; + __pyx_L23_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "pandas/src/reduce.pyx":398 + * vslider.reset() + * + * if result.dtype == np.object_: # <<<<<<<<<<<<<< + * result = maybe_convert_objects(result) + * + */ + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_object_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_14) { + + /* "pandas/src/reduce.pyx":399 + * + * if result.dtype == np.object_: + * result = maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * return result, counts + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L24; + } + __pyx_L24:; + + /* "pandas/src/reduce.pyx":401 + * result = maybe_convert_objects(result) + * + * return result, counts # <<<<<<<<<<<<<< + * + * def _get_result_array(self, object res): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __Pyx_INCREF(((PyObject *)__pyx_v_counts)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_counts)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_counts)); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":330 + * return values, index + * + * def get_result(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr, result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.SeriesGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_labels); + __Pyx_XDECREF((PyObject *)__pyx_v_counts); + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF((PyObject *)__pyx_v_vslider); + __Pyx_XDECREF((PyObject *)__pyx_v_islider); + __Pyx_XDECREF(__pyx_v_gin); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_cached_typ); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":403 + * return result, counts + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_7_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_result_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6_get_result_array(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_res)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6_get_result_array(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_res) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_result_array", 0); + + /* "pandas/src/reduce.pyx":404 + * + * def _get_result_array(self, object res): + * try: # <<<<<<<<<<<<<< + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/reduce.pyx":405 + * def _get_result_array(self, object res): + * try: + * assert(not isinstance(res, np.ndarray)) # <<<<<<<<<<<<<< + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_res, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + if (unlikely(!((!(__pyx_t_4 != 0)) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":406 + * try: + * assert(not isinstance(res, np.ndarray)) + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) # <<<<<<<<<<<<<< + * + * result = np.empty(self.ngroups, dtype='O') + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyList_Check(__pyx_v_res); + if ((__pyx_t_4 != 0)) { + __pyx_t_5 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __pyx_v_self->dummy_arr; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = ((__pyx_t_5 == __pyx_t_7) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = (__pyx_t_4 != 0); + } + if (unlikely(!((!__pyx_t_9) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":408 + * assert(not (isinstance(res, list) and len(res) == len(self.dummy_arr))) + * + * result = np.empty(self.ngroups, dtype='O') # <<<<<<<<<<<<<< + * except Exception: + * raise ValueError('function does not reduce') + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->ngroups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":409 + * + * result = np.empty(self.ngroups, dtype='O') + * except Exception: # <<<<<<<<<<<<<< + * raise ValueError('function does not reduce') + * return result + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("pandas.lib.SeriesGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_6, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/src/reduce.pyx":410 + * result = np.empty(self.ngroups, dtype='O') + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/reduce.pyx":411 + * except Exception: + * raise ValueError('function does not reduce') + * return result # <<<<<<<<<<<<<< + * + * cdef inline _extract_result(object res): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":403 + * return result, counts + * + * def _get_result_array(self, object res): # <<<<<<<<<<<<<< + * try: + * assert(not isinstance(res, np.ndarray)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("pandas.lib.SeriesGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":295 + * + * cdef public: + * object arr, index, dummy_arr, dummy_index, f, labels, values, typ, name # <<<<<<<<<<<<<< + * + * def __init__(self, object series, object f, object labels, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->arr); + __pyx_r = __pyx_v_self->arr; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->arr); + __Pyx_DECREF(__pyx_v_self->arr); + __pyx_v_self->arr = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_5index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_5index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->index); + __pyx_r = __pyx_v_self->index; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->index); + __Pyx_DECREF(__pyx_v_self->index); + __pyx_v_self->index = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy_arr); + __pyx_r = __pyx_v_self->dummy_arr; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_9dummy_arr_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy_arr); + __Pyx_DECREF(__pyx_v_self->dummy_arr); + __pyx_v_self->dummy_arr = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy_index); + __pyx_r = __pyx_v_self->dummy_index; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_11dummy_index_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy_index); + __Pyx_DECREF(__pyx_v_self->dummy_index); + __pyx_v_self->dummy_index = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_1f_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_1f_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->f); + __pyx_r = __pyx_v_self->f; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->f); + __Pyx_DECREF(__pyx_v_self->f); + __pyx_v_self->f = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->labels); + __pyx_r = __pyx_v_self->labels; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->labels); + __Pyx_DECREF(__pyx_v_self->labels); + __pyx_v_self->labels = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_6values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_6values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6values___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6values___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->values); + __pyx_r = __pyx_v_self->values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6values_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(__pyx_v_self->values); + __pyx_v_self->values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3typ___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->typ); + __pyx_r = __pyx_v_self->typ; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3typ_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->typ); + __Pyx_DECREF(__pyx_v_self->typ); + __pyx_v_self->typ = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_13SeriesGrouper_4name_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_4name___get__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_4name___get__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_2__set__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_2__set__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_4__del__(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_13SeriesGrouper_4name_4__del__(struct __pyx_obj_6pandas_3lib_SeriesGrouper *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":413 + * return result + * + * cdef inline _extract_result(object res): # <<<<<<<<<<<<<< + * ''' extract the result object, it might be a 0-dim ndarray + * or a len-1 0-dim, or a scalar ''' + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__extract_result(PyObject *__pyx_v_res) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_extract_result", 0); + __Pyx_INCREF(__pyx_v_res); + + /* "pandas/src/reduce.pyx":416 + * ''' extract the result object, it might be a 0-dim ndarray + * or a len-1 0-dim, or a scalar ''' + * if hasattr(res,'values'): # <<<<<<<<<<<<<< + * res = res.values + * if not np.isscalar(res): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_res, __pyx_n_s_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":417 + * or a len-1 0-dim, or a scalar ''' + * if hasattr(res,'values'): + * res = res.values # <<<<<<<<<<<<<< + * if not np.isscalar(res): + * if isinstance(res, np.ndarray): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":418 + * if hasattr(res,'values'): + * res = res.values + * if not np.isscalar(res): # <<<<<<<<<<<<<< + * if isinstance(res, np.ndarray): + * if res.ndim == 0: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_res); + __Pyx_GIVEREF(__pyx_v_res); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = ((!__pyx_t_2) != 0); + if (__pyx_t_1) { + + /* "pandas/src/reduce.pyx":419 + * res = res.values + * if not np.isscalar(res): + * if isinstance(res, np.ndarray): # <<<<<<<<<<<<<< + * if res.ndim == 0: + * res = res.item() + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_res, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":420 + * if not np.isscalar(res): + * if isinstance(res, np.ndarray): + * if res.ndim == 0: # <<<<<<<<<<<<<< + * res = res.item() + * elif res.ndim == 1 and len(res) == 1: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":421 + * if isinstance(res, np.ndarray): + * if res.ndim == 0: + * res = res.item() # <<<<<<<<<<<<<< + * elif res.ndim == 1 and len(res) == 1: + * res = res[0] + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_item); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L6; + } + + /* "pandas/src/reduce.pyx":422 + * if res.ndim == 0: + * res = res.item() + * elif res.ndim == 1 and len(res) == 1: # <<<<<<<<<<<<<< + * res = res[0] + * return res + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_6 == 1); + __pyx_t_7 = __pyx_t_1; + } else { + __pyx_t_7 = __pyx_t_2; + } + if (__pyx_t_7) { + + /* "pandas/src/reduce.pyx":423 + * res = res.item() + * elif res.ndim == 1 and len(res) == 1: + * res = res[0] # <<<<<<<<<<<<<< + * return res + * + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L6; + } + __pyx_L6:; + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/reduce.pyx":424 + * elif res.ndim == 1 and len(res) == 1: + * res = res[0] + * return res # <<<<<<<<<<<<<< + * + * cdef class Slider: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":413 + * return result + * + * cdef inline _extract_result(object res): # <<<<<<<<<<<<<< + * ''' extract the result object, it might be a 0-dim ndarray + * or a len-1 0-dim, or a scalar ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib._extract_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":435 + * char *orig_data + * + * def __init__(self, object values, object buf): # <<<<<<<<<<<<<< + * assert(values.ndim == 1) + * if not values.flags.contiguous: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_6Slider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_6Slider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_values = 0; + PyObject *__pyx_v_buf = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_buf,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = values[0]; + __pyx_v_buf = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Slider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_6Slider___init__(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), __pyx_v_values, __pyx_v_buf); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_6Slider___init__(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, PyObject *__pyx_v_values, PyObject *__pyx_v_buf) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_values); + + /* "pandas/src/reduce.pyx":436 + * + * def __init__(self, object values, object buf): + * assert(values.ndim == 1) # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":437 + * def __init__(self, object values, object buf): + * assert(values.ndim == 1) + * if not values.flags.contiguous: # <<<<<<<<<<<<<< + * values = values.copy() + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/src/reduce.pyx":438 + * assert(values.ndim == 1) + * if not values.flags.contiguous: + * values = values.copy() # <<<<<<<<<<<<<< + * + * assert(values.dtype == buf.dtype) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/reduce.pyx":440 + * values = values.copy() + * + * assert(values.dtype == buf.dtype) # <<<<<<<<<<<<<< + * self.values = values + * self.buf = buf + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/reduce.pyx":441 + * + * assert(values.dtype == buf.dtype) + * self.values = values # <<<<<<<<<<<<<< + * self.buf = buf + * self.stride = values.strides[0] + */ + if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_v_values; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->values); + __Pyx_DECREF(((PyObject *)__pyx_v_self->values)); + __pyx_v_self->values = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":442 + * assert(values.dtype == buf.dtype) + * self.values = values + * self.buf = buf # <<<<<<<<<<<<<< + * self.stride = values.strides[0] + * + */ + if (!(likely(((__pyx_v_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_buf, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_v_buf; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->buf); + __Pyx_DECREF(((PyObject *)__pyx_v_self->buf)); + __pyx_v_self->buf = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/reduce.pyx":443 + * self.values = values + * self.buf = buf + * self.stride = values.strides[0] # <<<<<<<<<<<<<< + * + * self.orig_data = self.buf.data + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->stride = __pyx_t_6; + + /* "pandas/src/reduce.pyx":445 + * self.stride = values.strides[0] + * + * self.orig_data = self.buf.data # <<<<<<<<<<<<<< + * self.orig_len = self.buf.shape[0] + * self.orig_stride = self.buf.strides[0] + */ + __pyx_t_7 = __pyx_v_self->buf->data; + __pyx_v_self->orig_data = __pyx_t_7; + + /* "pandas/src/reduce.pyx":446 + * + * self.orig_data = self.buf.data + * self.orig_len = self.buf.shape[0] # <<<<<<<<<<<<<< + * self.orig_stride = self.buf.strides[0] + * + */ + __pyx_v_self->orig_len = (__pyx_v_self->buf->dimensions[0]); + + /* "pandas/src/reduce.pyx":447 + * self.orig_data = self.buf.data + * self.orig_len = self.buf.shape[0] + * self.orig_stride = self.buf.strides[0] # <<<<<<<<<<<<<< + * + * self.buf.data = self.values.data + */ + __pyx_v_self->orig_stride = (__pyx_v_self->buf->strides[0]); + + /* "pandas/src/reduce.pyx":449 + * self.orig_stride = self.buf.strides[0] + * + * self.buf.data = self.values.data # <<<<<<<<<<<<<< + * self.buf.strides[0] = self.stride + * + */ + __pyx_t_7 = __pyx_v_self->values->data; + __pyx_v_self->buf->data = __pyx_t_7; + + /* "pandas/src/reduce.pyx":450 + * + * self.buf.data = self.values.data + * self.buf.strides[0] = self.stride # <<<<<<<<<<<<<< + * + * cpdef advance(self, Py_ssize_t k): + */ + __pyx_t_6 = __pyx_v_self->stride; + (__pyx_v_self->buf->strides[0]) = __pyx_t_6; + + /* "pandas/src/reduce.pyx":435 + * char *orig_data + * + * def __init__(self, object values, object buf): # <<<<<<<<<<<<<< + * assert(values.ndim == 1) + * if not values.flags.contiguous: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.Slider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":452 + * self.buf.strides[0] = self.stride + * + * cpdef advance(self, Py_ssize_t k): # <<<<<<<<<<<<<< + * self.buf.data = self.buf.data + self.stride * k + * + */ + +static PyObject *__pyx_pw_6pandas_3lib_6Slider_3advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_6Slider_advance(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_k, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("advance", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_3advance)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/reduce.pyx":453 + * + * cpdef advance(self, Py_ssize_t k): + * self.buf.data = self.buf.data + self.stride * k # <<<<<<<<<<<<<< + * + * cdef move(self, int start, int end): + */ + __pyx_v_self->buf->data = (((char *)__pyx_v_self->buf->data) + (__pyx_v_self->stride * __pyx_v_k)); + + /* "pandas/src/reduce.pyx":452 + * self.buf.strides[0] = self.stride + * + * cpdef advance(self, Py_ssize_t k): # <<<<<<<<<<<<<< + * self.buf.data = self.buf.data + self.stride * k + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_3advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_3advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) { + Py_ssize_t __pyx_v_k; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("advance (wrapper)", 0); + assert(__pyx_arg_k); { + __pyx_v_k = __Pyx_PyIndex_AsSsize_t(__pyx_arg_k); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_6Slider_2advance(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), ((Py_ssize_t)__pyx_v_k)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_6Slider_2advance(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_k) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("advance", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->__pyx_vtab)->advance(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":455 + * self.buf.data = self.buf.data + self.stride * k + * + * cdef move(self, int start, int end): # <<<<<<<<<<<<<< + * ''' + * For slicing + */ + +static PyObject *__pyx_f_6pandas_3lib_6Slider_move(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, int __pyx_v_start, int __pyx_v_end) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("move", 0); + + /* "pandas/src/reduce.pyx":459 + * For slicing + * ''' + * self.buf.data = self.values.data + self.stride * start # <<<<<<<<<<<<<< + * self.buf.shape[0] = end - start + * + */ + __pyx_v_self->buf->data = (__pyx_v_self->values->data + (__pyx_v_self->stride * __pyx_v_start)); + + /* "pandas/src/reduce.pyx":460 + * ''' + * self.buf.data = self.values.data + self.stride * start + * self.buf.shape[0] = end - start # <<<<<<<<<<<<<< + * + * cpdef set_length(self, Py_ssize_t length): + */ + (__pyx_v_self->buf->dimensions[0]) = (__pyx_v_end - __pyx_v_start); + + /* "pandas/src/reduce.pyx":455 + * self.buf.data = self.buf.data + self.stride * k + * + * cdef move(self, int start, int end): # <<<<<<<<<<<<<< + * ''' + * For slicing + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":462 + * self.buf.shape[0] = end - start + * + * cpdef set_length(self, Py_ssize_t length): # <<<<<<<<<<<<<< + * self.buf.shape[0] = length + * + */ + +static PyObject *__pyx_pw_6pandas_3lib_6Slider_5set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_6Slider_set_length(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_length, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_length", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_5set_length)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/reduce.pyx":463 + * + * cpdef set_length(self, Py_ssize_t length): + * self.buf.shape[0] = length # <<<<<<<<<<<<<< + * + * cpdef reset(self): + */ + (__pyx_v_self->buf->dimensions[0]) = __pyx_v_length; + + /* "pandas/src/reduce.pyx":462 + * self.buf.shape[0] = end - start + * + * cpdef set_length(self, Py_ssize_t length): # <<<<<<<<<<<<<< + * self.buf.shape[0] = length + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_5set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_5set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length) { + Py_ssize_t __pyx_v_length; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_length (wrapper)", 0); + assert(__pyx_arg_length); { + __pyx_v_length = __Pyx_PyIndex_AsSsize_t(__pyx_arg_length); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_6Slider_4set_length(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), ((Py_ssize_t)__pyx_v_length)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_6Slider_4set_length(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_length) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_length", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->__pyx_vtab)->set_length(__pyx_v_self, __pyx_v_length, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":465 + * self.buf.shape[0] = length + * + * cpdef reset(self): # <<<<<<<<<<<<<< + * self.buf.shape[0] = self.orig_len + * self.buf.data = self.orig_data + */ + +static PyObject *__pyx_pw_6pandas_3lib_6Slider_7reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_6Slider_reset(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + char *__pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reset", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_7reset)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/reduce.pyx":466 + * + * cpdef reset(self): + * self.buf.shape[0] = self.orig_len # <<<<<<<<<<<<<< + * self.buf.data = self.orig_data + * self.buf.strides[0] = self.orig_stride + */ + __pyx_t_3 = __pyx_v_self->orig_len; + (__pyx_v_self->buf->dimensions[0]) = __pyx_t_3; + + /* "pandas/src/reduce.pyx":467 + * cpdef reset(self): + * self.buf.shape[0] = self.orig_len + * self.buf.data = self.orig_data # <<<<<<<<<<<<<< + * self.buf.strides[0] = self.orig_stride + * + */ + __pyx_t_4 = __pyx_v_self->orig_data; + __pyx_v_self->buf->data = __pyx_t_4; + + /* "pandas/src/reduce.pyx":468 + * self.buf.shape[0] = self.orig_len + * self.buf.data = self.orig_data + * self.buf.strides[0] = self.orig_stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_v_self->orig_stride; + (__pyx_v_self->buf->strides[0]) = __pyx_t_3; + + /* "pandas/src/reduce.pyx":465 + * self.buf.shape[0] = length + * + * cpdef reset(self): # <<<<<<<<<<<<<< + * self.buf.shape[0] = self.orig_len + * self.buf.data = self.orig_data + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.Slider.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_7reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_6Slider_7reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_6Slider_6reset(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_6Slider_6reset(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reset", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->__pyx_vtab)->reset(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.Slider.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":474 + * pass + * + * def apply_frame_axis0(object frame, object f, object names, # <<<<<<<<<<<<<< + * ndarray[int64_t] starts, ndarray[int64_t] ends): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_118apply_frame_axis0(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_118apply_frame_axis0 = {__Pyx_NAMESTR("apply_frame_axis0"), (PyCFunction)__pyx_pw_6pandas_3lib_118apply_frame_axis0, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_118apply_frame_axis0(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_frame = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_names = 0; + PyArrayObject *__pyx_v_starts = 0; + PyArrayObject *__pyx_v_ends = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("apply_frame_axis0 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frame,&__pyx_n_s_f,&__pyx_n_s_names,&__pyx_n_s_starts,&__pyx_n_s_ends,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_names)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_starts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, 3); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ends)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, 4); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_frame_axis0") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_frame = values[0]; + __pyx_v_f = values[1]; + __pyx_v_names = values[2]; + __pyx_v_starts = ((PyArrayObject *)values[3]); + __pyx_v_ends = ((PyArrayObject *)values[4]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("apply_frame_axis0", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.apply_frame_axis0", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_starts), __pyx_ptype_5numpy_ndarray, 1, "starts", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ends), __pyx_ptype_5numpy_ndarray, 1, "ends", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_117apply_frame_axis0(__pyx_self, __pyx_v_frame, __pyx_v_f, __pyx_v_names, __pyx_v_starts, __pyx_v_ends); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_117apply_frame_axis0(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frame, PyObject *__pyx_v_f, PyObject *__pyx_v_names, PyArrayObject *__pyx_v_starts, PyArrayObject *__pyx_v_ends) { + struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_slider = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_results = 0; + PyObject *__pyx_v_piece = 0; + PyObject *__pyx_v_item_cache = 0; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_shape_before = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_mutated; + PyObject *__pyx_v_gin = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ends; + __Pyx_Buffer __pyx_pybuffer_ends; + __Pyx_LocalBuf_ND __pyx_pybuffernd_starts; + __Pyx_Buffer __pyx_pybuffer_starts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + long __pyx_t_5; + int __pyx_t_6; + long __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + int __pyx_t_19; + char const *__pyx_t_20; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("apply_frame_axis0", 0); + __pyx_pybuffer_starts.pybuffer.buf = NULL; + __pyx_pybuffer_starts.refcount = 0; + __pyx_pybuffernd_starts.data = NULL; + __pyx_pybuffernd_starts.rcbuffer = &__pyx_pybuffer_starts; + __pyx_pybuffer_ends.pybuffer.buf = NULL; + __pyx_pybuffer_ends.refcount = 0; + __pyx_pybuffernd_ends.data = NULL; + __pyx_pybuffernd_ends.rcbuffer = &__pyx_pybuffer_ends; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_starts.rcbuffer->pybuffer, (PyObject*)__pyx_v_starts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_starts.diminfo[0].strides = __pyx_pybuffernd_starts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_starts.diminfo[0].shape = __pyx_pybuffernd_starts.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ends.rcbuffer->pybuffer, (PyObject*)__pyx_v_ends, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_ends.diminfo[0].strides = __pyx_pybuffernd_ends.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ends.diminfo[0].shape = __pyx_pybuffernd_ends.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/reduce.pyx":478 + * cdef: + * BlockSlider slider + * Py_ssize_t i, n = len(starts) # <<<<<<<<<<<<<< + * list results + * object piece + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_starts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/reduce.pyx":483 + * dict item_cache + * + * if frame.index._has_complex_internals: # <<<<<<<<<<<<<< + * raise InvalidApply('Cannot modify frame index internals') + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_has_complex_internals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/src/reduce.pyx":484 + * + * if frame.index._has_complex_internals: + * raise InvalidApply('Cannot modify frame index internals') # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidApply); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":487 + * + * + * results = [] # <<<<<<<<<<<<<< + * + * # Need to infer if our low-level mucking is going to cause a segfault + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_results = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":490 + * + * # Need to infer if our low-level mucking is going to cause a segfault + * if n > 0: # <<<<<<<<<<<<<< + * chunk = frame[starts[0]:ends[0]] + * shape_before = chunk.shape + */ + __pyx_t_4 = ((__pyx_v_n > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/src/reduce.pyx":491 + * # Need to infer if our low-level mucking is going to cause a segfault + * if n > 0: + * chunk = frame[starts[0]:ends[0]] # <<<<<<<<<<<<<< + * shape_before = chunk.shape + * try: + */ + __pyx_t_5 = 0; + __pyx_t_6 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_pybuffernd_starts.diminfo[0].shape; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_starts.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_t_6 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_ends.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ends.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_frame, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_starts.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_starts.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ends.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_ends.diminfo[0].strides)), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_chunk = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":492 + * if n > 0: + * chunk = frame[starts[0]:ends[0]] + * shape_before = chunk.shape # <<<<<<<<<<<<<< + * try: + * result = f(chunk) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_shape_before = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":493 + * chunk = frame[starts[0]:ends[0]] + * shape_before = chunk.shape + * try: # <<<<<<<<<<<<<< + * result = f(chunk) + * if result is chunk: + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/src/reduce.pyx":494 + * shape_before = chunk.shape + * try: + * result = f(chunk) # <<<<<<<<<<<<<< + * if result is chunk: + * raise InvalidApply('Function unsafe for fast apply') + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":495 + * try: + * result = f(chunk) + * if result is chunk: # <<<<<<<<<<<<<< + * raise InvalidApply('Function unsafe for fast apply') + * except: + */ + __pyx_t_4 = (__pyx_v_result == __pyx_v_chunk); + __pyx_t_11 = (__pyx_t_4 != 0); + if (__pyx_t_11) { + + /* "pandas/src/reduce.pyx":496 + * result = f(chunk) + * if result is chunk: + * raise InvalidApply('Function unsafe for fast apply') # <<<<<<<<<<<<<< + * except: + * raise InvalidApply('Let this error raise above us') + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidApply); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + } + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":497 + * if result is chunk: + * raise InvalidApply('Function unsafe for fast apply') + * except: # <<<<<<<<<<<<<< + * raise InvalidApply('Let this error raise above us') + * + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.lib.apply_frame_axis0", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_12); + + /* "pandas/src/reduce.pyx":498 + * raise InvalidApply('Function unsafe for fast apply') + * except: + * raise InvalidApply('Let this error raise above us') # <<<<<<<<<<<<<< + * + * slider = BlockSlider(frame) + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidApply); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L12_try_end:; + } + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/reduce.pyx":500 + * raise InvalidApply('Let this error raise above us') + * + * slider = BlockSlider(frame) # <<<<<<<<<<<<<< + * + * mutated = False + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_frame); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_frame); + __Pyx_GIVEREF(__pyx_v_frame); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_BlockSlider)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_slider = ((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":502 + * slider = BlockSlider(frame) + * + * mutated = False # <<<<<<<<<<<<<< + * item_cache = slider.dummy._item_cache + * gin = slider.dummy.index._engine # f7u12 + */ + __pyx_v_mutated = 0; + + /* "pandas/src/reduce.pyx":503 + * + * mutated = False + * item_cache = slider.dummy._item_cache # <<<<<<<<<<<<<< + * gin = slider.dummy.index._engine # f7u12 + * try: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_slider->dummy, __pyx_n_s_item_cache); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_item_cache = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":504 + * mutated = False + * item_cache = slider.dummy._item_cache + * gin = slider.dummy.index._engine # f7u12 # <<<<<<<<<<<<<< + * try: + * for i in range(n): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_slider->dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_engine); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_gin = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":505 + * item_cache = slider.dummy._item_cache + * gin = slider.dummy.index._engine # f7u12 + * try: # <<<<<<<<<<<<<< + * for i in range(n): + * slider.move(starts[i], ends[i]) + */ + /*try:*/ { + + /* "pandas/src/reduce.pyx":506 + * gin = slider.dummy.index._engine # f7u12 + * try: + * for i in range(n): # <<<<<<<<<<<<<< + * slider.move(starts[i], ends[i]) + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/src/reduce.pyx":507 + * try: + * for i in range(n): + * slider.move(starts[i], ends[i]) # <<<<<<<<<<<<<< + * + * item_cache.clear() # ugh + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_starts.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_starts.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_ends.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ends.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + __pyx_t_12 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *)__pyx_v_slider->__pyx_vtab)->move(__pyx_v_slider, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_starts.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_starts.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ends.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ends.diminfo[0].strides)), 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":509 + * slider.move(starts[i], ends[i]) + * + * item_cache.clear() # ugh # <<<<<<<<<<<<<< + * gin.clear_mapping() + * + */ + if (unlikely(__pyx_v_item_cache == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "clear"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + __pyx_t_18 = __Pyx_PyDict_Clear(__pyx_v_item_cache); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + + /* "pandas/src/reduce.pyx":510 + * + * item_cache.clear() # ugh + * gin.clear_mapping() # <<<<<<<<<<<<<< + * + * object.__setattr__(slider.dummy, 'name', names[i]) + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_gin, __pyx_n_s_clear_mapping); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":512 + * gin.clear_mapping() + * + * object.__setattr__(slider.dummy, 'name', names[i]) # <<<<<<<<<<<<<< + * piece = f(slider.dummy) + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L17_error;}; + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_slider->dummy); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_slider->dummy); + __Pyx_GIVEREF(__pyx_v_slider->dummy); + __Pyx_INCREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_name_2); + __Pyx_GIVEREF(__pyx_n_s_name_2); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "pandas/src/reduce.pyx":513 + * + * object.__setattr__(slider.dummy, 'name', names[i]) + * piece = f(slider.dummy) # <<<<<<<<<<<<<< + * + * # I'm paying the price for index-sharing, ugh + */ + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_slider->dummy); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_slider->dummy); + __Pyx_GIVEREF(__pyx_v_slider->dummy); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_piece, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":516 + * + * # I'm paying the price for index-sharing, ugh + * try: # <<<<<<<<<<<<<< + * if piece.index is slider.dummy.index: + * piece = piece.copy() + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/reduce.pyx":517 + * # I'm paying the price for index-sharing, ugh + * try: + * if piece.index is slider.dummy.index: # <<<<<<<<<<<<<< + * piece = piece.copy() + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_piece, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L21_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_slider->dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L21_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = (__pyx_t_2 == __pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = (__pyx_t_11 != 0); + if (__pyx_t_4) { + + /* "pandas/src/reduce.pyx":518 + * try: + * if piece.index is slider.dummy.index: + * piece = piece.copy() # <<<<<<<<<<<<<< + * else: + * mutated = True + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_piece, __pyx_n_s_copy); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L21_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L21_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_piece, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L29; + } + /*else*/ { + + /* "pandas/src/reduce.pyx":520 + * piece = piece.copy() + * else: + * mutated = True # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_v_mutated = 1; + } + __pyx_L29:; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L28_try_end; + __pyx_L21_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":521 + * else: + * mutated = True + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * results.append(piece) + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_6) { + PyErr_Restore(0,0,0); + goto __pyx_L22_exception_handled; + } + goto __pyx_L23_except_error; + __pyx_L23_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L17_error; + __pyx_L22_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L28_try_end:; + } + + /* "pandas/src/reduce.pyx":523 + * except AttributeError: + * pass + * results.append(piece) # <<<<<<<<<<<<<< + * finally: + * slider.reset() + */ + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_piece); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + } + + /* "pandas/src/reduce.pyx":525 + * results.append(piece) + * finally: + * slider.reset() # <<<<<<<<<<<<<< + * + * return results, mutated + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *)__pyx_v_slider->__pyx_vtab)->reset(__pyx_v_slider); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L18; + } + /*exception exit:*/{ + __pyx_L17_error:; + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __pyx_t_6 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; + { + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *)__pyx_v_slider->__pyx_vtab)->reset(__pyx_v_slider); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L31_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; + goto __pyx_L1_error; + __pyx_L31_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + goto __pyx_L1_error; + } + __pyx_L18:; + } + + /* "pandas/src/reduce.pyx":527 + * slider.reset() + * + * return results, mutated # <<<<<<<<<<<<<< + * + * cdef class BlockSlider: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_mutated); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_results); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_results); + __Pyx_GIVEREF(__pyx_v_results); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":474 + * pass + * + * def apply_frame_axis0(object frame, object f, object names, # <<<<<<<<<<<<<< + * ndarray[int64_t] starts, ndarray[int64_t] ends): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ends.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.apply_frame_axis0", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ends.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_starts.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_slider); + __Pyx_XDECREF(__pyx_v_results); + __Pyx_XDECREF(__pyx_v_piece); + __Pyx_XDECREF(__pyx_v_item_cache); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_shape_before); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_gin); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":543 + * char **base_ptrs + * + * def __init__(self, frame): # <<<<<<<<<<<<<< + * self.frame = frame + * self.dummy = frame[:0] + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_frame = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frame,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_frame = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.BlockSlider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider___init__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), __pyx_v_frame); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider___init__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_frame) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_block = NULL; + PyObject *__pyx_v_b = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/reduce.pyx":544 + * + * def __init__(self, frame): + * self.frame = frame # <<<<<<<<<<<<<< + * self.dummy = frame[:0] + * + */ + __Pyx_INCREF(__pyx_v_frame); + __Pyx_GIVEREF(__pyx_v_frame); + __Pyx_GOTREF(__pyx_v_self->frame); + __Pyx_DECREF(__pyx_v_self->frame); + __pyx_v_self->frame = __pyx_v_frame; + + /* "pandas/src/reduce.pyx":545 + * def __init__(self, frame): + * self.frame = frame + * self.dummy = frame[:0] # <<<<<<<<<<<<<< + * + * self.blocks = [b.values for b in self.dummy._data.blocks] + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_frame, 0, 0, NULL, NULL, &__pyx_slice__40, 0, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->dummy); + __Pyx_DECREF(__pyx_v_self->dummy); + __pyx_v_self->dummy = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":547 + * self.dummy = frame[:0] + * + * self.blocks = [b.values for b in self.dummy._data.blocks] # <<<<<<<<<<<<<< + * + * for x in self.blocks: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dummy, __pyx_n_s_data_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_blocks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->blocks); + __Pyx_DECREF(__pyx_v_self->blocks); + __pyx_v_self->blocks = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":549 + * self.blocks = [b.values for b in self.dummy._data.blocks] + * + * for x in self.blocks: # <<<<<<<<<<<<<< + * util.set_array_not_contiguous(x) + * + */ + if (unlikely(__pyx_v_self->blocks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_self->blocks; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":550 + * + * for x in self.blocks: + * util.set_array_not_contiguous(x) # <<<<<<<<<<<<<< + * + * self.nblocks = len(self.blocks) + */ + if (!(likely(((__pyx_v_x) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + set_array_not_contiguous(((PyArrayObject *)__pyx_v_x)); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":552 + * util.set_array_not_contiguous(x) + * + * self.nblocks = len(self.blocks) # <<<<<<<<<<<<<< + * self.idx_slider = Slider(self.frame.index, self.dummy.index) + * + */ + __pyx_t_1 = __pyx_v_self->blocks; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->nblocks = __pyx_t_4; + + /* "pandas/src/reduce.pyx":553 + * + * self.nblocks = len(self.blocks) + * self.idx_slider = Slider(self.frame.index, self.dummy.index) # <<<<<<<<<<<<<< + * + * self.base_ptrs = malloc(sizeof(char*) * len(self.blocks)) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frame, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dummy, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->idx_slider); + __Pyx_DECREF(((PyObject *)__pyx_v_self->idx_slider)); + __pyx_v_self->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":555 + * self.idx_slider = Slider(self.frame.index, self.dummy.index) + * + * self.base_ptrs = malloc(sizeof(char*) * len(self.blocks)) # <<<<<<<<<<<<<< + * for i, block in enumerate(self.blocks): + * self.base_ptrs[i] = ( block).data + */ + __pyx_t_2 = __pyx_v_self->blocks; + __Pyx_INCREF(__pyx_t_2); + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->base_ptrs = ((char **)malloc(((sizeof(char *)) * __pyx_t_4))); + + /* "pandas/src/reduce.pyx":556 + * + * self.base_ptrs = malloc(sizeof(char*) * len(self.blocks)) + * for i, block in enumerate(self.blocks): # <<<<<<<<<<<<<< + * self.base_ptrs[i] = ( block).data + * + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_2 = __pyx_int_0; + __pyx_t_3 = __pyx_v_self->blocks; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_block, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":557 + * self.base_ptrs = malloc(sizeof(char*) * len(self.blocks)) + * for i, block in enumerate(self.blocks): + * self.base_ptrs[i] = ( block).data # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_6 = ((PyArrayObject *)__pyx_v_block)->data; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (__pyx_v_self->base_ptrs[__pyx_t_7]) = __pyx_t_6; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":543 + * char **base_ptrs + * + * def __init__(self, frame): # <<<<<<<<<<<<<< + * self.frame = frame + * self.dummy = frame[:0] + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockSlider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_block); + __Pyx_XDECREF(__pyx_v_b); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":559 + * self.base_ptrs[i] = ( block).data + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.base_ptrs) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_3lib_11BlockSlider_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_3lib_11BlockSlider_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_3lib_11BlockSlider_2__dealloc__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_3lib_11BlockSlider_2__dealloc__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/src/reduce.pyx":560 + * + * def __dealloc__(self): + * free(self.base_ptrs) # <<<<<<<<<<<<<< + * + * cpdef move(self, int start, int end): + */ + free(__pyx_v_self->base_ptrs); + + /* "pandas/src/reduce.pyx":559 + * self.base_ptrs[i] = ( block).data + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.base_ptrs) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/src/reduce.pyx":562 + * free(self.base_ptrs) + * + * cpdef move(self, int start, int end): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr + */ + +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_3lib_11BlockSlider_move(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, int __pyx_v_start, int __pyx_v_end, int __pyx_skip_dispatch) { + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("move", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_move); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_3lib_11BlockSlider_5move)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/reduce.pyx":567 + * + * # move blocks + * for i in range(self.nblocks): # <<<<<<<<<<<<<< + * arr = self.blocks[i] + * + */ + __pyx_t_5 = __pyx_v_self->nblocks; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/reduce.pyx":568 + * # move blocks + * for i in range(self.nblocks): + * arr = self.blocks[i] # <<<<<<<<<<<<<< + * + * # axis=1 is the frame's axis=0 + */ + if (unlikely(__pyx_v_self->blocks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->blocks, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":571 + * + * # axis=1 is the frame's axis=0 + * arr.data = self.base_ptrs[i] + arr.strides[1] * start # <<<<<<<<<<<<<< + * arr.shape[1] = end - start + * + */ + __pyx_v_arr->data = ((__pyx_v_self->base_ptrs[__pyx_v_i]) + ((__pyx_v_arr->strides[1]) * __pyx_v_start)); + + /* "pandas/src/reduce.pyx":572 + * # axis=1 is the frame's axis=0 + * arr.data = self.base_ptrs[i] + arr.strides[1] * start + * arr.shape[1] = end - start # <<<<<<<<<<<<<< + * + * self.idx_slider.move(start, end) + */ + (__pyx_v_arr->dimensions[1]) = (__pyx_v_end - __pyx_v_start); + } + + /* "pandas/src/reduce.pyx":574 + * arr.shape[1] = end - start + * + * self.idx_slider.move(start, end) # <<<<<<<<<<<<<< + * + * cdef reset(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->idx_slider->__pyx_vtab)->move(__pyx_v_self->idx_slider, __pyx_v_start, __pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/reduce.pyx":562 + * free(self.base_ptrs) + * + * cpdef move(self, int start, int end): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.BlockSlider.move", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_start; + int __pyx_v_end; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("move (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_end,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("move", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "move") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_start = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_end = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("move", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.BlockSlider.move", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_4move(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), __pyx_v_start, __pyx_v_end); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_4move(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, int __pyx_v_start, int __pyx_v_end) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("move", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_BlockSlider *)__pyx_v_self->__pyx_vtab)->move(__pyx_v_self, __pyx_v_start, __pyx_v_end, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockSlider.move", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":576 + * self.idx_slider.move(start, end) + * + * cdef reset(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr + */ + +static PyObject *__pyx_f_6pandas_3lib_11BlockSlider_reset(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reset", 0); + + /* "pandas/src/reduce.pyx":581 + * + * # move blocks + * for i in range(self.nblocks): # <<<<<<<<<<<<<< + * arr = self.blocks[i] + * + */ + __pyx_t_1 = __pyx_v_self->nblocks; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/reduce.pyx":582 + * # move blocks + * for i in range(self.nblocks): + * arr = self.blocks[i] # <<<<<<<<<<<<<< + * + * # axis=1 is the frame's axis=0 + */ + if (unlikely(__pyx_v_self->blocks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->blocks, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":585 + * + * # axis=1 is the frame's axis=0 + * arr.data = self.base_ptrs[i] # <<<<<<<<<<<<<< + * arr.shape[1] = 0 + * + */ + __pyx_v_arr->data = (__pyx_v_self->base_ptrs[__pyx_v_i]); + + /* "pandas/src/reduce.pyx":586 + * # axis=1 is the frame's axis=0 + * arr.data = self.base_ptrs[i] + * arr.shape[1] = 0 # <<<<<<<<<<<<<< + * + * self.idx_slider.reset() + */ + (__pyx_v_arr->dimensions[1]) = 0; + } + + /* "pandas/src/reduce.pyx":588 + * arr.shape[1] = 0 + * + * self.idx_slider.reset() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_self->idx_slider->__pyx_vtab)->reset(__pyx_v_self->idx_slider, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":576 + * self.idx_slider.move(start, end) + * + * cdef reset(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray arr + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.BlockSlider.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":535 + * + * cdef public: + * object frame, dummy # <<<<<<<<<<<<<< + * int nblocks + * Slider idx_slider + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5frame_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5frame_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5frame___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_5frame___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->frame); + __pyx_r = __pyx_v_self->frame; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5frame_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5frame_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5frame_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_5frame_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->frame); + __Pyx_DECREF(__pyx_v_self->frame); + __pyx_v_self->frame = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5frame_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5frame_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5frame_4__del__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_5frame_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->frame); + __Pyx_DECREF(__pyx_v_self->frame); + __pyx_v_self->frame = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5dummy_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_5dummy_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5dummy___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_5dummy___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dummy); + __pyx_r = __pyx_v_self->dummy; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dummy); + __Pyx_DECREF(__pyx_v_self->dummy); + __pyx_v_self->dummy = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_4__del__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_5dummy_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dummy); + __Pyx_DECREF(__pyx_v_self->dummy); + __pyx_v_self->dummy = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":536 + * cdef public: + * object frame, dummy + * int nblocks # <<<<<<<<<<<<<< + * Slider idx_slider + * list blocks + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_7nblocks___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_7nblocks___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nblocks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockSlider.nblocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_7nblocks_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_7nblocks_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->nblocks = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.BlockSlider.nblocks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":537 + * object frame, dummy + * int nblocks + * Slider idx_slider # <<<<<<<<<<<<<< + * list blocks + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->idx_slider)); + __pyx_r = ((PyObject *)__pyx_v_self->idx_slider); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_3lib_Slider))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->idx_slider); + __Pyx_DECREF(((PyObject *)__pyx_v_self->idx_slider)); + __pyx_v_self->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockSlider.idx_slider.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_4__del__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_10idx_slider_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->idx_slider); + __Pyx_DECREF(((PyObject *)__pyx_v_self->idx_slider)); + __pyx_v_self->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":538 + * int nblocks + * Slider idx_slider + * list blocks # <<<<<<<<<<<<<< + * + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_6blocks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_11BlockSlider_6blocks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_6blocks___get__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_11BlockSlider_6blocks___get__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->blocks); + __pyx_r = __pyx_v_self->blocks; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_2__set__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_2__set__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->blocks); + __Pyx_DECREF(__pyx_v_self->blocks); + __pyx_v_self->blocks = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.BlockSlider.blocks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_4__del__(((struct __pyx_obj_6pandas_3lib_BlockSlider *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_11BlockSlider_6blocks_4__del__(struct __pyx_obj_6pandas_3lib_BlockSlider *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->blocks); + __Pyx_DECREF(__pyx_v_self->blocks); + __pyx_v_self->blocks = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/reduce.pyx":591 + * + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): # <<<<<<<<<<<<<< + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_120reduce(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_120reduce = {__Pyx_NAMESTR("reduce"), (PyCFunction)__pyx_pw_6pandas_3lib_120reduce, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_120reduce(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_arr = 0; + PyObject *__pyx_v_f = 0; + PyObject *__pyx_v_axis = 0; + PyObject *__pyx_v_dummy = 0; + PyObject *__pyx_v_labels = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reduce (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_f,&__pyx_n_s_axis,&__pyx_n_s_dummy,&__pyx_n_s_labels,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)__pyx_int_0); + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reduce", 0, 2, 5, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dummy); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_labels); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduce") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = values[0]; + __pyx_v_f = values[1]; + __pyx_v_axis = values[2]; + __pyx_v_dummy = values[3]; + __pyx_v_labels = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("reduce", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.reduce", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_119reduce(__pyx_self, __pyx_v_arr, __pyx_v_f, __pyx_v_axis, __pyx_v_dummy, __pyx_v_labels); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_119reduce(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_f, PyObject *__pyx_v_axis, PyObject *__pyx_v_dummy, PyObject *__pyx_v_labels) { + struct __pyx_obj_6pandas_3lib_Reducer *__pyx_v_reducer = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reduce", 0); + + /* "pandas/src/reduce.pyx":592 + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): + * if labels._has_complex_internals: # <<<<<<<<<<<<<< + * raise Exception('Cannot use shortcut') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_has_complex_internals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/src/reduce.pyx":593 + * def reduce(arr, f, axis=0, dummy=None, labels=None): + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') # <<<<<<<<<<<<<< + * + * reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels) + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/reduce.pyx":595 + * raise Exception('Cannot use shortcut') + * + * reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels) # <<<<<<<<<<<<<< + * return reducer.get_result() + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_INCREF(__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_f); + __Pyx_GIVEREF(__pyx_v_f); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_v_axis) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dummy, __pyx_v_dummy) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_labels, __pyx_v_labels) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Reducer)), __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_reducer = ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/reduce.pyx":596 + * + * reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels) + * return reducer.get_result() # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_reducer), __pyx_n_s_get_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/reduce.pyx":591 + * + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): # <<<<<<<<<<<<<< + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.reduce", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_reducer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":9 + * object func, name, allow_setting + * + * def __init__(self, func=None, allow_setting=False): # <<<<<<<<<<<<<< + * if func is not None: + * self.func = func + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_14cache_readonly_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_14cache_readonly_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_allow_setting = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_allow_setting,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allow_setting); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_allow_setting = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.cache_readonly.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly___init__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self), __pyx_v_func, __pyx_v_allow_setting); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_14cache_readonly___init__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_allow_setting) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/properties.pyx":10 + * + * def __init__(self, func=None, allow_setting=False): + * if func is not None: # <<<<<<<<<<<<<< + * self.func = func + * self.name = func.__name__ + */ + __pyx_t_1 = (__pyx_v_func != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/properties.pyx":11 + * def __init__(self, func=None, allow_setting=False): + * if func is not None: + * self.func = func # <<<<<<<<<<<<<< + * self.name = func.__name__ + * self.allow_setting = allow_setting + */ + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = __pyx_v_func; + + /* "pandas/src/properties.pyx":12 + * if func is not None: + * self.func = func + * self.name = func.__name__ # <<<<<<<<<<<<<< + * self.allow_setting = allow_setting + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/properties.pyx":13 + * self.func = func + * self.name = func.__name__ + * self.allow_setting = allow_setting # <<<<<<<<<<<<<< + * + * def __call__(self, func, doc=None): + */ + __Pyx_INCREF(__pyx_v_allow_setting); + __Pyx_GIVEREF(__pyx_v_allow_setting); + __Pyx_GOTREF(__pyx_v_self->allow_setting); + __Pyx_DECREF(__pyx_v_self->allow_setting); + __pyx_v_self->allow_setting = __pyx_v_allow_setting; + + /* "pandas/src/properties.pyx":9 + * object func, name, allow_setting + * + * def __init__(self, func=None, allow_setting=False): # <<<<<<<<<<<<<< + * if func is not None: + * self.func = func + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.cache_readonly.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":15 + * self.allow_setting = allow_setting + * + * def __call__(self, func, doc=None): # <<<<<<<<<<<<<< + * self.func = func + * self.name = func.__name__ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + CYTHON_UNUSED PyObject *__pyx_v_doc = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_doc,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_doc); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_doc = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.cache_readonly.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_2__call__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self), __pyx_v_func, __pyx_v_doc); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_2__call__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_func, CYTHON_UNUSED PyObject *__pyx_v_doc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "pandas/src/properties.pyx":16 + * + * def __call__(self, func, doc=None): + * self.func = func # <<<<<<<<<<<<<< + * self.name = func.__name__ + * return self + */ + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = __pyx_v_func; + + /* "pandas/src/properties.pyx":17 + * def __call__(self, func, doc=None): + * self.func = func + * self.name = func.__name__ # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/properties.pyx":18 + * self.func = func + * self.name = func.__name__ + * return self # <<<<<<<<<<<<<< + * + * def __get__(self, obj, typ): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/src/properties.pyx":15 + * self.allow_setting = allow_setting + * + * def __call__(self, func, doc=None): # <<<<<<<<<<<<<< + * self.func = func + * self.name = func.__name__ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.cache_readonly.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":20 + * return self + * + * def __get__(self, obj, typ): # <<<<<<<<<<<<<< + * # Get the cache or set a default one if needed + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_5__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_typ); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_5__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_typ) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_4__get__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_typ)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4__get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_typ) { + PyObject *__pyx_v_cache = NULL; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/src/properties.pyx":23 + * # Get the cache or set a default one if needed + * + * cache = getattr(obj, '_cache', None) # <<<<<<<<<<<<<< + * if cache is None: + * try: + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_s_cache, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cache = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/src/properties.pyx":24 + * + * cache = getattr(obj, '_cache', None) + * if cache is None: # <<<<<<<<<<<<<< + * try: + * cache = obj._cache = {} + */ + __pyx_t_2 = (__pyx_v_cache == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/src/properties.pyx":25 + * cache = getattr(obj, '_cache', None) + * if cache is None: + * try: # <<<<<<<<<<<<<< + * cache = obj._cache = {} + * except (AttributeError): + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/src/properties.pyx":26 + * if cache is None: + * try: + * cache = obj._cache = {} # <<<<<<<<<<<<<< + * except (AttributeError): + * return + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_cache, __pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_cache, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/properties.pyx":27 + * try: + * cache = obj._cache = {} + * except (AttributeError): # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.cache_readonly.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/src/properties.pyx":28 + * cache = obj._cache = {} + * except (AttributeError): + * return # <<<<<<<<<<<<<< + * + * if PyDict_Contains(cache, self.name): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/properties.pyx":30 + * return + * + * if PyDict_Contains(cache, self.name): # <<<<<<<<<<<<<< + * # not necessary to Py_INCREF + * val = PyDict_GetItem(cache, self.name) + */ + __pyx_t_9 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_7 = PyDict_Contains(__pyx_v_cache, __pyx_t_9); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/src/properties.pyx":32 + * if PyDict_Contains(cache, self.name): + * # not necessary to Py_INCREF + * val = PyDict_GetItem(cache, self.name) # <<<<<<<<<<<<<< + * else: + * val = self.func(obj) + */ + __pyx_t_9 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = PyDict_GetItem(__pyx_v_cache, __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = ((PyObject *)__pyx_t_10); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_val = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/src/properties.pyx":34 + * val = PyDict_GetItem(cache, self.name) + * else: + * val = self.func(obj) # <<<<<<<<<<<<<< + * PyDict_SetItem(cache, self.name, val) + * return val + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_self->func, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_val = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/src/properties.pyx":35 + * else: + * val = self.func(obj) + * PyDict_SetItem(cache, self.name, val) # <<<<<<<<<<<<<< + * return val + * + */ + __pyx_t_8 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = PyDict_SetItem(__pyx_v_cache, __pyx_t_8, __pyx_v_val); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_L14:; + + /* "pandas/src/properties.pyx":36 + * val = self.func(obj) + * PyDict_SetItem(cache, self.name, val) + * return val # <<<<<<<<<<<<<< + * + * def __set__(self, obj, value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_val); + __pyx_r = __pyx_v_val; + goto __pyx_L0; + + /* "pandas/src/properties.pyx":20 + * return self + * + * def __get__(self, obj, typ): # <<<<<<<<<<<<<< + * # Get the cache or set a default one if needed + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.lib.cache_readonly.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cache); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":38 + * return val + * + * def __set__(self, obj, value): # <<<<<<<<<<<<<< + * + * if not self.allow_setting: + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_14cache_readonly_7__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_14cache_readonly_7__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_6__set__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_14cache_readonly_6__set__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { + PyObject *__pyx_v_cache = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "pandas/src/properties.pyx":40 + * def __set__(self, obj, value): + * + * if not self.allow_setting: # <<<<<<<<<<<<<< + * raise Exception("cannot set values for [%s]" % self.name) + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->allow_setting); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "pandas/src/properties.pyx":41 + * + * if not self.allow_setting: + * raise Exception("cannot set values for [%s]" % self.name) # <<<<<<<<<<<<<< + * + * # Get the cache or set a default one if needed + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_cannot_set_values_for_s, __pyx_v_self->name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/properties.pyx":44 + * + * # Get the cache or set a default one if needed + * cache = getattr(obj, '_cache', None) # <<<<<<<<<<<<<< + * if cache is None: + * try: + */ + __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_s_cache, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_cache = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/properties.pyx":45 + * # Get the cache or set a default one if needed + * cache = getattr(obj, '_cache', None) + * if cache is None: # <<<<<<<<<<<<<< + * try: + * cache = obj._cache = {} + */ + __pyx_t_2 = (__pyx_v_cache == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/properties.pyx":46 + * cache = getattr(obj, '_cache', None) + * if cache is None: + * try: # <<<<<<<<<<<<<< + * cache = obj._cache = {} + * except (AttributeError): + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/src/properties.pyx":47 + * if cache is None: + * try: + * cache = obj._cache = {} # <<<<<<<<<<<<<< + * except (AttributeError): + * return + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_cache, __pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_cache, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/properties.pyx":48 + * try: + * cache = obj._cache = {} + * except (AttributeError): # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.lib.cache_readonly.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/src/properties.pyx":49 + * cache = obj._cache = {} + * except (AttributeError): + * return # <<<<<<<<<<<<<< + * + * PyDict_SetItem(cache, self.name, value) + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L8_except_return; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_exception_handled; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L8_except_return:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L0; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L12_try_end:; + } + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/properties.pyx":51 + * return + * + * PyDict_SetItem(cache, self.name, value) # <<<<<<<<<<<<<< + * + * cdef class AxisProperty(object): + */ + __pyx_t_9 = __pyx_v_self->name; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = PyDict_SetItem(__pyx_v_cache, __pyx_t_9, __pyx_v_value); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/src/properties.pyx":38 + * return val + * + * def __set__(self, obj, value): # <<<<<<<<<<<<<< + * + * if not self.allow_setting: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.lib.cache_readonly.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cache); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":7 + * + * cdef readonly: + * object func, name, allow_setting # <<<<<<<<<<<<<< + * + * def __init__(self, func=None, allow_setting=False): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_4func_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_4func_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_4func___get__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4func___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->func); + __pyx_r = __pyx_v_self->func; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_4name_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_13allow_setting_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_14cache_readonly_13allow_setting_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_14cache_readonly_13allow_setting___get__(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_13allow_setting___get__(struct __pyx_obj_6pandas_3lib_cache_readonly *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->allow_setting); + __pyx_r = __pyx_v_self->allow_setting; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":57 + * Py_ssize_t axis + * + * def __init__(self, axis=0): # <<<<<<<<<<<<<< + * self.axis = axis + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_12AxisProperty_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_3lib_12AxisProperty_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_axis = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_axis,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axis); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_axis = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.AxisProperty.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_3lib_12AxisProperty___init__(((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self), __pyx_v_axis); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_12AxisProperty___init__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_axis) { + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/properties.pyx":58 + * + * def __init__(self, axis=0): + * self.axis = axis # <<<<<<<<<<<<<< + * + * def __get__(self, obj, type): + */ + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_axis); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->axis = __pyx_t_1; + + /* "pandas/src/properties.pyx":57 + * Py_ssize_t axis + * + * def __init__(self, axis=0): # <<<<<<<<<<<<<< + * self.axis = axis + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.AxisProperty.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":60 + * self.axis = axis + * + * def __get__(self, obj, type): # <<<<<<<<<<<<<< + * cdef list axes = obj._data.axes + * return axes[self.axis] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_12AxisProperty_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type); /*proto*/ +static PyObject *__pyx_pw_6pandas_3lib_12AxisProperty_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_12AxisProperty_2__get__(((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_type)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_12AxisProperty_2__get__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_type) { + PyObject *__pyx_v_axes = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/src/properties.pyx":61 + * + * def __get__(self, obj, type): + * cdef list axes = obj._data.axes # <<<<<<<<<<<<<< + * return axes[self.axis] + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_axes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_axes = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/properties.pyx":62 + * def __get__(self, obj, type): + * cdef list axes = obj._data.axes + * return axes[self.axis] # <<<<<<<<<<<<<< + * + * def __set__(self, obj, value): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_axes == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_axes, __pyx_v_self->axis, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/properties.pyx":60 + * self.axis = axis + * + * def __get__(self, obj, type): # <<<<<<<<<<<<<< + * cdef list axes = obj._data.axes + * return axes[self.axis] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.AxisProperty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_axes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/properties.pyx":64 + * return axes[self.axis] + * + * def __set__(self, obj, value): # <<<<<<<<<<<<<< + * obj._set_axis(self.axis, value) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_3lib_12AxisProperty_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_3lib_12AxisProperty_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_12AxisProperty_4__set__(((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_3lib_12AxisProperty_4__set__(struct __pyx_obj_6pandas_3lib_AxisProperty *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "pandas/src/properties.pyx":65 + * + * def __set__(self, obj, value): + * obj._set_axis(self.axis, value) # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_set_axis); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->axis); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/properties.pyx":64 + * return axes[self.axis] + * + * def __set__(self, obj, value): # <<<<<<<<<<<<<< + * obj._set_axis(self.axis, value) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.AxisProperty.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":7 + * + * # core.common import for fast inference checks + * def is_float(object obj): # <<<<<<<<<<<<<< + * return util.is_float_object(obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_122is_float(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_122is_float = {__Pyx_NAMESTR("is_float"), (PyCFunction)__pyx_pw_6pandas_3lib_122is_float, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_122is_float(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_float (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_121is_float(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_121is_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_float", 0); + + /* "pandas/src/inference.pyx":8 + * # core.common import for fast inference checks + * def is_float(object obj): + * return util.is_float_object(obj) # <<<<<<<<<<<<<< + * + * def is_integer(object obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_float_object(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":7 + * + * # core.common import for fast inference checks + * def is_float(object obj): # <<<<<<<<<<<<<< + * return util.is_float_object(obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_float", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":10 + * return util.is_float_object(obj) + * + * def is_integer(object obj): # <<<<<<<<<<<<<< + * return util.is_integer_object(obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_124is_integer(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_124is_integer = {__Pyx_NAMESTR("is_integer"), (PyCFunction)__pyx_pw_6pandas_3lib_124is_integer, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_124is_integer(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_integer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_123is_integer(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_123is_integer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_integer", 0); + + /* "pandas/src/inference.pyx":11 + * + * def is_integer(object obj): + * return util.is_integer_object(obj) # <<<<<<<<<<<<<< + * + * def is_bool(object obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_integer_object(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":10 + * return util.is_float_object(obj) + * + * def is_integer(object obj): # <<<<<<<<<<<<<< + * return util.is_integer_object(obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":13 + * return util.is_integer_object(obj) + * + * def is_bool(object obj): # <<<<<<<<<<<<<< + * return util.is_bool_object(obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_126is_bool(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_126is_bool = {__Pyx_NAMESTR("is_bool"), (PyCFunction)__pyx_pw_6pandas_3lib_126is_bool, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_126is_bool(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_bool (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_125is_bool(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_125is_bool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_bool", 0); + + /* "pandas/src/inference.pyx":14 + * + * def is_bool(object obj): + * return util.is_bool_object(obj) # <<<<<<<<<<<<<< + * + * def is_complex(object obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_bool_object(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":13 + * return util.is_integer_object(obj) + * + * def is_bool(object obj): # <<<<<<<<<<<<<< + * return util.is_bool_object(obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":16 + * return util.is_bool_object(obj) + * + * def is_complex(object obj): # <<<<<<<<<<<<<< + * return util.is_complex_object(obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_128is_complex(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_128is_complex = {__Pyx_NAMESTR("is_complex"), (PyCFunction)__pyx_pw_6pandas_3lib_128is_complex, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_128is_complex(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_complex (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_127is_complex(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_127is_complex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_complex", 0); + + /* "pandas/src/inference.pyx":17 + * + * def is_complex(object obj): + * return util.is_complex_object(obj) # <<<<<<<<<<<<<< + * + * _TYPE_MAP = { + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_complex_object(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":16 + * return util.is_bool_object(obj) + * + * def is_complex(object obj): # <<<<<<<<<<<<<< + * return util.is_complex_object(obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_complex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":64 + * pass + * + * def infer_dtype(object _values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_130infer_dtype(PyObject *__pyx_self, PyObject *__pyx_v__values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_130infer_dtype = {__Pyx_NAMESTR("infer_dtype"), (PyCFunction)__pyx_pw_6pandas_3lib_130infer_dtype, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_130infer_dtype(PyObject *__pyx_self, PyObject *__pyx_v__values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("infer_dtype (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_129infer_dtype(__pyx_self, ((PyObject *)__pyx_v__values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_129infer_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_val_name = NULL; + PyObject *__pyx_v_val_kind = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("infer_dtype", 0); + __Pyx_INCREF(__pyx_v__values); + + /* "pandas/src/inference.pyx":70 + * ndarray values + * + * if isinstance(_values, np.ndarray): # <<<<<<<<<<<<<< + * values = _values + * elif hasattr(_values,'values'): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v__values, ((PyObject*)__pyx_ptype_5numpy_ndarray)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":71 + * + * if isinstance(_values, np.ndarray): + * values = _values # <<<<<<<<<<<<<< + * elif hasattr(_values,'values'): + * values = _values.values + */ + if (!(likely(((__pyx_v__values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v__values; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_values = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + + /* "pandas/src/inference.pyx":72 + * if isinstance(_values, np.ndarray): + * values = _values + * elif hasattr(_values,'values'): # <<<<<<<<<<<<<< + * values = _values.values + * else: + */ + __pyx_t_2 = PyObject_HasAttr(__pyx_v__values, __pyx_n_s_values); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":73 + * values = _values + * elif hasattr(_values,'values'): + * values = _values.values # <<<<<<<<<<<<<< + * else: + * if not isinstance(_values, list): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__values, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_values = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/inference.pyx":75 + * values = _values.values + * else: + * if not isinstance(_values, list): # <<<<<<<<<<<<<< + * _values = list(_values) + * values = list_to_object_array(_values) + */ + __pyx_t_1 = PyList_Check(__pyx_v__values); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":76 + * else: + * if not isinstance(_values, list): + * _values = list(_values) # <<<<<<<<<<<<<< + * values = list_to_object_array(_values) + * + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__values); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__values); + __Pyx_GIVEREF(__pyx_v__values); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v__values, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":77 + * if not isinstance(_values, list): + * _values = list(_values) + * values = list_to_object_array(_values) # <<<<<<<<<<<<<< + * + * values = getattr(values, 'values', values) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_to_object_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__values); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__values); + __Pyx_GIVEREF(__pyx_v__values); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_values = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L3:; + + /* "pandas/src/inference.pyx":79 + * values = list_to_object_array(_values) + * + * values = getattr(values, 'values', values) # <<<<<<<<<<<<<< + * + * val_name = values.dtype.name + */ + __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_values), __pyx_n_s_values, ((PyObject *)__pyx_v_values)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":81 + * values = getattr(values, 'values', values) + * + * val_name = values.dtype.name # <<<<<<<<<<<<<< + * if val_name in _TYPE_MAP: + * return _TYPE_MAP[val_name] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_val_name = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":82 + * + * val_name = values.dtype.name + * if val_name in _TYPE_MAP: # <<<<<<<<<<<<<< + * return _TYPE_MAP[val_name] + * val_kind = values.dtype.kind + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_val_name, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":83 + * val_name = values.dtype.name + * if val_name in _TYPE_MAP: + * return _TYPE_MAP[val_name] # <<<<<<<<<<<<<< + * val_kind = values.dtype.kind + * if val_kind in _TYPE_MAP: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetItem(__pyx_t_3, __pyx_v_val_name); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":84 + * if val_name in _TYPE_MAP: + * return _TYPE_MAP[val_name] + * val_kind = values.dtype.kind # <<<<<<<<<<<<<< + * if val_kind in _TYPE_MAP: + * return _TYPE_MAP[val_kind] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_val_kind = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":85 + * return _TYPE_MAP[val_name] + * val_kind = values.dtype.kind + * if val_kind in _TYPE_MAP: # <<<<<<<<<<<<<< + * return _TYPE_MAP[val_kind] + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_val_kind, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":86 + * val_kind = values.dtype.kind + * if val_kind in _TYPE_MAP: + * return _TYPE_MAP[val_kind] # <<<<<<<<<<<<<< + * + * if values.dtype != np.object_: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetItem(__pyx_t_3, __pyx_v_val_kind); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":88 + * return _TYPE_MAP[val_kind] + * + * if values.dtype != np.object_: # <<<<<<<<<<<<<< + * values = values.astype('O') + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":89 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/src/inference.pyx":91 + * values = values.astype('O') + * + * n = len(values) # <<<<<<<<<<<<<< + * if n == 0: + * return 'empty' + */ + __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_6; + + /* "pandas/src/inference.pyx":92 + * + * n = len(values) + * if n == 0: # <<<<<<<<<<<<<< + * return 'empty' + * + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":93 + * n = len(values) + * if n == 0: + * return 'empty' # <<<<<<<<<<<<<< + * + * # make contiguous + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_empty); + __pyx_r = __pyx_n_s_empty; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":96 + * + * # make contiguous + * values = values.ravel() # <<<<<<<<<<<<<< + * + * # try to use a valid value + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_values, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":99 + * + * # try to use a valid value + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(values, i) + * if not is_null_datetimelike(val): + */ + __pyx_t_6 = __pyx_v_n; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/inference.pyx":100 + * # try to use a valid value + * for i in range(n): + * val = util.get_value_1d(values, i) # <<<<<<<<<<<<<< + * if not is_null_datetimelike(val): + * break + */ + __pyx_t_3 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":101 + * for i in range(n): + * val = util.get_value_1d(values, i) + * if not is_null_datetimelike(val): # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_val) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":102 + * val = util.get_value_1d(values, i) + * if not is_null_datetimelike(val): + * break # <<<<<<<<<<<<<< + * + * if util.is_datetime64_object(val) or val is NaT: + */ + goto __pyx_L10_break; + } + } + __pyx_L10_break:; + + /* "pandas/src/inference.pyx":104 + * break + * + * if util.is_datetime64_object(val) or val is NaT: # <<<<<<<<<<<<<< + * if is_datetime64_array(values): + * return 'datetime64' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (!(is_datetime64_object(__pyx_v_val) != 0)) { + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__pyx_v_val == __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_2; + } else { + __pyx_t_1 = (is_datetime64_object(__pyx_v_val) != 0); + } + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":105 + * + * if util.is_datetime64_object(val) or val is NaT: + * if is_datetime64_array(values): # <<<<<<<<<<<<<< + * return 'datetime64' + * elif is_timedelta_or_timedelta64_array(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_datetime64_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":106 + * if util.is_datetime64_object(val) or val is NaT: + * if is_datetime64_array(values): + * return 'datetime64' # <<<<<<<<<<<<<< + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_datetime64); + __pyx_r = __pyx_n_s_datetime64; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":107 + * if is_datetime64_array(values): + * return 'datetime64' + * elif is_timedelta_or_timedelta64_array(values): # <<<<<<<<<<<<<< + * return 'timedelta' + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_timedelta_or_timedelta64_arra); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":108 + * return 'datetime64' + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' # <<<<<<<<<<<<<< + * + * elif util.is_integer_object(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_timedelta); + __pyx_r = __pyx_n_s_timedelta; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":110 + * return 'timedelta' + * + * elif util.is_integer_object(val): # <<<<<<<<<<<<<< + * # a timedelta will show true here as well + * if is_timedelta(val): + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (is_integer_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":112 + * elif util.is_integer_object(val): + * # a timedelta will show true here as well + * if is_timedelta(val): # <<<<<<<<<<<<<< + * if is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":113 + * # a timedelta will show true here as well + * if is_timedelta(val): + * if is_timedelta_or_timedelta64_array(values): # <<<<<<<<<<<<<< + * return 'timedelta' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_timedelta_or_timedelta64_arra); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":114 + * if is_timedelta(val): + * if is_timedelta_or_timedelta64_array(values): + * return 'timedelta' # <<<<<<<<<<<<<< + * + * if is_integer_array(values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_timedelta); + __pyx_r = __pyx_n_s_timedelta; + goto __pyx_L0; + } + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/src/inference.pyx":116 + * return 'timedelta' + * + * if is_integer_array(values): # <<<<<<<<<<<<<< + * return 'integer' + * elif is_integer_float_array(values): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_integer_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":117 + * + * if is_integer_array(values): + * return 'integer' # <<<<<<<<<<<<<< + * elif is_integer_float_array(values): + * return 'mixed-integer-float' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_integer); + __pyx_r = __pyx_n_s_integer; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":118 + * if is_integer_array(values): + * return 'integer' + * elif is_integer_float_array(values): # <<<<<<<<<<<<<< + * return 'mixed-integer-float' + * elif is_timedelta_or_timedelta64_array(values): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_integer_float_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":119 + * return 'integer' + * elif is_integer_float_array(values): + * return 'mixed-integer-float' # <<<<<<<<<<<<<< + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_mixed_integer_float); + __pyx_r = __pyx_kp_s_mixed_integer_float; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":120 + * elif is_integer_float_array(values): + * return 'mixed-integer-float' + * elif is_timedelta_or_timedelta64_array(values): # <<<<<<<<<<<<<< + * return 'timedelta' + * return 'mixed-integer' + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_timedelta_or_timedelta64_arra); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":121 + * return 'mixed-integer-float' + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' # <<<<<<<<<<<<<< + * return 'mixed-integer' + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_timedelta); + __pyx_r = __pyx_n_s_timedelta; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":122 + * elif is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + * return 'mixed-integer' # <<<<<<<<<<<<<< + * + * elif is_datetime(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_mixed_integer); + __pyx_r = __pyx_kp_s_mixed_integer; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":124 + * return 'mixed-integer' + * + * elif is_datetime(val): # <<<<<<<<<<<<<< + * if is_datetime_array(values): + * return 'datetime' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_datetime(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":125 + * + * elif is_datetime(val): + * if is_datetime_array(values): # <<<<<<<<<<<<<< + * return 'datetime' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_datetime_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":126 + * elif is_datetime(val): + * if is_datetime_array(values): + * return 'datetime' # <<<<<<<<<<<<<< + * + * elif is_date(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_datetime); + __pyx_r = __pyx_n_s_datetime; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":128 + * return 'datetime' + * + * elif is_date(val): # <<<<<<<<<<<<<< + * if is_date_array(values): + * return 'date' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_date(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":129 + * + * elif is_date(val): + * if is_date_array(values): # <<<<<<<<<<<<<< + * return 'date' + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_date_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":130 + * elif is_date(val): + * if is_date_array(values): + * return 'date' # <<<<<<<<<<<<<< + * + * elif is_time(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_date); + __pyx_r = __pyx_n_s_date; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":132 + * return 'date' + * + * elif is_time(val): # <<<<<<<<<<<<<< + * if is_time_array(values): + * return 'time' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_time(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":133 + * + * elif is_time(val): + * if is_time_array(values): # <<<<<<<<<<<<<< + * return 'time' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_time_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":134 + * elif is_time(val): + * if is_time_array(values): + * return 'time' # <<<<<<<<<<<<<< + * + * elif util.is_float_object(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_time); + __pyx_r = __pyx_n_s_time; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":136 + * return 'time' + * + * elif util.is_float_object(val): # <<<<<<<<<<<<<< + * if is_float_array(values): + * return 'floating' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (is_float_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":137 + * + * elif util.is_float_object(val): + * if is_float_array(values): # <<<<<<<<<<<<<< + * return 'floating' + * elif is_integer_float_array(values): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_float_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":138 + * elif util.is_float_object(val): + * if is_float_array(values): + * return 'floating' # <<<<<<<<<<<<<< + * elif is_integer_float_array(values): + * return 'mixed-integer-float' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_floating); + __pyx_r = __pyx_n_s_floating; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":139 + * if is_float_array(values): + * return 'floating' + * elif is_integer_float_array(values): # <<<<<<<<<<<<<< + * return 'mixed-integer-float' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_integer_float_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":140 + * return 'floating' + * elif is_integer_float_array(values): + * return 'mixed-integer-float' # <<<<<<<<<<<<<< + * + * elif util.is_bool_object(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_mixed_integer_float); + __pyx_r = __pyx_kp_s_mixed_integer_float; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":142 + * return 'mixed-integer-float' + * + * elif util.is_bool_object(val): # <<<<<<<<<<<<<< + * if is_bool_array(values): + * return 'boolean' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (is_bool_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":143 + * + * elif util.is_bool_object(val): + * if is_bool_array(values): # <<<<<<<<<<<<<< + * return 'boolean' + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_bool_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":144 + * elif util.is_bool_object(val): + * if is_bool_array(values): + * return 'boolean' # <<<<<<<<<<<<<< + * + * elif PyString_Check(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_boolean); + __pyx_r = __pyx_n_s_boolean; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":146 + * return 'boolean' + * + * elif PyString_Check(val): # <<<<<<<<<<<<<< + * if is_string_array(values): + * return 'string' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (PyString_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":147 + * + * elif PyString_Check(val): + * if is_string_array(values): # <<<<<<<<<<<<<< + * return 'string' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_string_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":148 + * elif PyString_Check(val): + * if is_string_array(values): + * return 'string' # <<<<<<<<<<<<<< + * + * elif PyUnicode_Check(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_string); + __pyx_r = __pyx_n_s_string; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":150 + * return 'string' + * + * elif PyUnicode_Check(val): # <<<<<<<<<<<<<< + * if is_unicode_array(values): + * return 'unicode' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":151 + * + * elif PyUnicode_Check(val): + * if is_unicode_array(values): # <<<<<<<<<<<<<< + * return 'unicode' + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_unicode_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":152 + * elif PyUnicode_Check(val): + * if is_unicode_array(values): + * return 'unicode' # <<<<<<<<<<<<<< + * + * elif is_timedelta(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_unicode); + __pyx_r = __pyx_n_s_unicode; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":154 + * return 'unicode' + * + * elif is_timedelta(val): # <<<<<<<<<<<<<< + * if is_timedelta_or_timedelta64_array(values): + * return 'timedelta' + */ + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = (__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":155 + * + * elif is_timedelta(val): + * if is_timedelta_or_timedelta64_array(values): # <<<<<<<<<<<<<< + * return 'timedelta' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_timedelta_or_timedelta64_arra); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":156 + * elif is_timedelta(val): + * if is_timedelta_or_timedelta64_array(values): + * return 'timedelta' # <<<<<<<<<<<<<< + * + * elif is_period(val): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_timedelta); + __pyx_r = __pyx_n_s_timedelta; + goto __pyx_L0; + } + goto __pyx_L12; + } + + /* "pandas/src/inference.pyx":158 + * return 'timedelta' + * + * elif is_period(val): # <<<<<<<<<<<<<< + * if is_period_array(values): + * return 'period' + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_period); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_v_val)) { __Pyx_RaiseUnboundLocalError("val"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":159 + * + * elif is_period(val): + * if is_period_array(values): # <<<<<<<<<<<<<< + * return 'period' + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_period_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":160 + * elif is_period(val): + * if is_period_array(values): + * return 'period' # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_period); + __pyx_r = __pyx_n_s_period; + goto __pyx_L0; + } + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/inference.pyx":162 + * return 'period' + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(values, i) + * if util.is_integer_object(val): + */ + __pyx_t_6 = __pyx_v_n; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/src/inference.pyx":163 + * + * for i in range(n): + * val = util.get_value_1d(values, i) # <<<<<<<<<<<<<< + * if util.is_integer_object(val): + * return 'mixed-integer' + */ + __pyx_t_5 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":164 + * for i in range(n): + * val = util.get_value_1d(values, i) + * if util.is_integer_object(val): # <<<<<<<<<<<<<< + * return 'mixed-integer' + * + */ + __pyx_t_1 = (is_integer_object(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":165 + * val = util.get_value_1d(values, i) + * if util.is_integer_object(val): + * return 'mixed-integer' # <<<<<<<<<<<<<< + * + * return 'mixed' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_mixed_integer); + __pyx_r = __pyx_kp_s_mixed_integer; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":167 + * return 'mixed-integer' + * + * return 'mixed' # <<<<<<<<<<<<<< + * + * def infer_dtype_list(list values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_mixed); + __pyx_r = __pyx_n_s_mixed; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":64 + * pass + * + * def infer_dtype(object _values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_values); + __Pyx_XDECREF(__pyx_v_val_name); + __Pyx_XDECREF(__pyx_v_val_kind); + __Pyx_XDECREF(__pyx_v__values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":169 + * return 'mixed' + * + * def infer_dtype_list(list values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_132infer_dtype_list(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_132infer_dtype_list = {__Pyx_NAMESTR("infer_dtype_list"), (PyCFunction)__pyx_pw_6pandas_3lib_132infer_dtype_list, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_132infer_dtype_list(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("infer_dtype_list (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PyList_Type), 1, "values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_131infer_dtype_list(__pyx_self, ((PyObject*)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_131infer_dtype_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED Py_ssize_t __pyx_v_n; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("infer_dtype_list", 0); + + /* "pandas/src/inference.pyx":171 + * def infer_dtype_list(list values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * pass + * + */ + if (unlikely(__pyx_v_values == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":169 + * return 'mixed' + * + * def infer_dtype_list(list values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.lib.infer_dtype_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":175 + * + * + * def is_possible_datetimelike_array(object arr): # <<<<<<<<<<<<<< + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_134is_possible_datetimelike_array(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_134is_possible_datetimelike_array = {__Pyx_NAMESTR("is_possible_datetimelike_array"), (PyCFunction)__pyx_pw_6pandas_3lib_134is_possible_datetimelike_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_134is_possible_datetimelike_array(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_possible_datetimelike_array (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_133is_possible_datetimelike_array(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_133is_possible_datetimelike_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + int __pyx_v_seen_timedelta; + int __pyx_v_seen_datetime; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_possible_datetimelike_array", 0); + + /* "pandas/src/inference.pyx":178 + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * bint seen_timedelta = 0, seen_datetime = 0 + * object v + */ + __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":179 + * cdef: + * Py_ssize_t i, n = len(arr) + * bint seen_timedelta = 0, seen_datetime = 0 # <<<<<<<<<<<<<< + * object v + * + */ + __pyx_v_seen_timedelta = 0; + __pyx_v_seen_datetime = 0; + + /* "pandas/src/inference.pyx":182 + * object v + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = arr[i] + * if util.is_string_object(v): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/src/inference.pyx":183 + * + * for i in range(n): + * v = arr[i] # <<<<<<<<<<<<<< + * if util.is_string_object(v): + * continue + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":184 + * for i in range(n): + * v = arr[i] + * if util.is_string_object(v): # <<<<<<<<<<<<<< + * continue + * elif util._checknull(v): + */ + __pyx_t_4 = (is_string_object(__pyx_v_v) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":185 + * v = arr[i] + * if util.is_string_object(v): + * continue # <<<<<<<<<<<<<< + * elif util._checknull(v): + * continue + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/inference.pyx":186 + * if util.is_string_object(v): + * continue + * elif util._checknull(v): # <<<<<<<<<<<<<< + * continue + * elif is_datetime(v): + */ + __pyx_t_4 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":187 + * continue + * elif util._checknull(v): + * continue # <<<<<<<<<<<<<< + * elif is_datetime(v): + * seen_datetime=1 + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/inference.pyx":188 + * elif util._checknull(v): + * continue + * elif is_datetime(v): # <<<<<<<<<<<<<< + * seen_datetime=1 + * elif is_timedelta(v): + */ + __pyx_t_4 = (__pyx_f_6pandas_3lib_is_datetime(__pyx_v_v) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":189 + * continue + * elif is_datetime(v): + * seen_datetime=1 # <<<<<<<<<<<<<< + * elif is_timedelta(v): + * seen_timedelta=1 + */ + __pyx_v_seen_datetime = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":190 + * elif is_datetime(v): + * seen_datetime=1 + * elif is_timedelta(v): # <<<<<<<<<<<<<< + * seen_timedelta=1 + * else: + */ + __pyx_t_4 = (__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_v) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":191 + * seen_datetime=1 + * elif is_timedelta(v): + * seen_timedelta=1 # <<<<<<<<<<<<<< + * else: + * return False + */ + __pyx_v_seen_timedelta = 1; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/inference.pyx":193 + * seen_timedelta=1 + * else: + * return False # <<<<<<<<<<<<<< + * return seen_datetime or seen_timedelta + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L5:; + __pyx_L3_continue:; + } + + /* "pandas/src/inference.pyx":194 + * else: + * return False + * return seen_datetime or seen_timedelta # <<<<<<<<<<<<<< + * + * cdef inline bint is_null_datetimelike(v): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_seen_datetime) { + __pyx_t_4 = __pyx_v_seen_timedelta; + } else { + __pyx_t_4 = __pyx_v_seen_datetime; + } + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":175 + * + * + * def is_possible_datetimelike_array(object arr): # <<<<<<<<<<<<<< + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.is_possible_datetimelike_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":196 + * return seen_datetime or seen_timedelta + * + * cdef inline bint is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # determine if we have a null for a timedelta/datetime (or integer versions)x + * if util._checknull(v): + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_null_datetimelike(PyObject *__pyx_v_v) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_null_datetimelike", 0); + + /* "pandas/src/inference.pyx":198 + * cdef inline bint is_null_datetimelike(v): + * # determine if we have a null for a timedelta/datetime (or integer versions)x + * if util._checknull(v): # <<<<<<<<<<<<<< + * return True + * elif util.is_timedelta64_object(v): + */ + __pyx_t_1 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":199 + * # determine if we have a null for a timedelta/datetime (or integer versions)x + * if util._checknull(v): + * return True # <<<<<<<<<<<<<< + * elif util.is_timedelta64_object(v): + * return v.view('int64') == iNaT + */ + __pyx_r = 1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":200 + * if util._checknull(v): + * return True + * elif util.is_timedelta64_object(v): # <<<<<<<<<<<<<< + * return v.view('int64') == iNaT + * elif util.is_datetime64_object(v): + */ + __pyx_t_1 = (is_timedelta64_object(__pyx_v_v) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":201 + * return True + * elif util.is_timedelta64_object(v): + * return v.view('int64') == iNaT # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":202 + * elif util.is_timedelta64_object(v): + * return v.view('int64') == iNaT + * elif util.is_datetime64_object(v): # <<<<<<<<<<<<<< + * return v.view('int64') == iNaT + * elif util.is_integer_object(v): + */ + __pyx_t_1 = (is_datetime64_object(__pyx_v_v) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":203 + * return v.view('int64') == iNaT + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT # <<<<<<<<<<<<<< + * elif util.is_integer_object(v): + * return v == iNaT + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":204 + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT + * elif util.is_integer_object(v): # <<<<<<<<<<<<<< + * return v == iNaT + * elif v is NaT: + */ + __pyx_t_1 = (is_integer_object(__pyx_v_v) != 0); + if (__pyx_t_1) { + + /* "pandas/src/inference.pyx":205 + * return v.view('int64') == iNaT + * elif util.is_integer_object(v): + * return v == iNaT # <<<<<<<<<<<<<< + * elif v is NaT: + * return True + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_v, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":206 + * elif util.is_integer_object(v): + * return v == iNaT + * elif v is NaT: # <<<<<<<<<<<<<< + * return True + * return False + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = (__pyx_v_v == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + /* "pandas/src/inference.pyx":207 + * return v == iNaT + * elif v is NaT: + * return True # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_r = 1; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":208 + * elif v is NaT: + * return True + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint is_datetime(object o): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":196 + * return seen_datetime or seen_timedelta + * + * cdef inline bint is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # determine if we have a null for a timedelta/datetime (or integer versions)x + * if util._checknull(v): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.lib.is_null_datetimelike", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":210 + * return False + * + * cdef inline bint is_datetime(object o): # <<<<<<<<<<<<<< + * return PyDateTime_Check(o) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_datetime(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime", 0); + + /* "pandas/src/inference.pyx":211 + * + * cdef inline bint is_datetime(object o): + * return PyDateTime_Check(o) # <<<<<<<<<<<<<< + * + * cdef inline bint is_date(object o): + */ + __pyx_r = PyDateTime_Check(__pyx_v_o); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":210 + * return False + * + * cdef inline bint is_datetime(object o): # <<<<<<<<<<<<<< + * return PyDateTime_Check(o) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":213 + * return PyDateTime_Check(o) + * + * cdef inline bint is_date(object o): # <<<<<<<<<<<<<< + * return PyDate_Check(o) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_date(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_date", 0); + + /* "pandas/src/inference.pyx":214 + * + * cdef inline bint is_date(object o): + * return PyDate_Check(o) # <<<<<<<<<<<<<< + * + * cdef inline bint is_time(object o): + */ + __pyx_r = PyDate_Check(__pyx_v_o); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":213 + * return PyDateTime_Check(o) + * + * cdef inline bint is_date(object o): # <<<<<<<<<<<<<< + * return PyDate_Check(o) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":216 + * return PyDate_Check(o) + * + * cdef inline bint is_time(object o): # <<<<<<<<<<<<<< + * return PyTime_Check(o) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_time(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_time", 0); + + /* "pandas/src/inference.pyx":217 + * + * cdef inline bint is_time(object o): + * return PyTime_Check(o) # <<<<<<<<<<<<<< + * + * cdef inline bint is_timedelta(object o): + */ + __pyx_r = PyTime_Check(__pyx_v_o); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":216 + * return PyDate_Check(o) + * + * cdef inline bint is_time(object o): # <<<<<<<<<<<<<< + * return PyTime_Check(o) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":219 + * return PyTime_Check(o) + * + * cdef inline bint is_timedelta(object o): # <<<<<<<<<<<<<< + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_timedelta(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta", 0); + + /* "pandas/src/inference.pyx":220 + * + * cdef inline bint is_timedelta(object o): + * return PyDelta_Check(o) or util.is_timedelta64_object(o) # <<<<<<<<<<<<<< + * + * def is_bool_array(ndarray values): + */ + __pyx_t_1 = __Pyx_PyBool_FromLong(PyDelta_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_From_int(is_timedelta64_object(__pyx_v_o)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":219 + * return PyTime_Check(o) + * + * cdef inline bint is_timedelta(object o): # <<<<<<<<<<<<<< + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.lib.is_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":222 + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + * def is_bool_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_136is_bool_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_136is_bool_array = {__Pyx_NAMESTR("is_bool_array"), (PyCFunction)__pyx_pw_6pandas_3lib_136is_bool_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_136is_bool_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_bool_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_135is_bool_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_135is_bool_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_bool_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":224 + * def is_bool_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":228 + * object obj + * + * if issubclass(values.dtype.type, np.bool_): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":229 + * + * if issubclass(values.dtype.type, np.bool_): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":230 + * if issubclass(values.dtype.type, np.bool_): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":231 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":233 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":234 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":236 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not util.is_bool_object(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":237 + * + * for i in range(n): + * if not util.is_bool_object(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = ((!(is_bool_object(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":238 + * for i in range(n): + * if not util.is_bool_object(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":239 + * if not util.is_bool_object(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":241 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_integer(object o): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":222 + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + * def is_bool_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_bool_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":243 + * return False + * + * def is_integer(object o): # <<<<<<<<<<<<<< + * return util.is_integer_object(o) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_138is_integer(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_138is_integer = {__Pyx_NAMESTR("is_integer"), (PyCFunction)__pyx_pw_6pandas_3lib_138is_integer, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_138is_integer(PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_integer (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_137is_integer(__pyx_self, ((PyObject *)__pyx_v_o)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_137is_integer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_integer", 0); + + /* "pandas/src/inference.pyx":244 + * + * def is_integer(object o): + * return util.is_integer_object(o) # <<<<<<<<<<<<<< + * + * def is_integer_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_integer_object(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":243 + * return False + * + * def is_integer(object o): # <<<<<<<<<<<<<< + * return util.is_integer_object(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.lib.is_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":246 + * return util.is_integer_object(o) + * + * def is_integer_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_140is_integer_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_140is_integer_array = {__Pyx_NAMESTR("is_integer_array"), (PyCFunction)__pyx_pw_6pandas_3lib_140is_integer_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_140is_integer_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_integer_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_139is_integer_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_139is_integer_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_integer_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":248 + * def is_integer_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":252 + * object obj + * + * if issubclass(values.dtype.type, np.integer): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":253 + * + * if issubclass(values.dtype.type, np.integer): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":254 + * if issubclass(values.dtype.type, np.integer): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":255 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":257 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":258 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":260 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not util.is_integer_object(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":261 + * + * for i in range(n): + * if not util.is_integer_object(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = ((!(is_integer_object(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":262 + * for i in range(n): + * if not util.is_integer_object(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":263 + * if not util.is_integer_object(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":265 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_integer_float_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":246 + * return util.is_integer_object(o) + * + * def is_integer_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_integer_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":267 + * return False + * + * def is_integer_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_142is_integer_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_142is_integer_float_array = {__Pyx_NAMESTR("is_integer_float_array"), (PyCFunction)__pyx_pw_6pandas_3lib_142is_integer_float_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_142is_integer_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_integer_float_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_141is_integer_float_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_141is_integer_float_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_integer_float_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":269 + * def is_integer_float_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":273 + * object obj + * + * if issubclass(values.dtype.type, np.integer): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":274 + * + * if issubclass(values.dtype.type, np.integer): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":275 + * if issubclass(values.dtype.type, np.integer): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":276 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":278 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":279 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":281 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not (util.is_integer_object(objbuf[i]) or + * util.is_float_object(objbuf[i])): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":282 + * + * for i in range(n): + * if not (util.is_integer_object(objbuf[i]) or # <<<<<<<<<<<<<< + * util.is_float_object(objbuf[i])): + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = (is_integer_object(__pyx_t_3) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) { + + /* "pandas/src/inference.pyx":283 + * for i in range(n): + * if not (util.is_integer_object(objbuf[i]) or + * util.is_float_object(objbuf[i])): # <<<<<<<<<<<<<< + * + * return False + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_5 = (is_float_object(__pyx_t_3) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_14 = __pyx_t_5; + } else { + __pyx_t_14 = __pyx_t_6; + } + + /* "pandas/src/inference.pyx":282 + * + * for i in range(n): + * if not (util.is_integer_object(objbuf[i]) or # <<<<<<<<<<<<<< + * util.is_float_object(objbuf[i])): + * + */ + __pyx_t_6 = ((!__pyx_t_14) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":285 + * util.is_float_object(objbuf[i])): + * + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":286 + * + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":288 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_float_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":267 + * return False + * + * def is_integer_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_integer_float_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":290 + * return False + * + * def is_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_144is_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_144is_float_array = {__Pyx_NAMESTR("is_float_array"), (PyCFunction)__pyx_pw_6pandas_3lib_144is_float_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_144is_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_float_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_143is_float_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_143is_float_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_float_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":292 + * def is_float_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":296 + * object obj + * + * if issubclass(values.dtype.type, np.floating): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_floating); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":297 + * + * if issubclass(values.dtype.type, np.floating): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":298 + * if issubclass(values.dtype.type, np.floating): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":299 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":301 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":302 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":304 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not util.is_float_object(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":305 + * + * for i in range(n): + * if not util.is_float_object(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = ((!(is_float_object(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":306 + * for i in range(n): + * if not util.is_float_object(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":307 + * if not util.is_float_object(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":309 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_string_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":290 + * return False + * + * def is_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_float_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":311 + * return False + * + * def is_string_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_146is_string_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_146is_string_array = {__Pyx_NAMESTR("is_string_array"), (PyCFunction)__pyx_pw_6pandas_3lib_146is_string_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_146is_string_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_string_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_145is_string_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_145is_string_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_string_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":313 + * def is_string_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":317 + * object obj + * + * if issubclass(values.dtype.type, (np.string_, np.unicode_)): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_string_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unicode_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":318 + * + * if issubclass(values.dtype.type, (np.string_, np.unicode_)): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":319 + * if issubclass(values.dtype.type, (np.string_, np.unicode_)): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":320 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":322 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_7 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":323 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":325 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not PyString_Check(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/inference.pyx":326 + * + * for i in range(n): + * if not PyString_Check(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_7 = ((!(PyString_Check(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":327 + * for i in range(n): + * if not PyString_Check(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":328 + * if not PyString_Check(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":330 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def is_unicode_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":311 + * return False + * + * def is_string_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_string_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":332 + * return False + * + * def is_unicode_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_148is_unicode_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_148is_unicode_array = {__Pyx_NAMESTR("is_unicode_array"), (PyCFunction)__pyx_pw_6pandas_3lib_148is_unicode_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_148is_unicode_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_unicode_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_147is_unicode_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_147is_unicode_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_objbuf = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objbuf; + __Pyx_Buffer __pyx_pybuffer_objbuf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_unicode_array", 0); + __pyx_pybuffer_objbuf.pybuffer.buf = NULL; + __pyx_pybuffer_objbuf.refcount = 0; + __pyx_pybuffernd_objbuf.data = NULL; + __pyx_pybuffernd_objbuf.rcbuffer = &__pyx_pybuffer_objbuf; + + /* "pandas/src/inference.pyx":334 + * def is_unicode_array(ndarray values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[object] objbuf + * object obj + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":338 + * object obj + * + * if issubclass(values.dtype.type, np.unicode_): # <<<<<<<<<<<<<< + * return True + * elif values.dtype == np.object_: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unicode_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":339 + * + * if issubclass(values.dtype.type, np.unicode_): + * return True # <<<<<<<<<<<<<< + * elif values.dtype == np.object_: + * objbuf = values + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":340 + * if issubclass(values.dtype.type, np.unicode_): + * return True + * elif values.dtype == np.object_: # <<<<<<<<<<<<<< + * objbuf = values + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_values), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":341 + * return True + * elif values.dtype == np.object_: + * objbuf = values # <<<<<<<<<<<<<< + * + * if n == 0: + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_objbuf.diminfo[0].strides = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objbuf.diminfo[0].shape = __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values); + + /* "pandas/src/inference.pyx":343 + * objbuf = values + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_6 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":344 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":346 + * return False + * + * for i in range(n): # <<<<<<<<<<<<<< + * if not PyUnicode_Check(objbuf[i]): + * return False + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":347 + * + * for i in range(n): + * if not PyUnicode_Check(objbuf[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_objbuf.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_objbuf.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objbuf.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_objbuf.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_6 = ((!(PyUnicode_Check(__pyx_t_3) != 0)) != 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":348 + * for i in range(n): + * if not PyUnicode_Check(objbuf[i]): + * return False # <<<<<<<<<<<<<< + * return True + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":349 + * if not PyUnicode_Check(objbuf[i]): + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":351 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":332 + * return False + * + * def is_unicode_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_unicode_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objbuf.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_objbuf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":354 + * + * + * def is_datetime_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_150is_datetime_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_150is_datetime_array = {__Pyx_NAMESTR("is_datetime_array"), (PyCFunction)__pyx_pw_6pandas_3lib_150is_datetime_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_150is_datetime_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_149is_datetime_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_149is_datetime_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_datetime_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":355 + * + * def is_datetime_array(ndarray[object] values): + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":357 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":358 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * # return False for all nulls + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":361 + * + * # return False for all nulls + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":362 + * # return False for all nulls + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":363 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":365 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not is_datetime(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":366 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not is_datetime(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":367 + * if util._checknull(v): + * null_count += 1 + * elif not is_datetime(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_datetime(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":368 + * null_count += 1 + * elif not is_datetime(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":369 + * elif not is_datetime(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_datetime64_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":354 + * + * + * def is_datetime_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_datetime_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":371 + * return null_count != n + * + * def is_datetime64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_152is_datetime64_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_152is_datetime64_array = {__Pyx_NAMESTR("is_datetime64_array"), (PyCFunction)__pyx_pw_6pandas_3lib_152is_datetime64_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_152is_datetime64_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_151is_datetime64_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_151is_datetime64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_datetime64_array", 0); + + /* "pandas/src/inference.pyx":372 + * + * def is_datetime64_array(ndarray values): + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":374 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":375 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * + * # return False for all nulls + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":378 + * + * # return False for all nulls + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":379 + * # return False for all nulls + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_values), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":380 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":382 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not util.is_datetime64_object(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":383 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not util.is_datetime64_object(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":384 + * if util._checknull(v): + * null_count += 1 + * elif not util.is_datetime64_object(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(is_datetime64_object(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":385 + * null_count += 1 + * elif not util.is_datetime64_object(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":386 + * elif not util.is_datetime64_object(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_timedelta_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":371 + * return null_count != n + * + * def is_datetime64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.is_datetime64_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":388 + * return null_count != n + * + * def is_timedelta_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_154is_timedelta_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_154is_timedelta_array = {__Pyx_NAMESTR("is_timedelta_array"), (PyCFunction)__pyx_pw_6pandas_3lib_154is_timedelta_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_154is_timedelta_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_153is_timedelta_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_153is_timedelta_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta_array", 0); + + /* "pandas/src/inference.pyx":389 + * + * def is_timedelta_array(ndarray values): + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":391 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":392 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * v = values[i] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":393 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":394 + * return False + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_values), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":395 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":397 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not PyDelta_Check(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":398 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not PyDelta_Check(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":399 + * if util._checknull(v): + * null_count += 1 + * elif not PyDelta_Check(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(PyDelta_Check(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":400 + * null_count += 1 + * elif not PyDelta_Check(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":401 + * elif not PyDelta_Check(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_timedelta64_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":388 + * return null_count != n + * + * def is_timedelta_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.is_timedelta_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":403 + * return null_count != n + * + * def is_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_156is_timedelta64_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_156is_timedelta64_array = {__Pyx_NAMESTR("is_timedelta64_array"), (PyCFunction)__pyx_pw_6pandas_3lib_156is_timedelta64_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_156is_timedelta64_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta64_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_155is_timedelta64_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_155is_timedelta64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta64_array", 0); + + /* "pandas/src/inference.pyx":404 + * + * def is_timedelta64_array(ndarray values): + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":406 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":407 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * v = values[i] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":408 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":409 + * return False + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_values), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":410 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":412 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not util.is_timedelta64_object(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":413 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not util.is_timedelta64_object(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":414 + * if util._checknull(v): + * null_count += 1 + * elif not util.is_timedelta64_object(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(is_timedelta64_object(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":415 + * null_count += 1 + * elif not util.is_timedelta64_object(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":416 + * elif not util.is_timedelta64_object(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_timedelta_or_timedelta64_array(ndarray values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":403 + * return null_count != n + * + * def is_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.is_timedelta64_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":418 + * return null_count != n + * + * def is_timedelta_or_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_158is_timedelta_or_timedelta64_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static char __pyx_doc_6pandas_3lib_157is_timedelta_or_timedelta64_array[] = " infer with timedeltas and/or nat/none "; +static PyMethodDef __pyx_mdef_6pandas_3lib_158is_timedelta_or_timedelta64_array = {__Pyx_NAMESTR("is_timedelta_or_timedelta64_array"), (PyCFunction)__pyx_pw_6pandas_3lib_158is_timedelta_or_timedelta64_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_157is_timedelta_or_timedelta64_array)}; +static PyObject *__pyx_pw_6pandas_3lib_158is_timedelta_or_timedelta64_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta_or_timedelta64_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_157is_timedelta_or_timedelta64_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_157is_timedelta_or_timedelta64_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_null_count; + int __pyx_v_n; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timedelta_or_timedelta64_array", 0); + + /* "pandas/src/inference.pyx":420 + * def is_timedelta_or_timedelta64_array(ndarray values): + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) # <<<<<<<<<<<<<< + * cdef object v + * if n == 0: + */ + __pyx_v_null_count = 0; + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":422 + * cdef int i, null_count = 0, n = len(values) + * cdef object v + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":423 + * cdef object v + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * v = values[i] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":424 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * v = values[i] + * if is_null_datetimelike(v): + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":425 + * return False + * for i in range(n): + * v = values[i] # <<<<<<<<<<<<<< + * if is_null_datetimelike(v): + * # we are a regular null + */ + __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_values), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":426 + * for i in range(n): + * v = values[i] + * if is_null_datetimelike(v): # <<<<<<<<<<<<<< + * # we are a regular null + * if util._checknull(v): + */ + __pyx_t_2 = (__pyx_f_6pandas_3lib_is_null_datetimelike(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":428 + * if is_null_datetimelike(v): + * # we are a regular null + * if util._checknull(v): # <<<<<<<<<<<<<< + * null_count += 1 + * elif not is_timedelta(v): + */ + __pyx_t_2 = (__pyx_f_4util__checknull(__pyx_v_v) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":429 + * # we are a regular null + * if util._checknull(v): + * null_count += 1 # <<<<<<<<<<<<<< + * elif not is_timedelta(v): + * return False + */ + __pyx_v_null_count = (__pyx_v_null_count + 1); + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L6; + } + + /* "pandas/src/inference.pyx":430 + * if util._checknull(v): + * null_count += 1 + * elif not is_timedelta(v): # <<<<<<<<<<<<<< + * return False + * return null_count != n + */ + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_v) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":431 + * null_count += 1 + * elif not is_timedelta(v): + * return False # <<<<<<<<<<<<<< + * return null_count != n + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":432 + * elif not is_timedelta(v): + * return False + * return null_count != n # <<<<<<<<<<<<<< + * + * def is_date_array(ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_null_count != __pyx_v_n)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":418 + * return null_count != n + * + * def is_timedelta_or_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.lib.is_timedelta_or_timedelta64_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":434 + * return null_count != n + * + * def is_date_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_160is_date_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_160is_date_array = {__Pyx_NAMESTR("is_date_array"), (PyCFunction)__pyx_pw_6pandas_3lib_160is_date_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_160is_date_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_date_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_159is_date_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_159is_date_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_n; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_date_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":435 + * + * def is_date_array(ndarray[object] values): + * cdef int i, n = len(values) # <<<<<<<<<<<<<< + * if n == 0: + * return False + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":436 + * def is_date_array(ndarray[object] values): + * cdef int i, n = len(values) + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":437 + * cdef int i, n = len(values) + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * if not is_date(values[i]): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":438 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * if not is_date(values[i]): + * return False + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":439 + * return False + * for i in range(n): + * if not is_date(values[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_date(__pyx_t_5) != 0)) != 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":440 + * for i in range(n): + * if not is_date(values[i]): + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":441 + * if not is_date(values[i]): + * return False + * return True # <<<<<<<<<<<<<< + * + * def is_time_array(ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":434 + * return null_count != n + * + * def is_date_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_date_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":443 + * return True + * + * def is_time_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_162is_time_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_162is_time_array = {__Pyx_NAMESTR("is_time_array"), (PyCFunction)__pyx_pw_6pandas_3lib_162is_time_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_162is_time_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_time_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_161is_time_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_161is_time_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_n; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_time_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":444 + * + * def is_time_array(ndarray[object] values): + * cdef int i, n = len(values) # <<<<<<<<<<<<<< + * if n == 0: + * return False + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":445 + * def is_time_array(ndarray[object] values): + * cdef int i, n = len(values) + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":446 + * cdef int i, n = len(values) + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * if not is_time(values[i]): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":447 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * if not is_time(values[i]): + * return False + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/src/inference.pyx":448 + * return False + * for i in range(n): + * if not is_time(values[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = ((!(__pyx_f_6pandas_3lib_is_time(__pyx_t_5) != 0)) != 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + /* "pandas/src/inference.pyx":449 + * for i in range(n): + * if not is_time(values[i]): + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":450 + * if not is_time(values[i]): + * return False + * return True # <<<<<<<<<<<<<< + * + * def is_period(object o): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":443 + * return True + * + * def is_time_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_time_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":452 + * return True + * + * def is_period(object o): # <<<<<<<<<<<<<< + * from pandas import Period + * return isinstance(o,Period) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_164is_period(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_164is_period = {__Pyx_NAMESTR("is_period"), (PyCFunction)__pyx_pw_6pandas_3lib_164is_period, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_164is_period(PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_period (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_163is_period(__pyx_self, ((PyObject *)__pyx_v_o)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_163is_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) { + PyObject *__pyx_v_Period = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_period", 0); + + /* "pandas/src/inference.pyx":453 + * + * def is_period(object o): + * from pandas import Period # <<<<<<<<<<<<<< + * return isinstance(o,Period) + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Period); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Period); + __Pyx_GIVEREF(__pyx_n_s_Period); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Period); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_Period = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":454 + * def is_period(object o): + * from pandas import Period + * return isinstance(o,Period) # <<<<<<<<<<<<<< + * + * def is_period_array(ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_o, __pyx_v_Period); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":452 + * return True + * + * def is_period(object o): # <<<<<<<<<<<<<< + * from pandas import Period + * return isinstance(o,Period) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.is_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Period); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":456 + * return isinstance(o,Period) + * + * def is_period_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * from pandas.tseries.period import Period + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_166is_period_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_166is_period_array = {__Pyx_NAMESTR("is_period_array"), (PyCFunction)__pyx_pw_6pandas_3lib_166is_period_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_166is_period_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_period_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_165is_period_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_165is_period_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_n; + PyObject *__pyx_v_Period = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_period_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":457 + * + * def is_period_array(ndarray[object] values): + * cdef int i, n = len(values) # <<<<<<<<<<<<<< + * from pandas.tseries.period import Period + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":458 + * def is_period_array(ndarray[object] values): + * cdef int i, n = len(values) + * from pandas.tseries.period import Period # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Period); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Period); + __Pyx_GIVEREF(__pyx_n_s_Period); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pandas_tseries_period, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Period); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_Period = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":460 + * from pandas.tseries.period import Period + * + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_4 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":461 + * + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * if not isinstance(values[i], Period): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":462 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * if not isinstance(values[i], Period): + * return False + */ + __pyx_t_5 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/inference.pyx":463 + * return False + * for i in range(n): + * if not isinstance(values[i], Period): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __pyx_t_4 = PyObject_IsInstance(__pyx_t_3, __pyx_v_Period); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/inference.pyx":464 + * for i in range(n): + * if not isinstance(values[i], Period): + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/src/inference.pyx":465 + * if not isinstance(values[i], Period): + * return False + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":456 + * return isinstance(o,Period) + * + * def is_period_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * from pandas.tseries.period import Period + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.is_period_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_Period); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_168maybe_convert_numeric(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_167maybe_convert_numeric[] = "\n Type inference function-- convert strings to numeric (potentially) and\n convert to proper dtype array\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_168maybe_convert_numeric = {__Pyx_NAMESTR("maybe_convert_numeric"), (PyCFunction)__pyx_pw_6pandas_3lib_168maybe_convert_numeric, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_167maybe_convert_numeric)}; +static PyObject *__pyx_pw_6pandas_3lib_168maybe_convert_numeric(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_na_values = 0; + int __pyx_v_convert_empty; + int __pyx_v_coerce_numeric; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_convert_numeric (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_na_values,&__pyx_n_s_convert_empty,&__pyx_n_s_coerce_numeric,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("maybe_convert_numeric", 0, 2, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert_empty); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce_numeric); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maybe_convert_numeric") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_ds_object(values[0]); if (unlikely(!__pyx_v_values.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_na_values = ((PyObject*)values[1]); + if (values[2]) { + __pyx_v_convert_empty = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_convert_empty == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + + /* "pandas/src/inference.pyx":476 + * + * def maybe_convert_numeric(object[:] values, set na_values, + * bint convert_empty=True, bint coerce_numeric=False): # <<<<<<<<<<<<<< + * ''' + * Type inference function-- convert strings to numeric (potentially) and + */ + __pyx_v_convert_empty = ((int)1); + } + if (values[3]) { + __pyx_v_coerce_numeric = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_coerce_numeric == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_coerce_numeric = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("maybe_convert_numeric", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_na_values), (&PySet_Type), 1, "na_values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_167maybe_convert_numeric(__pyx_self, __pyx_v_values, __pyx_v_na_values, __pyx_v_convert_empty, __pyx_v_coerce_numeric); + + /* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_167maybe_convert_numeric(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values, PyObject *__pyx_v_na_values, int __pyx_v_convert_empty, int __pyx_v_coerce_numeric) { + CYTHON_UNUSED int __pyx_v_status; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_floats = 0; + PyArrayObject *__pyx_v_complexes = 0; + PyArrayObject *__pyx_v_ints = 0; + PyArrayObject *__pyx_v_bools = 0; + int __pyx_v_seen_float; + int __pyx_v_seen_complex; + int __pyx_v_seen_int; + int __pyx_v_seen_bool; + PyObject *__pyx_v_val = 0; + __pyx_t_5numpy_float64_t __pyx_v_fval; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bools; + __Pyx_Buffer __pyx_pybuffer_bools; + __Pyx_LocalBuf_ND __pyx_pybuffernd_complexes; + __Pyx_Buffer __pyx_pybuffer_complexes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_floats; + __Pyx_Buffer __pyx_pybuffer_floats; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ints; + __Pyx_Buffer __pyx_pybuffer_ints; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + __pyx_t_5numpy_float64_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_double_complex __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + __pyx_t_5numpy_int64_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_uint8_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + int __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + PyObject *__pyx_t_34 = NULL; + PyObject *__pyx_t_35 = NULL; + PyObject *__pyx_t_36 = NULL; + Py_ssize_t __pyx_t_37; + int __pyx_t_38; + PyObject *__pyx_t_39 = NULL; + PyObject *__pyx_t_40 = NULL; + PyObject *__pyx_t_41 = NULL; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_convert_numeric", 0); + __pyx_pybuffer_floats.pybuffer.buf = NULL; + __pyx_pybuffer_floats.refcount = 0; + __pyx_pybuffernd_floats.data = NULL; + __pyx_pybuffernd_floats.rcbuffer = &__pyx_pybuffer_floats; + __pyx_pybuffer_complexes.pybuffer.buf = NULL; + __pyx_pybuffer_complexes.refcount = 0; + __pyx_pybuffernd_complexes.data = NULL; + __pyx_pybuffernd_complexes.rcbuffer = &__pyx_pybuffer_complexes; + __pyx_pybuffer_ints.pybuffer.buf = NULL; + __pyx_pybuffer_ints.refcount = 0; + __pyx_pybuffernd_ints.data = NULL; + __pyx_pybuffernd_ints.rcbuffer = &__pyx_pybuffer_ints; + __pyx_pybuffer_bools.pybuffer.buf = NULL; + __pyx_pybuffer_bools.refcount = 0; + __pyx_pybuffernd_bools.data = NULL; + __pyx_pybuffernd_bools.rcbuffer = &__pyx_pybuffer_bools; + + /* "pandas/src/inference.pyx":483 + * cdef: + * int status + * Py_ssize_t i, n = values.size # <<<<<<<<<<<<<< + * ndarray[float64_t] floats = np.empty(n, dtype='f8') + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_values, 1, (PyObject *(*)(char *)) __pyx_memview_get_object, (int (*)(char *, PyObject *)) __pyx_memview_set_object, 1);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_n = __pyx_t_3; + + /* "pandas/src/inference.pyx":484 + * int status + * Py_ssize_t i, n = values.size + * ndarray[float64_t] floats = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') + * ndarray[int64_t] ints = np.empty(n, dtype='i8') + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_floats.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_floats = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_floats.diminfo[0].strides = __pyx_pybuffernd_floats.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_floats.diminfo[0].shape = __pyx_pybuffernd_floats.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_floats = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":485 + * Py_ssize_t i, n = values.size + * ndarray[float64_t] floats = np.empty(n, dtype='f8') + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') # <<<<<<<<<<<<<< + * ndarray[int64_t] ints = np.empty(n, dtype='i8') + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_c16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_complexes = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_complexes.diminfo[0].strides = __pyx_pybuffernd_complexes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_complexes.diminfo[0].shape = __pyx_pybuffernd_complexes.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_complexes = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/inference.pyx":486 + * ndarray[float64_t] floats = np.empty(n, dtype='f8') + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') + * ndarray[int64_t] ints = np.empty(n, dtype='i8') # <<<<<<<<<<<<<< + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') + * bint seen_float = False + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ints.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_ints = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_ints.diminfo[0].strides = __pyx_pybuffernd_ints.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ints.diminfo[0].shape = __pyx_pybuffernd_ints.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_8 = 0; + __pyx_v_ints = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":487 + * ndarray[complex128_t] complexes = np.empty(n, dtype='c16') + * ndarray[int64_t] ints = np.empty(n, dtype='i8') + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') # <<<<<<<<<<<<<< + * bint seen_float = False + * bint seen_complex = False + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bools.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_bools = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_bools.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_bools.diminfo[0].strides = __pyx_pybuffernd_bools.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bools.diminfo[0].shape = __pyx_pybuffernd_bools.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_9 = 0; + __pyx_v_bools = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":488 + * ndarray[int64_t] ints = np.empty(n, dtype='i8') + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') + * bint seen_float = False # <<<<<<<<<<<<<< + * bint seen_complex = False + * bint seen_int = False + */ + __pyx_v_seen_float = 0; + + /* "pandas/src/inference.pyx":489 + * ndarray[uint8_t] bools = np.empty(n, dtype='u1') + * bint seen_float = False + * bint seen_complex = False # <<<<<<<<<<<<<< + * bint seen_int = False + * bint seen_bool = False + */ + __pyx_v_seen_complex = 0; + + /* "pandas/src/inference.pyx":490 + * bint seen_float = False + * bint seen_complex = False + * bint seen_int = False # <<<<<<<<<<<<<< + * bint seen_bool = False + * object val + */ + __pyx_v_seen_int = 0; + + /* "pandas/src/inference.pyx":491 + * bint seen_complex = False + * bint seen_int = False + * bint seen_bool = False # <<<<<<<<<<<<<< + * object val + * float64_t fval + */ + __pyx_v_seen_bool = 0; + + /* "pandas/src/inference.pyx":495 + * float64_t fval + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_3; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/src/inference.pyx":496 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * if val in na_values: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_v_values.shape[0]; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_v_values.shape[0])) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *((PyObject * *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_11 * __pyx_v_values.strides[0]) )); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":498 + * val = values[i] + * + * if val in na_values: # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = nan + * seen_float = True + */ + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_na_values, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":499 + * + * if val in na_values: + * floats[i] = complexes[i] = nan # <<<<<<<<<<<<<< + * seen_float = True + * elif util.is_float_object(val): + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_6pandas_3lib_nan; + __pyx_t_16 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0); + + /* "pandas/src/inference.pyx":500 + * if val in na_values: + * floats[i] = complexes[i] = nan + * seen_float = True # <<<<<<<<<<<<<< + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val + */ + __pyx_v_seen_float = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":501 + * floats[i] = complexes[i] = nan + * seen_float = True + * elif util.is_float_object(val): # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = val + * seen_float = True + */ + __pyx_t_14 = (is_float_object(__pyx_v_val) != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":502 + * seen_float = True + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val # <<<<<<<<<<<<<< + * seen_float = True + * elif util.is_integer_object(val): + */ + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_17 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_17; + __pyx_t_19 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_19; + + /* "pandas/src/inference.pyx":503 + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val + * seen_float = True # <<<<<<<<<<<<<< + * elif util.is_integer_object(val): + * floats[i] = ints[i] = val + */ + __pyx_v_seen_float = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":504 + * floats[i] = complexes[i] = val + * seen_float = True + * elif util.is_integer_object(val): # <<<<<<<<<<<<<< + * floats[i] = ints[i] = val + * seen_int = True + */ + __pyx_t_14 = (is_integer_object(__pyx_v_val) != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":505 + * seen_float = True + * elif util.is_integer_object(val): + * floats[i] = ints[i] = val # <<<<<<<<<<<<<< + * seen_int = True + * elif util.is_bool_object(val): + */ + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_17 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_17; + __pyx_t_22 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_22 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ints.diminfo[0].strides) = __pyx_t_22; + + /* "pandas/src/inference.pyx":506 + * elif util.is_integer_object(val): + * floats[i] = ints[i] = val + * seen_int = True # <<<<<<<<<<<<<< + * elif util.is_bool_object(val): + * floats[i] = ints[i] = bools[i] = val + */ + __pyx_v_seen_int = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":507 + * floats[i] = ints[i] = val + * seen_int = True + * elif util.is_bool_object(val): # <<<<<<<<<<<<<< + * floats[i] = ints[i] = bools[i] = val + * seen_bool = True + */ + __pyx_t_14 = (is_bool_object(__pyx_v_val) != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":508 + * seen_int = True + * elif util.is_bool_object(val): + * floats[i] = ints[i] = bools[i] = val # <<<<<<<<<<<<<< + * seen_bool = True + * elif val is None: + */ + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_17 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_17; + __pyx_t_22 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_22 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_25 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ints.diminfo[0].strides) = __pyx_t_22; + __pyx_t_26 = __Pyx_PyInt_As_npy_uint8(__pyx_v_val); if (unlikely((__pyx_t_26 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_bools.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_bools.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_bools.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_bools.diminfo[0].strides) = __pyx_t_26; + + /* "pandas/src/inference.pyx":509 + * elif util.is_bool_object(val): + * floats[i] = ints[i] = bools[i] = val + * seen_bool = True # <<<<<<<<<<<<<< + * elif val is None: + * floats[i] = complexes[i] = nan + */ + __pyx_v_seen_bool = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":510 + * floats[i] = ints[i] = bools[i] = val + * seen_bool = True + * elif val is None: # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = nan + * seen_float = True + */ + __pyx_t_14 = (__pyx_v_val == Py_None); + __pyx_t_13 = (__pyx_t_14 != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":511 + * seen_bool = True + * elif val is None: + * floats[i] = complexes[i] = nan # <<<<<<<<<<<<<< + * seen_float = True + * elif hasattr(val, '__len__') and len(val) == 0: + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_6pandas_3lib_nan; + __pyx_t_29 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0); + + /* "pandas/src/inference.pyx":512 + * elif val is None: + * floats[i] = complexes[i] = nan + * seen_float = True # <<<<<<<<<<<<<< + * elif hasattr(val, '__len__') and len(val) == 0: + * if convert_empty or coerce_numeric: + */ + __pyx_v_seen_float = 1; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":513 + * floats[i] = complexes[i] = nan + * seen_float = True + * elif hasattr(val, '__len__') and len(val) == 0: # <<<<<<<<<<<<<< + * if convert_empty or coerce_numeric: + * floats[i] = complexes[i] = nan + */ + __pyx_t_13 = PyObject_HasAttr(__pyx_v_val, __pyx_n_s_len); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if ((__pyx_t_13 != 0)) { + __pyx_t_30 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((__pyx_t_30 == 0) != 0); + __pyx_t_31 = __pyx_t_14; + } else { + __pyx_t_31 = (__pyx_t_13 != 0); + } + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":514 + * seen_float = True + * elif hasattr(val, '__len__') and len(val) == 0: + * if convert_empty or coerce_numeric: # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = nan + * seen_float = True + */ + if (!(__pyx_v_convert_empty != 0)) { + __pyx_t_31 = (__pyx_v_coerce_numeric != 0); + } else { + __pyx_t_31 = (__pyx_v_convert_empty != 0); + } + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":515 + * elif hasattr(val, '__len__') and len(val) == 0: + * if convert_empty or coerce_numeric: + * floats[i] = complexes[i] = nan # <<<<<<<<<<<<<< + * seen_float = True + * else: + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_6pandas_3lib_nan; + __pyx_t_32 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0); + + /* "pandas/src/inference.pyx":516 + * if convert_empty or coerce_numeric: + * floats[i] = complexes[i] = nan + * seen_float = True # <<<<<<<<<<<<<< + * else: + * raise ValueError('Empty string encountered') + */ + __pyx_v_seen_float = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/inference.pyx":518 + * seen_float = True + * else: + * raise ValueError('Empty string encountered') # <<<<<<<<<<<<<< + * elif util.is_complex_object(val): + * complexes[i] = val + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L6:; + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":519 + * else: + * raise ValueError('Empty string encountered') + * elif util.is_complex_object(val): # <<<<<<<<<<<<<< + * complexes[i] = val + * seen_complex = True + */ + __pyx_t_31 = (is_complex_object(__pyx_v_val) != 0); + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":520 + * raise ValueError('Empty string encountered') + * elif util.is_complex_object(val): + * complexes[i] = val # <<<<<<<<<<<<<< + * seen_complex = True + * else: + */ + __pyx_t_19 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_33 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_19; + + /* "pandas/src/inference.pyx":521 + * elif util.is_complex_object(val): + * complexes[i] = val + * seen_complex = True # <<<<<<<<<<<<<< + * else: + * try: + */ + __pyx_v_seen_complex = 1; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/inference.pyx":523 + * seen_complex = True + * else: + * try: # <<<<<<<<<<<<<< + * status = floatify(val, &fval) + * floats[i] = fval + */ + { + __Pyx_ExceptionSave(&__pyx_t_34, &__pyx_t_35, &__pyx_t_36); + __Pyx_XGOTREF(__pyx_t_34); + __Pyx_XGOTREF(__pyx_t_35); + __Pyx_XGOTREF(__pyx_t_36); + /*try:*/ { + + /* "pandas/src/inference.pyx":524 + * else: + * try: + * status = floatify(val, &fval) # <<<<<<<<<<<<<< + * floats[i] = fval + * if not seen_float: + */ + __pyx_t_12 = floatify(__pyx_v_val, (&__pyx_v_fval)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_v_status = __pyx_t_12; + + /* "pandas/src/inference.pyx":525 + * try: + * status = floatify(val, &fval) + * floats[i] = fval # <<<<<<<<<<<<<< + * if not seen_float: + * if '.' in val or fval == INF or fval == NEGINF: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_fval; + + /* "pandas/src/inference.pyx":526 + * status = floatify(val, &fval) + * floats[i] = fval + * if not seen_float: # <<<<<<<<<<<<<< + * if '.' in val or fval == INF or fval == NEGINF: + * seen_float = True + */ + __pyx_t_31 = ((!(__pyx_v_seen_float != 0)) != 0); + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":527 + * floats[i] = fval + * if not seen_float: + * if '.' in val or fval == INF or fval == NEGINF: # <<<<<<<<<<<<<< + * seen_float = True + * elif 'inf' in val: # special case to handle +/-inf + */ + __pyx_t_31 = (__Pyx_PySequence_Contains(__pyx_kp_s__46, __pyx_v_val, Py_EQ)); if (unlikely(__pyx_t_31 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + if (!(__pyx_t_31 != 0)) { + __pyx_t_13 = ((__pyx_v_fval == __pyx_v_6pandas_3lib_INF) != 0); + if (!__pyx_t_13) { + __pyx_t_14 = ((__pyx_v_fval == __pyx_v_6pandas_3lib_NEGINF) != 0); + __pyx_t_38 = __pyx_t_14; + } else { + __pyx_t_38 = __pyx_t_13; + } + __pyx_t_13 = __pyx_t_38; + } else { + __pyx_t_13 = (__pyx_t_31 != 0); + } + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":528 + * if not seen_float: + * if '.' in val or fval == INF or fval == NEGINF: + * seen_float = True # <<<<<<<<<<<<<< + * elif 'inf' in val: # special case to handle +/-inf + * seen_float = True + */ + __pyx_v_seen_float = 1; + goto __pyx_L16; + } + + /* "pandas/src/inference.pyx":529 + * if '.' in val or fval == INF or fval == NEGINF: + * seen_float = True + * elif 'inf' in val: # special case to handle +/-inf # <<<<<<<<<<<<<< + * seen_float = True + * elif fval < fINT64_MAX and fval > fINT64_MIN: + */ + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_n_s_inf, __pyx_v_val, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_31 = (__pyx_t_13 != 0); + if (__pyx_t_31) { + + /* "pandas/src/inference.pyx":530 + * seen_float = True + * elif 'inf' in val: # special case to handle +/-inf + * seen_float = True # <<<<<<<<<<<<<< + * elif fval < fINT64_MAX and fval > fINT64_MIN: + * try: + */ + __pyx_v_seen_float = 1; + goto __pyx_L16; + } + + /* "pandas/src/inference.pyx":531 + * elif 'inf' in val: # special case to handle +/-inf + * seen_float = True + * elif fval < fINT64_MAX and fval > fINT64_MIN: # <<<<<<<<<<<<<< + * try: + * ints[i] = int(val) + */ + __pyx_t_31 = ((__pyx_v_fval < __pyx_v_6pandas_3lib_fINT64_MAX) != 0); + if (__pyx_t_31) { + __pyx_t_13 = ((__pyx_v_fval > __pyx_v_6pandas_3lib_fINT64_MIN) != 0); + __pyx_t_38 = __pyx_t_13; + } else { + __pyx_t_38 = __pyx_t_31; + } + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":532 + * seen_float = True + * elif fval < fINT64_MAX and fval > fINT64_MIN: + * try: # <<<<<<<<<<<<<< + * ints[i] = int(val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_39, &__pyx_t_40, &__pyx_t_41); + __Pyx_XGOTREF(__pyx_t_39); + __Pyx_XGOTREF(__pyx_t_40); + __Pyx_XGOTREF(__pyx_t_41); + /*try:*/ { + + /* "pandas/src/inference.pyx":533 + * elif fval < fINT64_MAX and fval > fINT64_MIN: + * try: + * ints[i] = int(val) # <<<<<<<<<<<<<< + * except ValueError: + * ints[i] = fval + */ + __pyx_t_5 = PyNumber_Int(__pyx_v_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_22 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_22 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_42 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_42 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_42 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_ints.diminfo[0].strides) = __pyx_t_22; + } + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_XDECREF(__pyx_t_40); __pyx_t_40 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":534 + * try: + * ints[i] = int(val) + * except ValueError: # <<<<<<<<<<<<<< + * ints[i] = fval + * else: + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":535 + * ints[i] = int(val) + * except ValueError: + * ints[i] = fval # <<<<<<<<<<<<<< + * else: + * seen_float = True + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_43 < 0) { + __pyx_t_43 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_43 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_ints.diminfo[0].strides) = ((__pyx_t_5numpy_int64_t)__pyx_v_fval); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L18_exception_handled; + } + goto __pyx_L19_except_error; + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_41); + __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_40, __pyx_t_41); + goto __pyx_L7_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_41); + __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_40, __pyx_t_41); + __pyx_L24_try_end:; + } + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/inference.pyx":537 + * ints[i] = fval + * else: + * seen_float = True # <<<<<<<<<<<<<< + * except: + * if not coerce_numeric: + */ + __pyx_v_seen_float = 1; + } + __pyx_L16:; + goto __pyx_L15; + } + __pyx_L15:; + } + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0; + __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":538 + * else: + * seen_float = True + * except: # <<<<<<<<<<<<<< + * if not coerce_numeric: + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/src/inference.pyx":539 + * seen_float = True + * except: + * if not coerce_numeric: # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_38 = ((!(__pyx_v_coerce_numeric != 0)) != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":540 + * except: + * if not coerce_numeric: + * raise # <<<<<<<<<<<<<< + * + * floats[i] = nan + */ + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_2, __pyx_t_5); + __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + } + + /* "pandas/src/inference.pyx":542 + * raise + * + * floats[i] = nan # <<<<<<<<<<<<<< + * seen_float = True + * + */ + __pyx_t_44 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_6pandas_3lib_nan; + + /* "pandas/src/inference.pyx":543 + * + * floats[i] = nan + * seen_float = True # <<<<<<<<<<<<<< + * + * if seen_complex: + */ + __pyx_v_seen_float = 1; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + __Pyx_XGIVEREF(__pyx_t_34); + __Pyx_XGIVEREF(__pyx_t_35); + __Pyx_XGIVEREF(__pyx_t_36); + __Pyx_ExceptionReset(__pyx_t_34, __pyx_t_35, __pyx_t_36); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_34); + __Pyx_XGIVEREF(__pyx_t_35); + __Pyx_XGIVEREF(__pyx_t_36); + __Pyx_ExceptionReset(__pyx_t_34, __pyx_t_35, __pyx_t_36); + __pyx_L14_try_end:; + } + } + __pyx_L5:; + } + + /* "pandas/src/inference.pyx":545 + * seen_float = True + * + * if seen_complex: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float: + */ + __pyx_t_38 = (__pyx_v_seen_complex != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":546 + * + * if seen_complex: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float: + * return floats + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":547 + * if seen_complex: + * return complexes + * elif seen_float: # <<<<<<<<<<<<<< + * return floats + * elif seen_int: + */ + __pyx_t_38 = (__pyx_v_seen_float != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":548 + * return complexes + * elif seen_float: + * return floats # <<<<<<<<<<<<<< + * elif seen_int: + * return ints + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":549 + * elif seen_float: + * return floats + * elif seen_int: # <<<<<<<<<<<<<< + * return ints + * elif seen_bool: + */ + __pyx_t_38 = (__pyx_v_seen_int != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":550 + * return floats + * elif seen_int: + * return ints # <<<<<<<<<<<<<< + * elif seen_bool: + * return bools.view(np.bool_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ints)); + __pyx_r = ((PyObject *)__pyx_v_ints); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":551 + * elif seen_int: + * return ints + * elif seen_bool: # <<<<<<<<<<<<<< + * return bools.view(np.bool_) + * return ints + */ + __pyx_t_38 = (__pyx_v_seen_bool != 0); + if (__pyx_t_38) { + + /* "pandas/src/inference.pyx":552 + * return ints + * elif seen_bool: + * return bools.view(np.bool_) # <<<<<<<<<<<<<< + * return ints + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bools), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":553 + * elif seen_bool: + * return bools.view(np.bool_) + * return ints # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ints)); + __pyx_r = ((PyObject *)__pyx_v_ints); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_floats); + __Pyx_XDECREF((PyObject *)__pyx_v_complexes); + __Pyx_XDECREF((PyObject *)__pyx_v_ints); + __Pyx_XDECREF((PyObject *)__pyx_v_bools); + __Pyx_XDECREF(__pyx_v_val); + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":556 + * + * + * def maybe_convert_objects(ndarray[object] objects, bint try_float=0, # <<<<<<<<<<<<<< + * bint safe=0, bint convert_datetime=0, + * bint convert_timedelta=0): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_170maybe_convert_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_169maybe_convert_objects[] = "\n Type inference function-- convert object array to proper dtype\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_170maybe_convert_objects = {__Pyx_NAMESTR("maybe_convert_objects"), (PyCFunction)__pyx_pw_6pandas_3lib_170maybe_convert_objects, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_169maybe_convert_objects)}; +static PyObject *__pyx_pw_6pandas_3lib_170maybe_convert_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_objects = 0; + int __pyx_v_try_float; + int __pyx_v_safe; + int __pyx_v_convert_datetime; + int __pyx_v_convert_timedelta; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_convert_objects (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_try_float,&__pyx_n_s_safe,&__pyx_n_s_convert_datetime,&__pyx_n_s_convert_timedelta,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_try_float); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_safe); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert_datetime); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert_timedelta); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maybe_convert_objects") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_objects = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_try_float = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_try_float == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_try_float = ((int)0); + } + if (values[2]) { + __pyx_v_safe = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_safe = ((int)0); + } + if (values[3]) { + __pyx_v_convert_datetime = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_convert_datetime == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_convert_datetime = ((int)0); + } + if (values[4]) { + __pyx_v_convert_timedelta = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_convert_timedelta == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_convert_timedelta = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("maybe_convert_objects", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_objects), __pyx_ptype_5numpy_ndarray, 1, "objects", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_169maybe_convert_objects(__pyx_self, __pyx_v_objects, __pyx_v_try_float, __pyx_v_safe, __pyx_v_convert_datetime, __pyx_v_convert_timedelta); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_169maybe_convert_objects(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_objects, int __pyx_v_try_float, int __pyx_v_safe, int __pyx_v_convert_datetime, int __pyx_v_convert_timedelta) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_floats = 0; + PyArrayObject *__pyx_v_complexes = 0; + PyArrayObject *__pyx_v_ints = 0; + PyArrayObject *__pyx_v_bools = 0; + PyArrayObject *__pyx_v_idatetimes = 0; + PyArrayObject *__pyx_v_itimedeltas = 0; + int __pyx_v_seen_float; + int __pyx_v_seen_complex; + int __pyx_v_seen_datetime; + int __pyx_v_seen_timedelta; + int __pyx_v_seen_int; + int __pyx_v_seen_bool; + int __pyx_v_seen_object; + int __pyx_v_seen_null; + int __pyx_v_seen_numeric; + PyObject *__pyx_v_val = 0; + CYTHON_UNUSED PyObject *__pyx_v_onan = 0; + __pyx_t_5numpy_float64_t __pyx_v_fnan; + PyObject *__pyx_v_datetimes = NULL; + PyObject *__pyx_v_timedeltas = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_bools; + __Pyx_Buffer __pyx_pybuffer_bools; + __Pyx_LocalBuf_ND __pyx_pybuffernd_complexes; + __Pyx_Buffer __pyx_pybuffer_complexes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_floats; + __Pyx_Buffer __pyx_pybuffer_floats; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idatetimes; + __Pyx_Buffer __pyx_pybuffer_idatetimes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ints; + __Pyx_Buffer __pyx_pybuffer_ints; + __Pyx_LocalBuf_ND __pyx_pybuffernd_itimedeltas; + __Pyx_Buffer __pyx_pybuffer_itimedeltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_objects; + __Pyx_Buffer __pyx_pybuffer_objects; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + PyArrayObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyArrayObject *__pyx_t_16 = NULL; + PyArrayObject *__pyx_t_17 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + __pyx_t_5numpy_uint8_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + __pyx_t_double_complex __pyx_t_26; + Py_ssize_t __pyx_t_27; + __pyx_t_5numpy_int64_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + double __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + int __pyx_t_39; + int __pyx_t_40; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_convert_objects", 0); + __pyx_pybuffer_floats.pybuffer.buf = NULL; + __pyx_pybuffer_floats.refcount = 0; + __pyx_pybuffernd_floats.data = NULL; + __pyx_pybuffernd_floats.rcbuffer = &__pyx_pybuffer_floats; + __pyx_pybuffer_complexes.pybuffer.buf = NULL; + __pyx_pybuffer_complexes.refcount = 0; + __pyx_pybuffernd_complexes.data = NULL; + __pyx_pybuffernd_complexes.rcbuffer = &__pyx_pybuffer_complexes; + __pyx_pybuffer_ints.pybuffer.buf = NULL; + __pyx_pybuffer_ints.refcount = 0; + __pyx_pybuffernd_ints.data = NULL; + __pyx_pybuffernd_ints.rcbuffer = &__pyx_pybuffer_ints; + __pyx_pybuffer_bools.pybuffer.buf = NULL; + __pyx_pybuffer_bools.refcount = 0; + __pyx_pybuffernd_bools.data = NULL; + __pyx_pybuffernd_bools.rcbuffer = &__pyx_pybuffer_bools; + __pyx_pybuffer_idatetimes.pybuffer.buf = NULL; + __pyx_pybuffer_idatetimes.refcount = 0; + __pyx_pybuffernd_idatetimes.data = NULL; + __pyx_pybuffernd_idatetimes.rcbuffer = &__pyx_pybuffer_idatetimes; + __pyx_pybuffer_itimedeltas.pybuffer.buf = NULL; + __pyx_pybuffer_itimedeltas.refcount = 0; + __pyx_pybuffernd_itimedeltas.data = NULL; + __pyx_pybuffernd_itimedeltas.rcbuffer = &__pyx_pybuffer_itimedeltas; + __pyx_pybuffer_objects.pybuffer.buf = NULL; + __pyx_pybuffer_objects.refcount = 0; + __pyx_pybuffernd_objects.data = NULL; + __pyx_pybuffernd_objects.rcbuffer = &__pyx_pybuffer_objects; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_objects.rcbuffer->pybuffer, (PyObject*)__pyx_v_objects, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_objects.diminfo[0].strides = __pyx_pybuffernd_objects.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_objects.diminfo[0].shape = __pyx_pybuffernd_objects.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":570 + * ndarray[int64_t] idatetimes + * ndarray[int64_t] itimedeltas + * bint seen_float = 0 # <<<<<<<<<<<<<< + * bint seen_complex = 0 + * bint seen_datetime = 0 + */ + __pyx_v_seen_float = 0; + + /* "pandas/src/inference.pyx":571 + * ndarray[int64_t] itimedeltas + * bint seen_float = 0 + * bint seen_complex = 0 # <<<<<<<<<<<<<< + * bint seen_datetime = 0 + * bint seen_timedelta = 0 + */ + __pyx_v_seen_complex = 0; + + /* "pandas/src/inference.pyx":572 + * bint seen_float = 0 + * bint seen_complex = 0 + * bint seen_datetime = 0 # <<<<<<<<<<<<<< + * bint seen_timedelta = 0 + * bint seen_int = 0 + */ + __pyx_v_seen_datetime = 0; + + /* "pandas/src/inference.pyx":573 + * bint seen_complex = 0 + * bint seen_datetime = 0 + * bint seen_timedelta = 0 # <<<<<<<<<<<<<< + * bint seen_int = 0 + * bint seen_bool = 0 + */ + __pyx_v_seen_timedelta = 0; + + /* "pandas/src/inference.pyx":574 + * bint seen_datetime = 0 + * bint seen_timedelta = 0 + * bint seen_int = 0 # <<<<<<<<<<<<<< + * bint seen_bool = 0 + * bint seen_object = 0 + */ + __pyx_v_seen_int = 0; + + /* "pandas/src/inference.pyx":575 + * bint seen_timedelta = 0 + * bint seen_int = 0 + * bint seen_bool = 0 # <<<<<<<<<<<<<< + * bint seen_object = 0 + * bint seen_null = 0 + */ + __pyx_v_seen_bool = 0; + + /* "pandas/src/inference.pyx":576 + * bint seen_int = 0 + * bint seen_bool = 0 + * bint seen_object = 0 # <<<<<<<<<<<<<< + * bint seen_null = 0 + * bint seen_numeric = 0 + */ + __pyx_v_seen_object = 0; + + /* "pandas/src/inference.pyx":577 + * bint seen_bool = 0 + * bint seen_object = 0 + * bint seen_null = 0 # <<<<<<<<<<<<<< + * bint seen_numeric = 0 + * object val, onan + */ + __pyx_v_seen_null = 0; + + /* "pandas/src/inference.pyx":578 + * bint seen_object = 0 + * bint seen_null = 0 + * bint seen_numeric = 0 # <<<<<<<<<<<<<< + * object val, onan + * float64_t fval, fnan + */ + __pyx_v_seen_numeric = 0; + + /* "pandas/src/inference.pyx":582 + * float64_t fval, fnan + * + * n = len(objects) # <<<<<<<<<<<<<< + * + * floats = np.empty(n, dtype='f8') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_objects)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":584 + * n = len(objects) + * + * floats = np.empty(n, dtype='f8') # <<<<<<<<<<<<<< + * complexes = np.empty(n, dtype='c16') + * ints = np.empty(n, dtype='i8') + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_floats.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_floats.rcbuffer->pybuffer, (PyObject*)__pyx_v_floats, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_floats.diminfo[0].strides = __pyx_pybuffernd_floats.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_floats.diminfo[0].shape = __pyx_pybuffernd_floats.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_floats = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":585 + * + * floats = np.empty(n, dtype='f8') + * complexes = np.empty(n, dtype='c16') # <<<<<<<<<<<<<< + * ints = np.empty(n, dtype='i8') + * bools = np.empty(n, dtype=np.uint8) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_c16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer, (PyObject*)__pyx_v_complexes, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_complexes.diminfo[0].strides = __pyx_pybuffernd_complexes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_complexes.diminfo[0].shape = __pyx_pybuffernd_complexes.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = 0; + __pyx_v_complexes = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":586 + * floats = np.empty(n, dtype='f8') + * complexes = np.empty(n, dtype='c16') + * ints = np.empty(n, dtype='i8') # <<<<<<<<<<<<<< + * bools = np.empty(n, dtype=np.uint8) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ints.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ints.rcbuffer->pybuffer, (PyObject*)__pyx_v_ints, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_ints.diminfo[0].strides = __pyx_pybuffernd_ints.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ints.diminfo[0].shape = __pyx_pybuffernd_ints.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_ints = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":587 + * complexes = np.empty(n, dtype='c16') + * ints = np.empty(n, dtype='i8') + * bools = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * + * if convert_datetime: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bools.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bools.rcbuffer->pybuffer, (PyObject*)__pyx_v_bools, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_bools.diminfo[0].strides = __pyx_pybuffernd_bools.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bools.diminfo[0].shape = __pyx_pybuffernd_bools.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = 0; + __pyx_v_bools = ((PyArrayObject *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/src/inference.pyx":589 + * bools = np.empty(n, dtype=np.uint8) + * + * if convert_datetime: # <<<<<<<<<<<<<< + * datetimes = np.empty(n, dtype='M8[ns]') + * idatetimes = datetimes.view(np.int64) + */ + __pyx_t_15 = (__pyx_v_convert_datetime != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":590 + * + * if convert_datetime: + * datetimes = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * idatetimes = datetimes.view(np.int64) + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_datetimes = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":591 + * if convert_datetime: + * datetimes = np.empty(n, dtype='M8[ns]') + * idatetimes = datetimes.view(np.int64) # <<<<<<<<<<<<<< + * + * if convert_timedelta: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetimes, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer, (PyObject*)__pyx_v_idatetimes, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_idatetimes.diminfo[0].strides = __pyx_pybuffernd_idatetimes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idatetimes.diminfo[0].shape = __pyx_pybuffernd_idatetimes.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = 0; + __pyx_v_idatetimes = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/inference.pyx":593 + * idatetimes = datetimes.view(np.int64) + * + * if convert_timedelta: # <<<<<<<<<<<<<< + * timedeltas = np.empty(n, dtype='m8[ns]') + * itimedeltas = timedeltas.view(np.int64) + */ + __pyx_t_15 = (__pyx_v_convert_timedelta != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":594 + * + * if convert_timedelta: + * timedeltas = np.empty(n, dtype='m8[ns]') # <<<<<<<<<<<<<< + * itimedeltas = timedeltas.view(np.int64) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_kp_s_m8_ns) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_timedeltas = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":595 + * if convert_timedelta: + * timedeltas = np.empty(n, dtype='m8[ns]') + * itimedeltas = timedeltas.view(np.int64) # <<<<<<<<<<<<<< + * + * onan = np.nan + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timedeltas, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = ((PyArrayObject *)__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_itimedeltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_itimedeltas.diminfo[0].strides = __pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_itimedeltas.diminfo[0].shape = __pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = 0; + __pyx_v_itimedeltas = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":597 + * itimedeltas = timedeltas.view(np.int64) + * + * onan = np.nan # <<<<<<<<<<<<<< + * fnan = np.nan + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_onan = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":598 + * + * onan = np.nan + * fnan = np.nan # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_18 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_fnan = __pyx_t_18; + + /* "pandas/src/inference.pyx":600 + * fnan = np.nan + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = objects[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":601 + * + * for i from 0 <= i < n: + * val = objects[i] # <<<<<<<<<<<<<< + * + * if val is None: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_objects.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_objects.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_objects.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_objects.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":603 + * val = objects[i] + * + * if val is None: # <<<<<<<<<<<<<< + * seen_null = 1 + * floats[i] = complexes[i] = fnan + */ + __pyx_t_15 = (__pyx_v_val == Py_None); + __pyx_t_20 = (__pyx_t_15 != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":604 + * + * if val is None: + * seen_null = 1 # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = fnan + * elif util.is_bool_object(val): + */ + __pyx_v_seen_null = 1; + + /* "pandas/src/inference.pyx":605 + * if val is None: + * seen_null = 1 + * floats[i] = complexes[i] = fnan # <<<<<<<<<<<<<< + * elif util.is_bool_object(val): + * seen_bool = 1 + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_v_fnan; + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(__pyx_v_fnan, 0); + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":606 + * seen_null = 1 + * floats[i] = complexes[i] = fnan + * elif util.is_bool_object(val): # <<<<<<<<<<<<<< + * seen_bool = 1 + * bools[i] = val + */ + __pyx_t_20 = (is_bool_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":607 + * floats[i] = complexes[i] = fnan + * elif util.is_bool_object(val): + * seen_bool = 1 # <<<<<<<<<<<<<< + * bools[i] = val + * elif util.is_float_object(val): + */ + __pyx_v_seen_bool = 1; + + /* "pandas/src/inference.pyx":608 + * elif util.is_bool_object(val): + * seen_bool = 1 + * bools[i] = val # <<<<<<<<<<<<<< + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val + */ + __pyx_t_23 = __Pyx_PyInt_As_npy_uint8(__pyx_v_val); if (unlikely((__pyx_t_23 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_bools.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_bools.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_bools.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_bools.diminfo[0].strides) = __pyx_t_23; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":609 + * seen_bool = 1 + * bools[i] = val + * elif util.is_float_object(val): # <<<<<<<<<<<<<< + * floats[i] = complexes[i] = val + * seen_float = 1 + */ + __pyx_t_20 = (is_float_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":610 + * bools[i] = val + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val # <<<<<<<<<<<<<< + * seen_float = 1 + * elif util.is_datetime64_object(val): + */ + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_18 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_25 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_18; + __pyx_t_26 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_27 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_26; + + /* "pandas/src/inference.pyx":611 + * elif util.is_float_object(val): + * floats[i] = complexes[i] = val + * seen_float = 1 # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * if convert_datetime: + */ + __pyx_v_seen_float = 1; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":612 + * floats[i] = complexes[i] = val + * seen_float = 1 + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * if convert_datetime: + * idatetimes[i] = convert_to_tsobject(val, None, None).value + */ + __pyx_t_20 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":613 + * seen_float = 1 + * elif util.is_datetime64_object(val): + * if convert_datetime: # <<<<<<<<<<<<<< + * idatetimes[i] = convert_to_tsobject(val, None, None).value + * seen_datetime = 1 + */ + __pyx_t_20 = (__pyx_v_convert_datetime != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":614 + * elif util.is_datetime64_object(val): + * if convert_datetime: + * idatetimes[i] = convert_to_tsobject(val, None, None).value # <<<<<<<<<<<<<< + * seen_datetime = 1 + * else: + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_val, Py_None, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_28 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_idatetimes.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_idatetimes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idatetimes.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_idatetimes.diminfo[0].strides) = __pyx_t_28; + + /* "pandas/src/inference.pyx":615 + * if convert_datetime: + * idatetimes[i] = convert_to_tsobject(val, None, None).value + * seen_datetime = 1 # <<<<<<<<<<<<<< + * else: + * seen_object = 1 + */ + __pyx_v_seen_datetime = 1; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/inference.pyx":617 + * seen_datetime = 1 + * else: + * seen_object = 1 # <<<<<<<<<<<<<< + * # objects[i] = val.astype('O') + * break + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":619 + * seen_object = 1 + * # objects[i] = val.astype('O') + * break # <<<<<<<<<<<<<< + * elif is_timedelta(val): + * if convert_timedelta: + */ + goto __pyx_L6_break; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":620 + * # objects[i] = val.astype('O') + * break + * elif is_timedelta(val): # <<<<<<<<<<<<<< + * if convert_timedelta: + * itimedeltas[i] = convert_to_timedelta64(val, 'ns', False) + */ + __pyx_t_20 = (__pyx_f_6pandas_3lib_is_timedelta(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":621 + * break + * elif is_timedelta(val): + * if convert_timedelta: # <<<<<<<<<<<<<< + * itimedeltas[i] = convert_to_timedelta64(val, 'ns', False) + * seen_timedelta = 1 + */ + __pyx_t_20 = (__pyx_v_convert_timedelta != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":622 + * elif is_timedelta(val): + * if convert_timedelta: + * itimedeltas[i] = convert_to_timedelta64(val, 'ns', False) # <<<<<<<<<<<<<< + * seen_timedelta = 1 + * else: + */ + __pyx_t_4 = __pyx_f_6pandas_5tslib_convert_to_timedelta64(__pyx_v_val, __pyx_n_s_ns, Py_False); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_28 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_30 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_itimedeltas.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_itimedeltas.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_itimedeltas.diminfo[0].strides) = __pyx_t_28; + + /* "pandas/src/inference.pyx":623 + * if convert_timedelta: + * itimedeltas[i] = convert_to_timedelta64(val, 'ns', False) + * seen_timedelta = 1 # <<<<<<<<<<<<<< + * else: + * seen_object = 1 + */ + __pyx_v_seen_timedelta = 1; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/inference.pyx":625 + * seen_timedelta = 1 + * else: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * elif util.is_integer_object(val): + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":626 + * else: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * elif util.is_integer_object(val): + * seen_int = 1 + */ + goto __pyx_L6_break; + } + __pyx_L9:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":627 + * seen_object = 1 + * break + * elif util.is_integer_object(val): # <<<<<<<<<<<<<< + * seen_int = 1 + * floats[i] = val + */ + __pyx_t_20 = (is_integer_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":628 + * break + * elif util.is_integer_object(val): + * seen_int = 1 # <<<<<<<<<<<<<< + * floats[i] = val + * complexes[i] = val + */ + __pyx_v_seen_int = 1; + + /* "pandas/src/inference.pyx":629 + * elif util.is_integer_object(val): + * seen_int = 1 + * floats[i] = val # <<<<<<<<<<<<<< + * complexes[i] = val + * if not seen_null: + */ + __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_18 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_31 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_floats.diminfo[0].strides) = ((__pyx_t_5numpy_float64_t)__pyx_t_18); + + /* "pandas/src/inference.pyx":630 + * seen_int = 1 + * floats[i] = val + * complexes[i] = val # <<<<<<<<<<<<<< + * if not seen_null: + * try: + */ + __pyx_t_26 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_32 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_double_complex_from_parts(((double)__Pyx_CREAL(__pyx_t_26)), ((double)__Pyx_CIMAG(__pyx_t_26))); + + /* "pandas/src/inference.pyx":631 + * floats[i] = val + * complexes[i] = val + * if not seen_null: # <<<<<<<<<<<<<< + * try: + * ints[i] = val + */ + __pyx_t_20 = ((!(__pyx_v_seen_null != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":632 + * complexes[i] = val + * if not seen_null: + * try: # <<<<<<<<<<<<<< + * ints[i] = val + * except OverflowError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/src/inference.pyx":633 + * if not seen_null: + * try: + * ints[i] = val # <<<<<<<<<<<<<< + * except OverflowError: + * seen_object = 1 + */ + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_28 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __pyx_t_33 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_ints.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ints.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ints.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_ints.diminfo[0].strides) = __pyx_t_28; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L18_try_end; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":634 + * try: + * ints[i] = val + * except OverflowError: # <<<<<<<<<<<<<< + * seen_object = 1 + * break + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/src/inference.pyx":635 + * ints[i] = val + * except OverflowError: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * elif util.is_complex_object(val): + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":636 + * except OverflowError: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * elif util.is_complex_object(val): + * complexes[i] = val + */ + goto __pyx_L19_except_break; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L12_exception_handled; + __pyx_L19_except_break:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L16_try_break; + } + goto __pyx_L13_except_error; + __pyx_L13_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L16_try_break:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L6_break; + __pyx_L12_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L18_try_end:; + } + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":637 + * seen_object = 1 + * break + * elif util.is_complex_object(val): # <<<<<<<<<<<<<< + * complexes[i] = val + * seen_complex = 1 + */ + __pyx_t_20 = (is_complex_object(__pyx_v_val) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":638 + * break + * elif util.is_complex_object(val): + * complexes[i] = val # <<<<<<<<<<<<<< + * seen_complex = 1 + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): + */ + __pyx_t_26 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_34 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_26; + + /* "pandas/src/inference.pyx":639 + * elif util.is_complex_object(val): + * complexes[i] = val + * seen_complex = 1 # <<<<<<<<<<<<<< + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): + * if convert_datetime: + */ + __pyx_v_seen_complex = 1; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":640 + * complexes[i] = val + * seen_complex = 1 + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * if convert_datetime: + * seen_datetime = 1 + */ + __pyx_t_20 = PyDateTime_Check(__pyx_v_val); + if (!__pyx_t_20) { + __pyx_t_15 = (is_datetime64_object(__pyx_v_val) != 0); + } else { + __pyx_t_15 = __pyx_t_20; + } + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":641 + * seen_complex = 1 + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): + * if convert_datetime: # <<<<<<<<<<<<<< + * seen_datetime = 1 + * idatetimes[i] = convert_to_tsobject(val, None, None).value + */ + __pyx_t_15 = (__pyx_v_convert_datetime != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":642 + * elif PyDateTime_Check(val) or util.is_datetime64_object(val): + * if convert_datetime: + * seen_datetime = 1 # <<<<<<<<<<<<<< + * idatetimes[i] = convert_to_tsobject(val, None, None).value + * else: + */ + __pyx_v_seen_datetime = 1; + + /* "pandas/src/inference.pyx":643 + * if convert_datetime: + * seen_datetime = 1 + * idatetimes[i] = convert_to_tsobject(val, None, None).value # <<<<<<<<<<<<<< + * else: + * seen_object = 1 + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_val, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_28 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_35 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_idatetimes.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_idatetimes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idatetimes.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_idatetimes.diminfo[0].strides) = __pyx_t_28; + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/inference.pyx":645 + * idatetimes[i] = convert_to_tsobject(val, None, None).value + * else: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * elif try_float and not util.is_string_object(val): + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":646 + * else: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * elif try_float and not util.is_string_object(val): + * # this will convert Decimal objects + */ + goto __pyx_L6_break; + } + __pyx_L21:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":647 + * seen_object = 1 + * break + * elif try_float and not util.is_string_object(val): # <<<<<<<<<<<<<< + * # this will convert Decimal objects + * try: + */ + if ((__pyx_v_try_float != 0)) { + __pyx_t_15 = ((!(is_string_object(__pyx_v_val) != 0)) != 0); + __pyx_t_20 = __pyx_t_15; + } else { + __pyx_t_20 = (__pyx_v_try_float != 0); + } + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":649 + * elif try_float and not util.is_string_object(val): + * # this will convert Decimal objects + * try: # <<<<<<<<<<<<<< + * floats[i] = float(val) + * complexes[i] = complex(val) + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/inference.pyx":650 + * # this will convert Decimal objects + * try: + * floats[i] = float(val) # <<<<<<<<<<<<<< + * complexes[i] = complex(val) + * seen_float = 1 + */ + __pyx_t_36 = __Pyx_PyObject_AsDouble(__pyx_v_val); if (unlikely(__pyx_t_36 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_37 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_floats.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_floats.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_floats.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_floats.diminfo[0].strides) = __pyx_t_36; + + /* "pandas/src/inference.pyx":651 + * try: + * floats[i] = float(val) + * complexes[i] = complex(val) # <<<<<<<<<<<<<< + * seen_float = 1 + * except Exception: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyComplex_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_26 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_38 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_complexes.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_complexes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_complexes.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_complexes.diminfo[0].strides) = __pyx_t_26; + + /* "pandas/src/inference.pyx":652 + * floats[i] = float(val) + * complexes[i] = complex(val) + * seen_float = 1 # <<<<<<<<<<<<<< + * except Exception: + * seen_object = 1 + */ + __pyx_v_seen_float = 1; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":653 + * complexes[i] = complex(val) + * seen_float = 1 + * except Exception: # <<<<<<<<<<<<<< + * seen_object = 1 + * break + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":654 + * seen_float = 1 + * except Exception: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":655 + * except Exception: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * else: + * seen_object = 1 + */ + goto __pyx_L30_except_break; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L23_exception_handled; + __pyx_L30_except_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L27_try_break; + } + goto __pyx_L24_except_error; + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L27_try_break:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L6_break; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L29_try_end:; + } + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/inference.pyx":657 + * break + * else: + * seen_object = 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_seen_object = 1; + + /* "pandas/src/inference.pyx":658 + * else: + * seen_object = 1 + * break # <<<<<<<<<<<<<< + * + * seen_numeric = seen_complex or seen_float or seen_int + */ + goto __pyx_L6_break; + } + __pyx_L7:; + } + __pyx_L6_break:; + + /* "pandas/src/inference.pyx":660 + * break + * + * seen_numeric = seen_complex or seen_float or seen_int # <<<<<<<<<<<<<< + * + * if not seen_object: + */ + if (!__pyx_v_seen_complex) { + if (!__pyx_v_seen_float) { + __pyx_t_20 = __pyx_v_seen_int; + } else { + __pyx_t_20 = __pyx_v_seen_float; + } + __pyx_t_15 = __pyx_t_20; + } else { + __pyx_t_15 = __pyx_v_seen_complex; + } + __pyx_v_seen_numeric = __pyx_t_15; + + /* "pandas/src/inference.pyx":662 + * seen_numeric = seen_complex or seen_float or seen_int + * + * if not seen_object: # <<<<<<<<<<<<<< + * + * if not safe: + */ + __pyx_t_15 = ((!(__pyx_v_seen_object != 0)) != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":664 + * if not seen_object: + * + * if not safe: # <<<<<<<<<<<<<< + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: + */ + __pyx_t_15 = ((!(__pyx_v_safe != 0)) != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":665 + * + * if not safe: + * if seen_null: # <<<<<<<<<<<<<< + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: + */ + __pyx_t_15 = (__pyx_v_seen_null != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":666 + * if not safe: + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: # <<<<<<<<<<<<<< + * if seen_complex: + * return complexes + */ + __pyx_t_15 = ((!(__pyx_v_seen_bool != 0)) != 0); + if (__pyx_t_15) { + __pyx_t_20 = ((!(__pyx_v_seen_datetime != 0)) != 0); + if (__pyx_t_20) { + __pyx_t_39 = ((!(__pyx_v_seen_timedelta != 0)) != 0); + __pyx_t_40 = __pyx_t_39; + } else { + __pyx_t_40 = __pyx_t_20; + } + __pyx_t_20 = __pyx_t_40; + } else { + __pyx_t_20 = __pyx_t_15; + } + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":667 + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float or seen_int: + */ + __pyx_t_20 = (__pyx_v_seen_complex != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":668 + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float or seen_int: + * return floats + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":669 + * if seen_complex: + * return complexes + * elif seen_float or seen_int: # <<<<<<<<<<<<<< + * return floats + * else: + */ + if (!(__pyx_v_seen_float != 0)) { + __pyx_t_20 = (__pyx_v_seen_int != 0); + } else { + __pyx_t_20 = (__pyx_v_seen_float != 0); + } + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":670 + * return complexes + * elif seen_float or seen_int: + * return floats # <<<<<<<<<<<<<< + * else: + * if not seen_bool: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + goto __pyx_L35; + } + __pyx_L35:; + goto __pyx_L34; + } + /*else*/ { + + /* "pandas/src/inference.pyx":672 + * return floats + * else: + * if not seen_bool: # <<<<<<<<<<<<<< + * if seen_datetime: + * if not seen_numeric: + */ + __pyx_t_20 = ((!(__pyx_v_seen_bool != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":673 + * else: + * if not seen_bool: + * if seen_datetime: # <<<<<<<<<<<<<< + * if not seen_numeric: + * return datetimes + */ + __pyx_t_20 = (__pyx_v_seen_datetime != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":674 + * if not seen_bool: + * if seen_datetime: + * if not seen_numeric: # <<<<<<<<<<<<<< + * return datetimes + * elif seen_timedelta: + */ + __pyx_t_20 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":675 + * if seen_datetime: + * if not seen_numeric: + * return datetimes # <<<<<<<<<<<<<< + * elif seen_timedelta: + * if not seen_numeric: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_datetimes)) { __Pyx_RaiseUnboundLocalError("datetimes"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_datetimes); + __pyx_r = __pyx_v_datetimes; + goto __pyx_L0; + } + goto __pyx_L38; + } + + /* "pandas/src/inference.pyx":676 + * if not seen_numeric: + * return datetimes + * elif seen_timedelta: # <<<<<<<<<<<<<< + * if not seen_numeric: + * return timedeltas + */ + __pyx_t_20 = (__pyx_v_seen_timedelta != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":677 + * return datetimes + * elif seen_timedelta: + * if not seen_numeric: # <<<<<<<<<<<<<< + * return timedeltas + * else: + */ + __pyx_t_20 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":678 + * elif seen_timedelta: + * if not seen_numeric: + * return timedeltas # <<<<<<<<<<<<<< + * else: + * if seen_complex: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_timedeltas)) { __Pyx_RaiseUnboundLocalError("timedeltas"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_timedeltas); + __pyx_r = __pyx_v_timedeltas; + goto __pyx_L0; + } + goto __pyx_L38; + } + /*else*/ { + + /* "pandas/src/inference.pyx":680 + * return timedeltas + * else: + * if seen_complex: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float: + */ + __pyx_t_20 = (__pyx_v_seen_complex != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":681 + * else: + * if seen_complex: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float: + * return floats + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":682 + * if seen_complex: + * return complexes + * elif seen_float: # <<<<<<<<<<<<<< + * return floats + * elif seen_int: + */ + __pyx_t_20 = (__pyx_v_seen_float != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":683 + * return complexes + * elif seen_float: + * return floats # <<<<<<<<<<<<<< + * elif seen_int: + * return ints + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":684 + * elif seen_float: + * return floats + * elif seen_int: # <<<<<<<<<<<<<< + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + */ + __pyx_t_20 = (__pyx_v_seen_int != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":685 + * return floats + * elif seen_int: + * return ints # <<<<<<<<<<<<<< + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + * return bools.view(np.bool_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ints)); + __pyx_r = ((PyObject *)__pyx_v_ints); + goto __pyx_L0; + } + } + __pyx_L38:; + goto __pyx_L37; + } + + /* "pandas/src/inference.pyx":686 + * elif seen_int: + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: # <<<<<<<<<<<<<< + * return bools.view(np.bool_) + * + */ + __pyx_t_20 = ((!(__pyx_v_seen_datetime != 0)) != 0); + if (__pyx_t_20) { + __pyx_t_15 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_15) { + __pyx_t_40 = ((!(__pyx_v_seen_timedelta != 0)) != 0); + __pyx_t_39 = __pyx_t_40; + } else { + __pyx_t_39 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_39; + } else { + __pyx_t_15 = __pyx_t_20; + } + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":687 + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + * return bools.view(np.bool_) # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bools), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + __pyx_L37:; + } + __pyx_L34:; + goto __pyx_L33; + } + /*else*/ { + + /* "pandas/src/inference.pyx":691 + * else: + * # don't cast int to float, etc. + * if seen_null: # <<<<<<<<<<<<<< + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: + */ + __pyx_t_15 = (__pyx_v_seen_null != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":692 + * # don't cast int to float, etc. + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: # <<<<<<<<<<<<<< + * if seen_complex: + * if not seen_int: + */ + __pyx_t_15 = ((!(__pyx_v_seen_bool != 0)) != 0); + if (__pyx_t_15) { + __pyx_t_20 = ((!(__pyx_v_seen_datetime != 0)) != 0); + if (__pyx_t_20) { + __pyx_t_39 = ((!(__pyx_v_seen_timedelta != 0)) != 0); + __pyx_t_40 = __pyx_t_39; + } else { + __pyx_t_40 = __pyx_t_20; + } + __pyx_t_20 = __pyx_t_40; + } else { + __pyx_t_20 = __pyx_t_15; + } + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":693 + * if seen_null: + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: # <<<<<<<<<<<<<< + * if not seen_int: + * return complexes + */ + __pyx_t_20 = (__pyx_v_seen_complex != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":694 + * if not seen_bool and not seen_datetime and not seen_timedelta: + * if seen_complex: + * if not seen_int: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float: + */ + __pyx_t_20 = ((!(__pyx_v_seen_int != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":695 + * if seen_complex: + * if not seen_int: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float: + * if not seen_int: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + goto __pyx_L44; + } + + /* "pandas/src/inference.pyx":696 + * if not seen_int: + * return complexes + * elif seen_float: # <<<<<<<<<<<<<< + * if not seen_int: + * return floats + */ + __pyx_t_20 = (__pyx_v_seen_float != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":697 + * return complexes + * elif seen_float: + * if not seen_int: # <<<<<<<<<<<<<< + * return floats + * else: + */ + __pyx_t_20 = ((!(__pyx_v_seen_int != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":698 + * elif seen_float: + * if not seen_int: + * return floats # <<<<<<<<<<<<<< + * else: + * if not seen_bool: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + goto __pyx_L44; + } + __pyx_L44:; + goto __pyx_L43; + } + __pyx_L43:; + goto __pyx_L42; + } + /*else*/ { + + /* "pandas/src/inference.pyx":700 + * return floats + * else: + * if not seen_bool: # <<<<<<<<<<<<<< + * if seen_datetime: + * if not seen_numeric: + */ + __pyx_t_20 = ((!(__pyx_v_seen_bool != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":701 + * else: + * if not seen_bool: + * if seen_datetime: # <<<<<<<<<<<<<< + * if not seen_numeric: + * return datetimes + */ + __pyx_t_20 = (__pyx_v_seen_datetime != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":702 + * if not seen_bool: + * if seen_datetime: + * if not seen_numeric: # <<<<<<<<<<<<<< + * return datetimes + * elif seen_timedelta: + */ + __pyx_t_20 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":703 + * if seen_datetime: + * if not seen_numeric: + * return datetimes # <<<<<<<<<<<<<< + * elif seen_timedelta: + * if not seen_numeric: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_datetimes)) { __Pyx_RaiseUnboundLocalError("datetimes"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_datetimes); + __pyx_r = __pyx_v_datetimes; + goto __pyx_L0; + } + goto __pyx_L48; + } + + /* "pandas/src/inference.pyx":704 + * if not seen_numeric: + * return datetimes + * elif seen_timedelta: # <<<<<<<<<<<<<< + * if not seen_numeric: + * return timedeltas + */ + __pyx_t_20 = (__pyx_v_seen_timedelta != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":705 + * return datetimes + * elif seen_timedelta: + * if not seen_numeric: # <<<<<<<<<<<<<< + * return timedeltas + * else: + */ + __pyx_t_20 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":706 + * elif seen_timedelta: + * if not seen_numeric: + * return timedeltas # <<<<<<<<<<<<<< + * else: + * if seen_complex: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_timedeltas)) { __Pyx_RaiseUnboundLocalError("timedeltas"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_timedeltas); + __pyx_r = __pyx_v_timedeltas; + goto __pyx_L0; + } + goto __pyx_L48; + } + /*else*/ { + + /* "pandas/src/inference.pyx":708 + * return timedeltas + * else: + * if seen_complex: # <<<<<<<<<<<<<< + * if not seen_int: + * return complexes + */ + __pyx_t_20 = (__pyx_v_seen_complex != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":709 + * else: + * if seen_complex: + * if not seen_int: # <<<<<<<<<<<<<< + * return complexes + * elif seen_float: + */ + __pyx_t_20 = ((!(__pyx_v_seen_int != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":710 + * if seen_complex: + * if not seen_int: + * return complexes # <<<<<<<<<<<<<< + * elif seen_float: + * if not seen_int: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_complexes)); + __pyx_r = ((PyObject *)__pyx_v_complexes); + goto __pyx_L0; + } + goto __pyx_L51; + } + + /* "pandas/src/inference.pyx":711 + * if not seen_int: + * return complexes + * elif seen_float: # <<<<<<<<<<<<<< + * if not seen_int: + * return floats + */ + __pyx_t_20 = (__pyx_v_seen_float != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":712 + * return complexes + * elif seen_float: + * if not seen_int: # <<<<<<<<<<<<<< + * return floats + * elif seen_int: + */ + __pyx_t_20 = ((!(__pyx_v_seen_int != 0)) != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":713 + * elif seen_float: + * if not seen_int: + * return floats # <<<<<<<<<<<<<< + * elif seen_int: + * return ints + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_floats)); + __pyx_r = ((PyObject *)__pyx_v_floats); + goto __pyx_L0; + } + goto __pyx_L51; + } + + /* "pandas/src/inference.pyx":714 + * if not seen_int: + * return floats + * elif seen_int: # <<<<<<<<<<<<<< + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + */ + __pyx_t_20 = (__pyx_v_seen_int != 0); + if (__pyx_t_20) { + + /* "pandas/src/inference.pyx":715 + * return floats + * elif seen_int: + * return ints # <<<<<<<<<<<<<< + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + * return bools.view(np.bool_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ints)); + __pyx_r = ((PyObject *)__pyx_v_ints); + goto __pyx_L0; + } + __pyx_L51:; + } + __pyx_L48:; + goto __pyx_L47; + } + + /* "pandas/src/inference.pyx":716 + * elif seen_int: + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: # <<<<<<<<<<<<<< + * return bools.view(np.bool_) + * + */ + __pyx_t_20 = ((!(__pyx_v_seen_datetime != 0)) != 0); + if (__pyx_t_20) { + __pyx_t_15 = ((!(__pyx_v_seen_numeric != 0)) != 0); + if (__pyx_t_15) { + __pyx_t_40 = ((!(__pyx_v_seen_timedelta != 0)) != 0); + __pyx_t_39 = __pyx_t_40; + } else { + __pyx_t_39 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_39; + } else { + __pyx_t_15 = __pyx_t_20; + } + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":717 + * return ints + * elif not seen_datetime and not seen_numeric and not seen_timedelta: + * return bools.view(np.bool_) # <<<<<<<<<<<<<< + * + * return objects + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bools), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + __pyx_L47:; + } + __pyx_L42:; + } + __pyx_L33:; + goto __pyx_L32; + } + __pyx_L32:; + + /* "pandas/src/inference.pyx":719 + * return bools.view(np.bool_) + * + * return objects # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_objects)); + __pyx_r = ((PyObject *)__pyx_v_objects); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":556 + * + * + * def maybe_convert_objects(ndarray[object] objects, bint try_float=0, # <<<<<<<<<<<<<< + * bint safe=0, bint convert_datetime=0, + * bint convert_timedelta=0): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_13); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objects.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bools.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_complexes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_floats.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idatetimes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ints.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_itimedeltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_objects.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_floats); + __Pyx_XDECREF((PyObject *)__pyx_v_complexes); + __Pyx_XDECREF((PyObject *)__pyx_v_ints); + __Pyx_XDECREF((PyObject *)__pyx_v_bools); + __Pyx_XDECREF((PyObject *)__pyx_v_idatetimes); + __Pyx_XDECREF((PyObject *)__pyx_v_itimedeltas); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_onan); + __Pyx_XDECREF(__pyx_v_datetimes); + __Pyx_XDECREF(__pyx_v_timedeltas); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":722 + * + * + * def convert_sql_column(x): # <<<<<<<<<<<<<< + * return maybe_convert_objects(x, try_float=1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_172convert_sql_column(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_172convert_sql_column = {__Pyx_NAMESTR("convert_sql_column"), (PyCFunction)__pyx_pw_6pandas_3lib_172convert_sql_column, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_172convert_sql_column(PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_sql_column (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_171convert_sql_column(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_171convert_sql_column(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_sql_column", 0); + + /* "pandas/src/inference.pyx":723 + * + * def convert_sql_column(x): + * return maybe_convert_objects(x, try_float=1) # <<<<<<<<<<<<<< + * + * def try_parse_dates(ndarray[object] values, parser=None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_try_float, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":722 + * + * + * def convert_sql_column(x): # <<<<<<<<<<<<<< + * return maybe_convert_objects(x, try_float=1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.lib.convert_sql_column", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_174try_parse_dates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_174try_parse_dates = {__Pyx_NAMESTR("try_parse_dates"), (PyCFunction)__pyx_pw_6pandas_3lib_174try_parse_dates, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_174try_parse_dates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_parser = 0; + PyObject *__pyx_v_dayfirst = 0; + PyObject *__pyx_v_default = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("try_parse_dates (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_parser,&__pyx_n_s_dayfirst,&__pyx_n_s_default,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + + /* "pandas/src/inference.pyx":726 + * + * def try_parse_dates(ndarray[object] values, parser=None, + * dayfirst=False,default=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dayfirst); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "try_parse_dates") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_parser = values[1]; + __pyx_v_dayfirst = values[2]; + __pyx_v_default = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("try_parse_dates", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_173try_parse_dates(__pyx_self, __pyx_v_values, __pyx_v_parser, __pyx_v_dayfirst, __pyx_v_default); + + /* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":743 + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return datetime.strptime(s, '%m/%d/%Y') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_15try_parse_dates_1parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_15try_parse_dates_1parse_date = {__Pyx_NAMESTR("parse_date"), (PyCFunction)__pyx_pw_6pandas_3lib_15try_parse_dates_1parse_date, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_15try_parse_dates_1parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parse_date (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_15try_parse_dates_parse_date(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_15try_parse_dates_parse_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_date", 0); + + /* "pandas/src/inference.pyx":744 + * except ImportError: # pragma: no cover + * def parse_date(s): + * try: # <<<<<<<<<<<<<< + * return datetime.strptime(s, '%m/%d/%Y') + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/inference.pyx":745 + * def parse_date(s): + * try: + * return datetime.strptime(s, '%m/%d/%Y') # <<<<<<<<<<<<<< + * except Exception: + * return s + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __Pyx_INCREF(__pyx_kp_s_m_d_Y); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_m_d_Y); + __Pyx_GIVEREF(__pyx_kp_s_m_d_Y); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":746 + * try: + * return datetime.strptime(s, '%m/%d/%Y') + * except Exception: # <<<<<<<<<<<<<< + * return s + * # EAFP here + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_dates.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":747 + * return datetime.strptime(s, '%m/%d/%Y') + * except Exception: + * return s # <<<<<<<<<<<<<< + * # EAFP here + * try: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/inference.pyx":743 + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return datetime.strptime(s, '%m/%d/%Y') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.try_parse_dates.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":741 + * try: + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_date(s): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_15try_parse_dates_2lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_15try_parse_dates_2lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_6pandas_3lib_15try_parse_dates_2lambda1, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_15try_parse_dates_2lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lambda1", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_v_dayfirst)) { __Pyx_RaiseClosureNameError("dayfirst"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dayfirst, __pyx_cur_scope->__pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_default)) { __Pyx_RaiseClosureNameError("default"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_cur_scope->__pyx_v_default) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_parse, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.try_parse_dates.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + +static PyObject *__pyx_pf_6pandas_3lib_173try_parse_dates(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_parser, PyObject *__pyx_v_dayfirst, PyObject *__pyx_v_default) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *__pyx_cur_scope; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_date = NULL; + PyObject *__pyx_v_parse_date = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("try_parse_dates", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)__pyx_tp_new_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(__pyx_ptype_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_dayfirst = __pyx_v_dayfirst; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dayfirst); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dayfirst); + __pyx_cur_scope->__pyx_v_default = __pyx_v_default; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":731 + * ndarray[object] result + * + * n = len(values) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":732 + * + * n = len(values) + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * if parser is None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":734 + * result = np.empty(n, dtype='O') + * + * if parser is None: # <<<<<<<<<<<<<< + * if default is None: # GH2618 + * date=datetime.now() + */ + __pyx_t_11 = (__pyx_v_parser == Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":735 + * + * if parser is None: + * if default is None: # GH2618 # <<<<<<<<<<<<<< + * date=datetime.now() + * default=datetime(date.year,date.month,1) + */ + __pyx_t_12 = (__pyx_cur_scope->__pyx_v_default == Py_None); + __pyx_t_11 = (__pyx_t_12 != 0); + if (__pyx_t_11) { + + /* "pandas/src/inference.pyx":736 + * if parser is None: + * if default is None: # GH2618 + * date=datetime.now() # <<<<<<<<<<<<<< + * default=datetime(date.year,date.month,1) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_now); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_date = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":737 + * if default is None: # GH2618 + * date=datetime.now() + * default=datetime(date.year,date.month,1) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_default); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_default, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":739 + * default=datetime(date.year,date.month,1) + * + * try: # <<<<<<<<<<<<<< + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/inference.pyx":740 + * + * try: + * from dateutil.parser import parse # <<<<<<<<<<<<<< + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_parse); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_parse); + __Pyx_GIVEREF(__pyx_n_s_parse); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_dateutil_parser, __pyx_t_5, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_parse); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_cur_scope->__pyx_v_parse = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":741 + * try: + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_date(s): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_15try_parse_dates_2lambda1, 0, __pyx_n_s_try_parse_dates_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_parse_date = __pyx_t_4; + __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":742 + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover # <<<<<<<<<<<<<< + * def parse_date(s): + * try: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/src/inference.pyx":743 + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return datetime.strptime(s, '%m/%d/%Y') + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_15try_parse_dates_1parse_date, 0, __pyx_n_s_try_parse_dates_locals_parse_dat, NULL, __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_parse_date, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L6_exception_handled; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L12_try_end:; + } + + /* "pandas/src/inference.pyx":749 + * return s + * # EAFP here + * try: # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * if values[i] == '': + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/src/inference.pyx":750 + * # EAFP here + * try: + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * if values[i] == '': + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":751 + * try: + * for i from 0 <= i < n: + * if values[i] == '': # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__49, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_11) { + + /* "pandas/src/inference.pyx":752 + * for i from 0 <= i < n: + * if values[i] == '': + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * result[i] = parse_date(values[i]) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/src/inference.pyx":754 + * result[i] = np.nan + * else: + * result[i] = parse_date(values[i]) # <<<<<<<<<<<<<< + * except Exception: + * # failed + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_parse_date, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L25:; + } + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L22_try_end; + __pyx_L15_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":755 + * else: + * result[i] = parse_date(values[i]) + * except Exception: # <<<<<<<<<<<<<< + * # failed + * return values + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":757 + * except Exception: + * # failed + * return values # <<<<<<<<<<<<<< + * else: + * parse_date = parser + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_r = ((PyObject *)__pyx_v_values); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_except_return; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L16_exception_handled; + } + goto __pyx_L17_except_error; + __pyx_L17_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L18_except_return:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L0; + __pyx_L16_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L22_try_end:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/inference.pyx":759 + * return values + * else: + * parse_date = parser # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_INCREF(__pyx_v_parser); + __pyx_v_parse_date = __pyx_v_parser; + + /* "pandas/src/inference.pyx":761 + * parse_date = parser + * + * try: # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * if values[i] == '': + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/src/inference.pyx":762 + * + * try: + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * if values[i] == '': + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":763 + * try: + * for i from 0 <= i < n: + * if values[i] == '': # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + } + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__49, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_11) { + + /* "pandas/src/inference.pyx":764 + * for i from 0 <= i < n: + * if values[i] == '': + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * result[i] = parse_date(values[i]) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L38; + } + /*else*/ { + + /* "pandas/src/inference.pyx":766 + * result[i] = np.nan + * else: + * result[i] = parse_date(values[i]) # <<<<<<<<<<<<<< + * except Exception: + * # raise if passed parser and it failed + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_parse_date, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L38:; + } + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L35_try_end; + __pyx_L28_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":767 + * else: + * result[i] = parse_date(values[i]) + * except Exception: # <<<<<<<<<<<<<< + * # raise if passed parser and it failed + * raise + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/src/inference.pyx":769 + * except Exception: + * # raise if passed parser and it failed + * raise # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_2, __pyx_t_4, __pyx_t_5); + __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L29_exception_handled; + } + goto __pyx_L30_except_error; + __pyx_L30_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L29_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); + __pyx_L35_try_end:; + } + } + __pyx_L3:; + + /* "pandas/src/inference.pyx":771 + * raise + * + * return result # <<<<<<<<<<<<<< + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_date); + __Pyx_XDECREF(__pyx_v_parse_date); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_176try_parse_date_and_time(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_176try_parse_date_and_time = {__Pyx_NAMESTR("try_parse_date_and_time"), (PyCFunction)__pyx_pw_6pandas_3lib_176try_parse_date_and_time, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_176try_parse_date_and_time(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_dates = 0; + PyArrayObject *__pyx_v_times = 0; + PyObject *__pyx_v_date_parser = 0; + PyObject *__pyx_v_time_parser = 0; + PyObject *__pyx_v_dayfirst = 0; + PyObject *__pyx_v_default = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("try_parse_date_and_time (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dates,&__pyx_n_s_times,&__pyx_n_s_date_parser,&__pyx_n_s_time_parser,&__pyx_n_s_dayfirst,&__pyx_n_s_default,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + + /* "pandas/src/inference.pyx":774 + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, + * date_parser=None, time_parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)Py_None); + + /* "pandas/src/inference.pyx":775 + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + values[4] = ((PyObject *)Py_False); + values[5] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dates)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_times)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_date_and_time", 0, 2, 6, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_date_parser); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_time_parser); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dayfirst); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[5] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "try_parse_date_and_time") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dates = ((PyArrayObject *)values[0]); + __pyx_v_times = ((PyArrayObject *)values[1]); + __pyx_v_date_parser = values[2]; + __pyx_v_time_parser = values[3]; + __pyx_v_dayfirst = values[4]; + __pyx_v_default = values[5]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("try_parse_date_and_time", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dates), __pyx_ptype_5numpy_ndarray, 1, "dates", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_times), __pyx_ptype_5numpy_ndarray, 1, "times", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_175try_parse_date_and_time(__pyx_self, __pyx_v_dates, __pyx_v_times, __pyx_v_date_parser, __pyx_v_time_parser, __pyx_v_dayfirst, __pyx_v_default); + + /* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":796 + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return date.strptime(s, '%m/%d/%Y') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_1parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_1parse_date = {__Pyx_NAMESTR("parse_date"), (PyCFunction)__pyx_pw_6pandas_3lib_23try_parse_date_and_time_1parse_date, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_1parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parse_date (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_date", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "pandas/src/inference.pyx":797 + * except ImportError: # pragma: no cover + * def parse_date(s): + * try: # <<<<<<<<<<<<<< + * return date.strptime(s, '%m/%d/%Y') + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/inference.pyx":798 + * def parse_date(s): + * try: + * return date.strptime(s, '%m/%d/%Y') # <<<<<<<<<<<<<< + * except Exception: + * return s + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_date)) { __Pyx_RaiseClosureNameError("date"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_date, __pyx_n_s_strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __Pyx_INCREF(__pyx_kp_s_m_d_Y); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_m_d_Y); + __Pyx_GIVEREF(__pyx_kp_s_m_d_Y); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":799 + * try: + * return date.strptime(s, '%m/%d/%Y') + * except Exception: # <<<<<<<<<<<<<< + * return s + * else: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":800 + * return date.strptime(s, '%m/%d/%Y') + * except Exception: + * return s # <<<<<<<<<<<<<< + * else: + * parse_date = date_parser + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/inference.pyx":796 + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return date.strptime(s, '%m/%d/%Y') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":809 + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + * def parse_time(s): # <<<<<<<<<<<<<< + * try: + * return time.strptime(s, '%H:%M:%S') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_3parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_3parse_time = {__Pyx_NAMESTR("parse_time"), (PyCFunction)__pyx_pw_6pandas_3lib_23try_parse_date_and_time_3parse_time, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_3parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parse_time (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_3lib_23try_parse_date_and_time_2parse_time(__pyx_self, ((PyObject *)__pyx_v_s)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_2parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_time", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "pandas/src/inference.pyx":810 + * except ImportError: # pragma: no cover + * def parse_time(s): + * try: # <<<<<<<<<<<<<< + * return time.strptime(s, '%H:%M:%S') + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/src/inference.pyx":811 + * def parse_time(s): + * try: + * return time.strptime(s, '%H:%M:%S') # <<<<<<<<<<<<<< + * except Exception: + * return s + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_time)) { __Pyx_RaiseClosureNameError("time"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_time, __pyx_n_s_strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s); + __Pyx_GIVEREF(__pyx_v_s); + __Pyx_INCREF(__pyx_kp_s_H_M_S); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_H_M_S); + __Pyx_GIVEREF(__pyx_kp_s_H_M_S); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":812 + * try: + * return time.strptime(s, '%H:%M:%S') + * except Exception: # <<<<<<<<<<<<<< + * return s + * + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/src/inference.pyx":813 + * return time.strptime(s, '%H:%M:%S') + * except Exception: + * return s # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_s); + __pyx_r = __pyx_v_s; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/src/inference.pyx":809 + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + * def parse_time(s): # <<<<<<<<<<<<<< + * try: + * return time.strptime(s, '%H:%M:%S') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":794 + * try: + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_date(s): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_4lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_4lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_pw_6pandas_3lib_23try_parse_date_and_time_4lambda2, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_4lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lambda2", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_v_dayfirst)) { __Pyx_RaiseClosureNameError("dayfirst"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dayfirst, __pyx_cur_scope->__pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_v_default)) { __Pyx_RaiseClosureNameError("default"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_cur_scope->__pyx_v_default) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_parse, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":807 + * try: + * from dateutil.parser import parse + * parse_time = lambda x: parse(x) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_time(s): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_5lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_5lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_pw_6pandas_3lib_23try_parse_date_and_time_5lambda3, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_23try_parse_date_and_time_5lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self, ((PyObject *)__pyx_v_x)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lambda3", 0); + __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_parse, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + +static PyObject *__pyx_pf_6pandas_3lib_175try_parse_date_and_time(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dates, PyArrayObject *__pyx_v_times, PyObject *__pyx_v_date_parser, PyObject *__pyx_v_time_parser, PyObject *__pyx_v_dayfirst, PyObject *__pyx_v_default) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_cur_scope; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_datetime = NULL; + CYTHON_UNUSED PyObject *__pyx_v_timedelta = NULL; + PyObject *__pyx_v_parse_date = NULL; + PyObject *__pyx_v_parse_time = NULL; + PyObject *__pyx_v_d = NULL; + PyObject *__pyx_v_t = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dates; + __Pyx_Buffer __pyx_pybuffer_dates; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_times; + __Pyx_Buffer __pyx_pybuffer_times; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + PyObject **__pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("try_parse_date_and_time", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)__pyx_tp_new_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(__pyx_ptype_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_dayfirst = __pyx_v_dayfirst; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dayfirst); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dayfirst); + __pyx_cur_scope->__pyx_v_default = __pyx_v_default; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_dates.pybuffer.buf = NULL; + __pyx_pybuffer_dates.refcount = 0; + __pyx_pybuffernd_dates.data = NULL; + __pyx_pybuffernd_dates.rcbuffer = &__pyx_pybuffer_dates; + __pyx_pybuffer_times.pybuffer.buf = NULL; + __pyx_pybuffer_times.refcount = 0; + __pyx_pybuffernd_times.data = NULL; + __pyx_pybuffernd_times.rcbuffer = &__pyx_pybuffer_times; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dates.rcbuffer->pybuffer, (PyObject*)__pyx_v_dates, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dates.diminfo[0].strides = __pyx_pybuffernd_dates.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dates.diminfo[0].shape = __pyx_pybuffernd_dates.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_times.rcbuffer->pybuffer, (PyObject*)__pyx_v_times, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_times.diminfo[0].strides = __pyx_pybuffernd_times.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_times.diminfo[0].shape = __pyx_pybuffernd_times.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":780 + * ndarray[object] result + * + * from datetime import date, time, datetime, timedelta # <<<<<<<<<<<<<< + * + * n = len(dates) + */ + __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_date); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_date); + __Pyx_GIVEREF(__pyx_n_s_date); + __Pyx_INCREF(__pyx_n_s_time); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_time); + __Pyx_GIVEREF(__pyx_n_s_time); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __Pyx_INCREF(__pyx_n_s_timedelta); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_timedelta); + __Pyx_GIVEREF(__pyx_n_s_timedelta); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_date = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_time = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_datetime = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_timedelta = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":782 + * from datetime import date, time, datetime, timedelta + * + * n = len(dates) # <<<<<<<<<<<<<< + * if len(times) != n: + * raise ValueError('Length of dates and times must be equal') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_dates)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/src/inference.pyx":783 + * + * n = len(dates) + * if len(times) != n: # <<<<<<<<<<<<<< + * raise ValueError('Length of dates and times must be equal') + * result = np.empty(n, dtype='O') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_times)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":784 + * n = len(dates) + * if len(times) != n: + * raise ValueError('Length of dates and times must be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/inference.pyx":785 + * if len(times) != n: + * raise ValueError('Length of dates and times must be equal') + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * if date_parser is None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":787 + * result = np.empty(n, dtype='O') + * + * if date_parser is None: # <<<<<<<<<<<<<< + * if default is None: # GH2618 + * date=datetime.now() + */ + __pyx_t_4 = (__pyx_v_date_parser == Py_None); + __pyx_t_12 = (__pyx_t_4 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":788 + * + * if date_parser is None: + * if default is None: # GH2618 # <<<<<<<<<<<<<< + * date=datetime.now() + * default=datetime(date.year,date.month,1) + */ + __pyx_t_12 = (__pyx_cur_scope->__pyx_v_default == Py_None); + __pyx_t_4 = (__pyx_t_12 != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":789 + * if date_parser is None: + * if default is None: # GH2618 + * date=datetime.now() # <<<<<<<<<<<<<< + * default=datetime(date.year,date.month,1) + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_now); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_date); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_date, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":790 + * if default is None: # GH2618 + * date=datetime.now() + * default=datetime(date.year,date.month,1) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_date, __pyx_n_s_year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_date, __pyx_n_s_month); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_datetime, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_default); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_default, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/inference.pyx":792 + * default=datetime(date.year,date.month,1) + * + * try: # <<<<<<<<<<<<<< + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/src/inference.pyx":793 + * + * try: + * from dateutil.parser import parse # <<<<<<<<<<<<<< + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + */ + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_parse); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_parse); + __Pyx_GIVEREF(__pyx_n_s_parse); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_dateutil_parser, __pyx_t_6, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_parse); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_cur_scope->__pyx_v_parse = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":794 + * try: + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_date(s): + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_4lambda2, 0, __pyx_n_s_try_parse_date_and_time_locals_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_parse_date = __pyx_t_5; + __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":795 + * from dateutil.parser import parse + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover # <<<<<<<<<<<<<< + * def parse_date(s): + * try: + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/src/inference.pyx":796 + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return date.strptime(s, '%m/%d/%Y') + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_1parse_date, 0, __pyx_n_s_try_parse_date_and_time_locals_p, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_parse_date, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); + __pyx_L13_try_end:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/inference.pyx":802 + * return s + * else: + * parse_date = date_parser # <<<<<<<<<<<<<< + * + * if time_parser is None: + */ + __Pyx_INCREF(__pyx_v_date_parser); + __pyx_v_parse_date = __pyx_v_date_parser; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":804 + * parse_date = date_parser + * + * if time_parser is None: # <<<<<<<<<<<<<< + * try: + * from dateutil.parser import parse + */ + __pyx_t_4 = (__pyx_v_time_parser == Py_None); + __pyx_t_12 = (__pyx_t_4 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":805 + * + * if time_parser is None: + * try: # <<<<<<<<<<<<<< + * from dateutil.parser import parse + * parse_time = lambda x: parse(x) + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "pandas/src/inference.pyx":806 + * if time_parser is None: + * try: + * from dateutil.parser import parse # <<<<<<<<<<<<<< + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_parse); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_parse); + __Pyx_GIVEREF(__pyx_n_s_parse); + __pyx_t_6 = __Pyx_Import(__pyx_n_s_dateutil_parser, __pyx_t_2, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_parse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_parse); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_parse, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":807 + * try: + * from dateutil.parser import parse + * parse_time = lambda x: parse(x) # <<<<<<<<<<<<<< + * except ImportError: # pragma: no cover + * def parse_time(s): + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_5lambda3, 0, __pyx_n_s_try_parse_date_and_time_locals_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_parse_time = __pyx_t_6; + __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":808 + * from dateutil.parser import parse + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover # <<<<<<<<<<<<<< + * def parse_time(s): + * try: + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/src/inference.pyx":809 + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + * def parse_time(s): # <<<<<<<<<<<<<< + * try: + * return time.strptime(s, '%H:%M:%S') + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_3parse_time, 0, __pyx_n_s_try_parse_date_and_time_locals_p_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pandas_lib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_parse_time, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_exception_handled; + } + goto __pyx_L19_except_error; + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L1_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L24_try_end:; + } + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/src/inference.pyx":816 + * + * else: + * parse_time = time_parser # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __Pyx_INCREF(__pyx_v_time_parser); + __pyx_v_parse_time = __pyx_v_time_parser; + } + __pyx_L16:; + + /* "pandas/src/inference.pyx":818 + * parse_time = time_parser + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * d = parse_date(str(dates[i])) + * t = parse_time(str(times[i])) + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":819 + * + * for i from 0 <= i < n: + * d = parse_date(str(dates[i])) # <<<<<<<<<<<<<< + * t = parse_time(str(times[i])) + * result[i] = datetime(d.year, d.month, d.day, + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_dates.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dates.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_dates.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_dates.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_parse_date, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":820 + * for i from 0 <= i < n: + * d = parse_date(str(dates[i])) + * t = parse_time(str(times[i])) # <<<<<<<<<<<<<< + * result[i] = datetime(d.year, d.month, d.day, + * t.hour, t.minute, t.second) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_times.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_times.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_times.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_times.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_parse_time, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":821 + * d = parse_date(str(dates[i])) + * t = parse_time(str(times[i])) + * result[i] = datetime(d.year, d.month, d.day, # <<<<<<<<<<<<<< + * t.hour, t.minute, t.second) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_year); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/src/inference.pyx":822 + * t = parse_time(str(times[i])) + * result[i] = datetime(d.year, d.month, d.day, + * t.hour, t.minute, t.second) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_minute); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_second); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + + /* "pandas/src/inference.pyx":821 + * d = parse_date(str(dates[i])) + * t = parse_time(str(times[i])) + * result[i] = datetime(d.year, d.month, d.day, # <<<<<<<<<<<<<< + * t.hour, t.minute, t.second) + * + */ + __pyx_t_17 = PyTuple_New(6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_5 = 0; + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_1 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_v_datetime, __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_19); + __Pyx_INCREF(__pyx_t_16); __Pyx_DECREF(*__pyx_t_19); + *__pyx_t_19 = __pyx_t_16; + __Pyx_GIVEREF(*__pyx_t_19); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + + /* "pandas/src/inference.pyx":824 + * t.hour, t.minute, t.second) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dates.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_times.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dates.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_times.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_datetime); + __Pyx_XDECREF(__pyx_v_timedelta); + __Pyx_XDECREF(__pyx_v_parse_date); + __Pyx_XDECREF(__pyx_v_parse_time); + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":827 + * + * + * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months, # <<<<<<<<<<<<<< + * ndarray[object] days): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_178try_parse_year_month_day(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_178try_parse_year_month_day = {__Pyx_NAMESTR("try_parse_year_month_day"), (PyCFunction)__pyx_pw_6pandas_3lib_178try_parse_year_month_day, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_178try_parse_year_month_day(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_years = 0; + PyArrayObject *__pyx_v_months = 0; + PyArrayObject *__pyx_v_days = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("try_parse_year_month_day (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_years,&__pyx_n_s_months,&__pyx_n_s_days,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_years)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_months)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_days)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "try_parse_year_month_day") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_years = ((PyArrayObject *)values[0]); + __pyx_v_months = ((PyArrayObject *)values[1]); + __pyx_v_days = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.try_parse_year_month_day", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_years), __pyx_ptype_5numpy_ndarray, 1, "years", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_months), __pyx_ptype_5numpy_ndarray, 1, "months", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_days), __pyx_ptype_5numpy_ndarray, 1, "days", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_177try_parse_year_month_day(__pyx_self, __pyx_v_years, __pyx_v_months, __pyx_v_days); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_177try_parse_year_month_day(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_years, PyArrayObject *__pyx_v_months, PyArrayObject *__pyx_v_days) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_datetime = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_days; + __Pyx_Buffer __pyx_pybuffer_days; + __Pyx_LocalBuf_ND __pyx_pybuffernd_months; + __Pyx_Buffer __pyx_pybuffer_months; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_years; + __Pyx_Buffer __pyx_pybuffer_years; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject **__pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("try_parse_year_month_day", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_years.pybuffer.buf = NULL; + __pyx_pybuffer_years.refcount = 0; + __pyx_pybuffernd_years.data = NULL; + __pyx_pybuffernd_years.rcbuffer = &__pyx_pybuffer_years; + __pyx_pybuffer_months.pybuffer.buf = NULL; + __pyx_pybuffer_months.refcount = 0; + __pyx_pybuffernd_months.data = NULL; + __pyx_pybuffernd_months.rcbuffer = &__pyx_pybuffer_months; + __pyx_pybuffer_days.pybuffer.buf = NULL; + __pyx_pybuffer_days.refcount = 0; + __pyx_pybuffernd_days.data = NULL; + __pyx_pybuffernd_days.rcbuffer = &__pyx_pybuffer_days; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_years.rcbuffer->pybuffer, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_years.diminfo[0].strides = __pyx_pybuffernd_years.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_years.diminfo[0].shape = __pyx_pybuffernd_years.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_months.rcbuffer->pybuffer, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_months.diminfo[0].strides = __pyx_pybuffernd_months.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_months.diminfo[0].shape = __pyx_pybuffernd_months.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_days.rcbuffer->pybuffer, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_days.diminfo[0].strides = __pyx_pybuffernd_days.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_days.diminfo[0].shape = __pyx_pybuffernd_days.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":833 + * ndarray[object] result + * + * from datetime import datetime # <<<<<<<<<<<<<< + * + * n = len(years) + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_datetime = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":835 + * from datetime import datetime + * + * n = len(years) # <<<<<<<<<<<<<< + * if len(months) != n or len(days) != n: + * raise ValueError('Length of years/months/days must all be equal') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_years)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/src/inference.pyx":836 + * + * n = len(years) + * if len(months) != n or len(days) != n: # <<<<<<<<<<<<<< + * raise ValueError('Length of years/months/days must all be equal') + * result = np.empty(n, dtype='O') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_months)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_4) { + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_days)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_3 != __pyx_v_n) != 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/src/inference.pyx":837 + * n = len(years) + * if len(months) != n or len(days) != n: + * raise ValueError('Length of years/months/days must all be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/inference.pyx":838 + * if len(months) != n or len(days) != n: + * raise ValueError('Length of years/months/days must all be equal') + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/src/inference.pyx":840 + * result = np.empty(n, dtype='O') + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i])) + * + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":841 + * + * for i from 0 <= i < n: + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i])) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_years.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_years.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_years.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_years.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_2 = PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_months.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_months.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_months.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_months.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_7 = PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_days.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_days.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_days.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_days.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __pyx_t_1 = PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_7 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_datetime, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_18); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/inference.pyx":843 + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i])) + * + * return result # <<<<<<<<<<<<<< + * + * def try_parse_datetime_components(ndarray[object] years, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":827 + * + * + * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months, # <<<<<<<<<<<<<< + * ndarray[object] days): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.try_parse_year_month_day", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_datetime); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":845 + * return result + * + * def try_parse_datetime_components(ndarray[object] years, # <<<<<<<<<<<<<< + * ndarray[object] months, + * ndarray[object] days, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_180try_parse_datetime_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_180try_parse_datetime_components = {__Pyx_NAMESTR("try_parse_datetime_components"), (PyCFunction)__pyx_pw_6pandas_3lib_180try_parse_datetime_components, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_180try_parse_datetime_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_years = 0; + PyArrayObject *__pyx_v_months = 0; + PyArrayObject *__pyx_v_days = 0; + PyArrayObject *__pyx_v_hours = 0; + PyArrayObject *__pyx_v_minutes = 0; + PyArrayObject *__pyx_v_seconds = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("try_parse_datetime_components (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_years,&__pyx_n_s_months,&__pyx_n_s_days,&__pyx_n_s_hours,&__pyx_n_s_minutes,&__pyx_n_s_seconds,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_years)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_months)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_days)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hours)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minutes)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seconds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 5); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "try_parse_datetime_components") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_years = ((PyArrayObject *)values[0]); + __pyx_v_months = ((PyArrayObject *)values[1]); + __pyx_v_days = ((PyArrayObject *)values[2]); + __pyx_v_hours = ((PyArrayObject *)values[3]); + __pyx_v_minutes = ((PyArrayObject *)values[4]); + __pyx_v_seconds = ((PyArrayObject *)values[5]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.try_parse_datetime_components", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_years), __pyx_ptype_5numpy_ndarray, 1, "years", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_months), __pyx_ptype_5numpy_ndarray, 1, "months", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_days), __pyx_ptype_5numpy_ndarray, 1, "days", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hours), __pyx_ptype_5numpy_ndarray, 1, "hours", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_minutes), __pyx_ptype_5numpy_ndarray, 1, "minutes", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seconds), __pyx_ptype_5numpy_ndarray, 1, "seconds", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_179try_parse_datetime_components(__pyx_self, __pyx_v_years, __pyx_v_months, __pyx_v_days, __pyx_v_hours, __pyx_v_minutes, __pyx_v_seconds); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_179try_parse_datetime_components(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_years, PyArrayObject *__pyx_v_months, PyArrayObject *__pyx_v_days, PyArrayObject *__pyx_v_hours, PyArrayObject *__pyx_v_minutes, PyArrayObject *__pyx_v_seconds) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_secs; + double __pyx_v_float_secs; + double __pyx_v_micros; + PyObject *__pyx_v_datetime = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_days; + __Pyx_Buffer __pyx_pybuffer_days; + __Pyx_LocalBuf_ND __pyx_pybuffernd_hours; + __Pyx_Buffer __pyx_pybuffer_hours; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minutes; + __Pyx_Buffer __pyx_pybuffer_minutes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_months; + __Pyx_Buffer __pyx_pybuffer_months; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_seconds; + __Pyx_Buffer __pyx_pybuffer_seconds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_years; + __Pyx_Buffer __pyx_pybuffer_years; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + double __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + PyObject *__pyx_t_23 = NULL; + Py_ssize_t __pyx_t_24; + PyObject *__pyx_t_25 = NULL; + PyObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + Py_ssize_t __pyx_t_28; + PyObject **__pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("try_parse_datetime_components", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_years.pybuffer.buf = NULL; + __pyx_pybuffer_years.refcount = 0; + __pyx_pybuffernd_years.data = NULL; + __pyx_pybuffernd_years.rcbuffer = &__pyx_pybuffer_years; + __pyx_pybuffer_months.pybuffer.buf = NULL; + __pyx_pybuffer_months.refcount = 0; + __pyx_pybuffernd_months.data = NULL; + __pyx_pybuffernd_months.rcbuffer = &__pyx_pybuffer_months; + __pyx_pybuffer_days.pybuffer.buf = NULL; + __pyx_pybuffer_days.refcount = 0; + __pyx_pybuffernd_days.data = NULL; + __pyx_pybuffernd_days.rcbuffer = &__pyx_pybuffer_days; + __pyx_pybuffer_hours.pybuffer.buf = NULL; + __pyx_pybuffer_hours.refcount = 0; + __pyx_pybuffernd_hours.data = NULL; + __pyx_pybuffernd_hours.rcbuffer = &__pyx_pybuffer_hours; + __pyx_pybuffer_minutes.pybuffer.buf = NULL; + __pyx_pybuffer_minutes.refcount = 0; + __pyx_pybuffernd_minutes.data = NULL; + __pyx_pybuffernd_minutes.rcbuffer = &__pyx_pybuffer_minutes; + __pyx_pybuffer_seconds.pybuffer.buf = NULL; + __pyx_pybuffer_seconds.refcount = 0; + __pyx_pybuffernd_seconds.data = NULL; + __pyx_pybuffernd_seconds.rcbuffer = &__pyx_pybuffer_seconds; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_years.rcbuffer->pybuffer, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_years.diminfo[0].strides = __pyx_pybuffernd_years.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_years.diminfo[0].shape = __pyx_pybuffernd_years.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_months.rcbuffer->pybuffer, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_months.diminfo[0].strides = __pyx_pybuffernd_months.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_months.diminfo[0].shape = __pyx_pybuffernd_months.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_days.rcbuffer->pybuffer, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_days.diminfo[0].strides = __pyx_pybuffernd_days.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_days.diminfo[0].shape = __pyx_pybuffernd_days.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hours.rcbuffer->pybuffer, (PyObject*)__pyx_v_hours, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_hours.diminfo[0].strides = __pyx_pybuffernd_hours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hours.diminfo[0].shape = __pyx_pybuffernd_hours.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer, (PyObject*)__pyx_v_minutes, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_minutes.diminfo[0].strides = __pyx_pybuffernd_minutes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minutes.diminfo[0].shape = __pyx_pybuffernd_minutes.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer, (PyObject*)__pyx_v_seconds, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_seconds.diminfo[0].strides = __pyx_pybuffernd_seconds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_seconds.diminfo[0].shape = __pyx_pybuffernd_seconds.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":859 + * double micros + * + * from datetime import datetime # <<<<<<<<<<<<<< + * + * n = len(years) + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_datetime = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":861 + * from datetime import datetime + * + * n = len(years) # <<<<<<<<<<<<<< + * if (len(months) != n or len(days) != n or len(hours) != n or + * len(minutes) != n or len(seconds) != n): + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_years)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_3; + + /* "pandas/src/inference.pyx":862 + * + * n = len(years) + * if (len(months) != n or len(days) != n or len(hours) != n or # <<<<<<<<<<<<<< + * len(minutes) != n or len(seconds) != n): + * raise ValueError('Length of all datetime components must be equal') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_months)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_4) { + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_days)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_5) { + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_hours)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_6) { + + /* "pandas/src/inference.pyx":863 + * n = len(years) + * if (len(months) != n or len(days) != n or len(hours) != n or + * len(minutes) != n or len(seconds) != n): # <<<<<<<<<<<<<< + * raise ValueError('Length of all datetime components must be equal') + * result = np.empty(n, dtype='O') + */ + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_minutes)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_t_3 != __pyx_v_n) != 0); + if (!__pyx_t_7) { + __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_seconds)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((__pyx_t_3 != __pyx_v_n) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + __pyx_t_7 = __pyx_t_9; + } else { + __pyx_t_7 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_7; + } else { + __pyx_t_6 = __pyx_t_5; + } + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_4; + } + if (__pyx_t_5) { + + /* "pandas/src/inference.pyx":864 + * if (len(months) != n or len(days) != n or len(hours) != n or + * len(minutes) != n or len(seconds) != n): + * raise ValueError('Length of all datetime components must be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/inference.pyx":865 + * len(minutes) != n or len(seconds) != n): + * raise ValueError('Length of all datetime components must be equal') + * result = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_11); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/src/inference.pyx":867 + * result = np.empty(n, dtype='O') + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * float_secs = float(seconds[i]) + * secs = int(float_secs) + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":868 + * + * for i from 0 <= i < n: + * float_secs = float(seconds[i]) # <<<<<<<<<<<<<< + * secs = int(float_secs) + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_seconds.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_seconds.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_seconds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_seconds.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_18 = __Pyx_PyObject_AsDouble(__pyx_t_11); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_float_secs = __pyx_t_18; + + /* "pandas/src/inference.pyx":869 + * for i from 0 <= i < n: + * float_secs = float(seconds[i]) + * secs = int(float_secs) # <<<<<<<<<<<<<< + * + * micros = float_secs - secs + */ + __pyx_v_secs = ((int)__pyx_v_float_secs); + + /* "pandas/src/inference.pyx":871 + * secs = int(float_secs) + * + * micros = float_secs - secs # <<<<<<<<<<<<<< + * if micros > 0: + * micros = micros * 1000000 + */ + __pyx_v_micros = (__pyx_v_float_secs - __pyx_v_secs); + + /* "pandas/src/inference.pyx":872 + * + * micros = float_secs - secs + * if micros > 0: # <<<<<<<<<<<<<< + * micros = micros * 1000000 + * + */ + __pyx_t_5 = ((__pyx_v_micros > 0.0) != 0); + if (__pyx_t_5) { + + /* "pandas/src/inference.pyx":873 + * micros = float_secs - secs + * if micros > 0: + * micros = micros * 1000000 # <<<<<<<<<<<<<< + * + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), + */ + __pyx_v_micros = (__pyx_v_micros * 1000000.0); + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/inference.pyx":875 + * micros = micros * 1000000 + * + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), # <<<<<<<<<<<<<< + * int(hours[i]), int(minutes[i]), secs, + * int(micros)) + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_years.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_years.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_years.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_years.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_2 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_20 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_months.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_months.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_months.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_months.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_10 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_days.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_days.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_days.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_days.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_1 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "pandas/src/inference.pyx":876 + * + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), + * int(hours[i]), int(minutes[i]), secs, # <<<<<<<<<<<<<< + * int(micros)) + * + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_hours.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_hours.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_hours.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_hours.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_23 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_23); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_24 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_minutes.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_minutes.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_minutes.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_minutes.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_11); + __pyx_t_25 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_25); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_secs); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/src/inference.pyx":877 + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), + * int(hours[i]), int(minutes[i]), secs, + * int(micros)) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_26 = PyFloat_FromDouble(__pyx_v_micros); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_26); + __pyx_t_27 = PyTuple_New(1); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_27); + PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_26); + __Pyx_GIVEREF(__pyx_t_26); + __pyx_t_26 = 0; + __pyx_t_26 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_27, NULL); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_26); + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /* "pandas/src/inference.pyx":875 + * micros = micros * 1000000 + * + * result[i] = datetime(int(years[i]), int(months[i]), int(days[i]), # <<<<<<<<<<<<<< + * int(hours[i]), int(minutes[i]), secs, + * int(micros)) + */ + __pyx_t_27 = PyTuple_New(7); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_27); + PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_27, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_27, 3, __pyx_t_23); + __Pyx_GIVEREF(__pyx_t_23); + PyTuple_SET_ITEM(__pyx_t_27, 4, __pyx_t_25); + __Pyx_GIVEREF(__pyx_t_25); + PyTuple_SET_ITEM(__pyx_t_27, 5, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_27, 6, __pyx_t_26); + __Pyx_GIVEREF(__pyx_t_26); + __pyx_t_2 = 0; + __pyx_t_10 = 0; + __pyx_t_1 = 0; + __pyx_t_23 = 0; + __pyx_t_25 = 0; + __pyx_t_11 = 0; + __pyx_t_26 = 0; + __pyx_t_26 = __Pyx_PyObject_Call(__pyx_v_datetime, __pyx_t_27, NULL); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_26); + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + __pyx_t_28 = __pyx_v_i; + __pyx_t_13 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_29); + __Pyx_INCREF(__pyx_t_26); __Pyx_DECREF(*__pyx_t_29); + *__pyx_t_29 = __pyx_t_26; + __Pyx_GIVEREF(*__pyx_t_29); + __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; + } + + /* "pandas/src/inference.pyx":879 + * int(micros)) + * + * return result # <<<<<<<<<<<<<< + * + * def sanitize_objects(ndarray[object] values, set na_values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":845 + * return result + * + * def try_parse_datetime_components(ndarray[object] years, # <<<<<<<<<<<<<< + * ndarray[object] months, + * ndarray[object] days, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_XDECREF(__pyx_t_25); + __Pyx_XDECREF(__pyx_t_26); + __Pyx_XDECREF(__pyx_t_27); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.try_parse_datetime_components", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_datetime); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_182sanitize_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_182sanitize_objects = {__Pyx_NAMESTR("sanitize_objects"), (PyCFunction)__pyx_pw_6pandas_3lib_182sanitize_objects, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_182sanitize_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_na_values = 0; + PyObject *__pyx_v_convert_empty = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sanitize_objects (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_na_values,&__pyx_n_s_convert_empty,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/inference.pyx":882 + * + * def sanitize_objects(ndarray[object] values, set na_values, + * convert_empty=True): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + values[2] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_values)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sanitize_objects", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert_empty); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sanitize_objects") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_na_values = ((PyObject*)values[1]); + __pyx_v_convert_empty = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sanitize_objects", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.sanitize_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_na_values), (&PySet_Type), 1, "na_values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_181sanitize_objects(__pyx_self, __pyx_v_values, __pyx_v_na_values, __pyx_v_convert_empty); + + /* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_181sanitize_objects(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_na_values, PyObject *__pyx_v_convert_empty) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_onan = 0; + Py_ssize_t __pyx_v_na_count; + PyObject *__pyx_v_memo = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject **__pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sanitize_objects", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":886 + * Py_ssize_t i, n + * object val, onan + * Py_ssize_t na_count = 0 # <<<<<<<<<<<<<< + * dict memo = {} + * + */ + __pyx_v_na_count = 0; + + /* "pandas/src/inference.pyx":887 + * object val, onan + * Py_ssize_t na_count = 0 + * dict memo = {} # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_memo = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/inference.pyx":889 + * dict memo = {} + * + * n = len(values) # <<<<<<<<<<<<<< + * onan = np.nan + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_2; + + /* "pandas/src/inference.pyx":890 + * + * n = len(values) + * onan = np.nan # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_onan = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":892 + * onan = np.nan + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = values[i] + * if (convert_empty and val == '') or (val in na_values): + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":893 + * + * for i from 0 <= i < n: + * val = values[i] # <<<<<<<<<<<<<< + * if (convert_empty and val == '') or (val in na_values): + * values[i] = onan + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/inference.pyx":894 + * for i from 0 <= i < n: + * val = values[i] + * if (convert_empty and val == '') or (val in na_values): # <<<<<<<<<<<<<< + * values[i] = onan + * na_count += 1 + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_convert_empty); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_val, __pyx_kp_s__49, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (!__pyx_t_8) { + __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_na_values, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_8; + } + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":895 + * val = values[i] + * if (convert_empty and val == '') or (val in na_values): + * values[i] = onan # <<<<<<<<<<<<<< + * na_count += 1 + * elif val in memo: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_v_onan); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_v_onan; + __Pyx_GIVEREF(*__pyx_t_10); + + /* "pandas/src/inference.pyx":896 + * if (convert_empty and val == '') or (val in na_values): + * values[i] = onan + * na_count += 1 # <<<<<<<<<<<<<< + * elif val in memo: + * values[i] = memo[val] + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + goto __pyx_L5; + } + + /* "pandas/src/inference.pyx":897 + * values[i] = onan + * na_count += 1 + * elif val in memo: # <<<<<<<<<<<<<< + * values[i] = memo[val] + * else: + */ + __pyx_t_7 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_memo, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "pandas/src/inference.pyx":898 + * na_count += 1 + * elif val in memo: + * values[i] = memo[val] # <<<<<<<<<<<<<< + * else: + * memo[val] = val + */ + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_memo, __pyx_v_val); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_10); + __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(*__pyx_t_10); + *__pyx_t_10 = __pyx_t_3; + __Pyx_GIVEREF(*__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/inference.pyx":900 + * values[i] = memo[val] + * else: + * memo[val] = val # <<<<<<<<<<<<<< + * + * return na_count + */ + if (unlikely(PyDict_SetItem(__pyx_v_memo, __pyx_v_val, __pyx_v_val) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + } + + /* "pandas/src/inference.pyx":902 + * memo[val] = val + * + * return na_count # <<<<<<<<<<<<<< + * + * def maybe_convert_bool(ndarray[object] arr, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_na_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.sanitize_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_onan); + __Pyx_XDECREF(__pyx_v_memo); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_184maybe_convert_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_184maybe_convert_bool = {__Pyx_NAMESTR("maybe_convert_bool"), (PyCFunction)__pyx_pw_6pandas_3lib_184maybe_convert_bool, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_184maybe_convert_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_true_values = 0; + PyObject *__pyx_v_false_values = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_convert_bool (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_true_values,&__pyx_n_s_false_values,0}; + PyObject* values[3] = {0,0,0}; + + /* "pandas/src/inference.pyx":905 + * + * def maybe_convert_bool(ndarray[object] arr, + * true_values=None, false_values=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_true_values); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_false_values); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maybe_convert_bool") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_true_values = values[1]; + __pyx_v_false_values = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("maybe_convert_bool", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.maybe_convert_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_183maybe_convert_bool(__pyx_self, __pyx_v_arr, __pyx_v_true_values, __pyx_v_false_values); + + /* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_183maybe_convert_bool(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_true_values, PyObject *__pyx_v_false_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_true_vals = 0; + PyObject *__pyx_v_false_vals = 0; + int __pyx_v_na_count; + PyObject *__pyx_v_mask = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + PyArrayObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_convert_bool", 0); + __Pyx_INCREF((PyObject *)__pyx_v_arr); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":911 + * object val + * set true_vals, false_vals + * int na_count = 0 # <<<<<<<<<<<<<< + * + * n = len(arr) + */ + __pyx_v_na_count = 0; + + /* "pandas/src/inference.pyx":913 + * int na_count = 0 + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.uint8) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":914 + * + * n = len(arr) + * result = np.empty(n, dtype=np.uint8) # <<<<<<<<<<<<<< + * + * # the defaults + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":917 + * + * # the defaults + * true_vals = set(('True', 'TRUE', 'true')) # <<<<<<<<<<<<<< + * false_vals = set(('False', 'FALSE', 'false')) + * + */ + __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PySet_Add(__pyx_t_6, __pyx_n_s_True) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_6, __pyx_n_s_TRUE) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_6, __pyx_n_s_true) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_true_vals = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":918 + * # the defaults + * true_vals = set(('True', 'TRUE', 'true')) + * false_vals = set(('False', 'FALSE', 'false')) # <<<<<<<<<<<<<< + * + * if true_values is not None: + */ + __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PySet_Add(__pyx_t_6, __pyx_n_s_False) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_6, __pyx_n_s_FALSE) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_6, __pyx_n_s_false) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_false_vals = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":920 + * false_vals = set(('False', 'FALSE', 'false')) + * + * if true_values is not None: # <<<<<<<<<<<<<< + * true_vals = true_vals | set(true_values) + * + */ + __pyx_t_12 = (__pyx_v_true_values != Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":921 + * + * if true_values is not None: + * true_vals = true_vals | set(true_values) # <<<<<<<<<<<<<< + * + * if false_values is not None: + */ + __pyx_t_6 = PySet_New(__pyx_v_true_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyNumber_Or(__pyx_v_true_vals, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_true_vals, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/inference.pyx":923 + * true_vals = true_vals | set(true_values) + * + * if false_values is not None: # <<<<<<<<<<<<<< + * false_vals = false_vals | set(false_values) + * + */ + __pyx_t_13 = (__pyx_v_false_values != Py_None); + __pyx_t_12 = (__pyx_t_13 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":924 + * + * if false_values is not None: + * false_vals = false_vals | set(false_values) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = PySet_New(__pyx_v_false_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyNumber_Or(__pyx_v_false_vals, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_false_vals, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/src/inference.pyx":926 + * false_vals = false_vals | set(false_values) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * val = arr[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":927 + * + * for i from 0 <= i < n: + * val = arr[i] # <<<<<<<<<<<<<< + * + * if cpython.PyBool_Check(val): + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":929 + * val = arr[i] + * + * if cpython.PyBool_Check(val): # <<<<<<<<<<<<<< + * if val is True: + * result[i] = 1 + */ + __pyx_t_12 = (PyBool_Check(__pyx_v_val) != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":930 + * + * if cpython.PyBool_Check(val): + * if val is True: # <<<<<<<<<<<<<< + * result[i] = 1 + * else: + */ + __pyx_t_12 = (__pyx_v_val == Py_True); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":931 + * if cpython.PyBool_Check(val): + * if val is True: + * result[i] = 1 # <<<<<<<<<<<<<< + * else: + * result[i] = 0 + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/inference.pyx":933 + * result[i] = 1 + * else: + * result[i] = 0 # <<<<<<<<<<<<<< + * elif val in true_vals: + * result[i] = 1 + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + } + __pyx_L8:; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":934 + * else: + * result[i] = 0 + * elif val in true_vals: # <<<<<<<<<<<<<< + * result[i] = 1 + * elif val in false_vals: + */ + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_true_vals, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (__pyx_t_13 != 0); + if (__pyx_t_12) { + + /* "pandas/src/inference.pyx":935 + * result[i] = 0 + * elif val in true_vals: + * result[i] = 1 # <<<<<<<<<<<<<< + * elif val in false_vals: + * result[i] = 0 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":936 + * elif val in true_vals: + * result[i] = 1 + * elif val in false_vals: # <<<<<<<<<<<<<< + * result[i] = 0 + * elif PyFloat_Check(val): + */ + __pyx_t_12 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_v_false_vals, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":937 + * result[i] = 1 + * elif val in false_vals: + * result[i] = 0 # <<<<<<<<<<<<<< + * elif PyFloat_Check(val): + * result[i] = UINT8_MAX + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + goto __pyx_L7; + } + + /* "pandas/src/inference.pyx":938 + * elif val in false_vals: + * result[i] = 0 + * elif PyFloat_Check(val): # <<<<<<<<<<<<<< + * result[i] = UINT8_MAX + * na_count += 1 + */ + __pyx_t_13 = (PyFloat_Check(__pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":939 + * result[i] = 0 + * elif PyFloat_Check(val): + * result[i] = UINT8_MAX # <<<<<<<<<<<<<< + * na_count += 1 + * else: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides) = UINT8_MAX; + + /* "pandas/src/inference.pyx":940 + * elif PyFloat_Check(val): + * result[i] = UINT8_MAX + * na_count += 1 # <<<<<<<<<<<<<< + * else: + * return arr + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/inference.pyx":942 + * na_count += 1 + * else: + * return arr # <<<<<<<<<<<<<< + * + * if na_count > 0: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + } + __pyx_L7:; + } + + /* "pandas/src/inference.pyx":944 + * return arr + * + * if na_count > 0: # <<<<<<<<<<<<<< + * mask = result == UINT8_MAX + * arr = result.view(np.bool_).astype(object) + */ + __pyx_t_13 = ((__pyx_v_na_count > 0) != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":945 + * + * if na_count > 0: + * mask = result == UINT8_MAX # <<<<<<<<<<<<<< + * arr = result.view(np.bool_).astype(object) + * np.putmask(arr, mask, np.nan) + */ + __pyx_t_6 = __Pyx_PyInt_From_int(UINT8_MAX); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_result), __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_mask = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":946 + * if na_count > 0: + * mask = result == UINT8_MAX + * arr = result.view(np.bool_).astype(object) # <<<<<<<<<<<<<< + * np.putmask(arr, mask, np.nan) + * return arr + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_20 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":947 + * mask = result == UINT8_MAX + * arr = result.view(np.bool_).astype(object) + * np.putmask(arr, mask, np.nan) # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_arr)); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/src/inference.pyx":948 + * arr = result.view(np.bool_).astype(object) + * np.putmask(arr, mask, np.nan) + * return arr # <<<<<<<<<<<<<< + * else: + * return result.view(np.bool_) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/inference.pyx":950 + * return arr + * else: + * return result.view(np.bool_) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.maybe_convert_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_true_vals); + __Pyx_XDECREF(__pyx_v_false_vals); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":953 + * + * + * def map_infer_mask(ndarray arr, object f, ndarray[uint8_t] mask, # <<<<<<<<<<<<<< + * bint convert=1): + * ''' + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_186map_infer_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_185map_infer_mask[] = "\n Substitute for np.vectorize with pandas-friendly dtype inference\n\n Parameters\n ----------\n arr : ndarray\n f : function\n\n Returns\n -------\n mapped : ndarray\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_186map_infer_mask = {__Pyx_NAMESTR("map_infer_mask"), (PyCFunction)__pyx_pw_6pandas_3lib_186map_infer_mask, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_185map_infer_mask)}; +static PyObject *__pyx_pw_6pandas_3lib_186map_infer_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_f = 0; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_v_convert; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_infer_mask (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_f,&__pyx_n_s_mask,&__pyx_n_s_convert,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_infer_mask", 0, 3, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_infer_mask", 0, 3, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_infer_mask") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_f = values[1]; + __pyx_v_mask = ((PyArrayObject *)values[2]); + if (values[3]) { + __pyx_v_convert = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_convert == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_convert = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_infer_mask", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.map_infer_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_185map_infer_mask(__pyx_self, __pyx_v_arr, __pyx_v_f, __pyx_v_mask, __pyx_v_convert); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_185map_infer_mask(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_f, PyArrayObject *__pyx_v_mask, int __pyx_v_convert) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject **__pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_infer_mask", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":972 + * object val + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=object) + * for i in range(n): + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":973 + * + * n = len(arr) + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * if mask[i]: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":974 + * n = len(arr) + * result = np.empty(n, dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * if mask[i]: + * val = util.get_value_at(arr, i) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":975 + * result = np.empty(n, dtype=object) + * for i in range(n): + * if mask[i]: # <<<<<<<<<<<<<< + * val = util.get_value_at(arr, i) + * else: + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0); + if (__pyx_t_13) { + + /* "pandas/src/inference.pyx":976 + * for i in range(n): + * if mask[i]: + * val = util.get_value_at(arr, i) # <<<<<<<<<<<<<< + * else: + * val = f(util.get_value_at(arr, i)) + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/inference.pyx":978 + * val = util.get_value_at(arr, i) + * else: + * val = f(util.get_value_at(arr, i)) # <<<<<<<<<<<<<< + * + * # unbox 0-dim arrays, GH #690 + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":981 + * + * # unbox 0-dim arrays, GH #690 + * if is_array(val) and PyArray_NDIM(val) == 0: # <<<<<<<<<<<<<< + * # is there a faster way to unbox? + * val = val.item() + */ + __pyx_t_5 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_13) { + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = (PyArray_NDIM(((PyArrayObject *)__pyx_v_val)) == 0); + __pyx_t_15 = __pyx_t_14; + } else { + __pyx_t_15 = __pyx_t_13; + } + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":983 + * if is_array(val) and PyArray_NDIM(val) == 0: + * # is there a faster way to unbox? + * val = val.item() # <<<<<<<<<<<<<< + * + * result[i] = val + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L6; + } + __pyx_L6:; + } + __pyx_L5:; + + /* "pandas/src/inference.pyx":985 + * val = val.item() + * + * result[i] = val # <<<<<<<<<<<<<< + * + * if convert: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_17); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_17); + *__pyx_t_17 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_17); + } + + /* "pandas/src/inference.pyx":987 + * result[i] = val + * + * if convert: # <<<<<<<<<<<<<< + * return maybe_convert_objects(result, + * try_float=0, + */ + __pyx_t_15 = (__pyx_v_convert != 0); + if (__pyx_t_15) { + + /* "pandas/src/inference.pyx":988 + * + * if convert: + * return maybe_convert_objects(result, # <<<<<<<<<<<<<< + * try_float=0, + * convert_datetime=0, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_try_float, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_convert_datetime, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_convert_timedelta, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":993 + * convert_timedelta=0) + * + * return result # <<<<<<<<<<<<<< + * + * def map_infer(ndarray arr, object f, bint convert=1): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":953 + * + * + * def map_infer_mask(ndarray arr, object f, ndarray[uint8_t] mask, # <<<<<<<<<<<<<< + * bint convert=1): + * ''' + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.map_infer_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":995 + * return result + * + * def map_infer(ndarray arr, object f, bint convert=1): # <<<<<<<<<<<<<< + * ''' + * Substitute for np.vectorize with pandas-friendly dtype inference + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_188map_infer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_3lib_187map_infer[] = "\n Substitute for np.vectorize with pandas-friendly dtype inference\n\n Parameters\n ----------\n arr : ndarray\n f : function\n\n Returns\n -------\n mapped : ndarray\n "; +static PyMethodDef __pyx_mdef_6pandas_3lib_188map_infer = {__Pyx_NAMESTR("map_infer"), (PyCFunction)__pyx_pw_6pandas_3lib_188map_infer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_187map_infer)}; +static PyObject *__pyx_pw_6pandas_3lib_188map_infer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_f = 0; + int __pyx_v_convert; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_infer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_f,&__pyx_n_s_convert,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_infer", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_convert); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_infer") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_f = values[1]; + if (values[2]) { + __pyx_v_convert = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_convert == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_convert = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_infer", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.map_infer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_187map_infer(__pyx_self, __pyx_v_arr, __pyx_v_f, __pyx_v_convert); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_187map_infer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_f, int __pyx_v_convert) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyObject **__pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_infer", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/src/inference.pyx":1013 + * object val + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=object) + * for i in range(n): + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1014 + * + * n = len(arr) + * result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * val = f(util.get_value_at(arr, i)) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1015 + * n = len(arr) + * result = np.empty(n, dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * val = f(util.get_value_at(arr, i)) + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/src/inference.pyx":1016 + * result = np.empty(n, dtype=object) + * for i in range(n): + * val = f(util.get_value_at(arr, i)) # <<<<<<<<<<<<<< + * + * # unbox 0-dim arrays, GH #690 + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1019 + * + * # unbox 0-dim arrays, GH #690 + * if is_array(val) and PyArray_NDIM(val) == 0: # <<<<<<<<<<<<<< + * # is there a faster way to unbox? + * val = val.item() + */ + __pyx_t_2 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_12) { + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = (PyArray_NDIM(((PyArrayObject *)__pyx_v_val)) == 0); + __pyx_t_14 = __pyx_t_13; + } else { + __pyx_t_14 = __pyx_t_12; + } + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":1021 + * if is_array(val) and PyArray_NDIM(val) == 0: + * # is there a faster way to unbox? + * val = val.item() # <<<<<<<<<<<<<< + * + * result[i] = val + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/inference.pyx":1023 + * val = val.item() + * + * result[i] = val # <<<<<<<<<<<<<< + * + * if convert: + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_16); + } + + /* "pandas/src/inference.pyx":1025 + * result[i] = val + * + * if convert: # <<<<<<<<<<<<<< + * return maybe_convert_objects(result, + * try_float=0, + */ + __pyx_t_14 = (__pyx_v_convert != 0); + if (__pyx_t_14) { + + /* "pandas/src/inference.pyx":1026 + * + * if convert: + * return maybe_convert_objects(result, # <<<<<<<<<<<<<< + * try_float=0, + * convert_datetime=0, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_try_float, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_convert_datetime, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_convert_timedelta, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":1031 + * convert_timedelta=0) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":995 + * return result + * + * def map_infer(ndarray arr, object f, bint convert=1): # <<<<<<<<<<<<<< + * ''' + * Substitute for np.vectorize with pandas-friendly dtype inference + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.map_infer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":1034 + * + * + * def to_object_array(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_190to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_rows); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_190to_object_array = {__Pyx_NAMESTR("to_object_array"), (PyCFunction)__pyx_pw_6pandas_3lib_190to_object_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_190to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_rows) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_object_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rows), (&PyList_Type), 1, "rows", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_189to_object_array(__pyx_self, ((PyObject*)__pyx_v_rows)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_189to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rows) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_tmp; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_row = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_object_array", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/src/inference.pyx":1040 + * list row + * + * n = len(rows) # <<<<<<<<<<<<<< + * + * k = 0 + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_rows); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1042 + * n = len(rows) + * + * k = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * tmp = len(rows[i]) + */ + __pyx_v_k = 0; + + /* "pandas/src/inference.pyx":1043 + * + * k = 0 + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * tmp = len(rows[i]) + * if tmp > k: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":1044 + * k = 0 + * for i from 0 <= i < n: + * tmp = len(rows[i]) # <<<<<<<<<<<<<< + * if tmp > k: + * k = tmp + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tmp = __pyx_t_3; + + /* "pandas/src/inference.pyx":1045 + * for i from 0 <= i < n: + * tmp = len(rows[i]) + * if tmp > k: # <<<<<<<<<<<<<< + * k = tmp + * + */ + __pyx_t_4 = ((__pyx_v_tmp > __pyx_v_k) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":1046 + * tmp = len(rows[i]) + * if tmp > k: + * k = tmp # <<<<<<<<<<<<<< + * + * result = np.empty((n, k), dtype=object) + */ + __pyx_v_k = __pyx_v_tmp; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/src/inference.pyx":1048 + * k = tmp + * + * result = np.empty((n, k), dtype=object) # <<<<<<<<<<<<<< + * + * for i from 0 <= i < n: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1050 + * result = np.empty((n, k), dtype=object) + * + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * row = rows[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":1051 + * + * for i from 0 <= i < n: + * row = rows[i] # <<<<<<<<<<<<<< + * + * for j from 0 <= j < len(row): + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1053 + * row = rows[i] + * + * for j from 0 <= j < len(row): # <<<<<<<<<<<<<< + * result[i, j] = row[j] + * + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyList_GET_SIZE(__pyx_v_row); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { + + /* "pandas/src/inference.pyx":1054 + * + * for j from 0 <= j < len(row): + * result[i, j] = row[j] # <<<<<<<<<<<<<< + * + * return result + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_row, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + + /* "pandas/src/inference.pyx":1056 + * result[i, j] = row[j] + * + * return result # <<<<<<<<<<<<<< + * + * def tuples_to_object_array(ndarray[object] tuples): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":1034 + * + * + * def to_object_array(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":1058 + * return result + * + * def tuples_to_object_array(ndarray[object] tuples): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_192tuples_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_tuples); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_192tuples_to_object_array = {__Pyx_NAMESTR("tuples_to_object_array"), (PyCFunction)__pyx_pw_6pandas_3lib_192tuples_to_object_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_192tuples_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_tuples) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tuples_to_object_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tuples), __pyx_ptype_5numpy_ndarray, 1, "tuples", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_191tuples_to_object_array(__pyx_self, ((PyArrayObject *)__pyx_v_tuples)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_191tuples_to_object_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tuples) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_tup = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_tuples; + __Pyx_Buffer __pyx_pybuffer_tuples; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + long __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject **__pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tuples_to_object_array", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_tuples.pybuffer.buf = NULL; + __pyx_pybuffer_tuples.refcount = 0; + __pyx_pybuffernd_tuples.data = NULL; + __pyx_pybuffernd_tuples.rcbuffer = &__pyx_pybuffer_tuples; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tuples.rcbuffer->pybuffer, (PyObject*)__pyx_v_tuples, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_tuples.diminfo[0].strides = __pyx_pybuffernd_tuples.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tuples.diminfo[0].shape = __pyx_pybuffernd_tuples.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/inference.pyx":1064 + * tuple tup + * + * n = len(tuples) # <<<<<<<<<<<<<< + * k = len(tuples[0]) + * result = np.empty((n, k), dtype=object) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_tuples)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1065 + * + * n = len(tuples) + * k = len(tuples[0]) # <<<<<<<<<<<<<< + * result = np.empty((n, k), dtype=object) + * for i in range(n): + */ + __pyx_t_3 = 0; + __pyx_t_4 = -1; + if (__pyx_t_3 < 0) { + __pyx_t_3 += __pyx_pybuffernd_tuples.diminfo[0].shape; + if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_tuples.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_tuples.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_tuples.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_k = __pyx_t_1; + + /* "pandas/src/inference.pyx":1066 + * n = len(tuples) + * k = len(tuples[0]) + * result = np.empty((n, k), dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * tup = tuples[i] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1067 + * k = len(tuples[0]) + * result = np.empty((n, k), dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * tup = tuples[i] + * for j in range(k): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/inference.pyx":1068 + * result = np.empty((n, k), dtype=object) + * for i in range(n): + * tup = tuples[i] # <<<<<<<<<<<<<< + * for j in range(k): + * result[i, j] = tup[j] + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_tuples.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_tuples.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_tuples.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_tuples.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_tup, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1069 + * for i in range(n): + * tup = tuples[i] + * for j in range(k): # <<<<<<<<<<<<<< + * result[i, j] = tup[j] + * + */ + __pyx_t_14 = __pyx_v_k; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; + + /* "pandas/src/inference.pyx":1070 + * tup = tuples[i] + * for j in range(k): + * result[i, j] = tup[j] # <<<<<<<<<<<<<< + * + * return result + */ + if (unlikely(__pyx_v_tup == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_tup, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_4 = 1; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_4 = 1; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_18); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_18); + *__pyx_t_18 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + + /* "pandas/src/inference.pyx":1072 + * result[i, j] = tup[j] + * + * return result # <<<<<<<<<<<<<< + * + * def to_object_array_tuples(list rows): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":1058 + * return result + * + * def tuples_to_object_array(ndarray[object] tuples): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tuples.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.tuples_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tuples.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":1074 + * return result + * + * def to_object_array_tuples(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_194to_object_array_tuples(PyObject *__pyx_self, PyObject *__pyx_v_rows); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_194to_object_array_tuples = {__Pyx_NAMESTR("to_object_array_tuples"), (PyCFunction)__pyx_pw_6pandas_3lib_194to_object_array_tuples, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_194to_object_array_tuples(PyObject *__pyx_self, PyObject *__pyx_v_rows) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_object_array_tuples (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rows), (&PyList_Type), 1, "rows", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_193to_object_array_tuples(__pyx_self, ((PyObject*)__pyx_v_rows)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_193to_object_array_tuples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rows) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_n; + Py_ssize_t __pyx_v_k; + Py_ssize_t __pyx_v_tmp; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_row = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyObject **__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_object_array_tuples", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/src/inference.pyx":1080 + * tuple row + * + * n = len(rows) # <<<<<<<<<<<<<< + * + * k = 0 + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_rows); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1082 + * n = len(rows) + * + * k = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < n: + * tmp = len(rows[i]) + */ + __pyx_v_k = 0; + + /* "pandas/src/inference.pyx":1083 + * + * k = 0 + * for i from 0 <= i < n: # <<<<<<<<<<<<<< + * tmp = len(rows[i]) + * if tmp > k: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { + + /* "pandas/src/inference.pyx":1084 + * k = 0 + * for i from 0 <= i < n: + * tmp = len(rows[i]) # <<<<<<<<<<<<<< + * if tmp > k: + * k = tmp + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tmp = __pyx_t_3; + + /* "pandas/src/inference.pyx":1085 + * for i from 0 <= i < n: + * tmp = len(rows[i]) + * if tmp > k: # <<<<<<<<<<<<<< + * k = tmp + * + */ + __pyx_t_4 = ((__pyx_v_tmp > __pyx_v_k) != 0); + if (__pyx_t_4) { + + /* "pandas/src/inference.pyx":1086 + * tmp = len(rows[i]) + * if tmp > k: + * k = tmp # <<<<<<<<<<<<<< + * + * result = np.empty((n, k), dtype=object) + */ + __pyx_v_k = __pyx_v_tmp; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/src/inference.pyx":1088 + * k = tmp + * + * result = np.empty((n, k), dtype=object) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_result.diminfo[1].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_result.diminfo[1].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1090 + * result = np.empty((n, k), dtype=object) + * + * try: # <<<<<<<<<<<<<< + * for i in range(n): + * row = rows[i] + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/src/inference.pyx":1091 + * + * try: + * for i in range(n): # <<<<<<<<<<<<<< + * row = rows[i] + * for j from 0 <= j < len(row): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/inference.pyx":1092 + * try: + * for i in range(n): + * row = rows[i] # <<<<<<<<<<<<<< + * for j from 0 <= j < len(row): + * result[i, j] = row[j] + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1093 + * for i in range(n): + * row = rows[i] + * for j from 0 <= j < len(row): # <<<<<<<<<<<<<< + * result[i, j] = row[j] + * except Exception: + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_13 = PyTuple_GET_SIZE(__pyx_v_row); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_13; __pyx_v_j++) { + + /* "pandas/src/inference.pyx":1094 + * row = rows[i] + * for j from 0 <= j < len(row): + * result[i, j] = row[j] # <<<<<<<<<<<<<< + * except Exception: + * # upcast any subclasses to tuple + */ + if (unlikely(__pyx_v_row == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_row, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_16); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":1095 + * for j from 0 <= j < len(row): + * result[i, j] = row[j] + * except Exception: # <<<<<<<<<<<<<< + * # upcast any subclasses to tuple + * for i in range(n): + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("pandas.lib.to_object_array_tuples", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/src/inference.pyx":1097 + * except Exception: + * # upcast any subclasses to tuple + * for i in range(n): # <<<<<<<<<<<<<< + * row = tuple(rows[i]) + * for j from 0 <= j < len(row): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/src/inference.pyx":1098 + * # upcast any subclasses to tuple + * for i in range(n): + * row = tuple(rows[i]) # <<<<<<<<<<<<<< + * for j from 0 <= j < len(row): + * result[i, j] = row[j] + */ + if (unlikely(__pyx_v_rows == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_rows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1099 + * for i in range(n): + * row = tuple(rows[i]) + * for j from 0 <= j < len(row): # <<<<<<<<<<<<<< + * result[i, j] = row[j] + * + */ + __pyx_t_13 = PyTuple_GET_SIZE(__pyx_v_row); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_13; __pyx_v_j++) { + + /* "pandas/src/inference.pyx":1100 + * row = tuple(rows[i]) + * for j from 0 <= j < len(row): + * result[i, j] = row[j] # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_row, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + __pyx_t_9 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_9 = 0; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[1].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 1; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[1].shape)) __pyx_t_9 = 1; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + } + __pyx_t_16 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_result.diminfo[1].strides); + __Pyx_GOTREF(*__pyx_t_16); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_16); + *__pyx_t_16 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10); + __pyx_L13_try_end:; + } + + /* "pandas/src/inference.pyx":1102 + * result[i, j] = row[j] + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/inference.pyx":1074 + * return result + * + * def to_object_array_tuples(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_17); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.to_object_array_tuples", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/inference.pyx":1105 + * + * + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(keys) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_3lib_196fast_multiget(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_3lib_196fast_multiget = {__Pyx_NAMESTR("fast_multiget"), (PyCFunction)__pyx_pw_6pandas_3lib_196fast_multiget, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_3lib_196fast_multiget(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_mapping = 0; + PyArrayObject *__pyx_v_keys = 0; + PyObject *__pyx_v_default = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fast_multiget (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping,&__pyx_n_s_keys,&__pyx_n_s_default,0}; + PyObject* values[3] = {0,0,0}; + values[2] = __pyx_k__57; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapping)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fast_multiget", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fast_multiget") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_mapping = ((PyObject*)values[0]); + __pyx_v_keys = ((PyArrayObject *)values[1]); + __pyx_v_default = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fast_multiget", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.lib.fast_multiget", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapping), (&PyDict_Type), 1, "mapping", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_3lib_195fast_multiget(__pyx_self, __pyx_v_mapping, __pyx_v_keys, __pyx_v_default); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_3lib_195fast_multiget(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping, PyArrayObject *__pyx_v_keys, PyObject *__pyx_v_default) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyArrayObject *__pyx_v_output = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_output; + __Pyx_Buffer __pyx_pybuffer_output; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + PyObject **__pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fast_multiget", 0); + __Pyx_INCREF((PyObject *)__pyx_v_keys); + __pyx_pybuffer_output.pybuffer.buf = NULL; + __pyx_pybuffer_output.refcount = 0; + __pyx_pybuffernd_output.data = NULL; + __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; + + /* "pandas/src/inference.pyx":1107 + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): + * cdef: + * Py_ssize_t i, n = len(keys) # <<<<<<<<<<<<<< + * object val + * ndarray[object] output = np.empty(n, dtype='O') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_keys)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/src/inference.pyx":1109 + * Py_ssize_t i, n = len(keys) + * object val + * ndarray[object] output = np.empty(n, dtype='O') # <<<<<<<<<<<<<< + * + * if n == 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_output = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1111 + * ndarray[object] output = np.empty(n, dtype='O') + * + * if n == 0: # <<<<<<<<<<<<<< + * # kludge, for Series + * return np.empty(0, dtype='f8') + */ + __pyx_t_7 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_7) { + + /* "pandas/src/inference.pyx":1113 + * if n == 0: + * # kludge, for Series + * return np.empty(0, dtype='f8') # <<<<<<<<<<<<<< + * + * keys = getattr(keys, 'values', keys) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__58, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/src/inference.pyx":1115 + * return np.empty(0, dtype='f8') + * + * keys = getattr(keys, 'values', keys) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_keys), __pyx_n_s_values, ((PyObject *)__pyx_v_keys)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF_SET(__pyx_v_keys, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":1117 + * keys = getattr(keys, 'values', keys) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = util.get_value_1d(keys, i) + * if val in mapping: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/src/inference.pyx":1118 + * + * for i in range(n): + * val = util.get_value_1d(keys, i) # <<<<<<<<<<<<<< + * if val in mapping: + * output[i] = mapping[val] + */ + __pyx_t_4 = get_value_1d(__pyx_v_keys, __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/inference.pyx":1119 + * for i in range(n): + * val = util.get_value_1d(keys, i) + * if val in mapping: # <<<<<<<<<<<<<< + * output[i] = mapping[val] + * else: + */ + if (unlikely(__pyx_v_mapping == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = (__Pyx_PyDict_Contains(__pyx_v_val, __pyx_v_mapping, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = (__pyx_t_7 != 0); + if (__pyx_t_9) { + + /* "pandas/src/inference.pyx":1120 + * val = util.get_value_1d(keys, i) + * if val in mapping: + * output[i] = mapping[val] # <<<<<<<<<<<<<< + * else: + * output[i] = default + */ + if (unlikely(__pyx_v_mapping == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_mapping, __pyx_v_val); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_output.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_12); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_12); + *__pyx_t_12 = __pyx_t_4; + __Pyx_GIVEREF(*__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/inference.pyx":1122 + * output[i] = mapping[val] + * else: + * output[i] = default # <<<<<<<<<<<<<< + * + * return maybe_convert_objects(output) + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_output.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_output.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_output.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_12); + __Pyx_INCREF(__pyx_v_default); __Pyx_DECREF(*__pyx_t_12); + *__pyx_t_12 = __pyx_v_default; + __Pyx_GIVEREF(*__pyx_t_12); + } + __pyx_L6:; + } + + /* "pandas/src/inference.pyx":1124 + * output[i] = default + * + * return maybe_convert_objects(output) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_output)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_output)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_output)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/inference.pyx":1105 + * + * + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(keys) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.lib.fast_multiget", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF((PyObject *)__pyx_v_output); + __Pyx_XDECREF((PyObject *)__pyx_v_keys); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_result; + char *__pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_to_dts", 0); + __Pyx_INCREF(__pyx_v_val); + + /* "datetime.pxd":130 + * cdef char *tmp + * + * if PyUnicode_Check(val): # <<<<<<<<<<<<<< + * val = PyUnicode_AsASCIIString(val); + * + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":131 + * + * if PyUnicode_Check(val): + * val = PyUnicode_AsASCIIString(val); # <<<<<<<<<<<<<< + * + * tmp = val + */ + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "datetime.pxd":133 + * val = PyUnicode_AsASCIIString(val); + * + * tmp = val # <<<<<<<<<<<<<< + * result = _cstring_to_dts(tmp, len(val), dts) + * + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmp = __pyx_t_3; + + /* "datetime.pxd":134 + * + * tmp = val + * result = _cstring_to_dts(tmp, len(val), dts) # <<<<<<<<<<<<<< + * + * if result == -1: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts); + + /* "datetime.pxd":136 + * result = _cstring_to_dts(tmp, len(val), dts) + * + * if result == -1: # <<<<<<<<<<<<<< + * raise ValueError('Unable to parse %s' % str(val)) + * + */ + __pyx_t_1 = ((__pyx_v_result == -1) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":137 + * + * if result == -1: + * raise ValueError('Unable to parse %s' % str(val)) # <<<<<<<<<<<<<< + * + * cdef inline int _cstring_to_dts(char *val, int length, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("datetime._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts) { + npy_bool __pyx_v_islocal; + npy_bool __pyx_v_special; + PANDAS_DATETIMEUNIT __pyx_v_out_bestunit; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cstring_to_dts", 0); + + /* "datetime.pxd":146 + * int result + * + * result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns, # <<<<<<<<<<<<<< + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + */ + __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special)); + + /* "datetime.pxd":149 + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime64_to_datetime", 0); + + /* "datetime.pxd":154 + * cdef inline object _datetime64_to_datetime(int64_t val): + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * return _dts_to_pydatetime(&dts) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "datetime.pxd":155 + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * return _dts_to_pydatetime(&dts) # <<<<<<<<<<<<<< + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dts_to_pydatetime", 0); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_XDECREF(__pyx_r); + + /* "datetime.pxd":160 + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + */ + __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0); + + /* "datetime.pxd":163 + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":164 + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":165 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":166 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) # <<<<<<<<<<<<<< + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + */ + __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val); + + /* "datetime.pxd":167 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) # <<<<<<<<<<<<<< + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + */ + __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val); + + /* "datetime.pxd":168 + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) # <<<<<<<<<<<<<< + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + */ + __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val); + + /* "datetime.pxd":169 + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val); + + /* "datetime.pxd":170 + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":171 + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _dtlike_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + npy_int64 __pyx_t_2; + npy_int32 __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dtlike_to_datetime64", 0); + + /* "datetime.pxd":175 + * cdef inline int64_t _dtlike_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = val.year # <<<<<<<<<<<<<< + * dts.month = val.month + * dts.day = val.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->year = __pyx_t_2; + + /* "datetime.pxd":176 + * pandas_datetimestruct *dts): + * dts.year = val.year + * dts.month = val.month # <<<<<<<<<<<<<< + * dts.day = val.day + * dts.hour = val.hour + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->month = __pyx_t_3; + + /* "datetime.pxd":177 + * dts.year = val.year + * dts.month = val.month + * dts.day = val.day # <<<<<<<<<<<<<< + * dts.hour = val.hour + * dts.min = val.minute + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->day = __pyx_t_3; + + /* "datetime.pxd":178 + * dts.month = val.month + * dts.day = val.day + * dts.hour = val.hour # <<<<<<<<<<<<<< + * dts.min = val.minute + * dts.sec = val.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->hour = __pyx_t_3; + + /* "datetime.pxd":179 + * dts.day = val.day + * dts.hour = val.hour + * dts.min = val.minute # <<<<<<<<<<<<<< + * dts.sec = val.second + * dts.us = val.microsecond + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->min = __pyx_t_3; + + /* "datetime.pxd":180 + * dts.hour = val.hour + * dts.min = val.minute + * dts.sec = val.second # <<<<<<<<<<<<<< + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->sec = __pyx_t_3; + + /* "datetime.pxd":181 + * dts.min = val.minute + * dts.sec = val.second + * dts.us = val.microsecond # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->us = __pyx_t_3; + + /* "datetime.pxd":182 + * dts.sec = val.second + * dts.us = val.microsecond + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":183 + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _date_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_to_datetime64", 0); + + /* "datetime.pxd":187 + * cdef inline int64_t _date_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":188 + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":189 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":190 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->hour = 0; + __pyx_v_dts->min = 0; + __pyx_v_dts->sec = 0; + __pyx_v_dts->us = 0; + + /* "datetime.pxd":191 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":192 + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + + /* "View.MemoryView":117 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":123 + * cdef PyObject **p + * + * self.ndim = len(shape) # <<<<<<<<<<<<<< + * self.itemsize = itemsize + * + */ + if (unlikely(__pyx_v_shape == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":124 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":126 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":127 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":129 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":130 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if isinstance(format, unicode): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":132 + * raise ValueError("itemsize <= 0 for cython.array") + * + * if isinstance(format, unicode): # <<<<<<<<<<<<<< + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string + */ + __pyx_t_2 = PyUnicode_Check(__pyx_v_format); + __pyx_t_4 = (__pyx_t_2 != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":133 + * + * if isinstance(format, unicode): + * format = (format).encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + if (unlikely(__pyx_v_format == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = PyUnicode_AsASCIIString(((PyObject*)__pyx_v_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "View.MemoryView":134 + * if isinstance(format, unicode): + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":135 + * format = (format).encode('ASCII') + * self._format = format # keep a reference to the byte string + * self.format = self._format # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->format = __pyx_t_5; + + /* "View.MemoryView":138 + * + * + * self._shape = PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< + * self._strides = self._shape + self.ndim + * + */ + __pyx_v_self->_shape = ((Py_ssize_t *)PyMem_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); + + /* "View.MemoryView":139 + * + * self._shape = PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) + * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< + * + * if not self._shape: + */ + __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); + + /* "View.MemoryView":141 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":142 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":145 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_6 = 0; + __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_dim = __pyx_t_8; + __pyx_v_idx = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":146 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":147 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_7 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":148 + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim # <<<<<<<<<<<<<< + * + * cdef char order + */ + (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":151 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":152 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":153 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + goto __pyx_L10; + } + + /* "View.MemoryView":154 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":155 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":156 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + goto __pyx_L10; + } + /*else*/ { + + /* "View.MemoryView":158 + * self.mode = u'c' + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< + * + * self.len = fill_contig_strides_array(self._shape, self._strides, + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L10:; + + /* "View.MemoryView":160 + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + * + * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< + * itemsize, self.ndim, order) + * + */ + __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); + + /* "View.MemoryView":163 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":164 + * + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< + * if allocate_buffer: + * + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":165 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = (__pyx_v_allocate_buffer != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":168 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":169 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":170 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":172 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":173 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":174 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":175 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":176 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "View.MemoryView":116 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":179 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":180 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":181 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":182 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + goto __pyx_L3; + } + + /* "View.MemoryView":183 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":184 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":185 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":186 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":187 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":188 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":189 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":190 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":191 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":192 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":193 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":194 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":196 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":197 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":199 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":201 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":179 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":205 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":206 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":207 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + goto __pyx_L3; + } + + /* "View.MemoryView":208 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":209 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":210 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":212 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyMem_Free(self._shape) + * + */ + free(__pyx_v_self->data); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":213 + * self._strides, self.ndim, False) + * free(self.data) + * PyMem_Free(self._shape) # <<<<<<<<<<<<<< + * + * property memview: + */ + PyMem_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":205 + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + * + * def __dealloc__(array self): # <<<<<<<<<<<<<< + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":217 + * property memview: + * @cname('get_memview') + * def __get__(self): # <<<<<<<<<<<<<< + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + */ + +/* Python wrapper */ +static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/ +static PyObject *get_memview(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":219 + * def __get__(self): + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":220 + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":217 + * property memview: + * @cname('get_memview') + * def __get__(self): # <<<<<<<<<<<<<< + * + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":223 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":224 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":223 + * + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":226 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":227 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":226 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":229 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":230 + * + * def __setitem__(self, item, value): + * self.memview[item] = value # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":229 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":234 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":238 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":239 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":241 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":242 + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) # <<<<<<<<<<<<<< + * result.data = buf + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":241 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":243 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":245 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":234 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":271 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":272 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":271 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":273 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":274 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":273 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":288 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":290 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< + * cdef size_t offset + * + */ + __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); + + /* "View.MemoryView":294 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":296 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + __pyx_t_1 = ((__pyx_v_offset > 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":297 + * + * if offset > 0: + * aligned_p += alignment - offset # <<<<<<<<<<<<<< + * + * return aligned_p + */ + __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":299 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview') + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":288 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":317 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":318 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":319 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":320 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type))); + if (!(__pyx_t_1 != 0)) { + __pyx_t_2 = (__pyx_v_obj != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "View.MemoryView":321 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":322 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_3 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":323 + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; + + /* "View.MemoryView":324 + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * self.lock = PyThread_allocate_lock() + */ + Py_INCREF(Py_None); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":326 + * Py_INCREF(Py_None) + * + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock == NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":327 + * + * self.lock = PyThread_allocate_lock() + * if self.lock == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_3 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":328 + * self.lock = PyThread_allocate_lock() + * if self.lock == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":330 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = self.view.format == b'O' + * else: + */ + __pyx_t_3 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":331 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_3; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":333 + * self.dtype_is_object = self.view.format == b'O' + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L6:; + + /* "View.MemoryView":335 + * self.dtype_is_object = dtype_is_object + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":337 + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) + * self.typeinfo = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(memoryview self): + */ + __pyx_v_self->typeinfo = NULL; + + /* "View.MemoryView":317 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":339 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":340 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":341 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * + * if self.lock != NULL: + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":343 + * __Pyx_ReleaseBuffer(&self.view) + * + * if self.lock != NULL: # <<<<<<<<<<<<<< + * PyThread_free_lock(self.lock) + * + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":344 + * + * if self.lock != NULL: + * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + */ + PyThread_free_lock(__pyx_v_self->lock); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":339 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":346 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":348 + * cdef char *get_item_pointer(memoryview self, object index) except NULL: + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< + * + * for dim, idx in enumerate(index): + */ + __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); + + /* "View.MemoryView":350 + * cdef char *itemp = self.view.buf + * + * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + */ + __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_v_index) || PyTuple_CheckExact(__pyx_v_index)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":351 + * + * for dim, idx in enumerate(index): + * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< + * + * return itemp + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":353 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":346 + * PyThread_free_lock(self.lock) + * + * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< + * cdef Py_ssize_t dim + * cdef char *itemp = self.view.buf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":356 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":357 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":358 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + } + + /* "View.MemoryView":360 + * return self + * + * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * cdef char *itemp + */ + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":363 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + + /* "View.MemoryView":364 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":366 + * return memview_slice(self, indices) + * else: + * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< + * return self.convert_item_to_object(itemp) + * + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":367 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":356 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":369 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":370 + * + * def __setitem__(memoryview self, object index, object value): + * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< + * + * if have_slices: + */ + __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_have_slices = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":372 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":373 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":374 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "View.MemoryView":375 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":377 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":379 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":369 + * return self.convert_item_to_object(itemp) + * + * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< + * have_slices, index = _unellipsify(index, self.view.ndim) + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":381 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":382 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type)); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":384 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":385 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":384 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":386 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":387 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":389 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":381 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":391 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":395 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":396 + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< + * src.ndim, dst.ndim, self.dtype_is_object) + * + */ + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":397 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":395 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":391 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":399 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[128]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + char const *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":401 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":406 + * cdef __Pyx_memviewslice *dst_slice + * cdef __Pyx_memviewslice tmp_slice + * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< + * + * if self.view.itemsize > sizeof(array): + */ + __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + + /* "View.MemoryView":408 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":409 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":410 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":411 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":412 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":414 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":416 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":417 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":418 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + goto __pyx_L8; + } + /*else*/ { + + /* "View.MemoryView":420 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":424 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":425 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":426 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":429 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + /*exception exit:*/{ + __pyx_L6_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":399 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":431 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":432 + * + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< + * self.assign_item_from_object(itemp, value) + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":433 + * cdef setitem_indexed(self, index, value): + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":431 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":435 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":438 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":441 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":442 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":443 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + } + /*else:*/ { + + /* "View.MemoryView":447 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + __pyx_t_7 = strlen(__pyx_v_self->view.format); + __pyx_t_8 = ((__pyx_t_7 == 1) != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":448 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L6_except_return; + } + + /* "View.MemoryView":449 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "View.MemoryView":444 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":445 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L10_try_end:; + } + + /* "View.MemoryView":435 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":451 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + char *__pyx_t_10; + char *__pyx_t_11; + char *__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":454 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":459 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":460 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":462 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":464 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_7 = 0; + if (unlikely(__pyx_v_bytesvalue == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_8 = __pyx_v_bytesvalue; + __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8); + __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8)); + for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) { + __pyx_t_9 = __pyx_t_12; + __pyx_v_c = (__pyx_t_9[0]); + + /* "View.MemoryView":465 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_7; + + /* "View.MemoryView":464 + * bytesvalue = struct.pack(self.view.format, value) + * + * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< + * itemp[i] = c + * + */ + __pyx_t_7 = (__pyx_t_7 + 1); + + /* "View.MemoryView":465 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "View.MemoryView":451 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":468 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + char *__pyx_t_3; + void *__pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "View.MemoryView":469 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":470 + * def __getbuffer__(self, Py_buffer *info, int flags): + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_2 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_2; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":472 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + __pyx_v_info->shape = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":474 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":475 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_2 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_2; + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":477 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + __pyx_v_info->strides = NULL; + } + __pyx_L4:; + + /* "View.MemoryView":479 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":480 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_2 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_2; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":482 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->suboffsets = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":484 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":485 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_3 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_3; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":487 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + __pyx_v_info->format = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":489 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_4 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":490 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_5 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_5; + + /* "View.MemoryView":491 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = 0 + */ + __pyx_t_6 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_6; + + /* "View.MemoryView":492 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = 0 + * info.obj = self + */ + __pyx_t_6 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_6; + + /* "View.MemoryView":493 + * info.itemsize = self.view.itemsize + * info.len = self.view.len + * info.readonly = 0 # <<<<<<<<<<<<<< + * info.obj = self + * + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":494 + * info.len = self.view.len + * info.readonly = 0 + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":468 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape + */ + + /* function exit code */ + __pyx_r = 0; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":501 + * property T: + * @cname('__pyx_memoryview_transpose') + * def __get__(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":502 + * @cname('__pyx_memoryview_transpose') + * def __get__(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":503 + * def __get__(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":504 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * property base: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":501 + * property T: + * @cname('__pyx_memoryview_transpose') + * def __get__(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":508 + * property base: + * @cname('__pyx_memoryview__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":509 + * @cname('__pyx_memoryview__get__base') + * def __get__(self): + * return self.obj # <<<<<<<<<<<<<< + * + * property shape: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":508 + * property base: + * @cname('__pyx_memoryview__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":513 + * property shape: + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): # <<<<<<<<<<<<<< + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":514 + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property strides: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_self->view.ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "View.MemoryView":513 + * property shape: + * @cname('__pyx_memoryview_get_shape') + * def __get__(self): # <<<<<<<<<<<<<< + * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":518 + * property strides: + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":519 + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":521 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":523 + * raise ValueError("Buffer view does not expose strides") + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property suboffsets: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_self->view.ndim; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":518 + * property strides: + * @cname('__pyx_memoryview_get_strides') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":527 + * property suboffsets: + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":528 + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return [-1] * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":529 + * def __get__(self): + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) { + __Pyx_INCREF(__pyx_int_neg_1); + PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + } + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":531 + * return [-1] * self.view.ndim + * + * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<< + * + * property ndim: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_v_self->view.ndim; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":527 + * property suboffsets: + * @cname('__pyx_memoryview_get_suboffsets') + * def __get__(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return [-1] * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":535 + * property ndim: + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":536 + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * property itemsize: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":535 + * property ndim: + * @cname('__pyx_memoryview_get_ndim') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":540 + * property itemsize: + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":541 + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * property nbytes: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":540 + * property itemsize: + * @cname('__pyx_memoryview_get_itemsize') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":545 + * property nbytes: + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":546 + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * property size: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":545 + * property nbytes: + * @cname('__pyx_memoryview_get_nbytes') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":550 + * property size: + * @cname('__pyx_memoryview_get_size') + * def __get__(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":551 + * @cname('__pyx_memoryview_get_size') + * def __get__(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":552 + * def __get__(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.shape: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":554 + * result = 1 + * + * for length in self.shape: # <<<<<<<<<<<<<< + * result *= length + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":555 + * + * for length in self.shape: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":557 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":559 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":550 + * property size: + * @cname('__pyx_memoryview_get_size') + * def __get__(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":561 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":562 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":563 + * def __len__(self): + * if self.view.ndim >= 1: + * return self.view.shape[0] # <<<<<<<<<<<<<< + * + * return 0 + */ + __pyx_r = (__pyx_v_self->view.shape[0]); + goto __pyx_L0; + } + + /* "View.MemoryView":565 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":561 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":567 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":568 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":569 + * def __repr__(self): + * return "" % (self.base.__class__.__name__, + * id(self)) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":568 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":567 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":571 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":572 + * + * def __str__(self): + * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":571 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":575 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":578 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":579 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<< + * + * def is_f_contig(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":575 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":581 + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":584 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":585 + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) + * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":581 + * return slice_is_contig(mslice, 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":587 + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":589 + * def copy(self): + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &mslice) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); + + /* "View.MemoryView":591 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":592 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":597 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":587 + * return slice_is_contig(mslice, 'F', self.view.ndim) + * + * def copy(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice mslice + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":599 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":601 + * def copy_fortran(self): + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< + * + * slice_copy(self, &src) + */ + __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); + + /* "View.MemoryView":603 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":604 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":609 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":599 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":613 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":614 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":615 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":616 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":613 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":619 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":620 + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): + * return isinstance(o, memoryview) # <<<<<<<<<<<<<< + * + * cdef tuple _unellipsify(object index, int ndim): + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":619 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":622 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":627 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":628 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":630 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":632 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":633 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":634 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":635 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_tup) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":636 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":637 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":638 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_9, __pyx_temp, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "View.MemoryView":639 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":641 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_L7:; + + /* "View.MemoryView":642 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":644 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + __pyx_t_1 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_1 = ((!(__Pyx_PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_11 = __pyx_t_1; + } else { + __pyx_t_11 = __pyx_t_2; + } + if (__pyx_t_11) { + + /* "View.MemoryView":645 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":647 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + if (!__pyx_v_have_slices) { + __pyx_t_11 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = __pyx_t_11; + } else { + __pyx_t_2 = __pyx_v_have_slices; + } + __pyx_v_have_slices = __pyx_t_2; + + /* "View.MemoryView":648 + * + * have_slices = have_slices or isinstance(item, slice) + * result.append(item) # <<<<<<<<<<<<<< + * + * nslices = ndim - len(result) + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":650 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":651 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_2 = (__pyx_v_nslices != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":652 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":654 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_2) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_9 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_9 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":622 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":656 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(ndim): + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":658 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * cdef int i + * for i in range(ndim): # <<<<<<<<<<<<<< + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":659 + * cdef int i + * for i in range(ndim): + * if suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":660 + * for i in range(ndim): + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + + /* "View.MemoryView":656 + * return have_slices or nslices, tuple(result) + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< + * cdef int i + * for i in range(ndim): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":667 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":668 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":675 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))); + + /* "View.MemoryView":679 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "View.MemoryView":681 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":682 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":683 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":685 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":686 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":692 + * + * + * dst.memview = p_src.memview # <<<<<<<<<<<<<< + * dst.data = p_src.data + * + */ + __pyx_t_4 = __pyx_v_p_src->memview; + __pyx_v_dst.memview = __pyx_t_4; + + /* "View.MemoryView":693 + * + * dst.memview = p_src.memview + * dst.data = p_src.data # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_v_p_src->data; + __pyx_v_dst.data = __pyx_t_5; + + /* "View.MemoryView":698 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":699 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":703 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (PyList_CheckExact(__pyx_v_indices) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[7]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":704 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (__Pyx_PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":708 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":705 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + + /* "View.MemoryView":711 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":712 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":713 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":714 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1; + + /* "View.MemoryView":715 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":717 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_12 = __pyx_int_0; + } else { + __pyx_t_12 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":718 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_9 = __pyx_int_0; + } else { + __pyx_t_9 = __pyx_t_12; + __pyx_t_12 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":719 + * start = index.start or 0 + * stop = index.stop or 0 + * step = index.step or 0 # <<<<<<<<<<<<<< + * + * have_start = index.start is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_t_12 = __pyx_int_0; + } else { + __pyx_t_12 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":721 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":722 + * + * have_start = index.start is not None + * have_stop = index.stop is not None # <<<<<<<<<<<<<< + * have_step = index.step is not None + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":723 + * have_start = index.start is not None + * have_stop = index.stop is not None + * have_step = index.step is not None # <<<<<<<<<<<<<< + * + * slice_memviewslice( + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = (__pyx_t_12 != Py_None); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":725 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":731 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":733 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":734 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":735 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "View.MemoryView":736 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + + /* "View.MemoryView":734 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":739 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":740 + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":739 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":667 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":764 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":784 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":786 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":787 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + goto __pyx_L4; + } + __pyx_L4:; + + /* "View.MemoryView":788 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":789 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":792 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + __pyx_t_2 = (__pyx_v_have_step != 0); + if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_step < 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_v_negative_step = __pyx_t_4; + + /* "View.MemoryView":794 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + if ((__pyx_v_have_step != 0)) { + __pyx_t_4 = (__pyx_v_step == 0); + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = (__pyx_v_have_step != 0); + } + if (__pyx_t_2) { + + /* "View.MemoryView":795 + * + * if have_step and step == 0: + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + + /* "View.MemoryView":798 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":799 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":800 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":801 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":802 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + goto __pyx_L9; + } + __pyx_L9:; + goto __pyx_L8; + } + + /* "View.MemoryView":803 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":804 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":805 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + goto __pyx_L10; + } + /*else*/ { + + /* "View.MemoryView":807 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_start = __pyx_v_shape; + } + __pyx_L10:; + goto __pyx_L8; + } + __pyx_L8:; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":809 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":810 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + goto __pyx_L11; + } + /*else*/ { + + /* "View.MemoryView":812 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + __pyx_v_start = 0; + } + __pyx_L11:; + } + __pyx_L7:; + + /* "View.MemoryView":814 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":815 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":816 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":817 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":818 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + + /* "View.MemoryView":819 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":820 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + goto __pyx_L13; + } + __pyx_L13:; + goto __pyx_L12; + } + /*else*/ { + + /* "View.MemoryView":822 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":823 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1; + goto __pyx_L15; + } + /*else*/ { + + /* "View.MemoryView":825 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L15:; + } + __pyx_L12:; + + /* "View.MemoryView":827 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":828 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + goto __pyx_L16; + } + __pyx_L16:; + + /* "View.MemoryView":832 + * + * with cython.cdivision(True): + * new_shape = (stop - start) // step # <<<<<<<<<<<<<< + * + * if (stop - start) - step * new_shape: + */ + __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); + + /* "View.MemoryView":834 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":835 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + goto __pyx_L17; + } + __pyx_L17:; + + /* "View.MemoryView":837 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + goto __pyx_L18; + } + __pyx_L18:; + + /* "View.MemoryView":841 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":842 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":843 + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; + } + __pyx_L3:; + + /* "View.MemoryView":846 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":847 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + goto __pyx_L19; + } + /*else*/ { + + /* "View.MemoryView":849 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L19:; + + /* "View.MemoryView":851 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":852 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":854 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + goto __pyx_L22; + } + /*else*/ { + + /* "View.MemoryView":856 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L22:; + goto __pyx_L21; + } + /*else*/ { + + /* "View.MemoryView":859 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L21:; + goto __pyx_L20; + } + __pyx_L20:; + + /* "View.MemoryView":861 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":764 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":867 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":869 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1; + + /* "View.MemoryView":870 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":873 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":874 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":875 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":877 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":878 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":879 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":880 + * stride = view.strides[dim] + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< + * + * if index < 0: + */ + __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); + goto __pyx_L4; + } + __pyx_L4:; + } + __pyx_L3:; + + /* "View.MemoryView":882 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":883 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":884 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":885 + * index += view.shape[dim] + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * if index >= shape: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "View.MemoryView":887 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * if index >= shape: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":888 + * + * if index >= shape: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< + * + * resultp = bufp + index * stride + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":890 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":891 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":892 + * resultp = bufp + index * stride + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< + * + * return resultp + */ + __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); + goto __pyx_L8; + } + __pyx_L8:; + + /* "View.MemoryView":894 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":867 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":900 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":901 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":903 + * cdef int ndim = memslice.memview.view.ndim + * + * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< + * cdef Py_ssize_t *strides = memslice.strides + * + */ + __pyx_t_2 = __pyx_v_memslice->shape; + __pyx_v_shape = __pyx_t_2; + + /* "View.MemoryView":904 + * + * cdef Py_ssize_t *shape = memslice.shape + * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_v_memslice->strides; + __pyx_v_strides = __pyx_t_2; + + /* "View.MemoryView":908 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":909 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":910 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":911 + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + */ + __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]); + __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4; + + /* "View.MemoryView":913 + * shape[i], shape[j] = shape[j], shape[i] + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + */ + __pyx_t_6 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); + if (!__pyx_t_6) { + __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "View.MemoryView":914 + * + * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< + * + * return 1 + */ + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "View.MemoryView":916 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":900 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":933 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":934 + * + * def __dealloc__(self): + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< + * + * cdef convert_item_to_object(self, char *itemp): + */ + __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); + + /* "View.MemoryView":933 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":936 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":937 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":938 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":940 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_vtabptr_memoryview->convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":936 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":942 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":943 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":944 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":946 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * property base: + */ + __pyx_t_3 = __pyx_vtabptr_memoryview->assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":942 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":950 + * property base: + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":951 + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":950 + * property base: + * @cname('__pyx_memoryviewslice__get__base') + * def __get__(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":957 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":966 + * cdef int i + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":967 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "View.MemoryView":972 + * + * + * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< + * + * result.from_slice = memviewslice + */ + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":974 + * result = _memoryviewslice(None, 0, dtype_is_object) + * + * result.from_slice = memviewslice # <<<<<<<<<<<<<< + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + */ + __pyx_v_result->from_slice = __pyx_v_memviewslice; + + /* "View.MemoryView":975 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":977 + * __PYX_INC_MEMVIEW(&memviewslice, 1) + * + * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< + * result.typeinfo = memviewslice.memview.typeinfo + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":978 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":980 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":981 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":982 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":983 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":984 + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * result.flags = PyBUF_RECORDS + */ + Py_INCREF(Py_None); + + /* "View.MemoryView":986 + * Py_INCREF(Py_None) + * + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":988 + * result.flags = PyBUF_RECORDS + * + * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< + * result.view.strides = result.from_slice.strides + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); + + /* "View.MemoryView":989 + * + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * + */ + __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); + + /* "View.MemoryView":990 + * result.view.shape = result.from_slice.shape + * result.view.strides = result.from_slice.strides + * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); + + /* "View.MemoryView":992 + * result.view.suboffsets = result.from_slice.suboffsets + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for i in range(ndim): + * result.view.len *= result.view.shape[i] + */ + __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_6; + + /* "View.MemoryView":993 + * + * result.view.len = result.view.itemsize + * for i in range(ndim): # <<<<<<<<<<<<<< + * result.view.len *= result.view.shape[i] + * + */ + __pyx_t_7 = __pyx_v_ndim; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "View.MemoryView":994 + * result.view.len = result.view.itemsize + * for i in range(ndim): + * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<< + * + * result.to_object_func = to_object_func + */ + __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i])); + } + + /* "View.MemoryView":996 + * result.view.len *= result.view.shape[i] + * + * result.to_object_func = to_object_func # <<<<<<<<<<<<<< + * result.to_dtype_func = to_dtype_func + * + */ + __pyx_v_result->to_object_func = __pyx_v_to_object_func; + + /* "View.MemoryView":997 + * + * result.to_object_func = to_object_func + * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; + + /* "View.MemoryView":999 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":957 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1002 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1005 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1006 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1007 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1009 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1010 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1002 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1013 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1017 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1018 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1019 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1021 + * suboffsets = memview.view.suboffsets + * + * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< + * dst.data = memview.view.buf + * + */ + __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); + + /* "View.MemoryView":1022 + * + * dst.memview = <__pyx_memoryview *> memview + * dst.data = memview.view.buf # <<<<<<<<<<<<<< + * + * for dim in range(memview.view.ndim): + */ + __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); + + /* "View.MemoryView":1024 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_dim = __pyx_t_3; + + /* "View.MemoryView":1025 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1026 + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< + * if suboffsets == NULL: + * dst.suboffsets[dim] = -1 + */ + (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); + + /* "View.MemoryView":1027 + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: # <<<<<<<<<<<<<< + * dst.suboffsets[dim] = -1 + * else: + */ + __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1028 + * dst.strides[dim] = strides[dim] + * if suboffsets == NULL: + * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[dim] = suboffsets[dim] + */ + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":1030 + * dst.suboffsets[dim] = -1 + * else: + * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object') + */ + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]); + } + __pyx_L5:; + } + + /* "View.MemoryView":1013 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1033 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1036 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1037 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1033 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1040 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1047 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1048 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1049 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1051 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1052 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1054 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1056 + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + * to_object_func, to_dtype_func, + * memview.dtype_is_object) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1040 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1062 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1063 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1064 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1066 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1062 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1069 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1074 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1075 + * cdef int i + * cdef Py_ssize_t c_stride = 0 + * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_f_stride = 0; + + /* "View.MemoryView":1077 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1078 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1079 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1080 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1082 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1083 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1084 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1085 + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + */ + goto __pyx_L7_break; + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1087 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1088 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + } + /*else*/ { + + /* "View.MemoryView":1090 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1069 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1093 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1100 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1101 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1102 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1103 + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); + + /* "View.MemoryView":1105 + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1106 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_1 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1107 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_3 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_3) { + __pyx_t_3 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_4 = (__pyx_t_3 != 0); + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (__pyx_t_2) { + + /* "View.MemoryView":1108 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)); + goto __pyx_L4; + } + /*else*/ { + + /* "View.MemoryView":1110 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + __pyx_t_5 = __pyx_v_dst_extent; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1111 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize); + + /* "View.MemoryView":1112 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1113 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1115 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + __pyx_t_5 = __pyx_v_dst_extent; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1116 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1120 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1121 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1093 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1123 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1126 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1123 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1130 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1133 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1135 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1136 + * + * for i in range(ndim): + * size *= src.shape[i] # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); + } + + /* "View.MemoryView":1138 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1130 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1141 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1150 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1151 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "View.MemoryView":1152 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1153 + * for idx in range(ndim): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1155 + * stride = stride * shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1156 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1157 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1159 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1141 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1162 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1173 + * cdef void *result + * + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef size_t size = slice_get_size(src, ndim) + * + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1174 + * + * cdef size_t itemsize = src.memview.view.itemsize + * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< + * + * result = malloc(size) + */ + __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); + + /* "View.MemoryView":1176 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1177 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1178 + * result = malloc(size) + * if not result: + * _err(MemoryError, NULL) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1181 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1182 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1183 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1184 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1185 + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, + */ + (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1; + } + + /* "View.MemoryView":1187 + * tmpslice.suboffsets[i] = -1 + * + * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< + * ndim, order) + * + */ + __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order); + + /* "View.MemoryView":1191 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":1192 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1193 + * for i in range(ndim): + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< + * + * if slice_is_contig(src, order, ndim): + */ + (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "View.MemoryView":1195 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1196 + * + * if slice_is_contig(src, order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size); + goto __pyx_L9; + } + /*else*/ { + + /* "View.MemoryView":1198 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1200 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1162 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1205 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1208 + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + * (i, extent1, extent2)) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err_dim') + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1207 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1205 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1211 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1212 + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: + * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_err') + */ + __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyUnicode_Format(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1211 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1215 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1216 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1217 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "View.MemoryView":1219 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "View.MemoryView":1215 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1222 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "View.MemoryView":1230 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1231 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1233 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1234 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1235 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1238 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1239 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + goto __pyx_L3; + } + + /* "View.MemoryView":1240 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1241 + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< + * + * cdef int ndim = max(src_ndim, dst_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1243 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1245 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1246 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1247 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1248 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1249 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "View.MemoryView":1251 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L7:; + goto __pyx_L6; + } + __pyx_L6:; + + /* "View.MemoryView":1253 + * _err_extents(i, dst.shape[i], src.shape[i]) + * + * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + */ + __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1254 + * + * if src.suboffsets[i] >= 0: + * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< + * + * if slices_overlap(&src, &dst, ndim, itemsize): + */ + __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L8; + } + __pyx_L8:; + } + + /* "View.MemoryView":1256 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(&src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1258 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1259 + * + * if not slice_is_contig(&src, order, ndim): + * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); + goto __pyx_L10; + } + __pyx_L10:; + + /* "View.MemoryView":1261 + * order = get_best_order(&dst, ndim) + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< + * src = tmp + * + */ + __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmpdata = __pyx_t_6; + + /* "View.MemoryView":1262 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + goto __pyx_L9; + } + __pyx_L9:; + + /* "View.MemoryView":1264 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1267 + * + * + * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1268 + * + * if slice_is_contig(&src, 'C', ndim): + * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(&src, 'F', ndim): + * direct_copy = slice_is_contig(&dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim); + goto __pyx_L12; + } + + /* "View.MemoryView":1269 + * if slice_is_contig(&src, 'C', ndim): + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(&dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1270 + * direct_copy = slice_is_contig(&dst, 'C', ndim) + * elif slice_is_contig(&src, 'F', ndim): + * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<< + * + * if direct_copy: + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim); + goto __pyx_L12; + } + __pyx_L12:; + + /* "View.MemoryView":1272 + * direct_copy = slice_is_contig(&dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1274 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1275 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)); + + /* "View.MemoryView":1276 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1277 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1278 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "View.MemoryView":1280 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_7 = (__pyx_t_2 != 0); + if (__pyx_t_7) { + + /* "View.MemoryView":1283 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":1284 + * + * transpose_memslice(&src) + * transpose_memslice(&dst) # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L14; + } + __pyx_L14:; + + /* "View.MemoryView":1286 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1287 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1288 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * free(tmpdata) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1290 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1291 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1222 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1294 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + + /* "View.MemoryView":1298 + * int ndim_other) nogil: + * cdef int i + * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< + * + * for i in range(ndim - 1, -1, -1): + */ + __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); + + /* "View.MemoryView":1300 + * cdef int offset = ndim_other - ndim + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1301 + * + * for i in range(ndim - 1, -1, -1): + * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<< + * slice.strides[i + offset] = slice.strides[i] + * slice.suboffsets[i + offset] = slice.suboffsets[i] + */ + (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]); + + /* "View.MemoryView":1302 + * for i in range(ndim - 1, -1, -1): + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<< + * slice.suboffsets[i + offset] = slice.suboffsets[i] + * + */ + (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]); + + /* "View.MemoryView":1303 + * slice.shape[i + offset] = slice.shape[i] + * slice.strides[i + offset] = slice.strides[i] + * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<< + * + * for i in range(offset): + */ + (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]); + } + + /* "View.MemoryView":1305 + * slice.suboffsets[i + offset] = slice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1306 + * + * for i in range(offset): + * slice.shape[i] = 1 # <<<<<<<<<<<<<< + * slice.strides[i] = slice.strides[0] + * slice.suboffsets[i] = -1 + */ + (__pyx_v_slice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1307 + * for i in range(offset): + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<< + * slice.suboffsets[i] = -1 + * + */ + (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]); + + /* "View.MemoryView":1308 + * slice.shape[i] = 1 + * slice.strides[i] = slice.strides[0] + * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1; + } + + /* "View.MemoryView":1294 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1316 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { + int __pyx_t_1; + + /* "View.MemoryView":1320 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1321 + * + * if dtype_is_object: + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< + * dst.strides, ndim, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); + goto __pyx_L3; + } + __pyx_L3:; + + /* "View.MemoryView":1316 + * + * @cname('__pyx_memoryview_refcount_copying') + * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< + * int ndim, bint inc) nogil: + * + */ + + /* function exit code */ +} + +/* "View.MemoryView":1325 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1328 + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); + + /* "View.MemoryView":1325 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1331 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1335 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "View.MemoryView":1336 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_3 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1337 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_3 = (__pyx_v_inc != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":1338 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + goto __pyx_L6; + } + /*else*/ { + + /* "View.MemoryView":1340 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "View.MemoryView":1342 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1345 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1331 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1351 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1354 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1355 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1357 + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * + * + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1351 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + + /* "View.MemoryView":1365 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1366 + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] + * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< + * + * if ndim == 1: + */ + __pyx_v_extent = (__pyx_v_shape[0]); + + /* "View.MemoryView":1368 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1369 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1370 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize); + + /* "View.MemoryView":1371 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + goto __pyx_L3; + } + /*else*/ { + + /* "View.MemoryView":1373 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + __pyx_t_2 = __pyx_v_extent; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1374 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1376 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +static PyObject *__pyx_tp_new_6pandas_3lib__PandasNull(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib__PandasNull(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6pandas_3lib__PandasNull[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib__PandasNull = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib._PandasNull"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib__PandasNull), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib__PandasNull, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + __pyx_pw_6pandas_3lib_11_PandasNull_3__hash__, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + __pyx_pw_6pandas_3lib_11_PandasNull_1__richcmp__, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib__PandasNull, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib__PandasNull, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_3lib_BlockPlacement __pyx_vtable_6pandas_3lib_BlockPlacement; + +static PyObject *__pyx_tp_new_6pandas_3lib_BlockPlacement(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_BlockPlacement *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_BlockPlacement *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_BlockPlacement; + p->_as_slice = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_as_array = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_BlockPlacement(PyObject *o) { + struct __pyx_obj_6pandas_3lib_BlockPlacement *p = (struct __pyx_obj_6pandas_3lib_BlockPlacement *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_as_slice); + Py_CLEAR(p->_as_array); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_BlockPlacement(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_BlockPlacement *p = (struct __pyx_obj_6pandas_3lib_BlockPlacement *)o; + if (p->_as_slice) { + e = (*v)(p->_as_slice, a); if (e) return e; + } + if (p->_as_array) { + e = (*v)(p->_as_array, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_BlockPlacement(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_BlockPlacement *p = (struct __pyx_obj_6pandas_3lib_BlockPlacement *)o; + tmp = ((PyObject*)p->_as_slice); + p->_as_slice = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_as_array); + p->_as_array = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +static PyObject *__pyx_sq_item_6pandas_3lib_BlockPlacement(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static PyMethodDef __pyx_methods_6pandas_3lib_BlockPlacement[] = { + {__Pyx_NAMESTR("__unicode__"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_3__unicode__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("as_slice"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_9as_slice, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("indexer"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_11indexer, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("isin"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_13isin, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("as_array"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_15as_array, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("is_slice_like"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_17is_slice_like, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("delete"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_21delete, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_23append, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_25add, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sub"), (PyCFunction)__pyx_pw_6pandas_3lib_14BlockPlacement_27sub, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_BlockPlacement = { + __pyx_pw_6pandas_3lib_14BlockPlacement_5__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_6pandas_3lib_BlockPlacement, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_BlockPlacement = { + __pyx_pw_6pandas_3lib_14BlockPlacement_5__len__, /*mp_length*/ + __pyx_pw_6pandas_3lib_14BlockPlacement_19__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6pandas_3lib_BlockPlacement = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.BlockPlacement"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_BlockPlacement), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_BlockPlacement, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_BlockPlacement, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_BlockPlacement, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_BlockPlacement, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_BlockPlacement, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6pandas_3lib_14BlockPlacement_7__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_BlockPlacement, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_14BlockPlacement_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_BlockPlacement, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_Reducer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_Reducer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_Reducer *)o); + p->arr = Py_None; Py_INCREF(Py_None); + p->dummy = Py_None; Py_INCREF(Py_None); + p->f = Py_None; Py_INCREF(Py_None); + p->labels = Py_None; Py_INCREF(Py_None); + p->typ = Py_None; Py_INCREF(Py_None); + p->index = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_Reducer(PyObject *o) { + struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arr); + Py_CLEAR(p->dummy); + Py_CLEAR(p->f); + Py_CLEAR(p->labels); + Py_CLEAR(p->typ); + Py_CLEAR(p->index); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_Reducer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o; + if (p->arr) { + e = (*v)(p->arr, a); if (e) return e; + } + if (p->dummy) { + e = (*v)(p->dummy, a); if (e) return e; + } + if (p->f) { + e = (*v)(p->f, a); if (e) return e; + } + if (p->labels) { + e = (*v)(p->labels, a); if (e) return e; + } + if (p->typ) { + e = (*v)(p->typ, a); if (e) return e; + } + if (p->index) { + e = (*v)(p->index, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_Reducer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o; + tmp = ((PyObject*)p->arr); + p->arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy); + p->dummy = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f); + p->f = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->labels); + p->labels = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->typ); + p->typ = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->index); + p->index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_3lib_Reducer[] = { + {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pw_6pandas_3lib_7Reducer_3_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pw_6pandas_3lib_7Reducer_5get_result, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pw_6pandas_3lib_7Reducer_7_get_result_array, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_Reducer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.Reducer"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_Reducer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_Reducer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Performs generic reduction operation on a C or Fortran-contiguous ndarray\n while avoiding ndarray construction overhead\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_Reducer, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_Reducer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_Reducer, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_7Reducer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_Reducer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_SeriesBinGrouper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o); + p->arr = Py_None; Py_INCREF(Py_None); + p->index = Py_None; Py_INCREF(Py_None); + p->dummy_arr = Py_None; Py_INCREF(Py_None); + p->dummy_index = Py_None; Py_INCREF(Py_None); + p->values = Py_None; Py_INCREF(Py_None); + p->f = Py_None; Py_INCREF(Py_None); + p->bins = Py_None; Py_INCREF(Py_None); + p->typ = Py_None; Py_INCREF(Py_None); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_SeriesBinGrouper(PyObject *o) { + struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arr); + Py_CLEAR(p->index); + Py_CLEAR(p->dummy_arr); + Py_CLEAR(p->dummy_index); + Py_CLEAR(p->values); + Py_CLEAR(p->f); + Py_CLEAR(p->bins); + Py_CLEAR(p->typ); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_SeriesBinGrouper(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o; + if (p->arr) { + e = (*v)(p->arr, a); if (e) return e; + } + if (p->index) { + e = (*v)(p->index, a); if (e) return e; + } + if (p->dummy_arr) { + e = (*v)(p->dummy_arr, a); if (e) return e; + } + if (p->dummy_index) { + e = (*v)(p->dummy_index, a); if (e) return e; + } + if (p->values) { + e = (*v)(p->values, a); if (e) return e; + } + if (p->f) { + e = (*v)(p->f, a); if (e) return e; + } + if (p->bins) { + e = (*v)(p->bins, a); if (e) return e; + } + if (p->typ) { + e = (*v)(p->typ, a); if (e) return e; + } + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_SeriesBinGrouper(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o; + tmp = ((PyObject*)p->arr); + p->arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->index); + p->index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy_arr); + p->dummy_arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy_index); + p->dummy_index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->values); + p->values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f); + p->f = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->bins); + p->bins = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->typ); + p->typ = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_arr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_arr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3arr_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_5index_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy_arr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy_arr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_9dummy_arr_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_11dummy_index_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_6values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_f(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1f_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_bins(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_bins(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4bins_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_typ(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_typ(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_3typ_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_16SeriesBinGrouper_4name_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_3lib_SeriesBinGrouper[] = { + {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pw_6pandas_3lib_16SeriesBinGrouper_3_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pw_6pandas_3lib_16SeriesBinGrouper_5get_result, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pw_6pandas_3lib_16SeriesBinGrouper_7_get_result_array, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_3lib_SeriesBinGrouper[] = { + {(char *)"arr", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_arr, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_arr, 0, 0}, + {(char *)"index", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_index, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_index, 0, 0}, + {(char *)"dummy_arr", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy_arr, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy_arr, 0, 0}, + {(char *)"dummy_index", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy_index, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy_index, 0, 0}, + {(char *)"values", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_values, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_values, 0, 0}, + {(char *)"f", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_f, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_f, 0, 0}, + {(char *)"bins", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_bins, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_bins, 0, 0}, + {(char *)"typ", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_typ, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_typ, 0, 0}, + {(char *)"name", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_name, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_name, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_SeriesBinGrouper = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.SeriesBinGrouper"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_SeriesBinGrouper, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Performs grouping operation according to bin edges, rather than labels\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_SeriesBinGrouper, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_SeriesBinGrouper, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_SeriesBinGrouper, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_3lib_SeriesBinGrouper, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_16SeriesBinGrouper_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_SeriesBinGrouper, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_SeriesGrouper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_SeriesGrouper *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o); + p->arr = Py_None; Py_INCREF(Py_None); + p->index = Py_None; Py_INCREF(Py_None); + p->dummy_arr = Py_None; Py_INCREF(Py_None); + p->dummy_index = Py_None; Py_INCREF(Py_None); + p->f = Py_None; Py_INCREF(Py_None); + p->labels = Py_None; Py_INCREF(Py_None); + p->values = Py_None; Py_INCREF(Py_None); + p->typ = Py_None; Py_INCREF(Py_None); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_SeriesGrouper(PyObject *o) { + struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arr); + Py_CLEAR(p->index); + Py_CLEAR(p->dummy_arr); + Py_CLEAR(p->dummy_index); + Py_CLEAR(p->f); + Py_CLEAR(p->labels); + Py_CLEAR(p->values); + Py_CLEAR(p->typ); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_SeriesGrouper(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o; + if (p->arr) { + e = (*v)(p->arr, a); if (e) return e; + } + if (p->index) { + e = (*v)(p->index, a); if (e) return e; + } + if (p->dummy_arr) { + e = (*v)(p->dummy_arr, a); if (e) return e; + } + if (p->dummy_index) { + e = (*v)(p->dummy_index, a); if (e) return e; + } + if (p->f) { + e = (*v)(p->f, a); if (e) return e; + } + if (p->labels) { + e = (*v)(p->labels, a); if (e) return e; + } + if (p->values) { + e = (*v)(p->values, a); if (e) return e; + } + if (p->typ) { + e = (*v)(p->typ, a); if (e) return e; + } + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_SeriesGrouper(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o; + tmp = ((PyObject*)p->arr); + p->arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->index); + p->index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy_arr); + p->dummy_arr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy_index); + p->dummy_index = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f); + p->f = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->labels); + p->labels = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->values); + p->values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->typ); + p->typ = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_arr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_arr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3arr_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_5index_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy_arr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy_arr(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_9dummy_arr_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_11dummy_index_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_f(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_1f_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_labels(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_labels(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6labels_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_6values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_typ(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_typ(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_3typ_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_13SeriesGrouper_4name_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_3lib_SeriesGrouper[] = { + {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pw_6pandas_3lib_13SeriesGrouper_3_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pw_6pandas_3lib_13SeriesGrouper_5get_result, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pw_6pandas_3lib_13SeriesGrouper_7_get_result_array, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_3lib_SeriesGrouper[] = { + {(char *)"arr", __pyx_getprop_6pandas_3lib_13SeriesGrouper_arr, __pyx_setprop_6pandas_3lib_13SeriesGrouper_arr, 0, 0}, + {(char *)"index", __pyx_getprop_6pandas_3lib_13SeriesGrouper_index, __pyx_setprop_6pandas_3lib_13SeriesGrouper_index, 0, 0}, + {(char *)"dummy_arr", __pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy_arr, __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy_arr, 0, 0}, + {(char *)"dummy_index", __pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy_index, __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy_index, 0, 0}, + {(char *)"f", __pyx_getprop_6pandas_3lib_13SeriesGrouper_f, __pyx_setprop_6pandas_3lib_13SeriesGrouper_f, 0, 0}, + {(char *)"labels", __pyx_getprop_6pandas_3lib_13SeriesGrouper_labels, __pyx_setprop_6pandas_3lib_13SeriesGrouper_labels, 0, 0}, + {(char *)"values", __pyx_getprop_6pandas_3lib_13SeriesGrouper_values, __pyx_setprop_6pandas_3lib_13SeriesGrouper_values, 0, 0}, + {(char *)"typ", __pyx_getprop_6pandas_3lib_13SeriesGrouper_typ, __pyx_setprop_6pandas_3lib_13SeriesGrouper_typ, 0, 0}, + {(char *)"name", __pyx_getprop_6pandas_3lib_13SeriesGrouper_name, __pyx_setprop_6pandas_3lib_13SeriesGrouper_name, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_SeriesGrouper = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.SeriesGrouper"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_SeriesGrouper), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_SeriesGrouper, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Performs generic grouping operation while avoiding ndarray construction\n overhead\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_SeriesGrouper, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_SeriesGrouper, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_SeriesGrouper, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_3lib_SeriesGrouper, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_13SeriesGrouper_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_SeriesGrouper, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_3lib_Slider __pyx_vtable_6pandas_3lib_Slider; + +static PyObject *__pyx_tp_new_6pandas_3lib_Slider(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_Slider *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_Slider *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_Slider; + p->values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->buf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_Slider(PyObject *o) { + struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->values); + Py_CLEAR(p->buf); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_Slider(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o; + if (p->values) { + e = (*v)(((PyObject*)p->values), a); if (e) return e; + } + if (p->buf) { + e = (*v)(((PyObject*)p->buf), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_Slider(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o; + tmp = ((PyObject*)p->values); + p->values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->buf); + p->buf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_3lib_Slider[] = { + {__Pyx_NAMESTR("advance"), (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_3advance, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_length"), (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_5set_length, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_6pandas_3lib_6Slider_7reset, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_Slider = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.Slider"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_Slider), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_Slider, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Only handles contiguous data for now\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_Slider, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_Slider, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_Slider, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_6Slider_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_Slider, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_3lib_BlockSlider __pyx_vtable_6pandas_3lib_BlockSlider; + +static PyObject *__pyx_tp_new_6pandas_3lib_BlockSlider(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_BlockSlider *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_BlockSlider *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_BlockSlider; + p->frame = Py_None; Py_INCREF(Py_None); + p->dummy = Py_None; Py_INCREF(Py_None); + p->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)Py_None); Py_INCREF(Py_None); + p->blocks = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_BlockSlider(PyObject *o) { + struct __pyx_obj_6pandas_3lib_BlockSlider *p = (struct __pyx_obj_6pandas_3lib_BlockSlider *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_3lib_11BlockSlider_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->frame); + Py_CLEAR(p->dummy); + Py_CLEAR(p->idx_slider); + Py_CLEAR(p->blocks); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_BlockSlider(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_BlockSlider *p = (struct __pyx_obj_6pandas_3lib_BlockSlider *)o; + if (p->frame) { + e = (*v)(p->frame, a); if (e) return e; + } + if (p->dummy) { + e = (*v)(p->dummy, a); if (e) return e; + } + if (p->idx_slider) { + e = (*v)(((PyObject*)p->idx_slider), a); if (e) return e; + } + if (p->blocks) { + e = (*v)(p->blocks, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_BlockSlider(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_BlockSlider *p = (struct __pyx_obj_6pandas_3lib_BlockSlider *)o; + tmp = ((PyObject*)p->frame); + p->frame = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dummy); + p->dummy = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->idx_slider); + p->idx_slider = ((struct __pyx_obj_6pandas_3lib_Slider *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->blocks); + p->blocks = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_frame(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_5frame_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_frame(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_5frame_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_11BlockSlider_5frame_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_dummy(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_dummy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_11BlockSlider_5dummy_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_nblocks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_nblocks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_7nblocks_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_idx_slider(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_idx_slider(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_11BlockSlider_10idx_slider_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_11BlockSlider_blocks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_1__get__(o); +} + +static int __pyx_setprop_6pandas_3lib_11BlockSlider_blocks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_3lib_11BlockSlider_6blocks_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_3lib_BlockSlider[] = { + {__Pyx_NAMESTR("move"), (PyCFunction)__pyx_pw_6pandas_3lib_11BlockSlider_5move, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_3lib_BlockSlider[] = { + {(char *)"frame", __pyx_getprop_6pandas_3lib_11BlockSlider_frame, __pyx_setprop_6pandas_3lib_11BlockSlider_frame, 0, 0}, + {(char *)"dummy", __pyx_getprop_6pandas_3lib_11BlockSlider_dummy, __pyx_setprop_6pandas_3lib_11BlockSlider_dummy, 0, 0}, + {(char *)"nblocks", __pyx_getprop_6pandas_3lib_11BlockSlider_nblocks, __pyx_setprop_6pandas_3lib_11BlockSlider_nblocks, 0, 0}, + {(char *)"idx_slider", __pyx_getprop_6pandas_3lib_11BlockSlider_idx_slider, __pyx_setprop_6pandas_3lib_11BlockSlider_idx_slider, 0, 0}, + {(char *)"blocks", __pyx_getprop_6pandas_3lib_11BlockSlider_blocks, __pyx_setprop_6pandas_3lib_11BlockSlider_blocks, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_BlockSlider = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.BlockSlider"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_BlockSlider), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_BlockSlider, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Only capable of sliding on axis=0\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_BlockSlider, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_BlockSlider, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_BlockSlider, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_3lib_BlockSlider, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_11BlockSlider_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_BlockSlider, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_cache_readonly(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib_cache_readonly *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)o); + p->func = Py_None; Py_INCREF(Py_None); + p->name = Py_None; Py_INCREF(Py_None); + p->allow_setting = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_cache_readonly(PyObject *o) { + struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->func); + Py_CLEAR(p->name); + Py_CLEAR(p->allow_setting); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_3lib_cache_readonly(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o; + if (p->func) { + e = (*v)(p->func, a); if (e) return e; + } + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + if (p->allow_setting) { + e = (*v)(p->allow_setting, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib_cache_readonly(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o; + tmp = ((PyObject*)p->func); + p->func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->allow_setting); + p->allow_setting = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_tp_descr_get_6pandas_3lib_cache_readonly(PyObject *o, PyObject *i, PyObject *c) { + PyObject *r = 0; + if (!i) i = Py_None; + if (!c) c = Py_None; + r = __pyx_pw_6pandas_3lib_14cache_readonly_5__get__(o, i, c); + return r; +} + +static int __pyx_tp_descr_set_6pandas_3lib_cache_readonly(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_pw_6pandas_3lib_14cache_readonly_7__set__(o, i, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__delete__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_3lib_14cache_readonly_func(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_14cache_readonly_4func_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_3lib_14cache_readonly_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_14cache_readonly_4name_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_3lib_14cache_readonly_allow_setting(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_3lib_14cache_readonly_13allow_setting_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_3lib_cache_readonly[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_3lib_cache_readonly[] = { + {(char *)"func", __pyx_getprop_6pandas_3lib_14cache_readonly_func, 0, 0, 0}, + {(char *)"name", __pyx_getprop_6pandas_3lib_14cache_readonly_name, 0, 0, 0}, + {(char *)"allow_setting", __pyx_getprop_6pandas_3lib_14cache_readonly_allow_setting, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_cache_readonly = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.cache_readonly"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_cache_readonly), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_cache_readonly, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6pandas_3lib_14cache_readonly_3__call__, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib_cache_readonly, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib_cache_readonly, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_cache_readonly, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_3lib_cache_readonly, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __pyx_tp_descr_get_6pandas_3lib_cache_readonly, /*tp_descr_get*/ + __pyx_tp_descr_set_6pandas_3lib_cache_readonly, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_14cache_readonly_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_cache_readonly, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_3lib_AxisProperty(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib_AxisProperty(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_tp_descr_get_6pandas_3lib_AxisProperty(PyObject *o, PyObject *i, PyObject *c) { + PyObject *r = 0; + if (!i) i = Py_None; + if (!c) c = Py_None; + r = __pyx_pw_6pandas_3lib_12AxisProperty_3__get__(o, i, c); + return r; +} + +static int __pyx_tp_descr_set_6pandas_3lib_AxisProperty(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_pw_6pandas_3lib_12AxisProperty_5__set__(o, i, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__delete__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6pandas_3lib_AxisProperty[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_3lib_AxisProperty = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.AxisProperty"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib_AxisProperty), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib_AxisProperty, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_3lib_AxisProperty, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __pyx_tp_descr_get_6pandas_3lib_AxisProperty, /*tp_descr_get*/ + __pyx_tp_descr_set_6pandas_3lib_AxisProperty, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_3lib_12AxisProperty_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib_AxisProperty, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *__pyx_freelist_6pandas_3lib___pyx_scope_struct__get_blkno_indexers[8]; +static int __pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers = 0; + +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *p; + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers)))) { + o = (PyObject*)__pyx_freelist_6pandas_3lib___pyx_scope_struct__get_blkno_indexers[--__pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + p = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o); + p->__pyx_v_blknos.data = NULL; + p->__pyx_v_blknos.memview = NULL; + p->__pyx_v_res_view.data = NULL; + p->__pyx_v_res_view.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyObject *o) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_blkno); + Py_CLEAR(p->__pyx_v_genexpr); + Py_CLEAR(p->__pyx_v_group_dict); + Py_CLEAR(p->__pyx_v_group_order); + Py_CLEAR(p->__pyx_v_group_slices); + Py_CLEAR(p->__pyx_v_result); + Py_CLEAR(p->__pyx_v_slices); + Py_CLEAR(p->__pyx_v_tot_len); + Py_CLEAR(p->__pyx_t_4); + __PYX_XDEC_MEMVIEW(&p->__pyx_v_blknos, 1); + __PYX_XDEC_MEMVIEW(&p->__pyx_v_res_view, 1); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers)))) { + __pyx_freelist_6pandas_3lib___pyx_scope_struct__get_blkno_indexers[__pyx_freecount_6pandas_3lib___pyx_scope_struct__get_blkno_indexers++] = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o; + if (p->__pyx_v_blkno) { + e = (*v)(p->__pyx_v_blkno, a); if (e) return e; + } + if (p->__pyx_v_genexpr) { + e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; + } + if (p->__pyx_v_group_dict) { + e = (*v)(p->__pyx_v_group_dict, a); if (e) return e; + } + if (p->__pyx_v_group_order) { + e = (*v)(p->__pyx_v_group_order, a); if (e) return e; + } + if (p->__pyx_v_group_slices) { + e = (*v)(p->__pyx_v_group_slices, a); if (e) return e; + } + if (p->__pyx_v_result) { + e = (*v)(p->__pyx_v_result, a); if (e) return e; + } + if (p->__pyx_v_slices) { + e = (*v)(p->__pyx_v_slices, a); if (e) return e; + } + if (p->__pyx_v_tot_len) { + e = (*v)(p->__pyx_v_tot_len, a); if (e) return e; + } + if (p->__pyx_t_4) { + e = (*v)(p->__pyx_t_4, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct__get_blkno_indexers(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)o; + tmp = ((PyObject*)p->__pyx_v_blkno); + p->__pyx_v_blkno = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_genexpr); + p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_group_dict); + p->__pyx_v_group_dict = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_group_order); + p->__pyx_v_group_order = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_group_slices); + p->__pyx_v_group_slices = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_result); + p->__pyx_v_result = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_slices); + p->__pyx_v_slices = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_tot_len); + p->__pyx_v_tot_len = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_4); + p->__pyx_t_4 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct__get_blkno_indexers = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct__get_blkno_indexers"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib___pyx_scope_struct__get_blkno_indexers, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *__pyx_freelist_6pandas_3lib___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_6pandas_3lib___pyx_scope_struct_1_genexpr[--__pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_start); + Py_CLEAR(p->__pyx_v_stop); + Py_CLEAR(p->__pyx_t_0); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_6pandas_3lib___pyx_scope_struct_1_genexpr[__pyx_freecount_6pandas_3lib___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_start) { + e = (*v)(p->__pyx_v_start, a); if (e) return e; + } + if (p->__pyx_v_stop) { + e = (*v)(p->__pyx_v_stop, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_1_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__get_blkno_indexers *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_start); + p->__pyx_v_start = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_stop); + p->__pyx_v_stop = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct_1_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_1_genexpr, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *__pyx_freelist_6pandas_3lib___pyx_scope_struct_2_try_parse_dates[8]; +static int __pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates = 0; + +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates)))) { + o = (PyObject*)__pyx_freelist_6pandas_3lib___pyx_scope_struct_2_try_parse_dates[--__pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyObject *o) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_dayfirst); + Py_CLEAR(p->__pyx_v_default); + Py_CLEAR(p->__pyx_v_parse); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates)))) { + __pyx_freelist_6pandas_3lib___pyx_scope_struct_2_try_parse_dates[__pyx_freecount_6pandas_3lib___pyx_scope_struct_2_try_parse_dates++] = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)o; + if (p->__pyx_v_dayfirst) { + e = (*v)(p->__pyx_v_dayfirst, a); if (e) return e; + } + if (p->__pyx_v_default) { + e = (*v)(p->__pyx_v_default, a); if (e) return e; + } + if (p->__pyx_v_parse) { + e = (*v)(p->__pyx_v_parse, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_2_try_parse_dates(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates *)o; + tmp = ((PyObject*)p->__pyx_v_dayfirst); + p->__pyx_v_dayfirst = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_default); + p->__pyx_v_default = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_parse); + p->__pyx_v_parse = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct_2_try_parse_dates = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct_2_try_parse_dates"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_2_try_parse_dates), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib___pyx_scope_struct_2_try_parse_dates, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *__pyx_freelist_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time[8]; +static int __pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time = 0; + +static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time)))) { + o = (PyObject*)__pyx_freelist_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time[--__pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyObject *o) { + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_date); + Py_CLEAR(p->__pyx_v_dayfirst); + Py_CLEAR(p->__pyx_v_default); + Py_CLEAR(p->__pyx_v_parse); + Py_CLEAR(p->__pyx_v_time); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time)))) { + __pyx_freelist_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time[__pyx_freecount_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time++] = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)o; + if (p->__pyx_v_date) { + e = (*v)(p->__pyx_v_date, a); if (e) return e; + } + if (p->__pyx_v_dayfirst) { + e = (*v)(p->__pyx_v_dayfirst, a); if (e) return e; + } + if (p->__pyx_v_default) { + e = (*v)(p->__pyx_v_default, a); if (e) return e; + } + if (p->__pyx_v_parse) { + e = (*v)(p->__pyx_v_parse, a); if (e) return e; + } + if (p->__pyx_v_time) { + e = (*v)(p->__pyx_v_time, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time *)o; + tmp = ((PyObject*)p->__pyx_v_date); + p->__pyx_v_date = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_dayfirst); + p->__pyx_v_dayfirst = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_default); + p->__pyx_v_default = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_parse); + p->__pyx_v_parse = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_time); + p->__pyx_v_time = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct_3_try_parse_date_and_time"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, /*tp_traverse*/ + __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_array___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return get_memview(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_array_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.array"), /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.Enum"), /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryview___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_transpose(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview__get__base(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_shape(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_strides(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_suboffsets(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_ndim(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_itemsize(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_nbytes(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_size(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib.memoryview"), /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryviewslice___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryviewslice__get__base(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.lib._memoryviewslice"), /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Internal class for passing memoryview slices to Python"), /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("map_indices_list"), (PyCFunction)__pyx_pw_6pandas_3lib_3map_indices_list, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_2map_indices_list)}, + {__Pyx_NAMESTR("to_datetime"), (PyCFunction)__pyx_pw_6pandas_3lib_9to_datetime, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_timestamp"), (PyCFunction)__pyx_pw_6pandas_3lib_11to_timestamp, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("checknull"), (PyCFunction)__pyx_pw_6pandas_3lib_17checknull, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("checknull_old"), (PyCFunction)__pyx_pw_6pandas_3lib_19checknull_old, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("astype_str"), (PyCFunction)__pyx_pw_6pandas_3lib_69astype_str, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("indexer_as_slice"), (PyCFunction)__pyx_pw_6pandas_3lib_108indexer_as_slice, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("slice_canonize"), (PyCFunction)__pyx_pw_6pandas_3lib_110slice_canonize, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_109slice_canonize)}, + {__Pyx_NAMESTR("slice_get_indices_ex"), (PyCFunction)__pyx_pw_6pandas_3lib_112slice_get_indices_ex, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_111slice_get_indices_ex)}, + {__Pyx_NAMESTR("slice_len"), (PyCFunction)__pyx_pw_6pandas_3lib_114slice_len, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_113slice_len)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("lib"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_1_6_2, __pyx_k_1_6_2, sizeof(__pyx_k_1_6_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Arrays_were_different_lengths_d, __pyx_k_Arrays_were_different_lengths_d, sizeof(__pyx_k_Arrays_were_different_lengths_d), 0, 0, 1, 0}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_modify_frame_index_intern, __pyx_k_Cannot_modify_frame_index_intern, sizeof(__pyx_k_Cannot_modify_frame_index_intern), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_use_shortcut, __pyx_k_Cannot_use_shortcut, sizeof(__pyx_k_Cannot_use_shortcut), 0, 0, 1, 0}, + {&__pyx_kp_s_Dummy_array_must_be_length_d, __pyx_k_Dummy_array_must_be_length_d, sizeof(__pyx_k_Dummy_array_must_be_length_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Dummy_array_must_be_same_dtype, __pyx_k_Dummy_array_must_be_same_dtype, sizeof(__pyx_k_Dummy_array_must_be_same_dtype), 0, 0, 1, 0}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_kp_s_Empty_string_encountered, __pyx_k_Empty_string_encountered, sizeof(__pyx_k_Empty_string_encountered), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1}, + {&__pyx_n_s_FALSE, __pyx_k_FALSE, sizeof(__pyx_k_FALSE), 0, 0, 1, 1}, + {&__pyx_n_s_False, __pyx_k_False, sizeof(__pyx_k_False), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Function_unsafe_for_fast_apply, __pyx_k_Function_unsafe_for_fast_apply, sizeof(__pyx_k_Function_unsafe_for_fast_apply), 0, 0, 1, 0}, + {&__pyx_kp_s_H_M_S, __pyx_k_H_M_S, sizeof(__pyx_k_H_M_S), 0, 0, 1, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_n_s_Int64Index, __pyx_k_Int64Index, sizeof(__pyx_k_Int64Index), 0, 0, 1, 1}, + {&__pyx_n_s_InvalidApply, __pyx_k_InvalidApply, sizeof(__pyx_k_InvalidApply), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_length_for_values_or_for, __pyx_k_Invalid_length_for_values_or_for, sizeof(__pyx_k_Invalid_length_for_values_or_for), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Length_of_all_datetime_component, __pyx_k_Length_of_all_datetime_component, sizeof(__pyx_k_Length_of_all_datetime_component), 0, 0, 1, 0}, + {&__pyx_kp_s_Length_of_dates_and_times_must_b, __pyx_k_Length_of_dates_and_times_must_b, sizeof(__pyx_k_Length_of_dates_and_times_must_b), 0, 0, 1, 0}, + {&__pyx_kp_s_Length_of_years_months_days_must, __pyx_k_Length_of_years_months_days_must, sizeof(__pyx_k_Length_of_years_months_days_must), 0, 0, 1, 0}, + {&__pyx_kp_s_Let_this_error_raise_above_us, __pyx_k_Let_this_error_raise_above_us, sizeof(__pyx_k_Let_this_error_raise_above_us), 0, 0, 1, 0}, + {&__pyx_n_s_LooseVersion, __pyx_k_LooseVersion, sizeof(__pyx_k_LooseVersion), 0, 0, 1, 1}, + {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1}, + {&__pyx_kp_s_M8_ns, __pyx_k_M8_ns, sizeof(__pyx_k_M8_ns), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1}, + {&__pyx_n_s_NaT, __pyx_k_NaT, sizeof(__pyx_k_NaT), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_kp_s_Not_slice_like, __pyx_k_Not_slice_like, sizeof(__pyx_k_Not_slice_like), 0, 0, 1, 0}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, + {&__pyx_n_s_Period, __pyx_k_Period, sizeof(__pyx_k_Period), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_n_s_TRUE, __pyx_k_TRUE, sizeof(__pyx_k_TRUE), 0, 0, 1, 1}, + {&__pyx_n_s_TYPE_MAP, __pyx_k_TYPE_MAP, sizeof(__pyx_k_TYPE_MAP), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_True, __pyx_k_True, sizeof(__pyx_k_True), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_operator, __pyx_k_Unrecognized_operator, sizeof(__pyx_k_Unrecognized_operator), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_Values_falls_after_last_bin, __pyx_k_Values_falls_after_last_bin, sizeof(__pyx_k_Values_falls_after_last_bin), 0, 0, 1, 0}, + {&__pyx_kp_s_Values_falls_before_first_bin, __pyx_k_Values_falls_before_first_bin, sizeof(__pyx_k_Values_falls_before_first_bin), 0, 0, 1, 0}, + {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1}, + {&__pyx_kp_s__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 0, 1, 0}, + {&__pyx_kp_s__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 0, 1, 0}, + {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, + {&__pyx_n_s_advance, __pyx_k_advance, sizeof(__pyx_k_advance), 0, 0, 1, 1}, + {&__pyx_n_s_all_arrays, __pyx_k_all_arrays, sizeof(__pyx_k_all_arrays), 0, 0, 1, 1}, + {&__pyx_kp_s_all_arrays_must_be_same_length, __pyx_k_all_arrays_must_be_same_length, sizeof(__pyx_k_all_arrays_must_be_same_length), 0, 0, 1, 0}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_allow_setting, __pyx_k_allow_setting, sizeof(__pyx_k_allow_setting), 0, 0, 1, 1}, + {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_apply_frame_axis0, __pyx_k_apply_frame_axis0, sizeof(__pyx_k_apply_frame_axis0), 0, 0, 1, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_arobj, __pyx_k_arobj, sizeof(__pyx_k_arobj), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_array_to_timestamp, __pyx_k_array_to_timestamp, sizeof(__pyx_k_array_to_timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_arrays, __pyx_k_arrays, sizeof(__pyx_k_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_arrmap, __pyx_k_arrmap, sizeof(__pyx_k_arrmap), 0, 0, 1, 1}, + {&__pyx_n_s_as_array, __pyx_k_as_array, sizeof(__pyx_k_as_array), 0, 0, 1, 1}, + {&__pyx_n_s_as_slice, __pyx_k_as_slice, sizeof(__pyx_k_as_slice), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_astype_intsafe, __pyx_k_astype_intsafe, sizeof(__pyx_k_astype_intsafe), 0, 0, 1, 1}, + {&__pyx_n_s_axes, __pyx_k_axes, sizeof(__pyx_k_axes), 0, 0, 1, 1}, + {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_bc, __pyx_k_bc, sizeof(__pyx_k_bc), 0, 0, 1, 1}, + {&__pyx_n_s_binner, __pyx_k_binner, sizeof(__pyx_k_binner), 0, 0, 1, 1}, + {&__pyx_n_s_bins, __pyx_k_bins, sizeof(__pyx_k_bins), 0, 0, 1, 1}, + {&__pyx_n_s_blkno, __pyx_k_blkno, sizeof(__pyx_k_blkno), 0, 0, 1, 1}, + {&__pyx_n_s_blknos, __pyx_k_blknos, sizeof(__pyx_k_blknos), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_blocks, __pyx_k_blocks, sizeof(__pyx_k_blocks), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_bool_2, __pyx_k_bool_2, sizeof(__pyx_k_bool_2), 0, 0, 1, 1}, + {&__pyx_n_s_boolean, __pyx_k_boolean, sizeof(__pyx_k_boolean), 0, 0, 1, 1}, + {&__pyx_n_s_bools, __pyx_k_bools, sizeof(__pyx_k_bools), 0, 0, 1, 1}, + {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_c16, __pyx_k_c16, sizeof(__pyx_k_c16), 0, 0, 1, 1}, + {&__pyx_n_s_c_contiguous, __pyx_k_c_contiguous, sizeof(__pyx_k_c_contiguous), 0, 0, 1, 1}, + {&__pyx_n_s_cache, __pyx_k_cache, sizeof(__pyx_k_cache), 0, 0, 1, 1}, + {&__pyx_n_s_cache_2, __pyx_k_cache_2, sizeof(__pyx_k_cache_2), 0, 0, 1, 1}, + {&__pyx_kp_s_cannot_set_values_for_s, __pyx_k_cannot_set_values_for_s, sizeof(__pyx_k_cannot_set_values_for_s), 0, 0, 1, 0}, + {&__pyx_n_s_check_dummy, __pyx_k_check_dummy, sizeof(__pyx_k_check_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_clean_index_list, __pyx_k_clean_index_list, sizeof(__pyx_k_clean_index_list), 0, 0, 1, 1}, + {&__pyx_n_s_clear_mapping, __pyx_k_clear_mapping, sizeof(__pyx_k_clear_mapping), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, + {&__pyx_n_s_coerce_numeric, __pyx_k_coerce_numeric, sizeof(__pyx_k_coerce_numeric), 0, 0, 1, 1}, + {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1}, + {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1}, + {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1}, + {&__pyx_n_s_complex, __pyx_k_complex, sizeof(__pyx_k_complex), 0, 0, 1, 1}, + {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1}, + {&__pyx_n_s_complex256, __pyx_k_complex256, sizeof(__pyx_k_complex256), 0, 0, 1, 1}, + {&__pyx_n_s_complexes, __pyx_k_complexes, sizeof(__pyx_k_complexes), 0, 0, 1, 1}, + {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, + {&__pyx_n_s_contiguous, __pyx_k_contiguous, sizeof(__pyx_k_contiguous), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, + {&__pyx_n_s_convert_datetime, __pyx_k_convert_datetime, sizeof(__pyx_k_convert_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_convert_empty, __pyx_k_convert_empty, sizeof(__pyx_k_convert_empty), 0, 0, 1, 1}, + {&__pyx_n_s_convert_sql_column, __pyx_k_convert_sql_column, sizeof(__pyx_k_convert_sql_column), 0, 0, 1, 1}, + {&__pyx_n_s_convert_timedelta, __pyx_k_convert_timedelta, sizeof(__pyx_k_convert_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_convert_timestamps, __pyx_k_convert_timestamps, sizeof(__pyx_k_convert_timestamps), 0, 0, 1, 1}, + {&__pyx_n_s_converted, __pyx_k_converted, sizeof(__pyx_k_converted), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_count_level_1d, __pyx_k_count_level_1d, sizeof(__pyx_k_count_level_1d), 0, 0, 1, 1}, + {&__pyx_n_s_count_level_2d, __pyx_k_count_level_2d, sizeof(__pyx_k_count_level_2d), 0, 0, 1, 1}, + {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1}, + {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1}, + {&__pyx_n_s_cur_blkno, __pyx_k_cur_blkno, sizeof(__pyx_k_cur_blkno), 0, 0, 1, 1}, + {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_data_2, __pyx_k_data_2, sizeof(__pyx_k_data_2), 0, 0, 1, 1}, + {&__pyx_n_s_data_index, __pyx_k_data_index, sizeof(__pyx_k_data_index), 0, 0, 1, 1}, + {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, + {&__pyx_n_s_date_parser, __pyx_k_date_parser, sizeof(__pyx_k_date_parser), 0, 0, 1, 1}, + {&__pyx_n_s_dates, __pyx_k_dates, sizeof(__pyx_k_dates), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_datetime64, __pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 0, 1, 1}, + {&__pyx_kp_s_datetime64_ns, __pyx_k_datetime64_ns, sizeof(__pyx_k_datetime64_ns), 0, 0, 1, 0}, + {&__pyx_n_s_datetimes, __pyx_k_datetimes, sizeof(__pyx_k_datetimes), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_parser, __pyx_k_dateutil_parser, sizeof(__pyx_k_dateutil_parser), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_dayfirst, __pyx_k_dayfirst, sizeof(__pyx_k_dayfirst), 0, 0, 1, 1}, + {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1}, + {&__pyx_n_s_dicts, __pyx_k_dicts, sizeof(__pyx_k_dicts), 0, 0, 1, 1}, + {&__pyx_n_s_dicts_to_array, __pyx_k_dicts_to_array, sizeof(__pyx_k_dicts_to_array), 0, 0, 1, 1}, + {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, + {&__pyx_n_s_distutils_version, __pyx_k_distutils_version, sizeof(__pyx_k_distutils_version), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_doc_2, __pyx_k_doc_2, sizeof(__pyx_k_doc_2), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_dummy, __pyx_k_dummy, sizeof(__pyx_k_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_duplicated, __pyx_k_duplicated, sizeof(__pyx_k_duplicated), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_ends, __pyx_k_ends, sizeof(__pyx_k_ends), 0, 0, 1, 1}, + {&__pyx_n_s_engine, __pyx_k_engine, sizeof(__pyx_k_engine), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 1}, + {&__pyx_n_s_f_contiguous, __pyx_k_f_contiguous, sizeof(__pyx_k_f_contiguous), 0, 0, 1, 1}, + {&__pyx_n_s_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 1, 1}, + {&__pyx_n_s_false_vals, __pyx_k_false_vals, sizeof(__pyx_k_false_vals), 0, 0, 1, 1}, + {&__pyx_n_s_false_values, __pyx_k_false_values, sizeof(__pyx_k_false_values), 0, 0, 1, 1}, + {&__pyx_n_s_fast_multiget, __pyx_k_fast_multiget, sizeof(__pyx_k_fast_multiget), 0, 0, 1, 1}, + {&__pyx_n_s_fast_unique, __pyx_k_fast_unique, sizeof(__pyx_k_fast_unique), 0, 0, 1, 1}, + {&__pyx_n_s_fast_unique_multiple, __pyx_k_fast_unique_multiple, sizeof(__pyx_k_fast_unique_multiple), 0, 0, 1, 1}, + {&__pyx_n_s_fast_unique_multiple_list, __pyx_k_fast_unique_multiple_list, sizeof(__pyx_k_fast_unique_multiple_list), 0, 0, 1, 1}, + {&__pyx_n_s_fast_unique_multiple_list_gen, __pyx_k_fast_unique_multiple_list_gen, sizeof(__pyx_k_fast_unique_multiple_list_gen), 0, 0, 1, 1}, + {&__pyx_n_s_fast_zip, __pyx_k_fast_zip, sizeof(__pyx_k_fast_zip), 0, 0, 1, 1}, + {&__pyx_n_s_fast_zip_fillna, __pyx_k_fast_zip_fillna, sizeof(__pyx_k_fast_zip_fillna), 0, 0, 1, 1}, + {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, + {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1}, + {&__pyx_n_s_finished, __pyx_k_finished, sizeof(__pyx_k_finished), 0, 0, 1, 1}, + {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 1, 1}, + {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_float_secs, __pyx_k_float_secs, sizeof(__pyx_k_float_secs), 0, 0, 1, 1}, + {&__pyx_n_s_floating, __pyx_k_floating, sizeof(__pyx_k_floating), 0, 0, 1, 1}, + {&__pyx_n_s_floats, __pyx_k_floats, sizeof(__pyx_k_floats), 0, 0, 1, 1}, + {&__pyx_n_s_fnan, __pyx_k_fnan, sizeof(__pyx_k_fnan), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1}, + {&__pyx_n_s_fromtimestamp, __pyx_k_fromtimestamp, sizeof(__pyx_k_fromtimestamp), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_kp_s_function_does_not_reduce, __pyx_k_function_does_not_reduce, sizeof(__pyx_k_function_does_not_reduce), 0, 0, 1, 0}, + {&__pyx_n_s_fval, __pyx_k_fval, sizeof(__pyx_k_fval), 0, 0, 1, 1}, + {&__pyx_n_s_ge, __pyx_k_ge, sizeof(__pyx_k_ge), 0, 0, 1, 1}, + {&__pyx_n_s_gen, __pyx_k_gen, sizeof(__pyx_k_gen), 0, 0, 1, 1}, + {&__pyx_n_s_generate_bins_dt64, __pyx_k_generate_bins_dt64, sizeof(__pyx_k_generate_bins_dt64), 0, 0, 1, 1}, + {&__pyx_n_s_generate_slices, __pyx_k_generate_slices, sizeof(__pyx_k_generate_slices), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get_blkno_indexers, __pyx_k_get_blkno_indexers, sizeof(__pyx_k_get_blkno_indexers), 0, 0, 1, 1}, + {&__pyx_n_s_get_result, __pyx_k_get_result, sizeof(__pyx_k_get_result), 0, 0, 1, 1}, + {&__pyx_n_s_get_result_array, __pyx_k_get_result_array, sizeof(__pyx_k_get_result_array), 0, 0, 1, 1}, + {&__pyx_n_s_get_reverse_indexer, __pyx_k_get_reverse_indexer, sizeof(__pyx_k_get_reverse_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_get_values, __pyx_k_get_values, sizeof(__pyx_k_get_values), 0, 0, 1, 1}, + {&__pyx_n_s_gin, __pyx_k_gin, sizeof(__pyx_k_gin), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, + {&__pyx_n_s_group_count, __pyx_k_group_count, sizeof(__pyx_k_group_count), 0, 0, 1, 1}, + {&__pyx_n_s_group_dict, __pyx_k_group_dict, sizeof(__pyx_k_group_dict), 0, 0, 1, 1}, + {&__pyx_n_s_group_order, __pyx_k_group_order, sizeof(__pyx_k_group_order), 0, 0, 1, 1}, + {&__pyx_n_s_group_size, __pyx_k_group_size, sizeof(__pyx_k_group_size), 0, 0, 1, 1}, + {&__pyx_n_s_group_slices, __pyx_k_group_slices, sizeof(__pyx_k_group_slices), 0, 0, 1, 1}, + {&__pyx_n_s_gt, __pyx_k_gt, sizeof(__pyx_k_gt), 0, 0, 1, 1}, + {&__pyx_n_s_has_complex_internals, __pyx_k_has_complex_internals, sizeof(__pyx_k_has_complex_internals), 0, 0, 1, 1}, + {&__pyx_n_s_has_infs_f4, __pyx_k_has_infs_f4, sizeof(__pyx_k_has_infs_f4), 0, 0, 1, 1}, + {&__pyx_n_s_has_infs_f8, __pyx_k_has_infs_f8, sizeof(__pyx_k_has_infs_f8), 0, 0, 1, 1}, + {&__pyx_n_s_hasnans, __pyx_k_hasnans, sizeof(__pyx_k_hasnans), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_n_s_iNaT, __pyx_k_iNaT, sizeof(__pyx_k_iNaT), 0, 0, 1, 1}, + {&__pyx_kp_s_iadd_causes_length_change, __pyx_k_iadd_causes_length_change, sizeof(__pyx_k_iadd_causes_length_change), 0, 0, 1, 0}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_idatetimes, __pyx_k_idatetimes, sizeof(__pyx_k_idatetimes), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1}, + {&__pyx_n_s_ind_len, __pyx_k_ind_len, sizeof(__pyx_k_ind_len), 0, 0, 1, 1}, + {&__pyx_n_s_ind_start, __pyx_k_ind_start, sizeof(__pyx_k_ind_start), 0, 0, 1, 1}, + {&__pyx_n_s_ind_step, __pyx_k_ind_step, sizeof(__pyx_k_ind_step), 0, 0, 1, 1}, + {&__pyx_n_s_ind_stop, __pyx_k_ind_stop, sizeof(__pyx_k_ind_stop), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_index_2, __pyx_k_index_2, sizeof(__pyx_k_index_2), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_indexer, __pyx_k_indexer, sizeof(__pyx_k_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, + {&__pyx_n_s_indices_fast, __pyx_k_indices_fast, sizeof(__pyx_k_indices_fast), 0, 0, 1, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_infer_dtype, __pyx_k_infer_dtype, sizeof(__pyx_k_infer_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_infer_dtype_list, __pyx_k_infer_dtype_list, sizeof(__pyx_k_infer_dtype_list), 0, 0, 1, 1}, + {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, + {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, + {&__pyx_n_s_ints, __pyx_k_ints, sizeof(__pyx_k_ints), 0, 0, 1, 1}, + {&__pyx_n_s_is_bool, __pyx_k_is_bool, sizeof(__pyx_k_is_bool), 0, 0, 1, 1}, + {&__pyx_n_s_is_bool_array, __pyx_k_is_bool_array, sizeof(__pyx_k_is_bool_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_complex, __pyx_k_is_complex, sizeof(__pyx_k_is_complex), 0, 0, 1, 1}, + {&__pyx_n_s_is_date_array, __pyx_k_is_date_array, sizeof(__pyx_k_is_date_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_datelike, __pyx_k_is_datelike, sizeof(__pyx_k_is_datelike), 0, 0, 1, 1}, + {&__pyx_n_s_is_datetime64_array, __pyx_k_is_datetime64_array, sizeof(__pyx_k_is_datetime64_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_datetime_array, __pyx_k_is_datetime_array, sizeof(__pyx_k_is_datetime_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_float, __pyx_k_is_float, sizeof(__pyx_k_is_float), 0, 0, 1, 1}, + {&__pyx_n_s_is_float_array, __pyx_k_is_float_array, sizeof(__pyx_k_is_float_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_integer, __pyx_k_is_integer, sizeof(__pyx_k_is_integer), 0, 0, 1, 1}, + {&__pyx_n_s_is_integer_array, __pyx_k_is_integer_array, sizeof(__pyx_k_is_integer_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_integer_float_array, __pyx_k_is_integer_float_array, sizeof(__pyx_k_is_integer_float_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_lexsorted, __pyx_k_is_lexsorted, sizeof(__pyx_k_is_lexsorted), 0, 0, 1, 1}, + {&__pyx_n_s_is_numpy_prior_1_6_2, __pyx_k_is_numpy_prior_1_6_2, sizeof(__pyx_k_is_numpy_prior_1_6_2), 0, 0, 1, 1}, + {&__pyx_n_s_is_period, __pyx_k_is_period, sizeof(__pyx_k_is_period), 0, 0, 1, 1}, + {&__pyx_n_s_is_period_array, __pyx_k_is_period_array, sizeof(__pyx_k_is_period_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_possible_datetimelike_array, __pyx_k_is_possible_datetimelike_array, sizeof(__pyx_k_is_possible_datetimelike_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_slice_like, __pyx_k_is_slice_like, sizeof(__pyx_k_is_slice_like), 0, 0, 1, 1}, + {&__pyx_n_s_is_string_array, __pyx_k_is_string_array, sizeof(__pyx_k_is_string_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_time_array, __pyx_k_is_time_array, sizeof(__pyx_k_is_time_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_timedelta64_array, __pyx_k_is_timedelta64_array, sizeof(__pyx_k_is_timedelta64_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_timedelta_array, __pyx_k_is_timedelta_array, sizeof(__pyx_k_is_timedelta_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_timedelta_or_timedelta64_arra, __pyx_k_is_timedelta_or_timedelta64_arra, sizeof(__pyx_k_is_timedelta_or_timedelta64_arra), 0, 0, 1, 1}, + {&__pyx_n_s_is_unicode_array, __pyx_k_is_unicode_array, sizeof(__pyx_k_is_unicode_array), 0, 0, 1, 1}, + {&__pyx_n_s_isin, __pyx_k_isin, sizeof(__pyx_k_isin), 0, 0, 1, 1}, + {&__pyx_n_s_ismember, __pyx_k_ismember, sizeof(__pyx_k_ismember), 0, 0, 1, 1}, + {&__pyx_n_s_ismember_nans, __pyx_k_ismember_nans, sizeof(__pyx_k_ismember_nans), 0, 0, 1, 1}, + {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj, __pyx_k_isnullobj, sizeof(__pyx_k_isnullobj), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj2d, __pyx_k_isnullobj2d, sizeof(__pyx_k_isnullobj2d), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj2d_old, __pyx_k_isnullobj2d_old, sizeof(__pyx_k_isnullobj2d_old), 0, 0, 1, 1}, + {&__pyx_n_s_isnullobj_old, __pyx_k_isnullobj_old, sizeof(__pyx_k_isnullobj_old), 0, 0, 1, 1}, + {&__pyx_n_s_isscalar, __pyx_k_isscalar, sizeof(__pyx_k_isscalar), 0, 0, 1, 1}, + {&__pyx_n_s_it, __pyx_k_it, sizeof(__pyx_k_it), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_item_cache, __pyx_k_item_cache, sizeof(__pyx_k_item_cache), 0, 0, 1, 1}, + {&__pyx_n_s_item_cache_2, __pyx_k_item_cache_2, sizeof(__pyx_k_item_cache_2), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_itimedeltas, __pyx_k_itimedeltas, sizeof(__pyx_k_itimedeltas), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, + {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, + {&__pyx_n_s_l_bin, __pyx_k_l_bin, sizeof(__pyx_k_l_bin), 0, 0, 1, 1}, + {&__pyx_n_s_lab, __pyx_k_lab, sizeof(__pyx_k_lab), 0, 0, 1, 1}, + {&__pyx_n_s_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1}, + {&__pyx_n_s_le, __pyx_k_le, sizeof(__pyx_k_le), 0, 0, 1, 1}, + {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, + {&__pyx_n_s_lenbin, __pyx_k_lenbin, sizeof(__pyx_k_lenbin), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lenidx, __pyx_k_lenidx, sizeof(__pyx_k_lenidx), 0, 0, 1, 1}, + {&__pyx_n_s_list_of_arrays, __pyx_k_list_of_arrays, sizeof(__pyx_k_list_of_arrays), 0, 0, 1, 1}, + {&__pyx_n_s_list_to_object_array, __pyx_k_list_to_object_array, sizeof(__pyx_k_list_to_object_array), 0, 0, 1, 1}, + {&__pyx_n_s_lists, __pyx_k_lists, sizeof(__pyx_k_lists), 0, 0, 1, 1}, + {&__pyx_n_s_lookup_values, __pyx_k_lookup_values, sizeof(__pyx_k_lookup_values), 0, 0, 1, 1}, + {&__pyx_n_s_lt, __pyx_k_lt, sizeof(__pyx_k_lt), 0, 0, 1, 1}, + {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, + {&__pyx_kp_s_m8_ns, __pyx_k_m8_ns, sizeof(__pyx_k_m8_ns), 0, 0, 1, 0}, + {&__pyx_kp_s_m_d_Y, __pyx_k_m_d_Y, sizeof(__pyx_k_m_d_Y), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_map_infer, __pyx_k_map_infer, sizeof(__pyx_k_map_infer), 0, 0, 1, 1}, + {&__pyx_n_s_map_infer_mask, __pyx_k_map_infer_mask, sizeof(__pyx_k_map_infer_mask), 0, 0, 1, 1}, + {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_max_bin, __pyx_k_max_bin, sizeof(__pyx_k_max_bin), 0, 0, 1, 1}, + {&__pyx_n_s_max_len_string_array, __pyx_k_max_len_string_array, sizeof(__pyx_k_max_len_string_array), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_booleans_to_slice, __pyx_k_maybe_booleans_to_slice, sizeof(__pyx_k_maybe_booleans_to_slice), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_bool, __pyx_k_maybe_convert_bool, sizeof(__pyx_k_maybe_convert_bool), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_numeric, __pyx_k_maybe_convert_numeric, sizeof(__pyx_k_maybe_convert_numeric), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_objects, __pyx_k_maybe_convert_objects, sizeof(__pyx_k_maybe_convert_objects), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_indices_to_slice, __pyx_k_maybe_indices_to_slice, sizeof(__pyx_k_maybe_indices_to_slice), 0, 0, 1, 1}, + {&__pyx_n_s_memo, __pyx_k_memo, sizeof(__pyx_k_memo), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_micros, __pyx_k_micros, sizeof(__pyx_k_micros), 0, 0, 1, 1}, + {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1}, + {&__pyx_n_s_mixed, __pyx_k_mixed, sizeof(__pyx_k_mixed), 0, 0, 1, 1}, + {&__pyx_kp_s_mixed_integer, __pyx_k_mixed_integer, sizeof(__pyx_k_mixed_integer), 0, 0, 1, 0}, + {&__pyx_kp_s_mixed_integer_float, __pyx_k_mixed_integer_float, sizeof(__pyx_k_mixed_integer_float), 0, 0, 1, 0}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_months, __pyx_k_months, sizeof(__pyx_k_months), 0, 0, 1, 1}, + {&__pyx_n_s_move, __pyx_k_move, sizeof(__pyx_k_move), 0, 0, 1, 1}, + {&__pyx_n_s_mutated, __pyx_k_mutated, sizeof(__pyx_k_mutated), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_na_count, __pyx_k_na_count, sizeof(__pyx_k_na_count), 0, 0, 1, 1}, + {&__pyx_n_s_na_values, __pyx_k_na_values, sizeof(__pyx_k_na_values), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_n_s_nan_rep, __pyx_k_nan_rep, sizeof(__pyx_k_nan_rep), 0, 0, 1, 1}, + {&__pyx_n_s_nat_count, __pyx_k_nat_count, sizeof(__pyx_k_nat_count), 0, 0, 1, 1}, + {&__pyx_n_s_ncols, __pyx_k_ncols, sizeof(__pyx_k_ncols), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndarrays, __pyx_k_ndarrays, sizeof(__pyx_k_ndarrays), 0, 0, 1, 1}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, + {&__pyx_n_s_neginf, __pyx_k_neginf, sizeof(__pyx_k_neginf), 0, 0, 1, 1}, + {&__pyx_n_s_new_dtype, __pyx_k_new_dtype, sizeof(__pyx_k_new_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_ngroups, __pyx_k_ngroups, sizeof(__pyx_k_ngroups), 0, 0, 1, 1}, + {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1}, + {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1}, + {&__pyx_n_s_null_count, __pyx_k_null_count, sizeof(__pyx_k_null_count), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_objbuf, __pyx_k_objbuf, sizeof(__pyx_k_objbuf), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1}, + {&__pyx_n_s_objects, __pyx_k_objects, sizeof(__pyx_k_objects), 0, 0, 1, 1}, + {&__pyx_n_s_objlen, __pyx_k_objlen, sizeof(__pyx_k_objlen), 0, 0, 1, 1}, + {&__pyx_n_s_onan, __pyx_k_onan, sizeof(__pyx_k_onan), 0, 0, 1, 1}, + {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1}, + {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, + {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_core_index, __pyx_k_pandas_core_index, sizeof(__pyx_k_pandas_core_index), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_lib, __pyx_k_pandas_lib, sizeof(__pyx_k_pandas_lib), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_null, __pyx_k_pandas_null, sizeof(__pyx_k_pandas_null), 0, 0, 1, 1}, + {&__pyx_kp_s_pandas_src_inference_pyx, __pyx_k_pandas_src_inference_pyx, sizeof(__pyx_k_pandas_src_inference_pyx), 0, 0, 1, 0}, + {&__pyx_kp_s_pandas_src_reduce_pyx, __pyx_k_pandas_src_reduce_pyx, sizeof(__pyx_k_pandas_src_reduce_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_pandas_tseries_period, __pyx_k_pandas_tseries_period, sizeof(__pyx_k_pandas_tseries_period), 0, 0, 1, 1}, + {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1}, + {&__pyx_n_s_parse_date, __pyx_k_parse_date, sizeof(__pyx_k_parse_date), 0, 0, 1, 1}, + {&__pyx_n_s_parse_time, __pyx_k_parse_time, sizeof(__pyx_k_parse_time), 0, 0, 1, 1}, + {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1}, + {&__pyx_n_s_period, __pyx_k_period, sizeof(__pyx_k_period), 0, 0, 1, 1}, + {&__pyx_n_s_piece, __pyx_k_piece, sizeof(__pyx_k_piece), 0, 0, 1, 1}, + {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, + {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_putmask, __pyx_k_putmask, sizeof(__pyx_k_putmask), 0, 0, 1, 1}, + {&__pyx_n_s_pydate, __pyx_k_pydate, sizeof(__pyx_k_pydate), 0, 0, 1, 1}, + {&__pyx_n_s_pydatetime, __pyx_k_pydatetime, sizeof(__pyx_k_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_r_bin, __pyx_k_r_bin, sizeof(__pyx_k_r_bin), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reducer, __pyx_k_reducer, sizeof(__pyx_k_reducer), 0, 0, 1, 1}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_repr_timedelta64, __pyx_k_repr_timedelta64, sizeof(__pyx_k_repr_timedelta64), 0, 0, 1, 1}, + {&__pyx_n_s_require, __pyx_k_require, sizeof(__pyx_k_require), 0, 0, 1, 1}, + {&__pyx_n_s_requirements, __pyx_k_requirements, sizeof(__pyx_k_requirements), 0, 0, 1, 1}, + {&__pyx_n_s_res_view, __pyx_k_res_view, sizeof(__pyx_k_res_view), 0, 0, 1, 1}, + {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1}, + {&__pyx_n_s_rev_indexer, __pyx_k_rev_indexer, sizeof(__pyx_k_rev_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_right_closed, __pyx_k_right_closed, sizeof(__pyx_k_right_closed), 0, 0, 1, 1}, + {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, + {&__pyx_n_s_row_bool_subset, __pyx_k_row_bool_subset, sizeof(__pyx_k_row_bool_subset), 0, 0, 1, 1}, + {&__pyx_n_s_row_bool_subset_object, __pyx_k_row_bool_subset_object, sizeof(__pyx_k_row_bool_subset_object), 0, 0, 1, 1}, + {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_n_s_s_len, __pyx_k_s_len, sizeof(__pyx_k_s_len), 0, 0, 1, 1}, + {&__pyx_kp_s_s_r, __pyx_k_s_r, sizeof(__pyx_k_s_r), 0, 0, 1, 0}, + {&__pyx_n_s_s_start, __pyx_k_s_start, sizeof(__pyx_k_s_start), 0, 0, 1, 1}, + {&__pyx_n_s_s_step, __pyx_k_s_step, sizeof(__pyx_k_s_step), 0, 0, 1, 1}, + {&__pyx_n_s_s_stop, __pyx_k_s_stop, sizeof(__pyx_k_s_stop), 0, 0, 1, 1}, + {&__pyx_n_s_safe, __pyx_k_safe, sizeof(__pyx_k_safe), 0, 0, 1, 1}, + {&__pyx_n_s_sanitize_objects, __pyx_k_sanitize_objects, sizeof(__pyx_k_sanitize_objects), 0, 0, 1, 1}, + {&__pyx_n_s_scalar_binop, __pyx_k_scalar_binop, sizeof(__pyx_k_scalar_binop), 0, 0, 1, 1}, + {&__pyx_n_s_scalar_compare, __pyx_k_scalar_compare, sizeof(__pyx_k_scalar_compare), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_secs, __pyx_k_secs, sizeof(__pyx_k_secs), 0, 0, 1, 1}, + {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1}, + {&__pyx_n_s_seen_bool, __pyx_k_seen_bool, sizeof(__pyx_k_seen_bool), 0, 0, 1, 1}, + {&__pyx_n_s_seen_complex, __pyx_k_seen_complex, sizeof(__pyx_k_seen_complex), 0, 0, 1, 1}, + {&__pyx_n_s_seen_datetime, __pyx_k_seen_datetime, sizeof(__pyx_k_seen_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_seen_float, __pyx_k_seen_float, sizeof(__pyx_k_seen_float), 0, 0, 1, 1}, + {&__pyx_n_s_seen_int, __pyx_k_seen_int, sizeof(__pyx_k_seen_int), 0, 0, 1, 1}, + {&__pyx_n_s_seen_null, __pyx_k_seen_null, sizeof(__pyx_k_seen_null), 0, 0, 1, 1}, + {&__pyx_n_s_seen_numeric, __pyx_k_seen_numeric, sizeof(__pyx_k_seen_numeric), 0, 0, 1, 1}, + {&__pyx_n_s_seen_object, __pyx_k_seen_object, sizeof(__pyx_k_seen_object), 0, 0, 1, 1}, + {&__pyx_n_s_seen_timedelta, __pyx_k_seen_timedelta, sizeof(__pyx_k_seen_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_series, __pyx_k_series, sizeof(__pyx_k_series), 0, 0, 1, 1}, + {&__pyx_n_s_set_axis, __pyx_k_set_axis, sizeof(__pyx_k_set_axis), 0, 0, 1, 1}, + {&__pyx_n_s_set_length, __pyx_k_set_length, sizeof(__pyx_k_set_length), 0, 0, 1, 1}, + {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_shape_before, __pyx_k_shape_before, sizeof(__pyx_k_shape_before), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_slc, __pyx_k_slc, sizeof(__pyx_k_slc), 0, 0, 1, 1}, + {&__pyx_kp_s_slc_must_be_slice, __pyx_k_slc_must_be_slice, sizeof(__pyx_k_slc_must_be_slice), 0, 0, 1, 0}, + {&__pyx_kp_s_slc_should_be_a_slice, __pyx_k_slc_should_be_a_slice, sizeof(__pyx_k_slc_should_be_a_slice), 0, 0, 1, 0}, + {&__pyx_n_s_slice_getitem, __pyx_k_slice_getitem, sizeof(__pyx_k_slice_getitem), 0, 0, 1, 1}, + {&__pyx_kp_s_slice_step_cannot_be_zero, __pyx_k_slice_step_cannot_be_zero, sizeof(__pyx_k_slice_step_cannot_be_zero), 0, 0, 1, 0}, + {&__pyx_n_s_slices, __pyx_k_slices, sizeof(__pyx_k_slices), 0, 0, 1, 1}, + {&__pyx_n_s_slider, __pyx_k_slider, sizeof(__pyx_k_slider), 0, 0, 1, 1}, + {&__pyx_n_s_slobj, __pyx_k_slobj, sizeof(__pyx_k_slobj), 0, 0, 1, 1}, + {&__pyx_n_s_sorted_labels, __pyx_k_sorted_labels, sizeof(__pyx_k_sorted_labels), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_started, __pyx_k_started, sizeof(__pyx_k_started), 0, 0, 1, 1}, + {&__pyx_n_s_starts, __pyx_k_starts, sizeof(__pyx_k_starts), 0, 0, 1, 1}, + {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, + {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1}, + {&__pyx_n_s_string_2, __pyx_k_string_2, sizeof(__pyx_k_string_2), 0, 0, 1, 1}, + {&__pyx_n_s_string_array_replace_from_nan_re, __pyx_k_string_array_replace_from_nan_re, sizeof(__pyx_k_string_array_replace_from_nan_re), 0, 0, 1, 1}, + {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_stub, __pyx_k_stub, sizeof(__pyx_k_stub), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, + {&__pyx_n_s_take_last, __pyx_k_take_last, sizeof(__pyx_k_take_last), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_time64_to_datetime, __pyx_k_time64_to_datetime, sizeof(__pyx_k_time64_to_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_time_parser, __pyx_k_time_parser, sizeof(__pyx_k_time_parser), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta64, __pyx_k_timedelta64, sizeof(__pyx_k_timedelta64), 0, 0, 1, 1}, + {&__pyx_kp_s_timedelta64_ns, __pyx_k_timedelta64_ns, sizeof(__pyx_k_timedelta64_ns), 0, 0, 1, 0}, + {&__pyx_n_s_timedeltas, __pyx_k_timedeltas, sizeof(__pyx_k_timedeltas), 0, 0, 1, 1}, + {&__pyx_n_s_times, __pyx_k_times, sizeof(__pyx_k_times), 0, 0, 1, 1}, + {&__pyx_n_s_tmp, __pyx_k_tmp, sizeof(__pyx_k_tmp), 0, 0, 1, 1}, + {&__pyx_n_s_to_object_array, __pyx_k_to_object_array, sizeof(__pyx_k_to_object_array), 0, 0, 1, 1}, + {&__pyx_n_s_to_object_array_tuples, __pyx_k_to_object_array_tuples, sizeof(__pyx_k_to_object_array_tuples), 0, 0, 1, 1}, + {&__pyx_n_s_toordinal, __pyx_k_toordinal, sizeof(__pyx_k_toordinal), 0, 0, 1, 1}, + {&__pyx_n_s_tot_len, __pyx_k_tot_len, sizeof(__pyx_k_tot_len), 0, 0, 1, 1}, + {&__pyx_n_s_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 1, 1}, + {&__pyx_n_s_true_vals, __pyx_k_true_vals, sizeof(__pyx_k_true_vals), 0, 0, 1, 1}, + {&__pyx_n_s_true_values, __pyx_k_true_values, sizeof(__pyx_k_true_values), 0, 0, 1, 1}, + {&__pyx_n_s_try_float, __pyx_k_try_float, sizeof(__pyx_k_try_float), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_date_and_time, __pyx_k_try_parse_date_and_time, sizeof(__pyx_k_try_parse_date_and_time), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_date_and_time_locals_l, __pyx_k_try_parse_date_and_time_locals_l, sizeof(__pyx_k_try_parse_date_and_time_locals_l), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_date_and_time_locals_p, __pyx_k_try_parse_date_and_time_locals_p, sizeof(__pyx_k_try_parse_date_and_time_locals_p), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_date_and_time_locals_p_2, __pyx_k_try_parse_date_and_time_locals_p_2, sizeof(__pyx_k_try_parse_date_and_time_locals_p_2), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_dates, __pyx_k_try_parse_dates, sizeof(__pyx_k_try_parse_dates), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_dates_locals_lambda, __pyx_k_try_parse_dates_locals_lambda, sizeof(__pyx_k_try_parse_dates_locals_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_dates_locals_parse_dat, __pyx_k_try_parse_dates_locals_parse_dat, sizeof(__pyx_k_try_parse_dates_locals_parse_dat), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_datetime_components, __pyx_k_try_parse_datetime_components, sizeof(__pyx_k_try_parse_datetime_components), 0, 0, 1, 1}, + {&__pyx_n_s_try_parse_year_month_day, __pyx_k_try_parse_year_month_day, sizeof(__pyx_k_try_parse_year_month_day), 0, 0, 1, 1}, + {&__pyx_n_s_tslib, __pyx_k_tslib, sizeof(__pyx_k_tslib), 0, 0, 1, 1}, + {&__pyx_n_s_tup, __pyx_k_tup, sizeof(__pyx_k_tup), 0, 0, 1, 1}, + {&__pyx_n_s_tuples, __pyx_k_tuples, sizeof(__pyx_k_tuples), 0, 0, 1, 1}, + {&__pyx_n_s_tuples_to_object_array, __pyx_k_tuples_to_object_array, sizeof(__pyx_k_tuples_to_object_array), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, + {&__pyx_n_s_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 0, 1, 1}, + {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1}, + {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1}, + {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_kp_s_unbounded_slice, __pyx_k_unbounded_slice, sizeof(__pyx_k_unbounded_slice), 0, 0, 1, 0}, + {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_unicode_2, __pyx_k_unicode_2, sizeof(__pyx_k_unicode_2), 0, 0, 1, 1}, + {&__pyx_n_s_uniques, __pyx_k_uniques, sizeof(__pyx_k_uniques), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_utcfromtimestamp, __pyx_k_utcfromtimestamp, sizeof(__pyx_k_utcfromtimestamp), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_val_kind, __pyx_k_val_kind, sizeof(__pyx_k_val_kind), 0, 0, 1, 1}, + {&__pyx_n_s_val_name, __pyx_k_val_name, sizeof(__pyx_k_val_name), 0, 0, 1, 1}, + {&__pyx_kp_s_vals_must_be_ndarray, __pyx_k_vals_must_be_ndarray, sizeof(__pyx_k_vals_must_be_ndarray), 0, 0, 1, 0}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_values_2, __pyx_k_values_2, sizeof(__pyx_k_values_2), 0, 0, 1, 1}, + {&__pyx_n_s_values_from_object, __pyx_k_values_from_object, sizeof(__pyx_k_values_from_object), 0, 0, 1, 1}, + {&__pyx_n_s_vc, __pyx_k_vc, sizeof(__pyx_k_vc), 0, 0, 1, 1}, + {&__pyx_n_s_vec_binop, __pyx_k_vec_binop, sizeof(__pyx_k_vec_binop), 0, 0, 1, 1}, + {&__pyx_n_s_vec_compare, __pyx_k_vec_compare, sizeof(__pyx_k_vec_compare), 0, 0, 1, 1}, + {&__pyx_n_s_vecs, __pyx_k_vecs, sizeof(__pyx_k_vecs), 0, 0, 1, 1}, + {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_write_csv_rows, __pyx_k_write_csv_rows, sizeof(__pyx_k_write_csv_rows), 0, 0, 1, 1}, + {&__pyx_n_s_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 0, 1, 1}, + {&__pyx_n_s_writerows, __pyx_k_writerows, sizeof(__pyx_k_writerows), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {&__pyx_n_s_years, __pyx_k_years, sizeof(__pyx_k_years), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION >= 3 + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/lib.pyx":201 + * + * cdef inline int64_t get_timedelta64_value(val): + * return val.view('i8') # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/lib.pyx":487 + * it = PyArray_IterNew(arr) + * if len(arr) != n: + * raise ValueError('all arrays must be same length') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_all_arrays_must_be_same_length); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/lib.pyx":515 + * + * rev_indexer = np.empty(length, dtype=np.int64) + * rev_indexer.fill(-1) # <<<<<<<<<<<<<< + * for i in range(n): + * idx = indexer[i] + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/lib.pyx":610 + * + * if not started: + * return slice(0, 0) # <<<<<<<<<<<<<< + * if not finished: + * return slice(start, None) + */ + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/lib.pyx":640 + * flag = cpython.Py_NE + * else: + * raise ValueError('Unrecognized operator') # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool).view(np.uint8) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Unrecognized_operator); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/lib.pyx":687 + * flag = cpython.Py_NE + * else: + * raise ValueError('Unrecognized operator') # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=bool).view(np.uint8) + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Unrecognized_operator); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/lib.pyx":981 + * + * if lenidx <= 0 or lenbin <= 0: + * raise ValueError("Invalid length for values or for binner") # <<<<<<<<<<<<<< + * + * # check binner fits data + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Invalid_length_for_values_or_for); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/lib.pyx":985 + * # check binner fits data + * if values[0] < binner[0]: + * raise ValueError("Values falls before first bin") # <<<<<<<<<<<<<< + * + * if values[lenidx-1] > binner[lenbin-1]: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Values_falls_before_first_bin); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/lib.pyx":988 + * + * if values[lenidx-1] > binner[lenbin-1]: + * raise ValueError("Values falls after last bin") # <<<<<<<<<<<<<< + * + * bins = np.empty(lenbin - 1, dtype=np.int64) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Values_falls_after_last_bin); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/lib.pyx":1168 + * it = PyArray_IterNew(arr) + * if len(arr) != n: + * raise ValueError('all arrays must be same length') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_all_arrays_must_be_same_length); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "pandas/lib.pyx":1366 + * + * if vals is None: + * raise TypeError("vals must be ndarray") # <<<<<<<<<<<<<< + * + * n = vals.shape[0] + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_vals_must_be_ndarray); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/lib.pyx":1409 + * step = s.step + * if step == 0: + * raise ValueError("slice step cannot be zero") # <<<<<<<<<<<<<< + * + * if step > 0: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_slice_step_cannot_be_zero); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/lib.pyx":1413 + * if step > 0: + * if s.stop is None: + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * stop = s.stop + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unbounded_slice); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "pandas/lib.pyx":1424 + * elif step < 0: + * if s.start is None: + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * start = s.start + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unbounded_slice); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/lib.pyx":1435 + * + * if start < 0 or (stop < 0 and s.stop is not None): + * raise ValueError("unbounded slice") # <<<<<<<<<<<<<< + * + * if stop < 0: + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unbounded_slice); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "pandas/lib.pyx":1455 + * + * if slc is None: + * raise TypeError("slc should be a slice") # <<<<<<<<<<<<<< + * + * PySlice_GetIndicesEx(slc, objlen, + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_slc_should_be_a_slice); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "pandas/lib.pyx":1478 + * + * if slc is None: + * raise TypeError("slc must be slice") # <<<<<<<<<<<<<< + * + * PySlice_GetIndicesEx(slc, objlen, + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_slc_must_be_slice); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "pandas/lib.pyx":1539 + * self._has_slice = True + * else: + * arr = np.empty(0, dtype=np.int64) # <<<<<<<<<<<<<< + * self._as_array = arr + * self._has_array = True + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "pandas/lib.pyx":1578 + * cdef slice s = self._ensure_has_slice() + * if s is None: + * raise TypeError('Not slice-like') # <<<<<<<<<<<<<< + * else: + * return s + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Not_slice_like); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "pandas/lib.pyx":1647 + * if ((step > 0 and start < 0) or + * (step < 0 and stop < step)): + * raise ValueError("iadd causes length change") # <<<<<<<<<<<<<< + * + * if stop < 0: + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_iadd_causes_length_change); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "pandas/lib.pyx":1659 + * newarr = self.as_array + other + * if (newarr < 0).any(): + * raise ValueError("iadd causes length change") # <<<<<<<<<<<<<< + * + * self._as_array = newarr + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_iadd_causes_length_change); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "pandas/src/reduce.pyx":24 + * if axis == 0: + * if not arr.flags.f_contiguous: + * arr = arr.copy('F') # <<<<<<<<<<<<<< + * + * self.nresults = k + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_F); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "pandas/src/reduce.pyx":31 + * else: + * if not arr.flags.c_contiguous: + * arr = arr.copy('C') # <<<<<<<<<<<<<< + * + * self.nresults = n + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "pandas/src/reduce.pyx":66 + * + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if len(dummy) != self.chunksize: + * raise ValueError('Dummy array must be length %d' % + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Dummy_array_must_be_same_dtype); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "pandas/src/reduce.pyx":153 + * result[0] = res + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_function_does_not_reduce); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/src/reduce.pyx":176 + * values = series.values + * if not values.flags.c_contiguous: + * values = values.copy('C') # <<<<<<<<<<<<<< + * self.arr = values + * self.index = series.index + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "pandas/src/reduce.pyx":193 + * def _check_dummy(self, dummy=None): + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * else: + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "pandas/src/reduce.pyx":198 + * values = dummy.values + * if values.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Dummy_array_must_be_same_dtype); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "pandas/src/reduce.pyx":281 + * result = np.empty(self.ngroups, dtype='O') + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_function_does_not_reduce); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "pandas/src/reduce.pyx":306 + * values = series.values + * if not values.flags.c_contiguous: + * values = values.copy('C') # <<<<<<<<<<<<<< + * self.arr = values + * self.index = series.index + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "pandas/src/reduce.pyx":318 + * def _check_dummy(self, dummy=None): + * if dummy is None: + * values = np.empty(0, dtype=self.arr.dtype) # <<<<<<<<<<<<<< + * index = None + * else: + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "pandas/src/reduce.pyx":323 + * values = dummy.values + * if dummy.dtype != self.arr.dtype: + * raise ValueError('Dummy array must be same dtype') # <<<<<<<<<<<<<< + * if not values.flags.contiguous: + * values = values.copy() + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Dummy_array_must_be_same_dtype); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "pandas/src/reduce.pyx":410 + * result = np.empty(self.ngroups, dtype='O') + * except Exception: + * raise ValueError('function does not reduce') # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_function_does_not_reduce); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "pandas/src/reduce.pyx":484 + * + * if frame.index._has_complex_internals: + * raise InvalidApply('Cannot modify frame index internals') # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Cannot_modify_frame_index_intern); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "pandas/src/reduce.pyx":496 + * result = f(chunk) + * if result is chunk: + * raise InvalidApply('Function unsafe for fast apply') # <<<<<<<<<<<<<< + * except: + * raise InvalidApply('Let this error raise above us') + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Function_unsafe_for_fast_apply); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "pandas/src/reduce.pyx":498 + * raise InvalidApply('Function unsafe for fast apply') + * except: + * raise InvalidApply('Let this error raise above us') # <<<<<<<<<<<<<< + * + * slider = BlockSlider(frame) + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Let_this_error_raise_above_us); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "pandas/src/reduce.pyx":545 + * def __init__(self, frame): + * self.frame = frame + * self.dummy = frame[:0] # <<<<<<<<<<<<<< + * + * self.blocks = [b.values for b in self.dummy._data.blocks] + */ + __pyx_slice__40 = PySlice_New(Py_None, __pyx_int_0, Py_None); if (unlikely(!__pyx_slice__40)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__40); + __Pyx_GIVEREF(__pyx_slice__40); + + /* "pandas/src/reduce.pyx":593 + * def reduce(arr, f, axis=0, dummy=None, labels=None): + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') # <<<<<<<<<<<<<< + * + * reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels) + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Cannot_use_shortcut); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "pandas/src/inference.pyx":89 + * + * if values.dtype != np.object_: + * values = values.astype('O') # <<<<<<<<<<<<<< + * + * n = len(values) + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "pandas/src/inference.pyx":201 + * return True + * elif util.is_timedelta64_object(v): + * return v.view('int64') == iNaT # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "pandas/src/inference.pyx":203 + * return v.view('int64') == iNaT + * elif util.is_datetime64_object(v): + * return v.view('int64') == iNaT # <<<<<<<<<<<<<< + * elif util.is_integer_object(v): + * return v == iNaT + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "pandas/src/inference.pyx":518 + * seen_float = True + * else: + * raise ValueError('Empty string encountered') # <<<<<<<<<<<<<< + * elif util.is_complex_object(val): + * complexes[i] = val + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Empty_string_encountered); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "pandas/src/inference.pyx":743 + * parse_date = lambda x: parse(x, dayfirst=dayfirst,default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return datetime.strptime(s, '%m/%d/%Y') + */ + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_parse_date, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":784 + * n = len(dates) + * if len(times) != n: + * raise ValueError('Length of dates and times must be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Length_of_dates_and_times_must_b); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + + /* "pandas/src/inference.pyx":796 + * parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default) + * except ImportError: # pragma: no cover + * def parse_date(s): # <<<<<<<<<<<<<< + * try: + * return date.strptime(s, '%m/%d/%Y') + */ + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_parse_date, 796, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":809 + * parse_time = lambda x: parse(x) + * except ImportError: # pragma: no cover + * def parse_time(s): # <<<<<<<<<<<<<< + * try: + * return time.strptime(s, '%H:%M:%S') + */ + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_parse_time, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":837 + * n = len(years) + * if len(months) != n or len(days) != n: + * raise ValueError('Length of years/months/days must all be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Length_of_years_months_days_must); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "pandas/src/inference.pyx":864 + * if (len(months) != n or len(days) != n or len(hours) != n or + * len(minutes) != n or len(seconds) != n): + * raise ValueError('Length of all datetime components must be equal') # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='O') + * + */ + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Length_of_all_datetime_component); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "pandas/src/inference.pyx":1113 + * if n == 0: + * # kludge, for Series + * return np.empty(0, dtype='f8') # <<<<<<<<<<<<<< + * + * keys = getattr(keys, 'values', keys) + */ + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "View.MemoryView":127 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "View.MemoryView":130 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if isinstance(format, unicode): + */ + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "View.MemoryView":142 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "View.MemoryView":170 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "View.MemoryView":186 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "View.MemoryView":445 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "View.MemoryView":521 + * if self.view.strides == NULL: + * + * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< + * + * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "View.MemoryView":638 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_tuple__74 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + + /* "View.MemoryView":641 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_tuple__75 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + + /* "View.MemoryView":652 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_tuple__76 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + + /* "View.MemoryView":660 + * for i in range(ndim): + * if suboffsets[i] >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + + /* "pandas/lib.pyx":75 + * import_ufunc() + * + * def values_from_object(object o): # <<<<<<<<<<<<<< + * """ return my values or the object if we are say an ndarray """ + * cdef f + */ + __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_o, __pyx_n_s_f); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_values_from_object, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":109 + * + * + * def ismember_nans(float64_t[:] arr, set values, bint hasnans): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_tuple__80 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_values, __pyx_n_s_hasnans, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ismember_nans, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":124 + * + * + * def ismember(ndarray arr, set values): # <<<<<<<<<<<<<< + * ''' + * Checks whether + */ + __pyx_tuple__82 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ismember, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":176 + * return gmtime(dt) + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[int64_t, ndim=1] result + */ + __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_array_to_timestamp, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":188 + * return result + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[object, ndim=1] result + */ + __pyx_tuple__86 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_time64_to_datetime, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":237 + * return util._checknull(val) + * + * def isscalar(object val): # <<<<<<<<<<<<<< + * return np.isscalar(val) or val is None or PyDateTime_Check(val) + * + */ + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_val); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isscalar, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":243 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_tuple__90 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_result, __pyx_n_s_arobj); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":257 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_tuple__92 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_result); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj_old, 257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":271 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + __pyx_tuple__94 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_val, __pyx_n_s_result); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj2d, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":287 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_tuple__96 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_result); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj_old, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d_old(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + __pyx_tuple__98 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_val, __pyx_n_s_result); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isnullobj2d_old, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":315 + * return result.view(np.bool_) + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + __pyx_tuple__100 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_list_to_object_array, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":335 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__102 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_uniques, __pyx_n_s_table, __pyx_n_s_val, __pyx_n_s_stub); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_unique, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":356 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple(list arrays): # <<<<<<<<<<<<<< + * cdef: + * ndarray[object] buf + */ + __pyx_tuple__104 = PyTuple_Pack(10, __pyx_n_s_arrays, __pyx_n_s_buf, __pyx_n_s_k, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_uniques, __pyx_n_s_table, __pyx_n_s_val, __pyx_n_s_stub); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_unique_multiple, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":382 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list(list lists): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + __pyx_tuple__106 = PyTuple_Pack(10, __pyx_n_s_lists, __pyx_n_s_buf, __pyx_n_s_k, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_uniques, __pyx_n_s_table, __pyx_n_s_val, __pyx_n_s_stub); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_unique_multiple_list, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":408 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list_gen(object gen): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + __pyx_tuple__108 = PyTuple_Pack(8, __pyx_n_s_gen, __pyx_n_s_buf, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_uniques, __pyx_n_s_table, __pyx_n_s_val, __pyx_n_s_stub); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_unique_multiple_list_gen, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":433 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def dicts_to_array(list dicts, list columns): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n + */ + __pyx_tuple__110 = PyTuple_Pack(10, __pyx_n_s_dicts, __pyx_n_s_columns, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_row, __pyx_n_s_col, __pyx_n_s_onan); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dicts_to_array, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":456 + * return result + * + * def fast_zip(list ndarrays): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + __pyx_tuple__112 = PyTuple_Pack(10, __pyx_n_s_ndarrays, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_it, __pyx_n_s_val, __pyx_n_s_tup, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_zip, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":497 + * return result + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): # <<<<<<<<<<<<<< + * """ + * Reverse indexing operation. + */ + __pyx_tuple__114 = PyTuple_Pack(6, __pyx_n_s_indexer, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_rev_indexer, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_reverse_indexer, 497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":524 + * + * + * def has_infs_f4(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__116 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_inf, __pyx_n_s_neginf, __pyx_n_s_val); if (unlikely(!__pyx_tuple__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_has_infs_f4, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":538 + * return False + * + * def has_infs_f8(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__118 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_inf, __pyx_n_s_neginf, __pyx_n_s_val); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_has_infs_f8, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":552 + * return False + * + * def convert_timestamps(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * object val, f, result + */ + __pyx_tuple__120 = PyTuple_Pack(9, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_f, __pyx_n_s_result, __pyx_n_s_cache_2, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_out, __pyx_n_s_datetime); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_convert_timestamps, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":575 + * return out + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indices) + */ + __pyx_tuple__122 = PyTuple_Pack(3, __pyx_n_s_indices, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_maybe_indices_to_slice, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":588 + * + * + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(mask) + */ + __pyx_tuple__124 = PyTuple_Pack(7, __pyx_n_s_mask, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_started, __pyx_n_s_finished); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_maybe_booleans_to_slice, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":619 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + __pyx_tuple__126 = PyTuple_Pack(9, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_op, __pyx_n_s_operator, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_flag, __pyx_n_s_x); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_scalar_compare, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":663 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + __pyx_tuple__128 = PyTuple_Pack(10, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_op, __pyx_n_s_operator, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_flag, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__128); + __Pyx_GIVEREF(__pyx_tuple__128); + __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_vec_compare, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":715 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_binop(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__130 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_val, __pyx_n_s_op, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_scalar_binop, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":737 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + __pyx_tuple__132 = PyTuple_Pack(8, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_op, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_vec_binop, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":764 + * + * + * def astype_intsafe(ndarray[object] arr, new_dtype): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__134 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_new_dtype, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_v, __pyx_n_s_is_datelike, __pyx_n_s_result); if (unlikely(!__pyx_tuple__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__134); + __Pyx_GIVEREF(__pyx_tuple__134); + __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_astype_intsafe, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":794 + * return result + * + * def clean_index_list(list obj): # <<<<<<<<<<<<<< + * ''' + * Utility used in pandas.core.index._ensure_index + */ + __pyx_tuple__136 = PyTuple_Pack(6, __pyx_n_s_obj, __pyx_n_s_converted, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_v, __pyx_n_s_all_arrays); if (unlikely(!__pyx_tuple__136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__136); + __Pyx_GIVEREF(__pyx_tuple__136); + __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_clean_index_list, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":825 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def max_len_string_array(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * """ return the maximum size of elements in a 1-dim string array """ + * cdef: + */ + __pyx_tuple__138 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_m, __pyx_n_s_l, __pyx_n_s_length, __pyx_n_s_v); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__138); + __Pyx_GIVEREF(__pyx_tuple__138); + __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_max_len_string_array, 825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":845 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def string_array_replace_from_nan_rep(ndarray[object, ndim=1] arr, object nan_rep, object replace = None): # <<<<<<<<<<<<<< + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + */ + __pyx_tuple__140 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_nan_rep, __pyx_n_s_replace, __pyx_n_s_length, __pyx_n_s_i); if (unlikely(!__pyx_tuple__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__140); + __Pyx_GIVEREF(__pyx_tuple__140); + __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_string_array_replace_from_nan_re, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":860 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def write_csv_rows(list data, list data_index, int nlevels, list cols, object writer): # <<<<<<<<<<<<<< + * + * cdef int N, j, i, ncols + */ + __pyx_tuple__142 = PyTuple_Pack(13, __pyx_n_s_data, __pyx_n_s_data_index, __pyx_n_s_nlevels, __pyx_n_s_cols, __pyx_n_s_writer, __pyx_n_s_N, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_ncols, __pyx_n_s_rows, __pyx_n_s_val, __pyx_n_s_row, __pyx_n_s_x); if (unlikely(!__pyx_tuple__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__142); + __Pyx_GIVEREF(__pyx_tuple__142); + __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_write_csv_rows, 860, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":908 + * + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef int length = index.shape[0] + * cdef int i = 0 + */ + __pyx_tuple__144 = PyTuple_Pack(5, __pyx_n_s_index, __pyx_n_s_func, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_result); if (unlikely(!__pyx_tuple__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__144); + __Pyx_GIVEREF(__pyx_tuple__144); + __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_arrmap, 908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":921 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + __pyx_tuple__146 = PyTuple_Pack(9, __pyx_n_s_list_of_arrays, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_nlevels, __pyx_n_s_k, __pyx_n_s_cur, __pyx_n_s_pre, __pyx_n_s_arr, __pyx_n_s_vecs); if (unlikely(!__pyx_tuple__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__146); + __Pyx_GIVEREF(__pyx_tuple__146); + __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_lexsorted, 921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":960 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner, # <<<<<<<<<<<<<< + * object closed='left', bint hasnans=0): + * """ + */ + __pyx_tuple__148 = PyTuple_Pack(16, __pyx_n_s_values, __pyx_n_s_binner, __pyx_n_s_closed, __pyx_n_s_hasnans, __pyx_n_s_lenidx, __pyx_n_s_lenbin, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_bc, __pyx_n_s_vc, __pyx_n_s_bins, __pyx_n_s_l_bin, __pyx_n_s_r_bin, __pyx_n_s_nat_count, __pyx_n_s_right_closed, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__148); + __Pyx_GIVEREF(__pyx_tuple__148); + __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_generate_bins_dt64, 960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1025 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + __pyx_tuple__150 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_pos, __pyx_n_s_out); if (unlikely(!__pyx_tuple__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__150); + __Pyx_GIVEREF(__pyx_tuple__150); + __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_row_bool_subset, 1025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1046 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + __pyx_tuple__152 = PyTuple_Pack(8, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_pos, __pyx_n_s_out); if (unlikely(!__pyx_tuple__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__152); + __Pyx_GIVEREF(__pyx_tuple__152); + __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_row_bool_subset_object, 1046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1066 + * + * + * def group_count(ndarray[int64_t] values, Py_ssize_t size): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__154 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_counts); if (unlikely(!__pyx_tuple__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__154); + __Pyx_GIVEREF(__pyx_tuple__154); + __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_group_count, 1066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1076 + * return counts + * + * def lookup_values(ndarray[object] values, dict mapping): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__156 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_mapping, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result); if (unlikely(!__pyx_tuple__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__156); + __Pyx_GIVEREF(__pyx_tuple__156); + __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_lookup_values, 1076, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1086 + * + * + * def count_level_1d(ndarray[uint8_t, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + __pyx_tuple__158 = PyTuple_Pack(6, __pyx_n_s_mask, __pyx_n_s_labels, __pyx_n_s_max_bin, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_counts); if (unlikely(!__pyx_tuple__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__158); + __Pyx_GIVEREF(__pyx_tuple__158); + __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_count_level_1d, 1086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1103 + * + * + * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + __pyx_tuple__160 = PyTuple_Pack(8, __pyx_n_s_mask, __pyx_n_s_labels, __pyx_n_s_max_bin, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_counts); if (unlikely(!__pyx_tuple__160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__160); + __Pyx_GIVEREF(__pyx_tuple__160); + __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_count_level_2d, 1103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1134 + * pandas_null = _PandasNull() + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + __pyx_tuple__162 = PyTuple_Pack(11, __pyx_n_s_ndarrays, __pyx_n_s_fill_value, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_it, __pyx_n_s_val, __pyx_n_s_tup, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__162); + __Pyx_GIVEREF(__pyx_tuple__162); + __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fast_zip_fillna, 1134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1181 + * return result + * + * def duplicated(ndarray[object] values, take_last=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_tuple__164 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_take_last, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_seen, __pyx_n_s_row, __pyx_n_s_result); if (unlikely(!__pyx_tuple__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__164); + __Pyx_GIVEREF(__pyx_tuple__164); + __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_duplicated, 1181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1210 + * return result.view(np.bool_) + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, group_size, n, lab, start + */ + __pyx_tuple__166 = PyTuple_Pack(10, __pyx_n_s_labels, __pyx_n_s_ngroups, __pyx_n_s_i, __pyx_n_s_group_size, __pyx_n_s_n, __pyx_n_s_lab, __pyx_n_s_start, __pyx_n_s_slobj, __pyx_n_s_starts, __pyx_n_s_ends); if (unlikely(!__pyx_tuple__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__166); + __Pyx_GIVEREF(__pyx_tuple__166); + __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_generate_slices, 1210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1235 + * + * + * def indices_fast(object index, ndarray[int64_t] labels, list keys, # <<<<<<<<<<<<<< + * list sorted_labels): + * cdef: + */ + __pyx_tuple__168 = PyTuple_Pack(14, __pyx_n_s_index, __pyx_n_s_labels, __pyx_n_s_keys, __pyx_n_s_sorted_labels, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_lab, __pyx_n_s_cur, __pyx_n_s_start, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_tup, __pyx_n_s_val); if (unlikely(!__pyx_tuple__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__168); + __Pyx_GIVEREF(__pyx_tuple__168); + __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_indices_fast, 1235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + __pyx_tuple__170 = PyTuple_Pack(18, __pyx_n_s_blknos, __pyx_n_s_group, __pyx_n_s_cur_blkno, __pyx_n_s_i, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_n, __pyx_n_s_diff, __pyx_n_s_group_order, __pyx_n_s_group_slices, __pyx_n_s_res_view, __pyx_n_s_group_dict, __pyx_n_s_blkno, __pyx_n_s_slices, __pyx_n_s_tot_len, __pyx_n_s_result, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__170); + __Pyx_GIVEREF(__pyx_tuple__170); + __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_blkno_indexers, 1278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/lib.pyx":1486 + * + * + * def slice_getitem(slice slc not None, ind): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s_start, s_stop, s_step, s_len + */ + __pyx_tuple__172 = PyTuple_Pack(10, __pyx_n_s_slc, __pyx_n_s_ind, __pyx_n_s_s_start, __pyx_n_s_s_stop, __pyx_n_s_s_step, __pyx_n_s_s_len, __pyx_n_s_ind_start, __pyx_n_s_ind_stop, __pyx_n_s_ind_step, __pyx_n_s_ind_len); if (unlikely(!__pyx_tuple__172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__172); + __Pyx_GIVEREF(__pyx_tuple__172); + __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_slice_getitem, 1486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/reduce.pyx":474 + * pass + * + * def apply_frame_axis0(object frame, object f, object names, # <<<<<<<<<<<<<< + * ndarray[int64_t] starts, ndarray[int64_t] ends): + * cdef: + */ + __pyx_tuple__174 = PyTuple_Pack(16, __pyx_n_s_frame, __pyx_n_s_f, __pyx_n_s_names, __pyx_n_s_starts, __pyx_n_s_ends, __pyx_n_s_slider, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_results, __pyx_n_s_piece, __pyx_n_s_item_cache_2, __pyx_n_s_chunk, __pyx_n_s_shape_before, __pyx_n_s_result, __pyx_n_s_mutated, __pyx_n_s_gin); if (unlikely(!__pyx_tuple__174)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__174); + __Pyx_GIVEREF(__pyx_tuple__174); + __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_reduce_pyx, __pyx_n_s_apply_frame_axis0, 474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/reduce.pyx":591 + * + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): # <<<<<<<<<<<<<< + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') + */ + __pyx_tuple__176 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_f, __pyx_n_s_axis, __pyx_n_s_dummy, __pyx_n_s_labels, __pyx_n_s_reducer); if (unlikely(!__pyx_tuple__176)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__176); + __Pyx_GIVEREF(__pyx_tuple__176); + __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_reduce_pyx, __pyx_n_s_reduce, 591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":7 + * + * # core.common import for fast inference checks + * def is_float(object obj): # <<<<<<<<<<<<<< + * return util.is_float_object(obj) + * + */ + __pyx_tuple__178 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__178)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__178); + __Pyx_GIVEREF(__pyx_tuple__178); + __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_float, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":10 + * return util.is_float_object(obj) + * + * def is_integer(object obj): # <<<<<<<<<<<<<< + * return util.is_integer_object(obj) + * + */ + __pyx_tuple__180 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__180)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__180); + __Pyx_GIVEREF(__pyx_tuple__180); + __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_integer, 10, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":13 + * return util.is_integer_object(obj) + * + * def is_bool(object obj): # <<<<<<<<<<<<<< + * return util.is_bool_object(obj) + * + */ + __pyx_tuple__182 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__182)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__182); + __Pyx_GIVEREF(__pyx_tuple__182); + __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_bool, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":16 + * return util.is_bool_object(obj) + * + * def is_complex(object obj): # <<<<<<<<<<<<<< + * return util.is_complex_object(obj) + * + */ + __pyx_tuple__184 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__184)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__184); + __Pyx_GIVEREF(__pyx_tuple__184); + __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_complex, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":64 + * pass + * + * def infer_dtype(object _values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_tuple__186 = PyTuple_Pack(7, __pyx_n_s_values_2, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_values, __pyx_n_s_val_name, __pyx_n_s_val_kind); if (unlikely(!__pyx_tuple__186)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__186); + __Pyx_GIVEREF(__pyx_tuple__186); + __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_infer_dtype, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":169 + * return 'mixed' + * + * def infer_dtype_list(list values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__188 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__188)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__188); + __Pyx_GIVEREF(__pyx_tuple__188); + __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_infer_dtype_list, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":175 + * + * + * def is_possible_datetimelike_array(object arr): # <<<<<<<<<<<<<< + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + */ + __pyx_tuple__190 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_seen_timedelta, __pyx_n_s_seen_datetime, __pyx_n_s_v); if (unlikely(!__pyx_tuple__190)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__190); + __Pyx_GIVEREF(__pyx_tuple__190); + __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_possible_datetimelike_array, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":222 + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + * def is_bool_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__192 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__192)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__192); + __Pyx_GIVEREF(__pyx_tuple__192); + __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_bool_array, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":243 + * return False + * + * def is_integer(object o): # <<<<<<<<<<<<<< + * return util.is_integer_object(o) + * + */ + __pyx_tuple__194 = PyTuple_Pack(1, __pyx_n_s_o); if (unlikely(!__pyx_tuple__194)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__194); + __Pyx_GIVEREF(__pyx_tuple__194); + __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_integer, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":246 + * return util.is_integer_object(o) + * + * def is_integer_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__196 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__196); + __Pyx_GIVEREF(__pyx_tuple__196); + __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_integer_array, 246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":267 + * return False + * + * def is_integer_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__198 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__198); + __Pyx_GIVEREF(__pyx_tuple__198); + __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_integer_float_array, 267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":290 + * return False + * + * def is_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__200 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__200)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__200); + __Pyx_GIVEREF(__pyx_tuple__200); + __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_float_array, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":311 + * return False + * + * def is_string_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__202 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__202)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__202); + __Pyx_GIVEREF(__pyx_tuple__202); + __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_string_array, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":332 + * return False + * + * def is_unicode_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__204 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_objbuf, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__204)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__204); + __Pyx_GIVEREF(__pyx_tuple__204); + __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_unicode_array, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":354 + * + * + * def is_datetime_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_tuple__206 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__206)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__206); + __Pyx_GIVEREF(__pyx_tuple__206); + __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_datetime_array, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":371 + * return null_count != n + * + * def is_datetime64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_tuple__208 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__208)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__208); + __Pyx_GIVEREF(__pyx_tuple__208); + __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_datetime64_array, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":388 + * return null_count != n + * + * def is_timedelta_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_tuple__210 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__210)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__210); + __Pyx_GIVEREF(__pyx_tuple__210); + __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_timedelta_array, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":403 + * return null_count != n + * + * def is_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_tuple__212 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__212)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__212); + __Pyx_GIVEREF(__pyx_tuple__212); + __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_timedelta64_array, 403, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":418 + * return null_count != n + * + * def is_timedelta_or_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) + */ + __pyx_tuple__214 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_null_count, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__214)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__214); + __Pyx_GIVEREF(__pyx_tuple__214); + __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_timedelta_or_timedelta64_arra, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":434 + * return null_count != n + * + * def is_date_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_tuple__216 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__216)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__216); + __Pyx_GIVEREF(__pyx_tuple__216); + __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_date_array, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":443 + * return True + * + * def is_time_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_tuple__218 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__218)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__218); + __Pyx_GIVEREF(__pyx_tuple__218); + __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_time_array, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":452 + * return True + * + * def is_period(object o): # <<<<<<<<<<<<<< + * from pandas import Period + * return isinstance(o,Period) + */ + __pyx_tuple__220 = PyTuple_Pack(2, __pyx_n_s_o, __pyx_n_s_Period); if (unlikely(!__pyx_tuple__220)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__220); + __Pyx_GIVEREF(__pyx_tuple__220); + __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_period, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":456 + * return isinstance(o,Period) + * + * def is_period_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * from pandas.tseries.period import Period + */ + __pyx_tuple__222 = PyTuple_Pack(4, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_Period); if (unlikely(!__pyx_tuple__222)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__222); + __Pyx_GIVEREF(__pyx_tuple__222); + __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_is_period_array, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + __pyx_tuple__224 = PyTuple_Pack(17, __pyx_n_s_values, __pyx_n_s_na_values, __pyx_n_s_convert_empty, __pyx_n_s_coerce_numeric, __pyx_n_s_status, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_floats, __pyx_n_s_complexes, __pyx_n_s_ints, __pyx_n_s_bools, __pyx_n_s_seen_float, __pyx_n_s_seen_complex, __pyx_n_s_seen_int, __pyx_n_s_seen_bool, __pyx_n_s_val, __pyx_n_s_fval); if (unlikely(!__pyx_tuple__224)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__224); + __Pyx_GIVEREF(__pyx_tuple__224); + __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_maybe_convert_numeric, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":556 + * + * + * def maybe_convert_objects(ndarray[object] objects, bint try_float=0, # <<<<<<<<<<<<<< + * bint safe=0, bint convert_datetime=0, + * bint convert_timedelta=0): + */ + __pyx_tuple__226 = PyTuple_Pack(28, __pyx_n_s_objects, __pyx_n_s_try_float, __pyx_n_s_safe, __pyx_n_s_convert_datetime, __pyx_n_s_convert_timedelta, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_floats, __pyx_n_s_complexes, __pyx_n_s_ints, __pyx_n_s_bools, __pyx_n_s_idatetimes, __pyx_n_s_itimedeltas, __pyx_n_s_seen_float, __pyx_n_s_seen_complex, __pyx_n_s_seen_datetime, __pyx_n_s_seen_timedelta, __pyx_n_s_seen_int, __pyx_n_s_seen_bool, __pyx_n_s_seen_object, __pyx_n_s_seen_null, __pyx_n_s_seen_numeric, __pyx_n_s_val, __pyx_n_s_onan, __pyx_n_s_fval, __pyx_n_s_fnan, __pyx_n_s_datetimes, __pyx_n_s_timedeltas); if (unlikely(!__pyx_tuple__226)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__226); + __Pyx_GIVEREF(__pyx_tuple__226); + __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(5, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_maybe_convert_objects, 556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":722 + * + * + * def convert_sql_column(x): # <<<<<<<<<<<<<< + * return maybe_convert_objects(x, try_float=1) + * + */ + __pyx_tuple__228 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__228)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__228); + __Pyx_GIVEREF(__pyx_tuple__228); + __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_convert_sql_column, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + __pyx_tuple__230 = PyTuple_Pack(11, __pyx_n_s_values, __pyx_n_s_parser, __pyx_n_s_dayfirst, __pyx_n_s_default, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_date, __pyx_n_s_parse, __pyx_n_s_parse_date, __pyx_n_s_parse_date); if (unlikely(!__pyx_tuple__230)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__230); + __Pyx_GIVEREF(__pyx_tuple__230); + __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_try_parse_dates, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + __pyx_tuple__232 = PyTuple_Pack(20, __pyx_n_s_dates, __pyx_n_s_times, __pyx_n_s_date_parser, __pyx_n_s_time_parser, __pyx_n_s_dayfirst, __pyx_n_s_default, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_date, __pyx_n_s_time, __pyx_n_s_datetime, __pyx_n_s_timedelta, __pyx_n_s_parse, __pyx_n_s_parse_date, __pyx_n_s_parse_date, __pyx_n_s_parse_time, __pyx_n_s_parse_time, __pyx_n_s_d, __pyx_n_s_t); if (unlikely(!__pyx_tuple__232)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__232); + __Pyx_GIVEREF(__pyx_tuple__232); + __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(6, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_try_parse_date_and_time, 773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":827 + * + * + * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months, # <<<<<<<<<<<<<< + * ndarray[object] days): + * cdef: + */ + __pyx_tuple__234 = PyTuple_Pack(7, __pyx_n_s_years, __pyx_n_s_months, __pyx_n_s_days, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_datetime); if (unlikely(!__pyx_tuple__234)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__234); + __Pyx_GIVEREF(__pyx_tuple__234); + __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_try_parse_year_month_day, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":845 + * return result + * + * def try_parse_datetime_components(ndarray[object] years, # <<<<<<<<<<<<<< + * ndarray[object] months, + * ndarray[object] days, + */ + __pyx_tuple__236 = PyTuple_Pack(13, __pyx_n_s_years, __pyx_n_s_months, __pyx_n_s_days, __pyx_n_s_hours, __pyx_n_s_minutes, __pyx_n_s_seconds, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_secs, __pyx_n_s_float_secs, __pyx_n_s_micros, __pyx_n_s_datetime); if (unlikely(!__pyx_tuple__236)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__236); + __Pyx_GIVEREF(__pyx_tuple__236); + __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_try_parse_datetime_components, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + __pyx_tuple__238 = PyTuple_Pack(9, __pyx_n_s_values, __pyx_n_s_na_values, __pyx_n_s_convert_empty, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_onan, __pyx_n_s_na_count, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__238)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__238); + __Pyx_GIVEREF(__pyx_tuple__238); + __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_sanitize_objects, 881, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + __pyx_tuple__240 = PyTuple_Pack(11, __pyx_n_s_arr, __pyx_n_s_true_values, __pyx_n_s_false_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val, __pyx_n_s_true_vals, __pyx_n_s_false_vals, __pyx_n_s_na_count, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__240)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__240); + __Pyx_GIVEREF(__pyx_tuple__240); + __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_maybe_convert_bool, 904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":953 + * + * + * def map_infer_mask(ndarray arr, object f, ndarray[uint8_t] mask, # <<<<<<<<<<<<<< + * bint convert=1): + * ''' + */ + __pyx_tuple__242 = PyTuple_Pack(8, __pyx_n_s_arr, __pyx_n_s_f, __pyx_n_s_mask, __pyx_n_s_convert, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val); if (unlikely(!__pyx_tuple__242)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__242); + __Pyx_GIVEREF(__pyx_tuple__242); + __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_map_infer_mask, 953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":995 + * return result + * + * def map_infer(ndarray arr, object f, bint convert=1): # <<<<<<<<<<<<<< + * ''' + * Substitute for np.vectorize with pandas-friendly dtype inference + */ + __pyx_tuple__244 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_f, __pyx_n_s_convert, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_result, __pyx_n_s_val); if (unlikely(!__pyx_tuple__244)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__244); + __Pyx_GIVEREF(__pyx_tuple__244); + __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_map_infer, 995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":1034 + * + * + * def to_object_array(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_tuple__246 = PyTuple_Pack(8, __pyx_n_s_rows, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_tmp, __pyx_n_s_result, __pyx_n_s_row); if (unlikely(!__pyx_tuple__246)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__246); + __Pyx_GIVEREF(__pyx_tuple__246); + __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_to_object_array, 1034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":1058 + * return result + * + * def tuples_to_object_array(ndarray[object] tuples): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_tuple__248 = PyTuple_Pack(8, __pyx_n_s_tuples, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_tmp, __pyx_n_s_result, __pyx_n_s_tup); if (unlikely(!__pyx_tuple__248)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__248); + __Pyx_GIVEREF(__pyx_tuple__248); + __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__248, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_tuples_to_object_array, 1058, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":1074 + * return result + * + * def to_object_array_tuples(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_tuple__250 = PyTuple_Pack(8, __pyx_n_s_rows, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_tmp, __pyx_n_s_result, __pyx_n_s_row); if (unlikely(!__pyx_tuple__250)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__250); + __Pyx_GIVEREF(__pyx_tuple__250); + __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_to_object_array_tuples, 1074, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/inference.pyx":1105 + * + * + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(keys) + */ + __pyx_tuple__252 = PyTuple_Pack(7, __pyx_n_s_mapping, __pyx_n_s_keys, __pyx_n_s_default, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_output); if (unlikely(!__pyx_tuple__252)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__252); + __Pyx_GIVEREF(__pyx_tuple__252); + __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas_src_inference_pyx, __pyx_n_s_fast_multiget, 1105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "View.MemoryView":276 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__254 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__254)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__254); + __Pyx_GIVEREF(__pyx_tuple__254); + + /* "View.MemoryView":277 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__255 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__255)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__255); + __Pyx_GIVEREF(__pyx_tuple__255); + + /* "View.MemoryView":278 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__256 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__256)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__256); + __Pyx_GIVEREF(__pyx_tuple__256); + + /* "View.MemoryView":281 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__257 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__257)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__257); + __Pyx_GIVEREF(__pyx_tuple__257); + + /* "View.MemoryView":282 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__258 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__258)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__258); + __Pyx_GIVEREF(__pyx_tuple__258); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initlib(void); /*proto*/ +PyMODINIT_FUNC initlib(void) +#else +PyMODINIT_FUNC PyInit_lib(void); /*proto*/ +PyMODINIT_FUNC PyInit_lib(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_lib(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("lib"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__lib) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.lib")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.lib", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6pandas_3lib__PandasNull) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib__PandasNull.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "_PandasNull", (PyObject *)&__pyx_type_6pandas_3lib__PandasNull) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib__PandasNull = &__pyx_type_6pandas_3lib__PandasNull; + __pyx_vtabptr_6pandas_3lib_BlockPlacement = &__pyx_vtable_6pandas_3lib_BlockPlacement; + __pyx_vtable_6pandas_3lib_BlockPlacement.iadd = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_BlockPlacement *, PyObject *))__pyx_f_6pandas_3lib_14BlockPlacement_iadd; + __pyx_vtable_6pandas_3lib_BlockPlacement.copy = (struct __pyx_obj_6pandas_3lib_BlockPlacement *(*)(struct __pyx_obj_6pandas_3lib_BlockPlacement *))__pyx_f_6pandas_3lib_14BlockPlacement_copy; + __pyx_vtable_6pandas_3lib_BlockPlacement._ensure_has_slice = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_BlockPlacement *))__pyx_f_6pandas_3lib_14BlockPlacement__ensure_has_slice; + if (PyType_Ready(&__pyx_type_6pandas_3lib_BlockPlacement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_BlockPlacement.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_BlockPlacement.tp_dict, __pyx_vtabptr_6pandas_3lib_BlockPlacement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockPlacement", (PyObject *)&__pyx_type_6pandas_3lib_BlockPlacement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_BlockPlacement = &__pyx_type_6pandas_3lib_BlockPlacement; + if (PyType_Ready(&__pyx_type_6pandas_3lib_Reducer) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_Reducer.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "Reducer", (PyObject *)&__pyx_type_6pandas_3lib_Reducer) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_Reducer = &__pyx_type_6pandas_3lib_Reducer; + if (PyType_Ready(&__pyx_type_6pandas_3lib_SeriesBinGrouper) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_SeriesBinGrouper.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "SeriesBinGrouper", (PyObject *)&__pyx_type_6pandas_3lib_SeriesBinGrouper) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_SeriesBinGrouper = &__pyx_type_6pandas_3lib_SeriesBinGrouper; + if (PyType_Ready(&__pyx_type_6pandas_3lib_SeriesGrouper) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_SeriesGrouper.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "SeriesGrouper", (PyObject *)&__pyx_type_6pandas_3lib_SeriesGrouper) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_SeriesGrouper = &__pyx_type_6pandas_3lib_SeriesGrouper; + __pyx_vtabptr_6pandas_3lib_Slider = &__pyx_vtable_6pandas_3lib_Slider; + __pyx_vtable_6pandas_3lib_Slider.advance = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_advance; + __pyx_vtable_6pandas_3lib_Slider.move = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, int, int))__pyx_f_6pandas_3lib_6Slider_move; + __pyx_vtable_6pandas_3lib_Slider.set_length = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_set_length; + __pyx_vtable_6pandas_3lib_Slider.reset = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_reset; + if (PyType_Ready(&__pyx_type_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_Slider.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Slider.tp_dict, __pyx_vtabptr_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Slider", (PyObject *)&__pyx_type_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_Slider = &__pyx_type_6pandas_3lib_Slider; + __pyx_vtabptr_6pandas_3lib_BlockSlider = &__pyx_vtable_6pandas_3lib_BlockSlider; + __pyx_vtable_6pandas_3lib_BlockSlider.move = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_BlockSlider *, int, int, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_11BlockSlider_move; + __pyx_vtable_6pandas_3lib_BlockSlider.reset = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_BlockSlider *))__pyx_f_6pandas_3lib_11BlockSlider_reset; + if (PyType_Ready(&__pyx_type_6pandas_3lib_BlockSlider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_BlockSlider.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_BlockSlider.tp_dict, __pyx_vtabptr_6pandas_3lib_BlockSlider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockSlider", (PyObject *)&__pyx_type_6pandas_3lib_BlockSlider) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_BlockSlider = &__pyx_type_6pandas_3lib_BlockSlider; + if (PyType_Ready(&__pyx_type_6pandas_3lib_cache_readonly) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_cache_readonly.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "cache_readonly", (PyObject *)&__pyx_type_6pandas_3lib_cache_readonly) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_cache_readonly = &__pyx_type_6pandas_3lib_cache_readonly; + if (PyType_Ready(&__pyx_type_6pandas_3lib_AxisProperty) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib_AxisProperty.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "AxisProperty", (PyObject *)&__pyx_type_6pandas_3lib_AxisProperty) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_3lib_AxisProperty = &__pyx_type_6pandas_3lib_AxisProperty; + if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct__get_blkno_indexers) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib___pyx_scope_struct__get_blkno_indexers.tp_print = 0; + __pyx_ptype_6pandas_3lib___pyx_scope_struct__get_blkno_indexers = &__pyx_type_6pandas_3lib___pyx_scope_struct__get_blkno_indexers; + if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib___pyx_scope_struct_1_genexpr.tp_print = 0; + __pyx_ptype_6pandas_3lib___pyx_scope_struct_1_genexpr = &__pyx_type_6pandas_3lib___pyx_scope_struct_1_genexpr; + if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct_2_try_parse_dates) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib___pyx_scope_struct_2_try_parse_dates.tp_print = 0; + __pyx_ptype_6pandas_3lib___pyx_scope_struct_2_try_parse_dates = &__pyx_type_6pandas_3lib___pyx_scope_struct_2_try_parse_dates; + if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time.tp_print = 0; + __pyx_ptype_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time = &__pyx_type_6pandas_3lib___pyx_scope_struct_3_try_parse_date_and_time; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_array.tp_print = 0; + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_MemviewEnum.tp_print = 0; + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_memoryview.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + __pyx_t_1 = __Pyx_ImportModule("pandas.tslib"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ImportFunction(__pyx_t_1, "convert_to_tsobject", (void (**)(void))&__pyx_f_6pandas_5tslib_convert_to_tsobject, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ImportFunction(__pyx_t_1, "convert_to_timedelta64", (void (**)(void))&__pyx_f_6pandas_5tslib_convert_to_timedelta64, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*--- Execution code ---*/ + + /* "pandas/lib.pyx":3 + * cimport numpy as np + * cimport cython + * import numpy as np # <<<<<<<<<<<<<< + * + * from numpy cimport * + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":37 + * cimport cpython + * + * isnan = np.isnan # <<<<<<<<<<<<<< + * cdef double NaN = np.NaN + * cdef double nan = NaN + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isnan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnan, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":38 + * + * isnan = np.isnan + * cdef double NaN = np.NaN # <<<<<<<<<<<<<< + * cdef double nan = NaN + * cdef double NAN = nan + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_3lib_NaN = ((double)__pyx_t_4); + + /* "pandas/lib.pyx":39 + * isnan = np.isnan + * cdef double NaN = np.NaN + * cdef double nan = NaN # <<<<<<<<<<<<<< + * cdef double NAN = nan + * + */ + __pyx_v_6pandas_3lib_nan = __pyx_v_6pandas_3lib_NaN; + + /* "pandas/lib.pyx":40 + * cdef double NaN = np.NaN + * cdef double nan = NaN + * cdef double NAN = nan # <<<<<<<<<<<<<< + * + * from datetime import datetime as pydatetime + */ + __pyx_v_6pandas_3lib_NAN = __pyx_v_6pandas_3lib_nan; + + /* "pandas/lib.pyx":42 + * cdef double NAN = nan + * + * from datetime import datetime as pydatetime # <<<<<<<<<<<<<< + * + * # this is our tseries.pxd + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydatetime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":48 + * + * from tslib cimport convert_to_tsobject, convert_to_timedelta64 + * import tslib # <<<<<<<<<<<<<< + * from tslib import NaT, Timestamp, repr_timedelta64 + * + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_tslib, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tslib, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":49 + * from tslib cimport convert_to_tsobject, convert_to_timedelta64 + * import tslib + * from tslib import NaT, Timestamp, repr_timedelta64 # <<<<<<<<<<<<<< + * + * cdef int64_t NPY_NAT = util.get_nat() + */ + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_NaT); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_NaT); + __Pyx_GIVEREF(__pyx_n_s_NaT); + __Pyx_INCREF(__pyx_n_s_Timestamp); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Timestamp); + __Pyx_GIVEREF(__pyx_n_s_Timestamp); + __Pyx_INCREF(__pyx_n_s_repr_timedelta64); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_repr_timedelta64); + __Pyx_GIVEREF(__pyx_n_s_repr_timedelta64); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_tslib, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_repr_timedelta64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_repr_timedelta64, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":51 + * from tslib import NaT, Timestamp, repr_timedelta64 + * + * cdef int64_t NPY_NAT = util.get_nat() # <<<<<<<<<<<<<< + * + * ctypedef unsigned char UChar + */ + __pyx_v_6pandas_3lib_NPY_NAT = get_nat(); + + /* "pandas/lib.pyx":69 + * + * # import datetime C API + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * # initialize numpy + */ + PyDateTime_IMPORT; + + /* "pandas/lib.pyx":72 + * + * # initialize numpy + * import_array() # <<<<<<<<<<<<<< + * import_ufunc() + * + */ + import_array(); + + /* "pandas/lib.pyx":73 + * # initialize numpy + * import_array() + * import_ufunc() # <<<<<<<<<<<<<< + * + * def values_from_object(object o): + */ + import_ufunc(); + + /* "pandas/lib.pyx":75 + * import_ufunc() + * + * def values_from_object(object o): # <<<<<<<<<<<<<< + * """ return my values or the object if we are say an ndarray """ + * cdef f + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_1values_from_object, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_values_from_object, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":109 + * + * + * def ismember_nans(float64_t[:] arr, set values, bint hasnans): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_5ismember_nans, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ismember_nans, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":124 + * + * + * def ismember(ndarray arr, set values): # <<<<<<<<<<<<<< + * ''' + * Checks whether + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_7ismember, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ismember, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":153 + * # datetime / io related + * + * cdef int _EPOCH_ORD = 719163 # <<<<<<<<<<<<<< + * + * from datetime import date as pydate + */ + __pyx_v_6pandas_3lib__EPOCH_ORD = 719163; + + /* "pandas/lib.pyx":155 + * cdef int _EPOCH_ORD = 719163 + * + * from datetime import date as pydate # <<<<<<<<<<<<<< + * + * cdef inline int64_t gmtime(object date): + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_date); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_date); + __Pyx_GIVEREF(__pyx_n_s_date); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydate, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":176 + * return gmtime(dt) + * + * def array_to_timestamp(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[int64_t, ndim=1] result + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_13array_to_timestamp, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_to_timestamp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":188 + * return result + * + * def time64_to_datetime(ndarray[int64_t, ndim=1] arr): # <<<<<<<<<<<<<< + * cdef int i, n + * cdef ndarray[object, ndim=1] result + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_15time64_to_datetime, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time64_to_datetime, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/lib.pyx":206 + * # isnull / notnull related + * + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_3lib_INF = ((double)__pyx_t_4); + + /* "pandas/lib.pyx":207 + * + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * + * cpdef checknull(object val): + */ + __pyx_v_6pandas_3lib_NEGINF = (-__pyx_v_6pandas_3lib_INF); + + /* "pandas/lib.pyx":237 + * return util._checknull(val) + * + * def isscalar(object val): # <<<<<<<<<<<<<< + * return np.isscalar(val) or val is None or PyDateTime_Check(val) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_21isscalar, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isscalar, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":243 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_23isnullobj, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":257 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_25isnullobj_old, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj_old, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":271 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_27isnullobj2d, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj2d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":287 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj_old(ndarray[object] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, n + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_29isnullobj_old, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj_old, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":301 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def isnullobj2d_old(ndarray[object, ndim=2] arr): # <<<<<<<<<<<<<< + * cdef Py_ssize_t i, j, n, m + * cdef object val + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_31isnullobj2d_old, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnullobj2d_old, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":315 + * return result.view(np.bool_) + * + * def list_to_object_array(list obj): # <<<<<<<<<<<<<< + * ''' + * Convert list to object ndarray. Seriously can't believe I had to write this + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_33list_to_object_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_to_object_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":335 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_35fast_unique, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_unique, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":356 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple(list arrays): # <<<<<<<<<<<<<< + * cdef: + * ndarray[object] buf + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_37fast_unique_multiple, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_unique_multiple, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":382 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list(list lists): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_39fast_unique_multiple_list, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_unique_multiple_list, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":408 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def fast_unique_multiple_list_gen(object gen): # <<<<<<<<<<<<<< + * cdef: + * list buf + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_41fast_unique_multiple_list_gen, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_unique_multiple_list_gen, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":433 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def dicts_to_array(list dicts, list columns): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, k, n + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_43dicts_to_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dicts_to_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":456 + * return result + * + * def fast_zip(list ndarrays): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_45fast_zip, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_zip, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":497 + * return result + * + * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length): # <<<<<<<<<<<<<< + * """ + * Reverse indexing operation. + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_47get_reverse_indexer, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reverse_indexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":524 + * + * + * def has_infs_f4(ndarray[float32_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_49has_infs_f4, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_infs_f4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":538 + * return False + * + * def has_infs_f8(ndarray[float64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_51has_infs_f8, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_infs_f8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":552 + * return False + * + * def convert_timestamps(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * object val, f, result + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_53convert_timestamps, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_timestamps, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":575 + * return out + * + * def maybe_indices_to_slice(ndarray[int64_t] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(indices) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_55maybe_indices_to_slice, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_indices_to_slice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":588 + * + * + * def maybe_booleans_to_slice(ndarray[uint8_t] mask): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(mask) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_57maybe_booleans_to_slice, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_booleans_to_slice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":619 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_compare(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_59scalar_compare, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_scalar_compare, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":663 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_compare(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * import operator + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_61vec_compare, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_vec_compare, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":715 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def scalar_binop(ndarray[object] values, object val, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_63scalar_binop, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_scalar_binop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":737 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def vec_binop(ndarray[object] left, ndarray[object] right, object op): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(left) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_65vec_binop, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_vec_binop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":764 + * + * + * def astype_intsafe(ndarray[object] arr, new_dtype): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_67astype_intsafe, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_astype_intsafe, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":794 + * return result + * + * def clean_index_list(list obj): # <<<<<<<<<<<<<< + * ''' + * Utility used in pandas.core.index._ensure_index + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_71clean_index_list, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean_index_list, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":825 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def max_len_string_array(ndarray[object, ndim=1] arr): # <<<<<<<<<<<<<< + * """ return the maximum size of elements in a 1-dim string array """ + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_73max_len_string_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_max_len_string_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":845 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def string_array_replace_from_nan_rep(ndarray[object, ndim=1] arr, object nan_rep, object replace = None): # <<<<<<<<<<<<<< + * """ replace the values in the array with replacement if they are nan_rep; return the same array """ + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_75string_array_replace_from_nan_rep, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_array_replace_from_nan_re, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":860 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def write_csv_rows(list data, list data_index, int nlevels, list cols, object writer): # <<<<<<<<<<<<<< + * + * cdef int N, j, i, ncols + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_77write_csv_rows, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_write_csv_rows, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":908 + * + * @cython.boundscheck(False) + * def arrmap(ndarray[object] index, object func): # <<<<<<<<<<<<<< + * cdef int length = index.shape[0] + * cdef int i = 0 + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_79arrmap, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_arrmap, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":921 + * @cython.wraparound(False) + * @cython.boundscheck(False) + * def is_lexsorted(list list_of_arrays): # <<<<<<<<<<<<<< + * cdef: + * int i + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_81is_lexsorted, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_lexsorted, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":960 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner, # <<<<<<<<<<<<<< + * object closed='left', bint hasnans=0): + * """ + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_83generate_bins_dt64, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_generate_bins_dt64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1025 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset(ndarray[float64_t, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_85row_bool_subset, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_row_bool_subset, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1046 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def row_bool_subset_object(ndarray[object, ndim=2] values, # <<<<<<<<<<<<<< + * ndarray[uint8_t, cast=True] mask): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_87row_bool_subset_object, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_row_bool_subset_object, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1066 + * + * + * def group_count(ndarray[int64_t] values, Py_ssize_t size): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_89group_count, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1076 + * return counts + * + * def lookup_values(ndarray[object] values, dict mapping): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_91lookup_values, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookup_values, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1086 + * + * + * def count_level_1d(ndarray[uint8_t, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_93count_level_1d, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_count_level_1d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1103 + * + * + * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask, # <<<<<<<<<<<<<< + * ndarray[int64_t] labels, Py_ssize_t max_bin): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_95count_level_2d, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_count_level_2d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1132 + * return 0 + * + * pandas_null = _PandasNull() # <<<<<<<<<<<<<< + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pandas_null, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1134 + * pandas_null = _PandasNull() + * + * def fast_zip_fillna(list ndarrays, fill_value=pandas_null): # <<<<<<<<<<<<<< + * ''' + * For zipping multiple ndarrays into an ndarray of tuples + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pandas_null); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_k__10 = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_97fast_zip_fillna, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_zip_fillna, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1181 + * return result + * + * def duplicated(ndarray[object] values, take_last=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_99duplicated, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_duplicated, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1210 + * return result.view(np.bool_) + * + * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, group_size, n, lab, start + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_101generate_slices, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_generate_slices, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1235 + * + * + * def indices_fast(object index, ndarray[int64_t] labels, list keys, # <<<<<<<<<<<<<< + * list sorted_labels): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_103indices_fast, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_indices_fast, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1278 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def get_blkno_indexers(int64_t[:] blknos, bint group=True): # <<<<<<<<<<<<<< + * """ + * Enumerate contiguous runs of integers in ndarray. + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_105get_blkno_indexers, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_blkno_indexers, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1443 + * + * + * cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX): # <<<<<<<<<<<<<< + * """ + * Get (start, stop, step, length) tuple for a slice. + */ + __pyx_k__17 = PY_SSIZE_T_MAX; + + /* "pandas/lib.pyx":1462 + * + * + * cpdef Py_ssize_t slice_len(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX) except -1: # <<<<<<<<<<<<<< + * """ + * Get length of a bounded slice. + */ + __pyx_k__19 = PY_SSIZE_T_MAX; + + /* "pandas/lib.pyx":1486 + * + * + * def slice_getitem(slice slc not None, ind): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t s_start, s_stop, s_step, s_len + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_116slice_getitem, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_slice_getitem, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1575 + * + * @property + * def as_slice(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is None: + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement, __pyx_n_s_as_slice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/lib.pyx":1574 + * return iter(self._as_array) + * + * @property # <<<<<<<<<<<<<< + * def as_slice(self): + * cdef slice s = self._ensure_has_slice() + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement->tp_dict, __pyx_n_s_as_slice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6pandas_3lib_BlockPlacement); + + /* "pandas/lib.pyx":1583 + * + * @property + * def indexer(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * if s is not None: + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement, __pyx_n_s_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/lib.pyx":1582 + * return s + * + * @property # <<<<<<<<<<<<<< + * def indexer(self): + * cdef slice s = self._ensure_has_slice() + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement->tp_dict, __pyx_n_s_indexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6pandas_3lib_BlockPlacement); + + /* "pandas/lib.pyx":1595 + * + * @property + * def as_array(self): # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, end, _ + * if not self._has_array: + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement, __pyx_n_s_as_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/lib.pyx":1594 + * return Int64Index(self.as_array, copy=False).isin(arr) + * + * @property # <<<<<<<<<<<<<< + * def as_array(self): + * cdef Py_ssize_t start, stop, end, _ + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement->tp_dict, __pyx_n_s_as_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6pandas_3lib_BlockPlacement); + + /* "pandas/lib.pyx":1605 + * + * @property + * def is_slice_like(self): # <<<<<<<<<<<<<< + * cdef slice s = self._ensure_has_slice() + * return s is not None + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement, __pyx_n_s_is_slice_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/lib.pyx":1604 + * return self._as_array + * + * @property # <<<<<<<<<<<<<< + * def is_slice_like(self): + * cdef slice s = self._ensure_has_slice() + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_3lib_BlockPlacement->tp_dict, __pyx_n_s_is_slice_like, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6pandas_3lib_BlockPlacement); + + /* "pandas/src/reduce.pyx":3 + * #cython=False + * from numpy cimport * + * import numpy as np # <<<<<<<<<<<<<< + * + * from distutils.version import LooseVersion + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":5 + * import numpy as np + * + * from distutils.version import LooseVersion # <<<<<<<<<<<<<< + * + * is_numpy_prior_1_6_2 = LooseVersion(np.__version__) < '1.6.2' + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_LooseVersion); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_LooseVersion); + __Pyx_GIVEREF(__pyx_n_s_LooseVersion); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_distutils_version, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LooseVersion, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/reduce.pyx":7 + * from distutils.version import LooseVersion + * + * is_numpy_prior_1_6_2 = LooseVersion(np.__version__) < '1.6.2' # <<<<<<<<<<<<<< + * + * cdef class Reducer: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_kp_s_1_6_2, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_numpy_prior_1_6_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":471 + * + * + * class InvalidApply(Exception): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_Exception); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception); + __Pyx_GIVEREF(__pyx_builtin_Exception); + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_n_s_InvalidApply, __pyx_n_s_InvalidApply, (PyObject *) NULL, __pyx_n_s_pandas_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_InvalidApply, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidApply, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":474 + * pass + * + * def apply_frame_axis0(object frame, object f, object names, # <<<<<<<<<<<<<< + * ndarray[int64_t] starts, ndarray[int64_t] ends): + * cdef: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_118apply_frame_axis0, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_frame_axis0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/reduce.pyx":591 + * + * + * def reduce(arr, f, axis=0, dummy=None, labels=None): # <<<<<<<<<<<<<< + * if labels._has_complex_internals: + * raise Exception('Cannot use shortcut') + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_120reduce, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":2 + * cimport util + * from tslib import NaT # <<<<<<<<<<<<<< + * from datetime import datetime, timedelta + * iNaT = util.get_nat() + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_NaT); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_NaT); + __Pyx_GIVEREF(__pyx_n_s_NaT); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_tslib, __pyx_t_2, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_NaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":3 + * cimport util + * from tslib import NaT + * from datetime import datetime, timedelta # <<<<<<<<<<<<<< + * iNaT = util.get_nat() + * + */ + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __Pyx_INCREF(__pyx_n_s_timedelta); + PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_timedelta); + __Pyx_GIVEREF(__pyx_n_s_timedelta); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_5, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":4 + * from tslib import NaT + * from datetime import datetime, timedelta + * iNaT = util.get_nat() # <<<<<<<<<<<<<< + * + * # core.common import for fast inference checks + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(get_nat()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_iNaT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":7 + * + * # core.common import for fast inference checks + * def is_float(object obj): # <<<<<<<<<<<<<< + * return util.is_float_object(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_122is_float, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_float, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":10 + * return util.is_float_object(obj) + * + * def is_integer(object obj): # <<<<<<<<<<<<<< + * return util.is_integer_object(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_124is_integer, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":13 + * return util.is_integer_object(obj) + * + * def is_bool(object obj): # <<<<<<<<<<<<<< + * return util.is_bool_object(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_126is_bool, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_bool, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":16 + * return util.is_bool_object(obj) + * + * def is_complex(object obj): # <<<<<<<<<<<<<< + * return util.is_complex_object(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_128is_complex, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_complex, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":19 + * return util.is_complex_object(obj) + * + * _TYPE_MAP = { # <<<<<<<<<<<<<< + * 'int8': 'integer', + * 'int16': 'integer', + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_u, __pyx_n_s_integer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float32, __pyx_n_s_floating) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float64, __pyx_n_s_floating) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_f, __pyx_n_s_floating) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_complex128, __pyx_n_s_complex) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_c, __pyx_n_s_complex) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_string, __pyx_n_s_string) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_S, __pyx_n_s_string) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_unicode, __pyx_n_s_unicode) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_U, __pyx_n_s_unicode) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bool_2, __pyx_n_s_boolean) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_b, __pyx_n_s_boolean) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_datetime64_ns, __pyx_n_s_datetime64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_M, __pyx_n_s_datetime64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_timedelta64_ns, __pyx_n_s_timedelta64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_m, __pyx_n_s_timedelta64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPE_MAP, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":48 + * + * # types only exist on certain platform + * try: # <<<<<<<<<<<<<< + * np.float128 + * _TYPE_MAP['float128'] = 'floating' + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/src/inference.pyx":49 + * # types only exist on certain platform + * try: + * np.float128 # <<<<<<<<<<<<<< + * _TYPE_MAP['float128'] = 'floating' + * except AttributeError: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float128); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":50 + * try: + * np.float128 + * _TYPE_MAP['float128'] = 'floating' # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_float128, __pyx_n_s_floating) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":51 + * np.float128 + * _TYPE_MAP['float128'] = 'floating' + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * try: + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L9_try_end:; + } + + /* "pandas/src/inference.pyx":53 + * except AttributeError: + * pass + * try: # <<<<<<<<<<<<<< + * np.complex256 + * _TYPE_MAP['complex256'] = 'complex' + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/src/inference.pyx":54 + * pass + * try: + * np.complex256 # <<<<<<<<<<<<<< + * _TYPE_MAP['complex256'] = 'complex' + * except AttributeError: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex256); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":55 + * try: + * np.complex256 + * _TYPE_MAP['complex256'] = 'complex' # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_complex256, __pyx_n_s_complex) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L10_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L17_try_end; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/inference.pyx":56 + * np.complex256 + * _TYPE_MAP['complex256'] = 'complex' + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * try: + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L11_exception_handled; + } + goto __pyx_L12_except_error; + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L11_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7); + __pyx_L17_try_end:; + } + + /* "pandas/src/inference.pyx":58 + * except AttributeError: + * pass + * try: # <<<<<<<<<<<<<< + * np.float16 + * _TYPE_MAP['float16'] = 'floating' + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/src/inference.pyx":59 + * pass + * try: + * np.float16 # <<<<<<<<<<<<<< + * _TYPE_MAP['float16'] = 'floating' + * except AttributeError: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":60 + * try: + * np.float16 + * _TYPE_MAP['float16'] = 'floating' # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPE_MAP); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_float16, __pyx_n_s_floating) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":61 + * np.float16 + * _TYPE_MAP['float16'] = 'floating' + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_10) { + PyErr_Restore(0,0,0); + goto __pyx_L19_exception_handled; + } + goto __pyx_L20_except_error; + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L25_try_end:; + } + + /* "pandas/src/inference.pyx":64 + * pass + * + * def infer_dtype(object _values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_130infer_dtype, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_infer_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":169 + * return 'mixed' + * + * def infer_dtype_list(list values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_132infer_dtype_list, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_infer_dtype_list, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":175 + * + * + * def is_possible_datetimelike_array(object arr): # <<<<<<<<<<<<<< + * # determine if we have a possible datetimelike (or null-like) array + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_134is_possible_datetimelike_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_possible_datetimelike_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":222 + * return PyDelta_Check(o) or util.is_timedelta64_object(o) + * + * def is_bool_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_136is_bool_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_bool_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":243 + * return False + * + * def is_integer(object o): # <<<<<<<<<<<<<< + * return util.is_integer_object(o) + * + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_138is_integer, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":246 + * return util.is_integer_object(o) + * + * def is_integer_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_140is_integer_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":267 + * return False + * + * def is_integer_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_142is_integer_float_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer_float_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":290 + * return False + * + * def is_float_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_144is_float_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_float_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":311 + * return False + * + * def is_string_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_146is_string_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_string_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":332 + * return False + * + * def is_unicode_array(ndarray values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_148is_unicode_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_unicode_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":354 + * + * + * def is_datetime_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_150is_datetime_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_datetime_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":371 + * return null_count != n + * + * def is_datetime64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_152is_datetime64_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_datetime64_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":388 + * return null_count != n + * + * def is_timedelta_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_154is_timedelta_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_timedelta_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":403 + * return null_count != n + * + * def is_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * cdef int i, null_count = 0, n = len(values) + * cdef object v + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_156is_timedelta64_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_timedelta64_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":418 + * return null_count != n + * + * def is_timedelta_or_timedelta64_array(ndarray values): # <<<<<<<<<<<<<< + * """ infer with timedeltas and/or nat/none """ + * cdef int i, null_count = 0, n = len(values) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_158is_timedelta_or_timedelta64_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_timedelta_or_timedelta64_arra, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":434 + * return null_count != n + * + * def is_date_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_160is_date_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_date_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":443 + * return True + * + * def is_time_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_162is_time_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_time_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":452 + * return True + * + * def is_period(object o): # <<<<<<<<<<<<<< + * from pandas import Period + * return isinstance(o,Period) + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_164is_period, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_period, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":456 + * return isinstance(o,Period) + * + * def is_period_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * from pandas.tseries.period import Period + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_166is_period_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_period_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":471 + * inline int floatify(object, double *result) except -1 + * + * cdef double fINT64_MAX = INT64_MAX # <<<<<<<<<<<<<< + * cdef double fINT64_MIN = INT64_MIN + * + */ + __pyx_v_6pandas_3lib_fINT64_MAX = ((double)INT64_MAX); + + /* "pandas/src/inference.pyx":472 + * + * cdef double fINT64_MAX = INT64_MAX + * cdef double fINT64_MIN = INT64_MIN # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6pandas_3lib_fINT64_MIN = ((double)INT64_MIN); + + /* "pandas/src/inference.pyx":475 + * + * + * def maybe_convert_numeric(object[:] values, set na_values, # <<<<<<<<<<<<<< + * bint convert_empty=True, bint coerce_numeric=False): + * ''' + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_168maybe_convert_numeric, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_convert_numeric, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":556 + * + * + * def maybe_convert_objects(ndarray[object] objects, bint try_float=0, # <<<<<<<<<<<<<< + * bint safe=0, bint convert_datetime=0, + * bint convert_timedelta=0): + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_170maybe_convert_objects, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_convert_objects, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":722 + * + * + * def convert_sql_column(x): # <<<<<<<<<<<<<< + * return maybe_convert_objects(x, try_float=1) + * + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_172convert_sql_column, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_sql_column, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":725 + * return maybe_convert_objects(x, try_float=1) + * + * def try_parse_dates(ndarray[object] values, parser=None, # <<<<<<<<<<<<<< + * dayfirst=False,default=None): + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_174try_parse_dates, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_parse_dates, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":773 + * return result + * + * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times, # <<<<<<<<<<<<<< + * date_parser=None, time_parser=None, + * dayfirst=False,default=None): + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_176try_parse_date_and_time, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_parse_date_and_time, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":827 + * + * + * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months, # <<<<<<<<<<<<<< + * ndarray[object] days): + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_178try_parse_year_month_day, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_parse_year_month_day, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":845 + * return result + * + * def try_parse_datetime_components(ndarray[object] years, # <<<<<<<<<<<<<< + * ndarray[object] months, + * ndarray[object] days, + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_180try_parse_datetime_components, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_parse_datetime_components, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":881 + * return result + * + * def sanitize_objects(ndarray[object] values, set na_values, # <<<<<<<<<<<<<< + * convert_empty=True): + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_182sanitize_objects, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sanitize_objects, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":904 + * return na_count + * + * def maybe_convert_bool(ndarray[object] arr, # <<<<<<<<<<<<<< + * true_values=None, false_values=None): + * cdef: + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_184maybe_convert_bool, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_convert_bool, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":953 + * + * + * def map_infer_mask(ndarray arr, object f, ndarray[uint8_t] mask, # <<<<<<<<<<<<<< + * bint convert=1): + * ''' + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_186map_infer_mask, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_map_infer_mask, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":995 + * return result + * + * def map_infer(ndarray arr, object f, bint convert=1): # <<<<<<<<<<<<<< + * ''' + * Substitute for np.vectorize with pandas-friendly dtype inference + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_188map_infer, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_map_infer, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1034 + * + * + * def to_object_array(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_190to_object_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_object_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1058 + * return result + * + * def tuples_to_object_array(ndarray[object] tuples): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_192tuples_to_object_array, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tuples_to_object_array, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1074 + * return result + * + * def to_object_array_tuples(list rows): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, j, n, k, tmp + */ + __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_194to_object_array_tuples, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_object_array_tuples, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/inference.pyx":1105 + * + * + * def fast_multiget(dict mapping, ndarray keys, default=np.nan): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(keys) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_k__57 = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_196fast_multiget, NULL, __pyx_n_s_pandas_lib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fast_multiget, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/lib.pyx":1 + * cimport numpy as np # <<<<<<<<<<<<<< + * cimport cython + * import numpy as np + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":203 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":276 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__254, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":277 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__255, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":278 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__256, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":281 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__257, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":282 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__258, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":496 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":953 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "View.MemoryView":1361 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.lib", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.lib"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (!buf) { + PyErr_SetString(PyExc_ValueError, + "buf is NULL."); + goto fail; + } else if (memviewslice->memview || memviewslice->data) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) { + va_list vargs; + char msg[200]; + va_start(vargs, fmt); +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + Py_FatalError(msg); + va_end(vargs); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; /* allow uninitialized memoryview assignment */ + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +static CYTHON_INLINE int __Pyx_mod_int(int a, int b) { + int r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_ass_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_ass_slice(obj, cstart, cstop, value); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_ass_subscript)) +#endif + { + int result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_ass_subscript(obj, py_slice, value); +#else + result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object does not support slice %.10s", + Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); +bad: + return -1; +} + +static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { + long r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { + Py_ssize_t start = *_start, stop = *_stop, length = *_length; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + else if (stop > length) + stop = length; + *_length = stop - start; + *_start = start; + *_stop = stop; +} +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + PyObject* dest; + Py_ssize_t length = PyList_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (unlikely(length <= 0)) + return PyList_New(0); + dest = PyList_New(length); + if (unlikely(!dest)) + return NULL; + __Pyx_copy_object_array( + ((PyListObject*)src)->ob_item + start, + ((PyListObject*)dest)->ob_item, + length); + return dest; +} +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + PyObject* dest; + Py_ssize_t length = PyTuple_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (unlikely(length <= 0)) + return PyTuple_New(0); + dest = PyTuple_New(length); + if (unlikely(!dest)) + return NULL; + __Pyx_copy_object_array( + ((PyTupleObject*)src)->ob_item + start, + ((PyTupleObject*)dest)->ob_item, + length); + return dest; +} +#endif + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} + +static double __Pyx__PyObject_AsDouble(PyObject* obj) { + PyObject* float_value; +#if CYTHON_COMPILING_IN_PYPY + float_value = PyNumber_Float(obj); +#else + PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; + if (likely(nb) && likely(nb->nb_float)) { + float_value = nb->nb_float(obj); + if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { + PyErr_Format(PyExc_TypeError, + "__float__ returned non-float (type %.200s)", + Py_TYPE(float_value)->tp_name); + Py_DECREF(float_value); + goto bad; + } + } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { +#if PY_MAJOR_VERSION >= 3 + float_value = PyFloat_FromString(obj); +#else + float_value = PyFloat_FromString(obj, 0); +#endif + } else { + PyObject* args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + PyTuple_SET_ITEM(args, 0, obj); + float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); + PyTuple_SET_ITEM(args, 0, 0); + Py_DECREF(args); + } +#endif + if (likely(float_value)) { + double value = PyFloat_AS_DOUBLE(float_value); + Py_DECREF(float_value); + return value; + } +bad: + return (double)-1; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + length = strlen(cstring); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) + result = __Pyx_GetModuleGlobalName(name); + return result; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc_2, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (buf->strides[dim] != sizeof(void *)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (buf->strides[dim] != buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (stride < buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (spec & (__Pyx_MEMVIEW_PTR)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (buf->suboffsets) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (buf->suboffsets && buf->suboffsets[dim] >= 0) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) + { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (buf->ndim != ndim) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned) buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (!__pyx_check_strides(buf, i, ndim, spec)) + goto fail; + if (!__pyx_check_suboffsets(buf, i, ndim, spec)) + goto fail; + } + if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_object(PyObject *obj) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS, 1, + &__Pyx_TypeInfo_object, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp); +} +static int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj); + if ((value == (npy_float64)-1) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_float64_t *) itemp = value; + return 1; +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + return (npy_uint8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong) + } else if (sizeof(npy_uint8) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint8 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint8) -1; + } + } else { + npy_uint8 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(Py_intptr_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(Py_intptr_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(Py_intptr_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), + little, !is_unsigned); + } +} + +static PyObject *__pyx_memview_get_object(const char *itemp) { + PyObject *result = *(PyObject **) itemp; + Py_INCREF(result); + return result; +} +static int __pyx_memview_set_object(const char *itemp, PyObject *obj) { + Py_INCREF(obj); + Py_DECREF(*(PyObject **) itemp); + *(PyObject **) itemp = obj; + return 1; +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) { + Py_complex cval; +#if CYTHON_COMPILING_IN_CPYTHON + if (PyComplex_CheckExact(o)) + cval = ((PyComplexObject *)o)->cval; + else +#endif + cval = PyComplex_AsCComplex(o); + return __pyx_t_double_complex_from_parts( + (double)cval.real, + (double)cval.imag); +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, + char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs->memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize) + return 0; + itemsize *= mvs->shape[index]; + } + return 1; +} + +static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0) + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(char) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(char) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong) + } else if (sizeof(char) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(char, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject *__Pyx_Generator_Next(PyObject *self); +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Generator_Close(PyObject *self); +static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args); +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (unlikely(et != PyExc_StopIteration) && + unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + if (likely(et == PyExc_StopIteration)) { + if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + ev = Py_None; + } + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = ev; + return 0; + } + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PyObject_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +#endif +static CYTHON_INLINE +void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) { + PyObject *exc_type = self->exc_type; + PyObject *exc_value = self->exc_value; + PyObject *exc_traceback = self->exc_traceback; + self->exc_type = NULL; + self->exc_value = NULL; + self->exc_traceback = NULL; + Py_XDECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_traceback); +} +static CYTHON_INLINE +int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) { + if (unlikely(gen->is_running)) { + PyErr_SetString(PyExc_ValueError, + "generator already executing"); + return 1; + } + return 0; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + PyErr_SetString(PyExc_TypeError, + "can't send non-None value to a " + "just-started generator"); + return NULL; + } + } + if (unlikely(self->resume_label == -1)) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } + if (value) { +#if CYTHON_COMPILING_IN_PYPY +#else + /* Generators always return to their most recent caller, not + * necessarily their creator. */ + if (self->exc_traceback) { + PyThreadState *tstate = PyThreadState_GET(); + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(tstate->frame); + assert(f->f_back == NULL); + f->f_back = tstate->frame; + } +#endif + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); + } else { + __Pyx_Generator_ExceptionClear(self); + } + self->is_running = 1; + retval = self->body((PyObject *) self, value); + self->is_running = 0; + if (retval) { + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); +#if CYTHON_COMPILING_IN_PYPY +#else + /* Don't keep the reference to f_back any longer than necessary. It + * may keep a chain of frames alive or it could create a reference + * cycle. */ + if (self->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + } +#endif + } else { + __Pyx_Generator_ExceptionClear(self); + } + return retval; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Generator_Undelegate(gen); + __Pyx_PyGen_FetchStopIterationValue(&val); + ret = __Pyx_Generator_SendEx(gen, val); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, Py_None); +} +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Send(yf, value); + } else { + if (value == Py_None) + ret = PyIter_Next(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, value); +} +static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Generator_Close(yf); + if (!retval) + return -1; + } else { + PyObject *meth; + gen->is_running = 1; + meth = PyObject_GetAttr(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Close(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + Py_INCREF(yf); + err = __Pyx_Generator_CloseIter(gen, yf); + __Pyx_Generator_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) +#if PY_VERSION_HEX < 0x02050000 + PyErr_SetNone(PyExc_StopIteration); +#else + PyErr_SetNone(PyExc_GeneratorExit); +#endif + retval = __Pyx_Generator_SendEx(gen, NULL); + if (retval) { + Py_DECREF(retval); + PyErr_SetString(PyExc_RuntimeError, + "generator ignored GeneratorExit"); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (!raised_exception + || raised_exception == PyExc_StopIteration +#if PY_VERSION_HEX >= 0x02050000 + || raised_exception == PyExc_GeneratorExit + || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) +#endif + || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) + { + if (raised_exception) PyErr_Clear(); /* ignore these errors */ + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *typ; + PyObject *tb = NULL; + PyObject *val = NULL; + PyObject *yf = gen->yieldfrom; + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) + return NULL; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + Py_INCREF(yf); +#if PY_VERSION_HEX >= 0x02050000 + if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { + int err = __Pyx_Generator_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Generator_Undelegate(gen); + if (err < 0) + return __Pyx_Generator_SendEx(gen, NULL); + goto throw_here; + } +#endif + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Throw(yf, args); + } else { + PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Generator_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + ret = PyObject_CallObject(meth, args); + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Generator_FinishDelegation(gen); + } + return ret; + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Generator_SendEx(gen, NULL); +} +static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + Py_VISIT(gen->exc_type); + Py_VISIT(gen->exc_value); + Py_VISIT(gen->exc_traceback); + return 0; +} +static int __Pyx_Generator_clear(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + Py_CLEAR(gen->exc_type); + Py_CLEAR(gen->exc_value); + Py_CLEAR(gen->exc_traceback); + return 0; +} +static void __Pyx_Generator_dealloc(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label > 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 + if (PyObject_CallFinalizerFromDealloc(self)) +#else + Py_TYPE(gen)->tp_del(self); + if (self->ob_refcnt > 0) +#endif + return; /* resurrected. :( */ + PyObject_GC_UnTrack(self); + } + __Pyx_Generator_clear(self); + PyObject_GC_Del(gen); +} +static void __Pyx_Generator_del(PyObject *self) { + PyObject *res; + PyObject *error_type, *error_value, *error_traceback; + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + if (gen->resume_label <= 0) + return ; +#if PY_VERSION_HEX < 0x030400a1 + assert(self->ob_refcnt == 0); + self->ob_refcnt = 1; +#endif + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); + res = __Pyx_Generator_Close(self); + if (res == NULL) + PyErr_WriteUnraisable(self); + else + Py_DECREF(res); + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if PY_VERSION_HEX < 0x030400a1 + /* Undo the temporary resurrection; can't use DECREF here, it would + * cause a recursive call. + */ + assert(self->ob_refcnt > 0); + if (--self->ob_refcnt == 0) + return; /* this is the normal path out */ + /* close() resurrected it! Make it look like the original Py_DECREF + * never happened. + */ + { + Py_ssize_t refcnt = self->ob_refcnt; + _Py_NewReference(self); + self->ob_refcnt = refcnt; + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(self->ob_type) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so + * we need to undo that. */ + _Py_DEC_REFTOTAL; +#endif + /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object + * chain, so no more to do there. + * If COUNT_ALLOCS, the original decref bumped tp_frees, and + * _Py_NewReference bumped tp_allocs: both of those need to be + * undone. + */ +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", +#if PY_VERSION_HEX >= 0x02060000 + T_BOOL, +#else + T_BYTE, +#endif + offsetof(__pyx_GeneratorObject, is_running), + READONLY, + NULL}, + {0, 0, 0, 0, 0} +}; +static PyMethodDef __pyx_Generator_methods[] = { + {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0}, + {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0}, + {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("generator"), /*tp_name*/ + sizeof(__pyx_GeneratorObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_Generator_traverse, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/ + __pyx_Generator_methods, /*tp_methods*/ + __pyx_Generator_memberlist, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_del*/ +#else + __Pyx_Generator_del, /*tp_del*/ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + __Pyx_Generator_del, /*tp_finalize*/ +#endif +}; +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure) { + __pyx_GeneratorObject *gen = + PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type); + if (gen == NULL) + return NULL; + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + gen->exc_type = NULL; + gen->exc_value = NULL; + gen->exc_traceback = NULL; + gen->gi_weakreflist = NULL; + PyObject_GC_Track(gen); + return gen; +} +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (__pyx_GeneratorType == NULL) { + return -1; + } + return 0; +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3 && PY_MINOR_VERSION==0) + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/pandas/msgpack.cpp b/cythonized-files3/pandas/msgpack.cpp new file mode 100644 index 00000000..fa7d4e72 --- /dev/null +++ b/cythonized-files3/pandas/msgpack.cpp @@ -0,0 +1,14209 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__msgpack +#define __PYX_HAVE_API__pandas__msgpack +#include "string.h" +#include "stdio.h" +#include "pythread.h" +#include "stdlib.h" +#include "limits.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "msgpack/unpack.h" +#include "msgpack/pack.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "msgpack.pyx", + "numpy.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_7msgpack_Packer; +struct __pyx_obj_6pandas_7msgpack_Unpacker; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack; +struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack; + +/* "pandas/msgpack.pyx":163 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<< + * cdef long long llval + * cdef unsigned long long ullval + */ +struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack { + int __pyx_n; + int nest_limit; +}; + +/* "pandas/msgpack.pyx":585 + * self.file_like = None + * + * cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<< + * cdef int ret + * cdef object obj + */ +struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack { + int __pyx_n; + int iter; +}; + +/* "pandas/msgpack.pyx":99 + * + * + * cdef class Packer(object): # <<<<<<<<<<<<<< + * """MessagePack Packer + * + */ +struct __pyx_obj_6pandas_7msgpack_Packer { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_7msgpack_Packer *__pyx_vtab; + struct msgpack_packer pk; + PyObject *_default; + PyObject *_bencoding; + PyObject *_berrors; + char *encoding; + char *unicode_errors; + PyBoolObject *use_float; + int autoreset; +}; + + +/* "pandas/msgpack.pyx":421 + * + * + * cdef class Unpacker(object): # <<<<<<<<<<<<<< + * """ + * Streaming unpacker. + */ +struct __pyx_obj_6pandas_7msgpack_Unpacker { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *__pyx_vtab; + template_context ctx; + char *buf; + size_t buf_size; + size_t buf_head; + size_t buf_tail; + PyObject *file_like; + PyObject *file_like_read; + Py_ssize_t read_size; + PyObject *object_hook; + PyObject *encoding; + PyObject *unicode_errors; + size_t max_buffer_size; +}; + + + +/* "pandas/msgpack.pyx":99 + * + * + * cdef class Packer(object): # <<<<<<<<<<<<<< + * """MessagePack Packer + * + */ + +struct __pyx_vtabstruct_6pandas_7msgpack_Packer { + int (*_pack)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack *__pyx_optional_args); + PyObject *(*pack)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*pack_pair)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, PyObject *, int); +}; +static struct __pyx_vtabstruct_6pandas_7msgpack_Packer *__pyx_vtabptr_6pandas_7msgpack_Packer; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_6Packer_pack_pair(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, PyObject *, int); + + +/* "pandas/msgpack.pyx":421 + * + * + * cdef class Unpacker(object): # <<<<<<<<<<<<<< + * """ + * Streaming unpacker. + */ + +struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker { + PyObject *(*append_buffer)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, void *, Py_ssize_t); + PyObject *(*read_from_file)(struct __pyx_obj_6pandas_7msgpack_Unpacker *); + PyObject *(*_unpack)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, execute_fn, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *__pyx_vtabptr_6pandas_7msgpack_Unpacker; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +#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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, + int is_tuple, int has_known_size, int decref_tuple); + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_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 { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +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(void); + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *); + +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'libc.limits' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'pandas.msgpack' */ +static PyTypeObject *__pyx_ptype_6pandas_7msgpack_Packer = 0; +static PyTypeObject *__pyx_ptype_6pandas_7msgpack_Unpacker = 0; +static int __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_init_ctx(template_context *, PyObject *, PyObject *, PyObject *, int, char *, char *); /*proto*/ +#define __Pyx_MODULE_NAME "pandas.msgpack" +int __pyx_module_is_main_pandas__msgpack = 0; + +/* Implementation of 'pandas.msgpack' */ +static PyObject *__pyx_builtin_IOError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_StopIteration; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unpacked, PyObject *__pyx_v_extra); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData_2__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7msgpack_6Packer___cinit__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7msgpack_6Packer_2__init__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float, int __pyx_v_autoreset); /* proto */ +static void __pyx_pf_6pandas_7msgpack_6Packer_4__dealloc__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_6pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_8pack_array_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_10pack_map_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_12pack_map_pairs(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_14reset(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_16bytes(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_pack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_stream, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_2packb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_4unpackb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_packed, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_6unpack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook); /* proto */ +static int __pyx_pf_6pandas_7msgpack_8Unpacker___cinit__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self); /* proto */ +static void __pyx_pf_6pandas_7msgpack_8Unpacker_2__dealloc__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7msgpack_8Unpacker_4__init__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_file_like, Py_ssize_t __pyx_v_read_size, int __pyx_v_use_list, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, int __pyx_v_max_buffer_size); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_6feed(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_next_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_8read_bytes(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_10unpack(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_12skip(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_14read_array_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_16read_map_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_18__iter__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_20__next__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_7msgpack_Packer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7msgpack_Unpacker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_o[] = "o"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_buf[] = "buf"; +static char __pyx_k_ctx[] = "ctx"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_off[] = "off"; +static char __pyx_k_ret[] = "ret"; +static char __pyx_k_str[] = "__str__"; +static char __pyx_k_cenc[] = "cenc"; +static char __pyx_k_cerr[] = "cerr"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_pack[] = "pack"; +static char __pyx_k_read[] = "read"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_ascii[] = "ascii"; +static char __pyx_k_extra[] = "extra"; +static char __pyx_k_items[] = "items"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_packb[] = "packb"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_utf_8[] = "utf-8"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_encode[] = "encode"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_packed[] = "packed"; +static char __pyx_k_packer[] = "packer"; +static char __pyx_k_stream[] = "stream"; +static char __pyx_k_strict[] = "strict"; +static char __pyx_k_unpack[] = "unpack"; +static char __pyx_k_IOError[] = "IOError"; +static char __pyx_k_buf_len[] = "buf_len"; +static char __pyx_k_default[] = "default"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_unpackb[] = "unpackb"; +static char __pyx_k_encoding[] = "encoding"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_unpacked[] = "unpacked"; +static char __pyx_k_use_list[] = "use_list"; +static char __pyx_k_ExtraData[] = "ExtraData"; +static char __pyx_k_OutOfData[] = "OutOfData"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_autoreset[] = "autoreset"; +static char __pyx_k_file_like[] = "file_like"; +static char __pyx_k_iteritems[] = "iteritems"; +static char __pyx_k_list_hook[] = "list_hook"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_read_size[] = "read_size"; +static char __pyx_k_BufferFull[] = "BufferFull"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MemoryError[] = "MemoryError"; +static char __pyx_k_object_hook[] = "object_hook"; +static char __pyx_k_write_bytes[] = "write_bytes"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_PackException[] = "PackException"; +static char __pyx_k_StopIteration[] = "StopIteration"; +static char __pyx_k_cannot_pack_s[] = "cannot pack : %s"; +static char __pyx_k_PackValueError[] = "PackValueError"; +static char __pyx_k_pandas_msgpack[] = "pandas.msgpack"; +static char __pyx_k_unicode_errors[] = "unicode_errors"; +static char __pyx_k_ExtraData___str[] = "ExtraData.__str__"; +static char __pyx_k_UnpackException[] = "UnpackException"; +static char __pyx_k_max_buffer_size[] = "max_buffer_size"; +static char __pyx_k_ExtraData___init[] = "ExtraData.__init__"; +static char __pyx_k_UnpackValueError[] = "UnpackValueError"; +static char __pyx_k_use_single_float[] = "use_single_float"; +static char __pyx_k_can_t_serialize_r[] = "can't serialize %r"; +static char __pyx_k_object_pairs_hook[] = "object_pairs_hook"; +static char __pyx_k_Unpack_failed_error_d[] = "Unpack failed: error = %d"; +static char __pyx_k_No_more_data_to_unpack[] = "No more data to unpack."; +static char __pyx_k_recursion_limit_exceeded[] = "recursion limit exceeded."; +static char __pyx_k_default_must_be_a_callable[] = "default must be a callable."; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_list_hook_must_be_a_callable[] = "list_hook must be a callable."; +static char __pyx_k_unpack_b_recieved_extra_data[] = "unpack(b) recieved extra data."; +static char __pyx_k_object_hook_must_be_a_callable[] = "object_hook must be a callable."; +static char __pyx_k_file_like_read_must_be_a_callab[] = "`file_like.read` must be a callable."; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/msgpack.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_unpacker_feed_is_not_be_able_to[] = "unpacker.feed() is not be able to use with `file_like`."; +static char __pyx_k_Can_t_encode_unicode_string_no_e[] = "Can't encode unicode string: no encoding is specified"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_Unable_to_allocate_internal_buff[] = "Unable to allocate internal buffer."; +static char __pyx_k_Unable_to_enlarge_internal_buffe[] = "Unable to enlarge internal buffer."; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_object_pairs_hook_and_object_hoo[] = "object_pairs_hook and object_hook are mutually exclusive."; +static char __pyx_k_object_pairs_hook_must_be_a_call[] = "object_pairs_hook must be a callable."; +static char __pyx_k_read_size_should_be_less_or_equa[] = "read_size should be less or equal to max_buffer_size"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_BufferFull; +static PyObject *__pyx_kp_s_Can_t_encode_unicode_string_no_e; +static PyObject *__pyx_n_s_ExtraData; +static PyObject *__pyx_n_s_ExtraData___init; +static PyObject *__pyx_n_s_ExtraData___str; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_IOError; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_No_more_data_to_unpack; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_OutOfData; +static PyObject *__pyx_n_s_PackException; +static PyObject *__pyx_n_s_PackValueError; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_allocate_internal_buff; +static PyObject *__pyx_kp_s_Unable_to_enlarge_internal_buffe; +static PyObject *__pyx_n_s_UnpackException; +static PyObject *__pyx_n_s_UnpackValueError; +static PyObject *__pyx_kp_s_Unpack_failed_error_d; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_ascii; +static PyObject *__pyx_n_s_autoreset; +static PyObject *__pyx_n_s_buf; +static PyObject *__pyx_n_s_buf_len; +static PyObject *__pyx_kp_s_can_t_serialize_r; +static PyObject *__pyx_kp_s_cannot_pack_s; +static PyObject *__pyx_n_s_cenc; +static PyObject *__pyx_n_s_cerr; +static PyObject *__pyx_n_s_ctx; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_kp_s_default_must_be_a_callable; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_encoding; +static PyObject *__pyx_n_s_extra; +static PyObject *__pyx_n_s_file_like; +static PyObject *__pyx_kp_s_file_like_read_must_be_a_callab; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_iteritems; +static PyObject *__pyx_n_s_list_hook; +static PyObject *__pyx_kp_s_list_hook_must_be_a_callable; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_max_buffer_size; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_o; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object_hook; +static PyObject *__pyx_kp_s_object_hook_must_be_a_callable; +static PyObject *__pyx_n_s_object_pairs_hook; +static PyObject *__pyx_kp_s_object_pairs_hook_and_object_hoo; +static PyObject *__pyx_kp_s_object_pairs_hook_must_be_a_call; +static PyObject *__pyx_n_s_off; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_packb; +static PyObject *__pyx_n_s_packed; +static PyObject *__pyx_n_s_packer; +static PyObject *__pyx_n_s_pandas_msgpack; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_read; +static PyObject *__pyx_n_s_read_size; +static PyObject *__pyx_kp_s_read_size_should_be_less_or_equa; +static PyObject *__pyx_kp_s_recursion_limit_exceeded; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_n_s_stream; +static PyObject *__pyx_n_s_strict; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_unicode_errors; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_kp_s_unpack_b_recieved_extra_data; +static PyObject *__pyx_n_s_unpackb; +static PyObject *__pyx_n_s_unpacked; +static PyObject *__pyx_kp_s_unpacker_feed_is_not_be_able_to; +static PyObject *__pyx_n_s_use_list; +static PyObject *__pyx_n_s_use_single_float; +static PyObject *__pyx_kp_s_utf_8; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_write_bytes; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_15; +static int __pyx_k__5; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; + +/* "pandas/msgpack.pyx":37 + * + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): # <<<<<<<<<<<<<< + * self.unpacked = unpacked + * self.extra = extra + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_9ExtraData___init__[] = "ExtraData.__init__(self, unpacked, extra)"; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_9ExtraData_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_9ExtraData___init__)}; +static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_unpacked = 0; + PyObject *__pyx_v_extra = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unpacked,&__pyx_n_s_extra,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unpacked)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extra)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_unpacked = values[1]; + __pyx_v_extra = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.ExtraData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_9ExtraData___init__(__pyx_self, __pyx_v_self, __pyx_v_unpacked, __pyx_v_extra); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unpacked, PyObject *__pyx_v_extra) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/msgpack.pyx":38 + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): + * self.unpacked = unpacked # <<<<<<<<<<<<<< + * self.extra = extra + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_unpacked, __pyx_v_unpacked) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":39 + * def __init__(self, unpacked, extra): + * self.unpacked = unpacked + * self.extra = extra # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extra, __pyx_v_extra) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":37 + * + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): # <<<<<<<<<<<<<< + * self.unpacked = unpacked + * self.extra = extra + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.msgpack.ExtraData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":41 + * self.extra = extra + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "unpack(b) recieved extra data." + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_9ExtraData_2__str__[] = "ExtraData.__str__(self)"; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_9ExtraData_3__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_9ExtraData_2__str__)}; +static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_9ExtraData_2__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData_2__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__", 0); + + /* "pandas/msgpack.pyx":42 + * + * def __str__(self): + * return "unpack(b) recieved extra data." # <<<<<<<<<<<<<< + * + * class PackException(IOError): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_unpack_b_recieved_extra_data); + __pyx_r = __pyx_kp_s_unpack_b_recieved_extra_data; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":41 + * self.extra = extra + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "unpack(b) recieved extra data." + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":127 + * cdef bint autoreset + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * cdef int buf_size = 1024*1024 + * self.pk.buf = malloc(buf_size); + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7msgpack_6Packer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7msgpack_6Packer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer___cinit__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7msgpack_6Packer___cinit__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { + int __pyx_v_buf_size; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/msgpack.pyx":128 + * + * def __cinit__(self): + * cdef int buf_size = 1024*1024 # <<<<<<<<<<<<<< + * self.pk.buf = malloc(buf_size); + * if self.pk.buf == NULL: + */ + __pyx_v_buf_size = 1048576; + + /* "pandas/msgpack.pyx":129 + * def __cinit__(self): + * cdef int buf_size = 1024*1024 + * self.pk.buf = malloc(buf_size); # <<<<<<<<<<<<<< + * if self.pk.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") + */ + __pyx_v_self->pk.buf = ((char *)malloc(__pyx_v_buf_size)); + + /* "pandas/msgpack.pyx":130 + * cdef int buf_size = 1024*1024 + * self.pk.buf = malloc(buf_size); + * if self.pk.buf == NULL: # <<<<<<<<<<<<<< + * raise MemoryError("Unable to allocate internal buffer.") + * self.pk.buf_size = buf_size + */ + __pyx_t_1 = ((__pyx_v_self->pk.buf == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":131 + * self.pk.buf = malloc(buf_size); + * if self.pk.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<< + * self.pk.buf_size = buf_size + * self.pk.length = 0 + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":132 + * if self.pk.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") + * self.pk.buf_size = buf_size # <<<<<<<<<<<<<< + * self.pk.length = 0 + * + */ + __pyx_v_self->pk.buf_size = __pyx_v_buf_size; + + /* "pandas/msgpack.pyx":133 + * raise MemoryError("Unable to allocate internal buffer.") + * self.pk.buf_size = buf_size + * self.pk.length = 0 # <<<<<<<<<<<<<< + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":127 + * cdef bint autoreset + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * cdef int buf_size = 1024*1024 + * self.pk.buf = malloc(buf_size); + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.msgpack.Packer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":135 + * self.pk.length = 0 + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<< + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7msgpack_6Packer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7msgpack_6Packer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_default = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + PyObject *__pyx_v_use_single_float = 0; + int __pyx_v_autoreset; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_use_single_float,&__pyx_n_s_autoreset,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_kp_s_utf_8); + values[2] = ((PyObject *)__pyx_n_s_strict); + + /* "pandas/msgpack.pyx":136 + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', + * use_single_float=False, bint autoreset=1): # <<<<<<<<<<<<<< + * self.use_float = use_single_float + * self.autoreset = autoreset + */ + values[3] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_single_float); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_autoreset); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_default = values[0]; + __pyx_v_encoding = values[1]; + __pyx_v_unicode_errors = values[2]; + __pyx_v_use_single_float = values[3]; + if (values[4]) { + __pyx_v_autoreset = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_autoreset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_autoreset = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Packer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_2__init__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_use_single_float, __pyx_v_autoreset); + + /* "pandas/msgpack.pyx":135 + * self.pk.length = 0 + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<< + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7msgpack_6Packer_2__init__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float, int __pyx_v_autoreset) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + char *__pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/msgpack.pyx":137 + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float # <<<<<<<<<<<<<< + * self.autoreset = autoreset + * if default is not None: + */ + if (!(likely(((__pyx_v_use_single_float) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_use_single_float, __pyx_ptype_7cpython_4bool_bool))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_use_single_float; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->use_float); + __Pyx_DECREF(((PyObject *)__pyx_v_self->use_float)); + __pyx_v_self->use_float = ((PyBoolObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":138 + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float + * self.autoreset = autoreset # <<<<<<<<<<<<<< + * if default is not None: + * if not PyCallable_Check(default): + */ + __pyx_v_self->autoreset = __pyx_v_autoreset; + + /* "pandas/msgpack.pyx":139 + * self.use_float = use_single_float + * self.autoreset = autoreset + * if default is not None: # <<<<<<<<<<<<<< + * if not PyCallable_Check(default): + * raise TypeError("default must be a callable.") + */ + __pyx_t_2 = (__pyx_v_default != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":140 + * self.autoreset = autoreset + * if default is not None: + * if not PyCallable_Check(default): # <<<<<<<<<<<<<< + * raise TypeError("default must be a callable.") + * self._default = default + */ + __pyx_t_3 = ((!(PyCallable_Check(__pyx_v_default) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":141 + * if default is not None: + * if not PyCallable_Check(default): + * raise TypeError("default must be a callable.") # <<<<<<<<<<<<<< + * self._default = default + * if encoding is None: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":142 + * if not PyCallable_Check(default): + * raise TypeError("default must be a callable.") + * self._default = default # <<<<<<<<<<<<<< + * if encoding is None: + * self.encoding = NULL + */ + __Pyx_INCREF(__pyx_v_default); + __Pyx_GIVEREF(__pyx_v_default); + __Pyx_GOTREF(__pyx_v_self->_default); + __Pyx_DECREF(__pyx_v_self->_default); + __pyx_v_self->_default = __pyx_v_default; + + /* "pandas/msgpack.pyx":143 + * raise TypeError("default must be a callable.") + * self._default = default + * if encoding is None: # <<<<<<<<<<<<<< + * self.encoding = NULL + * self.unicode_errors = NULL + */ + __pyx_t_3 = (__pyx_v_encoding == Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":144 + * self._default = default + * if encoding is None: + * self.encoding = NULL # <<<<<<<<<<<<<< + * self.unicode_errors = NULL + * else: + */ + __pyx_v_self->encoding = NULL; + + /* "pandas/msgpack.pyx":145 + * if encoding is None: + * self.encoding = NULL + * self.unicode_errors = NULL # <<<<<<<<<<<<<< + * else: + * if isinstance(encoding, unicode): + */ + __pyx_v_self->unicode_errors = NULL; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/msgpack.pyx":147 + * self.unicode_errors = NULL + * else: + * if isinstance(encoding, unicode): # <<<<<<<<<<<<<< + * self._bencoding = encoding.encode('ascii') + * else: + */ + __pyx_t_2 = PyUnicode_Check(__pyx_v_encoding); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":148 + * else: + * if isinstance(encoding, unicode): + * self._bencoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * else: + * self._bencoding = encoding + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_bencoding); + __Pyx_DECREF(__pyx_v_self->_bencoding); + __pyx_v_self->_bencoding = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/msgpack.pyx":150 + * self._bencoding = encoding.encode('ascii') + * else: + * self._bencoding = encoding # <<<<<<<<<<<<<< + * self.encoding = PyBytes_AsString(self._bencoding) + * if isinstance(unicode_errors, unicode): + */ + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_GIVEREF(__pyx_v_encoding); + __Pyx_GOTREF(__pyx_v_self->_bencoding); + __Pyx_DECREF(__pyx_v_self->_bencoding); + __pyx_v_self->_bencoding = __pyx_v_encoding; + } + __pyx_L6:; + + /* "pandas/msgpack.pyx":151 + * else: + * self._bencoding = encoding + * self.encoding = PyBytes_AsString(self._bencoding) # <<<<<<<<<<<<<< + * if isinstance(unicode_errors, unicode): + * self._berrors = unicode_errors.encode('ascii') + */ + __pyx_t_4 = __pyx_v_self->_bencoding; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = PyBytes_AsString(__pyx_t_4); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_self->encoding = __pyx_t_5; + + /* "pandas/msgpack.pyx":152 + * self._bencoding = encoding + * self.encoding = PyBytes_AsString(self._bencoding) + * if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<< + * self._berrors = unicode_errors.encode('ascii') + * else: + */ + __pyx_t_3 = PyUnicode_Check(__pyx_v_unicode_errors); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":153 + * self.encoding = PyBytes_AsString(self._bencoding) + * if isinstance(unicode_errors, unicode): + * self._berrors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * else: + * self._berrors = unicode_errors + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_berrors); + __Pyx_DECREF(__pyx_v_self->_berrors); + __pyx_v_self->_berrors = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/msgpack.pyx":155 + * self._berrors = unicode_errors.encode('ascii') + * else: + * self._berrors = unicode_errors # <<<<<<<<<<<<<< + * self.unicode_errors = PyBytes_AsString(self._berrors) + * + */ + __Pyx_INCREF(__pyx_v_unicode_errors); + __Pyx_GIVEREF(__pyx_v_unicode_errors); + __Pyx_GOTREF(__pyx_v_self->_berrors); + __Pyx_DECREF(__pyx_v_self->_berrors); + __pyx_v_self->_berrors = __pyx_v_unicode_errors; + } + __pyx_L7:; + + /* "pandas/msgpack.pyx":156 + * else: + * self._berrors = unicode_errors + * self.unicode_errors = PyBytes_AsString(self._berrors) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_1 = __pyx_v_self->_berrors; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = PyBytes_AsString(__pyx_t_1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->unicode_errors = __pyx_t_5; + } + __pyx_L5:; + + /* "pandas/msgpack.pyx":135 + * self.pk.length = 0 + * + * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<< + * use_single_float=False, bint autoreset=1): + * self.use_float = use_single_float + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.msgpack.Packer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":158 + * self.unicode_errors = PyBytes_AsString(self._berrors) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.pk.buf); + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_7msgpack_6Packer_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_7msgpack_6Packer_5__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_7msgpack_6Packer_4__dealloc__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_7msgpack_6Packer_4__dealloc__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/msgpack.pyx":159 + * + * def __dealloc__(self): + * free(self.pk.buf); # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + free(__pyx_v_self->pk.buf); + + /* "pandas/msgpack.pyx":158 + * self.unicode_errors = PyBytes_AsString(self._berrors) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.pk.buf); + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/msgpack.pyx":163 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<< + * cdef long long llval + * cdef unsigned long long ullval + */ + +static int __pyx_f_6pandas_7msgpack_6Packer__pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_o, struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack *__pyx_optional_args) { + int __pyx_v_nest_limit = __pyx_k__5; + PY_LONG_LONG __pyx_v_llval; + unsigned PY_LONG_LONG __pyx_v_ullval; + long __pyx_v_longval; + float __pyx_v_fval; + double __pyx_v_dval; + char *__pyx_v_rawval; + int __pyx_v_ret; + PyObject *__pyx_v_d = 0; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + unsigned PY_LONG_LONG __pyx_t_5; + PY_LONG_LONG __pyx_t_6; + long __pyx_t_7; + float __pyx_t_8; + double __pyx_t_9; + char *__pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack __pyx_t_16; + PyObject *(*__pyx_t_17)(PyObject *); + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *(*__pyx_t_20)(PyObject *); + int __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pack", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_nest_limit = __pyx_optional_args->nest_limit; + } + } + __Pyx_INCREF(__pyx_v_o); + + /* "pandas/msgpack.pyx":176 + * cdef int n,i + * + * if nest_limit < 0: # <<<<<<<<<<<<<< + * raise PackValueError("recursion limit exceeded.") + * + */ + __pyx_t_1 = ((__pyx_v_nest_limit < 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":177 + * + * if nest_limit < 0: + * raise PackValueError("recursion limit exceeded.") # <<<<<<<<<<<<<< + * + * if o is None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackValueError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":179 + * raise PackValueError("recursion limit exceeded.") + * + * if o is None: # <<<<<<<<<<<<<< + * ret = msgpack_pack_nil(&self.pk) + * elif isinstance(o, bool): + */ + __pyx_t_1 = (__pyx_v_o == Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "pandas/msgpack.pyx":180 + * + * if o is None: + * ret = msgpack_pack_nil(&self.pk) # <<<<<<<<<<<<<< + * elif isinstance(o, bool): + * if o: + */ + __pyx_v_ret = msgpack_pack_nil((&__pyx_v_self->pk)); + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":181 + * if o is None: + * ret = msgpack_pack_nil(&self.pk) + * elif isinstance(o, bool): # <<<<<<<<<<<<<< + * if o: + * ret = msgpack_pack_true(&self.pk) + */ + __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject*)__pyx_ptype_7cpython_4bool_bool)); + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":182 + * ret = msgpack_pack_nil(&self.pk) + * elif isinstance(o, bool): + * if o: # <<<<<<<<<<<<<< + * ret = msgpack_pack_true(&self.pk) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_o); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":183 + * elif isinstance(o, bool): + * if o: + * ret = msgpack_pack_true(&self.pk) # <<<<<<<<<<<<<< + * else: + * ret = msgpack_pack_false(&self.pk) + */ + __pyx_v_ret = msgpack_pack_true((&__pyx_v_self->pk)); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/msgpack.pyx":185 + * ret = msgpack_pack_true(&self.pk) + * else: + * ret = msgpack_pack_false(&self.pk) # <<<<<<<<<<<<<< + * elif PyLong_Check(o): + * if o > 0: + */ + __pyx_v_ret = msgpack_pack_false((&__pyx_v_self->pk)); + } + __pyx_L5:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":186 + * else: + * ret = msgpack_pack_false(&self.pk) + * elif PyLong_Check(o): # <<<<<<<<<<<<<< + * if o > 0: + * ullval = o + */ + __pyx_t_1 = (PyLong_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":187 + * ret = msgpack_pack_false(&self.pk) + * elif PyLong_Check(o): + * if o > 0: # <<<<<<<<<<<<<< + * ullval = o + * ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) + */ + __pyx_t_3 = PyObject_RichCompare(__pyx_v_o, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":188 + * elif PyLong_Check(o): + * if o > 0: + * ullval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) + * else: + */ + __pyx_t_5 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_o); if (unlikely((__pyx_t_5 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ullval = __pyx_t_5; + + /* "pandas/msgpack.pyx":189 + * if o > 0: + * ullval = o + * ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) # <<<<<<<<<<<<<< + * else: + * llval = o + */ + __pyx_v_ret = msgpack_pack_unsigned_long_long((&__pyx_v_self->pk), __pyx_v_ullval); + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/msgpack.pyx":191 + * ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) + * else: + * llval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_long_long(&self.pk, llval) + * elif PyInt_Check(o): + */ + __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_o); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_llval = __pyx_t_6; + + /* "pandas/msgpack.pyx":192 + * else: + * llval = o + * ret = msgpack_pack_long_long(&self.pk, llval) # <<<<<<<<<<<<<< + * elif PyInt_Check(o): + * longval = o + */ + __pyx_v_ret = msgpack_pack_long_long((&__pyx_v_self->pk), __pyx_v_llval); + } + __pyx_L6:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":193 + * llval = o + * ret = msgpack_pack_long_long(&self.pk, llval) + * elif PyInt_Check(o): # <<<<<<<<<<<<<< + * longval = o + * ret = msgpack_pack_long(&self.pk, longval) + */ + __pyx_t_1 = (PyInt_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":194 + * ret = msgpack_pack_long_long(&self.pk, llval) + * elif PyInt_Check(o): + * longval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_long(&self.pk, longval) + * elif PyFloat_Check(o): + */ + __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_v_o); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_longval = __pyx_t_7; + + /* "pandas/msgpack.pyx":195 + * elif PyInt_Check(o): + * longval = o + * ret = msgpack_pack_long(&self.pk, longval) # <<<<<<<<<<<<<< + * elif PyFloat_Check(o): + * if self.use_float: + */ + __pyx_v_ret = msgpack_pack_long((&__pyx_v_self->pk), __pyx_v_longval); + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":196 + * longval = o + * ret = msgpack_pack_long(&self.pk, longval) + * elif PyFloat_Check(o): # <<<<<<<<<<<<<< + * if self.use_float: + * fval = o + */ + __pyx_t_1 = (PyFloat_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":197 + * ret = msgpack_pack_long(&self.pk, longval) + * elif PyFloat_Check(o): + * if self.use_float: # <<<<<<<<<<<<<< + * fval = o + * ret = msgpack_pack_float(&self.pk, fval) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->use_float)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":198 + * elif PyFloat_Check(o): + * if self.use_float: + * fval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_float(&self.pk, fval) + * else: + */ + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_o); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fval = __pyx_t_8; + + /* "pandas/msgpack.pyx":199 + * if self.use_float: + * fval = o + * ret = msgpack_pack_float(&self.pk, fval) # <<<<<<<<<<<<<< + * else: + * dval = o + */ + __pyx_v_ret = msgpack_pack_float((&__pyx_v_self->pk), __pyx_v_fval); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/msgpack.pyx":201 + * ret = msgpack_pack_float(&self.pk, fval) + * else: + * dval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_double(&self.pk, dval) + * elif PyBytes_Check(o): + */ + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_o); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dval = __pyx_t_9; + + /* "pandas/msgpack.pyx":202 + * else: + * dval = o + * ret = msgpack_pack_double(&self.pk, dval) # <<<<<<<<<<<<<< + * elif PyBytes_Check(o): + * rawval = o + */ + __pyx_v_ret = msgpack_pack_double((&__pyx_v_self->pk), __pyx_v_dval); + } + __pyx_L7:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":203 + * dval = o + * ret = msgpack_pack_double(&self.pk, dval) + * elif PyBytes_Check(o): # <<<<<<<<<<<<<< + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) + */ + __pyx_t_1 = (PyBytes_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":204 + * ret = msgpack_pack_double(&self.pk, dval) + * elif PyBytes_Check(o): + * rawval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: + */ + __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_o); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_rawval = __pyx_t_10; + + /* "pandas/msgpack.pyx":205 + * elif PyBytes_Check(o): + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) # <<<<<<<<<<<<<< + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + */ + __pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_raw((&__pyx_v_self->pk), __pyx_t_11); + + /* "pandas/msgpack.pyx":206 + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: # <<<<<<<<<<<<<< + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyUnicode_Check(o): + */ + __pyx_t_1 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":207 + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) # <<<<<<<<<<<<<< + * elif PyUnicode_Check(o): + * if not self.encoding: + */ + __pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_raw_body((&__pyx_v_self->pk), __pyx_v_rawval, __pyx_t_11); + goto __pyx_L8; + } + __pyx_L8:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":208 + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyUnicode_Check(o): # <<<<<<<<<<<<<< + * if not self.encoding: + * raise TypeError("Can't encode unicode string: no encoding is specified") + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":209 + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyUnicode_Check(o): + * if not self.encoding: # <<<<<<<<<<<<<< + * raise TypeError("Can't encode unicode string: no encoding is specified") + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + */ + __pyx_t_1 = ((!(__pyx_v_self->encoding != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":210 + * elif PyUnicode_Check(o): + * if not self.encoding: + * raise TypeError("Can't encode unicode string: no encoding is specified") # <<<<<<<<<<<<<< + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + * rawval = o + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":211 + * if not self.encoding: + * raise TypeError("Can't encode unicode string: no encoding is specified") + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) # <<<<<<<<<<<<<< + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) + */ + __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_o, __pyx_v_self->encoding, __pyx_v_self->unicode_errors); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_o, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/msgpack.pyx":212 + * raise TypeError("Can't encode unicode string: no encoding is specified") + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + * rawval = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: + */ + __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_o); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_rawval = __pyx_t_10; + + /* "pandas/msgpack.pyx":213 + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) # <<<<<<<<<<<<<< + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + */ + __pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_raw((&__pyx_v_self->pk), __pyx_t_11); + + /* "pandas/msgpack.pyx":214 + * rawval = o + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: # <<<<<<<<<<<<<< + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyDict_CheckExact(o): + */ + __pyx_t_1 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":215 + * ret = msgpack_pack_raw(&self.pk, len(o)) + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) # <<<<<<<<<<<<<< + * elif PyDict_CheckExact(o): + * d = o + */ + __pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_raw_body((&__pyx_v_self->pk), __pyx_v_rawval, __pyx_t_11); + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":216 + * if ret == 0: + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyDict_CheckExact(o): # <<<<<<<<<<<<<< + * d = o + * ret = msgpack_pack_map(&self.pk, len(d)) + */ + __pyx_t_1 = (PyDict_CheckExact(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":217 + * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) + * elif PyDict_CheckExact(o): + * d = o # <<<<<<<<<<<<<< + * ret = msgpack_pack_map(&self.pk, len(d)) + * if ret == 0: + */ + __pyx_t_3 = __pyx_v_o; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_d = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/msgpack.pyx":218 + * elif PyDict_CheckExact(o): + * d = o + * ret = msgpack_pack_map(&self.pk, len(d)) # <<<<<<<<<<<<<< + * if ret == 0: + * for k, v in d.iteritems(): + */ + if (unlikely(__pyx_v_d == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyDict_Size(__pyx_v_d); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_11); + + /* "pandas/msgpack.pyx":219 + * d = o + * ret = msgpack_pack_map(&self.pk, len(d)) + * if ret == 0: # <<<<<<<<<<<<<< + * for k, v in d.iteritems(): + * ret = self._pack(k, nest_limit-1) + */ + __pyx_t_1 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":220 + * ret = msgpack_pack_map(&self.pk, len(d)) + * if ret == 0: + * for k, v in d.iteritems(): # <<<<<<<<<<<<<< + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break + */ + __pyx_t_11 = 0; + if (unlikely(__pyx_v_d == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_d, 1, __pyx_n_s_iteritems, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_2; + __pyx_t_2 = 0; + while (1) { + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_12, &__pyx_t_11, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/msgpack.pyx":221 + * if ret == 0: + * for k, v in d.iteritems(): + * ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_15 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_16); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_15; + + /* "pandas/msgpack.pyx":222 + * for k, v in d.iteritems(): + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + goto __pyx_L13_break; + } + + /* "pandas/msgpack.pyx":223 + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * elif PyDict_Check(o): + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_15 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_15; + + /* "pandas/msgpack.pyx":224 + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * elif PyDict_Check(o): + * ret = msgpack_pack_map(&self.pk, len(o)) + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + goto __pyx_L13_break; + } + } + __pyx_L13_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":225 + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + * elif PyDict_Check(o): # <<<<<<<<<<<<<< + * ret = msgpack_pack_map(&self.pk, len(o)) + * if ret == 0: + */ + __pyx_t_1 = (PyDict_Check(__pyx_v_o) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":226 + * if ret != 0: break + * elif PyDict_Check(o): + * ret = msgpack_pack_map(&self.pk, len(o)) # <<<<<<<<<<<<<< + * if ret == 0: + * for k, v in o.items(): + */ + __pyx_t_12 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_12); + + /* "pandas/msgpack.pyx":227 + * elif PyDict_Check(o): + * ret = msgpack_pack_map(&self.pk, len(o)) + * if ret == 0: # <<<<<<<<<<<<<< + * for k, v in o.items(): + * ret = self._pack(k, nest_limit-1) + */ + __pyx_t_1 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":228 + * ret = msgpack_pack_map(&self.pk, len(o)) + * if ret == 0: + * for k, v in o.items(): # <<<<<<<<<<<<<< + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_14) || PyTuple_CheckExact(__pyx_t_14)) { + __pyx_t_3 = __pyx_t_14; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0; + __pyx_t_17 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + for (;;) { + if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_14 = __pyx_t_17(__pyx_t_3); + if (unlikely(!__pyx_t_14)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_14); + } + if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { + PyObject* sequence = __pyx_t_14; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_18 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_18); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + #endif + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_19 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_2)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_18); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L20_unpacking_done; + __pyx_L19_unpacking_failed:; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L20_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/msgpack.pyx":229 + * if ret == 0: + * for k, v in o.items(): + * ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_13; + + /* "pandas/msgpack.pyx":230 + * for k, v in o.items(): + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + goto __pyx_L18_break; + } + + /* "pandas/msgpack.pyx":231 + * ret = self._pack(k, nest_limit-1) + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * elif PyTuple_Check(o) or PyList_Check(o): + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_13; + + /* "pandas/msgpack.pyx":232 + * if ret != 0: break + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * elif PyTuple_Check(o) or PyList_Check(o): + * ret = msgpack_pack_array(&self.pk, len(o)) + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + goto __pyx_L18_break; + } + } + __pyx_L18_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L16; + } + __pyx_L16:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":233 + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + * elif PyTuple_Check(o) or PyList_Check(o): # <<<<<<<<<<<<<< + * ret = msgpack_pack_array(&self.pk, len(o)) + * if ret == 0: + */ + __pyx_t_1 = (PyTuple_Check(__pyx_v_o) != 0); + if (!__pyx_t_1) { + __pyx_t_4 = (PyList_Check(__pyx_v_o) != 0); + __pyx_t_21 = __pyx_t_4; + } else { + __pyx_t_21 = __pyx_t_1; + } + if (__pyx_t_21) { + + /* "pandas/msgpack.pyx":234 + * if ret != 0: break + * elif PyTuple_Check(o) or PyList_Check(o): + * ret = msgpack_pack_array(&self.pk, len(o)) # <<<<<<<<<<<<<< + * if ret == 0: + * for v in o: + */ + __pyx_t_12 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_array((&__pyx_v_self->pk), __pyx_t_12); + + /* "pandas/msgpack.pyx":235 + * elif PyTuple_Check(o) or PyList_Check(o): + * ret = msgpack_pack_array(&self.pk, len(o)) + * if ret == 0: # <<<<<<<<<<<<<< + * for v in o: + * ret = self._pack(v, nest_limit-1) + */ + __pyx_t_21 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_21) { + + /* "pandas/msgpack.pyx":236 + * ret = msgpack_pack_array(&self.pk, len(o)) + * if ret == 0: + * for v in o: # <<<<<<<<<<<<<< + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break + */ + if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0; + __pyx_t_17 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_14 = __pyx_t_17(__pyx_t_3); + if (unlikely(!__pyx_t_14)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_14); + } + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/msgpack.pyx":237 + * if ret == 0: + * for v in o: + * ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: break + * + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_13; + + /* "pandas/msgpack.pyx":238 + * for v in o: + * ret = self._pack(v, nest_limit-1) + * if ret != 0: break # <<<<<<<<<<<<<< + * + * elif self._default: + */ + __pyx_t_21 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_21) { + goto __pyx_L25_break; + } + } + __pyx_L25_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L23; + } + __pyx_L23:; + goto __pyx_L4; + } + + /* "pandas/msgpack.pyx":240 + * if ret != 0: break + * + * elif self._default: # <<<<<<<<<<<<<< + * o = self._default(o) + * ret = self._pack(o, nest_limit-1) + */ + __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_v_self->_default); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_21) { + + /* "pandas/msgpack.pyx":241 + * + * elif self._default: + * o = self._default(o) # <<<<<<<<<<<<<< + * ret = self._pack(o, nest_limit-1) + * else: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_v_self->_default, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_o, __pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/msgpack.pyx":242 + * elif self._default: + * o = self._default(o) + * ret = self._pack(o, nest_limit-1) # <<<<<<<<<<<<<< + * else: + * raise TypeError("can't serialize %r" % (o,)) + */ + __pyx_t_16.__pyx_n = 1; + __pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_o, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_13; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/msgpack.pyx":244 + * ret = self._pack(o, nest_limit-1) + * else: + * raise TypeError("can't serialize %r" % (o,)) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_can_t_serialize_r, __pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + + /* "pandas/msgpack.pyx":245 + * else: + * raise TypeError("can't serialize %r" % (o,)) + * return ret # <<<<<<<<<<<<<< + * + * cpdef pack(self, object obj): + */ + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":163 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<< + * cdef long long llval + * cdef unsigned long long ullval + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("pandas.msgpack.Packer._pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_o); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":247 + * return ret + * + * cpdef pack(self, object obj): # <<<<<<<<<<<<<< + * cdef int ret + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) + */ + +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ +static PyObject *__pyx_f_6pandas_7msgpack_6Packer_pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) { + int __pyx_v_ret; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_7pack)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/msgpack.pyx":249 + * cpdef pack(self, object obj): + * cdef int ret + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) # <<<<<<<<<<<<<< + * if ret == -1: + * raise MemoryError + */ + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.nest_limit = __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT; + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_obj, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_4; + + /* "pandas/msgpack.pyx":250 + * cdef int ret + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) + * if ret == -1: # <<<<<<<<<<<<<< + * raise MemoryError + * elif ret: # should not happen. + */ + __pyx_t_6 = ((__pyx_v_ret == -1) != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":251 + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) + * if ret == -1: + * raise MemoryError # <<<<<<<<<<<<<< + * elif ret: # should not happen. + * raise TypeError + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":252 + * if ret == -1: + * raise MemoryError + * elif ret: # should not happen. # <<<<<<<<<<<<<< + * raise TypeError + * if self.autoreset: + */ + __pyx_t_6 = (__pyx_v_ret != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":253 + * raise MemoryError + * elif ret: # should not happen. + * raise TypeError # <<<<<<<<<<<<<< + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":254 + * elif ret: # should not happen. + * raise TypeError + * if self.autoreset: # <<<<<<<<<<<<<< + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + */ + __pyx_t_6 = (__pyx_v_self->autoreset != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":255 + * raise TypeError + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * self.pk.length = 0 + * return buf + */ + __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_buf = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":256 + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 # <<<<<<<<<<<<<< + * return buf + * + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":257 + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + * return buf # <<<<<<<<<<<<<< + * + * def pack_array_header(self, size_t size): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_buf); + __pyx_r = __pyx_v_buf; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":247 + * return ret + * + * cpdef pack(self, object obj): # <<<<<<<<<<<<<< + * cdef int ret + * ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_6pack[] = "Packer.pack(self, obj)"; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_6pack(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_6pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->pack(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":259 + * return buf + * + * def pack_array_header(self, size_t size): # <<<<<<<<<<<<<< + * cdef int ret = msgpack_pack_array(&self.pk, size) + * if ret == -1: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_9pack_array_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_8pack_array_header[] = "Packer.pack_array_header(self, size_t size)"; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_9pack_array_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size) { + size_t __pyx_v_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack_array_header (wrapper)", 0); + assert(__pyx_arg_size); { + __pyx_v_size = __Pyx_PyInt_As_size_t(__pyx_arg_size); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_8pack_array_header(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((size_t)__pyx_v_size)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_8pack_array_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size) { + int __pyx_v_ret; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack_array_header", 0); + + /* "pandas/msgpack.pyx":260 + * + * def pack_array_header(self, size_t size): + * cdef int ret = msgpack_pack_array(&self.pk, size) # <<<<<<<<<<<<<< + * if ret == -1: + * raise MemoryError + */ + __pyx_v_ret = msgpack_pack_array((&__pyx_v_self->pk), __pyx_v_size); + + /* "pandas/msgpack.pyx":261 + * def pack_array_header(self, size_t size): + * cdef int ret = msgpack_pack_array(&self.pk, size) + * if ret == -1: # <<<<<<<<<<<<<< + * raise MemoryError + * elif ret: # should not happen + */ + __pyx_t_1 = ((__pyx_v_ret == -1) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":262 + * cdef int ret = msgpack_pack_array(&self.pk, size) + * if ret == -1: + * raise MemoryError # <<<<<<<<<<<<<< + * elif ret: # should not happen + * raise TypeError + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":263 + * if ret == -1: + * raise MemoryError + * elif ret: # should not happen # <<<<<<<<<<<<<< + * raise TypeError + * if self.autoreset: + */ + __pyx_t_1 = (__pyx_v_ret != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":264 + * raise MemoryError + * elif ret: # should not happen + * raise TypeError # <<<<<<<<<<<<<< + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":265 + * elif ret: # should not happen + * raise TypeError + * if self.autoreset: # <<<<<<<<<<<<<< + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + */ + __pyx_t_1 = (__pyx_v_self->autoreset != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":266 + * raise TypeError + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * self.pk.length = 0 + * return buf + */ + __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_buf = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":267 + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 # <<<<<<<<<<<<<< + * return buf + * + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":268 + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + * return buf # <<<<<<<<<<<<<< + * + * def pack_map_header(self, size_t size): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_buf); + __pyx_r = __pyx_v_buf; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":259 + * return buf + * + * def pack_array_header(self, size_t size): # <<<<<<<<<<<<<< + * cdef int ret = msgpack_pack_array(&self.pk, size) + * if ret == -1: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":270 + * return buf + * + * def pack_map_header(self, size_t size): # <<<<<<<<<<<<<< + * cdef int ret = msgpack_pack_map(&self.pk, size) + * if ret == -1: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_11pack_map_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_10pack_map_header[] = "Packer.pack_map_header(self, size_t size)"; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_11pack_map_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size) { + size_t __pyx_v_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack_map_header (wrapper)", 0); + assert(__pyx_arg_size); { + __pyx_v_size = __Pyx_PyInt_As_size_t(__pyx_arg_size); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_10pack_map_header(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((size_t)__pyx_v_size)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_10pack_map_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size) { + int __pyx_v_ret; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack_map_header", 0); + + /* "pandas/msgpack.pyx":271 + * + * def pack_map_header(self, size_t size): + * cdef int ret = msgpack_pack_map(&self.pk, size) # <<<<<<<<<<<<<< + * if ret == -1: + * raise MemoryError + */ + __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_v_size); + + /* "pandas/msgpack.pyx":272 + * def pack_map_header(self, size_t size): + * cdef int ret = msgpack_pack_map(&self.pk, size) + * if ret == -1: # <<<<<<<<<<<<<< + * raise MemoryError + * elif ret: # should not happen + */ + __pyx_t_1 = ((__pyx_v_ret == -1) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":273 + * cdef int ret = msgpack_pack_map(&self.pk, size) + * if ret == -1: + * raise MemoryError # <<<<<<<<<<<<<< + * elif ret: # should not happen + * raise TypeError + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":274 + * if ret == -1: + * raise MemoryError + * elif ret: # should not happen # <<<<<<<<<<<<<< + * raise TypeError + * if self.autoreset: + */ + __pyx_t_1 = (__pyx_v_ret != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":275 + * raise MemoryError + * elif ret: # should not happen + * raise TypeError # <<<<<<<<<<<<<< + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":276 + * elif ret: # should not happen + * raise TypeError + * if self.autoreset: # <<<<<<<<<<<<<< + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + */ + __pyx_t_1 = (__pyx_v_self->autoreset != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":277 + * raise TypeError + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * self.pk.length = 0 + * return buf + */ + __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_buf = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":278 + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 # <<<<<<<<<<<<<< + * return buf + * + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":279 + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + * return buf # <<<<<<<<<<<<<< + * + * def pack_map_pairs(self, object pairs): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_buf); + __pyx_r = __pyx_v_buf; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":270 + * return buf + * + * def pack_map_header(self, size_t size): # <<<<<<<<<<<<<< + * cdef int ret = msgpack_pack_map(&self.pk, size) + * if ret == -1: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":281 + * return buf + * + * def pack_map_pairs(self, object pairs): # <<<<<<<<<<<<<< + * """ + * Pack *pairs* as msgpack map type. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_13pack_map_pairs(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_12pack_map_pairs[] = "Packer.pack_map_pairs(self, pairs)\n\n Pack *pairs* as msgpack map type.\n\n *pairs* should sequence of pair.\n (`len(pairs)` and `for k, v in *pairs*:` should be supported.)\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_13pack_map_pairs(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack_map_pairs (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_12pack_map_pairs(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((PyObject *)__pyx_v_pairs)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_12pack_map_pairs(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_pairs) { + int __pyx_v_ret; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v_buf = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack_map_pairs", 0); + + /* "pandas/msgpack.pyx":288 + * (`len(pairs)` and `for k, v in *pairs*:` should be supported.) + * """ + * cdef int ret = msgpack_pack_map(&self.pk, len(pairs)) # <<<<<<<<<<<<<< + * if ret == 0: + * for k, v in pairs: + */ + __pyx_t_1 = PyObject_Length(__pyx_v_pairs); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_1); + + /* "pandas/msgpack.pyx":289 + * """ + * cdef int ret = msgpack_pack_map(&self.pk, len(pairs)) + * if ret == 0: # <<<<<<<<<<<<<< + * for k, v in pairs: + * ret = self._pack(k) + */ + __pyx_t_2 = ((__pyx_v_ret == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":290 + * cdef int ret = msgpack_pack_map(&self.pk, len(pairs)) + * if ret == 0: + * for k, v in pairs: # <<<<<<<<<<<<<< + * ret = self._pack(k) + * if ret != 0: break + */ + if (PyList_CheckExact(__pyx_v_pairs) || PyTuple_CheckExact(__pyx_v_pairs)) { + __pyx_t_3 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_3); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/msgpack.pyx":291 + * if ret == 0: + * for k, v in pairs: + * ret = self._pack(k) # <<<<<<<<<<<<<< + * if ret != 0: break + * ret = self._pack(v) + */ + __pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, NULL); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_10; + + /* "pandas/msgpack.pyx":292 + * for k, v in pairs: + * ret = self._pack(k) + * if ret != 0: break # <<<<<<<<<<<<<< + * ret = self._pack(v) + * if ret != 0: break + */ + __pyx_t_2 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_2) { + goto __pyx_L5_break; + } + + /* "pandas/msgpack.pyx":293 + * ret = self._pack(k) + * if ret != 0: break + * ret = self._pack(v) # <<<<<<<<<<<<<< + * if ret != 0: break + * if ret == -1: + */ + __pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, NULL); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_10; + + /* "pandas/msgpack.pyx":294 + * if ret != 0: break + * ret = self._pack(v) + * if ret != 0: break # <<<<<<<<<<<<<< + * if ret == -1: + * raise MemoryError + */ + __pyx_t_2 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_2) { + goto __pyx_L5_break; + } + } + __pyx_L5_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":295 + * ret = self._pack(v) + * if ret != 0: break + * if ret == -1: # <<<<<<<<<<<<<< + * raise MemoryError + * elif ret: # should not happen + */ + __pyx_t_2 = ((__pyx_v_ret == -1) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":296 + * if ret != 0: break + * if ret == -1: + * raise MemoryError # <<<<<<<<<<<<<< + * elif ret: # should not happen + * raise TypeError + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":297 + * if ret == -1: + * raise MemoryError + * elif ret: # should not happen # <<<<<<<<<<<<<< + * raise TypeError + * if self.autoreset: + */ + __pyx_t_2 = (__pyx_v_ret != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":298 + * raise MemoryError + * elif ret: # should not happen + * raise TypeError # <<<<<<<<<<<<<< + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":299 + * elif ret: # should not happen + * raise TypeError + * if self.autoreset: # <<<<<<<<<<<<<< + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + */ + __pyx_t_2 = (__pyx_v_self->autoreset != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":300 + * raise TypeError + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * self.pk.length = 0 + * return buf + */ + __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_buf = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/msgpack.pyx":301 + * if self.autoreset: + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 # <<<<<<<<<<<<<< + * return buf + * + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":302 + * buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + * self.pk.length = 0 + * return buf # <<<<<<<<<<<<<< + * + * def reset(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_buf); + __pyx_r = __pyx_v_buf; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":281 + * return buf + * + * def pack_map_pairs(self, object pairs): # <<<<<<<<<<<<<< + * """ + * Pack *pairs* as msgpack map type. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":304 + * return buf + * + * def reset(self): # <<<<<<<<<<<<<< + * """Clear internal buffer.""" + * self.pk.length = 0 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_14reset[] = "Packer.reset(self)\nClear internal buffer."; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_14reset(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_14reset(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset", 0); + + /* "pandas/msgpack.pyx":306 + * def reset(self): + * """Clear internal buffer.""" + * self.pk.length = 0 # <<<<<<<<<<<<<< + * + * def bytes(self): + */ + __pyx_v_self->pk.length = 0; + + /* "pandas/msgpack.pyx":304 + * return buf + * + * def reset(self): # <<<<<<<<<<<<<< + * """Clear internal buffer.""" + * self.pk.length = 0 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":308 + * self.pk.length = 0 + * + * def bytes(self): # <<<<<<<<<<<<<< + * """Return buffer content.""" + * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_17bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6Packer_16bytes[] = "Packer.bytes(self)\nReturn buffer content."; +static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_17bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("bytes (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_16bytes(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_16bytes(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("bytes", 0); + + /* "pandas/msgpack.pyx":310 + * def bytes(self): + * """Return buffer content.""" + * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":308 + * self.pk.length = 0 + * + * def bytes(self): # <<<<<<<<<<<<<< + * """Return buffer content.""" + * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Packer.bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":313 + * + * + * cdef inline pack_pair(self, object k, object v, int nest_limit): # <<<<<<<<<<<<<< + * ret = self._pack(k, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % k) + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_6Packer_pack_pair(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_k, PyObject *__pyx_v_v, int __pyx_v_nest_limit) { + int __pyx_v_ret; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack_pair", 0); + + /* "pandas/msgpack.pyx":314 + * + * cdef inline pack_pair(self, object k, object v, int nest_limit): + * ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: raise PackException("cannot pack : %s" % k) + * ret = self._pack(v, nest_limit-1) + */ + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_1; + + /* "pandas/msgpack.pyx":315 + * cdef inline pack_pair(self, object k, object v, int nest_limit): + * ret = self._pack(k, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % k) # <<<<<<<<<<<<<< + * ret = self._pack(v, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % v) + */ + __pyx_t_3 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_3) { + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_cannot_pack_s, __pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":316 + * ret = self._pack(k, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % k) + * ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<< + * if ret != 0: raise PackException("cannot pack : %s" % v) + * return ret + */ + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.nest_limit = (__pyx_v_nest_limit - 1); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_1; + + /* "pandas/msgpack.pyx":317 + * if ret != 0: raise PackException("cannot pack : %s" % k) + * ret = self._pack(v, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % v) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_3 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_3) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_cannot_pack_s, __pyx_v_v); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":318 + * ret = self._pack(v, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % v) + * return ret # <<<<<<<<<<<<<< + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":313 + * + * + * cdef inline pack_pair(self, object k, object v, int nest_limit): # <<<<<<<<<<<<<< + * ret = self._pack(k, nest_limit-1) + * if ret != 0: raise PackException("cannot pack : %s" % k) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.msgpack.Packer.pack_pair", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":320 + * return ret + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<< + * """ + * pack an object `o` and write it to stream).""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_1pack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_pack[] = "pack(o, stream, default=None, encoding='utf-8', unicode_errors='strict')\n\n pack an object `o` and write it to stream)."; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_1pack = {__Pyx_NAMESTR("pack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_1pack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_pack)}; +static PyObject *__pyx_pw_6pandas_7msgpack_1pack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_o = 0; + PyObject *__pyx_v_stream = 0; + PyObject *__pyx_v_default = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pack (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_o,&__pyx_n_s_stream,&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)__pyx_kp_s_utf_8); + values[4] = ((PyObject *)__pyx_n_s_strict); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pack", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_o = values[0]; + __pyx_v_stream = values[1]; + __pyx_v_default = values[2]; + __pyx_v_encoding = values[3]; + __pyx_v_unicode_errors = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pack", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_pack(__pyx_self, __pyx_v_o, __pyx_v_stream, __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_pack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_stream, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors) { + struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_packer = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pack", 0); + + /* "pandas/msgpack.pyx":323 + * """ + * pack an object `o` and write it to stream).""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors) # <<<<<<<<<<<<<< + * stream.write(packer.pack(o)) + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default, __pyx_v_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7msgpack_Packer)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_packer = ((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":324 + * pack an object `o` and write it to stream).""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors) + * stream.write(packer.pack(o)) # <<<<<<<<<<<<<< + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_packer->__pyx_vtab)->pack(__pyx_v_packer, __pyx_v_o, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":320 + * return ret + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<< + * """ + * pack an object `o` and write it to stream).""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.msgpack.pack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_packer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":326 + * stream.write(packer.pack(o)) + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<< + * """ + * pack o and return packed bytes.""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_3packb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_2packb[] = "packb(o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False)\n\n pack o and return packed bytes."; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_3packb = {__Pyx_NAMESTR("packb"), (PyCFunction)__pyx_pw_6pandas_7msgpack_3packb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_2packb)}; +static PyObject *__pyx_pw_6pandas_7msgpack_3packb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_o = 0; + PyObject *__pyx_v_default = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + PyObject *__pyx_v_use_single_float = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("packb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_o,&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_use_single_float,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)__pyx_kp_s_utf_8); + values[3] = ((PyObject *)__pyx_n_s_strict); + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_single_float); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "packb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_o = values[0]; + __pyx_v_default = values[1]; + __pyx_v_encoding = values[2]; + __pyx_v_unicode_errors = values[3]; + __pyx_v_use_single_float = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("packb", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.packb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_2packb(__pyx_self, __pyx_v_o, __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_use_single_float); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_2packb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float) { + struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_packer = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("packb", 0); + + /* "pandas/msgpack.pyx":329 + * """ + * pack o and return packed bytes.""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< + * use_single_float=use_single_float) + * return packer.pack(o) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default, __pyx_v_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":330 + * pack o and return packed bytes.""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, + * use_single_float=use_single_float) # <<<<<<<<<<<<<< + * return packer.pack(o) + * + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_use_single_float, __pyx_v_use_single_float) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":329 + * """ + * pack o and return packed bytes.""" + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< + * use_single_float=use_single_float) + * return packer.pack(o) + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7msgpack_Packer)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_packer = ((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":331 + * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, + * use_single_float=use_single_float) + * return packer.pack(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_packer->__pyx_vtab)->pack(__pyx_v_packer, __pyx_v_o, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":326 + * stream.write(packer.pack(o)) + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<< + * """ + * pack o and return packed bytes.""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.msgpack.packb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_packer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":334 + * + * + * cdef inline init_ctx(template_context *ctx, # <<<<<<<<<<<<<< + * object object_hook, object object_pairs_hook, object list_hook, + * bint use_list, char* encoding, char* unicode_errors): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_init_ctx(template_context *__pyx_v_ctx, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, char *__pyx_v_encoding, char *__pyx_v_unicode_errors) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("init_ctx", 0); + + /* "pandas/msgpack.pyx":337 + * object object_hook, object object_pairs_hook, object list_hook, + * bint use_list, char* encoding, char* unicode_errors): + * template_init(ctx) # <<<<<<<<<<<<<< + * ctx.user.use_list = use_list + * ctx.user.object_hook = ctx.user.list_hook = NULL + */ + template_init(__pyx_v_ctx); + + /* "pandas/msgpack.pyx":338 + * bint use_list, char* encoding, char* unicode_errors): + * template_init(ctx) + * ctx.user.use_list = use_list # <<<<<<<<<<<<<< + * ctx.user.object_hook = ctx.user.list_hook = NULL + * + */ + __pyx_v_ctx->user.use_list = __pyx_v_use_list; + + /* "pandas/msgpack.pyx":339 + * template_init(ctx) + * ctx.user.use_list = use_list + * ctx.user.object_hook = ctx.user.list_hook = NULL # <<<<<<<<<<<<<< + * + * if object_hook is not None and object_pairs_hook is not None: + */ + __pyx_v_ctx->user.object_hook = ((PyObject *)NULL); + __pyx_v_ctx->user.list_hook = ((PyObject *)NULL); + + /* "pandas/msgpack.pyx":341 + * ctx.user.object_hook = ctx.user.list_hook = NULL + * + * if object_hook is not None and object_pairs_hook is not None: # <<<<<<<<<<<<<< + * raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") + * + */ + __pyx_t_1 = (__pyx_v_object_hook != Py_None); + if ((__pyx_t_1 != 0)) { + __pyx_t_2 = (__pyx_v_object_pairs_hook != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":342 + * + * if object_hook is not None and object_pairs_hook is not None: + * raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") # <<<<<<<<<<<<<< + * + * if object_hook is not None: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":344 + * raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") + * + * if object_hook is not None: # <<<<<<<<<<<<<< + * if not PyCallable_Check(object_hook): + * raise TypeError("object_hook must be a callable.") + */ + __pyx_t_3 = (__pyx_v_object_hook != Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":345 + * + * if object_hook is not None: + * if not PyCallable_Check(object_hook): # <<<<<<<<<<<<<< + * raise TypeError("object_hook must be a callable.") + * ctx.user.object_hook = object_hook + */ + __pyx_t_1 = ((!(PyCallable_Check(__pyx_v_object_hook) != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":346 + * if object_hook is not None: + * if not PyCallable_Check(object_hook): + * raise TypeError("object_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.object_hook = object_hook + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":347 + * if not PyCallable_Check(object_hook): + * raise TypeError("object_hook must be a callable.") + * ctx.user.object_hook = object_hook # <<<<<<<<<<<<<< + * + * if object_pairs_hook is None: + */ + __pyx_v_ctx->user.object_hook = ((PyObject *)__pyx_v_object_hook); + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/msgpack.pyx":349 + * ctx.user.object_hook = object_hook + * + * if object_pairs_hook is None: # <<<<<<<<<<<<<< + * ctx.user.has_pairs_hook = False + * else: + */ + __pyx_t_1 = (__pyx_v_object_pairs_hook == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":350 + * + * if object_pairs_hook is None: + * ctx.user.has_pairs_hook = False # <<<<<<<<<<<<<< + * else: + * if not PyCallable_Check(object_pairs_hook): + */ + __pyx_v_ctx->user.has_pairs_hook = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/msgpack.pyx":352 + * ctx.user.has_pairs_hook = False + * else: + * if not PyCallable_Check(object_pairs_hook): # <<<<<<<<<<<<<< + * raise TypeError("object_pairs_hook must be a callable.") + * ctx.user.object_hook = object_pairs_hook + */ + __pyx_t_3 = ((!(PyCallable_Check(__pyx_v_object_pairs_hook) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":353 + * else: + * if not PyCallable_Check(object_pairs_hook): + * raise TypeError("object_pairs_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.object_hook = object_pairs_hook + * ctx.user.has_pairs_hook = True + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":354 + * if not PyCallable_Check(object_pairs_hook): + * raise TypeError("object_pairs_hook must be a callable.") + * ctx.user.object_hook = object_pairs_hook # <<<<<<<<<<<<<< + * ctx.user.has_pairs_hook = True + * + */ + __pyx_v_ctx->user.object_hook = ((PyObject *)__pyx_v_object_pairs_hook); + + /* "pandas/msgpack.pyx":355 + * raise TypeError("object_pairs_hook must be a callable.") + * ctx.user.object_hook = object_pairs_hook + * ctx.user.has_pairs_hook = True # <<<<<<<<<<<<<< + * + * if list_hook is not None: + */ + __pyx_v_ctx->user.has_pairs_hook = 1; + } + __pyx_L6:; + + /* "pandas/msgpack.pyx":357 + * ctx.user.has_pairs_hook = True + * + * if list_hook is not None: # <<<<<<<<<<<<<< + * if not PyCallable_Check(list_hook): + * raise TypeError("list_hook must be a callable.") + */ + __pyx_t_3 = (__pyx_v_list_hook != Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":358 + * + * if list_hook is not None: + * if not PyCallable_Check(list_hook): # <<<<<<<<<<<<<< + * raise TypeError("list_hook must be a callable.") + * ctx.user.list_hook = list_hook + */ + __pyx_t_1 = ((!(PyCallable_Check(__pyx_v_list_hook) != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":359 + * if list_hook is not None: + * if not PyCallable_Check(list_hook): + * raise TypeError("list_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.list_hook = list_hook + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":360 + * if not PyCallable_Check(list_hook): + * raise TypeError("list_hook must be a callable.") + * ctx.user.list_hook = list_hook # <<<<<<<<<<<<<< + * + * ctx.user.encoding = encoding + */ + __pyx_v_ctx->user.list_hook = ((PyObject *)__pyx_v_list_hook); + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/msgpack.pyx":362 + * ctx.user.list_hook = list_hook + * + * ctx.user.encoding = encoding # <<<<<<<<<<<<<< + * ctx.user.unicode_errors = unicode_errors + * + */ + __pyx_v_ctx->user.encoding = __pyx_v_encoding; + + /* "pandas/msgpack.pyx":363 + * + * ctx.user.encoding = encoding + * ctx.user.unicode_errors = unicode_errors # <<<<<<<<<<<<<< + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, + */ + __pyx_v_ctx->user.unicode_errors = __pyx_v_unicode_errors; + + /* "pandas/msgpack.pyx":334 + * + * + * cdef inline init_ctx(template_context *ctx, # <<<<<<<<<<<<<< + * object object_hook, object object_pairs_hook, object list_hook, + * bint use_list, char* encoding, char* unicode_errors): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.msgpack.init_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_5unpackb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_4unpackb[] = "unpackb(packed, object_hook=None, list_hook=None, bool use_list=1, encoding=None, unicode_errors='strict', object_pairs_hook=None)\nUnpack packed_bytes to object. Returns an unpacked object.\n\n Raises `ValueError` when `packed` contains extra bytes.\n "; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_5unpackb = {__Pyx_NAMESTR("unpackb"), (PyCFunction)__pyx_pw_6pandas_7msgpack_5unpackb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_4unpackb)}; +static PyObject *__pyx_pw_6pandas_7msgpack_5unpackb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_packed = 0; + PyObject *__pyx_v_object_hook = 0; + PyObject *__pyx_v_list_hook = 0; + int __pyx_v_use_list; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + PyObject *__pyx_v_object_pairs_hook = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unpackb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_packed,&__pyx_n_s_object_hook,&__pyx_n_s_list_hook,&__pyx_n_s_use_list,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_object_pairs_hook,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + + /* "pandas/msgpack.pyx":366 + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, + * bint use_list=1, encoding=None, unicode_errors="strict", # <<<<<<<<<<<<<< + * object_pairs_hook=None, + * ): + */ + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)__pyx_n_s_strict); + + /* "pandas/msgpack.pyx":367 + * def unpackb(object packed, object object_hook=None, object list_hook=None, + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, # <<<<<<<<<<<<<< + * ): + * """Unpack packed_bytes to object. Returns an unpacked object. + */ + values[6] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_packed)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpackb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_packed = values[0]; + __pyx_v_object_hook = values[1]; + __pyx_v_list_hook = values[2]; + if (values[3]) { + __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_use_list = ((int)1); + } + __pyx_v_encoding = values[4]; + __pyx_v_unicode_errors = values[5]; + __pyx_v_object_pairs_hook = values[6]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("unpackb", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.unpackb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_4unpackb(__pyx_self, __pyx_v_packed, __pyx_v_object_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_object_pairs_hook); + + /* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_4unpackb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_packed, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook) { + template_context __pyx_v_ctx; + size_t __pyx_v_off; + int __pyx_v_ret; + char *__pyx_v_buf; + Py_ssize_t __pyx_v_buf_len; + char *__pyx_v_cenc; + char *__pyx_v_cerr; + PyObject *__pyx_v_obj = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unpackb", 0); + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_INCREF(__pyx_v_unicode_errors); + + /* "pandas/msgpack.pyx":374 + * """ + * cdef template_context ctx + * cdef size_t off = 0 # <<<<<<<<<<<<<< + * cdef int ret + * + */ + __pyx_v_off = 0; + + /* "pandas/msgpack.pyx":379 + * cdef char* buf + * cdef Py_ssize_t buf_len + * cdef char* cenc = NULL # <<<<<<<<<<<<<< + * cdef char* cerr = NULL + * + */ + __pyx_v_cenc = NULL; + + /* "pandas/msgpack.pyx":380 + * cdef Py_ssize_t buf_len + * cdef char* cenc = NULL + * cdef char* cerr = NULL # <<<<<<<<<<<<<< + * + * PyObject_AsReadBuffer(packed, &buf, &buf_len) + */ + __pyx_v_cerr = NULL; + + /* "pandas/msgpack.pyx":382 + * cdef char* cerr = NULL + * + * PyObject_AsReadBuffer(packed, &buf, &buf_len) # <<<<<<<<<<<<<< + * + * if encoding is not None: + */ + __pyx_t_1 = PyObject_AsReadBuffer(__pyx_v_packed, ((const void* *)(&__pyx_v_buf)), (&__pyx_v_buf_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":384 + * PyObject_AsReadBuffer(packed, &buf, &buf_len) + * + * if encoding is not None: # <<<<<<<<<<<<<< + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') + */ + __pyx_t_2 = (__pyx_v_encoding != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":385 + * + * if encoding is not None: + * if isinstance(encoding, unicode): # <<<<<<<<<<<<<< + * encoding = encoding.encode('ascii') + * cenc = PyBytes_AsString(encoding) + */ + __pyx_t_3 = PyUnicode_Check(__pyx_v_encoding); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":386 + * if encoding is not None: + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * cenc = PyBytes_AsString(encoding) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/msgpack.pyx":387 + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') + * cenc = PyBytes_AsString(encoding) # <<<<<<<<<<<<<< + * + * if unicode_errors is not None: + */ + __pyx_t_6 = PyBytes_AsString(__pyx_v_encoding); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_cenc = __pyx_t_6; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":389 + * cenc = PyBytes_AsString(encoding) + * + * if unicode_errors is not None: # <<<<<<<<<<<<<< + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') + */ + __pyx_t_2 = (__pyx_v_unicode_errors != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":390 + * + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<< + * unicode_errors = unicode_errors.encode('ascii') + * cerr = PyBytes_AsString(unicode_errors) + */ + __pyx_t_3 = PyUnicode_Check(__pyx_v_unicode_errors); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":391 + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * cerr = PyBytes_AsString(unicode_errors) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_unicode_errors, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/msgpack.pyx":392 + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') + * cerr = PyBytes_AsString(unicode_errors) # <<<<<<<<<<<<<< + * + * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + */ + __pyx_t_6 = PyBytes_AsString(__pyx_v_unicode_errors); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_cerr = __pyx_t_6; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/msgpack.pyx":394 + * cerr = PyBytes_AsString(unicode_errors) + * + * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) # <<<<<<<<<<<<<< + * ret = template_construct(&ctx, buf, buf_len, &off) + * if ret == 1: + */ + __pyx_t_4 = __pyx_f_6pandas_7msgpack_init_ctx((&__pyx_v_ctx), __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_cenc, __pyx_v_cerr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":395 + * + * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + * ret = template_construct(&ctx, buf, buf_len, &off) # <<<<<<<<<<<<<< + * if ret == 1: + * obj = template_data(&ctx) + */ + __pyx_t_1 = template_construct((&__pyx_v_ctx), __pyx_v_buf, __pyx_v_buf_len, (&__pyx_v_off)); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_1; + + /* "pandas/msgpack.pyx":396 + * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + * ret = template_construct(&ctx, buf, buf_len, &off) + * if ret == 1: # <<<<<<<<<<<<<< + * obj = template_data(&ctx) + * if off < buf_len: + */ + __pyx_t_2 = ((__pyx_v_ret == 1) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":397 + * ret = template_construct(&ctx, buf, buf_len, &off) + * if ret == 1: + * obj = template_data(&ctx) # <<<<<<<<<<<<<< + * if off < buf_len: + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) + */ + __pyx_t_4 = template_data((&__pyx_v_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_obj = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":398 + * if ret == 1: + * obj = template_data(&ctx) + * if off < buf_len: # <<<<<<<<<<<<<< + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) + * return obj + */ + __pyx_t_2 = ((__pyx_v_off < __pyx_v_buf_len) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":399 + * obj = template_data(&ctx) + * if off < buf_len: + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) # <<<<<<<<<<<<<< + * return obj + * elif ret < 0: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ExtraData); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyBytes_FromStringAndSize((__pyx_v_buf + __pyx_v_off), (__pyx_v_buf_len - __pyx_v_off)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":400 + * if off < buf_len: + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) + * return obj # <<<<<<<<<<<<<< + * elif ret < 0: + * raise ValueError("Unpack failed: error = %d" % (ret,)) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + } + + /* "pandas/msgpack.pyx":401 + * raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) + * return obj + * elif ret < 0: # <<<<<<<<<<<<<< + * raise ValueError("Unpack failed: error = %d" % (ret,)) + * else: + */ + __pyx_t_2 = ((__pyx_v_ret < 0) != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":402 + * return obj + * elif ret < 0: + * raise ValueError("Unpack failed: error = %d" % (ret,)) # <<<<<<<<<<<<<< + * else: + * raise UnpackValueError + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unpack_failed_error_d, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/msgpack.pyx":404 + * raise ValueError("Unpack failed: error = %d" % (ret,)) + * else: + * raise UnpackValueError # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackValueError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.msgpack.unpackb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XDECREF(__pyx_v_unicode_errors); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_7unpack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_6unpack[] = "unpack(stream, object_hook=None, list_hook=None, bool use_list=1, encoding=None, unicode_errors='strict', object_pairs_hook=None)\nUnpack an object from `stream`.\n\n Raises `ValueError` when `stream` has extra bytes.\n "; +static PyMethodDef __pyx_mdef_6pandas_7msgpack_7unpack = {__Pyx_NAMESTR("unpack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_7unpack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6unpack)}; +static PyObject *__pyx_pw_6pandas_7msgpack_7unpack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_stream = 0; + PyObject *__pyx_v_object_hook = 0; + PyObject *__pyx_v_list_hook = 0; + int __pyx_v_use_list; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + PyObject *__pyx_v_object_pairs_hook = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unpack (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_object_hook,&__pyx_n_s_list_hook,&__pyx_n_s_use_list,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_object_pairs_hook,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + + /* "pandas/msgpack.pyx":408 + * + * def unpack(object stream, object object_hook=None, object list_hook=None, + * bint use_list=1, encoding=None, unicode_errors="strict", # <<<<<<<<<<<<<< + * object_pairs_hook=None, + * ): + */ + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)__pyx_n_s_strict); + + /* "pandas/msgpack.pyx":409 + * def unpack(object stream, object object_hook=None, object list_hook=None, + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, # <<<<<<<<<<<<<< + * ): + * """Unpack an object from `stream`. + */ + values[6] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_stream = values[0]; + __pyx_v_object_hook = values[1]; + __pyx_v_list_hook = values[2]; + if (values[3]) { + __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_use_list = ((int)1); + } + __pyx_v_encoding = values[4]; + __pyx_v_unicode_errors = values[5]; + __pyx_v_object_pairs_hook = values[6]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("unpack", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_6unpack(__pyx_self, __pyx_v_stream, __pyx_v_object_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_object_pairs_hook); + + /* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_6unpack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unpack", 0); + + /* "pandas/msgpack.pyx":415 + * Raises `ValueError` when `stream` has extra bytes. + * """ + * return unpackb(stream.read(), use_list=use_list, # <<<<<<<<<<<<<< + * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, + * encoding=encoding, unicode_errors=unicode_errors, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unpackb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_use_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_list, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":416 + * """ + * return unpackb(stream.read(), use_list=use_list, + * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, # <<<<<<<<<<<<<< + * encoding=encoding, unicode_errors=unicode_errors, + * ) + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_object_hook, __pyx_v_object_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_object_pairs_hook, __pyx_v_object_pairs_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_list_hook, __pyx_v_list_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":417 + * return unpackb(stream.read(), use_list=use_list, + * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, + * encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< + * ) + * + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":415 + * Raises `ValueError` when `stream` has extra bytes. + * """ + * return unpackb(stream.read(), use_list=use_list, # <<<<<<<<<<<<<< + * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, + * encoding=encoding, unicode_errors=unicode_errors, + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.msgpack.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":478 + * cdef size_t max_buffer_size + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.buf = NULL + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7msgpack_8Unpacker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7msgpack_8Unpacker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker___cinit__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7msgpack_8Unpacker___cinit__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "pandas/msgpack.pyx":479 + * + * def __cinit__(self): + * self.buf = NULL # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->buf = NULL; + + /* "pandas/msgpack.pyx":478 + * cdef size_t max_buffer_size + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self.buf = NULL + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":481 + * self.buf = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.buf) + * self.buf = NULL + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_7msgpack_8Unpacker_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_7msgpack_8Unpacker_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_7msgpack_8Unpacker_2__dealloc__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_7msgpack_8Unpacker_2__dealloc__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/msgpack.pyx":482 + * + * def __dealloc__(self): + * free(self.buf) # <<<<<<<<<<<<<< + * self.buf = NULL + * + */ + free(__pyx_v_self->buf); + + /* "pandas/msgpack.pyx":483 + * def __dealloc__(self): + * free(self.buf) + * self.buf = NULL # <<<<<<<<<<<<<< + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, + */ + __pyx_v_self->buf = NULL; + + /* "pandas/msgpack.pyx":481 + * self.buf = NULL + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * free(self.buf) + * self.buf = NULL + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/msgpack.pyx":485 + * self.buf = NULL + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<< + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7msgpack_8Unpacker_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7msgpack_8Unpacker_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_like = 0; + Py_ssize_t __pyx_v_read_size; + int __pyx_v_use_list; + PyObject *__pyx_v_object_hook = 0; + PyObject *__pyx_v_object_pairs_hook = 0; + PyObject *__pyx_v_list_hook = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_unicode_errors = 0; + int __pyx_v_max_buffer_size; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_like,&__pyx_n_s_read_size,&__pyx_n_s_use_list,&__pyx_n_s_object_hook,&__pyx_n_s_object_pairs_hook,&__pyx_n_s_list_hook,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_max_buffer_size,0}; + PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; + values[0] = ((PyObject *)Py_None); + + /* "pandas/msgpack.pyx":486 + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + * ): + */ + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)Py_None); + + /* "pandas/msgpack.pyx":487 + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, + * encoding=None, unicode_errors='strict', int max_buffer_size=0, # <<<<<<<<<<<<<< + * ): + * cdef char *cenc=NULL, *cerr=NULL + */ + values[6] = ((PyObject *)Py_None); + values[7] = ((PyObject *)__pyx_n_s_strict); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_like); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_read_size); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[6] = value; kw_args--; } + } + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors); + if (value) { values[7] = value; kw_args--; } + } + case 8: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_buffer_size); + if (value) { values[8] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_like = values[0]; + if (values[1]) { + __pyx_v_read_size = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_read_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_read_size = ((Py_ssize_t)0); + } + if (values[2]) { + __pyx_v_use_list = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_use_list = ((int)1); + } + __pyx_v_object_hook = values[3]; + __pyx_v_object_pairs_hook = values[4]; + __pyx_v_list_hook = values[5]; + __pyx_v_encoding = values[6]; + __pyx_v_unicode_errors = values[7]; + if (values[8]) { + __pyx_v_max_buffer_size = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_buffer_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_max_buffer_size = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_4__init__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_file_like, __pyx_v_read_size, __pyx_v_use_list, __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_max_buffer_size); + + /* "pandas/msgpack.pyx":485 + * self.buf = NULL + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<< + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7msgpack_8Unpacker_4__init__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_file_like, Py_ssize_t __pyx_v_read_size, int __pyx_v_use_list, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, int __pyx_v_max_buffer_size) { + char *__pyx_v_cenc; + char *__pyx_v_cerr; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + long __pyx_t_3; + int __pyx_t_4; + long __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_INCREF(__pyx_v_unicode_errors); + + /* "pandas/msgpack.pyx":489 + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + * ): + * cdef char *cenc=NULL, *cerr=NULL # <<<<<<<<<<<<<< + * + * self.file_like = file_like + */ + __pyx_v_cenc = NULL; + __pyx_v_cerr = NULL; + + /* "pandas/msgpack.pyx":491 + * cdef char *cenc=NULL, *cerr=NULL + * + * self.file_like = file_like # <<<<<<<<<<<<<< + * if file_like: + * self.file_like_read = file_like.read + */ + __Pyx_INCREF(__pyx_v_file_like); + __Pyx_GIVEREF(__pyx_v_file_like); + __Pyx_GOTREF(__pyx_v_self->file_like); + __Pyx_DECREF(__pyx_v_self->file_like); + __pyx_v_self->file_like = __pyx_v_file_like; + + /* "pandas/msgpack.pyx":492 + * + * self.file_like = file_like + * if file_like: # <<<<<<<<<<<<<< + * self.file_like_read = file_like.read + * if not PyCallable_Check(self.file_like_read): + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_file_like); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":493 + * self.file_like = file_like + * if file_like: + * self.file_like_read = file_like.read # <<<<<<<<<<<<<< + * if not PyCallable_Check(self.file_like_read): + * raise ValueError("`file_like.read` must be a callable.") + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->file_like_read); + __Pyx_DECREF(__pyx_v_self->file_like_read); + __pyx_v_self->file_like_read = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":494 + * if file_like: + * self.file_like_read = file_like.read + * if not PyCallable_Check(self.file_like_read): # <<<<<<<<<<<<<< + * raise ValueError("`file_like.read` must be a callable.") + * if not max_buffer_size: + */ + __pyx_t_2 = __pyx_v_self->file_like_read; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = ((!(PyCallable_Check(__pyx_t_2) != 0)) != 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":495 + * self.file_like_read = file_like.read + * if not PyCallable_Check(self.file_like_read): + * raise ValueError("`file_like.read` must be a callable.") # <<<<<<<<<<<<<< + * if not max_buffer_size: + * max_buffer_size = INT_MAX + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":496 + * if not PyCallable_Check(self.file_like_read): + * raise ValueError("`file_like.read` must be a callable.") + * if not max_buffer_size: # <<<<<<<<<<<<<< + * max_buffer_size = INT_MAX + * if read_size > max_buffer_size: + */ + __pyx_t_1 = ((!(__pyx_v_max_buffer_size != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":497 + * raise ValueError("`file_like.read` must be a callable.") + * if not max_buffer_size: + * max_buffer_size = INT_MAX # <<<<<<<<<<<<<< + * if read_size > max_buffer_size: + * raise ValueError("read_size should be less or equal to max_buffer_size") + */ + __pyx_v_max_buffer_size = INT_MAX; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/msgpack.pyx":498 + * if not max_buffer_size: + * max_buffer_size = INT_MAX + * if read_size > max_buffer_size: # <<<<<<<<<<<<<< + * raise ValueError("read_size should be less or equal to max_buffer_size") + * if not read_size: + */ + __pyx_t_1 = ((__pyx_v_read_size > __pyx_v_max_buffer_size) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":499 + * max_buffer_size = INT_MAX + * if read_size > max_buffer_size: + * raise ValueError("read_size should be less or equal to max_buffer_size") # <<<<<<<<<<<<<< + * if not read_size: + * read_size = min(max_buffer_size, 1024**2) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":500 + * if read_size > max_buffer_size: + * raise ValueError("read_size should be less or equal to max_buffer_size") + * if not read_size: # <<<<<<<<<<<<<< + * read_size = min(max_buffer_size, 1024**2) + * self.max_buffer_size = max_buffer_size + */ + __pyx_t_1 = ((!(__pyx_v_read_size != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":501 + * raise ValueError("read_size should be less or equal to max_buffer_size") + * if not read_size: + * read_size = min(max_buffer_size, 1024**2) # <<<<<<<<<<<<<< + * self.max_buffer_size = max_buffer_size + * self.read_size = read_size + */ + __pyx_t_3 = 1048576; + __pyx_t_4 = __pyx_v_max_buffer_size; + if (((__pyx_t_3 < __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_read_size = __pyx_t_5; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/msgpack.pyx":502 + * if not read_size: + * read_size = min(max_buffer_size, 1024**2) + * self.max_buffer_size = max_buffer_size # <<<<<<<<<<<<<< + * self.read_size = read_size + * self.buf = malloc(read_size) + */ + __pyx_v_self->max_buffer_size = __pyx_v_max_buffer_size; + + /* "pandas/msgpack.pyx":503 + * read_size = min(max_buffer_size, 1024**2) + * self.max_buffer_size = max_buffer_size + * self.read_size = read_size # <<<<<<<<<<<<<< + * self.buf = malloc(read_size) + * if self.buf == NULL: + */ + __pyx_v_self->read_size = __pyx_v_read_size; + + /* "pandas/msgpack.pyx":504 + * self.max_buffer_size = max_buffer_size + * self.read_size = read_size + * self.buf = malloc(read_size) # <<<<<<<<<<<<<< + * if self.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") + */ + __pyx_v_self->buf = ((char *)malloc(__pyx_v_read_size)); + + /* "pandas/msgpack.pyx":505 + * self.read_size = read_size + * self.buf = malloc(read_size) + * if self.buf == NULL: # <<<<<<<<<<<<<< + * raise MemoryError("Unable to allocate internal buffer.") + * self.buf_size = read_size + */ + __pyx_t_1 = ((__pyx_v_self->buf == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":506 + * self.buf = malloc(read_size) + * if self.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<< + * self.buf_size = read_size + * self.buf_head = 0 + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":507 + * if self.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") + * self.buf_size = read_size # <<<<<<<<<<<<<< + * self.buf_head = 0 + * self.buf_tail = 0 + */ + __pyx_v_self->buf_size = __pyx_v_read_size; + + /* "pandas/msgpack.pyx":508 + * raise MemoryError("Unable to allocate internal buffer.") + * self.buf_size = read_size + * self.buf_head = 0 # <<<<<<<<<<<<<< + * self.buf_tail = 0 + * + */ + __pyx_v_self->buf_head = 0; + + /* "pandas/msgpack.pyx":509 + * self.buf_size = read_size + * self.buf_head = 0 + * self.buf_tail = 0 # <<<<<<<<<<<<<< + * + * if encoding is not None: + */ + __pyx_v_self->buf_tail = 0; + + /* "pandas/msgpack.pyx":511 + * self.buf_tail = 0 + * + * if encoding is not None: # <<<<<<<<<<<<<< + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') + */ + __pyx_t_1 = (__pyx_v_encoding != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":512 + * + * if encoding is not None: + * if isinstance(encoding, unicode): # <<<<<<<<<<<<<< + * encoding = encoding.encode('ascii') + * self.encoding = encoding + */ + __pyx_t_6 = PyUnicode_Check(__pyx_v_encoding); + __pyx_t_1 = (__pyx_t_6 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":513 + * if encoding is not None: + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * self.encoding = encoding + * cenc = PyBytes_AsString(encoding) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/msgpack.pyx":514 + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') + * self.encoding = encoding # <<<<<<<<<<<<<< + * cenc = PyBytes_AsString(encoding) + * + */ + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_GIVEREF(__pyx_v_encoding); + __Pyx_GOTREF(__pyx_v_self->encoding); + __Pyx_DECREF(__pyx_v_self->encoding); + __pyx_v_self->encoding = __pyx_v_encoding; + + /* "pandas/msgpack.pyx":515 + * encoding = encoding.encode('ascii') + * self.encoding = encoding + * cenc = PyBytes_AsString(encoding) # <<<<<<<<<<<<<< + * + * if unicode_errors is not None: + */ + __pyx_t_8 = PyBytes_AsString(__pyx_v_encoding); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_cenc = __pyx_t_8; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/msgpack.pyx":517 + * cenc = PyBytes_AsString(encoding) + * + * if unicode_errors is not None: # <<<<<<<<<<<<<< + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') + */ + __pyx_t_1 = (__pyx_v_unicode_errors != Py_None); + __pyx_t_6 = (__pyx_t_1 != 0); + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":518 + * + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<< + * unicode_errors = unicode_errors.encode('ascii') + * self.unicode_errors = unicode_errors + */ + __pyx_t_6 = PyUnicode_Check(__pyx_v_unicode_errors); + __pyx_t_1 = (__pyx_t_6 != 0); + if (__pyx_t_1) { + + /* "pandas/msgpack.pyx":519 + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * self.unicode_errors = unicode_errors + * cerr = PyBytes_AsString(unicode_errors) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_unicode_errors, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/msgpack.pyx":520 + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') + * self.unicode_errors = unicode_errors # <<<<<<<<<<<<<< + * cerr = PyBytes_AsString(unicode_errors) + * + */ + __Pyx_INCREF(__pyx_v_unicode_errors); + __Pyx_GIVEREF(__pyx_v_unicode_errors); + __Pyx_GOTREF(__pyx_v_self->unicode_errors); + __Pyx_DECREF(__pyx_v_self->unicode_errors); + __pyx_v_self->unicode_errors = __pyx_v_unicode_errors; + + /* "pandas/msgpack.pyx":521 + * unicode_errors = unicode_errors.encode('ascii') + * self.unicode_errors = unicode_errors + * cerr = PyBytes_AsString(unicode_errors) # <<<<<<<<<<<<<< + * + * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + */ + __pyx_t_8 = PyBytes_AsString(__pyx_v_unicode_errors); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_cerr = __pyx_t_8; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/msgpack.pyx":523 + * cerr = PyBytes_AsString(unicode_errors) + * + * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) # <<<<<<<<<<<<<< + * + * def feed(self, object next_bytes): + */ + __pyx_t_2 = __pyx_f_6pandas_7msgpack_init_ctx((&__pyx_v_self->ctx), __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_cenc, __pyx_v_cerr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":485 + * self.buf = NULL + * + * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<< + * object object_hook=None, object object_pairs_hook=None, object list_hook=None, + * encoding=None, unicode_errors='strict', int max_buffer_size=0, + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XDECREF(__pyx_v_unicode_errors); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":525 + * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + * + * def feed(self, object next_bytes): # <<<<<<<<<<<<<< + * """Append `next_bytes` to internal buffer.""" + * cdef char* buf + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_7feed(PyObject *__pyx_v_self, PyObject *__pyx_v_next_bytes); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_6feed[] = "Unpacker.feed(self, next_bytes)\nAppend `next_bytes` to internal buffer."; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_7feed(PyObject *__pyx_v_self, PyObject *__pyx_v_next_bytes) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_6feed(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), ((PyObject *)__pyx_v_next_bytes)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_6feed(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_next_bytes) { + char *__pyx_v_buf; + Py_ssize_t __pyx_v_buf_len; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("feed", 0); + + /* "pandas/msgpack.pyx":529 + * cdef char* buf + * cdef Py_ssize_t buf_len + * if self.file_like is not None: # <<<<<<<<<<<<<< + * raise TypeError( + * "unpacker.feed() is not be able to use with `file_like`.") + */ + __pyx_t_1 = (__pyx_v_self->file_like != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/msgpack.pyx":530 + * cdef Py_ssize_t buf_len + * if self.file_like is not None: + * raise TypeError( # <<<<<<<<<<<<<< + * "unpacker.feed() is not be able to use with `file_like`.") + * PyObject_AsReadBuffer(next_bytes, &buf, &buf_len) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":532 + * raise TypeError( + * "unpacker.feed() is not be able to use with `file_like`.") + * PyObject_AsReadBuffer(next_bytes, &buf, &buf_len) # <<<<<<<<<<<<<< + * self.append_buffer(buf, buf_len) + * + */ + __pyx_t_4 = PyObject_AsReadBuffer(__pyx_v_next_bytes, ((const void* *)(&__pyx_v_buf)), (&__pyx_v_buf_len)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":533 + * "unpacker.feed() is not be able to use with `file_like`.") + * PyObject_AsReadBuffer(next_bytes, &buf, &buf_len) + * self.append_buffer(buf, buf_len) # <<<<<<<<<<<<<< + * + * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->append_buffer(__pyx_v_self, __pyx_v_buf, __pyx_v_buf_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/msgpack.pyx":525 + * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) + * + * def feed(self, object next_bytes): # <<<<<<<<<<<<<< + * """Append `next_bytes` to internal buffer.""" + * cdef char* buf + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":535 + * self.append_buffer(buf, buf_len) + * + * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): # <<<<<<<<<<<<<< + * cdef: + * char* buf = self.buf + */ + +static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker_append_buffer(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, void *__pyx_v__buf, Py_ssize_t __pyx_v__buf_len) { + char *__pyx_v_buf; + char *__pyx_v_new_buf; + size_t __pyx_v_head; + size_t __pyx_v_tail; + size_t __pyx_v_buf_size; + size_t __pyx_v_new_size; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + size_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_5; + size_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append_buffer", 0); + + /* "pandas/msgpack.pyx":537 + * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): + * cdef: + * char* buf = self.buf # <<<<<<<<<<<<<< + * char* new_buf + * size_t head = self.buf_head + */ + __pyx_t_1 = __pyx_v_self->buf; + __pyx_v_buf = __pyx_t_1; + + /* "pandas/msgpack.pyx":539 + * char* buf = self.buf + * char* new_buf + * size_t head = self.buf_head # <<<<<<<<<<<<<< + * size_t tail = self.buf_tail + * size_t buf_size = self.buf_size + */ + __pyx_t_2 = __pyx_v_self->buf_head; + __pyx_v_head = __pyx_t_2; + + /* "pandas/msgpack.pyx":540 + * char* new_buf + * size_t head = self.buf_head + * size_t tail = self.buf_tail # <<<<<<<<<<<<<< + * size_t buf_size = self.buf_size + * size_t new_size + */ + __pyx_t_2 = __pyx_v_self->buf_tail; + __pyx_v_tail = __pyx_t_2; + + /* "pandas/msgpack.pyx":541 + * size_t head = self.buf_head + * size_t tail = self.buf_tail + * size_t buf_size = self.buf_size # <<<<<<<<<<<<<< + * size_t new_size + * + */ + __pyx_t_2 = __pyx_v_self->buf_size; + __pyx_v_buf_size = __pyx_t_2; + + /* "pandas/msgpack.pyx":544 + * size_t new_size + * + * if tail + _buf_len > buf_size: # <<<<<<<<<<<<<< + * if ((tail - head) + _buf_len) <= buf_size: + * # move to front. + */ + __pyx_t_3 = (((__pyx_v_tail + __pyx_v__buf_len) > __pyx_v_buf_size) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":545 + * + * if tail + _buf_len > buf_size: + * if ((tail - head) + _buf_len) <= buf_size: # <<<<<<<<<<<<<< + * # move to front. + * memmove(buf, buf + head, tail - head) + */ + __pyx_t_3 = ((((__pyx_v_tail - __pyx_v_head) + __pyx_v__buf_len) <= __pyx_v_buf_size) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":547 + * if ((tail - head) + _buf_len) <= buf_size: + * # move to front. + * memmove(buf, buf + head, tail - head) # <<<<<<<<<<<<<< + * tail -= head + * head = 0 + */ + memmove(__pyx_v_buf, (__pyx_v_buf + __pyx_v_head), (__pyx_v_tail - __pyx_v_head)); + + /* "pandas/msgpack.pyx":548 + * # move to front. + * memmove(buf, buf + head, tail - head) + * tail -= head # <<<<<<<<<<<<<< + * head = 0 + * else: + */ + __pyx_v_tail = (__pyx_v_tail - __pyx_v_head); + + /* "pandas/msgpack.pyx":549 + * memmove(buf, buf + head, tail - head) + * tail -= head + * head = 0 # <<<<<<<<<<<<<< + * else: + * # expand buffer. + */ + __pyx_v_head = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/msgpack.pyx":552 + * else: + * # expand buffer. + * new_size = (tail-head) + _buf_len # <<<<<<<<<<<<<< + * if new_size > self.max_buffer_size: + * raise BufferFull + */ + __pyx_v_new_size = ((__pyx_v_tail - __pyx_v_head) + __pyx_v__buf_len); + + /* "pandas/msgpack.pyx":553 + * # expand buffer. + * new_size = (tail-head) + _buf_len + * if new_size > self.max_buffer_size: # <<<<<<<<<<<<<< + * raise BufferFull + * new_size = min(new_size*2, self.max_buffer_size) + */ + __pyx_t_3 = ((__pyx_v_new_size > __pyx_v_self->max_buffer_size) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":554 + * new_size = (tail-head) + _buf_len + * if new_size > self.max_buffer_size: + * raise BufferFull # <<<<<<<<<<<<<< + * new_size = min(new_size*2, self.max_buffer_size) + * new_buf = malloc(new_size) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferFull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":555 + * if new_size > self.max_buffer_size: + * raise BufferFull + * new_size = min(new_size*2, self.max_buffer_size) # <<<<<<<<<<<<<< + * new_buf = malloc(new_size) + * if new_buf == NULL: + */ + __pyx_t_2 = __pyx_v_self->max_buffer_size; + __pyx_t_5 = (__pyx_v_new_size * 2); + if (((__pyx_t_2 < __pyx_t_5) != 0)) { + __pyx_t_6 = __pyx_t_2; + } else { + __pyx_t_6 = __pyx_t_5; + } + __pyx_v_new_size = __pyx_t_6; + + /* "pandas/msgpack.pyx":556 + * raise BufferFull + * new_size = min(new_size*2, self.max_buffer_size) + * new_buf = malloc(new_size) # <<<<<<<<<<<<<< + * if new_buf == NULL: + * # self.buf still holds old buffer and will be freed during + */ + __pyx_v_new_buf = ((char *)malloc(__pyx_v_new_size)); + + /* "pandas/msgpack.pyx":557 + * new_size = min(new_size*2, self.max_buffer_size) + * new_buf = malloc(new_size) + * if new_buf == NULL: # <<<<<<<<<<<<<< + * # self.buf still holds old buffer and will be freed during + * # obj destruction + */ + __pyx_t_3 = ((__pyx_v_new_buf == NULL) != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":560 + * # self.buf still holds old buffer and will be freed during + * # obj destruction + * raise MemoryError("Unable to enlarge internal buffer.") # <<<<<<<<<<<<<< + * memcpy(new_buf, buf + head, tail - head) + * free(buf) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/msgpack.pyx":561 + * # obj destruction + * raise MemoryError("Unable to enlarge internal buffer.") + * memcpy(new_buf, buf + head, tail - head) # <<<<<<<<<<<<<< + * free(buf) + * + */ + memcpy(__pyx_v_new_buf, (__pyx_v_buf + __pyx_v_head), (__pyx_v_tail - __pyx_v_head)); + + /* "pandas/msgpack.pyx":562 + * raise MemoryError("Unable to enlarge internal buffer.") + * memcpy(new_buf, buf + head, tail - head) + * free(buf) # <<<<<<<<<<<<<< + * + * buf = new_buf + */ + free(__pyx_v_buf); + + /* "pandas/msgpack.pyx":564 + * free(buf) + * + * buf = new_buf # <<<<<<<<<<<<<< + * buf_size = new_size + * tail -= head + */ + __pyx_v_buf = __pyx_v_new_buf; + + /* "pandas/msgpack.pyx":565 + * + * buf = new_buf + * buf_size = new_size # <<<<<<<<<<<<<< + * tail -= head + * head = 0 + */ + __pyx_v_buf_size = __pyx_v_new_size; + + /* "pandas/msgpack.pyx":566 + * buf = new_buf + * buf_size = new_size + * tail -= head # <<<<<<<<<<<<<< + * head = 0 + * + */ + __pyx_v_tail = (__pyx_v_tail - __pyx_v_head); + + /* "pandas/msgpack.pyx":567 + * buf_size = new_size + * tail -= head + * head = 0 # <<<<<<<<<<<<<< + * + * memcpy(buf + tail, (_buf), _buf_len) + */ + __pyx_v_head = 0; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":569 + * head = 0 + * + * memcpy(buf + tail, (_buf), _buf_len) # <<<<<<<<<<<<<< + * self.buf = buf + * self.buf_head = head + */ + memcpy((__pyx_v_buf + __pyx_v_tail), ((char *)__pyx_v__buf), __pyx_v__buf_len); + + /* "pandas/msgpack.pyx":570 + * + * memcpy(buf + tail, (_buf), _buf_len) + * self.buf = buf # <<<<<<<<<<<<<< + * self.buf_head = head + * self.buf_size = buf_size + */ + __pyx_v_self->buf = __pyx_v_buf; + + /* "pandas/msgpack.pyx":571 + * memcpy(buf + tail, (_buf), _buf_len) + * self.buf = buf + * self.buf_head = head # <<<<<<<<<<<<<< + * self.buf_size = buf_size + * self.buf_tail = tail + _buf_len + */ + __pyx_v_self->buf_head = __pyx_v_head; + + /* "pandas/msgpack.pyx":572 + * self.buf = buf + * self.buf_head = head + * self.buf_size = buf_size # <<<<<<<<<<<<<< + * self.buf_tail = tail + _buf_len + * + */ + __pyx_v_self->buf_size = __pyx_v_buf_size; + + /* "pandas/msgpack.pyx":573 + * self.buf_head = head + * self.buf_size = buf_size + * self.buf_tail = tail + _buf_len # <<<<<<<<<<<<<< + * + * cdef read_from_file(self): + */ + __pyx_v_self->buf_tail = (__pyx_v_tail + __pyx_v__buf_len); + + /* "pandas/msgpack.pyx":535 + * self.append_buffer(buf, buf_len) + * + * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): # <<<<<<<<<<<<<< + * cdef: + * char* buf = self.buf + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.append_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":575 + * self.buf_tail = tail + _buf_len + * + * cdef read_from_file(self): # <<<<<<<<<<<<<< + * next_bytes = self.file_like_read( + * min(self.read_size, + */ + +static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker_read_from_file(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + PyObject *__pyx_v_next_bytes = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + size_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + size_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_from_file", 0); + + /* "pandas/msgpack.pyx":578 + * next_bytes = self.file_like_read( + * min(self.read_size, + * self.max_buffer_size - (self.buf_tail - self.buf_head) # <<<<<<<<<<<<<< + * )) + * if next_bytes: + */ + __pyx_t_1 = (__pyx_v_self->max_buffer_size - (__pyx_v_self->buf_tail - __pyx_v_self->buf_head)); + + /* "pandas/msgpack.pyx":577 + * cdef read_from_file(self): + * next_bytes = self.file_like_read( + * min(self.read_size, # <<<<<<<<<<<<<< + * self.max_buffer_size - (self.buf_tail - self.buf_head) + * )) + */ + __pyx_t_2 = __pyx_v_self->read_size; + + /* "pandas/msgpack.pyx":578 + * next_bytes = self.file_like_read( + * min(self.read_size, + * self.max_buffer_size - (self.buf_tail - self.buf_head) # <<<<<<<<<<<<<< + * )) + * if next_bytes: + */ + if (((__pyx_t_1 < __pyx_t_2) != 0)) { + __pyx_t_3 = __pyx_t_1; + } else { + __pyx_t_3 = __pyx_t_2; + } + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/msgpack.pyx":576 + * + * cdef read_from_file(self): + * next_bytes = self.file_like_read( # <<<<<<<<<<<<<< + * min(self.read_size, + * self.max_buffer_size - (self.buf_tail - self.buf_head) + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_self->file_like_read, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_next_bytes = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":580 + * self.max_buffer_size - (self.buf_tail - self.buf_head) + * )) + * if next_bytes: # <<<<<<<<<<<<<< + * self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes)) + * else: + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_next_bytes); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + + /* "pandas/msgpack.pyx":581 + * )) + * if next_bytes: + * self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes)) # <<<<<<<<<<<<<< + * else: + * self.file_like = None + */ + __pyx_t_7 = PyBytes_AsString(__pyx_v_next_bytes); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyBytes_Size(__pyx_v_next_bytes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->append_buffer(__pyx_v_self, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/msgpack.pyx":583 + * self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes)) + * else: + * self.file_like = None # <<<<<<<<<<<<<< + * + * cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->file_like); + __Pyx_DECREF(__pyx_v_self->file_like); + __pyx_v_self->file_like = Py_None; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":575 + * self.buf_tail = tail + _buf_len + * + * cdef read_from_file(self): # <<<<<<<<<<<<<< + * next_bytes = self.file_like_read( + * min(self.read_size, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_next_bytes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":585 + * self.file_like = None + * + * cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<< + * cdef int ret + * cdef object obj + */ + +static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker__unpack(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, execute_fn __pyx_v_execute, PyObject *__pyx_v_write_bytes, struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack *__pyx_optional_args) { + int __pyx_v_iter = ((int)0); + int __pyx_v_ret; + PyObject *__pyx_v_obj = 0; + size_t __pyx_v_prev_head; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + size_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unpack", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_iter = __pyx_optional_args->iter; + } + } + + /* "pandas/msgpack.pyx":589 + * cdef object obj + * cdef size_t prev_head + * while 1: # <<<<<<<<<<<<<< + * prev_head = self.buf_head + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) + */ + while (1) { + + /* "pandas/msgpack.pyx":590 + * cdef size_t prev_head + * while 1: + * prev_head = self.buf_head # <<<<<<<<<<<<<< + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) + * if write_bytes is not None: + */ + __pyx_t_1 = __pyx_v_self->buf_head; + __pyx_v_prev_head = __pyx_t_1; + + /* "pandas/msgpack.pyx":591 + * while 1: + * prev_head = self.buf_head + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) # <<<<<<<<<<<<<< + * if write_bytes is not None: + * write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) + */ + __pyx_t_2 = __pyx_v_execute((&__pyx_v_self->ctx), __pyx_v_self->buf, __pyx_v_self->buf_tail, (&__pyx_v_self->buf_head)); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ret = __pyx_t_2; + + /* "pandas/msgpack.pyx":592 + * prev_head = self.buf_head + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) + * if write_bytes is not None: # <<<<<<<<<<<<<< + * write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) + * + */ + __pyx_t_3 = (__pyx_v_write_bytes != Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/msgpack.pyx":593 + * ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) + * if write_bytes is not None: + * write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) # <<<<<<<<<<<<<< + * + * if ret == 1: + */ + __pyx_t_5 = PyBytes_FromStringAndSize((__pyx_v_self->buf + __pyx_v_prev_head), (__pyx_v_self->buf_head - __pyx_v_prev_head)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_write_bytes, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/msgpack.pyx":599 + * template_init(&self.ctx) + * return obj + * elif ret == 0: # <<<<<<<<<<<<<< + * if self.file_like is not None: + * self.read_from_file() + */ + switch (__pyx_v_ret) { + + /* "pandas/msgpack.pyx":595 + * write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) + * + * if ret == 1: # <<<<<<<<<<<<<< + * obj = template_data(&self.ctx) + * template_init(&self.ctx) + */ + case 1: + + /* "pandas/msgpack.pyx":596 + * + * if ret == 1: + * obj = template_data(&self.ctx) # <<<<<<<<<<<<<< + * template_init(&self.ctx) + * return obj + */ + __pyx_t_5 = template_data((&__pyx_v_self->ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_obj = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/msgpack.pyx":597 + * if ret == 1: + * obj = template_data(&self.ctx) + * template_init(&self.ctx) # <<<<<<<<<<<<<< + * return obj + * elif ret == 0: + */ + template_init((&__pyx_v_self->ctx)); + + /* "pandas/msgpack.pyx":598 + * obj = template_data(&self.ctx) + * template_init(&self.ctx) + * return obj # <<<<<<<<<<<<<< + * elif ret == 0: + * if self.file_like is not None: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + break; + + /* "pandas/msgpack.pyx":599 + * template_init(&self.ctx) + * return obj + * elif ret == 0: # <<<<<<<<<<<<<< + * if self.file_like is not None: + * self.read_from_file() + */ + case 0: + + /* "pandas/msgpack.pyx":600 + * return obj + * elif ret == 0: + * if self.file_like is not None: # <<<<<<<<<<<<<< + * self.read_from_file() + * continue + */ + __pyx_t_4 = (__pyx_v_self->file_like != Py_None); + __pyx_t_3 = (__pyx_t_4 != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":601 + * elif ret == 0: + * if self.file_like is not None: + * self.read_from_file() # <<<<<<<<<<<<<< + * continue + * if iter: + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->read_from_file(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/msgpack.pyx":602 + * if self.file_like is not None: + * self.read_from_file() + * continue # <<<<<<<<<<<<<< + * if iter: + * raise StopIteration("No more data to unpack.") + */ + goto __pyx_L3_continue; + } + + /* "pandas/msgpack.pyx":603 + * self.read_from_file() + * continue + * if iter: # <<<<<<<<<<<<<< + * raise StopIteration("No more data to unpack.") + * else: + */ + __pyx_t_3 = (__pyx_v_iter != 0); + if (__pyx_t_3) { + + /* "pandas/msgpack.pyx":604 + * continue + * if iter: + * raise StopIteration("No more data to unpack.") # <<<<<<<<<<<<<< + * else: + * raise OutOfData("No more data to unpack.") + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_StopIteration, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/msgpack.pyx":606 + * raise StopIteration("No more data to unpack.") + * else: + * raise OutOfData("No more data to unpack.") # <<<<<<<<<<<<<< + * else: + * raise ValueError("Unpack failed: error = %d" % (ret,)) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfData); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + default: + + /* "pandas/msgpack.pyx":608 + * raise OutOfData("No more data to unpack.") + * else: + * raise ValueError("Unpack failed: error = %d" % (ret,)) # <<<<<<<<<<<<<< + * + * def read_bytes(self, Py_ssize_t nbytes): + */ + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Unpack_failed_error_d, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + __pyx_L3_continue:; + } + + /* "pandas/msgpack.pyx":585 + * self.file_like = None + * + * cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<< + * cdef int ret + * cdef object obj + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.msgpack.Unpacker._unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":610 + * raise ValueError("Unpack failed: error = %d" % (ret,)) + * + * def read_bytes(self, Py_ssize_t nbytes): # <<<<<<<<<<<<<< + * """read a specified number of raw bytes from the stream""" + * cdef size_t nread + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_9read_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_8read_bytes[] = "Unpacker.read_bytes(self, Py_ssize_t nbytes)\nread a specified number of raw bytes from the stream"; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_9read_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes) { + Py_ssize_t __pyx_v_nbytes; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_bytes (wrapper)", 0); + assert(__pyx_arg_nbytes); { + __pyx_v_nbytes = __Pyx_PyIndex_AsSsize_t(__pyx_arg_nbytes); if (unlikely((__pyx_v_nbytes == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_8read_bytes(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), ((Py_ssize_t)__pyx_v_nbytes)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_8read_bytes(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, Py_ssize_t __pyx_v_nbytes) { + size_t __pyx_v_nread; + PyObject *__pyx_v_ret = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + size_t __pyx_t_2; + size_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_bytes", 0); + + /* "pandas/msgpack.pyx":613 + * """read a specified number of raw bytes from the stream""" + * cdef size_t nread + * nread = min(self.buf_tail - self.buf_head, nbytes) # <<<<<<<<<<<<<< + * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) + * self.buf_head += nread + */ + __pyx_t_1 = __pyx_v_nbytes; + __pyx_t_2 = (__pyx_v_self->buf_tail - __pyx_v_self->buf_head); + if (((__pyx_t_1 < __pyx_t_2) != 0)) { + __pyx_t_3 = __pyx_t_1; + } else { + __pyx_t_3 = __pyx_t_2; + } + __pyx_v_nread = __pyx_t_3; + + /* "pandas/msgpack.pyx":614 + * cdef size_t nread + * nread = min(self.buf_tail - self.buf_head, nbytes) + * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) # <<<<<<<<<<<<<< + * self.buf_head += nread + * if len(ret) < nbytes and self.file_like is not None: + */ + __pyx_t_4 = PyBytes_FromStringAndSize((__pyx_v_self->buf + __pyx_v_self->buf_head), __pyx_v_nread); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_ret = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":615 + * nread = min(self.buf_tail - self.buf_head, nbytes) + * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) + * self.buf_head += nread # <<<<<<<<<<<<<< + * if len(ret) < nbytes and self.file_like is not None: + * ret += self.file_like.read(nbytes - len(ret)) + */ + __pyx_v_self->buf_head = (__pyx_v_self->buf_head + __pyx_v_nread); + + /* "pandas/msgpack.pyx":616 + * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) + * self.buf_head += nread + * if len(ret) < nbytes and self.file_like is not None: # <<<<<<<<<<<<<< + * ret += self.file_like.read(nbytes - len(ret)) + * return ret + */ + __pyx_t_1 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_1 < __pyx_v_nbytes) != 0); + if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_self->file_like != Py_None); + __pyx_t_7 = (__pyx_t_6 != 0); + } else { + __pyx_t_7 = __pyx_t_5; + } + if (__pyx_t_7) { + + /* "pandas/msgpack.pyx":617 + * self.buf_head += nread + * if len(ret) < nbytes and self.file_like is not None: + * ret += self.file_like.read(nbytes - len(ret)) # <<<<<<<<<<<<<< + * return ret + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->file_like, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromSsize_t((__pyx_v_nbytes - __pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/msgpack.pyx":618 + * if len(ret) < nbytes and self.file_like is not None: + * ret += self.file_like.read(nbytes - len(ret)) + * return ret # <<<<<<<<<<<<<< + * + * def unpack(self, object write_bytes=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":610 + * raise ValueError("Unpack failed: error = %d" % (ret,)) + * + * def read_bytes(self, Py_ssize_t nbytes): # <<<<<<<<<<<<<< + * """read a specified number of raw bytes from the stream""" + * cdef size_t nread + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ret); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":620 + * return ret + * + * def unpack(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """ + * unpack one object + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_10unpack[] = "Unpacker.unpack(self, write_bytes=None)\n\n unpack one object\n\n If write_bytes is not None, it will be called with parts of the raw\n message as it is unpacked.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_write_bytes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unpack (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_write_bytes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("unpack", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_10unpack(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_10unpack(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unpack", 0); + + /* "pandas/msgpack.pyx":629 + * Raises `OutOfData` when there are no more bytes to unpack. + * """ + * return self._unpack(template_construct, write_bytes) # <<<<<<<<<<<<<< + * + * def skip(self, object write_bytes=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_construct, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":620 + * return ret + * + * def unpack(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """ + * unpack one object + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":631 + * return self._unpack(template_construct, write_bytes) + * + * def skip(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """ + * read and ignore one object, returning None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_13skip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_12skip[] = "Unpacker.skip(self, write_bytes=None)\n\n read and ignore one object, returning None\n\n If write_bytes is not None, it will be called with parts of the raw\n message as it is unpacked.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_13skip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_write_bytes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("skip (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "skip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_write_bytes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("skip", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.skip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_12skip(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_12skip(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("skip", 0); + + /* "pandas/msgpack.pyx":640 + * Raises `OutOfData` when there are no more bytes to unpack. + * """ + * return self._unpack(template_skip, write_bytes) # <<<<<<<<<<<<<< + * + * def read_array_header(self, object write_bytes=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_skip, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":631 + * return self._unpack(template_construct, write_bytes) + * + * def skip(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """ + * read and ignore one object, returning None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.skip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":642 + * return self._unpack(template_skip, write_bytes) + * + * def read_array_header(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """assuming the next object is an array, return its size n, such that + * the next n unpack() calls will iterate over its contents. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_15read_array_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_14read_array_header[] = "Unpacker.read_array_header(self, write_bytes=None)\nassuming the next object is an array, return its size n, such that\n the next n unpack() calls will iterate over its contents.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_15read_array_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_write_bytes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_array_header (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_array_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_write_bytes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read_array_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_14read_array_header(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_14read_array_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_array_header", 0); + + /* "pandas/msgpack.pyx":648 + * Raises `OutOfData` when there are no more bytes to unpack. + * """ + * return self._unpack(read_array_header, write_bytes) # <<<<<<<<<<<<<< + * + * def read_map_header(self, object write_bytes=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, read_array_header, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":642 + * return self._unpack(template_skip, write_bytes) + * + * def read_array_header(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """assuming the next object is an array, return its size n, such that + * the next n unpack() calls will iterate over its contents. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":650 + * return self._unpack(read_array_header, write_bytes) + * + * def read_map_header(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """assuming the next object is a map, return its size n, such that the + * next n * 2 unpack() calls will iterate over its key-value pairs. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_17read_map_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_7msgpack_8Unpacker_16read_map_header[] = "Unpacker.read_map_header(self, write_bytes=None)\nassuming the next object is a map, return its size n, such that the\n next n * 2 unpack() calls will iterate over its key-value pairs.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n "; +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_17read_map_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_write_bytes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_map_header (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_map_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_write_bytes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read_map_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_16read_map_header(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_16read_map_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_map_header", 0); + + /* "pandas/msgpack.pyx":656 + * Raises `OutOfData` when there are no more bytes to unpack. + * """ + * return self._unpack(read_map_header, write_bytes) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, read_map_header, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":650 + * return self._unpack(read_array_header, write_bytes) + * + * def read_map_header(self, object write_bytes=None): # <<<<<<<<<<<<<< + * """assuming the next object is a map, return its size n, such that the + * next n * 2 unpack() calls will iterate over its key-value pairs. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.read_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":658 + * return self._unpack(read_map_header, write_bytes) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_19__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_19__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_18__iter__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_18__iter__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "pandas/msgpack.pyx":659 + * + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/msgpack.pyx":658 + * return self._unpack(read_map_header, write_bytes) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/msgpack.pyx":661 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * return self._unpack(template_construct, None, 1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_21__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_21__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_20__next__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_20__next__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "pandas/msgpack.pyx":662 + * + * def __next__(self): + * return self._unpack(template_construct, None, 1) # <<<<<<<<<<<<<< + * + * # for debug. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.iter = 1; + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_construct, Py_None, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/msgpack.pyx":661 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * return self._unpack(template_construct, None, 1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.msgpack.Unpacker.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6pandas_7msgpack_Packer __pyx_vtable_6pandas_7msgpack_Packer; + +static PyObject *__pyx_tp_new_6pandas_7msgpack_Packer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_7msgpack_Packer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7msgpack_Packer *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7msgpack_Packer; + p->_default = Py_None; Py_INCREF(Py_None); + p->_bencoding = Py_None; Py_INCREF(Py_None); + p->_berrors = Py_None; Py_INCREF(Py_None); + p->use_float = ((PyBoolObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_7msgpack_6Packer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_7msgpack_Packer(PyObject *o) { + struct __pyx_obj_6pandas_7msgpack_Packer *p = (struct __pyx_obj_6pandas_7msgpack_Packer *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_7msgpack_6Packer_5__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->_default); + Py_CLEAR(p->_bencoding); + Py_CLEAR(p->_berrors); + Py_CLEAR(p->use_float); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_7msgpack_Packer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7msgpack_Packer *p = (struct __pyx_obj_6pandas_7msgpack_Packer *)o; + if (p->_default) { + e = (*v)(p->_default, a); if (e) return e; + } + if (p->_bencoding) { + e = (*v)(p->_bencoding, a); if (e) return e; + } + if (p->_berrors) { + e = (*v)(p->_berrors, a); if (e) return e; + } + if (p->use_float) { + e = (*v)(((PyObject*)p->use_float), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7msgpack_Packer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7msgpack_Packer *p = (struct __pyx_obj_6pandas_7msgpack_Packer *)o; + tmp = ((PyObject*)p->_default); + p->_default = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_bencoding); + p->_bencoding = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_berrors); + p->_berrors = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->use_float); + p->use_float = ((PyBoolObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_7msgpack_Packer[] = { + {__Pyx_NAMESTR("pack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_7pack, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_6pack)}, + {__Pyx_NAMESTR("pack_array_header"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_9pack_array_header, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_8pack_array_header)}, + {__Pyx_NAMESTR("pack_map_header"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_11pack_map_header, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_10pack_map_header)}, + {__Pyx_NAMESTR("pack_map_pairs"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_13pack_map_pairs, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_12pack_map_pairs)}, + {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_15reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_14reset)}, + {__Pyx_NAMESTR("bytes"), (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_17bytes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6Packer_16bytes)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7msgpack_Packer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.msgpack.Packer"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7msgpack_Packer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7msgpack_Packer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Packer(default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False, bool autoreset=1)\nMessagePack Packer\n\n usage:\n\n packer = Packer()\n astream.write(packer.pack(a))\n astream.write(packer.pack(b))\n\n Packer's constructor has some keyword arguments:\n\n * *defaut* - Convert user type to builtin type that Packer supports.\n See also simplejson's document.\n * *encoding* - Convert unicode to bytes with this encoding. (default: 'utf-8')\n * *unicode_errors* - Error handler for encoding unicode. (default: 'strict')\n * *use_single_float* - Use single precision float type for float. (default: False)\n * *autoreset* - Reset buffer after each pack and return it's content as `bytes`. (default: True).\n If set this to false, use `bytes()` to get content and `.reset()` to clear buffer.\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7msgpack_Packer, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7msgpack_Packer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7msgpack_Packer, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7msgpack_6Packer_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7msgpack_Packer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker __pyx_vtable_6pandas_7msgpack_Unpacker; + +static PyObject *__pyx_tp_new_6pandas_7msgpack_Unpacker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_7msgpack_Unpacker *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7msgpack_Unpacker *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7msgpack_Unpacker; + p->file_like = Py_None; Py_INCREF(Py_None); + p->file_like_read = Py_None; Py_INCREF(Py_None); + p->object_hook = Py_None; Py_INCREF(Py_None); + p->encoding = Py_None; Py_INCREF(Py_None); + p->unicode_errors = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_7msgpack_8Unpacker_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_7msgpack_Unpacker(PyObject *o) { + struct __pyx_obj_6pandas_7msgpack_Unpacker *p = (struct __pyx_obj_6pandas_7msgpack_Unpacker *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_7msgpack_8Unpacker_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->file_like); + Py_CLEAR(p->file_like_read); + Py_CLEAR(p->object_hook); + Py_CLEAR(p->encoding); + Py_CLEAR(p->unicode_errors); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_7msgpack_Unpacker(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7msgpack_Unpacker *p = (struct __pyx_obj_6pandas_7msgpack_Unpacker *)o; + if (p->file_like) { + e = (*v)(p->file_like, a); if (e) return e; + } + if (p->file_like_read) { + e = (*v)(p->file_like_read, a); if (e) return e; + } + if (p->object_hook) { + e = (*v)(p->object_hook, a); if (e) return e; + } + if (p->encoding) { + e = (*v)(p->encoding, a); if (e) return e; + } + if (p->unicode_errors) { + e = (*v)(p->unicode_errors, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7msgpack_Unpacker(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7msgpack_Unpacker *p = (struct __pyx_obj_6pandas_7msgpack_Unpacker *)o; + tmp = ((PyObject*)p->file_like); + p->file_like = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->file_like_read); + p->file_like_read = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->object_hook); + p->object_hook = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->encoding); + p->encoding = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->unicode_errors); + p->unicode_errors = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_7msgpack_Unpacker[] = { + {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_7feed, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_6feed)}, + {__Pyx_NAMESTR("read_bytes"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_9read_bytes, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_8read_bytes)}, + {__Pyx_NAMESTR("unpack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_11unpack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_10unpack)}, + {__Pyx_NAMESTR("skip"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_13skip, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_12skip)}, + {__Pyx_NAMESTR("read_array_header"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_15read_array_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_14read_array_header)}, + {__Pyx_NAMESTR("read_map_header"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_17read_map_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_8Unpacker_16read_map_header)}, + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_6pandas_7msgpack_8Unpacker_21__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7msgpack_Unpacker = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.msgpack.Unpacker"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7msgpack_Unpacker), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7msgpack_Unpacker, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Unpacker(file_like=None, Py_ssize_t read_size=0, bool use_list=1, object_hook=None, object_pairs_hook=None, list_hook=None, encoding=None, unicode_errors='strict', int max_buffer_size=0)\n\n Streaming unpacker.\n\n `file_like` is a file-like object having `.read(n)` method.\n When `Unpacker` initialized with `file_like`, unpacker reads serialized data\n from it and `.feed()` method is not usable.\n\n `read_size` is used as `file_like.read(read_size)`.\n (default: min(1024**2, max_buffer_size))\n\n If `use_list` is true (default), msgpack list is deserialized to Python list.\n Otherwise, it is deserialized to Python tuple.\n\n `object_hook` is same to simplejson. If it is not None, it should be callable\n and Unpacker calls it with a dict argument after deserializing a map.\n\n `object_pairs_hook` is same to simplejson. If it is not None, it should be callable\n and Unpacker calls it with a list of key-value pairs after deserializing a map.\n\n `encoding` is encoding used for decoding msgpack bytes. If it is None (default),\n msgpack bytes is deserialized to Python bytes.\n\n `unicode_errors` is used for decoding bytes.\n\n `max_buffer_size` limits size of data waiting unpacked.\n 0 means system's INT_MAX (default).\n Raises `BufferFull` exception when it is insufficient.\n You shoud set this parameter when unpacking data from untrasted source.\n\n example of streaming deserialize from file-like object::\n\n unpacker = Unpacker(file_like)\n for o in unpacker:\n do_something(o)\n\n example of streaming deserialize from socket::\n\n unpacker = Unpacker()\n while 1:\n buf = sock.recv(1024**2)\n if not buf:\n break\n unpacker.feed(buf)\n for o in unpacker:\n do_something(o)\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7msgpack_Unpacker, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7msgpack_Unpacker, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6pandas_7msgpack_8Unpacker_19__iter__, /*tp_iter*/ + __pyx_pw_6pandas_7msgpack_8Unpacker_21__next__, /*tp_iternext*/ + __pyx_methods_6pandas_7msgpack_Unpacker, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7msgpack_8Unpacker_5__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7msgpack_Unpacker, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("msgpack"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_BufferFull, __pyx_k_BufferFull, sizeof(__pyx_k_BufferFull), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_t_encode_unicode_string_no_e, __pyx_k_Can_t_encode_unicode_string_no_e, sizeof(__pyx_k_Can_t_encode_unicode_string_no_e), 0, 0, 1, 0}, + {&__pyx_n_s_ExtraData, __pyx_k_ExtraData, sizeof(__pyx_k_ExtraData), 0, 0, 1, 1}, + {&__pyx_n_s_ExtraData___init, __pyx_k_ExtraData___init, sizeof(__pyx_k_ExtraData___init), 0, 0, 1, 1}, + {&__pyx_n_s_ExtraData___str, __pyx_k_ExtraData___str, sizeof(__pyx_k_ExtraData___str), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_No_more_data_to_unpack, __pyx_k_No_more_data_to_unpack, sizeof(__pyx_k_No_more_data_to_unpack), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_OutOfData, __pyx_k_OutOfData, sizeof(__pyx_k_OutOfData), 0, 0, 1, 1}, + {&__pyx_n_s_PackException, __pyx_k_PackException, sizeof(__pyx_k_PackException), 0, 0, 1, 1}, + {&__pyx_n_s_PackValueError, __pyx_k_PackValueError, sizeof(__pyx_k_PackValueError), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_allocate_internal_buff, __pyx_k_Unable_to_allocate_internal_buff, sizeof(__pyx_k_Unable_to_allocate_internal_buff), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_enlarge_internal_buffe, __pyx_k_Unable_to_enlarge_internal_buffe, sizeof(__pyx_k_Unable_to_enlarge_internal_buffe), 0, 0, 1, 0}, + {&__pyx_n_s_UnpackException, __pyx_k_UnpackException, sizeof(__pyx_k_UnpackException), 0, 0, 1, 1}, + {&__pyx_n_s_UnpackValueError, __pyx_k_UnpackValueError, sizeof(__pyx_k_UnpackValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unpack_failed_error_d, __pyx_k_Unpack_failed_error_d, sizeof(__pyx_k_Unpack_failed_error_d), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, + {&__pyx_n_s_autoreset, __pyx_k_autoreset, sizeof(__pyx_k_autoreset), 0, 0, 1, 1}, + {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, + {&__pyx_n_s_buf_len, __pyx_k_buf_len, sizeof(__pyx_k_buf_len), 0, 0, 1, 1}, + {&__pyx_kp_s_can_t_serialize_r, __pyx_k_can_t_serialize_r, sizeof(__pyx_k_can_t_serialize_r), 0, 0, 1, 0}, + {&__pyx_kp_s_cannot_pack_s, __pyx_k_cannot_pack_s, sizeof(__pyx_k_cannot_pack_s), 0, 0, 1, 0}, + {&__pyx_n_s_cenc, __pyx_k_cenc, sizeof(__pyx_k_cenc), 0, 0, 1, 1}, + {&__pyx_n_s_cerr, __pyx_k_cerr, sizeof(__pyx_k_cerr), 0, 0, 1, 1}, + {&__pyx_n_s_ctx, __pyx_k_ctx, sizeof(__pyx_k_ctx), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_kp_s_default_must_be_a_callable, __pyx_k_default_must_be_a_callable, sizeof(__pyx_k_default_must_be_a_callable), 0, 0, 1, 0}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_extra, __pyx_k_extra, sizeof(__pyx_k_extra), 0, 0, 1, 1}, + {&__pyx_n_s_file_like, __pyx_k_file_like, sizeof(__pyx_k_file_like), 0, 0, 1, 1}, + {&__pyx_kp_s_file_like_read_must_be_a_callab, __pyx_k_file_like_read_must_be_a_callab, sizeof(__pyx_k_file_like_read_must_be_a_callab), 0, 0, 1, 0}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, + {&__pyx_n_s_list_hook, __pyx_k_list_hook, sizeof(__pyx_k_list_hook), 0, 0, 1, 1}, + {&__pyx_kp_s_list_hook_must_be_a_callable, __pyx_k_list_hook_must_be_a_callable, sizeof(__pyx_k_list_hook_must_be_a_callable), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max_buffer_size, __pyx_k_max_buffer_size, sizeof(__pyx_k_max_buffer_size), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object_hook, __pyx_k_object_hook, sizeof(__pyx_k_object_hook), 0, 0, 1, 1}, + {&__pyx_kp_s_object_hook_must_be_a_callable, __pyx_k_object_hook_must_be_a_callable, sizeof(__pyx_k_object_hook_must_be_a_callable), 0, 0, 1, 0}, + {&__pyx_n_s_object_pairs_hook, __pyx_k_object_pairs_hook, sizeof(__pyx_k_object_pairs_hook), 0, 0, 1, 1}, + {&__pyx_kp_s_object_pairs_hook_and_object_hoo, __pyx_k_object_pairs_hook_and_object_hoo, sizeof(__pyx_k_object_pairs_hook_and_object_hoo), 0, 0, 1, 0}, + {&__pyx_kp_s_object_pairs_hook_must_be_a_call, __pyx_k_object_pairs_hook_must_be_a_call, sizeof(__pyx_k_object_pairs_hook_must_be_a_call), 0, 0, 1, 0}, + {&__pyx_n_s_off, __pyx_k_off, sizeof(__pyx_k_off), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_packb, __pyx_k_packb, sizeof(__pyx_k_packb), 0, 0, 1, 1}, + {&__pyx_n_s_packed, __pyx_k_packed, sizeof(__pyx_k_packed), 0, 0, 1, 1}, + {&__pyx_n_s_packer, __pyx_k_packer, sizeof(__pyx_k_packer), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_msgpack, __pyx_k_pandas_msgpack, sizeof(__pyx_k_pandas_msgpack), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, + {&__pyx_n_s_read_size, __pyx_k_read_size, sizeof(__pyx_k_read_size), 0, 0, 1, 1}, + {&__pyx_kp_s_read_size_should_be_less_or_equa, __pyx_k_read_size_should_be_less_or_equa, sizeof(__pyx_k_read_size_should_be_less_or_equa), 0, 0, 1, 0}, + {&__pyx_kp_s_recursion_limit_exceeded, __pyx_k_recursion_limit_exceeded, sizeof(__pyx_k_recursion_limit_exceeded), 0, 0, 1, 0}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1}, + {&__pyx_n_s_strict, __pyx_k_strict, sizeof(__pyx_k_strict), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_unicode_errors, __pyx_k_unicode_errors, sizeof(__pyx_k_unicode_errors), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_kp_s_unpack_b_recieved_extra_data, __pyx_k_unpack_b_recieved_extra_data, sizeof(__pyx_k_unpack_b_recieved_extra_data), 0, 0, 1, 0}, + {&__pyx_n_s_unpackb, __pyx_k_unpackb, sizeof(__pyx_k_unpackb), 0, 0, 1, 1}, + {&__pyx_n_s_unpacked, __pyx_k_unpacked, sizeof(__pyx_k_unpacked), 0, 0, 1, 1}, + {&__pyx_kp_s_unpacker_feed_is_not_be_able_to, __pyx_k_unpacker_feed_is_not_be_able_to, sizeof(__pyx_k_unpacker_feed_is_not_be_able_to), 0, 0, 1, 0}, + {&__pyx_n_s_use_list, __pyx_k_use_list, sizeof(__pyx_k_use_list), 0, 0, 1, 1}, + {&__pyx_n_s_use_single_float, __pyx_k_use_single_float, sizeof(__pyx_k_use_single_float), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_write_bytes, __pyx_k_write_bytes, sizeof(__pyx_k_write_bytes), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/msgpack.pyx":131 + * self.pk.buf = malloc(buf_size); + * if self.pk.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<< + * self.pk.buf_size = buf_size + * self.pk.length = 0 + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Unable_to_allocate_internal_buff); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/msgpack.pyx":141 + * if default is not None: + * if not PyCallable_Check(default): + * raise TypeError("default must be a callable.") # <<<<<<<<<<<<<< + * self._default = default + * if encoding is None: + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_default_must_be_a_callable); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/msgpack.pyx":148 + * else: + * if isinstance(encoding, unicode): + * self._bencoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * else: + * self._bencoding = encoding + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/msgpack.pyx":153 + * self.encoding = PyBytes_AsString(self._bencoding) + * if isinstance(unicode_errors, unicode): + * self._berrors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * else: + * self._berrors = unicode_errors + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/msgpack.pyx":177 + * + * if nest_limit < 0: + * raise PackValueError("recursion limit exceeded.") # <<<<<<<<<<<<<< + * + * if o is None: + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_recursion_limit_exceeded); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/msgpack.pyx":210 + * elif PyUnicode_Check(o): + * if not self.encoding: + * raise TypeError("Can't encode unicode string: no encoding is specified") # <<<<<<<<<<<<<< + * o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) + * rawval = o + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_t_encode_unicode_string_no_e); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/msgpack.pyx":342 + * + * if object_hook is not None and object_pairs_hook is not None: + * raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") # <<<<<<<<<<<<<< + * + * if object_hook is not None: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_object_pairs_hook_and_object_hoo); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/msgpack.pyx":346 + * if object_hook is not None: + * if not PyCallable_Check(object_hook): + * raise TypeError("object_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.object_hook = object_hook + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_object_hook_must_be_a_callable); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/msgpack.pyx":353 + * else: + * if not PyCallable_Check(object_pairs_hook): + * raise TypeError("object_pairs_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.object_hook = object_pairs_hook + * ctx.user.has_pairs_hook = True + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_object_pairs_hook_must_be_a_call); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "pandas/msgpack.pyx":359 + * if list_hook is not None: + * if not PyCallable_Check(list_hook): + * raise TypeError("list_hook must be a callable.") # <<<<<<<<<<<<<< + * ctx.user.list_hook = list_hook + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_list_hook_must_be_a_callable); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "pandas/msgpack.pyx":386 + * if encoding is not None: + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * cenc = PyBytes_AsString(encoding) + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/msgpack.pyx":391 + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * cerr = PyBytes_AsString(unicode_errors) + * + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/msgpack.pyx":495 + * self.file_like_read = file_like.read + * if not PyCallable_Check(self.file_like_read): + * raise ValueError("`file_like.read` must be a callable.") # <<<<<<<<<<<<<< + * if not max_buffer_size: + * max_buffer_size = INT_MAX + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_file_like_read_must_be_a_callab); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "pandas/msgpack.pyx":499 + * max_buffer_size = INT_MAX + * if read_size > max_buffer_size: + * raise ValueError("read_size should be less or equal to max_buffer_size") # <<<<<<<<<<<<<< + * if not read_size: + * read_size = min(max_buffer_size, 1024**2) + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_read_size_should_be_less_or_equa); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/msgpack.pyx":506 + * self.buf = malloc(read_size) + * if self.buf == NULL: + * raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<< + * self.buf_size = read_size + * self.buf_head = 0 + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_allocate_internal_buff); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "pandas/msgpack.pyx":513 + * if encoding is not None: + * if isinstance(encoding, unicode): + * encoding = encoding.encode('ascii') # <<<<<<<<<<<<<< + * self.encoding = encoding + * cenc = PyBytes_AsString(encoding) + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "pandas/msgpack.pyx":519 + * if unicode_errors is not None: + * if isinstance(unicode_errors, unicode): + * unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<< + * self.unicode_errors = unicode_errors + * cerr = PyBytes_AsString(unicode_errors) + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "pandas/msgpack.pyx":530 + * cdef Py_ssize_t buf_len + * if self.file_like is not None: + * raise TypeError( # <<<<<<<<<<<<<< + * "unpacker.feed() is not be able to use with `file_like`.") + * PyObject_AsReadBuffer(next_bytes, &buf, &buf_len) + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unpacker_feed_is_not_be_able_to); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "pandas/msgpack.pyx":560 + * # self.buf still holds old buffer and will be freed during + * # obj destruction + * raise MemoryError("Unable to enlarge internal buffer.") # <<<<<<<<<<<<<< + * memcpy(new_buf, buf + head, tail - head) + * free(buf) + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_enlarge_internal_buffe); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "pandas/msgpack.pyx":604 + * continue + * if iter: + * raise StopIteration("No more data to unpack.") # <<<<<<<<<<<<<< + * else: + * raise OutOfData("No more data to unpack.") + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_No_more_data_to_unpack); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "pandas/msgpack.pyx":606 + * raise StopIteration("No more data to unpack.") + * else: + * raise OutOfData("No more data to unpack.") # <<<<<<<<<<<<<< + * else: + * raise ValueError("Unpack failed: error = %d" % (ret,)) + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_more_data_to_unpack); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/msgpack.pyx":37 + * + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): # <<<<<<<<<<<<<< + * self.unpacked = unpacked + * self.extra = extra + */ + __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_unpacked, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":41 + * self.extra = extra + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "unpack(b) recieved extra data." + * + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_str, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":320 + * return ret + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<< + * """ + * pack an object `o` and write it to stream).""" + */ + __pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_o, __pyx_n_s_stream, __pyx_n_s_default, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_packer); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pack, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":326 + * stream.write(packer.pack(o)) + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<< + * """ + * pack o and return packed bytes.""" + */ + __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_o, __pyx_n_s_default, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_use_single_float, __pyx_n_s_packer); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_packb, 326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + __pyx_tuple__37 = PyTuple_Pack(15, __pyx_n_s_packed, __pyx_n_s_object_hook, __pyx_n_s_list_hook, __pyx_n_s_use_list, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_object_pairs_hook, __pyx_n_s_ctx, __pyx_n_s_off, __pyx_n_s_ret, __pyx_n_s_buf, __pyx_n_s_buf_len, __pyx_n_s_cenc, __pyx_n_s_cerr, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_unpackb, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_s_stream, __pyx_n_s_object_hook, __pyx_n_s_list_hook, __pyx_n_s_use_list, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_object_pairs_hook); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_unpack, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initmsgpack(void); /*proto*/ +PyMODINIT_FUNC initmsgpack(void) +#else +PyMODINIT_FUNC PyInit_msgpack(void); /*proto*/ +PyMODINIT_FUNC PyInit_msgpack(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_msgpack(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("msgpack"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__msgpack) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.msgpack")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.msgpack", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_6pandas_7msgpack_Packer = &__pyx_vtable_6pandas_7msgpack_Packer; + __pyx_vtable_6pandas_7msgpack_Packer._pack = (int (*)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack *__pyx_optional_args))__pyx_f_6pandas_7msgpack_6Packer__pack; + __pyx_vtable_6pandas_7msgpack_Packer.pack = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7msgpack_6Packer_pack; + __pyx_vtable_6pandas_7msgpack_Packer.pack_pair = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, PyObject *, int))__pyx_f_6pandas_7msgpack_6Packer_pack_pair; + if (PyType_Ready(&__pyx_type_6pandas_7msgpack_Packer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7msgpack_Packer.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7msgpack_Packer.tp_dict, __pyx_vtabptr_6pandas_7msgpack_Packer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Packer", (PyObject *)&__pyx_type_6pandas_7msgpack_Packer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7msgpack_Packer = &__pyx_type_6pandas_7msgpack_Packer; + __pyx_vtabptr_6pandas_7msgpack_Unpacker = &__pyx_vtable_6pandas_7msgpack_Unpacker; + __pyx_vtable_6pandas_7msgpack_Unpacker.append_buffer = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, void *, Py_ssize_t))__pyx_f_6pandas_7msgpack_8Unpacker_append_buffer; + __pyx_vtable_6pandas_7msgpack_Unpacker.read_from_file = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Unpacker *))__pyx_f_6pandas_7msgpack_8Unpacker_read_from_file; + __pyx_vtable_6pandas_7msgpack_Unpacker._unpack = (PyObject *(*)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, execute_fn, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack *__pyx_optional_args))__pyx_f_6pandas_7msgpack_8Unpacker__unpack; + if (PyType_Ready(&__pyx_type_6pandas_7msgpack_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7msgpack_Unpacker.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7msgpack_Unpacker.tp_dict, __pyx_vtabptr_6pandas_7msgpack_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Unpacker", (PyObject *)&__pyx_type_6pandas_7msgpack_Unpacker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7msgpack_Unpacker = &__pyx_type_6pandas_7msgpack_Unpacker; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/msgpack.pyx":17 + * + * import cython + * import numpy as np # <<<<<<<<<<<<<< + * from numpy cimport * + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":20 + * from numpy cimport * + * + * class UnpackException(IOError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_builtin_IOError); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_IOError); + __Pyx_GIVEREF(__pyx_builtin_IOError); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UnpackException, __pyx_n_s_UnpackException, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UnpackException, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnpackException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":24 + * + * + * class BufferFull(UnpackException): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_BufferFull, __pyx_n_s_BufferFull, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BufferFull, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferFull, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":28 + * + * + * class OutOfData(UnpackException): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_OutOfData, __pyx_n_s_OutOfData, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OutOfData, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutOfData, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":32 + * + * + * class UnpackValueError(UnpackException, ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_UnpackValueError, __pyx_n_s_UnpackValueError, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_UnpackValueError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnpackValueError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":36 + * + * + * class ExtraData(ValueError): # <<<<<<<<<<<<<< + * def __init__(self, unpacked, extra): + * self.unpacked = unpacked + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ExtraData, __pyx_n_s_ExtraData, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/msgpack.pyx":37 + * + * class ExtraData(ValueError): + * def __init__(self, unpacked, extra): # <<<<<<<<<<<<<< + * self.unpacked = unpacked + * self.extra = extra + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_9ExtraData_1__init__, 0, __pyx_n_s_ExtraData___init, NULL, __pyx_n_s_pandas_msgpack, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":41 + * self.extra = extra + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "unpack(b) recieved extra data." + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_9ExtraData_3__str__, 0, __pyx_n_s_ExtraData___str, NULL, __pyx_n_s_pandas_msgpack, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/msgpack.pyx":36 + * + * + * class ExtraData(ValueError): # <<<<<<<<<<<<<< + * def __init__(self, unpacked, extra): + * self.unpacked = unpacked + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ExtraData, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExtraData, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":44 + * return "unpack(b) recieved extra data." + * + * class PackException(IOError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_IOError); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_IOError); + __Pyx_GIVEREF(__pyx_builtin_IOError); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PackException, __pyx_n_s_PackException, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PackException, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PackException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/msgpack.pyx":47 + * pass + * + * class PackValueError(PackException, ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PackValueError, __pyx_n_s_PackValueError, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PackValueError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PackValueError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":95 + * int msgpack_pack_raw_body(msgpack_packer* pk, char* body, size_t l) + * + * cdef int DEFAULT_RECURSE_LIMIT=511 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT = 511; + + /* "pandas/msgpack.pyx":163 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<< + * cdef long long llval + * cdef unsigned long long ullval + */ + __pyx_k__5 = __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT; + + /* "pandas/msgpack.pyx":320 + * return ret + * + * def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<< + * """ + * pack an object `o` and write it to stream).""" + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_1pack, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pack, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":326 + * stream.write(packer.pack(o)) + * + * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<< + * """ + * pack o and return packed bytes.""" + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_3packb, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_packb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":365 + * ctx.user.unicode_errors = unicode_errors + * + * def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_5unpackb, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpackb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":407 + * + * + * def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<< + * bint use_list=1, encoding=None, unicode_errors="strict", + * object_pairs_hook=None, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_7unpack, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/msgpack.pyx":1 + * # coding: utf-8 # <<<<<<<<<<<<<< + * #cython: embedsignature=True + * #cython: profile=False + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.msgpack", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.msgpack"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int is_tuple, int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + } else { + if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { + __Pyx_UnpackTupleError(tuple, 2); + goto bad; + } +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); + if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); + if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); + value2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(value1); + Py_INCREF(value2); +#endif + if (decref_tuple) { Py_DECREF(tuple); } + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; +#if !CYTHON_COMPILING_IN_PYPY + if (is_dict) { + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#endif + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(size_t)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (size_t) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(size_t) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(size_t)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(size_t) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(size_t) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong) + } else if (sizeof(size_t) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *x) { + const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned PY_LONG_LONG"); + return (unsigned PY_LONG_LONG) -1; + } + return (unsigned PY_LONG_LONG) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned PY_LONG_LONG"); + return (unsigned PY_LONG_LONG) -1; + } + if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyLong_AsLong) + } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned PY_LONG_LONG val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned PY_LONG_LONG) -1; + } + } else { + unsigned PY_LONG_LONG val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (unsigned PY_LONG_LONG) -1; + val = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) { + const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(PY_LONG_LONG) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to PY_LONG_LONG"); + return (PY_LONG_LONG) -1; + } + return (PY_LONG_LONG) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to PY_LONG_LONG"); + return (PY_LONG_LONG) -1; + } + if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(PY_LONG_LONG) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyLong_AsLong) + } else if (sizeof(PY_LONG_LONG) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + PY_LONG_LONG val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (PY_LONG_LONG) -1; + } + } else { + PY_LONG_LONG val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (PY_LONG_LONG) -1; + val = __Pyx_PyInt_As_PY_LONG_LONG(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/pandas/parser.c b/cythonized-files3/pandas/parser.c new file mode 100644 index 00000000..1c121ed8 --- /dev/null +++ b/cythonized-files3/pandas/parser.c @@ -0,0 +1,31721 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__parser +#define __PYX_HAVE_API__pandas__parser +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "pythread.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "numpy_helper.h" +#include "khash_python.h" +#include "headers/stdint.h" +#include "headers/portable.h" +#include "parser/tokenizer.h" +#include "parser/io.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "parser.pyx", + "util.pxd", + "numpy.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_6parser_TextReader; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "pandas/parser.pyx":232 + * + * + * cdef class TextReader: # <<<<<<<<<<<<<< + * ''' + * + */ +struct __pyx_obj_6pandas_6parser_TextReader { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_6parser_TextReader *__pyx_vtab; + parser_t *parser; + PyObject *file_handle; + PyObject *na_fvalues; + int na_filter; + int verbose; + int has_usecols; + int has_mi_columns; + int parser_start; + PyObject *clocks; + char *c_encoding; + int leading_cols; + int table_width; + int skip_footer; + int buffer_lines; + PyObject *allow_leading_cols; + PyObject *delimiter; + PyObject *converters; + PyObject *delim_whitespace; + PyObject *na_values; + PyObject *true_values; + PyObject *false_values; + PyObject *memory_map; + PyObject *as_recarray; + PyObject *header; + PyObject *orig_header; + PyObject *names; + PyObject *header_start; + PyObject *header_end; + PyObject *index_col; + PyObject *low_memory; + PyObject *skiprows; + PyObject *compact_ints; + PyObject *use_unsigned; + PyObject *dtype; + PyObject *encoding; + PyObject *compression; + PyObject *mangle_dupe_cols; + PyObject *tupleize_cols; + PyObject *noconvert; + PyObject *usecols; +}; + + + +struct __pyx_vtabstruct_6pandas_6parser_TextReader { + PyObject *(*_make_skiprow_set)(struct __pyx_obj_6pandas_6parser_TextReader *); + PyObject *(*_setup_parser_source)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *); + PyObject *(*_get_header)(struct __pyx_obj_6pandas_6parser_TextReader *); + PyObject *(*_implicit_index_count)(struct __pyx_obj_6pandas_6parser_TextReader *); + PyObject *(*_read_low_memory)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *); + PyObject *(*_tokenize_rows)(struct __pyx_obj_6pandas_6parser_TextReader *, size_t); + PyObject *(*_read_rows)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, int); + PyObject *(*_start_clock)(struct __pyx_obj_6pandas_6parser_TextReader *); + PyObject *(*_end_clock)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *); + PyObject *(*_convert_tokens)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, PyObject *, int, kh_str_t *, PyObject *); + PyObject *(*_convert_with_dtype)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, Py_ssize_t, int, int, int, int, kh_str_t *, PyObject *); + PyObject *(*_string_convert)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, int, kh_str_t *); + PyObject *(*_get_na_list)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, PyObject *); + PyObject *(*_free_na_set)(struct __pyx_obj_6pandas_6parser_TextReader *, kh_str_t *); + PyObject *(*_get_column_name)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, Py_ssize_t); +}; +static struct __pyx_vtabstruct_6pandas_6parser_TextReader *__pyx_vtabptr_6pandas_6parser_TextReader; +static CYTHON_INLINE PyObject *__pyx_f_6pandas_6parser_10TextReader__convert_tokens(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, PyObject *, int, kh_str_t *, PyObject *); +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*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); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/ +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /*proto*/ + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_PyObject_PopIndex(L, ix) (PyList_CheckExact(L) ? \ + __Pyx_PyList_PopIndex(L, ix) : __Pyx__PyObject_PopIndex(L, ix)) +static PyObject* __Pyx_PyList_PopIndex(PyObject* L, Py_ssize_t ix); /*proto*/ +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, Py_ssize_t ix); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +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); + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'util' */ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'pandas.parser' */ +static PyTypeObject *__pyx_ptype_6pandas_6parser_TextReader = 0; +static int __pyx_v_6pandas_6parser_PY3; +static double __pyx_v_6pandas_6parser_INF; +static double __pyx_v_6pandas_6parser_NEGINF; +static PyObject *__pyx_v_6pandas_6parser__true_values = 0; +static PyObject *__pyx_v_6pandas_6parser__false_values = 0; +static char *__pyx_v_6pandas_6parser_cinf; +static char *__pyx_v_6pandas_6parser_cneginf; +static PyObject *__pyx_v_6pandas_6parser_dtype_cast_order = 0; +static PyObject *__pyx_f_6pandas_6parser_asbytes(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__string_box_factorize(parser_t *, int, int, int, int, kh_str_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__string_box_utf8(parser_t *, int, int, int, int, kh_str_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__string_box_decode(parser_t *, int, int, int, int, kh_str_t *, char *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__to_fw_string(parser_t *, int, int, int, size_t); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__try_double(parser_t *, int, int, int, int, kh_str_t *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__try_int64(parser_t *, int, int, int, int, kh_str_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__try_bool(parser_t *, int, int, int, int, kh_str_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__try_bool_flex(parser_t *, int, int, int, int, kh_str_t *, kh_str_t *, kh_str_t *); /*proto*/ +static kh_str_t *__pyx_f_6pandas_6parser_kset_from_list(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser_raise_parser_error(PyObject *, parser_t *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__apply_converter(PyObject *, parser_t *, int, int, int, char *); /*proto*/ +static PyObject *__pyx_f_6pandas_6parser__fill_structured_column(char *, char *, int, int, int, int); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +#define __Pyx_MODULE_NAME "pandas.parser" +int __pyx_module_is_main_pandas__parser = 0; + +/* Implementation of 'pandas.parser' */ +static PyObject *__pyx_builtin_NameError; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_ord; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_IOError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_StopIteration; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_RuntimeError; +static int __pyx_pf_6pandas_6parser_10TextReader___cinit__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_delimiter, PyObject *__pyx_v_header, CYTHON_UNUSED PyObject *__pyx_v_header_start, CYTHON_UNUSED PyObject *__pyx_v_header_end, PyObject *__pyx_v_index_col, PyObject *__pyx_v_names, PyObject *__pyx_v_memory_map, PyObject *__pyx_v_tokenize_chunksize, PyObject *__pyx_v_delim_whitespace, PyObject *__pyx_v_compression, PyObject *__pyx_v_converters, PyObject *__pyx_v_as_recarray, PyObject *__pyx_v_skipinitialspace, PyObject *__pyx_v_escapechar, PyObject *__pyx_v_doublequote, PyObject *__pyx_v_quotechar, PyObject *__pyx_v_quoting, PyObject *__pyx_v_lineterminator, PyObject *__pyx_v_encoding, PyObject *__pyx_v_comment, PyObject *__pyx_v_decimal, PyObject *__pyx_v_thousands, PyObject *__pyx_v_dtype, PyObject *__pyx_v_usecols, PyObject *__pyx_v_error_bad_lines, PyObject *__pyx_v_warn_bad_lines, PyObject *__pyx_v_na_filter, PyObject *__pyx_v_na_values, PyObject *__pyx_v_na_fvalues, PyObject *__pyx_v_true_values, PyObject *__pyx_v_false_values, PyObject *__pyx_v_compact_ints, PyObject *__pyx_v_allow_leading_cols, PyObject *__pyx_v_use_unsigned, PyObject *__pyx_v_low_memory, CYTHON_UNUSED PyObject *__pyx_v_buffer_lines, PyObject *__pyx_v_skiprows, PyObject *__pyx_v_skip_footer, PyObject *__pyx_v_verbose, PyObject *__pyx_v_mangle_dupe_cols, PyObject *__pyx_v_tupleize_cols); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_2__init__(CYTHON_UNUSED struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwards); /* proto */ +static void __pyx_pf_6pandas_6parser_10TextReader_4__dealloc__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_6set_error_bad_lines(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, int __pyx_v_status); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8read(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10debug_print(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12set_noconvert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_14remove_noconvert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16_convert_column_data(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_upcast_na, CYTHON_UNUSED PyObject *__pyx_v_footer); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_18_get_converter(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12leading_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12leading_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11table_width___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11table_width_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11skip_footer___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11skip_footer_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12buffer_lines___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12buffer_lines_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9delimiter___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9delimiter_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9delimiter_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10converters___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10converters_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10converters_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9na_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9na_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9na_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11true_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11true_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11true_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12false_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12false_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12false_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10memory_map___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10memory_map_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10memory_map_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11as_recarray___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_6header___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_6header_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_6header_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11orig_header___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11orig_header_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11orig_header_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_5names___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_5names_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_5names_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12header_start___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12header_start_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12header_start_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10header_end___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10header_end_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10header_end_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9index_col___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9index_col_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9index_col_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10low_memory___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10low_memory_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_10low_memory_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8skiprows___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_8skiprows_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_8skiprows_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12compact_ints___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12use_unsigned___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_5dtype___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_5dtype_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_5dtype_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8encoding___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_8encoding_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_8encoding_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11compression___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11compression_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_11compression_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9noconvert___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9noconvert_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_9noconvert_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_7usecols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_7usecols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6pandas_6parser_10TextReader_7usecols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser__ensure_encoded(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_2_is_file_like(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_4_maybe_upcast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_6downcast_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_use_unsigned); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_8_concatenate_chunks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chunks); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_10_compute_na_values(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_12_to_structured_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_names); /* proto */ +static PyObject *__pyx_pf_6pandas_6parser_14_maybe_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_6parser_TextReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_[] = ","; +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_M[] = "M"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_S[] = "S"; +static char __pyx_k_U[] = "U"; +static char __pyx_k_a[] = "a"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_c[] = "c"; +static char __pyx_k_d[] = "%d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_u[] = "u"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_NA[] = "NA"; +static char __pyx_k_O8[] = "|O8"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k__3[] = "\""; +static char __pyx_k__4[] = "."; +static char __pyx_k_b1[] = "|b1"; +static char __pyx_k_dt[] = "dt"; +static char __pyx_k_f8[] = "f8"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_io[] = "io"; +static char __pyx_k_mn[] = "mn"; +static char __pyx_k_mx[] = "mx"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_os[] = "os"; +static char __pyx_k_rb[] = "rb"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k_S_d[] = "|S%d"; +static char __pyx_k__16[] = ""; +static char __pyx_k__35[] = " "; +static char __pyx_k__45[] = "*"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_buf[] = "buf"; +static char __pyx_k_bz2[] = "bz2"; +static char __pyx_k_d_2[] = "d"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_lib[] = "lib"; +static char __pyx_k_lst[] = "lst"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_ord[] = "ord"; +static char __pyx_k_pop[] = "pop"; +static char __pyx_k_s_d[] = "%s.%d"; +static char __pyx_k_str[] = "str"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_NA_2[] = "#NA"; +static char __pyx_k_NULL[] = "NULL"; +static char __pyx_k_TRUE[] = "TRUE"; +static char __pyx_k_True[] = "True"; +static char __pyx_k_arrs[] = "arrs"; +static char __pyx_k_bool[] = "bool_"; +static char __pyx_k_f8_2[] = " 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delimiter); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_header); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_header_start); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_header_end); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_col); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_names); + if (value) { values[6] = value; kw_args--; } + } + case 7: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_memory_map); + if (value) { values[7] = value; kw_args--; } + } + case 8: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tokenize_chunksize); + if (value) { values[8] = value; kw_args--; } + } + case 9: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delim_whitespace); + if (value) { values[9] = value; kw_args--; } + } + case 10: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression); + if (value) { values[10] = value; kw_args--; } + } + case 11: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_converters); + if (value) { values[11] = value; kw_args--; } + } + case 12: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_as_recarray); + if (value) { values[12] = value; kw_args--; } + } + case 13: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skipinitialspace); + if (value) { values[13] = value; kw_args--; } + } + case 14: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_escapechar); + if (value) { values[14] = value; kw_args--; } + } + case 15: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_doublequote); + if (value) { values[15] = value; kw_args--; } + } + case 16: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_quotechar); + if (value) { values[16] = value; kw_args--; } + } + case 17: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_quoting); + if (value) { values[17] = value; kw_args--; } + } + case 18: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lineterminator); + if (value) { values[18] = value; kw_args--; } + } + case 19: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[19] = value; kw_args--; } + } + case 20: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_comment); + if (value) { values[20] = value; kw_args--; } + } + case 21: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_decimal); + if (value) { values[21] = value; kw_args--; } + } + case 22: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thousands); + if (value) { values[22] = value; kw_args--; } + } + case 23: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); + if (value) { values[23] = value; kw_args--; } + } + case 24: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_usecols); + if (value) { values[24] = value; kw_args--; } + } + case 25: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_error_bad_lines); + if (value) { values[25] = value; kw_args--; } + } + case 26: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_warn_bad_lines); + if (value) { values[26] = value; kw_args--; } + } + case 27: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_filter); + if (value) { values[27] = value; kw_args--; } + } + case 28: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_values); + if (value) { values[28] = value; kw_args--; } + } + case 29: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_na_fvalues); + if (value) { values[29] = value; kw_args--; } + } + case 30: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_true_values); + if (value) { values[30] = value; kw_args--; } + } + case 31: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_false_values); + if (value) { values[31] = value; kw_args--; } + } + case 32: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compact_ints); + if (value) { values[32] = value; kw_args--; } + } + case 33: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allow_leading_cols); + if (value) { values[33] = value; kw_args--; } + } + case 34: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_unsigned); + if (value) { values[34] = value; kw_args--; } + } + case 35: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_low_memory); + if (value) { values[35] = value; kw_args--; } + } + case 36: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer_lines); + if (value) { values[36] = value; kw_args--; } + } + case 37: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skiprows); + if (value) { values[37] = value; kw_args--; } + } + case 38: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip_footer); + if (value) { values[38] = value; kw_args--; } + } + case 39: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verbose); + if (value) { values[39] = value; kw_args--; } + } + case 40: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mangle_dupe_cols); + if (value) { values[40] = value; kw_args--; } + } + case 41: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tupleize_cols); + if (value) { values[41] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 42: values[41] = PyTuple_GET_ITEM(__pyx_args, 41); + case 41: values[40] = PyTuple_GET_ITEM(__pyx_args, 40); + case 40: values[39] = PyTuple_GET_ITEM(__pyx_args, 39); + case 39: values[38] = PyTuple_GET_ITEM(__pyx_args, 38); + case 38: values[37] = PyTuple_GET_ITEM(__pyx_args, 37); + case 37: values[36] = PyTuple_GET_ITEM(__pyx_args, 36); + case 36: values[35] = PyTuple_GET_ITEM(__pyx_args, 35); + case 35: values[34] = PyTuple_GET_ITEM(__pyx_args, 34); + case 34: values[33] = PyTuple_GET_ITEM(__pyx_args, 33); + case 33: values[32] = PyTuple_GET_ITEM(__pyx_args, 32); + case 32: values[31] = PyTuple_GET_ITEM(__pyx_args, 31); + case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30); + case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29); + case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28); + case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27); + case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26); + case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25); + case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24); + case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23); + case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); + case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21); + case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); + case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19); + case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); + case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_source = values[0]; + __pyx_v_delimiter = values[1]; + __pyx_v_header = values[2]; + __pyx_v_header_start = values[3]; + __pyx_v_header_end = values[4]; + __pyx_v_index_col = values[5]; + __pyx_v_names = values[6]; + __pyx_v_memory_map = values[7]; + __pyx_v_tokenize_chunksize = values[8]; + __pyx_v_delim_whitespace = values[9]; + __pyx_v_compression = values[10]; + __pyx_v_converters = values[11]; + __pyx_v_as_recarray = values[12]; + __pyx_v_skipinitialspace = values[13]; + __pyx_v_escapechar = values[14]; + __pyx_v_doublequote = values[15]; + __pyx_v_quotechar = values[16]; + __pyx_v_quoting = values[17]; + __pyx_v_lineterminator = values[18]; + __pyx_v_encoding = values[19]; + __pyx_v_comment = values[20]; + __pyx_v_decimal = values[21]; + __pyx_v_thousands = values[22]; + __pyx_v_dtype = values[23]; + __pyx_v_usecols = values[24]; + __pyx_v_error_bad_lines = values[25]; + __pyx_v_warn_bad_lines = values[26]; + __pyx_v_na_filter = values[27]; + __pyx_v_na_values = values[28]; + __pyx_v_na_fvalues = values[29]; + __pyx_v_true_values = values[30]; + __pyx_v_false_values = values[31]; + __pyx_v_compact_ints = values[32]; + __pyx_v_allow_leading_cols = values[33]; + __pyx_v_use_unsigned = values[34]; + __pyx_v_low_memory = values[35]; + __pyx_v_buffer_lines = values[36]; + __pyx_v_skiprows = values[37]; + __pyx_v_skip_footer = values[38]; + __pyx_v_verbose = values[39]; + __pyx_v_mangle_dupe_cols = values[40]; + __pyx_v_tupleize_cols = values[41]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 42, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader___cinit__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_source, __pyx_v_delimiter, __pyx_v_header, __pyx_v_header_start, __pyx_v_header_end, __pyx_v_index_col, __pyx_v_names, __pyx_v_memory_map, __pyx_v_tokenize_chunksize, __pyx_v_delim_whitespace, __pyx_v_compression, __pyx_v_converters, __pyx_v_as_recarray, __pyx_v_skipinitialspace, __pyx_v_escapechar, __pyx_v_doublequote, __pyx_v_quotechar, __pyx_v_quoting, __pyx_v_lineterminator, __pyx_v_encoding, __pyx_v_comment, __pyx_v_decimal, __pyx_v_thousands, __pyx_v_dtype, __pyx_v_usecols, __pyx_v_error_bad_lines, __pyx_v_warn_bad_lines, __pyx_v_na_filter, __pyx_v_na_values, __pyx_v_na_fvalues, __pyx_v_true_values, __pyx_v_false_values, __pyx_v_compact_ints, __pyx_v_allow_leading_cols, __pyx_v_use_unsigned, __pyx_v_low_memory, __pyx_v_buffer_lines, __pyx_v_skiprows, __pyx_v_skip_footer, __pyx_v_verbose, __pyx_v_mangle_dupe_cols, __pyx_v_tupleize_cols); + + /* "pandas/parser.pyx":266 + * set noconvert, usecols + * + * def __cinit__(self, source, # <<<<<<<<<<<<<< + * delimiter=b',', + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader___cinit__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_delimiter, PyObject *__pyx_v_header, CYTHON_UNUSED PyObject *__pyx_v_header_start, CYTHON_UNUSED PyObject *__pyx_v_header_end, PyObject *__pyx_v_index_col, PyObject *__pyx_v_names, PyObject *__pyx_v_memory_map, PyObject *__pyx_v_tokenize_chunksize, PyObject *__pyx_v_delim_whitespace, PyObject *__pyx_v_compression, PyObject *__pyx_v_converters, PyObject *__pyx_v_as_recarray, PyObject *__pyx_v_skipinitialspace, PyObject *__pyx_v_escapechar, PyObject *__pyx_v_doublequote, PyObject *__pyx_v_quotechar, PyObject *__pyx_v_quoting, PyObject *__pyx_v_lineterminator, PyObject *__pyx_v_encoding, PyObject *__pyx_v_comment, PyObject *__pyx_v_decimal, PyObject *__pyx_v_thousands, PyObject *__pyx_v_dtype, PyObject *__pyx_v_usecols, PyObject *__pyx_v_error_bad_lines, PyObject *__pyx_v_warn_bad_lines, PyObject *__pyx_v_na_filter, PyObject *__pyx_v_na_values, PyObject *__pyx_v_na_fvalues, PyObject *__pyx_v_true_values, PyObject *__pyx_v_false_values, PyObject *__pyx_v_compact_ints, PyObject *__pyx_v_allow_leading_cols, PyObject *__pyx_v_use_unsigned, PyObject *__pyx_v_low_memory, CYTHON_UNUSED PyObject *__pyx_v_buffer_lines, PyObject *__pyx_v_skiprows, PyObject *__pyx_v_skip_footer, PyObject *__pyx_v_verbose, PyObject *__pyx_v_mangle_dupe_cols, PyObject *__pyx_v_tupleize_cols) { + PyObject *__pyx_v_conv = NULL; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + long __pyx_v_heuristic; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + char __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_header); + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_INCREF(__pyx_v_dtype); + __Pyx_INCREF(__pyx_v_na_fvalues); + + /* "pandas/parser.pyx":320 + * tupleize_cols=False): + * + * self.parser = parser_new() # <<<<<<<<<<<<<< + * self.parser.chunksize = tokenize_chunksize + * + */ + __pyx_v_self->parser = parser_new(); + + /* "pandas/parser.pyx":321 + * + * self.parser = parser_new() + * self.parser.chunksize = tokenize_chunksize # <<<<<<<<<<<<<< + * + * self.mangle_dupe_cols=mangle_dupe_cols + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_tokenize_chunksize); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->chunksize = __pyx_t_1; + + /* "pandas/parser.pyx":323 + * self.parser.chunksize = tokenize_chunksize + * + * self.mangle_dupe_cols=mangle_dupe_cols # <<<<<<<<<<<<<< + * self.tupleize_cols=tupleize_cols + * + */ + __Pyx_INCREF(__pyx_v_mangle_dupe_cols); + __Pyx_GIVEREF(__pyx_v_mangle_dupe_cols); + __Pyx_GOTREF(__pyx_v_self->mangle_dupe_cols); + __Pyx_DECREF(__pyx_v_self->mangle_dupe_cols); + __pyx_v_self->mangle_dupe_cols = __pyx_v_mangle_dupe_cols; + + /* "pandas/parser.pyx":324 + * + * self.mangle_dupe_cols=mangle_dupe_cols + * self.tupleize_cols=tupleize_cols # <<<<<<<<<<<<<< + * + * # For timekeeping + */ + __Pyx_INCREF(__pyx_v_tupleize_cols); + __Pyx_GIVEREF(__pyx_v_tupleize_cols); + __Pyx_GOTREF(__pyx_v_self->tupleize_cols); + __Pyx_DECREF(__pyx_v_self->tupleize_cols); + __pyx_v_self->tupleize_cols = __pyx_v_tupleize_cols; + + /* "pandas/parser.pyx":327 + * + * # For timekeeping + * self.clocks = [] # <<<<<<<<<<<<<< + * + * self.compression = compression + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->clocks); + __Pyx_DECREF(__pyx_v_self->clocks); + __pyx_v_self->clocks = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":329 + * self.clocks = [] + * + * self.compression = compression # <<<<<<<<<<<<<< + * self.memory_map = memory_map + * + */ + __Pyx_INCREF(__pyx_v_compression); + __Pyx_GIVEREF(__pyx_v_compression); + __Pyx_GOTREF(__pyx_v_self->compression); + __Pyx_DECREF(__pyx_v_self->compression); + __pyx_v_self->compression = __pyx_v_compression; + + /* "pandas/parser.pyx":330 + * + * self.compression = compression + * self.memory_map = memory_map # <<<<<<<<<<<<<< + * + * self._setup_parser_source(source) + */ + __Pyx_INCREF(__pyx_v_memory_map); + __Pyx_GIVEREF(__pyx_v_memory_map); + __Pyx_GOTREF(__pyx_v_self->memory_map); + __Pyx_DECREF(__pyx_v_self->memory_map); + __pyx_v_self->memory_map = __pyx_v_memory_map; + + /* "pandas/parser.pyx":332 + * self.memory_map = memory_map + * + * self._setup_parser_source(source) # <<<<<<<<<<<<<< + * parser_set_default_options(self.parser) + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_setup_parser_source(__pyx_v_self, __pyx_v_source); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":333 + * + * self._setup_parser_source(source) + * parser_set_default_options(self.parser) # <<<<<<<<<<<<<< + * + * parser_init(self.parser) + */ + parser_set_default_options(__pyx_v_self->parser); + + /* "pandas/parser.pyx":335 + * parser_set_default_options(self.parser) + * + * parser_init(self.parser) # <<<<<<<<<<<<<< + * + * if delim_whitespace: + */ + parser_init(__pyx_v_self->parser); + + /* "pandas/parser.pyx":337 + * parser_init(self.parser) + * + * if delim_whitespace: # <<<<<<<<<<<<<< + * self.parser.delim_whitespace = delim_whitespace + * else: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_delim_whitespace); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/parser.pyx":338 + * + * if delim_whitespace: + * self.parser.delim_whitespace = delim_whitespace # <<<<<<<<<<<<<< + * else: + * if len(delimiter) > 1: + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_delim_whitespace); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->delim_whitespace = __pyx_t_1; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":340 + * self.parser.delim_whitespace = delim_whitespace + * else: + * if len(delimiter) > 1: # <<<<<<<<<<<<<< + * raise ValueError('only length-1 separators excluded right now') + * self.parser.delimiter = ord(delimiter) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_delimiter); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_4 > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":341 + * else: + * if len(delimiter) > 1: + * raise ValueError('only length-1 separators excluded right now') # <<<<<<<<<<<<<< + * self.parser.delimiter = ord(delimiter) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":342 + * if len(delimiter) > 1: + * raise ValueError('only length-1 separators excluded right now') + * self.parser.delimiter = ord(delimiter) # <<<<<<<<<<<<<< + * + * #---------------------------------------- + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_delimiter); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_delimiter); + __Pyx_GIVEREF(__pyx_v_delimiter); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->delimiter = __pyx_t_6; + } + __pyx_L3:; + + /* "pandas/parser.pyx":347 + * # parser options + * + * self.parser.doublequote = doublequote # <<<<<<<<<<<<<< + * self.parser.skipinitialspace = skipinitialspace + * + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_doublequote); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->doublequote = __pyx_t_1; + + /* "pandas/parser.pyx":348 + * + * self.parser.doublequote = doublequote + * self.parser.skipinitialspace = skipinitialspace # <<<<<<<<<<<<<< + * + * if lineterminator is not None: + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_skipinitialspace); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->skipinitialspace = __pyx_t_1; + + /* "pandas/parser.pyx":350 + * self.parser.skipinitialspace = skipinitialspace + * + * if lineterminator is not None: # <<<<<<<<<<<<<< + * if len(lineterminator) != 1: + * raise ValueError('Only length-1 line terminators supported') + */ + __pyx_t_3 = (__pyx_v_lineterminator != Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":351 + * + * if lineterminator is not None: + * if len(lineterminator) != 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 line terminators supported') + * self.parser.lineterminator = ord(lineterminator) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_lineterminator); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_t_4 != 1) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":352 + * if lineterminator is not None: + * if len(lineterminator) != 1: + * raise ValueError('Only length-1 line terminators supported') # <<<<<<<<<<<<<< + * self.parser.lineterminator = ord(lineterminator) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":353 + * if len(lineterminator) != 1: + * raise ValueError('Only length-1 line terminators supported') + * self.parser.lineterminator = ord(lineterminator) # <<<<<<<<<<<<<< + * + * if len(decimal) != 1: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_lineterminator); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_lineterminator); + __Pyx_GIVEREF(__pyx_v_lineterminator); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_2); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->lineterminator = __pyx_t_6; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":355 + * self.parser.lineterminator = ord(lineterminator) + * + * if len(decimal) != 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 decimal markers supported') + * self.parser.decimal = ord(decimal) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_decimal); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_t_4 != 1) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":356 + * + * if len(decimal) != 1: + * raise ValueError('Only length-1 decimal markers supported') # <<<<<<<<<<<<<< + * self.parser.decimal = ord(decimal) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":357 + * if len(decimal) != 1: + * raise ValueError('Only length-1 decimal markers supported') + * self.parser.decimal = ord(decimal) # <<<<<<<<<<<<<< + * + * if thousands is not None: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_decimal); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_decimal); + __Pyx_GIVEREF(__pyx_v_decimal); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->decimal = __pyx_t_6; + + /* "pandas/parser.pyx":359 + * self.parser.decimal = ord(decimal) + * + * if thousands is not None: # <<<<<<<<<<<<<< + * if len(thousands) != 1: + * raise ValueError('Only length-1 thousands markers supported') + */ + __pyx_t_7 = (__pyx_v_thousands != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":360 + * + * if thousands is not None: + * if len(thousands) != 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 thousands markers supported') + * self.parser.thousands = ord(thousands) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_thousands); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_4 != 1) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":361 + * if thousands is not None: + * if len(thousands) != 1: + * raise ValueError('Only length-1 thousands markers supported') # <<<<<<<<<<<<<< + * self.parser.thousands = ord(thousands) + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":362 + * if len(thousands) != 1: + * raise ValueError('Only length-1 thousands markers supported') + * self.parser.thousands = ord(thousands) # <<<<<<<<<<<<<< + * + * if escapechar is not None: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_thousands); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_thousands); + __Pyx_GIVEREF(__pyx_v_thousands); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_2); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->thousands = __pyx_t_6; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/parser.pyx":364 + * self.parser.thousands = ord(thousands) + * + * if escapechar is not None: # <<<<<<<<<<<<<< + * if len(escapechar) != 1: + * raise ValueError('Only length-1 escapes supported') + */ + __pyx_t_3 = (__pyx_v_escapechar != Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":365 + * + * if escapechar is not None: + * if len(escapechar) != 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 escapes supported') + * self.parser.escapechar = ord(escapechar) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_escapechar); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_t_4 != 1) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":366 + * if escapechar is not None: + * if len(escapechar) != 1: + * raise ValueError('Only length-1 escapes supported') # <<<<<<<<<<<<<< + * self.parser.escapechar = ord(escapechar) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":367 + * if len(escapechar) != 1: + * raise ValueError('Only length-1 escapes supported') + * self.parser.escapechar = ord(escapechar) # <<<<<<<<<<<<<< + * + * self.parser.quotechar = ord(quotechar) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_escapechar); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_escapechar); + __Pyx_GIVEREF(__pyx_v_escapechar); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->escapechar = __pyx_t_6; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":369 + * self.parser.escapechar = ord(escapechar) + * + * self.parser.quotechar = ord(quotechar) # <<<<<<<<<<<<<< + * self.parser.quoting = quoting + * + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_quotechar); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_quotechar); + __Pyx_GIVEREF(__pyx_v_quotechar); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_2); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->quotechar = __pyx_t_6; + + /* "pandas/parser.pyx":370 + * + * self.parser.quotechar = ord(quotechar) + * self.parser.quoting = quoting # <<<<<<<<<<<<<< + * + * if comment is not None: + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_quoting); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->quoting = __pyx_t_1; + + /* "pandas/parser.pyx":372 + * self.parser.quoting = quoting + * + * if comment is not None: # <<<<<<<<<<<<<< + * if len(comment) > 1: + * raise ValueError('Only length-1 comment characters supported') + */ + __pyx_t_7 = (__pyx_v_comment != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":373 + * + * if comment is not None: + * if len(comment) > 1: # <<<<<<<<<<<<<< + * raise ValueError('Only length-1 comment characters supported') + * self.parser.commentchar = ord(comment) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_comment); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_4 > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":374 + * if comment is not None: + * if len(comment) > 1: + * raise ValueError('Only length-1 comment characters supported') # <<<<<<<<<<<<<< + * self.parser.commentchar = ord(comment) + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":375 + * if len(comment) > 1: + * raise ValueError('Only length-1 comment characters supported') + * self.parser.commentchar = ord(comment) # <<<<<<<<<<<<<< + * + * # error handling of bad lines + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_comment); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_comment); + __Pyx_GIVEREF(__pyx_v_comment); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_As_char(__pyx_t_5); if (unlikely((__pyx_t_6 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->commentchar = __pyx_t_6; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/parser.pyx":378 + * + * # error handling of bad lines + * self.parser.error_bad_lines = int(error_bad_lines) # <<<<<<<<<<<<<< + * self.parser.warn_bad_lines = int(warn_bad_lines) + * + */ + __pyx_t_5 = PyNumber_Int(__pyx_v_error_bad_lines); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->error_bad_lines = __pyx_t_1; + + /* "pandas/parser.pyx":379 + * # error handling of bad lines + * self.parser.error_bad_lines = int(error_bad_lines) + * self.parser.warn_bad_lines = int(warn_bad_lines) # <<<<<<<<<<<<<< + * + * self.skiprows = skiprows + */ + __pyx_t_5 = PyNumber_Int(__pyx_v_warn_bad_lines); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser->warn_bad_lines = __pyx_t_1; + + /* "pandas/parser.pyx":381 + * self.parser.warn_bad_lines = int(warn_bad_lines) + * + * self.skiprows = skiprows # <<<<<<<<<<<<<< + * if skiprows is not None: + * self._make_skiprow_set() + */ + __Pyx_INCREF(__pyx_v_skiprows); + __Pyx_GIVEREF(__pyx_v_skiprows); + __Pyx_GOTREF(__pyx_v_self->skiprows); + __Pyx_DECREF(__pyx_v_self->skiprows); + __pyx_v_self->skiprows = __pyx_v_skiprows; + + /* "pandas/parser.pyx":382 + * + * self.skiprows = skiprows + * if skiprows is not None: # <<<<<<<<<<<<<< + * self._make_skiprow_set() + * + */ + __pyx_t_3 = (__pyx_v_skiprows != Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":383 + * self.skiprows = skiprows + * if skiprows is not None: + * self._make_skiprow_set() # <<<<<<<<<<<<<< + * + * self.skip_footer = skip_footer + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_make_skiprow_set(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/parser.pyx":385 + * self._make_skiprow_set() + * + * self.skip_footer = skip_footer # <<<<<<<<<<<<<< + * + * # suboptimal + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_skip_footer); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->skip_footer = __pyx_t_1; + + /* "pandas/parser.pyx":388 + * + * # suboptimal + * if usecols is not None: # <<<<<<<<<<<<<< + * self.has_usecols = 1 + * self.usecols = set(usecols) + */ + __pyx_t_7 = (__pyx_v_usecols != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":389 + * # suboptimal + * if usecols is not None: + * self.has_usecols = 1 # <<<<<<<<<<<<<< + * self.usecols = set(usecols) + * + */ + __pyx_v_self->has_usecols = 1; + + /* "pandas/parser.pyx":390 + * if usecols is not None: + * self.has_usecols = 1 + * self.usecols = set(usecols) # <<<<<<<<<<<<<< + * + * # XXX + */ + __pyx_t_5 = PySet_New(__pyx_v_usecols); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->usecols); + __Pyx_DECREF(__pyx_v_self->usecols); + __pyx_v_self->usecols = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/parser.pyx":393 + * + * # XXX + * if skip_footer > 0: # <<<<<<<<<<<<<< + * self.parser.error_bad_lines = 0 + * self.parser.warn_bad_lines = 0 + */ + __pyx_t_5 = PyObject_RichCompare(__pyx_v_skip_footer, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":394 + * # XXX + * if skip_footer > 0: + * self.parser.error_bad_lines = 0 # <<<<<<<<<<<<<< + * self.parser.warn_bad_lines = 0 + * + */ + __pyx_v_self->parser->error_bad_lines = 0; + + /* "pandas/parser.pyx":395 + * if skip_footer > 0: + * self.parser.error_bad_lines = 0 + * self.parser.warn_bad_lines = 0 # <<<<<<<<<<<<<< + * + * self.delimiter = delimiter + */ + __pyx_v_self->parser->warn_bad_lines = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/parser.pyx":397 + * self.parser.warn_bad_lines = 0 + * + * self.delimiter = delimiter # <<<<<<<<<<<<<< + * self.delim_whitespace = delim_whitespace + * + */ + __Pyx_INCREF(__pyx_v_delimiter); + __Pyx_GIVEREF(__pyx_v_delimiter); + __Pyx_GOTREF(__pyx_v_self->delimiter); + __Pyx_DECREF(__pyx_v_self->delimiter); + __pyx_v_self->delimiter = __pyx_v_delimiter; + + /* "pandas/parser.pyx":398 + * + * self.delimiter = delimiter + * self.delim_whitespace = delim_whitespace # <<<<<<<<<<<<<< + * + * self.na_values = na_values + */ + __Pyx_INCREF(__pyx_v_delim_whitespace); + __Pyx_GIVEREF(__pyx_v_delim_whitespace); + __Pyx_GOTREF(__pyx_v_self->delim_whitespace); + __Pyx_DECREF(__pyx_v_self->delim_whitespace); + __pyx_v_self->delim_whitespace = __pyx_v_delim_whitespace; + + /* "pandas/parser.pyx":400 + * self.delim_whitespace = delim_whitespace + * + * self.na_values = na_values # <<<<<<<<<<<<<< + * if na_fvalues is None: + * na_fvalues = set() + */ + __Pyx_INCREF(__pyx_v_na_values); + __Pyx_GIVEREF(__pyx_v_na_values); + __Pyx_GOTREF(__pyx_v_self->na_values); + __Pyx_DECREF(__pyx_v_self->na_values); + __pyx_v_self->na_values = __pyx_v_na_values; + + /* "pandas/parser.pyx":401 + * + * self.na_values = na_values + * if na_fvalues is None: # <<<<<<<<<<<<<< + * na_fvalues = set() + * self.na_fvalues = na_fvalues + */ + __pyx_t_3 = (__pyx_v_na_fvalues == Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":402 + * self.na_values = na_values + * if na_fvalues is None: + * na_fvalues = set() # <<<<<<<<<<<<<< + * self.na_fvalues = na_fvalues + * + */ + __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_na_fvalues, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/parser.pyx":403 + * if na_fvalues is None: + * na_fvalues = set() + * self.na_fvalues = na_fvalues # <<<<<<<<<<<<<< + * + * self.true_values = _maybe_encode(true_values) + */ + __Pyx_INCREF(__pyx_v_na_fvalues); + __Pyx_GIVEREF(__pyx_v_na_fvalues); + __Pyx_GOTREF(__pyx_v_self->na_fvalues); + __Pyx_DECREF(__pyx_v_self->na_fvalues); + __pyx_v_self->na_fvalues = __pyx_v_na_fvalues; + + /* "pandas/parser.pyx":405 + * self.na_fvalues = na_fvalues + * + * self.true_values = _maybe_encode(true_values) # <<<<<<<<<<<<<< + * self.false_values = _maybe_encode(false_values) + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_true_values); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_true_values); + __Pyx_GIVEREF(__pyx_v_true_values); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_v_self->true_values); + __Pyx_DECREF(__pyx_v_self->true_values); + __pyx_v_self->true_values = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/parser.pyx":406 + * + * self.true_values = _maybe_encode(true_values) + * self.false_values = _maybe_encode(false_values) # <<<<<<<<<<<<<< + * + * self.converters = converters + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_encode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_false_values); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_false_values); + __Pyx_GIVEREF(__pyx_v_false_values); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->false_values); + __Pyx_DECREF(__pyx_v_self->false_values); + __pyx_v_self->false_values = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":408 + * self.false_values = _maybe_encode(false_values) + * + * self.converters = converters # <<<<<<<<<<<<<< + * + * self.na_filter = na_filter + */ + __Pyx_INCREF(__pyx_v_converters); + __Pyx_GIVEREF(__pyx_v_converters); + __Pyx_GOTREF(__pyx_v_self->converters); + __Pyx_DECREF(__pyx_v_self->converters); + __pyx_v_self->converters = __pyx_v_converters; + + /* "pandas/parser.pyx":410 + * self.converters = converters + * + * self.na_filter = na_filter # <<<<<<<<<<<<<< + * self.as_recarray = as_recarray + * + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_na_filter); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->na_filter = __pyx_t_7; + + /* "pandas/parser.pyx":411 + * + * self.na_filter = na_filter + * self.as_recarray = as_recarray # <<<<<<<<<<<<<< + * + * self.compact_ints = compact_ints + */ + __Pyx_INCREF(__pyx_v_as_recarray); + __Pyx_GIVEREF(__pyx_v_as_recarray); + __Pyx_GOTREF(__pyx_v_self->as_recarray); + __Pyx_DECREF(__pyx_v_self->as_recarray); + __pyx_v_self->as_recarray = __pyx_v_as_recarray; + + /* "pandas/parser.pyx":413 + * self.as_recarray = as_recarray + * + * self.compact_ints = compact_ints # <<<<<<<<<<<<<< + * self.use_unsigned = use_unsigned + * + */ + __Pyx_INCREF(__pyx_v_compact_ints); + __Pyx_GIVEREF(__pyx_v_compact_ints); + __Pyx_GOTREF(__pyx_v_self->compact_ints); + __Pyx_DECREF(__pyx_v_self->compact_ints); + __pyx_v_self->compact_ints = __pyx_v_compact_ints; + + /* "pandas/parser.pyx":414 + * + * self.compact_ints = compact_ints + * self.use_unsigned = use_unsigned # <<<<<<<<<<<<<< + * + * self.verbose = verbose + */ + __Pyx_INCREF(__pyx_v_use_unsigned); + __Pyx_GIVEREF(__pyx_v_use_unsigned); + __Pyx_GOTREF(__pyx_v_self->use_unsigned); + __Pyx_DECREF(__pyx_v_self->use_unsigned); + __pyx_v_self->use_unsigned = __pyx_v_use_unsigned; + + /* "pandas/parser.pyx":416 + * self.use_unsigned = use_unsigned + * + * self.verbose = verbose # <<<<<<<<<<<<<< + * self.low_memory = low_memory + * + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->verbose = __pyx_t_7; + + /* "pandas/parser.pyx":417 + * + * self.verbose = verbose + * self.low_memory = low_memory # <<<<<<<<<<<<<< + * + * # encoding + */ + __Pyx_INCREF(__pyx_v_low_memory); + __Pyx_GIVEREF(__pyx_v_low_memory); + __Pyx_GOTREF(__pyx_v_self->low_memory); + __Pyx_DECREF(__pyx_v_self->low_memory); + __pyx_v_self->low_memory = __pyx_v_low_memory; + + /* "pandas/parser.pyx":420 + * + * # encoding + * if encoding is not None: # <<<<<<<<<<<<<< + * if not isinstance(encoding, bytes): + * encoding = encoding.encode('utf-8') + */ + __pyx_t_7 = (__pyx_v_encoding != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":421 + * # encoding + * if encoding is not None: + * if not isinstance(encoding, bytes): # <<<<<<<<<<<<<< + * encoding = encoding.encode('utf-8') + * encoding = encoding.lower() + */ + __pyx_t_3 = PyBytes_Check(__pyx_v_encoding); + __pyx_t_7 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":422 + * if encoding is not None: + * if not isinstance(encoding, bytes): + * encoding = encoding.encode('utf-8') # <<<<<<<<<<<<<< + * encoding = encoding.lower() + * self.c_encoding = encoding + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L19; + } + __pyx_L19:; + + /* "pandas/parser.pyx":423 + * if not isinstance(encoding, bytes): + * encoding = encoding.encode('utf-8') + * encoding = encoding.lower() # <<<<<<<<<<<<<< + * self.c_encoding = encoding + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":424 + * encoding = encoding.encode('utf-8') + * encoding = encoding.lower() + * self.c_encoding = encoding # <<<<<<<<<<<<<< + * else: + * self.c_encoding = NULL + */ + __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_encoding); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->c_encoding = ((char *)__pyx_t_9); + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/parser.pyx":426 + * self.c_encoding = encoding + * else: + * self.c_encoding = NULL # <<<<<<<<<<<<<< + * + * self.encoding = encoding + */ + __pyx_v_self->c_encoding = NULL; + } + __pyx_L18:; + + /* "pandas/parser.pyx":428 + * self.c_encoding = NULL + * + * self.encoding = encoding # <<<<<<<<<<<<<< + * + * if isinstance(dtype, dict): + */ + __Pyx_INCREF(__pyx_v_encoding); + __Pyx_GIVEREF(__pyx_v_encoding); + __Pyx_GOTREF(__pyx_v_self->encoding); + __Pyx_DECREF(__pyx_v_self->encoding); + __pyx_v_self->encoding = __pyx_v_encoding; + + /* "pandas/parser.pyx":430 + * self.encoding = encoding + * + * if isinstance(dtype, dict): # <<<<<<<<<<<<<< + * conv = {} + * for k in dtype: + */ + __pyx_t_7 = PyDict_Check(__pyx_v_dtype); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":431 + * + * if isinstance(dtype, dict): + * conv = {} # <<<<<<<<<<<<<< + * for k in dtype: + * v = dtype[k] + */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_conv = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":432 + * if isinstance(dtype, dict): + * conv = {} + * for k in dtype: # <<<<<<<<<<<<<< + * v = dtype[k] + * if isinstance(v, basestring): + */ + if (PyList_CheckExact(__pyx_v_dtype) || PyTuple_CheckExact(__pyx_v_dtype)) { + __pyx_t_5 = __pyx_v_dtype; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + for (;;) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_10(__pyx_t_5); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":433 + * conv = {} + * for k in dtype: + * v = dtype[k] # <<<<<<<<<<<<<< + * if isinstance(v, basestring): + * v = np.dtype(v) + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_dtype, __pyx_v_k); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":434 + * for k in dtype: + * v = dtype[k] + * if isinstance(v, basestring): # <<<<<<<<<<<<<< + * v = np.dtype(v) + * conv[k] = v + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_v, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":435 + * v = dtype[k] + * if isinstance(v, basestring): + * v = np.dtype(v) # <<<<<<<<<<<<<< + * conv[k] = v + * dtype = conv + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L23; + } + __pyx_L23:; + + /* "pandas/parser.pyx":436 + * if isinstance(v, basestring): + * v = np.dtype(v) + * conv[k] = v # <<<<<<<<<<<<<< + * dtype = conv + * elif dtype is not None: + */ + if (unlikely(PyDict_SetItem(__pyx_v_conv, __pyx_v_k, __pyx_v_v) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":437 + * v = np.dtype(v) + * conv[k] = v + * dtype = conv # <<<<<<<<<<<<<< + * elif dtype is not None: + * dtype = np.dtype(dtype) + */ + __Pyx_INCREF(__pyx_v_conv); + __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_v_conv); + goto __pyx_L20; + } + + /* "pandas/parser.pyx":438 + * conv[k] = v + * dtype = conv + * elif dtype is not None: # <<<<<<<<<<<<<< + * dtype = np.dtype(dtype) + * + */ + __pyx_t_7 = (__pyx_v_dtype != Py_None); + __pyx_t_3 = (__pyx_t_7 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":439 + * dtype = conv + * elif dtype is not None: + * dtype = np.dtype(dtype) # <<<<<<<<<<<<<< + * + * self.dtype = dtype + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dtype); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dtype); + __Pyx_GIVEREF(__pyx_v_dtype); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/parser.pyx":441 + * dtype = np.dtype(dtype) + * + * self.dtype = dtype # <<<<<<<<<<<<<< + * + * # XXX + */ + __Pyx_INCREF(__pyx_v_dtype); + __Pyx_GIVEREF(__pyx_v_dtype); + __Pyx_GOTREF(__pyx_v_self->dtype); + __Pyx_DECREF(__pyx_v_self->dtype); + __pyx_v_self->dtype = __pyx_v_dtype; + + /* "pandas/parser.pyx":444 + * + * # XXX + * self.noconvert = set() # <<<<<<<<<<<<<< + * + * self.index_col = index_col + */ + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->noconvert); + __Pyx_DECREF(__pyx_v_self->noconvert); + __pyx_v_self->noconvert = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":446 + * self.noconvert = set() + * + * self.index_col = index_col # <<<<<<<<<<<<<< + * + * #---------------------------------------- + */ + __Pyx_INCREF(__pyx_v_index_col); + __Pyx_GIVEREF(__pyx_v_index_col); + __Pyx_GOTREF(__pyx_v_self->index_col); + __Pyx_DECREF(__pyx_v_self->index_col); + __pyx_v_self->index_col = __pyx_v_index_col; + + /* "pandas/parser.pyx":451 + * # header stuff + * + * self.allow_leading_cols = allow_leading_cols # <<<<<<<<<<<<<< + * self.leading_cols = 0 + * + */ + __Pyx_INCREF(__pyx_v_allow_leading_cols); + __Pyx_GIVEREF(__pyx_v_allow_leading_cols); + __Pyx_GOTREF(__pyx_v_self->allow_leading_cols); + __Pyx_DECREF(__pyx_v_self->allow_leading_cols); + __pyx_v_self->allow_leading_cols = __pyx_v_allow_leading_cols; + + /* "pandas/parser.pyx":452 + * + * self.allow_leading_cols = allow_leading_cols + * self.leading_cols = 0 # <<<<<<<<<<<<<< + * + * # TODO: no header vs. header is not the first row + */ + __pyx_v_self->leading_cols = 0; + + /* "pandas/parser.pyx":455 + * + * # TODO: no header vs. header is not the first row + * self.has_mi_columns = 0 # <<<<<<<<<<<<<< + * self.orig_header = header + * if header is None: + */ + __pyx_v_self->has_mi_columns = 0; + + /* "pandas/parser.pyx":456 + * # TODO: no header vs. header is not the first row + * self.has_mi_columns = 0 + * self.orig_header = header # <<<<<<<<<<<<<< + * if header is None: + * # sentinel value + */ + __Pyx_INCREF(__pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + __Pyx_GOTREF(__pyx_v_self->orig_header); + __Pyx_DECREF(__pyx_v_self->orig_header); + __pyx_v_self->orig_header = __pyx_v_header; + + /* "pandas/parser.pyx":457 + * self.has_mi_columns = 0 + * self.orig_header = header + * if header is None: # <<<<<<<<<<<<<< + * # sentinel value + * self.parser.header_start = -1 + */ + __pyx_t_3 = (__pyx_v_header == Py_None); + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":459 + * if header is None: + * # sentinel value + * self.parser.header_start = -1 # <<<<<<<<<<<<<< + * self.parser.header_end = -1 + * self.parser.header = -1 + */ + __pyx_v_self->parser->header_start = -1; + + /* "pandas/parser.pyx":460 + * # sentinel value + * self.parser.header_start = -1 + * self.parser.header_end = -1 # <<<<<<<<<<<<<< + * self.parser.header = -1 + * self.parser_start = 0 + */ + __pyx_v_self->parser->header_end = -1; + + /* "pandas/parser.pyx":461 + * self.parser.header_start = -1 + * self.parser.header_end = -1 + * self.parser.header = -1 # <<<<<<<<<<<<<< + * self.parser_start = 0 + * self.header = [] + */ + __pyx_v_self->parser->header = -1; + + /* "pandas/parser.pyx":462 + * self.parser.header_end = -1 + * self.parser.header = -1 + * self.parser_start = 0 # <<<<<<<<<<<<<< + * self.header = [] + * else: + */ + __pyx_v_self->parser_start = 0; + + /* "pandas/parser.pyx":463 + * self.parser.header = -1 + * self.parser_start = 0 + * self.header = [] # <<<<<<<<<<<<<< + * else: + * if isinstance(header, list) and len(header): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L24; + } + /*else*/ { + + /* "pandas/parser.pyx":465 + * self.header = [] + * else: + * if isinstance(header, list) and len(header): # <<<<<<<<<<<<<< + * # need to artifically skip the final line + * # which is still a header line + */ + __pyx_t_7 = PyList_Check(__pyx_v_header); + if (__pyx_t_7) { + __pyx_t_4 = PyObject_Length(__pyx_v_header); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__pyx_t_4 != 0); + } else { + __pyx_t_3 = __pyx_t_7; + } + if (__pyx_t_3) { + + /* "pandas/parser.pyx":468 + * # need to artifically skip the final line + * # which is still a header line + * header = list(header) # <<<<<<<<<<<<<< + * header.append(header[-1]+1) + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_header); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_header, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":469 + * # which is still a header line + * header = list(header) + * header.append(header[-1]+1) # <<<<<<<<<<<<<< + * + * self.parser.header_start = header[0] + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_header, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_header, __pyx_t_2); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":471 + * header.append(header[-1]+1) + * + * self.parser.header_start = header[0] # <<<<<<<<<<<<<< + * self.parser.header_end = header[-1] + * self.parser.header = header[0] + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->header_start = __pyx_t_1; + + /* "pandas/parser.pyx":472 + * + * self.parser.header_start = header[0] + * self.parser.header_end = header[-1] # <<<<<<<<<<<<<< + * self.parser.header = header[0] + * self.parser_start = header[-1] + 1 + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_header, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->header_end = __pyx_t_1; + + /* "pandas/parser.pyx":473 + * self.parser.header_start = header[0] + * self.parser.header_end = header[-1] + * self.parser.header = header[0] # <<<<<<<<<<<<<< + * self.parser_start = header[-1] + 1 + * self.has_mi_columns = 1 + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->parser->header = __pyx_t_1; + + /* "pandas/parser.pyx":474 + * self.parser.header_end = header[-1] + * self.parser.header = header[0] + * self.parser_start = header[-1] + 1 # <<<<<<<<<<<<<< + * self.has_mi_columns = 1 + * self.header = header + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_header, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser_start = __pyx_t_1; + + /* "pandas/parser.pyx":475 + * self.parser.header = header[0] + * self.parser_start = header[-1] + 1 + * self.has_mi_columns = 1 # <<<<<<<<<<<<<< + * self.header = header + * else: + */ + __pyx_v_self->has_mi_columns = 1; + + /* "pandas/parser.pyx":476 + * self.parser_start = header[-1] + 1 + * self.has_mi_columns = 1 + * self.header = header # <<<<<<<<<<<<<< + * else: + * self.parser.header_start = header + */ + __Pyx_INCREF(__pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_v_header; + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/parser.pyx":478 + * self.header = header + * else: + * self.parser.header_start = header # <<<<<<<<<<<<<< + * self.parser.header_end = header + * self.parser.header = header + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_header); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->header_start = __pyx_t_1; + + /* "pandas/parser.pyx":479 + * else: + * self.parser.header_start = header + * self.parser.header_end = header # <<<<<<<<<<<<<< + * self.parser.header = header + * self.parser_start = header + 1 + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_header); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->header_end = __pyx_t_1; + + /* "pandas/parser.pyx":480 + * self.parser.header_start = header + * self.parser.header_end = header + * self.parser.header = header # <<<<<<<<<<<<<< + * self.parser_start = header + 1 + * self.header = [ header ] + */ + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_header); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->parser->header = __pyx_t_1; + + /* "pandas/parser.pyx":481 + * self.parser.header_end = header + * self.parser.header = header + * self.parser_start = header + 1 # <<<<<<<<<<<<<< + * self.header = [ header ] + * + */ + __pyx_t_5 = PyNumber_Add(__pyx_v_header, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->parser_start = __pyx_t_1; + + /* "pandas/parser.pyx":482 + * self.parser.header = header + * self.parser_start = header + 1 + * self.header = [ header ] # <<<<<<<<<<<<<< + * + * self.names = names + */ + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_header); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L25:; + } + __pyx_L24:; + + /* "pandas/parser.pyx":484 + * self.header = [ header ] + * + * self.names = names # <<<<<<<<<<<<<< + * self.header, self.table_width = self._get_header() + * + */ + __Pyx_INCREF(__pyx_v_names); + __Pyx_GIVEREF(__pyx_v_names); + __Pyx_GOTREF(__pyx_v_self->names); + __Pyx_DECREF(__pyx_v_self->names); + __pyx_v_self->names = __pyx_v_names; + + /* "pandas/parser.pyx":485 + * + * self.names = names + * self.header, self.table_width = self._get_header() # <<<<<<<<<<<<<< + * + * if not self.table_width: + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_get_header(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_11 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_11)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L27_unpacking_done; + __pyx_L26_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L27_unpacking_done:; + } + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_self->table_width = __pyx_t_1; + + /* "pandas/parser.pyx":487 + * self.header, self.table_width = self._get_header() + * + * if not self.table_width: # <<<<<<<<<<<<<< + * raise ValueError("No columns to parse from file") + * + */ + __pyx_t_3 = ((!(__pyx_v_self->table_width != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":488 + * + * if not self.table_width: + * raise ValueError("No columns to parse from file") # <<<<<<<<<<<<<< + * + * # compute buffer_lines as function of table width + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":491 + * + * # compute buffer_lines as function of table width + * heuristic = 2**20 // self.table_width # <<<<<<<<<<<<<< + * self.buffer_lines = 1 + * while self.buffer_lines * 2< heuristic: + */ + if (unlikely(__pyx_v_self->table_width == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(long) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_self->table_width == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(1048576))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_heuristic = __Pyx_div_long(1048576, __pyx_v_self->table_width); + + /* "pandas/parser.pyx":492 + * # compute buffer_lines as function of table width + * heuristic = 2**20 // self.table_width + * self.buffer_lines = 1 # <<<<<<<<<<<<<< + * while self.buffer_lines * 2< heuristic: + * self.buffer_lines *= 2 + */ + __pyx_v_self->buffer_lines = 1; + + /* "pandas/parser.pyx":493 + * heuristic = 2**20 // self.table_width + * self.buffer_lines = 1 + * while self.buffer_lines * 2< heuristic: # <<<<<<<<<<<<<< + * self.buffer_lines *= 2 + * + */ + while (1) { + __pyx_t_3 = (((__pyx_v_self->buffer_lines * 2) < __pyx_v_heuristic) != 0); + if (!__pyx_t_3) break; + + /* "pandas/parser.pyx":494 + * self.buffer_lines = 1 + * while self.buffer_lines * 2< heuristic: + * self.buffer_lines *= 2 # <<<<<<<<<<<<<< + * + * def __init__(self, *args, **kwards): + */ + __pyx_v_self->buffer_lines = (__pyx_v_self->buffer_lines * 2); + } + + /* "pandas/parser.pyx":266 + * set noconvert, usecols + * + * def __cinit__(self, source, # <<<<<<<<<<<<<< + * delimiter=b',', + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.parser.TextReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_conv); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_header); + __Pyx_XDECREF(__pyx_v_encoding); + __Pyx_XDECREF(__pyx_v_dtype); + __Pyx_XDECREF(__pyx_v_na_fvalues); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":496 + * self.buffer_lines *= 2 + * + * def __init__(self, *args, **kwards): # <<<<<<<<<<<<<< + * pass + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_args = 0; + CYTHON_UNUSED PyObject *__pyx_v_kwards = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; + __pyx_v_kwards = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwards)) return -1; + __Pyx_GOTREF(__pyx_v_kwards); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_2__init__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_args, __pyx_v_kwards); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwards); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_2__init__(CYTHON_UNUSED struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwards) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":499 + * pass + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * parser_free(self.parser) + * + */ + +/* Python wrapper */ +static void __pyx_pw_6pandas_6parser_10TextReader_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pandas_6parser_10TextReader_5__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6pandas_6parser_10TextReader_4__dealloc__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6pandas_6parser_10TextReader_4__dealloc__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "pandas/parser.pyx":500 + * + * def __dealloc__(self): + * parser_free(self.parser) # <<<<<<<<<<<<<< + * + * def set_error_bad_lines(self, int status): + */ + parser_free(__pyx_v_self->parser); + + /* "pandas/parser.pyx":499 + * pass + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * parser_free(self.parser) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/parser.pyx":502 + * parser_free(self.parser) + * + * def set_error_bad_lines(self, int status): # <<<<<<<<<<<<<< + * self.parser.error_bad_lines = status + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_7set_error_bad_lines(PyObject *__pyx_v_self, PyObject *__pyx_arg_status); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_7set_error_bad_lines(PyObject *__pyx_v_self, PyObject *__pyx_arg_status) { + int __pyx_v_status; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_error_bad_lines (wrapper)", 0); + assert(__pyx_arg_status); { + __pyx_v_status = __Pyx_PyInt_As_int(__pyx_arg_status); if (unlikely((__pyx_v_status == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.set_error_bad_lines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_6set_error_bad_lines(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((int)__pyx_v_status)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_6set_error_bad_lines(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, int __pyx_v_status) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_error_bad_lines", 0); + + /* "pandas/parser.pyx":503 + * + * def set_error_bad_lines(self, int status): + * self.parser.error_bad_lines = status # <<<<<<<<<<<<<< + * + * cdef _make_skiprow_set(self): + */ + __pyx_v_self->parser->error_bad_lines = __pyx_v_status; + + /* "pandas/parser.pyx":502 + * parser_free(self.parser) + * + * def set_error_bad_lines(self, int status): # <<<<<<<<<<<<<< + * self.parser.error_bad_lines = status + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":505 + * self.parser.error_bad_lines = status + * + * cdef _make_skiprow_set(self): # <<<<<<<<<<<<<< + * if isinstance(self.skiprows, (int, np.integer)): + * self.skiprows = range(self.skiprows) + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__make_skiprow_set(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + __pyx_t_5numpy_int64_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_skiprow_set", 0); + + /* "pandas/parser.pyx":506 + * + * cdef _make_skiprow_set(self): + * if isinstance(self.skiprows, (int, np.integer)): # <<<<<<<<<<<<<< + * self.skiprows = range(self.skiprows) + * + */ + __pyx_t_1 = __pyx_v_self->skiprows; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_4 = PyObject_IsInstance(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/parser.pyx":507 + * cdef _make_skiprow_set(self): + * if isinstance(self.skiprows, (int, np.integer)): + * self.skiprows = range(self.skiprows) # <<<<<<<<<<<<<< + * + * for i in self.skiprows: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->skiprows); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->skiprows); + __Pyx_GIVEREF(__pyx_v_self->skiprows); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->skiprows); + __Pyx_DECREF(__pyx_v_self->skiprows); + __pyx_v_self->skiprows = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":509 + * self.skiprows = range(self.skiprows) + * + * for i in self.skiprows: # <<<<<<<<<<<<<< + * parser_add_skiprow(self.parser, i) + * + */ + if (PyList_CheckExact(__pyx_v_self->skiprows) || PyTuple_CheckExact(__pyx_v_self->skiprows)) { + __pyx_t_1 = __pyx_v_self->skiprows; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->skiprows); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_7(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":510 + * + * for i in self.skiprows: + * parser_add_skiprow(self.parser, i) # <<<<<<<<<<<<<< + * + * cdef _setup_parser_source(self, source): + */ + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_i); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + parser_add_skiprow(__pyx_v_self->parser, __pyx_t_8); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":505 + * self.parser.error_bad_lines = status + * + * cdef _make_skiprow_set(self): # <<<<<<<<<<<<<< + * if isinstance(self.skiprows, (int, np.integer)): + * self.skiprows = range(self.skiprows) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.TextReader._make_skiprow_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":512 + * parser_add_skiprow(self.parser, i) + * + * cdef _setup_parser_source(self, source): # <<<<<<<<<<<<<< + * cdef: + * int status + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__setup_parser_source(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_source) { + void *__pyx_v_ptr; + PyObject *__pyx_v_gzip = NULL; + PyObject *__pyx_v_bz2 = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_setup_parser_source", 0); + __Pyx_INCREF(__pyx_v_source); + + /* "pandas/parser.pyx":517 + * void *ptr + * + * self.parser.cb_io = NULL # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = NULL + * + */ + __pyx_v_self->parser->cb_io = NULL; + + /* "pandas/parser.pyx":518 + * + * self.parser.cb_io = NULL + * self.parser.cb_cleanup = NULL # <<<<<<<<<<<<<< + * + * if self.compression: + */ + __pyx_v_self->parser->cb_cleanup = NULL; + + /* "pandas/parser.pyx":520 + * self.parser.cb_cleanup = NULL + * + * if self.compression: # <<<<<<<<<<<<<< + * if self.compression == 'gzip': + * import gzip + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->compression); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":521 + * + * if self.compression: + * if self.compression == 'gzip': # <<<<<<<<<<<<<< + * import gzip + * if isinstance(source, basestring): + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->compression, __pyx_n_s_gzip, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":522 + * if self.compression: + * if self.compression == 'gzip': + * import gzip # <<<<<<<<<<<<<< + * if isinstance(source, basestring): + * source = gzip.GzipFile(source, 'rb') + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gzip, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_gzip = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":523 + * if self.compression == 'gzip': + * import gzip + * if isinstance(source, basestring): # <<<<<<<<<<<<<< + * source = gzip.GzipFile(source, 'rb') + * else: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_source, __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":524 + * import gzip + * if isinstance(source, basestring): + * source = gzip.GzipFile(source, 'rb') # <<<<<<<<<<<<<< + * else: + * source = gzip.GzipFile(fileobj=source) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + __Pyx_INCREF(__pyx_n_s_rb); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_rb); + __Pyx_GIVEREF(__pyx_n_s_rb); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/parser.pyx":526 + * source = gzip.GzipFile(source, 'rb') + * else: + * source = gzip.GzipFile(fileobj=source) # <<<<<<<<<<<<<< + * elif self.compression == 'bz2': + * import bz2 + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fileobj, __pyx_v_source) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L5:; + goto __pyx_L4; + } + + /* "pandas/parser.pyx":527 + * else: + * source = gzip.GzipFile(fileobj=source) + * elif self.compression == 'bz2': # <<<<<<<<<<<<<< + * import bz2 + * if isinstance(source, basestring): + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_self->compression, __pyx_n_s_bz2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/parser.pyx":528 + * source = gzip.GzipFile(fileobj=source) + * elif self.compression == 'bz2': + * import bz2 # <<<<<<<<<<<<<< + * if isinstance(source, basestring): + * source = bz2.BZ2File(source, 'rb') + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_bz2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_bz2 = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":529 + * elif self.compression == 'bz2': + * import bz2 + * if isinstance(source, basestring): # <<<<<<<<<<<<<< + * source = bz2.BZ2File(source, 'rb') + * else: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_source, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":530 + * import bz2 + * if isinstance(source, basestring): + * source = bz2.BZ2File(source, 'rb') # <<<<<<<<<<<<<< + * else: + * raise ValueError('Python cannot read bz2 from open file ' + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_bz2, __pyx_n_s_BZ2File); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + __Pyx_INCREF(__pyx_n_s_rb); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_rb); + __Pyx_GIVEREF(__pyx_n_s_rb); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/parser.pyx":532 + * source = bz2.BZ2File(source, 'rb') + * else: + * raise ValueError('Python cannot read bz2 from open file ' # <<<<<<<<<<<<<< + * 'handle') + * else: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L6:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/parser.pyx":535 + * 'handle') + * else: + * raise ValueError('Unrecognized compression type: %s' % # <<<<<<<<<<<<<< + * self.compression) + * + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_compression_type_s, __pyx_v_self->compression); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":538 + * self.compression) + * + * if isinstance(source, basestring): # <<<<<<<<<<<<<< + * if not isinstance(source, bytes): + * source = source.encode(sys.getfilesystemencoding() or 'utf-8') + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":539 + * + * if isinstance(source, basestring): + * if not isinstance(source, bytes): # <<<<<<<<<<<<<< + * source = source.encode(sys.getfilesystemencoding() or 'utf-8') + * + */ + __pyx_t_3 = PyBytes_Check(__pyx_v_source); + __pyx_t_1 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":540 + * if isinstance(source, basestring): + * if not isinstance(source, bytes): + * source = source.encode(sys.getfilesystemencoding() or 'utf-8') # <<<<<<<<<<<<<< + * + * if self.memory_map: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_s_utf_8); + __pyx_t_2 = __pyx_kp_s_utf_8; + } else { + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/parser.pyx":542 + * source = source.encode(sys.getfilesystemencoding() or 'utf-8') + * + * if self.memory_map: # <<<<<<<<<<<<<< + * ptr = new_mmap(source) + * if ptr == NULL: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->memory_map); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":543 + * + * if self.memory_map: + * ptr = new_mmap(source) # <<<<<<<<<<<<<< + * if ptr == NULL: + * # fall back + */ + __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_source); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ptr = new_mmap(__pyx_t_6); + + /* "pandas/parser.pyx":544 + * if self.memory_map: + * ptr = new_mmap(source) + * if ptr == NULL: # <<<<<<<<<<<<<< + * # fall back + * ptr = new_file_source(source, self.parser.chunksize) + */ + __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":546 + * if ptr == NULL: + * # fall back + * ptr = new_file_source(source, self.parser.chunksize) # <<<<<<<<<<<<<< + * self.parser.cb_io = &buffer_file_bytes + * self.parser.cb_cleanup = &del_file_source + */ + __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_source); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ptr = new_file_source(__pyx_t_6, __pyx_v_self->parser->chunksize); + + /* "pandas/parser.pyx":547 + * # fall back + * ptr = new_file_source(source, self.parser.chunksize) + * self.parser.cb_io = &buffer_file_bytes # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = &del_file_source + * else: + */ + __pyx_v_self->parser->cb_io = (&buffer_file_bytes); + + /* "pandas/parser.pyx":548 + * ptr = new_file_source(source, self.parser.chunksize) + * self.parser.cb_io = &buffer_file_bytes + * self.parser.cb_cleanup = &del_file_source # <<<<<<<<<<<<<< + * else: + * self.parser.cb_io = &buffer_mmap_bytes + */ + __pyx_v_self->parser->cb_cleanup = (&del_file_source); + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/parser.pyx":550 + * self.parser.cb_cleanup = &del_file_source + * else: + * self.parser.cb_io = &buffer_mmap_bytes # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = &del_mmap + * else: + */ + __pyx_v_self->parser->cb_io = (&buffer_mmap_bytes); + + /* "pandas/parser.pyx":551 + * else: + * self.parser.cb_io = &buffer_mmap_bytes + * self.parser.cb_cleanup = &del_mmap # <<<<<<<<<<<<<< + * else: + * ptr = new_file_source(source, self.parser.chunksize) + */ + __pyx_v_self->parser->cb_cleanup = (&del_mmap); + } + __pyx_L10:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/parser.pyx":553 + * self.parser.cb_cleanup = &del_mmap + * else: + * ptr = new_file_source(source, self.parser.chunksize) # <<<<<<<<<<<<<< + * self.parser.cb_io = &buffer_file_bytes + * self.parser.cb_cleanup = &del_file_source + */ + __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_source); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ptr = new_file_source(__pyx_t_6, __pyx_v_self->parser->chunksize); + + /* "pandas/parser.pyx":554 + * else: + * ptr = new_file_source(source, self.parser.chunksize) + * self.parser.cb_io = &buffer_file_bytes # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = &del_file_source + * + */ + __pyx_v_self->parser->cb_io = (&buffer_file_bytes); + + /* "pandas/parser.pyx":555 + * ptr = new_file_source(source, self.parser.chunksize) + * self.parser.cb_io = &buffer_file_bytes + * self.parser.cb_cleanup = &del_file_source # <<<<<<<<<<<<<< + * + * if ptr == NULL: + */ + __pyx_v_self->parser->cb_cleanup = (&del_file_source); + } + __pyx_L9:; + + /* "pandas/parser.pyx":557 + * self.parser.cb_cleanup = &del_file_source + * + * if ptr == NULL: # <<<<<<<<<<<<<< + * if not os.path.exists(source): + * raise IOError('File %s does not exist' % source) + */ + __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":558 + * + * if ptr == NULL: + * if not os.path.exists(source): # <<<<<<<<<<<<<< + * raise IOError('File %s does not exist' % source) + * raise IOError('Initializing from file failed') + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = ((!__pyx_t_1) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":559 + * if ptr == NULL: + * if not os.path.exists(source): + * raise IOError('File %s does not exist' % source) # <<<<<<<<<<<<<< + * raise IOError('Initializing from file failed') + * + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_File_s_does_not_exist, __pyx_v_source); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":560 + * if not os.path.exists(source): + * raise IOError('File %s does not exist' % source) + * raise IOError('Initializing from file failed') # <<<<<<<<<<<<<< + * + * self.parser.source = ptr + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":562 + * raise IOError('Initializing from file failed') + * + * self.parser.source = ptr # <<<<<<<<<<<<<< + * + * elif hasattr(source, 'read'): + */ + __pyx_v_self->parser->source = __pyx_v_ptr; + goto __pyx_L7; + } + + /* "pandas/parser.pyx":564 + * self.parser.source = ptr + * + * elif hasattr(source, 'read'): # <<<<<<<<<<<<<< + * # e.g., StringIO + * + */ + __pyx_t_3 = PyObject_HasAttr(__pyx_v_source, __pyx_n_s_read); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":567 + * # e.g., StringIO + * + * ptr = new_rd_source(source) # <<<<<<<<<<<<<< + * if ptr == NULL: + * raise IOError('Initializing parser from file-like ' + */ + __pyx_v_ptr = new_rd_source(__pyx_v_source); + + /* "pandas/parser.pyx":568 + * + * ptr = new_rd_source(source) + * if ptr == NULL: # <<<<<<<<<<<<<< + * raise IOError('Initializing parser from file-like ' + * 'object failed') + */ + __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":569 + * ptr = new_rd_source(source) + * if ptr == NULL: + * raise IOError('Initializing parser from file-like ' # <<<<<<<<<<<<<< + * 'object failed') + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":572 + * 'object failed') + * + * self.parser.source = ptr # <<<<<<<<<<<<<< + * self.parser.cb_io = &buffer_rd_bytes + * self.parser.cb_cleanup = &del_rd_source + */ + __pyx_v_self->parser->source = __pyx_v_ptr; + + /* "pandas/parser.pyx":573 + * + * self.parser.source = ptr + * self.parser.cb_io = &buffer_rd_bytes # <<<<<<<<<<<<<< + * self.parser.cb_cleanup = &del_rd_source + * else: + */ + __pyx_v_self->parser->cb_io = (&buffer_rd_bytes); + + /* "pandas/parser.pyx":574 + * self.parser.source = ptr + * self.parser.cb_io = &buffer_rd_bytes + * self.parser.cb_cleanup = &del_rd_source # <<<<<<<<<<<<<< + * else: + * raise IOError('Expected file path name or file-like object,' + */ + __pyx_v_self->parser->cb_cleanup = (&del_rd_source); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/parser.pyx":577 + * else: + * raise IOError('Expected file path name or file-like object,' + * ' got %s type' % type(source)) # <<<<<<<<<<<<<< + * + * cdef _get_header(self): + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_file_path_name_or_file, ((PyObject *)Py_TYPE(__pyx_v_source))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/parser.pyx":576 + * self.parser.cb_cleanup = &del_rd_source + * else: + * raise IOError('Expected file path name or file-like object,' # <<<<<<<<<<<<<< + * ' got %s type' % type(source)) + * + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L7:; + + /* "pandas/parser.pyx":512 + * parser_add_skiprow(self.parser, i) + * + * cdef _setup_parser_source(self, source): # <<<<<<<<<<<<<< + * cdef: + * int status + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.parser.TextReader._setup_parser_source", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_gzip); + __Pyx_XDECREF(__pyx_v_bz2); + __Pyx_XDECREF(__pyx_v_source); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":579 + * ' got %s type' % type(source)) + * + * cdef _get_header(self): # <<<<<<<<<<<<<< + * # header is now a list of lists, so field_count should use header[0] + * + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__get_header(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + size_t __pyx_v_i; + size_t __pyx_v_start; + size_t __pyx_v_data_line; + size_t __pyx_v_field_count; + size_t __pyx_v_passed_count; + size_t __pyx_v_hr; + size_t __pyx_v_unnamed_count; + char *__pyx_v_word; + PyObject *__pyx_v_name = 0; + char *__pyx_v_errors; + PyObject *__pyx_v_header = NULL; + PyObject *__pyx_v_level = NULL; + PyObject *__pyx_v_this_header = NULL; + PyObject *__pyx_v_msg = NULL; + PyObject *__pyx_v_counts = NULL; + PyObject *__pyx_v_count = NULL; + PyObject *__pyx_v_lc = NULL; + PyObject *__pyx_v_ic = NULL; + Py_ssize_t __pyx_v_nuse; + PyObject *__pyx_v_m = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + size_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_header", 0); + + /* "pandas/parser.pyx":588 + * int status + * Py_ssize_t size + * char *errors = "strict" # <<<<<<<<<<<<<< + * + * header = [] + */ + __pyx_v_errors = __pyx_k_strict; + + /* "pandas/parser.pyx":590 + * char *errors = "strict" + * + * header = [] # <<<<<<<<<<<<<< + * + * if self.parser.header_start >= 0: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_header = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":592 + * header = [] + * + * if self.parser.header_start >= 0: # <<<<<<<<<<<<<< + * + * # Header is in the file + */ + __pyx_t_2 = ((__pyx_v_self->parser->header_start >= 0) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":595 + * + * # Header is in the file + * for level, hr in enumerate(self.header): # <<<<<<<<<<<<<< + * + * this_header = [] + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_self->header) || PyTuple_CheckExact(__pyx_v_self->header)) { + __pyx_t_3 = __pyx_v_self->header; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self->header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_hr = __pyx_t_7; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_level, __pyx_t_1); + __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":597 + * for level, hr in enumerate(self.header): + * + * this_header = [] # <<<<<<<<<<<<<< + * + * if self.parser.lines < hr + 1: + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_this_header, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":599 + * this_header = [] + * + * if self.parser.lines < hr + 1: # <<<<<<<<<<<<<< + * self._tokenize_rows(hr + 2) + * + */ + __pyx_t_2 = ((__pyx_v_self->parser->lines < (__pyx_v_hr + 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":600 + * + * if self.parser.lines < hr + 1: + * self._tokenize_rows(hr + 2) # <<<<<<<<<<<<<< + * + * # e.g., if header=3 and file only has 2 lines + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_tokenize_rows(__pyx_v_self, (__pyx_v_hr + 2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/parser.pyx":603 + * + * # e.g., if header=3 and file only has 2 lines + * if self.parser.lines < hr + 1: # <<<<<<<<<<<<<< + * msg = self.orig_header + * if isinstance(msg,list): + */ + __pyx_t_2 = ((__pyx_v_self->parser->lines < (__pyx_v_hr + 1)) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":604 + * # e.g., if header=3 and file only has 2 lines + * if self.parser.lines < hr + 1: + * msg = self.orig_header # <<<<<<<<<<<<<< + * if isinstance(msg,list): + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + */ + __pyx_t_6 = __pyx_v_self->orig_header; + __Pyx_INCREF(__pyx_t_6); + __pyx_v_msg = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":605 + * if self.parser.lines < hr + 1: + * msg = self.orig_header + * if isinstance(msg,list): # <<<<<<<<<<<<<< + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + * raise CParserError('Passed header=%s but only %d lines in file' + */ + __pyx_t_2 = PyList_Check(__pyx_v_msg); + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":606 + * msg = self.orig_header + * if isinstance(msg,list): + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) # <<<<<<<<<<<<<< + * raise CParserError('Passed header=%s but only %d lines in file' + * % (msg, self.parser.lines)) + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyList_CheckExact(__pyx_v_msg) || PyTuple_CheckExact(__pyx_v_msg)) { + __pyx_t_9 = __pyx_v_msg; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_msg); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext; + } + for (;;) { + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_9)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_12 = __pyx_t_11(__pyx_t_9); + if (unlikely(!__pyx_t_12)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_12); + } + __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_m); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_m); + __Pyx_GIVEREF(__pyx_v_m); + __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_10 = PyObject_Length(__pyx_v_msg); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_9 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_s_len_of_d, __pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/parser.pyx":607 + * if isinstance(msg,list): + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + * raise CParserError('Passed header=%s but only %d lines in file' # <<<<<<<<<<<<<< + * % (msg, self.parser.lines)) + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_CParserError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/parser.pyx":608 + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + * raise CParserError('Passed header=%s but only %d lines in file' + * % (msg, self.parser.lines)) # <<<<<<<<<<<<<< + * + * field_count = self.parser.line_fields[hr] + */ + __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_self->parser->lines); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_msg); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_msg); + __Pyx_GIVEREF(__pyx_v_msg); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyString_Format(__pyx_kp_s_Passed_header_s_but_only_d_lines, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":607 + * if isinstance(msg,list): + * msg = "[%s], len of %d," % (','.join([ str(m) for m in msg ]),len(msg)) + * raise CParserError('Passed header=%s but only %d lines in file' # <<<<<<<<<<<<<< + * % (msg, self.parser.lines)) + * + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_13, 0, 0, 0); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":610 + * % (msg, self.parser.lines)) + * + * field_count = self.parser.line_fields[hr] # <<<<<<<<<<<<<< + * start = self.parser.line_start[hr] + * + */ + __pyx_v_field_count = (__pyx_v_self->parser->line_fields[__pyx_v_hr]); + + /* "pandas/parser.pyx":611 + * + * field_count = self.parser.line_fields[hr] + * start = self.parser.line_start[hr] # <<<<<<<<<<<<<< + * + * # TODO: Py3 vs. Py2 + */ + __pyx_v_start = (__pyx_v_self->parser->line_start[__pyx_v_hr]); + + /* "pandas/parser.pyx":614 + * + * # TODO: Py3 vs. Py2 + * counts = {} # <<<<<<<<<<<<<< + * unnamed_count = 0 + * for i in range(field_count): + */ + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_XDECREF_SET(__pyx_v_counts, ((PyObject*)__pyx_t_13)); + __pyx_t_13 = 0; + + /* "pandas/parser.pyx":615 + * # TODO: Py3 vs. Py2 + * counts = {} + * unnamed_count = 0 # <<<<<<<<<<<<<< + * for i in range(field_count): + * word = self.parser.words[start + i] + */ + __pyx_v_unnamed_count = 0; + + /* "pandas/parser.pyx":616 + * counts = {} + * unnamed_count = 0 + * for i in range(field_count): # <<<<<<<<<<<<<< + * word = self.parser.words[start + i] + * + */ + __pyx_t_7 = __pyx_v_field_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_7; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/parser.pyx":617 + * unnamed_count = 0 + * for i in range(field_count): + * word = self.parser.words[start + i] # <<<<<<<<<<<<<< + * + * if self.c_encoding == NULL and not PY3: + */ + __pyx_v_word = (__pyx_v_self->parser->words[(__pyx_v_start + __pyx_v_i)]); + + /* "pandas/parser.pyx":619 + * word = self.parser.words[start + i] + * + * if self.c_encoding == NULL and not PY3: # <<<<<<<<<<<<<< + * name = PyBytes_FromString(word) + * else: + */ + __pyx_t_8 = ((__pyx_v_self->c_encoding == NULL) != 0); + if (__pyx_t_8) { + __pyx_t_2 = ((!(__pyx_v_6pandas_6parser_PY3 != 0)) != 0); + __pyx_t_15 = __pyx_t_2; + } else { + __pyx_t_15 = __pyx_t_8; + } + if (__pyx_t_15) { + + /* "pandas/parser.pyx":620 + * + * if self.c_encoding == NULL and not PY3: + * name = PyBytes_FromString(word) # <<<<<<<<<<<<<< + * else: + * if self.c_encoding == NULL or self.c_encoding == b'utf-8': + */ + __pyx_t_13 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/parser.pyx":622 + * name = PyBytes_FromString(word) + * else: + * if self.c_encoding == NULL or self.c_encoding == b'utf-8': # <<<<<<<<<<<<<< + * name = PyUnicode_FromString(word) + * else: + */ + __pyx_t_15 = (__pyx_v_self->c_encoding == NULL); + if (!__pyx_t_15) { + __pyx_t_13 = __Pyx_PyBytes_FromString(__pyx_v_self->c_encoding); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_8 = (__Pyx_PyBytes_Equals(__pyx_t_13, __pyx_kp_b_utf_8, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_2 = __pyx_t_8; + } else { + __pyx_t_2 = __pyx_t_15; + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":623 + * else: + * if self.c_encoding == NULL or self.c_encoding == b'utf-8': + * name = PyUnicode_FromString(word) # <<<<<<<<<<<<<< + * else: + * name = PyUnicode_Decode(word, strlen(word), + */ + __pyx_t_13 = PyUnicode_FromString(__pyx_v_word); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/parser.pyx":625 + * name = PyUnicode_FromString(word) + * else: + * name = PyUnicode_Decode(word, strlen(word), # <<<<<<<<<<<<<< + * self.c_encoding, errors) + * + */ + __pyx_t_13 = PyUnicode_Decode(__pyx_v_word, strlen(__pyx_v_word), __pyx_v_self->c_encoding, __pyx_v_errors); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_13); + __pyx_t_13 = 0; + } + __pyx_L14:; + } + __pyx_L13:; + + /* "pandas/parser.pyx":628 + * self.c_encoding, errors) + * + * if name == '': # <<<<<<<<<<<<<< + * if self.has_mi_columns: + * name = 'Unnamed: %d_level_%d' % (i,level) + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_kp_s__16, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + + /* "pandas/parser.pyx":629 + * + * if name == '': + * if self.has_mi_columns: # <<<<<<<<<<<<<< + * name = 'Unnamed: %d_level_%d' % (i,level) + * else: + */ + __pyx_t_2 = (__pyx_v_self->has_mi_columns != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":630 + * if name == '': + * if self.has_mi_columns: + * name = 'Unnamed: %d_level_%d' % (i,level) # <<<<<<<<<<<<<< + * else: + * name = 'Unnamed: %d' % i + */ + __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_level); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_level); + __Pyx_GIVEREF(__pyx_v_level); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyString_Format(__pyx_kp_s_Unnamed_d_level__d, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L16; + } + /*else*/ { + + /* "pandas/parser.pyx":632 + * name = 'Unnamed: %d_level_%d' % (i,level) + * else: + * name = 'Unnamed: %d' % i # <<<<<<<<<<<<<< + * unnamed_count += 1 + * + */ + __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Unnamed_d, __pyx_t_13); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_9); + __pyx_t_9 = 0; + } + __pyx_L16:; + + /* "pandas/parser.pyx":633 + * else: + * name = 'Unnamed: %d' % i + * unnamed_count += 1 # <<<<<<<<<<<<<< + * + * count = counts.get(name, 0) + */ + __pyx_v_unnamed_count = (__pyx_v_unnamed_count + 1); + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/parser.pyx":635 + * unnamed_count += 1 + * + * count = counts.get(name, 0) # <<<<<<<<<<<<<< + * if count > 0 and self.mangle_dupe_cols and not self.has_mi_columns: + * this_header.append('%s.%d' % (name, count)) + */ + __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_counts, __pyx_v_name, __pyx_int_0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/parser.pyx":636 + * + * count = counts.get(name, 0) + * if count > 0 and self.mangle_dupe_cols and not self.has_mi_columns: # <<<<<<<<<<<<<< + * this_header.append('%s.%d' % (name, count)) + * else: + */ + __pyx_t_9 = PyObject_RichCompare(__pyx_v_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_2) { + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_self->mangle_dupe_cols); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_15) { + __pyx_t_8 = (!(__pyx_v_self->has_mi_columns != 0)); + __pyx_t_16 = __pyx_t_8; + } else { + __pyx_t_16 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_16; + } else { + __pyx_t_15 = __pyx_t_2; + } + if (__pyx_t_15) { + + /* "pandas/parser.pyx":637 + * count = counts.get(name, 0) + * if count > 0 and self.mangle_dupe_cols and not self.has_mi_columns: + * this_header.append('%s.%d' % (name, count)) # <<<<<<<<<<<<<< + * else: + * this_header.append(name) + */ + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_INCREF(__pyx_v_count); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_count); + __Pyx_GIVEREF(__pyx_v_count); + __pyx_t_13 = __Pyx_PyString_Format(__pyx_kp_s_s_d, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_this_header, __pyx_t_13); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/parser.pyx":639 + * this_header.append('%s.%d' % (name, count)) + * else: + * this_header.append(name) # <<<<<<<<<<<<<< + * counts[name] = count + 1 + * + */ + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_this_header, __pyx_v_name); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L17:; + + /* "pandas/parser.pyx":640 + * else: + * this_header.append(name) + * counts[name] = count + 1 # <<<<<<<<<<<<<< + * + * if self.has_mi_columns: + */ + __pyx_t_13 = PyNumber_Add(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (unlikely(PyDict_SetItem(__pyx_v_counts, __pyx_v_name, __pyx_t_13) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + + /* "pandas/parser.pyx":642 + * counts[name] = count + 1 + * + * if self.has_mi_columns: # <<<<<<<<<<<<<< + * + * # if we have grabbed an extra line, but its not in our format + */ + __pyx_t_15 = (__pyx_v_self->has_mi_columns != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":647 + * # so save in the buffer, and create an blank extra line for the rest of the + * # parsing code + * if hr == self.header[-1]: # <<<<<<<<<<<<<< + * lc = len(this_header) + * ic = len(self.index_col) if self.index_col is not None else 0 + */ + __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_hr); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_self->header, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_13, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_15) { + + /* "pandas/parser.pyx":648 + * # parsing code + * if hr == self.header[-1]: + * lc = len(this_header) # <<<<<<<<<<<<<< + * ic = len(self.index_col) if self.index_col is not None else 0 + * if lc != unnamed_count and lc-ic > unnamed_count: + */ + __pyx_t_10 = PyList_GET_SIZE(__pyx_v_this_header); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":649 + * if hr == self.header[-1]: + * lc = len(this_header) + * ic = len(self.index_col) if self.index_col is not None else 0 # <<<<<<<<<<<<<< + * if lc != unnamed_count and lc-ic > unnamed_count: + * hr -= 1 + */ + __pyx_t_15 = (__pyx_v_self->index_col != Py_None); + if ((__pyx_t_15 != 0)) { + __pyx_t_9 = __pyx_v_self->index_col; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __Pyx_INCREF(__pyx_int_0); + __pyx_t_6 = __pyx_int_0; + } + __Pyx_XDECREF_SET(__pyx_v_ic, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":650 + * lc = len(this_header) + * ic = len(self.index_col) if self.index_col is not None else 0 + * if lc != unnamed_count and lc-ic > unnamed_count: # <<<<<<<<<<<<<< + * hr -= 1 + * self.parser_start -= 1 + */ + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_unnamed_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_lc, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_15) { + __pyx_t_9 = PyNumber_Subtract(__pyx_v_lc, __pyx_v_ic); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_unnamed_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyObject_RichCompare(__pyx_t_9, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_16 = __pyx_t_2; + } else { + __pyx_t_16 = __pyx_t_15; + } + if (__pyx_t_16) { + + /* "pandas/parser.pyx":651 + * ic = len(self.index_col) if self.index_col is not None else 0 + * if lc != unnamed_count and lc-ic > unnamed_count: + * hr -= 1 # <<<<<<<<<<<<<< + * self.parser_start -= 1 + * this_header = [ None ] * lc + */ + __pyx_v_hr = (__pyx_v_hr - 1); + + /* "pandas/parser.pyx":652 + * if lc != unnamed_count and lc-ic > unnamed_count: + * hr -= 1 + * self.parser_start -= 1 # <<<<<<<<<<<<<< + * this_header = [ None ] * lc + * + */ + __pyx_v_self->parser_start = (__pyx_v_self->parser_start - 1); + + /* "pandas/parser.pyx":653 + * hr -= 1 + * self.parser_start -= 1 + * this_header = [ None ] * lc # <<<<<<<<<<<<<< + * + * data_line = hr + 1 + */ + __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_13, 0, Py_None); + __Pyx_GIVEREF(Py_None); + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_13, __pyx_v_lc); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_temp); + __Pyx_DECREF(__pyx_t_13); + __pyx_t_13 = __pyx_temp; + } + __Pyx_DECREF_SET(__pyx_v_this_header, ((PyObject*)__pyx_t_13)); + __pyx_t_13 = 0; + goto __pyx_L20; + } + __pyx_L20:; + goto __pyx_L19; + } + __pyx_L19:; + goto __pyx_L18; + } + __pyx_L18:; + + /* "pandas/parser.pyx":655 + * this_header = [ None ] * lc + * + * data_line = hr + 1 # <<<<<<<<<<<<<< + * header.append(this_header) + * + */ + __pyx_v_data_line = (__pyx_v_hr + 1); + + /* "pandas/parser.pyx":656 + * + * data_line = hr + 1 + * header.append(this_header) # <<<<<<<<<<<<<< + * + * if self.names is not None: + */ + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_header, __pyx_v_this_header); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":658 + * header.append(this_header) + * + * if self.names is not None: # <<<<<<<<<<<<<< + * header = [ self.names ] + * + */ + __pyx_t_16 = (__pyx_v_self->names != Py_None); + __pyx_t_15 = (__pyx_t_16 != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":659 + * + * if self.names is not None: + * header = [ self.names ] # <<<<<<<<<<<<<< + * + * elif self.names is not None: + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->names); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->names); + __Pyx_GIVEREF(__pyx_v_self->names); + __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + goto __pyx_L21; + } + __pyx_L21:; + goto __pyx_L3; + } + + /* "pandas/parser.pyx":661 + * header = [ self.names ] + * + * elif self.names is not None: # <<<<<<<<<<<<<< + * # Enforce this unless usecols + * if not self.has_usecols: + */ + __pyx_t_15 = (__pyx_v_self->names != Py_None); + __pyx_t_16 = (__pyx_t_15 != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":663 + * elif self.names is not None: + * # Enforce this unless usecols + * if not self.has_usecols: # <<<<<<<<<<<<<< + * self.parser.expected_fields = len(self.names) + * + */ + __pyx_t_16 = ((!(__pyx_v_self->has_usecols != 0)) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":664 + * # Enforce this unless usecols + * if not self.has_usecols: + * self.parser.expected_fields = len(self.names) # <<<<<<<<<<<<<< + * + * # Names passed + */ + __pyx_t_1 = __pyx_v_self->names; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->parser->expected_fields = __pyx_t_4; + goto __pyx_L22; + } + __pyx_L22:; + + /* "pandas/parser.pyx":667 + * + * # Names passed + * if self.parser.lines < 1: # <<<<<<<<<<<<<< + * self._tokenize_rows(1) + * + */ + __pyx_t_16 = ((__pyx_v_self->parser->lines < 1) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":668 + * # Names passed + * if self.parser.lines < 1: + * self._tokenize_rows(1) # <<<<<<<<<<<<<< + * + * header = [ self.names ] + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_tokenize_rows(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L23; + } + __pyx_L23:; + + /* "pandas/parser.pyx":670 + * self._tokenize_rows(1) + * + * header = [ self.names ] # <<<<<<<<<<<<<< + * data_line = 0 + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->names); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->names); + __Pyx_GIVEREF(__pyx_v_self->names); + __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":671 + * + * header = [ self.names ] + * data_line = 0 # <<<<<<<<<<<<<< + * + * if self.parser.lines < 1: + */ + __pyx_v_data_line = 0; + + /* "pandas/parser.pyx":673 + * data_line = 0 + * + * if self.parser.lines < 1: # <<<<<<<<<<<<<< + * field_count = len(header[0]) + * else: + */ + __pyx_t_16 = ((__pyx_v_self->parser->lines < 1) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":674 + * + * if self.parser.lines < 1: + * field_count = len(header[0]) # <<<<<<<<<<<<<< + * else: + * field_count = self.parser.line_fields[data_line] + */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_field_count = __pyx_t_4; + goto __pyx_L24; + } + /*else*/ { + + /* "pandas/parser.pyx":676 + * field_count = len(header[0]) + * else: + * field_count = self.parser.line_fields[data_line] # <<<<<<<<<<<<<< + * else: + * # No header passed nor to be found in the file + */ + __pyx_v_field_count = (__pyx_v_self->parser->line_fields[__pyx_v_data_line]); + } + __pyx_L24:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":679 + * else: + * # No header passed nor to be found in the file + * if self.parser.lines < 1: # <<<<<<<<<<<<<< + * self._tokenize_rows(1) + * + */ + __pyx_t_16 = ((__pyx_v_self->parser->lines < 1) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":680 + * # No header passed nor to be found in the file + * if self.parser.lines < 1: + * self._tokenize_rows(1) # <<<<<<<<<<<<<< + * + * return None, self.parser.line_fields[0] + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_tokenize_rows(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L25; + } + __pyx_L25:; + + /* "pandas/parser.pyx":682 + * self._tokenize_rows(1) + * + * return None, self.parser.line_fields[0] # <<<<<<<<<<<<<< + * + * # Corner case, not enough lines in the file + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->parser->line_fields[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":685 + * + * # Corner case, not enough lines in the file + * if self.parser.lines < data_line + 1: # <<<<<<<<<<<<<< + * field_count = len(header[0]) + * else: # not self.has_usecols: + */ + __pyx_t_16 = ((__pyx_v_self->parser->lines < (__pyx_v_data_line + 1)) != 0); + if (__pyx_t_16) { + + /* "pandas/parser.pyx":686 + * # Corner case, not enough lines in the file + * if self.parser.lines < data_line + 1: + * field_count = len(header[0]) # <<<<<<<<<<<<<< + * else: # not self.has_usecols: + * + */ + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_field_count = __pyx_t_4; + goto __pyx_L26; + } + /*else*/ { + + /* "pandas/parser.pyx":689 + * else: # not self.has_usecols: + * + * field_count = self.parser.line_fields[data_line] # <<<<<<<<<<<<<< + * + * # #2981 + */ + __pyx_v_field_count = (__pyx_v_self->parser->line_fields[__pyx_v_data_line]); + + /* "pandas/parser.pyx":692 + * + * # #2981 + * if self.names is not None: # <<<<<<<<<<<<<< + * field_count = max(field_count, len(self.names)) + * + */ + __pyx_t_16 = (__pyx_v_self->names != Py_None); + __pyx_t_15 = (__pyx_t_16 != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":693 + * # #2981 + * if self.names is not None: + * field_count = max(field_count, len(self.names)) # <<<<<<<<<<<<<< + * + * passed_count = len(header[0]) + */ + __pyx_t_3 = __pyx_v_self->names; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __pyx_v_field_count; + if (((__pyx_t_4 > __pyx_t_7) != 0)) { + __pyx_t_14 = __pyx_t_4; + } else { + __pyx_t_14 = __pyx_t_7; + } + __pyx_v_field_count = __pyx_t_14; + goto __pyx_L27; + } + __pyx_L27:; + + /* "pandas/parser.pyx":695 + * field_count = max(field_count, len(self.names)) + * + * passed_count = len(header[0]) # <<<<<<<<<<<<<< + * + * # if passed_count > field_count: + */ + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_header, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_passed_count = __pyx_t_4; + + /* "pandas/parser.pyx":702 + * # % (passed_count, field_count)) + * + * if self.has_usecols: # <<<<<<<<<<<<<< + * nuse = len(self.usecols) + * if nuse == passed_count: + */ + __pyx_t_15 = (__pyx_v_self->has_usecols != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":703 + * + * if self.has_usecols: + * nuse = len(self.usecols) # <<<<<<<<<<<<<< + * if nuse == passed_count: + * self.leading_cols = 0 + */ + __pyx_t_3 = __pyx_v_self->usecols; + __Pyx_INCREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PySet_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_nuse = __pyx_t_4; + + /* "pandas/parser.pyx":704 + * if self.has_usecols: + * nuse = len(self.usecols) + * if nuse == passed_count: # <<<<<<<<<<<<<< + * self.leading_cols = 0 + * elif self.names is None and nuse < passed_count: + */ + __pyx_t_15 = ((__pyx_v_nuse == __pyx_v_passed_count) != 0); + if (__pyx_t_15) { + + /* "pandas/parser.pyx":705 + * nuse = len(self.usecols) + * if nuse == passed_count: + * self.leading_cols = 0 # <<<<<<<<<<<<<< + * elif self.names is None and nuse < passed_count: + * self.leading_cols = field_count - passed_count + */ + __pyx_v_self->leading_cols = 0; + goto __pyx_L29; + } + + /* "pandas/parser.pyx":706 + * if nuse == passed_count: + * self.leading_cols = 0 + * elif self.names is None and nuse < passed_count: # <<<<<<<<<<<<<< + * self.leading_cols = field_count - passed_count + * elif passed_count != field_count: + */ + __pyx_t_15 = (__pyx_v_self->names == Py_None); + if ((__pyx_t_15 != 0)) { + __pyx_t_16 = ((__pyx_v_nuse < __pyx_v_passed_count) != 0); + __pyx_t_2 = __pyx_t_16; + } else { + __pyx_t_2 = (__pyx_t_15 != 0); + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":707 + * self.leading_cols = 0 + * elif self.names is None and nuse < passed_count: + * self.leading_cols = field_count - passed_count # <<<<<<<<<<<<<< + * elif passed_count != field_count: + * raise ValueError('Passed header names ' + */ + __pyx_v_self->leading_cols = (__pyx_v_field_count - __pyx_v_passed_count); + goto __pyx_L29; + } + + /* "pandas/parser.pyx":708 + * elif self.names is None and nuse < passed_count: + * self.leading_cols = field_count - passed_count + * elif passed_count != field_count: # <<<<<<<<<<<<<< + * raise ValueError('Passed header names ' + * 'mismatches usecols') + */ + __pyx_t_2 = ((__pyx_v_passed_count != __pyx_v_field_count) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":709 + * self.leading_cols = field_count - passed_count + * elif passed_count != field_count: + * raise ValueError('Passed header names ' # <<<<<<<<<<<<<< + * 'mismatches usecols') + * # oh boy, #2442, #2981 + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L29:; + goto __pyx_L28; + } + + /* "pandas/parser.pyx":712 + * 'mismatches usecols') + * # oh boy, #2442, #2981 + * elif self.allow_leading_cols and passed_count < field_count: # <<<<<<<<<<<<<< + * self.leading_cols = field_count - passed_count + * + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->allow_leading_cols); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __pyx_t_15 = (__pyx_v_passed_count < __pyx_v_field_count); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_2; + } + if (__pyx_t_16) { + + /* "pandas/parser.pyx":713 + * # oh boy, #2442, #2981 + * elif self.allow_leading_cols and passed_count < field_count: + * self.leading_cols = field_count - passed_count # <<<<<<<<<<<<<< + * + * return header, field_count + */ + __pyx_v_self->leading_cols = (__pyx_v_field_count - __pyx_v_passed_count); + goto __pyx_L28; + } + __pyx_L28:; + } + __pyx_L26:; + + /* "pandas/parser.pyx":715 + * self.leading_cols = field_count - passed_count + * + * return header, field_count # <<<<<<<<<<<<<< + * + * cdef _implicit_index_count(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_field_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_header); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_header); + __Pyx_GIVEREF(__pyx_v_header); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":579 + * ' got %s type' % type(source)) + * + * cdef _get_header(self): # <<<<<<<<<<<<<< + * # header is now a list of lists, so field_count should use header[0] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.parser.TextReader._get_header", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_header); + __Pyx_XDECREF(__pyx_v_level); + __Pyx_XDECREF(__pyx_v_this_header); + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XDECREF(__pyx_v_counts); + __Pyx_XDECREF(__pyx_v_count); + __Pyx_XDECREF(__pyx_v_lc); + __Pyx_XDECREF(__pyx_v_ic); + __Pyx_XDECREF(__pyx_v_m); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":717 + * return header, field_count + * + * cdef _implicit_index_count(self): # <<<<<<<<<<<<<< + * pass + * + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__implicit_index_count(CYTHON_UNUSED struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_implicit_index_count", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":720 + * pass + * + * def read(self, rows=None): # <<<<<<<<<<<<<< + * """ + * rows=None --> read all rows + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_6parser_10TextReader_8read[] = "\n rows=None --> read all rows\n "; +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_rows = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rows); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_rows = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8read(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_rows); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8read(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows) { + PyObject *__pyx_v_columns = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read", 0); + + /* "pandas/parser.pyx":727 + * int status + * + * if self.low_memory: # <<<<<<<<<<<<<< + * # Conserve intermediate space + * columns = self._read_low_memory(rows) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->low_memory); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":729 + * if self.low_memory: + * # Conserve intermediate space + * columns = self._read_low_memory(rows) # <<<<<<<<<<<<<< + * else: + * # Don't care about memory usage + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_read_low_memory(__pyx_v_self, __pyx_v_rows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_columns = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":732 + * else: + * # Don't care about memory usage + * columns = self._read_rows(rows, 1) # <<<<<<<<<<<<<< + * + * if self.as_recarray: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_read_rows(__pyx_v_self, __pyx_v_rows, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_columns = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":734 + * columns = self._read_rows(rows, 1) + * + * if self.as_recarray: # <<<<<<<<<<<<<< + * self._start_clock() + * result = _to_structured_array(columns, self.header) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->as_recarray); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/parser.pyx":735 + * + * if self.as_recarray: + * self._start_clock() # <<<<<<<<<<<<<< + * result = _to_structured_array(columns, self.header) + * self._end_clock('Conversion to structured array') + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_start_clock(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":736 + * if self.as_recarray: + * self._start_clock() + * result = _to_structured_array(columns, self.header) # <<<<<<<<<<<<<< + * self._end_clock('Conversion to structured array') + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_to_structured_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_columns); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_columns); + __Pyx_GIVEREF(__pyx_v_columns); + __Pyx_INCREF(__pyx_v_self->header); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->header); + __Pyx_GIVEREF(__pyx_v_self->header); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":737 + * self._start_clock() + * result = _to_structured_array(columns, self.header) + * self._end_clock('Conversion to structured array') # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_end_clock(__pyx_v_self, __pyx_kp_s_Conversion_to_structured_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":739 + * self._end_clock('Conversion to structured array') + * + * return result # <<<<<<<<<<<<<< + * else: + * return columns + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":741 + * return result + * else: + * return columns # <<<<<<<<<<<<<< + * + * cdef _read_low_memory(self, rows): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_columns); + __pyx_r = __pyx_v_columns; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":720 + * pass + * + * def read(self, rows=None): # <<<<<<<<<<<<<< + * """ + * rows=None --> read all rows + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.parser.TextReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_columns); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":743 + * return columns + * + * cdef _read_low_memory(self, rows): # <<<<<<<<<<<<<< + * cdef: + * size_t rows_read = 0 + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__read_low_memory(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows) { + size_t __pyx_v_rows_read; + PyObject *__pyx_v_chunks = 0; + PyObject *__pyx_v_chunk = NULL; + PyObject *__pyx_v_crows = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_read_low_memory", 0); + + /* "pandas/parser.pyx":745 + * cdef _read_low_memory(self, rows): + * cdef: + * size_t rows_read = 0 # <<<<<<<<<<<<<< + * chunks = [] + * + */ + __pyx_v_rows_read = 0; + + /* "pandas/parser.pyx":746 + * cdef: + * size_t rows_read = 0 + * chunks = [] # <<<<<<<<<<<<<< + * + * if rows is None: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_chunks = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":748 + * chunks = [] + * + * if rows is None: # <<<<<<<<<<<<<< + * while True: + * try: + */ + __pyx_t_2 = (__pyx_v_rows == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":749 + * + * if rows is None: + * while True: # <<<<<<<<<<<<<< + * try: + * chunk = self._read_rows(self.buffer_lines, 0) + */ + while (1) { + + /* "pandas/parser.pyx":750 + * if rows is None: + * while True: + * try: # <<<<<<<<<<<<<< + * chunk = self._read_rows(self.buffer_lines, 0) + * if len(chunk) == 0: + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/parser.pyx":751 + * while True: + * try: + * chunk = self._read_rows(self.buffer_lines, 0) # <<<<<<<<<<<<<< + * if len(chunk) == 0: + * break + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->buffer_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_read_rows(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":752 + * try: + * chunk = self._read_rows(self.buffer_lines, 0) + * if len(chunk) == 0: # <<<<<<<<<<<<<< + * break + * except StopIteration: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_3 = ((__pyx_t_8 == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":753 + * chunk = self._read_rows(self.buffer_lines, 0) + * if len(chunk) == 0: + * break # <<<<<<<<<<<<<< + * except StopIteration: + * break + */ + goto __pyx_L11_try_break; + } + } + /*else:*/ { + + /* "pandas/parser.pyx":757 + * break + * else: + * chunks.append(chunk) # <<<<<<<<<<<<<< + * else: + * while rows_read < rows: + */ + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_chunks, __pyx_v_chunk); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/parser.pyx":754 + * if len(chunk) == 0: + * break + * except StopIteration: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); + if (__pyx_t_10) { + __Pyx_AddTraceback("pandas.parser.TextReader._read_low_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/parser.pyx":755 + * break + * except StopIteration: + * break # <<<<<<<<<<<<<< + * else: + * chunks.append(chunk) + */ + goto __pyx_L15_except_break; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L7_exception_handled; + __pyx_L15_except_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L11_try_break; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L11_try_break:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L5_break; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L13_try_end:; + } + } + __pyx_L5_break:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":759 + * chunks.append(chunk) + * else: + * while rows_read < rows: # <<<<<<<<<<<<<< + * try: + * crows = min(self.buffer_lines, rows - rows_read) + */ + while (1) { + __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_v_rows_read); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_v_rows, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_3) break; + + /* "pandas/parser.pyx":760 + * else: + * while rows_read < rows: + * try: # <<<<<<<<<<<<<< + * crows = min(self.buffer_lines, rows - rows_read) + * + */ + { + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/parser.pyx":761 + * while rows_read < rows: + * try: + * crows = min(self.buffer_lines, rows - rows_read) # <<<<<<<<<<<<<< + * + * chunk = self._read_rows(crows, 0) + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rows_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PyNumber_Subtract(__pyx_v_rows, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __pyx_v_self->buffer_lines; + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_3) { + __Pyx_INCREF(__pyx_t_11); + __pyx_t_1 = __pyx_t_11; + } else { + __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __pyx_t_12; + __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_crows, __pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/parser.pyx":763 + * crows = min(self.buffer_lines, rows - rows_read) + * + * chunk = self._read_rows(crows, 0) # <<<<<<<<<<<<<< + * if len(chunk) == 0: + * break + */ + __pyx_t_11 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_read_rows(__pyx_v_self, __pyx_v_crows, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/parser.pyx":764 + * + * chunk = self._read_rows(crows, 0) + * if len(chunk) == 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_8 = PyObject_Length(__pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __pyx_t_3 = ((__pyx_t_8 == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":765 + * chunk = self._read_rows(crows, 0) + * if len(chunk) == 0: + * break # <<<<<<<<<<<<<< + * + * rows_read += len(list(chunk.values())[0]) + */ + goto __pyx_L24_try_break; + } + + /* "pandas/parser.pyx":767 + * break + * + * rows_read += len(list(chunk.values())[0]) # <<<<<<<<<<<<<< + * except StopIteration: + * break + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_values); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;}; + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_rows_read = (__pyx_v_rows_read + __pyx_t_8); + } + /*else:*/ { + + /* "pandas/parser.pyx":771 + * break + * else: + * chunks.append(chunk) # <<<<<<<<<<<<<< + * + * parser_trim_buffers(self.parser) + */ + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_chunks, __pyx_v_chunk); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L26_try_end; + __pyx_L19_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "pandas/parser.pyx":768 + * + * rows_read += len(list(chunk.values())[0]) + * except StopIteration: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); + if (__pyx_t_10) { + __Pyx_AddTraceback("pandas.parser.TextReader._read_low_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_1, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_12); + + /* "pandas/parser.pyx":769 + * rows_read += len(list(chunk.values())[0]) + * except StopIteration: + * break # <<<<<<<<<<<<<< + * else: + * chunks.append(chunk) + */ + goto __pyx_L28_except_break; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L20_exception_handled; + __pyx_L28_except_break:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L24_try_break; + } + goto __pyx_L21_except_error; + __pyx_L21_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L24_try_break:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L18_break; + __pyx_L20_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_L26_try_end:; + } + } + __pyx_L18_break:; + } + __pyx_L3:; + + /* "pandas/parser.pyx":773 + * chunks.append(chunk) + * + * parser_trim_buffers(self.parser) # <<<<<<<<<<<<<< + * + * if len(chunks) == 0: + */ + parser_trim_buffers(__pyx_v_self->parser); + + /* "pandas/parser.pyx":775 + * parser_trim_buffers(self.parser) + * + * if len(chunks) == 0: # <<<<<<<<<<<<<< + * raise StopIteration + * + */ + __pyx_t_8 = PyObject_Length(__pyx_v_chunks); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_8 == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":776 + * + * if len(chunks) == 0: + * raise StopIteration # <<<<<<<<<<<<<< + * + * # destructive to chunks + */ + __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":779 + * + * # destructive to chunks + * return _concatenate_chunks(chunks) # <<<<<<<<<<<<<< + * + * cdef _tokenize_rows(self, size_t nrows): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_concatenate_chunks); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_chunks); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chunks); + __Pyx_GIVEREF(__pyx_v_chunks); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":743 + * return columns + * + * cdef _read_low_memory(self, rows): # <<<<<<<<<<<<<< + * cdef: + * size_t rows_read = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("pandas.parser.TextReader._read_low_memory", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_chunks); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_crows); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":781 + * return _concatenate_chunks(chunks) + * + * cdef _tokenize_rows(self, size_t nrows): # <<<<<<<<<<<<<< + * cdef int status + * status = tokenize_nrows(self.parser, nrows) + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__tokenize_rows(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, size_t __pyx_v_nrows) { + int __pyx_v_status; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_tokenize_rows", 0); + + /* "pandas/parser.pyx":783 + * cdef _tokenize_rows(self, size_t nrows): + * cdef int status + * status = tokenize_nrows(self.parser, nrows) # <<<<<<<<<<<<<< + * + * if self.parser.warn_msg != NULL: + */ + __pyx_v_status = tokenize_nrows(__pyx_v_self->parser, __pyx_v_nrows); + + /* "pandas/parser.pyx":785 + * status = tokenize_nrows(self.parser, nrows) + * + * if self.parser.warn_msg != NULL: # <<<<<<<<<<<<<< + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) + */ + __pyx_t_1 = ((__pyx_v_self->parser->warn_msg != NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":786 + * + * if self.parser.warn_msg != NULL: + * print >> sys.stderr, self.parser.warn_msg # <<<<<<<<<<<<<< + * free(self.parser.warn_msg) + * self.parser.warn_msg = NULL + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stderr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->parser->warn_msg); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PrintOne(__pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/parser.pyx":787 + * if self.parser.warn_msg != NULL: + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) # <<<<<<<<<<<<<< + * self.parser.warn_msg = NULL + * + */ + free(__pyx_v_self->parser->warn_msg); + + /* "pandas/parser.pyx":788 + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) + * self.parser.warn_msg = NULL # <<<<<<<<<<<<<< + * + * if status < 0: + */ + __pyx_v_self->parser->warn_msg = NULL; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":790 + * self.parser.warn_msg = NULL + * + * if status < 0: # <<<<<<<<<<<<<< + * raise_parser_error('Error tokenizing data', self.parser) + * + */ + __pyx_t_1 = ((__pyx_v_status < 0) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":791 + * + * if status < 0: + * raise_parser_error('Error tokenizing data', self.parser) # <<<<<<<<<<<<<< + * + * cdef _read_rows(self, rows, bint trim): + */ + __pyx_t_3 = __pyx_f_6pandas_6parser_raise_parser_error(__pyx_kp_s_Error_tokenizing_data, __pyx_v_self->parser); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/parser.pyx":781 + * return _concatenate_chunks(chunks) + * + * cdef _tokenize_rows(self, size_t nrows): # <<<<<<<<<<<<<< + * cdef int status + * status = tokenize_nrows(self.parser, nrows) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.TextReader._tokenize_rows", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":793 + * raise_parser_error('Error tokenizing data', self.parser) + * + * cdef _read_rows(self, rows, bint trim): # <<<<<<<<<<<<<< + * cdef: + * int buffered_lines + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__read_rows(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows, int __pyx_v_trim) { + int __pyx_v_buffered_lines; + int __pyx_v_irows; + int __pyx_v_footer; + int __pyx_v_status; + PyObject *__pyx_v_columns = NULL; + PyObject *__pyx_v_rows_read = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + size_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_read_rows", 0); + + /* "pandas/parser.pyx":796 + * cdef: + * int buffered_lines + * int irows, footer = 0 # <<<<<<<<<<<<<< + * + * self._start_clock() + */ + __pyx_v_footer = 0; + + /* "pandas/parser.pyx":798 + * int irows, footer = 0 + * + * self._start_clock() # <<<<<<<<<<<<<< + * + * if rows is not None: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_start_clock(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":800 + * self._start_clock() + * + * if rows is not None: # <<<<<<<<<<<<<< + * irows = rows + * buffered_lines = self.parser.lines - self.parser_start + */ + __pyx_t_2 = (__pyx_v_rows != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":801 + * + * if rows is not None: + * irows = rows # <<<<<<<<<<<<<< + * buffered_lines = self.parser.lines - self.parser_start + * if buffered_lines < irows: + */ + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_rows); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_irows = __pyx_t_4; + + /* "pandas/parser.pyx":802 + * if rows is not None: + * irows = rows + * buffered_lines = self.parser.lines - self.parser_start # <<<<<<<<<<<<<< + * if buffered_lines < irows: + * self._tokenize_rows(irows - buffered_lines) + */ + __pyx_v_buffered_lines = (__pyx_v_self->parser->lines - __pyx_v_self->parser_start); + + /* "pandas/parser.pyx":803 + * irows = rows + * buffered_lines = self.parser.lines - self.parser_start + * if buffered_lines < irows: # <<<<<<<<<<<<<< + * self._tokenize_rows(irows - buffered_lines) + * + */ + __pyx_t_3 = ((__pyx_v_buffered_lines < __pyx_v_irows) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":804 + * buffered_lines = self.parser.lines - self.parser_start + * if buffered_lines < irows: + * self._tokenize_rows(irows - buffered_lines) # <<<<<<<<<<<<<< + * + * if self.skip_footer > 0: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_tokenize_rows(__pyx_v_self, (__pyx_v_irows - __pyx_v_buffered_lines)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/parser.pyx":806 + * self._tokenize_rows(irows - buffered_lines) + * + * if self.skip_footer > 0: # <<<<<<<<<<<<<< + * raise ValueError('skip_footer can only be used to read ' + * 'the whole file') + */ + __pyx_t_3 = ((__pyx_v_self->skip_footer > 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":807 + * + * if self.skip_footer > 0: + * raise ValueError('skip_footer can only be used to read ' # <<<<<<<<<<<<<< + * 'the whole file') + * else: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":810 + * 'the whole file') + * else: + * status = tokenize_all_rows(self.parser) # <<<<<<<<<<<<<< + * + * if self.parser.warn_msg != NULL: + */ + __pyx_v_status = tokenize_all_rows(__pyx_v_self->parser); + + /* "pandas/parser.pyx":812 + * status = tokenize_all_rows(self.parser) + * + * if self.parser.warn_msg != NULL: # <<<<<<<<<<<<<< + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) + */ + __pyx_t_3 = ((__pyx_v_self->parser->warn_msg != NULL) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":813 + * + * if self.parser.warn_msg != NULL: + * print >> sys.stderr, self.parser.warn_msg # <<<<<<<<<<<<<< + * free(self.parser.warn_msg) + * self.parser.warn_msg = NULL + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->parser->warn_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PrintOne(__pyx_t_5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":814 + * if self.parser.warn_msg != NULL: + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) # <<<<<<<<<<<<<< + * self.parser.warn_msg = NULL + * + */ + free(__pyx_v_self->parser->warn_msg); + + /* "pandas/parser.pyx":815 + * print >> sys.stderr, self.parser.warn_msg + * free(self.parser.warn_msg) + * self.parser.warn_msg = NULL # <<<<<<<<<<<<<< + * + * if status < 0: + */ + __pyx_v_self->parser->warn_msg = NULL; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/parser.pyx":817 + * self.parser.warn_msg = NULL + * + * if status < 0: # <<<<<<<<<<<<<< + * raise_parser_error('Error tokenizing data', self.parser) + * footer = self.skip_footer + */ + __pyx_t_3 = ((__pyx_v_status < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":818 + * + * if status < 0: + * raise_parser_error('Error tokenizing data', self.parser) # <<<<<<<<<<<<<< + * footer = self.skip_footer + * + */ + __pyx_t_5 = __pyx_f_6pandas_6parser_raise_parser_error(__pyx_kp_s_Error_tokenizing_data, __pyx_v_self->parser); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/parser.pyx":819 + * if status < 0: + * raise_parser_error('Error tokenizing data', self.parser) + * footer = self.skip_footer # <<<<<<<<<<<<<< + * + * if self.parser_start == self.parser.lines: + */ + __pyx_t_4 = __pyx_v_self->skip_footer; + __pyx_v_footer = __pyx_t_4; + } + __pyx_L3:; + + /* "pandas/parser.pyx":821 + * footer = self.skip_footer + * + * if self.parser_start == self.parser.lines: # <<<<<<<<<<<<<< + * raise StopIteration + * self._end_clock('Tokenization') + */ + __pyx_t_3 = ((__pyx_v_self->parser_start == __pyx_v_self->parser->lines) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":822 + * + * if self.parser_start == self.parser.lines: + * raise StopIteration # <<<<<<<<<<<<<< + * self._end_clock('Tokenization') + * + */ + __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":823 + * if self.parser_start == self.parser.lines: + * raise StopIteration + * self._end_clock('Tokenization') # <<<<<<<<<<<<<< + * + * self._start_clock() + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_end_clock(__pyx_v_self, __pyx_n_s_Tokenization); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":825 + * self._end_clock('Tokenization') + * + * self._start_clock() # <<<<<<<<<<<<<< + * columns = self._convert_column_data(rows=rows, + * footer=footer, + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_start_clock(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":826 + * + * self._start_clock() + * columns = self._convert_column_data(rows=rows, # <<<<<<<<<<<<<< + * footer=footer, + * upcast_na=not self.as_recarray) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_column_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rows, __pyx_v_rows) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":827 + * self._start_clock() + * columns = self._convert_column_data(rows=rows, + * footer=footer, # <<<<<<<<<<<<<< + * upcast_na=not self.as_recarray) + * self._end_clock('Type conversion') + */ + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_footer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_footer, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":828 + * columns = self._convert_column_data(rows=rows, + * footer=footer, + * upcast_na=not self.as_recarray) # <<<<<<<<<<<<<< + * self._end_clock('Type conversion') + * + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->as_recarray); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyBool_FromLong((!__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_upcast_na, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":826 + * + * self._start_clock() + * columns = self._convert_column_data(rows=rows, # <<<<<<<<<<<<<< + * footer=footer, + * upcast_na=not self.as_recarray) + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_columns = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":829 + * footer=footer, + * upcast_na=not self.as_recarray) + * self._end_clock('Type conversion') # <<<<<<<<<<<<<< + * + * self._start_clock() + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_end_clock(__pyx_v_self, __pyx_kp_s_Type_conversion); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":831 + * self._end_clock('Type conversion') + * + * self._start_clock() # <<<<<<<<<<<<<< + * if len(columns) > 0: + * rows_read = len(list(columns.values())[0]) + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_start_clock(__pyx_v_self); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":832 + * + * self._start_clock() + * if len(columns) > 0: # <<<<<<<<<<<<<< + * rows_read = len(list(columns.values())[0]) + * # trim + */ + __pyx_t_7 = PyObject_Length(__pyx_v_columns); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((__pyx_t_7 > 0) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":833 + * self._start_clock() + * if len(columns) > 0: + * rows_read = len(list(columns.values())[0]) # <<<<<<<<<<<<<< + * # trim + * parser_consume_rows(self.parser, rows_read) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_columns, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_rows_read = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":835 + * rows_read = len(list(columns.values())[0]) + * # trim + * parser_consume_rows(self.parser, rows_read) # <<<<<<<<<<<<<< + * if trim: + * parser_trim_buffers(self.parser) + */ + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_v_rows_read); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + parser_consume_rows(__pyx_v_self->parser, __pyx_t_8); + + /* "pandas/parser.pyx":836 + * # trim + * parser_consume_rows(self.parser, rows_read) + * if trim: # <<<<<<<<<<<<<< + * parser_trim_buffers(self.parser) + * self.parser_start -= rows_read + */ + __pyx_t_3 = (__pyx_v_trim != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":837 + * parser_consume_rows(self.parser, rows_read) + * if trim: + * parser_trim_buffers(self.parser) # <<<<<<<<<<<<<< + * self.parser_start -= rows_read + * + */ + parser_trim_buffers(__pyx_v_self->parser); + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":838 + * if trim: + * parser_trim_buffers(self.parser) + * self.parser_start -= rows_read # <<<<<<<<<<<<<< + * + * self._end_clock('Parser memory cleanup') + */ + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->parser_start); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_6, __pyx_v_rows_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->parser_start = __pyx_t_4; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/parser.pyx":840 + * self.parser_start -= rows_read + * + * self._end_clock('Parser memory cleanup') # <<<<<<<<<<<<<< + * + * return columns + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_end_clock(__pyx_v_self, __pyx_kp_s_Parser_memory_cleanup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":842 + * self._end_clock('Parser memory cleanup') + * + * return columns # <<<<<<<<<<<<<< + * + * def debug_print(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_columns); + __pyx_r = __pyx_v_columns; + goto __pyx_L0; + + /* "pandas/parser.pyx":793 + * raise_parser_error('Error tokenizing data', self.parser) + * + * cdef _read_rows(self, rows, bint trim): # <<<<<<<<<<<<<< + * cdef: + * int buffered_lines + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser.TextReader._read_rows", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_columns); + __Pyx_XDECREF(__pyx_v_rows_read); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":844 + * return columns + * + * def debug_print(self): # <<<<<<<<<<<<<< + * debug_print_parser(self.parser) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11debug_print(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11debug_print(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("debug_print (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10debug_print(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10debug_print(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("debug_print", 0); + + /* "pandas/parser.pyx":845 + * + * def debug_print(self): + * debug_print_parser(self.parser) # <<<<<<<<<<<<<< + * + * cdef _start_clock(self): + */ + debug_print_parser(__pyx_v_self->parser); + + /* "pandas/parser.pyx":844 + * return columns + * + * def debug_print(self): # <<<<<<<<<<<<<< + * debug_print_parser(self.parser) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":847 + * debug_print_parser(self.parser) + * + * cdef _start_clock(self): # <<<<<<<<<<<<<< + * self.clocks.append(time.time()) + * + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__start_clock(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_start_clock", 0); + + /* "pandas/parser.pyx":848 + * + * cdef _start_clock(self): + * self.clocks.append(time.time()) # <<<<<<<<<<<<<< + * + * cdef _end_clock(self, what): + */ + if (unlikely(__pyx_v_self->clocks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_self->clocks, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":847 + * debug_print_parser(self.parser) + * + * cdef _start_clock(self): # <<<<<<<<<<<<<< + * self.clocks.append(time.time()) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.parser.TextReader._start_clock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":850 + * self.clocks.append(time.time()) + * + * cdef _end_clock(self, what): # <<<<<<<<<<<<<< + * if self.verbose: + * elapsed = time.time() - self.clocks.pop(-1) + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__end_clock(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_what) { + PyObject *__pyx_v_elapsed = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_end_clock", 0); + + /* "pandas/parser.pyx":851 + * + * cdef _end_clock(self, what): + * if self.verbose: # <<<<<<<<<<<<<< + * elapsed = time.time() - self.clocks.pop(-1) + * print '%s took: %.2f ms' % (what, elapsed * 1000) + */ + __pyx_t_1 = (__pyx_v_self->verbose != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":852 + * cdef _end_clock(self, what): + * if self.verbose: + * elapsed = time.time() - self.clocks.pop(-1) # <<<<<<<<<<<<<< + * print '%s took: %.2f ms' % (what, elapsed * 1000) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_v_self->clocks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_self->clocks, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_elapsed = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":853 + * if self.verbose: + * elapsed = time.time() - self.clocks.pop(-1) + * print '%s took: %.2f ms' % (what, elapsed * 1000) # <<<<<<<<<<<<<< + * + * def set_noconvert(self, i): + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_elapsed, __pyx_int_1000); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_what); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_what); + __Pyx_GIVEREF(__pyx_v_what); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_took_2f_ms, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":850 + * self.clocks.append(time.time()) + * + * cdef _end_clock(self, what): # <<<<<<<<<<<<<< + * if self.verbose: + * elapsed = time.time() - self.clocks.pop(-1) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.parser.TextReader._end_clock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_elapsed); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":855 + * print '%s took: %.2f ms' % (what, elapsed * 1000) + * + * def set_noconvert(self, i): # <<<<<<<<<<<<<< + * self.noconvert.add(i) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_13set_noconvert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_13set_noconvert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_noconvert (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12set_noconvert(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12set_noconvert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_noconvert", 0); + + /* "pandas/parser.pyx":856 + * + * def set_noconvert(self, i): + * self.noconvert.add(i) # <<<<<<<<<<<<<< + * + * def remove_noconvert(self, i): + */ + if (unlikely(__pyx_v_self->noconvert == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PySet_Add(__pyx_v_self->noconvert, __pyx_v_i); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":855 + * print '%s took: %.2f ms' % (what, elapsed * 1000) + * + * def set_noconvert(self, i): # <<<<<<<<<<<<<< + * self.noconvert.add(i) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.set_noconvert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":858 + * self.noconvert.add(i) + * + * def remove_noconvert(self, i): # <<<<<<<<<<<<<< + * self.noconvert.remove(i) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_15remove_noconvert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_15remove_noconvert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("remove_noconvert (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_14remove_noconvert(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_14remove_noconvert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("remove_noconvert", 0); + + /* "pandas/parser.pyx":859 + * + * def remove_noconvert(self, i): + * self.noconvert.remove(i) # <<<<<<<<<<<<<< + * + * def _convert_column_data(self, rows=None, upcast_na=False, footer=0): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->noconvert, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_i); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i); + __Pyx_GIVEREF(__pyx_v_i); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/parser.pyx":858 + * self.noconvert.add(i) + * + * def remove_noconvert(self, i): # <<<<<<<<<<<<<< + * self.noconvert.remove(i) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.TextReader.remove_noconvert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":861 + * self.noconvert.remove(i) + * + * def _convert_column_data(self, rows=None, upcast_na=False, footer=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, nused + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_17_convert_column_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_17_convert_column_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_rows = 0; + PyObject *__pyx_v_upcast_na = 0; + CYTHON_UNUSED PyObject *__pyx_v_footer = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_convert_column_data (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_upcast_na,&__pyx_n_s_footer,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rows); + if (value) { values[0] = value; kw_args--; } + } + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_upcast_na); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_footer); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_convert_column_data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_rows = values[0]; + __pyx_v_upcast_na = values[1]; + __pyx_v_footer = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_convert_column_data", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader._convert_column_data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16_convert_column_data(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_rows, __pyx_v_upcast_na, __pyx_v_footer); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16_convert_column_data(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_upcast_na, CYTHON_UNUSED PyObject *__pyx_v_footer) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_nused; + kh_str_t *__pyx_v_na_hashset; + int __pyx_v_start; + int __pyx_v_end; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_na_flist = 0; + int __pyx_v_na_filter; + Py_ssize_t __pyx_v_num_cols; + PyObject *__pyx_v_results = NULL; + PyObject *__pyx_v_conv = NULL; + PyObject *__pyx_v_na_list = NULL; + PyObject *__pyx_v_col_res = NULL; + PyObject *__pyx_v_na_count = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + kh_str_t *__pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_convert_column_data", 0); + + /* "pandas/parser.pyx":864 + * cdef: + * Py_ssize_t i, nused + * kh_str_t *na_hashset = NULL # <<<<<<<<<<<<<< + * int start, end + * object name, na_flist + */ + __pyx_v_na_hashset = NULL; + + /* "pandas/parser.pyx":867 + * int start, end + * object name, na_flist + * bint na_filter = 0 # <<<<<<<<<<<<<< + * Py_ssize_t num_cols + * + */ + __pyx_v_na_filter = 0; + + /* "pandas/parser.pyx":870 + * Py_ssize_t num_cols + * + * start = self.parser_start # <<<<<<<<<<<<<< + * + * if rows is None: + */ + __pyx_t_1 = __pyx_v_self->parser_start; + __pyx_v_start = __pyx_t_1; + + /* "pandas/parser.pyx":872 + * start = self.parser_start + * + * if rows is None: # <<<<<<<<<<<<<< + * end = self.parser.lines + * else: + */ + __pyx_t_2 = (__pyx_v_rows == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":873 + * + * if rows is None: + * end = self.parser.lines # <<<<<<<<<<<<<< + * else: + * end = min(start + rows, self.parser.lines) + */ + __pyx_t_1 = __pyx_v_self->parser->lines; + __pyx_v_end = __pyx_t_1; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":875 + * end = self.parser.lines + * else: + * end = min(start + rows, self.parser.lines) # <<<<<<<<<<<<<< + * + * # # skip footer + */ + __pyx_t_1 = __pyx_v_self->parser->lines; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_rows); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_3) { + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __Pyx_INCREF(__pyx_t_5); + __pyx_t_4 = __pyx_t_5; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_end = __pyx_t_1; + } + __pyx_L3:; + + /* "pandas/parser.pyx":888 + * #print >> sys.stderr, self.header + * #print >> sys.stderr, "index" + * num_cols = -1 # <<<<<<<<<<<<<< + * for i in range(self.parser.lines): + * num_cols = (num_cols < self.parser.line_fields[i]) * self.parser.line_fields[i] +\ + */ + __pyx_v_num_cols = -1; + + /* "pandas/parser.pyx":889 + * #print >> sys.stderr, "index" + * num_cols = -1 + * for i in range(self.parser.lines): # <<<<<<<<<<<<<< + * num_cols = (num_cols < self.parser.line_fields[i]) * self.parser.line_fields[i] +\ + * (num_cols >= self.parser.line_fields[i]) * num_cols + */ + __pyx_t_1 = __pyx_v_self->parser->lines; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/parser.pyx":890 + * num_cols = -1 + * for i in range(self.parser.lines): + * num_cols = (num_cols < self.parser.line_fields[i]) * self.parser.line_fields[i] +\ # <<<<<<<<<<<<<< + * (num_cols >= self.parser.line_fields[i]) * num_cols + * + */ + __pyx_v_num_cols = (((__pyx_v_num_cols < (__pyx_v_self->parser->line_fields[__pyx_v_i])) * (__pyx_v_self->parser->line_fields[__pyx_v_i])) + ((__pyx_v_num_cols >= (__pyx_v_self->parser->line_fields[__pyx_v_i])) * __pyx_v_num_cols)); + } + + /* "pandas/parser.pyx":893 + * (num_cols >= self.parser.line_fields[i]) * num_cols + * + * if self.table_width - self.leading_cols > num_cols: # <<<<<<<<<<<<<< + * raise CParserError("Too many columns specified: expected %s and found %s" % + * (self.table_width - self.leading_cols, num_cols)) + */ + __pyx_t_3 = (((__pyx_v_self->table_width - __pyx_v_self->leading_cols) > __pyx_v_num_cols) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":894 + * + * if self.table_width - self.leading_cols > num_cols: + * raise CParserError("Too many columns specified: expected %s and found %s" % # <<<<<<<<<<<<<< + * (self.table_width - self.leading_cols, num_cols)) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CParserError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/parser.pyx":895 + * if self.table_width - self.leading_cols > num_cols: + * raise CParserError("Too many columns specified: expected %s and found %s" % + * (self.table_width - self.leading_cols, num_cols)) # <<<<<<<<<<<<<< + * + * results = {} + */ + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_self->table_width - __pyx_v_self->leading_cols)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_num_cols); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_5 = 0; + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":894 + * + * if self.table_width - self.leading_cols > num_cols: + * raise CParserError("Too many columns specified: expected %s and found %s" % # <<<<<<<<<<<<<< + * (self.table_width - self.leading_cols, num_cols)) + * + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Too_many_columns_specified_expec, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":897 + * (self.table_width - self.leading_cols, num_cols)) + * + * results = {} # <<<<<<<<<<<<<< + * nused = 0 + * for i in range(self.table_width): + */ + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_results = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":898 + * + * results = {} + * nused = 0 # <<<<<<<<<<<<<< + * for i in range(self.table_width): + * if i < self.leading_cols: + */ + __pyx_v_nused = 0; + + /* "pandas/parser.pyx":899 + * results = {} + * nused = 0 + * for i in range(self.table_width): # <<<<<<<<<<<<<< + * if i < self.leading_cols: + * # Pass through leading columns always + */ + __pyx_t_1 = __pyx_v_self->table_width; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/parser.pyx":900 + * nused = 0 + * for i in range(self.table_width): + * if i < self.leading_cols: # <<<<<<<<<<<<<< + * # Pass through leading columns always + * name = i + */ + __pyx_t_3 = ((__pyx_v_i < __pyx_v_self->leading_cols) != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":902 + * if i < self.leading_cols: + * # Pass through leading columns always + * name = i # <<<<<<<<<<<<<< + * elif self.usecols and nused == len(self.usecols): + * # Once we've gathered all requested columns, stop. GH5766 + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L9; + } + + /* "pandas/parser.pyx":903 + * # Pass through leading columns always + * name = i + * elif self.usecols and nused == len(self.usecols): # <<<<<<<<<<<<<< + * # Once we've gathered all requested columns, stop. GH5766 + * break + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->usecols); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + __pyx_t_7 = __pyx_v_self->usecols; + __Pyx_INCREF(__pyx_t_7); + if (unlikely(__pyx_t_7 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = PySet_Size(__pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = (__pyx_v_nused == __pyx_t_9); + __pyx_t_10 = __pyx_t_2; + } else { + __pyx_t_10 = __pyx_t_3; + } + if (__pyx_t_10) { + + /* "pandas/parser.pyx":905 + * elif self.usecols and nused == len(self.usecols): + * # Once we've gathered all requested columns, stop. GH5766 + * break # <<<<<<<<<<<<<< + * else: + * name = self._get_column_name(i, nused) + */ + goto __pyx_L8_break; + } + /*else*/ { + + /* "pandas/parser.pyx":907 + * break + * else: + * name = self._get_column_name(i, nused) # <<<<<<<<<<<<<< + * if self.has_usecols and not (i in self.usecols or + * name in self.usecols): + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_get_column_name(__pyx_v_self, __pyx_v_i, __pyx_v_nused); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":908 + * else: + * name = self._get_column_name(i, nused) + * if self.has_usecols and not (i in self.usecols or # <<<<<<<<<<<<<< + * name in self.usecols): + * continue + */ + if ((__pyx_v_self->has_usecols != 0)) { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_7, __pyx_v_self->usecols, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(__pyx_t_10 != 0)) { + + /* "pandas/parser.pyx":909 + * name = self._get_column_name(i, nused) + * if self.has_usecols and not (i in self.usecols or + * name in self.usecols): # <<<<<<<<<<<<<< + * continue + * nused += 1 + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_self->usecols, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_3 != 0); + } else { + __pyx_t_2 = (__pyx_t_10 != 0); + } + + /* "pandas/parser.pyx":908 + * else: + * name = self._get_column_name(i, nused) + * if self.has_usecols and not (i in self.usecols or # <<<<<<<<<<<<<< + * name in self.usecols): + * continue + */ + __pyx_t_10 = ((!__pyx_t_2) != 0); + __pyx_t_2 = __pyx_t_10; + } else { + __pyx_t_2 = (__pyx_v_self->has_usecols != 0); + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":910 + * if self.has_usecols and not (i in self.usecols or + * name in self.usecols): + * continue # <<<<<<<<<<<<<< + * nused += 1 + * + */ + goto __pyx_L7_continue; + } + + /* "pandas/parser.pyx":911 + * name in self.usecols): + * continue + * nused += 1 # <<<<<<<<<<<<<< + * + * conv = self._get_converter(i, name) + */ + __pyx_v_nused = (__pyx_v_nused + 1); + } + __pyx_L9:; + + /* "pandas/parser.pyx":913 + * nused += 1 + * + * conv = self._get_converter(i, name) # <<<<<<<<<<<<<< + * + * # XXX + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_converter); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_conv, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":916 + * + * # XXX + * na_flist = set() # <<<<<<<<<<<<<< + * if self.na_filter: + * na_list, na_flist = self._get_na_list(i, name) + */ + __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_na_flist, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":917 + * # XXX + * na_flist = set() + * if self.na_filter: # <<<<<<<<<<<<<< + * na_list, na_flist = self._get_na_list(i, name) + * if na_list is None: + */ + __pyx_t_2 = (__pyx_v_self->na_filter != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":918 + * na_flist = set() + * if self.na_filter: + * na_list, na_flist = self._get_na_list(i, name) # <<<<<<<<<<<<<< + * if na_list is None: + * na_filter = 0 + */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_get_na_list(__pyx_v_self, __pyx_t_6, __pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L13_unpacking_done; + __pyx_L12_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L13_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_na_list, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_na_flist, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":919 + * if self.na_filter: + * na_list, na_flist = self._get_na_list(i, name) + * if na_list is None: # <<<<<<<<<<<<<< + * na_filter = 0 + * else: + */ + __pyx_t_2 = (__pyx_v_na_list == Py_None); + __pyx_t_10 = (__pyx_t_2 != 0); + if (__pyx_t_10) { + + /* "pandas/parser.pyx":920 + * na_list, na_flist = self._get_na_list(i, name) + * if na_list is None: + * na_filter = 0 # <<<<<<<<<<<<<< + * else: + * na_filter = 1 + */ + __pyx_v_na_filter = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/parser.pyx":922 + * na_filter = 0 + * else: + * na_filter = 1 # <<<<<<<<<<<<<< + * na_hashset = kset_from_list(na_list) + * else: + */ + __pyx_v_na_filter = 1; + + /* "pandas/parser.pyx":923 + * else: + * na_filter = 1 + * na_hashset = kset_from_list(na_list) # <<<<<<<<<<<<<< + * else: + * na_filter = 0 + */ + if (!(likely(PyList_CheckExact(__pyx_v_na_list))||((__pyx_v_na_list) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_na_list)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_f_6pandas_6parser_kset_from_list(((PyObject*)__pyx_v_na_list)); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_na_hashset = __pyx_t_12; + } + __pyx_L14:; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/parser.pyx":925 + * na_hashset = kset_from_list(na_list) + * else: + * na_filter = 0 # <<<<<<<<<<<<<< + * + * if conv: + */ + __pyx_v_na_filter = 0; + } + __pyx_L11:; + + /* "pandas/parser.pyx":927 + * na_filter = 0 + * + * if conv: # <<<<<<<<<<<<<< + * results[i] = _apply_converter(conv, self.parser, i, start, end, + * self.c_encoding) + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_conv); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_10) { + + /* "pandas/parser.pyx":928 + * + * if conv: + * results[i] = _apply_converter(conv, self.parser, i, start, end, # <<<<<<<<<<<<<< + * self.c_encoding) + * continue + */ + __pyx_t_4 = __pyx_f_6pandas_6parser__apply_converter(__pyx_v_conv, __pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_self->c_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PyDict_SetItem(__pyx_v_results, __pyx_t_7, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":930 + * results[i] = _apply_converter(conv, self.parser, i, start, end, + * self.c_encoding) + * continue # <<<<<<<<<<<<<< + * + * # Should return as the desired dtype (inferred or specified) + */ + goto __pyx_L7_continue; + } + + /* "pandas/parser.pyx":933 + * + * # Should return as the desired dtype (inferred or specified) + * col_res, na_count = self._convert_tokens(i, start, end, name, # <<<<<<<<<<<<<< + * na_filter, na_hashset, na_flist) + * + */ + __pyx_t_4 = __pyx_f_6pandas_6parser_10TextReader__convert_tokens(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_name, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_7 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L16_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_6 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L16_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L17_unpacking_done; + __pyx_L16_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L17_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_col_res, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_na_count, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":936 + * na_filter, na_hashset, na_flist) + * + * if na_filter: # <<<<<<<<<<<<<< + * self._free_na_set(na_hashset) + * + */ + __pyx_t_10 = (__pyx_v_na_filter != 0); + if (__pyx_t_10) { + + /* "pandas/parser.pyx":937 + * + * if na_filter: + * self._free_na_set(na_hashset) # <<<<<<<<<<<<<< + * + * if upcast_na and na_count > 0: + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_free_na_set(__pyx_v_self, __pyx_v_na_hashset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L18; + } + __pyx_L18:; + + /* "pandas/parser.pyx":939 + * self._free_na_set(na_hashset) + * + * if upcast_na and na_count > 0: # <<<<<<<<<<<<<< + * col_res = _maybe_upcast(col_res) + * + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_upcast_na); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_10) { + __pyx_t_4 = PyObject_RichCompare(__pyx_v_na_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_10; + } + if (__pyx_t_3) { + + /* "pandas/parser.pyx":940 + * + * if upcast_na and na_count > 0: + * col_res = _maybe_upcast(col_res) # <<<<<<<<<<<<<< + * + * if issubclass(col_res.dtype.type, np.integer) and self.compact_ints: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_maybe_upcast); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_col_res); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_col_res); + __Pyx_GIVEREF(__pyx_v_col_res); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_col_res, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L19; + } + __pyx_L19:; + + /* "pandas/parser.pyx":942 + * col_res = _maybe_upcast(col_res) + * + * if issubclass(col_res.dtype.type, np.integer) and self.compact_ints: # <<<<<<<<<<<<<< + * col_res = downcast_int64(col_res, self.use_unsigned) + * + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_res, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = PyObject_IsSubclass(__pyx_t_6, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_self->compact_ints); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_t_10; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":943 + * + * if issubclass(col_res.dtype.type, np.integer) and self.compact_ints: + * col_res = downcast_int64(col_res, self.use_unsigned) # <<<<<<<<<<<<<< + * + * if col_res is None: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_downcast_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_col_res); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_col_res); + __Pyx_GIVEREF(__pyx_v_col_res); + __Pyx_INCREF(__pyx_v_self->use_unsigned); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_self->use_unsigned); + __Pyx_GIVEREF(__pyx_v_self->use_unsigned); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_col_res, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/parser.pyx":945 + * col_res = downcast_int64(col_res, self.use_unsigned) + * + * if col_res is None: # <<<<<<<<<<<<<< + * raise Exception('Unable to parse column %d' % i) + * + */ + __pyx_t_2 = (__pyx_v_col_res == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":946 + * + * if col_res is None: + * raise Exception('Unable to parse column %d' % i) # <<<<<<<<<<<<<< + * + * results[i] = col_res + */ + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_column_d, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":948 + * raise Exception('Unable to parse column %d' % i) + * + * results[i] = col_res # <<<<<<<<<<<<<< + * + * self.parser_start += end - start + */ + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyDict_SetItem(__pyx_v_results, __pyx_t_6, __pyx_v_col_res) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_L7_continue:; + } + __pyx_L8_break:; + + /* "pandas/parser.pyx":950 + * results[i] = col_res + * + * self.parser_start += end - start # <<<<<<<<<<<<<< + * + * return results + */ + __pyx_v_self->parser_start = (__pyx_v_self->parser_start + (__pyx_v_end - __pyx_v_start)); + + /* "pandas/parser.pyx":952 + * self.parser_start += end - start + * + * return results # <<<<<<<<<<<<<< + * + * cdef inline _convert_tokens(self, Py_ssize_t i, int start, int end, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_results); + __pyx_r = __pyx_v_results; + goto __pyx_L0; + + /* "pandas/parser.pyx":861 + * self.noconvert.remove(i) + * + * def _convert_column_data(self, rows=None, upcast_na=False, footer=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, nused + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.parser.TextReader._convert_column_data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_na_flist); + __Pyx_XDECREF(__pyx_v_results); + __Pyx_XDECREF(__pyx_v_conv); + __Pyx_XDECREF(__pyx_v_na_list); + __Pyx_XDECREF(__pyx_v_col_res); + __Pyx_XDECREF(__pyx_v_na_count); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":954 + * return results + * + * cdef inline _convert_tokens(self, Py_ssize_t i, int start, int end, # <<<<<<<<<<<<<< + * object name, bint na_filter, + * kh_str_t *na_hashset, + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_6parser_10TextReader__convert_tokens(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, Py_ssize_t __pyx_v_i, int __pyx_v_start, int __pyx_v_end, PyObject *__pyx_v_name, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset, PyObject *__pyx_v_na_flist) { + PyObject *__pyx_v_col_dtype = 0; + PyObject *__pyx_v_col_res = NULL; + PyObject *__pyx_v_dt = NULL; + PyObject *__pyx_v_na_count = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_convert_tokens", 0); + + /* "pandas/parser.pyx":959 + * object na_flist): + * cdef: + * object col_dtype = None # <<<<<<<<<<<<<< + * + * if self.dtype is not None: + */ + __Pyx_INCREF(Py_None); + __pyx_v_col_dtype = Py_None; + + /* "pandas/parser.pyx":961 + * object col_dtype = None + * + * if self.dtype is not None: # <<<<<<<<<<<<<< + * if isinstance(self.dtype, dict): + * if name in self.dtype: + */ + __pyx_t_1 = (__pyx_v_self->dtype != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":962 + * + * if self.dtype is not None: + * if isinstance(self.dtype, dict): # <<<<<<<<<<<<<< + * if name in self.dtype: + * col_dtype = self.dtype[name] + */ + __pyx_t_3 = __pyx_v_self->dtype; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyDict_Check(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":963 + * if self.dtype is not None: + * if isinstance(self.dtype, dict): + * if name in self.dtype: # <<<<<<<<<<<<<< + * col_dtype = self.dtype[name] + * elif i in self.dtype: + */ + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_self->dtype, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":964 + * if isinstance(self.dtype, dict): + * if name in self.dtype: + * col_dtype = self.dtype[name] # <<<<<<<<<<<<<< + * elif i in self.dtype: + * col_dtype = self.dtype[i] + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->dtype, __pyx_v_name); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + + /* "pandas/parser.pyx":965 + * if name in self.dtype: + * col_dtype = self.dtype[name] + * elif i in self.dtype: # <<<<<<<<<<<<<< + * col_dtype = self.dtype[i] + * else: + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_3, __pyx_v_self->dtype, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":966 + * col_dtype = self.dtype[name] + * elif i in self.dtype: + * col_dtype = self.dtype[i] # <<<<<<<<<<<<<< + * else: + * if self.dtype.names: + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->dtype, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/parser.pyx":968 + * col_dtype = self.dtype[i] + * else: + * if self.dtype.names: # <<<<<<<<<<<<<< + * col_dtype = self.dtype.descr[i][1] + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/parser.pyx":969 + * else: + * if self.dtype.names: + * col_dtype = self.dtype.descr[i][1] # <<<<<<<<<<<<<< + * else: + * col_dtype = self.dtype + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_descr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/parser.pyx":971 + * col_dtype = self.dtype.descr[i][1] + * else: + * col_dtype = self.dtype # <<<<<<<<<<<<<< + * + * if col_dtype is not None: + */ + __pyx_t_3 = __pyx_v_self->dtype; + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L6:; + } + __pyx_L4:; + + /* "pandas/parser.pyx":973 + * col_dtype = self.dtype + * + * if col_dtype is not None: # <<<<<<<<<<<<<< + * if not isinstance(col_dtype, basestring): + * if isinstance(col_dtype, np.dtype): + */ + __pyx_t_1 = (__pyx_v_col_dtype != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":974 + * + * if col_dtype is not None: + * if not isinstance(col_dtype, basestring): # <<<<<<<<<<<<<< + * if isinstance(col_dtype, np.dtype): + * col_dtype = col_dtype.str + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_col_dtype, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":975 + * if col_dtype is not None: + * if not isinstance(col_dtype, basestring): + * if isinstance(col_dtype, np.dtype): # <<<<<<<<<<<<<< + * col_dtype = col_dtype.str + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_col_dtype, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":976 + * if not isinstance(col_dtype, basestring): + * if isinstance(col_dtype, np.dtype): + * col_dtype = col_dtype.str # <<<<<<<<<<<<<< + * else: + * col_dtype = np.dtype(col_dtype).str + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/parser.pyx":978 + * col_dtype = col_dtype.str + * else: + * col_dtype = np.dtype(col_dtype).str # <<<<<<<<<<<<<< + * + * return self._convert_with_dtype(col_dtype, i, start, end, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_col_dtype); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_col_dtype); + __Pyx_GIVEREF(__pyx_v_col_dtype); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_col_dtype, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L9:; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/parser.pyx":980 + * col_dtype = np.dtype(col_dtype).str + * + * return self._convert_with_dtype(col_dtype, i, start, end, # <<<<<<<<<<<<<< + * na_filter, 1, na_hashset, na_flist) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":981 + * + * return self._convert_with_dtype(col_dtype, i, start, end, + * na_filter, 1, na_hashset, na_flist) # <<<<<<<<<<<<<< + * + * if i in self.noconvert: + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_convert_with_dtype(__pyx_v_self, __pyx_v_col_dtype, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, 1, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":983 + * na_filter, 1, na_hashset, na_flist) + * + * if i in self.noconvert: # <<<<<<<<<<<<<< + * return self._string_convert(i, start, end, na_filter, na_hashset) + * else: + */ + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_4, __pyx_v_self->noconvert, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":984 + * + * if i in self.noconvert: + * return self._string_convert(i, start, end, na_filter, na_hashset) # <<<<<<<<<<<<<< + * else: + * col_res = None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_string_convert(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":986 + * return self._string_convert(i, start, end, na_filter, na_hashset) + * else: + * col_res = None # <<<<<<<<<<<<<< + * for dt in dtype_cast_order: + * try: + */ + __Pyx_INCREF(Py_None); + __pyx_v_col_res = Py_None; + + /* "pandas/parser.pyx":987 + * else: + * col_res = None + * for dt in dtype_cast_order: # <<<<<<<<<<<<<< + * try: + * col_res, na_count = self._convert_with_dtype( + */ + if (unlikely(__pyx_v_6pandas_6parser_dtype_cast_order == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __pyx_v_6pandas_6parser_dtype_cast_order; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + for (;;) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":988 + * col_res = None + * for dt in dtype_cast_order: + * try: # <<<<<<<<<<<<<< + * col_res, na_count = self._convert_with_dtype( + * dt, i, start, end, na_filter, 0, na_hashset, na_flist) + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + /*try:*/ { + + /* "pandas/parser.pyx":989 + * for dt in dtype_cast_order: + * try: + * col_res, na_count = self._convert_with_dtype( # <<<<<<<<<<<<<< + * dt, i, start, end, na_filter, 0, na_hashset, na_flist) + * except OverflowError: + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_convert_with_dtype(__pyx_v_self, __pyx_v_dt, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, 0, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_10 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_10); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L22_unpacking_done; + __pyx_L21_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __pyx_L22_unpacking_done:; + } + __Pyx_DECREF_SET(__pyx_v_col_res, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_na_count, __pyx_t_10); + __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/parser.pyx":991 + * col_res, na_count = self._convert_with_dtype( + * dt, i, start, end, na_filter, 0, na_hashset, na_flist) + * except OverflowError: # <<<<<<<<<<<<<< + * col_res, na_count = self._convert_with_dtype( + * '|O8', i, start, end, na_filter, 0, na_hashset, na_flist) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OverflowError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_13) { + __Pyx_AddTraceback("pandas.parser.TextReader._convert_tokens", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/parser.pyx":992 + * dt, i, start, end, na_filter, 0, na_hashset, na_flist) + * except OverflowError: + * col_res, na_count = self._convert_with_dtype( # <<<<<<<<<<<<<< + * '|O8', i, start, end, na_filter, 0, na_hashset, na_flist) + * + */ + __pyx_t_11 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_convert_with_dtype(__pyx_v_self, __pyx_kp_s_O8, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, 0, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_11); + if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { + PyObject* sequence = __pyx_t_11; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_14 = PyList_GET_ITEM(sequence, 0); + __pyx_t_15 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + #else + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_15); + #endif + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_14 = __pyx_t_12(__pyx_t_16); if (unlikely(!__pyx_t_14)) goto __pyx_L25_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + index = 1; __pyx_t_15 = __pyx_t_12(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L25_unpacking_failed; + __Pyx_GOTREF(__pyx_t_15); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_16), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L26_unpacking_done; + __pyx_L25_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __pyx_L26_unpacking_done:; + } + __Pyx_DECREF_SET(__pyx_v_col_res, __pyx_t_14); + __pyx_t_14 = 0; + __Pyx_XDECREF_SET(__pyx_v_na_count, __pyx_t_15); + __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_L20_try_end:; + } + + /* "pandas/parser.pyx":995 + * '|O8', i, start, end, na_filter, 0, na_hashset, na_flist) + * + * if col_res is not None: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_1 = (__pyx_v_col_res != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":996 + * + * if col_res is not None: + * break # <<<<<<<<<<<<<< + * + * return col_res, na_count + */ + goto __pyx_L12_break; + } + } + __pyx_L12_break:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "pandas/parser.pyx":998 + * break + * + * return col_res, na_count # <<<<<<<<<<<<<< + * + * cdef _convert_with_dtype(self, object dtype, Py_ssize_t i, + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_na_count)) { __Pyx_RaiseUnboundLocalError("na_count"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_col_res); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_col_res); + __Pyx_GIVEREF(__pyx_v_col_res); + __Pyx_INCREF(__pyx_v_na_count); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_na_count); + __Pyx_GIVEREF(__pyx_v_na_count); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":954 + * return results + * + * cdef inline _convert_tokens(self, Py_ssize_t i, int start, int end, # <<<<<<<<<<<<<< + * object name, bint na_filter, + * kh_str_t *na_hashset, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("pandas.parser.TextReader._convert_tokens", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_col_dtype); + __Pyx_XDECREF(__pyx_v_col_res); + __Pyx_XDECREF(__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_na_count); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1000 + * return col_res, na_count + * + * cdef _convert_with_dtype(self, object dtype, Py_ssize_t i, # <<<<<<<<<<<<<< + * int start, int end, + * bint na_filter, + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__convert_with_dtype(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_dtype, Py_ssize_t __pyx_v_i, int __pyx_v_start, int __pyx_v_end, int __pyx_v_na_filter, int __pyx_v_user_dtype, kh_str_t *__pyx_v_na_hashset, PyObject *__pyx_v_na_flist) { + kh_str_t *__pyx_v_true_set; + kh_str_t *__pyx_v_false_set; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_na_count = NULL; + PyObject *__pyx_v_width = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + kh_str_t *__pyx_t_9; + size_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_convert_with_dtype", 0); + + /* "pandas/parser.pyx":1008 + * cdef kh_str_t *true_set, *false_set + * + * if dtype[1] == 'i' or dtype[1] == 'u': # <<<<<<<<<<<<<< + * result, na_count = _try_int64(self.parser, i, start, end, + * na_filter, na_hashset) + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_i, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_u, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "pandas/parser.pyx":1009 + * + * if dtype[1] == 'i' or dtype[1] == 'u': + * result, na_count = _try_int64(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * if user_dtype and na_count > 0: + */ + __pyx_t_1 = __pyx_f_6pandas_6parser__try_int64(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_na_count = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1011 + * result, na_count = _try_int64(self.parser, i, start, end, + * na_filter, na_hashset) + * if user_dtype and na_count > 0: # <<<<<<<<<<<<<< + * raise Exception('Integer column has NA values') + * + */ + __pyx_t_4 = __pyx_v_user_dtype; + if (__pyx_t_4) { + __pyx_t_1 = PyObject_RichCompare(__pyx_v_na_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1012 + * na_filter, na_hashset) + * if user_dtype and na_count > 0: + * raise Exception('Integer column has NA values') # <<<<<<<<<<<<<< + * + * if dtype[1:] != 'i8': + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1014 + * raise Exception('Integer column has NA values') + * + * if dtype[1:] != 'i8': # <<<<<<<<<<<<<< + * result = result.astype(dtype) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_dtype, 1, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_i8, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1015 + * + * if dtype[1:] != 'i8': + * result = result.astype(dtype) # <<<<<<<<<<<<<< + * + * return result, na_count + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_dtype); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_dtype); + __Pyx_GIVEREF(__pyx_v_dtype); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/parser.pyx":1017 + * result = result.astype(dtype) + * + * return result, na_count # <<<<<<<<<<<<<< + * + * elif dtype[1] == 'f': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v_na_count); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_na_count); + __Pyx_GIVEREF(__pyx_v_na_count); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1019 + * return result, na_count + * + * elif dtype[1] == 'f': # <<<<<<<<<<<<<< + * result, na_count = _try_double(self.parser, i, start, end, + * na_filter, na_hashset, na_flist) + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1020 + * + * elif dtype[1] == 'f': + * result, na_count = _try_double(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset, na_flist) + * + */ + __pyx_t_5 = __pyx_f_6pandas_6parser__try_double(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_na_flist); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L9_unpacking_done:; + } + __pyx_v_result = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_na_count = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1023 + * na_filter, na_hashset, na_flist) + * + * if dtype[1:] != 'f8': # <<<<<<<<<<<<<< + * result = result.astype(dtype) + * return result, na_count + */ + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_dtype, 1, 0, NULL, NULL, &__pyx_slice__21, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_f8, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1024 + * + * if dtype[1:] != 'f8': + * result = result.astype(dtype) # <<<<<<<<<<<<<< + * return result, na_count + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_dtype); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dtype); + __Pyx_GIVEREF(__pyx_v_dtype); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":1025 + * if dtype[1:] != 'f8': + * result = result.astype(dtype) + * return result, na_count # <<<<<<<<<<<<<< + * + * elif dtype[1] == 'b': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v_na_count); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_na_count); + __Pyx_GIVEREF(__pyx_v_na_count); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1027 + * return result, na_count + * + * elif dtype[1] == 'b': # <<<<<<<<<<<<<< + * if self.true_values is not None or self.false_values is not None: + * + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_b, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1028 + * + * elif dtype[1] == 'b': + * if self.true_values is not None or self.false_values is not None: # <<<<<<<<<<<<<< + * + * true_set = kset_from_list(self.true_values + _true_values) + */ + __pyx_t_3 = (__pyx_v_self->true_values != Py_None); + if (!(__pyx_t_3 != 0)) { + __pyx_t_4 = (__pyx_v_self->false_values != Py_None); + __pyx_t_2 = (__pyx_t_4 != 0); + } else { + __pyx_t_2 = (__pyx_t_3 != 0); + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1030 + * if self.true_values is not None or self.false_values is not None: + * + * true_set = kset_from_list(self.true_values + _true_values) # <<<<<<<<<<<<<< + * false_set = kset_from_list(self.false_values + _false_values) + * result, na_count = _try_bool_flex(self.parser, i, start, end, + */ + __pyx_t_6 = PyNumber_Add(__pyx_v_self->true_values, __pyx_v_6pandas_6parser__true_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_6pandas_6parser_kset_from_list(((PyObject*)__pyx_t_6)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_true_set = __pyx_t_9; + + /* "pandas/parser.pyx":1031 + * + * true_set = kset_from_list(self.true_values + _true_values) + * false_set = kset_from_list(self.false_values + _false_values) # <<<<<<<<<<<<<< + * result, na_count = _try_bool_flex(self.parser, i, start, end, + * na_filter, na_hashset, + */ + __pyx_t_6 = PyNumber_Add(__pyx_v_self->false_values, __pyx_v_6pandas_6parser__false_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_6pandas_6parser_kset_from_list(((PyObject*)__pyx_t_6)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_false_set = __pyx_t_9; + + /* "pandas/parser.pyx":1032 + * true_set = kset_from_list(self.true_values + _true_values) + * false_set = kset_from_list(self.false_values + _false_values) + * result, na_count = _try_bool_flex(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset, + * true_set, false_set) + */ + __pyx_t_6 = __pyx_f_6pandas_6parser__try_bool_flex(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_true_set, __pyx_v_false_set); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L13_unpacking_done; + __pyx_L12_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L13_unpacking_done:; + } + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_na_count = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1035 + * na_filter, na_hashset, + * true_set, false_set) + * kh_destroy_str(true_set) # <<<<<<<<<<<<<< + * kh_destroy_str(false_set) + * else: + */ + kh_destroy_str(__pyx_v_true_set); + + /* "pandas/parser.pyx":1036 + * true_set, false_set) + * kh_destroy_str(true_set) + * kh_destroy_str(false_set) # <<<<<<<<<<<<<< + * else: + * result, na_count = _try_bool(self.parser, i, start, end, + */ + kh_destroy_str(__pyx_v_false_set); + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/parser.pyx":1038 + * kh_destroy_str(false_set) + * else: + * result, na_count = _try_bool(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * return result, na_count + */ + __pyx_t_6 = __pyx_f_6pandas_6parser__try_bool(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L15_unpacking_done; + __pyx_L14_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L15_unpacking_done:; + } + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_na_count = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L11:; + + /* "pandas/parser.pyx":1040 + * result, na_count = _try_bool(self.parser, i, start, end, + * na_filter, na_hashset) + * return result, na_count # <<<<<<<<<<<<<< + * elif dtype[1] == 'c': + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v_na_count); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_na_count); + __Pyx_GIVEREF(__pyx_v_na_count); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1041 + * na_filter, na_hashset) + * return result, na_count + * elif dtype[1] == 'c': # <<<<<<<<<<<<<< + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + * + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1042 + * return result, na_count + * elif dtype[1] == 'c': + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) # <<<<<<<<<<<<<< + * + * elif dtype[1] == 'S': + */ + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_the_dtype_s_is_not_supported_for, __pyx_v_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1044 + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + * + * elif dtype[1] == 'S': # <<<<<<<<<<<<<< + * # TODO: na handling + * width = int(dtype[2:]) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1046 + * elif dtype[1] == 'S': + * # TODO: na handling + * width = int(dtype[2:]) # <<<<<<<<<<<<<< + * if width > 0: + * result = _to_fw_string(self.parser, i, start, end, width) + */ + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_dtype, 2, 0, NULL, NULL, &__pyx_slice__22, 1, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_width = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1047 + * # TODO: na handling + * width = int(dtype[2:]) + * if width > 0: # <<<<<<<<<<<<<< + * result = _to_fw_string(self.parser, i, start, end, width) + * return result, 0 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_width, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1048 + * width = int(dtype[2:]) + * if width > 0: + * result = _to_fw_string(self.parser, i, start, end, width) # <<<<<<<<<<<<<< + * return result, 0 + * + */ + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_width); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_6pandas_6parser__to_fw_string(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1049 + * if width > 0: + * result = _to_fw_string(self.parser, i, start, end, width) + * return result, 0 # <<<<<<<<<<<<<< + * + * # treat as a regular string parsing + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1052 + * + * # treat as a regular string parsing + * return self._string_convert(i, start, end, na_filter, # <<<<<<<<<<<<<< + * na_hashset) + * elif dtype[1] == 'U': + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1053 + * # treat as a regular string parsing + * return self._string_convert(i, start, end, na_filter, + * na_hashset) # <<<<<<<<<<<<<< + * elif dtype[1] == 'U': + * width = int(dtype[2:]) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_string_convert(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1054 + * return self._string_convert(i, start, end, na_filter, + * na_hashset) + * elif dtype[1] == 'U': # <<<<<<<<<<<<<< + * width = int(dtype[2:]) + * if width > 0: + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1055 + * na_hashset) + * elif dtype[1] == 'U': + * width = int(dtype[2:]) # <<<<<<<<<<<<<< + * if width > 0: + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_dtype, 2, 0, NULL, NULL, &__pyx_slice__23, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_width = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1056 + * elif dtype[1] == 'U': + * width = int(dtype[2:]) + * if width > 0: # <<<<<<<<<<<<<< + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + * + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_width, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1057 + * width = int(dtype[2:]) + * if width > 0: + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) # <<<<<<<<<<<<<< + * + * # unicode variable width + */ + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_the_dtype_s_is_not_supported_for, __pyx_v_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1060 + * + * # unicode variable width + * return self._string_convert(i, start, end, na_filter, # <<<<<<<<<<<<<< + * na_hashset) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1061 + * # unicode variable width + * return self._string_convert(i, start, end, na_filter, + * na_hashset) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_string_convert(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1064 + * + * + * elif dtype[1] == 'O': # <<<<<<<<<<<<<< + * return self._string_convert(i, start, end, na_filter, + * na_hashset) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1065 + * + * elif dtype[1] == 'O': + * return self._string_convert(i, start, end, na_filter, # <<<<<<<<<<<<<< + * na_hashset) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1066 + * elif dtype[1] == 'O': + * return self._string_convert(i, start, end, na_filter, + * na_hashset) # <<<<<<<<<<<<<< + * else: + * if dtype[1] == 'M': + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_6parser_TextReader *)__pyx_v_self->__pyx_vtab)->_string_convert(__pyx_v_self, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1068 + * na_hashset) + * else: + * if dtype[1] == 'M': # <<<<<<<<<<<<<< + * raise TypeError("the dtype %s is not supported for parsing, " + * "pass this column using parse_dates instead" % dtype) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_dtype, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_M, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1070 + * if dtype[1] == 'M': + * raise TypeError("the dtype %s is not supported for parsing, " + * "pass this column using parse_dates instead" % dtype) # <<<<<<<<<<<<<< + * raise TypeError("the dtype %s is not supported for parsing" % dtype) + * + */ + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_the_dtype_s_is_not_supported_for_2, __pyx_v_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/parser.pyx":1069 + * else: + * if dtype[1] == 'M': + * raise TypeError("the dtype %s is not supported for parsing, " # <<<<<<<<<<<<<< + * "pass this column using parse_dates instead" % dtype) + * raise TypeError("the dtype %s is not supported for parsing" % dtype) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1071 + * raise TypeError("the dtype %s is not supported for parsing, " + * "pass this column using parse_dates instead" % dtype) + * raise TypeError("the dtype %s is not supported for parsing" % dtype) # <<<<<<<<<<<<<< + * + * cdef _string_convert(self, Py_ssize_t i, int start, int end, + */ + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_the_dtype_s_is_not_supported_for, __pyx_v_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1000 + * return col_res, na_count + * + * cdef _convert_with_dtype(self, object dtype, Py_ssize_t i, # <<<<<<<<<<<<<< + * int start, int end, + * bint na_filter, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.parser.TextReader._convert_with_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_na_count); + __Pyx_XDECREF(__pyx_v_width); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1073 + * raise TypeError("the dtype %s is not supported for parsing" % dtype) + * + * cdef _string_convert(self, Py_ssize_t i, int start, int end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * if PY3: + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__string_convert(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, Py_ssize_t __pyx_v_i, int __pyx_v_start, int __pyx_v_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_convert", 0); + + /* "pandas/parser.pyx":1075 + * cdef _string_convert(self, Py_ssize_t i, int start, int end, + * bint na_filter, kh_str_t *na_hashset): + * if PY3: # <<<<<<<<<<<<<< + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": + */ + __pyx_t_1 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1076 + * bint na_filter, kh_str_t *na_hashset): + * if PY3: + * if self.c_encoding != NULL: # <<<<<<<<<<<<<< + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, + */ + __pyx_t_1 = ((__pyx_v_self->c_encoding != NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1077 + * if PY3: + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": # <<<<<<<<<<<<<< + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) + */ + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->c_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b_utf_8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1078 + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1079 + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) # <<<<<<<<<<<<<< + * else: + * return _string_box_decode(self.parser, i, start, end, + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_utf8(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1081 + * na_filter, na_hashset) + * else: + * return _string_box_decode(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset, + * self.c_encoding) + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1083 + * return _string_box_decode(self.parser, i, start, end, + * na_filter, na_hashset, + * self.c_encoding) # <<<<<<<<<<<<<< + * else: + * return _string_box_utf8(self.parser, i, start, end, + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_decode(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_self->c_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1085 + * self.c_encoding) + * else: + * return _string_box_utf8(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1086 + * else: + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) # <<<<<<<<<<<<<< + * else: + * if self.c_encoding != NULL: + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_utf8(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1088 + * na_filter, na_hashset) + * else: + * if self.c_encoding != NULL: # <<<<<<<<<<<<<< + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, + */ + __pyx_t_1 = ((__pyx_v_self->c_encoding != NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1089 + * else: + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": # <<<<<<<<<<<<<< + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) + */ + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->c_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b_utf_8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1090 + * if self.c_encoding != NULL: + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1091 + * if self.c_encoding == b"utf-8": + * return _string_box_utf8(self.parser, i, start, end, + * na_filter, na_hashset) # <<<<<<<<<<<<<< + * else: + * return _string_box_decode(self.parser, i, start, end, + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_utf8(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1093 + * na_filter, na_hashset) + * else: + * return _string_box_decode(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset, + * self.c_encoding) + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1095 + * return _string_box_decode(self.parser, i, start, end, + * na_filter, na_hashset, + * self.c_encoding) # <<<<<<<<<<<<<< + * else: + * return _string_box_factorize(self.parser, i, start, end, + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_decode(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset, __pyx_v_self->c_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1097 + * self.c_encoding) + * else: + * return _string_box_factorize(self.parser, i, start, end, # <<<<<<<<<<<<<< + * na_filter, na_hashset) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/parser.pyx":1098 + * else: + * return _string_box_factorize(self.parser, i, start, end, + * na_filter, na_hashset) # <<<<<<<<<<<<<< + * + * def _get_converter(self, i, name): + */ + __pyx_t_2 = __pyx_f_6pandas_6parser__string_box_factorize(__pyx_v_self->parser, __pyx_v_i, __pyx_v_start, __pyx_v_end, __pyx_v_na_filter, __pyx_v_na_hashset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + + /* "pandas/parser.pyx":1073 + * raise TypeError("the dtype %s is not supported for parsing" % dtype) + * + * cdef _string_convert(self, Py_ssize_t i, int start, int end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * if PY3: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.parser.TextReader._string_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1100 + * na_filter, na_hashset) + * + * def _get_converter(self, i, name): # <<<<<<<<<<<<<< + * if self.converters is None: + * return None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_19_get_converter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_19_get_converter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_i = 0; + PyObject *__pyx_v_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_converter (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_get_converter", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_converter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_i = values[0]; + __pyx_v_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_converter", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.TextReader._get_converter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_18_get_converter(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), __pyx_v_i, __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_18_get_converter(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_name) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_converter", 0); + + /* "pandas/parser.pyx":1101 + * + * def _get_converter(self, i, name): + * if self.converters is None: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = (__pyx_v_self->converters == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1102 + * def _get_converter(self, i, name): + * if self.converters is None: + * return None # <<<<<<<<<<<<<< + * + * if name is not None and name in self.converters: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1104 + * return None + * + * if name is not None and name in self.converters: # <<<<<<<<<<<<<< + * return self.converters[name] + * + */ + __pyx_t_2 = (__pyx_v_name != Py_None); + if ((__pyx_t_2 != 0)) { + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_self->converters, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__pyx_t_1 != 0); + } else { + __pyx_t_3 = (__pyx_t_2 != 0); + } + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1105 + * + * if name is not None and name in self.converters: + * return self.converters[name] # <<<<<<<<<<<<<< + * + * # Converter for position, if any + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->converters, __pyx_v_name); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1108 + * + * # Converter for position, if any + * return self.converters.get(i) # <<<<<<<<<<<<<< + * + * cdef _get_na_list(self, i, name): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->converters, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_i); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_i); + __Pyx_GIVEREF(__pyx_v_i); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1100 + * na_filter, na_hashset) + * + * def _get_converter(self, i, name): # <<<<<<<<<<<<<< + * if self.converters is None: + * return None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser.TextReader._get_converter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1110 + * return self.converters.get(i) + * + * cdef _get_na_list(self, i, name): # <<<<<<<<<<<<<< + * if self.na_values is None: + * return None, set() + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__get_na_list(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_name) { + PyObject *__pyx_v_values = NULL; + PyObject *__pyx_v_fvalues = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_na_list", 0); + + /* "pandas/parser.pyx":1111 + * + * cdef _get_na_list(self, i, name): + * if self.na_values is None: # <<<<<<<<<<<<<< + * return None, set() + * + */ + __pyx_t_1 = (__pyx_v_self->na_values == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1112 + * cdef _get_na_list(self, i, name): + * if self.na_values is None: + * return None, set() # <<<<<<<<<<<<<< + * + * if isinstance(self.na_values, dict): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1114 + * return None, set() + * + * if isinstance(self.na_values, dict): # <<<<<<<<<<<<<< + * values = None + * if name is not None and name in self.na_values: + */ + __pyx_t_4 = __pyx_v_self->na_values; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = PyDict_Check(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1115 + * + * if isinstance(self.na_values, dict): + * values = None # <<<<<<<<<<<<<< + * if name is not None and name in self.na_values: + * values = self.na_values[name] + */ + __Pyx_INCREF(Py_None); + __pyx_v_values = Py_None; + + /* "pandas/parser.pyx":1116 + * if isinstance(self.na_values, dict): + * values = None + * if name is not None and name in self.na_values: # <<<<<<<<<<<<<< + * values = self.na_values[name] + * if values is not None and not isinstance(values, list): + */ + __pyx_t_1 = (__pyx_v_name != Py_None); + if ((__pyx_t_1 != 0)) { + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_self->na_values, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_2 != 0); + } else { + __pyx_t_5 = (__pyx_t_1 != 0); + } + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1117 + * values = None + * if name is not None and name in self.na_values: + * values = self.na_values[name] # <<<<<<<<<<<<<< + * if values is not None and not isinstance(values, list): + * values = list(values) + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->na_values, __pyx_v_name); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1118 + * if name is not None and name in self.na_values: + * values = self.na_values[name] + * if values is not None and not isinstance(values, list): # <<<<<<<<<<<<<< + * values = list(values) + * fvalues = self.na_fvalues[name] + */ + __pyx_t_5 = (__pyx_v_values != Py_None); + if ((__pyx_t_5 != 0)) { + __pyx_t_1 = PyList_Check(__pyx_v_values); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + } else { + __pyx_t_1 = (__pyx_t_5 != 0); + } + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1119 + * values = self.na_values[name] + * if values is not None and not isinstance(values, list): + * values = list(values) # <<<<<<<<<<<<<< + * fvalues = self.na_fvalues[name] + * if fvalues is not None and not isinstance(fvalues, set): + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/parser.pyx":1120 + * if values is not None and not isinstance(values, list): + * values = list(values) + * fvalues = self.na_fvalues[name] # <<<<<<<<<<<<<< + * if fvalues is not None and not isinstance(fvalues, set): + * fvalues = set(fvalues) + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->na_fvalues, __pyx_v_name); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_fvalues = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1121 + * values = list(values) + * fvalues = self.na_fvalues[name] + * if fvalues is not None and not isinstance(fvalues, set): # <<<<<<<<<<<<<< + * fvalues = set(fvalues) + * else: + */ + __pyx_t_1 = (__pyx_v_fvalues != Py_None); + if ((__pyx_t_1 != 0)) { + __pyx_t_5 = PySet_Check(__pyx_v_fvalues); + __pyx_t_2 = ((!(__pyx_t_5 != 0)) != 0); + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = (__pyx_t_1 != 0); + } + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1122 + * fvalues = self.na_fvalues[name] + * if fvalues is not None and not isinstance(fvalues, set): + * fvalues = set(fvalues) # <<<<<<<<<<<<<< + * else: + * if i in self.na_values: + */ + __pyx_t_3 = PySet_New(__pyx_v_fvalues); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_fvalues, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L7; + } + __pyx_L7:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/parser.pyx":1124 + * fvalues = set(fvalues) + * else: + * if i in self.na_values: # <<<<<<<<<<<<<< + * return self.na_values[i], self.na_fvalues[i] + * else: + */ + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_i, __pyx_v_self->na_values, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1125 + * else: + * if i in self.na_values: + * return self.na_values[i], self.na_fvalues[i] # <<<<<<<<<<<<<< + * else: + * return _NA_VALUES, set() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyObject_GetItem(__pyx_v_self->na_values, __pyx_v_i); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetItem(__pyx_v_self->na_fvalues, __pyx_v_i); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1127 + * return self.na_values[i], self.na_fvalues[i] + * else: + * return _NA_VALUES, set() # <<<<<<<<<<<<<< + * + * return _ensure_encoded(values), fvalues + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NA_VALUES); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + } + __pyx_L5:; + + /* "pandas/parser.pyx":1129 + * return _NA_VALUES, set() + * + * return _ensure_encoded(values), fvalues # <<<<<<<<<<<<<< + * else: + * if not isinstance(self.na_values, list): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ensure_encoded); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_fvalues); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_fvalues); + __Pyx_GIVEREF(__pyx_v_fvalues); + __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1131 + * return _ensure_encoded(values), fvalues + * else: + * if not isinstance(self.na_values, list): # <<<<<<<<<<<<<< + * self.na_values = list(self.na_values) + * if not isinstance(self.na_fvalues, set): + */ + __pyx_t_4 = __pyx_v_self->na_values; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = PyList_Check(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1132 + * else: + * if not isinstance(self.na_values, list): + * self.na_values = list(self.na_values) # <<<<<<<<<<<<<< + * if not isinstance(self.na_fvalues, set): + * self.na_fvalues = set(self.na_fvalues) + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->na_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->na_values); + __Pyx_GIVEREF(__pyx_v_self->na_values); + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->na_values); + __Pyx_DECREF(__pyx_v_self->na_values); + __pyx_v_self->na_values = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/parser.pyx":1133 + * if not isinstance(self.na_values, list): + * self.na_values = list(self.na_values) + * if not isinstance(self.na_fvalues, set): # <<<<<<<<<<<<<< + * self.na_fvalues = set(self.na_fvalues) + * + */ + __pyx_t_6 = __pyx_v_self->na_fvalues; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_5 = PySet_Check(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1134 + * self.na_values = list(self.na_values) + * if not isinstance(self.na_fvalues, set): + * self.na_fvalues = set(self.na_fvalues) # <<<<<<<<<<<<<< + * + * return _ensure_encoded(self.na_values), self.na_fvalues + */ + __pyx_t_6 = PySet_New(__pyx_v_self->na_fvalues); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->na_fvalues); + __Pyx_DECREF(__pyx_v_self->na_fvalues); + __pyx_v_self->na_fvalues = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":1136 + * self.na_fvalues = set(self.na_fvalues) + * + * return _ensure_encoded(self.na_values), self.na_fvalues # <<<<<<<<<<<<<< + * + * cdef _free_na_set(self, kh_str_t *table): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ensure_encoded); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->na_values); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->na_values); + __Pyx_GIVEREF(__pyx_v_self->na_values); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self->na_fvalues); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->na_fvalues); + __Pyx_GIVEREF(__pyx_v_self->na_fvalues); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1110 + * return self.converters.get(i) + * + * cdef _get_na_list(self, i, name): # <<<<<<<<<<<<<< + * if self.na_values is None: + * return None, set() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser.TextReader._get_na_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_values); + __Pyx_XDECREF(__pyx_v_fvalues); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1138 + * return _ensure_encoded(self.na_values), self.na_fvalues + * + * cdef _free_na_set(self, kh_str_t *table): # <<<<<<<<<<<<<< + * kh_destroy_str(table) + * + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__free_na_set(CYTHON_UNUSED struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, kh_str_t *__pyx_v_table) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_free_na_set", 0); + + /* "pandas/parser.pyx":1139 + * + * cdef _free_na_set(self, kh_str_t *table): + * kh_destroy_str(table) # <<<<<<<<<<<<<< + * + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): + */ + kh_destroy_str(__pyx_v_table); + + /* "pandas/parser.pyx":1138 + * return _ensure_encoded(self.na_values), self.na_fvalues + * + * cdef _free_na_set(self, kh_str_t *table): # <<<<<<<<<<<<<< + * kh_destroy_str(table) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1141 + * kh_destroy_str(table) + * + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): # <<<<<<<<<<<<<< + * if self.has_usecols and self.names is not None: + * if len(self.names) == len(self.usecols): + */ + +static PyObject *__pyx_f_6pandas_6parser_10TextReader__get_column_name(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, Py_ssize_t __pyx_v_i, Py_ssize_t __pyx_v_nused) { + Py_ssize_t __pyx_v_j; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_column_name", 0); + + /* "pandas/parser.pyx":1142 + * + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): + * if self.has_usecols and self.names is not None: # <<<<<<<<<<<<<< + * if len(self.names) == len(self.usecols): + * return self.names[nused] + */ + if ((__pyx_v_self->has_usecols != 0)) { + __pyx_t_1 = (__pyx_v_self->names != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + } else { + __pyx_t_2 = (__pyx_v_self->has_usecols != 0); + } + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1143 + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): + * if self.has_usecols and self.names is not None: + * if len(self.names) == len(self.usecols): # <<<<<<<<<<<<<< + * return self.names[nused] + * else: + */ + __pyx_t_3 = __pyx_v_self->names; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_v_self->usecols; + __Pyx_INCREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = PySet_Size(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((__pyx_t_4 == __pyx_t_5) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1144 + * if self.has_usecols and self.names is not None: + * if len(self.names) == len(self.usecols): + * return self.names[nused] # <<<<<<<<<<<<<< + * else: + * return self.names[i - self.leading_cols] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->names, __pyx_v_nused, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1146 + * return self.names[nused] + * else: + * return self.names[i - self.leading_cols] # <<<<<<<<<<<<<< + * else: + * if self.header is not None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = (__pyx_v_i - __pyx_v_self->leading_cols); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->names, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1148 + * return self.names[i - self.leading_cols] + * else: + * if self.header is not None: # <<<<<<<<<<<<<< + * j = i - self.leading_cols + * # hack for #2442 + */ + __pyx_t_2 = (__pyx_v_self->header != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1149 + * else: + * if self.header is not None: + * j = i - self.leading_cols # <<<<<<<<<<<<<< + * # hack for #2442 + * if j == len(self.header[0]): + */ + __pyx_v_j = (__pyx_v_i - __pyx_v_self->leading_cols); + + /* "pandas/parser.pyx":1151 + * j = i - self.leading_cols + * # hack for #2442 + * if j == len(self.header[0]): # <<<<<<<<<<<<<< + * return j + * else: + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->header, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = ((__pyx_v_j == __pyx_t_5) != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1152 + * # hack for #2442 + * if j == len(self.header[0]): + * return j # <<<<<<<<<<<<<< + * else: + * return self.header[0][j] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1154 + * return j + * else: + * return self.header[0][j] # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->header, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/parser.pyx":1156 + * return self.header[0][j] + * else: + * return None # <<<<<<<<<<<<<< + * + * class CParserError(Exception): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + } + + /* "pandas/parser.pyx":1141 + * kh_destroy_str(table) + * + * cdef _get_column_name(self, Py_ssize_t i, Py_ssize_t nused): # <<<<<<<<<<<<<< + * if self.has_usecols and self.names is not None: + * if len(self.names) == len(self.usecols): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser.TextReader._get_column_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":248 + * + * cdef public: + * int leading_cols, table_width, skip_footer, buffer_lines # <<<<<<<<<<<<<< + * object allow_leading_cols + * object delimiter, converters, delim_whitespace + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12leading_cols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12leading_cols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12leading_cols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12leading_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->leading_cols); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.leading_cols.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12leading_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12leading_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12leading_cols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12leading_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->leading_cols = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.leading_cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11table_width_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11table_width_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11table_width___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11table_width___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->table_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.table_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11table_width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11table_width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11table_width_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11table_width_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->table_width = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.table_width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11skip_footer_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11skip_footer_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11skip_footer___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11skip_footer___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->skip_footer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.skip_footer.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11skip_footer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11skip_footer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11skip_footer_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11skip_footer_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->skip_footer = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.skip_footer.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12buffer_lines___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12buffer_lines___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->buffer_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.buffer_lines.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12buffer_lines_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12buffer_lines_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->buffer_lines = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.parser.TextReader.buffer_lines.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":249 + * cdef public: + * int leading_cols, table_width, skip_footer, buffer_lines + * object allow_leading_cols # <<<<<<<<<<<<<< + * object delimiter, converters, delim_whitespace + * object na_values, true_values, false_values + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->allow_leading_cols); + __pyx_r = __pyx_v_self->allow_leading_cols; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->allow_leading_cols); + __Pyx_DECREF(__pyx_v_self->allow_leading_cols); + __pyx_v_self->allow_leading_cols = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_18allow_leading_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->allow_leading_cols); + __Pyx_DECREF(__pyx_v_self->allow_leading_cols); + __pyx_v_self->allow_leading_cols = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":250 + * int leading_cols, table_width, skip_footer, buffer_lines + * object allow_leading_cols + * object delimiter, converters, delim_whitespace # <<<<<<<<<<<<<< + * object na_values, true_values, false_values + * object memory_map + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9delimiter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9delimiter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9delimiter___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9delimiter___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->delimiter); + __pyx_r = __pyx_v_self->delimiter; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9delimiter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9delimiter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9delimiter_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9delimiter_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->delimiter); + __Pyx_DECREF(__pyx_v_self->delimiter); + __pyx_v_self->delimiter = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9delimiter_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9delimiter_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9delimiter_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9delimiter_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->delimiter); + __Pyx_DECREF(__pyx_v_self->delimiter); + __pyx_v_self->delimiter = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10converters_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10converters_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10converters___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10converters___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->converters); + __pyx_r = __pyx_v_self->converters; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10converters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10converters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10converters_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10converters_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->converters); + __Pyx_DECREF(__pyx_v_self->converters); + __pyx_v_self->converters = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10converters_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10converters_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10converters_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10converters_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->converters); + __Pyx_DECREF(__pyx_v_self->converters); + __pyx_v_self->converters = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->delim_whitespace); + __pyx_r = __pyx_v_self->delim_whitespace; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->delim_whitespace); + __Pyx_DECREF(__pyx_v_self->delim_whitespace); + __pyx_v_self->delim_whitespace = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_16delim_whitespace_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->delim_whitespace); + __Pyx_DECREF(__pyx_v_self->delim_whitespace); + __pyx_v_self->delim_whitespace = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":251 + * object allow_leading_cols + * object delimiter, converters, delim_whitespace + * object na_values, true_values, false_values # <<<<<<<<<<<<<< + * object memory_map + * object as_recarray + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9na_values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9na_values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9na_values___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9na_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->na_values); + __pyx_r = __pyx_v_self->na_values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9na_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9na_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9na_values_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9na_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->na_values); + __Pyx_DECREF(__pyx_v_self->na_values); + __pyx_v_self->na_values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9na_values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9na_values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9na_values_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9na_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->na_values); + __Pyx_DECREF(__pyx_v_self->na_values); + __pyx_v_self->na_values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11true_values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11true_values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11true_values___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11true_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->true_values); + __pyx_r = __pyx_v_self->true_values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11true_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11true_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11true_values_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11true_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->true_values); + __Pyx_DECREF(__pyx_v_self->true_values); + __pyx_v_self->true_values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11true_values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11true_values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11true_values_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11true_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->true_values); + __Pyx_DECREF(__pyx_v_self->true_values); + __pyx_v_self->true_values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12false_values_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12false_values_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12false_values___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12false_values___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->false_values); + __pyx_r = __pyx_v_self->false_values; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12false_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12false_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12false_values_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12false_values_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->false_values); + __Pyx_DECREF(__pyx_v_self->false_values); + __pyx_v_self->false_values = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12false_values_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12false_values_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12false_values_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12false_values_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->false_values); + __Pyx_DECREF(__pyx_v_self->false_values); + __pyx_v_self->false_values = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":252 + * object delimiter, converters, delim_whitespace + * object na_values, true_values, false_values + * object memory_map # <<<<<<<<<<<<<< + * object as_recarray + * object header, orig_header, names, header_start, header_end + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10memory_map_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10memory_map_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10memory_map___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10memory_map___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->memory_map); + __pyx_r = __pyx_v_self->memory_map; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10memory_map_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10memory_map_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10memory_map_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10memory_map_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->memory_map); + __Pyx_DECREF(__pyx_v_self->memory_map); + __pyx_v_self->memory_map = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10memory_map_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10memory_map_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10memory_map_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10memory_map_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->memory_map); + __Pyx_DECREF(__pyx_v_self->memory_map); + __pyx_v_self->memory_map = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":253 + * object na_values, true_values, false_values + * object memory_map + * object as_recarray # <<<<<<<<<<<<<< + * object header, orig_header, names, header_start, header_end + * object index_col + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11as_recarray_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11as_recarray_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11as_recarray___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11as_recarray___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->as_recarray); + __pyx_r = __pyx_v_self->as_recarray; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->as_recarray); + __Pyx_DECREF(__pyx_v_self->as_recarray); + __pyx_v_self->as_recarray = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11as_recarray_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->as_recarray); + __Pyx_DECREF(__pyx_v_self->as_recarray); + __pyx_v_self->as_recarray = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":254 + * object memory_map + * object as_recarray + * object header, orig_header, names, header_start, header_end # <<<<<<<<<<<<<< + * object index_col + * object low_memory + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_6header_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_6header_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_6header___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_6header___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->header); + __pyx_r = __pyx_v_self->header; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_6header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_6header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_6header_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_6header_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_6header_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_6header_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_6header_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_6header_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->header); + __Pyx_DECREF(__pyx_v_self->header); + __pyx_v_self->header = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11orig_header_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11orig_header_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11orig_header___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11orig_header___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->orig_header); + __pyx_r = __pyx_v_self->orig_header; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11orig_header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11orig_header_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11orig_header_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11orig_header_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->orig_header); + __Pyx_DECREF(__pyx_v_self->orig_header); + __pyx_v_self->orig_header = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11orig_header_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11orig_header_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11orig_header_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11orig_header_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->orig_header); + __Pyx_DECREF(__pyx_v_self->orig_header); + __pyx_v_self->orig_header = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_5names_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_5names_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5names___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_5names___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->names); + __pyx_r = __pyx_v_self->names; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_5names_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_5names_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5names_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_5names_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->names); + __Pyx_DECREF(__pyx_v_self->names); + __pyx_v_self->names = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_5names_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_5names_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5names_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_5names_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->names); + __Pyx_DECREF(__pyx_v_self->names); + __pyx_v_self->names = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12header_start_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12header_start_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12header_start___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12header_start___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->header_start); + __pyx_r = __pyx_v_self->header_start; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12header_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12header_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12header_start_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12header_start_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->header_start); + __Pyx_DECREF(__pyx_v_self->header_start); + __pyx_v_self->header_start = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12header_start_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12header_start_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12header_start_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12header_start_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->header_start); + __Pyx_DECREF(__pyx_v_self->header_start); + __pyx_v_self->header_start = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10header_end_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10header_end_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10header_end___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10header_end___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->header_end); + __pyx_r = __pyx_v_self->header_end; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10header_end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10header_end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10header_end_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10header_end_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->header_end); + __Pyx_DECREF(__pyx_v_self->header_end); + __pyx_v_self->header_end = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10header_end_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10header_end_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10header_end_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10header_end_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->header_end); + __Pyx_DECREF(__pyx_v_self->header_end); + __pyx_v_self->header_end = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":255 + * object as_recarray + * object header, orig_header, names, header_start, header_end + * object index_col # <<<<<<<<<<<<<< + * object low_memory + * object skiprows + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9index_col_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9index_col_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9index_col___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9index_col___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->index_col); + __pyx_r = __pyx_v_self->index_col; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9index_col_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9index_col_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9index_col_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9index_col_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->index_col); + __Pyx_DECREF(__pyx_v_self->index_col); + __pyx_v_self->index_col = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9index_col_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9index_col_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9index_col_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9index_col_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->index_col); + __Pyx_DECREF(__pyx_v_self->index_col); + __pyx_v_self->index_col = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":256 + * object header, orig_header, names, header_start, header_end + * object index_col + * object low_memory # <<<<<<<<<<<<<< + * object skiprows + * object compact_ints, use_unsigned + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10low_memory_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_10low_memory_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10low_memory___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_10low_memory___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->low_memory); + __pyx_r = __pyx_v_self->low_memory; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10low_memory_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10low_memory_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10low_memory_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10low_memory_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->low_memory); + __Pyx_DECREF(__pyx_v_self->low_memory); + __pyx_v_self->low_memory = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_10low_memory_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_10low_memory_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_10low_memory_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_10low_memory_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->low_memory); + __Pyx_DECREF(__pyx_v_self->low_memory); + __pyx_v_self->low_memory = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":257 + * object index_col + * object low_memory + * object skiprows # <<<<<<<<<<<<<< + * object compact_ints, use_unsigned + * object dtype + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_8skiprows_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_8skiprows_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8skiprows___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8skiprows___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->skiprows); + __pyx_r = __pyx_v_self->skiprows; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_8skiprows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_8skiprows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8skiprows_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_8skiprows_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->skiprows); + __Pyx_DECREF(__pyx_v_self->skiprows); + __pyx_v_self->skiprows = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_8skiprows_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_8skiprows_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8skiprows_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_8skiprows_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->skiprows); + __Pyx_DECREF(__pyx_v_self->skiprows); + __pyx_v_self->skiprows = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":258 + * object low_memory + * object skiprows + * object compact_ints, use_unsigned # <<<<<<<<<<<<<< + * object dtype + * object encoding + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12compact_ints_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12compact_ints_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12compact_ints___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12compact_ints___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->compact_ints); + __pyx_r = __pyx_v_self->compact_ints; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->compact_ints); + __Pyx_DECREF(__pyx_v_self->compact_ints); + __pyx_v_self->compact_ints = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12compact_ints_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->compact_ints); + __Pyx_DECREF(__pyx_v_self->compact_ints); + __pyx_v_self->compact_ints = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_12use_unsigned___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->use_unsigned); + __pyx_r = __pyx_v_self->use_unsigned; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->use_unsigned); + __Pyx_DECREF(__pyx_v_self->use_unsigned); + __pyx_v_self->use_unsigned = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_12use_unsigned_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->use_unsigned); + __Pyx_DECREF(__pyx_v_self->use_unsigned); + __pyx_v_self->use_unsigned = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":259 + * object skiprows + * object compact_ints, use_unsigned + * object dtype # <<<<<<<<<<<<<< + * object encoding + * object compression + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_5dtype_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5dtype___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_5dtype___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->dtype); + __pyx_r = __pyx_v_self->dtype; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5dtype_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_5dtype_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->dtype); + __Pyx_DECREF(__pyx_v_self->dtype); + __pyx_v_self->dtype = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_5dtype_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_5dtype_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_5dtype_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_5dtype_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->dtype); + __Pyx_DECREF(__pyx_v_self->dtype); + __pyx_v_self->dtype = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":260 + * object compact_ints, use_unsigned + * object dtype + * object encoding # <<<<<<<<<<<<<< + * object compression + * object mangle_dupe_cols + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_8encoding_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_8encoding_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8encoding___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_8encoding___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->encoding); + __pyx_r = __pyx_v_self->encoding; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_8encoding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_8encoding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8encoding_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_8encoding_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->encoding); + __Pyx_DECREF(__pyx_v_self->encoding); + __pyx_v_self->encoding = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_8encoding_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_8encoding_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_8encoding_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_8encoding_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->encoding); + __Pyx_DECREF(__pyx_v_self->encoding); + __pyx_v_self->encoding = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":261 + * object dtype + * object encoding + * object compression # <<<<<<<<<<<<<< + * object mangle_dupe_cols + * object tupleize_cols + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11compression_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_11compression_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11compression___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_11compression___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->compression); + __pyx_r = __pyx_v_self->compression; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11compression_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11compression_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11compression_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11compression_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->compression); + __Pyx_DECREF(__pyx_v_self->compression); + __pyx_v_self->compression = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_11compression_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_11compression_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_11compression_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_11compression_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->compression); + __Pyx_DECREF(__pyx_v_self->compression); + __pyx_v_self->compression = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":262 + * object encoding + * object compression + * object mangle_dupe_cols # <<<<<<<<<<<<<< + * object tupleize_cols + * set noconvert, usecols + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->mangle_dupe_cols); + __pyx_r = __pyx_v_self->mangle_dupe_cols; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->mangle_dupe_cols); + __Pyx_DECREF(__pyx_v_self->mangle_dupe_cols); + __pyx_v_self->mangle_dupe_cols = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_16mangle_dupe_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->mangle_dupe_cols); + __Pyx_DECREF(__pyx_v_self->mangle_dupe_cols); + __pyx_v_self->mangle_dupe_cols = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":263 + * object compression + * object mangle_dupe_cols + * object tupleize_cols # <<<<<<<<<<<<<< + * set noconvert, usecols + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->tupleize_cols); + __pyx_r = __pyx_v_self->tupleize_cols; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->tupleize_cols); + __Pyx_DECREF(__pyx_v_self->tupleize_cols); + __pyx_v_self->tupleize_cols = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_13tupleize_cols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->tupleize_cols); + __Pyx_DECREF(__pyx_v_self->tupleize_cols); + __pyx_v_self->tupleize_cols = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":264 + * object mangle_dupe_cols + * object tupleize_cols + * set noconvert, usecols # <<<<<<<<<<<<<< + * + * def __cinit__(self, source, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9noconvert_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_9noconvert_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9noconvert___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_9noconvert___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->noconvert); + __pyx_r = __pyx_v_self->noconvert; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9noconvert_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9noconvert_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9noconvert_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9noconvert_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->noconvert); + __Pyx_DECREF(__pyx_v_self->noconvert); + __pyx_v_self->noconvert = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.noconvert.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_9noconvert_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_9noconvert_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_9noconvert_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_9noconvert_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->noconvert); + __Pyx_DECREF(__pyx_v_self->noconvert); + __pyx_v_self->noconvert = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_7usecols_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_6parser_10TextReader_7usecols_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_7usecols___get__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10TextReader_7usecols___get__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->usecols); + __pyx_r = __pyx_v_self->usecols; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_7usecols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_7usecols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_7usecols_2__set__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_7usecols_2__set__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->usecols); + __Pyx_DECREF(__pyx_v_self->usecols); + __pyx_v_self->usecols = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.parser.TextReader.usecols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6pandas_6parser_10TextReader_7usecols_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6pandas_6parser_10TextReader_7usecols_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10TextReader_7usecols_4__del__(((struct __pyx_obj_6pandas_6parser_TextReader *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_6parser_10TextReader_7usecols_4__del__(struct __pyx_obj_6pandas_6parser_TextReader *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->usecols); + __Pyx_DECREF(__pyx_v_self->usecols); + __pyx_v_self->usecols = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1169 + * + * + * def _ensure_encoded(list lst): # <<<<<<<<<<<<<< + * cdef list result = [] + * for x in lst: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_1_ensure_encoded(PyObject *__pyx_self, PyObject *__pyx_v_lst); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_1_ensure_encoded = {__Pyx_NAMESTR("_ensure_encoded"), (PyCFunction)__pyx_pw_6pandas_6parser_1_ensure_encoded, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_1_ensure_encoded(PyObject *__pyx_self, PyObject *__pyx_v_lst) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_ensure_encoded (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lst), (&PyList_Type), 1, "lst", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_6parser__ensure_encoded(__pyx_self, ((PyObject*)__pyx_v_lst)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser__ensure_encoded(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst) { + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ensure_encoded", 0); + + /* "pandas/parser.pyx":1170 + * + * def _ensure_encoded(list lst): + * cdef list result = [] # <<<<<<<<<<<<<< + * for x in lst: + * if PyUnicode_Check(x): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1171 + * def _ensure_encoded(list lst): + * cdef list result = [] + * for x in lst: # <<<<<<<<<<<<<< + * if PyUnicode_Check(x): + * x = PyUnicode_AsUTF8String(x) + */ + if (unlikely(__pyx_v_lst == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1172 + * cdef list result = [] + * for x in lst: + * if PyUnicode_Check(x): # <<<<<<<<<<<<<< + * x = PyUnicode_AsUTF8String(x) + * elif not PyBytes_Check(x): + */ + __pyx_t_4 = (PyUnicode_Check(__pyx_v_x) != 0); + if (__pyx_t_4) { + + /* "pandas/parser.pyx":1173 + * for x in lst: + * if PyUnicode_Check(x): + * x = PyUnicode_AsUTF8String(x) # <<<<<<<<<<<<<< + * elif not PyBytes_Check(x): + * x = asbytes(x) + */ + __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + + /* "pandas/parser.pyx":1174 + * if PyUnicode_Check(x): + * x = PyUnicode_AsUTF8String(x) + * elif not PyBytes_Check(x): # <<<<<<<<<<<<<< + * x = asbytes(x) + * + */ + __pyx_t_4 = ((!(PyBytes_Check(__pyx_v_x) != 0)) != 0); + if (__pyx_t_4) { + + /* "pandas/parser.pyx":1175 + * x = PyUnicode_AsUTF8String(x) + * elif not PyBytes_Check(x): + * x = asbytes(x) # <<<<<<<<<<<<<< + * + * result.append(x) + */ + __pyx_t_3 = __pyx_f_6pandas_6parser_asbytes(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":1177 + * x = asbytes(x) + * + * result.append(x) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_x); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1178 + * + * result.append(x) + * return result # <<<<<<<<<<<<<< + * + * cdef asbytes(object o): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/parser.pyx":1169 + * + * + * def _ensure_encoded(list lst): # <<<<<<<<<<<<<< + * cdef list result = [] + * for x in lst: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser._ensure_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1180 + * return result + * + * cdef asbytes(object o): # <<<<<<<<<<<<<< + * if PY3: + * return str(o).encode('utf-8') + */ + +static PyObject *__pyx_f_6pandas_6parser_asbytes(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("asbytes", 0); + + /* "pandas/parser.pyx":1181 + * + * cdef asbytes(object o): + * if PY3: # <<<<<<<<<<<<<< + * return str(o).encode('utf-8') + * else: + */ + __pyx_t_1 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1182 + * cdef asbytes(object o): + * if PY3: + * return str(o).encode('utf-8') # <<<<<<<<<<<<<< + * else: + * return str(o) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/parser.pyx":1184 + * return str(o).encode('utf-8') + * else: + * return str(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1180 + * return result + * + * cdef asbytes(object o): # <<<<<<<<<<<<<< + * if PY3: + * return str(o).encode('utf-8') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.asbytes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1187 + * + * + * def _is_file_like(obj): # <<<<<<<<<<<<<< + * if PY3: + * import io + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_3_is_file_like(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_3_is_file_like = {__Pyx_NAMESTR("_is_file_like"), (PyCFunction)__pyx_pw_6pandas_6parser_3_is_file_like, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_3_is_file_like(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_is_file_like (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_2_is_file_like(__pyx_self, ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_2_is_file_like(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_v_io = NULL; + PyObject *__pyx_v_file = NULL; + PyObject *__pyx_v___builtin__ = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_file_like", 0); + + /* "pandas/parser.pyx":1188 + * + * def _is_file_like(obj): + * if PY3: # <<<<<<<<<<<<<< + * import io + * if isinstance(obj, io.TextIOWrapper): + */ + __pyx_t_1 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1189 + * def _is_file_like(obj): + * if PY3: + * import io # <<<<<<<<<<<<<< + * if isinstance(obj, io.TextIOWrapper): + * raise CParserError('Cannot handle open unicode files (yet)') + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_io, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_io = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1190 + * if PY3: + * import io + * if isinstance(obj, io.TextIOWrapper): # <<<<<<<<<<<<<< + * raise CParserError('Cannot handle open unicode files (yet)') + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_TextIOWrapper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/parser.pyx":1191 + * import io + * if isinstance(obj, io.TextIOWrapper): + * raise CParserError('Cannot handle open unicode files (yet)') # <<<<<<<<<<<<<< + * + * # BufferedReader is a byte reader for Python 3 + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CParserError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1194 + * + * # BufferedReader is a byte reader for Python 3 + * file = io.BufferedReader # <<<<<<<<<<<<<< + * else: + * import __builtin__ + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_BufferedReader); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_file = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1196 + * file = io.BufferedReader + * else: + * import __builtin__ # <<<<<<<<<<<<<< + * file = __builtin__.file + * + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_builtin, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v___builtin__ = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1197 + * else: + * import __builtin__ + * file = __builtin__.file # <<<<<<<<<<<<<< + * + * return isinstance(obj, (basestring, file)) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v___builtin__, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_file = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":1199 + * file = __builtin__.file + * + * return isinstance(obj, (basestring, file)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_file); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_file); + __Pyx_GIVEREF(__pyx_v_file); + __pyx_t_4 = 0; + __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1187 + * + * + * def _is_file_like(obj): # <<<<<<<<<<<<<< + * if PY3: + * import io + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.parser._is_file_like", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_io); + __Pyx_XDECREF(__pyx_v_file); + __Pyx_XDECREF(__pyx_v___builtin__); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1202 + * + * + * def _maybe_upcast(arr): # <<<<<<<<<<<<<< + * """ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_5_maybe_upcast(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static char __pyx_doc_6pandas_6parser_4_maybe_upcast[] = "\n\n "; +static PyMethodDef __pyx_mdef_6pandas_6parser_5_maybe_upcast = {__Pyx_NAMESTR("_maybe_upcast"), (PyCFunction)__pyx_pw_6pandas_6parser_5_maybe_upcast, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_6parser_4_maybe_upcast)}; +static PyObject *__pyx_pw_6pandas_6parser_5_maybe_upcast(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_maybe_upcast (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_4_maybe_upcast(__pyx_self, ((PyObject *)__pyx_v_arr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_4_maybe_upcast(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr) { + PyObject *__pyx_v_na_value = NULL; + PyObject *__pyx_v_mask = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_upcast", 0); + __Pyx_INCREF(__pyx_v_arr); + + /* "pandas/parser.pyx":1206 + * + * """ + * if issubclass(arr.dtype.type, np.integer): # <<<<<<<<<<<<<< + * na_value = na_values[arr.dtype] + * arr = arr.astype(float) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_IsSubclass(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1207 + * """ + * if issubclass(arr.dtype.type, np.integer): + * na_value = na_values[arr.dtype] # <<<<<<<<<<<<<< + * arr = arr.astype(float) + * np.putmask(arr, arr == na_value, np.nan) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_t_2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_na_value = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1208 + * if issubclass(arr.dtype.type, np.integer): + * na_value = na_values[arr.dtype] + * arr = arr.astype(float) # <<<<<<<<<<<<<< + * np.putmask(arr, arr == na_value, np.nan) + * elif arr.dtype == np.bool_: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyFloat_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1209 + * na_value = na_values[arr.dtype] + * arr = arr.astype(float) + * np.putmask(arr, arr == na_value, np.nan) # <<<<<<<<<<<<<< + * elif arr.dtype == np.bool_: + * mask = arr.view(np.uint8) == na_values[np.uint8] + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_putmask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_arr, __pyx_v_na_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_3 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L3; + } + + /* "pandas/parser.pyx":1210 + * arr = arr.astype(float) + * np.putmask(arr, arr == na_value, np.nan) + * elif arr.dtype == np.bool_: # <<<<<<<<<<<<<< + * mask = arr.view(np.uint8) == na_values[np.uint8] + * arr = arr.astype(object) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/parser.pyx":1211 + * np.putmask(arr, arr == na_value, np.nan) + * elif arr.dtype == np.bool_: + * mask = arr.view(np.uint8) == na_values[np.uint8] # <<<<<<<<<<<<<< + * arr = arr.astype(object) + * np.putmask(arr, mask, np.nan) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_mask = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1212 + * elif arr.dtype == np.bool_: + * mask = arr.view(np.uint8) == na_values[np.uint8] + * arr = arr.astype(object) # <<<<<<<<<<<<<< + * np.putmask(arr, mask, np.nan) + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1213 + * mask = arr.view(np.uint8) == na_values[np.uint8] + * arr = arr.astype(object) + * np.putmask(arr, mask, np.nan) # <<<<<<<<<<<<<< + * + * return arr + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __Pyx_INCREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_mask); + __Pyx_GIVEREF(__pyx_v_mask); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/parser.pyx":1215 + * np.putmask(arr, mask, np.nan) + * + * return arr # <<<<<<<<<<<<<< + * + * # ---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + + /* "pandas/parser.pyx":1202 + * + * + * def _maybe_upcast(arr): # <<<<<<<<<<<<<< + * """ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser._maybe_upcast", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_na_value); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1220 + * # Type conversions / inference support code + * + * cdef _string_box_factorize(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset): + */ + +static PyObject *__pyx_f_6pandas_6parser__string_box_factorize(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + int __pyx_v_na_count; + Py_ssize_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_ret; + kh_strbox_t *__pyx_v_table; + PyObject *__pyx_v_pyval = 0; + PyObject *__pyx_v_NA = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_box_factorize", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1224 + * bint na_filter, kh_str_t *na_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i + * size_t lines + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1231 + * ndarray[object] result + * + * int ret = 0 # <<<<<<<<<<<<<< + * kh_strbox_t *table + * + */ + __pyx_v_ret = 0; + + /* "pandas/parser.pyx":1236 + * object pyval + * + * object NA = na_values[np.object_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_NA = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1239 + * khiter_t k + * + * table = kh_init_strbox() # <<<<<<<<<<<<<< + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + */ + __pyx_v_table = kh_init_strbox(); + + /* "pandas/parser.pyx":1240 + * + * table = kh_init_strbox() + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1241 + * table = kh_init_strbox() + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1242 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * for i in range(lines): + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1244 + * coliter_setup(&it, parser, col, line_start) + * + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_11 = __pyx_v_lines; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1245 + * + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1247 + * word = COLITER_NEXT(it) + * + * if na_filter: # <<<<<<<<<<<<<< + * k = kh_get_str(na_hashset, word) + * # in the hash table + */ + __pyx_t_13 = (__pyx_v_na_filter != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1248 + * + * if na_filter: + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1250 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * result[i] = NA + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1251 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * result[i] = NA + * continue + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1252 + * if k != na_hashset.n_buckets: + * na_count += 1 + * result[i] = NA # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_NA); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_NA; + __Pyx_GIVEREF(*__pyx_t_15); + + /* "pandas/parser.pyx":1253 + * na_count += 1 + * result[i] = NA + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_strbox(table, word) + */ + goto __pyx_L3_continue; + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":1255 + * continue + * + * k = kh_get_strbox(table, word) # <<<<<<<<<<<<<< + * + * # in the hash table + */ + __pyx_v_k = kh_get_strbox(__pyx_v_table, __pyx_v_word); + + /* "pandas/parser.pyx":1258 + * + * # in the hash table + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * # this increments the refcount, but need to test + * pyval = table.vals[k] + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1260 + * if k != table.n_buckets: + * # this increments the refcount, but need to test + * pyval = table.vals[k] # <<<<<<<<<<<<<< + * else: + * # box it. new ref? + */ + __pyx_t_5 = ((PyObject *)(__pyx_v_table->vals[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/parser.pyx":1263 + * else: + * # box it. new ref? + * pyval = PyBytes_FromString(word) # <<<<<<<<<<<<<< + * + * k = kh_put_strbox(table, word, &ret) + */ + __pyx_t_5 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1265 + * pyval = PyBytes_FromString(word) + * + * k = kh_put_strbox(table, word, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = pyval + * + */ + __pyx_v_k = kh_put_strbox(__pyx_v_table, __pyx_v_word, (&__pyx_v_ret)); + + /* "pandas/parser.pyx":1266 + * + * k = kh_put_strbox(table, word, &ret) + * table.vals[k] = pyval # <<<<<<<<<<<<<< + * + * result[i] = pyval + */ + (__pyx_v_table->vals[__pyx_v_k]) = ((PyObject *)__pyx_v_pyval); + } + __pyx_L7:; + + /* "pandas/parser.pyx":1268 + * table.vals[k] = pyval + * + * result[i] = pyval # <<<<<<<<<<<<<< + * + * kh_destroy_strbox(table) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_pyval); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_pyval; + __Pyx_GIVEREF(*__pyx_t_15); + __pyx_L3_continue:; + } + + /* "pandas/parser.pyx":1270 + * result[i] = pyval + * + * kh_destroy_strbox(table) # <<<<<<<<<<<<<< + * + * return result, na_count + */ + kh_destroy_strbox(__pyx_v_table); + + /* "pandas/parser.pyx":1272 + * kh_destroy_strbox(table) + * + * return result, na_count # <<<<<<<<<<<<<< + * + * cdef _string_box_utf8(parser_t *parser, int col, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1220 + * # Type conversions / inference support code + * + * cdef _string_box_factorize(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._string_box_factorize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_pyval); + __Pyx_XDECREF(__pyx_v_NA); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1274 + * return result, na_count + * + * cdef _string_box_utf8(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset): + */ + +static PyObject *__pyx_f_6pandas_6parser__string_box_utf8(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + int __pyx_v_na_count; + Py_ssize_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_ret; + kh_strbox_t *__pyx_v_table; + PyObject *__pyx_v_pyval = 0; + PyObject *__pyx_v_NA = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_box_utf8", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1278 + * bint na_filter, kh_str_t *na_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i + * size_t lines + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1285 + * ndarray[object] result + * + * int ret = 0 # <<<<<<<<<<<<<< + * kh_strbox_t *table + * + */ + __pyx_v_ret = 0; + + /* "pandas/parser.pyx":1290 + * object pyval + * + * object NA = na_values[np.object_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_NA = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1293 + * khiter_t k + * + * table = kh_init_strbox() # <<<<<<<<<<<<<< + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + */ + __pyx_v_table = kh_init_strbox(); + + /* "pandas/parser.pyx":1294 + * + * table = kh_init_strbox() + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1295 + * table = kh_init_strbox() + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1296 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * for i in range(lines): + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1298 + * coliter_setup(&it, parser, col, line_start) + * + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_11 = __pyx_v_lines; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1299 + * + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1301 + * word = COLITER_NEXT(it) + * + * if na_filter: # <<<<<<<<<<<<<< + * k = kh_get_str(na_hashset, word) + * # in the hash table + */ + __pyx_t_13 = (__pyx_v_na_filter != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1302 + * + * if na_filter: + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1304 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * result[i] = NA + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1305 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * result[i] = NA + * continue + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1306 + * if k != na_hashset.n_buckets: + * na_count += 1 + * result[i] = NA # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_NA); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_NA; + __Pyx_GIVEREF(*__pyx_t_15); + + /* "pandas/parser.pyx":1307 + * na_count += 1 + * result[i] = NA + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_strbox(table, word) + */ + goto __pyx_L3_continue; + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":1309 + * continue + * + * k = kh_get_strbox(table, word) # <<<<<<<<<<<<<< + * + * # in the hash table + */ + __pyx_v_k = kh_get_strbox(__pyx_v_table, __pyx_v_word); + + /* "pandas/parser.pyx":1312 + * + * # in the hash table + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * # this increments the refcount, but need to test + * pyval = table.vals[k] + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1314 + * if k != table.n_buckets: + * # this increments the refcount, but need to test + * pyval = table.vals[k] # <<<<<<<<<<<<<< + * else: + * # box it. new ref? + */ + __pyx_t_5 = ((PyObject *)(__pyx_v_table->vals[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/parser.pyx":1317 + * else: + * # box it. new ref? + * pyval = PyUnicode_FromString(word) # <<<<<<<<<<<<<< + * + * k = kh_put_strbox(table, word, &ret) + */ + __pyx_t_5 = PyUnicode_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1319 + * pyval = PyUnicode_FromString(word) + * + * k = kh_put_strbox(table, word, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = pyval + * + */ + __pyx_v_k = kh_put_strbox(__pyx_v_table, __pyx_v_word, (&__pyx_v_ret)); + + /* "pandas/parser.pyx":1320 + * + * k = kh_put_strbox(table, word, &ret) + * table.vals[k] = pyval # <<<<<<<<<<<<<< + * + * result[i] = pyval + */ + (__pyx_v_table->vals[__pyx_v_k]) = ((PyObject *)__pyx_v_pyval); + } + __pyx_L7:; + + /* "pandas/parser.pyx":1322 + * table.vals[k] = pyval + * + * result[i] = pyval # <<<<<<<<<<<<<< + * + * kh_destroy_strbox(table) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_pyval); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_pyval; + __Pyx_GIVEREF(*__pyx_t_15); + __pyx_L3_continue:; + } + + /* "pandas/parser.pyx":1324 + * result[i] = pyval + * + * kh_destroy_strbox(table) # <<<<<<<<<<<<<< + * + * return result, na_count + */ + kh_destroy_strbox(__pyx_v_table); + + /* "pandas/parser.pyx":1326 + * kh_destroy_strbox(table) + * + * return result, na_count # <<<<<<<<<<<<<< + * + * cdef _string_box_decode(parser_t *parser, int col, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1274 + * return result, na_count + * + * cdef _string_box_utf8(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._string_box_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_pyval); + __Pyx_XDECREF(__pyx_v_NA); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1328 + * return result, na_count + * + * cdef _string_box_decode(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset, + */ + +static PyObject *__pyx_f_6pandas_6parser__string_box_decode(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset, char *__pyx_v_encoding) { + int __pyx_v_na_count; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_size; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + PyArrayObject *__pyx_v_result = 0; + int __pyx_v_ret; + kh_strbox_t *__pyx_v_table; + char *__pyx_v_errors; + PyObject *__pyx_v_pyval = 0; + PyObject *__pyx_v_NA = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject **__pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_box_decode", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1333 + * char *encoding): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * Py_ssize_t i, size + * size_t lines + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1340 + * ndarray[object] result + * + * int ret = 0 # <<<<<<<<<<<<<< + * kh_strbox_t *table + * + */ + __pyx_v_ret = 0; + + /* "pandas/parser.pyx":1343 + * kh_strbox_t *table + * + * char *errors = "strict" # <<<<<<<<<<<<<< + * + * object pyval + */ + __pyx_v_errors = __pyx_k_strict; + + /* "pandas/parser.pyx":1347 + * object pyval + * + * object NA = na_values[np.object_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_NA = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1350 + * khiter_t k + * + * table = kh_init_strbox() # <<<<<<<<<<<<<< + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + */ + __pyx_v_table = kh_init_strbox(); + + /* "pandas/parser.pyx":1351 + * + * table = kh_init_strbox() + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1352 + * table = kh_init_strbox() + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1353 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * for i in range(lines): + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1355 + * coliter_setup(&it, parser, col, line_start) + * + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_11 = __pyx_v_lines; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1356 + * + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1358 + * word = COLITER_NEXT(it) + * + * if na_filter: # <<<<<<<<<<<<<< + * k = kh_get_str(na_hashset, word) + * # in the hash table + */ + __pyx_t_13 = (__pyx_v_na_filter != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1359 + * + * if na_filter: + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1361 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * result[i] = NA + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1362 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * result[i] = NA + * continue + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1363 + * if k != na_hashset.n_buckets: + * na_count += 1 + * result[i] = NA # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_NA); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_NA; + __Pyx_GIVEREF(*__pyx_t_15); + + /* "pandas/parser.pyx":1364 + * na_count += 1 + * result[i] = NA + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_strbox(table, word) + */ + goto __pyx_L3_continue; + } + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/parser.pyx":1366 + * continue + * + * k = kh_get_strbox(table, word) # <<<<<<<<<<<<<< + * + * # in the hash table + */ + __pyx_v_k = kh_get_strbox(__pyx_v_table, __pyx_v_word); + + /* "pandas/parser.pyx":1369 + * + * # in the hash table + * if k != table.n_buckets: # <<<<<<<<<<<<<< + * # this increments the refcount, but need to test + * pyval = table.vals[k] + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_table->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1371 + * if k != table.n_buckets: + * # this increments the refcount, but need to test + * pyval = table.vals[k] # <<<<<<<<<<<<<< + * else: + * # box it. new ref? + */ + __pyx_t_5 = ((PyObject *)(__pyx_v_table->vals[__pyx_v_k])); + __Pyx_INCREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/parser.pyx":1374 + * else: + * # box it. new ref? + * size = strlen(word) # <<<<<<<<<<<<<< + * pyval = PyUnicode_Decode(word, size, encoding, errors) + * + */ + __pyx_v_size = strlen(__pyx_v_word); + + /* "pandas/parser.pyx":1375 + * # box it. new ref? + * size = strlen(word) + * pyval = PyUnicode_Decode(word, size, encoding, errors) # <<<<<<<<<<<<<< + * + * k = kh_put_strbox(table, word, &ret) + */ + __pyx_t_5 = PyUnicode_Decode(__pyx_v_word, __pyx_v_size, __pyx_v_encoding, __pyx_v_errors); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pyval, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1377 + * pyval = PyUnicode_Decode(word, size, encoding, errors) + * + * k = kh_put_strbox(table, word, &ret) # <<<<<<<<<<<<<< + * table.vals[k] = pyval + * + */ + __pyx_v_k = kh_put_strbox(__pyx_v_table, __pyx_v_word, (&__pyx_v_ret)); + + /* "pandas/parser.pyx":1378 + * + * k = kh_put_strbox(table, word, &ret) + * table.vals[k] = pyval # <<<<<<<<<<<<<< + * + * result[i] = pyval + */ + (__pyx_v_table->vals[__pyx_v_k]) = ((PyObject *)__pyx_v_pyval); + } + __pyx_L7:; + + /* "pandas/parser.pyx":1380 + * table.vals[k] = pyval + * + * result[i] = pyval # <<<<<<<<<<<<<< + * + * kh_destroy_strbox(table) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_15); + __Pyx_INCREF(__pyx_v_pyval); __Pyx_DECREF(*__pyx_t_15); + *__pyx_t_15 = __pyx_v_pyval; + __Pyx_GIVEREF(*__pyx_t_15); + __pyx_L3_continue:; + } + + /* "pandas/parser.pyx":1382 + * result[i] = pyval + * + * kh_destroy_strbox(table) # <<<<<<<<<<<<<< + * + * return result, na_count + */ + kh_destroy_strbox(__pyx_v_table); + + /* "pandas/parser.pyx":1384 + * kh_destroy_strbox(table) + * + * return result, na_count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1328 + * return result, na_count + * + * cdef _string_box_decode(parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * bint na_filter, kh_str_t *na_hashset, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._string_box_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_pyval); + __Pyx_XDECREF(__pyx_v_NA); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1387 + * + * + * cdef _to_fw_string(parser_t *parser, int col, int line_start, # <<<<<<<<<<<<<< + * int line_end, size_t width): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__to_fw_string(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, size_t __pyx_v_width) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + coliter_t __pyx_v_it; + char *__pyx_v_word; + char *__pyx_v_data; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_to_fw_string", 0); + + /* "pandas/parser.pyx":1396 + * ndarray result + * + * result = np.empty(line_end - line_start, dtype='|S%d' % width) # <<<<<<<<<<<<<< + * data = result.data + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_line_end - __pyx_v_line_start)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_S_d, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1397 + * + * result = np.empty(line_end - line_start, dtype='|S%d' % width) + * data = result.data # <<<<<<<<<<<<<< + * + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_v_data = ((char *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1399 + * data = result.data + * + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * for i in range(line_end - line_start): + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1401 + * coliter_setup(&it, parser, col, line_start) + * + * for i in range(line_end - line_start): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * strncpy(data, word, width) + */ + __pyx_t_6 = (__pyx_v_line_end - __pyx_v_line_start); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "pandas/parser.pyx":1402 + * + * for i in range(line_end - line_start): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * strncpy(data, word, width) + * data += width + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1403 + * for i in range(line_end - line_start): + * word = COLITER_NEXT(it) + * strncpy(data, word, width) # <<<<<<<<<<<<<< + * data += width + * + */ + strncpy(__pyx_v_data, __pyx_v_word, __pyx_v_width); + + /* "pandas/parser.pyx":1404 + * word = COLITER_NEXT(it) + * strncpy(data, word, width) + * data += width # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_width); + } + + /* "pandas/parser.pyx":1406 + * data += width + * + * return result # <<<<<<<<<<<<<< + * + * cdef char* cinf = b'inf' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/parser.pyx":1387 + * + * + * cdef _to_fw_string(parser_t *parser, int col, int line_start, # <<<<<<<<<<<<<< + * int line_end, size_t width): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.parser._to_fw_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1411 + * cdef char* cneginf = b'-inf' + * + * cdef _try_double(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset, object na_flist): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__try_double(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset, PyObject *__pyx_v_na_flist) { + int __pyx_v_error; + int __pyx_v_na_count; + CYTHON_UNUSED size_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + double *__pyx_v_data; + double __pyx_v_NA; + PyArrayObject *__pyx_v_result = 0; + khiter_t __pyx_v_k; + int __pyx_v_use_na_flist; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + double __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_try_double", 0); + + /* "pandas/parser.pyx":1414 + * bint na_filter, kh_str_t *na_hashset, object na_flist): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * size_t i, lines + * coliter_t it + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1419 + * char *word + * double *data + * double NA = na_values[np.float64] # <<<<<<<<<<<<<< + * ndarray result + * khiter_t k + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_NA = __pyx_t_4; + + /* "pandas/parser.pyx":1422 + * ndarray result + * khiter_t k + * bint use_na_flist = len(na_flist) > 0 # <<<<<<<<<<<<<< + * + * lines = line_end - line_start + */ + __pyx_t_5 = PyObject_Length(__pyx_v_na_flist); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_use_na_flist = (__pyx_t_5 > 0); + + /* "pandas/parser.pyx":1424 + * bint use_na_flist = len(na_flist) > 0 + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.float64) + * data = result.data + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1425 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.float64) # <<<<<<<<<<<<<< + * data = result.data + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/parser.pyx":1426 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.float64) + * data = result.data # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_v_data = ((double *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1427 + * result = np.empty(lines, dtype=np.float64) + * data = result.data + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1429 + * coliter_setup(&it, parser, col, line_start) + * + * if na_filter: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_8 = (__pyx_v_na_filter != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1430 + * + * if na_filter: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_9 = __pyx_v_lines; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/parser.pyx":1431 + * if na_filter: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(na_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1433 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1435 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * data[0] = NA + */ + __pyx_t_8 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1436 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * data[0] = NA + * else: + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1437 + * if k != na_hashset.n_buckets: + * na_count += 1 + * data[0] = NA # <<<<<<<<<<<<<< + * else: + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + */ + (__pyx_v_data[0]) = __pyx_v_NA; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/parser.pyx":1439 + * data[0] = NA + * else: + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) # <<<<<<<<<<<<<< + * if error != 1: + * if strcasecmp(word, cinf) == 0: + */ + __pyx_v_error = to_double(__pyx_v_word, __pyx_v_data, __pyx_v_parser->sci, __pyx_v_parser->decimal, __pyx_v_parser->thousands); + + /* "pandas/parser.pyx":1440 + * else: + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: # <<<<<<<<<<<<<< + * if strcasecmp(word, cinf) == 0: + * data[0] = INF + */ + __pyx_t_8 = ((__pyx_v_error != 1) != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1441 + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: + * if strcasecmp(word, cinf) == 0: # <<<<<<<<<<<<<< + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: + */ + __pyx_t_8 = ((strcasecmp(__pyx_v_word, __pyx_v_6pandas_6parser_cinf) == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1442 + * if error != 1: + * if strcasecmp(word, cinf) == 0: + * data[0] = INF # <<<<<<<<<<<<<< + * elif strcasecmp(word, cneginf) == 0: + * data[0] = NEGINF + */ + (__pyx_v_data[0]) = __pyx_v_6pandas_6parser_INF; + goto __pyx_L8; + } + + /* "pandas/parser.pyx":1443 + * if strcasecmp(word, cinf) == 0: + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: # <<<<<<<<<<<<<< + * data[0] = NEGINF + * else: + */ + __pyx_t_8 = ((strcasecmp(__pyx_v_word, __pyx_v_6pandas_6parser_cneginf) == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1444 + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: + * data[0] = NEGINF # <<<<<<<<<<<<<< + * else: + * return None, None + */ + (__pyx_v_data[0]) = __pyx_v_6pandas_6parser_NEGINF; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/parser.pyx":1446 + * data[0] = NEGINF + * else: + * return None, None # <<<<<<<<<<<<<< + * if use_na_flist: + * if data[0] in na_flist: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__26); + __pyx_r = __pyx_tuple__26; + goto __pyx_L0; + } + __pyx_L8:; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/parser.pyx":1447 + * else: + * return None, None + * if use_na_flist: # <<<<<<<<<<<<<< + * if data[0] in na_flist: + * na_count += 1 + */ + __pyx_t_8 = (__pyx_v_use_na_flist != 0); + if (__pyx_t_8) { + + /* "pandas/parser.pyx":1448 + * return None, None + * if use_na_flist: + * if data[0] in na_flist: # <<<<<<<<<<<<<< + * na_count += 1 + * data[0] = NA + */ + __pyx_t_7 = PyFloat_FromDouble((__pyx_v_data[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_t_7, __pyx_v_na_flist, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = (__pyx_t_8 != 0); + if (__pyx_t_11) { + + /* "pandas/parser.pyx":1449 + * if use_na_flist: + * if data[0] in na_flist: + * na_count += 1 # <<<<<<<<<<<<<< + * data[0] = NA + * data += 1 + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1450 + * if data[0] in na_flist: + * na_count += 1 + * data[0] = NA # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + (__pyx_v_data[0]) = __pyx_v_NA; + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + } + __pyx_L6:; + + /* "pandas/parser.pyx":1451 + * na_count += 1 + * data[0] = NA + * data += 1 # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_v_data = (__pyx_v_data + 1); + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1453 + * data += 1 + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + */ + __pyx_t_9 = __pyx_v_lines; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/parser.pyx":1454 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1455 + * for i in range(lines): + * word = COLITER_NEXT(it) + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) # <<<<<<<<<<<<<< + * if error != 1: + * if strcasecmp(word, cinf) == 0: + */ + __pyx_v_error = to_double(__pyx_v_word, __pyx_v_data, __pyx_v_parser->sci, __pyx_v_parser->decimal, __pyx_v_parser->thousands); + + /* "pandas/parser.pyx":1456 + * word = COLITER_NEXT(it) + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: # <<<<<<<<<<<<<< + * if strcasecmp(word, cinf) == 0: + * data[0] = INF + */ + __pyx_t_11 = ((__pyx_v_error != 1) != 0); + if (__pyx_t_11) { + + /* "pandas/parser.pyx":1457 + * error = to_double(word, data, parser.sci, parser.decimal, parser.thousands) + * if error != 1: + * if strcasecmp(word, cinf) == 0: # <<<<<<<<<<<<<< + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: + */ + __pyx_t_11 = ((strcasecmp(__pyx_v_word, __pyx_v_6pandas_6parser_cinf) == 0) != 0); + if (__pyx_t_11) { + + /* "pandas/parser.pyx":1458 + * if error != 1: + * if strcasecmp(word, cinf) == 0: + * data[0] = INF # <<<<<<<<<<<<<< + * elif strcasecmp(word, cneginf) == 0: + * data[0] = NEGINF + */ + (__pyx_v_data[0]) = __pyx_v_6pandas_6parser_INF; + goto __pyx_L14; + } + + /* "pandas/parser.pyx":1459 + * if strcasecmp(word, cinf) == 0: + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: # <<<<<<<<<<<<<< + * data[0] = NEGINF + * else: + */ + __pyx_t_11 = ((strcasecmp(__pyx_v_word, __pyx_v_6pandas_6parser_cneginf) == 0) != 0); + if (__pyx_t_11) { + + /* "pandas/parser.pyx":1460 + * data[0] = INF + * elif strcasecmp(word, cneginf) == 0: + * data[0] = NEGINF # <<<<<<<<<<<<<< + * else: + * return None, None + */ + (__pyx_v_data[0]) = __pyx_v_6pandas_6parser_NEGINF; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/parser.pyx":1462 + * data[0] = NEGINF + * else: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__27); + __pyx_r = __pyx_tuple__27; + goto __pyx_L0; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/parser.pyx":1463 + * else: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * + * return result, na_count + */ + __pyx_v_data = (__pyx_v_data + 1); + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1465 + * data += 1 + * + * return result, na_count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1411 + * cdef char* cneginf = b'-inf' + * + * cdef _try_double(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset, object na_flist): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.parser._try_double", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1468 + * + * + * cdef _try_int64(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__try_int64(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + int __pyx_v_error; + int __pyx_v_na_count; + size_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + __pyx_t_5numpy_int64_t *__pyx_v_data; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_int64_t __pyx_v_NA; + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + size_t __pyx_t_8; + size_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_try_int64", 0); + + /* "pandas/parser.pyx":1471 + * bint na_filter, kh_str_t *na_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * size_t i, lines + * coliter_t it + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1478 + * ndarray result + * + * int64_t NA = na_values[np.int64] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_NA = __pyx_t_4; + + /* "pandas/parser.pyx":1481 + * khiter_t k + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.int64) + * data = result.data + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1482 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.int64) # <<<<<<<<<<<<<< + * data = result.data + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1483 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.int64) + * data = result.data # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_v_data = ((__pyx_t_5numpy_int64_t *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1484 + * result = np.empty(lines, dtype=np.int64) + * data = result.data + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1486 + * coliter_setup(&it, parser, col, line_start) + * + * if na_filter: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_7 = (__pyx_v_na_filter != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1487 + * + * if na_filter: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * k = kh_get_str(na_hashset, word) + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1488 + * if na_filter: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * k = kh_get_str(na_hashset, word) + * # in the hash table + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1489 + * for i in range(lines): + * word = COLITER_NEXT(it) + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1491 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * data[i] = NA + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1492 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * data[i] = NA + * continue + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1493 + * if k != na_hashset.n_buckets: + * na_count += 1 + * data[i] = NA # <<<<<<<<<<<<<< + * continue + * + */ + (__pyx_v_data[__pyx_v_i]) = __pyx_v_NA; + + /* "pandas/parser.pyx":1494 + * na_count += 1 + * data[i] = NA + * continue # <<<<<<<<<<<<<< + * + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1496 + * continue + * + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, # <<<<<<<<<<<<<< + * &error, parser.thousands) + * if error != 0: + */ + (__pyx_v_data[__pyx_v_i]) = str_to_int64(__pyx_v_word, INT64_MIN, INT64_MAX, (&__pyx_v_error), __pyx_v_parser->thousands); + + /* "pandas/parser.pyx":1498 + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + * &error, parser.thousands) + * if error != 0: # <<<<<<<<<<<<<< + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1499 + * &error, parser.thousands) + * if error != 0: + * if error == ERROR_OVERFLOW: # <<<<<<<<<<<<<< + * raise OverflowError(word) + * + */ + __pyx_t_7 = ((__pyx_v_error == ERROR_OVERFLOW) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1500 + * if error != 0: + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) # <<<<<<<<<<<<<< + * + * return None, None + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_OverflowError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1502 + * raise OverflowError(word) + * + * return None, None # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__28); + __pyx_r = __pyx_tuple__28; + goto __pyx_L0; + } + __pyx_L4_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1504 + * return None, None + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1505 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + * &error, parser.thousands) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1506 + * for i in range(lines): + * word = COLITER_NEXT(it) + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, # <<<<<<<<<<<<<< + * &error, parser.thousands) + * if error != 0: + */ + (__pyx_v_data[__pyx_v_i]) = str_to_int64(__pyx_v_word, INT64_MIN, INT64_MAX, (&__pyx_v_error), __pyx_v_parser->thousands); + + /* "pandas/parser.pyx":1508 + * data[i] = str_to_int64(word, INT64_MIN, INT64_MAX, + * &error, parser.thousands) + * if error != 0: # <<<<<<<<<<<<<< + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1509 + * &error, parser.thousands) + * if error != 0: + * if error == ERROR_OVERFLOW: # <<<<<<<<<<<<<< + * raise OverflowError(word) + * return None, None + */ + __pyx_t_7 = ((__pyx_v_error == ERROR_OVERFLOW) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1510 + * if error != 0: + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) # <<<<<<<<<<<<<< + * return None, None + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OverflowError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1511 + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) + * return None, None # <<<<<<<<<<<<<< + * + * return result, na_count + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__29); + __pyx_r = __pyx_tuple__29; + goto __pyx_L0; + } + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1513 + * return None, None + * + * return result, na_count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1468 + * + * + * cdef _try_int64(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser._try_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1516 + * + * + * cdef _try_bool(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__try_bool(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset) { + int __pyx_v_error; + int __pyx_v_na_count; + CYTHON_UNUSED size_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + __pyx_t_5numpy_uint8_t *__pyx_v_data; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_uint8_t __pyx_v_NA; + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_uint8_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + size_t __pyx_t_8; + size_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_try_bool", 0); + + /* "pandas/parser.pyx":1519 + * bint na_filter, kh_str_t *na_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * size_t i, lines + * coliter_t it + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1526 + * ndarray result + * + * uint8_t NA = na_values[np.bool_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_uint8(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_NA = __pyx_t_4; + + /* "pandas/parser.pyx":1529 + * khiter_t k + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.uint8) + * data = result.data + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1530 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.uint8) # <<<<<<<<<<<<<< + * data = result.data + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1531 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.uint8) + * data = result.data # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_v_data = ((__pyx_t_5numpy_uint8_t *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1532 + * result = np.empty(lines, dtype=np.uint8) + * data = result.data + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1534 + * coliter_setup(&it, parser, col, line_start) + * + * if na_filter: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_7 = (__pyx_v_na_filter != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1535 + * + * if na_filter: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1536 + * if na_filter: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(na_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1538 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1540 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * data[0] = NA + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1541 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * data[0] = NA + * data += 1 + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1542 + * if k != na_hashset.n_buckets: + * na_count += 1 + * data[0] = NA # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = __pyx_v_NA; + + /* "pandas/parser.pyx":1543 + * na_count += 1 + * data[0] = NA + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1544 + * data[0] = NA + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * error = to_boolean(word, data) + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1546 + * continue + * + * error = to_boolean(word, data) # <<<<<<<<<<<<<< + * if error != 0: + * return None, None + */ + __pyx_v_error = to_boolean(__pyx_v_word, __pyx_v_data); + + /* "pandas/parser.pyx":1547 + * + * error = to_boolean(word, data) + * if error != 0: # <<<<<<<<<<<<<< + * return None, None + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1548 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__30); + __pyx_r = __pyx_tuple__30; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1549 + * if error != 0: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_v_data = (__pyx_v_data + 1); + __pyx_L4_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1551 + * data += 1 + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1552 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * error = to_boolean(word, data) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1554 + * word = COLITER_NEXT(it) + * + * error = to_boolean(word, data) # <<<<<<<<<<<<<< + * if error != 0: + * return None, None + */ + __pyx_v_error = to_boolean(__pyx_v_word, __pyx_v_data); + + /* "pandas/parser.pyx":1555 + * + * error = to_boolean(word, data) + * if error != 0: # <<<<<<<<<<<<<< + * return None, None + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1556 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__31); + __pyx_r = __pyx_tuple__31; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1557 + * if error != 0: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * + * return result.view(np.bool_), na_count + */ + __pyx_v_data = (__pyx_v_data + 1); + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1559 + * data += 1 + * + * return result.view(np.bool_), na_count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1516 + * + * + * cdef _try_bool(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser._try_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1562 + * + * + * cdef _try_bool_flex(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset, + * kh_str_t *true_hashset, kh_str_t *false_hashset): + */ + +static PyObject *__pyx_f_6pandas_6parser__try_bool_flex(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, int __pyx_v_na_filter, kh_str_t *__pyx_v_na_hashset, kh_str_t *__pyx_v_true_hashset, kh_str_t *__pyx_v_false_hashset) { + int __pyx_v_error; + int __pyx_v_na_count; + CYTHON_UNUSED size_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + __pyx_t_5numpy_uint8_t *__pyx_v_data; + PyArrayObject *__pyx_v_result = 0; + __pyx_t_5numpy_uint8_t __pyx_v_NA; + khiter_t __pyx_v_k; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_uint8_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + size_t __pyx_t_8; + size_t __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_try_bool_flex", 0); + + /* "pandas/parser.pyx":1566 + * kh_str_t *true_hashset, kh_str_t *false_hashset): + * cdef: + * int error, na_count = 0 # <<<<<<<<<<<<<< + * size_t i, lines + * coliter_t it + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1573 + * ndarray result + * + * uint8_t NA = na_values[np.bool_] # <<<<<<<<<<<<<< + * khiter_t k + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_uint8(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_NA = __pyx_t_4; + + /* "pandas/parser.pyx":1576 + * khiter_t k + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.uint8) + * data = result.data + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1577 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.uint8) # <<<<<<<<<<<<<< + * data = result.data + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1578 + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.uint8) + * data = result.data # <<<<<<<<<<<<<< + * coliter_setup(&it, parser, col, line_start) + * + */ + __pyx_v_data = ((__pyx_t_5numpy_uint8_t *)__pyx_v_result->data); + + /* "pandas/parser.pyx":1579 + * result = np.empty(lines, dtype=np.uint8) + * data = result.data + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if na_filter: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1581 + * coliter_setup(&it, parser, col, line_start) + * + * if na_filter: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_7 = (__pyx_v_na_filter != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1582 + * + * if na_filter: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1583 + * if na_filter: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(na_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1585 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1587 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * na_count += 1 + * data[0] = NA + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1588 + * # in the hash table + * if k != na_hashset.n_buckets: + * na_count += 1 # <<<<<<<<<<<<<< + * data[0] = NA + * data += 1 + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1589 + * if k != na_hashset.n_buckets: + * na_count += 1 + * data[0] = NA # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = __pyx_v_NA; + + /* "pandas/parser.pyx":1590 + * na_count += 1 + * data[0] = NA + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1591 + * data[0] = NA + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_str(true_hashset, word) + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1593 + * continue + * + * k = kh_get_str(true_hashset, word) # <<<<<<<<<<<<<< + * if k != true_hashset.n_buckets: + * data[0] = 1 + */ + __pyx_v_k = kh_get_str(__pyx_v_true_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1594 + * + * k = kh_get_str(true_hashset, word) + * if k != true_hashset.n_buckets: # <<<<<<<<<<<<<< + * data[0] = 1 + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_true_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1595 + * k = kh_get_str(true_hashset, word) + * if k != true_hashset.n_buckets: + * data[0] = 1 # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = 1; + + /* "pandas/parser.pyx":1596 + * if k != true_hashset.n_buckets: + * data[0] = 1 + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1597 + * data[0] = 1 + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_str(false_hashset, word) + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1599 + * continue + * + * k = kh_get_str(false_hashset, word) # <<<<<<<<<<<<<< + * if k != false_hashset.n_buckets: + * data[0] = 0 + */ + __pyx_v_k = kh_get_str(__pyx_v_false_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1600 + * + * k = kh_get_str(false_hashset, word) + * if k != false_hashset.n_buckets: # <<<<<<<<<<<<<< + * data[0] = 0 + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_false_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1601 + * k = kh_get_str(false_hashset, word) + * if k != false_hashset.n_buckets: + * data[0] = 0 # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = 0; + + /* "pandas/parser.pyx":1602 + * if k != false_hashset.n_buckets: + * data[0] = 0 + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1603 + * data[0] = 0 + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * error = to_boolean(word, data) + */ + goto __pyx_L4_continue; + } + + /* "pandas/parser.pyx":1605 + * continue + * + * error = to_boolean(word, data) # <<<<<<<<<<<<<< + * if error != 0: + * return None, None + */ + __pyx_v_error = to_boolean(__pyx_v_word, __pyx_v_data); + + /* "pandas/parser.pyx":1606 + * + * error = to_boolean(word, data) + * if error != 0: # <<<<<<<<<<<<<< + * return None, None + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1607 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__32); + __pyx_r = __pyx_tuple__32; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1608 + * if error != 0: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_v_data = (__pyx_v_data + 1); + __pyx_L4_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1610 + * data += 1 + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_8 = __pyx_v_lines; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/parser.pyx":1611 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(true_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1613 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(true_hashset, word) # <<<<<<<<<<<<<< + * if k != true_hashset.n_buckets: + * data[0] = 1 + */ + __pyx_v_k = kh_get_str(__pyx_v_true_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1614 + * + * k = kh_get_str(true_hashset, word) + * if k != true_hashset.n_buckets: # <<<<<<<<<<<<<< + * data[0] = 1 + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_true_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1615 + * k = kh_get_str(true_hashset, word) + * if k != true_hashset.n_buckets: + * data[0] = 1 # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = 1; + + /* "pandas/parser.pyx":1616 + * if k != true_hashset.n_buckets: + * data[0] = 1 + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1617 + * data[0] = 1 + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * k = kh_get_str(false_hashset, word) + */ + goto __pyx_L10_continue; + } + + /* "pandas/parser.pyx":1619 + * continue + * + * k = kh_get_str(false_hashset, word) # <<<<<<<<<<<<<< + * if k != false_hashset.n_buckets: + * data[0] = 0 + */ + __pyx_v_k = kh_get_str(__pyx_v_false_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1620 + * + * k = kh_get_str(false_hashset, word) + * if k != false_hashset.n_buckets: # <<<<<<<<<<<<<< + * data[0] = 0 + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_k != __pyx_v_false_hashset->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1621 + * k = kh_get_str(false_hashset, word) + * if k != false_hashset.n_buckets: + * data[0] = 0 # <<<<<<<<<<<<<< + * data += 1 + * continue + */ + (__pyx_v_data[0]) = 0; + + /* "pandas/parser.pyx":1622 + * if k != false_hashset.n_buckets: + * data[0] = 0 + * data += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_data = (__pyx_v_data + 1); + + /* "pandas/parser.pyx":1623 + * data[0] = 0 + * data += 1 + * continue # <<<<<<<<<<<<<< + * + * error = to_boolean(word, data) + */ + goto __pyx_L10_continue; + } + + /* "pandas/parser.pyx":1625 + * continue + * + * error = to_boolean(word, data) # <<<<<<<<<<<<<< + * if error != 0: + * return None, None + */ + __pyx_v_error = to_boolean(__pyx_v_word, __pyx_v_data); + + /* "pandas/parser.pyx":1626 + * + * error = to_boolean(word, data) + * if error != 0: # <<<<<<<<<<<<<< + * return None, None + * data += 1 + */ + __pyx_t_7 = ((__pyx_v_error != 0) != 0); + if (__pyx_t_7) { + + /* "pandas/parser.pyx":1627 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_tuple__33); + __pyx_r = __pyx_tuple__33; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1628 + * if error != 0: + * return None, None + * data += 1 # <<<<<<<<<<<<<< + * + * return result.view(np.bool_), na_count + */ + __pyx_v_data = (__pyx_v_data + 1); + __pyx_L10_continue:; + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1630 + * data += 1 + * + * return result.view(np.bool_), na_count # <<<<<<<<<<<<<< + * + * cdef _get_na_mask(parser_t *parser, int col, int line_start, int line_end, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_na_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1562 + * + * + * cdef _try_bool_flex(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * bint na_filter, kh_str_t *na_hashset, + * kh_str_t *true_hashset, kh_str_t *false_hashset): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.parser._try_bool_flex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1632 + * return result.view(np.bool_), na_count + * + * cdef _get_na_mask(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * kh_str_t *na_hashset): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__get_na_mask(parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, kh_str_t *__pyx_v_na_hashset) { + Py_ssize_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + PyArrayObject *__pyx_v_result = 0; + khiter_t __pyx_v_k; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_na_mask", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1643 + * khiter_t k + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.bool_) + * + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1644 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.bool_) # <<<<<<<<<<<<<< + * + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1646 + * result = np.empty(lines, dtype=np.bool_) + * + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1647 + * + * coliter_setup(&it, parser, col, line_start) + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * + */ + __pyx_t_11 = __pyx_v_lines; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1648 + * coliter_setup(&it, parser, col, line_start) + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * + * k = kh_get_str(na_hashset, word) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1650 + * word = COLITER_NEXT(it) + * + * k = kh_get_str(na_hashset, word) # <<<<<<<<<<<<<< + * # in the hash table + * if k != na_hashset.n_buckets: + */ + __pyx_v_k = kh_get_str(__pyx_v_na_hashset, __pyx_v_word); + + /* "pandas/parser.pyx":1652 + * k = kh_get_str(na_hashset, word) + * # in the hash table + * if k != na_hashset.n_buckets: # <<<<<<<<<<<<<< + * result[i] = 1 + * else: + */ + __pyx_t_13 = ((__pyx_v_k != __pyx_v_na_hashset->n_buckets) != 0); + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1653 + * # in the hash table + * if k != na_hashset.n_buckets: + * result[i] = 1 # <<<<<<<<<<<<<< + * else: + * result[i] = 0 + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides) = 1; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/parser.pyx":1655 + * result[i] = 1 + * else: + * result[i] = 0 # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = 0; + } + __pyx_L5:; + } + + /* "pandas/parser.pyx":1657 + * result[i] = 0 + * + * return result # <<<<<<<<<<<<<< + * + * cdef kh_str_t* kset_from_list(list values) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/parser.pyx":1632 + * return result.view(np.bool_), na_count + * + * cdef _get_na_mask(parser_t *parser, int col, int line_start, int line_end, # <<<<<<<<<<<<<< + * kh_str_t *na_hashset): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._get_na_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1659 + * return result + * + * cdef kh_str_t* kset_from_list(list values) except NULL: # <<<<<<<<<<<<<< + * # caller takes responsibility for freeing the hash table + * cdef: + */ + +static kh_str_t *__pyx_f_6pandas_6parser_kset_from_list(PyObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + CYTHON_UNUSED khiter_t __pyx_v_k; + kh_str_t *__pyx_v_table; + int __pyx_v_ret; + PyObject *__pyx_v_val = 0; + kh_str_t *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char *__pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("kset_from_list", 0); + + /* "pandas/parser.pyx":1665 + * khiter_t k + * kh_str_t *table + * int ret = 0 # <<<<<<<<<<<<<< + * + * object val + */ + __pyx_v_ret = 0; + + /* "pandas/parser.pyx":1669 + * object val + * + * table = kh_init_str() # <<<<<<<<<<<<<< + * + * for i in range(len(values)): + */ + __pyx_v_table = kh_init_str(); + + /* "pandas/parser.pyx":1671 + * table = kh_init_str() + * + * for i in range(len(values)): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + if (unlikely(__pyx_v_values == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + + /* "pandas/parser.pyx":1672 + * + * for i in range(len(values)): + * val = values[i] # <<<<<<<<<<<<<< + * + * # None creeps in sometimes, which isn't possible here + */ + if (unlikely(__pyx_v_values == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_values, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1675 + * + * # None creeps in sometimes, which isn't possible here + * if not PyBytes_Check(val): # <<<<<<<<<<<<<< + * raise Exception('Must be all encoded bytes') + * + */ + __pyx_t_4 = ((!(PyBytes_Check(__pyx_v_val) != 0)) != 0); + if (__pyx_t_4) { + + /* "pandas/parser.pyx":1676 + * # None creeps in sometimes, which isn't possible here + * if not PyBytes_Check(val): + * raise Exception('Must be all encoded bytes') # <<<<<<<<<<<<<< + * + * k = kh_put_str(table, PyBytes_AsString(val), &ret) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/parser.pyx":1678 + * raise Exception('Must be all encoded bytes') + * + * k = kh_put_str(table, PyBytes_AsString(val), &ret) # <<<<<<<<<<<<<< + * + * return table + */ + __pyx_t_5 = PyBytes_AsString(__pyx_v_val); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_k = kh_put_str(__pyx_v_table, __pyx_t_5, (&__pyx_v_ret)); + } + + /* "pandas/parser.pyx":1680 + * k = kh_put_str(table, PyBytes_AsString(val), &ret) + * + * return table # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_table; + goto __pyx_L0; + + /* "pandas/parser.pyx":1659 + * return result + * + * cdef kh_str_t* kset_from_list(list values) except NULL: # <<<<<<<<<<<<<< + * # caller takes responsibility for freeing the hash table + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.parser.kset_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1689 + * + * + * cdef raise_parser_error(object base, parser_t *parser): # <<<<<<<<<<<<<< + * message = '%s. C error: ' % base + * if parser.error_msg != NULL: + */ + +static PyObject *__pyx_f_6pandas_6parser_raise_parser_error(PyObject *__pyx_v_base, parser_t *__pyx_v_parser) { + PyObject *__pyx_v_message = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + char *__pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("raise_parser_error", 0); + + /* "pandas/parser.pyx":1690 + * + * cdef raise_parser_error(object base, parser_t *parser): + * message = '%s. C error: ' % base # <<<<<<<<<<<<<< + * if parser.error_msg != NULL: + * if PY3: + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_C_error, __pyx_v_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_message = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1691 + * cdef raise_parser_error(object base, parser_t *parser): + * message = '%s. C error: ' % base + * if parser.error_msg != NULL: # <<<<<<<<<<<<<< + * if PY3: + * message += parser.error_msg.decode('utf-8') + */ + __pyx_t_2 = ((__pyx_v_parser->error_msg != NULL) != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1692 + * message = '%s. C error: ' % base + * if parser.error_msg != NULL: + * if PY3: # <<<<<<<<<<<<<< + * message += parser.error_msg.decode('utf-8') + * else: + */ + __pyx_t_2 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1693 + * if parser.error_msg != NULL: + * if PY3: + * message += parser.error_msg.decode('utf-8') # <<<<<<<<<<<<<< + * else: + * message += parser.error_msg + */ + __pyx_t_3 = __pyx_v_parser->error_msg; + __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_3, 0, strlen(__pyx_t_3), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_message, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/parser.pyx":1695 + * message += parser.error_msg.decode('utf-8') + * else: + * message += parser.error_msg # <<<<<<<<<<<<<< + * else: + * message += 'no error message set' + */ + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_parser->error_msg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1697 + * message += parser.error_msg + * else: + * message += 'no error message set' # <<<<<<<<<<<<<< + * + * raise CParserError(message) + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_kp_s_no_error_message_set); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":1699 + * message += 'no error message set' + * + * raise CParserError(message) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CParserError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_message); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_message); + __Pyx_GIVEREF(__pyx_v_message); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1689 + * + * + * cdef raise_parser_error(object base, parser_t *parser): # <<<<<<<<<<<<<< + * message = '%s. C error: ' % base + * if parser.error_msg != NULL: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.parser.raise_parser_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __Pyx_XDECREF(__pyx_v_message); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1702 + * + * + * def downcast_int64(ndarray[int64_t] arr, bint use_unsigned=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_7downcast_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_7downcast_int64 = {__Pyx_NAMESTR("downcast_int64"), (PyCFunction)__pyx_pw_6pandas_6parser_7downcast_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_7downcast_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_use_unsigned; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("downcast_int64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_use_unsigned,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_unsigned); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "downcast_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + if (values[1]) { + __pyx_v_use_unsigned = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_use_unsigned == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_use_unsigned = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("downcast_int64", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser.downcast_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_6parser_6downcast_int64(__pyx_self, __pyx_v_arr, __pyx_v_use_unsigned); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_6downcast_int64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_use_unsigned) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_mx; + __pyx_t_5numpy_int64_t __pyx_v_mn; + __pyx_t_5numpy_int64_t __pyx_v_NA; + __pyx_t_5numpy_int64_t __pyx_v_val; + PyArrayObject *__pyx_v_mask = 0; + int __pyx_v_na_count; + PyObject *__pyx_v__mask = NULL; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mask; + __Pyx_Buffer __pyx_pybuffer_mask; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_t_17; + int __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("downcast_int64", 0); + __pyx_pybuffer_mask.pybuffer.buf = NULL; + __pyx_pybuffer_mask.refcount = 0; + __pyx_pybuffernd_mask.data = NULL; + __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/parser.pyx":1704 + * def downcast_int64(ndarray[int64_t] arr, bint use_unsigned=0): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * int64_t mx = INT64_MIN + 1, mn = INT64_MAX + * int64_t NA = na_values[np.int64] + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/parser.pyx":1705 + * cdef: + * Py_ssize_t i, n = len(arr) + * int64_t mx = INT64_MIN + 1, mn = INT64_MAX # <<<<<<<<<<<<<< + * int64_t NA = na_values[np.int64] + * int64_t val + */ + __pyx_v_mx = (INT64_MIN + 1); + __pyx_v_mn = INT64_MAX; + + /* "pandas/parser.pyx":1706 + * Py_ssize_t i, n = len(arr) + * int64_t mx = INT64_MIN + 1, mn = INT64_MAX + * int64_t NA = na_values[np.int64] # <<<<<<<<<<<<<< + * int64_t val + * ndarray[uint8_t] mask + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_t_4); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_NA = __pyx_t_5; + + /* "pandas/parser.pyx":1709 + * int64_t val + * ndarray[uint8_t] mask + * int na_count = 0 # <<<<<<<<<<<<<< + * + * _mask = np.empty(n, dtype=bool) + */ + __pyx_v_na_count = 0; + + /* "pandas/parser.pyx":1711 + * int na_count = 0 + * + * _mask = np.empty(n, dtype=bool) # <<<<<<<<<<<<<< + * mask = _mask.view(np.uint8) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v__mask = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1712 + * + * _mask = np.empty(n, dtype=bool) + * mask = _mask.view(np.uint8) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__mask, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_mask = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1714 + * mask = _mask.view(np.uint8) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/parser.pyx":1715 + * + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * + * if val == NA: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/parser.pyx":1717 + * val = arr[i] + * + * if val == NA: # <<<<<<<<<<<<<< + * mask[i] = 1 + * na_count += 1 + */ + __pyx_t_14 = ((__pyx_v_val == __pyx_v_NA) != 0); + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1718 + * + * if val == NA: + * mask[i] = 1 # <<<<<<<<<<<<<< + * na_count += 1 + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_mask.diminfo[0].strides) = 1; + + /* "pandas/parser.pyx":1719 + * if val == NA: + * mask[i] = 1 + * na_count += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_na_count = (__pyx_v_na_count + 1); + + /* "pandas/parser.pyx":1720 + * mask[i] = 1 + * na_count += 1 + * continue # <<<<<<<<<<<<<< + * + * # not NA + */ + goto __pyx_L3_continue; + } + + /* "pandas/parser.pyx":1723 + * + * # not NA + * mask[i] = 0 # <<<<<<<<<<<<<< + * + * if val > mx: + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_mask.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_mask.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_mask.diminfo[0].strides) = 0; + + /* "pandas/parser.pyx":1725 + * mask[i] = 0 + * + * if val > mx: # <<<<<<<<<<<<<< + * mx = val + * + */ + __pyx_t_14 = ((__pyx_v_val > __pyx_v_mx) != 0); + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1726 + * + * if val > mx: + * mx = val # <<<<<<<<<<<<<< + * + * if val < mn: + */ + __pyx_v_mx = __pyx_v_val; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/parser.pyx":1728 + * mx = val + * + * if val < mn: # <<<<<<<<<<<<<< + * mn = val + * + */ + __pyx_t_14 = ((__pyx_v_val < __pyx_v_mn) != 0); + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1729 + * + * if val < mn: + * mn = val # <<<<<<<<<<<<<< + * + * if mn >= 0 and use_unsigned: + */ + __pyx_v_mn = __pyx_v_val; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_L3_continue:; + } + + /* "pandas/parser.pyx":1731 + * mn = val + * + * if mn >= 0 and use_unsigned: # <<<<<<<<<<<<<< + * if mx <= UINT8_MAX - 1: + * result = arr.astype(np.uint8) + */ + __pyx_t_14 = ((__pyx_v_mn >= 0) != 0); + if (__pyx_t_14) { + __pyx_t_17 = (__pyx_v_use_unsigned != 0); + } else { + __pyx_t_17 = __pyx_t_14; + } + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1732 + * + * if mn >= 0 and use_unsigned: + * if mx <= UINT8_MAX - 1: # <<<<<<<<<<<<<< + * result = arr.astype(np.uint8) + * if na_count: + */ + __pyx_t_17 = ((__pyx_v_mx <= (UINT8_MAX - 1)) != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1733 + * if mn >= 0 and use_unsigned: + * if mx <= UINT8_MAX - 1: + * result = arr.astype(np.uint8) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.uint8]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1734 + * if mx <= UINT8_MAX - 1: + * result = arr.astype(np.uint8) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.uint8]) + * return result + */ + __pyx_t_17 = (__pyx_v_na_count != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1735 + * result = arr.astype(np.uint8) + * if na_count: + * np.putmask(result, _mask, na_values[np.uint8]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_6, __pyx_t_4); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/parser.pyx":1736 + * if na_count: + * np.putmask(result, _mask, na_values[np.uint8]) + * return result # <<<<<<<<<<<<<< + * + * if mx <= UINT16_MAX - 1: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1738 + * return result + * + * if mx <= UINT16_MAX - 1: # <<<<<<<<<<<<<< + * result = arr.astype(np.uint16) + * if na_count: + */ + __pyx_t_17 = ((__pyx_v_mx <= (UINT16_MAX - 1)) != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1739 + * + * if mx <= UINT16_MAX - 1: + * result = arr.astype(np.uint16) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.uint16]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1740 + * if mx <= UINT16_MAX - 1: + * result = arr.astype(np.uint16) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.uint16]) + * return result + */ + __pyx_t_17 = (__pyx_v_na_count != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1741 + * result = arr.astype(np.uint16) + * if na_count: + * np.putmask(result, _mask, na_values[np.uint16]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/parser.pyx":1742 + * if na_count: + * np.putmask(result, _mask, na_values[np.uint16]) + * return result # <<<<<<<<<<<<<< + * + * if mx <= UINT32_MAX - 1: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1744 + * return result + * + * if mx <= UINT32_MAX - 1: # <<<<<<<<<<<<<< + * result = arr.astype(np.uint32) + * if na_count: + */ + __pyx_t_17 = ((__pyx_v_mx <= (UINT32_MAX - 1)) != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1745 + * + * if mx <= UINT32_MAX - 1: + * result = arr.astype(np.uint32) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.uint32]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1746 + * if mx <= UINT32_MAX - 1: + * result = arr.astype(np.uint32) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.uint32]) + * return result + */ + __pyx_t_17 = (__pyx_v_na_count != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1747 + * result = arr.astype(np.uint32) + * if na_count: + * np.putmask(result, _mask, na_values[np.uint32]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_putmask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/parser.pyx":1748 + * if na_count: + * np.putmask(result, _mask, na_values[np.uint32]) + * return result # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/parser.pyx":1751 + * + * else: + * if mn >= INT8_MIN + 1 and mx <= INT8_MAX: # <<<<<<<<<<<<<< + * result = arr.astype(np.int8) + * if na_count: + */ + __pyx_t_17 = ((__pyx_v_mn >= (INT8_MIN + 1)) != 0); + if (__pyx_t_17) { + __pyx_t_14 = ((__pyx_v_mx <= INT8_MAX) != 0); + __pyx_t_18 = __pyx_t_14; + } else { + __pyx_t_18 = __pyx_t_17; + } + if (__pyx_t_18) { + + /* "pandas/parser.pyx":1752 + * else: + * if mn >= INT8_MIN + 1 and mx <= INT8_MAX: + * result = arr.astype(np.int8) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.int8]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1753 + * if mn >= INT8_MIN + 1 and mx <= INT8_MAX: + * result = arr.astype(np.int8) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.int8]) + * return result + */ + __pyx_t_18 = (__pyx_v_na_count != 0); + if (__pyx_t_18) { + + /* "pandas/parser.pyx":1754 + * result = arr.astype(np.int8) + * if na_count: + * np.putmask(result, _mask, na_values[np.int8]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_putmask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_6, __pyx_t_4); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/parser.pyx":1755 + * if na_count: + * np.putmask(result, _mask, na_values[np.int8]) + * return result # <<<<<<<<<<<<<< + * + * if mn >= INT16_MIN + 1 and mx <= INT16_MAX: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1757 + * return result + * + * if mn >= INT16_MIN + 1 and mx <= INT16_MAX: # <<<<<<<<<<<<<< + * result = arr.astype(np.int16) + * if na_count: + */ + __pyx_t_18 = ((__pyx_v_mn >= (INT16_MIN + 1)) != 0); + if (__pyx_t_18) { + __pyx_t_17 = ((__pyx_v_mx <= INT16_MAX) != 0); + __pyx_t_14 = __pyx_t_17; + } else { + __pyx_t_14 = __pyx_t_18; + } + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1758 + * + * if mn >= INT16_MIN + 1 and mx <= INT16_MAX: + * result = arr.astype(np.int16) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.int16]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1759 + * if mn >= INT16_MIN + 1 and mx <= INT16_MAX: + * result = arr.astype(np.int16) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.int16]) + * return result + */ + __pyx_t_14 = (__pyx_v_na_count != 0); + if (__pyx_t_14) { + + /* "pandas/parser.pyx":1760 + * result = arr.astype(np.int16) + * if na_count: + * np.putmask(result, _mask, na_values[np.int16]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L18; + } + __pyx_L18:; + + /* "pandas/parser.pyx":1761 + * if na_count: + * np.putmask(result, _mask, na_values[np.int16]) + * return result # <<<<<<<<<<<<<< + * + * if mn >= INT32_MIN + 1 and mx <= INT32_MAX: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1763 + * return result + * + * if mn >= INT32_MIN + 1 and mx <= INT32_MAX: # <<<<<<<<<<<<<< + * result = arr.astype(np.int32) + * if na_count: + */ + __pyx_t_14 = ((__pyx_v_mn >= (INT32_MIN + 1)) != 0); + if (__pyx_t_14) { + __pyx_t_18 = ((__pyx_v_mx <= INT32_MAX) != 0); + __pyx_t_17 = __pyx_t_18; + } else { + __pyx_t_17 = __pyx_t_14; + } + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1764 + * + * if mn >= INT32_MIN + 1 and mx <= INT32_MAX: + * result = arr.astype(np.int32) # <<<<<<<<<<<<<< + * if na_count: + * np.putmask(result, _mask, na_values[np.int32]) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1765 + * if mn >= INT32_MIN + 1 and mx <= INT32_MAX: + * result = arr.astype(np.int32) + * if na_count: # <<<<<<<<<<<<<< + * np.putmask(result, _mask, na_values[np.int32]) + * return result + */ + __pyx_t_17 = (__pyx_v_na_count != 0); + if (__pyx_t_17) { + + /* "pandas/parser.pyx":1766 + * result = arr.astype(np.int32) + * if na_count: + * np.putmask(result, _mask, na_values[np.int32]) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_putmask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v__mask); + __Pyx_GIVEREF(__pyx_v__mask); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/parser.pyx":1767 + * if na_count: + * np.putmask(result, _mask, na_values[np.int32]) + * return result # <<<<<<<<<<<<<< + * + * return arr + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + } + __pyx_L8:; + + /* "pandas/parser.pyx":1769 + * return result + * + * return arr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/parser.pyx":1702 + * + * + * def downcast_int64(ndarray[int64_t] arr, bint use_unsigned=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser.downcast_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_mask); + __Pyx_XDECREF(__pyx_v__mask); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1772 + * + * + * def _concatenate_chunks(list chunks): # <<<<<<<<<<<<<< + * cdef: + * list names = list(chunks[0].keys()) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_9_concatenate_chunks(PyObject *__pyx_self, PyObject *__pyx_v_chunks); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_9_concatenate_chunks = {__Pyx_NAMESTR("_concatenate_chunks"), (PyCFunction)__pyx_pw_6pandas_6parser_9_concatenate_chunks, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_9_concatenate_chunks(PyObject *__pyx_self, PyObject *__pyx_v_chunks) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_concatenate_chunks (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chunks), (&PyList_Type), 1, "chunks", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_6parser_8_concatenate_chunks(__pyx_self, ((PyObject*)__pyx_v_chunks)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_8_concatenate_chunks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chunks) { + PyObject *__pyx_v_names = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_warning_columns = 0; + PyObject *__pyx_v_warning_names = 0; + PyObject *__pyx_v_common_type = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_arrs = NULL; + PyObject *__pyx_v_dtypes = NULL; + PyObject *__pyx_v_warning_message = NULL; + PyObject *__pyx_v_chunk = NULL; + PyObject *__pyx_v_a = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_concatenate_chunks", 0); + + /* "pandas/parser.pyx":1774 + * def _concatenate_chunks(list chunks): + * cdef: + * list names = list(chunks[0].keys()) # <<<<<<<<<<<<<< + * object name + * list warning_columns + */ + if (unlikely(__pyx_v_chunks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_chunks, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_names = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1780 + * object common_type + * + * result = {} # <<<<<<<<<<<<<< + * warning_columns = list() + * for name in names: + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1781 + * + * result = {} + * warning_columns = list() # <<<<<<<<<<<<<< + * for name in names: + * arrs = [chunk.pop(name) for chunk in chunks] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_warning_columns = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1782 + * result = {} + * warning_columns = list() + * for name in names: # <<<<<<<<<<<<<< + * arrs = [chunk.pop(name) for chunk in chunks] + * # Check each arr for consistent types. + */ + __pyx_t_1 = __pyx_v_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1783 + * warning_columns = list() + * for name in names: + * arrs = [chunk.pop(name) for chunk in chunks] # <<<<<<<<<<<<<< + * # Check each arr for consistent types. + * dtypes = set([a.dtype for a in arrs]) + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_chunks == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + for (;;) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_arrs, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1785 + * arrs = [chunk.pop(name) for chunk in chunks] + * # Check each arr for consistent types. + * dtypes = set([a.dtype for a in arrs]) # <<<<<<<<<<<<<< + * if len(dtypes) > 1: + * common_type = np.find_common_type(dtypes, []) + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __pyx_v_arrs; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + for (;;) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_dtypes, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1786 + * # Check each arr for consistent types. + * dtypes = set([a.dtype for a in arrs]) + * if len(dtypes) > 1: # <<<<<<<<<<<<<< + * common_type = np.find_common_type(dtypes, []) + * if common_type == np.object: + */ + __pyx_t_5 = PySet_Size(__pyx_v_dtypes); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_5 > 1) != 0); + if (__pyx_t_9) { + + /* "pandas/parser.pyx":1787 + * dtypes = set([a.dtype for a in arrs]) + * if len(dtypes) > 1: + * common_type = np.find_common_type(dtypes, []) # <<<<<<<<<<<<<< + * if common_type == np.object: + * warning_columns.append(str(name)) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_find_common_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_dtypes); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_dtypes); + __Pyx_GIVEREF(__pyx_v_dtypes); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_common_type, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1788 + * if len(dtypes) > 1: + * common_type = np.find_common_type(dtypes, []) + * if common_type == np.object: # <<<<<<<<<<<<<< + * warning_columns.append(str(name)) + * result[name] = np.concatenate(arrs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_common_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "pandas/parser.pyx":1789 + * common_type = np.find_common_type(dtypes, []) + * if common_type == np.object: + * warning_columns.append(str(name)) # <<<<<<<<<<<<<< + * result[name] = np.concatenate(arrs) + * + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_warning_columns, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L10; + } + __pyx_L10:; + goto __pyx_L9; + } + __pyx_L9:; + + /* "pandas/parser.pyx":1790 + * if common_type == np.object: + * warning_columns.append(str(name)) + * result[name] = np.concatenate(arrs) # <<<<<<<<<<<<<< + * + * if warning_columns: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_arrs); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_arrs); + __Pyx_GIVEREF(__pyx_v_arrs); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_name, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1792 + * result[name] = np.concatenate(arrs) + * + * if warning_columns: # <<<<<<<<<<<<<< + * warning_names = ','.join(warning_columns) + * warning_message = " ".join(["Columns (%s) have mixed types." % warning_names, + */ + __pyx_t_9 = (__pyx_v_warning_columns != Py_None) && (PyList_GET_SIZE(__pyx_v_warning_columns) != 0); + if (__pyx_t_9) { + + /* "pandas/parser.pyx":1793 + * + * if warning_columns: + * warning_names = ','.join(warning_columns) # <<<<<<<<<<<<<< + * warning_message = " ".join(["Columns (%s) have mixed types." % warning_names, + * "Specify dtype option on import or set low_memory=False." + */ + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_v_warning_columns); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_warning_names = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1794 + * if warning_columns: + * warning_names = ','.join(warning_columns) + * warning_message = " ".join(["Columns (%s) have mixed types." % warning_names, # <<<<<<<<<<<<<< + * "Specify dtype option on import or set low_memory=False." + * ]) + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Columns_s_have_mixed_types, __pyx_v_warning_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_Specify_dtype_option_on_import_o); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_Specify_dtype_option_on_import_o); + __Pyx_GIVEREF(__pyx_kp_s_Specify_dtype_option_on_import_o); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__35, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_warning_message = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1797 + * "Specify dtype option on import or set low_memory=False." + * ]) + * warnings.warn(warning_message, DtypeWarning) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DtypeWarning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_warning_message); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_warning_message); + __Pyx_GIVEREF(__pyx_v_warning_message); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/parser.pyx":1798 + * ]) + * warnings.warn(warning_message, DtypeWarning) + * return result # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/parser.pyx":1772 + * + * + * def _concatenate_chunks(list chunks): # <<<<<<<<<<<<<< + * cdef: + * list names = list(chunks[0].keys()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.parser._concatenate_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_names); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_warning_columns); + __Pyx_XDECREF(__pyx_v_warning_names); + __Pyx_XDECREF(__pyx_v_common_type); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_arrs); + __Pyx_XDECREF(__pyx_v_dtypes); + __Pyx_XDECREF(__pyx_v_warning_message); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_a); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1803 + * + * # NA values + * def _compute_na_values(): # <<<<<<<<<<<<<< + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_11_compute_na_values(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_11_compute_na_values = {__Pyx_NAMESTR("_compute_na_values"), (PyCFunction)__pyx_pw_6pandas_6parser_11_compute_na_values, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_11_compute_na_values(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_compute_na_values (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_10_compute_na_values(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_10_compute_na_values(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_int64info = NULL; + PyObject *__pyx_v_int32info = NULL; + PyObject *__pyx_v_int16info = NULL; + PyObject *__pyx_v_int8info = NULL; + PyObject *__pyx_v_uint64info = NULL; + PyObject *__pyx_v_uint32info = NULL; + PyObject *__pyx_v_uint16info = NULL; + PyObject *__pyx_v_uint8info = NULL; + PyObject *__pyx_v_na_values = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_compute_na_values", 0); + + /* "pandas/parser.pyx":1804 + * # NA values + * def _compute_na_values(): + * int64info = np.iinfo(np.int64) # <<<<<<<<<<<<<< + * int32info = np.iinfo(np.int32) + * int16info = np.iinfo(np.int16) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_int64info = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1805 + * def _compute_na_values(): + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) # <<<<<<<<<<<<<< + * int16info = np.iinfo(np.int16) + * int8info = np.iinfo(np.int8) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_int32info = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1806 + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) + * int16info = np.iinfo(np.int16) # <<<<<<<<<<<<<< + * int8info = np.iinfo(np.int8) + * uint64info = np.iinfo(np.uint64) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_int16info = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1807 + * int32info = np.iinfo(np.int32) + * int16info = np.iinfo(np.int16) + * int8info = np.iinfo(np.int8) # <<<<<<<<<<<<<< + * uint64info = np.iinfo(np.uint64) + * uint32info = np.iinfo(np.uint32) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_int8info = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1808 + * int16info = np.iinfo(np.int16) + * int8info = np.iinfo(np.int8) + * uint64info = np.iinfo(np.uint64) # <<<<<<<<<<<<<< + * uint32info = np.iinfo(np.uint32) + * uint16info = np.iinfo(np.uint16) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_uint64info = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1809 + * int8info = np.iinfo(np.int8) + * uint64info = np.iinfo(np.uint64) + * uint32info = np.iinfo(np.uint32) # <<<<<<<<<<<<<< + * uint16info = np.iinfo(np.uint16) + * uint8info = np.iinfo(np.uint8) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_uint32info = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1810 + * uint64info = np.iinfo(np.uint64) + * uint32info = np.iinfo(np.uint32) + * uint16info = np.iinfo(np.uint16) # <<<<<<<<<<<<<< + * uint8info = np.iinfo(np.uint8) + * na_values = { + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_uint16info = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1811 + * uint32info = np.iinfo(np.uint32) + * uint16info = np.iinfo(np.uint16) + * uint8info = np.iinfo(np.uint8) # <<<<<<<<<<<<<< + * na_values = { + * np.float64 : np.nan, + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_uint8info = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1812 + * uint16info = np.iinfo(np.uint16) + * uint8info = np.iinfo(np.uint8) + * na_values = { # <<<<<<<<<<<<<< + * np.float64 : np.nan, + * np.int64 : int64info.min, + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/parser.pyx":1813 + * uint8info = np.iinfo(np.uint8) + * na_values = { + * np.float64 : np.nan, # <<<<<<<<<<<<<< + * np.int64 : int64info.min, + * np.int32 : int32info.min, + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1814 + * na_values = { + * np.float64 : np.nan, + * np.int64 : int64info.min, # <<<<<<<<<<<<<< + * np.int32 : int32info.min, + * np.int16 : int16info.min, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_int64info, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1815 + * np.float64 : np.nan, + * np.int64 : int64info.min, + * np.int32 : int32info.min, # <<<<<<<<<<<<<< + * np.int16 : int16info.min, + * np.int8 : int8info.min, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_int32info, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1816 + * np.int64 : int64info.min, + * np.int32 : int32info.min, + * np.int16 : int16info.min, # <<<<<<<<<<<<<< + * np.int8 : int8info.min, + * np.uint64 : uint64info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_int16info, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1817 + * np.int32 : int32info.min, + * np.int16 : int16info.min, + * np.int8 : int8info.min, # <<<<<<<<<<<<<< + * np.uint64 : uint64info.max, + * np.uint32 : uint32info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_int8info, __pyx_n_s_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1818 + * np.int16 : int16info.min, + * np.int8 : int8info.min, + * np.uint64 : uint64info.max, # <<<<<<<<<<<<<< + * np.uint32 : uint32info.max, + * np.uint16 : uint16info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint64info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1819 + * np.int8 : int8info.min, + * np.uint64 : uint64info.max, + * np.uint32 : uint32info.max, # <<<<<<<<<<<<<< + * np.uint16 : uint16info.max, + * np.uint8 : uint8info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint32info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1820 + * np.uint64 : uint64info.max, + * np.uint32 : uint32info.max, + * np.uint16 : uint16info.max, # <<<<<<<<<<<<<< + * np.uint8 : uint8info.max, + * np.bool_ : uint8info.max, + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint16info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1821 + * np.uint32 : uint32info.max, + * np.uint16 : uint16info.max, + * np.uint8 : uint8info.max, # <<<<<<<<<<<<<< + * np.bool_ : uint8info.max, + * np.object_ : np.nan # oof + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint8info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1822 + * np.uint16 : uint16info.max, + * np.uint8 : uint8info.max, + * np.bool_ : uint8info.max, # <<<<<<<<<<<<<< + * np.object_ : np.nan # oof + * } + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_uint8info, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1823 + * np.uint8 : uint8info.max, + * np.bool_ : uint8info.max, + * np.object_ : np.nan # oof # <<<<<<<<<<<<<< + * } + * return na_values + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_na_values = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1825 + * np.object_ : np.nan # oof + * } + * return na_values # <<<<<<<<<<<<<< + * + * na_values = _compute_na_values() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_na_values); + __pyx_r = __pyx_v_na_values; + goto __pyx_L0; + + /* "pandas/parser.pyx":1803 + * + * # NA values + * def _compute_na_values(): # <<<<<<<<<<<<<< + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.parser._compute_na_values", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_int64info); + __Pyx_XDECREF(__pyx_v_int32info); + __Pyx_XDECREF(__pyx_v_int16info); + __Pyx_XDECREF(__pyx_v_int8info); + __Pyx_XDECREF(__pyx_v_uint64info); + __Pyx_XDECREF(__pyx_v_uint32info); + __Pyx_XDECREF(__pyx_v_uint16info); + __Pyx_XDECREF(__pyx_v_uint8info); + __Pyx_XDECREF(__pyx_v_na_values); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1833 + * + * + * cdef _apply_converter(object f, parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * char* c_encoding): + */ + +static PyObject *__pyx_f_6pandas_6parser__apply_converter(PyObject *__pyx_v_f, parser_t *__pyx_v_parser, int __pyx_v_col, int __pyx_v_line_start, int __pyx_v_line_end, char *__pyx_v_c_encoding) { + Py_ssize_t __pyx_v_i; + size_t __pyx_v_lines; + coliter_t __pyx_v_it; + char *__pyx_v_word; + char *__pyx_v_errors; + PyArrayObject *__pyx_v_result = 0; + PyObject *__pyx_v_val = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + size_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject **__pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_apply_converter", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + + /* "pandas/parser.pyx":1842 + * coliter_t it + * char *word + * char *errors = "strict" # <<<<<<<<<<<<<< + * ndarray[object] result + * object val + */ + __pyx_v_errors = __pyx_k_strict; + + /* "pandas/parser.pyx":1846 + * object val + * + * lines = line_end - line_start # <<<<<<<<<<<<<< + * result = np.empty(lines, dtype=np.object_) + * + */ + __pyx_v_lines = (__pyx_v_line_end - __pyx_v_line_start); + + /* "pandas/parser.pyx":1847 + * + * lines = line_end - line_start + * result = np.empty(lines, dtype=np.object_) # <<<<<<<<<<<<<< + * + * coliter_setup(&it, parser, col, line_start) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1849 + * result = np.empty(lines, dtype=np.object_) + * + * coliter_setup(&it, parser, col, line_start) # <<<<<<<<<<<<<< + * + * if not PY3 and c_encoding == NULL: + */ + coliter_setup((&__pyx_v_it), __pyx_v_parser, __pyx_v_col, __pyx_v_line_start); + + /* "pandas/parser.pyx":1851 + * coliter_setup(&it, parser, col, line_start) + * + * if not PY3 and c_encoding == NULL: # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + __pyx_t_11 = ((!(__pyx_v_6pandas_6parser_PY3 != 0)) != 0); + if (__pyx_t_11) { + __pyx_t_12 = ((__pyx_v_c_encoding == NULL) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_11; + } + if (__pyx_t_13) { + + /* "pandas/parser.pyx":1852 + * + * if not PY3 and c_encoding == NULL: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * val = PyBytes_FromString(word) + */ + __pyx_t_14 = __pyx_v_lines; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/parser.pyx":1853 + * if not PY3 and c_encoding == NULL: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * val = PyBytes_FromString(word) + * result[i] = f(val) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1854 + * for i in range(lines): + * word = COLITER_NEXT(it) + * val = PyBytes_FromString(word) # <<<<<<<<<<<<<< + * result[i] = f(val) + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): + */ + __pyx_t_5 = PyBytes_FromString(__pyx_v_word); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1855 + * word = COLITER_NEXT(it) + * val = PyBytes_FromString(word) + * result[i] = f(val) # <<<<<<<<<<<<<< + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): + * for i in range(lines): + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_17); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_17); + *__pyx_t_17 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_17); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + goto __pyx_L3; + } + + /* "pandas/parser.pyx":1856 + * val = PyBytes_FromString(word) + * result[i] = f(val) + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): # <<<<<<<<<<<<<< + * for i in range(lines): + * word = COLITER_NEXT(it) + */ + if (__pyx_v_6pandas_6parser_PY3) { + __pyx_t_13 = (__pyx_v_c_encoding == NULL); + __pyx_t_11 = __pyx_t_13; + } else { + __pyx_t_11 = __pyx_v_6pandas_6parser_PY3; + } + if (!__pyx_t_11) { + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c_encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b_utf_8, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __pyx_t_13; + } else { + __pyx_t_12 = __pyx_t_11; + } + if (__pyx_t_12) { + + /* "pandas/parser.pyx":1857 + * result[i] = f(val) + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * val = PyUnicode_FromString(word) + */ + __pyx_t_14 = __pyx_v_lines; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/parser.pyx":1858 + * elif ((PY3 and c_encoding == NULL) or c_encoding == b'utf-8'): + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * val = PyUnicode_FromString(word) + * result[i] = f(val) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1859 + * for i in range(lines): + * word = COLITER_NEXT(it) + * val = PyUnicode_FromString(word) # <<<<<<<<<<<<<< + * result[i] = f(val) + * else: + */ + __pyx_t_1 = PyUnicode_FromString(__pyx_v_word); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/parser.pyx":1860 + * word = COLITER_NEXT(it) + * val = PyUnicode_FromString(word) + * result[i] = f(val) # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_17); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_17); + *__pyx_t_17 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_17); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1862 + * result[i] = f(val) + * else: + * for i in range(lines): # <<<<<<<<<<<<<< + * word = COLITER_NEXT(it) + * val = PyUnicode_Decode(word, strlen(word), + */ + __pyx_t_14 = __pyx_v_lines; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/parser.pyx":1863 + * else: + * for i in range(lines): + * word = COLITER_NEXT(it) # <<<<<<<<<<<<<< + * val = PyUnicode_Decode(word, strlen(word), + * c_encoding, errors) + */ + __pyx_v_word = COLITER_NEXT(__pyx_v_it); + + /* "pandas/parser.pyx":1864 + * for i in range(lines): + * word = COLITER_NEXT(it) + * val = PyUnicode_Decode(word, strlen(word), # <<<<<<<<<<<<<< + * c_encoding, errors) + * result[i] = f(val) + */ + __pyx_t_5 = PyUnicode_Decode(__pyx_v_word, strlen(__pyx_v_word), __pyx_v_c_encoding, __pyx_v_errors); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/parser.pyx":1866 + * val = PyUnicode_Decode(word, strlen(word), + * c_encoding, errors) + * result[i] = f(val) # <<<<<<<<<<<<<< + * + * return lib.maybe_convert_objects(result) + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_17); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_17); + *__pyx_t_17 = __pyx_t_1; + __Pyx_GIVEREF(*__pyx_t_17); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1868 + * result[i] = f(val) + * + * return lib.maybe_convert_objects(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maybe_convert_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1833 + * + * + * cdef _apply_converter(object f, parser_t *parser, int col, # <<<<<<<<<<<<<< + * int line_start, int line_end, + * char* c_encoding): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.parser._apply_converter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1871 + * + * + * def _to_structured_array(dict columns, object names): # <<<<<<<<<<<<<< + * cdef: + * ndarray recs, column + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_13_to_structured_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_13_to_structured_array = {__Pyx_NAMESTR("_to_structured_array"), (PyCFunction)__pyx_pw_6pandas_6parser_13_to_structured_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_13_to_structured_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_columns = 0; + PyObject *__pyx_v_names = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_to_structured_array (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_columns,&__pyx_n_s_names,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_names)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_to_structured_array", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_to_structured_array") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_columns = ((PyObject*)values[0]); + __pyx_v_names = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_to_structured_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.parser._to_structured_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_columns), (&PyDict_Type), 1, "columns", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_6parser_12_to_structured_array(__pyx_self, __pyx_v_columns, __pyx_v_names); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_12_to_structured_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_names) { + PyArrayObject *__pyx_v_recs = 0; + PyArrayObject *__pyx_v_column = 0; + PyArray_Descr *__pyx_v_dt = 0; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_name = 0; + PyObject *__pyx_v_fnames = 0; + PyObject *__pyx_v_field_type = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_offset; + Py_ssize_t __pyx_v_nfields; + Py_ssize_t __pyx_v_length; + int __pyx_v_stride; + int __pyx_v_elsize; + char *__pyx_v_buf; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_to_structured_array", 0); + __Pyx_INCREF(__pyx_v_names); + + /* "pandas/parser.pyx":1882 + * char *buf + * + * if names is None: # <<<<<<<<<<<<<< + * names = ['%d' % i for i in range(len(columns))] + * else: + */ + __pyx_t_1 = (__pyx_v_names == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1883 + * + * if names is None: + * names = ['%d' % i for i in range(len(columns))] # <<<<<<<<<<<<<< + * else: + * # single line header + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyDict_Size(__pyx_v_columns); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_d, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF_SET(__pyx_v_names, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1886 + * else: + * # single line header + * names = names[0] # <<<<<<<<<<<<<< + * + * dt = np.dtype([(str(name), columns[i].dtype) + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_names, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_names, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "pandas/parser.pyx":1888 + * names = names[0] + * + * dt = np.dtype([(str(name), columns[i].dtype) # <<<<<<<<<<<<<< + * for i, name in enumerate(names)]) + * fnames = dt.names + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 0; + + /* "pandas/parser.pyx":1889 + * + * dt = np.dtype([(str(name), columns[i].dtype) + * for i, name in enumerate(names)]) # <<<<<<<<<<<<<< + * fnames = dt.names + * fields = dt.fields + */ + if (PyList_CheckExact(__pyx_v_names) || PyTuple_CheckExact(__pyx_v_names)) { + __pyx_t_6 = __pyx_v_names; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_6); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_i = __pyx_t_4; + __pyx_t_4 = (__pyx_t_4 + 1); + + /* "pandas/parser.pyx":1888 + * names = names[0] + * + * dt = np.dtype([(str(name), columns[i].dtype) # <<<<<<<<<<<<<< + * for i, name in enumerate(names)]) + * fnames = dt.names + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_columns, __pyx_t_9); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_10 = 0; + __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dt = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1890 + * dt = np.dtype([(str(name), columns[i].dtype) + * for i, name in enumerate(names)]) + * fnames = dt.names # <<<<<<<<<<<<<< + * fields = dt.fields + * + */ + __pyx_t_3 = __pyx_v_dt->names; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_fnames = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1891 + * for i, name in enumerate(names)]) + * fnames = dt.names + * fields = dt.fields # <<<<<<<<<<<<<< + * + * nfields = len(fields) + */ + if (!(likely(PyDict_CheckExact(__pyx_v_dt->fields))||((__pyx_v_dt->fields) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_dt->fields)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_dt->fields; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_fields = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1893 + * fields = dt.fields + * + * nfields = len(fields) # <<<<<<<<<<<<<< + * + * if PY3: + */ + if (unlikely(__pyx_v_fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = PyDict_Size(__pyx_v_fields); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nfields = __pyx_t_4; + + /* "pandas/parser.pyx":1895 + * nfields = len(fields) + * + * if PY3: # <<<<<<<<<<<<<< + * length = len(list(columns.values())[0]) + * else: + */ + __pyx_t_2 = (__pyx_v_6pandas_6parser_PY3 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1896 + * + * if PY3: + * length = len(list(columns.values())[0]) # <<<<<<<<<<<<<< + * else: + * length = len(columns.values()[0]) + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyDict_Values(__pyx_v_columns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_length = __pyx_t_4; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/parser.pyx":1898 + * length = len(list(columns.values())[0]) + * else: + * length = len(columns.values()[0]) # <<<<<<<<<<<<<< + * + * stride = dt.itemsize + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_PyDict_Values(__pyx_v_columns); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_length = __pyx_t_4; + } + __pyx_L8:; + + /* "pandas/parser.pyx":1900 + * length = len(columns.values()[0]) + * + * stride = dt.itemsize # <<<<<<<<<<<<<< + * + * # start = time.time() + */ + __pyx_t_12 = __pyx_v_dt->elsize; + __pyx_v_stride = __pyx_t_12; + + /* "pandas/parser.pyx":1905 + * + * # we own the data + * buf = malloc(length * stride) # <<<<<<<<<<<<<< + * + * recs = util.sarr_from_data(dt, length, buf) + */ + __pyx_v_buf = ((char *)malloc((__pyx_v_length * __pyx_v_stride))); + + /* "pandas/parser.pyx":1907 + * buf = malloc(length * stride) + * + * recs = util.sarr_from_data(dt, length, buf) # <<<<<<<<<<<<<< + * assert(recs.flags.owndata) + * + */ + __pyx_t_3 = sarr_from_data(__pyx_v_dt, __pyx_v_length, __pyx_v_buf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_recs = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1908 + * + * recs = util.sarr_from_data(dt, length, buf) + * assert(recs.flags.owndata) # <<<<<<<<<<<<<< + * + * # buf = recs.data + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_recs), __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_owndata); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/parser.pyx":1914 + * # print 'took %.4f' % (end - start) + * + * for i in range(nfields): # <<<<<<<<<<<<<< + * # start = time.clock() + * # name = names[i] + */ + __pyx_t_4 = __pyx_v_nfields; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/parser.pyx":1919 + * + * # XXX + * field_type = fields[fnames[i]] # <<<<<<<<<<<<<< + * + * # (dtype, stride) tuple + */ + if (unlikely(__pyx_v_fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_fnames, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_fields, __pyx_t_6); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_field_type, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1922 + * + * # (dtype, stride) tuple + * offset = field_type[1] # <<<<<<<<<<<<<< + * elsize = field_type[0].itemsize + * column = columns[i] + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_field_type, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_offset = __pyx_t_13; + + /* "pandas/parser.pyx":1923 + * # (dtype, stride) tuple + * offset = field_type[1] + * elsize = field_type[0].itemsize # <<<<<<<<<<<<<< + * column = columns[i] + * + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_field_type, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_elsize = __pyx_t_12; + + /* "pandas/parser.pyx":1924 + * offset = field_type[1] + * elsize = field_type[0].itemsize + * column = columns[i] # <<<<<<<<<<<<<< + * + * _fill_structured_column(buf + offset, column.data, + */ + if (unlikely(__pyx_v_columns == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_columns, __pyx_t_6); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_column, ((PyArrayObject *)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/parser.pyx":1928 + * _fill_structured_column(buf + offset, column.data, + * elsize, stride, length, + * field_type[0] == np.object_) # <<<<<<<<<<<<<< + * + * # print 'Transfer of %s took %.4f' % (str(field_type), + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_field_type, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_object_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/parser.pyx":1926 + * column = columns[i] + * + * _fill_structured_column(buf + offset, column.data, # <<<<<<<<<<<<<< + * elsize, stride, length, + * field_type[0] == np.object_) + */ + __pyx_t_6 = __pyx_f_6pandas_6parser__fill_structured_column((__pyx_v_buf + __pyx_v_offset), ((char *)__pyx_v_column->data), __pyx_v_elsize, __pyx_v_stride, __pyx_v_length, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "pandas/parser.pyx":1933 + * # time.clock() - start) + * + * return recs # <<<<<<<<<<<<<< + * + * cdef _fill_structured_column(char *dst, char* src, int elsize, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_recs)); + __pyx_r = ((PyObject *)__pyx_v_recs); + goto __pyx_L0; + + /* "pandas/parser.pyx":1871 + * + * + * def _to_structured_array(dict columns, object names): # <<<<<<<<<<<<<< + * cdef: + * ndarray recs, column + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.parser._to_structured_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_recs); + __Pyx_XDECREF((PyObject *)__pyx_v_column); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_fnames); + __Pyx_XDECREF(__pyx_v_field_type); + __Pyx_XDECREF(__pyx_v_names); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1935 + * return recs + * + * cdef _fill_structured_column(char *dst, char* src, int elsize, # <<<<<<<<<<<<<< + * int stride, int length, bint incref): + * cdef: + */ + +static PyObject *__pyx_f_6pandas_6parser__fill_structured_column(char *__pyx_v_dst, char *__pyx_v_src, int __pyx_v_elsize, int __pyx_v_stride, int __pyx_v_length, int __pyx_v_incref) { + CYTHON_UNUSED size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + size_t __pyx_t_3; + __Pyx_RefNannySetupContext("_fill_structured_column", 0); + + /* "pandas/parser.pyx":1940 + * size_t i + * + * if incref: # <<<<<<<<<<<<<< + * util.transfer_object_column(dst, src, stride, length) + * else: + */ + __pyx_t_1 = (__pyx_v_incref != 0); + if (__pyx_t_1) { + + /* "pandas/parser.pyx":1941 + * + * if incref: + * util.transfer_object_column(dst, src, stride, length) # <<<<<<<<<<<<<< + * else: + * for i in range(length): + */ + transfer_object_column(__pyx_v_dst, __pyx_v_src, __pyx_v_stride, __pyx_v_length); + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/parser.pyx":1943 + * util.transfer_object_column(dst, src, stride, length) + * else: + * for i in range(length): # <<<<<<<<<<<<<< + * memcpy(dst, src, elsize) + * dst += stride + */ + __pyx_t_2 = __pyx_v_length; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/parser.pyx":1944 + * else: + * for i in range(length): + * memcpy(dst, src, elsize) # <<<<<<<<<<<<<< + * dst += stride + * src += elsize + */ + memcpy(__pyx_v_dst, __pyx_v_src, __pyx_v_elsize); + + /* "pandas/parser.pyx":1945 + * for i in range(length): + * memcpy(dst, src, elsize) + * dst += stride # <<<<<<<<<<<<<< + * src += elsize + * + */ + __pyx_v_dst = (__pyx_v_dst + __pyx_v_stride); + + /* "pandas/parser.pyx":1946 + * memcpy(dst, src, elsize) + * dst += stride + * src += elsize # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_src = (__pyx_v_src + __pyx_v_elsize); + } + } + __pyx_L3:; + + /* "pandas/parser.pyx":1935 + * return recs + * + * cdef _fill_structured_column(char *dst, char* src, int elsize, # <<<<<<<<<<<<<< + * int stride, int length, bint incref): + * cdef: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/parser.pyx":1950 + * + * + * def _maybe_encode(values): # <<<<<<<<<<<<<< + * if values is None: + * return [] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_6parser_15_maybe_encode(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_6parser_15_maybe_encode = {__Pyx_NAMESTR("_maybe_encode"), (PyCFunction)__pyx_pw_6pandas_6parser_15_maybe_encode, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_6parser_15_maybe_encode(PyObject *__pyx_self, PyObject *__pyx_v_values) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_maybe_encode (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_6parser_14_maybe_encode(__pyx_self, ((PyObject *)__pyx_v_values)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_6parser_14_maybe_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_maybe_encode", 0); + + /* "pandas/parser.pyx":1951 + * + * def _maybe_encode(values): + * if values is None: # <<<<<<<<<<<<<< + * return [] + * return [x.encode('utf-8') if isinstance(x, unicode) else x for x in values] + */ + __pyx_t_1 = (__pyx_v_values == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/parser.pyx":1952 + * def _maybe_encode(values): + * if values is None: + * return [] # <<<<<<<<<<<<<< + * return [x.encode('utf-8') if isinstance(x, unicode) else x for x in values] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/parser.pyx":1953 + * if values is None: + * return [] + * return [x.encode('utf-8') if isinstance(x, unicode) else x for x in values] # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) { + __pyx_t_4 = __pyx_v_values; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_2 = PyUnicode_Check(__pyx_v_x); + if ((__pyx_t_2 != 0)) { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __Pyx_INCREF(__pyx_v_x); + __pyx_t_7 = __pyx_v_x; + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/parser.pyx":1950 + * + * + * def _maybe_encode(values): # <<<<<<<<<<<<<< + * if values is None: + * return [] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.parser._maybe_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d_2; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6pandas_6parser_TextReader __pyx_vtable_6pandas_6parser_TextReader; + +static PyObject *__pyx_tp_new_6pandas_6parser_TextReader(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_6parser_TextReader *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_6parser_TextReader *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_6parser_TextReader; + p->file_handle = Py_None; Py_INCREF(Py_None); + p->na_fvalues = Py_None; Py_INCREF(Py_None); + p->clocks = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->allow_leading_cols = Py_None; Py_INCREF(Py_None); + p->delimiter = Py_None; Py_INCREF(Py_None); + p->converters = Py_None; Py_INCREF(Py_None); + p->delim_whitespace = Py_None; Py_INCREF(Py_None); + p->na_values = Py_None; Py_INCREF(Py_None); + p->true_values = Py_None; Py_INCREF(Py_None); + p->false_values = Py_None; Py_INCREF(Py_None); + p->memory_map = Py_None; Py_INCREF(Py_None); + p->as_recarray = Py_None; Py_INCREF(Py_None); + p->header = Py_None; Py_INCREF(Py_None); + p->orig_header = Py_None; Py_INCREF(Py_None); + p->names = Py_None; Py_INCREF(Py_None); + p->header_start = Py_None; Py_INCREF(Py_None); + p->header_end = Py_None; Py_INCREF(Py_None); + p->index_col = Py_None; Py_INCREF(Py_None); + p->low_memory = Py_None; Py_INCREF(Py_None); + p->skiprows = Py_None; Py_INCREF(Py_None); + p->compact_ints = Py_None; Py_INCREF(Py_None); + p->use_unsigned = Py_None; Py_INCREF(Py_None); + p->dtype = Py_None; Py_INCREF(Py_None); + p->encoding = Py_None; Py_INCREF(Py_None); + p->compression = Py_None; Py_INCREF(Py_None); + p->mangle_dupe_cols = Py_None; Py_INCREF(Py_None); + p->tupleize_cols = Py_None; Py_INCREF(Py_None); + p->noconvert = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->usecols = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6pandas_6parser_10TextReader_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_6parser_TextReader(PyObject *o) { + struct __pyx_obj_6pandas_6parser_TextReader *p = (struct __pyx_obj_6pandas_6parser_TextReader *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6pandas_6parser_10TextReader_5__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->file_handle); + Py_CLEAR(p->na_fvalues); + Py_CLEAR(p->clocks); + Py_CLEAR(p->allow_leading_cols); + Py_CLEAR(p->delimiter); + Py_CLEAR(p->converters); + Py_CLEAR(p->delim_whitespace); + Py_CLEAR(p->na_values); + Py_CLEAR(p->true_values); + Py_CLEAR(p->false_values); + Py_CLEAR(p->memory_map); + Py_CLEAR(p->as_recarray); + Py_CLEAR(p->header); + Py_CLEAR(p->orig_header); + Py_CLEAR(p->names); + Py_CLEAR(p->header_start); + Py_CLEAR(p->header_end); + Py_CLEAR(p->index_col); + Py_CLEAR(p->low_memory); + Py_CLEAR(p->skiprows); + Py_CLEAR(p->compact_ints); + Py_CLEAR(p->use_unsigned); + Py_CLEAR(p->dtype); + Py_CLEAR(p->encoding); + Py_CLEAR(p->compression); + Py_CLEAR(p->mangle_dupe_cols); + Py_CLEAR(p->tupleize_cols); + Py_CLEAR(p->noconvert); + Py_CLEAR(p->usecols); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_6parser_TextReader(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_6parser_TextReader *p = (struct __pyx_obj_6pandas_6parser_TextReader *)o; + if (p->file_handle) { + e = (*v)(p->file_handle, a); if (e) return e; + } + if (p->na_fvalues) { + e = (*v)(p->na_fvalues, a); if (e) return e; + } + if (p->clocks) { + e = (*v)(p->clocks, a); if (e) return e; + } + if (p->allow_leading_cols) { + e = (*v)(p->allow_leading_cols, a); if (e) return e; + } + if (p->delimiter) { + e = (*v)(p->delimiter, a); if (e) return e; + } + if (p->converters) { + e = (*v)(p->converters, a); if (e) return e; + } + if (p->delim_whitespace) { + e = (*v)(p->delim_whitespace, a); if (e) return e; + } + if (p->na_values) { + e = (*v)(p->na_values, a); if (e) return e; + } + if (p->true_values) { + e = (*v)(p->true_values, a); if (e) return e; + } + if (p->false_values) { + e = (*v)(p->false_values, a); if (e) return e; + } + if (p->memory_map) { + e = (*v)(p->memory_map, a); if (e) return e; + } + if (p->as_recarray) { + e = (*v)(p->as_recarray, a); if (e) return e; + } + if (p->header) { + e = (*v)(p->header, a); if (e) return e; + } + if (p->orig_header) { + e = (*v)(p->orig_header, a); if (e) return e; + } + if (p->names) { + e = (*v)(p->names, a); if (e) return e; + } + if (p->header_start) { + e = (*v)(p->header_start, a); if (e) return e; + } + if (p->header_end) { + e = (*v)(p->header_end, a); if (e) return e; + } + if (p->index_col) { + e = (*v)(p->index_col, a); if (e) return e; + } + if (p->low_memory) { + e = (*v)(p->low_memory, a); if (e) return e; + } + if (p->skiprows) { + e = (*v)(p->skiprows, a); if (e) return e; + } + if (p->compact_ints) { + e = (*v)(p->compact_ints, a); if (e) return e; + } + if (p->use_unsigned) { + e = (*v)(p->use_unsigned, a); if (e) return e; + } + if (p->dtype) { + e = (*v)(p->dtype, a); if (e) return e; + } + if (p->encoding) { + e = (*v)(p->encoding, a); if (e) return e; + } + if (p->compression) { + e = (*v)(p->compression, a); if (e) return e; + } + if (p->mangle_dupe_cols) { + e = (*v)(p->mangle_dupe_cols, a); if (e) return e; + } + if (p->tupleize_cols) { + e = (*v)(p->tupleize_cols, a); if (e) return e; + } + if (p->noconvert) { + e = (*v)(p->noconvert, a); if (e) return e; + } + if (p->usecols) { + e = (*v)(p->usecols, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_6parser_TextReader(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_6parser_TextReader *p = (struct __pyx_obj_6pandas_6parser_TextReader *)o; + tmp = ((PyObject*)p->file_handle); + p->file_handle = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->na_fvalues); + p->na_fvalues = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->clocks); + p->clocks = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->allow_leading_cols); + p->allow_leading_cols = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->delimiter); + p->delimiter = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->converters); + p->converters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->delim_whitespace); + p->delim_whitespace = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->na_values); + p->na_values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->true_values); + p->true_values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->false_values); + p->false_values = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->memory_map); + p->memory_map = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->as_recarray); + p->as_recarray = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->header); + p->header = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->orig_header); + p->orig_header = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->names); + p->names = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->header_start); + p->header_start = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->header_end); + p->header_end = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->index_col); + p->index_col = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->low_memory); + p->low_memory = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->skiprows); + p->skiprows = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->compact_ints); + p->compact_ints = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->use_unsigned); + p->use_unsigned = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->dtype); + p->dtype = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->encoding); + p->encoding = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->compression); + p->compression = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->mangle_dupe_cols); + p->mangle_dupe_cols = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->tupleize_cols); + p->tupleize_cols = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->noconvert); + p->noconvert = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->usecols); + p->usecols = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_leading_cols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12leading_cols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_leading_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12leading_cols_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_table_width(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11table_width_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_table_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11table_width_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_skip_footer(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11skip_footer_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_skip_footer(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11skip_footer_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_buffer_lines(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_buffer_lines(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12buffer_lines_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_allow_leading_cols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_allow_leading_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_18allow_leading_cols_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_delimiter(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_9delimiter_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_delimiter(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_9delimiter_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_9delimiter_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_converters(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_10converters_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_converters(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_10converters_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_10converters_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_delim_whitespace(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_delim_whitespace(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_16delim_whitespace_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_na_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_9na_values_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_na_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_9na_values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_9na_values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_true_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11true_values_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_true_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11true_values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_11true_values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_false_values(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12false_values_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_false_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12false_values_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_12false_values_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_memory_map(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_10memory_map_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_memory_map(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_10memory_map_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_10memory_map_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_as_recarray(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_as_recarray(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_11as_recarray_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_header(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_6header_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_header(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_6header_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_6header_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_orig_header(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11orig_header_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_orig_header(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11orig_header_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_11orig_header_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_names(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_5names_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_names(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_5names_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_5names_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_header_start(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12header_start_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_header_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12header_start_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_12header_start_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_header_end(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_10header_end_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_header_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_10header_end_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_10header_end_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_index_col(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_9index_col_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_index_col(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_9index_col_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_9index_col_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_low_memory(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_10low_memory_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_low_memory(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_10low_memory_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_10low_memory_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_skiprows(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_8skiprows_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_skiprows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_8skiprows_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_8skiprows_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_compact_ints(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_compact_ints(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_12compact_ints_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_use_unsigned(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_use_unsigned(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_12use_unsigned_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_dtype(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_5dtype_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_dtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_5dtype_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_5dtype_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_encoding(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_8encoding_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_encoding(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_8encoding_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_8encoding_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_compression(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_11compression_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_compression(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_11compression_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_11compression_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_mangle_dupe_cols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_mangle_dupe_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_16mangle_dupe_cols_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_tupleize_cols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_tupleize_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_13tupleize_cols_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_noconvert(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_9noconvert_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_noconvert(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_9noconvert_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_9noconvert_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6pandas_6parser_10TextReader_usecols(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_6parser_10TextReader_7usecols_1__get__(o); +} + +static int __pyx_setprop_6pandas_6parser_10TextReader_usecols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6pandas_6parser_10TextReader_7usecols_3__set__(o, v); + } + else { + return __pyx_pw_6pandas_6parser_10TextReader_7usecols_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6pandas_6parser_TextReader[] = { + {__Pyx_NAMESTR("set_error_bad_lines"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_7set_error_bad_lines, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_9read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_6parser_10TextReader_8read)}, + {__Pyx_NAMESTR("debug_print"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_11debug_print, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_noconvert"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_13set_noconvert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("remove_noconvert"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_15remove_noconvert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_convert_column_data"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_17_convert_column_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_converter"), (PyCFunction)__pyx_pw_6pandas_6parser_10TextReader_19_get_converter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_6parser_TextReader[] = { + {(char *)"leading_cols", __pyx_getprop_6pandas_6parser_10TextReader_leading_cols, __pyx_setprop_6pandas_6parser_10TextReader_leading_cols, 0, 0}, + {(char *)"table_width", __pyx_getprop_6pandas_6parser_10TextReader_table_width, __pyx_setprop_6pandas_6parser_10TextReader_table_width, 0, 0}, + {(char *)"skip_footer", __pyx_getprop_6pandas_6parser_10TextReader_skip_footer, __pyx_setprop_6pandas_6parser_10TextReader_skip_footer, 0, 0}, + {(char *)"buffer_lines", __pyx_getprop_6pandas_6parser_10TextReader_buffer_lines, __pyx_setprop_6pandas_6parser_10TextReader_buffer_lines, 0, 0}, + {(char *)"allow_leading_cols", __pyx_getprop_6pandas_6parser_10TextReader_allow_leading_cols, __pyx_setprop_6pandas_6parser_10TextReader_allow_leading_cols, 0, 0}, + {(char *)"delimiter", __pyx_getprop_6pandas_6parser_10TextReader_delimiter, __pyx_setprop_6pandas_6parser_10TextReader_delimiter, 0, 0}, + {(char *)"converters", __pyx_getprop_6pandas_6parser_10TextReader_converters, __pyx_setprop_6pandas_6parser_10TextReader_converters, 0, 0}, + {(char *)"delim_whitespace", __pyx_getprop_6pandas_6parser_10TextReader_delim_whitespace, __pyx_setprop_6pandas_6parser_10TextReader_delim_whitespace, 0, 0}, + {(char *)"na_values", __pyx_getprop_6pandas_6parser_10TextReader_na_values, __pyx_setprop_6pandas_6parser_10TextReader_na_values, 0, 0}, + {(char *)"true_values", __pyx_getprop_6pandas_6parser_10TextReader_true_values, __pyx_setprop_6pandas_6parser_10TextReader_true_values, 0, 0}, + {(char *)"false_values", __pyx_getprop_6pandas_6parser_10TextReader_false_values, __pyx_setprop_6pandas_6parser_10TextReader_false_values, 0, 0}, + {(char *)"memory_map", __pyx_getprop_6pandas_6parser_10TextReader_memory_map, __pyx_setprop_6pandas_6parser_10TextReader_memory_map, 0, 0}, + {(char *)"as_recarray", __pyx_getprop_6pandas_6parser_10TextReader_as_recarray, __pyx_setprop_6pandas_6parser_10TextReader_as_recarray, 0, 0}, + {(char *)"header", __pyx_getprop_6pandas_6parser_10TextReader_header, __pyx_setprop_6pandas_6parser_10TextReader_header, 0, 0}, + {(char *)"orig_header", __pyx_getprop_6pandas_6parser_10TextReader_orig_header, __pyx_setprop_6pandas_6parser_10TextReader_orig_header, 0, 0}, + {(char *)"names", __pyx_getprop_6pandas_6parser_10TextReader_names, __pyx_setprop_6pandas_6parser_10TextReader_names, 0, 0}, + {(char *)"header_start", __pyx_getprop_6pandas_6parser_10TextReader_header_start, __pyx_setprop_6pandas_6parser_10TextReader_header_start, 0, 0}, + {(char *)"header_end", __pyx_getprop_6pandas_6parser_10TextReader_header_end, __pyx_setprop_6pandas_6parser_10TextReader_header_end, 0, 0}, + {(char *)"index_col", __pyx_getprop_6pandas_6parser_10TextReader_index_col, __pyx_setprop_6pandas_6parser_10TextReader_index_col, 0, 0}, + {(char *)"low_memory", __pyx_getprop_6pandas_6parser_10TextReader_low_memory, __pyx_setprop_6pandas_6parser_10TextReader_low_memory, 0, 0}, + {(char *)"skiprows", __pyx_getprop_6pandas_6parser_10TextReader_skiprows, __pyx_setprop_6pandas_6parser_10TextReader_skiprows, 0, 0}, + {(char *)"compact_ints", __pyx_getprop_6pandas_6parser_10TextReader_compact_ints, __pyx_setprop_6pandas_6parser_10TextReader_compact_ints, 0, 0}, + {(char *)"use_unsigned", __pyx_getprop_6pandas_6parser_10TextReader_use_unsigned, __pyx_setprop_6pandas_6parser_10TextReader_use_unsigned, 0, 0}, + {(char *)"dtype", __pyx_getprop_6pandas_6parser_10TextReader_dtype, __pyx_setprop_6pandas_6parser_10TextReader_dtype, 0, 0}, + {(char *)"encoding", __pyx_getprop_6pandas_6parser_10TextReader_encoding, __pyx_setprop_6pandas_6parser_10TextReader_encoding, 0, 0}, + {(char *)"compression", __pyx_getprop_6pandas_6parser_10TextReader_compression, __pyx_setprop_6pandas_6parser_10TextReader_compression, 0, 0}, + {(char *)"mangle_dupe_cols", __pyx_getprop_6pandas_6parser_10TextReader_mangle_dupe_cols, __pyx_setprop_6pandas_6parser_10TextReader_mangle_dupe_cols, 0, 0}, + {(char *)"tupleize_cols", __pyx_getprop_6pandas_6parser_10TextReader_tupleize_cols, __pyx_setprop_6pandas_6parser_10TextReader_tupleize_cols, 0, 0}, + {(char *)"noconvert", __pyx_getprop_6pandas_6parser_10TextReader_noconvert, __pyx_setprop_6pandas_6parser_10TextReader_noconvert, 0, 0}, + {(char *)"usecols", __pyx_getprop_6pandas_6parser_10TextReader_usecols, __pyx_setprop_6pandas_6parser_10TextReader_usecols, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_6parser_TextReader = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.parser.TextReader"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_6parser_TextReader), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_6parser_TextReader, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n\n # source: StringIO or file object\n\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_6parser_TextReader, /*tp_traverse*/ + __pyx_tp_clear_6pandas_6parser_TextReader, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_6parser_TextReader, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_6parser_TextReader, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_6parser_10TextReader_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_6parser_TextReader, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("parser"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0}, + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_kp_b_1_IND, __pyx_k_1_IND, sizeof(__pyx_k_1_IND), 0, 0, 0, 0}, + {&__pyx_kp_b_1_IND_2, __pyx_k_1_IND_2, sizeof(__pyx_k_1_IND_2), 0, 0, 0, 0}, + {&__pyx_kp_b_1_QNAN, __pyx_k_1_QNAN, sizeof(__pyx_k_1_QNAN), 0, 0, 0, 0}, + {&__pyx_kp_b_1_QNAN_2, __pyx_k_1_QNAN_2, sizeof(__pyx_k_1_QNAN_2), 0, 0, 0, 0}, + {&__pyx_n_s_BZ2File, __pyx_k_BZ2File, sizeof(__pyx_k_BZ2File), 0, 0, 1, 1}, + {&__pyx_n_s_BufferedReader, __pyx_k_BufferedReader, sizeof(__pyx_k_BufferedReader), 0, 0, 1, 1}, + {&__pyx_n_s_CParserError, __pyx_k_CParserError, sizeof(__pyx_k_CParserError), 0, 0, 1, 1}, + {&__pyx_kp_s_Cannot_handle_open_unicode_files, __pyx_k_Cannot_handle_open_unicode_files, sizeof(__pyx_k_Cannot_handle_open_unicode_files), 0, 0, 1, 0}, + {&__pyx_kp_s_Columns_s_have_mixed_types, __pyx_k_Columns_s_have_mixed_types, sizeof(__pyx_k_Columns_s_have_mixed_types), 0, 0, 1, 0}, + {&__pyx_kp_s_Conversion_to_structured_array, __pyx_k_Conversion_to_structured_array, sizeof(__pyx_k_Conversion_to_structured_array), 0, 0, 1, 0}, + {&__pyx_n_s_DEFAULT_CHUNKSIZE, __pyx_k_DEFAULT_CHUNKSIZE, sizeof(__pyx_k_DEFAULT_CHUNKSIZE), 0, 0, 1, 1}, + {&__pyx_n_s_DtypeWarning, __pyx_k_DtypeWarning, sizeof(__pyx_k_DtypeWarning), 0, 0, 1, 1}, + {&__pyx_kp_s_Error_tokenizing_data, __pyx_k_Error_tokenizing_data, sizeof(__pyx_k_Error_tokenizing_data), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_s_Expected_file_path_name_or_file, __pyx_k_Expected_file_path_name_or_file, sizeof(__pyx_k_Expected_file_path_name_or_file), 0, 0, 1, 0}, + {&__pyx_n_b_FALSE, __pyx_k_FALSE, sizeof(__pyx_k_FALSE), 0, 0, 0, 1}, + {&__pyx_n_b_False, __pyx_k_False, sizeof(__pyx_k_False), 0, 0, 0, 1}, + {&__pyx_kp_s_File_s_does_not_exist, __pyx_k_File_s_does_not_exist, sizeof(__pyx_k_File_s_does_not_exist), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_GzipFile, __pyx_k_GzipFile, sizeof(__pyx_k_GzipFile), 0, 0, 1, 1}, + {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Initializing_from_file_failed, __pyx_k_Initializing_from_file_failed, sizeof(__pyx_k_Initializing_from_file_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_Initializing_parser_from_file_li, __pyx_k_Initializing_parser_from_file_li, sizeof(__pyx_k_Initializing_parser_from_file_li), 0, 0, 1, 0}, + {&__pyx_kp_s_Integer_column_has_NA_values, __pyx_k_Integer_column_has_NA_values, sizeof(__pyx_k_Integer_column_has_NA_values), 0, 0, 1, 0}, + {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1}, + {&__pyx_kp_s_Must_be_all_encoded_bytes, __pyx_k_Must_be_all_encoded_bytes, sizeof(__pyx_k_Must_be_all_encoded_bytes), 0, 0, 1, 0}, + {&__pyx_n_b_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 0, 1}, + {&__pyx_n_s_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 1, 1}, + {&__pyx_kp_b_NA_2, __pyx_k_NA_2, sizeof(__pyx_k_NA_2), 0, 0, 0, 0}, + {&__pyx_n_s_NA_VALUES, __pyx_k_NA_VALUES, sizeof(__pyx_k_NA_VALUES), 0, 0, 1, 1}, + {&__pyx_n_b_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 0, 0, 1}, + {&__pyx_kp_b_N_A_N_A, __pyx_k_N_A_N_A, sizeof(__pyx_k_N_A_N_A), 0, 0, 0, 0}, + {&__pyx_n_b_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 0, 1}, + {&__pyx_n_s_NameError, __pyx_k_NameError, sizeof(__pyx_k_NameError), 0, 0, 1, 1}, + {&__pyx_kp_s_No_columns_to_parse_from_file, __pyx_k_No_columns_to_parse_from_file, sizeof(__pyx_k_No_columns_to_parse_from_file), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1}, + {&__pyx_kp_s_O8, __pyx_k_O8, sizeof(__pyx_k_O8), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_comment_characters, __pyx_k_Only_length_1_comment_characters, sizeof(__pyx_k_Only_length_1_comment_characters), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_decimal_markers_su, __pyx_k_Only_length_1_decimal_markers_su, sizeof(__pyx_k_Only_length_1_decimal_markers_su), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_escapes_supported, __pyx_k_Only_length_1_escapes_supported, sizeof(__pyx_k_Only_length_1_escapes_supported), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_line_terminators_s, __pyx_k_Only_length_1_line_terminators_s, sizeof(__pyx_k_Only_length_1_line_terminators_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Only_length_1_thousands_markers, __pyx_k_Only_length_1_thousands_markers, sizeof(__pyx_k_Only_length_1_thousands_markers), 0, 0, 1, 0}, + {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, + {&__pyx_kp_s_Parser_memory_cleanup, __pyx_k_Parser_memory_cleanup, sizeof(__pyx_k_Parser_memory_cleanup), 0, 0, 1, 0}, + {&__pyx_kp_s_Passed_header_names_mismatches_u, __pyx_k_Passed_header_names_mismatches_u, sizeof(__pyx_k_Passed_header_names_mismatches_u), 0, 0, 1, 0}, + {&__pyx_kp_s_Passed_header_s_but_only_d_lines, __pyx_k_Passed_header_s_but_only_d_lines, sizeof(__pyx_k_Passed_header_s_but_only_d_lines), 0, 0, 1, 0}, + {&__pyx_kp_s_Python_cannot_read_bz2_from_open, __pyx_k_Python_cannot_read_bz2_from_open, sizeof(__pyx_k_Python_cannot_read_bz2_from_open), 0, 0, 1, 0}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_kp_s_S_d, __pyx_k_S_d, sizeof(__pyx_k_S_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Specify_dtype_option_on_import_o, __pyx_k_Specify_dtype_option_on_import_o, sizeof(__pyx_k_Specify_dtype_option_on_import_o), 0, 0, 1, 0}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_b_TRUE, __pyx_k_TRUE, sizeof(__pyx_k_TRUE), 0, 0, 0, 1}, + {&__pyx_n_s_TextIOWrapper, __pyx_k_TextIOWrapper, sizeof(__pyx_k_TextIOWrapper), 0, 0, 1, 1}, + {&__pyx_n_s_Tokenization, __pyx_k_Tokenization, sizeof(__pyx_k_Tokenization), 0, 0, 1, 1}, + {&__pyx_kp_s_Too_many_columns_specified_expec, __pyx_k_Too_many_columns_specified_expec, sizeof(__pyx_k_Too_many_columns_specified_expec), 0, 0, 1, 0}, + {&__pyx_n_b_True, __pyx_k_True, sizeof(__pyx_k_True), 0, 0, 0, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Type_conversion, __pyx_k_Type_conversion, sizeof(__pyx_k_Type_conversion), 0, 0, 1, 0}, + {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_parse_column_d, __pyx_k_Unable_to_parse_column_d, sizeof(__pyx_k_Unable_to_parse_column_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unnamed_d, __pyx_k_Unnamed_d, sizeof(__pyx_k_Unnamed_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unnamed_d_level__d, __pyx_k_Unnamed_d_level__d, sizeof(__pyx_k_Unnamed_d_level__d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_compression_type_s, __pyx_k_Unrecognized_compression_type_s, sizeof(__pyx_k_Unrecognized_compression_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_b__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 0, 0}, + {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0}, + {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, + {&__pyx_kp_s__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 1, 0}, + {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, + {&__pyx_n_s__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 0, 1, 1}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_allow_leading_cols, __pyx_k_allow_leading_cols, sizeof(__pyx_k_allow_leading_cols), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_arrs, __pyx_k_arrs, sizeof(__pyx_k_arrs), 0, 0, 1, 1}, + {&__pyx_n_s_as_recarray, __pyx_k_as_recarray, sizeof(__pyx_k_as_recarray), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_kp_s_b1, __pyx_k_b1, sizeof(__pyx_k_b1), 0, 0, 1, 0}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, + {&__pyx_n_s_buffer_lines, __pyx_k_buffer_lines, sizeof(__pyx_k_buffer_lines), 0, 0, 1, 1}, + {&__pyx_n_s_builtin, __pyx_k_builtin, sizeof(__pyx_k_builtin), 0, 0, 1, 1}, + {&__pyx_n_s_bz2, __pyx_k_bz2, sizeof(__pyx_k_bz2), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1}, + {&__pyx_n_s_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 0, 1, 1}, + {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1}, + {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1}, + {&__pyx_n_s_comment, __pyx_k_comment, sizeof(__pyx_k_comment), 0, 0, 1, 1}, + {&__pyx_n_s_common_type, __pyx_k_common_type, sizeof(__pyx_k_common_type), 0, 0, 1, 1}, + {&__pyx_n_s_compact_ints, __pyx_k_compact_ints, sizeof(__pyx_k_compact_ints), 0, 0, 1, 1}, + {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1}, + {&__pyx_n_s_compute_na_values, __pyx_k_compute_na_values, sizeof(__pyx_k_compute_na_values), 0, 0, 1, 1}, + {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, + {&__pyx_n_s_concatenate_chunks, __pyx_k_concatenate_chunks, sizeof(__pyx_k_concatenate_chunks), 0, 0, 1, 1}, + {&__pyx_n_s_convert_column_data, __pyx_k_convert_column_data, sizeof(__pyx_k_convert_column_data), 0, 0, 1, 1}, + {&__pyx_n_s_converters, __pyx_k_converters, sizeof(__pyx_k_converters), 0, 0, 1, 1}, + {&__pyx_kp_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 0}, + {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1}, + {&__pyx_n_s_delim_whitespace, __pyx_k_delim_whitespace, sizeof(__pyx_k_delim_whitespace), 0, 0, 1, 1}, + {&__pyx_n_s_delimiter, __pyx_k_delimiter, sizeof(__pyx_k_delimiter), 0, 0, 1, 1}, + {&__pyx_n_s_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_doublequote, __pyx_k_doublequote, sizeof(__pyx_k_doublequote), 0, 0, 1, 1}, + {&__pyx_n_s_downcast_int64, __pyx_k_downcast_int64, sizeof(__pyx_k_downcast_int64), 0, 0, 1, 1}, + {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtypes, __pyx_k_dtypes, sizeof(__pyx_k_dtypes), 0, 0, 1, 1}, + {&__pyx_n_s_elsize, __pyx_k_elsize, sizeof(__pyx_k_elsize), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_ensure_encoded, __pyx_k_ensure_encoded, sizeof(__pyx_k_ensure_encoded), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error_bad_lines, __pyx_k_error_bad_lines, sizeof(__pyx_k_error_bad_lines), 0, 0, 1, 1}, + {&__pyx_n_s_escapechar, __pyx_k_escapechar, sizeof(__pyx_k_escapechar), 0, 0, 1, 1}, + {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 1}, + {&__pyx_kp_s_f8_2, __pyx_k_f8_2, sizeof(__pyx_k_f8_2), 0, 0, 1, 0}, + {&__pyx_n_b_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 0, 1}, + {&__pyx_n_s_false_values, __pyx_k_false_values, sizeof(__pyx_k_false_values), 0, 0, 1, 1}, + {&__pyx_n_s_field_type, __pyx_k_field_type, sizeof(__pyx_k_field_type), 0, 0, 1, 1}, + {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_fileobj, __pyx_k_fileobj, sizeof(__pyx_k_fileobj), 0, 0, 1, 1}, + {&__pyx_n_s_find_common_type, __pyx_k_find_common_type, sizeof(__pyx_k_find_common_type), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_fnames, __pyx_k_fnames, sizeof(__pyx_k_fnames), 0, 0, 1, 1}, + {&__pyx_n_s_footer, __pyx_k_footer, sizeof(__pyx_k_footer), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_converter, __pyx_k_get_converter, sizeof(__pyx_k_get_converter), 0, 0, 1, 1}, + {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, + {&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1}, + {&__pyx_n_s_header_end, __pyx_k_header_end, sizeof(__pyx_k_header_end), 0, 0, 1, 1}, + {&__pyx_n_s_header_start, __pyx_k_header_start, sizeof(__pyx_k_header_start), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_kp_s_i8_2, __pyx_k_i8_2, sizeof(__pyx_k_i8_2), 0, 0, 1, 0}, + {&__pyx_n_s_iinfo, __pyx_k_iinfo, sizeof(__pyx_k_iinfo), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index_col, __pyx_k_index_col, sizeof(__pyx_k_index_col), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1}, + {&__pyx_n_s_int16info, __pyx_k_int16info, sizeof(__pyx_k_int16info), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int32info, __pyx_k_int32info, sizeof(__pyx_k_int32info), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int64info, __pyx_k_int64info, sizeof(__pyx_k_int64info), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_int8info, __pyx_k_int8info, sizeof(__pyx_k_int8info), 0, 0, 1, 1}, + {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_n_s_io_common, __pyx_k_io_common, sizeof(__pyx_k_io_common), 0, 0, 1, 1}, + {&__pyx_n_s_is_file_like, __pyx_k_is_file_like, sizeof(__pyx_k_is_file_like), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1}, + {&__pyx_n_s_lineterminator, __pyx_k_lineterminator, sizeof(__pyx_k_lineterminator), 0, 0, 1, 1}, + {&__pyx_n_s_low_memory, __pyx_k_low_memory, sizeof(__pyx_k_low_memory), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mangle_dupe_cols, __pyx_k_mangle_dupe_cols, sizeof(__pyx_k_mangle_dupe_cols), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_mask_2, __pyx_k_mask_2, sizeof(__pyx_k_mask_2), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_convert_objects, __pyx_k_maybe_convert_objects, sizeof(__pyx_k_maybe_convert_objects), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_encode, __pyx_k_maybe_encode, sizeof(__pyx_k_maybe_encode), 0, 0, 1, 1}, + {&__pyx_n_s_maybe_upcast, __pyx_k_maybe_upcast, sizeof(__pyx_k_maybe_upcast), 0, 0, 1, 1}, + {&__pyx_n_s_memory_map, __pyx_k_memory_map, sizeof(__pyx_k_memory_map), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_mn, __pyx_k_mn, sizeof(__pyx_k_mn), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_mx, __pyx_k_mx, sizeof(__pyx_k_mx), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_na_count, __pyx_k_na_count, sizeof(__pyx_k_na_count), 0, 0, 1, 1}, + {&__pyx_n_s_na_filter, __pyx_k_na_filter, sizeof(__pyx_k_na_filter), 0, 0, 1, 1}, + {&__pyx_n_s_na_fvalues, __pyx_k_na_fvalues, sizeof(__pyx_k_na_fvalues), 0, 0, 1, 1}, + {&__pyx_n_s_na_value, __pyx_k_na_value, sizeof(__pyx_k_na_value), 0, 0, 1, 1}, + {&__pyx_n_s_na_values, __pyx_k_na_values, sizeof(__pyx_k_na_values), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1}, + {&__pyx_n_b_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 0, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_nfields, __pyx_k_nfields, sizeof(__pyx_k_nfields), 0, 0, 1, 1}, + {&__pyx_kp_s_no_error_message_set, __pyx_k_no_error_message_set, sizeof(__pyx_k_no_error_message_set), 0, 0, 1, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_kp_s_only_length_1_separators_exclude, __pyx_k_only_length_1_separators_exclude, sizeof(__pyx_k_only_length_1_separators_exclude), 0, 0, 1, 0}, + {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_owndata, __pyx_k_owndata, sizeof(__pyx_k_owndata), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_lib, __pyx_k_pandas_lib, sizeof(__pyx_k_pandas_lib), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_parser, __pyx_k_pandas_parser, sizeof(__pyx_k_pandas_parser), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_putmask, __pyx_k_putmask, sizeof(__pyx_k_putmask), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_quotechar, __pyx_k_quotechar, sizeof(__pyx_k_quotechar), 0, 0, 1, 1}, + {&__pyx_n_s_quoting, __pyx_k_quoting, sizeof(__pyx_k_quoting), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, + {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, + {&__pyx_n_s_recs, __pyx_k_recs, sizeof(__pyx_k_recs), 0, 0, 1, 1}, + {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1}, + {&__pyx_kp_s_s_C_error, __pyx_k_s_C_error, sizeof(__pyx_k_s_C_error), 0, 0, 1, 0}, + {&__pyx_kp_s_s_d, __pyx_k_s_d, sizeof(__pyx_k_s_d), 0, 0, 1, 0}, + {&__pyx_kp_s_s_len_of_d, __pyx_k_s_len_of_d, sizeof(__pyx_k_s_len_of_d), 0, 0, 1, 0}, + {&__pyx_kp_s_s_took_2f_ms, __pyx_k_s_took_2f_ms, sizeof(__pyx_k_s_took_2f_ms), 0, 0, 1, 0}, + {&__pyx_n_s_skip_footer, __pyx_k_skip_footer, sizeof(__pyx_k_skip_footer), 0, 0, 1, 1}, + {&__pyx_kp_s_skip_footer_can_only_be_used_to, __pyx_k_skip_footer_can_only_be_used_to, sizeof(__pyx_k_skip_footer_can_only_be_used_to), 0, 0, 1, 0}, + {&__pyx_n_s_skipinitialspace, __pyx_k_skipinitialspace, sizeof(__pyx_k_skipinitialspace), 0, 0, 1, 1}, + {&__pyx_n_s_skiprows, __pyx_k_skiprows, sizeof(__pyx_k_skiprows), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_stride, __pyx_k_stride, sizeof(__pyx_k_stride), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_kp_s_the_dtype_s_is_not_supported_for, __pyx_k_the_dtype_s_is_not_supported_for, sizeof(__pyx_k_the_dtype_s_is_not_supported_for), 0, 0, 1, 0}, + {&__pyx_kp_s_the_dtype_s_is_not_supported_for_2, __pyx_k_the_dtype_s_is_not_supported_for_2, sizeof(__pyx_k_the_dtype_s_is_not_supported_for_2), 0, 0, 1, 0}, + {&__pyx_n_s_thousands, __pyx_k_thousands, sizeof(__pyx_k_thousands), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_to_structured_array, __pyx_k_to_structured_array, sizeof(__pyx_k_to_structured_array), 0, 0, 1, 1}, + {&__pyx_n_s_tokenize_chunksize, __pyx_k_tokenize_chunksize, sizeof(__pyx_k_tokenize_chunksize), 0, 0, 1, 1}, + {&__pyx_n_b_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 0, 1}, + {&__pyx_n_s_true_values, __pyx_k_true_values, sizeof(__pyx_k_true_values), 0, 0, 1, 1}, + {&__pyx_n_s_tupleize_cols, __pyx_k_tupleize_cols, sizeof(__pyx_k_tupleize_cols), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, + {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1}, + {&__pyx_n_s_uint16info, __pyx_k_uint16info, sizeof(__pyx_k_uint16info), 0, 0, 1, 1}, + {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1}, + {&__pyx_n_s_uint32info, __pyx_k_uint32info, sizeof(__pyx_k_uint32info), 0, 0, 1, 1}, + {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1}, + {&__pyx_n_s_uint64info, __pyx_k_uint64info, sizeof(__pyx_k_uint64info), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_n_s_uint8info, __pyx_k_uint8info, sizeof(__pyx_k_uint8info), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_upcast_na, __pyx_k_upcast_na, sizeof(__pyx_k_upcast_na), 0, 0, 1, 1}, + {&__pyx_n_s_use_unsigned, __pyx_k_use_unsigned, sizeof(__pyx_k_use_unsigned), 0, 0, 1, 1}, + {&__pyx_n_s_usecols, __pyx_k_usecols, sizeof(__pyx_k_usecols), 0, 0, 1, 1}, + {&__pyx_kp_b_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 0, 0}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, + {&__pyx_n_s_warn_bad_lines, __pyx_k_warn_bad_lines, sizeof(__pyx_k_warn_bad_lines), 0, 0, 1, 1}, + {&__pyx_n_s_warning_columns, __pyx_k_warning_columns, sizeof(__pyx_k_warning_columns), 0, 0, 1, 1}, + {&__pyx_n_s_warning_message, __pyx_k_warning_message, sizeof(__pyx_k_warning_message), 0, 0, 1, 1}, + {&__pyx_n_s_warning_names, __pyx_k_warning_names, sizeof(__pyx_k_warning_names), 0, 0, 1, 1}, + {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/parser.pyx":341 + * else: + * if len(delimiter) > 1: + * raise ValueError('only length-1 separators excluded right now') # <<<<<<<<<<<<<< + * self.parser.delimiter = ord(delimiter) + * + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_only_length_1_separators_exclude); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/parser.pyx":352 + * if lineterminator is not None: + * if len(lineterminator) != 1: + * raise ValueError('Only length-1 line terminators supported') # <<<<<<<<<<<<<< + * self.parser.lineterminator = ord(lineterminator) + * + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_line_terminators_s); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/parser.pyx":356 + * + * if len(decimal) != 1: + * raise ValueError('Only length-1 decimal markers supported') # <<<<<<<<<<<<<< + * self.parser.decimal = ord(decimal) + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_decimal_markers_su); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/parser.pyx":361 + * if thousands is not None: + * if len(thousands) != 1: + * raise ValueError('Only length-1 thousands markers supported') # <<<<<<<<<<<<<< + * self.parser.thousands = ord(thousands) + * + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_thousands_markers); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/parser.pyx":366 + * if escapechar is not None: + * if len(escapechar) != 1: + * raise ValueError('Only length-1 escapes supported') # <<<<<<<<<<<<<< + * self.parser.escapechar = ord(escapechar) + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_escapes_supported); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/parser.pyx":374 + * if comment is not None: + * if len(comment) > 1: + * raise ValueError('Only length-1 comment characters supported') # <<<<<<<<<<<<<< + * self.parser.commentchar = ord(comment) + * + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Only_length_1_comment_characters); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "pandas/parser.pyx":422 + * if encoding is not None: + * if not isinstance(encoding, bytes): + * encoding = encoding.encode('utf-8') # <<<<<<<<<<<<<< + * encoding = encoding.lower() + * self.c_encoding = encoding + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "pandas/parser.pyx":488 + * + * if not self.table_width: + * raise ValueError("No columns to parse from file") # <<<<<<<<<<<<<< + * + * # compute buffer_lines as function of table width + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_No_columns_to_parse_from_file); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/parser.pyx":532 + * source = bz2.BZ2File(source, 'rb') + * else: + * raise ValueError('Python cannot read bz2 from open file ' # <<<<<<<<<<<<<< + * 'handle') + * else: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Python_cannot_read_bz2_from_open); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/parser.pyx":560 + * if not os.path.exists(source): + * raise IOError('File %s does not exist' % source) + * raise IOError('Initializing from file failed') # <<<<<<<<<<<<<< + * + * self.parser.source = ptr + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Initializing_from_file_failed); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "pandas/parser.pyx":569 + * ptr = new_rd_source(source) + * if ptr == NULL: + * raise IOError('Initializing parser from file-like ' # <<<<<<<<<<<<<< + * 'object failed') + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Initializing_parser_from_file_li); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/parser.pyx":709 + * self.leading_cols = field_count - passed_count + * elif passed_count != field_count: + * raise ValueError('Passed header names ' # <<<<<<<<<<<<<< + * 'mismatches usecols') + * # oh boy, #2442, #2981 + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Passed_header_names_mismatches_u); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "pandas/parser.pyx":807 + * + * if self.skip_footer > 0: + * raise ValueError('skip_footer can only be used to read ' # <<<<<<<<<<<<<< + * 'the whole file') + * else: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_skip_footer_can_only_be_used_to); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "pandas/parser.pyx":1012 + * na_filter, na_hashset) + * if user_dtype and na_count > 0: + * raise Exception('Integer column has NA values') # <<<<<<<<<<<<<< + * + * if dtype[1:] != 'i8': + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Integer_column_has_NA_values); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "pandas/parser.pyx":1014 + * raise Exception('Integer column has NA values') + * + * if dtype[1:] != 'i8': # <<<<<<<<<<<<<< + * result = result.astype(dtype) + * + */ + __pyx_slice__20 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__20); + __Pyx_GIVEREF(__pyx_slice__20); + + /* "pandas/parser.pyx":1023 + * na_filter, na_hashset, na_flist) + * + * if dtype[1:] != 'f8': # <<<<<<<<<<<<<< + * result = result.astype(dtype) + * return result, na_count + */ + __pyx_slice__21 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__21); + __Pyx_GIVEREF(__pyx_slice__21); + + /* "pandas/parser.pyx":1046 + * elif dtype[1] == 'S': + * # TODO: na handling + * width = int(dtype[2:]) # <<<<<<<<<<<<<< + * if width > 0: + * result = _to_fw_string(self.parser, i, start, end, width) + */ + __pyx_slice__22 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__22); + __Pyx_GIVEREF(__pyx_slice__22); + + /* "pandas/parser.pyx":1055 + * na_hashset) + * elif dtype[1] == 'U': + * width = int(dtype[2:]) # <<<<<<<<<<<<<< + * if width > 0: + * raise NotImplementedError("the dtype %s is not supported for parsing" % dtype) + */ + __pyx_slice__23 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + + /* "pandas/parser.pyx":1182 + * cdef asbytes(object o): + * if PY3: + * return str(o).encode('utf-8') # <<<<<<<<<<<<<< + * else: + * return str(o) + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "pandas/parser.pyx":1191 + * import io + * if isinstance(obj, io.TextIOWrapper): + * raise CParserError('Cannot handle open unicode files (yet)') # <<<<<<<<<<<<<< + * + * # BufferedReader is a byte reader for Python 3 + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_handle_open_unicode_files); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "pandas/parser.pyx":1446 + * data[0] = NEGINF + * else: + * return None, None # <<<<<<<<<<<<<< + * if use_na_flist: + * if data[0] in na_flist: + */ + __pyx_tuple__26 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "pandas/parser.pyx":1462 + * data[0] = NEGINF + * else: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __pyx_tuple__27 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "pandas/parser.pyx":1502 + * raise OverflowError(word) + * + * return None, None # <<<<<<<<<<<<<< + * else: + * for i in range(lines): + */ + __pyx_tuple__28 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/parser.pyx":1511 + * if error == ERROR_OVERFLOW: + * raise OverflowError(word) + * return None, None # <<<<<<<<<<<<<< + * + * return result, na_count + */ + __pyx_tuple__29 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "pandas/parser.pyx":1548 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + __pyx_tuple__30 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "pandas/parser.pyx":1556 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __pyx_tuple__31 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "pandas/parser.pyx":1607 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * else: + */ + __pyx_tuple__32 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "pandas/parser.pyx":1627 + * error = to_boolean(word, data) + * if error != 0: + * return None, None # <<<<<<<<<<<<<< + * data += 1 + * + */ + __pyx_tuple__33 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "pandas/parser.pyx":1676 + * # None creeps in sometimes, which isn't possible here + * if not PyBytes_Check(val): + * raise Exception('Must be all encoded bytes') # <<<<<<<<<<<<<< + * + * k = kh_put_str(table, PyBytes_AsString(val), &ret) + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Must_be_all_encoded_bytes); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "pandas/parser.pyx":1953 + * if values is None: + * return [] + * return [x.encode('utf-8') if isinstance(x, unicode) else x for x in values] # <<<<<<<<<<<<<< + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "pandas/parser.pyx":1169 + * + * + * def _ensure_encoded(list lst): # <<<<<<<<<<<<<< + * cdef list result = [] + * for x in lst: + */ + __pyx_tuple__46 = PyTuple_Pack(3, __pyx_n_s_lst, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ensure_encoded, 1169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1187 + * + * + * def _is_file_like(obj): # <<<<<<<<<<<<<< + * if PY3: + * import io + */ + __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_io, __pyx_n_s_file, __pyx_n_s_builtin); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_file_like, 1187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1202 + * + * + * def _maybe_upcast(arr): # <<<<<<<<<<<<<< + * """ + * + */ + __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_arr, __pyx_n_s_na_value, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_maybe_upcast, 1202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1702 + * + * + * def downcast_int64(ndarray[int64_t] arr, bint use_unsigned=0): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__52 = PyTuple_Pack(12, __pyx_n_s_arr, __pyx_n_s_use_unsigned, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_mx, __pyx_n_s_mn, __pyx_n_s_NA, __pyx_n_s_val, __pyx_n_s_mask, __pyx_n_s_na_count, __pyx_n_s_mask_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_downcast_int64, 1702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1772 + * + * + * def _concatenate_chunks(list chunks): # <<<<<<<<<<<<<< + * cdef: + * list names = list(chunks[0].keys()) + */ + __pyx_tuple__54 = PyTuple_Pack(12, __pyx_n_s_chunks, __pyx_n_s_names, __pyx_n_s_name, __pyx_n_s_warning_columns, __pyx_n_s_warning_names, __pyx_n_s_common_type, __pyx_n_s_result, __pyx_n_s_arrs, __pyx_n_s_dtypes, __pyx_n_s_warning_message, __pyx_n_s_chunk, __pyx_n_s_a); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_concatenate_chunks, 1772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1803 + * + * # NA values + * def _compute_na_values(): # <<<<<<<<<<<<<< + * int64info = np.iinfo(np.int64) + * int32info = np.iinfo(np.int32) + */ + __pyx_tuple__56 = PyTuple_Pack(9, __pyx_n_s_int64info, __pyx_n_s_int32info, __pyx_n_s_int16info, __pyx_n_s_int8info, __pyx_n_s_uint64info, __pyx_n_s_uint32info, __pyx_n_s_uint16info, __pyx_n_s_uint8info, __pyx_n_s_na_values); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(0, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_compute_na_values, 1803, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1871 + * + * + * def _to_structured_array(dict columns, object names): # <<<<<<<<<<<<<< + * cdef: + * ndarray recs, column + */ + __pyx_tuple__58 = PyTuple_Pack(16, __pyx_n_s_columns, __pyx_n_s_names, __pyx_n_s_recs, __pyx_n_s_column, __pyx_n_s_dt, __pyx_n_s_fields, __pyx_n_s_name, __pyx_n_s_fnames, __pyx_n_s_field_type, __pyx_n_s_i, __pyx_n_s_offset, __pyx_n_s_nfields, __pyx_n_s_length, __pyx_n_s_stride, __pyx_n_s_elsize, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_to_structured_array, 1871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":1950 + * + * + * def _maybe_encode(values): # <<<<<<<<<<<<<< + * if values is None: + * return [] + */ + __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_x); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_maybe_encode, 1950, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_262144 = PyInt_FromLong(262144L); if (unlikely(!__pyx_int_262144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initparser(void); /*proto*/ +PyMODINIT_FUNC initparser(void) +#else +PyMODINIT_FUNC PyInit_parser(void); /*proto*/ +PyMODINIT_FUNC PyInit_parser(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_parser(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("parser"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__parser) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.parser")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.parser", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + __pyx_v_6pandas_6parser__true_values = Py_None; Py_INCREF(Py_None); + __pyx_v_6pandas_6parser__false_values = Py_None; Py_INCREF(Py_None); + __pyx_v_6pandas_6parser_dtype_cast_order = ((PyObject*)Py_None); Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + __pyx_vtabptr_6pandas_6parser_TextReader = &__pyx_vtable_6pandas_6parser_TextReader; + __pyx_vtable_6pandas_6parser_TextReader._make_skiprow_set = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *))__pyx_f_6pandas_6parser_10TextReader__make_skiprow_set; + __pyx_vtable_6pandas_6parser_TextReader._setup_parser_source = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__setup_parser_source; + __pyx_vtable_6pandas_6parser_TextReader._get_header = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *))__pyx_f_6pandas_6parser_10TextReader__get_header; + __pyx_vtable_6pandas_6parser_TextReader._implicit_index_count = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *))__pyx_f_6pandas_6parser_10TextReader__implicit_index_count; + __pyx_vtable_6pandas_6parser_TextReader._read_low_memory = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__read_low_memory; + __pyx_vtable_6pandas_6parser_TextReader._tokenize_rows = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, size_t))__pyx_f_6pandas_6parser_10TextReader__tokenize_rows; + __pyx_vtable_6pandas_6parser_TextReader._read_rows = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, int))__pyx_f_6pandas_6parser_10TextReader__read_rows; + __pyx_vtable_6pandas_6parser_TextReader._start_clock = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *))__pyx_f_6pandas_6parser_10TextReader__start_clock; + __pyx_vtable_6pandas_6parser_TextReader._end_clock = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__end_clock; + __pyx_vtable_6pandas_6parser_TextReader._convert_tokens = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, PyObject *, int, kh_str_t *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__convert_tokens; + __pyx_vtable_6pandas_6parser_TextReader._convert_with_dtype = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, Py_ssize_t, int, int, int, int, kh_str_t *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__convert_with_dtype; + __pyx_vtable_6pandas_6parser_TextReader._string_convert = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, int, int, int, kh_str_t *))__pyx_f_6pandas_6parser_10TextReader__string_convert; + __pyx_vtable_6pandas_6parser_TextReader._get_na_list = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, PyObject *, PyObject *))__pyx_f_6pandas_6parser_10TextReader__get_na_list; + __pyx_vtable_6pandas_6parser_TextReader._free_na_set = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, kh_str_t *))__pyx_f_6pandas_6parser_10TextReader__free_na_set; + __pyx_vtable_6pandas_6parser_TextReader._get_column_name = (PyObject *(*)(struct __pyx_obj_6pandas_6parser_TextReader *, Py_ssize_t, Py_ssize_t))__pyx_f_6pandas_6parser_10TextReader__get_column_name; + if (PyType_Ready(&__pyx_type_6pandas_6parser_TextReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_6parser_TextReader.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_6parser_TextReader.tp_dict, __pyx_vtabptr_6pandas_6parser_TextReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TextReader", (PyObject *)&__pyx_type_6pandas_6parser_TextReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_6parser_TextReader = &__pyx_type_6pandas_6parser_TextReader; + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/parser.pyx":8 + * from libc.string cimport strncpy, strlen, strcmp, strcasecmp + * cimport libc.stdio as stdio + * import warnings # <<<<<<<<<<<<<< + * + * from cpython cimport (PyObject, PyBytes_FromString, + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":13 + * PyBytes_AsString, PyBytes_Check, + * PyUnicode_Check, PyUnicode_AsUTF8String) + * from io.common import DtypeWarning # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_DtypeWarning); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_DtypeWarning); + __Pyx_GIVEREF(__pyx_n_s_DtypeWarning); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_io_common, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_DtypeWarning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DtypeWarning, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":29 + * from numpy cimport ndarray, uint8_t, uint64_t + * + * import numpy as np # <<<<<<<<<<<<<< + * cimport util + * + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":32 + * cimport util + * + * import pandas.lib as lib # <<<<<<<<<<<<<< + * + * import time + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s__45); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__45); + __Pyx_GIVEREF(__pyx_n_s__45); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_lib, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":34 + * import pandas.lib as lib + * + * import time # <<<<<<<<<<<<<< + * import os + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":35 + * + * import time + * import os # <<<<<<<<<<<<<< + * + * cnp.import_array() + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":37 + * import os + * + * cnp.import_array() # <<<<<<<<<<<<<< + * + * from khash cimport * + */ + import_array(); + + /* "pandas/parser.pyx":41 + * from khash cimport * + * + * import sys # <<<<<<<<<<<<<< + * + * cdef bint PY3 = (sys.version_info[0] >= 3) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":43 + * import sys + * + * cdef bint PY3 = (sys.version_info[0] >= 3) # <<<<<<<<<<<<<< + * + * cdef double INF = np.inf + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_6parser_PY3 = __pyx_t_3; + + /* "pandas/parser.pyx":45 + * cdef bint PY3 = (sys.version_info[0] >= 3) + * + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_6parser_INF = ((double)__pyx_t_4); + + /* "pandas/parser.pyx":46 + * + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * + * cdef extern from "headers/stdint.h": + */ + __pyx_v_6pandas_6parser_NEGINF = (-__pyx_v_6pandas_6parser_INF); + + /* "pandas/parser.pyx":65 + * pass + * + * try: # <<<<<<<<<<<<<< + * basestring + * except NameError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/parser.pyx":66 + * + * try: + * basestring # <<<<<<<<<<<<<< + * except NameError: + * basestring = str + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L9_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/parser.pyx":67 + * try: + * basestring + * except NameError: # <<<<<<<<<<<<<< + * basestring = str + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_NameError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.parser", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/parser.pyx":68 + * basestring + * except NameError: + * basestring = str # <<<<<<<<<<<<<< + * + * cdef extern from "parser/tokenizer.h": + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L9_try_end:; + } + + /* "pandas/parser.pyx":222 + * + * + * DEFAULT_CHUNKSIZE = 256 * 1024 # <<<<<<<<<<<<<< + * + * # common NA values + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_CHUNKSIZE, __pyx_int_262144) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/parser.pyx":227 + * # no longer excluding inf representations + * # '1.#INF','-1.#INF', '1.#INF000000', + * _NA_VALUES = [b'-1.#IND', b'1.#QNAN', b'1.#IND', b'-1.#QNAN', # <<<<<<<<<<<<<< + * b'#N/A N/A', b'NA', b'#NA', b'NULL', b'NaN', + * b'nan', b''] + */ + __pyx_t_9 = PyList_New(11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_kp_b_1_IND); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_kp_b_1_IND); + __Pyx_GIVEREF(__pyx_kp_b_1_IND); + __Pyx_INCREF(__pyx_kp_b_1_QNAN); + PyList_SET_ITEM(__pyx_t_9, 1, __pyx_kp_b_1_QNAN); + __Pyx_GIVEREF(__pyx_kp_b_1_QNAN); + __Pyx_INCREF(__pyx_kp_b_1_IND_2); + PyList_SET_ITEM(__pyx_t_9, 2, __pyx_kp_b_1_IND_2); + __Pyx_GIVEREF(__pyx_kp_b_1_IND_2); + __Pyx_INCREF(__pyx_kp_b_1_QNAN_2); + PyList_SET_ITEM(__pyx_t_9, 3, __pyx_kp_b_1_QNAN_2); + __Pyx_GIVEREF(__pyx_kp_b_1_QNAN_2); + __Pyx_INCREF(__pyx_kp_b_N_A_N_A); + PyList_SET_ITEM(__pyx_t_9, 4, __pyx_kp_b_N_A_N_A); + __Pyx_GIVEREF(__pyx_kp_b_N_A_N_A); + __Pyx_INCREF(__pyx_n_b_NA); + PyList_SET_ITEM(__pyx_t_9, 5, __pyx_n_b_NA); + __Pyx_GIVEREF(__pyx_n_b_NA); + __Pyx_INCREF(__pyx_kp_b_NA_2); + PyList_SET_ITEM(__pyx_t_9, 6, __pyx_kp_b_NA_2); + __Pyx_GIVEREF(__pyx_kp_b_NA_2); + __Pyx_INCREF(__pyx_n_b_NULL); + PyList_SET_ITEM(__pyx_t_9, 7, __pyx_n_b_NULL); + __Pyx_GIVEREF(__pyx_n_b_NULL); + __Pyx_INCREF(__pyx_n_b_NaN); + PyList_SET_ITEM(__pyx_t_9, 8, __pyx_n_b_NaN); + __Pyx_GIVEREF(__pyx_n_b_NaN); + __Pyx_INCREF(__pyx_n_b_nan); + PyList_SET_ITEM(__pyx_t_9, 9, __pyx_n_b_nan); + __Pyx_GIVEREF(__pyx_n_b_nan); + __Pyx_INCREF(__pyx_kp_b__16); + PyList_SET_ITEM(__pyx_t_9, 10, __pyx_kp_b__16); + __Pyx_GIVEREF(__pyx_kp_b__16); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA_VALUES, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":276 + * + * memory_map=False, + * tokenize_chunksize=DEFAULT_CHUNKSIZE, # <<<<<<<<<<<<<< + * delim_whitespace=False, + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEFAULT_CHUNKSIZE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_k__2 = __pyx_t_9; + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1158 + * return None + * + * class CParserError(Exception): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_builtin_Exception); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_builtin_Exception); + __Pyx_GIVEREF(__pyx_builtin_Exception); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_9, __pyx_n_s_CParserError, __pyx_n_s_CParserError, (PyObject *) NULL, __pyx_n_s_pandas_parser, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_CParserError, __pyx_t_9, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CParserError, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1162 + * + * + * class OverflowError(ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_9, __pyx_n_s_OverflowError, __pyx_n_s_OverflowError, (PyObject *) NULL, __pyx_n_s_pandas_parser, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OverflowError, __pyx_t_9, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OverflowError, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1165 + * pass + * + * cdef object _true_values = [b'True', b'TRUE', b'true'] # <<<<<<<<<<<<<< + * cdef object _false_values = [b'False', b'FALSE', b'false'] + * + */ + __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_b_True); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_b_True); + __Pyx_GIVEREF(__pyx_n_b_True); + __Pyx_INCREF(__pyx_n_b_TRUE); + PyList_SET_ITEM(__pyx_t_9, 1, __pyx_n_b_TRUE); + __Pyx_GIVEREF(__pyx_n_b_TRUE); + __Pyx_INCREF(__pyx_n_b_true); + PyList_SET_ITEM(__pyx_t_9, 2, __pyx_n_b_true); + __Pyx_GIVEREF(__pyx_n_b_true); + __Pyx_XGOTREF(__pyx_v_6pandas_6parser__true_values); + __Pyx_DECREF_SET(__pyx_v_6pandas_6parser__true_values, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1166 + * + * cdef object _true_values = [b'True', b'TRUE', b'true'] + * cdef object _false_values = [b'False', b'FALSE', b'false'] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_b_False); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_b_False); + __Pyx_GIVEREF(__pyx_n_b_False); + __Pyx_INCREF(__pyx_n_b_FALSE); + PyList_SET_ITEM(__pyx_t_9, 1, __pyx_n_b_FALSE); + __Pyx_GIVEREF(__pyx_n_b_FALSE); + __Pyx_INCREF(__pyx_n_b_false); + PyList_SET_ITEM(__pyx_t_9, 2, __pyx_n_b_false); + __Pyx_GIVEREF(__pyx_n_b_false); + __Pyx_XGOTREF(__pyx_v_6pandas_6parser__false_values); + __Pyx_DECREF_SET(__pyx_v_6pandas_6parser__false_values, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1169 + * + * + * def _ensure_encoded(list lst): # <<<<<<<<<<<<<< + * cdef list result = [] + * for x in lst: + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_1_ensure_encoded, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ensure_encoded, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1187 + * + * + * def _is_file_like(obj): # <<<<<<<<<<<<<< + * if PY3: + * import io + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_3_is_file_like, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_file_like, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1202 + * + * + * def _maybe_upcast(arr): # <<<<<<<<<<<<<< + * """ + * + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_5_maybe_upcast, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_upcast, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1408 + * return result + * + * cdef char* cinf = b'inf' # <<<<<<<<<<<<<< + * cdef char* cneginf = b'-inf' + * + */ + __pyx_v_6pandas_6parser_cinf = __pyx_k_inf; + + /* "pandas/parser.pyx":1409 + * + * cdef char* cinf = b'inf' + * cdef char* cneginf = b'-inf' # <<<<<<<<<<<<<< + * + * cdef _try_double(parser_t *parser, int col, int line_start, int line_end, + */ + __pyx_v_6pandas_6parser_cneginf = __pyx_k_inf_2; + + /* "pandas/parser.pyx":1686 + * + * # TODO: endianness just a placeholder? + * cdef list dtype_cast_order = ['= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (PyDict_SetItem(__pyx_d, __pyx_n_s_k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/parser.pyx":1830 + * + * for k in list(na_values): + * na_values[np.dtype(k)] = na_values[k] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_na_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1871 + * + * + * def _to_structured_array(dict columns, object names): # <<<<<<<<<<<<<< + * cdef: + * ndarray recs, column + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_13_to_structured_array, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_structured_array, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1950 + * + * + * def _maybe_encode(values): # <<<<<<<<<<<<<< + * if values is None: + * return [] + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_6parser_15_maybe_encode, NULL, __pyx_n_s_pandas_parser); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_maybe_encode, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/parser.pyx":1 + * # Copyright (c) 2012, Lambda Foundry, Inc. # <<<<<<<<<<<<<< + * # See LICENSE for the license + * + */ + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.parser", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.parser"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { + PyObject* value; +#if PY_MAJOR_VERSION >= 3 + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (unlikely(PyErr_Occurred())) + return NULL; + value = default_value; + } + Py_INCREF(value); +#else + if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + value = PyDict_GetItem(d, key); + if (unlikely(!value)) { + value = default_value; + } + Py_INCREF(value); + } else { + if (default_value == Py_None) + default_value = NULL; + value = PyObject_CallMethodObjArgs( + d, __pyx_n_s_get, key, default_value, NULL); + } +#endif + return value; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, Py_ssize_t ix) { + PyObject *r, *py_ix; + py_ix = PyInt_FromSsize_t(ix); + if (!py_ix) return NULL; + r = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); + Py_DECREF(py_ix); + return r; +} +static PyObject* __Pyx_PyList_PopIndex(PyObject* L, Py_ssize_t ix) { +#if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = PyList_GET_SIZE(L); + if (likely(size > (((PyListObject*)L)->allocated >> 1))) { + Py_ssize_t cix = ix; + if (cix < 0) { + cix += size; + } + if (likely(0 <= cix && cix < size)) { + PyObject* v = PyList_GET_ITEM(L, cix); + Py_SIZE(L) -= 1; + size -= 1; + memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); + return v; + } + } +#endif + return __Pyx__PyObject_PopIndex(L, ix); +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + length = strlen(cstring); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { + if (PY_MAJOR_VERSION >= 3) + return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s_values, d); + else + return PyDict_Values(d); +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; + } + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(char) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(char)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(char) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(char) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyLong_AsLong) + } else if (sizeof(char) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(char, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(size_t)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (size_t) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(size_t) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(size_t)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(size_t) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(size_t) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong) + } else if (sizeof(size_t) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) { + const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_uint8) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + return (npy_uint8) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_uint8"); + return (npy_uint8) -1; + } + if (sizeof(npy_uint8) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_uint8)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_uint8) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_uint8) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong) + } else if (sizeof(npy_uint8) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_uint8, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_uint8 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_uint8) -1; + } + } else { + npy_uint8 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_uint8) -1; + val = __Pyx_PyInt_As_npy_uint8(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/pandas/src/sparse.c b/cythonized-files3/pandas/src/sparse.c new file mode 100644 index 00000000..4eaa4268 --- /dev/null +++ b/cythonized-files3/pandas/src/sparse.c @@ -0,0 +1,24464 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas___sparse +#define __PYX_HAVE_API__pandas___sparse +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "sparse.pyx", + "numpy.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_7_sparse_SparseIndex; +struct __pyx_obj_6pandas_7_sparse_IntIndex; +struct __pyx_obj_6pandas_7_sparse_BlockIndex; +struct __pyx_obj_6pandas_7_sparse_BlockMerge; +struct __pyx_obj_6pandas_7_sparse_BlockIntersection; +struct __pyx_obj_6pandas_7_sparse_BlockUnion; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "pandas/src/sparse.pyx":688 + * # Sparse arithmetic + * + * ctypedef float64_t (* double_func)(float64_t a, float64_t b) # <<<<<<<<<<<<<< + * + * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex, + */ +typedef __pyx_t_5numpy_float64_t (*__pyx_t_6pandas_7_sparse_double_func)(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); + +/* "pandas/src/sparse.pyx":25 + * + * + * cdef class SparseIndex: # <<<<<<<<<<<<<< + * ''' + * Abstract superclass for sparse index types + */ +struct __pyx_obj_6pandas_7_sparse_SparseIndex { + PyObject_HEAD +}; + + +/* "pandas/src/sparse.pyx":33 + * + * + * cdef class IntIndex(SparseIndex): # <<<<<<<<<<<<<< + * ''' + * Object for holding exact integer sparse indexing information + */ +struct __pyx_obj_6pandas_7_sparse_IntIndex { + struct __pyx_obj_6pandas_7_sparse_SparseIndex __pyx_base; + struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *__pyx_vtab; + Py_ssize_t length; + Py_ssize_t npoints; + PyArrayObject *indices; +}; + + +/* "pandas/src/sparse.pyx":259 + * # BlockIndex + * + * cdef class BlockIndex(SparseIndex): # <<<<<<<<<<<<<< + * ''' + * Object for holding block-based sparse indexing information + */ +struct __pyx_obj_6pandas_7_sparse_BlockIndex { + struct __pyx_obj_6pandas_7_sparse_SparseIndex __pyx_base; + struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *__pyx_vtab; + Py_ssize_t nblocks; + Py_ssize_t npoints; + Py_ssize_t length; + PyArrayObject *blocs; + PyArrayObject *blengths; + PyObject *__weakref__; + __pyx_t_5numpy_int32_t *locbuf; + __pyx_t_5numpy_int32_t *lenbuf; +}; + + +/* "pandas/src/sparse.pyx":527 + * + * + * cdef class BlockMerge(object): # <<<<<<<<<<<<<< + * ''' + * Object-oriented approach makes sharing state between recursive functions a + */ +struct __pyx_obj_6pandas_7_sparse_BlockMerge { + PyObject_HEAD + struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *__pyx_vtab; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *x; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *y; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *result; + PyArrayObject *xstart; + PyArrayObject *xlen; + PyArrayObject *xend; + PyArrayObject *ystart; + PyArrayObject *ylen; + PyArrayObject *yend; + __pyx_t_5numpy_int32_t xi; + __pyx_t_5numpy_int32_t yi; +}; + + +/* "pandas/src/sparse.pyx":569 + * self.yi = xi + * + * cdef class BlockIntersection(BlockMerge): # <<<<<<<<<<<<<< + * ''' + * not done yet + */ +struct __pyx_obj_6pandas_7_sparse_BlockIntersection { + struct __pyx_obj_6pandas_7_sparse_BlockMerge __pyx_base; +}; + + +/* "pandas/src/sparse.pyx":575 + * pass + * + * cdef class BlockUnion(BlockMerge): # <<<<<<<<<<<<<< + * ''' + * Object-oriented approach makes sharing state between recursive functions a + */ +struct __pyx_obj_6pandas_7_sparse_BlockUnion { + struct __pyx_obj_6pandas_7_sparse_BlockMerge __pyx_base; +}; + + + +/* "pandas/src/sparse.pyx":33 + * + * + * cdef class IntIndex(SparseIndex): # <<<<<<<<<<<<<< + * ''' + * Object for holding exact integer sparse indexing information + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex { + struct __pyx_obj_6pandas_7_sparse_IntIndex *(*intersect)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + struct __pyx_obj_6pandas_7_sparse_IntIndex *(*make_union)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + PyObject *(*lookup)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, Py_ssize_t, int __pyx_skip_dispatch); + PyArrayObject *(*reindex)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + PyObject *(*put)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*take)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *__pyx_vtabptr_6pandas_7_sparse_IntIndex; + + +/* "pandas/src/sparse.pyx":259 + * # BlockIndex + * + * cdef class BlockIndex(SparseIndex): # <<<<<<<<<<<<<< + * ''' + * Object for holding block-based sparse indexing information + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex { + PyObject *(*check_integrity)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, int __pyx_skip_dispatch); + struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*intersect)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*make_union)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + PyObject *(*lookup)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, Py_ssize_t, int __pyx_skip_dispatch); + PyArrayObject *(*reindex)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); + PyObject *(*put)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*take)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *__pyx_vtabptr_6pandas_7_sparse_BlockIndex; + + +/* "pandas/src/sparse.pyx":527 + * + * + * cdef class BlockMerge(object): # <<<<<<<<<<<<<< + * ''' + * Object-oriented approach makes sharing state between recursive functions a + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge { + PyObject *(*_make_merged_blocks)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *); + PyObject *(*_set_current_indices)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t, int); +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *__pyx_vtabptr_6pandas_7_sparse_BlockMerge; + + +/* "pandas/src/sparse.pyx":569 + * self.yi = xi + * + * cdef class BlockIntersection(BlockMerge): # <<<<<<<<<<<<<< + * ''' + * not done yet + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection { + struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection *__pyx_vtabptr_6pandas_7_sparse_BlockIntersection; + + +/* "pandas/src/sparse.pyx":575 + * pass + * + * cdef class BlockUnion(BlockMerge): # <<<<<<<<<<<<<< + * ''' + * Object-oriented approach makes sharing state between recursive functions a + */ + +struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion { + struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_base; + __pyx_t_5numpy_int32_t (*_find_next_block_end)(struct __pyx_obj_6pandas_7_sparse_BlockUnion *, int); +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *__pyx_vtabptr_6pandas_7_sparse_BlockUnion; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/ + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); /*proto*/ + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static int __Pyx_check_binary_version(void); + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'pandas._sparse' */ +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_SparseIndex = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_IntIndex = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockIndex = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockMerge = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockIntersection = 0; +static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockUnion = 0; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_7_sparse_NaN; +static __pyx_t_5numpy_float64_t __pyx_v_6pandas_7_sparse_INF; +static PyObject *__pyx_f_6pandas_7_sparse_get_blocks(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_nancombine(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_combine(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_nanop(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_op(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_BlockIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_BlockIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_op(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___add(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___sub(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rsub(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___div(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rdiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___floordiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rfloordiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___mul(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___pow(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rpow(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanadd(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nansub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrsub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanmul(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nandiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrdiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_add(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_sub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rsub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_mul(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_div(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rdiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_floordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_pow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +#define __Pyx_MODULE_NAME "pandas._sparse" +int __pyx_module_is_main_pandas___sparse = 0; + +/* Implementation of 'pandas._sparse' */ +static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_RuntimeError; +static int __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7_sparse_8IntIndex___init__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_length, PyObject *__pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_8equals(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_22reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_24put(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_26take(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_get_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices); /* proto */ +static int __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_blocs, PyObject *__pyx_v_blengths); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_22reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_24put(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_26take(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */ +static int __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_2sparse_nanadd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_4sparse_nansub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_6sparse_nanrsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_8sparse_nanmul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_10sparse_nandiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_12sparse_nanrdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_14sparse_nanfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_16sparse_nanrfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_18sparse_nanpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_20sparse_nanrpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_22sparse_add(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_24sparse_sub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_26sparse_rsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_28sparse_mul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_30sparse_div(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_32sparse_rdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_34sparse_floordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_36sparse_rfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_38sparse_pow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_40sparse_rpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_42get_reindexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_index_map); /* proto */ +static PyObject *__pyx_pf_6pandas_7_sparse_44reindex_integer(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index, CYTHON_UNUSED PyArrayObject *__pyx_v_indexer); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_7_sparse_SparseIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_IntIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockMerge(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIntersection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockUnion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_B[] = "B"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k_idx[] = "idx"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_put[] = "put"; +static char __pyx_k_sum[] = "sum"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_fill[] = "fill"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_take[] = "take"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_blocs[] = "blocs"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_ngaps[] = "ngaps"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_other[] = "other_"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_xfill[] = "xfill"; +static char __pyx_k_yfill[] = "yfill"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_length[] = "length"; +static char __pyx_k_lookup[] = "lookup"; +static char __pyx_k_to_put[] = "to_put"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_xindex[] = "xindex"; +static char __pyx_k_yindex[] = "yindex"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_indexer[] = "indexer"; +static char __pyx_k_indices[] = "indices"; +static char __pyx_k_reindex[] = "reindex"; +static char __pyx_k_IntIndex[] = "IntIndex\n"; +static char __pyx_k_blengths[] = "blengths"; +static char __pyx_k_operator[] = "operator"; +static char __pyx_k_property[] = "property"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_Indices_s[] = "Indices: %s\n"; +static char __pyx_k_index_map[] = "index_map"; +static char __pyx_k_intersect[] = "intersect"; +static char __pyx_k_BlockIndex[] = "BlockIndex\n"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_fill_value[] = "fill_value"; +static char __pyx_k_make_union[] = "make_union"; +static char __pyx_k_new_length[] = "new_length"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_sparse_div[] = "sparse_div"; +static char __pyx_k_array_equal[] = "array_equal"; +static char __pyx_k_sparse_rdiv[] = "sparse_rdiv"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_searchsorted[] = "searchsorted"; +static char __pyx_k_sparse_index[] = "sparse_index"; +static char __pyx_k_to_int_index[] = "to_int_index"; +static char __pyx_k_get_reindexer[] = "get_reindexer"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_sparse_nandiv[] = "sparse_nandiv"; +static char __pyx_k_pandas__sparse[] = "pandas._sparse"; +static char __pyx_k_sparse_nanrdiv[] = "sparse_nanrdiv"; +static char __pyx_k_sparse_truediv[] = "sparse_truediv"; +static char __pyx_k_to_block_index[] = "to_block_index"; +static char __pyx_k_Block_lengths_s[] = "Block lengths: %s"; +static char __pyx_k_check_integrity[] = "check_integrity"; +static char __pyx_k_reindex_integer[] = "reindex_integer"; +static char __pyx_k_sparse_rtruediv[] = "sparse_rtruediv"; +static char __pyx_k_Block_d_overlaps[] = "Block %d overlaps"; +static char __pyx_k_Block_locations_s[] = "Block locations: %s\n"; +static char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_sparse_nantruediv[] = "sparse_nantruediv"; +static char __pyx_k_sparse_nanrtruediv[] = "sparse_nanrtruediv"; +static char __pyx_k_Mode_must_be_0_or_1[] = "Mode must be 0 or 1"; +static char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static char __pyx_k_Zero_length_block_d[] = "Zero-length block %d"; +static char __pyx_k_Block_d_extends_beyond_end[] = "Block %d extends beyond end"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_block_bound_arrays_must_be_same[] = "block bound arrays must be same length"; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/src/sparse.pyx"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Indices_must_reference_same_unde[] = "Indices must reference same underlying length"; +static char __pyx_k_Locations_not_in_ascending_order[] = "Locations not in ascending order"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_BlockIndex; +static PyObject *__pyx_kp_s_Block_d_extends_beyond_end; +static PyObject *__pyx_kp_s_Block_d_overlaps; +static PyObject *__pyx_kp_s_Block_lengths_s; +static PyObject *__pyx_kp_s_Block_locations_s; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_kp_s_Indices_must_reference_same_unde; +static PyObject *__pyx_kp_s_Indices_s; +static PyObject *__pyx_n_s_IntIndex; +static PyObject *__pyx_kp_s_Locations_not_in_ascending_order; +static PyObject *__pyx_kp_s_Mode_must_be_0_or_1; +static PyObject *__pyx_n_s_NaN; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s_Zero_length_block_d; +static PyObject *__pyx_n_s_array_equal; +static PyObject *__pyx_n_s_ascontiguousarray; +static PyObject *__pyx_n_s_blengths; +static PyObject *__pyx_kp_s_block_bound_arrays_must_be_same; +static PyObject *__pyx_n_s_blocs; +static PyObject *__pyx_n_s_check_integrity; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_fill; +static PyObject *__pyx_n_s_fill_value; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_get_reindexer; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_index_map; +static PyObject *__pyx_n_s_indexer; +static PyObject *__pyx_n_s_indices; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_intersect; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_lookup; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_union; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_new_length; +static PyObject *__pyx_n_s_ngaps; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_operator; +static PyObject *__pyx_n_s_other; +static PyObject *__pyx_n_s_pandas__sparse; +static PyObject *__pyx_n_s_property; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reindex; +static PyObject *__pyx_n_s_reindex_integer; +static PyObject *__pyx_n_s_searchsorted; +static PyObject *__pyx_n_s_sparse_div; +static PyObject *__pyx_n_s_sparse_index; +static PyObject *__pyx_n_s_sparse_nandiv; +static PyObject *__pyx_n_s_sparse_nanrdiv; +static PyObject *__pyx_n_s_sparse_nanrtruediv; +static PyObject *__pyx_n_s_sparse_nantruediv; +static PyObject *__pyx_n_s_sparse_rdiv; +static PyObject *__pyx_n_s_sparse_rtruediv; +static PyObject *__pyx_n_s_sparse_truediv; +static PyObject *__pyx_n_s_sum; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_take; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_to_block_index; +static PyObject *__pyx_n_s_to_int_index; +static PyObject *__pyx_n_s_to_put; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xfill; +static PyObject *__pyx_n_s_xindex; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_n_s_yfill; +static PyObject *__pyx_n_s_yindex; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__17; + +/* "pandas/src/sparse.pyx":19 + * cdef float64_t INF = np.inf + * + * cdef inline int int_max(int a, int b): return a if a >= b else b # <<<<<<<<<<<<<< + * cdef inline int int_min(int a, int b): return a if a <= b else b + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_7_sparse_int_max(int __pyx_v_a, int __pyx_v_b) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("int_max", 0); + if (((__pyx_v_a >= __pyx_v_b) != 0)) { + __pyx_t_1 = __pyx_v_a; + } else { + __pyx_t_1 = __pyx_v_b; + } + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":20 + * + * cdef inline int int_max(int a, int b): return a if a >= b else b + * cdef inline int int_min(int a, int b): return a if a <= b else b # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + +static CYTHON_INLINE int __pyx_f_6pandas_7_sparse_int_min(int __pyx_v_a, int __pyx_v_b) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("int_min", 0); + if (((__pyx_v_a <= __pyx_v_b) != 0)) { + __pyx_t_1 = __pyx_v_a; + } else { + __pyx_t_1 = __pyx_v_b; + } + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":29 + * Abstract superclass for sparse index types + * ''' + * def __init__(self): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/sparse.pyx":30 + * ''' + * def __init__(self): + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":29 + * Abstract superclass for sparse index types + * ''' + * def __init__(self): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas._sparse.SparseIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":47 + * ndarray indices + * + * def __init__(self, Py_ssize_t length, indices): # <<<<<<<<<<<<<< + * self.length = length + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_indices = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_indices,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_length = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_indices = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex___init__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_length, __pyx_v_indices); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7_sparse_8IntIndex___init__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_length, PyObject *__pyx_v_indices) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/sparse.pyx":48 + * + * def __init__(self, Py_ssize_t length, indices): + * self.length = length # <<<<<<<<<<<<<< + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) + * self.npoints = len(self.indices) + */ + __pyx_v_self->length = __pyx_v_length; + + /* "pandas/src/sparse.pyx":49 + * def __init__(self, Py_ssize_t length, indices): + * self.length = length + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) # <<<<<<<<<<<<<< + * self.npoints = len(self.indices) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_indices); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices); + __Pyx_GIVEREF(__pyx_v_indices); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->indices); + __Pyx_DECREF(((PyObject *)__pyx_v_self->indices)); + __pyx_v_self->indices = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":50 + * self.length = length + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) + * self.npoints = len(self.indices) # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + __pyx_t_5 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_self->npoints = __pyx_t_6; + + /* "pandas/src/sparse.pyx":47 + * ndarray indices + * + * def __init__(self, Py_ssize_t length, indices): # <<<<<<<<<<<<<< + * self.length = length + * self.indices = np.ascontiguousarray(indices, dtype=np.int32) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas._sparse.IntIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":52 + * self.npoints = len(self.indices) + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * args = (self.length, self.indices) + * return (IntIndex, args) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "pandas/src/sparse.pyx":53 + * + * def __reduce__(self): + * args = (self.length, self.indices) # <<<<<<<<<<<<<< + * return (IntIndex, args) + * + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices)); + __pyx_t_1 = 0; + __pyx_v_args = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":54 + * def __reduce__(self): + * args = (self.length, self.indices) + * return (IntIndex, args) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex))); + __Pyx_INCREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":52 + * self.npoints = len(self.indices) + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * args = (self.length, self.indices) + * return (IntIndex, args) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.IntIndex.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":56 + * return (IntIndex, args) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * output = 'IntIndex\n' + * output += 'Indices: %s\n' % repr(self.indices) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "pandas/src/sparse.pyx":57 + * + * def __repr__(self): + * output = 'IntIndex\n' # <<<<<<<<<<<<<< + * output += 'Indices: %s\n' % repr(self.indices) + * return output + */ + __Pyx_INCREF(__pyx_n_s_IntIndex); + __pyx_v_output = __pyx_n_s_IntIndex; + + /* "pandas/src/sparse.pyx":58 + * def __repr__(self): + * output = 'IntIndex\n' + * output += 'Indices: %s\n' % repr(self.indices) # <<<<<<<<<<<<<< + * return output + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Indices_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":59 + * output = 'IntIndex\n' + * output += 'Indices: %s\n' % repr(self.indices) + * return output # <<<<<<<<<<<<<< + * + * def check_integrity(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_output); + __pyx_r = __pyx_v_output; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":56 + * return (IntIndex, args) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * output = 'IntIndex\n' + * output += 'Indices: %s\n' % repr(self.indices) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.IntIndex.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":61 + * return output + * + * def check_integrity(self): # <<<<<<<<<<<<<< + * ''' + * Only need be strictly ascending and nothing less than 0 or greater than + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_8IntIndex_6check_integrity[] = "\n Only need be strictly ascending and nothing less than 0 or greater than\n totall ength\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_integrity (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_integrity", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":68 + * pass + * + * def equals(self, other): # <<<<<<<<<<<<<< + * if not isinstance(other, IntIndex): + * return False + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_8equals(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_8equals(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_same_length = NULL; + PyObject *__pyx_v_same_indices = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "pandas/src/sparse.pyx":69 + * + * def equals(self, other): + * if not isinstance(other, IntIndex): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/sparse.pyx":70 + * def equals(self, other): + * if not isinstance(other, IntIndex): + * return False # <<<<<<<<<<<<<< + * + * if self is other: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":72 + * return False + * + * if self is other: # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_2 = (((PyObject *)__pyx_v_self) == __pyx_v_other); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":73 + * + * if self is other: + * return True # <<<<<<<<<<<<<< + * + * same_length = self.length == other.length + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":75 + * return True + * + * same_length = self.length == other.length # <<<<<<<<<<<<<< + * same_indices = np.array_equal(self.indices, other.indices) + * return same_length and same_indices + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_same_length = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":76 + * + * same_length = self.length == other.length + * same_indices = np.array_equal(self.indices, other.indices) # <<<<<<<<<<<<<< + * return same_length and same_indices + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->indices)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_same_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":77 + * same_length = self.length == other.length + * same_indices = np.array_equal(self.indices, other.indices) + * return same_length and same_indices # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_same_length); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __Pyx_INCREF(__pyx_v_same_indices); + __pyx_t_5 = __pyx_v_same_indices; + } else { + __Pyx_INCREF(__pyx_v_same_length); + __pyx_t_5 = __pyx_v_same_length; + } + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":68 + * pass + * + * def equals(self, other): # <<<<<<<<<<<<<< + * if not isinstance(other, IntIndex): + * return False + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas._sparse.IntIndex.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_same_length); + __Pyx_XDECREF(__pyx_v_same_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":80 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ngaps (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ngaps", 0); + + /* "pandas/src/sparse.pyx":81 + * @property + * def ngaps(self): + * return self.length - self.npoints # <<<<<<<<<<<<<< + * + * def to_int_index(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->length - __pyx_v_self->npoints)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":80 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.ngaps", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":83 + * return self.length - self.npoints + * + * def to_int_index(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_int_index (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_int_index", 0); + + /* "pandas/src/sparse.pyx":84 + * + * def to_int_index(self): + * return self # <<<<<<<<<<<<<< + * + * def to_block_index(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":83 + * return self.length - self.npoints + * + * def to_int_index(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":86 + * return self + * + * def to_block_index(self): # <<<<<<<<<<<<<< + * locs, lens = get_blocks(self.indices) + * return BlockIndex(self.length, locs, lens) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_block_index (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_v_locs = NULL; + PyObject *__pyx_v_lens = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_block_index", 0); + + /* "pandas/src/sparse.pyx":87 + * + * def to_block_index(self): + * locs, lens = get_blocks(self.indices) # <<<<<<<<<<<<<< + * return BlockIndex(self.length, locs, lens) + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6pandas_7_sparse_get_blocks(((PyArrayObject *)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + __pyx_v_locs = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_lens = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":88 + * def to_block_index(self): + * locs, lens = get_blocks(self.indices) + * return BlockIndex(self.length, locs, lens) # <<<<<<<<<<<<<< + * + * cpdef IntIndex intersect(self, SparseIndex y_): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_locs); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_locs); + __Pyx_GIVEREF(__pyx_v_locs); + __Pyx_INCREF(__pyx_v_lens); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_lens); + __Pyx_GIVEREF(__pyx_v_lens); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":86 + * return self + * + * def to_block_index(self): # <<<<<<<<<<<<<< + * locs, lens = get_blocks(self.indices) + * return BlockIndex(self.length, locs, lens) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas._sparse.IntIndex.to_block_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_locs); + __Pyx_XDECREF(__pyx_v_lens); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":90 + * return BlockIndex(self.length, locs, lens) + * + * cpdef IntIndex intersect(self, SparseIndex y_): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t out_length, xi, yi = 0 + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/ +static struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_f_6pandas_7_sparse_8IntIndex_intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + __pyx_t_5numpy_int32_t __pyx_v_xind; + PyArrayObject *__pyx_v_xindices = 0; + PyArrayObject *__pyx_v_yindices = 0; + PyObject *__pyx_v_new_list = 0; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_y = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices; + __Pyx_Buffer __pyx_pybuffer_xindices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices; + __Pyx_Buffer __pyx_pybuffer_yindices; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersect", 0); + __pyx_pybuffer_xindices.pybuffer.buf = NULL; + __pyx_pybuffer_xindices.refcount = 0; + __pyx_pybuffernd_xindices.data = NULL; + __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices; + __pyx_pybuffer_yindices.pybuffer.buf = NULL; + __pyx_pybuffer_yindices.refcount = 0; + __pyx_pybuffernd_yindices.data = NULL; + __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_intersect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_y_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_y_)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":92 + * cpdef IntIndex intersect(self, SparseIndex y_): + * cdef: + * Py_ssize_t out_length, xi, yi = 0 # <<<<<<<<<<<<<< + * int32_t xind + * ndarray[int32_t, ndim=1] xindices, yindices + */ + __pyx_v_yi = 0; + + /* "pandas/src/sparse.pyx":95 + * int32_t xind + * ndarray[int32_t, ndim=1] xindices, yindices + * list new_list = [] # <<<<<<<<<<<<<< + * IntIndex y + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_new_list = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":99 + * + * # if is one already, returns self + * y = y_.to_int_index() # <<<<<<<<<<<<<< + * + * if self.length != y.length: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":101 + * y = y_.to_int_index() + * + * if self.length != y.length: # <<<<<<<<<<<<<< + * raise Exception('Indices must reference same underlying length') + * + */ + __pyx_t_4 = ((__pyx_v_self->length != __pyx_v_y->length) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":102 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xindices = self.indices + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":104 + * raise Exception('Indices must reference same underlying length') + * + * xindices = self.indices # <<<<<<<<<<<<<< + * yindices = y.indices + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xindices = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":105 + * + * xindices = self.indices + * yindices = y.indices # <<<<<<<<<<<<<< + * + * for xi from 0 <= xi < self.npoints: + */ + __pyx_t_3 = ((PyObject *)__pyx_v_y->indices); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yindices = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":107 + * yindices = y.indices + * + * for xi from 0 <= xi < self.npoints: # <<<<<<<<<<<<<< + * xind = xindices[xi] + * + */ + __pyx_t_9 = __pyx_v_self->npoints; + for (__pyx_v_xi = 0; __pyx_v_xi < __pyx_t_9; __pyx_v_xi++) { + + /* "pandas/src/sparse.pyx":108 + * + * for xi from 0 <= xi < self.npoints: + * xind = xindices[xi] # <<<<<<<<<<<<<< + * + * while yi < y.npoints and yindices[yi] < xind: + */ + __pyx_t_10 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_xindices.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_xindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xind = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_xindices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":110 + * xind = xindices[xi] + * + * while yi < y.npoints and yindices[yi] < xind: # <<<<<<<<<<<<<< + * yi += 1 + * + */ + while (1) { + __pyx_t_4 = ((__pyx_v_yi < __pyx_v_y->npoints) != 0); + if (__pyx_t_4) { + __pyx_t_11 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_yindices.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_yindices.diminfo[0].strides)) < __pyx_v_xind) != 0); + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_4; + } + if (!__pyx_t_13) break; + + /* "pandas/src/sparse.pyx":111 + * + * while yi < y.npoints and yindices[yi] < xind: + * yi += 1 # <<<<<<<<<<<<<< + * + * if yi >= y.npoints: + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":113 + * yi += 1 + * + * if yi >= y.npoints: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_13 = ((__pyx_v_yi >= __pyx_v_y->npoints) != 0); + if (__pyx_t_13) { + + /* "pandas/src/sparse.pyx":114 + * + * if yi >= y.npoints: + * break # <<<<<<<<<<<<<< + * + * # TODO: would a two-pass algorithm be faster? + */ + goto __pyx_L5_break; + } + + /* "pandas/src/sparse.pyx":117 + * + * # TODO: would a two-pass algorithm be faster? + * if yindices[yi] == xind: # <<<<<<<<<<<<<< + * new_list.append(xind) + * + */ + __pyx_t_14 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_yindices.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_yindices.diminfo[0].strides)) == __pyx_v_xind) != 0); + if (__pyx_t_13) { + + /* "pandas/src/sparse.pyx":118 + * # TODO: would a two-pass algorithm be faster? + * if yindices[yi] == xind: + * new_list.append(xind) # <<<<<<<<<<<<<< + * + * return IntIndex(self.length, new_list) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_3); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L9; + } + __pyx_L9:; + } + __pyx_L5_break:; + + /* "pandas/src/sparse.pyx":120 + * new_list.append(xind) + * + * return IntIndex(self.length, new_list) # <<<<<<<<<<<<<< + * + * cpdef IntIndex make_union(self, SparseIndex y_): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_new_list); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_new_list); + __Pyx_GIVEREF(__pyx_v_new_list); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":90 + * return BlockIndex(self.length, locs, lens) + * + * cpdef IntIndex intersect(self, SparseIndex y_): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t out_length, xi, yi = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_xindices); + __Pyx_XDECREF((PyObject *)__pyx_v_yindices); + __Pyx_XDECREF(__pyx_v_new_list); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersect (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y_)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersect", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->intersect(__pyx_v_self, __pyx_v_y_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":122 + * return IntIndex(self.length, new_list) + * + * cpdef IntIndex make_union(self, SparseIndex y_): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t out_length, i, xi, yi + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/ +static struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_f_6pandas_7_sparse_8IntIndex_make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + __pyx_t_5numpy_int32_t __pyx_v_xind; + PyArrayObject *__pyx_v_xindices = 0; + PyArrayObject *__pyx_v_yindices = 0; + PyObject *__pyx_v_new_list = 0; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_y = 0; + PyObject *__pyx_v_yind = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices; + __Pyx_Buffer __pyx_pybuffer_xindices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices; + __Pyx_Buffer __pyx_pybuffer_yindices; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_union", 0); + __pyx_pybuffer_xindices.pybuffer.buf = NULL; + __pyx_pybuffer_xindices.refcount = 0; + __pyx_pybuffernd_xindices.data = NULL; + __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices; + __pyx_pybuffer_yindices.pybuffer.buf = NULL; + __pyx_pybuffer_yindices.refcount = 0; + __pyx_pybuffernd_yindices.data = NULL; + __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_y_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_y_)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":127 + * int32_t xind + * ndarray[int32_t, ndim=1] xindices, yindices + * list new_list = [] # <<<<<<<<<<<<<< + * IntIndex x, y + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_new_list = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":130 + * IntIndex x, y + * + * x = self # <<<<<<<<<<<<<< + * + * # if is one already, returns self + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_v_x = __pyx_v_self; + + /* "pandas/src/sparse.pyx":133 + * + * # if is one already, returns self + * y = y_.to_int_index() # <<<<<<<<<<<<<< + * + * if self.length != y.length: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":135 + * y = y_.to_int_index() + * + * if self.length != y.length: # <<<<<<<<<<<<<< + * raise Exception('Indices must reference same underlying length') + * + */ + __pyx_t_4 = ((__pyx_v_self->length != __pyx_v_y->length) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":136 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xindices = self.indices + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":138 + * raise Exception('Indices must reference same underlying length') + * + * xindices = self.indices # <<<<<<<<<<<<<< + * yindices = y.indices + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xindices = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":139 + * + * xindices = self.indices + * yindices = y.indices # <<<<<<<<<<<<<< + * + * xi = yi = 0 + */ + __pyx_t_3 = ((PyObject *)__pyx_v_y->indices); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yindices = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":141 + * yindices = y.indices + * + * xi = yi = 0 # <<<<<<<<<<<<<< + * while True: + * if xi == x.npoints: + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + + /* "pandas/src/sparse.pyx":142 + * + * xi = yi = 0 + * while True: # <<<<<<<<<<<<<< + * if xi == x.npoints: + * while yi < y.npoints: + */ + while (1) { + + /* "pandas/src/sparse.pyx":143 + * xi = yi = 0 + * while True: + * if xi == x.npoints: # <<<<<<<<<<<<<< + * while yi < y.npoints: + * new_list.append(yindices[yi]) + */ + __pyx_t_4 = ((__pyx_v_xi == __pyx_v_x->npoints) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":144 + * while True: + * if xi == x.npoints: + * while yi < y.npoints: # <<<<<<<<<<<<<< + * new_list.append(yindices[yi]) + * yi += 1 + */ + while (1) { + __pyx_t_4 = ((__pyx_v_yi < __pyx_v_y->npoints) != 0); + if (!__pyx_t_4) break; + + /* "pandas/src/sparse.pyx":145 + * if xi == x.npoints: + * while yi < y.npoints: + * new_list.append(yindices[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * break + */ + __pyx_t_9 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_yindices.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_yindices.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":146 + * while yi < y.npoints: + * new_list.append(yindices[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * break + * elif yi == y.npoints: + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":147 + * new_list.append(yindices[yi]) + * yi += 1 + * break # <<<<<<<<<<<<<< + * elif yi == y.npoints: + * while xi < x.npoints: + */ + goto __pyx_L5_break; + } + + /* "pandas/src/sparse.pyx":148 + * yi += 1 + * break + * elif yi == y.npoints: # <<<<<<<<<<<<<< + * while xi < x.npoints: + * new_list.append(xindices[xi]) + */ + __pyx_t_4 = ((__pyx_v_yi == __pyx_v_y->npoints) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":149 + * break + * elif yi == y.npoints: + * while xi < x.npoints: # <<<<<<<<<<<<<< + * new_list.append(xindices[xi]) + * xi += 1 + */ + while (1) { + __pyx_t_4 = ((__pyx_v_xi < __pyx_v_x->npoints) != 0); + if (!__pyx_t_4) break; + + /* "pandas/src/sparse.pyx":150 + * elif yi == y.npoints: + * while xi < x.npoints: + * new_list.append(xindices[xi]) # <<<<<<<<<<<<<< + * xi += 1 + * break + */ + __pyx_t_11 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_xindices.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_xindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_xindices.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":151 + * while xi < x.npoints: + * new_list.append(xindices[xi]) + * xi += 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + } + + /* "pandas/src/sparse.pyx":152 + * new_list.append(xindices[xi]) + * xi += 1 + * break # <<<<<<<<<<<<<< + * + * xind = xindices[xi] + */ + goto __pyx_L5_break; + } + + /* "pandas/src/sparse.pyx":154 + * break + * + * xind = xindices[xi] # <<<<<<<<<<<<<< + * yind = yindices[yi] + * + */ + __pyx_t_12 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_xindices.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_xindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xind = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_xindices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":155 + * + * xind = xindices[xi] + * yind = yindices[yi] # <<<<<<<<<<<<<< + * + * if xind == yind: + */ + __pyx_t_13 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_yindices.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_yindices.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_yind, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":157 + * yind = yindices[yi] + * + * if xind == yind: # <<<<<<<<<<<<<< + * new_list.append(xind) + * xi += 1 + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_yind, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":158 + * + * if xind == yind: + * new_list.append(xind) # <<<<<<<<<<<<<< + * xi += 1 + * yi += 1 + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":159 + * if xind == yind: + * new_list.append(xind) + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * elif xind < yind: + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":160 + * new_list.append(xind) + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * elif xind < yind: + * new_list.append(xind) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + goto __pyx_L11; + } + + /* "pandas/src/sparse.pyx":161 + * xi += 1 + * yi += 1 + * elif xind < yind: # <<<<<<<<<<<<<< + * new_list.append(xind) + * xi += 1 + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_yind, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":162 + * yi += 1 + * elif xind < yind: + * new_list.append(xind) # <<<<<<<<<<<<<< + * xi += 1 + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_3); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":163 + * elif xind < yind: + * new_list.append(xind) + * xi += 1 # <<<<<<<<<<<<<< + * else: + * new_list.append(yind) + */ + __pyx_v_xi = (__pyx_v_xi + 1); + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":165 + * xi += 1 + * else: + * new_list.append(yind) # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_v_yind); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":166 + * else: + * new_list.append(yind) + * yi += 1 # <<<<<<<<<<<<<< + * + * return IntIndex(x.length, new_list) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + __pyx_L11:; + } + __pyx_L5_break:; + + /* "pandas/src/sparse.pyx":168 + * yi += 1 + * + * return IntIndex(x.length, new_list) # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_x->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_new_list); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_new_list); + __Pyx_GIVEREF(__pyx_v_new_list); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":122 + * return IntIndex(self.length, new_list) + * + * cpdef IntIndex make_union(self, SparseIndex y_): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t out_length, i, xi, yi + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_xindices); + __Pyx_XDECREF((PyObject *)__pyx_v_yindices); + __Pyx_XDECREF(__pyx_v_new_list); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF(__pyx_v_yind); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_union (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y_)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_union", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->make_union(__pyx_v_self, __pyx_v_y_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":171 + * + * @cython.wraparound(False) + * cpdef lookup(self, Py_ssize_t index): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t res, n, cum_len = 0 + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_res; + CYTHON_UNUSED Py_ssize_t __pyx_v_cum_len; + PyArrayObject *__pyx_v_inds = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_inds; + __Pyx_Buffer __pyx_pybuffer_inds; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_inds.pybuffer.buf = NULL; + __pyx_pybuffer_inds.refcount = 0; + __pyx_pybuffernd_inds.data = NULL; + __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":173 + * cpdef lookup(self, Py_ssize_t index): + * cdef: + * Py_ssize_t res, n, cum_len = 0 # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] inds + * + */ + __pyx_v_cum_len = 0; + + /* "pandas/src/sparse.pyx":176 + * ndarray[int32_t, ndim=1] inds + * + * inds = self.indices # <<<<<<<<<<<<<< + * res = inds.searchsorted(index) + * if res == self.npoints: + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_inds = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":177 + * + * inds = self.indices + * res = inds.searchsorted(index) # <<<<<<<<<<<<<< + * if res == self.npoints: + * return -1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_inds), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_res = __pyx_t_8; + + /* "pandas/src/sparse.pyx":178 + * inds = self.indices + * res = inds.searchsorted(index) + * if res == self.npoints: # <<<<<<<<<<<<<< + * return -1 + * elif inds[res] == index: + */ + __pyx_t_9 = ((__pyx_v_res == __pyx_v_self->npoints) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":179 + * res = inds.searchsorted(index) + * if res == self.npoints: + * return -1 # <<<<<<<<<<<<<< + * elif inds[res] == index: + * return res + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":180 + * if res == self.npoints: + * return -1 + * elif inds[res] == index: # <<<<<<<<<<<<<< + * return res + * else: + */ + __pyx_t_8 = __pyx_v_res; + __pyx_t_4 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_inds.diminfo[0].strides)) == __pyx_v_index) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":181 + * return -1 + * elif inds[res] == index: + * return res # <<<<<<<<<<<<<< + * else: + * return -1 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":183 + * return res + * else: + * return -1 # <<<<<<<<<<<<<< + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":171 + * + * @cython.wraparound(False) + * cpdef lookup(self, Py_ssize_t index): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t res, n, cum_len = 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_inds); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) { + Py_ssize_t __pyx_v_index; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + assert(__pyx_arg_index); { + __pyx_v_index = __Pyx_PyIndex_AsSsize_t(__pyx_arg_index); if (unlikely((__pyx_v_index == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((Py_ssize_t)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->lookup(__pyx_v_self, __pyx_v_index, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":185 + * return -1 + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * float64_t fill_value, SparseIndex other_): + * cdef: + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_7_sparse_8IntIndex_reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_other = 0; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_sinds = 0; + PyArrayObject *__pyx_v_oinds = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_oinds; + __Pyx_Buffer __pyx_pybuffer_oinds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_sinds; + __Pyx_Buffer __pyx_pybuffer_sinds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_sinds.pybuffer.buf = NULL; + __pyx_pybuffer_sinds.refcount = 0; + __pyx_pybuffernd_sinds.data = NULL; + __pyx_pybuffernd_sinds.rcbuffer = &__pyx_pybuffer_sinds; + __pyx_pybuffer_oinds.pybuffer.buf = NULL; + __pyx_pybuffer_oinds.refcount = 0; + __pyx_pybuffernd_oinds.data = NULL; + __pyx_pybuffernd_oinds.rcbuffer = &__pyx_pybuffer_oinds; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_other_)); + PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_other_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_other_)); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":188 + * float64_t fill_value, SparseIndex other_): + * cdef: + * Py_ssize_t i = 0, j = 0 # <<<<<<<<<<<<<< + * IntIndex other + * ndarray[float64_t, ndim=1] result + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/sparse.pyx":193 + * ndarray[int32_t, ndim=1] sinds, oinds + * + * other = other_.to_int_index() # <<<<<<<<<<<<<< + * + * oinds = other.indices + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_other = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":195 + * other = other_.to_int_index() + * + * oinds = other.indices # <<<<<<<<<<<<<< + * sinds = self.indices + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_other->indices); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_oinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_oinds.diminfo[0].strides = __pyx_pybuffernd_oinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oinds.diminfo[0].shape = __pyx_pybuffernd_oinds.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_oinds = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":196 + * + * oinds = other.indices + * sinds = self.indices # <<<<<<<<<<<<<< + * + * result = np.empty(other.npoints, dtype=np.float64) + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->indices); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_sinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_sinds.diminfo[0].strides = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sinds.diminfo[0].shape = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_sinds = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":198 + * sinds = self.indices + * + * result = np.empty(other.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * result.fill(fill_value) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_other->npoints); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":199 + * + * result = np.empty(other.npoints, dtype=np.float64) + * result.fill(fill_value) # <<<<<<<<<<<<<< + * + * for 0 <= i < other.npoints: + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_fill); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":201 + * result.fill(fill_value) + * + * for 0 <= i < other.npoints: # <<<<<<<<<<<<<< + * while oinds[i] > sinds[j] and j < self.npoints: + * j += 1 + */ + __pyx_t_11 = __pyx_v_other->npoints; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":202 + * + * for 0 <= i < other.npoints: + * while oinds[i] > sinds[j] and j < self.npoints: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_12 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_oinds.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_sinds.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_oinds.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0); + if (__pyx_t_14) { + __pyx_t_15 = ((__pyx_v_j < __pyx_v_self->npoints) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_14; + } + if (!__pyx_t_16) break; + + /* "pandas/src/sparse.pyx":203 + * for 0 <= i < other.npoints: + * while oinds[i] > sinds[j] and j < self.npoints: + * j += 1 # <<<<<<<<<<<<<< + * + * if j == self.npoints: + */ + __pyx_v_j = (__pyx_v_j + 1); + } + + /* "pandas/src/sparse.pyx":205 + * j += 1 + * + * if j == self.npoints: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_16 = ((__pyx_v_j == __pyx_v_self->npoints) != 0); + if (__pyx_t_16) { + + /* "pandas/src/sparse.pyx":206 + * + * if j == self.npoints: + * break # <<<<<<<<<<<<<< + * + * if oinds[i] < sinds[j]: + */ + goto __pyx_L4_break; + } + + /* "pandas/src/sparse.pyx":208 + * break + * + * if oinds[i] < sinds[j]: # <<<<<<<<<<<<<< + * continue + * elif oinds[i] == sinds[j]: + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_oinds.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_sinds.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_oinds.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/sparse.pyx":209 + * + * if oinds[i] < sinds[j]: + * continue # <<<<<<<<<<<<<< + * elif oinds[i] == sinds[j]: + * result[i] = values[j] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":210 + * if oinds[i] < sinds[j]: + * continue + * elif oinds[i] == sinds[j]: # <<<<<<<<<<<<<< + * result[i] = values[j] + * j += 1 + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_oinds.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_20 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_sinds.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_oinds.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0); + if (__pyx_t_16) { + + /* "pandas/src/sparse.pyx":211 + * continue + * elif oinds[i] == sinds[j]: + * result[i] = values[j] # <<<<<<<<<<<<<< + * j += 1 + * + */ + __pyx_t_21 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":212 + * elif oinds[i] == sinds[j]: + * result[i] = values[j] + * j += 1 # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L8; + } + __pyx_L8:; + __pyx_L3_continue:; + } + __pyx_L4_break:; + + /* "pandas/src/sparse.pyx":214 + * j += 1 + * + * return result # <<<<<<<<<<<<<< + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyArrayObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":185 + * return -1 + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * float64_t fill_value, SparseIndex other_): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_other); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_sinds); + __Pyx_XDECREF((PyObject *)__pyx_v_oinds); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + __pyx_t_5numpy_float64_t __pyx_v_fill_value; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reindex (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_fill_value,&__pyx_n_s_other,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_fill_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fill_value == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_other_ = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_22reindex(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_22reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->reindex(__pyx_v_self, __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":216 + * return result + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_put(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_to_put, int __pyx_skip_dispatch) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_25put)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __Pyx_INCREF(__pyx_v_to_put); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_to_put); + __Pyx_GIVEREF(__pyx_v_to_put); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":218 + * cpdef put(self, ndarray[float64_t, ndim=1] values, + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass # <<<<<<<<<<<<<< + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":216 + * return result + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indices = 0; + PyObject *__pyx_v_to_put = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,&__pyx_n_s_to_put,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_put)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indices = ((PyArrayObject *)values[1]); + __pyx_v_to_put = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_24put(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices, __pyx_v_to_put); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_24put(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_values, __pyx_v_indices, __pyx_v_to_put, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":220 + * pass + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices): + * pass + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_take(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, int __pyx_skip_dispatch) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_27take)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":222 + * cpdef take(self, ndarray[float64_t, ndim=1] values, + * ndarray[int32_t, ndim=1] indices): + * pass # <<<<<<<<<<<<<< + * + * cpdef get_blocks(ndarray[int32_t, ndim=1] indices): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":220 + * pass + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices): + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indices = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indices = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_26take(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_26take(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_self->__pyx_vtab)->take(__pyx_v_self, __pyx_v_values, __pyx_v_indices, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":44 + * ''' + * cdef readonly: + * Py_ssize_t length, npoints # <<<<<<<<<<<<<< + * ndarray indices + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.IntIndex.npoints.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":45 + * cdef readonly: + * Py_ssize_t length, npoints + * ndarray indices # <<<<<<<<<<<<<< + * + * def __init__(self, Py_ssize_t length, indices): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->indices)); + __pyx_r = ((PyObject *)__pyx_v_self->indices); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":224 + * pass + * + * cpdef get_blocks(ndarray[int32_t, ndim=1] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, npoints + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_get_blocks(PyArrayObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_npoints; + __pyx_t_5numpy_int32_t __pyx_v_block; + __pyx_t_5numpy_int32_t __pyx_v_length; + __pyx_t_5numpy_int32_t __pyx_v_cur; + __pyx_t_5numpy_int32_t __pyx_v_prev; + PyObject *__pyx_v_locs = 0; + PyObject *__pyx_v_lens = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + long __pyx_t_6; + int __pyx_t_7; + __pyx_t_5numpy_int32_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_blocks", 0); + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/sparse.pyx":227 + * cdef: + * Py_ssize_t i, npoints + * int32_t block, length = 1, cur, prev # <<<<<<<<<<<<<< + * list locs = [], lens = [] + * + */ + __pyx_v_length = 1; + + /* "pandas/src/sparse.pyx":228 + * Py_ssize_t i, npoints + * int32_t block, length = 1, cur, prev + * list locs = [], lens = [] # <<<<<<<<<<<<<< + * + * npoints = len(indices) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_locs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_lens = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":230 + * list locs = [], lens = [] + * + * npoints = len(indices) # <<<<<<<<<<<<<< + * + * # just handle the special empty case separately + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indices)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_npoints = __pyx_t_2; + + /* "pandas/src/sparse.pyx":233 + * + * # just handle the special empty case separately + * if npoints == 0: # <<<<<<<<<<<<<< + * return [], [] + * + */ + __pyx_t_3 = ((__pyx_v_npoints == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/src/sparse.pyx":234 + * # just handle the special empty case separately + * if npoints == 0: + * return [], [] # <<<<<<<<<<<<<< + * + * # TODO: two-pass algorithm faster? + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":237 + * + * # TODO: two-pass algorithm faster? + * prev = block = indices[0] # <<<<<<<<<<<<<< + * for i from 1 <= i < npoints: + * cur = indices[i] + */ + __pyx_t_6 = 0; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_indices.diminfo[0].strides)); + __pyx_v_prev = __pyx_t_8; + __pyx_v_block = __pyx_t_8; + + /* "pandas/src/sparse.pyx":238 + * # TODO: two-pass algorithm faster? + * prev = block = indices[0] + * for i from 1 <= i < npoints: # <<<<<<<<<<<<<< + * cur = indices[i] + * if cur - prev > 1: + */ + __pyx_t_2 = __pyx_v_npoints; + for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":239 + * prev = block = indices[0] + * for i from 1 <= i < npoints: + * cur = indices[i] # <<<<<<<<<<<<<< + * if cur - prev > 1: + * # new block + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":240 + * for i from 1 <= i < npoints: + * cur = indices[i] + * if cur - prev > 1: # <<<<<<<<<<<<<< + * # new block + * locs.append(block) + */ + __pyx_t_3 = (((__pyx_v_cur - __pyx_v_prev) > 1) != 0); + if (__pyx_t_3) { + + /* "pandas/src/sparse.pyx":242 + * if cur - prev > 1: + * # new block + * locs.append(block) # <<<<<<<<<<<<<< + * lens.append(length) + * block = cur + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_block); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_locs, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":243 + * # new block + * locs.append(block) + * lens.append(length) # <<<<<<<<<<<<<< + * block = cur + * length = 1 + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lens, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":244 + * locs.append(block) + * lens.append(length) + * block = cur # <<<<<<<<<<<<<< + * length = 1 + * else: + */ + __pyx_v_block = __pyx_v_cur; + + /* "pandas/src/sparse.pyx":245 + * lens.append(length) + * block = cur + * length = 1 # <<<<<<<<<<<<<< + * else: + * # same block, increment length + */ + __pyx_v_length = 1; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":248 + * else: + * # same block, increment length + * length += 1 # <<<<<<<<<<<<<< + * + * prev = cur + */ + __pyx_v_length = (__pyx_v_length + 1); + } + __pyx_L6:; + + /* "pandas/src/sparse.pyx":250 + * length += 1 + * + * prev = cur # <<<<<<<<<<<<<< + * + * locs.append(block) + */ + __pyx_v_prev = __pyx_v_cur; + } + + /* "pandas/src/sparse.pyx":252 + * prev = cur + * + * locs.append(block) # <<<<<<<<<<<<<< + * lens.append(length) + * return locs, lens + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_block); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_locs, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":253 + * + * locs.append(block) + * lens.append(length) # <<<<<<<<<<<<<< + * return locs, lens + * + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lens, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":254 + * locs.append(block) + * lens.append(length) + * return locs, lens # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_locs); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_locs); + __Pyx_GIVEREF(__pyx_v_locs); + __Pyx_INCREF(__pyx_v_lens); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_lens); + __Pyx_GIVEREF(__pyx_v_lens); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":224 + * pass + * + * cpdef get_blocks(ndarray[int32_t, ndim=1] indices): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, npoints + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.get_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_locs); + __Pyx_XDECREF(__pyx_v_lens); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_blocks (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_get_blocks(__pyx_self, ((PyArrayObject *)__pyx_v_indices)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_get_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_blocks", 0); + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_get_blocks(__pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.get_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":274 + * int32_t* locbuf, *lenbuf + * + * def __init__(self, length, blocs, blengths): # <<<<<<<<<<<<<< + * + * self.blocs = np.ascontiguousarray(blocs, dtype=np.int32) + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_length = 0; + PyObject *__pyx_v_blocs = 0; + PyObject *__pyx_v_blengths = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_blocs,&__pyx_n_s_blengths,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blocs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blengths)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_length = values[0]; + __pyx_v_blocs = values[1]; + __pyx_v_blengths = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_length, __pyx_v_blocs, __pyx_v_blengths); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_blocs, PyObject *__pyx_v_blengths) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/sparse.pyx":276 + * def __init__(self, length, blocs, blengths): + * + * self.blocs = np.ascontiguousarray(blocs, dtype=np.int32) # <<<<<<<<<<<<<< + * self.blengths = np.ascontiguousarray(blengths, dtype=np.int32) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_blocs); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_blocs); + __Pyx_GIVEREF(__pyx_v_blocs); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->blocs); + __Pyx_DECREF(((PyObject *)__pyx_v_self->blocs)); + __pyx_v_self->blocs = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":277 + * + * self.blocs = np.ascontiguousarray(blocs, dtype=np.int32) + * self.blengths = np.ascontiguousarray(blengths, dtype=np.int32) # <<<<<<<<<<<<<< + * + * # in case we need + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_blengths); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_blengths); + __Pyx_GIVEREF(__pyx_v_blengths); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->blengths); + __Pyx_DECREF(((PyObject *)__pyx_v_self->blengths)); + __pyx_v_self->blengths = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/sparse.pyx":280 + * + * # in case we need + * self.locbuf = self.blocs.data # <<<<<<<<<<<<<< + * self.lenbuf = self.blengths.data + * + */ + __pyx_v_self->locbuf = ((__pyx_t_5numpy_int32_t *)__pyx_v_self->blocs->data); + + /* "pandas/src/sparse.pyx":281 + * # in case we need + * self.locbuf = self.blocs.data + * self.lenbuf = self.blengths.data # <<<<<<<<<<<<<< + * + * self.length = length + */ + __pyx_v_self->lenbuf = ((__pyx_t_5numpy_int32_t *)__pyx_v_self->blengths->data); + + /* "pandas/src/sparse.pyx":283 + * self.lenbuf = self.blengths.data + * + * self.length = length # <<<<<<<<<<<<<< + * self.nblocks = len(self.blocs) + * self.npoints = self.blengths.sum() + */ + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_length); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->length = __pyx_t_6; + + /* "pandas/src/sparse.pyx":284 + * + * self.length = length + * self.nblocks = len(self.blocs) # <<<<<<<<<<<<<< + * self.npoints = self.blengths.sum() + * + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_self->nblocks = __pyx_t_6; + + /* "pandas/src/sparse.pyx":285 + * self.length = length + * self.nblocks = len(self.blocs) + * self.npoints = self.blengths.sum() # <<<<<<<<<<<<<< + * + * # self.block_start = blocs + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->blengths), __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->npoints = __pyx_t_6; + + /* "pandas/src/sparse.pyx":290 + * # self.block_end = blocs + blengths + * + * self.check_integrity() # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->check_integrity(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":274 + * int32_t* locbuf, *lenbuf + * + * def __init__(self, length, blocs, blengths): # <<<<<<<<<<<<<< + * + * self.blocs = np.ascontiguousarray(blocs, dtype=np.int32) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":292 + * self.check_integrity() + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * args = (self.length, self.blocs, self.blengths) + * return (BlockIndex, args) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "pandas/src/sparse.pyx":293 + * + * def __reduce__(self): + * args = (self.length, self.blocs, self.blengths) # <<<<<<<<<<<<<< + * return (BlockIndex, args) + * + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->blocs)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blocs)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->blengths)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blengths)); + __pyx_t_1 = 0; + __pyx_v_args = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":294 + * def __reduce__(self): + * args = (self.length, self.blocs, self.blengths) + * return (BlockIndex, args) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex))); + __Pyx_INCREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":292 + * self.check_integrity() + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * args = (self.length, self.blocs, self.blengths) + * return (BlockIndex, args) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":296 + * return (BlockIndex, args) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * output = 'BlockIndex\n' + * output += 'Block locations: %s\n' % repr(self.blocs) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_v_output = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "pandas/src/sparse.pyx":297 + * + * def __repr__(self): + * output = 'BlockIndex\n' # <<<<<<<<<<<<<< + * output += 'Block locations: %s\n' % repr(self.blocs) + * output += 'Block lengths: %s' % repr(self.blengths) + */ + __Pyx_INCREF(__pyx_n_s_BlockIndex); + __pyx_v_output = __pyx_n_s_BlockIndex; + + /* "pandas/src/sparse.pyx":298 + * def __repr__(self): + * output = 'BlockIndex\n' + * output += 'Block locations: %s\n' % repr(self.blocs) # <<<<<<<<<<<<<< + * output += 'Block lengths: %s' % repr(self.blengths) + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Block_locations_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":299 + * output = 'BlockIndex\n' + * output += 'Block locations: %s\n' % repr(self.blocs) + * output += 'Block lengths: %s' % repr(self.blengths) # <<<<<<<<<<<<<< + * + * return output + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Block_lengths_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":301 + * output += 'Block lengths: %s' % repr(self.blengths) + * + * return output # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_output); + __pyx_r = __pyx_v_output; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":296 + * return (BlockIndex, args) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * output = 'BlockIndex\n' + * output += 'Block locations: %s\n' % repr(self.blocs) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_output); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":304 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ngaps (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ngaps", 0); + + /* "pandas/src/sparse.pyx":305 + * @property + * def ngaps(self): + * return self.length - self.npoints # <<<<<<<<<<<<<< + * + * cpdef check_integrity(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->length - __pyx_v_self->npoints)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":304 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.ngaps", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":307 + * return self.length - self.npoints + * + * cpdef check_integrity(self): # <<<<<<<<<<<<<< + * ''' + * Check: + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + PyArrayObject *__pyx_v_blocs = 0; + PyArrayObject *__pyx_v_blengths = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_blengths; + __Pyx_Buffer __pyx_pybuffer_blengths; + __Pyx_LocalBuf_ND __pyx_pybuffernd_blocs; + __Pyx_Buffer __pyx_pybuffer_blocs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_integrity", 0); + __pyx_pybuffer_blocs.pybuffer.buf = NULL; + __pyx_pybuffer_blocs.refcount = 0; + __pyx_pybuffernd_blocs.data = NULL; + __pyx_pybuffernd_blocs.rcbuffer = &__pyx_pybuffer_blocs; + __pyx_pybuffer_blengths.pybuffer.buf = NULL; + __pyx_pybuffer_blengths.refcount = 0; + __pyx_pybuffernd_blengths.data = NULL; + __pyx_pybuffernd_blengths.rcbuffer = &__pyx_pybuffer_blengths; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_integrity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":318 + * ndarray[int32_t, ndim=1] blocs, blengths + * + * blocs = self.blocs # <<<<<<<<<<<<<< + * blengths = self.blengths + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_blocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_blocs.diminfo[0].strides = __pyx_pybuffernd_blocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_blocs.diminfo[0].shape = __pyx_pybuffernd_blocs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_blocs = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":319 + * + * blocs = self.blocs + * blengths = self.blengths # <<<<<<<<<<<<<< + * + * if len(blocs) != len(blengths): + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer, (PyObject*)__pyx_v_blengths, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_blengths.diminfo[0].strides = __pyx_pybuffernd_blengths.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_blengths.diminfo[0].shape = __pyx_pybuffernd_blengths.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_blengths = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":321 + * blengths = self.blengths + * + * if len(blocs) != len(blengths): # <<<<<<<<<<<<<< + * raise ValueError('block bound arrays must be same length') + * + */ + __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_blocs)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_blengths)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((__pyx_t_7 != __pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":322 + * + * if len(blocs) != len(blengths): + * raise ValueError('block bound arrays must be same length') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < self.nblocks: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":324 + * raise ValueError('block bound arrays must be same length') + * + * for i from 0 <= i < self.nblocks: # <<<<<<<<<<<<<< + * if i > 0: + * if blocs[i] <= blocs[i-1]: + */ + __pyx_t_8 = __pyx_v_self->nblocks; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":325 + * + * for i from 0 <= i < self.nblocks: + * if i > 0: # <<<<<<<<<<<<<< + * if blocs[i] <= blocs[i-1]: + * raise ValueError('Locations not in ascending order') + */ + __pyx_t_9 = ((__pyx_v_i > 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":326 + * for i from 0 <= i < self.nblocks: + * if i > 0: + * if blocs[i] <= blocs[i-1]: # <<<<<<<<<<<<<< + * raise ValueError('Locations not in ascending order') + * + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = (__pyx_v_i - 1); + __pyx_t_3 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_blocs.diminfo[0].strides)) <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_blocs.diminfo[0].strides))) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":327 + * if i > 0: + * if blocs[i] <= blocs[i-1]: + * raise ValueError('Locations not in ascending order') # <<<<<<<<<<<<<< + * + * if i < self.nblocks - 1: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/sparse.pyx":329 + * raise ValueError('Locations not in ascending order') + * + * if i < self.nblocks - 1: # <<<<<<<<<<<<<< + * if blocs[i] + blengths[i] > blocs[i + 1]: + * raise ValueError('Block %d overlaps' % i) + */ + __pyx_t_9 = ((__pyx_v_i < (__pyx_v_self->nblocks - 1)) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":330 + * + * if i < self.nblocks - 1: + * if blocs[i] + blengths[i] > blocs[i + 1]: # <<<<<<<<<<<<<< + * raise ValueError('Block %d overlaps' % i) + * else: + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_blengths.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (__pyx_v_i + 1); + __pyx_t_3 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_blocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_blengths.diminfo[0].strides))) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_blocs.diminfo[0].strides))) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":331 + * if i < self.nblocks - 1: + * if blocs[i] + blengths[i] > blocs[i + 1]: + * raise ValueError('Block %d overlaps' % i) # <<<<<<<<<<<<<< + * else: + * if blocs[i] + blengths[i] > self.length: + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Block_d_overlaps, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":333 + * raise ValueError('Block %d overlaps' % i) + * else: + * if blocs[i] + blengths[i] > self.length: # <<<<<<<<<<<<<< + * raise ValueError('Block %d extends beyond end' % i) + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_blocs.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_blengths.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_blocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_blengths.diminfo[0].strides))) > __pyx_v_self->length) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":334 + * else: + * if blocs[i] + blengths[i] > self.length: + * raise ValueError('Block %d extends beyond end' % i) # <<<<<<<<<<<<<< + * + * # no zero-length blocks + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Block_d_extends_beyond_end, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L8:; + + /* "pandas/src/sparse.pyx":337 + * + * # no zero-length blocks + * if blengths[i] == 0: # <<<<<<<<<<<<<< + * raise ValueError('Zero-length block %d' % i) + * + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_blengths.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_blengths.diminfo[0].strides)) == 0) != 0); + if (__pyx_t_9) { + + /* "pandas/src/sparse.pyx":338 + * # no zero-length blocks + * if blengths[i] == 0: + * raise ValueError('Zero-length block %d' % i) # <<<<<<<<<<<<<< + * + * def equals(self, other): + */ + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Zero_length_block_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + + /* "pandas/src/sparse.pyx":307 + * return self.length - self.npoints + * + * cpdef check_integrity(self): # <<<<<<<<<<<<<< + * ''' + * Check: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.check_integrity", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_blocs); + __Pyx_XDECREF((PyObject *)__pyx_v_blengths); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_10BlockIndex_8check_integrity[] = "\n Check:\n - Locations are in ascending order\n - No overlapping blocks\n - Blocks to not start after end of index, nor extend beyond end\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check_integrity (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_integrity", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->check_integrity(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.check_integrity", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":340 + * raise ValueError('Zero-length block %d' % i) + * + * def equals(self, other): # <<<<<<<<<<<<<< + * if not isinstance(other, BlockIndex): + * return False + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_same_length = NULL; + PyObject *__pyx_v_same_blocks = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "pandas/src/sparse.pyx":341 + * + * def equals(self, other): + * if not isinstance(other, BlockIndex): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/src/sparse.pyx":342 + * def equals(self, other): + * if not isinstance(other, BlockIndex): + * return False # <<<<<<<<<<<<<< + * + * if self is other: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":344 + * return False + * + * if self is other: # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_2 = (((PyObject *)__pyx_v_self) == __pyx_v_other); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":345 + * + * if self is other: + * return True # <<<<<<<<<<<<<< + * + * same_length = self.length == other.length + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":347 + * return True + * + * same_length = self.length == other.length # <<<<<<<<<<<<<< + * same_blocks = (np.array_equal(self.blocs, other.blocs) and + * np.array_equal(self.blengths, other.blengths)) + */ + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_same_length = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":348 + * + * same_length = self.length == other.length + * same_blocks = (np.array_equal(self.blocs, other.blocs) and # <<<<<<<<<<<<<< + * np.array_equal(self.blengths, other.blengths)) + * return same_length and same_blocks + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_blocs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->blocs)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blocs)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":349 + * same_length = self.length == other.length + * same_blocks = (np.array_equal(self.blocs, other.blocs) and + * np.array_equal(self.blengths, other.blengths)) # <<<<<<<<<<<<<< + * return same_length and same_blocks + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_blengths); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self->blengths)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blengths)); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_v_same_blocks = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/src/sparse.pyx":350 + * same_blocks = (np.array_equal(self.blocs, other.blocs) and + * np.array_equal(self.blengths, other.blengths)) + * return same_length and same_blocks # <<<<<<<<<<<<<< + * + * def to_block_index(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_same_length); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __Pyx_INCREF(__pyx_v_same_blocks); + __pyx_t_6 = __pyx_v_same_blocks; + } else { + __Pyx_INCREF(__pyx_v_same_length); + __pyx_t_6 = __pyx_v_same_length; + } + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":340 + * raise ValueError('Zero-length block %d' % i) + * + * def equals(self, other): # <<<<<<<<<<<<<< + * if not isinstance(other, BlockIndex): + * return False + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_same_length); + __Pyx_XDECREF(__pyx_v_same_blocks); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":352 + * return same_length and same_blocks + * + * def to_block_index(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_block_index (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_block_index", 0); + + /* "pandas/src/sparse.pyx":353 + * + * def to_block_index(self): + * return self # <<<<<<<<<<<<<< + * + * def to_int_index(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":352 + * return same_length and same_blocks + * + * def to_block_index(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":355 + * return self + * + * def to_int_index(self): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i = 0, j, b + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_int_index (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_b; + __pyx_t_5numpy_int32_t __pyx_v_offset; + PyArrayObject *__pyx_v_indices = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + __pyx_t_5numpy_int32_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_int_index", 0); + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + + /* "pandas/src/sparse.pyx":357 + * def to_int_index(self): + * cdef: + * Py_ssize_t i = 0, j, b # <<<<<<<<<<<<<< + * int32_t offset + * ndarray[int32_t, ndim=1] indices + */ + __pyx_v_i = 0; + + /* "pandas/src/sparse.pyx":361 + * ndarray[int32_t, ndim=1] indices + * + * indices = np.empty(self.npoints, dtype=np.int32) # <<<<<<<<<<<<<< + * + * for b from 0 <= b < self.nblocks: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_indices = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":363 + * indices = np.empty(self.npoints, dtype=np.int32) + * + * for b from 0 <= b < self.nblocks: # <<<<<<<<<<<<<< + * offset = self.locbuf[b] + * + */ + __pyx_t_11 = __pyx_v_self->nblocks; + for (__pyx_v_b = 0; __pyx_v_b < __pyx_t_11; __pyx_v_b++) { + + /* "pandas/src/sparse.pyx":364 + * + * for b from 0 <= b < self.nblocks: + * offset = self.locbuf[b] # <<<<<<<<<<<<<< + * + * for j from 0 <= j < self.lenbuf[b]: + */ + __pyx_v_offset = (__pyx_v_self->locbuf[__pyx_v_b]); + + /* "pandas/src/sparse.pyx":366 + * offset = self.locbuf[b] + * + * for j from 0 <= j < self.lenbuf[b]: # <<<<<<<<<<<<<< + * indices[i] = offset + j + * i += 1 + */ + __pyx_t_12 = (__pyx_v_self->lenbuf[__pyx_v_b]); + for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_12; __pyx_v_j++) { + + /* "pandas/src/sparse.pyx":367 + * + * for j from 0 <= j < self.lenbuf[b]: + * indices[i] = offset + j # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_indices.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indices.diminfo[0].strides) = (__pyx_v_offset + __pyx_v_j); + + /* "pandas/src/sparse.pyx":368 + * for j from 0 <= j < self.lenbuf[b]: + * indices[i] = offset + j + * i += 1 # <<<<<<<<<<<<<< + * + * return IntIndex(self.length, indices) + */ + __pyx_v_i = (__pyx_v_i + 1); + } + } + + /* "pandas/src/sparse.pyx":370 + * i += 1 + * + * return IntIndex(self.length, indices) # <<<<<<<<<<<<<< + * + * cpdef BlockIndex intersect(self, SparseIndex other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":355 + * return self + * + * def to_int_index(self): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i = 0, j, b + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.to_int_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":372 + * return IntIndex(self.length, indices) + * + * cpdef BlockIndex intersect(self, SparseIndex other): # <<<<<<<<<<<<<< + * ''' + * Intersect two BlockIndex objects + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_f_6pandas_7_sparse_10BlockIndex_intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other, int __pyx_skip_dispatch) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y = 0; + PyArrayObject *__pyx_v_xloc = 0; + PyArrayObject *__pyx_v_xlen = 0; + PyArrayObject *__pyx_v_yloc = 0; + PyArrayObject *__pyx_v_ylen = 0; + PyObject *__pyx_v_out_blocs = 0; + PyObject *__pyx_v_out_blengths = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + __pyx_t_5numpy_int32_t __pyx_v_cur_loc; + __pyx_t_5numpy_int32_t __pyx_v_cur_length; + __pyx_t_5numpy_int32_t __pyx_v_diff; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xlen; + __Pyx_Buffer __pyx_pybuffer_xlen; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xloc; + __Pyx_Buffer __pyx_pybuffer_xloc; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ylen; + __Pyx_Buffer __pyx_pybuffer_ylen; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yloc; + __Pyx_Buffer __pyx_pybuffer_yloc; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_t_29; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersect", 0); + __pyx_pybuffer_xloc.pybuffer.buf = NULL; + __pyx_pybuffer_xloc.refcount = 0; + __pyx_pybuffernd_xloc.data = NULL; + __pyx_pybuffernd_xloc.rcbuffer = &__pyx_pybuffer_xloc; + __pyx_pybuffer_xlen.pybuffer.buf = NULL; + __pyx_pybuffer_xlen.refcount = 0; + __pyx_pybuffernd_xlen.data = NULL; + __pyx_pybuffernd_xlen.rcbuffer = &__pyx_pybuffer_xlen; + __pyx_pybuffer_yloc.pybuffer.buf = NULL; + __pyx_pybuffer_yloc.refcount = 0; + __pyx_pybuffernd_yloc.data = NULL; + __pyx_pybuffernd_yloc.rcbuffer = &__pyx_pybuffer_yloc; + __pyx_pybuffer_ylen.pybuffer.buf = NULL; + __pyx_pybuffer_ylen.refcount = 0; + __pyx_pybuffernd_ylen.data = NULL; + __pyx_pybuffernd_ylen.rcbuffer = &__pyx_pybuffer_ylen; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_intersect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_other)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_other)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_other)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":387 + * ndarray[int32_t, ndim=1] xloc, xlen, yloc, ylen + * + * list out_blocs = [] # <<<<<<<<<<<<<< + * list out_blengths = [] + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_out_blocs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":388 + * + * list out_blocs = [] + * list out_blengths = [] # <<<<<<<<<<<<<< + * + * Py_ssize_t xi = 0, yi = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_out_blengths = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":390 + * list out_blengths = [] + * + * Py_ssize_t xi = 0, yi = 0 # <<<<<<<<<<<<<< + * int32_t cur_loc, cur_length, diff + * + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + + /* "pandas/src/sparse.pyx":393 + * int32_t cur_loc, cur_length, diff + * + * y = other.to_block_index() # <<<<<<<<<<<<<< + * + * if self.length != y.length: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":395 + * y = other.to_block_index() + * + * if self.length != y.length: # <<<<<<<<<<<<<< + * raise Exception('Indices must reference same underlying length') + * + */ + __pyx_t_4 = ((__pyx_v_self->length != __pyx_v_y->length) != 0); + if (__pyx_t_4) { + + /* "pandas/src/sparse.pyx":396 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xloc = self.blocs + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":398 + * raise Exception('Indices must reference same underlying length') + * + * xloc = self.blocs # <<<<<<<<<<<<<< + * xlen = self.blengths + * yloc = y.blocs + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer, (PyObject*)__pyx_v_xloc, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_xloc.diminfo[0].strides = __pyx_pybuffernd_xloc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xloc.diminfo[0].shape = __pyx_pybuffernd_xloc.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xloc = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":399 + * + * xloc = self.blocs + * xlen = self.blengths # <<<<<<<<<<<<<< + * yloc = y.blocs + * ylen = y.blengths + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer, (PyObject*)__pyx_v_xlen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_xlen.diminfo[0].strides = __pyx_pybuffernd_xlen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xlen.diminfo[0].shape = __pyx_pybuffernd_xlen.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xlen = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":400 + * xloc = self.blocs + * xlen = self.blengths + * yloc = y.blocs # <<<<<<<<<<<<<< + * ylen = y.blengths + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_y->blocs); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer, (PyObject*)__pyx_v_yloc, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + __pyx_pybuffernd_yloc.diminfo[0].strides = __pyx_pybuffernd_yloc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yloc.diminfo[0].shape = __pyx_pybuffernd_yloc.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yloc = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":401 + * xlen = self.blengths + * yloc = y.blocs + * ylen = y.blengths # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_t_3 = ((PyObject *)__pyx_v_y->blengths); + __Pyx_INCREF(__pyx_t_3); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer); + __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_5 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer, (PyObject*)__pyx_v_ylen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + } + } + __pyx_pybuffernd_ylen.diminfo[0].strides = __pyx_pybuffernd_ylen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ylen.diminfo[0].shape = __pyx_pybuffernd_ylen.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ylen = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":403 + * ylen = y.blengths + * + * while True: # <<<<<<<<<<<<<< + * # we are done (or possibly never began) + * if xi >= self.nblocks or yi >= y.nblocks: + */ + while (1) { + + /* "pandas/src/sparse.pyx":405 + * while True: + * # we are done (or possibly never began) + * if xi >= self.nblocks or yi >= y.nblocks: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_4 = ((__pyx_v_xi >= __pyx_v_self->nblocks) != 0); + if (!__pyx_t_4) { + __pyx_t_9 = ((__pyx_v_yi >= __pyx_v_y->nblocks) != 0); + __pyx_t_10 = __pyx_t_9; + } else { + __pyx_t_10 = __pyx_t_4; + } + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":406 + * # we are done (or possibly never began) + * if xi >= self.nblocks or yi >= y.nblocks: + * break # <<<<<<<<<<<<<< + * + * # completely symmetric...would like to avoid code dup but oh well + */ + goto __pyx_L5_break; + } + + /* "pandas/src/sparse.pyx":409 + * + * # completely symmetric...would like to avoid code dup but oh well + * if xloc[xi] >= yloc[yi]: # <<<<<<<<<<<<<< + * cur_loc = xloc[xi] + * diff = xloc[xi] - yloc[yi] + */ + __pyx_t_11 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_xloc.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_yloc.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_xloc.diminfo[0].strides)) >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_yloc.diminfo[0].strides))) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":410 + * # completely symmetric...would like to avoid code dup but oh well + * if xloc[xi] >= yloc[yi]: + * cur_loc = xloc[xi] # <<<<<<<<<<<<<< + * diff = xloc[xi] - yloc[yi] + * + */ + __pyx_t_13 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_xloc.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_xloc.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":411 + * if xloc[xi] >= yloc[yi]: + * cur_loc = xloc[xi] + * diff = xloc[xi] - yloc[yi] # <<<<<<<<<<<<<< + * + * if ylen[yi] <= diff: + */ + __pyx_t_14 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_xloc.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_yloc.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_diff = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_xloc.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_yloc.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":413 + * diff = xloc[xi] - yloc[yi] + * + * if ylen[yi] <= diff: # <<<<<<<<<<<<<< + * # have to skip this block + * yi += 1 + */ + __pyx_t_16 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_ylen.diminfo[0].strides)) <= __pyx_v_diff) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":415 + * if ylen[yi] <= diff: + * # have to skip this block + * yi += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":416 + * # have to skip this block + * yi += 1 + * continue # <<<<<<<<<<<<<< + * + * if ylen[yi] - diff < xlen[xi]: + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/sparse.pyx":418 + * continue + * + * if ylen[yi] - diff < xlen[xi]: # <<<<<<<<<<<<<< + * # take end of y block, move onward + * cur_length = ylen[yi] - diff + */ + __pyx_t_17 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_18 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ylen.diminfo[0].strides)) - __pyx_v_diff) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_xlen.diminfo[0].strides))) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":420 + * if ylen[yi] - diff < xlen[xi]: + * # take end of y block, move onward + * cur_length = ylen[yi] - diff # <<<<<<<<<<<<<< + * yi += 1 + * else: + */ + __pyx_t_19 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_length = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ylen.diminfo[0].strides)) - __pyx_v_diff); + + /* "pandas/src/sparse.pyx":421 + * # take end of y block, move onward + * cur_length = ylen[yi] - diff + * yi += 1 # <<<<<<<<<<<<<< + * else: + * # take end of x block + */ + __pyx_v_yi = (__pyx_v_yi + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":424 + * else: + * # take end of x block + * cur_length = xlen[xi] # <<<<<<<<<<<<<< + * xi += 1 + * + */ + __pyx_t_20 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_length = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_xlen.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":425 + * # take end of x block + * cur_length = xlen[xi] + * xi += 1 # <<<<<<<<<<<<<< + * + * else: # xloc[xi] < yloc[yi] + */ + __pyx_v_xi = (__pyx_v_xi + 1); + } + __pyx_L9:; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":428 + * + * else: # xloc[xi] < yloc[yi] + * cur_loc = yloc[yi] # <<<<<<<<<<<<<< + * diff = yloc[yi] - xloc[xi] + * + */ + __pyx_t_21 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_yloc.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_yloc.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":429 + * else: # xloc[xi] < yloc[yi] + * cur_loc = yloc[yi] + * diff = yloc[yi] - xloc[xi] # <<<<<<<<<<<<<< + * + * if xlen[xi] <= diff: + */ + __pyx_t_22 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_yloc.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_xloc.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_diff = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_yloc.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_xloc.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":431 + * diff = yloc[yi] - xloc[xi] + * + * if xlen[xi] <= diff: # <<<<<<<<<<<<<< + * # have to skip this block + * xi += 1 + */ + __pyx_t_24 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_xlen.diminfo[0].strides)) <= __pyx_v_diff) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":433 + * if xlen[xi] <= diff: + * # have to skip this block + * xi += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":434 + * # have to skip this block + * xi += 1 + * continue # <<<<<<<<<<<<<< + * + * if xlen[xi] - diff < ylen[yi]: + */ + goto __pyx_L4_continue; + } + + /* "pandas/src/sparse.pyx":436 + * continue + * + * if xlen[xi] - diff < ylen[yi]: # <<<<<<<<<<<<<< + * # take end of x block, move onward + * cur_length = xlen[xi] - diff + */ + __pyx_t_25 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_xlen.diminfo[0].strides)) - __pyx_v_diff) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ylen.diminfo[0].strides))) != 0); + if (__pyx_t_10) { + + /* "pandas/src/sparse.pyx":438 + * if xlen[xi] - diff < ylen[yi]: + * # take end of x block, move onward + * cur_length = xlen[xi] - diff # <<<<<<<<<<<<<< + * xi += 1 + * else: + */ + __pyx_t_27 = __pyx_v_xi; + __pyx_t_5 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_xlen.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_length = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_xlen.diminfo[0].strides)) - __pyx_v_diff); + + /* "pandas/src/sparse.pyx":439 + * # take end of x block, move onward + * cur_length = xlen[xi] - diff + * xi += 1 # <<<<<<<<<<<<<< + * else: + * # take end of y block + */ + __pyx_v_xi = (__pyx_v_xi + 1); + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":442 + * else: + * # take end of y block + * cur_length = ylen[yi] # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_28 = __pyx_v_yi; + __pyx_t_5 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_ylen.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cur_length = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ylen.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":443 + * # take end of y block + * cur_length = ylen[yi] + * yi += 1 # <<<<<<<<<<<<<< + * + * out_blocs.append(cur_loc) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + __pyx_L11:; + } + __pyx_L7:; + + /* "pandas/src/sparse.pyx":445 + * yi += 1 + * + * out_blocs.append(cur_loc) # <<<<<<<<<<<<<< + * out_blengths.append(cur_length) + * + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_cur_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_29 = __Pyx_PyList_Append(__pyx_v_out_blocs, __pyx_t_3); if (unlikely(__pyx_t_29 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/src/sparse.pyx":446 + * + * out_blocs.append(cur_loc) + * out_blengths.append(cur_length) # <<<<<<<<<<<<<< + * + * return BlockIndex(self.length, out_blocs, out_blengths) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_cur_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_29 = __Pyx_PyList_Append(__pyx_v_out_blengths, __pyx_t_3); if (unlikely(__pyx_t_29 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L4_continue:; + } + __pyx_L5_break:; + + /* "pandas/src/sparse.pyx":448 + * out_blengths.append(cur_length) + * + * return BlockIndex(self.length, out_blocs, out_blengths) # <<<<<<<<<<<<<< + * + * cpdef BlockIndex make_union(self, SparseIndex y): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_out_blocs); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_out_blocs); + __Pyx_GIVEREF(__pyx_v_out_blocs); + __Pyx_INCREF(__pyx_v_out_blengths); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_out_blengths); + __Pyx_GIVEREF(__pyx_v_out_blengths); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":372 + * return IntIndex(self.length, indices) + * + * cpdef BlockIndex intersect(self, SparseIndex other): # <<<<<<<<<<<<<< + * ''' + * Intersect two BlockIndex objects + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_xloc); + __Pyx_XDECREF((PyObject *)__pyx_v_xlen); + __Pyx_XDECREF((PyObject *)__pyx_v_yloc); + __Pyx_XDECREF((PyObject *)__pyx_v_ylen); + __Pyx_XDECREF(__pyx_v_out_blocs); + __Pyx_XDECREF(__pyx_v_out_blengths); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_10BlockIndex_16intersect[] = "\n Intersect two BlockIndex objects\n\n Parameters\n ----------\n\n Returns\n -------\n intersection : BlockIndex\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersect (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_other)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersect", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->intersect(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":450 + * return BlockIndex(self.length, out_blocs, out_blengths) + * + * cpdef BlockIndex make_union(self, SparseIndex y): # <<<<<<<<<<<<<< + * ''' + * Combine together two BlockIndex objects, accepting indices if contained + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/ +static struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_f_6pandas_7_sparse_10BlockIndex_make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y, int __pyx_skip_dispatch) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_union", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_y)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_y)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_y)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":467 + * union : BlockIndex + * ''' + * return BlockUnion(self, y.to_block_index()).result # <<<<<<<<<<<<<< + * + * cpdef lookup(self, Py_ssize_t index): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockUnion)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)__pyx_t_3)->__pyx_base.result)); + __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)__pyx_t_3)->__pyx_base.result; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":450 + * return BlockIndex(self.length, out_blocs, out_blengths) + * + * cpdef BlockIndex make_union(self, SparseIndex y): # <<<<<<<<<<<<<< + * ''' + * Combine together two BlockIndex objects, accepting indices if contained + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_10BlockIndex_18make_union[] = "\n Combine together two BlockIndex objects, accepting indices if contained\n in one or the other\n\n Parameters\n ----------\n other : SparseIndex\n\n Notes\n -----\n union is a protected keyword in Cython, hence make_union\n\n Returns\n -------\n union : BlockIndex\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_union (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_union", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->make_union(__pyx_v_self, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":469 + * return BlockUnion(self, y.to_block_index()).result + * + * cpdef lookup(self, Py_ssize_t index): # <<<<<<<<<<<<<< + * ''' + * + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_cum_len; + PyArrayObject *__pyx_v_locs = 0; + PyArrayObject *__pyx_v_lens = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_lens; + __Pyx_Buffer __pyx_pybuffer_lens; + __Pyx_LocalBuf_ND __pyx_pybuffernd_locs; + __Pyx_Buffer __pyx_pybuffer_locs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + long __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __pyx_pybuffer_locs.pybuffer.buf = NULL; + __pyx_pybuffer_locs.refcount = 0; + __pyx_pybuffernd_locs.data = NULL; + __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs; + __pyx_pybuffer_lens.pybuffer.buf = NULL; + __pyx_pybuffer_lens.refcount = 0; + __pyx_pybuffernd_lens.data = NULL; + __pyx_pybuffernd_lens.rcbuffer = &__pyx_pybuffer_lens; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":478 + * ndarray[int32_t, ndim=1] locs, lens + * + * locs = self.blocs # <<<<<<<<<<<<<< + * lens = self.blengths + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_v_locs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_locs = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":479 + * + * locs = self.blocs + * lens = self.blengths # <<<<<<<<<<<<<< + * + * if self.nblocks == 0: + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lens.rcbuffer->pybuffer, (PyObject*)__pyx_v_lens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_lens.diminfo[0].strides = __pyx_pybuffernd_lens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lens.diminfo[0].shape = __pyx_pybuffernd_lens.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_lens = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":481 + * lens = self.blengths + * + * if self.nblocks == 0: # <<<<<<<<<<<<<< + * return -1 + * elif index < locs[0]: + */ + __pyx_t_8 = ((__pyx_v_self->nblocks == 0) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":482 + * + * if self.nblocks == 0: + * return -1 # <<<<<<<<<<<<<< + * elif index < locs[0]: + * return -1 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":483 + * if self.nblocks == 0: + * return -1 + * elif index < locs[0]: # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_t_9 = 0; + __pyx_t_4 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = ((__pyx_v_index < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_locs.diminfo[0].strides))) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":484 + * return -1 + * elif index < locs[0]: + * return -1 # <<<<<<<<<<<<<< + * + * cum_len = 0 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":486 + * return -1 + * + * cum_len = 0 # <<<<<<<<<<<<<< + * for i from 0 <= i < self.nblocks: + * if index >= locs[i] and index < locs[i] + lens[i]: + */ + __pyx_v_cum_len = 0; + + /* "pandas/src/sparse.pyx":487 + * + * cum_len = 0 + * for i from 0 <= i < self.nblocks: # <<<<<<<<<<<<<< + * if index >= locs[i] and index < locs[i] + lens[i]: + * return cum_len + index - locs[i] + */ + __pyx_t_10 = __pyx_v_self->nblocks; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":488 + * cum_len = 0 + * for i from 0 <= i < self.nblocks: + * if index >= locs[i] and index < locs[i] + lens[i]: # <<<<<<<<<<<<<< + * return cum_len + index - locs[i] + * cum_len += lens[i] + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = ((__pyx_v_index >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_locs.diminfo[0].strides))) != 0); + if (__pyx_t_8) { + __pyx_t_12 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_lens.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_lens.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = ((__pyx_v_index < ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_lens.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_lens.diminfo[0].strides)))) != 0); + __pyx_t_15 = __pyx_t_14; + } else { + __pyx_t_15 = __pyx_t_8; + } + if (__pyx_t_15) { + + /* "pandas/src/sparse.pyx":489 + * for i from 0 <= i < self.nblocks: + * if index >= locs[i] and index < locs[i] + lens[i]: + * return cum_len + index - locs[i] # <<<<<<<<<<<<<< + * cum_len += lens[i] + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_16 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_locs.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = PyInt_FromSsize_t(((__pyx_v_cum_len + __pyx_v_index) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_locs.diminfo[0].strides)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":490 + * if index >= locs[i] and index < locs[i] + lens[i]: + * return cum_len + index - locs[i] + * cum_len += lens[i] # <<<<<<<<<<<<<< + * + * return -1 + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_lens.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_lens.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_cum_len = (__pyx_v_cum_len + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_lens.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_lens.diminfo[0].strides))); + } + + /* "pandas/src/sparse.pyx":492 + * cum_len += lens[i] + * + * return -1 # <<<<<<<<<<<<<< + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":469 + * return BlockUnion(self, y.to_block_index()).result + * + * cpdef lookup(self, Py_ssize_t index): # <<<<<<<<<<<<<< + * ''' + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_locs); + __Pyx_XDECREF((PyObject *)__pyx_v_lens); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/ +static char __pyx_doc_6pandas_7_sparse_10BlockIndex_20lookup[] = "\n\n Returns -1 if not found\n "; +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) { + Py_ssize_t __pyx_v_index; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lookup (wrapper)", 0); + assert(__pyx_arg_index); { + __pyx_v_index = __Pyx_PyIndex_AsSsize_t(__pyx_arg_index); if (unlikely((__pyx_v_index == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((Py_ssize_t)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lookup", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->lookup(__pyx_v_self, __pyx_v_index, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":494 + * return -1 + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * float64_t fill_value, SparseIndex other_): + * cdef: + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_7_sparse_10BlockIndex_reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_j; + Py_ssize_t __pyx_v_ocur; + CYTHON_UNUSED Py_ssize_t __pyx_v_ocurlen; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_other = 0; + CYTHON_UNUSED PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_slocs = 0; + PyArrayObject *__pyx_v_slens = 0; + PyArrayObject *__pyx_v_olocs = 0; + PyArrayObject *__pyx_v_olens = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_olens; + __Pyx_Buffer __pyx_pybuffer_olens; + __Pyx_LocalBuf_ND __pyx_pybuffernd_olocs; + __Pyx_Buffer __pyx_pybuffer_olocs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_slens; + __Pyx_Buffer __pyx_pybuffer_slens; + __Pyx_LocalBuf_ND __pyx_pybuffernd_slocs; + __Pyx_Buffer __pyx_pybuffer_slocs; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_slocs.pybuffer.buf = NULL; + __pyx_pybuffer_slocs.refcount = 0; + __pyx_pybuffernd_slocs.data = NULL; + __pyx_pybuffernd_slocs.rcbuffer = &__pyx_pybuffer_slocs; + __pyx_pybuffer_slens.pybuffer.buf = NULL; + __pyx_pybuffer_slens.refcount = 0; + __pyx_pybuffernd_slens.data = NULL; + __pyx_pybuffernd_slens.rcbuffer = &__pyx_pybuffer_slens; + __pyx_pybuffer_olocs.pybuffer.buf = NULL; + __pyx_pybuffer_olocs.refcount = 0; + __pyx_pybuffernd_olocs.data = NULL; + __pyx_pybuffernd_olocs.rcbuffer = &__pyx_pybuffer_olocs; + __pyx_pybuffer_olens.pybuffer.buf = NULL; + __pyx_pybuffer_olens.refcount = 0; + __pyx_pybuffernd_olens.data = NULL; + __pyx_pybuffernd_olens.rcbuffer = &__pyx_pybuffer_olens; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_other_)); + PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_other_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_other_)); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":497 + * float64_t fill_value, SparseIndex other_): + * cdef: + * Py_ssize_t i = 0, j = 0, ocur, ocurlen # <<<<<<<<<<<<<< + * BlockIndex other + * ndarray[float64_t, ndim=1] result + */ + __pyx_v_i = 0; + __pyx_v_j = 0; + + /* "pandas/src/sparse.pyx":502 + * ndarray[int32_t, ndim=1] slocs, slens, olocs, olens + * + * other = other_.to_block_index() # <<<<<<<<<<<<<< + * + * olocs = other.blocs + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other_), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_other = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":504 + * other = other_.to_block_index() + * + * olocs = other.blocs # <<<<<<<<<<<<<< + * olens = other.blengths + * slocs = self.blocs + */ + __pyx_t_2 = ((PyObject *)__pyx_v_other->blocs); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_olocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_olocs.diminfo[0].strides = __pyx_pybuffernd_olocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_olocs.diminfo[0].shape = __pyx_pybuffernd_olocs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_olocs = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":505 + * + * olocs = other.blocs + * olens = other.blengths # <<<<<<<<<<<<<< + * slocs = self.blocs + * slens = self.blengths + */ + __pyx_t_2 = ((PyObject *)__pyx_v_other->blengths); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olens.rcbuffer->pybuffer, (PyObject*)__pyx_v_olens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_olens.diminfo[0].strides = __pyx_pybuffernd_olens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_olens.diminfo[0].shape = __pyx_pybuffernd_olens.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_olens = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":506 + * olocs = other.blocs + * olens = other.blengths + * slocs = self.blocs # <<<<<<<<<<<<<< + * slens = self.blengths + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->blocs); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_slocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_slocs.diminfo[0].strides = __pyx_pybuffernd_slocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_slocs.diminfo[0].shape = __pyx_pybuffernd_slocs.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_slocs = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":507 + * olens = other.blengths + * slocs = self.blocs + * slens = self.blengths # <<<<<<<<<<<<<< + * + * result = np.empty(other.npoints, dtype=np.float64) + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->blengths); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slens.rcbuffer->pybuffer, (PyObject*)__pyx_v_slens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5); + } + } + __pyx_pybuffernd_slens.diminfo[0].strides = __pyx_pybuffernd_slens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_slens.diminfo[0].shape = __pyx_pybuffernd_slens.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_slens = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":509 + * slens = self.blengths + * + * result = np.empty(other.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * for 0 <= i < other.nblocks: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_other->npoints); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_4 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":511 + * result = np.empty(other.npoints, dtype=np.float64) + * + * for 0 <= i < other.nblocks: # <<<<<<<<<<<<<< + * ocur = olocs[i] + * ocurlen = olens[i] + */ + __pyx_t_11 = __pyx_v_other->nblocks; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { + + /* "pandas/src/sparse.pyx":512 + * + * for 0 <= i < other.nblocks: + * ocur = olocs[i] # <<<<<<<<<<<<<< + * ocurlen = olens[i] + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_olocs.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_olocs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ocur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_olocs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_olocs.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":513 + * for 0 <= i < other.nblocks: + * ocur = olocs[i] + * ocurlen = olens[i] # <<<<<<<<<<<<<< + * + * while slocs[j] + slens[j] < ocur: + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_4 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_olens.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_olens.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ocurlen = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_olens.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_olens.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":515 + * ocurlen = olens[i] + * + * while slocs[j] + slens[j] < ocur: # <<<<<<<<<<<<<< + * j += 1 + * + */ + while (1) { + __pyx_t_14 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_slocs.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_slocs.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __pyx_v_j; + __pyx_t_4 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_slens.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_4 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_slens.diminfo[0].shape)) __pyx_t_4 = 0; + if (unlikely(__pyx_t_4 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_4); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_slocs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_slocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_slens.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_slens.diminfo[0].strides))) < __pyx_v_ocur) != 0); + if (!__pyx_t_16) break; + + /* "pandas/src/sparse.pyx":516 + * + * while slocs[j] + slens[j] < ocur: + * j += 1 # <<<<<<<<<<<<<< + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, + */ + __pyx_v_j = (__pyx_v_j + 1); + } + } + + /* "pandas/src/sparse.pyx":494 + * return -1 + * + * cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * float64_t fill_value, SparseIndex other_): + * cdef: + */ + + /* function exit code */ + __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_other); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_slocs); + __Pyx_XDECREF((PyObject *)__pyx_v_slens); + __Pyx_XDECREF((PyObject *)__pyx_v_olocs); + __Pyx_XDECREF((PyObject *)__pyx_v_olens); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + __pyx_t_5numpy_float64_t __pyx_v_fill_value; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_ = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reindex (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_fill_value,&__pyx_n_s_other,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_fill_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fill_value == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_other_ = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_22reindex(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_22reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->reindex(__pyx_v_self, __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":518 + * j += 1 + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_put(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_to_put, int __pyx_skip_dispatch) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_25put)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __Pyx_INCREF(__pyx_v_to_put); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_to_put); + __Pyx_GIVEREF(__pyx_v_to_put); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":520 + * cpdef put(self, ndarray[float64_t, ndim=1] values, + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass # <<<<<<<<<<<<<< + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":518 + * j += 1 + * + * cpdef put(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices, object to_put): + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indices = 0; + PyObject *__pyx_v_to_put = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,&__pyx_n_s_to_put,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_put)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indices = ((PyArrayObject *)values[1]); + __pyx_v_to_put = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_24put(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices, __pyx_v_to_put); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_24put(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_values, __pyx_v_indices, __pyx_v_to_put, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":522 + * pass + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices): + * pass + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_take(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, int __pyx_skip_dispatch) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_27take)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_values)); + __Pyx_INCREF(((PyObject *)__pyx_v_indices)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_indices)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_indices)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/src/sparse.pyx":524 + * cpdef take(self, ndarray[float64_t, ndim=1] values, + * ndarray[int32_t, ndim=1] indices): + * pass # <<<<<<<<<<<<<< + * + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":522 + * pass + * + * cpdef take(self, ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] indices): + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyArrayObject *__pyx_v_indices = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("take (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_indices = ((PyArrayObject *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_26take(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_26take(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indices; + __Pyx_Buffer __pyx_pybuffer_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("take", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indices.pybuffer.buf = NULL; + __pyx_pybuffer_indices.refcount = 0; + __pyx_pybuffernd_indices.data = NULL; + __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->take(__pyx_v_self, __pyx_v_values, __pyx_v_indices, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":267 + * ''' + * cdef readonly: + * Py_ssize_t nblocks, npoints, length # <<<<<<<<<<<<<< + * ndarray blocs, blengths + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->nblocks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.nblocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.npoints.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.BlockIndex.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":268 + * cdef readonly: + * Py_ssize_t nblocks, npoints, length + * ndarray blocs, blengths # <<<<<<<<<<<<<< + * + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs)); + __pyx_r = ((PyObject *)__pyx_v_self->blocs); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths)); + __pyx_r = ((PyObject *)__pyx_v_self->blengths); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":537 + * int32_t xi, yi # block indices + * + * def __init__(self, BlockIndex x, BlockIndex y): # <<<<<<<<<<<<<< + * self.x = x + * self.y = y + */ + +/* Python wrapper */ +static int __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)values[0]); + __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.BlockMerge.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_6pandas_7_sparse_BlockIndex, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_6pandas_7_sparse_BlockIndex, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), __pyx_v_x, __pyx_v_y); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/src/sparse.pyx":538 + * + * def __init__(self, BlockIndex x, BlockIndex y): + * self.x = x # <<<<<<<<<<<<<< + * self.y = y + * + */ + __Pyx_INCREF(((PyObject *)__pyx_v_x)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); + __Pyx_GOTREF(__pyx_v_self->x); + __Pyx_DECREF(((PyObject *)__pyx_v_self->x)); + __pyx_v_self->x = __pyx_v_x; + + /* "pandas/src/sparse.pyx":539 + * def __init__(self, BlockIndex x, BlockIndex y): + * self.x = x + * self.y = y # <<<<<<<<<<<<<< + * + * if x.length != y.length: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_y)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_y)); + __Pyx_GOTREF(__pyx_v_self->y); + __Pyx_DECREF(((PyObject *)__pyx_v_self->y)); + __pyx_v_self->y = __pyx_v_y; + + /* "pandas/src/sparse.pyx":541 + * self.y = y + * + * if x.length != y.length: # <<<<<<<<<<<<<< + * raise Exception('Indices must reference same underlying length') + * + */ + __pyx_t_1 = ((__pyx_v_x->length != __pyx_v_y->length) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":542 + * + * if x.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * self.xstart = self.x.blocs + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":544 + * raise Exception('Indices must reference same underlying length') + * + * self.xstart = self.x.blocs # <<<<<<<<<<<<<< + * self.ystart = self.y.blocs + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->x->blocs); + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->xstart); + __Pyx_DECREF(((PyObject *)__pyx_v_self->xstart)); + __pyx_v_self->xstart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":545 + * + * self.xstart = self.x.blocs + * self.ystart = self.y.blocs # <<<<<<<<<<<<<< + * + * self.xend = self.x.blocs + self.x.blengths + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->y->blocs); + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->ystart); + __Pyx_DECREF(((PyObject *)__pyx_v_self->ystart)); + __pyx_v_self->ystart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":547 + * self.ystart = self.y.blocs + * + * self.xend = self.x.blocs + self.x.blengths # <<<<<<<<<<<<<< + * self.yend = self.y.blocs + self.y.blengths + * + */ + __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_self->x->blocs), ((PyObject *)__pyx_v_self->x->blengths)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->xend); + __Pyx_DECREF(((PyObject *)__pyx_v_self->xend)); + __pyx_v_self->xend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":548 + * + * self.xend = self.x.blocs + self.x.blengths + * self.yend = self.y.blocs + self.y.blengths # <<<<<<<<<<<<<< + * + * # self.xlen = self.x.blengths + */ + __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_self->y->blocs), ((PyObject *)__pyx_v_self->y->blengths)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->yend); + __Pyx_DECREF(((PyObject *)__pyx_v_self->yend)); + __pyx_v_self->yend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":553 + * # self.ylen = self.y.blengths + * + * self.xi = 0 # <<<<<<<<<<<<<< + * self.yi = 0 + * + */ + __pyx_v_self->xi = 0; + + /* "pandas/src/sparse.pyx":554 + * + * self.xi = 0 + * self.yi = 0 # <<<<<<<<<<<<<< + * + * self.result = self._make_merged_blocks() + */ + __pyx_v_self->yi = 0; + + /* "pandas/src/sparse.pyx":556 + * self.yi = 0 + * + * self.result = self._make_merged_blocks() # <<<<<<<<<<<<<< + * + * cdef _make_merged_blocks(self): + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *)__pyx_v_self->__pyx_vtab)->_make_merged_blocks(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->result); + __Pyx_DECREF(((PyObject *)__pyx_v_self->result)); + __pyx_v_self->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":537 + * int32_t xi, yi # block indices + * + * def __init__(self, BlockIndex x, BlockIndex y): # <<<<<<<<<<<<<< + * self.x = x + * self.y = y + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas._sparse.BlockMerge.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":558 + * self.result = self._make_merged_blocks() + * + * cdef _make_merged_blocks(self): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + +static PyObject *__pyx_f_6pandas_7_sparse_10BlockMerge__make_merged_blocks(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_merged_blocks", 0); + + /* "pandas/src/sparse.pyx":559 + * + * cdef _make_merged_blocks(self): + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":558 + * self.result = self._make_merged_blocks() + * + * cdef _make_merged_blocks(self): # <<<<<<<<<<<<<< + * raise NotImplementedError + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("pandas._sparse.BlockMerge._make_merged_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":561 + * raise NotImplementedError + * + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): # <<<<<<<<<<<<<< + * if mode == 0: + * self.xi = xi + */ + +static PyObject *__pyx_f_6pandas_7_sparse_10BlockMerge__set_current_indices(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_xi, __pyx_t_5numpy_int32_t __pyx_v_yi, int __pyx_v_mode) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_set_current_indices", 0); + + /* "pandas/src/sparse.pyx":562 + * + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): + * if mode == 0: # <<<<<<<<<<<<<< + * self.xi = xi + * self.yi = yi + */ + __pyx_t_1 = ((__pyx_v_mode == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":563 + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): + * if mode == 0: + * self.xi = xi # <<<<<<<<<<<<<< + * self.yi = yi + * else: + */ + __pyx_v_self->xi = __pyx_v_xi; + + /* "pandas/src/sparse.pyx":564 + * if mode == 0: + * self.xi = xi + * self.yi = yi # <<<<<<<<<<<<<< + * else: + * self.xi = yi + */ + __pyx_v_self->yi = __pyx_v_yi; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":566 + * self.yi = yi + * else: + * self.xi = yi # <<<<<<<<<<<<<< + * self.yi = xi + * + */ + __pyx_v_self->xi = __pyx_v_yi; + + /* "pandas/src/sparse.pyx":567 + * else: + * self.xi = yi + * self.yi = xi # <<<<<<<<<<<<<< + * + * cdef class BlockIntersection(BlockMerge): + */ + __pyx_v_self->yi = __pyx_v_xi; + } + __pyx_L3:; + + /* "pandas/src/sparse.pyx":561 + * raise NotImplementedError + * + * cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode): # <<<<<<<<<<<<<< + * if mode == 0: + * self.xi = xi + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":581 + * ''' + * + * cdef _make_merged_blocks(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int32_t, ndim=1] xstart, xend, ystart, yend + */ + +static PyObject *__pyx_f_6pandas_7_sparse_10BlockUnion__make_merged_blocks(struct __pyx_obj_6pandas_7_sparse_BlockUnion *__pyx_v_self) { + PyArrayObject *__pyx_v_xstart = 0; + PyArrayObject *__pyx_v_xend = 0; + PyArrayObject *__pyx_v_ystart = 0; + PyArrayObject *__pyx_v_yend = 0; + __pyx_t_5numpy_int32_t __pyx_v_nstart; + __pyx_t_5numpy_int32_t __pyx_v_nend; + PyObject *__pyx_v_out_blocs = 0; + PyObject *__pyx_v_out_blengths = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xend; + __Pyx_Buffer __pyx_pybuffer_xend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xstart; + __Pyx_Buffer __pyx_pybuffer_xstart; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yend; + __Pyx_Buffer __pyx_pybuffer_yend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ystart; + __Pyx_Buffer __pyx_pybuffer_ystart; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __pyx_t_5numpy_int32_t __pyx_t_9; + __pyx_t_5numpy_int32_t __pyx_t_10; + __pyx_t_5numpy_int32_t __pyx_t_11; + __pyx_t_5numpy_int32_t __pyx_t_12; + __pyx_t_5numpy_int32_t __pyx_t_13; + __pyx_t_5numpy_int32_t __pyx_t_14; + __pyx_t_5numpy_int32_t __pyx_t_15; + __pyx_t_5numpy_int32_t __pyx_t_16; + __pyx_t_5numpy_int32_t __pyx_t_17; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_merged_blocks", 0); + __pyx_pybuffer_xstart.pybuffer.buf = NULL; + __pyx_pybuffer_xstart.refcount = 0; + __pyx_pybuffernd_xstart.data = NULL; + __pyx_pybuffernd_xstart.rcbuffer = &__pyx_pybuffer_xstart; + __pyx_pybuffer_xend.pybuffer.buf = NULL; + __pyx_pybuffer_xend.refcount = 0; + __pyx_pybuffernd_xend.data = NULL; + __pyx_pybuffernd_xend.rcbuffer = &__pyx_pybuffer_xend; + __pyx_pybuffer_ystart.pybuffer.buf = NULL; + __pyx_pybuffer_ystart.refcount = 0; + __pyx_pybuffernd_ystart.data = NULL; + __pyx_pybuffernd_ystart.rcbuffer = &__pyx_pybuffer_ystart; + __pyx_pybuffer_yend.pybuffer.buf = NULL; + __pyx_pybuffer_yend.refcount = 0; + __pyx_pybuffernd_yend.data = NULL; + __pyx_pybuffernd_yend.rcbuffer = &__pyx_pybuffer_yend; + + /* "pandas/src/sparse.pyx":585 + * ndarray[int32_t, ndim=1] xstart, xend, ystart, yend + * int32_t nstart, nend, diff + * list out_blocs = [], out_blengths = [] # <<<<<<<<<<<<<< + * + * xstart = self.xstart + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_out_blocs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_out_blengths = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":587 + * list out_blocs = [], out_blengths = [] + * + * xstart = self.xstart # <<<<<<<<<<<<<< + * xend = self.xend + * ystart = self.ystart + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.xstart); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5); + } + } + __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xstart = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":588 + * + * xstart = self.xstart + * xend = self.xend # <<<<<<<<<<<<<< + * ystart = self.ystart + * yend = self.yend + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.xend); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3); + } + } + __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xend = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":589 + * xstart = self.xstart + * xend = self.xend + * ystart = self.ystart # <<<<<<<<<<<<<< + * yend = self.yend + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.ystart); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5); + } + } + __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ystart = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":590 + * xend = self.xend + * ystart = self.ystart + * yend = self.yend # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.yend); + __Pyx_INCREF(__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_2 < 0)) { + PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3); + } + } + __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yend = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":592 + * yend = self.yend + * + * while True: # <<<<<<<<<<<<<< + * # we are done (or possibly never began) + * if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks: + */ + while (1) { + + /* "pandas/src/sparse.pyx":594 + * while True: + * # we are done (or possibly never began) + * if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks: # <<<<<<<<<<<<<< + * break + * elif self.yi >= self.y.nblocks: + */ + __pyx_t_6 = ((__pyx_v_self->__pyx_base.xi >= __pyx_v_self->__pyx_base.x->nblocks) != 0); + if (__pyx_t_6) { + __pyx_t_7 = ((__pyx_v_self->__pyx_base.yi >= __pyx_v_self->__pyx_base.y->nblocks) != 0); + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":595 + * # we are done (or possibly never began) + * if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks: + * break # <<<<<<<<<<<<<< + * elif self.yi >= self.y.nblocks: + * # through with y, just pass through x blocks + */ + goto __pyx_L4_break; + } + + /* "pandas/src/sparse.pyx":596 + * if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks: + * break + * elif self.yi >= self.y.nblocks: # <<<<<<<<<<<<<< + * # through with y, just pass through x blocks + * nstart = xstart[self.xi] + */ + __pyx_t_8 = ((__pyx_v_self->__pyx_base.yi >= __pyx_v_self->__pyx_base.y->nblocks) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":598 + * elif self.yi >= self.y.nblocks: + * # through with y, just pass through x blocks + * nstart = xstart[self.xi] # <<<<<<<<<<<<<< + * nend = xend[self.xi] + * self.xi += 1 + */ + __pyx_t_9 = __pyx_v_self->__pyx_base.xi; + __pyx_t_2 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_xstart.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_xstart.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":599 + * # through with y, just pass through x blocks + * nstart = xstart[self.xi] + * nend = xend[self.xi] # <<<<<<<<<<<<<< + * self.xi += 1 + * elif self.xi >= self.x.nblocks: + */ + __pyx_t_10 = __pyx_v_self->__pyx_base.xi; + __pyx_t_2 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_xend.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_xend.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xend.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_xend.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":600 + * nstart = xstart[self.xi] + * nend = xend[self.xi] + * self.xi += 1 # <<<<<<<<<<<<<< + * elif self.xi >= self.x.nblocks: + * # through with x, just pass through y blocks + */ + __pyx_v_self->__pyx_base.xi = (__pyx_v_self->__pyx_base.xi + 1); + goto __pyx_L5; + } + + /* "pandas/src/sparse.pyx":601 + * nend = xend[self.xi] + * self.xi += 1 + * elif self.xi >= self.x.nblocks: # <<<<<<<<<<<<<< + * # through with x, just pass through y blocks + * nstart = ystart[self.yi] + */ + __pyx_t_8 = ((__pyx_v_self->__pyx_base.xi >= __pyx_v_self->__pyx_base.x->nblocks) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":603 + * elif self.xi >= self.x.nblocks: + * # through with x, just pass through y blocks + * nstart = ystart[self.yi] # <<<<<<<<<<<<<< + * nend = yend[self.yi] + * self.yi += 1 + */ + __pyx_t_11 = __pyx_v_self->__pyx_base.yi; + __pyx_t_2 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_ystart.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":604 + * # through with x, just pass through y blocks + * nstart = ystart[self.yi] + * nend = yend[self.yi] # <<<<<<<<<<<<<< + * self.yi += 1 + * else: + */ + __pyx_t_12 = __pyx_v_self->__pyx_base.yi; + __pyx_t_2 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_yend.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_yend.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yend.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_yend.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":605 + * nstart = ystart[self.yi] + * nend = yend[self.yi] + * self.yi += 1 # <<<<<<<<<<<<<< + * else: + * # find end of new block + */ + __pyx_v_self->__pyx_base.yi = (__pyx_v_self->__pyx_base.yi + 1); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":608 + * else: + * # find end of new block + * if xstart[self.xi] < ystart[self.yi]: # <<<<<<<<<<<<<< + * nstart = xstart[self.xi] + * nend = self._find_next_block_end(0) + */ + __pyx_t_13 = __pyx_v_self->__pyx_base.xi; + __pyx_t_2 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_xstart.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = __pyx_v_self->__pyx_base.yi; + __pyx_t_2 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_xstart.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0); + if (__pyx_t_8) { + + /* "pandas/src/sparse.pyx":609 + * # find end of new block + * if xstart[self.xi] < ystart[self.yi]: + * nstart = xstart[self.xi] # <<<<<<<<<<<<<< + * nend = self._find_next_block_end(0) + * else: + */ + __pyx_t_15 = __pyx_v_self->__pyx_base.xi; + __pyx_t_2 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_xstart.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_xstart.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":610 + * if xstart[self.xi] < ystart[self.yi]: + * nstart = xstart[self.xi] + * nend = self._find_next_block_end(0) # <<<<<<<<<<<<<< + * else: + * nstart = ystart[self.yi] + */ + __pyx_t_16 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, 0); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nend = __pyx_t_16; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":612 + * nend = self._find_next_block_end(0) + * else: + * nstart = ystart[self.yi] # <<<<<<<<<<<<<< + * nend = self._find_next_block_end(1) + * + */ + __pyx_t_16 = __pyx_v_self->__pyx_base.yi; + __pyx_t_2 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_ystart.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":613 + * else: + * nstart = ystart[self.yi] + * nend = self._find_next_block_end(1) # <<<<<<<<<<<<<< + * + * out_blocs.append(nstart) + */ + __pyx_t_17 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, 1); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_nend = __pyx_t_17; + } + __pyx_L6:; + } + __pyx_L5:; + + /* "pandas/src/sparse.pyx":615 + * nend = self._find_next_block_end(1) + * + * out_blocs.append(nstart) # <<<<<<<<<<<<<< + * out_blengths.append(nend - nstart) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_nstart); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_out_blocs, __pyx_t_1); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":616 + * + * out_blocs.append(nstart) + * out_blengths.append(nend - nstart) # <<<<<<<<<<<<<< + * + * return BlockIndex(self.x.length, out_blocs, out_blengths) + */ + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_nend - __pyx_v_nstart)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_out_blengths, __pyx_t_1); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L4_break:; + + /* "pandas/src/sparse.pyx":618 + * out_blengths.append(nend - nstart) + * + * return BlockIndex(self.x.length, out_blocs, out_blengths) # <<<<<<<<<<<<<< + * + * cdef int32_t _find_next_block_end(self, bint mode) except -1: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->__pyx_base.x->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_out_blocs); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_out_blocs); + __Pyx_GIVEREF(__pyx_v_out_blocs); + __Pyx_INCREF(__pyx_v_out_blengths); + PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_v_out_blengths); + __Pyx_GIVEREF(__pyx_v_out_blengths); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":581 + * ''' + * + * cdef _make_merged_blocks(self): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int32_t, ndim=1] xstart, xend, ystart, yend + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_19); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockUnion._make_merged_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_xstart); + __Pyx_XDECREF((PyObject *)__pyx_v_xend); + __Pyx_XDECREF((PyObject *)__pyx_v_ystart); + __Pyx_XDECREF((PyObject *)__pyx_v_yend); + __Pyx_XDECREF(__pyx_v_out_blocs); + __Pyx_XDECREF(__pyx_v_out_blengths); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":620 + * return BlockIndex(self.x.length, out_blocs, out_blengths) + * + * cdef int32_t _find_next_block_end(self, bint mode) except -1: # <<<<<<<<<<<<<< + * ''' + * Wow, this got complicated in a hurry + */ + +static __pyx_t_5numpy_int32_t __pyx_f_6pandas_7_sparse_10BlockUnion__find_next_block_end(struct __pyx_obj_6pandas_7_sparse_BlockUnion *__pyx_v_self, int __pyx_v_mode) { + CYTHON_UNUSED PyArrayObject *__pyx_v_xstart = 0; + PyArrayObject *__pyx_v_xend = 0; + PyArrayObject *__pyx_v_ystart = 0; + PyArrayObject *__pyx_v_yend = 0; + __pyx_t_5numpy_int32_t __pyx_v_xi; + __pyx_t_5numpy_int32_t __pyx_v_yi; + __pyx_t_5numpy_int32_t __pyx_v_ynblocks; + __pyx_t_5numpy_int32_t __pyx_v_nend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xend; + __Pyx_Buffer __pyx_pybuffer_xend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xstart; + __Pyx_Buffer __pyx_pybuffer_xstart; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yend; + __Pyx_Buffer __pyx_pybuffer_yend; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ystart; + __Pyx_Buffer __pyx_pybuffer_ystart; + __pyx_t_5numpy_int32_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __pyx_t_5numpy_int32_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + __pyx_t_5numpy_int32_t __pyx_t_9; + __pyx_t_5numpy_int32_t __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + __pyx_t_5numpy_int32_t __pyx_t_13; + __pyx_t_5numpy_int32_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_find_next_block_end", 0); + __pyx_pybuffer_xstart.pybuffer.buf = NULL; + __pyx_pybuffer_xstart.refcount = 0; + __pyx_pybuffernd_xstart.data = NULL; + __pyx_pybuffernd_xstart.rcbuffer = &__pyx_pybuffer_xstart; + __pyx_pybuffer_xend.pybuffer.buf = NULL; + __pyx_pybuffer_xend.refcount = 0; + __pyx_pybuffernd_xend.data = NULL; + __pyx_pybuffernd_xend.rcbuffer = &__pyx_pybuffer_xend; + __pyx_pybuffer_ystart.pybuffer.buf = NULL; + __pyx_pybuffer_ystart.refcount = 0; + __pyx_pybuffernd_ystart.data = NULL; + __pyx_pybuffernd_ystart.rcbuffer = &__pyx_pybuffer_ystart; + __pyx_pybuffer_yend.pybuffer.buf = NULL; + __pyx_pybuffer_yend.refcount = 0; + __pyx_pybuffernd_yend.data = NULL; + __pyx_pybuffernd_yend.rcbuffer = &__pyx_pybuffer_yend; + + /* "pandas/src/sparse.pyx":631 + * int32_t xi, yi, xnblocks, ynblocks, nend + * + * if mode != 0 and mode != 1: # <<<<<<<<<<<<<< + * raise Exception('Mode must be 0 or 1') + * + */ + switch (__pyx_v_mode) { + case 0: + case 1: + __pyx_t_1 = 0; + break; + default: + __pyx_t_1 = 1; + break; + } + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":632 + * + * if mode != 0 and mode != 1: + * raise Exception('Mode must be 0 or 1') # <<<<<<<<<<<<<< + * + * # so symmetric code will work + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/src/sparse.pyx":635 + * + * # so symmetric code will work + * if mode == 0: # <<<<<<<<<<<<<< + * xstart = self.xstart + * xend = self.xend + */ + __pyx_t_1 = ((__pyx_v_mode == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":636 + * # so symmetric code will work + * if mode == 0: + * xstart = self.xstart # <<<<<<<<<<<<<< + * xend = self.xend + * xi = self.xi + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xstart); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xstart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":637 + * if mode == 0: + * xstart = self.xstart + * xend = self.xend # <<<<<<<<<<<<<< + * xi = self.xi + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xend); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":638 + * xstart = self.xstart + * xend = self.xend + * xi = self.xi # <<<<<<<<<<<<<< + * + * ystart = self.ystart + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.xi; + __pyx_v_xi = __pyx_t_7; + + /* "pandas/src/sparse.pyx":640 + * xi = self.xi + * + * ystart = self.ystart # <<<<<<<<<<<<<< + * yend = self.yend + * yi = self.yi + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.ystart); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ystart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":641 + * + * ystart = self.ystart + * yend = self.yend # <<<<<<<<<<<<<< + * yi = self.yi + * ynblocks = self.y.nblocks + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.yend); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":642 + * ystart = self.ystart + * yend = self.yend + * yi = self.yi # <<<<<<<<<<<<<< + * ynblocks = self.y.nblocks + * else: + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.yi; + __pyx_v_yi = __pyx_t_7; + + /* "pandas/src/sparse.pyx":643 + * yend = self.yend + * yi = self.yi + * ynblocks = self.y.nblocks # <<<<<<<<<<<<<< + * else: + * xstart = self.ystart + */ + __pyx_t_8 = __pyx_v_self->__pyx_base.y->nblocks; + __pyx_v_ynblocks = __pyx_t_8; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":645 + * ynblocks = self.y.nblocks + * else: + * xstart = self.ystart # <<<<<<<<<<<<<< + * xend = self.yend + * xi = self.yi + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.ystart); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xstart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":646 + * else: + * xstart = self.ystart + * xend = self.yend # <<<<<<<<<<<<<< + * xi = self.yi + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.yend); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":647 + * xstart = self.ystart + * xend = self.yend + * xi = self.yi # <<<<<<<<<<<<<< + * + * ystart = self.xstart + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.yi; + __pyx_v_xi = __pyx_t_7; + + /* "pandas/src/sparse.pyx":649 + * xi = self.yi + * + * ystart = self.xstart # <<<<<<<<<<<<<< + * yend = self.xend + * yi = self.xi + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xstart); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6); + } + } + __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ystart = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":650 + * + * ystart = self.xstart + * yend = self.xend # <<<<<<<<<<<<<< + * yi = self.xi + * ynblocks = self.x.nblocks + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xend); + __Pyx_INCREF(__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4); + } + } + __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yend = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":651 + * ystart = self.xstart + * yend = self.xend + * yi = self.xi # <<<<<<<<<<<<<< + * ynblocks = self.x.nblocks + * + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.xi; + __pyx_v_yi = __pyx_t_7; + + /* "pandas/src/sparse.pyx":652 + * yend = self.xend + * yi = self.xi + * ynblocks = self.x.nblocks # <<<<<<<<<<<<<< + * + * nend = xend[xi] + */ + __pyx_t_8 = __pyx_v_self->__pyx_base.x->nblocks; + __pyx_v_ynblocks = __pyx_t_8; + } + __pyx_L4:; + + /* "pandas/src/sparse.pyx":654 + * ynblocks = self.x.nblocks + * + * nend = xend[xi] # <<<<<<<<<<<<<< + * + * # print 'here xi=%d, yi=%d, mode=%d, nend=%d' % (self.xi, self.yi, + */ + __pyx_t_7 = __pyx_v_xi; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_xend.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_xend.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xend.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_xend.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":660 + * + * # done with y? + * if yi == ynblocks: # <<<<<<<<<<<<<< + * self._set_current_indices(xi + 1, yi, mode) + * return nend + */ + __pyx_t_1 = ((__pyx_v_yi == __pyx_v_ynblocks) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":661 + * # done with y? + * if yi == ynblocks: + * self._set_current_indices(xi + 1, yi, mode) # <<<<<<<<<<<<<< + * return nend + * elif nend < ystart[yi]: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":662 + * if yi == ynblocks: + * self._set_current_indices(xi + 1, yi, mode) + * return nend # <<<<<<<<<<<<<< + * elif nend < ystart[yi]: + * # block ends before y block + */ + __pyx_r = __pyx_v_nend; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":663 + * self._set_current_indices(xi + 1, yi, mode) + * return nend + * elif nend < ystart[yi]: # <<<<<<<<<<<<<< + * # block ends before y block + * self._set_current_indices(xi + 1, yi, mode) + */ + __pyx_t_9 = __pyx_v_yi; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = ((__pyx_v_nend < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":665 + * elif nend < ystart[yi]: + * # block ends before y block + * self._set_current_indices(xi + 1, yi, mode) # <<<<<<<<<<<<<< + * return nend + * else: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":666 + * # block ends before y block + * self._set_current_indices(xi + 1, yi, mode) + * return nend # <<<<<<<<<<<<<< + * else: + * while yi < ynblocks and nend > yend[yi]: + */ + __pyx_r = __pyx_v_nend; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":668 + * return nend + * else: + * while yi < ynblocks and nend > yend[yi]: # <<<<<<<<<<<<<< + * yi += 1 + * + */ + while (1) { + __pyx_t_1 = ((__pyx_v_yi < __pyx_v_ynblocks) != 0); + if (__pyx_t_1) { + __pyx_t_10 = __pyx_v_yi; + __pyx_t_3 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_yend.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_yend.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = ((__pyx_v_nend > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yend.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_yend.diminfo[0].strides))) != 0); + __pyx_t_12 = __pyx_t_11; + } else { + __pyx_t_12 = __pyx_t_1; + } + if (!__pyx_t_12) break; + + /* "pandas/src/sparse.pyx":669 + * else: + * while yi < ynblocks and nend > yend[yi]: + * yi += 1 # <<<<<<<<<<<<<< + * + * self._set_current_indices(xi + 1, yi, mode) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":671 + * yi += 1 + * + * self._set_current_indices(xi + 1, yi, mode) # <<<<<<<<<<<<<< + * + * if yi == ynblocks: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/sparse.pyx":673 + * self._set_current_indices(xi + 1, yi, mode) + * + * if yi == ynblocks: # <<<<<<<<<<<<<< + * return nend + * + */ + __pyx_t_12 = ((__pyx_v_yi == __pyx_v_ynblocks) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":674 + * + * if yi == ynblocks: + * return nend # <<<<<<<<<<<<<< + * + * if nend < ystart[yi]: + */ + __pyx_r = __pyx_v_nend; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":676 + * return nend + * + * if nend < ystart[yi]: # <<<<<<<<<<<<<< + * # we're done, return the block end + * return nend + */ + __pyx_t_13 = __pyx_v_yi; + __pyx_t_3 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_ystart.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = ((__pyx_v_nend < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":678 + * if nend < ystart[yi]: + * # we're done, return the block end + * return nend # <<<<<<<<<<<<<< + * else: + * # merge blocks, continue searching + */ + __pyx_r = __pyx_v_nend; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":682 + * # merge blocks, continue searching + * # this also catches the case where blocks + * return self._find_next_block_end(1 - mode) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_14 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, (1 - __pyx_v_mode)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_14; + goto __pyx_L0; + } + } + + /* "pandas/src/sparse.pyx":620 + * return BlockIndex(self.x.length, out_blocs, out_blengths) + * + * cdef int32_t _find_next_block_end(self, bint mode) except -1: # <<<<<<<<<<<<<< + * ''' + * Wow, this got complicated in a hurry + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.BlockUnion._find_next_block_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_xstart); + __Pyx_XDECREF((PyObject *)__pyx_v_xend); + __Pyx_XDECREF((PyObject *)__pyx_v_ystart); + __Pyx_XDECREF((PyObject *)__pyx_v_yend); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":690 + * ctypedef float64_t (* double_func)(float64_t a, float64_t b) + * + * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_nancombine(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nancombine", 0); + + /* "pandas/src/sparse.pyx":694 + * double_func op): + * # faster to convert to IntIndex + * return int_nanop(x, xindex.to_int_index(), # <<<<<<<<<<<<<< + * y, yindex.to_int_index(), op) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":695 + * # faster to convert to IntIndex + * return int_nanop(x, xindex.to_int_index(), + * y, yindex.to_int_index(), op) # <<<<<<<<<<<<<< + * + * # if isinstance(xindex, BlockIndex): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_yindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":694 + * double_func op): + * # faster to convert to IntIndex + * return int_nanop(x, xindex.to_int_index(), # <<<<<<<<<<<<<< + * y, yindex.to_int_index(), op) + * + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_int_nanop(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_2), __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_3), __pyx_v_op); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":690 + * ctypedef float64_t (* double_func)(float64_t a, float64_t b) + * + * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas._sparse.sparse_nancombine", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":705 + * + * + * cdef inline tuple sparse_combine(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_combine(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_combine", 0); + + /* "pandas/src/sparse.pyx":708 + * ndarray y, SparseIndex yindex, float64_t yfill, + * double_func op): + * if isinstance(xindex, BlockIndex): # <<<<<<<<<<<<<< + * return block_op(x, xindex.to_block_index(), xfill, + * y, yindex.to_block_index(), yfill, op) + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_xindex), ((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/src/sparse.pyx":709 + * double_func op): + * if isinstance(xindex, BlockIndex): + * return block_op(x, xindex.to_block_index(), xfill, # <<<<<<<<<<<<<< + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":710 + * if isinstance(xindex, BlockIndex): + * return block_op(x, xindex.to_block_index(), xfill, + * y, yindex.to_block_index(), yfill, op) # <<<<<<<<<<<<<< + * elif isinstance(xindex, IntIndex): + * return int_op(x, xindex.to_int_index(), xfill, + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_yindex), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":709 + * double_func op): + * if isinstance(xindex, BlockIndex): + * return block_op(x, xindex.to_block_index(), xfill, # <<<<<<<<<<<<<< + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): + */ + __pyx_t_3 = __pyx_f_6pandas_7_sparse_block_op(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_4), __pyx_v_xfill, __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_5), __pyx_v_yfill, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":711 + * return block_op(x, xindex.to_block_index(), xfill, + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): # <<<<<<<<<<<<<< + * return int_op(x, xindex.to_int_index(), xfill, + * y, yindex.to_int_index(), yfill, op) + */ + __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_xindex), ((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":712 + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): + * return int_op(x, xindex.to_int_index(), xfill, # <<<<<<<<<<<<<< + * y, yindex.to_int_index(), yfill, op) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":713 + * elif isinstance(xindex, IntIndex): + * return int_op(x, xindex.to_int_index(), xfill, + * y, yindex.to_int_index(), yfill, op) # <<<<<<<<<<<<<< + * + * # NaN-based arithmetic operation-- no handling of fill values + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_yindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":712 + * y, yindex.to_block_index(), yfill, op) + * elif isinstance(xindex, IntIndex): + * return int_op(x, xindex.to_int_index(), xfill, # <<<<<<<<<<<<<< + * y, yindex.to_int_index(), yfill, op) + * + */ + __pyx_t_3 = __pyx_f_6pandas_7_sparse_int_op(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_5), __pyx_v_xfill, __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_4), __pyx_v_yfill, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":705 + * + * + * cdef inline tuple sparse_combine(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill, + * double_func op): + */ + + /* function exit code */ + __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas._sparse.sparse_combine", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":719 + * + * @cython.boundscheck(False) + * cdef inline tuple block_nanop(ndarray x_, BlockIndex xindex, # <<<<<<<<<<<<<< + * ndarray y_, BlockIndex yindex, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_nanop(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_yindex, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_out_index = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_out_i; + Py_ssize_t __pyx_v_xbp; + Py_ssize_t __pyx_v_ybp; + Py_ssize_t __pyx_v_obp; + Py_ssize_t __pyx_v_xblock; + Py_ssize_t __pyx_v_yblock; + Py_ssize_t __pyx_v_outblock; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_y = 0; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("block_nanop", 0); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/src/sparse.pyx":724 + * cdef: + * BlockIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices # <<<<<<<<<<<<<< + * Py_ssize_t xbp = 0, ybp = 0, obp = 0 # block positions + * Py_ssize_t xblock = 0, yblock = 0, outblock = 0 # block numbers + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + __pyx_v_out_i = 0; + + /* "pandas/src/sparse.pyx":725 + * BlockIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices + * Py_ssize_t xbp = 0, ybp = 0, obp = 0 # block positions # <<<<<<<<<<<<<< + * Py_ssize_t xblock = 0, yblock = 0, outblock = 0 # block numbers + * + */ + __pyx_v_xbp = 0; + __pyx_v_ybp = 0; + __pyx_v_obp = 0; + + /* "pandas/src/sparse.pyx":726 + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices + * Py_ssize_t xbp = 0, ybp = 0, obp = 0 # block positions + * Py_ssize_t xblock = 0, yblock = 0, outblock = 0 # block numbers # <<<<<<<<<<<<<< + * + * ndarray[float64_t, ndim=1] x, y + */ + __pyx_v_xblock = 0; + __pyx_v_yblock = 0; + __pyx_v_outblock = 0; + + /* "pandas/src/sparse.pyx":732 + * + * # suppress Cython compiler warnings due to inlining + * x = x_ # <<<<<<<<<<<<<< + * y = y_ + * + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_x_)); + __pyx_v_x = ((PyArrayObject *)__pyx_v_x_); + + /* "pandas/src/sparse.pyx":733 + * # suppress Cython compiler warnings due to inlining + * x = x_ + * y = y_ # <<<<<<<<<<<<<< + * + * out_index = xindex.intersect(yindex) + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + __pyx_v_y = ((PyArrayObject *)__pyx_v_y_); + + /* "pandas/src/sparse.pyx":735 + * y = y_ + * + * out_index = xindex.intersect(yindex) # <<<<<<<<<<<<<< + * out = np.empty(out_index.npoints, dtype=np.float64) + * + */ + __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_xindex->__pyx_vtab)->intersect(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":736 + * + * out_index = xindex.intersect(yindex) + * out = np.empty(out_index.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * # walk the two SparseVectors, adding matched locations... + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":739 + * + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: # <<<<<<<<<<<<<< + * + * # I have a feeling this is inefficient + */ + __pyx_t_11 = __pyx_v_out_index->npoints; + for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) { + + /* "pandas/src/sparse.pyx":744 + * + * # walk x + * while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp: # <<<<<<<<<<<<<< + * xbp += 1 + * xi += 1 + */ + while (1) { + __pyx_t_12 = ((((__pyx_v_xindex->locbuf[__pyx_v_xblock]) + __pyx_v_xbp) < ((__pyx_v_out_index->locbuf[__pyx_v_outblock]) + __pyx_v_obp)) != 0); + if (!__pyx_t_12) break; + + /* "pandas/src/sparse.pyx":745 + * # walk x + * while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp: + * xbp += 1 # <<<<<<<<<<<<<< + * xi += 1 + * if xbp == xindex.lenbuf[xblock]: + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":746 + * while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp: + * xbp += 1 + * xi += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":747 + * xbp += 1 + * xi += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":748 + * xi += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":749 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * + * # walk y + */ + __pyx_v_xbp = 0; + goto __pyx_L7; + } + __pyx_L7:; + } + + /* "pandas/src/sparse.pyx":752 + * + * # walk y + * while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp: # <<<<<<<<<<<<<< + * ybp += 1 + * yi += 1 + */ + while (1) { + __pyx_t_12 = ((((__pyx_v_yindex->locbuf[__pyx_v_yblock]) + __pyx_v_ybp) < ((__pyx_v_out_index->locbuf[__pyx_v_outblock]) + __pyx_v_obp)) != 0); + if (!__pyx_t_12) break; + + /* "pandas/src/sparse.pyx":753 + * # walk y + * while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp: + * ybp += 1 # <<<<<<<<<<<<<< + * yi += 1 + * if ybp == yindex.lenbuf[yblock]: + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":754 + * while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp: + * ybp += 1 + * yi += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":755 + * ybp += 1 + * yi += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":756 + * yi += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":757 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * + * out[out_i] = op(x[xi], y[yi]) + */ + __pyx_v_ybp = 0; + goto __pyx_L10; + } + __pyx_L10:; + } + + /* "pandas/src/sparse.pyx":759 + * ybp = 0 + * + * out[out_i] = op(x[xi], y[yi]) # <<<<<<<<<<<<<< + * + * # advance. strikes me as too complicated + */ + __pyx_t_13 = __pyx_v_xi; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_14 = __pyx_v_yi; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_15 = __pyx_v_out_i; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":762 + * + * # advance. strikes me as too complicated + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":763 + * # advance. strikes me as too complicated + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * + * xbp += 1 + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":765 + * yi += 1 + * + * xbp += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":766 + * + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":767 + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":768 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * + * ybp += 1 + */ + __pyx_v_xbp = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/src/sparse.pyx":770 + * xbp = 0 + * + * ybp += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":771 + * + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":772 + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":773 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * + * obp += 1 + */ + __pyx_v_ybp = 0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/src/sparse.pyx":775 + * ybp = 0 + * + * obp += 1 # <<<<<<<<<<<<<< + * if obp == out_index.lenbuf[outblock]: + * outblock += 1 + */ + __pyx_v_obp = (__pyx_v_obp + 1); + + /* "pandas/src/sparse.pyx":776 + * + * obp += 1 + * if obp == out_index.lenbuf[outblock]: # <<<<<<<<<<<<<< + * outblock += 1 + * obp = 0 + */ + __pyx_t_12 = ((__pyx_v_obp == (__pyx_v_out_index->lenbuf[__pyx_v_outblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":777 + * obp += 1 + * if obp == out_index.lenbuf[outblock]: + * outblock += 1 # <<<<<<<<<<<<<< + * obp = 0 + * + */ + __pyx_v_outblock = (__pyx_v_outblock + 1); + + /* "pandas/src/sparse.pyx":778 + * if obp == out_index.lenbuf[outblock]: + * outblock += 1 + * obp = 0 # <<<<<<<<<<<<<< + * + * return out, out_index + */ + __pyx_v_obp = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/src/sparse.pyx":780 + * obp = 0 + * + * return out, out_index # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __Pyx_INCREF(((PyObject *)__pyx_v_out_index)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index)); + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":719 + * + * @cython.boundscheck(False) + * cdef inline tuple block_nanop(ndarray x_, BlockIndex xindex, # <<<<<<<<<<<<<< + * ndarray y_, BlockIndex yindex, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.block_nanop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out_index); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":783 + * + * @cython.boundscheck(False) + * cdef inline tuple int_nanop(ndarray x_, IntIndex xindex, # <<<<<<<<<<<<<< + * ndarray y_, IntIndex yindex, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_nanop(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_yindex, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_out_index = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_out_i; + PyArrayObject *__pyx_v_xindices = 0; + PyArrayObject *__pyx_v_yindices = 0; + PyArrayObject *__pyx_v_out_indices = 0; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_y = 0; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out_indices; + __Pyx_Buffer __pyx_pybuffer_out_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices; + __Pyx_Buffer __pyx_pybuffer_xindices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices; + __Pyx_Buffer __pyx_pybuffer_yindices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("int_nanop", 0); + __pyx_pybuffer_xindices.pybuffer.buf = NULL; + __pyx_pybuffer_xindices.refcount = 0; + __pyx_pybuffernd_xindices.data = NULL; + __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices; + __pyx_pybuffer_yindices.pybuffer.buf = NULL; + __pyx_pybuffer_yindices.refcount = 0; + __pyx_pybuffernd_yindices.data = NULL; + __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices; + __pyx_pybuffer_out_indices.pybuffer.buf = NULL; + __pyx_pybuffer_out_indices.refcount = 0; + __pyx_pybuffernd_out_indices.data = NULL; + __pyx_pybuffernd_out_indices.rcbuffer = &__pyx_pybuffer_out_indices; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/src/sparse.pyx":788 + * cdef: + * IntIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices # <<<<<<<<<<<<<< + * ndarray[int32_t, ndim=1] xindices, yindices, out_indices + * ndarray[float64_t, ndim=1] x, y + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + __pyx_v_out_i = 0; + + /* "pandas/src/sparse.pyx":794 + * + * # suppress Cython compiler warnings due to inlining + * x = x_ # <<<<<<<<<<<<<< + * y = y_ + * + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_x_)); + __pyx_v_x = ((PyArrayObject *)__pyx_v_x_); + + /* "pandas/src/sparse.pyx":795 + * # suppress Cython compiler warnings due to inlining + * x = x_ + * y = y_ # <<<<<<<<<<<<<< + * + * # need to do this first to know size of result array + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + __pyx_v_y = ((PyArrayObject *)__pyx_v_y_); + + /* "pandas/src/sparse.pyx":798 + * + * # need to do this first to know size of result array + * out_index = xindex.intersect(yindex) # <<<<<<<<<<<<<< + * out = np.empty(out_index.npoints, dtype=np.float64) + * + */ + __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_xindex->__pyx_vtab)->intersect(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":799 + * # need to do this first to know size of result array + * out_index = xindex.intersect(yindex) + * out = np.empty(out_index.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * xindices = xindex.indices + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":801 + * out = np.empty(out_index.npoints, dtype=np.float64) + * + * xindices = xindex.indices # <<<<<<<<<<<<<< + * yindices = yindex.indices + * out_indices = out_index.indices + */ + __pyx_t_9 = ((PyObject *)__pyx_v_xindex->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xindices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":802 + * + * xindices = xindex.indices + * yindices = yindex.indices # <<<<<<<<<<<<<< + * out_indices = out_index.indices + * + */ + __pyx_t_9 = ((PyObject *)__pyx_v_yindex->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yindices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":803 + * xindices = xindex.indices + * yindices = yindex.indices + * out_indices = out_index.indices # <<<<<<<<<<<<<< + * + * # walk the two SparseVectors, adding matched locations... + */ + __pyx_t_9 = ((PyObject *)__pyx_v_out_index->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_out_indices.diminfo[0].strides = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_indices.diminfo[0].shape = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_out_indices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":806 + * + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: # <<<<<<<<<<<<<< + * + * # walk x + */ + __pyx_t_11 = __pyx_v_out_index->npoints; + for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) { + + /* "pandas/src/sparse.pyx":809 + * + * # walk x + * while xindices[xi] < out_indices[out_i]: # <<<<<<<<<<<<<< + * xi += 1 + * + */ + while (1) { + __pyx_t_12 = __pyx_v_xi; + if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_pybuffernd_xindices.diminfo[0].shape; + __pyx_t_13 = __pyx_v_out_i; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_out_indices.diminfo[0].shape; + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_xindices.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_out_indices.diminfo[0].strides))) != 0); + if (!__pyx_t_14) break; + + /* "pandas/src/sparse.pyx":810 + * # walk x + * while xindices[xi] < out_indices[out_i]: + * xi += 1 # <<<<<<<<<<<<<< + * + * # walk y + */ + __pyx_v_xi = (__pyx_v_xi + 1); + } + + /* "pandas/src/sparse.pyx":813 + * + * # walk y + * while yindices[yi] < out_indices[out_i]: # <<<<<<<<<<<<<< + * yi += 1 + * + */ + while (1) { + __pyx_t_15 = __pyx_v_yi; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_yindices.diminfo[0].shape; + __pyx_t_16 = __pyx_v_out_i; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out_indices.diminfo[0].shape; + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_yindices.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out_indices.diminfo[0].strides))) != 0); + if (!__pyx_t_14) break; + + /* "pandas/src/sparse.pyx":814 + * # walk y + * while yindices[yi] < out_indices[out_i]: + * yi += 1 # <<<<<<<<<<<<<< + * + * out[out_i] = op(x[xi], y[yi]) + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":816 + * yi += 1 + * + * out[out_i] = op(x[xi], y[yi]) # <<<<<<<<<<<<<< + * + * # advance + */ + __pyx_t_17 = __pyx_v_xi; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_18 = __pyx_v_yi; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_19 = __pyx_v_out_i; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":819 + * + * # advance + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":820 + * # advance + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * + * return out, out_index + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + + /* "pandas/src/sparse.pyx":822 + * yi += 1 + * + * return out, out_index # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __Pyx_INCREF(((PyObject *)__pyx_v_out_index)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index)); + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":783 + * + * @cython.boundscheck(False) + * cdef inline tuple int_nanop(ndarray x_, IntIndex xindex, # <<<<<<<<<<<<<< + * ndarray y_, IntIndex yindex, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.int_nanop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out_index); + __Pyx_XDECREF((PyObject *)__pyx_v_xindices); + __Pyx_XDECREF((PyObject *)__pyx_v_yindices); + __Pyx_XDECREF((PyObject *)__pyx_v_out_indices); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":826 + * + * @cython.boundscheck(False) + * cdef inline tuple block_op(ndarray x_, BlockIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y_, BlockIndex yindex, float64_t yfill, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_op(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_out_index = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_out_i; + Py_ssize_t __pyx_v_xbp; + Py_ssize_t __pyx_v_ybp; + __pyx_t_5numpy_int32_t __pyx_v_xloc; + __pyx_t_5numpy_int32_t __pyx_v_yloc; + Py_ssize_t __pyx_v_xblock; + Py_ssize_t __pyx_v_yblock; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_y = 0; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("block_op", 0); + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/src/sparse.pyx":835 + * cdef: + * BlockIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices # <<<<<<<<<<<<<< + * Py_ssize_t xbp = 0, ybp = 0 # block positions + * int32_t xloc, yloc + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + __pyx_v_out_i = 0; + + /* "pandas/src/sparse.pyx":836 + * BlockIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices + * Py_ssize_t xbp = 0, ybp = 0 # block positions # <<<<<<<<<<<<<< + * int32_t xloc, yloc + * Py_ssize_t xblock = 0, yblock = 0 # block numbers + */ + __pyx_v_xbp = 0; + __pyx_v_ybp = 0; + + /* "pandas/src/sparse.pyx":838 + * Py_ssize_t xbp = 0, ybp = 0 # block positions + * int32_t xloc, yloc + * Py_ssize_t xblock = 0, yblock = 0 # block numbers # <<<<<<<<<<<<<< + * + * ndarray[float64_t, ndim=1] x, y + */ + __pyx_v_xblock = 0; + __pyx_v_yblock = 0; + + /* "pandas/src/sparse.pyx":844 + * + * # to suppress Cython warning + * x = x_ # <<<<<<<<<<<<<< + * y = y_ + * + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_x_)); + __pyx_v_x = ((PyArrayObject *)__pyx_v_x_); + + /* "pandas/src/sparse.pyx":845 + * # to suppress Cython warning + * x = x_ + * y = y_ # <<<<<<<<<<<<<< + * + * out_index = xindex.make_union(yindex) + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + __pyx_v_y = ((PyArrayObject *)__pyx_v_y_); + + /* "pandas/src/sparse.pyx":847 + * y = y_ + * + * out_index = xindex.make_union(yindex) # <<<<<<<<<<<<<< + * out = np.empty(out_index.npoints, dtype=np.float64) + * + */ + __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_xindex->__pyx_vtab)->make_union(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":848 + * + * out_index = xindex.make_union(yindex) + * out = np.empty(out_index.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * # Wow, what a hack job. Need to do something about this + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":853 + * + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: # <<<<<<<<<<<<<< + * if yblock == yindex.nblocks: + * # use y fill value + */ + __pyx_t_11 = __pyx_v_out_index->npoints; + for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) { + + /* "pandas/src/sparse.pyx":854 + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: + * if yblock == yindex.nblocks: # <<<<<<<<<<<<<< + * # use y fill value + * out[out_i] = op(x[xi], yfill) + */ + __pyx_t_12 = ((__pyx_v_yblock == __pyx_v_yindex->nblocks) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":856 + * if yblock == yindex.nblocks: + * # use y fill value + * out[out_i] = op(x[xi], yfill) # <<<<<<<<<<<<<< + * xi += 1 + * + */ + __pyx_t_13 = __pyx_v_xi; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_14 = __pyx_v_out_i; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill); + + /* "pandas/src/sparse.pyx":857 + * # use y fill value + * out[out_i] = op(x[xi], yfill) + * xi += 1 # <<<<<<<<<<<<<< + * + * # advance x location + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":860 + * + * # advance x location + * xbp += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":861 + * # advance x location + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":862 + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * continue + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":863 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_xbp = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/sparse.pyx":864 + * xblock += 1 + * xbp = 0 + * continue # <<<<<<<<<<<<<< + * + * if xblock == xindex.nblocks: + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":866 + * continue + * + * if xblock == xindex.nblocks: # <<<<<<<<<<<<<< + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + */ + __pyx_t_12 = ((__pyx_v_xblock == __pyx_v_xindex->nblocks) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":868 + * if xblock == xindex.nblocks: + * # use x fill value + * out[out_i] = op(xfill, y[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_15 = __pyx_v_yi; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_16 = __pyx_v_out_i; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":869 + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * + * # advance y location + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":872 + * + * # advance y location + * ybp += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":873 + * # advance y location + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":874 + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * continue + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":875 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_ybp = 0; + goto __pyx_L8; + } + __pyx_L8:; + + /* "pandas/src/sparse.pyx":876 + * yblock += 1 + * ybp = 0 + * continue # <<<<<<<<<<<<<< + * + * yloc = yindex.locbuf[yblock] + ybp + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":878 + * continue + * + * yloc = yindex.locbuf[yblock] + ybp # <<<<<<<<<<<<<< + * xloc = xindex.locbuf[xblock] + xbp + * + */ + __pyx_v_yloc = ((__pyx_v_yindex->locbuf[__pyx_v_yblock]) + __pyx_v_ybp); + + /* "pandas/src/sparse.pyx":879 + * + * yloc = yindex.locbuf[yblock] + ybp + * xloc = xindex.locbuf[xblock] + xbp # <<<<<<<<<<<<<< + * + * # each index in the out_index had to come from either x, y, or both + */ + __pyx_v_xloc = ((__pyx_v_xindex->locbuf[__pyx_v_xblock]) + __pyx_v_xbp); + + /* "pandas/src/sparse.pyx":882 + * + * # each index in the out_index had to come from either x, y, or both + * if xloc == yloc: # <<<<<<<<<<<<<< + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 + */ + __pyx_t_12 = ((__pyx_v_xloc == __pyx_v_yloc) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":883 + * # each index in the out_index had to come from either x, y, or both + * if xloc == yloc: + * out[out_i] = op(x[xi], y[yi]) # <<<<<<<<<<<<<< + * xi += 1 + * yi += 1 + */ + __pyx_t_17 = __pyx_v_xi; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_18 = __pyx_v_yi; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_19 = __pyx_v_out_i; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":884 + * if xloc == yloc: + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":885 + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * + * # advance both locations + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":888 + * + * # advance both locations + * xbp += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":889 + * # advance both locations + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":890 + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":891 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * + * ybp += 1 + */ + __pyx_v_xbp = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/src/sparse.pyx":893 + * xbp = 0 + * + * ybp += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":894 + * + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":895 + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":896 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * + * elif xloc < yloc: + */ + __pyx_v_ybp = 0; + goto __pyx_L11; + } + __pyx_L11:; + goto __pyx_L9; + } + + /* "pandas/src/sparse.pyx":898 + * ybp = 0 + * + * elif xloc < yloc: # <<<<<<<<<<<<<< + * # use y fill value + * out[out_i] = op(x[xi], yfill) + */ + __pyx_t_12 = ((__pyx_v_xloc < __pyx_v_yloc) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":900 + * elif xloc < yloc: + * # use y fill value + * out[out_i] = op(x[xi], yfill) # <<<<<<<<<<<<<< + * xi += 1 + * + */ + __pyx_t_20 = __pyx_v_xi; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_21 = __pyx_v_out_i; + if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill); + + /* "pandas/src/sparse.pyx":901 + * # use y fill value + * out[out_i] = op(x[xi], yfill) + * xi += 1 # <<<<<<<<<<<<<< + * + * # advance x location + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":904 + * + * # advance x location + * xbp += 1 # <<<<<<<<<<<<<< + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + */ + __pyx_v_xbp = (__pyx_v_xbp + 1); + + /* "pandas/src/sparse.pyx":905 + * # advance x location + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: # <<<<<<<<<<<<<< + * xblock += 1 + * xbp = 0 + */ + __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":906 + * xbp += 1 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 # <<<<<<<<<<<<<< + * xbp = 0 + * else: + */ + __pyx_v_xblock = (__pyx_v_xblock + 1); + + /* "pandas/src/sparse.pyx":907 + * if xbp == xindex.lenbuf[xblock]: + * xblock += 1 + * xbp = 0 # <<<<<<<<<<<<<< + * else: + * # use x fill value + */ + __pyx_v_xbp = 0; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":910 + * else: + * # use x fill value + * out[out_i] = op(xfill, y[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_22 = __pyx_v_yi; + if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_23 = __pyx_v_out_i; + if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":911 + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * + * # advance y location + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":914 + * + * # advance y location + * ybp += 1 # <<<<<<<<<<<<<< + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + */ + __pyx_v_ybp = (__pyx_v_ybp + 1); + + /* "pandas/src/sparse.pyx":915 + * # advance y location + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: # <<<<<<<<<<<<<< + * yblock += 1 + * ybp = 0 + */ + __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":916 + * ybp += 1 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 # <<<<<<<<<<<<<< + * ybp = 0 + * + */ + __pyx_v_yblock = (__pyx_v_yblock + 1); + + /* "pandas/src/sparse.pyx":917 + * if ybp == yindex.lenbuf[yblock]: + * yblock += 1 + * ybp = 0 # <<<<<<<<<<<<<< + * + * return out, out_index + */ + __pyx_v_ybp = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + __pyx_L9:; + __pyx_L3_continue:; + } + + /* "pandas/src/sparse.pyx":919 + * ybp = 0 + * + * return out, out_index # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __Pyx_INCREF(((PyObject *)__pyx_v_out_index)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index)); + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":826 + * + * @cython.boundscheck(False) + * cdef inline tuple block_op(ndarray x_, BlockIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y_, BlockIndex yindex, float64_t yfill, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.block_op", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out_index); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":923 + * + * @cython.boundscheck(False) + * cdef inline tuple int_op(ndarray x_, IntIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y_, IntIndex yindex, float64_t yfill, + * double_func op): + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_op(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) { + struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_out_index = 0; + Py_ssize_t __pyx_v_xi; + Py_ssize_t __pyx_v_yi; + Py_ssize_t __pyx_v_out_i; + __pyx_t_5numpy_int32_t __pyx_v_xloc; + __pyx_t_5numpy_int32_t __pyx_v_yloc; + PyArrayObject *__pyx_v_xindices = 0; + PyArrayObject *__pyx_v_yindices = 0; + CYTHON_UNUSED PyArrayObject *__pyx_v_out_indices = 0; + PyArrayObject *__pyx_v_x = 0; + PyArrayObject *__pyx_v_y = 0; + PyArrayObject *__pyx_v_out = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out_indices; + __Pyx_Buffer __pyx_pybuffer_out_indices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_x; + __Pyx_Buffer __pyx_pybuffer_x; + __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices; + __Pyx_Buffer __pyx_pybuffer_xindices; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices; + __Pyx_Buffer __pyx_pybuffer_yindices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("int_op", 0); + __pyx_pybuffer_xindices.pybuffer.buf = NULL; + __pyx_pybuffer_xindices.refcount = 0; + __pyx_pybuffernd_xindices.data = NULL; + __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices; + __pyx_pybuffer_yindices.pybuffer.buf = NULL; + __pyx_pybuffer_yindices.refcount = 0; + __pyx_pybuffernd_yindices.data = NULL; + __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices; + __pyx_pybuffer_out_indices.pybuffer.buf = NULL; + __pyx_pybuffer_out_indices.refcount = 0; + __pyx_pybuffernd_out_indices.data = NULL; + __pyx_pybuffernd_out_indices.rcbuffer = &__pyx_pybuffer_out_indices; + __pyx_pybuffer_x.pybuffer.buf = NULL; + __pyx_pybuffer_x.refcount = 0; + __pyx_pybuffernd_x.data = NULL; + __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x; + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + + /* "pandas/src/sparse.pyx":928 + * cdef: + * IntIndex out_index + * Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices # <<<<<<<<<<<<<< + * int32_t xloc, yloc + * ndarray[int32_t, ndim=1] xindices, yindices, out_indices + */ + __pyx_v_xi = 0; + __pyx_v_yi = 0; + __pyx_v_out_i = 0; + + /* "pandas/src/sparse.pyx":935 + * + * # suppress Cython compiler warnings due to inlining + * x = x_ # <<<<<<<<<<<<<< + * y = y_ + * + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_x_)); + __pyx_v_x = ((PyArrayObject *)__pyx_v_x_); + + /* "pandas/src/sparse.pyx":936 + * # suppress Cython compiler warnings due to inlining + * x = x_ + * y = y_ # <<<<<<<<<<<<<< + * + * # need to do this first to know size of result array + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_y_)); + __pyx_v_y = ((PyArrayObject *)__pyx_v_y_); + + /* "pandas/src/sparse.pyx":939 + * + * # need to do this first to know size of result array + * out_index = xindex.make_union(yindex) # <<<<<<<<<<<<<< + * out = np.empty(out_index.npoints, dtype=np.float64) + * + */ + __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_xindex->__pyx_vtab)->make_union(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/sparse.pyx":940 + * # need to do this first to know size of result array + * out_index = xindex.make_union(yindex) + * out = np.empty(out_index.npoints, dtype=np.float64) # <<<<<<<<<<<<<< + * + * xindices = xindex.indices + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":942 + * out = np.empty(out_index.npoints, dtype=np.float64) + * + * xindices = xindex.indices # <<<<<<<<<<<<<< + * yindices = yindex.indices + * out_indices = out_index.indices + */ + __pyx_t_9 = ((PyObject *)__pyx_v_xindex->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_xindices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":943 + * + * xindices = xindex.indices + * yindices = yindex.indices # <<<<<<<<<<<<<< + * out_indices = out_index.indices + * + */ + __pyx_t_9 = ((PyObject *)__pyx_v_yindex->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4); + } + } + __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_yindices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":944 + * xindices = xindex.indices + * yindices = yindex.indices + * out_indices = out_index.indices # <<<<<<<<<<<<<< + * + * # walk the two SparseVectors, adding matched locations... + */ + __pyx_t_9 = ((PyObject *)__pyx_v_out_index->indices); + __Pyx_INCREF(__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_1 < 0)) { + PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + } + } + __pyx_pybuffernd_out_indices.diminfo[0].strides = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_indices.diminfo[0].shape = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_out_indices = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/src/sparse.pyx":947 + * + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: # <<<<<<<<<<<<<< + * if xi == xindex.npoints: + * # use x fill value + */ + __pyx_t_11 = __pyx_v_out_index->npoints; + for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) { + + /* "pandas/src/sparse.pyx":948 + * # walk the two SparseVectors, adding matched locations... + * for out_i from 0 <= out_i < out_index.npoints: + * if xi == xindex.npoints: # <<<<<<<<<<<<<< + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + */ + __pyx_t_12 = ((__pyx_v_xi == __pyx_v_xindex->npoints) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":950 + * if xi == xindex.npoints: + * # use x fill value + * out[out_i] = op(xfill, y[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * continue + */ + __pyx_t_13 = __pyx_v_yi; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_14 = __pyx_v_out_i; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":951 + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_yi = (__pyx_v_yi + 1); + + /* "pandas/src/sparse.pyx":952 + * out[out_i] = op(xfill, y[yi]) + * yi += 1 + * continue # <<<<<<<<<<<<<< + * + * if yi == yindex.npoints: + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":954 + * continue + * + * if yi == yindex.npoints: # <<<<<<<<<<<<<< + * # use y fill value + * out[out_i] = op(x[xi], yfill) + */ + __pyx_t_12 = ((__pyx_v_yi == __pyx_v_yindex->npoints) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":956 + * if yi == yindex.npoints: + * # use y fill value + * out[out_i] = op(x[xi], yfill) # <<<<<<<<<<<<<< + * xi += 1 + * continue + */ + __pyx_t_15 = __pyx_v_xi; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_16 = __pyx_v_out_i; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill); + + /* "pandas/src/sparse.pyx":957 + * # use y fill value + * out[out_i] = op(x[xi], yfill) + * xi += 1 # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":958 + * out[out_i] = op(x[xi], yfill) + * xi += 1 + * continue # <<<<<<<<<<<<<< + * + * xloc = xindices[xi] + */ + goto __pyx_L3_continue; + } + + /* "pandas/src/sparse.pyx":960 + * continue + * + * xloc = xindices[xi] # <<<<<<<<<<<<<< + * yloc = yindices[yi] + * + */ + __pyx_t_17 = __pyx_v_xi; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_xindices.diminfo[0].shape; + __pyx_v_xloc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_xindices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":961 + * + * xloc = xindices[xi] + * yloc = yindices[yi] # <<<<<<<<<<<<<< + * + * # each index in the out_index had to come from either x, y, or both + */ + __pyx_t_18 = __pyx_v_yi; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_yindices.diminfo[0].shape; + __pyx_v_yloc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_yindices.diminfo[0].strides)); + + /* "pandas/src/sparse.pyx":964 + * + * # each index in the out_index had to come from either x, y, or both + * if xloc == yloc: # <<<<<<<<<<<<<< + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 + */ + __pyx_t_12 = ((__pyx_v_xloc == __pyx_v_yloc) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":965 + * # each index in the out_index had to come from either x, y, or both + * if xloc == yloc: + * out[out_i] = op(x[xi], y[yi]) # <<<<<<<<<<<<<< + * xi += 1 + * yi += 1 + */ + __pyx_t_19 = __pyx_v_xi; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_20 = __pyx_v_yi; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_21 = __pyx_v_out_i; + if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":966 + * if xloc == yloc: + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 # <<<<<<<<<<<<<< + * yi += 1 + * elif xloc < yloc: + */ + __pyx_v_xi = (__pyx_v_xi + 1); + + /* "pandas/src/sparse.pyx":967 + * out[out_i] = op(x[xi], y[yi]) + * xi += 1 + * yi += 1 # <<<<<<<<<<<<<< + * elif xloc < yloc: + * # use y fill value + */ + __pyx_v_yi = (__pyx_v_yi + 1); + goto __pyx_L7; + } + + /* "pandas/src/sparse.pyx":968 + * xi += 1 + * yi += 1 + * elif xloc < yloc: # <<<<<<<<<<<<<< + * # use y fill value + * out[out_i] = op(x[xi], yfill) + */ + __pyx_t_12 = ((__pyx_v_xloc < __pyx_v_yloc) != 0); + if (__pyx_t_12) { + + /* "pandas/src/sparse.pyx":970 + * elif xloc < yloc: + * # use y fill value + * out[out_i] = op(x[xi], yfill) # <<<<<<<<<<<<<< + * xi += 1 + * else: + */ + __pyx_t_22 = __pyx_v_xi; + if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_x.diminfo[0].shape; + __pyx_t_23 = __pyx_v_out_i; + if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill); + + /* "pandas/src/sparse.pyx":971 + * # use y fill value + * out[out_i] = op(x[xi], yfill) + * xi += 1 # <<<<<<<<<<<<<< + * else: + * # use x fill value + */ + __pyx_v_xi = (__pyx_v_xi + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":974 + * else: + * # use x fill value + * out[out_i] = op(xfill, y[yi]) # <<<<<<<<<<<<<< + * yi += 1 + * + */ + __pyx_t_24 = __pyx_v_yi; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_y.diminfo[0].shape; + __pyx_t_25 = __pyx_v_out_i; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_out.diminfo[0].shape; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_y.diminfo[0].strides))); + + /* "pandas/src/sparse.pyx":975 + * # use x fill value + * out[out_i] = op(xfill, y[yi]) + * yi += 1 # <<<<<<<<<<<<<< + * + * return out, out_index + */ + __pyx_v_yi = (__pyx_v_yi + 1); + } + __pyx_L7:; + __pyx_L3_continue:; + } + + /* "pandas/src/sparse.pyx":977 + * yi += 1 + * + * return out, out_index # <<<<<<<<<<<<<< + * + * cdef inline float64_t __add(float64_t a, float64_t b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); + __Pyx_INCREF(((PyObject *)__pyx_v_out_index)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index)); + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":923 + * + * @cython.boundscheck(False) + * cdef inline tuple int_op(ndarray x_, IntIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y_, IntIndex yindex, float64_t yfill, + * double_func op): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.int_op", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out_index); + __Pyx_XDECREF((PyObject *)__pyx_v_xindices); + __Pyx_XDECREF((PyObject *)__pyx_v_yindices); + __Pyx_XDECREF((PyObject *)__pyx_v_out_indices); + __Pyx_XDECREF((PyObject *)__pyx_v_x); + __Pyx_XDECREF((PyObject *)__pyx_v_y); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":979 + * return out, out_index + * + * cdef inline float64_t __add(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a + b + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___add(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add", 0); + + /* "pandas/src/sparse.pyx":980 + * + * cdef inline float64_t __add(float64_t a, float64_t b): + * return a + b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __sub(float64_t a, float64_t b): + */ + __pyx_r = (__pyx_v_a + __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":979 + * return out, out_index + * + * cdef inline float64_t __add(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a + b + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":982 + * return a + b + * + * cdef inline float64_t __sub(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a - b + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___sub(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__sub", 0); + + /* "pandas/src/sparse.pyx":983 + * + * cdef inline float64_t __sub(float64_t a, float64_t b): + * return a - b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __rsub(float64_t a, float64_t b): + */ + __pyx_r = (__pyx_v_a - __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":982 + * return a + b + * + * cdef inline float64_t __sub(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a - b + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":985 + * return a - b + * + * cdef inline float64_t __rsub(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return b - a + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rsub(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__rsub", 0); + + /* "pandas/src/sparse.pyx":986 + * + * cdef inline float64_t __rsub(float64_t a, float64_t b): + * return b - a # <<<<<<<<<<<<<< + * + * cdef inline float64_t __div(float64_t a, float64_t b): + */ + __pyx_r = (__pyx_v_b - __pyx_v_a); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":985 + * return a - b + * + * cdef inline float64_t __rsub(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return b - a + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":988 + * return b - a + * + * cdef inline float64_t __div(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * if b == 0: + * if a > 0: + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___div(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__div", 0); + + /* "pandas/src/sparse.pyx":989 + * + * cdef inline float64_t __div(float64_t a, float64_t b): + * if b == 0: # <<<<<<<<<<<<<< + * if a > 0: + * return INF + */ + __pyx_t_1 = ((__pyx_v_b == 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":990 + * cdef inline float64_t __div(float64_t a, float64_t b): + * if b == 0: + * if a > 0: # <<<<<<<<<<<<<< + * return INF + * elif a < 0: + */ + __pyx_t_1 = ((__pyx_v_a > 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":991 + * if b == 0: + * if a > 0: + * return INF # <<<<<<<<<<<<<< + * elif a < 0: + * return -INF + */ + __pyx_r = __pyx_v_6pandas_7_sparse_INF; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":992 + * if a > 0: + * return INF + * elif a < 0: # <<<<<<<<<<<<<< + * return -INF + * else: + */ + __pyx_t_1 = ((__pyx_v_a < 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":993 + * return INF + * elif a < 0: + * return -INF # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_r = (-__pyx_v_6pandas_7_sparse_INF); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":995 + * return -INF + * else: + * return NaN # <<<<<<<<<<<<<< + * else: + * return a / b + */ + __pyx_r = __pyx_v_6pandas_7_sparse_NaN; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/sparse.pyx":997 + * return NaN + * else: + * return a / b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __rdiv(float64_t a, float64_t b): + */ + if (unlikely(__pyx_v_b == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = (__pyx_v_a / __pyx_v_b); + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":988 + * return b - a + * + * cdef inline float64_t __div(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * if b == 0: + * if a > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._sparse.__div", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":999 + * return a / b + * + * cdef inline float64_t __rdiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __div(b, a) + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rdiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__rdiv", 0); + + /* "pandas/src/sparse.pyx":1000 + * + * cdef inline float64_t __rdiv(float64_t a, float64_t b): + * return __div(b, a) # <<<<<<<<<<<<<< + * + * cdef inline float64_t __floordiv(float64_t a, float64_t b): + */ + __pyx_r = __pyx_f_6pandas_7_sparse___div(__pyx_v_b, __pyx_v_a); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":999 + * return a / b + * + * cdef inline float64_t __rdiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __div(b, a) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1002 + * return __div(b, a) + * + * cdef inline float64_t __floordiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * if b == 0: + * if a > 0: + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___floordiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__floordiv", 0); + + /* "pandas/src/sparse.pyx":1003 + * + * cdef inline float64_t __floordiv(float64_t a, float64_t b): + * if b == 0: # <<<<<<<<<<<<<< + * if a > 0: + * return INF + */ + __pyx_t_1 = ((__pyx_v_b == 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":1004 + * cdef inline float64_t __floordiv(float64_t a, float64_t b): + * if b == 0: + * if a > 0: # <<<<<<<<<<<<<< + * return INF + * elif a < 0: + */ + __pyx_t_1 = ((__pyx_v_a > 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":1005 + * if b == 0: + * if a > 0: + * return INF # <<<<<<<<<<<<<< + * elif a < 0: + * return -INF + */ + __pyx_r = __pyx_v_6pandas_7_sparse_INF; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":1006 + * if a > 0: + * return INF + * elif a < 0: # <<<<<<<<<<<<<< + * return -INF + * else: + */ + __pyx_t_1 = ((__pyx_v_a < 0.0) != 0); + if (__pyx_t_1) { + + /* "pandas/src/sparse.pyx":1007 + * return INF + * elif a < 0: + * return -INF # <<<<<<<<<<<<<< + * else: + * return NaN + */ + __pyx_r = (-__pyx_v_6pandas_7_sparse_INF); + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":1009 + * return -INF + * else: + * return NaN # <<<<<<<<<<<<<< + * else: + * return a // b + */ + __pyx_r = __pyx_v_6pandas_7_sparse_NaN; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/src/sparse.pyx":1011 + * return NaN + * else: + * return a // b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __rfloordiv(float64_t a, float64_t b): + */ + if (unlikely(__pyx_v_b == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = floor(__pyx_v_a / __pyx_v_b); + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":1002 + * return __div(b, a) + * + * cdef inline float64_t __floordiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * if b == 0: + * if a > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._sparse.__floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1013 + * return a // b + * + * cdef inline float64_t __rfloordiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __floordiv(b, a) + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rfloordiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__rfloordiv", 0); + + /* "pandas/src/sparse.pyx":1014 + * + * cdef inline float64_t __rfloordiv(float64_t a, float64_t b): + * return __floordiv(b, a) # <<<<<<<<<<<<<< + * + * cdef inline float64_t __mul(float64_t a, float64_t b): + */ + __pyx_r = __pyx_f_6pandas_7_sparse___floordiv(__pyx_v_b, __pyx_v_a); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1013 + * return a // b + * + * cdef inline float64_t __rfloordiv(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __floordiv(b, a) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1016 + * return __floordiv(b, a) + * + * cdef inline float64_t __mul(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___mul(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__mul", 0); + + /* "pandas/src/sparse.pyx":1017 + * + * cdef inline float64_t __mul(float64_t a, float64_t b): + * return a * b # <<<<<<<<<<<<<< + * cdef inline float64_t __eq(float64_t a, float64_t b): + * return a == b + */ + __pyx_r = (__pyx_v_a * __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1016 + * return __floordiv(b, a) + * + * cdef inline float64_t __mul(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1018 + * cdef inline float64_t __mul(float64_t a, float64_t b): + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___eq(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq", 0); + + /* "pandas/src/sparse.pyx":1019 + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): + * return a == b # <<<<<<<<<<<<<< + * cdef inline float64_t __ne(float64_t a, float64_t b): + * return a != b + */ + __pyx_r = (__pyx_v_a == __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1018 + * cdef inline float64_t __mul(float64_t a, float64_t b): + * return a * b + * cdef inline float64_t __eq(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1020 + * cdef inline float64_t __eq(float64_t a, float64_t b): + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___ne(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne", 0); + + /* "pandas/src/sparse.pyx":1021 + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): + * return a != b # <<<<<<<<<<<<<< + * cdef inline float64_t __lt(float64_t a, float64_t b): + * return a < b + */ + __pyx_r = (__pyx_v_a != __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1020 + * cdef inline float64_t __eq(float64_t a, float64_t b): + * return a == b + * cdef inline float64_t __ne(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1022 + * cdef inline float64_t __ne(float64_t a, float64_t b): + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___lt(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__lt", 0); + + /* "pandas/src/sparse.pyx":1023 + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): + * return a < b # <<<<<<<<<<<<<< + * cdef inline float64_t __gt(float64_t a, float64_t b): + * return a > b + */ + __pyx_r = (__pyx_v_a < __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1022 + * cdef inline float64_t __ne(float64_t a, float64_t b): + * return a != b + * cdef inline float64_t __lt(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1024 + * cdef inline float64_t __lt(float64_t a, float64_t b): + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a > b + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___gt(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__gt", 0); + + /* "pandas/src/sparse.pyx":1025 + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): + * return a > b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __pow(float64_t a, float64_t b): + */ + __pyx_r = (__pyx_v_a > __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1024 + * cdef inline float64_t __lt(float64_t a, float64_t b): + * return a < b + * cdef inline float64_t __gt(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return a > b + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1027 + * return a > b + * + * cdef inline float64_t __pow(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * # NaN + * if a != a or b != b: + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___pow(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__pow", 0); + + /* "pandas/src/sparse.pyx":1029 + * cdef inline float64_t __pow(float64_t a, float64_t b): + * # NaN + * if a != a or b != b: # <<<<<<<<<<<<<< + * return NaN + * return a ** b + */ + __pyx_t_1 = ((__pyx_v_a != __pyx_v_a) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_b != __pyx_v_b) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/src/sparse.pyx":1030 + * # NaN + * if a != a or b != b: + * return NaN # <<<<<<<<<<<<<< + * return a ** b + * + */ + __pyx_r = __pyx_v_6pandas_7_sparse_NaN; + goto __pyx_L0; + } + + /* "pandas/src/sparse.pyx":1031 + * if a != a or b != b: + * return NaN + * return a ** b # <<<<<<<<<<<<<< + * + * cdef inline float64_t __rpow(float64_t a, float64_t b): + */ + __pyx_r = pow(__pyx_v_a, __pyx_v_b); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1027 + * return a > b + * + * cdef inline float64_t __pow(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * # NaN + * if a != a or b != b: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1033 + * return a ** b + * + * cdef inline float64_t __rpow(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __pow(b, a) + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rpow(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) { + __pyx_t_5numpy_float64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__rpow", 0); + + /* "pandas/src/sparse.pyx":1034 + * + * cdef inline float64_t __rpow(float64_t a, float64_t b): + * return __pow(b, a) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_f_6pandas_7_sparse___pow(__pyx_v_b, __pyx_v_a); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1033 + * return a ** b + * + * cdef inline float64_t __rpow(float64_t a, float64_t b): # <<<<<<<<<<<<<< + * return __pow(b, a) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1040 + * # TODO: quantify performance boost to "templating" + * + * cpdef sparse_nanadd(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __add) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_nanadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanadd(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanadd", 0); + + /* "pandas/src/sparse.pyx":1042 + * cpdef sparse_nanadd(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __add) # <<<<<<<<<<<<<< + * + * cpdef sparse_nansub(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1040 + * # TODO: quantify performance boost to "templating" + * + * cpdef sparse_nanadd(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __add) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanadd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_nanadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_nanadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanadd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanadd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanadd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_2sparse_nanadd(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_2sparse_nanadd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanadd", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanadd(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanadd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1044 + * return sparse_nancombine(x, xindex, y, yindex, __add) + * + * cpdef sparse_nansub(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __sub) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_nansub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nansub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nansub", 0); + + /* "pandas/src/sparse.pyx":1046 + * cpdef sparse_nansub(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __sub) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1044 + * return sparse_nancombine(x, xindex, y, yindex, __add) + * + * cpdef sparse_nansub(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __sub) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nansub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_nansub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_nansub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nansub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nansub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nansub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_4sparse_nansub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_4sparse_nansub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nansub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nansub(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nansub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1048 + * return sparse_nancombine(x, xindex, y, yindex, __sub) + * + * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rsub) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_nanrsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrsub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrsub", 0); + + /* "pandas/src/sparse.pyx":1050 + * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rsub) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanmul(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rsub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1048 + * return sparse_nancombine(x, xindex, y, yindex, __sub) + * + * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rsub) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_nanrsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_nanrsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanrsub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanrsub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanrsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_6sparse_nanrsub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_6sparse_nanrsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrsub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrsub(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1052 + * return sparse_nancombine(x, xindex, y, yindex, __rsub) + * + * cpdef sparse_nanmul(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __mul) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_nanmul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanmul(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanmul", 0); + + /* "pandas/src/sparse.pyx":1054 + * cpdef sparse_nanmul(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __mul) # <<<<<<<<<<<<<< + * + * cpdef sparse_nandiv(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___mul); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1052 + * return sparse_nancombine(x, xindex, y, yindex, __rsub) + * + * cpdef sparse_nanmul(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __mul) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanmul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_nanmul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_nanmul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanmul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanmul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanmul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_8sparse_nanmul(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_8sparse_nanmul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanmul", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanmul(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanmul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1056 + * return sparse_nancombine(x, xindex, y, yindex, __mul) + * + * cpdef sparse_nandiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __div) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_nandiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nandiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nandiv", 0); + + /* "pandas/src/sparse.pyx":1058 + * cpdef sparse_nandiv(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __div) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1056 + * return sparse_nancombine(x, xindex, y, yindex, __mul) + * + * cpdef sparse_nandiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __div) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nandiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_nandiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_nandiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nandiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nandiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nandiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_10sparse_nandiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_10sparse_nandiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nandiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nandiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nandiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1060 + * return sparse_nancombine(x, xindex, y, yindex, __div) + * + * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rdiv) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrdiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrdiv", 0); + + /* "pandas/src/sparse.pyx":1062 + * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rdiv) # <<<<<<<<<<<<<< + * + * sparse_nantruediv = sparse_nandiv + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1060 + * return sparse_nancombine(x, xindex, y, yindex, __div) + * + * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rdiv) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanrdiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanrdiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanrdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_12sparse_nanrdiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_12sparse_nanrdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrdiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrdiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1067 + * sparse_nanrtruediv = sparse_nanrdiv + * + * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanfloordiv", 0); + + /* "pandas/src/sparse.pyx":1069 + * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___floordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1067 + * sparse_nanrtruediv = sparse_nanrdiv + * + * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanfloordiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_14sparse_nanfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_14sparse_nanfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanfloordiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1071 + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) + * + * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrfloordiv", 0); + + /* "pandas/src/sparse.pyx":1073 + * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanpow(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rfloordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1071 + * return sparse_nancombine(x, xindex, y, yindex, __floordiv) + * + * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanrfloordiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanrfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanrfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_16sparse_nanrfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_16sparse_nanrfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrfloordiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1075 + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) + * + * cpdef sparse_nanpow(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __pow) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_nanpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanpow", 0); + + /* "pandas/src/sparse.pyx":1077 + * cpdef sparse_nanpow(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __pow) # <<<<<<<<<<<<<< + * + * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___pow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1075 + * return sparse_nancombine(x, xindex, y, yindex, __rfloordiv) + * + * cpdef sparse_nanpow(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __pow) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_nanpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_nanpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanpow (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_18sparse_nanpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_18sparse_nanpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanpow", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1079 + * return sparse_nancombine(x, xindex, y, yindex, __pow) + * + * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rpow) + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_nanrpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrpow", 0); + + /* "pandas/src/sparse.pyx":1081 + * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex, + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rpow) # <<<<<<<<<<<<<< + * + * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rpow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1079 + * return sparse_nancombine(x, xindex, y, yindex, __pow) + * + * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex): + * return sparse_nancombine(x, xindex, y, yindex, __rpow) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_nanrpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_nanrpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_nanrpow (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_nanrpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_y = ((PyArrayObject *)values[2]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_nanrpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_20sparse_nanrpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_20sparse_nanrpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_nanrpow", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_nanrpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1083 + * return sparse_nancombine(x, xindex, y, yindex, __rpow) + * + * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_add(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_add", 0); + + /* "pandas/src/sparse.pyx":1085 + * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __add) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1086 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __add) # <<<<<<<<<<<<<< + * + * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1083 + * return sparse_nancombine(x, xindex, y, yindex, __rpow) + * + * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_22sparse_add(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_22sparse_add(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_add", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_add(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1088 + * y, yindex, yfill, __add) + * + * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_sub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_sub", 0); + + /* "pandas/src/sparse.pyx":1090 + * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __sub) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1091 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __sub) # <<<<<<<<<<<<<< + * + * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1088 + * y, yindex, yfill, __add) + * + * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_24sparse_sub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_24sparse_sub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_sub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_sub(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1093 + * y, yindex, yfill, __sub) + * + * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rsub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rsub", 0); + + /* "pandas/src/sparse.pyx":1095 + * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __rsub) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1096 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __rsub) # <<<<<<<<<<<<<< + * + * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rsub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1093 + * y, yindex, yfill, __sub) + * + * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_rsub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rsub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_26sparse_rsub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_26sparse_rsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rsub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rsub(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1098 + * y, yindex, yfill, __rsub) + * + * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_mul(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_mul", 0); + + /* "pandas/src/sparse.pyx":1100 + * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __mul) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1101 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __mul) # <<<<<<<<<<<<<< + * + * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___mul); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1098 + * y, yindex, yfill, __rsub) + * + * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_28sparse_mul(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_28sparse_mul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_mul", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_mul(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1103 + * y, yindex, yfill, __mul) + * + * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_div(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_div", 0); + + /* "pandas/src/sparse.pyx":1105 + * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __div) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1106 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __div) # <<<<<<<<<<<<<< + * + * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1103 + * y, yindex, yfill, __mul) + * + * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_30sparse_div(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_30sparse_div(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_div", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_div(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1108 + * y, yindex, yfill, __div) + * + * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rdiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rdiv", 0); + + /* "pandas/src/sparse.pyx":1110 + * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __rdiv) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1111 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __rdiv) # <<<<<<<<<<<<<< + * + * sparse_truediv = sparse_div + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1108 + * y, yindex, yfill, __div) + * + * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_rdiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rdiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_32sparse_rdiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_32sparse_rdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rdiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rdiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1116 + * sparse_rtruediv = sparse_rdiv + * + * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_floordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_floordiv", 0); + + /* "pandas/src/sparse.pyx":1118 + * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __floordiv) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1119 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __floordiv) # <<<<<<<<<<<<<< + * + * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___floordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1116 + * sparse_rtruediv = sparse_rdiv + * + * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_floordiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_floordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_34sparse_floordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_34sparse_floordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_floordiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_floordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1121 + * y, yindex, yfill, __floordiv) + * + * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rfloordiv", 0); + + /* "pandas/src/sparse.pyx":1123 + * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __rfloordiv) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1124 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __rfloordiv) # <<<<<<<<<<<<<< + * + * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rfloordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1121 + * y, yindex, yfill, __floordiv) + * + * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_rfloordiv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_36sparse_rfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_36sparse_rfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rfloordiv", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1126 + * y, yindex, yfill, __rfloordiv) + * + * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_39sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_pow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_pow", 0); + + /* "pandas/src/sparse.pyx":1128 + * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __pow) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1129 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __pow) # <<<<<<<<<<<<<< + * + * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___pow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1126 + * y, yindex, yfill, __rfloordiv) + * + * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_39sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_39sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_pow (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_pow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_38sparse_pow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_38sparse_pow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_pow", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_pow(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1131 + * y, yindex, yfill, __pow) + * + * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + +static PyObject *__pyx_pw_6pandas_7_sparse_41sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_7_sparse_sparse_rpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rpow", 0); + + /* "pandas/src/sparse.pyx":1133 + * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill, + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, # <<<<<<<<<<<<<< + * y, yindex, yfill, __rpow) + * + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/src/sparse.pyx":1134 + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + * y, yindex, yfill, __rpow) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rpow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1131 + * y, yindex, yfill, __pow) + * + * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill, # <<<<<<<<<<<<<< + * ndarray y, SparseIndex yindex, float64_t yfill): + * return sparse_combine(x, xindex, xfill, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_41sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_7_sparse_41sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_x = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_xfill; + PyArrayObject *__pyx_v_y = 0; + struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0; + __pyx_t_5numpy_float64_t __pyx_v_yfill; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sparse_rpow (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_x = ((PyArrayObject *)values[0]); + __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]); + __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_y = ((PyArrayObject *)values[3]); + __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]); + __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_40sparse_rpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_40sparse_rpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sparse_rpow", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1140 + * # Indexing operations + * + * def get_reindexer(ndarray[object, ndim=1] values, dict index_map): # <<<<<<<<<<<<<< + * cdef object idx + * cdef Py_ssize_t i + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_43get_reindexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_7_sparse_43get_reindexer = {__Pyx_NAMESTR("get_reindexer"), (PyCFunction)__pyx_pw_6pandas_7_sparse_43get_reindexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_7_sparse_43get_reindexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_index_map = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_reindexer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_index_map,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_map)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_reindexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reindexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_index_map = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_reindexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.get_reindexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index_map), (&PyDict_Type), 1, "index_map", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_42get_reindexer(__pyx_self, __pyx_v_values, __pyx_v_index_map); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_42get_reindexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_index_map) { + PyObject *__pyx_v_idx = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_new_length; + PyArrayObject *__pyx_v_indexer = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + __pyx_t_5numpy_int32_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_reindexer", 0); + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/src/sparse.pyx":1143 + * cdef object idx + * cdef Py_ssize_t i + * cdef Py_ssize_t new_length = len(values) # <<<<<<<<<<<<<< + * cdef ndarray[int32_t, ndim=1] indexer + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_new_length = __pyx_t_1; + + /* "pandas/src/sparse.pyx":1146 + * cdef ndarray[int32_t, ndim=1] indexer + * + * indexer = np.empty(new_length, dtype=np.int32) # <<<<<<<<<<<<<< + * + * for i in range(new_length): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_new_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/sparse.pyx":1148 + * indexer = np.empty(new_length, dtype=np.int32) + * + * for i in range(new_length): # <<<<<<<<<<<<<< + * idx = values[i] + * if idx in index_map: + */ + __pyx_t_1 = __pyx_v_new_length; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/src/sparse.pyx":1149 + * + * for i in range(new_length): + * idx = values[i] # <<<<<<<<<<<<<< + * if idx in index_map: + * indexer[i] = index_map[idx] + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/src/sparse.pyx":1150 + * for i in range(new_length): + * idx = values[i] + * if idx in index_map: # <<<<<<<<<<<<<< + * indexer[i] = index_map[idx] + * else: + */ + if (unlikely(__pyx_v_index_map == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (__Pyx_PyDict_Contains(__pyx_v_idx, __pyx_v_index_map, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = (__pyx_t_14 != 0); + if (__pyx_t_15) { + + /* "pandas/src/sparse.pyx":1151 + * idx = values[i] + * if idx in index_map: + * indexer[i] = index_map[idx] # <<<<<<<<<<<<<< + * else: + * indexer[i] = -1 + */ + if (unlikely(__pyx_v_index_map == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_index_map, __pyx_v_idx); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_6); if (unlikely((__pyx_t_16 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_t_16; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/src/sparse.pyx":1153 + * indexer[i] = index_map[idx] + * else: + * indexer[i] = -1 # <<<<<<<<<<<<<< + * + * return indexer + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_indexer.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1; + } + __pyx_L5:; + } + + /* "pandas/src/sparse.pyx":1155 + * indexer[i] = -1 + * + * return indexer # <<<<<<<<<<<<<< + * + * # def reindex_block(ndarray[float64_t, ndim=1] values, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_indexer)); + __pyx_r = ((PyObject *)__pyx_v_indexer); + goto __pyx_L0; + + /* "pandas/src/sparse.pyx":1140 + * # Indexing operations + * + * def get_reindexer(ndarray[object, ndim=1] values, dict index_map): # <<<<<<<<<<<<<< + * cdef object idx + * cdef Py_ssize_t i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.get_reindexer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF((PyObject *)__pyx_v_indexer); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/sparse.pyx":1187 + * + * + * def reindex_integer(ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * IntIndex sparse_index, + * ndarray[int32_t, ndim=1] indexer): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_7_sparse_45reindex_integer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_7_sparse_45reindex_integer = {__Pyx_NAMESTR("reindex_integer"), (PyCFunction)__pyx_pw_6pandas_7_sparse_45reindex_integer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_7_sparse_45reindex_integer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyArrayObject *__pyx_v_values = 0; + CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index = 0; + CYTHON_UNUSED PyArrayObject *__pyx_v_indexer = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reindex_integer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_sparse_index,&__pyx_n_s_indexer,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sparse_index)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex_integer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_sparse_index = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)values[1]); + __pyx_v_indexer = ((PyArrayObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._sparse.reindex_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sparse_index), __pyx_ptype_6pandas_7_sparse_IntIndex, 1, "sparse_index", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_7_sparse_44reindex_integer(__pyx_self, __pyx_v_values, __pyx_v_sparse_index, __pyx_v_indexer); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_7_sparse_44reindex_integer(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index, CYTHON_UNUSED PyArrayObject *__pyx_v_indexer) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer; + __Pyx_Buffer __pyx_pybuffer_indexer; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("reindex_integer", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + __pyx_pybuffer_indexer.pybuffer.buf = NULL; + __pyx_pybuffer_indexer.refcount = 0; + __pyx_pybuffernd_indexer.data = NULL; + __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0]; + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas._sparse.reindex_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6pandas_7_sparse_SparseIndex(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(PyObject *o) { + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6pandas_7_sparse_SparseIndex[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7_sparse_SparseIndex = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.SparseIndex"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_SparseIndex), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + __Pyx_DOCSTR("\n Abstract superclass for sparse index types\n "), /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7_sparse_SparseIndex, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_SparseIndex, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex __pyx_vtable_6pandas_7_sparse_IntIndex; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_IntIndex(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_IntIndex *p; + PyObject *o = __pyx_tp_new_6pandas_7_sparse_SparseIndex(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_IntIndex; + p->indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_7_sparse_IntIndex(PyObject *o) { + struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->indices); + #if CYTHON_COMPILING_IN_CPYTHON + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(o); +} + +static int __pyx_tp_traverse_6pandas_7_sparse_IntIndex(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o; + e = ((likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) ? ((__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse) ? __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6pandas_7_sparse_IntIndex)); if (e) return e; + if (p->indices) { + e = (*v)(((PyObject*)p->indices), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7_sparse_IntIndex(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o; + if (likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) { if (__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear) __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6pandas_7_sparse_IntIndex); + tmp = ((PyObject*)p->indices); + p->indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_length(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_npoints(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_indices(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_7_sparse_IntIndex[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("check_integrity"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_8IntIndex_6check_integrity)}, + {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_9equals, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ngaps"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_int_index"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_block_index"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("intersect"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("make_union"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("reindex"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("put"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_25put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("take"), (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_27take, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_7_sparse_IntIndex[] = { + {(char *)"length", __pyx_getprop_6pandas_7_sparse_8IntIndex_length, 0, 0, 0}, + {(char *)"npoints", __pyx_getprop_6pandas_7_sparse_8IntIndex_npoints, 0, 0, 0}, + {(char *)"indices", __pyx_getprop_6pandas_7_sparse_8IntIndex_indices, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7_sparse_IntIndex = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.IntIndex"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_IntIndex), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_IntIndex, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Object for holding exact integer sparse indexing information\n\n Parameters\n ----------\n length : integer\n indices : array-like\n Contains integers corresponding to\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_IntIndex, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_IntIndex, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7_sparse_IntIndex, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_7_sparse_IntIndex, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_IntIndex, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex __pyx_vtable_6pandas_7_sparse_BlockIndex; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIndex(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *p; + PyObject *o = __pyx_tp_new_6pandas_7_sparse_SparseIndex(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_BlockIndex; + p->blocs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->blengths = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_7_sparse_BlockIndex(PyObject *o) { + struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->blocs); + Py_CLEAR(p->blengths); + #if CYTHON_COMPILING_IN_CPYTHON + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(o); +} + +static int __pyx_tp_traverse_6pandas_7_sparse_BlockIndex(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o; + e = ((likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) ? ((__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse) ? __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6pandas_7_sparse_BlockIndex)); if (e) return e; + if (p->blocs) { + e = (*v)(((PyObject*)p->blocs), a); if (e) return e; + } + if (p->blengths) { + e = (*v)(((PyObject*)p->blengths), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7_sparse_BlockIndex(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o; + if (likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) { if (__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear) __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6pandas_7_sparse_BlockIndex); + tmp = ((PyObject*)p->blocs); + p->blocs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->blengths); + p->blengths = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_nblocks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_npoints(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_length(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_blocs(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_blengths(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_7_sparse_BlockIndex[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("ngaps"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("check_integrity"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_10BlockIndex_8check_integrity)}, + {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_block_index"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("to_int_index"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("intersect"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_10BlockIndex_16intersect)}, + {__Pyx_NAMESTR("make_union"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_10BlockIndex_18make_union)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7_sparse_10BlockIndex_20lookup)}, + {__Pyx_NAMESTR("reindex"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("put"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_25put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("take"), (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_27take, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_7_sparse_BlockIndex[] = { + {(char *)"nblocks", __pyx_getprop_6pandas_7_sparse_10BlockIndex_nblocks, 0, 0, 0}, + {(char *)"npoints", __pyx_getprop_6pandas_7_sparse_10BlockIndex_npoints, 0, 0, 0}, + {(char *)"length", __pyx_getprop_6pandas_7_sparse_10BlockIndex_length, 0, 0, 0}, + {(char *)"blocs", __pyx_getprop_6pandas_7_sparse_10BlockIndex_blocs, 0, 0, 0}, + {(char *)"blengths", __pyx_getprop_6pandas_7_sparse_10BlockIndex_blengths, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7_sparse_BlockIndex = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.BlockIndex"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_BlockIndex), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_BlockIndex, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + __pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Object for holding block-based sparse indexing information\n\n Parameters\n ----------\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_BlockIndex, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_BlockIndex, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7_sparse_BlockIndex, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_7_sparse_BlockIndex, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_BlockIndex, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_vtable_6pandas_7_sparse_BlockMerge; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockMerge(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_BlockMerge *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_BlockMerge; + p->x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + p->y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + p->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + p->xstart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->xlen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->xend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->ystart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->ylen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->yend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge(PyObject *o) { + struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->x); + Py_CLEAR(p->y); + Py_CLEAR(p->result); + Py_CLEAR(p->xstart); + Py_CLEAR(p->xlen); + Py_CLEAR(p->xend); + Py_CLEAR(p->ystart); + Py_CLEAR(p->ylen); + Py_CLEAR(p->yend); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_7_sparse_BlockMerge(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o; + if (p->x) { + e = (*v)(((PyObject*)p->x), a); if (e) return e; + } + if (p->y) { + e = (*v)(((PyObject*)p->y), a); if (e) return e; + } + if (p->result) { + e = (*v)(((PyObject*)p->result), a); if (e) return e; + } + if (p->xstart) { + e = (*v)(((PyObject*)p->xstart), a); if (e) return e; + } + if (p->xlen) { + e = (*v)(((PyObject*)p->xlen), a); if (e) return e; + } + if (p->xend) { + e = (*v)(((PyObject*)p->xend), a); if (e) return e; + } + if (p->ystart) { + e = (*v)(((PyObject*)p->ystart), a); if (e) return e; + } + if (p->ylen) { + e = (*v)(((PyObject*)p->ylen), a); if (e) return e; + } + if (p->yend) { + e = (*v)(((PyObject*)p->yend), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_7_sparse_BlockMerge(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o; + tmp = ((PyObject*)p->x); + p->x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->y); + p->y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->result); + p->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->xstart); + p->xstart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->xlen); + p->xlen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->xend); + p->xend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->ystart); + p->ystart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->ylen); + p->ylen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->yend); + p->yend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6pandas_7_sparse_BlockMerge[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_7_sparse_BlockMerge = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.BlockMerge"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_BlockMerge), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Object-oriented approach makes sharing state between recursive functions a\n lot easier and reduces code duplication\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_7_sparse_BlockMerge, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_BlockMerge, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection __pyx_vtable_6pandas_7_sparse_BlockIntersection; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIntersection(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_BlockIntersection *p; + PyObject *o = __pyx_tp_new_6pandas_7_sparse_BlockMerge(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_BlockIntersection *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge*)__pyx_vtabptr_6pandas_7_sparse_BlockIntersection; + return o; +} + +static PyTypeObject __pyx_type_6pandas_7_sparse_BlockIntersection = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.BlockIntersection"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_BlockIntersection), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n not done yet\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_BlockIntersection, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion __pyx_vtable_6pandas_7_sparse_BlockUnion; + +static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockUnion(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_7_sparse_BlockUnion *p; + PyObject *o = __pyx_tp_new_6pandas_7_sparse_BlockMerge(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge*)__pyx_vtabptr_6pandas_7_sparse_BlockUnion; + return o; +} + +static PyTypeObject __pyx_type_6pandas_7_sparse_BlockUnion = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas._sparse.BlockUnion"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_7_sparse_BlockUnion), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("\n Object-oriented approach makes sharing state between recursive functions a\n lot easier and reduces code duplication\n "), /*tp_doc*/ + __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/ + __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_7_sparse_BlockUnion, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("get_blocks"), (PyCFunction)__pyx_pw_6pandas_7_sparse_1get_blocks, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanadd"), (PyCFunction)__pyx_pw_6pandas_7_sparse_3sparse_nanadd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nansub"), (PyCFunction)__pyx_pw_6pandas_7_sparse_5sparse_nansub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanrsub"), (PyCFunction)__pyx_pw_6pandas_7_sparse_7sparse_nanrsub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanmul"), (PyCFunction)__pyx_pw_6pandas_7_sparse_9sparse_nanmul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nandiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_11sparse_nandiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanrdiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanfloordiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanrfloordiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanpow"), (PyCFunction)__pyx_pw_6pandas_7_sparse_19sparse_nanpow, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_nanrpow"), (PyCFunction)__pyx_pw_6pandas_7_sparse_21sparse_nanrpow, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_add"), (PyCFunction)__pyx_pw_6pandas_7_sparse_23sparse_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_sub"), (PyCFunction)__pyx_pw_6pandas_7_sparse_25sparse_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_rsub"), (PyCFunction)__pyx_pw_6pandas_7_sparse_27sparse_rsub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_mul"), (PyCFunction)__pyx_pw_6pandas_7_sparse_29sparse_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_div"), (PyCFunction)__pyx_pw_6pandas_7_sparse_31sparse_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_rdiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_33sparse_rdiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_floordiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_35sparse_floordiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_rfloordiv"), (PyCFunction)__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_pow"), (PyCFunction)__pyx_pw_6pandas_7_sparse_39sparse_pow, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sparse_rpow"), (PyCFunction)__pyx_pw_6pandas_7_sparse_41sparse_rpow, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("_sparse"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_BlockIndex, __pyx_k_BlockIndex, sizeof(__pyx_k_BlockIndex), 0, 0, 1, 1}, + {&__pyx_kp_s_Block_d_extends_beyond_end, __pyx_k_Block_d_extends_beyond_end, sizeof(__pyx_k_Block_d_extends_beyond_end), 0, 0, 1, 0}, + {&__pyx_kp_s_Block_d_overlaps, __pyx_k_Block_d_overlaps, sizeof(__pyx_k_Block_d_overlaps), 0, 0, 1, 0}, + {&__pyx_kp_s_Block_lengths_s, __pyx_k_Block_lengths_s, sizeof(__pyx_k_Block_lengths_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Block_locations_s, __pyx_k_Block_locations_s, sizeof(__pyx_k_Block_locations_s), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Indices_must_reference_same_unde, __pyx_k_Indices_must_reference_same_unde, sizeof(__pyx_k_Indices_must_reference_same_unde), 0, 0, 1, 0}, + {&__pyx_kp_s_Indices_s, __pyx_k_Indices_s, sizeof(__pyx_k_Indices_s), 0, 0, 1, 0}, + {&__pyx_n_s_IntIndex, __pyx_k_IntIndex, sizeof(__pyx_k_IntIndex), 0, 0, 1, 1}, + {&__pyx_kp_s_Locations_not_in_ascending_order, __pyx_k_Locations_not_in_ascending_order, sizeof(__pyx_k_Locations_not_in_ascending_order), 0, 0, 1, 0}, + {&__pyx_kp_s_Mode_must_be_0_or_1, __pyx_k_Mode_must_be_0_or_1, sizeof(__pyx_k_Mode_must_be_0_or_1), 0, 0, 1, 0}, + {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_Zero_length_block_d, __pyx_k_Zero_length_block_d, sizeof(__pyx_k_Zero_length_block_d), 0, 0, 1, 0}, + {&__pyx_n_s_array_equal, __pyx_k_array_equal, sizeof(__pyx_k_array_equal), 0, 0, 1, 1}, + {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1}, + {&__pyx_n_s_blengths, __pyx_k_blengths, sizeof(__pyx_k_blengths), 0, 0, 1, 1}, + {&__pyx_kp_s_block_bound_arrays_must_be_same, __pyx_k_block_bound_arrays_must_be_same, sizeof(__pyx_k_block_bound_arrays_must_be_same), 0, 0, 1, 0}, + {&__pyx_n_s_blocs, __pyx_k_blocs, sizeof(__pyx_k_blocs), 0, 0, 1, 1}, + {&__pyx_n_s_check_integrity, __pyx_k_check_integrity, sizeof(__pyx_k_check_integrity), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, + {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_get_reindexer, __pyx_k_get_reindexer, sizeof(__pyx_k_get_reindexer), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index_map, __pyx_k_index_map, sizeof(__pyx_k_index_map), 0, 0, 1, 1}, + {&__pyx_n_s_indexer, __pyx_k_indexer, sizeof(__pyx_k_indexer), 0, 0, 1, 1}, + {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_intersect, __pyx_k_intersect, sizeof(__pyx_k_intersect), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_union, __pyx_k_make_union, sizeof(__pyx_k_make_union), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_new_length, __pyx_k_new_length, sizeof(__pyx_k_new_length), 0, 0, 1, 1}, + {&__pyx_n_s_ngaps, __pyx_k_ngaps, sizeof(__pyx_k_ngaps), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_pandas__sparse, __pyx_k_pandas__sparse, sizeof(__pyx_k_pandas__sparse), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reindex, __pyx_k_reindex, sizeof(__pyx_k_reindex), 0, 0, 1, 1}, + {&__pyx_n_s_reindex_integer, __pyx_k_reindex_integer, sizeof(__pyx_k_reindex_integer), 0, 0, 1, 1}, + {&__pyx_n_s_searchsorted, __pyx_k_searchsorted, sizeof(__pyx_k_searchsorted), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_div, __pyx_k_sparse_div, sizeof(__pyx_k_sparse_div), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_index, __pyx_k_sparse_index, sizeof(__pyx_k_sparse_index), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_nandiv, __pyx_k_sparse_nandiv, sizeof(__pyx_k_sparse_nandiv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_nanrdiv, __pyx_k_sparse_nanrdiv, sizeof(__pyx_k_sparse_nanrdiv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_nanrtruediv, __pyx_k_sparse_nanrtruediv, sizeof(__pyx_k_sparse_nanrtruediv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_nantruediv, __pyx_k_sparse_nantruediv, sizeof(__pyx_k_sparse_nantruediv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_rdiv, __pyx_k_sparse_rdiv, sizeof(__pyx_k_sparse_rdiv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_rtruediv, __pyx_k_sparse_rtruediv, sizeof(__pyx_k_sparse_rtruediv), 0, 0, 1, 1}, + {&__pyx_n_s_sparse_truediv, __pyx_k_sparse_truediv, sizeof(__pyx_k_sparse_truediv), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_to_block_index, __pyx_k_to_block_index, sizeof(__pyx_k_to_block_index), 0, 0, 1, 1}, + {&__pyx_n_s_to_int_index, __pyx_k_to_int_index, sizeof(__pyx_k_to_int_index), 0, 0, 1, 1}, + {&__pyx_n_s_to_put, __pyx_k_to_put, sizeof(__pyx_k_to_put), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xfill, __pyx_k_xfill, sizeof(__pyx_k_xfill), 0, 0, 1, 1}, + {&__pyx_n_s_xindex, __pyx_k_xindex, sizeof(__pyx_k_xindex), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_n_s_yfill, __pyx_k_yfill, sizeof(__pyx_k_yfill), 0, 0, 1, 1}, + {&__pyx_n_s_yindex, __pyx_k_yindex, sizeof(__pyx_k_yindex), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/src/sparse.pyx":102 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xindices = self.indices + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/src/sparse.pyx":136 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xindices = self.indices + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/src/sparse.pyx":322 + * + * if len(blocs) != len(blengths): + * raise ValueError('block bound arrays must be same length') # <<<<<<<<<<<<<< + * + * for i from 0 <= i < self.nblocks: + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_block_bound_arrays_must_be_same); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/src/sparse.pyx":327 + * if i > 0: + * if blocs[i] <= blocs[i-1]: + * raise ValueError('Locations not in ascending order') # <<<<<<<<<<<<<< + * + * if i < self.nblocks - 1: + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Locations_not_in_ascending_order); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/src/sparse.pyx":396 + * + * if self.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * xloc = self.blocs + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "pandas/src/sparse.pyx":542 + * + * if x.length != y.length: + * raise Exception('Indices must reference same underlying length') # <<<<<<<<<<<<<< + * + * self.xstart = self.x.blocs + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/src/sparse.pyx":632 + * + * if mode != 0 and mode != 1: + * raise Exception('Mode must be 0 or 1') # <<<<<<<<<<<<<< + * + * # so symmetric code will work + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Mode_must_be_0_or_1); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/src/sparse.pyx":1140 + * # Indexing operations + * + * def get_reindexer(ndarray[object, ndim=1] values, dict index_map): # <<<<<<<<<<<<<< + * cdef object idx + * cdef Py_ssize_t i + */ + __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_values, __pyx_n_s_index_map, __pyx_n_s_idx, __pyx_n_s_i, __pyx_n_s_new_length, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_reindexer, 1140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/src/sparse.pyx":1187 + * + * + * def reindex_integer(ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * IntIndex sparse_index, + * ndarray[int32_t, ndim=1] indexer): + */ + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_sparse_index, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_reindex_integer, 1187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_sparse(void); /*proto*/ +PyMODINIT_FUNC init_sparse(void) +#else +PyMODINIT_FUNC PyInit__sparse(void); /*proto*/ +PyMODINIT_FUNC PyInit__sparse(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __pyx_t_5numpy_float64_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__sparse(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_sparse"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas___sparse) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas._sparse")) { + if (unlikely(PyDict_SetItemString(modules, "pandas._sparse", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_SparseIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_SparseIndex.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "SparseIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_SparseIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_SparseIndex = &__pyx_type_6pandas_7_sparse_SparseIndex; + __pyx_vtabptr_6pandas_7_sparse_IntIndex = &__pyx_vtable_6pandas_7_sparse_IntIndex; + __pyx_vtable_6pandas_7_sparse_IntIndex.intersect = (struct __pyx_obj_6pandas_7_sparse_IntIndex *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_intersect; + __pyx_vtable_6pandas_7_sparse_IntIndex.make_union = (struct __pyx_obj_6pandas_7_sparse_IntIndex *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_make_union; + __pyx_vtable_6pandas_7_sparse_IntIndex.lookup = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_lookup; + __pyx_vtable_6pandas_7_sparse_IntIndex.reindex = (PyArrayObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_reindex; + __pyx_vtable_6pandas_7_sparse_IntIndex.put = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_put; + __pyx_vtable_6pandas_7_sparse_IntIndex.take = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_take; + __pyx_type_6pandas_7_sparse_IntIndex.tp_base = __pyx_ptype_6pandas_7_sparse_SparseIndex; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_IntIndex.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_IntIndex.tp_dict, __pyx_vtabptr_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "IntIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_IntIndex = &__pyx_type_6pandas_7_sparse_IntIndex; + __pyx_vtabptr_6pandas_7_sparse_BlockIndex = &__pyx_vtable_6pandas_7_sparse_BlockIndex; + __pyx_vtable_6pandas_7_sparse_BlockIndex.check_integrity = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_check_integrity; + __pyx_vtable_6pandas_7_sparse_BlockIndex.intersect = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_intersect; + __pyx_vtable_6pandas_7_sparse_BlockIndex.make_union = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_make_union; + __pyx_vtable_6pandas_7_sparse_BlockIndex.lookup = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_lookup; + __pyx_vtable_6pandas_7_sparse_BlockIndex.reindex = (PyArrayObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_reindex; + __pyx_vtable_6pandas_7_sparse_BlockIndex.put = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_put; + __pyx_vtable_6pandas_7_sparse_BlockIndex.take = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_take; + __pyx_type_6pandas_7_sparse_BlockIndex.tp_base = __pyx_ptype_6pandas_7_sparse_SparseIndex; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_BlockIndex.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockIndex.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_type_6pandas_7_sparse_BlockIndex.tp_weaklistoffset == 0) __pyx_type_6pandas_7_sparse_BlockIndex.tp_weaklistoffset = offsetof(struct __pyx_obj_6pandas_7_sparse_BlockIndex, __weakref__); + __pyx_ptype_6pandas_7_sparse_BlockIndex = &__pyx_type_6pandas_7_sparse_BlockIndex; + __pyx_vtabptr_6pandas_7_sparse_BlockMerge = &__pyx_vtable_6pandas_7_sparse_BlockMerge; + __pyx_vtable_6pandas_7_sparse_BlockMerge._make_merged_blocks = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *))__pyx_f_6pandas_7_sparse_10BlockMerge__make_merged_blocks; + __pyx_vtable_6pandas_7_sparse_BlockMerge._set_current_indices = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t, int))__pyx_f_6pandas_7_sparse_10BlockMerge__set_current_indices; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_BlockMerge.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockMerge.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockMerge", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_BlockMerge = &__pyx_type_6pandas_7_sparse_BlockMerge; + __pyx_vtabptr_6pandas_7_sparse_BlockIntersection = &__pyx_vtable_6pandas_7_sparse_BlockIntersection; + __pyx_vtable_6pandas_7_sparse_BlockIntersection.__pyx_base = *__pyx_vtabptr_6pandas_7_sparse_BlockMerge; + __pyx_type_6pandas_7_sparse_BlockIntersection.tp_base = __pyx_ptype_6pandas_7_sparse_BlockMerge; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_BlockIntersection.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockIntersection.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockIntersection", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_BlockIntersection = &__pyx_type_6pandas_7_sparse_BlockIntersection; + __pyx_vtabptr_6pandas_7_sparse_BlockUnion = &__pyx_vtable_6pandas_7_sparse_BlockUnion; + __pyx_vtable_6pandas_7_sparse_BlockUnion.__pyx_base = *__pyx_vtabptr_6pandas_7_sparse_BlockMerge; + __pyx_vtable_6pandas_7_sparse_BlockUnion.__pyx_base._make_merged_blocks = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *))__pyx_f_6pandas_7_sparse_10BlockUnion__make_merged_blocks; + __pyx_vtable_6pandas_7_sparse_BlockUnion._find_next_block_end = (__pyx_t_5numpy_int32_t (*)(struct __pyx_obj_6pandas_7_sparse_BlockUnion *, int))__pyx_f_6pandas_7_sparse_10BlockUnion__find_next_block_end; + __pyx_type_6pandas_7_sparse_BlockUnion.tp_base = __pyx_ptype_6pandas_7_sparse_BlockMerge; + if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_7_sparse_BlockUnion.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockUnion.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BlockUnion", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_7_sparse_BlockUnion = &__pyx_type_6pandas_7_sparse_BlockUnion; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/src/sparse.pyx":6 + * cimport cython + * + * import numpy as np # <<<<<<<<<<<<<< + * import operator + * import sys + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":7 + * + * import numpy as np + * import operator # <<<<<<<<<<<<<< + * import sys + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":8 + * import numpy as np + * import operator + * import sys # <<<<<<<<<<<<<< + * + * np.import_array() + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":10 + * import sys + * + * np.import_array() # <<<<<<<<<<<<<< + * np.import_ufunc() + * + */ + import_array(); + + /* "pandas/src/sparse.pyx":11 + * + * np.import_array() + * np.import_ufunc() # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------- + */ + import_ufunc(); + + /* "pandas/src/sparse.pyx":16 + * # Preamble stuff + * + * cdef float64_t NaN = np.NaN # <<<<<<<<<<<<<< + * cdef float64_t INF = np.inf + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6pandas_7_sparse_NaN = ((__pyx_t_5numpy_float64_t)__pyx_t_3); + + /* "pandas/src/sparse.pyx":17 + * + * cdef float64_t NaN = np.NaN + * cdef float64_t INF = np.inf # <<<<<<<<<<<<<< + * + * cdef inline int int_max(int a, int b): return a if a >= b else b + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_7_sparse_INF = ((__pyx_t_5numpy_float64_t)__pyx_t_3); + + /* "pandas/src/sparse.pyx":80 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex, __pyx_n_s_ngaps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/sparse.pyx":79 + * return same_length and same_indices + * + * @property # <<<<<<<<<<<<<< + * def ngaps(self): + * return self.length - self.npoints + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex->tp_dict, __pyx_n_s_ngaps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6pandas_7_sparse_IntIndex); + + /* "pandas/src/sparse.pyx":304 + * + * @property + * def ngaps(self): # <<<<<<<<<<<<<< + * return self.length - self.npoints + * + */ + __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex, __pyx_n_s_ngaps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/src/sparse.pyx":303 + * return output + * + * @property # <<<<<<<<<<<<<< + * def ngaps(self): + * return self.length - self.npoints + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex->tp_dict, __pyx_n_s_ngaps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6pandas_7_sparse_BlockIndex); + + /* "pandas/src/sparse.pyx":1064 + * return sparse_nancombine(x, xindex, y, yindex, __rdiv) + * + * sparse_nantruediv = sparse_nandiv # <<<<<<<<<<<<<< + * sparse_nanrtruediv = sparse_nanrdiv + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_nandiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_nantruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1065 + * + * sparse_nantruediv = sparse_nandiv + * sparse_nanrtruediv = sparse_nanrdiv # <<<<<<<<<<<<<< + * + * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_nanrdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_nanrtruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1113 + * y, yindex, yfill, __rdiv) + * + * sparse_truediv = sparse_div # <<<<<<<<<<<<<< + * sparse_rtruediv = sparse_rdiv + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_truediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1114 + * + * sparse_truediv = sparse_div + * sparse_rtruediv = sparse_rdiv # <<<<<<<<<<<<<< + * + * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_rtruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1140 + * # Indexing operations + * + * def get_reindexer(ndarray[object, ndim=1] values, dict index_map): # <<<<<<<<<<<<<< + * cdef object idx + * cdef Py_ssize_t i + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7_sparse_43get_reindexer, NULL, __pyx_n_s_pandas__sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reindexer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1187 + * + * + * def reindex_integer(ndarray[float64_t, ndim=1] values, # <<<<<<<<<<<<<< + * IntIndex sparse_index, + * ndarray[int32_t, ndim=1] indexer): + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7_sparse_45reindex_integer, NULL, __pyx_n_s_pandas__sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reindex_integer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/sparse.pyx":1 + * from numpy cimport ndarray, int32_t, float64_t # <<<<<<<<<<<<<< + * cimport numpy as np + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas._sparse", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas._sparse"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) + result = __Pyx_GetModuleGlobalName(name); + return result; +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/pandas/src/testing.c b/cythonized-files3/pandas/src/testing.c new file mode 100644 index 00000000..9fd4a8e9 --- /dev/null +++ b/cythonized-files3/pandas/src/testing.c @@ -0,0 +1,4188 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas___testing +#define __PYX_HAVE_API__pandas___testing +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "testing.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal; +struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal; + +/* "pandas/src/testing.pyx":42 + * return abs(desired - actual) < (0.5 * 10.0 ** -decimal) + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): # <<<<<<<<<<<<<< + * assert is_dictlike(a) and is_dictlike(b), ( + * "Cannot compare dict objects, one or both is not dict-like" + */ +struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal { + int __pyx_n; + int compare_keys; +}; + +/* "pandas/src/testing.pyx":58 + * return True + * + * cpdef assert_almost_equal(a, b, bint check_less_precise=False): # <<<<<<<<<<<<<< + * cdef: + * int decimal + */ +struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal { + int __pyx_n; + int check_less_precise; +}; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); + } + #if CYTHON_COMPILING_IN_CPYTHON + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); + #else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); + #endif +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'pandas._testing' */ +static PyObject *__pyx_v_6pandas_8_testing_NUMERIC_TYPES = 0; +static int __pyx_f_6pandas_8_testing_is_comparable_as_number(PyObject *); /*proto*/ +static int __pyx_f_6pandas_8_testing_isiterable(PyObject *); /*proto*/ +static int __pyx_f_6pandas_8_testing_has_length(PyObject *); /*proto*/ +static int __pyx_f_6pandas_8_testing_is_dictlike(PyObject *); /*proto*/ +static int __pyx_f_6pandas_8_testing_decimal_almost_equal(double, double, int); /*proto*/ +static PyObject *__pyx_f_6pandas_8_testing_assert_dict_equal(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6pandas_8_testing_assert_almost_equal(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal *__pyx_optional_args); /*proto*/ +#define __Pyx_MODULE_NAME "pandas._testing" +int __pyx_module_is_main_pandas___testing = 0; + +/* Implementation of 'pandas._testing' */ +static PyObject *__pyx_builtin_xrange; +static PyObject *__pyx_pf_6pandas_8_testing_assert_dict_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_compare_keys); /* proto */ +static PyObject *__pyx_pf_6pandas_8_testing_2assert_almost_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_check_less_precise); /* proto */ +static char __pyx_k_a[] = "a"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_len[] = "__len__"; +static char __pyx_k_r_r[] = "%r != %r"; +static char __pyx_k_bool[] = "bool"; +static char __pyx_k_int8[] = "int8"; +static char __pyx_k_iter[] = "__iter__"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_int16[] = "int16"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_isinf[] = "isinf"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_compat[] = "compat"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_isnull[] = "isnull"; +static char __pyx_k_pandas[] = "pandas"; +static char __pyx_k_uint16[] = "uint16"; +static char __pyx_k_uint32[] = "uint32"; +static char __pyx_k_uint64[] = "uint64"; +static char __pyx_k_xrange[] = "xrange"; +static char __pyx_k_float16[] = "float16"; +static char __pyx_k_float32[] = "float32"; +static char __pyx_k_float64[] = "float64"; +static char __pyx_k_getitem[] = "__getitem__"; +static char __pyx_k_ndarray[] = "ndarray"; +static char __pyx_k_array_equal[] = "array_equal"; +static char __pyx_k_compare_keys[] = "compare_keys"; +static char __pyx_k_string_types[] = "string_types"; +static char __pyx_k_check_less_precise[] = "check_less_precise"; +static char __pyx_k_pandas_core_common[] = "pandas.core.common"; +static char __pyx_k_Cannot_compare_dict_objects_one[] = "Cannot compare dict objects, one or both is not dict-like"; +static char __pyx_k_First_object_is_iterable_second[] = "First object is iterable, second isn't: %r != %r"; +static char __pyx_k_First_object_is_not_null_second[] = "First object is not null, second is null: %r != %r"; +static char __pyx_k_First_object_is_null_second_isn[] = "First object is null, second isn't: %r != %r"; +static char __pyx_k_Length_of_two_iterators_not_the[] = "Length of two iterators not the same: %r != %r"; +static char __pyx_k_Second_object_is_iterable_first[] = "Second object is iterable, first isn't: %r != %r"; +static char __pyx_k_very_low_values_expected_5f_but[] = "(very low values) expected %.5f but got %.5f, with decimal %d"; +static char __pyx_k_Can_t_compare_objects_without_le[] = "Can't compare objects without length, one or both is invalid: (%r, %r)"; +static char __pyx_k_First_object_is_inf_second_isn_t[] = "First object is inf, second isn't"; +static char __pyx_k_First_object_is_numeric_second_i[] = "First object is numeric, second is not: %r != %r"; +static char __pyx_k_expected_5f_but_got_5f_with_deci[] = "expected %.5f but got %.5f, with decimal %d"; +static PyObject *__pyx_kp_s_Can_t_compare_objects_without_le; +static PyObject *__pyx_kp_s_Cannot_compare_dict_objects_one; +static PyObject *__pyx_kp_s_First_object_is_inf_second_isn_t; +static PyObject *__pyx_kp_s_First_object_is_iterable_second; +static PyObject *__pyx_kp_s_First_object_is_not_null_second; +static PyObject *__pyx_kp_s_First_object_is_null_second_isn; +static PyObject *__pyx_kp_s_First_object_is_numeric_second_i; +static PyObject *__pyx_kp_s_Length_of_two_iterators_not_the; +static PyObject *__pyx_kp_s_Second_object_is_iterable_first; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_array_equal; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_check_less_precise; +static PyObject *__pyx_n_s_compare_keys; +static PyObject *__pyx_n_s_compat; +static PyObject *__pyx_kp_s_expected_5f_but_got_5f_with_deci; +static PyObject *__pyx_n_s_float16; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_float64; +static PyObject *__pyx_n_s_getitem; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_int16; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_isinf; +static PyObject *__pyx_n_s_isnull; +static PyObject *__pyx_n_s_iter; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_len; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_ndarray; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_pandas; +static PyObject *__pyx_n_s_pandas_core_common; +static PyObject *__pyx_kp_s_r_r; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_string_types; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_uint16; +static PyObject *__pyx_n_s_uint32; +static PyObject *__pyx_n_s_uint64; +static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_kp_s_very_low_values_expected_5f_but; +static PyObject *__pyx_n_s_xrange; + +/* "pandas/src/testing.pyx":24 + * ) + * + * cdef bint is_comparable_as_number(obj): # <<<<<<<<<<<<<< + * return isinstance(obj, NUMERIC_TYPES) + * + */ + +static int __pyx_f_6pandas_8_testing_is_comparable_as_number(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_comparable_as_number", 0); + + /* "pandas/src/testing.pyx":25 + * + * cdef bint is_comparable_as_number(obj): + * return isinstance(obj, NUMERIC_TYPES) # <<<<<<<<<<<<<< + * + * cdef bint isiterable(obj): + */ + __pyx_t_1 = __pyx_v_6pandas_8_testing_NUMERIC_TYPES; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":24 + * ) + * + * cdef bint is_comparable_as_number(obj): # <<<<<<<<<<<<<< + * return isinstance(obj, NUMERIC_TYPES) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("pandas._testing.is_comparable_as_number", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":27 + * return isinstance(obj, NUMERIC_TYPES) + * + * cdef bint isiterable(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, '__iter__') + * + */ + +static int __pyx_f_6pandas_8_testing_isiterable(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isiterable", 0); + + /* "pandas/src/testing.pyx":28 + * + * cdef bint isiterable(obj): + * return hasattr(obj, '__iter__') # <<<<<<<<<<<<<< + * + * cdef bint has_length(obj): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_s_iter); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":27 + * return isinstance(obj, NUMERIC_TYPES) + * + * cdef bint isiterable(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, '__iter__') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._testing.isiterable", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":30 + * return hasattr(obj, '__iter__') + * + * cdef bint has_length(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, '__len__') + * + */ + +static int __pyx_f_6pandas_8_testing_has_length(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("has_length", 0); + + /* "pandas/src/testing.pyx":31 + * + * cdef bint has_length(obj): + * return hasattr(obj, '__len__') # <<<<<<<<<<<<<< + * + * cdef bint is_dictlike(obj): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_s_len); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":30 + * return hasattr(obj, '__iter__') + * + * cdef bint has_length(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, '__len__') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._testing.has_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":33 + * return hasattr(obj, '__len__') + * + * cdef bint is_dictlike(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') + * + */ + +static int __pyx_f_6pandas_8_testing_is_dictlike(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_dictlike", 0); + + /* "pandas/src/testing.pyx":34 + * + * cdef bint is_dictlike(obj): + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') # <<<<<<<<<<<<<< + * + * cdef bint decimal_almost_equal(double desired, double actual, int decimal): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_s_keys); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __pyx_t_2 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_s_getitem); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":33 + * return hasattr(obj, '__len__') + * + * cdef bint is_dictlike(obj): # <<<<<<<<<<<<<< + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas._testing.is_dictlike", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":36 + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') + * + * cdef bint decimal_almost_equal(double desired, double actual, int decimal): # <<<<<<<<<<<<<< + * # Code from + * # http://docs.scipy.org/doc/numpy/reference/generated + */ + +static int __pyx_f_6pandas_8_testing_decimal_almost_equal(double __pyx_v_desired, double __pyx_v_actual, int __pyx_v_decimal) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("decimal_almost_equal", 0); + + /* "pandas/src/testing.pyx":40 + * # http://docs.scipy.org/doc/numpy/reference/generated + * # /numpy.testing.assert_almost_equal.html + * return abs(desired - actual) < (0.5 * 10.0 ** -decimal) # <<<<<<<<<<<<<< + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): + */ + __pyx_r = (fabs((__pyx_v_desired - __pyx_v_actual)) < (0.5 * pow(10.0, ((double)(-__pyx_v_decimal))))); + goto __pyx_L0; + + /* "pandas/src/testing.pyx":36 + * return hasattr(obj, 'keys') and hasattr(obj, '__getitem__') + * + * cdef bint decimal_almost_equal(double desired, double actual, int decimal): # <<<<<<<<<<<<<< + * # Code from + * # http://docs.scipy.org/doc/numpy/reference/generated + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":42 + * return abs(desired - actual) < (0.5 * 10.0 ** -decimal) + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): # <<<<<<<<<<<<<< + * assert is_dictlike(a) and is_dictlike(b), ( + * "Cannot compare dict objects, one or both is not dict-like" + */ + +static PyObject *__pyx_pw_6pandas_8_testing_1assert_dict_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_8_testing_assert_dict_equal(PyObject *__pyx_v_a, PyObject *__pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal *__pyx_optional_args) { + int __pyx_v_compare_keys = ((int)1); + PyObject *__pyx_v_a_keys = NULL; + PyObject *__pyx_v_b_keys = NULL; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_dict_equal", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_compare_keys = __pyx_optional_args->compare_keys; + } + } + + /* "pandas/src/testing.pyx":43 + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): + * assert is_dictlike(a) and is_dictlike(b), ( # <<<<<<<<<<<<<< + * "Cannot compare dict objects, one or both is not dict-like" + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = (__pyx_f_6pandas_8_testing_is_dictlike(__pyx_v_a) != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_f_6pandas_8_testing_is_dictlike(__pyx_v_b) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (unlikely(!__pyx_t_3)) { + PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Cannot_compare_dict_objects_one); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":47 + * ) + * + * a_keys = frozenset(a.keys()) # <<<<<<<<<<<<<< + * b_keys = frozenset(b.keys()) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyFrozenSet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_a_keys = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/testing.pyx":48 + * + * a_keys = frozenset(a.keys()) + * b_keys = frozenset(b.keys()) # <<<<<<<<<<<<<< + * + * if compare_keys: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyFrozenSet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_b_keys = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/src/testing.pyx":50 + * b_keys = frozenset(b.keys()) + * + * if compare_keys: # <<<<<<<<<<<<<< + * assert a_keys == b_keys + * + */ + __pyx_t_3 = (__pyx_v_compare_keys != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":51 + * + * if compare_keys: + * assert a_keys == b_keys # <<<<<<<<<<<<<< + * + * for k in a_keys: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyObject_RichCompare(__pyx_v_a_keys, __pyx_v_b_keys, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/src/testing.pyx":53 + * assert a_keys == b_keys + * + * for k in a_keys: # <<<<<<<<<<<<<< + * assert_almost_equal(a[k], b[k]) + * + */ + __pyx_t_4 = PyObject_GetIter(__pyx_v_a_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + for (;;) { + { + __pyx_t_5 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/src/testing.pyx":54 + * + * for k in a_keys: + * assert_almost_equal(a[k], b[k]) # <<<<<<<<<<<<<< + * + * return True + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_a, __pyx_v_k); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyObject_GetItem(__pyx_v_b, __pyx_v_k); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __pyx_f_6pandas_8_testing_assert_almost_equal(__pyx_t_5, __pyx_t_7, 0, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/src/testing.pyx":56 + * assert_almost_equal(a[k], b[k]) + * + * return True # <<<<<<<<<<<<<< + * + * cpdef assert_almost_equal(a, b, bint check_less_precise=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":42 + * return abs(desired - actual) < (0.5 * 10.0 ** -decimal) + * + * cpdef assert_dict_equal(a, b, bint compare_keys=True): # <<<<<<<<<<<<<< + * assert is_dictlike(a) and is_dictlike(b), ( + * "Cannot compare dict objects, one or both is not dict-like" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas._testing.assert_dict_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_a_keys); + __Pyx_XDECREF(__pyx_v_b_keys); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_8_testing_1assert_dict_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_8_testing_1assert_dict_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_b = 0; + int __pyx_v_compare_keys; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("assert_dict_equal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_compare_keys,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("assert_dict_equal", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compare_keys); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assert_dict_equal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_a = values[0]; + __pyx_v_b = values[1]; + if (values[2]) { + __pyx_v_compare_keys = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_compare_keys == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_compare_keys = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("assert_dict_equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._testing.assert_dict_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_8_testing_assert_dict_equal(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_compare_keys); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_8_testing_assert_dict_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_compare_keys) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_8_testing_assert_dict_equal __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_dict_equal", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.compare_keys = __pyx_v_compare_keys; + __pyx_t_1 = __pyx_f_6pandas_8_testing_assert_dict_equal(__pyx_v_a, __pyx_v_b, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._testing.assert_dict_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/src/testing.pyx":58 + * return True + * + * cpdef assert_almost_equal(a, b, bint check_less_precise=False): # <<<<<<<<<<<<<< + * cdef: + * int decimal + */ + +static PyObject *__pyx_pw_6pandas_8_testing_3assert_almost_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_8_testing_assert_almost_equal(PyObject *__pyx_v_a, PyObject *__pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal *__pyx_optional_args) { + int __pyx_v_check_less_precise = ((int)0); + int __pyx_v_decimal; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_na; + Py_ssize_t __pyx_v_nb; + double __pyx_v_fa; + double __pyx_v_fb; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal __pyx_t_12; + double __pyx_t_13; + double __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_almost_equal", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_check_less_precise = __pyx_optional_args->check_less_precise; + } + } + + /* "pandas/src/testing.pyx":64 + * double fa, fb + * + * if isinstance(a, dict) or isinstance(b, dict): # <<<<<<<<<<<<<< + * return assert_dict_equal(a, b) + * + */ + __pyx_t_1 = PyDict_Check(__pyx_v_a); + if (!(__pyx_t_1 != 0)) { + __pyx_t_2 = PyDict_Check(__pyx_v_b); + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":65 + * + * if isinstance(a, dict) or isinstance(b, dict): + * return assert_dict_equal(a, b) # <<<<<<<<<<<<<< + * + * if (isinstance(a, compat.string_types) or + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __pyx_f_6pandas_8_testing_assert_dict_equal(__pyx_v_a, __pyx_v_b, 0, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":67 + * return assert_dict_equal(a, b) + * + * if (isinstance(a, compat.string_types) or # <<<<<<<<<<<<<< + * isinstance(b, compat.string_types)): + * assert a == b, "%r != %r" % (a, b) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_compat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyObject_IsInstance(__pyx_v_a, __pyx_t_5); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(__pyx_t_3 != 0)) { + + /* "pandas/src/testing.pyx":68 + * + * if (isinstance(a, compat.string_types) or + * isinstance(b, compat.string_types)): # <<<<<<<<<<<<<< + * assert a == b, "%r != %r" % (a, b) + * return True + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_compat); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_string_types); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_b, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + } else { + __pyx_t_2 = (__pyx_t_3 != 0); + } + if (__pyx_t_2) { + + /* "pandas/src/testing.pyx":69 + * if (isinstance(a, compat.string_types) or + * isinstance(b, compat.string_types)): + * assert a == b, "%r != %r" % (a, b) # <<<<<<<<<<<<<< + * return True + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_4 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) { + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_r_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":70 + * isinstance(b, compat.string_types)): + * assert a == b, "%r != %r" % (a, b) + * return True # <<<<<<<<<<<<<< + * + * if isiterable(a): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":72 + * return True + * + * if isiterable(a): # <<<<<<<<<<<<<< + * assert isiterable(b), ( + * "First object is iterable, second isn't: %r != %r" % (a, b) + */ + __pyx_t_2 = (__pyx_f_6pandas_8_testing_isiterable(__pyx_v_a) != 0); + if (__pyx_t_2) { + + /* "pandas/src/testing.pyx":73 + * + * if isiterable(a): + * assert isiterable(b), ( # <<<<<<<<<<<<<< + * "First object is iterable, second isn't: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_f_6pandas_8_testing_isiterable(__pyx_v_b) != 0))) { + + /* "pandas/src/testing.pyx":74 + * if isiterable(a): + * assert isiterable(b), ( + * "First object is iterable, second isn't: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * assert has_length(a) and has_length(b), ( + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_First_object_is_iterable_second, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":76 + * "First object is iterable, second isn't: %r != %r" % (a, b) + * ) + * assert has_length(a) and has_length(b), ( # <<<<<<<<<<<<<< + * "Can't compare objects without length, one or both is invalid: " + * "(%r, %r)" % (a, b) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = (__pyx_f_6pandas_8_testing_has_length(__pyx_v_a) != 0); + if (__pyx_t_2) { + __pyx_t_3 = (__pyx_f_6pandas_8_testing_has_length(__pyx_v_b) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (unlikely(!__pyx_t_1)) { + + /* "pandas/src/testing.pyx":78 + * assert has_length(a) and has_length(b), ( + * "Can't compare objects without length, one or both is invalid: " + * "(%r, %r)" % (a, b) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Can_t_compare_objects_without_le, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":81 + * ) + * + * na, nb = len(a), len(b) # <<<<<<<<<<<<<< + * assert na == nb, ( + * "Length of two iterators not the same: %r != %r" % (na, nb) + */ + __pyx_t_6 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Length(__pyx_v_b); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_na = __pyx_t_6; + __pyx_v_nb = __pyx_t_7; + + /* "pandas/src/testing.pyx":82 + * + * na, nb = len(a), len(b) + * assert na == nb, ( # <<<<<<<<<<<<<< + * "Length of two iterators not the same: %r != %r" % (na, nb) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_na == __pyx_v_nb) != 0))) { + + /* "pandas/src/testing.pyx":83 + * na, nb = len(a), len(b) + * assert na == nb, ( + * "Length of two iterators not the same: %r != %r" % (na, nb) # <<<<<<<<<<<<<< + * ) + * if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): + */ + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_na); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nb); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Length_of_two_iterators_not_the, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":85 + * "Length of two iterators not the same: %r != %r" % (na, nb) + * ) + * if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): # <<<<<<<<<<<<<< + * try: + * if np.array_equal(a, b): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_a, __pyx_t_8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if ((__pyx_t_1 != 0)) { + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = PyObject_IsInstance(__pyx_v_b, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + } else { + __pyx_t_3 = (__pyx_t_1 != 0); + } + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":86 + * ) + * if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): + * try: # <<<<<<<<<<<<<< + * if np.array_equal(a, b): + * return True + */ + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "pandas/src/testing.pyx":87 + * if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): + * try: + * if np.array_equal(a, b): # <<<<<<<<<<<<<< + * return True + * except: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":88 + * try: + * if np.array_equal(a, b): + * return True # <<<<<<<<<<<<<< + * except: + * pass + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L11_try_return; + } + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/src/testing.pyx":89 + * if np.array_equal(a, b): + * return True + * except: # <<<<<<<<<<<<<< + * pass + * + */ + /*except:*/ { + PyErr_Restore(0,0,0); + goto __pyx_L8_exception_handled; + } + __pyx_L11_try_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L0; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L14_try_end:; + } + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/src/testing.pyx":92 + * pass + * + * for i in xrange(na): # <<<<<<<<<<<<<< + * assert_almost_equal(a[i], b[i], check_less_precise) + * + */ + __pyx_t_7 = __pyx_v_na; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/src/testing.pyx":93 + * + * for i in xrange(na): + * assert_almost_equal(a[i], b[i], check_less_precise) # <<<<<<<<<<<<<< + * + * return True + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_a, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_b, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12.__pyx_n = 1; + __pyx_t_12.check_less_precise = __pyx_v_check_less_precise; + __pyx_t_8 = __pyx_f_6pandas_8_testing_assert_almost_equal(__pyx_t_5, __pyx_t_4, 0, &__pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + + /* "pandas/src/testing.pyx":95 + * assert_almost_equal(a[i], b[i], check_less_precise) + * + * return True # <<<<<<<<<<<<<< + * elif isiterable(b): + * assert False, ( + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":96 + * + * return True + * elif isiterable(b): # <<<<<<<<<<<<<< + * assert False, ( + * "Second object is iterable, first isn't: %r != %r" % (a, b) + */ + __pyx_t_3 = (__pyx_f_6pandas_8_testing_isiterable(__pyx_v_b) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":97 + * return True + * elif isiterable(b): + * assert False, ( # <<<<<<<<<<<<<< + * "Second object is iterable, first isn't: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!0)) { + + /* "pandas/src/testing.pyx":98 + * elif isiterable(b): + * assert False, ( + * "Second object is iterable, first isn't: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Second_object_is_iterable_first, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/src/testing.pyx":101 + * ) + * + * if isnull(a): # <<<<<<<<<<<<<< + * assert isnull(b), ( + * "First object is null, second isn't: %r != %r" % (a, b) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":102 + * + * if isnull(a): + * assert isnull(b), ( # <<<<<<<<<<<<<< + * "First object is null, second isn't: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnull); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) { + + /* "pandas/src/testing.pyx":103 + * if isnull(a): + * assert isnull(b), ( + * "First object is null, second isn't: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * return True + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_First_object_is_null_second_isn, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":105 + * "First object is null, second isn't: %r != %r" % (a, b) + * ) + * return True # <<<<<<<<<<<<<< + * elif isnull(b): + * assert isnull(a), ( + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":106 + * ) + * return True + * elif isnull(b): # <<<<<<<<<<<<<< + * assert isnull(a), ( + * "First object is not null, second is null: %r != %r" % (a, b) + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnull); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":107 + * return True + * elif isnull(b): + * assert isnull(a), ( # <<<<<<<<<<<<<< + * "First object is not null, second is null: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_isnull); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) { + + /* "pandas/src/testing.pyx":108 + * elif isnull(b): + * assert isnull(a), ( + * "First object is not null, second is null: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * return True + */ + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_First_object_is_not_null_second, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":110 + * "First object is not null, second is null: %r != %r" % (a, b) + * ) + * return True # <<<<<<<<<<<<<< + * + * if is_comparable_as_number(a): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/src/testing.pyx":112 + * return True + * + * if is_comparable_as_number(a): # <<<<<<<<<<<<<< + * assert is_comparable_as_number(b), ( + * "First object is numeric, second is not: %r != %r" % (a, b) + */ + __pyx_t_3 = (__pyx_f_6pandas_8_testing_is_comparable_as_number(__pyx_v_a) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":113 + * + * if is_comparable_as_number(a): + * assert is_comparable_as_number(b), ( # <<<<<<<<<<<<<< + * "First object is numeric, second is not: %r != %r" % (a, b) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_f_6pandas_8_testing_is_comparable_as_number(__pyx_v_b) != 0))) { + + /* "pandas/src/testing.pyx":114 + * if is_comparable_as_number(a): + * assert is_comparable_as_number(b), ( + * "First object is numeric, second is not: %r != %r" % (a, b) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_First_object_is_numeric_second_i, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + + /* "pandas/src/testing.pyx":117 + * ) + * + * decimal = 5 # <<<<<<<<<<<<<< + * + * # deal with differing dtypes + */ + __pyx_v_decimal = 5; + + /* "pandas/src/testing.pyx":120 + * + * # deal with differing dtypes + * if check_less_precise: # <<<<<<<<<<<<<< + * decimal = 3 + * + */ + __pyx_t_3 = (__pyx_v_check_less_precise != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":121 + * # deal with differing dtypes + * if check_less_precise: + * decimal = 3 # <<<<<<<<<<<<<< + * + * if np.isinf(a): + */ + __pyx_v_decimal = 3; + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/src/testing.pyx":123 + * decimal = 3 + * + * if np.isinf(a): # <<<<<<<<<<<<<< + * assert np.isinf(b), "First object is inf, second isn't" + * else: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isinf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":124 + * + * if np.isinf(a): + * assert np.isinf(b), "First object is inf, second isn't" # <<<<<<<<<<<<<< + * else: + * fa, fb = a, b + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isinf); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) { + PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_First_object_is_inf_second_isn_t); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L21; + } + /*else*/ { + + /* "pandas/src/testing.pyx":126 + * assert np.isinf(b), "First object is inf, second isn't" + * else: + * fa, fb = a, b # <<<<<<<<<<<<<< + * + * # case for zero + */ + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_b); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_fa = __pyx_t_13; + __pyx_v_fb = __pyx_t_14; + + /* "pandas/src/testing.pyx":129 + * + * # case for zero + * if abs(fa) < 1e-5: # <<<<<<<<<<<<<< + * if not decimal_almost_equal(fa, fb, decimal): + * assert False, ( + */ + __pyx_t_3 = ((fabs(__pyx_v_fa) < 1e-5) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":130 + * # case for zero + * if abs(fa) < 1e-5: + * if not decimal_almost_equal(fa, fb, decimal): # <<<<<<<<<<<<<< + * assert False, ( + * '(very low values) expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) + */ + __pyx_t_3 = ((!(__pyx_f_6pandas_8_testing_decimal_almost_equal(__pyx_v_fa, __pyx_v_fb, __pyx_v_decimal) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":131 + * if abs(fa) < 1e-5: + * if not decimal_almost_equal(fa, fb, decimal): + * assert False, ( # <<<<<<<<<<<<<< + * '(very low values) expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) + * ) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!0)) { + + /* "pandas/src/testing.pyx":132 + * if not decimal_almost_equal(fa, fb, decimal): + * assert False, ( + * '(very low values) expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) # <<<<<<<<<<<<<< + * ) + * else: + */ + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_fb); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_fa); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_decimal); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_very_low_values_expected_5f_but, __pyx_t_15); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L23; + } + __pyx_L23:; + goto __pyx_L22; + } + /*else*/ { + + /* "pandas/src/testing.pyx":135 + * ) + * else: + * if not decimal_almost_equal(1, fb / fa, decimal): # <<<<<<<<<<<<<< + * assert False, 'expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) + * + */ + if (unlikely(__pyx_v_fa == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = ((!(__pyx_f_6pandas_8_testing_decimal_almost_equal(1.0, (__pyx_v_fb / __pyx_v_fa), __pyx_v_decimal) != 0)) != 0); + if (__pyx_t_3) { + + /* "pandas/src/testing.pyx":136 + * else: + * if not decimal_almost_equal(1, fb / fa, decimal): + * assert False, 'expected %.5f but got %.5f, with decimal %d' % (fb, fa, decimal) # <<<<<<<<<<<<<< + * + * else: + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!0)) { + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_fb); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = PyFloat_FromDouble(__pyx_v_fa); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_decimal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_8 = 0; + __pyx_t_15 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_expected_5f_but_got_5f_with_deci, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + goto __pyx_L24; + } + __pyx_L24:; + } + __pyx_L22:; + } + __pyx_L21:; + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/src/testing.pyx":139 + * + * else: + * assert a == b, "%r != %r" % (a, b) # <<<<<<<<<<<<<< + * + * return True + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_5 = PyObject_RichCompare(__pyx_v_a, __pyx_v_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) { + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_b); + __Pyx_GIVEREF(__pyx_v_b); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_r_r, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + } + __pyx_L19:; + + /* "pandas/src/testing.pyx":141 + * assert a == b, "%r != %r" % (a, b) + * + * return True # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/src/testing.pyx":58 + * return True + * + * cpdef assert_almost_equal(a, b, bint check_less_precise=False): # <<<<<<<<<<<<<< + * cdef: + * int decimal + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("pandas._testing.assert_almost_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_8_testing_3assert_almost_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_8_testing_3assert_almost_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_b = 0; + int __pyx_v_check_less_precise; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("assert_almost_equal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_check_less_precise,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("assert_almost_equal", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check_less_precise); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assert_almost_equal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_a = values[0]; + __pyx_v_b = values[1]; + if (values[2]) { + __pyx_v_check_less_precise = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_check_less_precise == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_check_less_precise = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("assert_almost_equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas._testing.assert_almost_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_8_testing_2assert_almost_equal(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_check_less_precise); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_8_testing_2assert_almost_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_check_less_precise) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_8_testing_assert_almost_equal __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("assert_almost_equal", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.check_less_precise = __pyx_v_check_less_precise; + __pyx_t_1 = __pyx_f_6pandas_8_testing_assert_almost_equal(__pyx_v_a, __pyx_v_b, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas._testing.assert_almost_equal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("assert_dict_equal"), (PyCFunction)__pyx_pw_6pandas_8_testing_1assert_dict_equal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("assert_almost_equal"), (PyCFunction)__pyx_pw_6pandas_8_testing_3assert_almost_equal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("_testing"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_Can_t_compare_objects_without_le, __pyx_k_Can_t_compare_objects_without_le, sizeof(__pyx_k_Can_t_compare_objects_without_le), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_compare_dict_objects_one, __pyx_k_Cannot_compare_dict_objects_one, sizeof(__pyx_k_Cannot_compare_dict_objects_one), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_inf_second_isn_t, __pyx_k_First_object_is_inf_second_isn_t, sizeof(__pyx_k_First_object_is_inf_second_isn_t), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_iterable_second, __pyx_k_First_object_is_iterable_second, sizeof(__pyx_k_First_object_is_iterable_second), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_not_null_second, __pyx_k_First_object_is_not_null_second, sizeof(__pyx_k_First_object_is_not_null_second), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_null_second_isn, __pyx_k_First_object_is_null_second_isn, sizeof(__pyx_k_First_object_is_null_second_isn), 0, 0, 1, 0}, + {&__pyx_kp_s_First_object_is_numeric_second_i, __pyx_k_First_object_is_numeric_second_i, sizeof(__pyx_k_First_object_is_numeric_second_i), 0, 0, 1, 0}, + {&__pyx_kp_s_Length_of_two_iterators_not_the, __pyx_k_Length_of_two_iterators_not_the, sizeof(__pyx_k_Length_of_two_iterators_not_the), 0, 0, 1, 0}, + {&__pyx_kp_s_Second_object_is_iterable_first, __pyx_k_Second_object_is_iterable_first, sizeof(__pyx_k_Second_object_is_iterable_first), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_array_equal, __pyx_k_array_equal, sizeof(__pyx_k_array_equal), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_check_less_precise, __pyx_k_check_less_precise, sizeof(__pyx_k_check_less_precise), 0, 0, 1, 1}, + {&__pyx_n_s_compare_keys, __pyx_k_compare_keys, sizeof(__pyx_k_compare_keys), 0, 0, 1, 1}, + {&__pyx_n_s_compat, __pyx_k_compat, sizeof(__pyx_k_compat), 0, 0, 1, 1}, + {&__pyx_kp_s_expected_5f_but_got_5f_with_deci, __pyx_k_expected_5f_but_got_5f_with_deci, sizeof(__pyx_k_expected_5f_but_got_5f_with_deci), 0, 0, 1, 0}, + {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, + {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_isinf, __pyx_k_isinf, sizeof(__pyx_k_isinf), 0, 0, 1, 1}, + {&__pyx_n_s_isnull, __pyx_k_isnull, sizeof(__pyx_k_isnull), 0, 0, 1, 1}, + {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_core_common, __pyx_k_pandas_core_common, sizeof(__pyx_k_pandas_core_common), 0, 0, 1, 1}, + {&__pyx_kp_s_r_r, __pyx_k_r_r, sizeof(__pyx_k_r_r), 0, 0, 1, 0}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_string_types, __pyx_k_string_types, sizeof(__pyx_k_string_types), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1}, + {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1}, + {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_kp_s_very_low_values_expected_5f_but, __pyx_k_very_low_values_expected_5f_but, sizeof(__pyx_k_very_low_values_expected_5f_but), 0, 0, 1, 0}, + {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + #if PY_MAJOR_VERSION >= 3 + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_testing(void); /*proto*/ +PyMODINIT_FUNC init_testing(void) +#else +PyMODINIT_FUNC PyInit__testing(void); /*proto*/ +PyMODINIT_FUNC PyInit__testing(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__testing(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_testing"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas___testing) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas._testing")) { + if (unlikely(PyDict_SetItemString(modules, "pandas._testing", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + __pyx_v_6pandas_8_testing_NUMERIC_TYPES = Py_None; Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/src/testing.pyx":1 + * import numpy as np # <<<<<<<<<<<<<< + * + * from pandas import compat + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":3 + * import numpy as np + * + * from pandas import compat # <<<<<<<<<<<<<< + * from pandas.core.common import isnull + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_compat); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_compat); + __Pyx_GIVEREF(__pyx_n_s_compat); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_compat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/src/testing.pyx":4 + * + * from pandas import compat + * from pandas.core.common import isnull # <<<<<<<<<<<<<< + * + * cdef NUMERIC_TYPES = ( + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_isnull); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_isnull); + __Pyx_GIVEREF(__pyx_n_s_isnull); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_core_common, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_isnull); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isnull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":10 + * int, + * float, + * np.bool, # <<<<<<<<<<<<<< + * np.int8, + * np.int16, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":11 + * float, + * np.bool, + * np.int8, # <<<<<<<<<<<<<< + * np.int16, + * np.int32, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":12 + * np.bool, + * np.int8, + * np.int16, # <<<<<<<<<<<<<< + * np.int32, + * np.int64, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":13 + * np.int8, + * np.int16, + * np.int32, # <<<<<<<<<<<<<< + * np.int64, + * np.uint8, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":14 + * np.int16, + * np.int32, + * np.int64, # <<<<<<<<<<<<<< + * np.uint8, + * np.uint16, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":15 + * np.int32, + * np.int64, + * np.uint8, # <<<<<<<<<<<<<< + * np.uint16, + * np.uint32, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":16 + * np.int64, + * np.uint8, + * np.uint16, # <<<<<<<<<<<<<< + * np.uint32, + * np.uint64, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":17 + * np.uint8, + * np.uint16, + * np.uint32, # <<<<<<<<<<<<<< + * np.uint64, + * np.float16, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":18 + * np.uint16, + * np.uint32, + * np.uint64, # <<<<<<<<<<<<<< + * np.float16, + * np.float32, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":19 + * np.uint32, + * np.uint64, + * np.float16, # <<<<<<<<<<<<<< + * np.float32, + * np.float64, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":20 + * np.uint64, + * np.float16, + * np.float32, # <<<<<<<<<<<<<< + * np.float64, + * ) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":21 + * np.float16, + * np.float32, + * np.float64, # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":7 + * + * cdef NUMERIC_TYPES = ( + * bool, # <<<<<<<<<<<<<< + * int, + * float, + */ + __pyx_t_1 = PyTuple_New(15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((PyObject*)(&PyInt_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)((PyObject*)(&PyFloat_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 11, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_1, 13, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_1, 14, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __Pyx_XGOTREF(__pyx_v_6pandas_8_testing_NUMERIC_TYPES); + __Pyx_DECREF_SET(__pyx_v_6pandas_8_testing_NUMERIC_TYPES, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/src/testing.pyx":1 + * import numpy as np # <<<<<<<<<<<<<< + * + * from pandas import compat + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas._testing", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas._testing"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/cythonized-files3/pandas/tslib.c b/cythonized-files3/pandas/tslib.c new file mode 100644 index 00000000..3ccd047e --- /dev/null +++ b/cythonized-files3/pandas/tslib.c @@ -0,0 +1,71037 @@ +/* Generated by Cython 0.20.2 (Debian 0.20.2-1) on Thu Jul 10 23:40:48 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_2" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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 +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if 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 +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#ifdef __cplusplus +template +void __Pyx_call_destructor(T* x) { + x->~T(); +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__pandas__tslib +#define __PYX_HAVE_API__pandas__tslib +#include "string.h" +#include "stdio.h" +#include "stdlib.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include "headers/stdint.h" +#include "datetime.h" +#include "datetime_helper.h" +#include "numpy/ndarrayobject.h" +#include "numpy_helper.h" +#include "numpy/npy_common.h" +#include "datetime/np_datetime.h" +#include "datetime/np_datetime_strings.h" +#include "khash_python.h" +#include "period.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#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 char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#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 PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#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__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "tslib.pyx", + "numpy.pxd", + "util.pxd", + "datetime.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; /* for error messages only */ + struct __Pyx_StructField_* fields; + size_t size; /* sizeof(type) */ + size_t arraysize[8]; /* length of array in each dimension */ + int ndim; + char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */ + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "numpy.pxd":726 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "numpy.pxd":727 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "numpy.pxd":728 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "numpy.pxd":729 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "numpy.pxd":733 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "numpy.pxd":734 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "numpy.pxd":735 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "numpy.pxd":736 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "numpy.pxd":740 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float16 float16_t # <<<<<<<<<<<<<< + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t + */ +typedef npy_float16 __pyx_t_5numpy_float16_t; + +/* "numpy.pxd":741 + * + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "numpy.pxd":742 + * ctypedef npy_float16 float16_t + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "numpy.pxd":751 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "numpy.pxd":752 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "numpy.pxd":753 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "numpy.pxd":755 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "numpy.pxd":756 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "numpy.pxd":757 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "numpy.pxd":759 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "numpy.pxd":760 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "numpy.pxd":762 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "numpy.pxd":763 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "numpy.pxd":764 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6pandas_5tslib__Timestamp; +struct __pyx_obj_6pandas_5tslib__NaT; +struct __pyx_obj_6pandas_5tslib__TSObject; +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__; +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr; +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE; +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr; + +/* "numpy.pxd":766 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "numpy.pxd":767 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "numpy.pxd":768 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "numpy.pxd":770 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_opt_args_6pandas_5tslib_resolution; + +/* "pandas/tslib.pyx":3292 + * # period accessors + * + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN # <<<<<<<<<<<<<< + * + * def get_period_field(int code, int64_t value, int freq): + */ +typedef int (*__pyx_t_6pandas_5tslib_accessor)(__pyx_t_5numpy_int64_t, int); + +/* "pandas/tslib.pyx":3365 + * return ordinals + * + * cpdef resolution(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ +struct __pyx_opt_args_6pandas_5tslib_resolution { + int __pyx_n; + PyObject *tz; +}; + +/* "pandas/tslib.pyx":649 + * # (see Timestamp class above). This will serve as a C extension type that + * # shadows the python class, where we do any heavy lifting. + * cdef class _Timestamp(datetime): # <<<<<<<<<<<<<< + * cdef readonly: + * int64_t value, nanosecond + */ +struct __pyx_obj_6pandas_5tslib__Timestamp { + PyDateTime_DateTime __pyx_base; + struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *__pyx_vtab; + __pyx_t_5numpy_int64_t value; + __pyx_t_5numpy_int64_t nanosecond; + PyObject *offset; +}; + + +/* "pandas/tslib.pyx":804 + * + * + * cdef class _NaT(_Timestamp): # <<<<<<<<<<<<<< + * + * def __hash__(_NaT self): + */ +struct __pyx_obj_6pandas_5tslib__NaT { + struct __pyx_obj_6pandas_5tslib__Timestamp __pyx_base; +}; + + +/* "pandas/tslib.pyx":858 + * + * # lightweight C object to hold datetime & int64 pair + * cdef class _TSObject: # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts # pandas_datetimestruct + */ +struct __pyx_obj_6pandas_5tslib__TSObject { + PyObject_HEAD + pandas_datetimestruct dts; + __pyx_t_5numpy_int64_t value; + PyObject *tzinfo; +}; + + +/* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ { + PyObject_HEAD + PyObject *__pyx_v_self; +}; + + +/* "pandas/tslib.pyx":3686 + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone # <<<<<<<<<<<<<< + * for tz in tz_names), + * 'Z'), + */ +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr { + PyObject_HEAD + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *__pyx_outer_scope; + PyObject *__pyx_v_tz; + PyObject *__pyx_v_tz_names; + PyObject *__pyx_t_0; + PyObject *__pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); +}; + + +/* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE { + PyObject_HEAD + PyObject *__pyx_v_to_convert; +}; + + +/* "pandas/tslib.pyx":3710 + * else: + * return '' + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) # <<<<<<<<<<<<<< + * regex = '(?P<%s>%s' % (directive, regex) + * return '%s)' % regex + */ +struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr { + PyObject_HEAD + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *__pyx_outer_scope; + PyObject *__pyx_v_stuff; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; + PyObject *(*__pyx_t_2)(PyObject *); +}; + + + +/* "pandas/tslib.pyx":649 + * # (see Timestamp class above). This will serve as a C extension type that + * # shadows the python class, where we do any heavy lifting. + * cdef class _Timestamp(datetime): # <<<<<<<<<<<<<< + * cdef readonly: + * int64_t value, nanosecond + */ + +struct __pyx_vtabstruct_6pandas_5tslib__Timestamp { + int (*_compare_outside_nanorange)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyDateTime_DateTime *, int); + int (*_assert_tzawareness_compat)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *); + PyDateTime_DateTime *(*to_datetime)(struct __pyx_obj_6pandas_5tslib__Timestamp *, int __pyx_skip_dispatch); + PyObject *(*_get_field)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_get_start_end_field)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *__pyx_vtabptr_6pandas_5tslib__Timestamp; + + +/* "pandas/tslib.pyx":804 + * + * + * cdef class _NaT(_Timestamp): # <<<<<<<<<<<<<< + * + * def __hash__(_NaT self): + */ + +struct __pyx_vtabstruct_6pandas_5tslib__NaT { + struct __pyx_vtabstruct_6pandas_5tslib__Timestamp __pyx_base; +}; +static struct __pyx_vtabstruct_6pandas_5tslib__NaT *__pyx_vtabptr_6pandas_5tslib__NaT; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #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__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #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) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #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 /* CYTHON_REFNANNY */ +#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) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*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); /*proto*/ + +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ + +#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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) \ + (__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) \ + (__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 CYTHON_INLINE 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); + +#if CYTHON_COMPILING_IN_CPYTHON +#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) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*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); + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* proto */ + +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ +#if CYTHON_COMPILING_IN_PYPY +#define __Pyx_PyObject_AsDouble(obj) \ +(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \ + likely(PyInt_CheckExact(obj)) ? \ + PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) +#else +#define __Pyx_PyObject_AsDouble(obj) \ +((likely(PyFloat_CheckExact(obj))) ? \ + PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +#endif + +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__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 CYTHON_INLINE 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); + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000) +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, + int is_tuple, int has_known_size, int decref_tuple); + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#else + #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +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); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */ + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) +static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* proto */ + +#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + 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 +} + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_GET_SIZE(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); + } + #if CYTHON_COMPILING_IN_CPYTHON + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); + #else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); + #endif +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/ +#endif + +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_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 { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +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(void); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0}; +static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value); + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +#include "descrobject.h" +static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/ + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eqf(a, b) ((a)==(b)) + #define __Pyx_c_sumf(a, b) ((a)+(b)) + #define __Pyx_c_difff(a, b) ((a)-(b)) + #define __Pyx_c_prodf(a, b) ((a)*(b)) + #define __Pyx_c_quotf(a, b) ((a)/(b)) + #define __Pyx_c_negf(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zerof(z) ((z)==(float)0) + #define __Pyx_c_conjf(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_absf(z) (::std::abs(z)) + #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zerof(z) ((z)==0) + #define __Pyx_c_conjf(z) (conjf(z)) + #if 1 + #define __Pyx_c_absf(z) (cabsf(z)) + #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq(a, b) ((a)==(b)) + #define __Pyx_c_sum(a, b) ((a)+(b)) + #define __Pyx_c_diff(a, b) ((a)-(b)) + #define __Pyx_c_prod(a, b) ((a)*(b)) + #define __Pyx_c_quot(a, b) ((a)/(b)) + #define __Pyx_c_neg(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero(z) ((z)==(double)0) + #define __Pyx_c_conj(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs(z) (::std::abs(z)) + #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero(z) ((z)==0) + #define __Pyx_c_conj(z) (conj(z)) + #if 1 + #define __Pyx_c_abs(z) (cabs(z)) + #define __Pyx_c_pow(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#define __Pyx_Generator_USED +#include +#include +typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *); +typedef struct { + PyObject_HEAD + __pyx_generator_body_t body; + PyObject *closure; + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + int resume_label; + char is_running; +} __pyx_GeneratorObject; +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure); +static int __pyx_Generator_init(void); +static int __Pyx_Generator_clear(PyObject* self); +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) +#endif + +static int __Pyx_check_binary_version(void); + +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/ + +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'libc.stdlib' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'datetime' */ + +/* Module declarations from 'datetime' */ +static PyTypeObject *__pyx_ptype_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0; +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *, int, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *, pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *, pandas_datetimestruct *); /*proto*/ + +/* Module declarations from 'util' */ +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *); /*proto*/ + +/* Module declarations from 'khash' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'pandas.tslib' */ +static PyTypeObject *__pyx_ptype_6pandas_5tslib__Timestamp = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib__NaT = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib__TSObject = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib___pyx_scope_struct____init__ = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib___pyx_scope_struct_1_genexpr = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib___pyx_scope_struct_2___seqToRE = 0; +static PyTypeObject *__pyx_ptype_6pandas_5tslib___pyx_scope_struct_3_genexpr = 0; +static int __pyx_v_6pandas_5tslib_PY2; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5tslib_NPY_NAT; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5tslib__NS_LOWER_BOUND; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5tslib__NS_UPPER_BOUND; +static pandas_datetimestruct __pyx_v_6pandas_5tslib__NS_MIN_DTS; +static pandas_datetimestruct __pyx_v_6pandas_5tslib__NS_MAX_DTS; +static int __pyx_v_6pandas_5tslib__reverse_ops[6]; +static PyObject *__pyx_v_6pandas_5tslib__NDIM_STRING = 0; +static PyTypeObject *__pyx_v_6pandas_5tslib_ts_type; +static int __pyx_v_6pandas_5tslib__nat_scalar_rules[6]; +static __pyx_t_5numpy_int64_t __pyx_v_6pandas_5tslib_DAY_NS; +static char __pyx_v_6pandas_5tslib_START; +static char __pyx_v_6pandas_5tslib_END; +static PyObject *__pyx_v_6pandas_5tslib_extra_fmts = 0; +static PyObject *__pyx_v_6pandas_5tslib_str_extra_fmts = 0; +static PyObject *__pyx_f_6pandas_5tslib_convert_to_tsobject(PyObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_convert_to_timedelta64(PyObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_tzlocal(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_fixed_offset(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__checknull_with_nat(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__cmp_nat_dt(struct __pyx_obj_6pandas_5tslib__NaT *, struct __pyx_obj_6pandas_5tslib__Timestamp *, int); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_get_value_box(PyArrayObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__cmp_scalar(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, int); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib_is_timestamp(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_utcoffset(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE void __pyx_f_6pandas_5tslib__localize_tso(struct __pyx_obj_6pandas_5tslib__TSObject *, PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_utc(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__get_zone(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_maybe_get_tz(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__check_dts_bounds(pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__get_datetime64_nanos(PyObject *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_cast_from_unit(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__treat_tz_as_pytz(PyObject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__treat_tz_as_dateutil(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__tz_cache_key(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_transitions(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_utc_trans_times_from_dateutil_tz(PyObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_deltas(PyObject *); /*proto*/ +static double __pyx_f_6pandas_5tslib_total_seconds(PyObject *); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_5tslib__unbox_utcoffsets(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__ensure_int64(PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_bisect_right_i8(__pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, Py_ssize_t); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__normalize_local(PyArrayObject *, PyObject *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib__normalized_stamp(pandas_datetimestruct *); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_ts_dayofweek(struct __pyx_obj_6pandas_5tslib__TSObject *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_normalize_date(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_5tslib_localize_dt64arr_to_period(PyArrayObject *, int, PyObject *); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_period_asfreq(__pyx_t_5numpy_int64_t, int, int, int, int __pyx_skip_dispatch); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_period_ordinal_to_dt64(__pyx_t_5numpy_int64_t, int, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__period_strftime(__pyx_t_5numpy_int64_t, int, PyObject *); /*proto*/ +static __pyx_t_6pandas_5tslib_accessor __pyx_f_6pandas_5tslib__get_accessor_func(int); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_resolution(PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_5tslib_resolution *__pyx_optional_args); /*proto*/ +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__reso_stamp(pandas_datetimestruct *); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__reso_local(PyArrayObject *, PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 }; +#define __Pyx_MODULE_NAME "pandas.tslib" +int __pyx_module_is_main_pandas__tslib = 0; + +/* Implementation of 'pandas.tslib' */ +static PyObject *__pyx_builtin_NameError; +static PyObject *__pyx_builtin_property; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_super; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_NotImplemented; +static PyObject *__pyx_builtin_OverflowError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_round; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_sorted; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_lambda_funcdef_6pandas_5tslib_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_ints_to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_fromordinal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ordinal, PyObject *__pyx_v_offset, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_2now(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_4today(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_6utcnow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_8__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ts_input, PyObject *__pyx_v_offset, PyObject *__pyx_v_tz, PyObject *__pyx_v_unit); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_12_date_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_14_time_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_16_repr_base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_18tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_20freq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_22__setstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_24__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_26to_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_28dayofweek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_30dayofyear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_32week(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_34quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_36freqstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_38asm8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_40is_month_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_42is_month_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_44is_quarter_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_46is_quarter_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_48is_year_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_50is_year_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_52tz_localize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz, PyObject *__pyx_v_infer_dst); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_54tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_56replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwds); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_58to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_warn); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_60isoformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_sep); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_62_has_time_component(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_64to_julian_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_4__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_6__hash__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_8__int__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_10__long__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_12weekday(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_14toordinal(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_16__reduce__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_2__nat_unpickle(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_4is_timestamp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6get_value_box(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_8unique_deltas(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10apply_offset(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyObject *__pyx_v_offset); /* proto */ +static Py_hash_t __pyx_pf_6pandas_5tslib_10_Timestamp___hash__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_2__richcmp__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_4to_datetime(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_6__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_8__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_10_get_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_12_get_start_end_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_5value___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_10nanosecond___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_6offset___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self); /* proto */ +static Py_hash_t __pyx_pf_6pandas_5tslib_4_NaT___hash__(struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_2__richcmp__(struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_4__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_6__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_12_delta_to_nanoseconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_delta); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_9_TSObject_5value___get__(struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_14_get_utcoffset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tzinfo, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_16get_timezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_18maybe_get_tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_20datetime_to_datetime64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_22_does_string_look_like_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_string); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_24parse_datetime_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_string, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_26array_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_raise_, PyObject *__pyx_v_dayfirst, CYTHON_UNUSED PyObject *__pyx_v_format, PyObject *__pyx_v_utc, PyObject *__pyx_v_coerce, PyObject *__pyx_v_unit); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_28array_to_timedelta64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_30convert_to_timedelta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_32repr_timedelta64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_format); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_34array_strptime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_fmt, PyObject *__pyx_v_coerce); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_36cast_from_unit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_unit); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_38cast_to_nanoseconds(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_40pydt_to_i8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pydt); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_42i8_to_pydt(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_i8, CYTHON_UNUSED PyObject *__pyx_v_tzinfo); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_44tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vals, PyObject *__pyx_v_tz1, PyObject *__pyx_v_tz2); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_46tz_convert_single(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_val, PyObject *__pyx_v_tz1, PyObject *__pyx_v_tz2); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_48_p_tz_cache_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_50tot_seconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_td); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_52_unbox_utcoffsets(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_transinfo); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_54tz_localize_to_utc(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vals, PyObject *__pyx_v_tz, int __pyx_v_infer_dst); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_56build_field_sarray(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_58get_time_micros(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_60get_date_field(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex, PyObject *__pyx_v_field); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_62get_start_end_field(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex, PyObject *__pyx_v_field, PyObject *__pyx_v_freqstr, int __pyx_v_month_kw); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_64date_normalize(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_66dates_normalized(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_68isleapyear(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_year); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_70monthrange(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_year, __pyx_t_5numpy_int64_t __pyx_v_month); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_72normalize_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dt); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_74dt64arr_to_periodarr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtarr, int __pyx_v_freq, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_76periodarr_to_dt64arr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_periodarr, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_78period_asfreq(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_period_ordinal, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_80period_asfreq_arr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_82period_ordinal(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_y, int __pyx_v_m, int __pyx_v_d, int __pyx_v_h, int __pyx_v_min, int __pyx_v_s, int __pyx_v_us, int __pyx_v_ps, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_84period_ordinal_to_dt64(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_ordinal, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_86period_format(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq, PyObject *__pyx_v_fmt); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_88get_period_field(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_code, __pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_90get_period_field_arr(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_code, PyArrayObject *__pyx_v_arr, int __pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_92extract_ordinals(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_freq); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_94resolution(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_96_getlang(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_2__pad(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_front); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_4__calc_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_6__calc_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_8__calc_am_pm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_10__calc_date_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_12__calc_timezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_8__init___genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_locale_time); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_9__seqToRE_genexpr(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_2__seqToRE(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_to_convert, PyObject *__pyx_v_directive); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_4pattern(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_6compile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */ +static PyObject *__pyx_pf_6pandas_5tslib_98_calc_julian_from_U_or_W(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_year, PyObject *__pyx_v_week_of_year, PyObject *__pyx_v_day_of_week, PyObject *__pyx_v_week_starts_Mon); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_tp_new_6pandas_5tslib__Timestamp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib__NaT(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib__TSObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct____init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_0[] = "0"; +static char __pyx_k_1[] = "\\\\\\1"; +static char __pyx_k_2[] = "2"; +static char __pyx_k_3[] = "3"; +static char __pyx_k_A[] = "A"; +static char __pyx_k_B[] = "B"; +static char __pyx_k_C[] = "C"; +static char __pyx_k_D[] = "D"; +static char __pyx_k_F[] = "%F"; +static char __pyx_k_H[] = "H"; +static char __pyx_k_I[] = "I"; +static char __pyx_k_L[] = "L"; +static char __pyx_k_M[] = "M"; +static char __pyx_k_O[] = "O"; +static char __pyx_k_P[] = "P"; +static char __pyx_k_Q[] = "Q"; +static char __pyx_k_S[] = "S"; +static char __pyx_k_T[] = "T"; +static char __pyx_k_U[] = "U"; +static char __pyx_k_W[] = "W"; +static char __pyx_k_X[] = "%X"; +static char __pyx_k_Y[] = "Y"; +static char __pyx_k_Z[] = " %%Z"; +static char __pyx_k_a[] = "a"; +static char __pyx_k_b[] = "b"; +static char __pyx_k_c[] = "%c"; +static char __pyx_k_d[] = "d"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_g[] = "g"; +static char __pyx_k_h[] = "h"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_k[] = "k"; +static char __pyx_k_l[] = "l"; +static char __pyx_k_m[] = "m"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_p[] = "p"; +static char __pyx_k_q[] = "q"; +static char __pyx_k_s[] = "s"; +static char __pyx_k_t[] = "t"; +static char __pyx_k_u[] = "u"; +static char __pyx_k_v[] = "v"; +static char __pyx_k_w[] = "w"; +static char __pyx_k_x[] = "%x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k_z[] = "%z"; +static char __pyx_k_00[] = "00"; +static char __pyx_k_03[] = "03"; +static char __pyx_k_10[] = "10"; +static char __pyx_k_11[] = "11"; +static char __pyx_k_17[] = "17"; +static char __pyx_k_22[] = "22"; +static char __pyx_k_2d[] = "%.2d"; +static char __pyx_k_3d[] = "%.3d"; +static char __pyx_k_44[] = "44"; +static char __pyx_k_55[] = "55"; +static char __pyx_k_6d[] = ".%.6d"; +static char __pyx_k_76[] = "76"; +static char __pyx_k_99[] = "99"; +static char __pyx_k_9d[] = ".%.9d"; +static char __pyx_k_AB[] = "^`AB`^"; +static char __pyx_k_AS[] = "AS"; +static char __pyx_k_CD[] = "^`CD`^"; +static char __pyx_k_EF[] = "^`EF`^"; +static char __pyx_k_GH[] = "^`GH`^"; +static char __pyx_k_IJ[] = "^`IJ`^"; +static char __pyx_k_KL[] = "^`KL`^"; +static char __pyx_k_MS[] = "MS"; +static char __pyx_k_QS[] = "QS"; +static char __pyx_k_Zd[] = "Zd"; +static char __pyx_k_Zf[] = "Zf"; +static char __pyx_k_Zg[] = "Zg"; +static char __pyx_k__5[] = ""; +static char __pyx_k_dt[] = "dt"; +static char __pyx_k_i4[] = "i4"; +static char __pyx_k_i8[] = "i8"; +static char __pyx_k_ms[] = "ms"; +static char __pyx_k_np[] = "np"; +static char __pyx_k_ns[] = "ns"; +static char __pyx_k_ps[] = "ps"; +static char __pyx_k_re[] = "re"; +static char __pyx_k_sp[] = "sp"; +static char __pyx_k_sz[] = "sz"; +static char __pyx_k_td[] = "td"; +static char __pyx_k_ts[] = "ts"; +static char __pyx_k_tz[] = "tz"; +static char __pyx_k_us[] = "us"; +static char __pyx_k_02d[] = "%02d"; +static char __pyx_k_03d[] = "%03d"; +static char __pyx_k_06d[] = "%06d"; +static char __pyx_k_09d[] = "%09d"; +static char __pyx_k_1_6[] = "1.6"; +static char __pyx_k_1_7[] = "1.7"; +static char __pyx_k_A_2[] = "%A"; +static char __pyx_k_B_2[] = "%B"; +static char __pyx_k_H_2[] = "%H"; +static char __pyx_k_I_2[] = "%I"; +static char __pyx_k_M_2[] = "%M"; +static char __pyx_k_NAN[] = "NAN"; +static char __pyx_k_NAT[] = "NAT"; +static char __pyx_k_NaN[] = "NaN"; +static char __pyx_k_NaT[] = "NaT"; +static char __pyx_k_S_2[] = "%S"; +static char __pyx_k_UTC[] = "UTC"; +static char __pyx_k_U_2[] = "%U"; +static char __pyx_k_U_W[] = "U_W"; +static char __pyx_k_W_2[] = "%W"; +static char __pyx_k_X_2[] = "X"; +static char __pyx_k_Y_2[] = "%Y"; +static char __pyx_k_Y_m[] = "%Y-%m"; +static char __pyx_k_Z_2[] = "Z"; +static char __pyx_k_Z_3[] = "%Z"; +static char __pyx_k__50[] = "-"; +static char __pyx_k__51[] = "\\"; +static char __pyx_k__52[] = "%"; +static char __pyx_k__89[] = "%%"; +static char __pyx_k_a_2[] = "%a"; +static char __pyx_k_abs[] = "abs"; +static char __pyx_k_add[] = "__add__"; +static char __pyx_k_all[] = "all"; +static char __pyx_k_any[] = "any"; +static char __pyx_k_arr[] = "arr"; +static char __pyx_k_b_2[] = "%b"; +static char __pyx_k_c_2[] = "c"; +static char __pyx_k_cls[] = "cls"; +static char __pyx_k_d_2[] = "%d"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_dom[] = "dom"; +static char __pyx_k_dow[] = "dow"; +static char __pyx_k_doy[] = "doy"; +static char __pyx_k_dts[] = "dts"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_err[] = "err"; +static char __pyx_k_f_2[] = "%f"; +static char __pyx_k_fix[] = "fix"; +static char __pyx_k_fmt[] = "fmt"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_gmt[] = "gmt"; +static char __pyx_k_grp[] = "grp"; +static char __pyx_k_idx[] = "idx"; +static char __pyx_k_inf[] = "inf"; +static char __pyx_k_int[] = "__int__"; +static char __pyx_k_j_2[] = "%j"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_l_2[] = "%l"; +static char __pyx_k_len[] = "len"; +static char __pyx_k_loc[] = "loc"; +static char __pyx_k_m_2[] = "%m"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_mus[] = "mus"; +static char __pyx_k_n_2[] = "%n"; +static char __pyx_k_nan[] = "nan"; +static char __pyx_k_nat[] = "nat"; +static char __pyx_k_new[] = "__new__"; +static char __pyx_k_now[] = "now"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_old[] = "old"; +static char __pyx_k_out[] = "out"; +static char __pyx_k_p_2[] = "%p"; +static char __pyx_k_pad[] = "__pad"; +static char __pyx_k_pos[] = "pos"; +static char __pyx_k_q_2[] = "%q"; +static char __pyx_k_ret[] = "ret"; +static char __pyx_k_s_2[] = "%s)"; +static char __pyx_k_s_3[] = "\\s+"; +static char __pyx_k_s_s[] = "%s %s"; +static char __pyx_k_sep[] = "sep"; +static char __pyx_k_seq[] = "seq"; +static char __pyx_k_str[] = "__str__"; +static char __pyx_k_sub[] = "__sub__"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_tso[] = "tso"; +static char __pyx_k_tz1[] = "tz1"; +static char __pyx_k_tz2[] = "tz2"; +static char __pyx_k_u_2[] = "%u"; +static char __pyx_k_utc[] = "utc"; +static char __pyx_k_val[] = "val"; +static char __pyx_k_w_2[] = "%w"; +static char __pyx_k_woy[] = "woy"; +static char __pyx_k_x_2[] = "x"; +static char __pyx_k_y_2[] = "%y"; +static char __pyx_k_zip[] = "zip"; +static char __pyx_k_1999[] = "1999"; +static char __pyx_k_FQ_q[] = "%FQ%q"; +static char __pyx_k_M8_s[] = "M8[s]"; +static char __pyx_k__112[] = "|"; +static char __pyx_k__113[] = "([\\\\.^$*+?\\(\\){}\\[\\]|])"; +static char __pyx_k_ampm[] = "ampm"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_asm8[] = "asm8"; +static char __pyx_k_base[] = "base"; +static char __pyx_k_code[] = "code"; +static char __pyx_k_date[] = "date"; +static char __pyx_k_days[] = "days"; +static char __pyx_k_diff[] = "diff"; +static char __pyx_k_exit[] = "__exit__"; +static char __pyx_k_fget[] = "fget"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_fill[] = "fill"; +static char __pyx_k_flat[] = "flat"; +static char __pyx_k_frac[] = "frac"; +static char __pyx_k_freq[] = "freq"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_hash[] = "__hash__"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_iNaT[] = "iNaT"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_int8[] = "int8"; +static char __pyx_k_item[] = "item"; +static char __pyx_k_join[] = "join"; +static char __pyx_k_kwds[] = "kwds"; +static char __pyx_k_lang[] = "lang"; +static char __pyx_k_ldom[] = "ldom"; +static char __pyx_k_left[] = "left"; +static char __pyx_k_long[] = "long"; +static char __pyx_k_m8_0[] = "m8[{0}]"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mask[] = "mask"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_ndim[] = "ndim"; +static char __pyx_k_prop[] = "prop"; +static char __pyx_k_pydt[] = "pydt"; +static char __pyx_k_pytz[] = "pytz"; +static char __pyx_k_repr[] = "__repr__"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_send[] = "send"; +static char __pyx_k_side[] = "side"; +static char __pyx_k_sign[] = "sign"; +static char __pyx_k_size[] = "size"; +static char __pyx_k_sort[] = "sort"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_time[] = "time"; +static char __pyx_k_ts_2[] = "_ts"; +static char __pyx_k_tz_0[] = ", tz='{0}'"; +static char __pyx_k_tz_s[] = ", tz=%s"; +static char __pyx_k_unit[] = "unit"; +static char __pyx_k_vals[] = "vals"; +static char __pyx_k_view[] = "view"; +static char __pyx_k_warn[] = "warn"; +static char __pyx_k_week[] = "week"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_zone[] = "zone"; +static char __pyx_k_M8_ns[] = "M8[ns]"; +static char __pyx_k_P_s_s[] = "(?P<%s>%s"; +static char __pyx_k_Y_m_d[] = "%Y-%m-%d"; +static char __pyx_k_a_idx[] = "a_idx"; +static char __pyx_k_all_2[] = "__all__"; +static char __pyx_k_am_pm[] = "am_pm"; +static char __pyx_k_apply[] = "apply"; +static char __pyx_k_array[] = "array"; +static char __pyx_k_b_idx[] = "b_idx"; +static char __pyx_k_base1[] = "base1"; +static char __pyx_k_base2[] = "base2"; +static char __pyx_k_boxed[] = "boxed"; +static char __pyx_k_clear[] = "clear"; +static char __pyx_k_close[] = "close"; +static char __pyx_k_count[] = "count"; +static char __pyx_k_delta[] = "delta"; +static char __pyx_k_dtarr[] = "dtarr"; +static char __pyx_k_dtype[] = "dtype"; +static char __pyx_k_empty[] = "empty"; +static char __pyx_k_enter[] = "__enter__"; +static char __pyx_k_field[] = "field"; +static char __pyx_k_finfo[] = "finfo"; +static char __pyx_k_floor[] = "floor"; +static char __pyx_k_found[] = "found"; +static char __pyx_k_freq1[] = "freq1"; +static char __pyx_k_freq2[] = "freq2"; +static char __pyx_k_front[] = "front"; +static char __pyx_k_gettz[] = "gettz"; +static char __pyx_k_hours[] = "hours"; +static char __pyx_k_index[] = "index"; +static char __pyx_k_int32[] = "int32"; +static char __pyx_k_int64[] = "int64"; +static char __pyx_k_isdst[] = "isdst"; +static char __pyx_k_lower[] = "lower"; +static char __pyx_k_m8_ns[] = "m8[ns]"; +static char __pyx_k_match[] = "match"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_nanos[] = "nanos"; +static char __pyx_k_new_2[] = "new"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_py_dt[] = "py_dt"; +static char __pyx_k_raise[] = "raise_"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_ravel[] = "ravel"; +static char __pyx_k_regex[] = "regex"; +static char __pyx_k_right[] = "right"; +static char __pyx_k_round[] = "round"; +static char __pyx_k_s_s_2[] = "%s/%s"; +static char __pyx_k_s_s_3[] = "%s%s"; +static char __pyx_k_s_s_s[] = "%s%s%s"; +static char __pyx_k_shape[] = "shape"; +static char __pyx_k_short[] = "short"; +static char __pyx_k_stamp[] = "stamp"; +static char __pyx_k_state[] = "state"; +static char __pyx_k_sub_2[] = "sub"; +static char __pyx_k_super[] = "super"; +static char __pyx_k_table[] = "table"; +static char __pyx_k_tdata[] = "tdata"; +static char __pyx_k_throw[] = "throw"; +static char __pyx_k_today[] = "today"; +static char __pyx_k_trans[] = "trans"; +static char __pyx_k_tzset[] = "tzset"; +static char __pyx_k_tzutc[] = "tzutc"; +static char __pyx_k_utf_8[] = "utf-8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_where[] = "where"; +static char __pyx_k_years[] = "years"; +static char __pyx_k_zeros[] = "zeros"; +static char __pyx_k_D_RESO[] = "D_RESO"; +static char __pyx_k_H_RESO[] = "H_RESO"; +static char __pyx_k_Period[] = "Period"; +static char __pyx_k_S_RESO[] = "S_RESO"; +static char __pyx_k_T_RESO[] = "T_RESO"; +static char __pyx_k_TimeRE[] = "TimeRE"; +static char __pyx_k_Z_tz_s[] = " %%Z, tz=%s"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_astype[] = "astype"; +static char __pyx_k_coerce[] = "coerce"; +static char __pyx_k_decode[] = "decode"; +static char __pyx_k_deltas[] = "deltas"; +static char __pyx_k_encode[] = "encode"; +static char __pyx_k_escape[] = "escape"; +static char __pyx_k_fields[] = "fields"; +static char __pyx_k_format[] = "format"; +static char __pyx_k_hstack[] = "hstack"; +static char __pyx_k_ignore[] = "ignore"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_insert[] = "insert"; +static char __pyx_k_isleap[] = "isleap"; +static char __pyx_k_ivalue[] = "ivalue"; +static char __pyx_k_julian[] = "julian"; +static char __pyx_k_kwargs[] = "kwargs"; +static char __pyx_k_lambda[] = ""; +static char __pyx_k_locale[] = "locale"; +static char __pyx_k_long_2[] = "__long__"; +static char __pyx_k_micros[] = "micros"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_mo_off[] = "mo_off"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_months[] = "months"; +static char __pyx_k_new_tz[] = "new_tz"; +static char __pyx_k_np_NaT[] = "np_NaT"; +static char __pyx_k_ntrans[] = "ntrans"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_offset[] = "offset"; +static char __pyx_k_reduce[] = "__reduce__"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_sorted[] = "sorted"; +static char __pyx_k_stamps[] = "stamps"; +static char __pyx_k_tar_gz[] = ".tar.gz"; +static char __pyx_k_thread[] = "thread"; +static char __pyx_k_tzfile[] = "tzfile"; +static char __pyx_k_tzinfo[] = "tzinfo"; +static char __pyx_k_tzname[] = "tzname"; +static char __pyx_k_utcnow[] = "utcnow"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_02d_06d[] = "%02d.%06d"; +static char __pyx_k_LC_TIME[] = "LC_TIME"; +static char __pyx_k_LC_date[] = "LC_date"; +static char __pyx_k_LC_time[] = "LC_time"; +static char __pyx_k_MS_RESO[] = "MS_RESO"; +static char __pyx_k_NaTType[] = "NaTType"; +static char __pyx_k_P_w_0_6[] = "(?P[0-6])"; +static char __pyx_k_P_y_d_d[] = "(?P\\d\\d)"; +static char __pyx_k_US_RESO[] = "US_RESO"; +static char __pyx_k_a_month[] = "a_month"; +static char __pyx_k_both_eq[] = "both_eq"; +static char __pyx_k_combine[] = "combine"; +static char __pyx_k_compile[] = "compile"; +static char __pyx_k_d_2d_2d[] = "%d-%.2d-%.2d"; +static char __pyx_k_dtindex[] = "dtindex"; +static char __pyx_k_f_month[] = "f_month"; +static char __pyx_k_freqstr[] = "freqstr"; +static char __pyx_k_genexpr[] = "genexpr"; +static char __pyx_k_getitem[] = "__getitem__"; +static char __pyx_k_getlang[] = "_getlang"; +static char __pyx_k_iresult[] = "iresult"; +static char __pyx_k_ivalues[] = "ivalues"; +static char __pyx_k_maximum[] = "maximum"; +static char __pyx_k_minutes[] = "minutes"; +static char __pyx_k_nonzero[] = "nonzero"; +static char __pyx_k_ordinal[] = "ordinal"; +static char __pyx_k_oresult[] = "oresult"; +static char __pyx_k_pattern[] = "pattern"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_quarter[] = "quarter"; +static char __pyx_k_replace[] = "replace"; +static char __pyx_k_reverse[] = "reverse"; +static char __pyx_k_seconds[] = "seconds"; +static char __pyx_k_seqToRE[] = "__seqToRE"; +static char __pyx_k_setitem[] = "__setitem__"; +static char __pyx_k_squeeze[] = "squeeze"; +static char __pyx_k_ts_base[] = "ts_base"; +static char __pyx_k_tzinfos[] = "_tzinfos"; +static char __pyx_k_tzlocal[] = "tzlocal"; +static char __pyx_k_uniques[] = "uniques"; +static char __pyx_k_version[] = "version"; +static char __pyx_k_weekday[] = "weekday"; +static char __pyx_k_2d_2d_2d[] = "%.2d:%.2d:%.2d"; +static char __pyx_k_KeyError[] = "KeyError"; +static char __pyx_k_both_nat[] = "both_nat"; +static char __pyx_k_calendar[] = "calendar"; +static char __pyx_k_datetime[] = "datetime"; +static char __pyx_k_dateutil[] = "dateutil/"; +static char __pyx_k_day_abbr[] = "day_abbr"; +static char __pyx_k_day_name[] = "day_name"; +static char __pyx_k_dayfirst[] = "dayfirst"; +static char __pyx_k_daylight[] = "daylight"; +static char __pyx_k_filename[] = "_filename"; +static char __pyx_k_fraction[] = "fraction"; +static char __pyx_k_iterkeys[] = "iterkeys"; +static char __pyx_k_localize[] = "localize"; +static char __pyx_k_month_kw[] = "month_kw"; +static char __pyx_k_offset_0[] = ", offset='{0}'"; +static char __pyx_k_one_diff[] = "one_diff"; +static char __pyx_k_ordinals[] = "ordinals"; +static char __pyx_k_property[] = "property"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_relation[] = "relation"; +static char __pyx_k_result_a[] = "result_a"; +static char __pyx_k_result_b[] = "result_b"; +static char __pyx_k_s_d_days[] = "%s%d days"; +static char __pyx_k_sa_dtype[] = "sa_dtype"; +static char __pyx_k_setstate[] = "__setstate__"; +static char __pyx_k_strftime[] = "strftime"; +static char __pyx_k_thread_2[] = "_thread"; +static char __pyx_k_timezone[] = "timezone"; +static char __pyx_k_ts_input[] = "ts_input"; +static char __pyx_k_tzoffset[] = "tzoffset"; +static char __pyx_k_utc_date[] = "utc_date"; +static char __pyx_k_year2000[] = "year2000"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_NameError[] = "NameError"; +static char __pyx_k_Timestamp[] = "Timestamp"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_Y_m_d_H_M[] = "%Y-%m-%d %H:%M"; +static char __pyx_k_a_weekday[] = "a_weekday"; +static char __pyx_k_date_repr[] = "_date_repr"; +static char __pyx_k_date_time[] = "date_time"; +static char __pyx_k_dayofweek[] = "dayofweek"; +static char __pyx_k_dayofyear[] = "dayofyear"; +static char __pyx_k_directive[] = "directive"; +static char __pyx_k_dst_hours[] = "dst_hours"; +static char __pyx_k_end_month[] = "end_month"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_f_weekday[] = "f_weekday"; +static char __pyx_k_get_field[] = "_get_field"; +static char __pyx_k_getlocale[] = "getlocale"; +static char __pyx_k_group_key[] = "group_key"; +static char __pyx_k_groupdict[] = "groupdict"; +static char __pyx_k_have_pytz[] = "have_pytz"; +static char __pyx_k_infer_dst[] = "infer_dst"; +static char __pyx_k_isoformat[] = "isoformat"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_no_saving[] = "no_saving"; +static char __pyx_k_normalize[] = "normalize"; +static char __pyx_k_periodarr[] = "periodarr"; +static char __pyx_k_re_escape[] = "re_escape"; +static char __pyx_k_repr_base[] = "_repr_base"; +static char __pyx_k_time_repr[] = "_time_repr"; +static char __pyx_k_timedelta[] = "timedelta"; +static char __pyx_k_to_offset[] = "to_offset"; +static char __pyx_k_to_period[] = "to_period"; +static char __pyx_k_toordinal[] = "toordinal"; +static char __pyx_k_trans_grp[] = "trans_grp"; +static char __pyx_k_trans_idx[] = "_trans_idx"; +static char __pyx_k_trans_len[] = "trans_len"; +static char __pyx_k_tz_values[] = "tz_values"; +static char __pyx_k_utc_dates[] = "utc_dates"; +static char __pyx_k_utcoffset[] = "utcoffset"; +static char __pyx_k_zero_time[] = "_zero_time"; +static char __pyx_k_BaseTzInfo[] = "BaseTzInfo"; +static char __pyx_k_IGNORECASE[] = "IGNORECASE"; +static char __pyx_k_IndexError[] = "IndexError"; +static char __pyx_k_LocaleTime[] = "LocaleTime"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_Y_m_d_H_00[] = "%Y-%m-%d %H:00"; +static char __pyx_k_astimezone[] = "astimezone"; +static char __pyx_k_basestring[] = "basestring"; +static char __pyx_k_cache_lock[] = "_cache_lock"; +static char __pyx_k_calc_am_pm[] = "__calc_am_pm"; +static char __pyx_k_calc_month[] = "__calc_month"; +static char __pyx_k_compat_NaT[] = "compat_NaT"; +static char __pyx_k_datetime64[] = "datetime64"; +static char __pyx_k_dateutil_2[] = "dateutil"; +static char __pyx_k_found_dict[] = "found_dict"; +static char __pyx_k_found_zone[] = "found_zone"; +static char __pyx_k_freq_group[] = "freq_group"; +static char __pyx_k_has_saving[] = "has_saving"; +static char __pyx_k_i8_to_pydt[] = "i8_to_pydt"; +static char __pyx_k_isleapyear[] = "isleapyear"; +static char __pyx_k_month_abbr[] = "month_abbr"; +static char __pyx_k_month_name[] = "month_name"; +static char __pyx_k_monthrange[] = "monthrange"; +static char __pyx_k_nanosecond[] = "nanosecond"; +static char __pyx_k_new_values[] = "new_values"; +static char __pyx_k_np_version[] = "_np_version"; +static char __pyx_k_parse_code[] = "parse_code"; +static char __pyx_k_parse_date[] = "parse_date"; +static char __pyx_k_pydt_to_i8[] = "pydt_to_i8"; +static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_re_compile[] = "re_compile"; +static char __pyx_k_startswith[] = "startswith"; +static char __pyx_k_switch_idx[] = "switch_idx"; +static char __pyx_k_time_tuple[] = "time_tuple"; +static char __pyx_k_to_convert[] = "to_convert"; +static char __pyx_k_trans_list[] = "_trans_list"; +static char __pyx_k_ttinfo_std[] = "_ttinfo_std"; +static char __pyx_k_tz_convert[] = "tz_convert"; +static char __pyx_k_weekofyear[] = "weekofyear"; +static char __pyx_k_P_M_0_5_d_d[] = "(?P[0-5]\\d|\\d)"; +static char __pyx_k_P_Y_d_d_d_d[] = "(?P\\d\\d\\d\\d)"; +static char __pyx_k_P_f_0_9_1_6[] = "(?P[0-9]{1,6})"; +static char __pyx_k_Y_m_d_H_M_S[] = "%Y-%m-%d %H:%M:%S"; +static char __pyx_k_array_split[] = "array_split"; +static char __pyx_k_date_string[] = "date_string"; +static char __pyx_k_dateutil_tz[] = "dateutil.tz"; +static char __pyx_k_day_of_week[] = "day_of_week"; +static char __pyx_k_fromordinal[] = "fromordinal"; +static char __pyx_k_idx_shifted[] = "idx_shifted"; +static char __pyx_k_inferred_tz[] = "inferred_tz"; +static char __pyx_k_is_business[] = "is_business"; +static char __pyx_k_is_year_end[] = "is_year_end"; +static char __pyx_k_isleap_prev[] = "isleap_prev"; +static char __pyx_k_locale_time[] = "locale_time"; +static char __pyx_k_logical_and[] = "logical_and"; +static char __pyx_k_microsecond[] = "microsecond"; +static char __pyx_k_nat_strings[] = "_nat_strings"; +static char __pyx_k_pytz_tzinfo[] = "pytz.tzinfo"; +static char __pyx_k_regex_cache[] = "_regex_cache"; +static char __pyx_k_regex_chars[] = "regex_chars"; +static char __pyx_k_s_02d_02d_s[] = "%s%02d:%02d:%s"; +static char __pyx_k_sign_pretty[] = "sign_pretty"; +static char __pyx_k_start_month[] = "start_month"; +static char __pyx_k_struct_time[] = "struct_time"; +static char __pyx_k_timedelta64[] = "timedelta64"; +static char __pyx_k_to_datetime[] = "to_datetime"; +static char __pyx_k_tot_seconds[] = "tot_seconds"; +static char __pyx_k_trans_cache[] = "trans_cache"; +static char __pyx_k_trans_idx_2[] = "trans_idx"; +static char __pyx_k_tz_localize[] = "tz_localize"; +static char __pyx_k_utc_convert[] = "utc_convert"; +static char __pyx_k_utcoffset_2[] = "_utcoffset"; +static char __pyx_k_LC_date_time[] = "LC_date_time"; +static char __pyx_k_LooseVersion[] = "LooseVersion"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_TimeRE_cache[] = "_TimeRE_cache"; +static char __pyx_k_Timestamp_tz[] = "Timestamp.tz"; +static char __pyx_k_apply_offset[] = "apply_offset"; +static char __pyx_k_calc_weekday[] = "__calc_weekday"; +static char __pyx_k_days_to_week[] = "days_to_week"; +static char __pyx_k_dummy_thread[] = "dummy_thread"; +static char __pyx_k_format_regex[] = "format_regex"; +static char __pyx_k_get_timezone[] = "get_timezone"; +static char __pyx_k_is_month_end[] = "is_month_end"; +static char __pyx_k_microseconds[] = "microseconds"; +static char __pyx_k_month_offset[] = "_month_offset"; +static char __pyx_k_nat_unpickle[] = "__nat_unpickle"; +static char __pyx_k_object_state[] = "object_state"; +static char __pyx_k_pandas_tslib[] = "pandas.tslib"; +static char __pyx_k_searchsorted[] = "searchsorted"; +static char __pyx_k_seen_integer[] = "seen_integer"; +static char __pyx_k_string_types[] = "string_types"; +static char __pyx_k_version_info[] = "version_info"; +static char __pyx_k_week_of_year[] = "week_of_year"; +static char __pyx_k_NaTType___int[] = "NaTType.__int__"; +static char __pyx_k_NaTType___new[] = "NaTType.__new__"; +static char __pyx_k_NaTType___str[] = "NaTType.__str__"; +static char __pyx_k_OverflowError[] = "OverflowError"; +static char __pyx_k_TimeRE___init[] = "TimeRE.__init__"; +static char __pyx_k_Timestamp_now[] = "Timestamp.now"; +static char __pyx_k_Y_m_d_H_M_S_l[] = "%Y-%m-%d %H:%M:%S.%l"; +static char __pyx_k_Y_m_d_H_M_S_n[] = "%Y-%m-%d %H:%M:%S.%n"; +static char __pyx_k_Y_m_d_H_M_S_u[] = "%Y-%m-%d %H:%M:%S.%u"; +static char __pyx_k_allocate_lock[] = "allocate_lock"; +static char __pyx_k_bad_directive[] = "bad_directive"; +static char __pyx_k_calc_timezone[] = "__calc_timezone"; +static char __pyx_k_datetime_date[] = "datetime_date"; +static char __pyx_k_datetime_time[] = "datetime_time"; +static char __pyx_k_first_weekday[] = "first_weekday"; +static char __pyx_k_is_year_start[] = "is_year_start"; +static char __pyx_k_pandas_compat[] = "pandas.compat"; +static char __pyx_k_period_format[] = "period_format"; +static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static char __pyx_k_seen_datetime[] = "seen_datetime"; +static char __pyx_k_short_version[] = "short_version"; +static char __pyx_k_startingMonth[] = "startingMonth"; +static char __pyx_k_to_pydatetime[] = "to_pydatetime"; +static char __pyx_k_total_seconds[] = "total_seconds"; +static char __pyx_k_ttinfo_before[] = "_ttinfo_before"; +static char __pyx_k_unique_deltas[] = "unique_deltas"; +static char __pyx_k_week_0_length[] = "week_0_length"; +static char __pyx_k_AttributeError[] = "AttributeError"; +static char __pyx_k_CACHE_MAX_SIZE[] = "_CACHE_MAX_SIZE"; +static char __pyx_k_NaTType___hash[] = "NaTType.__hash__"; +static char __pyx_k_NaTType___long[] = "NaTType.__long__"; +static char __pyx_k_NaTType___repr[] = "NaTType.__repr__"; +static char __pyx_k_NotImplemented[] = "NotImplemented"; +static char __pyx_k_TimeRE_compile[] = "TimeRE.compile"; +static char __pyx_k_TimeRE_pattern[] = "TimeRE.pattern"; +static char __pyx_k_Timestamp_asm8[] = "Timestamp.asm8"; +static char __pyx_k_Timestamp_freq[] = "Timestamp.freq"; +static char __pyx_k_Timestamp_week[] = "Timestamp.week"; +static char __pyx_k_Unknown_freq_d[] = "Unknown freq: %d"; +static char __pyx_k_array_strptime[] = "array_strptime"; +static char __pyx_k_calc_date_time[] = "__calc_date_time"; +static char __pyx_k_current_format[] = "current_format"; +static char __pyx_k_date_normalize[] = "date_normalize"; +static char __pyx_k_dateutil_gettz[] = "_dateutil_gettz"; +static char __pyx_k_dateutil_tzutc[] = "_dateutil_tzutc"; +static char __pyx_k_dummy_thread_2[] = "_dummy_thread"; +static char __pyx_k_get_date_field[] = "get_date_field"; +static char __pyx_k_is_month_start[] = "is_month_start"; +static char __pyx_k_is_quarter_end[] = "is_quarter_end"; +static char __pyx_k_p_tz_cache_key[] = "_p_tz_cache_key"; +static char __pyx_k_period_ordinal[] = "period_ordinal"; +static char __pyx_k_seconds_pretty[] = "seconds_pretty"; +static char __pyx_k_timedelta64_ns[] = "timedelta64[ns]"; +static char __pyx_k_to_julian_date[] = "to_julian_date"; +static char __pyx_k_LocaleTime__pad[] = "_LocaleTime__pad"; +static char __pyx_k_NaTType_weekday[] = "NaTType.weekday"; +static char __pyx_k_TimeRE__seqToRE[] = "_TimeRE__seqToRE"; +static char __pyx_k_Timestamp___new[] = "Timestamp.__new__"; +static char __pyx_k_Timestamp_today[] = "Timestamp.today"; +static char __pyx_k_datetime_result[] = "datetime_result"; +static char __pyx_k_dateutil_tzfile[] = "_dateutil_tzfile"; +static char __pyx_k_directive_index[] = "directive_index"; +static char __pyx_k_get_time_micros[] = "get_time_micros"; +static char __pyx_k_pytz_BaseTzInfo[] = "_pytz_BaseTzInfo"; +static char __pyx_k_s_is_wrong_freq[] = "%s is wrong freq"; +static char __pyx_k_transition_info[] = "_transition_info"; +static char __pyx_k_week_starts_Mon[] = "week_starts_Mon"; +static char __pyx_k_LocaleTime___pad[] = "LocaleTime.__pad"; +static char __pyx_k_NaTType___reduce[] = "NaTType.__reduce__"; +static char __pyx_k_TimeRE___seqToRE[] = "TimeRE.__seqToRE"; +static char __pyx_k_Timestamp___repr[] = "Timestamp.__repr__"; +static char __pyx_k_Timestamp_utcnow[] = "Timestamp.utcnow"; +static char __pyx_k_d_2d_2d_2d_2d_2d[] = "%d-%.2d-%.2d %.2d:%.2d:%.2d"; +static char __pyx_k_dates_normalized[] = "dates_normalized"; +static char __pyx_k_dateutil_tzlocal[] = "_dateutil_tzlocal"; +static char __pyx_k_extract_ordinals[] = "extract_ordinals"; +static char __pyx_k_get_period_field[] = "get_period_field"; +static char __pyx_k_is_quarter_start[] = "is_quarter_start"; +static char __pyx_k_parse_code_table[] = "_parse_code_table"; +static char __pyx_k_processed_format[] = "processed_format"; +static char __pyx_k_repr_timedelta64[] = "repr_timedelta64"; +static char __pyx_k_utc_offset_cache[] = "utc_offset_cache"; +static char __pyx_k_LocaleTime___init[] = "LocaleTime.__init__"; +static char __pyx_k_NaTType_toordinal[] = "NaTType.toordinal"; +static char __pyx_k_P_H_2_0_3_0_1_d_d[] = "(?P2[0-3]|[0-1]\\d|\\d)"; +static char __pyx_k_P_S_6_0_1_0_5_d_d[] = "(?P6[0-1]|[0-5]\\d|\\d)"; +static char __pyx_k_P_U_5_0_3_0_4_d_d[] = "(?P5[0-3]|[0-4]\\d|\\d)"; +static char __pyx_k_Timestamp_freqstr[] = "Timestamp.freqstr"; +static char __pyx_k_Timestamp_quarter[] = "Timestamp.quarter"; +static char __pyx_k_Timestamp_replace[] = "Timestamp.replace"; +static char __pyx_k_Unable_to_parse_s[] = "Unable to parse %s"; +static char __pyx_k_array_to_datetime[] = "array_to_datetime"; +static char __pyx_k_distutils_version[] = "distutils.version"; +static char __pyx_k_period_asfreq_arr[] = "period_asfreq_arr"; +static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; +static char __pyx_k_replacement_pairs[] = "replacement_pairs"; +static char __pyx_k_stray_in_format_s[] = "stray %% in format '%s'"; +static char __pyx_k_tz_convert_single[] = "tz_convert_single"; +static char __pyx_k_AmbiguousTimeError[] = "AmbiguousTimeError"; +static char __pyx_k_Timestamp___reduce[] = "Timestamp.__reduce__"; +static char __pyx_k_build_field_sarray[] = "build_field_sarray"; +static char __pyx_k_cannot_cast_unit_0[] = "cannot cast unit {0}"; +static char __pyx_k_has_time_component[] = "_has_time_component"; +static char __pyx_k_ints_to_pydatetime[] = "ints_to_pydatetime"; +static char __pyx_k_is_timestamp_array[] = "is_timestamp_array"; +static char __pyx_k_s_d_days_02d_02d_s[] = "%s%d days, %02d:%02d:%s"; +static char __pyx_k_tz_localize_to_utc[] = "tz_localize_to_utc"; +static char __pyx_k_week_of_year_start[] = "week_of_year_start"; +static char __pyx_k_OutOfBoundsDatetime[] = "OutOfBoundsDatetime"; +static char __pyx_k_P_I_1_0_2_0_1_9_1_9[] = "(?P1[0-2]|0[1-9]|[1-9])"; +static char __pyx_k_P_m_1_0_2_0_1_9_1_9[] = "(?P1[0-2]|0[1-9]|[1-9])"; +static char __pyx_k_Timestamp_dayofweek[] = "Timestamp.dayofweek"; +static char __pyx_k_Timestamp_dayofyear[] = "Timestamp.dayofyear"; +static char __pyx_k_Timestamp_isoformat[] = "Timestamp.isoformat"; +static char __pyx_k_Timestamp_to_period[] = "Timestamp.to_period"; +static char __pyx_k_Unrecognized_type_s[] = "Unrecognized type: %s"; +static char __pyx_k_cast_to_nanoseconds[] = "cast_to_nanoseconds"; +static char __pyx_k_get_start_end_field[] = "_get_start_end_field"; +static char __pyx_k_index_out_of_bounds[] = "index out of bounds"; +static char __pyx_k_np_version_under1p6[] = "_np_version_under1p6"; +static char __pyx_k_np_version_under1p7[] = "_np_version_under1p7"; +static char __pyx_k_NonExistentTimeError[] = "NonExistentTimeError"; +static char __pyx_k_Timestamp___setstate[] = "Timestamp.__setstate__"; +static char __pyx_k_Timestamp__date_repr[] = "Timestamp._date_repr"; +static char __pyx_k_Timestamp__repr_base[] = "Timestamp._repr_base"; +static char __pyx_k_Timestamp__time_repr[] = "Timestamp._time_repr"; +static char __pyx_k_Timestamp_tz_convert[] = "Timestamp.tz_convert"; +static char __pyx_k_array_to_timedelta64[] = "array_to_timedelta64"; +static char __pyx_k_convert_to_timedelta[] = "convert_to_timedelta"; +static char __pyx_k_delta_to_nanoseconds[] = "_delta_to_nanoseconds"; +static char __pyx_k_dt64arr_to_periodarr[] = "dt64arr_to_periodarr"; +static char __pyx_k_get_period_field_arr[] = "get_period_field_arr"; +static char __pyx_k_not_datelike_strings[] = "_not_datelike_strings"; +static char __pyx_k_periodarr_to_dt64arr[] = "periodarr_to_dt64arr"; +static char __pyx_k_thread_allocate_lock[] = "_thread_allocate_lock"; +static char __pyx_k_utc_transition_times[] = "_utc_transition_times"; +static char __pyx_k_Field_s_not_supported[] = "Field %s not supported"; +static char __pyx_k_Timestamp_fromordinal[] = "Timestamp.fromordinal"; +static char __pyx_k_Timestamp_is_year_end[] = "Timestamp.is_year_end"; +static char __pyx_k_Timestamp_tz_localize[] = "Timestamp.tz_localize"; +static char __pyx_k_get_start_end_field_2[] = "get_start_end_field"; +static char __pyx_k_pandas_tseries_period[] = "pandas.tseries.period"; +static char __pyx_k_parse_datetime_string[] = "parse_datetime_string"; +static char __pyx_k_LocaleTime__calc_am_pm[] = "_LocaleTime__calc_am_pm"; +static char __pyx_k_LocaleTime__calc_month[] = "_LocaleTime__calc_month"; +static char __pyx_k_Timestamp_is_month_end[] = "Timestamp.is_month_end"; +static char __pyx_k_datetime_to_datetime64[] = "datetime_to_datetime64"; +static char __pyx_k_whitespace_replacement[] = "whitespace_replacement"; +static char __pyx_k_LocaleTime___calc_am_pm[] = "LocaleTime.__calc_am_pm"; +static char __pyx_k_LocaleTime___calc_month[] = "LocaleTime.__calc_month"; +static char __pyx_k_Timestamp_is_year_start[] = "Timestamp.is_year_start"; +static char __pyx_k_Timestamp_to_pydatetime[] = "Timestamp.to_pydatetime"; +static char __pyx_k_calc_julian_from_U_or_W[] = "_calc_julian_from_U_or_W"; +static char __pyx_k_LocaleTime__calc_weekday[] = "_LocaleTime__calc_weekday"; +static char __pyx_k_Timestamp_is_month_start[] = "Timestamp.is_month_start"; +static char __pyx_k_Timestamp_is_quarter_end[] = "Timestamp.is_quarter_end"; +static char __pyx_k_Timestamp_to_julian_date[] = "Timestamp.to_julian_date"; +static char __pyx_k_LocaleTime___calc_weekday[] = "LocaleTime.__calc_weekday"; +static char __pyx_k_LocaleTime__calc_timezone[] = "_LocaleTime__calc_timezone"; +static char __pyx_k_Timestamp_stamp_tz_offset[] = "Timestamp('{stamp}'{tz}{offset})"; +static char __pyx_k_Unrecognized_value_type_s[] = "Unrecognized value type: %s"; +static char __pyx_k_Could_not_find_pytz_module[] = "Could not find pytz module"; +static char __pyx_k_LocaleTime___calc_timezone[] = "LocaleTime.__calc_timezone"; +static char __pyx_k_LocaleTime__calc_date_time[] = "_LocaleTime__calc_date_time"; +static char __pyx_k_Timestamp_is_quarter_start[] = "Timestamp.is_quarter_start"; +static char __pyx_k_Unrecognized_period_code_d[] = "Unrecognized period code: %d"; +static char __pyx_k_pandas_tseries_frequencies[] = "pandas.tseries.frequencies"; +static char __pyx_k_unconverted_data_remains_s[] = "unconverted data remains: %s"; +static char __pyx_k_Frequency_conversion_failed[] = "Frequency conversion failed"; +static char __pyx_k_LocaleTime___calc_date_time[] = "LocaleTime.__calc_date_time"; +static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static char __pyx_k_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9[] = "(?P3[0-1]|[1-2]\\d|0[1-9]|[1-9]| [1-9])"; +static char __pyx_k_Timestamp__has_time_component[] = "Timestamp._has_time_component"; +static char __pyx_k_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1[] = "(?P36[0-6]|3[0-5]\\d|[1-2]\\d\\d|0[1-9]\\d|00[1-9]|[1-9]\\d|0[1-9]|[1-9])"; +static char __pyx_k_Unable_to_get_quarter_and_year[] = "Unable to get quarter and year"; +static char __pyx_k_does_string_look_like_datetime[] = "_does_string_look_like_datetime"; +static char __pyx_k_s_is_a_bad_directive_in_format[] = "'%s' is a bad directive in format '%s'"; +static char __pyx_k_Cannot_compare_type_r_with_type[] = "Cannot compare type %r with type %r"; +static char __pyx_k_N_ot_A_T_ime_the_time_equivalen[] = "(N)ot-(A)-(T)ime, the time equivalent of NaN"; +static char __pyx_k_bad_month_number_0_must_be_1_12[] = "bad month number 0; must be 1-12"; +static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/tslib.pyx"; +static char __pyx_k_mixed_datetimes_and_integers_in[] = "mixed datetimes and integers in passed array"; +static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_Array_must_be_all_same_time_zone[] = "Array must be all same time zone"; +static char __pyx_k_Bad_tz_filename_Dateutil_on_pyth[] = "Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all timezone files. Please construct dateutil timezones implicitly by passing a string like \"dateutil/Europe/London\" when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362"; +static char __pyx_k_Cannot_add_integral_value_to_Tim[] = "Cannot add integral value to Timestamp without offset."; +static char __pyx_k_Cannot_compare_tz_naive_and_tz_a[] = "Cannot compare tz-naive and tz-aware timestamps"; +static char __pyx_k_Cannot_convert_tz_naive_Timestam[] = "Cannot convert tz-naive Timestamp, use tz_localize to localize"; +static char __pyx_k_Cannot_infer_dst_time_from_r_try[] = "Cannot infer dst time from %r, try using the 'infer_dst' argument"; +static char __pyx_k_Cannot_infer_dst_time_from_s_ast[] = "Cannot infer dst time from %s asthere are no repeated times"; +static char __pyx_k_Cannot_localize_tz_aware_Timesta[] = "Cannot localize tz-aware Timestamp, use tz_convert for conversions"; +static char __pyx_k_Cannot_mix_tz_aware_with_tz_naiv[] = "Cannot mix tz-aware with tz-naive values"; +static char __pyx_k_Could_not_construct_Timestamp_fr[] = "Could not construct Timestamp from argument %s"; +static char __pyx_k_Custom_business_days_is_not_supp[] = "Custom business days is not supported by %s"; +static char __pyx_k_First_time_before_start_of_DST_i[] = "First time before start of DST info"; +static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_Given_date_string_not_likely_a_d[] = "Given date string not likely a datetime."; +static char __pyx_k_Handle_conversion_from_format_di[] = "Handle conversion from format directives to regexes."; +static char __pyx_k_Invalid_type_for_timedelta_scala[] = "Invalid type for timedelta scalar: %s"; +static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static char __pyx_k_NumPy_1_6_1_business_freq_not_su[] = "NumPy 1.6.1 business freq not supported"; +static char __pyx_k_Out_of_bounds_nanosecond_timesta[] = "Out of bounds nanosecond timestamp: %s"; +static char __pyx_k_Stores_and_handles_locale_specif[] = "Stores and handles locale-specific information related to time.\n\n ATTRIBUTES:\n f_weekday -- full weekday names (7-item list)\n a_weekday -- abbreviated weekday names (7-item list)\n f_month -- full month names (13-item list; dummy value in [0], which\n is added by code)\n a_month -- abbreviated month names (13-item list, dummy value in\n [0], which is added by code)\n am_pm -- AM/PM representation (2-item list)\n LC_date_time -- format string for date/time representation (string)\n LC_date -- format string for date representation (string)\n LC_time -- format string for time representation (string)\n timezone -- daylight- and non-daylight-savings timezone representation\n (2-item list of sets)\n lang -- Language used by instance (2-item tuple)\n "; +static char __pyx_k_There_are_i_dst_switches_when_th[] = "There are %i dst switches when there should only be 1."; +static char __pyx_k_TimeStamp_is_the_pandas_equivale[] = "TimeStamp is the pandas equivalent of python's Datetime\n and is interchangable with it in most cases. It's the type used\n for the entries that make up a DatetimeIndex, and other timeseries\n oriented data structures in pandas.\n "; +static char __pyx_k_Tz_aware_datetime_datetime_canno[] = "Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True"; +static char __pyx_k_Unable_to_convert_to_desired_fre[] = "Unable to convert to desired frequency."; +static char __pyx_k_Warning_discarding_nonzero_nanos[] = "Warning: discarding nonzero nanoseconds"; +static char __pyx_k_locale_changed_during_initializa[] = "locale changed during initialization"; +static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_time_data_r_does_not_match_forma[] = "time data %r does not match format %r"; +static char __pyx_k_unsupported_unit_for_native_time[] = "unsupported unit for native timedelta under this numpy {0}"; +static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_kp_s_0; +static PyObject *__pyx_kp_s_00; +static PyObject *__pyx_kp_s_02d; +static PyObject *__pyx_kp_s_02d_06d; +static PyObject *__pyx_kp_s_03; +static PyObject *__pyx_kp_s_03d; +static PyObject *__pyx_kp_s_06d; +static PyObject *__pyx_kp_s_09d; +static PyObject *__pyx_kp_s_1; +static PyObject *__pyx_kp_s_10; +static PyObject *__pyx_kp_s_11; +static PyObject *__pyx_kp_s_17; +static PyObject *__pyx_kp_s_1999; +static PyObject *__pyx_kp_s_1_6; +static PyObject *__pyx_kp_s_1_7; +static PyObject *__pyx_kp_s_2; +static PyObject *__pyx_kp_s_22; +static PyObject *__pyx_kp_s_2d; +static PyObject *__pyx_kp_s_2d_2d_2d; +static PyObject *__pyx_kp_s_3; +static PyObject *__pyx_kp_s_3d; +static PyObject *__pyx_kp_s_44; +static PyObject *__pyx_kp_s_55; +static PyObject *__pyx_kp_s_6d; +static PyObject *__pyx_kp_s_76; +static PyObject *__pyx_kp_s_99; +static PyObject *__pyx_kp_s_9d; +static PyObject *__pyx_n_s_A; +static PyObject *__pyx_kp_b_AB; +static PyObject *__pyx_kp_s_AB; +static PyObject *__pyx_n_s_AS; +static PyObject *__pyx_kp_s_A_2; +static PyObject *__pyx_n_s_AmbiguousTimeError; +static PyObject *__pyx_kp_s_Array_must_be_all_same_time_zone; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_B; +static PyObject *__pyx_kp_s_B_2; +static PyObject *__pyx_kp_s_Bad_tz_filename_Dateutil_on_pyth; +static PyObject *__pyx_n_s_BaseTzInfo; +static PyObject *__pyx_n_s_C; +static PyObject *__pyx_n_s_CACHE_MAX_SIZE; +static PyObject *__pyx_kp_b_CD; +static PyObject *__pyx_kp_s_CD; +static PyObject *__pyx_kp_s_Cannot_add_integral_value_to_Tim; +static PyObject *__pyx_kp_s_Cannot_compare_type_r_with_type; +static PyObject *__pyx_kp_s_Cannot_compare_tz_naive_and_tz_a; +static PyObject *__pyx_kp_s_Cannot_convert_tz_naive_Timestam; +static PyObject *__pyx_kp_s_Cannot_infer_dst_time_from_r_try; +static PyObject *__pyx_kp_s_Cannot_infer_dst_time_from_s_ast; +static PyObject *__pyx_kp_s_Cannot_localize_tz_aware_Timesta; +static PyObject *__pyx_kp_s_Cannot_mix_tz_aware_with_tz_naiv; +static PyObject *__pyx_kp_s_Could_not_construct_Timestamp_fr; +static PyObject *__pyx_kp_s_Could_not_find_pytz_module; +static PyObject *__pyx_kp_s_Custom_business_days_is_not_supp; +static PyObject *__pyx_n_s_D; +static PyObject *__pyx_n_s_D_RESO; +static PyObject *__pyx_kp_b_EF; +static PyObject *__pyx_kp_s_EF; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_kp_b_F; +static PyObject *__pyx_kp_b_FQ_q; +static PyObject *__pyx_kp_s_Field_s_not_supported; +static PyObject *__pyx_kp_s_First_time_before_start_of_DST_i; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_kp_s_Frequency_conversion_failed; +static PyObject *__pyx_kp_b_GH; +static PyObject *__pyx_kp_s_GH; +static PyObject *__pyx_kp_s_Given_date_string_not_likely_a_d; +static PyObject *__pyx_n_s_H; +static PyObject *__pyx_kp_s_H_2; +static PyObject *__pyx_n_s_H_RESO; +static PyObject *__pyx_kp_s_Handle_conversion_from_format_di; +static PyObject *__pyx_n_s_I; +static PyObject *__pyx_n_s_IGNORECASE; +static PyObject *__pyx_kp_b_IJ; +static PyObject *__pyx_kp_s_IJ; +static PyObject *__pyx_kp_s_I_2; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Invalid_type_for_timedelta_scala; +static PyObject *__pyx_kp_b_KL; +static PyObject *__pyx_kp_s_KL; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_LC_TIME; +static PyObject *__pyx_n_s_LC_date; +static PyObject *__pyx_n_s_LC_date_time; +static PyObject *__pyx_n_s_LC_time; +static PyObject *__pyx_n_s_LocaleTime; +static PyObject *__pyx_n_s_LocaleTime___calc_am_pm; +static PyObject *__pyx_n_s_LocaleTime___calc_date_time; +static PyObject *__pyx_n_s_LocaleTime___calc_month; +static PyObject *__pyx_n_s_LocaleTime___calc_timezone; +static PyObject *__pyx_n_s_LocaleTime___calc_weekday; +static PyObject *__pyx_n_s_LocaleTime___init; +static PyObject *__pyx_n_s_LocaleTime___pad; +static PyObject *__pyx_n_s_LocaleTime__calc_am_pm; +static PyObject *__pyx_n_s_LocaleTime__calc_date_time; +static PyObject *__pyx_n_s_LocaleTime__calc_month; +static PyObject *__pyx_n_s_LocaleTime__calc_timezone; +static PyObject *__pyx_n_s_LocaleTime__calc_weekday; +static PyObject *__pyx_n_s_LocaleTime__pad; +static PyObject *__pyx_n_s_LooseVersion; +static PyObject *__pyx_n_s_M; +static PyObject *__pyx_kp_s_M8_ns; +static PyObject *__pyx_kp_s_M8_s; +static PyObject *__pyx_n_s_MS; +static PyObject *__pyx_n_s_MS_RESO; +static PyObject *__pyx_kp_s_M_2; +static PyObject *__pyx_n_s_NAN; +static PyObject *__pyx_n_s_NAT; +static PyObject *__pyx_kp_s_N_ot_A_T_ime_the_time_equivalen; +static PyObject *__pyx_n_s_NaN; +static PyObject *__pyx_n_s_NaT; +static PyObject *__pyx_n_s_NaTType; +static PyObject *__pyx_n_s_NaTType___hash; +static PyObject *__pyx_n_s_NaTType___int; +static PyObject *__pyx_n_s_NaTType___long; +static PyObject *__pyx_n_s_NaTType___new; +static PyObject *__pyx_n_s_NaTType___reduce; +static PyObject *__pyx_n_s_NaTType___repr; +static PyObject *__pyx_n_s_NaTType___str; +static PyObject *__pyx_n_s_NaTType_toordinal; +static PyObject *__pyx_n_s_NaTType_weekday; +static PyObject *__pyx_n_s_NameError; +static PyObject *__pyx_n_s_NonExistentTimeError; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_NotImplemented; +static PyObject *__pyx_kp_s_NumPy_1_6_1_business_freq_not_su; +static PyObject *__pyx_n_s_OutOfBoundsDatetime; +static PyObject *__pyx_kp_s_Out_of_bounds_nanosecond_timesta; +static PyObject *__pyx_n_s_OverflowError; +static PyObject *__pyx_n_s_P; +static PyObject *__pyx_kp_s_P_H_2_0_3_0_1_d_d; +static PyObject *__pyx_kp_s_P_I_1_0_2_0_1_9_1_9; +static PyObject *__pyx_kp_s_P_M_0_5_d_d; +static PyObject *__pyx_kp_s_P_S_6_0_1_0_5_d_d; +static PyObject *__pyx_kp_s_P_U_5_0_3_0_4_d_d; +static PyObject *__pyx_kp_s_P_Y_d_d_d_d; +static PyObject *__pyx_kp_s_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9; +static PyObject *__pyx_kp_s_P_f_0_9_1_6; +static PyObject *__pyx_kp_s_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1; +static PyObject *__pyx_kp_s_P_m_1_0_2_0_1_9_1_9; +static PyObject *__pyx_kp_s_P_s_s; +static PyObject *__pyx_kp_s_P_w_0_6; +static PyObject *__pyx_kp_s_P_y_d_d; +static PyObject *__pyx_n_s_Period; +static PyObject *__pyx_n_s_QS; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_S; +static PyObject *__pyx_kp_s_S_2; +static PyObject *__pyx_n_s_S_RESO; +static PyObject *__pyx_kp_s_Stores_and_handles_locale_specif; +static PyObject *__pyx_n_s_T; +static PyObject *__pyx_n_s_T_RESO; +static PyObject *__pyx_kp_s_There_are_i_dst_switches_when_th; +static PyObject *__pyx_n_s_TimeRE; +static PyObject *__pyx_n_s_TimeRE___init; +static PyObject *__pyx_n_s_TimeRE___seqToRE; +static PyObject *__pyx_n_s_TimeRE__seqToRE; +static PyObject *__pyx_n_s_TimeRE_cache; +static PyObject *__pyx_n_s_TimeRE_compile; +static PyObject *__pyx_n_s_TimeRE_pattern; +static PyObject *__pyx_kp_s_TimeStamp_is_the_pandas_equivale; +static PyObject *__pyx_n_s_Timestamp; +static PyObject *__pyx_n_s_Timestamp___new; +static PyObject *__pyx_n_s_Timestamp___reduce; +static PyObject *__pyx_n_s_Timestamp___repr; +static PyObject *__pyx_n_s_Timestamp___setstate; +static PyObject *__pyx_n_s_Timestamp__date_repr; +static PyObject *__pyx_n_s_Timestamp__has_time_component; +static PyObject *__pyx_n_s_Timestamp__repr_base; +static PyObject *__pyx_n_s_Timestamp__time_repr; +static PyObject *__pyx_n_s_Timestamp_asm8; +static PyObject *__pyx_n_s_Timestamp_dayofweek; +static PyObject *__pyx_n_s_Timestamp_dayofyear; +static PyObject *__pyx_n_s_Timestamp_freq; +static PyObject *__pyx_n_s_Timestamp_freqstr; +static PyObject *__pyx_n_s_Timestamp_fromordinal; +static PyObject *__pyx_n_s_Timestamp_is_month_end; +static PyObject *__pyx_n_s_Timestamp_is_month_start; +static PyObject *__pyx_n_s_Timestamp_is_quarter_end; +static PyObject *__pyx_n_s_Timestamp_is_quarter_start; +static PyObject *__pyx_n_s_Timestamp_is_year_end; +static PyObject *__pyx_n_s_Timestamp_is_year_start; +static PyObject *__pyx_n_s_Timestamp_isoformat; +static PyObject *__pyx_n_s_Timestamp_now; +static PyObject *__pyx_n_s_Timestamp_quarter; +static PyObject *__pyx_n_s_Timestamp_replace; +static PyObject *__pyx_kp_s_Timestamp_stamp_tz_offset; +static PyObject *__pyx_n_s_Timestamp_to_julian_date; +static PyObject *__pyx_n_s_Timestamp_to_period; +static PyObject *__pyx_n_s_Timestamp_to_pydatetime; +static PyObject *__pyx_n_s_Timestamp_today; +static PyObject *__pyx_n_s_Timestamp_tz; +static PyObject *__pyx_n_s_Timestamp_tz_convert; +static PyObject *__pyx_n_s_Timestamp_tz_localize; +static PyObject *__pyx_n_s_Timestamp_utcnow; +static PyObject *__pyx_n_s_Timestamp_week; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Tz_aware_datetime_datetime_canno; +static PyObject *__pyx_n_s_U; +static PyObject *__pyx_n_s_US_RESO; +static PyObject *__pyx_n_s_UTC; +static PyObject *__pyx_kp_s_U_2; +static PyObject *__pyx_n_s_U_W; +static PyObject *__pyx_kp_s_Unable_to_convert_to_desired_fre; +static PyObject *__pyx_kp_s_Unable_to_get_quarter_and_year; +static PyObject *__pyx_kp_s_Unable_to_parse_s; +static PyObject *__pyx_kp_s_Unknown_freq_d; +static PyObject *__pyx_kp_s_Unrecognized_period_code_d; +static PyObject *__pyx_kp_s_Unrecognized_type_s; +static PyObject *__pyx_kp_s_Unrecognized_value_type_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_W; +static PyObject *__pyx_kp_s_W_2; +static PyObject *__pyx_kp_s_Warning_discarding_nonzero_nanos; +static PyObject *__pyx_kp_s_X; +static PyObject *__pyx_n_s_X_2; +static PyObject *__pyx_n_s_Y; +static PyObject *__pyx_kp_b_Y_2; +static PyObject *__pyx_kp_s_Y_2; +static PyObject *__pyx_kp_b_Y_m; +static PyObject *__pyx_kp_b_Y_m_d; +static PyObject *__pyx_kp_b_Y_m_d_H_00; +static PyObject *__pyx_kp_b_Y_m_d_H_M; +static PyObject *__pyx_kp_b_Y_m_d_H_M_S; +static PyObject *__pyx_kp_b_Y_m_d_H_M_S_l; +static PyObject *__pyx_kp_b_Y_m_d_H_M_S_n; +static PyObject *__pyx_kp_b_Y_m_d_H_M_S_u; +static PyObject *__pyx_kp_s_Z; +static PyObject *__pyx_n_s_Z_2; +static PyObject *__pyx_kp_s_Z_3; +static PyObject *__pyx_kp_s_Z_tz_s; +static PyObject *__pyx_kp_s__112; +static PyObject *__pyx_kp_s__113; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__50; +static PyObject *__pyx_kp_s__51; +static PyObject *__pyx_kp_s__52; +static PyObject *__pyx_kp_s__89; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_kp_s_a_2; +static PyObject *__pyx_n_s_a_idx; +static PyObject *__pyx_n_s_a_month; +static PyObject *__pyx_n_s_a_weekday; +static PyObject *__pyx_n_s_abs; +static PyObject *__pyx_n_s_add; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_all_2; +static PyObject *__pyx_n_s_allocate_lock; +static PyObject *__pyx_n_s_am_pm; +static PyObject *__pyx_n_s_ampm; +static PyObject *__pyx_n_s_any; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_apply; +static PyObject *__pyx_n_s_apply_offset; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_arr; +static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_array_split; +static PyObject *__pyx_n_s_array_strptime; +static PyObject *__pyx_n_s_array_to_datetime; +static PyObject *__pyx_n_s_array_to_timedelta64; +static PyObject *__pyx_n_s_asm8; +static PyObject *__pyx_n_s_astimezone; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_kp_s_b_2; +static PyObject *__pyx_n_s_b_idx; +static PyObject *__pyx_n_s_bad_directive; +static PyObject *__pyx_kp_s_bad_month_number_0_must_be_1_12; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_base1; +static PyObject *__pyx_n_s_base2; +static PyObject *__pyx_n_s_basestring; +static PyObject *__pyx_n_s_both_eq; +static PyObject *__pyx_n_s_both_nat; +static PyObject *__pyx_n_s_boxed; +static PyObject *__pyx_n_s_build_field_sarray; +static PyObject *__pyx_kp_s_c; +static PyObject *__pyx_n_s_c_2; +static PyObject *__pyx_n_s_cache_lock; +static PyObject *__pyx_n_s_calc_am_pm; +static PyObject *__pyx_n_s_calc_date_time; +static PyObject *__pyx_n_s_calc_julian_from_U_or_W; +static PyObject *__pyx_n_s_calc_month; +static PyObject *__pyx_n_s_calc_timezone; +static PyObject *__pyx_n_s_calc_weekday; +static PyObject *__pyx_n_s_calendar; +static PyObject *__pyx_kp_s_cannot_cast_unit_0; +static PyObject *__pyx_n_s_cast_to_nanoseconds; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_code; +static PyObject *__pyx_n_s_coerce; +static PyObject *__pyx_n_s_combine; +static PyObject *__pyx_n_s_compat_NaT; +static PyObject *__pyx_n_s_compile; +static PyObject *__pyx_n_s_convert_to_timedelta; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_current_format; +static PyObject *__pyx_n_s_d; +static PyObject *__pyx_kp_s_d_2; +static PyObject *__pyx_kp_s_d_2d_2d; +static PyObject *__pyx_kp_s_d_2d_2d_2d_2d_2d; +static PyObject *__pyx_n_s_date; +static PyObject *__pyx_n_s_date_normalize; +static PyObject *__pyx_n_s_date_repr; +static PyObject *__pyx_n_s_date_string; +static PyObject *__pyx_n_s_date_time; +static PyObject *__pyx_n_s_dates_normalized; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_datetime64; +static PyObject *__pyx_n_s_datetime_date; +static PyObject *__pyx_n_s_datetime_result; +static PyObject *__pyx_n_s_datetime_time; +static PyObject *__pyx_n_s_datetime_to_datetime64; +static PyObject *__pyx_kp_s_dateutil; +static PyObject *__pyx_n_s_dateutil_2; +static PyObject *__pyx_n_s_dateutil_gettz; +static PyObject *__pyx_n_s_dateutil_tz; +static PyObject *__pyx_n_s_dateutil_tzfile; +static PyObject *__pyx_n_s_dateutil_tzlocal; +static PyObject *__pyx_n_s_dateutil_tzutc; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_day_abbr; +static PyObject *__pyx_n_s_day_name; +static PyObject *__pyx_n_s_day_of_week; +static PyObject *__pyx_n_s_dayfirst; +static PyObject *__pyx_n_s_daylight; +static PyObject *__pyx_n_s_dayofweek; +static PyObject *__pyx_n_s_dayofyear; +static PyObject *__pyx_n_s_days; +static PyObject *__pyx_n_s_days_to_week; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_delta; +static PyObject *__pyx_n_s_delta_to_nanoseconds; +static PyObject *__pyx_n_s_deltas; +static PyObject *__pyx_n_s_diff; +static PyObject *__pyx_n_s_directive; +static PyObject *__pyx_n_s_directive_index; +static PyObject *__pyx_n_s_distutils_version; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_does_string_look_like_datetime; +static PyObject *__pyx_n_s_dom; +static PyObject *__pyx_n_s_dow; +static PyObject *__pyx_n_s_doy; +static PyObject *__pyx_n_s_dst_hours; +static PyObject *__pyx_n_s_dt; +static PyObject *__pyx_n_s_dt64arr_to_periodarr; +static PyObject *__pyx_n_s_dtarr; +static PyObject *__pyx_n_s_dtindex; +static PyObject *__pyx_n_s_dts; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dummy_thread; +static PyObject *__pyx_n_s_dummy_thread_2; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_end_month; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_err; +static PyObject *__pyx_n_s_escape; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_extract_ordinals; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_kp_b_f_2; +static PyObject *__pyx_n_s_f_month; +static PyObject *__pyx_n_s_f_weekday; +static PyObject *__pyx_n_s_fget; +static PyObject *__pyx_n_s_field; +static PyObject *__pyx_n_s_fields; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_filename; +static PyObject *__pyx_n_s_fill; +static PyObject *__pyx_n_s_finfo; +static PyObject *__pyx_n_s_first_weekday; +static PyObject *__pyx_n_s_fix; +static PyObject *__pyx_n_s_flat; +static PyObject *__pyx_n_s_floor; +static PyObject *__pyx_n_s_fmt; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_format_regex; +static PyObject *__pyx_n_s_found; +static PyObject *__pyx_n_s_found_dict; +static PyObject *__pyx_n_s_found_zone; +static PyObject *__pyx_n_s_frac; +static PyObject *__pyx_n_s_fraction; +static PyObject *__pyx_n_s_freq; +static PyObject *__pyx_n_s_freq1; +static PyObject *__pyx_n_s_freq2; +static PyObject *__pyx_n_s_freq_group; +static PyObject *__pyx_n_s_freqstr; +static PyObject *__pyx_n_s_fromordinal; +static PyObject *__pyx_n_s_front; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_date_field; +static PyObject *__pyx_n_s_get_field; +static PyObject *__pyx_n_s_get_period_field; +static PyObject *__pyx_n_s_get_period_field_arr; +static PyObject *__pyx_n_s_get_start_end_field; +static PyObject *__pyx_n_s_get_start_end_field_2; +static PyObject *__pyx_n_s_get_time_micros; +static PyObject *__pyx_n_s_get_timezone; +static PyObject *__pyx_n_s_getitem; +static PyObject *__pyx_n_s_getlang; +static PyObject *__pyx_n_s_getlocale; +static PyObject *__pyx_n_s_gettz; +static PyObject *__pyx_n_s_gmt; +static PyObject *__pyx_n_s_group_key; +static PyObject *__pyx_n_s_groupdict; +static PyObject *__pyx_n_s_grp; +static PyObject *__pyx_n_s_h; +static PyObject *__pyx_n_s_has_saving; +static PyObject *__pyx_n_s_has_time_component; +static PyObject *__pyx_n_s_hash; +static PyObject *__pyx_n_s_have_pytz; +static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_hours; +static PyObject *__pyx_n_s_hstack; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_i4; +static PyObject *__pyx_n_s_i8; +static PyObject *__pyx_n_s_i8_to_pydt; +static PyObject *__pyx_n_s_iNaT; +static PyObject *__pyx_n_s_idx; +static PyObject *__pyx_n_s_idx_shifted; +static PyObject *__pyx_n_s_ignore; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_kp_s_index_out_of_bounds; +static PyObject *__pyx_n_s_inf; +static PyObject *__pyx_n_s_infer_dst; +static PyObject *__pyx_n_s_inferred_tz; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_insert; +static PyObject *__pyx_n_s_int; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_ints_to_pydatetime; +static PyObject *__pyx_n_s_iresult; +static PyObject *__pyx_n_s_is_business; +static PyObject *__pyx_n_s_is_month_end; +static PyObject *__pyx_n_s_is_month_start; +static PyObject *__pyx_n_s_is_quarter_end; +static PyObject *__pyx_n_s_is_quarter_start; +static PyObject *__pyx_n_s_is_timestamp_array; +static PyObject *__pyx_n_s_is_year_end; +static PyObject *__pyx_n_s_is_year_start; +static PyObject *__pyx_n_s_isdst; +static PyObject *__pyx_n_s_isleap; +static PyObject *__pyx_n_s_isleap_prev; +static PyObject *__pyx_n_s_isleapyear; +static PyObject *__pyx_n_s_isoformat; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_iterkeys; +static PyObject *__pyx_n_s_ivalue; +static PyObject *__pyx_n_s_ivalues; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_kp_s_j_2; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_julian; +static PyObject *__pyx_n_s_k; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_kwds; +static PyObject *__pyx_n_s_l; +static PyObject *__pyx_kp_b_l_2; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_lang; +static PyObject *__pyx_n_s_ldom; +static PyObject *__pyx_n_s_left; +static PyObject *__pyx_n_s_len; +static PyObject *__pyx_n_s_loc; +static PyObject *__pyx_n_s_locale; +static PyObject *__pyx_kp_s_locale_changed_during_initializa; +static PyObject *__pyx_n_s_locale_time; +static PyObject *__pyx_n_s_localize; +static PyObject *__pyx_n_s_logical_and; +static PyObject *__pyx_n_s_long; +static PyObject *__pyx_n_s_long_2; +static PyObject *__pyx_n_s_lower; +static PyObject *__pyx_n_s_m; +static PyObject *__pyx_kp_s_m8_0; +static PyObject *__pyx_kp_s_m8_ns; +static PyObject *__pyx_kp_s_m_2; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mask; +static PyObject *__pyx_n_s_match; +static PyObject *__pyx_n_s_max; +static PyObject *__pyx_n_s_maximum; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_micros; +static PyObject *__pyx_n_s_microsecond; +static PyObject *__pyx_n_s_microseconds; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_minutes; +static PyObject *__pyx_kp_s_mixed_datetimes_and_integers_in; +static PyObject *__pyx_n_s_mo_off; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_month_abbr; +static PyObject *__pyx_n_s_month_kw; +static PyObject *__pyx_n_s_month_name; +static PyObject *__pyx_n_s_month_offset; +static PyObject *__pyx_n_s_monthrange; +static PyObject *__pyx_n_s_months; +static PyObject *__pyx_n_s_ms; +static PyObject *__pyx_n_s_mus; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_kp_b_n_2; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_nan; +static PyObject *__pyx_n_s_nanos; +static PyObject *__pyx_n_s_nanosecond; +static PyObject *__pyx_n_s_nat; +static PyObject *__pyx_n_s_nat_strings; +static PyObject *__pyx_n_s_nat_unpickle; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_new_2; +static PyObject *__pyx_n_s_new_tz; +static PyObject *__pyx_n_s_new_values; +static PyObject *__pyx_n_s_no_saving; +static PyObject *__pyx_n_s_nonzero; +static PyObject *__pyx_n_s_normalize; +static PyObject *__pyx_n_s_not_datelike_strings; +static PyObject *__pyx_n_s_now; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_np_NaT; +static PyObject *__pyx_n_s_np_version; +static PyObject *__pyx_n_s_np_version_under1p6; +static PyObject *__pyx_n_s_np_version_under1p7; +static PyObject *__pyx_n_s_ns; +static PyObject *__pyx_n_s_ntrans; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_object_state; +static PyObject *__pyx_n_s_offset; +static PyObject *__pyx_kp_s_offset_0; +static PyObject *__pyx_n_s_old; +static PyObject *__pyx_n_s_one_diff; +static PyObject *__pyx_n_s_ordinal; +static PyObject *__pyx_n_s_ordinals; +static PyObject *__pyx_n_s_oresult; +static PyObject *__pyx_n_s_out; +static PyObject *__pyx_n_s_p; +static PyObject *__pyx_kp_s_p_2; +static PyObject *__pyx_n_s_p_tz_cache_key; +static PyObject *__pyx_n_s_pad; +static PyObject *__pyx_n_s_pandas_compat; +static PyObject *__pyx_n_s_pandas_tseries_frequencies; +static PyObject *__pyx_n_s_pandas_tseries_period; +static PyObject *__pyx_n_s_pandas_tslib; +static PyObject *__pyx_n_s_parse_code; +static PyObject *__pyx_n_s_parse_code_table; +static PyObject *__pyx_n_s_parse_date; +static PyObject *__pyx_n_s_parse_datetime_string; +static PyObject *__pyx_n_s_pattern; +static PyObject *__pyx_n_s_period_asfreq_arr; +static PyObject *__pyx_n_s_period_format; +static PyObject *__pyx_n_s_period_ordinal; +static PyObject *__pyx_n_s_periodarr; +static PyObject *__pyx_n_s_periodarr_to_dt64arr; +static PyObject *__pyx_n_s_pos; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_processed_format; +static PyObject *__pyx_n_s_prop; +static PyObject *__pyx_n_s_property; +static PyObject *__pyx_n_s_ps; +static PyObject *__pyx_n_s_py_dt; +static PyObject *__pyx_n_s_pydt; +static PyObject *__pyx_n_s_pydt_to_i8; +static PyObject *__pyx_n_s_pytz; +static PyObject *__pyx_n_s_pytz_BaseTzInfo; +static PyObject *__pyx_n_s_pytz_tzinfo; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_releasebuffer; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_q; +static PyObject *__pyx_kp_b_q_2; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_quarter; +static PyObject *__pyx_n_s_raise; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_ravel; +static PyObject *__pyx_n_s_re; +static PyObject *__pyx_n_s_re_compile; +static PyObject *__pyx_n_s_re_escape; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_regex; +static PyObject *__pyx_n_s_regex_cache; +static PyObject *__pyx_n_s_regex_chars; +static PyObject *__pyx_n_s_relation; +static PyObject *__pyx_n_s_replace; +static PyObject *__pyx_n_s_replacement_pairs; +static PyObject *__pyx_n_s_repr; +static PyObject *__pyx_n_s_repr_base; +static PyObject *__pyx_n_s_repr_timedelta64; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_result_a; +static PyObject *__pyx_n_s_result_b; +static PyObject *__pyx_n_s_ret; +static PyObject *__pyx_n_s_reverse; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_round; +static PyObject *__pyx_n_s_s; +static PyObject *__pyx_kp_s_s_02d_02d_s; +static PyObject *__pyx_kp_s_s_2; +static PyObject *__pyx_kp_s_s_3; +static PyObject *__pyx_kp_s_s_d_days; +static PyObject *__pyx_kp_s_s_d_days_02d_02d_s; +static PyObject *__pyx_kp_s_s_is_a_bad_directive_in_format; +static PyObject *__pyx_kp_s_s_is_wrong_freq; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_s_2; +static PyObject *__pyx_kp_s_s_s_3; +static PyObject *__pyx_kp_s_s_s_s; +static PyObject *__pyx_n_s_sa_dtype; +static PyObject *__pyx_n_s_searchsorted; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_seconds; +static PyObject *__pyx_n_s_seconds_pretty; +static PyObject *__pyx_n_s_seen_datetime; +static PyObject *__pyx_n_s_seen_integer; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_sep; +static PyObject *__pyx_n_s_seq; +static PyObject *__pyx_n_s_seqToRE; +static PyObject *__pyx_n_s_setitem; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_short; +static PyObject *__pyx_n_s_short_version; +static PyObject *__pyx_n_s_side; +static PyObject *__pyx_n_s_sign; +static PyObject *__pyx_n_s_sign_pretty; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_sort; +static PyObject *__pyx_n_s_sorted; +static PyObject *__pyx_n_s_sp; +static PyObject *__pyx_n_s_squeeze; +static PyObject *__pyx_n_s_stamp; +static PyObject *__pyx_n_s_stamps; +static PyObject *__pyx_n_s_start_month; +static PyObject *__pyx_n_s_startingMonth; +static PyObject *__pyx_n_s_startswith; +static PyObject *__pyx_n_s_state; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_kp_s_stray_in_format_s; +static PyObject *__pyx_n_s_strftime; +static PyObject *__pyx_n_s_string_types; +static PyObject *__pyx_n_s_struct_time; +static PyObject *__pyx_n_s_sub; +static PyObject *__pyx_n_s_sub_2; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_switch_idx; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_sz; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_table; +static PyObject *__pyx_kp_s_tar_gz; +static PyObject *__pyx_n_s_td; +static PyObject *__pyx_n_s_tdata; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_thread; +static PyObject *__pyx_n_s_thread_2; +static PyObject *__pyx_n_s_thread_allocate_lock; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_kp_s_time_data_r_does_not_match_forma; +static PyObject *__pyx_n_s_time_repr; +static PyObject *__pyx_n_s_time_tuple; +static PyObject *__pyx_n_s_timedelta; +static PyObject *__pyx_n_s_timedelta64; +static PyObject *__pyx_kp_s_timedelta64_ns; +static PyObject *__pyx_n_s_timezone; +static PyObject *__pyx_n_s_to_convert; +static PyObject *__pyx_n_s_to_datetime; +static PyObject *__pyx_n_s_to_julian_date; +static PyObject *__pyx_n_s_to_offset; +static PyObject *__pyx_n_s_to_period; +static PyObject *__pyx_n_s_to_pydatetime; +static PyObject *__pyx_n_s_today; +static PyObject *__pyx_n_s_toordinal; +static PyObject *__pyx_n_s_tot_seconds; +static PyObject *__pyx_n_s_total_seconds; +static PyObject *__pyx_n_s_trans; +static PyObject *__pyx_n_s_trans_cache; +static PyObject *__pyx_n_s_trans_grp; +static PyObject *__pyx_n_s_trans_idx; +static PyObject *__pyx_n_s_trans_idx_2; +static PyObject *__pyx_n_s_trans_len; +static PyObject *__pyx_n_s_trans_list; +static PyObject *__pyx_n_s_transition_info; +static PyObject *__pyx_n_s_ts; +static PyObject *__pyx_n_s_ts_2; +static PyObject *__pyx_n_s_ts_base; +static PyObject *__pyx_n_s_ts_input; +static PyObject *__pyx_n_s_tso; +static PyObject *__pyx_n_s_ttinfo_before; +static PyObject *__pyx_n_s_ttinfo_std; +static PyObject *__pyx_n_s_tz; +static PyObject *__pyx_n_s_tz1; +static PyObject *__pyx_n_s_tz2; +static PyObject *__pyx_kp_s_tz_0; +static PyObject *__pyx_n_s_tz_convert; +static PyObject *__pyx_n_s_tz_convert_single; +static PyObject *__pyx_n_s_tz_localize; +static PyObject *__pyx_n_s_tz_localize_to_utc; +static PyObject *__pyx_kp_s_tz_s; +static PyObject *__pyx_n_s_tz_values; +static PyObject *__pyx_n_s_tzfile; +static PyObject *__pyx_n_s_tzinfo; +static PyObject *__pyx_n_s_tzinfos; +static PyObject *__pyx_n_s_tzlocal; +static PyObject *__pyx_n_s_tzname; +static PyObject *__pyx_n_s_tzoffset; +static PyObject *__pyx_n_s_tzset; +static PyObject *__pyx_n_s_tzutc; +static PyObject *__pyx_n_s_u; +static PyObject *__pyx_kp_b_u_2; +static PyObject *__pyx_kp_s_unconverted_data_remains_s; +static PyObject *__pyx_n_s_unique_deltas; +static PyObject *__pyx_n_s_uniques; +static PyObject *__pyx_n_s_unit; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_kp_s_unsupported_unit_for_native_time; +static PyObject *__pyx_n_s_us; +static PyObject *__pyx_n_s_utc; +static PyObject *__pyx_n_s_utc_convert; +static PyObject *__pyx_n_s_utc_date; +static PyObject *__pyx_n_s_utc_dates; +static PyObject *__pyx_n_s_utc_offset_cache; +static PyObject *__pyx_n_s_utc_transition_times; +static PyObject *__pyx_n_s_utcnow; +static PyObject *__pyx_n_s_utcoffset; +static PyObject *__pyx_n_s_utcoffset_2; +static PyObject *__pyx_kp_s_utf_8; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_val; +static PyObject *__pyx_n_s_vals; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_version; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_view; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_kp_s_w_2; +static PyObject *__pyx_n_s_warn; +static PyObject *__pyx_n_s_week; +static PyObject *__pyx_n_s_week_0_length; +static PyObject *__pyx_n_s_week_of_year; +static PyObject *__pyx_n_s_week_of_year_start; +static PyObject *__pyx_n_s_week_starts_Mon; +static PyObject *__pyx_n_s_weekday; +static PyObject *__pyx_n_s_weekofyear; +static PyObject *__pyx_n_s_where; +static PyObject *__pyx_n_s_whitespace_replacement; +static PyObject *__pyx_n_s_woy; +static PyObject *__pyx_kp_s_x; +static PyObject *__pyx_n_s_x_2; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_kp_s_y_2; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_n_s_year2000; +static PyObject *__pyx_n_s_years; +static PyObject *__pyx_kp_s_z; +static PyObject *__pyx_n_s_zero_time; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_n_s_zip; +static PyObject *__pyx_n_s_zone; +static PyObject *__pyx_float_1e6; +static PyObject *__pyx_float_1e9; +static PyObject *__pyx_float_1e_6; +static PyObject *__pyx_float_1e_9; +static PyObject *__pyx_float_24_0; +static PyObject *__pyx_float_60_0; +static PyObject *__pyx_float_1000_0; +static PyObject *__pyx_float_3600_0; +static PyObject *__pyx_float_1721118_5; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_4; +static PyObject *__pyx_int_5; +static PyObject *__pyx_int_6; +static PyObject *__pyx_int_7; +static PyObject *__pyx_int_8; +static PyObject *__pyx_int_9; +static PyObject *__pyx_int_10; +static PyObject *__pyx_int_11; +static PyObject *__pyx_int_12; +static PyObject *__pyx_int_13; +static PyObject *__pyx_int_14; +static PyObject *__pyx_int_15; +static PyObject *__pyx_int_16; +static PyObject *__pyx_int_17; +static PyObject *__pyx_int_18; +static PyObject *__pyx_int_22; +static PyObject *__pyx_int_24; +static PyObject *__pyx_int_31; +static PyObject *__pyx_int_44; +static PyObject *__pyx_int_55; +static PyObject *__pyx_int_59; +static PyObject *__pyx_int_60; +static PyObject *__pyx_int_76; +static PyObject *__pyx_int_90; +static PyObject *__pyx_int_91; +static PyObject *__pyx_int_100; +static PyObject *__pyx_int_120; +static PyObject *__pyx_int_121; +static PyObject *__pyx_int_151; +static PyObject *__pyx_int_152; +static PyObject *__pyx_int_153; +static PyObject *__pyx_int_181; +static PyObject *__pyx_int_182; +static PyObject *__pyx_int_212; +static PyObject *__pyx_int_213; +static PyObject *__pyx_int_243; +static PyObject *__pyx_int_244; +static PyObject *__pyx_int_273; +static PyObject *__pyx_int_274; +static PyObject *__pyx_int_304; +static PyObject *__pyx_int_305; +static PyObject *__pyx_int_334; +static PyObject *__pyx_int_335; +static PyObject *__pyx_int_365; +static PyObject *__pyx_int_366; +static PyObject *__pyx_int_400; +static PyObject *__pyx_int_457; +static PyObject *__pyx_int_1000; +static PyObject *__pyx_int_1999; +static PyObject *__pyx_int_2000; +static PyObject *__pyx_int_3600; +static PyObject *__pyx_int_6000; +static PyObject *__pyx_int_86400; +static PyObject *__pyx_int_1000000; +static PyObject *__pyx_int_1000000000; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_int_neg_6; +static PyObject *__pyx_int_1L; +static PyObject *__pyx_int_1000L; +static PyObject *__pyx_int_1000000L; +static PyObject *__pyx_int_1000000000L; +static PyObject *__pyx_int_60000000000L; +static PyObject *__pyx_int_3600000000000L; +static PyObject *__pyx_int_86400000000000L; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__18; +static PyObject *__pyx_slice__19; +static PyObject *__pyx_slice__33; +static PyObject *__pyx_slice__34; +static PyObject *__pyx_slice__74; +static PyObject *__pyx_slice__75; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__72; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__96; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__98; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_slice__108; +static PyObject *__pyx_slice__109; +static PyObject *__pyx_tuple__100; +static PyObject *__pyx_tuple__101; +static PyObject *__pyx_tuple__102; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__104; +static PyObject *__pyx_tuple__105; +static PyObject *__pyx_tuple__106; +static PyObject *__pyx_tuple__107; +static PyObject *__pyx_tuple__110; +static PyObject *__pyx_tuple__111; +static PyObject *__pyx_tuple__114; +static PyObject *__pyx_tuple__115; +static PyObject *__pyx_tuple__116; +static PyObject *__pyx_tuple__117; +static PyObject *__pyx_tuple__118; +static PyObject *__pyx_tuple__119; +static PyObject *__pyx_tuple__120; +static PyObject *__pyx_tuple__121; +static PyObject *__pyx_tuple__122; +static PyObject *__pyx_tuple__123; +static PyObject *__pyx_tuple__124; +static PyObject *__pyx_tuple__125; +static PyObject *__pyx_tuple__126; +static PyObject *__pyx_tuple__127; +static PyObject *__pyx_tuple__129; +static PyObject *__pyx_tuple__130; +static PyObject *__pyx_tuple__132; +static PyObject *__pyx_tuple__133; +static PyObject *__pyx_tuple__135; +static PyObject *__pyx_tuple__136; +static PyObject *__pyx_tuple__138; +static PyObject *__pyx_tuple__140; +static PyObject *__pyx_tuple__142; +static PyObject *__pyx_tuple__143; +static PyObject *__pyx_tuple__145; +static PyObject *__pyx_tuple__147; +static PyObject *__pyx_tuple__149; +static PyObject *__pyx_tuple__151; +static PyObject *__pyx_tuple__153; +static PyObject *__pyx_tuple__155; +static PyObject *__pyx_tuple__157; +static PyObject *__pyx_tuple__159; +static PyObject *__pyx_tuple__161; +static PyObject *__pyx_tuple__162; +static PyObject *__pyx_tuple__164; +static PyObject *__pyx_tuple__166; +static PyObject *__pyx_tuple__168; +static PyObject *__pyx_tuple__170; +static PyObject *__pyx_tuple__172; +static PyObject *__pyx_tuple__174; +static PyObject *__pyx_tuple__176; +static PyObject *__pyx_tuple__178; +static PyObject *__pyx_tuple__180; +static PyObject *__pyx_tuple__182; +static PyObject *__pyx_tuple__184; +static PyObject *__pyx_tuple__186; +static PyObject *__pyx_tuple__188; +static PyObject *__pyx_tuple__189; +static PyObject *__pyx_tuple__191; +static PyObject *__pyx_tuple__193; +static PyObject *__pyx_tuple__195; +static PyObject *__pyx_tuple__196; +static PyObject *__pyx_tuple__198; +static PyObject *__pyx_tuple__199; +static PyObject *__pyx_tuple__201; +static PyObject *__pyx_tuple__203; +static PyObject *__pyx_tuple__205; +static PyObject *__pyx_tuple__207; +static PyObject *__pyx_tuple__209; +static PyObject *__pyx_tuple__211; +static PyObject *__pyx_tuple__213; +static PyObject *__pyx_tuple__215; +static PyObject *__pyx_tuple__217; +static PyObject *__pyx_tuple__219; +static PyObject *__pyx_tuple__221; +static PyObject *__pyx_tuple__223; +static PyObject *__pyx_tuple__225; +static PyObject *__pyx_tuple__227; +static PyObject *__pyx_tuple__229; +static PyObject *__pyx_tuple__231; +static PyObject *__pyx_tuple__233; +static PyObject *__pyx_tuple__235; +static PyObject *__pyx_tuple__237; +static PyObject *__pyx_tuple__239; +static PyObject *__pyx_tuple__241; +static PyObject *__pyx_tuple__243; +static PyObject *__pyx_tuple__245; +static PyObject *__pyx_tuple__247; +static PyObject *__pyx_tuple__249; +static PyObject *__pyx_tuple__251; +static PyObject *__pyx_tuple__253; +static PyObject *__pyx_tuple__255; +static PyObject *__pyx_tuple__257; +static PyObject *__pyx_tuple__259; +static PyObject *__pyx_tuple__261; +static PyObject *__pyx_tuple__263; +static PyObject *__pyx_tuple__265; +static PyObject *__pyx_tuple__267; +static PyObject *__pyx_tuple__269; +static PyObject *__pyx_tuple__271; +static PyObject *__pyx_tuple__273; +static PyObject *__pyx_tuple__275; +static PyObject *__pyx_tuple__277; +static PyObject *__pyx_tuple__279; +static PyObject *__pyx_tuple__281; +static PyObject *__pyx_tuple__283; +static PyObject *__pyx_tuple__285; +static PyObject *__pyx_tuple__287; +static PyObject *__pyx_tuple__289; +static PyObject *__pyx_tuple__291; +static PyObject *__pyx_tuple__292; +static PyObject *__pyx_tuple__293; +static PyObject *__pyx_tuple__294; +static PyObject *__pyx_tuple__295; +static PyObject *__pyx_tuple__296; +static PyObject *__pyx_tuple__297; +static PyObject *__pyx_tuple__299; +static PyObject *__pyx_tuple__301; +static PyObject *__pyx_tuple__304; +static PyObject *__pyx_tuple__306; +static PyObject *__pyx_tuple__308; +static PyObject *__pyx_tuple__310; +static PyObject *__pyx_tuple__312; +static PyObject *__pyx_tuple__314; +static PyObject *__pyx_tuple__316; +static PyObject *__pyx_tuple__318; +static PyObject *__pyx_tuple__320; +static PyObject *__pyx_tuple__321; +static PyObject *__pyx_tuple__323; +static PyObject *__pyx_tuple__325; +static PyObject *__pyx_tuple__327; +static PyObject *__pyx_codeobj__128; +static PyObject *__pyx_codeobj__131; +static PyObject *__pyx_codeobj__134; +static PyObject *__pyx_codeobj__137; +static PyObject *__pyx_codeobj__139; +static PyObject *__pyx_codeobj__141; +static PyObject *__pyx_codeobj__144; +static PyObject *__pyx_codeobj__146; +static PyObject *__pyx_codeobj__148; +static PyObject *__pyx_codeobj__150; +static PyObject *__pyx_codeobj__152; +static PyObject *__pyx_codeobj__154; +static PyObject *__pyx_codeobj__156; +static PyObject *__pyx_codeobj__158; +static PyObject *__pyx_codeobj__160; +static PyObject *__pyx_codeobj__163; +static PyObject *__pyx_codeobj__165; +static PyObject *__pyx_codeobj__167; +static PyObject *__pyx_codeobj__169; +static PyObject *__pyx_codeobj__171; +static PyObject *__pyx_codeobj__173; +static PyObject *__pyx_codeobj__175; +static PyObject *__pyx_codeobj__177; +static PyObject *__pyx_codeobj__179; +static PyObject *__pyx_codeobj__181; +static PyObject *__pyx_codeobj__183; +static PyObject *__pyx_codeobj__185; +static PyObject *__pyx_codeobj__187; +static PyObject *__pyx_codeobj__190; +static PyObject *__pyx_codeobj__192; +static PyObject *__pyx_codeobj__194; +static PyObject *__pyx_codeobj__197; +static PyObject *__pyx_codeobj__200; +static PyObject *__pyx_codeobj__202; +static PyObject *__pyx_codeobj__204; +static PyObject *__pyx_codeobj__206; +static PyObject *__pyx_codeobj__208; +static PyObject *__pyx_codeobj__210; +static PyObject *__pyx_codeobj__212; +static PyObject *__pyx_codeobj__214; +static PyObject *__pyx_codeobj__216; +static PyObject *__pyx_codeobj__218; +static PyObject *__pyx_codeobj__220; +static PyObject *__pyx_codeobj__222; +static PyObject *__pyx_codeobj__224; +static PyObject *__pyx_codeobj__226; +static PyObject *__pyx_codeobj__228; +static PyObject *__pyx_codeobj__230; +static PyObject *__pyx_codeobj__232; +static PyObject *__pyx_codeobj__234; +static PyObject *__pyx_codeobj__236; +static PyObject *__pyx_codeobj__238; +static PyObject *__pyx_codeobj__240; +static PyObject *__pyx_codeobj__242; +static PyObject *__pyx_codeobj__244; +static PyObject *__pyx_codeobj__246; +static PyObject *__pyx_codeobj__248; +static PyObject *__pyx_codeobj__250; +static PyObject *__pyx_codeobj__252; +static PyObject *__pyx_codeobj__254; +static PyObject *__pyx_codeobj__256; +static PyObject *__pyx_codeobj__258; +static PyObject *__pyx_codeobj__260; +static PyObject *__pyx_codeobj__262; +static PyObject *__pyx_codeobj__264; +static PyObject *__pyx_codeobj__266; +static PyObject *__pyx_codeobj__268; +static PyObject *__pyx_codeobj__270; +static PyObject *__pyx_codeobj__272; +static PyObject *__pyx_codeobj__274; +static PyObject *__pyx_codeobj__276; +static PyObject *__pyx_codeobj__278; +static PyObject *__pyx_codeobj__280; +static PyObject *__pyx_codeobj__282; +static PyObject *__pyx_codeobj__284; +static PyObject *__pyx_codeobj__286; +static PyObject *__pyx_codeobj__288; +static PyObject *__pyx_codeobj__290; +static PyObject *__pyx_codeobj__298; +static PyObject *__pyx_codeobj__300; +static PyObject *__pyx_codeobj__302; +static PyObject *__pyx_codeobj__303; +static PyObject *__pyx_codeobj__305; +static PyObject *__pyx_codeobj__307; +static PyObject *__pyx_codeobj__309; +static PyObject *__pyx_codeobj__311; +static PyObject *__pyx_codeobj__313; +static PyObject *__pyx_codeobj__315; +static PyObject *__pyx_codeobj__317; +static PyObject *__pyx_codeobj__319; +static PyObject *__pyx_codeobj__322; +static PyObject *__pyx_codeobj__324; +static PyObject *__pyx_codeobj__326; +static PyObject *__pyx_codeobj__328; + +/* "pandas/tslib.pyx":503 + * 'week', 'dayofyear'] + * for field in fields: + * prop = property(fget=lambda self: -1) # <<<<<<<<<<<<<< + * setattr(NaTType, field, prop) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_100lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_100lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_6pandas_5tslib_100lambda1, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_100lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6pandas_5tslib_lambda1(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6pandas_5tslib_lambda1(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda1", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":77 + * basestring = str + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_1ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_1ints_to_pydatetime = {__Pyx_NAMESTR("ints_to_pydatetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_1ints_to_pydatetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_1ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ints_to_pydatetime (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ints_to_pydatetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ints_to_pydatetime", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_ints_to_pydatetime(__pyx_self, __pyx_v_arr, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_ints_to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + PyArrayObject *__pyx_v_result = 0; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_trans = NULL; + PyObject *__pyx_v_deltas = NULL; + PyObject *__pyx_v_pos = NULL; + PyObject *__pyx_v_new_tz = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject **__pyx_t_13; + Py_ssize_t __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + Py_ssize_t __pyx_t_19; + int __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + npy_datetime __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ints_to_pydatetime", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":79 + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * ndarray[object] result = np.empty(n, dtype=object) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":81 + * Py_ssize_t i, n = len(arr) + * pandas_datetimestruct dts + * ndarray[object] result = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":83 + * ndarray[object] result = np.empty(n, dtype=object) + * + * if tz is not None: # <<<<<<<<<<<<<< + * if _is_utc(tz): + * for i in range(n): + */ + __pyx_t_7 = (__pyx_v_tz != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":84 + * + * if tz is not None: + * if _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if arr[i] == iNaT: + */ + __pyx_t_8 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":85 + * if tz is not None: + * if _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if arr[i] == iNaT: + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":86 + * if _is_utc(tz): + * for i in range(n): + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":87 + * for i in range(n): + * if arr[i] == iNaT: + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":89 + * result[i] = np.nan + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":90 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":91 + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + * for i in range(n): + */ + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + + /* "pandas/tslib.pyx":90 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + */ + __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_19 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_17); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_17; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + } + __pyx_L7:; + } + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":92 + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if arr[i] == iNaT: + */ + __pyx_t_8 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (!__pyx_t_8) { + __pyx_t_7 = (__pyx_f_6pandas_5tslib__is_fixed_offset(__pyx_v_tz) != 0); + __pyx_t_20 = __pyx_t_7; + } else { + __pyx_t_20 = __pyx_t_8; + } + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":93 + * dts.min, dts.sec, dts.us, tz) + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if arr[i] == iNaT: + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":94 + * elif _is_tzlocal(tz) or _is_fixed_offset(tz): + * for i in range(n): + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_16 = PyObject_RichCompare(__pyx_t_17, __pyx_t_18, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":95 + * for i in range(n): + * if arr[i] == iNaT: + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_nan); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_22 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_18); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_18; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/tslib.pyx":97 + * result[i] = np.nan + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_arr.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":98 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * result[i] = dt + tz.utcoffset(dt) + */ + __pyx_t_18 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/tslib.pyx":99 + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * result[i] = dt + tz.utcoffset(dt) + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":98 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * result[i] = dt + tz.utcoffset(dt) + */ + __pyx_t_2 = PyTuple_New(8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_18 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_15 = 0; + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":100 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * result[i] = dt + tz.utcoffset(dt) # <<<<<<<<<<<<<< + * else: + * trans = _get_transitions(tz) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_dt)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_dt)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_dt)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_dt), __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_24 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L10:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":102 + * result[i] = dt + tz.utcoffset(dt) + * else: + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * for i in range(n): + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_trans = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":103 + * else: + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * for i in range(n): + * + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_deltas = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":104 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * for i in range(n): # <<<<<<<<<<<<<< + * + * if arr[i] == iNaT: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":106 + * for i in range(n): + * + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":107 + * + * if arr[i] == iNaT: + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_26 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_5; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/tslib.pyx":111 + * + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(arr[i], side='right') - 1 # <<<<<<<<<<<<<< + * if _treat_tz_as_pytz(tz): + * # find right representation of dst etc in pytz timezone + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_27 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":112 + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(arr[i], side='right') - 1 + * if _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * # find right representation of dst etc in pytz timezone + * new_tz = tz._tzinfos[tz._transition_info[pos]] + */ + __pyx_t_20 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":114 + * if _treat_tz_as_pytz(tz): + * # find right representation of dst etc in pytz timezone + * new_tz = tz._tzinfos[tz._transition_info[pos]] # <<<<<<<<<<<<<< + * else: + * # no zone-name change for dateutil tzs - dst etc represented in single object. + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_tzinfos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_v_pos); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetItem(__pyx_t_4, __pyx_t_2); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_tz, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/tslib.pyx":117 + * else: + * # no zone-name change for dateutil tzs - dst etc represented in single object. + * new_tz = tz # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_XDECREF_SET(__pyx_v_new_tz, __pyx_v_tz); + } + __pyx_L14:; + + /* "pandas/tslib.pyx":119 + * new_tz = tz + * + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_29 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_29 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":120 + * + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, + */ + pandas_datetime_to_datetimestruct(__pyx_t_29, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":121 + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], + * PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, + * new_tz) + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":122 + * PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, # <<<<<<<<<<<<<< + * new_tz) + * else: + */ + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + + /* "pandas/tslib.pyx":121 + * pandas_datetime_to_datetimestruct(arr[i] + deltas[pos], + * PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, + * new_tz) + */ + __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_new_tz); + PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_v_new_tz); + __Pyx_GIVEREF(__pyx_v_new_tz); + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_15 = 0; + __pyx_t_17 = 0; + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_30 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_16); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_16; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + __pyx_L13:; + } + } + __pyx_L4:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":125 + * new_tz) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if arr[i] == iNaT: + * result[i] = np.nan + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":126 + * else: + * for i in range(n): + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * result[i] = np.nan + * else: + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_17 = PyObject_RichCompare(__pyx_t_16, __pyx_t_18, Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_20) { + + /* "pandas/tslib.pyx":127 + * for i in range(n): + * if arr[i] == iNaT: + * result[i] = np.nan # <<<<<<<<<<<<<< + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nan); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_32 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_18); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_18; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + goto __pyx_L17; + } + /*else*/ { + + /* "pandas/tslib.pyx":129 + * result[i] = np.nan + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_arr.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":130 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us) + * + */ + __pyx_t_18 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/tslib.pyx":131 + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":130 + * else: + * pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts) + * result[i] = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us) + * + */ + __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_18 = 0; + __pyx_t_17 = 0; + __pyx_t_16 = 0; + __pyx_t_15 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_34 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_13); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_13); + *__pyx_t_13 = __pyx_t_2; + __Pyx_GIVEREF(*__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L17:; + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":133 + * dts.min, dts.sec, dts.us) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":77 + * basestring = str + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_trans); + __Pyx_XDECREF(__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pos); + __Pyx_XDECREF(__pyx_v_new_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":136 + * + * + * cdef inline bint _is_tzlocal(object tz): # <<<<<<<<<<<<<< + * return isinstance(tz, _dateutil_tzlocal) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_tzlocal(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_tzlocal", 0); + + /* "pandas/tslib.pyx":137 + * + * cdef inline bint _is_tzlocal(object tz): + * return isinstance(tz, _dateutil_tzlocal) # <<<<<<<<<<<<<< + * + * cdef inline bint _is_fixed_offset(object tz): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_tzlocal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "pandas/tslib.pyx":136 + * + * + * cdef inline bint _is_tzlocal(object tz): # <<<<<<<<<<<<<< + * return isinstance(tz, _dateutil_tzlocal) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("pandas.tslib._is_tzlocal", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":139 + * return isinstance(tz, _dateutil_tzlocal) + * + * cdef inline bint _is_fixed_offset(object tz): # <<<<<<<<<<<<<< + * if _treat_tz_as_dateutil(tz): + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_fixed_offset(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_fixed_offset", 0); + + /* "pandas/tslib.pyx":140 + * + * cdef inline bint _is_fixed_offset(object tz): + * if _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: + * return 1 + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":141 + * cdef inline bint _is_fixed_offset(object tz): + * if _treat_tz_as_dateutil(tz): + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: # <<<<<<<<<<<<<< + * return 1 + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_idx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = ((__pyx_t_3 == 0) != 0); + if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((__pyx_t_3 == 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":142 + * if _treat_tz_as_dateutil(tz): + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: + * return 1 # <<<<<<<<<<<<<< + * else: + * return 0 + */ + __pyx_r = 1; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":144 + * return 1 + * else: + * return 0 # <<<<<<<<<<<<<< + * elif _treat_tz_as_pytz(tz): + * if len(tz._transition_info) == 0 and len(tz._utc_transition_times) == 0: + */ + __pyx_r = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":145 + * else: + * return 0 + * elif _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * if len(tz._transition_info) == 0 and len(tz._utc_transition_times) == 0: + * return 1 + */ + __pyx_t_5 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":146 + * return 0 + * elif _treat_tz_as_pytz(tz): + * if len(tz._transition_info) == 0 and len(tz._utc_transition_times) == 0: # <<<<<<<<<<<<<< + * return 1 + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((__pyx_t_3 == 0) != 0); + if (__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utc_transition_times); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = ((__pyx_t_3 == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":147 + * elif _treat_tz_as_pytz(tz): + * if len(tz._transition_info) == 0 and len(tz._utc_transition_times) == 0: + * return 1 # <<<<<<<<<<<<<< + * else: + * return 0 + */ + __pyx_r = 1; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":149 + * return 1 + * else: + * return 0 # <<<<<<<<<<<<<< + * return 1 + * + */ + __pyx_r = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":150 + * else: + * return 0 + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "pandas/tslib.pyx":139 + * return isinstance(tz, _dateutil_tzlocal) + * + * cdef inline bint _is_fixed_offset(object tz): # <<<<<<<<<<<<<< + * if _treat_tz_as_dateutil(tz): + * if len(tz._trans_idx) == 0 and len(tz._trans_list) == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.tslib._is_fixed_offset", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":165 + * + * @classmethod + * def fromordinal(cls, ordinal, offset=None, tz=None): # <<<<<<<<<<<<<< + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_1fromordinal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_fromordinal[] = " passed an ordinal, translate and convert to a ts\n note: by definition there cannot be any tz info on the ordinal itself "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_1fromordinal = {__Pyx_NAMESTR("fromordinal"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_1fromordinal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_fromordinal)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_1fromordinal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_ordinal = 0; + PyObject *__pyx_v_offset = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fromordinal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_ordinal,&__pyx_n_s_offset,&__pyx_n_s_tz,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_None)); + values[3] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ordinal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fromordinal", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fromordinal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_ordinal = values[1]; + __pyx_v_offset = values[2]; + __pyx_v_tz = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fromordinal", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.fromordinal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_fromordinal(__pyx_self, __pyx_v_cls, __pyx_v_ordinal, __pyx_v_offset, __pyx_v_tz); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_fromordinal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ordinal, PyObject *__pyx_v_offset, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fromordinal", 0); + + /* "pandas/tslib.pyx":168 + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + * return cls(datetime.fromordinal(ordinal),offset=offset,tz=tz) # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_fromordinal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_ordinal); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ordinal); + __Pyx_GIVEREF(__pyx_v_ordinal); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_offset, __pyx_v_offset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":165 + * + * @classmethod + * def fromordinal(cls, ordinal, offset=None, tz=None): # <<<<<<<<<<<<<< + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp.fromordinal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":171 + * + * @classmethod + * def now(cls, tz=None): # <<<<<<<<<<<<<< + * """ compat now with datetime """ + * if isinstance(tz, basestring): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_3now(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_2now[] = " compat now with datetime "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_3now = {__Pyx_NAMESTR("now"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_3now, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_2now)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_3now(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("now (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "now") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("now", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_2now(__pyx_self, __pyx_v_cls, __pyx_v_tz); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_2now(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("now", 0); + __Pyx_INCREF(__pyx_v_tz); + + /* "pandas/tslib.pyx":173 + * def now(cls, tz=None): + * """ compat now with datetime """ + * if isinstance(tz, basestring): # <<<<<<<<<<<<<< + * tz = maybe_get_tz(tz) + * return cls(datetime.now(tz)) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":174 + * """ compat now with datetime """ + * if isinstance(tz, basestring): + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * return cls(datetime.now(tz)) + * + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":175 + * if isinstance(tz, basestring): + * tz = maybe_get_tz(tz) + * return cls(datetime.now(tz)) # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":171 + * + * @classmethod + * def now(cls, tz=None): # <<<<<<<<<<<<<< + * """ compat now with datetime """ + * if isinstance(tz, basestring): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":178 + * + * @classmethod + * def today(cls): # <<<<<<<<<<<<<< + * """ compat today with datetime """ + * return cls(datetime.today()) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_5today(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_4today[] = " compat today with datetime "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_5today = {__Pyx_NAMESTR("today"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_5today, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_4today)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_5today(PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("today (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_4today(__pyx_self, ((PyObject *)__pyx_v_cls)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_4today(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("today", 0); + + /* "pandas/tslib.pyx":180 + * def today(cls): + * """ compat today with datetime """ + * return cls(datetime.today()) # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_today); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":178 + * + * @classmethod + * def today(cls): # <<<<<<<<<<<<<< + * """ compat today with datetime """ + * return cls(datetime.today()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.today", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":183 + * + * @classmethod + * def utcnow(cls): # <<<<<<<<<<<<<< + * return cls.now('UTC') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_7utcnow(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_7utcnow = {__Pyx_NAMESTR("utcnow"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_7utcnow, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_7utcnow(PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("utcnow (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_6utcnow(__pyx_self, ((PyObject *)__pyx_v_cls)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_6utcnow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("utcnow", 0); + + /* "pandas/tslib.pyx":184 + * @classmethod + * def utcnow(cls): + * return cls.now('UTC') # <<<<<<<<<<<<<< + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":183 + * + * @classmethod + * def utcnow(cls): # <<<<<<<<<<<<<< + * return cls.now('UTC') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.utcnow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":186 + * return cls.now('UTC') + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): # <<<<<<<<<<<<<< + * cdef _TSObject ts + * cdef _Timestamp ts_base + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_9__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_9__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_9__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_9__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_ts_input = 0; + PyObject *__pyx_v_offset = 0; + PyObject *__pyx_v_tz = 0; + PyObject *__pyx_v_unit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_ts_input,&__pyx_n_s_offset,&__pyx_n_s_tz,&__pyx_n_s_unit,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_None)); + values[3] = ((PyObject *)((PyObject *)Py_None)); + values[4] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ts_input)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_ts_input = values[1]; + __pyx_v_offset = values[2]; + __pyx_v_tz = values[3]; + __pyx_v_unit = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_8__new__(__pyx_self, __pyx_v_cls, __pyx_v_ts_input, __pyx_v_offset, __pyx_v_tz, __pyx_v_unit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_8__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ts_input, PyObject *__pyx_v_offset, PyObject *__pyx_v_tz, PyObject *__pyx_v_unit) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_ts_base = 0; + PyObject *__pyx_v_to_offset = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + __Pyx_INCREF(__pyx_v_ts_input); + __Pyx_INCREF(__pyx_v_offset); + + /* "pandas/tslib.pyx":190 + * cdef _Timestamp ts_base + * + * if util.is_string_object(ts_input): # <<<<<<<<<<<<<< + * try: + * ts_input = parse_date(ts_input) + */ + __pyx_t_1 = (is_string_object(__pyx_v_ts_input) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":191 + * + * if util.is_string_object(ts_input): + * try: # <<<<<<<<<<<<<< + * ts_input = parse_date(ts_input) + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/tslib.pyx":192 + * if util.is_string_object(ts_input): + * try: + * ts_input = parse_date(ts_input) # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_date); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_ts_input); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts_input); + __Pyx_GIVEREF(__pyx_v_ts_input); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_ts_input, __pyx_t_7); + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":193 + * try: + * ts_input = parse_date(ts_input) + * except Exception: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + PyErr_Restore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L11_try_end:; + } + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":196 + * pass + * + * ts = convert_to_tsobject(ts_input, tz, unit) # <<<<<<<<<<<<<< + * + * if ts.value == NPY_NAT: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_ts_input, __pyx_v_tz, __pyx_v_unit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":198 + * ts = convert_to_tsobject(ts_input, tz, unit) + * + * if ts.value == NPY_NAT: # <<<<<<<<<<<<<< + * return NaT + * + */ + __pyx_t_1 = ((__pyx_v_ts->value == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":199 + * + * if ts.value == NPY_NAT: + * return NaT # <<<<<<<<<<<<<< + * + * if util.is_string_object(offset): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":201 + * return NaT + * + * if util.is_string_object(offset): # <<<<<<<<<<<<<< + * from pandas.tseries.frequencies import to_offset + * offset = to_offset(offset) + */ + __pyx_t_1 = (is_string_object(__pyx_v_offset) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":202 + * + * if util.is_string_object(offset): + * from pandas.tseries.frequencies import to_offset # <<<<<<<<<<<<<< + * offset = to_offset(offset) + * + */ + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_n_s_to_offset); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_to_offset); + __Pyx_GIVEREF(__pyx_n_s_to_offset); + __pyx_t_6 = __Pyx_Import(__pyx_n_s_pandas_tseries_frequencies, __pyx_t_7, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_to_offset); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_to_offset = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":203 + * if util.is_string_object(offset): + * from pandas.tseries.frequencies import to_offset + * offset = to_offset(offset) # <<<<<<<<<<<<<< + * + * # make datetime happy + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_offset); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_offset); + __Pyx_GIVEREF(__pyx_v_offset); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_to_offset, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_offset, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/tslib.pyx":206 + * + * # make datetime happy + * ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month, # <<<<<<<<<<<<<< + * ts.dts.day, ts.dts.hour, ts.dts.min, + * ts.dts.sec, ts.dts.us, ts.tzinfo) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp)), __pyx_n_s_new); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_ts->dts.year); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":207 + * # make datetime happy + * ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month, + * ts.dts.day, ts.dts.hour, ts.dts.min, # <<<<<<<<<<<<<< + * ts.dts.sec, ts.dts.us, ts.tzinfo) + * + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.day); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.hour); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.min); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + + /* "pandas/tslib.pyx":208 + * ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month, + * ts.dts.day, ts.dts.hour, ts.dts.min, + * ts.dts.sec, ts.dts.us, ts.tzinfo) # <<<<<<<<<<<<<< + * + * # fill out rest of data + */ + __pyx_t_12 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.sec); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.us); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + + /* "pandas/tslib.pyx":206 + * + * # make datetime happy + * ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month, # <<<<<<<<<<<<<< + * ts.dts.day, ts.dts.hour, ts.dts.min, + * ts.dts.sec, ts.dts.us, ts.tzinfo) + */ + __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_ts->tzinfo); + PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_v_ts->tzinfo); + __Pyx_GIVEREF(__pyx_v_ts->tzinfo); + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_6pandas_5tslib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts_base = ((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/tslib.pyx":211 + * + * # fill out rest of data + * ts_base.value = ts.value # <<<<<<<<<<<<<< + * ts_base.offset = offset + * ts_base.nanosecond = ts.dts.ps / 1000 + */ + __pyx_t_15 = __pyx_v_ts->value; + __pyx_v_ts_base->value = __pyx_t_15; + + /* "pandas/tslib.pyx":212 + * # fill out rest of data + * ts_base.value = ts.value + * ts_base.offset = offset # <<<<<<<<<<<<<< + * ts_base.nanosecond = ts.dts.ps / 1000 + * + */ + __Pyx_INCREF(__pyx_v_offset); + __Pyx_GIVEREF(__pyx_v_offset); + __Pyx_GOTREF(__pyx_v_ts_base->offset); + __Pyx_DECREF(__pyx_v_ts_base->offset); + __pyx_v_ts_base->offset = __pyx_v_offset; + + /* "pandas/tslib.pyx":213 + * ts_base.value = ts.value + * ts_base.offset = offset + * ts_base.nanosecond = ts.dts.ps / 1000 # <<<<<<<<<<<<<< + * + * return ts_base + */ + __pyx_v_ts_base->nanosecond = __Pyx_div_long(__pyx_v_ts->dts.ps, 1000); + + /* "pandas/tslib.pyx":215 + * ts_base.nanosecond = ts.dts.ps / 1000 + * + * return ts_base # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ts_base)); + __pyx_r = ((PyObject *)__pyx_v_ts_base); + goto __pyx_L0; + + /* "pandas/tslib.pyx":186 + * return cls.now('UTC') + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): # <<<<<<<<<<<<<< + * cdef _TSObject ts + * cdef _Timestamp ts_base + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("pandas.tslib.Timestamp.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XDECREF((PyObject *)__pyx_v_ts_base); + __Pyx_XDECREF(__pyx_v_to_offset); + __Pyx_XDECREF(__pyx_v_ts_input); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":217 + * return ts_base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * stamp = self._repr_base + * zone = None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_11__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_11__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_11__repr__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_11__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_10__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_stamp = NULL; + PyObject *__pyx_v_zone = NULL; + PyObject *__pyx_v_year2000 = NULL; + PyObject *__pyx_v_tz = NULL; + PyObject *__pyx_v_offset = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "pandas/tslib.pyx":218 + * + * def __repr__(self): + * stamp = self._repr_base # <<<<<<<<<<<<<< + * zone = None + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_repr_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_stamp = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":219 + * def __repr__(self): + * stamp = self._repr_base + * zone = None # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_INCREF(Py_None); + __pyx_v_zone = Py_None; + + /* "pandas/tslib.pyx":221 + * zone = None + * + * try: # <<<<<<<<<<<<<< + * stamp += self.strftime('%z') + * if self.tzinfo: + */ + { + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "pandas/tslib.pyx":222 + * + * try: + * stamp += self.strftime('%z') # <<<<<<<<<<<<<< + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_strftime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_stamp, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_stamp, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":223 + * try: + * stamp += self.strftime('%z') + * if self.tzinfo: # <<<<<<<<<<<<<< + * zone = _get_zone(self.tzinfo) + * except ValueError: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":224 + * stamp += self.strftime('%z') + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) # <<<<<<<<<<<<<< + * except ValueError: + * year2000 = self.replace(year=2000) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __pyx_f_6pandas_5tslib__get_zone(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_zone, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L11; + } + __pyx_L11:; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":225 + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + * except ValueError: # <<<<<<<<<<<<<< + * year2000 = self.replace(year=2000) + * stamp += year2000.strftime('%z') + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_7) { + __Pyx_AddTraceback("pandas.tslib.Timestamp.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/tslib.pyx":226 + * zone = _get_zone(self.tzinfo) + * except ValueError: + * year2000 = self.replace(year=2000) # <<<<<<<<<<<<<< + * stamp += year2000.strftime('%z') + * if self.tzinfo: + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_replace); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_year, __pyx_int_2000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_year2000 = __pyx_t_11; + __pyx_t_11 = 0; + + /* "pandas/tslib.pyx":227 + * except ValueError: + * year2000 = self.replace(year=2000) + * stamp += year2000.strftime('%z') # <<<<<<<<<<<<<< + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_year2000, __pyx_n_s_strftime); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_stamp, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_v_stamp, __pyx_t_11); + __pyx_t_11 = 0; + + /* "pandas/tslib.pyx":228 + * year2000 = self.replace(year=2000) + * stamp += year2000.strftime('%z') + * if self.tzinfo: # <<<<<<<<<<<<<< + * zone = _get_zone(self.tzinfo) + * + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":229 + * stamp += year2000.strftime('%z') + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __pyx_f_6pandas_5tslib__get_zone(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_zone, __pyx_t_10); + __pyx_t_10 = 0; + goto __pyx_L14; + } + __pyx_L14:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":231 + * zone = _get_zone(self.tzinfo) + * + * try: # <<<<<<<<<<<<<< + * stamp += zone.strftime(' %%Z') + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + /*try:*/ { + + /* "pandas/tslib.pyx":232 + * + * try: + * stamp += zone.strftime(' %%Z') # <<<<<<<<<<<<<< + * except: + * pass + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_zone, __pyx_n_s_strftime); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_stamp, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_stamp, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L22_try_end; + __pyx_L15_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":233 + * try: + * stamp += zone.strftime(' %%Z') + * except: # <<<<<<<<<<<<<< + * pass + * + */ + /*except:*/ { + PyErr_Restore(0,0,0); + goto __pyx_L16_exception_handled; + } + __pyx_L16_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2); + __pyx_L22_try_end:; + } + + /* "pandas/tslib.pyx":236 + * pass + * + * tz = ", tz='{0}'".format(zone) if zone is not None and not isinstance(zone, tzoffset) else "" # <<<<<<<<<<<<<< + * offset = ", offset='{0}'".format(self.offset.freqstr) if self.offset is not None else "" + * + */ + __pyx_t_6 = (__pyx_v_zone != Py_None); + if ((__pyx_t_6 != 0)) { + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tzoffset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = PyObject_IsInstance(__pyx_v_zone, __pyx_t_1); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0); + __pyx_t_12 = __pyx_t_13; + } else { + __pyx_t_12 = (__pyx_t_6 != 0); + } + if (__pyx_t_12) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_tz_0, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_zone); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_zone); + __Pyx_GIVEREF(__pyx_v_zone); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_t_8 = __pyx_kp_s__5; + } + __pyx_v_tz = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":237 + * + * tz = ", tz='{0}'".format(zone) if zone is not None and not isinstance(zone, tzoffset) else "" + * offset = ", offset='{0}'".format(self.offset.freqstr) if self.offset is not None else "" # <<<<<<<<<<<<<< + * + * return "Timestamp('{stamp}'{tz}{offset})".format(stamp=stamp, tz=tz, offset=offset) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = (__pyx_t_10 != Py_None); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if ((__pyx_t_12 != 0)) { + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_offset_0, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_freqstr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_t_8 = __pyx_kp_s__5; + } + __pyx_v_offset = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":239 + * offset = ", offset='{0}'".format(self.offset.freqstr) if self.offset is not None else "" + * + * return "Timestamp('{stamp}'{tz}{offset})".format(stamp=stamp, tz=tz, offset=offset) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Timestamp_stamp_tz_offset, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stamp, __pyx_v_stamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tz, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_offset, __pyx_v_offset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":217 + * return ts_base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * stamp = self._repr_base + * zone = None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.tslib.Timestamp.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_stamp); + __Pyx_XDECREF(__pyx_v_zone); + __Pyx_XDECREF(__pyx_v_year2000); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":242 + * + * @property + * def _date_repr(self): # <<<<<<<<<<<<<< + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_13_date_repr(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_13_date_repr = {__Pyx_NAMESTR("_date_repr"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_13_date_repr, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_13_date_repr(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_date_repr (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_12_date_repr(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_12_date_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_repr", 0); + + /* "pandas/tslib.pyx":245 + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + * return '%d-%.2d-%.2d' % (self.year, self.month, self.day) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_day); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_d_2d_2d, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":242 + * + * @property + * def _date_repr(self): # <<<<<<<<<<<<<< + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.Timestamp._date_repr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":248 + * + * @property + * def _time_repr(self): # <<<<<<<<<<<<<< + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_15_time_repr(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_15_time_repr = {__Pyx_NAMESTR("_time_repr"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_15_time_repr, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_15_time_repr(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_time_repr (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_14_time_repr(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_14_time_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_nanos = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_time_repr", 0); + + /* "pandas/tslib.pyx":249 + * @property + * def _time_repr(self): + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) # <<<<<<<<<<<<<< + * + * if self.nanosecond != 0: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minute); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_second); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_2d_2d_2d, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":251 + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + * if self.nanosecond != 0: # <<<<<<<<<<<<<< + * nanos = self.nanosecond + 1000 * self.microsecond + * result += '.%.9d' % nanos + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":252 + * + * if self.nanosecond != 0: + * nanos = self.nanosecond + 1000 * self.microsecond # <<<<<<<<<<<<<< + * result += '.%.9d' % nanos + * elif self.microsecond != 0: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Multiply(__pyx_int_1000, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nanos = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":253 + * if self.nanosecond != 0: + * nanos = self.nanosecond + 1000 * self.microsecond + * result += '.%.9d' % nanos # <<<<<<<<<<<<<< + * elif self.microsecond != 0: + * result += '.%.6d' % self.microsecond + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_9d, __pyx_v_nanos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":254 + * nanos = self.nanosecond + 1000 * self.microsecond + * result += '.%.9d' % nanos + * elif self.microsecond != 0: # <<<<<<<<<<<<<< + * result += '.%.6d' % self.microsecond + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":255 + * result += '.%.9d' % nanos + * elif self.microsecond != 0: + * result += '.%.6d' % self.microsecond # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_6d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":257 + * result += '.%.6d' % self.microsecond + * + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":248 + * + * @property + * def _time_repr(self): # <<<<<<<<<<<<<< + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.Timestamp._time_repr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_nanos); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":260 + * + * @property + * def _repr_base(self): # <<<<<<<<<<<<<< + * return '%s %s' % (self._date_repr, self._time_repr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_17_repr_base(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_17_repr_base = {__Pyx_NAMESTR("_repr_base"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_17_repr_base, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_17_repr_base(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_repr_base (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_16_repr_base(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_16_repr_base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_repr_base", 0); + + /* "pandas/tslib.pyx":261 + * @property + * def _repr_base(self): + * return '%s %s' % (self._date_repr, self._time_repr) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_date_repr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_time_repr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":260 + * + * @property + * def _repr_base(self): # <<<<<<<<<<<<<< + * return '%s %s' % (self._date_repr, self._time_repr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp._repr_base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":264 + * + * @property + * def tz(self): # <<<<<<<<<<<<<< + * """ + * Alias for tzinfo + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_19tz(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_18tz[] = "\n Alias for tzinfo\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_19tz = {__Pyx_NAMESTR("tz"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_19tz, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_18tz)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_19tz(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_18tz(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_18tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz", 0); + + /* "pandas/tslib.pyx":268 + * Alias for tzinfo + * """ + * return self.tzinfo # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":264 + * + * @property + * def tz(self): # <<<<<<<<<<<<<< + * """ + * Alias for tzinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":271 + * + * @property + * def freq(self): # <<<<<<<<<<<<<< + * return self.offset + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_21freq(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_21freq = {__Pyx_NAMESTR("freq"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_21freq, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_21freq(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("freq (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_20freq(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_20freq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("freq", 0); + + /* "pandas/tslib.pyx":272 + * @property + * def freq(self): + * return self.offset # <<<<<<<<<<<<<< + * + * def __setstate__(self, state): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":271 + * + * @property + * def freq(self): # <<<<<<<<<<<<<< + * return self.offset + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.Timestamp.freq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":274 + * return self.offset + * + * def __setstate__(self, state): # <<<<<<<<<<<<<< + * self.value = state[0] + * self.offset = state[1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_23__setstate__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_23__setstate__ = {__Pyx_NAMESTR("__setstate__"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_23__setstate__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_23__setstate__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_state,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setstate__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_state = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_22__setstate__(__pyx_self, __pyx_v_self, __pyx_v_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_22__setstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate__", 0); + + /* "pandas/tslib.pyx":275 + * + * def __setstate__(self, state): + * self.value = state[0] # <<<<<<<<<<<<<< + * self.offset = state[1] + * self.tzinfo = state[2] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":276 + * def __setstate__(self, state): + * self.value = state[0] + * self.offset = state[1] # <<<<<<<<<<<<<< + * self.tzinfo = state[2] + * + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":277 + * self.value = state[0] + * self.offset = state[1] + * self.tzinfo = state[2] # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":274 + * return self.offset + * + * def __setstate__(self, state): # <<<<<<<<<<<<<< + * self.value = state[0] + * self.offset = state[1] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.Timestamp.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":279 + * self.tzinfo = state[2] + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_25__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_25__reduce__ = {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_25__reduce__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_25__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_24__reduce__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_24__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_object_state = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "pandas/tslib.pyx":280 + * + * def __reduce__(self): + * object_state = self.value, self.offset, self.tzinfo # <<<<<<<<<<<<<< + * return (Timestamp, object_state) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_v_object_state = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":281 + * def __reduce__(self): + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) # <<<<<<<<<<<<<< + * + * def to_period(self, freq=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_object_state); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_object_state); + __Pyx_GIVEREF(__pyx_v_object_state); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":279 + * self.tzinfo = state[2] + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.Timestamp.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_object_state); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":283 + * return (Timestamp, object_state) + * + * def to_period(self, freq=None): # <<<<<<<<<<<<<< + * """ + * Return an period of which this timestamp is an observation. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_27to_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_26to_period[] = "\n Return an period of which this timestamp is an observation.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_27to_period = {__Pyx_NAMESTR("to_period"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_27to_period, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_26to_period)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_27to_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_freq = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_period (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_freq,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_period") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_freq = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("to_period", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_26to_period(__pyx_self, __pyx_v_self, __pyx_v_freq); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_26to_period(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_freq) { + PyObject *__pyx_v_Period = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_period", 0); + __Pyx_INCREF(__pyx_v_freq); + + /* "pandas/tslib.pyx":287 + * Return an period of which this timestamp is an observation. + * """ + * from pandas.tseries.period import Period # <<<<<<<<<<<<<< + * + * if freq is None: + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Period); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Period); + __Pyx_GIVEREF(__pyx_n_s_Period); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas_tseries_period, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Period); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_Period = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":289 + * from pandas.tseries.period import Period + * + * if freq is None: # <<<<<<<<<<<<<< + * freq = self.freq + * + */ + __pyx_t_3 = (__pyx_v_freq == Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":290 + * + * if freq is None: + * freq = self.freq # <<<<<<<<<<<<<< + * + * return Period(self, freq=freq) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_freq, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":292 + * freq = self.freq + * + * return Period(self, freq=freq) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_freq, __pyx_v_freq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_Period, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":283 + * return (Timestamp, object_state) + * + * def to_period(self, freq=None): # <<<<<<<<<<<<<< + * """ + * Return an period of which this timestamp is an observation. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Period); + __Pyx_XDECREF(__pyx_v_freq); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":295 + * + * @property + * def dayofweek(self): # <<<<<<<<<<<<<< + * return self.weekday() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_29dayofweek(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_29dayofweek = {__Pyx_NAMESTR("dayofweek"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_29dayofweek, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_29dayofweek(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dayofweek (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_28dayofweek(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_28dayofweek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dayofweek", 0); + + /* "pandas/tslib.pyx":296 + * @property + * def dayofweek(self): + * return self.weekday() # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_weekday); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":295 + * + * @property + * def dayofweek(self): # <<<<<<<<<<<<<< + * return self.weekday() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.dayofweek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":299 + * + * @property + * def dayofyear(self): # <<<<<<<<<<<<<< + * return self._get_field('doy') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_31dayofyear(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_31dayofyear = {__Pyx_NAMESTR("dayofyear"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_31dayofyear, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_31dayofyear(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dayofyear (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_30dayofyear(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_30dayofyear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dayofyear", 0); + + /* "pandas/tslib.pyx":300 + * @property + * def dayofyear(self): + * return self._get_field('doy') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":299 + * + * @property + * def dayofyear(self): # <<<<<<<<<<<<<< + * return self._get_field('doy') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.dayofyear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":303 + * + * @property + * def week(self): # <<<<<<<<<<<<<< + * return self._get_field('woy') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_33week(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_33week = {__Pyx_NAMESTR("week"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_33week, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_33week(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("week (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_32week(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_32week(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("week", 0); + + /* "pandas/tslib.pyx":304 + * @property + * def week(self): + * return self._get_field('woy') # <<<<<<<<<<<<<< + * + * weekofyear = week + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":303 + * + * @property + * def week(self): # <<<<<<<<<<<<<< + * return self._get_field('woy') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.week", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":309 + * + * @property + * def quarter(self): # <<<<<<<<<<<<<< + * return self._get_field('q') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_35quarter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_35quarter = {__Pyx_NAMESTR("quarter"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_35quarter, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_35quarter(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("quarter (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_34quarter(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_34quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("quarter", 0); + + /* "pandas/tslib.pyx":310 + * @property + * def quarter(self): + * return self._get_field('q') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":309 + * + * @property + * def quarter(self): # <<<<<<<<<<<<<< + * return self._get_field('q') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.quarter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":313 + * + * @property + * def freqstr(self): # <<<<<<<<<<<<<< + * return getattr(self.offset, 'freqstr', self.offset) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_37freqstr(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_37freqstr = {__Pyx_NAMESTR("freqstr"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_37freqstr, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_37freqstr(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("freqstr (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_36freqstr(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_36freqstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("freqstr", 0); + + /* "pandas/tslib.pyx":314 + * @property + * def freqstr(self): + * return getattr(self.offset, 'freqstr', self.offset) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_freqstr, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":313 + * + * @property + * def freqstr(self): # <<<<<<<<<<<<<< + * return getattr(self.offset, 'freqstr', self.offset) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp.freqstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":317 + * + * @property + * def asm8(self): # <<<<<<<<<<<<<< + * return np.int64(self.value).view('M8[ns]') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_39asm8(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_39asm8 = {__Pyx_NAMESTR("asm8"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_39asm8, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_39asm8(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("asm8 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_38asm8(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_38asm8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("asm8", 0); + + /* "pandas/tslib.pyx":318 + * @property + * def asm8(self): + * return np.int64(self.value).view('M8[ns]') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":317 + * + * @property + * def asm8(self): # <<<<<<<<<<<<<< + * return np.int64(self.value).view('M8[ns]') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp.asm8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":321 + * + * @property + * def is_month_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_start') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_41is_month_start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_41is_month_start = {__Pyx_NAMESTR("is_month_start"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_41is_month_start, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_41is_month_start(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_month_start (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_40is_month_start(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_40is_month_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_month_start", 0); + + /* "pandas/tslib.pyx":322 + * @property + * def is_month_start(self): + * return self._get_start_end_field('is_month_start') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":321 + * + * @property + * def is_month_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_start') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_month_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":325 + * + * @property + * def is_month_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_end') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_43is_month_end(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_43is_month_end = {__Pyx_NAMESTR("is_month_end"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_43is_month_end, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_43is_month_end(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_month_end (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_42is_month_end(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_42is_month_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_month_end", 0); + + /* "pandas/tslib.pyx":326 + * @property + * def is_month_end(self): + * return self._get_start_end_field('is_month_end') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":325 + * + * @property + * def is_month_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_end') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_month_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":329 + * + * @property + * def is_quarter_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_start') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_45is_quarter_start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_45is_quarter_start = {__Pyx_NAMESTR("is_quarter_start"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_45is_quarter_start, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_45is_quarter_start(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_quarter_start (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_44is_quarter_start(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_44is_quarter_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_quarter_start", 0); + + /* "pandas/tslib.pyx":330 + * @property + * def is_quarter_start(self): + * return self._get_start_end_field('is_quarter_start') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":329 + * + * @property + * def is_quarter_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_start') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_quarter_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":333 + * + * @property + * def is_quarter_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_end') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_47is_quarter_end(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_47is_quarter_end = {__Pyx_NAMESTR("is_quarter_end"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_47is_quarter_end, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_47is_quarter_end(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_quarter_end (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_46is_quarter_end(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_46is_quarter_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_quarter_end", 0); + + /* "pandas/tslib.pyx":334 + * @property + * def is_quarter_end(self): + * return self._get_start_end_field('is_quarter_end') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":333 + * + * @property + * def is_quarter_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_end') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_quarter_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":337 + * + * @property + * def is_year_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_start') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_49is_year_start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_49is_year_start = {__Pyx_NAMESTR("is_year_start"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_49is_year_start, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_49is_year_start(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_year_start (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_48is_year_start(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_48is_year_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_year_start", 0); + + /* "pandas/tslib.pyx":338 + * @property + * def is_year_start(self): + * return self._get_start_end_field('is_year_start') # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":337 + * + * @property + * def is_year_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_start') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_year_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":341 + * + * @property + * def is_year_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_end') + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_51is_year_end(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_51is_year_end = {__Pyx_NAMESTR("is_year_end"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_51is_year_end, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_51is_year_end(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_year_end (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_50is_year_end(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_50is_year_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_year_end", 0); + + /* "pandas/tslib.pyx":342 + * @property + * def is_year_end(self): + * return self._get_start_end_field('is_year_end') # <<<<<<<<<<<<<< + * + * def tz_localize(self, tz, infer_dst=False): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":341 + * + * @property + * def is_year_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_end') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.Timestamp.is_year_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":344 + * return self._get_start_end_field('is_year_end') + * + * def tz_localize(self, tz, infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Convert naive Timestamp to local time zone + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_53tz_localize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_52tz_localize[] = "\n Convert naive Timestamp to local time zone\n\n Parameters\n ----------\n tz : pytz.timezone or dateutil.tz.tzfile\n infer_dst : boolean, default False\n Attempt to infer fall dst-transition hours based on order\n\n Returns\n -------\n localized : Timestamp\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_53tz_localize = {__Pyx_NAMESTR("tz_localize"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_53tz_localize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_52tz_localize)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_53tz_localize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_tz = 0; + PyObject *__pyx_v_infer_dst = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_localize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_tz,&__pyx_n_s_infer_dst,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_localize", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infer_dst); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_localize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_tz = values[1]; + __pyx_v_infer_dst = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_localize", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_52tz_localize(__pyx_self, __pyx_v_self, __pyx_v_tz, __pyx_v_infer_dst); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_52tz_localize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz, PyObject *__pyx_v_infer_dst) { + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_localize", 0); + __Pyx_INCREF(__pyx_v_tz); + + /* "pandas/tslib.pyx":358 + * localized : Timestamp + * """ + * if self.tzinfo is None: # <<<<<<<<<<<<<< + * # tz naive, localize + * tz = maybe_get_tz(tz) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":360 + * if self.tzinfo is None: + * # tz naive, localize + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * value = tz_localize_to_utc(np.array([self.value]), tz, + * infer_dst=infer_dst)[0] + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":361 + * # tz naive, localize + * tz = maybe_get_tz(tz) + * value = tz_localize_to_utc(np.array([self.value]), tz, # <<<<<<<<<<<<<< + * infer_dst=infer_dst)[0] + * return Timestamp(value, tz=tz) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tz_localize_to_utc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/tslib.pyx":362 + * tz = maybe_get_tz(tz) + * value = tz_localize_to_utc(np.array([self.value]), tz, + * infer_dst=infer_dst)[0] # <<<<<<<<<<<<<< + * return Timestamp(value, tz=tz) + * else: + */ + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_infer_dst, __pyx_v_infer_dst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":361 + * # tz naive, localize + * tz = maybe_get_tz(tz) + * value = tz_localize_to_utc(np.array([self.value]), tz, # <<<<<<<<<<<<<< + * infer_dst=infer_dst)[0] + * return Timestamp(value, tz=tz) + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":362 + * tz = maybe_get_tz(tz) + * value = tz_localize_to_utc(np.array([self.value]), tz, + * infer_dst=infer_dst)[0] # <<<<<<<<<<<<<< + * return Timestamp(value, tz=tz) + * else: + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_value = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":363 + * value = tz_localize_to_utc(np.array([self.value]), tz, + * infer_dst=infer_dst)[0] + * return Timestamp(value, tz=tz) # <<<<<<<<<<<<<< + * else: + * raise Exception('Cannot localize tz-aware Timestamp, use ' + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tz, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":365 + * return Timestamp(value, tz=tz) + * else: + * raise Exception('Cannot localize tz-aware Timestamp, use ' # <<<<<<<<<<<<<< + * 'tz_convert for conversions') + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":344 + * return self._get_start_end_field('is_year_end') + * + * def tz_localize(self, tz, infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Convert naive Timestamp to local time zone + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":368 + * 'tz_convert for conversions') + * + * def tz_convert(self, tz): # <<<<<<<<<<<<<< + * """ + * Convert Timestamp to another time zone or localize to requested time + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_55tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_54tz_convert[] = "\n Convert Timestamp to another time zone or localize to requested time\n zone\n\n Parameters\n ----------\n tz : pytz.timezone or dateutil.tz.tzfile\n\n Returns\n -------\n converted : Timestamp\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_55tz_convert = {__Pyx_NAMESTR("tz_convert"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_55tz_convert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_54tz_convert)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_55tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_convert (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_convert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_54tz_convert(__pyx_self, __pyx_v_self, __pyx_v_tz); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_54tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_convert", 0); + + /* "pandas/tslib.pyx":381 + * converted : Timestamp + * """ + * if self.tzinfo is None: # <<<<<<<<<<<<<< + * # tz naive, use tz_localize + * raise Exception('Cannot convert tz-naive Timestamp, use ' + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":383 + * if self.tzinfo is None: + * # tz naive, use tz_localize + * raise Exception('Cannot convert tz-naive Timestamp, use ' # <<<<<<<<<<<<<< + * 'tz_localize to localize') + * else: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/tslib.pyx":387 + * else: + * # Same UTC timestamp, different time zone + * return Timestamp(self.value, tz=tz) # <<<<<<<<<<<<<< + * + * astimezone = tz_convert + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tz, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":368 + * 'tz_convert for conversions') + * + * def tz_convert(self, tz): # <<<<<<<<<<<<<< + * """ + * Convert Timestamp to another time zone or localize to requested time + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.Timestamp.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":391 + * astimezone = tz_convert + * + * def replace(self, **kwds): # <<<<<<<<<<<<<< + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_57replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_57replace = {__Pyx_NAMESTR("replace"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_57replace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_57replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_kwds = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("replace (wrapper)", 0); + __pyx_v_kwds = PyDict_New(); if (unlikely(!__pyx_v_kwds)) return NULL; + __Pyx_GOTREF(__pyx_v_kwds); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwds, values, pos_args, "replace") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("replace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0; + __Pyx_AddTraceback("pandas.tslib.Timestamp.replace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_56replace(__pyx_self, __pyx_v_self, __pyx_v_kwds); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_kwds); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_56replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwds) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("replace", 0); + + /* "pandas/tslib.pyx":392 + * + * def replace(self, **kwds): + * return Timestamp(datetime.replace(self, **kwds), # <<<<<<<<<<<<<< + * offset=self.offset) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_4 = __pyx_v_kwds; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":393 + * def replace(self, **kwds): + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) # <<<<<<<<<<<<<< + * + * def to_pydatetime(self, warn=True): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_offset, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":392 + * + * def replace(self, **kwds): + * return Timestamp(datetime.replace(self, **kwds), # <<<<<<<<<<<<<< + * offset=self.offset) + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":391 + * astimezone = tz_convert + * + * def replace(self, **kwds): # <<<<<<<<<<<<<< + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp.replace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":395 + * offset=self.offset) + * + * def to_pydatetime(self, warn=True): # <<<<<<<<<<<<<< + * """ + * If warn=True, issue warning if nanoseconds is nonzero + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_59to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_58to_pydatetime[] = "\n If warn=True, issue warning if nanoseconds is nonzero\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_59to_pydatetime = {__Pyx_NAMESTR("to_pydatetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_59to_pydatetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_58to_pydatetime)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_59to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_warn = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_pydatetime (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_warn,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_True)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_warn); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_pydatetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_warn = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("to_pydatetime", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_58to_pydatetime(__pyx_self, __pyx_v_self, __pyx_v_warn); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_58to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_warn) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_pydatetime", 0); + + /* "pandas/tslib.pyx":403 + * _TSObject ts + * + * if self.nanosecond != 0 and warn: # <<<<<<<<<<<<<< + * print 'Warning: discarding nonzero nanoseconds' + * ts = convert_to_tsobject(self, self.tzinfo, None) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_warn); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_3; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":404 + * + * if self.nanosecond != 0 and warn: + * print 'Warning: discarding nonzero nanoseconds' # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(self, self.tzinfo, None) + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Warning_discarding_nonzero_nanos) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":405 + * if self.nanosecond != 0 and warn: + * print 'Warning: discarding nonzero nanoseconds' + * ts = convert_to_tsobject(self, self.tzinfo, None) # <<<<<<<<<<<<<< + * + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_self, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":407 + * ts = convert_to_tsobject(self, self.tzinfo, None) + * + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, # <<<<<<<<<<<<<< + * ts.dts.hour, ts.dts.min, ts.dts.sec, + * ts.dts.us, ts.tzinfo) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_ts->dts.year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/tslib.pyx":408 + * + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, + * ts.dts.hour, ts.dts.min, ts.dts.sec, # <<<<<<<<<<<<<< + * ts.dts.us, ts.tzinfo) + * + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.hour); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.min); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.sec); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":409 + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, + * ts.dts.hour, ts.dts.min, ts.dts.sec, + * ts.dts.us, ts.tzinfo) # <<<<<<<<<<<<<< + * + * def isoformat(self, sep='T'): + */ + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_ts->dts.us); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + + /* "pandas/tslib.pyx":407 + * ts = convert_to_tsobject(self, self.tzinfo, None) + * + * return datetime(ts.dts.year, ts.dts.month, ts.dts.day, # <<<<<<<<<<<<<< + * ts.dts.hour, ts.dts.min, ts.dts.sec, + * ts.dts.us, ts.tzinfo) + */ + __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_ts->tzinfo); + PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_v_ts->tzinfo); + __Pyx_GIVEREF(__pyx_v_ts->tzinfo); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":395 + * offset=self.offset) + * + * def to_pydatetime(self, warn=True): # <<<<<<<<<<<<<< + * """ + * If warn=True, issue warning if nanoseconds is nonzero + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":411 + * ts.dts.us, ts.tzinfo) + * + * def isoformat(self, sep='T'): # <<<<<<<<<<<<<< + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_61isoformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_61isoformat = {__Pyx_NAMESTR("isoformat"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_61isoformat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_61isoformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_sep = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isoformat (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_sep,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_n_s_T)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sep); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isoformat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_sep = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("isoformat", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.Timestamp.isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_60isoformat(__pyx_self, __pyx_v_self, __pyx_v_sep); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_60isoformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_sep) { + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_base1 = NULL; + PyObject *__pyx_v_base2 = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isoformat", 0); + + /* "pandas/tslib.pyx":412 + * + * def isoformat(self, sep='T'): + * base = super(_Timestamp, self).isoformat(sep=sep) # <<<<<<<<<<<<<< + * if self.nanosecond == 0: + * return base + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isoformat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sep, __pyx_v_sep) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_base = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":413 + * def isoformat(self, sep='T'): + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: # <<<<<<<<<<<<<< + * return base + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":414 + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + * return base # <<<<<<<<<<<<<< + * + * if self.tzinfo is not None: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_base); + __pyx_r = __pyx_v_base; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":416 + * return base + * + * if self.tzinfo is not None: # <<<<<<<<<<<<<< + * base1, base2 = base[:-6], base[-6:] + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":417 + * + * if self.tzinfo is not None: + * base1, base2 = base[:-6], base[-6:] # <<<<<<<<<<<<<< + * else: + * base1, base2 = base, "" + */ + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_base, 0, -6, NULL, NULL, &__pyx_slice__18, 0, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_base, -6, 0, NULL, NULL, &__pyx_slice__19, 1, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_base1 = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_base2 = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":419 + * base1, base2 = base[:-6], base[-6:] + * else: + * base1, base2 = base, "" # <<<<<<<<<<<<<< + * + * if self.microsecond != 0: + */ + __pyx_t_3 = __pyx_v_base; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_kp_s__5; + __Pyx_INCREF(__pyx_t_2); + __pyx_v_base1 = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_base2 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":421 + * base1, base2 = base, "" + * + * if self.microsecond != 0: # <<<<<<<<<<<<<< + * base1 += "%.3d" % self.nanosecond + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":422 + * + * if self.microsecond != 0: + * base1 += "%.3d" % self.nanosecond # <<<<<<<<<<<<<< + * else: + * base1 += ".%.9d" % self.nanosecond + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_3d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_base1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_base1, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":424 + * base1 += "%.3d" % self.nanosecond + * else: + * base1 += ".%.9d" % self.nanosecond # <<<<<<<<<<<<<< + * + * return base1 + base2 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_9d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_base1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_base1, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":426 + * base1 += ".%.9d" % self.nanosecond + * + * return base1 + base2 # <<<<<<<<<<<<<< + * + * def _has_time_component(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyNumber_Add(__pyx_v_base1, __pyx_v_base2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":411 + * ts.dts.us, ts.tzinfo) + * + * def isoformat(self, sep='T'): # <<<<<<<<<<<<<< + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.Timestamp.isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_base1); + __Pyx_XDECREF(__pyx_v_base2); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":428 + * return base1 + base2 + * + * def _has_time_component(self): # <<<<<<<<<<<<<< + * """ + * Returns if the Timestamp has a time component + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_63_has_time_component(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_62_has_time_component[] = "\n Returns if the Timestamp has a time component\n in addition to the date part\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_63_has_time_component = {__Pyx_NAMESTR("_has_time_component"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_63_has_time_component, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_62_has_time_component)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_63_has_time_component(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_has_time_component (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_62_has_time_component(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_62_has_time_component(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_has_time_component", 0); + + /* "pandas/tslib.pyx":433 + * in addition to the date part + * """ + * return (self.time() != _zero_time # <<<<<<<<<<<<<< + * or self.tzinfo is not None + * or self.nanosecond != 0) + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/tslib.pyx":434 + * """ + * return (self.time() != _zero_time + * or self.tzinfo is not None # <<<<<<<<<<<<<< + * or self.nanosecond != 0) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/tslib.pyx":433 + * in addition to the date part + * """ + * return (self.time() != _zero_time # <<<<<<<<<<<<<< + * or self.tzinfo is not None + * or self.nanosecond != 0) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":434 + * """ + * return (self.time() != _zero_time + * or self.tzinfo is not None # <<<<<<<<<<<<<< + * or self.nanosecond != 0) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_zero_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":435 + * return (self.time() != _zero_time + * or self.tzinfo is not None + * or self.nanosecond != 0) # <<<<<<<<<<<<<< + * + * def to_julian_date(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/tslib.pyx":434 + * """ + * return (self.time() != _zero_time + * or self.tzinfo is not None # <<<<<<<<<<<<<< + * or self.nanosecond != 0) + * + */ + __pyx_t_4 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":435 + * return (self.time() != _zero_time + * or self.tzinfo is not None + * or self.nanosecond != 0) # <<<<<<<<<<<<<< + * + * def to_julian_date(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":428 + * return base1 + base2 + * + * def _has_time_component(self): # <<<<<<<<<<<<<< + * """ + * Returns if the Timestamp has a time component + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp._has_time_component", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":437 + * or self.nanosecond != 0) + * + * def to_julian_date(self): # <<<<<<<<<<<<<< + * """ + * Convert TimeStamp to a Julian Date. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_65to_julian_date(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_5tslib_9Timestamp_64to_julian_date[] = "\n Convert TimeStamp to a Julian Date.\n 0 Julian date is noon January 1, 4713 BC.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_9Timestamp_65to_julian_date = {__Pyx_NAMESTR("to_julian_date"), (PyCFunction)__pyx_pw_6pandas_5tslib_9Timestamp_65to_julian_date, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_9Timestamp_64to_julian_date)}; +static PyObject *__pyx_pw_6pandas_5tslib_9Timestamp_65to_julian_date(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_julian_date (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9Timestamp_64to_julian_date(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9Timestamp_64to_julian_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_year = NULL; + PyObject *__pyx_v_month = NULL; + PyObject *__pyx_v_day = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_julian_date", 0); + + /* "pandas/tslib.pyx":442 + * 0 Julian date is noon January 1, 4713 BC. + * """ + * year = self.year # <<<<<<<<<<<<<< + * month = self.month + * day = self.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_year = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":443 + * """ + * year = self.year + * month = self.month # <<<<<<<<<<<<<< + * day = self.day + * if month <= 2: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_month = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":444 + * year = self.year + * month = self.month + * day = self.day # <<<<<<<<<<<<<< + * if month <= 2: + * year -= 1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_day = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":445 + * month = self.month + * day = self.day + * if month <= 2: # <<<<<<<<<<<<<< + * year -= 1 + * month += 12 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_month, __pyx_int_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":446 + * day = self.day + * if month <= 2: + * year -= 1 # <<<<<<<<<<<<<< + * month += 12 + * return (day + + */ + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_year, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_year, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":447 + * if month <= 2: + * year -= 1 + * month += 12 # <<<<<<<<<<<<<< + * return (day + + * np.fix((153*month - 457)/5) + + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_month, __pyx_int_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_month, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":448 + * year -= 1 + * month += 12 + * return (day + # <<<<<<<<<<<<<< + * np.fix((153*month - 457)/5) + + * 365*year + + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/tslib.pyx":449 + * month += 12 + * return (day + + * np.fix((153*month - 457)/5) + # <<<<<<<<<<<<<< + * 365*year + + * np.floor(year / 4) - + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fix); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_int_153, __pyx_v_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_457); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_int_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":448 + * year -= 1 + * month += 12 + * return (day + # <<<<<<<<<<<<<< + * np.fix((153*month - 457)/5) + + * 365*year + + */ + __pyx_t_4 = PyNumber_Add(__pyx_v_day, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":450 + * return (day + + * np.fix((153*month - 457)/5) + + * 365*year + # <<<<<<<<<<<<<< + * np.floor(year / 4) - + * np.floor(year / 100) + + */ + __pyx_t_1 = PyNumber_Multiply(__pyx_int_365, __pyx_v_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/tslib.pyx":449 + * month += 12 + * return (day + + * np.fix((153*month - 457)/5) + # <<<<<<<<<<<<<< + * 365*year + + * np.floor(year / 4) - + */ + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":451 + * np.fix((153*month - 457)/5) + + * 365*year + + * np.floor(year / 4) - # <<<<<<<<<<<<<< + * np.floor(year / 100) + + * np.floor(year / 400) + + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_floor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_year, __pyx_int_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":450 + * return (day + + * np.fix((153*month - 457)/5) + + * 365*year + # <<<<<<<<<<<<<< + * np.floor(year / 4) - + * np.floor(year / 100) + + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":452 + * 365*year + + * np.floor(year / 4) - + * np.floor(year / 100) + # <<<<<<<<<<<<<< + * np.floor(year / 400) + + * 1721118.5 + + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_year, __pyx_int_100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":451 + * np.fix((153*month - 457)/5) + + * 365*year + + * np.floor(year / 4) - # <<<<<<<<<<<<<< + * np.floor(year / 100) + + * np.floor(year / 400) + + */ + __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":453 + * np.floor(year / 4) - + * np.floor(year / 100) + + * np.floor(year / 400) + # <<<<<<<<<<<<<< + * 1721118.5 + + * (self.hour + + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_year, __pyx_int_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":452 + * 365*year + + * np.floor(year / 4) - + * np.floor(year / 100) + # <<<<<<<<<<<<<< + * np.floor(year / 400) + + * 1721118.5 + + */ + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":453 + * np.floor(year / 4) - + * np.floor(year / 100) + + * np.floor(year / 400) + # <<<<<<<<<<<<<< + * 1721118.5 + + * (self.hour + + */ + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_float_1721118_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":455 + * np.floor(year / 400) + + * 1721118.5 + + * (self.hour + # <<<<<<<<<<<<<< + * self.minute/60.0 + + * self.second/3600.0 + + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":456 + * 1721118.5 + + * (self.hour + + * self.minute/60.0 + # <<<<<<<<<<<<<< + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minute); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_float_60_0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":455 + * np.floor(year / 400) + + * 1721118.5 + + * (self.hour + # <<<<<<<<<<<<<< + * self.minute/60.0 + + * self.second/3600.0 + + */ + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":457 + * (self.hour + + * self.minute/60.0 + + * self.second/3600.0 + # <<<<<<<<<<<<<< + * self.microsecond/3600.0/1e+6 + + * self.nanosecond/3600.0/1e+9 + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_second); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_float_3600_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":456 + * 1721118.5 + + * (self.hour + + * self.minute/60.0 + # <<<<<<<<<<<<<< + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":458 + * self.minute/60.0 + + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + # <<<<<<<<<<<<<< + * self.nanosecond/3600.0/1e+9 + * )/24.0) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_float_3600_0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_float_1e_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":457 + * (self.hour + + * self.minute/60.0 + + * self.second/3600.0 + # <<<<<<<<<<<<<< + * self.microsecond/3600.0/1e+6 + + * self.nanosecond/3600.0/1e+9 + */ + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":459 + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + + * self.nanosecond/3600.0/1e+9 # <<<<<<<<<<<<<< + * )/24.0) + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_float_3600_0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_float_1e_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":458 + * self.minute/60.0 + + * self.second/3600.0 + + * self.microsecond/3600.0/1e+6 + # <<<<<<<<<<<<<< + * self.nanosecond/3600.0/1e+9 + * )/24.0) + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":460 + * self.microsecond/3600.0/1e+6 + + * self.nanosecond/3600.0/1e+9 + * )/24.0) # <<<<<<<<<<<<<< + * + * _nat_strings = set(['NaT','nat','NAT','nan','NaN','NAN']) + */ + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_float_24_0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":454 + * np.floor(year / 100) + + * np.floor(year / 400) + + * 1721118.5 + # <<<<<<<<<<<<<< + * (self.hour + + * self.minute/60.0 + + */ + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":437 + * or self.nanosecond != 0) + * + * def to_julian_date(self): # <<<<<<<<<<<<<< + * """ + * Convert TimeStamp to a Julian Date. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.Timestamp.to_julian_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_year); + __Pyx_XDECREF(__pyx_v_month); + __Pyx_XDECREF(__pyx_v_day); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":466 + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + * def __new__(cls): # <<<<<<<<<<<<<< + * cdef _NaT base + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_1__new__(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_1__new__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_1__new__(PyObject *__pyx_self, PyObject *__pyx_v_cls) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType___new__(__pyx_self, ((PyObject *)__pyx_v_cls)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { + struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_base = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "pandas/tslib.pyx":469 + * cdef _NaT base + * + * base = _NaT.__new__(cls, 1, 1, 1) # <<<<<<<<<<<<<< + * mangle_nat(base) + * base.value = NPY_NAT + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__NaT)), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_5tslib__NaT))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_base = ((struct __pyx_obj_6pandas_5tslib__NaT *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":470 + * + * base = _NaT.__new__(cls, 1, 1, 1) + * mangle_nat(base) # <<<<<<<<<<<<<< + * base.value = NPY_NAT + * + */ + mangle_nat(((PyObject *)__pyx_v_base)); + + /* "pandas/tslib.pyx":471 + * base = _NaT.__new__(cls, 1, 1, 1) + * mangle_nat(base) + * base.value = NPY_NAT # <<<<<<<<<<<<<< + * + * return base + */ + __pyx_v_base->__pyx_base.value = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":473 + * base.value = NPY_NAT + * + * return base # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "pandas/tslib.pyx":466 + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + * def __new__(cls): # <<<<<<<<<<<<<< + * cdef _NaT base + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.NaTType.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_base); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":475 + * return base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_3__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_3__repr__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "pandas/tslib.pyx":476 + * + * def __repr__(self): + * return 'NaT' # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_NaT); + __pyx_r = __pyx_n_s_NaT; + goto __pyx_L0; + + /* "pandas/tslib.pyx":475 + * return base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":478 + * return 'NaT' + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_5__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_5__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_5__str__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_5__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_4__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_4__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__", 0); + + /* "pandas/tslib.pyx":479 + * + * def __str__(self): + * return 'NaT' # <<<<<<<<<<<<<< + * + * def __hash__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_NaT); + __pyx_r = __pyx_n_s_NaT; + goto __pyx_L0; + + /* "pandas/tslib.pyx":478 + * return 'NaT' + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":481 + * return 'NaT' + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return iNaT + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_7__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_7__hash__ = {__Pyx_NAMESTR("__hash__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_7__hash__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_7__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_6__hash__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_6__hash__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "pandas/tslib.pyx":482 + * + * def __hash__(self): + * return iNaT # <<<<<<<<<<<<<< + * + * def __int__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":481 + * return 'NaT' + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return iNaT + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.NaTType.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":484 + * return iNaT + * + * def __int__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_9__int__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_9__int__ = {__Pyx_NAMESTR("__int__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_9__int__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_9__int__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_8__int__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_8__int__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__int__", 0); + + /* "pandas/tslib.pyx":485 + * + * def __int__(self): + * return NPY_NAT # <<<<<<<<<<<<<< + * + * def __long__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":484 + * return iNaT + * + * def __int__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.NaTType.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":487 + * return NPY_NAT + * + * def __long__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_11__long__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_11__long__ = {__Pyx_NAMESTR("__long__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_11__long__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_11__long__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__long__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_10__long__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_10__long__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__long__", 0); + + /* "pandas/tslib.pyx":488 + * + * def __long__(self): + * return NPY_NAT # <<<<<<<<<<<<<< + * + * def weekday(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":487 + * return NPY_NAT + * + * def __long__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.NaTType.__long__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":490 + * return NPY_NAT + * + * def weekday(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_13weekday(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_13weekday = {__Pyx_NAMESTR("weekday"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_13weekday, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_13weekday(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("weekday (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_12weekday(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_12weekday(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("weekday", 0); + + /* "pandas/tslib.pyx":491 + * + * def weekday(self): + * return -1 # <<<<<<<<<<<<<< + * + * def toordinal(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* "pandas/tslib.pyx":490 + * return NPY_NAT + * + * def weekday(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":493 + * return -1 + * + * def toordinal(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_15toordinal(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_15toordinal = {__Pyx_NAMESTR("toordinal"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_15toordinal, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_15toordinal(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("toordinal (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_14toordinal(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_14toordinal(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("toordinal", 0); + + /* "pandas/tslib.pyx":494 + * + * def toordinal(self): + * return -1 # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + + /* "pandas/tslib.pyx":493 + * return -1 + * + * def toordinal(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":496 + * return -1 + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * return (__nat_unpickle, (None, )) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_17__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_7NaTType_17__reduce__ = {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6pandas_5tslib_7NaTType_17__reduce__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_7NaTType_17__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_7NaTType_16__reduce__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_7NaTType_16__reduce__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "pandas/tslib.pyx":497 + * + * def __reduce__(self): + * return (__nat_unpickle, (None, )) # <<<<<<<<<<<<<< + * + * fields = ['year', 'quarter', 'month', 'day', 'hour', + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_unpickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_tuple__20); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":496 + * return -1 + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * return (__nat_unpickle, (None, )) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.NaTType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":506 + * setattr(NaTType, field, prop) + * + * def __nat_unpickle(*args): # <<<<<<<<<<<<<< + * # return constant defined in the module + * return NaT + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_3__nat_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_3__nat_unpickle = {__Pyx_NAMESTR("__nat_unpickle"), (PyCFunction)__pyx_pw_6pandas_5tslib_3__nat_unpickle, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_3__nat_unpickle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nat_unpickle (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__nat_unpickle", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6pandas_5tslib_2__nat_unpickle(__pyx_self, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_2__nat_unpickle(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__nat_unpickle", 0); + + /* "pandas/tslib.pyx":508 + * def __nat_unpickle(*args): + * # return constant defined in the module + * return NaT # <<<<<<<<<<<<<< + * + * NaT = NaTType() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":506 + * setattr(NaTType, field, prop) + * + * def __nat_unpickle(*args): # <<<<<<<<<<<<<< + * # return constant defined in the module + * return NaT + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.__nat_unpickle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":515 + * + * + * cdef inline bint _checknull_with_nat(object val): # <<<<<<<<<<<<<< + * """ utility to check if a value is a nat or not """ + * return val is None or ( + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__checknull_with_nat(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_with_nat", 0); + + /* "pandas/tslib.pyx":517 + * cdef inline bint _checknull_with_nat(object val): + * """ utility to check if a value is a nat or not """ + * return val is None or ( # <<<<<<<<<<<<<< + * PyFloat_Check(val) and val != val) or val is NaT + * + */ + __pyx_t_1 = (__pyx_v_val == Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":518 + * """ utility to check if a value is a nat or not """ + * return val is None or ( + * PyFloat_Check(val) and val != val) or val is NaT # <<<<<<<<<<<<<< + * + * cdef inline bint _cmp_nat_dt(_NaT lhs, _Timestamp rhs, int op) except -1: + */ + __pyx_t_3 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_5 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__pyx_v_val == __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_5 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; + } + + /* "pandas/tslib.pyx":517 + * cdef inline bint _checknull_with_nat(object val): + * """ utility to check if a value is a nat or not """ + * return val is None or ( # <<<<<<<<<<<<<< + * PyFloat_Check(val) and val != val) or val is NaT + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "pandas/tslib.pyx":515 + * + * + * cdef inline bint _checknull_with_nat(object val): # <<<<<<<<<<<<<< + * """ utility to check if a value is a nat or not """ + * return val is None or ( + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_WriteUnraisable("pandas.tslib._checknull_with_nat", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":520 + * PyFloat_Check(val) and val != val) or val is NaT + * + * cdef inline bint _cmp_nat_dt(_NaT lhs, _Timestamp rhs, int op) except -1: # <<<<<<<<<<<<<< + * return _nat_scalar_rules[op] + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__cmp_nat_dt(CYTHON_UNUSED struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_lhs, CYTHON_UNUSED struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_rhs, int __pyx_v_op) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cmp_nat_dt", 0); + + /* "pandas/tslib.pyx":521 + * + * cdef inline bint _cmp_nat_dt(_NaT lhs, _Timestamp rhs, int op) except -1: + * return _nat_scalar_rules[op] # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = (__pyx_v_6pandas_5tslib__nat_scalar_rules[__pyx_v_op]); + goto __pyx_L0; + + /* "pandas/tslib.pyx":520 + * PyFloat_Check(val) and val != val) or val is NaT + * + * cdef inline bint _cmp_nat_dt(_NaT lhs, _Timestamp rhs, int op) except -1: # <<<<<<<<<<<<<< + * return _nat_scalar_rules[op] + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":524 + * + * + * cdef _tz_format(object obj, object zone): # <<<<<<<<<<<<<< + * try: + * return obj.strftime(' %%Z, tz=%s' % zone) + */ + +static PyObject *__pyx_f_6pandas_5tslib__tz_format(PyObject *__pyx_v_obj, PyObject *__pyx_v_zone) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_tz_format", 0); + + /* "pandas/tslib.pyx":525 + * + * cdef _tz_format(object obj, object zone): + * try: # <<<<<<<<<<<<<< + * return obj.strftime(' %%Z, tz=%s' % zone) + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":526 + * cdef _tz_format(object obj, object zone): + * try: + * return obj.strftime(' %%Z, tz=%s' % zone) # <<<<<<<<<<<<<< + * except: + * return ', tz=%s' % zone + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_strftime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Z_tz_s, __pyx_v_zone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":527 + * try: + * return obj.strftime(' %%Z, tz=%s' % zone) + * except: # <<<<<<<<<<<<<< + * return ', tz=%s' % zone + * + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib._tz_format", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":528 + * return obj.strftime(' %%Z, tz=%s' % zone) + * except: + * return ', tz=%s' % zone # <<<<<<<<<<<<<< + * + * def is_timestamp_array(ndarray[object] values): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_tz_s, __pyx_v_zone); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":524 + * + * + * cdef _tz_format(object obj, object zone): # <<<<<<<<<<<<<< + * try: + * return obj.strftime(' %%Z, tz=%s' % zone) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.tslib._tz_format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":530 + * return ', tz=%s' % zone + * + * def is_timestamp_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_5is_timestamp_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_5is_timestamp_array = {__Pyx_NAMESTR("is_timestamp_array"), (PyCFunction)__pyx_pw_6pandas_5tslib_5is_timestamp_array, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_5is_timestamp_array(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timestamp_array (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_4is_timestamp_array(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_4is_timestamp_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + int __pyx_v_i; + int __pyx_v_n; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_timestamp_array", 0); + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":531 + * + * def is_timestamp_array(ndarray[object] values): + * cdef int i, n = len(values) # <<<<<<<<<<<<<< + * if n == 0: + * return False + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":532 + * def is_timestamp_array(ndarray[object] values): + * cdef int i, n = len(values) + * if n == 0: # <<<<<<<<<<<<<< + * return False + * for i in range(n): + */ + __pyx_t_2 = ((__pyx_v_n == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":533 + * cdef int i, n = len(values) + * if n == 0: + * return False # <<<<<<<<<<<<<< + * for i in range(n): + * if not is_timestamp(values[i]): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":534 + * if n == 0: + * return False + * for i in range(n): # <<<<<<<<<<<<<< + * if not is_timestamp(values[i]): + * return False + */ + __pyx_t_3 = __pyx_v_n; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "pandas/tslib.pyx":535 + * return False + * for i in range(n): + * if not is_timestamp(values[i]): # <<<<<<<<<<<<<< + * return False + * return True + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_2 = ((!(__pyx_f_6pandas_5tslib_is_timestamp(__pyx_t_5) != 0)) != 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":536 + * for i in range(n): + * if not is_timestamp(values[i]): + * return False # <<<<<<<<<<<<<< + * return True + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":537 + * if not is_timestamp(values[i]): + * return False + * return True # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/tslib.pyx":530 + * return ', tz=%s' % zone + * + * def is_timestamp_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.is_timestamp_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":540 + * + * + * cpdef object get_value_box(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static PyObject *__pyx_pw_6pandas_5tslib_7get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_get_value_box(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_box", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "pandas/tslib.pyx":544 + * Py_ssize_t i, sz + * void* data_ptr + * if util.is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":545 + * void* data_ptr + * if util.is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":546 + * if util.is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":547 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = np.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":548 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = np.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "pandas/tslib.pyx":549 + * loc = casted + * i = loc + * sz = np.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "pandas/tslib.pyx":551 + * sz = np.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":552 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * + * if i >= sz or sz == 0 or i < 0: + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":554 + * i += sz + * + * if i >= sz or sz == 0 or i < 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + if (!__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_i < 0) != 0); + __pyx_t_6 = __pyx_t_4; + } else { + __pyx_t_6 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_6; + } else { + __pyx_t_1 = __pyx_t_5; + } + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":555 + * + * if i >= sz or sz == 0 or i < 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * if arr.descr.type_num == NPY_DATETIME: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":557 + * raise IndexError('index out of bounds') + * + * if arr.descr.type_num == NPY_DATETIME: # <<<<<<<<<<<<<< + * return Timestamp(util.get_value_1d(arr, i)) + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->descr->type_num == NPY_DATETIME) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":558 + * + * if arr.descr.type_num == NPY_DATETIME: + * return Timestamp(util.get_value_1d(arr, i)) # <<<<<<<<<<<<<< + * else: + * return util.get_value_1d(arr, i) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":560 + * return Timestamp(util.get_value_1d(arr, i)) + * else: + * return util.get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":540 + * + * + * cpdef object get_value_box(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.tslib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_7get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_7get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + PyObject *__pyx_v_loc = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_value_box (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_loc,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_value_box", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_value_box") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_loc = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_value_box", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_6get_value_box(__pyx_self, __pyx_v_arr, __pyx_v_loc); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_6get_value_box(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_box", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_get_value_box(__pyx_v_arr, __pyx_v_loc, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":580 + * # Frequency inference + * + * def unique_deltas(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9unique_deltas(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_9unique_deltas = {__Pyx_NAMESTR("unique_deltas"), (PyCFunction)__pyx_pw_6pandas_5tslib_9unique_deltas, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_9unique_deltas(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique_deltas (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_8unique_deltas(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_8unique_deltas(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_val; + khiter_t __pyx_v_k; + kh_int64_t *__pyx_v_table; + int __pyx_v_ret; + PyObject *__pyx_v_uniques = 0; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unique_deltas", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":582 + * def unique_deltas(ndarray[int64_t] arr): + * cdef: + * Py_ssize_t i, n = len(arr) # <<<<<<<<<<<<<< + * int64_t val + * khiter_t k + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":586 + * khiter_t k + * kh_int64_t *table + * int ret = 0 # <<<<<<<<<<<<<< + * list uniques = [] + * + */ + __pyx_v_ret = 0; + + /* "pandas/tslib.pyx":587 + * kh_int64_t *table + * int ret = 0 + * list uniques = [] # <<<<<<<<<<<<<< + * + * table = kh_init_int64() + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_uniques = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":589 + * list uniques = [] + * + * table = kh_init_int64() # <<<<<<<<<<<<<< + * kh_resize_int64(table, 10) + * for i in range(n - 1): + */ + __pyx_v_table = kh_init_int64(); + + /* "pandas/tslib.pyx":590 + * + * table = kh_init_int64() + * kh_resize_int64(table, 10) # <<<<<<<<<<<<<< + * for i in range(n - 1): + * val = arr[i + 1] - arr[i] + */ + kh_resize_int64(__pyx_v_table, 10); + + /* "pandas/tslib.pyx":591 + * table = kh_init_int64() + * kh_resize_int64(table, 10) + * for i in range(n - 1): # <<<<<<<<<<<<<< + * val = arr[i + 1] - arr[i] + * k = kh_get_int64(table, val) + */ + __pyx_t_1 = (__pyx_v_n - 1); + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "pandas/tslib.pyx":592 + * kh_resize_int64(table, 10) + * for i in range(n - 1): + * val = arr[i + 1] - arr[i] # <<<<<<<<<<<<<< + * k = kh_get_int64(table, val) + * if k == table.n_buckets: + */ + __pyx_t_4 = (__pyx_v_i + 1); + __pyx_t_5 = -1; + if (__pyx_t_4 < 0) { + __pyx_t_4 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __pyx_v_i; + __pyx_t_5 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_5 = 0; + if (unlikely(__pyx_t_5 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_5); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_arr.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_arr.diminfo[0].strides))); + + /* "pandas/tslib.pyx":593 + * for i in range(n - 1): + * val = arr[i + 1] - arr[i] + * k = kh_get_int64(table, val) # <<<<<<<<<<<<<< + * if k == table.n_buckets: + * kh_put_int64(table, val, &ret) + */ + __pyx_v_k = kh_get_int64(__pyx_v_table, __pyx_v_val); + + /* "pandas/tslib.pyx":594 + * val = arr[i + 1] - arr[i] + * k = kh_get_int64(table, val) + * if k == table.n_buckets: # <<<<<<<<<<<<<< + * kh_put_int64(table, val, &ret) + * uniques.append(val) + */ + __pyx_t_7 = ((__pyx_v_k == __pyx_v_table->n_buckets) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":595 + * k = kh_get_int64(table, val) + * if k == table.n_buckets: + * kh_put_int64(table, val, &ret) # <<<<<<<<<<<<<< + * uniques.append(val) + * kh_destroy_int64(table) + */ + kh_put_int64(__pyx_v_table, __pyx_v_val, (&__pyx_v_ret)); + + /* "pandas/tslib.pyx":596 + * if k == table.n_buckets: + * kh_put_int64(table, val, &ret) + * uniques.append(val) # <<<<<<<<<<<<<< + * kh_destroy_int64(table) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_uniques, __pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + + /* "pandas/tslib.pyx":597 + * kh_put_int64(table, val, &ret) + * uniques.append(val) + * kh_destroy_int64(table) # <<<<<<<<<<<<<< + * + * result = np.array(uniques, dtype=np.int64) + */ + kh_destroy_int64(__pyx_v_table); + + /* "pandas/tslib.pyx":599 + * kh_destroy_int64(table) + * + * result = np.array(uniques, dtype=np.int64) # <<<<<<<<<<<<<< + * result.sort() + * return result + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_uniques); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_uniques); + __Pyx_GIVEREF(__pyx_v_uniques); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_result = __pyx_t_12; + __pyx_t_12 = 0; + + /* "pandas/tslib.pyx":600 + * + * result = np.array(uniques, dtype=np.int64) + * result.sort() # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_sort); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":601 + * result = np.array(uniques, dtype=np.int64) + * result.sort() + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":580 + * # Frequency inference + * + * def unique_deltas(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.unique_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_uniques); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":604 + * + * + * cdef inline bint _is_multiple(int64_t us, int64_t mult): # <<<<<<<<<<<<<< + * return us % mult == 0 + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_multiple(__pyx_t_5numpy_int64_t __pyx_v_us, __pyx_t_5numpy_int64_t __pyx_v_mult) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_multiple", 0); + + /* "pandas/tslib.pyx":605 + * + * cdef inline bint _is_multiple(int64_t us, int64_t mult): + * return us % mult == 0 # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_mult == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = (__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_us, __pyx_v_mult) == 0); + goto __pyx_L0; + + /* "pandas/tslib.pyx":604 + * + * + * cdef inline bint _is_multiple(int64_t us, int64_t mult): # <<<<<<<<<<<<<< + * return us % mult == 0 + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.tslib._is_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":608 + * + * + * def apply_offset(ndarray[object] values, object offset): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_11apply_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_11apply_offset = {__Pyx_NAMESTR("apply_offset"), (PyCFunction)__pyx_pw_6pandas_5tslib_11apply_offset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_11apply_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + CYTHON_UNUSED PyObject *__pyx_v_offset = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("apply_offset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_offset,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("apply_offset", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_offset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_offset = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("apply_offset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.apply_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_10apply_offset(__pyx_self, __pyx_v_values, __pyx_v_offset); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10apply_offset(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyObject *__pyx_v_offset) { + Py_ssize_t __pyx_v_n; + CYTHON_UNUSED PyArrayObject *__pyx_v_new_values = 0; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_new_values; + __Pyx_Buffer __pyx_pybuffer_new_values; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("apply_offset", 0); + __pyx_pybuffer_new_values.pybuffer.buf = NULL; + __pyx_pybuffer_new_values.refcount = 0; + __pyx_pybuffernd_new_values.data = NULL; + __pyx_pybuffernd_new_values.rcbuffer = &__pyx_pybuffer_new_values; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":610 + * def apply_offset(ndarray[object] values, object offset): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] new_values + * object boxed + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":614 + * object boxed + * + * result = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * new_values = result.view('i8') + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":615 + * + * result = np.empty(n, dtype='M8[ns]') + * new_values = result.view('i8') # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_new_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_new_values.diminfo[0].strides = __pyx_pybuffernd_new_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new_values.diminfo[0].shape = __pyx_pybuffernd_new_values.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_new_values = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":608 + * + * + * def apply_offset(ndarray[object] values, object offset): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.apply_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_values.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_new_values); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":618 + * + * + * cdef inline bint _cmp_scalar(int64_t lhs, int64_t rhs, int op) except -1: # <<<<<<<<<<<<<< + * if op == Py_EQ: + * return lhs == rhs + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__cmp_scalar(__pyx_t_5numpy_int64_t __pyx_v_lhs, __pyx_t_5numpy_int64_t __pyx_v_rhs, int __pyx_v_op) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_cmp_scalar", 0); + + /* "pandas/tslib.pyx":619 + * + * cdef inline bint _cmp_scalar(int64_t lhs, int64_t rhs, int op) except -1: + * if op == Py_EQ: # <<<<<<<<<<<<<< + * return lhs == rhs + * elif op == Py_NE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_EQ) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":620 + * cdef inline bint _cmp_scalar(int64_t lhs, int64_t rhs, int op) except -1: + * if op == Py_EQ: + * return lhs == rhs # <<<<<<<<<<<<<< + * elif op == Py_NE: + * return lhs != rhs + */ + __pyx_r = (__pyx_v_lhs == __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":621 + * if op == Py_EQ: + * return lhs == rhs + * elif op == Py_NE: # <<<<<<<<<<<<<< + * return lhs != rhs + * elif op == Py_LT: + */ + __pyx_t_1 = ((__pyx_v_op == Py_NE) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":622 + * return lhs == rhs + * elif op == Py_NE: + * return lhs != rhs # <<<<<<<<<<<<<< + * elif op == Py_LT: + * return lhs < rhs + */ + __pyx_r = (__pyx_v_lhs != __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":623 + * elif op == Py_NE: + * return lhs != rhs + * elif op == Py_LT: # <<<<<<<<<<<<<< + * return lhs < rhs + * elif op == Py_LE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_LT) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":624 + * return lhs != rhs + * elif op == Py_LT: + * return lhs < rhs # <<<<<<<<<<<<<< + * elif op == Py_LE: + * return lhs <= rhs + */ + __pyx_r = (__pyx_v_lhs < __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":625 + * elif op == Py_LT: + * return lhs < rhs + * elif op == Py_LE: # <<<<<<<<<<<<<< + * return lhs <= rhs + * elif op == Py_GT: + */ + __pyx_t_1 = ((__pyx_v_op == Py_LE) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":626 + * return lhs < rhs + * elif op == Py_LE: + * return lhs <= rhs # <<<<<<<<<<<<<< + * elif op == Py_GT: + * return lhs > rhs + */ + __pyx_r = (__pyx_v_lhs <= __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":627 + * elif op == Py_LE: + * return lhs <= rhs + * elif op == Py_GT: # <<<<<<<<<<<<<< + * return lhs > rhs + * elif op == Py_GE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_GT) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":628 + * return lhs <= rhs + * elif op == Py_GT: + * return lhs > rhs # <<<<<<<<<<<<<< + * elif op == Py_GE: + * return lhs >= rhs + */ + __pyx_r = (__pyx_v_lhs > __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":629 + * elif op == Py_GT: + * return lhs > rhs + * elif op == Py_GE: # <<<<<<<<<<<<<< + * return lhs >= rhs + * + */ + __pyx_t_1 = ((__pyx_v_op == Py_GE) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":630 + * return lhs > rhs + * elif op == Py_GE: + * return lhs >= rhs # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = (__pyx_v_lhs >= __pyx_v_rhs); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":618 + * + * + * cdef inline bint _cmp_scalar(int64_t lhs, int64_t rhs, int op) except -1: # <<<<<<<<<<<<<< + * if op == Py_EQ: + * return lhs == rhs + */ + + /* function exit code */ + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":654 + * object offset # frequency reference + * + * def __hash__(_Timestamp self): # <<<<<<<<<<<<<< + * if self.nanosecond: + * return hash(self.value) + */ + +/* Python wrapper */ +static Py_hash_t __pyx_pw_6pandas_5tslib_10_Timestamp_1__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_6pandas_5tslib_10_Timestamp_1__hash__(PyObject *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp___hash__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_hash_t __pyx_pf_6pandas_5tslib_10_Timestamp___hash__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_hash_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "pandas/tslib.pyx":655 + * + * def __hash__(_Timestamp self): + * if self.nanosecond: # <<<<<<<<<<<<<< + * return hash(self.value) + * return datetime.__hash__(self) + */ + __pyx_t_1 = (__pyx_v_self->nanosecond != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":656 + * def __hash__(_Timestamp self): + * if self.nanosecond: + * return hash(self.value) # <<<<<<<<<<<<<< + * return datetime.__hash__(self) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Hash(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":657 + * if self.nanosecond: + * return hash(self.value) + * return datetime.__hash__(self) # <<<<<<<<<<<<<< + * + * def __richcmp__(_Timestamp self, object other, int op): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_hash); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyInt_AsHash_t(__pyx_t_5); if (unlikely((__pyx_t_3 == (Py_hash_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/tslib.pyx":654 + * object offset # frequency reference + * + * def __hash__(_Timestamp self): # <<<<<<<<<<<<<< + * if self.nanosecond: + * return hash(self.value) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib._Timestamp.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":659 + * return datetime.__hash__(self) + * + * def __richcmp__(_Timestamp self, object other, int op): # <<<<<<<<<<<<<< + * cdef: + * _Timestamp ots + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_5tslib__Timestamp, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_2__richcmp__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_2__richcmp__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_ots = 0; + int __pyx_v_ndim; + PyDateTime_DateTime *__pyx_v_val = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__richcmp__", 0); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/tslib.pyx":664 + * int ndim + * + * if isinstance(other, _Timestamp): # <<<<<<<<<<<<<< + * if isinstance(other, _NaT): + * return _cmp_nat_dt(other, self, _reverse_ops[op]) + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":665 + * + * if isinstance(other, _Timestamp): + * if isinstance(other, _NaT): # <<<<<<<<<<<<<< + * return _cmp_nat_dt(other, self, _reverse_ops[op]) + * ots = other + */ + __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_5tslib__NaT)); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":666 + * if isinstance(other, _Timestamp): + * if isinstance(other, _NaT): + * return _cmp_nat_dt(other, self, _reverse_ops[op]) # <<<<<<<<<<<<<< + * ots = other + * elif isinstance(other, datetime): + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_6pandas_5tslib__NaT))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_6pandas_5tslib__cmp_nat_dt(((struct __pyx_obj_6pandas_5tslib__NaT *)__pyx_v_other), __pyx_v_self, (__pyx_v_6pandas_5tslib__reverse_ops[__pyx_v_op])); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":667 + * if isinstance(other, _NaT): + * return _cmp_nat_dt(other, self, _reverse_ops[op]) + * ots = other # <<<<<<<<<<<<<< + * elif isinstance(other, datetime): + * if self.nanosecond == 0: + */ + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_6pandas_5tslib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_v_other; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ots = ((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":668 + * return _cmp_nat_dt(other, self, _reverse_ops[op]) + * ots = other + * elif isinstance(other, datetime): # <<<<<<<<<<<<<< + * if self.nanosecond == 0: + * val = self.to_datetime() + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_8datetime_datetime)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":669 + * ots = other + * elif isinstance(other, datetime): + * if self.nanosecond == 0: # <<<<<<<<<<<<<< + * val = self.to_datetime() + * return PyObject_RichCompareBool(val, other, op) + */ + __pyx_t_2 = ((__pyx_v_self->nanosecond == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":670 + * elif isinstance(other, datetime): + * if self.nanosecond == 0: + * val = self.to_datetime() # <<<<<<<<<<<<<< + * return PyObject_RichCompareBool(val, other, op) + * + */ + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->to_datetime(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_val = ((PyDateTime_DateTime *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":671 + * if self.nanosecond == 0: + * val = self.to_datetime() + * return PyObject_RichCompareBool(val, other, op) # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyObject_RichCompareBool(((PyObject *)__pyx_v_val), __pyx_v_other, __pyx_v_op); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":673 + * return PyObject_RichCompareBool(val, other, op) + * + * try: # <<<<<<<<<<<<<< + * ots = Timestamp(other) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/tslib.pyx":674 + * + * try: + * ots = Timestamp(other) # <<<<<<<<<<<<<< + * except ValueError: + * return self._compare_outside_nanorange(other, op) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_6pandas_5tslib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_v_ots = ((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":675 + * try: + * ots = Timestamp(other) + * except ValueError: # <<<<<<<<<<<<<< + * return self._compare_outside_nanorange(other, op) + * else: + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("pandas.tslib._Timestamp.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":676 + * ots = Timestamp(other) + * except ValueError: + * return self._compare_outside_nanorange(other, op) # <<<<<<<<<<<<<< + * else: + * ndim = getattr(other, _NDIM_STRING, -1) + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8datetime_datetime))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_compare_outside_nanorange(__pyx_v_self, ((PyDateTime_DateTime *)__pyx_v_other), __pyx_v_op); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L9_except_return; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L9_except_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L13_try_end:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":678 + * return self._compare_outside_nanorange(other, op) + * else: + * ndim = getattr(other, _NDIM_STRING, -1) # <<<<<<<<<<<<<< + * + * if ndim != -1: + */ + __pyx_t_3 = __pyx_v_6pandas_5tslib__NDIM_STRING; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = __Pyx_GetAttr3(__pyx_v_other, __pyx_t_3, __pyx_int_neg_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_ndim = __pyx_t_9; + + /* "pandas/tslib.pyx":680 + * ndim = getattr(other, _NDIM_STRING, -1) + * + * if ndim != -1: # <<<<<<<<<<<<<< + * if ndim == 0: + * if isinstance(other, np.datetime64): + */ + __pyx_t_2 = ((__pyx_v_ndim != -1) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":681 + * + * if ndim != -1: + * if ndim == 0: # <<<<<<<<<<<<<< + * if isinstance(other, np.datetime64): + * other = Timestamp(other) + */ + __pyx_t_2 = ((__pyx_v_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":682 + * if ndim != -1: + * if ndim == 0: + * if isinstance(other, np.datetime64): # <<<<<<<<<<<<<< + * other = Timestamp(other) + * else: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":683 + * if ndim == 0: + * if isinstance(other, np.datetime64): + * other = Timestamp(other) # <<<<<<<<<<<<<< + * else: + * raise TypeError('Cannot compare type %r with type %r' % + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L18; + } + /*else*/ { + + /* "pandas/tslib.pyx":686 + * else: + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, # <<<<<<<<<<<<<< + * type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/tslib.pyx":687 + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, + * type(other).__name__)) # <<<<<<<<<<<<<< + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * else: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_other)), __pyx_n_s_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":686 + * else: + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, # <<<<<<<<<<<<<< + * type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_8 = 0; + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":685 + * other = Timestamp(other) + * else: + * raise TypeError('Cannot compare type %r with type %r' % # <<<<<<<<<<<<<< + * (type(self).__name__, + * type(other).__name__)) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_compare_type_r_with_type, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L18:; + goto __pyx_L17; + } + __pyx_L17:; + + /* "pandas/tslib.pyx":688 + * (type(self).__name__, + * type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) # <<<<<<<<<<<<<< + * else: + * if op == Py_EQ: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_other, ((PyObject *)__pyx_v_self), (__pyx_v_6pandas_5tslib__reverse_ops[__pyx_v_op])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":690 + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * else: + * if op == Py_EQ: # <<<<<<<<<<<<<< + * return False + * elif op == Py_NE: + */ + __pyx_t_1 = ((__pyx_v_op == Py_EQ) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":691 + * else: + * if op == Py_EQ: + * return False # <<<<<<<<<<<<<< + * elif op == Py_NE: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":692 + * if op == Py_EQ: + * return False + * elif op == Py_NE: # <<<<<<<<<<<<<< + * return True + * raise TypeError('Cannot compare type %r with type %r' % + */ + __pyx_t_1 = ((__pyx_v_op == Py_NE) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":693 + * return False + * elif op == Py_NE: + * return True # <<<<<<<<<<<<<< + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, type(other).__name__)) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":695 + * return True + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, type(other).__name__)) # <<<<<<<<<<<<<< + * + * self._assert_tzawareness_compat(other) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_other)), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_7 = 0; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":694 + * elif op == Py_NE: + * return True + * raise TypeError('Cannot compare type %r with type %r' % # <<<<<<<<<<<<<< + * (type(self).__name__, type(other).__name__)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_compare_type_r_with_type, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":697 + * (type(self).__name__, type(other).__name__)) + * + * self._assert_tzawareness_compat(other) # <<<<<<<<<<<<<< + * return _cmp_scalar(self.value, ots.value, op) + * + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_assert_tzawareness_compat(__pyx_v_self, __pyx_v_other); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":698 + * + * self._assert_tzawareness_compat(other) + * return _cmp_scalar(self.value, ots.value, op) # <<<<<<<<<<<<<< + * + * cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib__cmp_scalar(__pyx_v_self->value, __pyx_v_ots->value, __pyx_v_op); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":659 + * return datetime.__hash__(self) + * + * def __richcmp__(_Timestamp self, object other, int op): # <<<<<<<<<<<<<< + * cdef: + * _Timestamp ots + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.tslib._Timestamp.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ots); + __Pyx_XDECREF((PyObject *)__pyx_v_val); + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":700 + * return _cmp_scalar(self.value, ots.value, op) + * + * cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, # <<<<<<<<<<<<<< + * int op) except -1: + * cdef datetime dtval = self.to_datetime() + */ + +static int __pyx_f_6pandas_5tslib_10_Timestamp__compare_outside_nanorange(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyDateTime_DateTime *__pyx_v_other, int __pyx_v_op) { + PyDateTime_DateTime *__pyx_v_dtval = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_compare_outside_nanorange", 0); + + /* "pandas/tslib.pyx":702 + * cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, + * int op) except -1: + * cdef datetime dtval = self.to_datetime() # <<<<<<<<<<<<<< + * + * self._assert_tzawareness_compat(other) + */ + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->to_datetime(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dtval = ((PyDateTime_DateTime *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":704 + * cdef datetime dtval = self.to_datetime() + * + * self._assert_tzawareness_compat(other) # <<<<<<<<<<<<<< + * + * if self.nanosecond == 0: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_assert_tzawareness_compat(__pyx_v_self, ((PyObject *)__pyx_v_other)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":706 + * self._assert_tzawareness_compat(other) + * + * if self.nanosecond == 0: # <<<<<<<<<<<<<< + * return PyObject_RichCompareBool(dtval, other, op) + * else: + */ + __pyx_t_3 = ((__pyx_v_self->nanosecond == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":707 + * + * if self.nanosecond == 0: + * return PyObject_RichCompareBool(dtval, other, op) # <<<<<<<<<<<<<< + * else: + * if op == Py_EQ: + */ + __pyx_t_3 = PyObject_RichCompareBool(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), __pyx_v_op); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":709 + * return PyObject_RichCompareBool(dtval, other, op) + * else: + * if op == Py_EQ: # <<<<<<<<<<<<<< + * return False + * elif op == Py_NE: + */ + __pyx_t_3 = ((__pyx_v_op == Py_EQ) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":710 + * else: + * if op == Py_EQ: + * return False # <<<<<<<<<<<<<< + * elif op == Py_NE: + * return True + */ + __pyx_r = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":711 + * if op == Py_EQ: + * return False + * elif op == Py_NE: # <<<<<<<<<<<<<< + * return True + * elif op == Py_LT: + */ + __pyx_t_3 = ((__pyx_v_op == Py_NE) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":712 + * return False + * elif op == Py_NE: + * return True # <<<<<<<<<<<<<< + * elif op == Py_LT: + * return dtval < other + */ + __pyx_r = 1; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":713 + * elif op == Py_NE: + * return True + * elif op == Py_LT: # <<<<<<<<<<<<<< + * return dtval < other + * elif op == Py_LE: + */ + __pyx_t_3 = ((__pyx_v_op == Py_LT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":714 + * return True + * elif op == Py_LT: + * return dtval < other # <<<<<<<<<<<<<< + * elif op == Py_LE: + * return dtval < other + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":715 + * elif op == Py_LT: + * return dtval < other + * elif op == Py_LE: # <<<<<<<<<<<<<< + * return dtval < other + * elif op == Py_GT: + */ + __pyx_t_3 = ((__pyx_v_op == Py_LE) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":716 + * return dtval < other + * elif op == Py_LE: + * return dtval < other # <<<<<<<<<<<<<< + * elif op == Py_GT: + * return dtval >= other + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":717 + * elif op == Py_LE: + * return dtval < other + * elif op == Py_GT: # <<<<<<<<<<<<<< + * return dtval >= other + * elif op == Py_GE: + */ + __pyx_t_3 = ((__pyx_v_op == Py_GT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":718 + * return dtval < other + * elif op == Py_GT: + * return dtval >= other # <<<<<<<<<<<<<< + * elif op == Py_GE: + * return dtval >= other + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":719 + * elif op == Py_GT: + * return dtval >= other + * elif op == Py_GE: # <<<<<<<<<<<<<< + * return dtval >= other + * + */ + __pyx_t_3 = ((__pyx_v_op == Py_GE) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":720 + * return dtval >= other + * elif op == Py_GE: + * return dtval >= other # <<<<<<<<<<<<<< + * + * cdef int _assert_tzawareness_compat(_Timestamp self, + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_dtval), ((PyObject *)__pyx_v_other), Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":700 + * return _cmp_scalar(self.value, ots.value, op) + * + * cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, # <<<<<<<<<<<<<< + * int op) except -1: + * cdef datetime dtval = self.to_datetime() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp._compare_outside_nanorange", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_dtval); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":722 + * return dtval >= other + * + * cdef int _assert_tzawareness_compat(_Timestamp self, # <<<<<<<<<<<<<< + * object other) except -1: + * if self.tzinfo is None: + */ + +static int __pyx_f_6pandas_5tslib_10_Timestamp__assert_tzawareness_compat(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_other) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_assert_tzawareness_compat", 0); + + /* "pandas/tslib.pyx":724 + * cdef int _assert_tzawareness_compat(_Timestamp self, + * object other) except -1: + * if self.tzinfo is None: # <<<<<<<<<<<<<< + * if other.tzinfo is not None: + * raise ValueError('Cannot compare tz-naive and tz-aware ' + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":725 + * object other) except -1: + * if self.tzinfo is None: + * if other.tzinfo is not None: # <<<<<<<<<<<<<< + * raise ValueError('Cannot compare tz-naive and tz-aware ' + * 'timestamps') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":726 + * if self.tzinfo is None: + * if other.tzinfo is not None: + * raise ValueError('Cannot compare tz-naive and tz-aware ' # <<<<<<<<<<<<<< + * 'timestamps') + * elif other.tzinfo is None: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":728 + * raise ValueError('Cannot compare tz-naive and tz-aware ' + * 'timestamps') + * elif other.tzinfo is None: # <<<<<<<<<<<<<< + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":729 + * 'timestamps') + * elif other.tzinfo is None: + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') # <<<<<<<<<<<<<< + * + * cpdef datetime to_datetime(_Timestamp self): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/tslib.pyx":722 + * return dtval >= other + * + * cdef int _assert_tzawareness_compat(_Timestamp self, # <<<<<<<<<<<<<< + * object other) except -1: + * if self.tzinfo is None: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp._assert_tzawareness_compat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":731 + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') + * + * cpdef datetime to_datetime(_Timestamp self): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyDateTime_DateTime *__pyx_f_6pandas_5tslib_10_Timestamp_to_datetime(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, int __pyx_skip_dispatch) { + pandas_datetimestruct __pyx_v_dts; + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + PyDateTime_DateTime *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + pandas_datetimestruct __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_datetime", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8datetime_datetime))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/tslib.pyx":735 + * pandas_datetimestruct dts + * _TSObject ts + * ts = convert_to_tsobject(self, self.tzinfo, None) # <<<<<<<<<<<<<< + * dts = ts.dts + * return datetime(dts.year, dts.month, dts.day, + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(((PyObject *)__pyx_v_self), __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":736 + * _TSObject ts + * ts = convert_to_tsobject(self, self.tzinfo, None) + * dts = ts.dts # <<<<<<<<<<<<<< + * return datetime(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, + */ + __pyx_t_3 = __pyx_v_ts->dts; + __pyx_v_dts = __pyx_t_3; + + /* "pandas/tslib.pyx":737 + * ts = convert_to_tsobject(self, self.tzinfo, None) + * dts = ts.dts + * return datetime(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, + * dts.us, ts.tzinfo) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":738 + * dts = ts.dts + * return datetime(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, # <<<<<<<<<<<<<< + * dts.us, ts.tzinfo) + * + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":739 + * return datetime(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, + * dts.us, ts.tzinfo) # <<<<<<<<<<<<<< + * + * def __add__(self, other): + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/tslib.pyx":737 + * ts = convert_to_tsobject(self, self.tzinfo, None) + * dts = ts.dts + * return datetime(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, + * dts.us, ts.tzinfo) + */ + __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_ts->tzinfo); + PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_v_ts->tzinfo); + __Pyx_GIVEREF(__pyx_v_ts->tzinfo); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = ((PyDateTime_DateTime *)__pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":731 + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') + * + * cpdef datetime to_datetime(_Timestamp self): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.tslib._Timestamp.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("to_datetime (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_4to_datetime(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_4to_datetime(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_datetime", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->to_datetime(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":741 + * dts.us, ts.tzinfo) + * + * def __add__(self, other): # <<<<<<<<<<<<<< + * cdef int64_t other_int + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_7__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_7__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_6__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_6__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + __pyx_t_5numpy_int64_t __pyx_v_other_int; + PyObject *__pyx_v_nanos = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 0); + + /* "pandas/tslib.pyx":744 + * cdef int64_t other_int + * + * if is_timedelta64_object(other): # <<<<<<<<<<<<<< + * other_int = other.astype('timedelta64[ns]').view('i8') + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) + */ + __pyx_t_1 = (is_timedelta64_object(__pyx_v_other) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":745 + * + * if is_timedelta64_object(other): + * other_int = other.astype('timedelta64[ns]').view('i8') # <<<<<<<<<<<<<< + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_other_int = __pyx_t_4; + + /* "pandas/tslib.pyx":746 + * if is_timedelta64_object(other): + * other_int = other.astype('timedelta64[ns]').view('i8') + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) # <<<<<<<<<<<<<< + * + * elif is_integer_object(other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_other_int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_offset, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":748 + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) + * + * elif is_integer_object(other): # <<<<<<<<<<<<<< + * if self.offset is None: + * raise ValueError("Cannot add integral value to Timestamp " + */ + __pyx_t_1 = (is_integer_object(__pyx_v_other) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":749 + * + * elif is_integer_object(other): + * if self.offset is None: # <<<<<<<<<<<<<< + * raise ValueError("Cannot add integral value to Timestamp " + * "without offset.") + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__pyx_t_2 == Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":750 + * elif is_integer_object(other): + * if self.offset is None: + * raise ValueError("Cannot add integral value to Timestamp " # <<<<<<<<<<<<<< + * "without offset.") + * return Timestamp((self.offset * other).apply(self), offset=self.offset) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":752 + * raise ValueError("Cannot add integral value to Timestamp " + * "without offset.") + * return Timestamp((self.offset * other).apply(self), offset=self.offset) # <<<<<<<<<<<<<< + * + * elif isinstance(other, timedelta) or hasattr(other, 'delta'): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_apply); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_offset, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":754 + * return Timestamp((self.offset * other).apply(self), offset=self.offset) + * + * elif isinstance(other, timedelta) or hasattr(other, 'delta'): # <<<<<<<<<<<<<< + * nanos = _delta_to_nanoseconds(other) + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) + */ + __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_8datetime_timedelta)); + if (!(__pyx_t_7 != 0)) { + __pyx_t_1 = PyObject_HasAttr(__pyx_v_other, __pyx_n_s_delta); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_1 != 0); + } else { + __pyx_t_8 = (__pyx_t_7 != 0); + } + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":755 + * + * elif isinstance(other, timedelta) or hasattr(other, 'delta'): + * nanos = _delta_to_nanoseconds(other) # <<<<<<<<<<<<<< + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) + * if getattr(other, 'normalize', False): + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_nanos = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":756 + * elif isinstance(other, timedelta) or hasattr(other, 'delta'): + * nanos = _delta_to_nanoseconds(other) + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) # <<<<<<<<<<<<<< + * if getattr(other, 'normalize', False): + * result = Timestamp(normalize_date(result)) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_nanos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_offset, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_result = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":757 + * nanos = _delta_to_nanoseconds(other) + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) + * if getattr(other, 'normalize', False): # <<<<<<<<<<<<<< + * result = Timestamp(normalize_date(result)) + * return result + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_s_normalize, Py_False); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":758 + * result = Timestamp(self.value + nanos, tz=self.tzinfo, offset=self.offset) + * if getattr(other, 'normalize', False): + * result = Timestamp(normalize_date(result)) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __pyx_f_6pandas_5tslib_normalize_date(__pyx_v_result, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":759 + * if getattr(other, 'normalize', False): + * result = Timestamp(normalize_date(result)) + * return result # <<<<<<<<<<<<<< + * + * result = datetime.__add__(self, other) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":761 + * return result + * + * result = datetime.__add__(self, other) # <<<<<<<<<<<<<< + * if isinstance(result, datetime): + * result = Timestamp(result) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":762 + * + * result = datetime.__add__(self, other) + * if isinstance(result, datetime): # <<<<<<<<<<<<<< + * result = Timestamp(result) + * result.nanosecond = self.nanosecond + */ + __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_result, ((PyObject*)__pyx_ptype_8datetime_datetime)); + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":763 + * result = datetime.__add__(self, other) + * if isinstance(result, datetime): + * result = Timestamp(result) # <<<<<<<<<<<<<< + * result.nanosecond = self.nanosecond + * return result + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":764 + * if isinstance(result, datetime): + * result = Timestamp(result) + * result.nanosecond = self.nanosecond # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_nanosecond, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/tslib.pyx":765 + * result = Timestamp(result) + * result.nanosecond = self.nanosecond + * return result # <<<<<<<<<<<<<< + * + * def __sub__(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":741 + * dts.us, ts.tzinfo) + * + * def __add__(self, other): # <<<<<<<<<<<<<< + * cdef int64_t other_int + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._Timestamp.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_nanos); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":767 + * return result + * + * def __sub__(self, other): # <<<<<<<<<<<<<< + * if is_timedelta64_object(other) or is_integer_object(other) \ + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_9__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_9__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_8__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_8__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_neg_other = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__sub__", 0); + + /* "pandas/tslib.pyx":768 + * + * def __sub__(self, other): + * if is_timedelta64_object(other) or is_integer_object(other) \ # <<<<<<<<<<<<<< + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + * neg_other = -other + */ + if (!(is_timedelta64_object(__pyx_v_other) != 0)) { + + /* "pandas/tslib.pyx":769 + * def __sub__(self, other): + * if is_timedelta64_object(other) or is_integer_object(other) \ + * or isinstance(other, timedelta) or hasattr(other, 'delta'): # <<<<<<<<<<<<<< + * neg_other = -other + * return self + neg_other + */ + if (!(is_integer_object(__pyx_v_other) != 0)) { + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_8datetime_timedelta)); + if (!__pyx_t_1) { + __pyx_t_2 = PyObject_HasAttr(__pyx_v_other, __pyx_n_s_delta); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = (is_integer_object(__pyx_v_other) != 0); + } + __pyx_t_3 = __pyx_t_1; + } else { + __pyx_t_3 = (is_timedelta64_object(__pyx_v_other) != 0); + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":770 + * if is_timedelta64_object(other) or is_integer_object(other) \ + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + * neg_other = -other # <<<<<<<<<<<<<< + * return self + neg_other + * elif other is NaT: + */ + __pyx_t_4 = PyNumber_Negative(__pyx_v_other); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_neg_other = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":771 + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + * neg_other = -other + * return self + neg_other # <<<<<<<<<<<<<< + * elif other is NaT: + * return NaT + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyNumber_Add(__pyx_v_self, __pyx_v_neg_other); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":772 + * neg_other = -other + * return self + neg_other + * elif other is NaT: # <<<<<<<<<<<<<< + * return NaT + * return datetime.__sub__(self, other) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = (__pyx_v_other == __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":773 + * return self + neg_other + * elif other is NaT: + * return NaT # <<<<<<<<<<<<<< + * return datetime.__sub__(self, other) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":774 + * elif other is NaT: + * return NaT + * return datetime.__sub__(self, other) # <<<<<<<<<<<<<< + * + * cpdef _get_field(self, field): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_sub); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":767 + * return result + * + * def __sub__(self, other): # <<<<<<<<<<<<<< + * if is_timedelta64_object(other) or is_integer_object(other) \ + * or isinstance(other, timedelta) or hasattr(other, 'delta'): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._Timestamp.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_neg_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":776 + * return datetime.__sub__(self, other) + * + * cpdef _get_field(self, field): # <<<<<<<<<<<<<< + * out = get_date_field(np.array([self.value], dtype=np.int64), field) + * return out[0] + */ + +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_10_Timestamp__get_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field, int __pyx_skip_dispatch) { + PyObject *__pyx_v_out = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_field", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/tslib.pyx":777 + * + * cpdef _get_field(self, field): + * out = get_date_field(np.array([self.value], dtype=np.int64), field) # <<<<<<<<<<<<<< + * return out[0] + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_date_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_out = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":778 + * cpdef _get_field(self, field): + * out = get_date_field(np.array([self.value], dtype=np.int64), field) + * return out[0] # <<<<<<<<<<<<<< + * + * cpdef _get_start_end_field(self, field): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":776 + * return datetime.__sub__(self, other) + * + * cpdef _get_field(self, field): # <<<<<<<<<<<<<< + * out = get_date_field(np.array([self.value], dtype=np.int64), field) + * return out[0] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._Timestamp._get_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_field (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_10_get_field(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self), ((PyObject *)__pyx_v_field)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_10_get_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_field", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_get_field(__pyx_v_self, __pyx_v_field, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp._get_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":780 + * return out[0] + * + * cpdef _get_start_end_field(self, field): # <<<<<<<<<<<<<< + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 + * freqstr = self.freqstr if self.freq else None + */ + +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_10_Timestamp__get_start_end_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field, int __pyx_skip_dispatch) { + PyObject *__pyx_v_month_kw = NULL; + PyObject *__pyx_v_freqstr = NULL; + PyObject *__pyx_v_out = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_start_end_field", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_start_end_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/tslib.pyx":781 + * + * cpdef _get_start_end_field(self, field): + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 # <<<<<<<<<<<<<< + * freqstr = self.freqstr if self.freq else None + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_kwds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_kwds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_startingMonth); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_startingMonth); + __Pyx_GIVEREF(__pyx_n_s_startingMonth); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __Pyx_INCREF(__pyx_int_12); + __pyx_t_1 = __pyx_int_12; + } + __pyx_v_month_kw = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":782 + * cpdef _get_start_end_field(self, field): + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 + * freqstr = self.freqstr if self.freq else None # <<<<<<<<<<<<<< + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) + * return out[0] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freq); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_4) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_freqstr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } + __pyx_v_freqstr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":783 + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 + * freqstr = self.freqstr if self.freq else None + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) # <<<<<<<<<<<<<< + * return out[0] + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_start_end_field_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_field); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_field); + __Pyx_GIVEREF(__pyx_v_field); + __Pyx_INCREF(__pyx_v_freqstr); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_freqstr); + __Pyx_GIVEREF(__pyx_v_freqstr); + __Pyx_INCREF(__pyx_v_month_kw); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_month_kw); + __Pyx_GIVEREF(__pyx_v_month_kw); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_out = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":784 + * freqstr = self.freqstr if self.freq else None + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) + * return out[0] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":780 + * return out[0] + * + * cpdef _get_start_end_field(self, field): # <<<<<<<<<<<<<< + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 + * freqstr = self.freqstr if self.freq else None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.tslib._Timestamp._get_start_end_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_month_kw); + __Pyx_XDECREF(__pyx_v_freqstr); + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_start_end_field (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_12_get_start_end_field(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self), ((PyObject *)__pyx_v_field)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_12_get_start_end_field(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_start_end_field", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_5tslib__Timestamp *)__pyx_v_self->__pyx_vtab)->_get_start_end_field(__pyx_v_self, __pyx_v_field, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp._get_start_end_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":651 + * cdef class _Timestamp(datetime): + * cdef readonly: + * int64_t value, nanosecond # <<<<<<<<<<<<<< + * object offset # frequency reference + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_5value___get__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_5value___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_10nanosecond_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_10nanosecond_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_10nanosecond___get__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_10nanosecond___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nanosecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._Timestamp.nanosecond.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":652 + * cdef readonly: + * int64_t value, nanosecond + * object offset # frequency reference # <<<<<<<<<<<<<< + * + * def __hash__(_Timestamp self): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_10_Timestamp_6offset_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10_Timestamp_6offset___get__(((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10_Timestamp_6offset___get__(struct __pyx_obj_6pandas_5tslib__Timestamp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->offset); + __pyx_r = __pyx_v_self->offset; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":790 + * + * + * cdef inline bint is_timestamp(object o): # <<<<<<<<<<<<<< + * return Py_TYPE(o) == ts_type # isinstance(o, Timestamp) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib_is_timestamp(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timestamp", 0); + + /* "pandas/tslib.pyx":791 + * + * cdef inline bint is_timestamp(object o): + * return Py_TYPE(o) == ts_type # isinstance(o, Timestamp) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = (Py_TYPE(__pyx_v_o) == __pyx_v_6pandas_5tslib_ts_type); + goto __pyx_L0; + + /* "pandas/tslib.pyx":790 + * + * + * cdef inline bint is_timestamp(object o): # <<<<<<<<<<<<<< + * return Py_TYPE(o) == ts_type # isinstance(o, Timestamp) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":806 + * cdef class _NaT(_Timestamp): + * + * def __hash__(_NaT self): # <<<<<<<<<<<<<< + * # py3k needs this defined here + * return hash(self.value) + */ + +/* Python wrapper */ +static Py_hash_t __pyx_pw_6pandas_5tslib_4_NaT_1__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_6pandas_5tslib_4_NaT_1__hash__(PyObject *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_4_NaT___hash__(((struct __pyx_obj_6pandas_5tslib__NaT *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_hash_t __pyx_pf_6pandas_5tslib_4_NaT___hash__(struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_hash_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "pandas/tslib.pyx":808 + * def __hash__(_NaT self): + * # py3k needs this defined here + * return hash(self.value) # <<<<<<<<<<<<<< + * + * def __richcmp__(_NaT self, object other, int op): + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "pandas/tslib.pyx":806 + * cdef class _NaT(_Timestamp): + * + * def __hash__(_NaT self): # <<<<<<<<<<<<<< + * # py3k needs this defined here + * return hash(self.value) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._NaT.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":810 + * return hash(self.value) + * + * def __richcmp__(_NaT self, object other, int op): # <<<<<<<<<<<<<< + * cdef int ndim = getattr(other, 'ndim', -1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_3__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_5tslib__NaT, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_4_NaT_2__richcmp__(((struct __pyx_obj_6pandas_5tslib__NaT *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_2__richcmp__(struct __pyx_obj_6pandas_5tslib__NaT *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { + int __pyx_v_ndim; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__richcmp__", 0); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/tslib.pyx":811 + * + * def __richcmp__(_NaT self, object other, int op): + * cdef int ndim = getattr(other, 'ndim', -1) # <<<<<<<<<<<<<< + * + * if ndim == -1: + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_s_ndim, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_ndim = __pyx_t_2; + + /* "pandas/tslib.pyx":813 + * cdef int ndim = getattr(other, 'ndim', -1) + * + * if ndim == -1: # <<<<<<<<<<<<<< + * return _nat_scalar_rules[op] + * + */ + __pyx_t_3 = ((__pyx_v_ndim == -1) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":814 + * + * if ndim == -1: + * return _nat_scalar_rules[op] # <<<<<<<<<<<<<< + * + * if ndim == 0: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_6pandas_5tslib__nat_scalar_rules[__pyx_v_op])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":816 + * return _nat_scalar_rules[op] + * + * if ndim == 0: # <<<<<<<<<<<<<< + * if isinstance(other, np.datetime64): + * other = Timestamp(other) + */ + __pyx_t_3 = ((__pyx_v_ndim == 0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":817 + * + * if ndim == 0: + * if isinstance(other, np.datetime64): # <<<<<<<<<<<<<< + * other = Timestamp(other) + * else: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_IsInstance(__pyx_v_other, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = (__pyx_t_3 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":818 + * if ndim == 0: + * if isinstance(other, np.datetime64): + * other = Timestamp(other) # <<<<<<<<<<<<<< + * else: + * raise TypeError('Cannot compare type %r with type %r' % + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":821 + * else: + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, type(other).__name__)) # <<<<<<<<<<<<<< + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_other)), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_6 = 0; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":820 + * other = Timestamp(other) + * else: + * raise TypeError('Cannot compare type %r with type %r' % # <<<<<<<<<<<<<< + * (type(self).__name__, type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_compare_type_r_with_type, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":822 + * raise TypeError('Cannot compare type %r with type %r' % + * (type(self).__name__, type(other).__name__)) + * return PyObject_RichCompare(other, self, _reverse_ops[op]) # <<<<<<<<<<<<<< + * + * def __add__(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_other, ((PyObject *)__pyx_v_self), (__pyx_v_6pandas_5tslib__reverse_ops[__pyx_v_op])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":810 + * return hash(self.value) + * + * def __richcmp__(_NaT self, object other, int op): # <<<<<<<<<<<<<< + * cdef int ndim = getattr(other, 'ndim', -1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._NaT.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":824 + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * + * def __add__(self, other): # <<<<<<<<<<<<<< + * try: + * result = _Timestamp.__add__(self, other) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_4_NaT_4__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_4__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 0); + + /* "pandas/tslib.pyx":825 + * + * def __add__(self, other): + * try: # <<<<<<<<<<<<<< + * result = _Timestamp.__add__(self, other) + * if result is NotImplemented: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":826 + * def __add__(self, other): + * try: + * result = _Timestamp.__add__(self, other) # <<<<<<<<<<<<<< + * if result is NotImplemented: + * return result + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp)), __pyx_n_s_add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":827 + * try: + * result = _Timestamp.__add__(self, other) + * if result is NotImplemented: # <<<<<<<<<<<<<< + * return result + * except (OverflowError, OutOfBoundsDatetime): + */ + __pyx_t_7 = (__pyx_v_result == __pyx_builtin_NotImplemented); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":828 + * result = _Timestamp.__add__(self, other) + * if result is NotImplemented: + * return result # <<<<<<<<<<<<<< + * except (OverflowError, OutOfBoundsDatetime): + * pass + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":829 + * if result is NotImplemented: + * return result + * except (OverflowError, OutOfBoundsDatetime): # <<<<<<<<<<<<<< + * pass + * return NaT + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError) || PyErr_ExceptionMatches(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + PyErr_Restore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":831 + * except (OverflowError, OutOfBoundsDatetime): + * pass + * return NaT # <<<<<<<<<<<<<< + * + * def __sub__(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":824 + * return PyObject_RichCompare(other, self, _reverse_ops[op]) + * + * def __add__(self, other): # <<<<<<<<<<<<<< + * try: + * result = _Timestamp.__add__(self, other) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._NaT.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":833 + * return NaT + * + * def __sub__(self, other): # <<<<<<<<<<<<<< + * if type(self) is datetime: + * other, self = self, other + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_7__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_4_NaT_7__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_4_NaT_6__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_4_NaT_6__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__sub__", 0); + __Pyx_INCREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + + /* "pandas/tslib.pyx":834 + * + * def __sub__(self, other): + * if type(self) is datetime: # <<<<<<<<<<<<<< + * other, self = self, other + * try: + */ + __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_self)) == ((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime))); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":835 + * def __sub__(self, other): + * if type(self) is datetime: + * other, self = self, other # <<<<<<<<<<<<<< + * try: + * result = _Timestamp.__sub__(self, other) + */ + __pyx_t_3 = __pyx_v_self; + __pyx_t_4 = __pyx_v_other; + __pyx_v_other = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_self = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":836 + * if type(self) is datetime: + * other, self = self, other + * try: # <<<<<<<<<<<<<< + * result = _Timestamp.__sub__(self, other) + * if result is NotImplemented: + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "pandas/tslib.pyx":837 + * other, self = self, other + * try: + * result = _Timestamp.__sub__(self, other) # <<<<<<<<<<<<<< + * if result is NotImplemented: + * return result + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp)), __pyx_n_s_sub); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_other); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_other); + __Pyx_GIVEREF(__pyx_v_other); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_result = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":838 + * try: + * result = _Timestamp.__sub__(self, other) + * if result is NotImplemented: # <<<<<<<<<<<<<< + * return result + * except (OverflowError, OutOfBoundsDatetime): + */ + __pyx_t_2 = (__pyx_v_result == __pyx_builtin_NotImplemented); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":839 + * result = _Timestamp.__sub__(self, other) + * if result is NotImplemented: + * return result # <<<<<<<<<<<<<< + * except (OverflowError, OutOfBoundsDatetime): + * pass + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L8_try_return; + } + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":840 + * if result is NotImplemented: + * return result + * except (OverflowError, OutOfBoundsDatetime): # <<<<<<<<<<<<<< + * pass + * return NaT + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError) || PyErr_ExceptionMatches(__pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + PyErr_Restore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L8_try_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_5); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_5); + __pyx_L11_try_end:; + } + + /* "pandas/tslib.pyx":842 + * except (OverflowError, OutOfBoundsDatetime): + * pass + * return NaT # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":833 + * return NaT + * + * def __sub__(self, other): # <<<<<<<<<<<<<< + * if type(self) is datetime: + * other, self = self, other + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.tslib._NaT.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_self); + __Pyx_XDECREF(__pyx_v_other); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":845 + * + * + * def _delta_to_nanoseconds(delta): # <<<<<<<<<<<<<< + * if hasattr(delta, 'delta'): + * delta = delta.delta + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_13_delta_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_delta); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_13_delta_to_nanoseconds = {__Pyx_NAMESTR("_delta_to_nanoseconds"), (PyCFunction)__pyx_pw_6pandas_5tslib_13_delta_to_nanoseconds, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_13_delta_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_delta) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_delta_to_nanoseconds (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_12_delta_to_nanoseconds(__pyx_self, ((PyObject *)__pyx_v_delta)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_12_delta_to_nanoseconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_delta) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_delta_to_nanoseconds", 0); + __Pyx_INCREF(__pyx_v_delta); + + /* "pandas/tslib.pyx":846 + * + * def _delta_to_nanoseconds(delta): + * if hasattr(delta, 'delta'): # <<<<<<<<<<<<<< + * delta = delta.delta + * if is_timedelta64_object(delta): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_delta, __pyx_n_s_delta); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":847 + * def _delta_to_nanoseconds(delta): + * if hasattr(delta, 'delta'): + * delta = delta.delta # <<<<<<<<<<<<<< + * if is_timedelta64_object(delta): + * return delta.astype("timedelta64[ns]").item() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_delta); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_delta, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":848 + * if hasattr(delta, 'delta'): + * delta = delta.delta + * if is_timedelta64_object(delta): # <<<<<<<<<<<<<< + * return delta.astype("timedelta64[ns]").item() + * if is_integer_object(delta): + */ + __pyx_t_2 = (is_timedelta64_object(__pyx_v_delta) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":849 + * delta = delta.delta + * if is_timedelta64_object(delta): + * return delta.astype("timedelta64[ns]").item() # <<<<<<<<<<<<<< + * if is_integer_object(delta): + * return delta + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_item); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":850 + * if is_timedelta64_object(delta): + * return delta.astype("timedelta64[ns]").item() + * if is_integer_object(delta): # <<<<<<<<<<<<<< + * return delta + * return (delta.days * 24 * 60 * 60 * 1000000 + */ + __pyx_t_2 = (is_integer_object(__pyx_v_delta) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":851 + * return delta.astype("timedelta64[ns]").item() + * if is_integer_object(delta): + * return delta # <<<<<<<<<<<<<< + * return (delta.days * 24 * 60 * 60 * 1000000 + * + delta.seconds * 1000000 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_delta); + __pyx_r = __pyx_v_delta; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":852 + * if is_integer_object(delta): + * return delta + * return (delta.days * 24 * 60 * 60 * 1000000 # <<<<<<<<<<<<<< + * + delta.seconds * 1000000 + * + delta.microseconds) * 1000 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_days); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_24); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_int_60); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_60); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_int_1000000); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":853 + * return delta + * return (delta.days * 24 * 60 * 60 * 1000000 + * + delta.seconds * 1000000 # <<<<<<<<<<<<<< + * + delta.microseconds) * 1000 + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_seconds); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_int_1000000); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":854 + * return (delta.days * 24 * 60 * 60 * 1000000 + * + delta.seconds * 1000000 + * + delta.microseconds) * 1000 # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":845 + * + * + * def _delta_to_nanoseconds(delta): # <<<<<<<<<<<<<< + * if hasattr(delta, 'delta'): + * delta = delta.delta + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib._delta_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":865 + * + * property value: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.value + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_9_TSObject_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_9_TSObject_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_9_TSObject_5value___get__(((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_9_TSObject_5value___get__(struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "pandas/tslib.pyx":866 + * property value: + * def __get__(self): + * return self.value # <<<<<<<<<<<<<< + * + * cpdef _get_utcoffset(tzinfo, obj): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":865 + * + * property value: + * def __get__(self): # <<<<<<<<<<<<<< + * return self.value + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._TSObject.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":868 + * return self.value + * + * cpdef _get_utcoffset(tzinfo, obj): # <<<<<<<<<<<<<< + * try: + * return tzinfo._utcoffset + */ + +static PyObject *__pyx_pw_6pandas_5tslib_15_get_utcoffset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib__get_utcoffset(PyObject *__pyx_v_tzinfo, PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_utcoffset", 0); + + /* "pandas/tslib.pyx":869 + * + * cpdef _get_utcoffset(tzinfo, obj): + * try: # <<<<<<<<<<<<<< + * return tzinfo._utcoffset + * except AttributeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":870 + * cpdef _get_utcoffset(tzinfo, obj): + * try: + * return tzinfo._utcoffset # <<<<<<<<<<<<<< + * except AttributeError: + * return tzinfo.utcoffset(obj) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_utcoffset_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":871 + * try: + * return tzinfo._utcoffset + * except AttributeError: # <<<<<<<<<<<<<< + * return tzinfo.utcoffset(obj) + * + */ + __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_5) { + __Pyx_AddTraceback("pandas.tslib._get_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":872 + * return tzinfo._utcoffset + * except AttributeError: + * return tzinfo.utcoffset(obj) # <<<<<<<<<<<<<< + * + * # helper to extract datetime and int64 from several different possibilities + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":868 + * return self.value + * + * cpdef _get_utcoffset(tzinfo, obj): # <<<<<<<<<<<<<< + * try: + * return tzinfo._utcoffset + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.tslib._get_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_15_get_utcoffset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_15_get_utcoffset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_tzinfo = 0; + PyObject *__pyx_v_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_utcoffset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tzinfo,&__pyx_n_s_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_get_utcoffset", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_utcoffset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_tzinfo = values[0]; + __pyx_v_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_utcoffset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib._get_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_14_get_utcoffset(__pyx_self, __pyx_v_tzinfo, __pyx_v_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_14_get_utcoffset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tzinfo, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_utcoffset", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tzinfo, __pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._get_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":875 + * + * # helper to extract datetime and int64 from several different possibilities + * cdef convert_to_tsobject(object ts, object tz, object unit): # <<<<<<<<<<<<<< + * """ + * Extract datetime and int64 from any of: + */ + +static PyObject *__pyx_f_6pandas_5tslib_convert_to_tsobject(PyObject *__pyx_v_ts, PyObject *__pyx_v_tz, PyObject *__pyx_v_unit) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_obj = 0; + CYTHON_UNUSED int __pyx_v_utc_convert; + PyObject *__pyx_v_ts_offset = NULL; + PyObject *__pyx_v_tz_offset = NULL; + PyObject *__pyx_v_offset = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_8; + npy_datetime __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + npy_int32 __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_to_tsobject", 0); + __Pyx_INCREF(__pyx_v_ts); + __Pyx_INCREF(__pyx_v_tz); + + /* "pandas/tslib.pyx":888 + * cdef: + * _TSObject obj + * bint utc_convert = 1 # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_v_utc_convert = 1; + + /* "pandas/tslib.pyx":890 + * bint utc_convert = 1 + * + * if tz is not None: # <<<<<<<<<<<<<< + * tz = maybe_get_tz(tz) + * + */ + __pyx_t_1 = (__pyx_v_tz != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":891 + * + * if tz is not None: + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * + * obj = _TSObject() + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":893 + * tz = maybe_get_tz(tz) + * + * obj = _TSObject() # <<<<<<<<<<<<<< + * + * if ts is None or ts is NaT or ts is np_NaT: + */ + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__TSObject)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":895 + * obj = _TSObject() + * + * if ts is None or ts is NaT or ts is np_NaT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * elif is_datetime64_object(ts): + */ + __pyx_t_2 = (__pyx_v_ts == Py_None); + if (!(__pyx_t_2 != 0)) { + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__pyx_v_ts == __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(__pyx_t_1 != 0)) { + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = (__pyx_v_ts == __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + } else { + __pyx_t_5 = (__pyx_t_1 != 0); + } + __pyx_t_1 = __pyx_t_5; + } else { + __pyx_t_1 = (__pyx_t_2 != 0); + } + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":896 + * + * if ts is None or ts is NaT or ts is np_NaT: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * elif is_datetime64_object(ts): + * if ts.view('i8') == iNaT: + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":897 + * if ts is None or ts is NaT or ts is np_NaT: + * obj.value = NPY_NAT + * elif is_datetime64_object(ts): # <<<<<<<<<<<<<< + * if ts.view('i8') == iNaT: + * obj.value = NPY_NAT + */ + __pyx_t_1 = (is_datetime64_object(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":898 + * obj.value = NPY_NAT + * elif is_datetime64_object(ts): + * if ts.view('i8') == iNaT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":899 + * elif is_datetime64_object(ts): + * if ts.view('i8') == iNaT: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * else: + * obj.value = _get_datetime64_nanos(ts) + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":901 + * obj.value = NPY_NAT + * else: + * obj.value = _get_datetime64_nanos(ts) # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * elif is_integer_object(ts): + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib__get_datetime64_nanos(__pyx_v_ts); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":902 + * else: + * obj.value = _get_datetime64_nanos(ts) + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * elif is_integer_object(ts): + * if ts == NPY_NAT: + */ + pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L5:; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":903 + * obj.value = _get_datetime64_nanos(ts) + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * elif is_integer_object(ts): # <<<<<<<<<<<<<< + * if ts == NPY_NAT: + * obj.value = NPY_NAT + */ + __pyx_t_1 = (is_integer_object(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":904 + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * elif is_integer_object(ts): + * if ts == NPY_NAT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_ts, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":905 + * elif is_integer_object(ts): + * if ts == NPY_NAT: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * else: + * ts = ts * cast_from_unit(None,unit) + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/tslib.pyx":907 + * obj.value = NPY_NAT + * else: + * ts = ts * cast_from_unit(None,unit) # <<<<<<<<<<<<<< + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib_cast_from_unit(Py_None, __pyx_v_unit, 0); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyNumber_Multiply(__pyx_v_ts, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":908 + * else: + * ts = ts * cast_from_unit(None,unit) + * obj.value = ts # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_float_object(ts): + */ + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":909 + * ts = ts * cast_from_unit(None,unit) + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * elif util.is_float_object(ts): + * if ts != ts or ts == NPY_NAT: + */ + __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_9 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + pandas_datetime_to_datetimestruct(__pyx_t_9, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L6:; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":910 + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_float_object(ts): # <<<<<<<<<<<<<< + * if ts != ts or ts == NPY_NAT: + * obj.value = NPY_NAT + */ + __pyx_t_1 = (is_float_object(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":911 + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_float_object(ts): + * if ts != ts or ts == NPY_NAT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_ts, __pyx_v_ts, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_1) { + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_ts, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __pyx_t_2; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":912 + * elif util.is_float_object(ts): + * if ts != ts or ts == NPY_NAT: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * else: + * ts = cast_from_unit(ts,unit) + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":914 + * obj.value = NPY_NAT + * else: + * ts = cast_from_unit(ts,unit) # <<<<<<<<<<<<<< + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib_cast_from_unit(__pyx_v_ts, __pyx_v_unit, 0); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":915 + * else: + * ts = cast_from_unit(ts,unit) + * obj.value = ts # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_string_object(ts): + */ + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":916 + * ts = cast_from_unit(ts,unit) + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * elif util.is_string_object(ts): + * if ts in _nat_strings: + */ + __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_9 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + pandas_datetime_to_datetimestruct(__pyx_t_9, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L7:; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":917 + * obj.value = ts + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_string_object(ts): # <<<<<<<<<<<<<< + * if ts in _nat_strings: + * obj.value = NPY_NAT + */ + __pyx_t_5 = (is_string_object(__pyx_v_ts) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":918 + * pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts) + * elif util.is_string_object(ts): + * if ts in _nat_strings: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_strings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_ts, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":919 + * elif util.is_string_object(ts): + * if ts in _nat_strings: + * obj.value = NPY_NAT # <<<<<<<<<<<<<< + * else: + * _string_to_dts(ts, &obj.dts) + */ + __pyx_v_obj->value = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/tslib.pyx":921 + * obj.value = NPY_NAT + * else: + * _string_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts) + * elif PyDateTime_Check(ts): + */ + __pyx_t_3 = __pyx_f_8datetime__string_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":922 + * else: + * _string_to_dts(ts, &obj.dts) + * obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * elif PyDateTime_Check(ts): + * if tz is not None: + */ + __pyx_v_obj->value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L8:; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":923 + * _string_to_dts(ts, &obj.dts) + * obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts) + * elif PyDateTime_Check(ts): # <<<<<<<<<<<<<< + * if tz is not None: + * # sort of a temporary hack + */ + __pyx_t_1 = (PyDateTime_Check(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":924 + * obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts) + * elif PyDateTime_Check(ts): + * if tz is not None: # <<<<<<<<<<<<<< + * # sort of a temporary hack + * if ts.tzinfo is not None: + */ + __pyx_t_1 = (__pyx_v_tz != Py_None); + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":926 + * if tz is not None: + * # sort of a temporary hack + * if ts.tzinfo is not None: # <<<<<<<<<<<<<< + * if (hasattr(tz, 'normalize') and + * hasattr(ts.tzinfo, '_utcoffset')): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_t_3 != Py_None); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":927 + * # sort of a temporary hack + * if ts.tzinfo is not None: + * if (hasattr(tz, 'normalize') and # <<<<<<<<<<<<<< + * hasattr(ts.tzinfo, '_utcoffset')): + * ts = tz.normalize(ts) + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_normalize); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if ((__pyx_t_1 != 0)) { + + /* "pandas/tslib.pyx":928 + * if ts.tzinfo is not None: + * if (hasattr(tz, 'normalize') and + * hasattr(ts.tzinfo, '_utcoffset')): # <<<<<<<<<<<<<< + * ts = tz.normalize(ts) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_HasAttr(__pyx_t_3, __pyx_n_s_utcoffset_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__pyx_t_5 != 0); + } else { + __pyx_t_2 = (__pyx_t_1 != 0); + } + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":929 + * if (hasattr(tz, 'normalize') and + * hasattr(ts.tzinfo, '_utcoffset')): + * ts = tz.normalize(ts) # <<<<<<<<<<<<<< + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_normalize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":930 + * hasattr(ts.tzinfo, '_utcoffset')): + * ts = tz.normalize(ts) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = ts.tzinfo + * else: #tzoffset + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":931 + * ts = tz.normalize(ts) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo # <<<<<<<<<<<<<< + * else: #tzoffset + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/tslib.pyx":933 + * obj.tzinfo = ts.tzinfo + * else: #tzoffset + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * ts_offset = _get_utcoffset(ts.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(ts_offset) + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":934 + * else: #tzoffset + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * ts_offset = _get_utcoffset(ts.tzinfo, ts) # <<<<<<<<<<<<<< + * obj.value -= _delta_to_nanoseconds(ts_offset) + * tz_offset = _get_utcoffset(tz, ts) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_t_6, __pyx_v_ts, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_ts_offset = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":935 + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * ts_offset = _get_utcoffset(ts.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(ts_offset) # <<<<<<<<<<<<<< + * tz_offset = _get_utcoffset(tz, ts) + * obj.value += _delta_to_nanoseconds(tz_offset) + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_ts_offset); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ts_offset); + __Pyx_GIVEREF(__pyx_v_ts_offset); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":936 + * ts_offset = _get_utcoffset(ts.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(ts_offset) + * tz_offset = _get_utcoffset(tz, ts) # <<<<<<<<<<<<<< + * obj.value += _delta_to_nanoseconds(tz_offset) + * pandas_datetime_to_datetimestruct(obj.value, + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, __pyx_v_ts, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_tz_offset = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":937 + * obj.value -= _delta_to_nanoseconds(ts_offset) + * tz_offset = _get_utcoffset(tz, ts) + * obj.value += _delta_to_nanoseconds(tz_offset) # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value, + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_tz_offset); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_tz_offset); + __Pyx_GIVEREF(__pyx_v_tz_offset); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":938 + * tz_offset = _get_utcoffset(tz, ts) + * obj.value += _delta_to_nanoseconds(tz_offset) + * pandas_datetime_to_datetimestruct(obj.value, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + */ + pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":940 + * pandas_datetime_to_datetimestruct(obj.value, + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * elif not _is_utc(tz): + * try: + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + } + __pyx_L11:; + goto __pyx_L10; + } + + /* "pandas/tslib.pyx":941 + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + * elif not _is_utc(tz): # <<<<<<<<<<<<<< + * try: + * ts = tz.localize(ts) + */ + __pyx_t_2 = ((!(__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0)) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":942 + * obj.tzinfo = tz + * elif not _is_utc(tz): + * try: # <<<<<<<<<<<<<< + * ts = tz.localize(ts) + * except AttributeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":943 + * elif not _is_utc(tz): + * try: + * ts = tz.localize(ts) # <<<<<<<<<<<<<< + * except AttributeError: + * ts = ts.replace(tzinfo=tz) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_localize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L19_try_end; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":944 + * try: + * ts = tz.localize(ts) + * except AttributeError: # <<<<<<<<<<<<<< + * ts = ts.replace(tzinfo=tz) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + */ + __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_14) { + __Pyx_AddTraceback("pandas.tslib.convert_to_tsobject", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":945 + * ts = tz.localize(ts) + * except AttributeError: + * ts = ts.replace(tzinfo=tz) # <<<<<<<<<<<<<< + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_replace); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __Pyx_GOTREF(__pyx_t_15); + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_tzinfo, __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_16); + __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L13_exception_handled; + } + goto __pyx_L14_except_error; + __pyx_L14_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L1_error; + __pyx_L13_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L19_try_end:; + } + + /* "pandas/tslib.pyx":946 + * except AttributeError: + * ts = ts.replace(tzinfo=tz) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = ts.tzinfo + * else: + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":947 + * ts = ts.replace(tzinfo=tz) + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo # <<<<<<<<<<<<<< + * else: + * # UTC + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L10; + } + /*else*/ { + + /* "pandas/tslib.pyx":950 + * else: + * # UTC + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = pytz.utc + * else: + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":951 + * # UTC + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = pytz.utc # <<<<<<<<<<<<<< + * else: + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_utc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L10:; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/tslib.pyx":953 + * obj.tzinfo = pytz.utc + * else: + * obj.value = _pydatetime_to_dts(ts, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = ts.tzinfo + * + */ + __pyx_v_obj->value = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":954 + * else: + * obj.value = _pydatetime_to_dts(ts, &obj.dts) + * obj.tzinfo = ts.tzinfo # <<<<<<<<<<<<<< + * + * if obj.tzinfo is not None and not _is_utc(obj.tzinfo): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L9:; + + /* "pandas/tslib.pyx":956 + * obj.tzinfo = ts.tzinfo + * + * if obj.tzinfo is not None and not _is_utc(obj.tzinfo): # <<<<<<<<<<<<<< + * offset = _get_utcoffset(obj.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(offset) + */ + __pyx_t_2 = (__pyx_v_obj->tzinfo != Py_None); + if ((__pyx_t_2 != 0)) { + __pyx_t_6 = __pyx_v_obj->tzinfo; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = ((!(__pyx_f_6pandas_5tslib__is_utc(__pyx_t_6) != 0)) != 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __pyx_t_1; + } else { + __pyx_t_5 = (__pyx_t_2 != 0); + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":957 + * + * if obj.tzinfo is not None and not _is_utc(obj.tzinfo): + * offset = _get_utcoffset(obj.tzinfo, ts) # <<<<<<<<<<<<<< + * obj.value -= _delta_to_nanoseconds(offset) + * + */ + __pyx_t_6 = __pyx_v_obj->tzinfo; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_t_6, __pyx_v_ts, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_offset = __pyx_t_7; + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":958 + * if obj.tzinfo is not None and not _is_utc(obj.tzinfo): + * offset = _get_utcoffset(obj.tzinfo, ts) + * obj.value -= _delta_to_nanoseconds(offset) # <<<<<<<<<<<<<< + * + * if is_timestamp(ts): + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_delta_to_nanoseconds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_offset); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_offset); + __Pyx_GIVEREF(__pyx_v_offset); + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_7, __pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_obj->value = __pyx_t_8; + goto __pyx_L22; + } + __pyx_L22:; + + /* "pandas/tslib.pyx":960 + * obj.value -= _delta_to_nanoseconds(offset) + * + * if is_timestamp(ts): # <<<<<<<<<<<<<< + * obj.value += ts.nanosecond + * obj.dts.ps = ts.nanosecond * 1000 + */ + __pyx_t_5 = (__pyx_f_6pandas_5tslib_is_timestamp(__pyx_v_ts) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":961 + * + * if is_timestamp(ts): + * obj.value += ts.nanosecond # <<<<<<<<<<<<<< + * obj.dts.ps = ts.nanosecond * 1000 + * _check_dts_bounds(&obj.dts) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_obj->value = __pyx_t_8; + + /* "pandas/tslib.pyx":962 + * if is_timestamp(ts): + * obj.value += ts.nanosecond + * obj.dts.ps = ts.nanosecond * 1000 # <<<<<<<<<<<<<< + * _check_dts_bounds(&obj.dts) + * return obj + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_nanosecond); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_16 = PyNumber_Multiply(__pyx_t_7, __pyx_int_1000); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_17 = __Pyx_PyInt_As_npy_int32(__pyx_t_16); if (unlikely((__pyx_t_17 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_obj->dts.ps = __pyx_t_17; + goto __pyx_L23; + } + __pyx_L23:; + + /* "pandas/tslib.pyx":963 + * obj.value += ts.nanosecond + * obj.dts.ps = ts.nanosecond * 1000 + * _check_dts_bounds(&obj.dts) # <<<<<<<<<<<<<< + * return obj + * elif PyDate_Check(ts): + */ + __pyx_t_16 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":964 + * obj.dts.ps = ts.nanosecond * 1000 + * _check_dts_bounds(&obj.dts) + * return obj # <<<<<<<<<<<<<< + * elif PyDate_Check(ts): + * # Keep the converter same as PyDateTime's + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_obj)); + __pyx_r = ((PyObject *)__pyx_v_obj); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":965 + * _check_dts_bounds(&obj.dts) + * return obj + * elif PyDate_Check(ts): # <<<<<<<<<<<<<< + * # Keep the converter same as PyDateTime's + * ts = datetime.combine(ts, datetime_time()) + */ + __pyx_t_5 = (PyDate_Check(__pyx_v_ts) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":967 + * elif PyDate_Check(ts): + * # Keep the converter same as PyDateTime's + * ts = datetime.combine(ts, datetime_time()) # <<<<<<<<<<<<<< + * return convert_to_tsobject(ts, tz, None) + * else: + */ + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s_combine); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_time); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":968 + * # Keep the converter same as PyDateTime's + * ts = datetime.combine(ts, datetime_time()) + * return convert_to_tsobject(ts, tz, None) # <<<<<<<<<<<<<< + * else: + * raise ValueError("Could not construct Timestamp from argument %s" % + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_ts, __pyx_v_tz, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":970 + * return convert_to_tsobject(ts, tz, None) + * else: + * raise ValueError("Could not construct Timestamp from argument %s" % # <<<<<<<<<<<<<< + * type(ts)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Could_not_construct_Timestamp_fr, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L4:; + + /* "pandas/tslib.pyx":973 + * type(ts)) + * + * if obj.value != NPY_NAT: # <<<<<<<<<<<<<< + * _check_dts_bounds(&obj.dts) + * + */ + __pyx_t_5 = ((__pyx_v_obj->value != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":974 + * + * if obj.value != NPY_NAT: + * _check_dts_bounds(&obj.dts) # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L24; + } + __pyx_L24:; + + /* "pandas/tslib.pyx":976 + * _check_dts_bounds(&obj.dts) + * + * if tz is not None: # <<<<<<<<<<<<<< + * _localize_tso(obj, tz) + * + */ + __pyx_t_5 = (__pyx_v_tz != Py_None); + __pyx_t_2 = (__pyx_t_5 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":977 + * + * if tz is not None: + * _localize_tso(obj, tz) # <<<<<<<<<<<<<< + * + * return obj + */ + __pyx_f_6pandas_5tslib__localize_tso(__pyx_v_obj, __pyx_v_tz); + goto __pyx_L25; + } + __pyx_L25:; + + /* "pandas/tslib.pyx":979 + * _localize_tso(obj, tz) + * + * return obj # <<<<<<<<<<<<<< + * + * cdef inline void _localize_tso(_TSObject obj, object tz): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_obj)); + __pyx_r = ((PyObject *)__pyx_v_obj); + goto __pyx_L0; + + /* "pandas/tslib.pyx":875 + * + * # helper to extract datetime and int64 from several different possibilities + * cdef convert_to_tsobject(object ts, object tz, object unit): # <<<<<<<<<<<<<< + * """ + * Extract datetime and int64 from any of: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("pandas.tslib.convert_to_tsobject", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_ts_offset); + __Pyx_XDECREF(__pyx_v_tz_offset); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XDECREF(__pyx_v_ts); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":981 + * return obj + * + * cdef inline void _localize_tso(_TSObject obj, object tz): # <<<<<<<<<<<<<< + * ''' + * Take a TSObject in UTC and localizes to timezone tz. + */ + +static CYTHON_INLINE void __pyx_f_6pandas_5tslib__localize_tso(struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_obj, PyObject *__pyx_v_tz) { + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v_trans = NULL; + PyObject *__pyx_v_deltas = NULL; + PyObject *__pyx_v_pos = NULL; + PyObject *__pyx_v_inf = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + npy_datetime __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_localize_tso", 0); + + /* "pandas/tslib.pyx":985 + * Take a TSObject in UTC and localizes to timezone tz. + * ''' + * if _is_utc(tz): # <<<<<<<<<<<<<< + * obj.tzinfo = tz + * elif _is_tzlocal(tz): + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":986 + * ''' + * if _is_utc(tz): + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz): + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":987 + * if _is_utc(tz): + * obj.tzinfo = tz + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":988 + * obj.tzinfo = tz + * elif _is_tzlocal(tz): + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + */ + pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":989 + * elif _is_tzlocal(tz): + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, # <<<<<<<<<<<<<< + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.month); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.hour); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":990 + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(obj.value + delta, + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.sec); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_obj->dts.us); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + + /* "pandas/tslib.pyx":989 + * elif _is_tzlocal(tz): + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, # <<<<<<<<<<<<<< + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dt = ((PyDateTime_DateTime *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":991 + * dt = datetime(obj.dts.year, obj.dts.month, obj.dts.day, obj.dts.hour, + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value + delta, + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Multiply(__pyx_t_9, __pyx_int_1000000000); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_delta = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":992 + * obj.dts.min, obj.dts.sec, obj.dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(obj.value + delta, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_delta); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_10 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":993 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(obj.value + delta, + * PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = tz + * else: + */ + pandas_datetime_to_datetimestruct(__pyx_t_10, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":994 + * pandas_datetime_to_datetimestruct(obj.value + delta, + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":997 + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * pos = trans.searchsorted(obj.value, side='right') - 1 + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_trans = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":998 + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(obj.value, side='right') - 1 + * + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_deltas = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":999 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * pos = trans.searchsorted(obj.value, side='right') - 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Subtract(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_pos = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1003 + * + * # static/pytz/dateutil specific code + * if _is_fixed_offset(tz): # <<<<<<<<<<<<<< + * # statictzinfo + * if len(deltas) > 0: + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__is_fixed_offset(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1005 + * if _is_fixed_offset(tz): + * # statictzinfo + * if len(deltas) > 0: # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value + deltas[0], + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_11 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((__pyx_t_11 > 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1006 + * # statictzinfo + * if len(deltas) > 0: + * pandas_datetime_to_datetimestruct(obj.value + deltas[0], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * else: + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_deltas, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_10 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1007 + * if len(deltas) > 0: + * pandas_datetime_to_datetimestruct(obj.value + deltas[0], + * PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * else: + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + */ + pandas_datetime_to_datetimestruct(__pyx_t_10, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1009 + * PANDAS_FR_ns, &obj.dts) + * else: + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = tz + * elif _treat_tz_as_pytz(tz): + */ + pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + } + __pyx_L5:; + + /* "pandas/tslib.pyx":1010 + * else: + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * elif _treat_tz_as_pytz(tz): + * inf = tz._transition_info[pos] + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":1011 + * pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + * elif _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * inf = tz._transition_info[pos] + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1012 + * obj.tzinfo = tz + * elif _treat_tz_as_pytz(tz): + * inf = tz._transition_info[pos] # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyObject_GetItem(__pyx_t_7, __pyx_v_pos); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_inf = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1013 + * elif _treat_tz_as_pytz(tz): + * inf = tz._transition_info[pos] + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz._tzinfos[inf] + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_10 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1014 + * inf = tz._transition_info[pos] + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = tz._tzinfos[inf] + * elif _treat_tz_as_dateutil(tz): + */ + pandas_datetime_to_datetimestruct(__pyx_t_10, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":1015 + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz._tzinfos[inf] # <<<<<<<<<<<<<< + * elif _treat_tz_as_dateutil(tz): + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_tzinfos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyObject_GetItem(__pyx_t_8, __pyx_v_inf); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":1016 + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz._tzinfos[inf] + * elif _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1017 + * obj.tzinfo = tz._tzinfos[inf] + * elif _treat_tz_as_dateutil(tz): + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_10 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1018 + * elif _treat_tz_as_dateutil(tz): + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) # <<<<<<<<<<<<<< + * obj.tzinfo = tz + * else: + */ + pandas_datetime_to_datetimestruct(__pyx_t_10, PANDAS_FR_ns, (&__pyx_v_obj->dts)); + + /* "pandas/tslib.pyx":1019 + * pandas_datetime_to_datetimestruct(obj.value + deltas[pos], + * PANDAS_FR_ns, &obj.dts) + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * else: + * obj.tzinfo = tz + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":1021 + * obj.tzinfo = tz + * else: + * obj.tzinfo = tz # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_GOTREF(__pyx_v_obj->tzinfo); + __Pyx_DECREF(__pyx_v_obj->tzinfo); + __pyx_v_obj->tzinfo = __pyx_v_tz; + } + __pyx_L4:; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":981 + * return obj + * + * cdef inline void _localize_tso(_TSObject obj, object tz): # <<<<<<<<<<<<<< + * ''' + * Take a TSObject in UTC and localizes to timezone tz. + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_WriteUnraisable("pandas.tslib._localize_tso", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v_trans); + __Pyx_XDECREF(__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pos); + __Pyx_XDECREF(__pyx_v_inf); + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/tslib.pyx":1024 + * + * + * def get_timezone(tz): # <<<<<<<<<<<<<< + * return _get_zone(tz) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_17get_timezone(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_17get_timezone = {__Pyx_NAMESTR("get_timezone"), (PyCFunction)__pyx_pw_6pandas_5tslib_17get_timezone, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_17get_timezone(PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_timezone (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_16get_timezone(__pyx_self, ((PyObject *)__pyx_v_tz)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_16get_timezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_timezone", 0); + + /* "pandas/tslib.pyx":1025 + * + * def get_timezone(tz): + * return _get_zone(tz) # <<<<<<<<<<<<<< + * + * cdef inline bint _is_utc(object tz): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1024 + * + * + * def get_timezone(tz): # <<<<<<<<<<<<<< + * return _get_zone(tz) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.get_timezone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1027 + * return _get_zone(tz) + * + * cdef inline bint _is_utc(object tz): # <<<<<<<<<<<<<< + * return tz is UTC or isinstance(tz, _dateutil_tzutc) + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__is_utc(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_is_utc", 0); + + /* "pandas/tslib.pyx":1028 + * + * cdef inline bint _is_utc(object tz): + * return tz is UTC or isinstance(tz, _dateutil_tzutc) # <<<<<<<<<<<<<< + * + * cdef inline object _get_zone(object tz): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UTC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_v_tz == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_tzutc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_r = __pyx_t_4; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1027 + * return _get_zone(tz) + * + * cdef inline bint _is_utc(object tz): # <<<<<<<<<<<<<< + * return tz is UTC or isinstance(tz, _dateutil_tzutc) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("pandas.tslib._is_utc", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1030 + * return tz is UTC or isinstance(tz, _dateutil_tzutc) + * + * cdef inline object _get_zone(object tz): # <<<<<<<<<<<<<< + * ''' + * We need to do several things here: + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__get_zone(PyObject *__pyx_v_tz) { + PyObject *__pyx_v_zone = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_zone", 0); + + /* "pandas/tslib.pyx":1040 + * string so that we can serialize it with UJSON/pytables. maybe_get_tz (below) is the inverse of this process. + * ''' + * if _is_utc(tz): # <<<<<<<<<<<<<< + * return 'UTC' + * else: + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1041 + * ''' + * if _is_utc(tz): + * return 'UTC' # <<<<<<<<<<<<<< + * else: + * if _treat_tz_as_dateutil(tz): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_UTC); + __pyx_r = __pyx_n_s_UTC; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1043 + * return 'UTC' + * else: + * if _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1044 + * else: + * if _treat_tz_as_dateutil(tz): + * if '.tar.gz' in tz._filename: # <<<<<<<<<<<<<< + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_kp_s_tar_gz, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1045 + * if _treat_tz_as_dateutil(tz): + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' # <<<<<<<<<<<<<< + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1048 + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + * return 'dateutil/' + tz._filename # <<<<<<<<<<<<<< + * else: + * # tz is a pytz timezone or unknown. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_kp_s_dateutil, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1051 + * else: + * # tz is a pytz timezone or unknown. + * try: # <<<<<<<<<<<<<< + * zone = tz.zone + * if zone is None: + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/tslib.pyx":1052 + * # tz is a pytz timezone or unknown. + * try: + * zone = tz.zone # <<<<<<<<<<<<<< + * if zone is None: + * return tz + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_zone = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1053 + * try: + * zone = tz.zone + * if zone is None: # <<<<<<<<<<<<<< + * return tz + * return zone + */ + __pyx_t_3 = (__pyx_v_zone == Py_None); + __pyx_t_1 = (__pyx_t_3 != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1054 + * zone = tz.zone + * if zone is None: + * return tz # <<<<<<<<<<<<<< + * return zone + * except AttributeError: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tz); + __pyx_r = __pyx_v_tz; + goto __pyx_L10_try_return; + } + + /* "pandas/tslib.pyx":1055 + * if zone is None: + * return tz + * return zone # <<<<<<<<<<<<<< + * except AttributeError: + * return tz + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_zone); + __pyx_r = __pyx_v_zone; + goto __pyx_L10_try_return; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1056 + * return tz + * return zone + * except AttributeError: # <<<<<<<<<<<<<< + * return tz + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.tslib._get_zone", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1057 + * return zone + * except AttributeError: + * return tz # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tz); + __pyx_r = __pyx_v_tz; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L10_try_return:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L0; + __pyx_L9_except_return:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L0; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L13_try_end:; + } + } + } + + /* "pandas/tslib.pyx":1030 + * return tz is UTC or isinstance(tz, _dateutil_tzutc) + * + * cdef inline object _get_zone(object tz): # <<<<<<<<<<<<<< + * ''' + * We need to do several things here: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("pandas.tslib._get_zone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_zone); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1060 + * + * + * cpdef inline object maybe_get_tz(object tz): # <<<<<<<<<<<<<< + * ''' + * (Maybe) Construct a timezone object from a string. If tz is a string, use it to construct a timezone object. + */ + +static PyObject *__pyx_pw_6pandas_5tslib_19maybe_get_tz(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_maybe_get_tz(PyObject *__pyx_v_tz, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_zone = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_get_tz", 0); + __Pyx_INCREF(__pyx_v_tz); + + /* "pandas/tslib.pyx":1065 + * Otherwise, just return tz. + * ''' + * if isinstance(tz, string_types): # <<<<<<<<<<<<<< + * if tz.startswith('dateutil/'): + * zone = tz[9:] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_string_types); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1066 + * ''' + * if isinstance(tz, string_types): + * if tz.startswith('dateutil/'): # <<<<<<<<<<<<<< + * zone = tz[9:] + * tz = _dateutil_gettz(tz[9:]) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1067 + * if isinstance(tz, string_types): + * if tz.startswith('dateutil/'): + * zone = tz[9:] # <<<<<<<<<<<<<< + * tz = _dateutil_gettz(tz[9:]) + * # On Python 3 on Windows, the filename is not always set correctly. + */ + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_tz, 9, 0, NULL, NULL, &__pyx_slice__33, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_zone = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1068 + * if tz.startswith('dateutil/'): + * zone = tz[9:] + * tz = _dateutil_gettz(tz[9:]) # <<<<<<<<<<<<<< + * # On Python 3 on Windows, the filename is not always set correctly. + * if isinstance(tz, _dateutil_tzfile) and '.tar.gz' in tz._filename: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_gettz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_tz, 9, 0, NULL, NULL, &__pyx_slice__34, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1070 + * tz = _dateutil_gettz(tz[9:]) + * # On Python 3 on Windows, the filename is not always set correctly. + * if isinstance(tz, _dateutil_tzfile) and '.tar.gz' in tz._filename: # <<<<<<<<<<<<<< + * tz._filename = zone + * else: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_tzfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if ((__pyx_t_3 != 0)) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_kp_s_tar_gz, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = (__pyx_t_2 != 0); + } else { + __pyx_t_6 = (__pyx_t_3 != 0); + } + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":1071 + * # On Python 3 on Windows, the filename is not always set correctly. + * if isinstance(tz, _dateutil_tzfile) and '.tar.gz' in tz._filename: + * tz._filename = zone # <<<<<<<<<<<<<< + * else: + * tz = pytz.timezone(tz) + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_tz, __pyx_n_s_filename, __pyx_v_zone) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":1073 + * tz._filename = zone + * else: + * tz = pytz.timezone(tz) # <<<<<<<<<<<<<< + * return tz + * else: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timezone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":1074 + * else: + * tz = pytz.timezone(tz) + * return tz # <<<<<<<<<<<<<< + * else: + * return tz + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tz); + __pyx_r = __pyx_v_tz; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1076 + * return tz + * else: + * return tz # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tz); + __pyx_r = __pyx_v_tz; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1060 + * + * + * cpdef inline object maybe_get_tz(object tz): # <<<<<<<<<<<<<< + * ''' + * (Maybe) Construct a timezone object from a string. If tz is a string, use it to construct a timezone object. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.maybe_get_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_zone); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_19maybe_get_tz(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/ +static char __pyx_doc_6pandas_5tslib_18maybe_get_tz[] = "\n (Maybe) Construct a timezone object from a string. If tz is a string, use it to construct a timezone object.\n Otherwise, just return tz.\n "; +static PyObject *__pyx_pw_6pandas_5tslib_19maybe_get_tz(PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("maybe_get_tz (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_18maybe_get_tz(__pyx_self, ((PyObject *)__pyx_v_tz)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_18maybe_get_tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("maybe_get_tz", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.maybe_get_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1082 + * pass + * + * cdef inline _check_dts_bounds(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * cdef: + * bint error = False + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__check_dts_bounds(pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_error; + PyObject *__pyx_v_fmt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_dts_bounds", 0); + + /* "pandas/tslib.pyx":1084 + * cdef inline _check_dts_bounds(pandas_datetimestruct *dts): + * cdef: + * bint error = False # <<<<<<<<<<<<<< + * + * if dts.year <= 1677 and cmp_pandas_datetimestruct(dts, &_NS_MIN_DTS) == -1: + */ + __pyx_v_error = 0; + + /* "pandas/tslib.pyx":1086 + * bint error = False + * + * if dts.year <= 1677 and cmp_pandas_datetimestruct(dts, &_NS_MIN_DTS) == -1: # <<<<<<<<<<<<<< + * error = True + * elif ( + */ + __pyx_t_1 = ((__pyx_v_dts->year <= 1677) != 0); + if (__pyx_t_1) { + __pyx_t_2 = ((cmp_pandas_datetimestruct(__pyx_v_dts, (&__pyx_v_6pandas_5tslib__NS_MIN_DTS)) == -1) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1087 + * + * if dts.year <= 1677 and cmp_pandas_datetimestruct(dts, &_NS_MIN_DTS) == -1: + * error = True # <<<<<<<<<<<<<< + * elif ( + * dts.year >= 2262 and + */ + __pyx_v_error = 1; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1089 + * error = True + * elif ( + * dts.year >= 2262 and # <<<<<<<<<<<<<< + * cmp_pandas_datetimestruct(dts, &_NS_MAX_DTS) == 1): + * error = True + */ + __pyx_t_3 = ((__pyx_v_dts->year >= 2262) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1090 + * elif ( + * dts.year >= 2262 and + * cmp_pandas_datetimestruct(dts, &_NS_MAX_DTS) == 1): # <<<<<<<<<<<<<< + * error = True + * + */ + __pyx_t_1 = ((cmp_pandas_datetimestruct(__pyx_v_dts, (&__pyx_v_6pandas_5tslib__NS_MAX_DTS)) == 1) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1091 + * dts.year >= 2262 and + * cmp_pandas_datetimestruct(dts, &_NS_MAX_DTS) == 1): + * error = True # <<<<<<<<<<<<<< + * + * if error: + */ + __pyx_v_error = 1; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1093 + * error = True + * + * if error: # <<<<<<<<<<<<<< + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, + * dts.day, dts.hour, + */ + __pyx_t_2 = (__pyx_v_error != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1094 + * + * if error: + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec) + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts->year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":1095 + * if error: + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, + * dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec) + * + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->hour); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1096 + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec) # <<<<<<<<<<<<<< + * + * raise OutOfBoundsDatetime('Out of bounds nanosecond timestamp: %s' % fmt) + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->min); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts->sec); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1094 + * + * if error: + * fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec) + */ + __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_d_2d_2d_2d_2d_2d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_fmt = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1098 + * dts.min, dts.sec) + * + * raise OutOfBoundsDatetime('Out of bounds nanosecond timestamp: %s' % fmt) # <<<<<<<<<<<<<< + * + * # elif isinstance(ts, _Timestamp): + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_nanosecond_timesta, __pyx_v_fmt); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1082 + * pass + * + * cdef inline _check_dts_bounds(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * cdef: + * bint error = False + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("pandas.tslib._check_dts_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fmt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1109 + * # obj.dtval = _dts_to_pydatetime(&obj.dts) + * + * def datetime_to_datetime64(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_21datetime_to_datetime64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_21datetime_to_datetime64 = {__Pyx_NAMESTR("datetime_to_datetime64"), (PyCFunction)__pyx_pw_6pandas_5tslib_21datetime_to_datetime64, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_21datetime_to_datetime64(PyObject *__pyx_self, PyObject *__pyx_v_values) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_to_datetime64 (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_20datetime_to_datetime64(__pyx_self, ((PyArrayObject *)__pyx_v_values)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_20datetime_to_datetime64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_inferred_tz = 0; + PyArrayObject *__pyx_v_iresult = 0; + pandas_datetimestruct __pyx_v_dts; + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v__ts = 0; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + __pyx_t_5numpy_int64_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("datetime_to_datetime64", 0); + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1111 + * def datetime_to_datetime64(ndarray[object] values): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * object val, inferred_tz = None + * ndarray[int64_t] iresult + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":1112 + * cdef: + * Py_ssize_t i, n = len(values) + * object val, inferred_tz = None # <<<<<<<<<<<<<< + * ndarray[int64_t] iresult + * pandas_datetimestruct dts + */ + __Pyx_INCREF(Py_None); + __pyx_v_inferred_tz = Py_None; + + /* "pandas/tslib.pyx":1117 + * _TSObject _ts + * + * result = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * iresult = result.view('i8') + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1118 + * + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1119 + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * if _checknull_with_nat(val): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":1120 + * iresult = result.view('i8') + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * if _checknull_with_nat(val): + * iresult[i] = iNaT + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1121 + * for i in range(n): + * val = values[i] + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * elif PyDateTime_Check(val): + */ + __pyx_t_13 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":1122 + * val = values[i] + * if _checknull_with_nat(val): + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * elif PyDateTime_Check(val): + * if val.tzinfo is not None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_14 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_14; + goto __pyx_L5; + } + + /* "pandas/tslib.pyx":1123 + * if _checknull_with_nat(val): + * iresult[i] = iNaT + * elif PyDateTime_Check(val): # <<<<<<<<<<<<<< + * if val.tzinfo is not None: + * if inferred_tz is not None: + */ + __pyx_t_13 = (PyDateTime_Check(__pyx_v_val) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":1124 + * iresult[i] = iNaT + * elif PyDateTime_Check(val): + * if val.tzinfo is not None: # <<<<<<<<<<<<<< + * if inferred_tz is not None: + * if _get_zone(val.tzinfo) != inferred_tz: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = (__pyx_t_13 != 0); + if (__pyx_t_16) { + + /* "pandas/tslib.pyx":1125 + * elif PyDateTime_Check(val): + * if val.tzinfo is not None: + * if inferred_tz is not None: # <<<<<<<<<<<<<< + * if _get_zone(val.tzinfo) != inferred_tz: + * raise ValueError('Array must be all same time zone') + */ + __pyx_t_16 = (__pyx_v_inferred_tz != Py_None); + __pyx_t_13 = (__pyx_t_16 != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":1126 + * if val.tzinfo is not None: + * if inferred_tz is not None: + * if _get_zone(val.tzinfo) != inferred_tz: # <<<<<<<<<<<<<< + * raise ValueError('Array must be all same time zone') + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib__get_zone(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_v_inferred_tz, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":1127 + * if inferred_tz is not None: + * if _get_zone(val.tzinfo) != inferred_tz: + * raise ValueError('Array must be all same time zone') # <<<<<<<<<<<<<< + * else: + * inferred_tz = _get_zone(val.tzinfo) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":1129 + * raise ValueError('Array must be all same time zone') + * else: + * inferred_tz = _get_zone(val.tzinfo) # <<<<<<<<<<<<<< + * + * _ts = convert_to_tsobject(val, None, None) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib__get_zone(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_inferred_tz, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L7:; + + /* "pandas/tslib.pyx":1131 + * inferred_tz = _get_zone(val.tzinfo) + * + * _ts = convert_to_tsobject(val, None, None) # <<<<<<<<<<<<<< + * iresult[i] = _ts.value + * _check_dts_bounds(&_ts.dts) + */ + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_val, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v__ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1132 + * + * _ts = convert_to_tsobject(val, None, None) + * iresult[i] = _ts.value # <<<<<<<<<<<<<< + * _check_dts_bounds(&_ts.dts) + * else: + */ + __pyx_t_14 = __pyx_v__ts->value; + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_14; + + /* "pandas/tslib.pyx":1133 + * _ts = convert_to_tsobject(val, None, None) + * iresult[i] = _ts.value + * _check_dts_bounds(&_ts.dts) # <<<<<<<<<<<<<< + * else: + * if inferred_tz is not None: + */ + __pyx_t_5 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v__ts->dts)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/tslib.pyx":1135 + * _check_dts_bounds(&_ts.dts) + * else: + * if inferred_tz is not None: # <<<<<<<<<<<<<< + * raise ValueError('Cannot mix tz-aware with tz-naive values') + * iresult[i] = _pydatetime_to_dts(val, &dts) + */ + __pyx_t_13 = (__pyx_v_inferred_tz != Py_None); + __pyx_t_16 = (__pyx_t_13 != 0); + if (__pyx_t_16) { + + /* "pandas/tslib.pyx":1136 + * else: + * if inferred_tz is not None: + * raise ValueError('Cannot mix tz-aware with tz-naive values') # <<<<<<<<<<<<<< + * iresult[i] = _pydatetime_to_dts(val, &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1137 + * if inferred_tz is not None: + * raise ValueError('Cannot mix tz-aware with tz-naive values') + * iresult[i] = _pydatetime_to_dts(val, &dts) # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * else: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_val, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1138 + * raise ValueError('Cannot mix tz-aware with tz-naive values') + * iresult[i] = _pydatetime_to_dts(val, &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * else: + * raise TypeError('Unrecognized value type: %s' % type(val)) + */ + __pyx_t_5 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1140 + * _check_dts_bounds(&dts) + * else: + * raise TypeError('Unrecognized value type: %s' % type(val)) # <<<<<<<<<<<<<< + * + * return result, inferred_tz + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_value_type_s, ((PyObject *)Py_TYPE(__pyx_v_val))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + } + + /* "pandas/tslib.pyx":1142 + * raise TypeError('Unrecognized value type: %s' % type(val)) + * + * return result, inferred_tz # <<<<<<<<<<<<<< + * + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_INCREF(__pyx_v_inferred_tz); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_inferred_tz); + __Pyx_GIVEREF(__pyx_v_inferred_tz); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1109 + * # obj.dtval = _dts_to_pydatetime(&obj.dts) + * + * def datetime_to_datetime64(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.datetime_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_inferred_tz); + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF((PyObject *)__pyx_v__ts); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1146 + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + * + * def _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * if date_string.startswith('0'): + * # Strings starting with 0 are more consistent with a + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_23_does_string_look_like_datetime(PyObject *__pyx_self, PyObject *__pyx_v_date_string); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_23_does_string_look_like_datetime = {__Pyx_NAMESTR("_does_string_look_like_datetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_23_does_string_look_like_datetime, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_23_does_string_look_like_datetime(PyObject *__pyx_self, PyObject *__pyx_v_date_string) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_does_string_look_like_datetime (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_22_does_string_look_like_datetime(__pyx_self, ((PyObject *)__pyx_v_date_string)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_22_does_string_look_like_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + double __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_does_string_look_like_datetime", 0); + + /* "pandas/tslib.pyx":1147 + * + * def _does_string_look_like_datetime(date_string): + * if date_string.startswith('0'): # <<<<<<<<<<<<<< + * # Strings starting with 0 are more consistent with a + * # date-like string than a number + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_date_string, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1150 + * # Strings starting with 0 are more consistent with a + * # date-like string than a number + * return True # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1152 + * return True + * + * try: # <<<<<<<<<<<<<< + * if float(date_string) < 1000: + * return False + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/tslib.pyx":1153 + * + * try: + * if float(date_string) < 1000: # <<<<<<<<<<<<<< + * return False + * except ValueError: + */ + __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_date_string); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_3 = ((__pyx_t_7 < 1000.0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1154 + * try: + * if float(date_string) < 1000: + * return False # <<<<<<<<<<<<<< + * except ValueError: + * pass + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L8_try_return; + } + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1155 + * if float(date_string) < 1000: + * return False + * except ValueError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_8) { + PyErr_Restore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L8_try_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L11_try_end:; + } + + /* "pandas/tslib.pyx":1158 + * pass + * + * if date_string in _not_datelike_strings: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_not_datelike_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_date_string, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = (__pyx_t_3 != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1159 + * + * if date_string in _not_datelike_strings: + * return False # <<<<<<<<<<<<<< + * + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1161 + * return False + * + * return True # <<<<<<<<<<<<<< + * + * def parse_datetime_string(date_string, **kwargs): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1146 + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + * + * def _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * if date_string.startswith('0'): + * # Strings starting with 0 are more consistent with a + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib._does_string_look_like_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1163 + * return True + * + * def parse_datetime_string(date_string, **kwargs): # <<<<<<<<<<<<<< + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_25parse_datetime_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_25parse_datetime_string = {__Pyx_NAMESTR("parse_datetime_string"), (PyCFunction)__pyx_pw_6pandas_5tslib_25parse_datetime_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_25parse_datetime_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_date_string = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parse_datetime_string (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_date_string,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_date_string)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "parse_datetime_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_date_string = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("parse_datetime_string", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("pandas.tslib.parse_datetime_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_24parse_datetime_string(__pyx_self, __pyx_v_date_string, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_24parse_datetime_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_string, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_v_dt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_datetime_string", 0); + + /* "pandas/tslib.pyx":1164 + * + * def parse_datetime_string(date_string, **kwargs): + * if not _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * raise ValueError('Given date string not likely a datetime.') + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_does_string_look_like_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_date_string); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_date_string); + __Pyx_GIVEREF(__pyx_v_date_string); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1165 + * def parse_datetime_string(date_string, **kwargs): + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') # <<<<<<<<<<<<<< + * + * dt = parse_date(date_string, **kwargs) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1167 + * raise ValueError('Given date string not likely a datetime.') + * + * dt = parse_date(date_string, **kwargs) # <<<<<<<<<<<<<< + * return dt + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_date); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_date_string); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_date_string); + __Pyx_GIVEREF(__pyx_v_date_string); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dt = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1168 + * + * dt = parse_date(date_string, **kwargs) + * return dt # <<<<<<<<<<<<<< + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dt); + __pyx_r = __pyx_v_dt; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1163 + * return True + * + * def parse_datetime_string(date_string, **kwargs): # <<<<<<<<<<<<<< + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.parse_datetime_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_27array_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_27array_to_datetime = {__Pyx_NAMESTR("array_to_datetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_27array_to_datetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_27array_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_raise_ = 0; + PyObject *__pyx_v_dayfirst = 0; + CYTHON_UNUSED PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_utc = 0; + PyObject *__pyx_v_coerce = 0; + PyObject *__pyx_v_unit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("array_to_datetime (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_raise,&__pyx_n_s_dayfirst,&__pyx_n_s_format,&__pyx_n_s_utc,&__pyx_n_s_coerce,&__pyx_n_s_unit,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)Py_False); + + /* "pandas/tslib.pyx":1171 + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, + * format=None, utc=None, coerce=False, unit=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)Py_False); + values[6] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_raise); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dayfirst); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_utc); + if (value) { values[4] = value; kw_args--; } + } + case 5: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce); + if (value) { values[5] = value; kw_args--; } + } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit); + if (value) { values[6] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array_to_datetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_raise_ = values[1]; + __pyx_v_dayfirst = values[2]; + __pyx_v_format = values[3]; + __pyx_v_utc = values[4]; + __pyx_v_coerce = values[5]; + __pyx_v_unit = values[6]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("array_to_datetime", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_26array_to_datetime(__pyx_self, __pyx_v_values, __pyx_v_raise_, __pyx_v_dayfirst, __pyx_v_format, __pyx_v_utc, __pyx_v_coerce, __pyx_v_unit); + + /* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_26array_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_raise_, PyObject *__pyx_v_dayfirst, CYTHON_UNUSED PyObject *__pyx_v_format, PyObject *__pyx_v_utc, PyObject *__pyx_v_coerce, PyObject *__pyx_v_unit) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_py_dt = 0; + PyArrayObject *__pyx_v_iresult = 0; + PyArrayObject *__pyx_v_oresult = 0; + pandas_datetimestruct __pyx_v_dts; + int __pyx_v_utc_convert; + int __pyx_v_seen_integer; + int __pyx_v_seen_datetime; + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v__ts = 0; + __pyx_t_5numpy_int64_t __pyx_v_m; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_oresult; + __Pyx_Buffer __pyx_pybuffer_oresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + __pyx_t_5numpy_int64_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + int __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + PyObject *__pyx_t_38 = NULL; + PyObject *__pyx_t_39 = NULL; + PyObject *__pyx_t_40 = NULL; + PyObject *__pyx_t_41 = NULL; + PyObject *__pyx_t_42 = NULL; + PyObject *__pyx_t_43 = NULL; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + PyArrayObject *__pyx_t_48 = NULL; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + PyObject **__pyx_t_51; + Py_ssize_t __pyx_t_52; + Py_ssize_t __pyx_t_53; + Py_ssize_t __pyx_t_54; + Py_ssize_t __pyx_t_55; + Py_ssize_t __pyx_t_56; + Py_ssize_t __pyx_t_57; + Py_ssize_t __pyx_t_58; + Py_ssize_t __pyx_t_59; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_to_datetime", 0); + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + __pyx_pybuffer_oresult.pybuffer.buf = NULL; + __pyx_pybuffer_oresult.refcount = 0; + __pyx_pybuffernd_oresult.data = NULL; + __pyx_pybuffernd_oresult.rcbuffer = &__pyx_pybuffer_oresult; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1173 + * format=None, utc=None, coerce=False, unit=None): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * object val, py_dt + * ndarray[int64_t] iresult + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":1178 + * ndarray[object] oresult + * pandas_datetimestruct dts + * bint utc_convert = bool(utc), seen_integer=0, seen_datetime=0 # <<<<<<<<<<<<<< + * _TSObject _ts + * int64_t m = cast_from_unit(None,unit) + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_utc); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_utc_convert = (!(!__pyx_t_2)); + __pyx_v_seen_integer = 0; + __pyx_v_seen_datetime = 0; + + /* "pandas/tslib.pyx":1180 + * bint utc_convert = bool(utc), seen_integer=0, seen_datetime=0 + * _TSObject _ts + * int64_t m = cast_from_unit(None,unit) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib_cast_from_unit(Py_None, __pyx_v_unit, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_m = __pyx_t_3; + + /* "pandas/tslib.pyx":1182 + * int64_t m = cast_from_unit(None,unit) + * + * try: # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') + */ + { + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "pandas/tslib.pyx":1183 + * + * try: + * result = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * iresult = result.view('i8') + * for i in range(n): + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":1184 + * try: + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_t_11 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1185 + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * if _checknull_with_nat(val): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/tslib.pyx":1186 + * iresult = result.view('i8') + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * if _checknull_with_nat(val): + * iresult[i] = iNaT + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_t_7 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1187 + * for i in range(n): + * val = values[i] + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * elif PyDateTime_Check(val): + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1188 + * val = values[i] + * if _checknull_with_nat(val): + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * elif PyDateTime_Check(val): + * seen_datetime=1 + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_18 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1189 + * if _checknull_with_nat(val): + * iresult[i] = iNaT + * elif PyDateTime_Check(val): # <<<<<<<<<<<<<< + * seen_datetime=1 + * if val.tzinfo is not None: + */ + __pyx_t_2 = (PyDateTime_Check(__pyx_v_val) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1190 + * iresult[i] = iNaT + * elif PyDateTime_Check(val): + * seen_datetime=1 # <<<<<<<<<<<<<< + * if val.tzinfo is not None: + * if utc_convert: + */ + __pyx_v_seen_datetime = 1; + + /* "pandas/tslib.pyx":1191 + * elif PyDateTime_Check(val): + * seen_datetime=1 + * if val.tzinfo is not None: # <<<<<<<<<<<<<< + * if utc_convert: + * _ts = convert_to_tsobject(val, None, unit) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = (__pyx_t_7 != Py_None); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_19 = (__pyx_t_2 != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1192 + * seen_datetime=1 + * if val.tzinfo is not None: + * if utc_convert: # <<<<<<<<<<<<<< + * _ts = convert_to_tsobject(val, None, unit) + * iresult[i] = _ts.value + */ + __pyx_t_19 = (__pyx_v_utc_convert != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1193 + * if val.tzinfo is not None: + * if utc_convert: + * _ts = convert_to_tsobject(val, None, unit) # <<<<<<<<<<<<<< + * iresult[i] = _ts.value + * try: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_val, Py_None, __pyx_v_unit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_XDECREF_SET(__pyx_v__ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_7)); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1194 + * if utc_convert: + * _ts = convert_to_tsobject(val, None, unit) + * iresult[i] = _ts.value # <<<<<<<<<<<<<< + * try: + * _check_dts_bounds(&_ts.dts) + */ + __pyx_t_3 = __pyx_v__ts->value; + __pyx_t_20 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1195 + * _ts = convert_to_tsobject(val, None, unit) + * iresult[i] = _ts.value + * try: # <<<<<<<<<<<<<< + * _check_dts_bounds(&_ts.dts) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":1196 + * iresult[i] = _ts.value + * try: + * _check_dts_bounds(&_ts.dts) # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v__ts->dts)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L23_try_end; + __pyx_L16_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1197 + * try: + * _check_dts_bounds(&_ts.dts) + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1198 + * _check_dts_bounds(&_ts.dts) + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1199 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1200 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * else: + */ + goto __pyx_L25_except_continue; + } + + /* "pandas/tslib.pyx":1201 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * else: + * raise ValueError('Tz-aware datetime.datetime cannot ' + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_10, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L17_exception_handled; + __pyx_L25_except_continue:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L22_try_continue; + } + goto __pyx_L18_except_error; + __pyx_L18_except_error:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L22_try_continue:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L11_continue; + __pyx_L17_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + __pyx_L23_try_end:; + } + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/tslib.pyx":1203 + * raise + * else: + * raise ValueError('Tz-aware datetime.datetime cannot ' # <<<<<<<<<<<<<< + * 'be converted to datetime64 unless ' + * 'utc=True') + */ + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_L15:; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/tslib.pyx":1207 + * 'utc=True') + * else: + * iresult[i] = _pydatetime_to_dts(val, &dts) # <<<<<<<<<<<<<< + * if is_timestamp(val): + * iresult[i] += (<_Timestamp>val).nanosecond + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_f_8datetime__pydatetime_to_dts(__pyx_v_val, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1208 + * else: + * iresult[i] = _pydatetime_to_dts(val, &dts) + * if is_timestamp(val): # <<<<<<<<<<<<<< + * iresult[i] += (<_Timestamp>val).nanosecond + * try: + */ + __pyx_t_19 = (__pyx_f_6pandas_5tslib_is_timestamp(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1209 + * iresult[i] = _pydatetime_to_dts(val, &dts) + * if is_timestamp(val): + * iresult[i] += (<_Timestamp>val).nanosecond # <<<<<<<<<<<<<< + * try: + * _check_dts_bounds(&dts) + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_iresult.diminfo[0].strides) += ((struct __pyx_obj_6pandas_5tslib__Timestamp *)__pyx_v_val)->nanosecond; + goto __pyx_L27; + } + __pyx_L27:; + + /* "pandas/tslib.pyx":1210 + * if is_timestamp(val): + * iresult[i] += (<_Timestamp>val).nanosecond + * try: # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + + /* "pandas/tslib.pyx":1211 + * iresult[i] += (<_Timestamp>val).nanosecond + * try: + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L28_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L35_try_end; + __pyx_L28_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1212 + * try: + * _check_dts_bounds(&dts) + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1213 + * _check_dts_bounds(&dts) + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1214 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_24 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1215 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * elif PyDate_Check(val): + */ + goto __pyx_L37_except_continue; + } + + /* "pandas/tslib.pyx":1216 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * elif PyDate_Check(val): + * iresult[i] = _date_to_datetime64(val, &dts) + */ + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_7); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L29_exception_handled; + __pyx_L37_except_continue:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L34_try_continue; + } + goto __pyx_L30_except_error; + __pyx_L30_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L34_try_continue:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L11_continue; + __pyx_L29_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L35_try_end:; + } + } + __pyx_L14:; + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1217 + * continue + * raise + * elif PyDate_Check(val): # <<<<<<<<<<<<<< + * iresult[i] = _date_to_datetime64(val, &dts) + * try: + */ + __pyx_t_19 = (PyDate_Check(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1218 + * raise + * elif PyDate_Check(val): + * iresult[i] = _date_to_datetime64(val, &dts) # <<<<<<<<<<<<<< + * try: + * _check_dts_bounds(&dts) + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_f_8datetime__date_to_datetime64(__pyx_v_val, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1219 + * elif PyDate_Check(val): + * iresult[i] = _date_to_datetime64(val, &dts) + * try: # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * seen_datetime=1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":1220 + * iresult[i] = _date_to_datetime64(val, &dts) + * try: + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * seen_datetime=1 + * except ValueError: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L39_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1221 + * try: + * _check_dts_bounds(&dts) + * seen_datetime=1 # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_v_seen_datetime = 1; + } + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L46_try_end; + __pyx_L39_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1222 + * _check_dts_bounds(&dts) + * seen_datetime=1 + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1223 + * seen_datetime=1 + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1224 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_26 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1225 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * elif util.is_datetime64_object(val): + */ + goto __pyx_L48_except_continue; + } + + /* "pandas/tslib.pyx":1226 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_10, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L40_exception_handled; + __pyx_L48_except_continue:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L45_try_continue; + } + goto __pyx_L41_except_error; + __pyx_L41_except_error:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L45_try_continue:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L11_continue; + __pyx_L40_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + __pyx_L46_try_end:; + } + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1227 + * continue + * raise + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * if val is np_NaT or val.view('i8') == iNaT: + * iresult[i] = iNaT + */ + __pyx_t_19 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1228 + * raise + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * else: + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_NaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_19 = (__pyx_v_val == __pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!__pyx_t_19) { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_view); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_27 = __pyx_t_2; + } else { + __pyx_t_27 = __pyx_t_19; + } + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1229 + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * else: + * try: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_28 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + goto __pyx_L50; + } + /*else*/ { + + /* "pandas/tslib.pyx":1231 + * iresult[i] = iNaT + * else: + * try: # <<<<<<<<<<<<<< + * iresult[i] = _get_datetime64_nanos(val) + * seen_datetime=1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + + /* "pandas/tslib.pyx":1232 + * else: + * try: + * iresult[i] = _get_datetime64_nanos(val) # <<<<<<<<<<<<<< + * seen_datetime=1 + * except ValueError: + */ + __pyx_t_7 = __pyx_f_6pandas_5tslib__get_datetime64_nanos(__pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L51_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L51_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_29 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L51_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1233 + * try: + * iresult[i] = _get_datetime64_nanos(val) + * seen_datetime=1 # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_v_seen_datetime = 1; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L58_try_end; + __pyx_L51_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":1234 + * iresult[i] = _get_datetime64_nanos(val) + * seen_datetime=1 + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + + /* "pandas/tslib.pyx":1235 + * seen_datetime=1 + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1236 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_30 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1237 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * + */ + goto __pyx_L60_except_continue; + } + + /* "pandas/tslib.pyx":1238 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * + * # if we are coercing, dont' allow integers + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_9, __pyx_t_10); + __pyx_t_7 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L52_exception_handled; + __pyx_L60_except_continue:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L57_try_continue; + } + goto __pyx_L53_except_error; + __pyx_L53_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L57_try_continue:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L11_continue; + __pyx_L52_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L58_try_end:; + } + } + __pyx_L50:; + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1241 + * + * # if we are coercing, dont' allow integers + * elif util.is_integer_object(val) and not coerce: # <<<<<<<<<<<<<< + * if val == iNaT: + * iresult[i] = iNaT + */ + if ((is_integer_object(__pyx_v_val) != 0)) { + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_19 = (!__pyx_t_27); + __pyx_t_27 = __pyx_t_19; + } else { + __pyx_t_27 = (is_integer_object(__pyx_v_val) != 0); + } + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1242 + * # if we are coercing, dont' allow integers + * elif util.is_integer_object(val) and not coerce: + * if val == iNaT: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * else: + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1243 + * elif util.is_integer_object(val) and not coerce: + * if val == iNaT: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * else: + * iresult[i] = val*m + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_31 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + goto __pyx_L62; + } + /*else*/ { + + /* "pandas/tslib.pyx":1245 + * iresult[i] = iNaT + * else: + * iresult[i] = val*m # <<<<<<<<<<<<<< + * seen_integer=1 + * elif util.is_float_object(val) and not coerce: + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_m); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyNumber_Multiply(__pyx_v_val, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_10); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_32 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1246 + * else: + * iresult[i] = val*m + * seen_integer=1 # <<<<<<<<<<<<<< + * elif util.is_float_object(val) and not coerce: + * if val != val or val == iNaT: + */ + __pyx_v_seen_integer = 1; + } + __pyx_L62:; + goto __pyx_L13; + } + + /* "pandas/tslib.pyx":1247 + * iresult[i] = val*m + * seen_integer=1 + * elif util.is_float_object(val) and not coerce: # <<<<<<<<<<<<<< + * if val != val or val == iNaT: + * iresult[i] = iNaT + */ + if ((is_float_object(__pyx_v_val) != 0)) { + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_19 = (!__pyx_t_27); + __pyx_t_27 = __pyx_t_19; + } else { + __pyx_t_27 = (is_float_object(__pyx_v_val) != 0); + } + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1248 + * seen_integer=1 + * elif util.is_float_object(val) and not coerce: + * if val != val or val == iNaT: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * else: + */ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!__pyx_t_27) { + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __pyx_t_19; + } else { + __pyx_t_2 = __pyx_t_27; + } + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1249 + * elif util.is_float_object(val) and not coerce: + * if val != val or val == iNaT: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * else: + * iresult[i] = cast_from_unit(val,unit) + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_33 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + goto __pyx_L63; + } + /*else*/ { + + /* "pandas/tslib.pyx":1251 + * iresult[i] = iNaT + * else: + * iresult[i] = cast_from_unit(val,unit) # <<<<<<<<<<<<<< + * seen_integer=1 + * else: + */ + __pyx_t_3 = __pyx_f_6pandas_5tslib_cast_from_unit(__pyx_v_val, __pyx_v_unit, 0); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_34 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1252 + * else: + * iresult[i] = cast_from_unit(val,unit) + * seen_integer=1 # <<<<<<<<<<<<<< + * else: + * try: + */ + __pyx_v_seen_integer = 1; + } + __pyx_L63:; + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/tslib.pyx":1254 + * seen_integer=1 + * else: + * try: # <<<<<<<<<<<<<< + * if len(val) == 0: + * iresult[i] = iNaT + */ + { + __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":1255 + * else: + * try: + * if len(val) == 0: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_35 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_35 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __pyx_t_2 = ((__pyx_t_35 == 0) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1256 + * try: + * if len(val) == 0: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_35 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1257 + * if len(val) == 0: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * + * elif val in _nat_strings: + */ + goto __pyx_L70_try_continue; + } + + /* "pandas/tslib.pyx":1259 + * continue + * + * elif val in _nat_strings: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_strings); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_27 = (__pyx_t_2 != 0); + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1260 + * + * elif val in _nat_strings: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_36 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1261 + * elif val in _nat_strings: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * + * _string_to_dts(val, &dts) + */ + goto __pyx_L70_try_continue; + } + + /* "pandas/tslib.pyx":1263 + * continue + * + * _string_to_dts(val, &dts) # <<<<<<<<<<<<<< + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, + * &dts) + */ + __pyx_t_9 = __pyx_f_8datetime__string_to_dts(__pyx_v_val, (&__pyx_v_dts)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1264 + * + * _string_to_dts(val, &dts) + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, # <<<<<<<<<<<<<< + * &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_iresult.diminfo[0].strides) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1266 + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, + * &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * except ValueError: + * try: + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L64_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L71_try_end; + __pyx_L64_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1267 + * &dts) + * _check_dts_bounds(&dts) + * except ValueError: # <<<<<<<<<<<<<< + * try: + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1268 + * _check_dts_bounds(&dts) + * except ValueError: + * try: # <<<<<<<<<<<<<< + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) + * except Exception: + */ + { + __Pyx_ExceptionSave(&__pyx_t_38, &__pyx_t_39, &__pyx_t_40); + __Pyx_XGOTREF(__pyx_t_38); + __Pyx_XGOTREF(__pyx_t_39); + __Pyx_XGOTREF(__pyx_t_40); + /*try:*/ { + + /* "pandas/tslib.pyx":1269 + * except ValueError: + * try: + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) # <<<<<<<<<<<<<< + * except Exception: + * if coerce: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_datetime_string); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_41 = PyTuple_New(1); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __Pyx_GOTREF(__pyx_t_41); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_42 = PyDict_New(); if (unlikely(!__pyx_t_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __Pyx_GOTREF(__pyx_t_42); + if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_dayfirst, __pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_41, __pyx_t_42); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L75_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF_SET(__pyx_v_py_dt, __pyx_t_43); + __pyx_t_43 = 0; + } + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_XDECREF(__pyx_t_40); __pyx_t_40 = 0; + goto __pyx_L82_try_end; + __pyx_L75_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0; + + /* "pandas/tslib.pyx":1270 + * try: + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) + * except Exception: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_43, &__pyx_t_42, &__pyx_t_41) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_GOTREF(__pyx_t_42); + __Pyx_GOTREF(__pyx_t_41); + + /* "pandas/tslib.pyx":1271 + * py_dt = parse_datetime_string(val, dayfirst=dayfirst) + * except Exception: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1272 + * except Exception: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise TypeError + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_44 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_44 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_44 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1273 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise TypeError + * + */ + goto __pyx_L84_except_continue; + } + + /* "pandas/tslib.pyx":1274 + * iresult[i] = iNaT + * continue + * raise TypeError # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L77_except_error;} + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + goto __pyx_L76_exception_handled; + __pyx_L84_except_continue:; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + goto __pyx_L81_try_continue; + } + goto __pyx_L77_except_error; + __pyx_L77_except_error:; + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_39, __pyx_t_40); + goto __pyx_L66_except_error; + __pyx_L81_try_continue:; + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_39, __pyx_t_40); + goto __pyx_L74_except_continue; + __pyx_L76_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_39, __pyx_t_40); + __pyx_L82_try_end:; + } + + /* "pandas/tslib.pyx":1276 + * raise TypeError + * + * try: # <<<<<<<<<<<<<< + * _ts = convert_to_tsobject(py_dt, None, None) + * iresult[i] = _ts.value + */ + { + __Pyx_ExceptionSave(&__pyx_t_40, &__pyx_t_39, &__pyx_t_38); + __Pyx_XGOTREF(__pyx_t_40); + __Pyx_XGOTREF(__pyx_t_39); + __Pyx_XGOTREF(__pyx_t_38); + /*try:*/ { + + /* "pandas/tslib.pyx":1277 + * + * try: + * _ts = convert_to_tsobject(py_dt, None, None) # <<<<<<<<<<<<<< + * iresult[i] = _ts.value + * except ValueError: + */ + __pyx_t_41 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_py_dt, Py_None, Py_None); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L86_error;} + __Pyx_GOTREF(__pyx_t_41); + if (!(likely(((__pyx_t_41) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_41, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L86_error;} + __Pyx_XDECREF_SET(__pyx_v__ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_41)); + __pyx_t_41 = 0; + + /* "pandas/tslib.pyx":1278 + * try: + * _ts = convert_to_tsobject(py_dt, None, None) + * iresult[i] = _ts.value # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_t_3 = __pyx_v__ts->value; + __pyx_t_45 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_45 < 0) { + __pyx_t_45 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_45 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L86_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + } + __Pyx_XDECREF(__pyx_t_40); __pyx_t_40 = 0; + __Pyx_XDECREF(__pyx_t_39); __pyx_t_39 = 0; + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + goto __pyx_L93_try_end; + __pyx_L86_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + + /* "pandas/tslib.pyx":1279 + * _ts = convert_to_tsobject(py_dt, None, None) + * iresult[i] = _ts.value + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_41, &__pyx_t_42, &__pyx_t_43) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __Pyx_GOTREF(__pyx_t_42); + __Pyx_GOTREF(__pyx_t_43); + + /* "pandas/tslib.pyx":1280 + * iresult[i] = _ts.value + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1281 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_46 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_46 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_46 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1282 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * except: + */ + goto __pyx_L95_except_continue; + } + + /* "pandas/tslib.pyx":1283 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * except: + * if coerce: + */ + __Pyx_GIVEREF(__pyx_t_41); + __Pyx_GIVEREF(__pyx_t_42); + __Pyx_XGIVEREF(__pyx_t_43); + __Pyx_ErrRestore(__pyx_t_41, __pyx_t_42, __pyx_t_43); + __pyx_t_41 = 0; __pyx_t_42 = 0; __pyx_t_43 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L88_except_error;} + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L87_exception_handled; + __pyx_L95_except_continue:; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L92_try_continue; + } + goto __pyx_L88_except_error; + __pyx_L88_except_error:; + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_ExceptionReset(__pyx_t_40, __pyx_t_39, __pyx_t_38); + goto __pyx_L66_except_error; + __pyx_L92_try_continue:; + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_ExceptionReset(__pyx_t_40, __pyx_t_39, __pyx_t_38); + goto __pyx_L74_except_continue; + __pyx_L87_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_ExceptionReset(__pyx_t_40, __pyx_t_39, __pyx_t_38); + __pyx_L93_try_end:; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L65_exception_handled; + __pyx_L74_except_continue:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L70_try_continue; + } + + /* "pandas/tslib.pyx":1284 + * continue + * raise + * except: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1285 + * raise + * except: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1286 + * except: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_43 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_3 = __Pyx_PyInt_As_npy_int64(__pyx_t_43); if (unlikely((__pyx_t_3 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_47 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_47 < 0) { + __pyx_t_47 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_47 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_3; + + /* "pandas/tslib.pyx":1287 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * + */ + goto __pyx_L98_except_continue; + } + + /* "pandas/tslib.pyx":1288 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * + * # don't allow mixed integers and datetime like + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_10, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L65_exception_handled; + __pyx_L98_except_continue:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L70_try_continue; + } + __pyx_L66_except_error:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L70_try_continue:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + goto __pyx_L11_continue; + __pyx_L65_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + __pyx_L71_try_end:; + } + } + __pyx_L13:; + __pyx_L11_continue:; + } + + /* "pandas/tslib.pyx":1293 + * # higher levels can catch and coerce to object, for + * # example + * if seen_integer and seen_datetime: # <<<<<<<<<<<<<< + * raise ValueError("mixed datetimes and integers in passed array") + * + */ + if ((__pyx_v_seen_integer != 0)) { + __pyx_t_27 = (__pyx_v_seen_datetime != 0); + } else { + __pyx_t_27 = (__pyx_v_seen_integer != 0); + } + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1294 + * # example + * if seen_integer and seen_datetime: + * raise ValueError("mixed datetimes and integers in passed array") # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_Raise(__pyx_t_9, 0, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "pandas/tslib.pyx":1296 + * raise ValueError("mixed datetimes and integers in passed array") + * + * return result # <<<<<<<<<<<<<< + * except OutOfBoundsDatetime: + * if raise_: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1297 + * + * return result + * except OutOfBoundsDatetime: # <<<<<<<<<<<<<< + * if raise_: + * raise + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1298 + * return result + * except OutOfBoundsDatetime: + * if raise_: # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_v_raise_); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1299 + * except OutOfBoundsDatetime: + * if raise_: + * raise # <<<<<<<<<<<<<< + * + * oresult = np.empty(n, dtype=object) + */ + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_7); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + + /* "pandas/tslib.pyx":1301 + * raise + * + * oresult = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_t_43 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_empty); if (unlikely(!__pyx_t_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_42); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_43 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_41 = PyTuple_New(1); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_43); + __Pyx_GIVEREF(__pyx_t_43); + __pyx_t_43 = 0; + __pyx_t_43 = PyDict_New(); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + if (PyDict_SetItem(__pyx_t_43, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_42, __pyx_t_41, __pyx_t_43); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_48 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_oresult, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + } + __pyx_pybuffernd_oresult.diminfo[0].strides = __pyx_pybuffernd_oresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oresult.diminfo[0].shape = __pyx_pybuffernd_oresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_48 = 0; + __pyx_v_oresult = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1302 + * + * oresult = np.empty(n, dtype=object) + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/tslib.pyx":1303 + * oresult = np.empty(n, dtype=object) + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * + * # set as nan if is even a datetime NaT + */ + __pyx_t_49 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_49 < 0) { + __pyx_t_49 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_49 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_8 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1306 + * + * # set as nan if is even a datetime NaT + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * oresult[i] = np.nan + * elif util.is_datetime64_object(val): + */ + __pyx_t_27 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1307 + * # set as nan if is even a datetime NaT + * if _checknull_with_nat(val): + * oresult[i] = np.nan # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nan); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_50 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_50 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_50 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_t_43); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_t_43; + __Pyx_GIVEREF(*__pyx_t_51); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L106; + } + + /* "pandas/tslib.pyx":1308 + * if _checknull_with_nat(val): + * oresult[i] = np.nan + * elif util.is_datetime64_object(val): # <<<<<<<<<<<<<< + * if val is np_NaT or val.view('i8') == iNaT: + * oresult[i] = np.nan + */ + __pyx_t_27 = (is_datetime64_object(__pyx_v_val) != 0); + if (__pyx_t_27) { + + /* "pandas/tslib.pyx":1309 + * oresult[i] = np.nan + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: # <<<<<<<<<<<<<< + * oresult[i] = np.nan + * else: + */ + __pyx_t_43 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_NaT); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_27 = (__pyx_v_val == __pyx_t_43); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + if (!__pyx_t_27) { + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_view); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_43 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_41 = PyObject_RichCompare(__pyx_t_8, __pyx_t_43, Py_EQ); __Pyx_XGOTREF(__pyx_t_41); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_41); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __pyx_t_19 = __pyx_t_2; + } else { + __pyx_t_19 = __pyx_t_27; + } + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1310 + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: + * oresult[i] = np.nan # <<<<<<<<<<<<<< + * else: + * oresult[i] = val.item() + */ + __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_nan); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __pyx_t_52 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_52 < 0) { + __pyx_t_52 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_52 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_t_43); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_t_43; + __Pyx_GIVEREF(*__pyx_t_51); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L107; + } + /*else*/ { + + /* "pandas/tslib.pyx":1312 + * oresult[i] = np.nan + * else: + * oresult[i] = val.item() # <<<<<<<<<<<<<< + * else: + * oresult[i] = val + */ + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_item); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_53 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_53 < 0) { + __pyx_t_53 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_53 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_t_41); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_t_41; + __Pyx_GIVEREF(*__pyx_t_51); + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + } + __pyx_L107:; + goto __pyx_L106; + } + /*else*/ { + + /* "pandas/tslib.pyx":1314 + * oresult[i] = val.item() + * else: + * oresult[i] = val # <<<<<<<<<<<<<< + * return oresult + * except TypeError: + */ + __pyx_t_54 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_54 < 0) { + __pyx_t_54 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_54 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_51); + } + __pyx_L106:; + } + + /* "pandas/tslib.pyx":1315 + * else: + * oresult[i] = val + * return oresult # <<<<<<<<<<<<<< + * except TypeError: + * oresult = np.empty(n, dtype=object) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_oresult)); + __pyx_r = ((PyObject *)__pyx_v_oresult); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + + /* "pandas/tslib.pyx":1316 + * oresult[i] = val + * return oresult + * except TypeError: # <<<<<<<<<<<<<< + * oresult = np.empty(n, dtype=object) + * + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1317 + * return oresult + * except TypeError: + * oresult = np.empty(n, dtype=object) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_empty); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __pyx_t_41 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_41); + __Pyx_GIVEREF(__pyx_t_41); + __pyx_t_41 = 0; + __pyx_t_41 = PyDict_New(); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_41); + if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_dtype, __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_t_8, __pyx_t_41); if (unlikely(!__pyx_t_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_42); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + if (!(likely(((__pyx_t_42) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_42, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_48 = ((PyArrayObject *)__pyx_t_42); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_48, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_oresult, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13); + } + } + __pyx_pybuffernd_oresult.diminfo[0].strides = __pyx_pybuffernd_oresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oresult.diminfo[0].shape = __pyx_pybuffernd_oresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_48 = 0; + __pyx_v_oresult = ((PyArrayObject *)__pyx_t_42); + __pyx_t_42 = 0; + + /* "pandas/tslib.pyx":1319 + * oresult = np.empty(n, dtype=object) + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * if _checknull_with_nat(val): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; + + /* "pandas/tslib.pyx":1320 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * if _checknull_with_nat(val): + * oresult[i] = val + */ + __pyx_t_55 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_55 < 0) { + __pyx_t_55 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_55 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_42 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_42); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_42); + __pyx_t_42 = 0; + + /* "pandas/tslib.pyx":1321 + * for i in range(n): + * val = values[i] + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * oresult[i] = val + * elif util.is_string_object(val): + */ + __pyx_t_19 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1322 + * val = values[i] + * if _checknull_with_nat(val): + * oresult[i] = val # <<<<<<<<<<<<<< + * elif util.is_string_object(val): + * if len(val) == 0: + */ + __pyx_t_56 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_56 < 0) { + __pyx_t_56 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_56 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_v_val); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_v_val; + __Pyx_GIVEREF(*__pyx_t_51); + goto __pyx_L112; + } + + /* "pandas/tslib.pyx":1323 + * if _checknull_with_nat(val): + * oresult[i] = val + * elif util.is_string_object(val): # <<<<<<<<<<<<<< + * if len(val) == 0: + * # TODO: ?? + */ + __pyx_t_19 = (is_string_object(__pyx_v_val) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1324 + * oresult[i] = val + * elif util.is_string_object(val): + * if len(val) == 0: # <<<<<<<<<<<<<< + * # TODO: ?? + * oresult[i] = 'NaT' + */ + __pyx_t_57 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_57 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_19 = ((__pyx_t_57 == 0) != 0); + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1326 + * if len(val) == 0: + * # TODO: ?? + * oresult[i] = 'NaT' # <<<<<<<<<<<<<< + * continue + * try: + */ + __pyx_t_57 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_57 < 0) { + __pyx_t_57 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_57 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_n_s_NaT); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_n_s_NaT; + __Pyx_GIVEREF(*__pyx_t_51); + + /* "pandas/tslib.pyx":1327 + * # TODO: ?? + * oresult[i] = 'NaT' + * continue # <<<<<<<<<<<<<< + * try: + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) + */ + goto __pyx_L110_continue; + } + + /* "pandas/tslib.pyx":1328 + * oresult[i] = 'NaT' + * continue + * try: # <<<<<<<<<<<<<< + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) + * _pydatetime_to_dts(oresult[i], &dts) + */ + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + + /* "pandas/tslib.pyx":1329 + * continue + * try: + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) # <<<<<<<<<<<<<< + * _pydatetime_to_dts(oresult[i], &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_42 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_datetime_string); if (unlikely(!__pyx_t_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_42); + __pyx_t_41 = PyTuple_New(1); if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_41); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dayfirst, __pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_42, __pyx_t_41, __pyx_t_8); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_58 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_58 < 0) { + __pyx_t_58 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_58 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + } + __pyx_t_51 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_GOTREF(*__pyx_t_51); + __Pyx_INCREF(__pyx_t_43); __Pyx_DECREF(*__pyx_t_51); + *__pyx_t_51 = __pyx_t_43; + __Pyx_GIVEREF(*__pyx_t_51); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + + /* "pandas/tslib.pyx":1330 + * try: + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) + * _pydatetime_to_dts(oresult[i], &dts) # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * except Exception: + */ + __pyx_t_59 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_59 < 0) { + __pyx_t_59 += __pyx_pybuffernd_oresult.diminfo[0].shape; + if (unlikely(__pyx_t_59 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_oresult.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + } + __pyx_t_43 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_oresult.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_oresult.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_43); + __pyx_f_8datetime__pydatetime_to_dts(__pyx_t_43, (&__pyx_v_dts)); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + + /* "pandas/tslib.pyx":1331 + * oresult[i] = parse_datetime_string(val, dayfirst=dayfirst) + * _pydatetime_to_dts(oresult[i], &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * except Exception: + * if raise_: + */ + __pyx_t_43 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L114_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L121_try_end; + __pyx_L114_error:; + __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0; + __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0; + + /* "pandas/tslib.pyx":1332 + * _pydatetime_to_dts(oresult[i], &dts) + * _check_dts_bounds(&dts) + * except Exception: # <<<<<<<<<<<<<< + * if raise_: + * raise + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_43, &__pyx_t_8, &__pyx_t_41) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L116_except_error;} + __Pyx_GOTREF(__pyx_t_43); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_41); + + /* "pandas/tslib.pyx":1333 + * _check_dts_bounds(&dts) + * except Exception: + * if raise_: # <<<<<<<<<<<<<< + * raise + * return values + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_raise_); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L116_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1334 + * except Exception: + * if raise_: + * raise # <<<<<<<<<<<<<< + * return values + * # oresult[i] = val + */ + __Pyx_GIVEREF(__pyx_t_43); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_41); + __Pyx_ErrRestore(__pyx_t_43, __pyx_t_8, __pyx_t_41); + __pyx_t_43 = 0; __pyx_t_8 = 0; __pyx_t_41 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L116_except_error;} + } + + /* "pandas/tslib.pyx":1335 + * if raise_: + * raise + * return values # <<<<<<<<<<<<<< + * # oresult[i] = val + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_r = ((PyObject *)__pyx_v_values); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + goto __pyx_L117_except_return; + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; + goto __pyx_L115_exception_handled; + } + goto __pyx_L116_except_error; + __pyx_L116_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L5_except_error; + __pyx_L117_except_return:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L6_except_return; + __pyx_L115_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L121_try_end:; + } + goto __pyx_L112; + } + /*else*/ { + + /* "pandas/tslib.pyx":1338 + * # oresult[i] = val + * else: + * if raise_: # <<<<<<<<<<<<<< + * raise + * return values + */ + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_raise_); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + if (__pyx_t_19) { + + /* "pandas/tslib.pyx":1339 + * else: + * if raise_: + * raise # <<<<<<<<<<<<<< + * return values + * + */ + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_10, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + + /* "pandas/tslib.pyx":1340 + * if raise_: + * raise + * return values # <<<<<<<<<<<<<< + * + * return oresult + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_values)); + __pyx_r = ((PyObject *)__pyx_v_values); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L6_except_return; + } + __pyx_L112:; + __pyx_L110_continue:; + } + + /* "pandas/tslib.pyx":1342 + * return values + * + * return oresult # <<<<<<<<<<<<<< + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_oresult)); + __pyx_r = ((PyObject *)__pyx_v_oresult); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_41); + __Pyx_XDECREF(__pyx_t_42); + __Pyx_XDECREF(__pyx_t_43); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_py_dt); + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF((PyObject *)__pyx_v_oresult); + __Pyx_XDECREF((PyObject *)__pyx_v__ts); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1344 + * return oresult + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): # <<<<<<<<<<<<<< + * """ convert an ndarray to an array of ints that are timedeltas + * force conversion if coerce = True, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_29array_to_timedelta64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_28array_to_timedelta64[] = " convert an ndarray to an array of ints that are timedeltas\n force conversion if coerce = True,\n else will raise if cannot convert "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_29array_to_timedelta64 = {__Pyx_NAMESTR("array_to_timedelta64"), (PyCFunction)__pyx_pw_6pandas_5tslib_29array_to_timedelta64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_28array_to_timedelta64)}; +static PyObject *__pyx_pw_6pandas_5tslib_29array_to_timedelta64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_unit = 0; + PyObject *__pyx_v_coerce = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("array_to_timedelta64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_unit,&__pyx_n_s_coerce,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_n_s_ns); + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array_to_timedelta64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_unit = values[1]; + __pyx_v_coerce = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("array_to_timedelta64", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.array_to_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_28array_to_timedelta64(__pyx_self, __pyx_v_values, __pyx_v_unit, __pyx_v_coerce); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_28array_to_timedelta64(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_iresult = 0; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_to_timedelta64", 0); + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1352 + * ndarray[int64_t] iresult + * + * n = values.shape[0] # <<<<<<<<<<<<<< + * result = np.empty(n, dtype='m8[ns]') + * iresult = result.view('i8') + */ + __pyx_v_n = (__pyx_v_values->dimensions[0]); + + /* "pandas/tslib.pyx":1353 + * + * n = values.shape[0] + * result = np.empty(n, dtype='m8[ns]') # <<<<<<<<<<<<<< + * iresult = result.view('i8') + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_kp_s_m8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1354 + * n = values.shape[0] + * result = np.empty(n, dtype='m8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1356 + * iresult = result.view('i8') + * + * for i in range(n): # <<<<<<<<<<<<<< + * result[i] = convert_to_timedelta64(values[i], unit, coerce) + * return iresult + */ + __pyx_t_10 = __pyx_v_n; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":1357 + * + * for i in range(n): + * result[i] = convert_to_timedelta64(values[i], unit, coerce) # <<<<<<<<<<<<<< + * return iresult + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_1); + __pyx_t_4 = __pyx_f_6pandas_5tslib_convert_to_timedelta64(__pyx_t_1, __pyx_v_unit, __pyx_v_coerce); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_result, __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "pandas/tslib.pyx":1358 + * for i in range(n): + * result[i] = convert_to_timedelta64(values[i], unit, coerce) + * return iresult # <<<<<<<<<<<<<< + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_iresult)); + __pyx_r = ((PyObject *)__pyx_v_iresult); + goto __pyx_L0; + + /* "pandas/tslib.pyx":1344 + * return oresult + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): # <<<<<<<<<<<<<< + * """ convert an ndarray to an array of ints that are timedeltas + * force conversion if coerce = True, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.array_to_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1360 + * return iresult + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): # <<<<<<<<<<<<<< + * return convert_to_timedelta64(ts, unit, coerce) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_31convert_to_timedelta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_31convert_to_timedelta = {__Pyx_NAMESTR("convert_to_timedelta"), (PyCFunction)__pyx_pw_6pandas_5tslib_31convert_to_timedelta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_31convert_to_timedelta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ts = 0; + PyObject *__pyx_v_unit = 0; + PyObject *__pyx_v_coerce = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_to_timedelta (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_unit,&__pyx_n_s_coerce,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_n_s_ns); + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert_to_timedelta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ts = values[0]; + __pyx_v_unit = values[1]; + __pyx_v_coerce = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("convert_to_timedelta", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.convert_to_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_30convert_to_timedelta(__pyx_self, __pyx_v_ts, __pyx_v_unit, __pyx_v_coerce); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_30convert_to_timedelta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_to_timedelta", 0); + + /* "pandas/tslib.pyx":1361 + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): + * return convert_to_timedelta64(ts, unit, coerce) # <<<<<<<<<<<<<< + * + * cdef inline convert_to_timedelta64(object ts, object unit, object coerce): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_convert_to_timedelta64(__pyx_v_ts, __pyx_v_unit, __pyx_v_coerce); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1360 + * return iresult + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): # <<<<<<<<<<<<<< + * return convert_to_timedelta64(ts, unit, coerce) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.convert_to_timedelta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1363 + * return convert_to_timedelta64(ts, unit, coerce) + * + * cdef inline convert_to_timedelta64(object ts, object unit, object coerce): # <<<<<<<<<<<<<< + * """ + * Convert an incoming object to a timedelta64 if possible + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_convert_to_timedelta64(PyObject *__pyx_v_ts, PyObject *__pyx_v_unit, PyObject *__pyx_v_coerce) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_to_timedelta64", 0); + __Pyx_INCREF(__pyx_v_ts); + + /* "pandas/tslib.pyx":1380 + * # handle the numpy < 1.7 case + * """ + * if _checknull_with_nat(ts): # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * elif util.is_datetime64_object(ts): + */ + __pyx_t_1 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1381 + * """ + * if _checknull_with_nat(ts): + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * elif util.is_datetime64_object(ts): + * # only accept a NaT here + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1382 + * if _checknull_with_nat(ts): + * return np.timedelta64(iNaT) + * elif util.is_datetime64_object(ts): # <<<<<<<<<<<<<< + * # only accept a NaT here + * if ts.astype('int64') == iNaT: + */ + __pyx_t_1 = (is_datetime64_object(__pyx_v_ts) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1384 + * elif util.is_datetime64_object(ts): + * # only accept a NaT here + * if ts.astype('int64') == iNaT: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * elif isinstance(ts, np.timedelta64): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1385 + * # only accept a NaT here + * if ts.astype('int64') == iNaT: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * elif isinstance(ts, np.timedelta64): + * ts = ts.astype("m8[{0}]".format(unit.lower())) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1386 + * if ts.astype('int64') == iNaT: + * return np.timedelta64(iNaT) + * elif isinstance(ts, np.timedelta64): # <<<<<<<<<<<<<< + * ts = ts.astype("m8[{0}]".format(unit.lower())) + * elif is_integer_object(ts): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_ts, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1387 + * return np.timedelta64(iNaT) + * elif isinstance(ts, np.timedelta64): + * ts = ts.astype("m8[{0}]".format(unit.lower())) # <<<<<<<<<<<<<< + * elif is_integer_object(ts): + * if ts == iNaT: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_m8_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_unit, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1388 + * elif isinstance(ts, np.timedelta64): + * ts = ts.astype("m8[{0}]".format(unit.lower())) + * elif is_integer_object(ts): # <<<<<<<<<<<<<< + * if ts == iNaT: + * return np.timedelta64(iNaT) + */ + __pyx_t_5 = (is_integer_object(__pyx_v_ts) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1389 + * ts = ts.astype("m8[{0}]".format(unit.lower())) + * elif is_integer_object(ts): + * if ts == iNaT: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * else: + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_ts, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1390 + * elif is_integer_object(ts): + * if ts == iNaT: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * else: + * if util.is_array(ts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1392 + * return np.timedelta64(iNaT) + * else: + * if util.is_array(ts): # <<<<<<<<<<<<<< + * ts = ts.astype('int64').item() + * if unit in ['Y','M','W']: + */ + __pyx_t_2 = __pyx_f_4util_is_array(__pyx_v_ts); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1393 + * else: + * if util.is_array(ts): + * ts = ts.astype('int64').item() # <<<<<<<<<<<<<< + * if unit in ['Y','M','W']: + * if _np_version_under1p7: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "pandas/tslib.pyx":1394 + * if util.is_array(ts): + * ts = ts.astype('int64').item() + * if unit in ['Y','M','W']: # <<<<<<<<<<<<<< + * if _np_version_under1p7: + * raise ValueError("unsupported unit for native timedelta under this numpy {0}".format(unit)) + */ + __Pyx_INCREF(__pyx_v_unit); + __pyx_t_4 = __pyx_v_unit; + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_Y, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_5) { + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_M, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_t_1; + } else { + __pyx_t_7 = __pyx_t_5; + } + if (!__pyx_t_7) { + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_W, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_t_5; + } else { + __pyx_t_1 = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1395 + * ts = ts.astype('int64').item() + * if unit in ['Y','M','W']: + * if _np_version_under1p7: # <<<<<<<<<<<<<< + * raise ValueError("unsupported unit for native timedelta under this numpy {0}".format(unit)) + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1396 + * if unit in ['Y','M','W']: + * if _np_version_under1p7: + * raise ValueError("unsupported unit for native timedelta under this numpy {0}".format(unit)) # <<<<<<<<<<<<<< + * else: + * ts = np.timedelta64(ts,unit) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unsupported_unit_for_native_time, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_unit); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_unit); + __Pyx_GIVEREF(__pyx_v_unit); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + /*else*/ { + + /* "pandas/tslib.pyx":1398 + * raise ValueError("unsupported unit for native timedelta under this numpy {0}".format(unit)) + * else: + * ts = np.timedelta64(ts,unit) # <<<<<<<<<<<<<< + * else: + * ts = cast_from_unit(ts, unit) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __Pyx_INCREF(__pyx_v_unit); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_unit); + __Pyx_GIVEREF(__pyx_v_unit); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_4); + __pyx_t_4 = 0; + } + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":1400 + * ts = np.timedelta64(ts,unit) + * else: + * ts = cast_from_unit(ts, unit) # <<<<<<<<<<<<<< + * if _np_version_under1p7: + * ts = timedelta(microseconds=ts/1000.0) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib_cast_from_unit(__pyx_v_ts, __pyx_v_unit, 0); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1401 + * else: + * ts = cast_from_unit(ts, unit) + * if _np_version_under1p7: # <<<<<<<<<<<<<< + * ts = timedelta(microseconds=ts/1000.0) + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1402 + * ts = cast_from_unit(ts, unit) + * if _np_version_under1p7: + * ts = timedelta(microseconds=ts/1000.0) # <<<<<<<<<<<<<< + * else: + * ts = np.timedelta64(ts) + */ + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ts, __pyx_float_1000_0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_timedelta)), __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L9; + } + /*else*/ { + + /* "pandas/tslib.pyx":1404 + * ts = timedelta(microseconds=ts/1000.0) + * else: + * ts = np.timedelta64(ts) # <<<<<<<<<<<<<< + * elif util.is_string_object(ts): + * if ts in _nat_strings or coerce: + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L9:; + } + __pyx_L7:; + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1405 + * else: + * ts = np.timedelta64(ts) + * elif util.is_string_object(ts): # <<<<<<<<<<<<<< + * if ts in _nat_strings or coerce: + * return np.timedelta64(iNaT) + */ + __pyx_t_7 = (is_string_object(__pyx_v_ts) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1406 + * ts = np.timedelta64(ts) + * elif util.is_string_object(ts): + * if ts in _nat_strings or coerce: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * else: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_ts, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_7) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_1; + } else { + __pyx_t_5 = __pyx_t_7; + } + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1407 + * elif util.is_string_object(ts): + * if ts in _nat_strings or coerce: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1409 + * return np.timedelta64(iNaT) + * else: + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) # <<<<<<<<<<<<<< + * + * if _np_version_under1p7: + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_type_for_timedelta_scala, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1411 + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * + * if _np_version_under1p7: # <<<<<<<<<<<<<< + * if not isinstance(ts, timedelta): + * if coerce: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1412 + * + * if _np_version_under1p7: + * if not isinstance(ts, timedelta): # <<<<<<<<<<<<<< + * if coerce: + * return np.timedelta64(iNaT) + */ + __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_ts, ((PyObject*)__pyx_ptype_8datetime_timedelta)); + __pyx_t_7 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1413 + * if _np_version_under1p7: + * if not isinstance(ts, timedelta): + * if coerce: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1414 + * if not isinstance(ts, timedelta): + * if coerce: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * if not PY2: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1415 + * if coerce: + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) # <<<<<<<<<<<<<< + * if not PY2: + * # convert to microseconds in timedelta64 + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_type_for_timedelta_scala, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1416 + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * if not PY2: # <<<<<<<<<<<<<< + * # convert to microseconds in timedelta64 + * ts = np.timedelta64(int(ts.total_seconds()*1e9 + ts.microseconds*1000)) + */ + __pyx_t_7 = ((!(__pyx_v_6pandas_5tslib_PY2 != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1418 + * if not PY2: + * # convert to microseconds in timedelta64 + * ts = np.timedelta64(int(ts.total_seconds()*1e9 + ts.microseconds*1000)) # <<<<<<<<<<<<<< + * else: + * return ts + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_float_1e9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/tslib.pyx":1420 + * ts = np.timedelta64(int(ts.total_seconds()*1e9 + ts.microseconds*1000)) + * else: + * return ts # <<<<<<<<<<<<<< + * + * if isinstance(ts, timedelta): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ts); + __pyx_r = __pyx_v_ts; + goto __pyx_L0; + } + __pyx_L14:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":1422 + * return ts + * + * if isinstance(ts, timedelta): # <<<<<<<<<<<<<< + * ts = np.timedelta64(ts) + * elif not isinstance(ts, np.timedelta64): + */ + __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_ts, ((PyObject*)__pyx_ptype_8datetime_timedelta)); + __pyx_t_5 = (__pyx_t_7 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1423 + * + * if isinstance(ts, timedelta): + * ts = np.timedelta64(ts) # <<<<<<<<<<<<<< + * elif not isinstance(ts, np.timedelta64): + * if coerce: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_ts); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ts); + __Pyx_GIVEREF(__pyx_v_ts); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_ts, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L15; + } + + /* "pandas/tslib.pyx":1424 + * if isinstance(ts, timedelta): + * ts = np.timedelta64(ts) + * elif not isinstance(ts, np.timedelta64): # <<<<<<<<<<<<<< + * if coerce: + * return np.timedelta64(iNaT) + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = PyObject_IsInstance(__pyx_v_ts, __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1425 + * ts = np.timedelta64(ts) + * elif not isinstance(ts, np.timedelta64): + * if coerce: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1426 + * elif not isinstance(ts, np.timedelta64): + * if coerce: + * return np.timedelta64(iNaT) # <<<<<<<<<<<<<< + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * return ts.astype('timedelta64[ns]') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1427 + * if coerce: + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) # <<<<<<<<<<<<<< + * return ts.astype('timedelta64[ns]') + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_type_for_timedelta_scala, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L15:; + + /* "pandas/tslib.pyx":1428 + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * return ts.astype('timedelta64[ns]') # <<<<<<<<<<<<<< + * + * def repr_timedelta64(object value, format=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ts, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1363 + * return convert_to_timedelta64(ts, unit, coerce) + * + * cdef inline convert_to_timedelta64(object ts, object unit, object coerce): # <<<<<<<<<<<<<< + * """ + * Convert an incoming object to a timedelta64 if possible + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.convert_to_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1430 + * return ts.astype('timedelta64[ns]') + * + * def repr_timedelta64(object value, format=None): # <<<<<<<<<<<<<< + * """ + * provide repr for timedelta64 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_33repr_timedelta64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_32repr_timedelta64[] = "\n provide repr for timedelta64\n\n Parameters\n ----------\n value : timedelta64\n format : None|\"short\"|\"long\"\n\n Returns\n -------\n converted : Timestamp\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_33repr_timedelta64 = {__Pyx_NAMESTR("repr_timedelta64"), (PyCFunction)__pyx_pw_6pandas_5tslib_33repr_timedelta64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_32repr_timedelta64)}; +static PyObject *__pyx_pw_6pandas_5tslib_33repr_timedelta64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_format = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("repr_timedelta64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_format,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "repr_timedelta64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = values[0]; + __pyx_v_format = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("repr_timedelta64", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.repr_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_32repr_timedelta64(__pyx_self, __pyx_v_value, __pyx_v_format); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_32repr_timedelta64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_format) { + PyObject *__pyx_v_ivalue = 0; + PyObject *__pyx_v_frac = NULL; + PyObject *__pyx_v_sign = NULL; + PyObject *__pyx_v_days = NULL; + PyObject *__pyx_v_hours = NULL; + PyObject *__pyx_v_minutes = NULL; + PyObject *__pyx_v_seconds = NULL; + PyObject *__pyx_v_seconds_pretty = NULL; + PyObject *__pyx_v_sp = NULL; + PyObject *__pyx_v_sign_pretty = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + double __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("repr_timedelta64", 0); + + /* "pandas/tslib.pyx":1446 + * cdef object ivalue + * + * ivalue = value.view('i8') # <<<<<<<<<<<<<< + * + * # put frac in seconds + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_ivalue = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1449 + * + * # put frac in seconds + * frac = float(ivalue)/1e9 # <<<<<<<<<<<<<< + * sign = np.sign(frac) + * frac = np.abs(frac) + */ + __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_v_ivalue); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble((__pyx_t_3 / 1e9)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_frac = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1450 + * # put frac in seconds + * frac = float(ivalue)/1e9 + * sign = np.sign(frac) # <<<<<<<<<<<<<< + * frac = np.abs(frac) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sign); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_frac); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_frac); + __Pyx_GIVEREF(__pyx_v_frac); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_sign = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1451 + * frac = float(ivalue)/1e9 + * sign = np.sign(frac) + * frac = np.abs(frac) # <<<<<<<<<<<<<< + * + * if frac >= 86400: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_frac); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_frac); + __Pyx_GIVEREF(__pyx_v_frac); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1453 + * frac = np.abs(frac) + * + * if frac >= 86400: # <<<<<<<<<<<<<< + * days = int(frac / 86400) + * frac -= days * 86400 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frac, __pyx_int_86400, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1454 + * + * if frac >= 86400: + * days = int(frac / 86400) # <<<<<<<<<<<<<< + * frac -= days * 86400 + * else: + */ + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_frac, __pyx_int_86400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_days = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1455 + * if frac >= 86400: + * days = int(frac / 86400) + * frac -= days * 86400 # <<<<<<<<<<<<<< + * else: + * days = 0 + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_days, __pyx_int_86400); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_frac, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":1457 + * frac -= days * 86400 + * else: + * days = 0 # <<<<<<<<<<<<<< + * + * if frac >= 3600: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_days = __pyx_int_0; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1459 + * days = 0 + * + * if frac >= 3600: # <<<<<<<<<<<<<< + * hours = int(frac / 3600) + * frac -= hours * 3600 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frac, __pyx_int_3600, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1460 + * + * if frac >= 3600: + * hours = int(frac / 3600) # <<<<<<<<<<<<<< + * frac -= hours * 3600 + * else: + */ + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_frac, __pyx_int_3600); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_hours = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1461 + * if frac >= 3600: + * hours = int(frac / 3600) + * frac -= hours * 3600 # <<<<<<<<<<<<<< + * else: + * hours = 0 + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_hours, __pyx_int_3600); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_frac, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":1463 + * frac -= hours * 3600 + * else: + * hours = 0 # <<<<<<<<<<<<<< + * + * if frac >= 60: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_hours = __pyx_int_0; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":1465 + * hours = 0 + * + * if frac >= 60: # <<<<<<<<<<<<<< + * minutes = int(frac / 60) + * frac -= minutes * 60 + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frac, __pyx_int_60, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1466 + * + * if frac >= 60: + * minutes = int(frac / 60) # <<<<<<<<<<<<<< + * frac -= minutes * 60 + * else: + */ + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_frac, __pyx_int_60); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_minutes = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1467 + * if frac >= 60: + * minutes = int(frac / 60) + * frac -= minutes * 60 # <<<<<<<<<<<<<< + * else: + * minutes = 0 + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_minutes, __pyx_int_60); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_frac, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1469 + * frac -= minutes * 60 + * else: + * minutes = 0 # <<<<<<<<<<<<<< + * + * if frac >= 1: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_minutes = __pyx_int_0; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":1471 + * minutes = 0 + * + * if frac >= 1: # <<<<<<<<<<<<<< + * seconds = int(frac) + * frac -= seconds + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frac, __pyx_int_1, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1472 + * + * if frac >= 1: + * seconds = int(frac) # <<<<<<<<<<<<<< + * frac -= seconds + * else: + */ + __pyx_t_1 = PyNumber_Int(__pyx_v_frac); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_seconds = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1473 + * if frac >= 1: + * seconds = int(frac) + * frac -= seconds # <<<<<<<<<<<<<< + * else: + * seconds = 0 + */ + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_frac, __pyx_v_seconds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/tslib.pyx":1475 + * frac -= seconds + * else: + * seconds = 0 # <<<<<<<<<<<<<< + * + * if frac == int(frac): + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_seconds = __pyx_int_0; + } + __pyx_L6:; + + /* "pandas/tslib.pyx":1477 + * seconds = 0 + * + * if frac == int(frac): # <<<<<<<<<<<<<< + * seconds_pretty = "%02d" % seconds + * else: + */ + __pyx_t_1 = PyNumber_Int(__pyx_v_frac); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_frac, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1478 + * + * if frac == int(frac): + * seconds_pretty = "%02d" % seconds # <<<<<<<<<<<<<< + * else: + * sp = abs(round(1e6*frac)) + */ + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_02d, __pyx_v_seconds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_seconds_pretty = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":1480 + * seconds_pretty = "%02d" % seconds + * else: + * sp = abs(round(1e6*frac)) # <<<<<<<<<<<<<< + * seconds_pretty = "%02d.%06d" % (seconds, sp) + * + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_float_1e6, __pyx_v_frac); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_sp = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1481 + * else: + * sp = abs(round(1e6*frac)) + * seconds_pretty = "%02d.%06d" % (seconds, sp) # <<<<<<<<<<<<<< + * + * if sign < 0: + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_seconds); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seconds); + __Pyx_GIVEREF(__pyx_v_seconds); + __Pyx_INCREF(__pyx_v_sp); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_sp); + __Pyx_GIVEREF(__pyx_v_sp); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_02d_06d, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_seconds_pretty = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L7:; + + /* "pandas/tslib.pyx":1483 + * seconds_pretty = "%02d.%06d" % (seconds, sp) + * + * if sign < 0: # <<<<<<<<<<<<<< + * sign_pretty = "-" + * else: + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_sign, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":1484 + * + * if sign < 0: + * sign_pretty = "-" # <<<<<<<<<<<<<< + * else: + * sign_pretty = "" + */ + __Pyx_INCREF(__pyx_kp_s__50); + __pyx_v_sign_pretty = __pyx_kp_s__50; + goto __pyx_L8; + } + /*else*/ { + + /* "pandas/tslib.pyx":1486 + * sign_pretty = "-" + * else: + * sign_pretty = "" # <<<<<<<<<<<<<< + * + * if days or format == 'long': + */ + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_v_sign_pretty = __pyx_kp_s__5; + } + __pyx_L8:; + + /* "pandas/tslib.pyx":1488 + * sign_pretty = "" + * + * if days or format == 'long': # <<<<<<<<<<<<<< + * if (hours or minutes or seconds or frac) or format != 'short': + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_days); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_5) { + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_format, __pyx_n_s_long, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_5; + } + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":1489 + * + * if days or format == 'long': + * if (hours or minutes or seconds or frac) or format != 'short': # <<<<<<<<<<<<<< + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, + * seconds_pretty) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_hours); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_7) { + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_minutes); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_5) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_seconds); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_6) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_frac); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_5; + } + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_7; + } + if (!__pyx_t_5) { + __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_format, __pyx_n_s_short, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_t_7; + } else { + __pyx_t_6 = __pyx_t_5; + } + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":1490 + * if days or format == 'long': + * if (hours or minutes or seconds or frac) or format != 'short': + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, # <<<<<<<<<<<<<< + * seconds_pretty) + * else: + */ + __Pyx_XDECREF(__pyx_r); + + /* "pandas/tslib.pyx":1491 + * if (hours or minutes or seconds or frac) or format != 'short': + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, + * seconds_pretty) # <<<<<<<<<<<<<< + * else: + * return "%s%d days" % (sign_pretty, days) + */ + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_sign_pretty); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_sign_pretty); + __Pyx_GIVEREF(__pyx_v_sign_pretty); + __Pyx_INCREF(__pyx_v_days); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_days); + __Pyx_GIVEREF(__pyx_v_days); + __Pyx_INCREF(__pyx_v_hours); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_hours); + __Pyx_GIVEREF(__pyx_v_hours); + __Pyx_INCREF(__pyx_v_minutes); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_minutes); + __Pyx_GIVEREF(__pyx_v_minutes); + __Pyx_INCREF(__pyx_v_seconds_pretty); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_seconds_pretty); + __Pyx_GIVEREF(__pyx_v_seconds_pretty); + + /* "pandas/tslib.pyx":1490 + * if days or format == 'long': + * if (hours or minutes or seconds or frac) or format != 'short': + * return "%s%d days, %02d:%02d:%s" % (sign_pretty, days, hours, minutes, # <<<<<<<<<<<<<< + * seconds_pretty) + * else: + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_d_days_02d_02d_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1493 + * seconds_pretty) + * else: + * return "%s%d days" % (sign_pretty, days) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_sign_pretty); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sign_pretty); + __Pyx_GIVEREF(__pyx_v_sign_pretty); + __Pyx_INCREF(__pyx_v_days); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_days); + __Pyx_GIVEREF(__pyx_v_days); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_d_days, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":1496 + * + * + * return "%s%02d:%02d:%s" % (sign_pretty, hours, minutes, seconds_pretty) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_sign_pretty); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_sign_pretty); + __Pyx_GIVEREF(__pyx_v_sign_pretty); + __Pyx_INCREF(__pyx_v_hours); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_hours); + __Pyx_GIVEREF(__pyx_v_hours); + __Pyx_INCREF(__pyx_v_minutes); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_minutes); + __Pyx_GIVEREF(__pyx_v_minutes); + __Pyx_INCREF(__pyx_v_seconds_pretty); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_seconds_pretty); + __Pyx_GIVEREF(__pyx_v_seconds_pretty); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_02d_02d_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1430 + * return ts.astype('timedelta64[ns]') + * + * def repr_timedelta64(object value, format=None): # <<<<<<<<<<<<<< + * """ + * provide repr for timedelta64 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.repr_timedelta64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ivalue); + __Pyx_XDECREF(__pyx_v_frac); + __Pyx_XDECREF(__pyx_v_sign); + __Pyx_XDECREF(__pyx_v_days); + __Pyx_XDECREF(__pyx_v_hours); + __Pyx_XDECREF(__pyx_v_minutes); + __Pyx_XDECREF(__pyx_v_seconds); + __Pyx_XDECREF(__pyx_v_seconds_pretty); + __Pyx_XDECREF(__pyx_v_sp); + __Pyx_XDECREF(__pyx_v_sign_pretty); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1499 + * + * + * def array_strptime(ndarray[object] values, object fmt, coerce=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_35array_strptime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_35array_strptime = {__Pyx_NAMESTR("array_strptime"), (PyCFunction)__pyx_pw_6pandas_5tslib_35array_strptime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_35array_strptime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_fmt = 0; + PyObject *__pyx_v_coerce = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("array_strptime (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_fmt,&__pyx_n_s_coerce,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmt)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("array_strptime", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coerce); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array_strptime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_fmt = values[1]; + __pyx_v_coerce = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("array_strptime", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_34array_strptime(__pyx_self, __pyx_v_values, __pyx_v_fmt, __pyx_v_coerce); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_34array_strptime(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_fmt, PyObject *__pyx_v_coerce) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + PyArrayObject *__pyx_v_iresult = 0; + int __pyx_v_year; + int __pyx_v_month; + int __pyx_v_day; + int __pyx_v_minute; + int __pyx_v_hour; + int __pyx_v_second; + int __pyx_v_fraction; + int __pyx_v_weekday; + int __pyx_v_julian; + PyObject *__pyx_v_val = 0; + PyObject *__pyx_v_locale_time = NULL; + PyObject *__pyx_v_format_regex = NULL; + PyObject *__pyx_v_err = NULL; + PyObject *__pyx_v_bad_directive = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v__parse_code_table = 0; + int __pyx_v_parse_code; + PyObject *__pyx_v_found = NULL; + CYTHON_UNUSED PyObject *__pyx_v_tz = NULL; + PyObject *__pyx_v_week_of_year = NULL; + long __pyx_v_week_of_year_start; + PyObject *__pyx_v_found_dict = NULL; + PyObject *__pyx_v_group_key = NULL; + PyObject *__pyx_v_ampm = NULL; + PyObject *__pyx_v_s = NULL; + PyObject *__pyx_v_found_zone = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_tz_values = NULL; + int __pyx_v_week_starts_Mon; + PyObject *__pyx_v_datetime_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyArrayObject *__pyx_t_17 = NULL; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + __pyx_t_5numpy_int64_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + int __pyx_t_29; + int __pyx_t_30; + Py_ssize_t __pyx_t_31; + PyObject *(*__pyx_t_32)(PyObject *); + PyObject *__pyx_t_33 = NULL; + int __pyx_t_34; + int __pyx_t_35; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("array_strptime", 0); + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1501 + * def array_strptime(ndarray[object] values, object fmt, coerce=False): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * ndarray[int64_t] iresult + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":1508 + * + * global _TimeRE_cache, _regex_cache + * with _cache_lock: # <<<<<<<<<<<<<< + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() + */ + /*with:*/ { + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "pandas/tslib.pyx":1509 + * global _TimeRE_cache, _regex_cache + * with _cache_lock: + * if _getlang() != _TimeRE_cache.locale_time.lang: # <<<<<<<<<<<<<< + * _TimeRE_cache = TimeRE() + * _regex_cache.clear() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_getlang); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lang); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1510 + * with _cache_lock: + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() # <<<<<<<<<<<<<< + * _regex_cache.clear() + * if len(_regex_cache) > _CACHE_MAX_SIZE: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeRE_cache, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1511 + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() + * _regex_cache.clear() # <<<<<<<<<<<<<< + * if len(_regex_cache) > _CACHE_MAX_SIZE: + * _regex_cache.clear() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "pandas/tslib.pyx":1512 + * _TimeRE_cache = TimeRE() + * _regex_cache.clear() + * if len(_regex_cache) > _CACHE_MAX_SIZE: # <<<<<<<<<<<<<< + * _regex_cache.clear() + * locale_time = _TimeRE_cache.locale_time + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CACHE_MAX_SIZE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1513 + * _regex_cache.clear() + * if len(_regex_cache) > _CACHE_MAX_SIZE: + * _regex_cache.clear() # <<<<<<<<<<<<<< + * locale_time = _TimeRE_cache.locale_time + * format_regex = _regex_cache.get(fmt) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/tslib.pyx":1514 + * if len(_regex_cache) > _CACHE_MAX_SIZE: + * _regex_cache.clear() + * locale_time = _TimeRE_cache.locale_time # <<<<<<<<<<<<<< + * format_regex = _regex_cache.get(fmt) + * if not format_regex: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_locale_time = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1515 + * _regex_cache.clear() + * locale_time = _TimeRE_cache.locale_time + * format_regex = _regex_cache.get(fmt) # <<<<<<<<<<<<<< + * if not format_regex: + * try: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_fmt); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmt); + __Pyx_GIVEREF(__pyx_v_fmt); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_format_regex = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1516 + * locale_time = _TimeRE_cache.locale_time + * format_regex = _regex_cache.get(fmt) + * if not format_regex: # <<<<<<<<<<<<<< + * try: + * format_regex = _TimeRE_cache.compile(fmt) + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_format_regex); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = ((!__pyx_t_9) != 0); + if (__pyx_t_10) { + + /* "pandas/tslib.pyx":1517 + * format_regex = _regex_cache.get(fmt) + * if not format_regex: + * try: # <<<<<<<<<<<<<< + * format_regex = _TimeRE_cache.compile(fmt) + * # KeyError raised when a bad format is found; can be specified as + */ + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "pandas/tslib.pyx":1518 + * if not format_regex: + * try: + * format_regex = _TimeRE_cache.compile(fmt) # <<<<<<<<<<<<<< + * # KeyError raised when a bad format is found; can be specified as + * # \\, in which case it was a stray % but with a space after it + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_fmt); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fmt); + __Pyx_GIVEREF(__pyx_v_fmt); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_format_regex, __pyx_t_5); + __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1521 + * # KeyError raised when a bad format is found; can be specified as + * # \\, in which case it was a stray % but with a space after it + * except KeyError, err: # <<<<<<<<<<<<<< + * bad_directive = err.args[0] + * if bad_directive == "\\": + */ + __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_14) { + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_err = __pyx_t_2; + + /* "pandas/tslib.pyx":1522 + * # \\, in which case it was a stray % but with a space after it + * except KeyError, err: + * bad_directive = err.args[0] # <<<<<<<<<<<<<< + * if bad_directive == "\\": + * bad_directive = "%" + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_err, __pyx_n_s_args); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}; + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_v_bad_directive = __pyx_t_16; + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":1523 + * except KeyError, err: + * bad_directive = err.args[0] + * if bad_directive == "\\": # <<<<<<<<<<<<<< + * bad_directive = "%" + * del err + */ + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_bad_directive, __pyx_kp_s__51, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + if (__pyx_t_10) { + + /* "pandas/tslib.pyx":1524 + * bad_directive = err.args[0] + * if bad_directive == "\\": + * bad_directive = "%" # <<<<<<<<<<<<<< + * del err + * raise ValueError("'%s' is a bad directive in format '%s'" % + */ + __Pyx_INCREF(__pyx_kp_s__52); + __Pyx_DECREF_SET(__pyx_v_bad_directive, __pyx_kp_s__52); + goto __pyx_L28; + } + __pyx_L28:; + + /* "pandas/tslib.pyx":1525 + * if bad_directive == "\\": + * bad_directive = "%" + * del err # <<<<<<<<<<<<<< + * raise ValueError("'%s' is a bad directive in format '%s'" % + * (bad_directive, fmt)) + */ + __Pyx_DECREF(__pyx_v_err); + __pyx_v_err = NULL; + + /* "pandas/tslib.pyx":1527 + * del err + * raise ValueError("'%s' is a bad directive in format '%s'" % + * (bad_directive, fmt)) # <<<<<<<<<<<<<< + * # IndexError only occurs when the format string is "%" + * except IndexError: + */ + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_bad_directive); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_bad_directive); + __Pyx_GIVEREF(__pyx_v_bad_directive); + __Pyx_INCREF(__pyx_v_fmt); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_fmt); + __Pyx_GIVEREF(__pyx_v_fmt); + + /* "pandas/tslib.pyx":1526 + * bad_directive = "%" + * del err + * raise ValueError("'%s' is a bad directive in format '%s'" % # <<<<<<<<<<<<<< + * (bad_directive, fmt)) + * # IndexError only occurs when the format string is "%" + */ + __pyx_t_15 = __Pyx_PyString_Format(__pyx_kp_s_s_is_a_bad_directive_in_format, __pyx_t_16); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_Raise(__pyx_t_15, 0, 0, 0); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L19_exception_handled; + } + + /* "pandas/tslib.pyx":1529 + * (bad_directive, fmt)) + * # IndexError only occurs when the format string is "%" + * except IndexError: # <<<<<<<<<<<<<< + * raise ValueError("stray %% in format '%s'" % fmt) + * _regex_cache[fmt] = format_regex + */ + __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_IndexError); + if (__pyx_t_14) { + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":1530 + * # IndexError only occurs when the format string is "%" + * except IndexError: + * raise ValueError("stray %% in format '%s'" % fmt) # <<<<<<<<<<<<<< + * _regex_cache[fmt] = format_regex + * + */ + __pyx_t_15 = __Pyx_PyString_Format(__pyx_kp_s_stray_in_format_s, __pyx_v_fmt); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_Raise(__pyx_t_15, 0, 0, 0); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L19_exception_handled; + } + goto __pyx_L20_except_error; + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L7_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L25_try_end:; + } + + /* "pandas/tslib.pyx":1531 + * except IndexError: + * raise ValueError("stray %% in format '%s'" % fmt) + * _regex_cache[fmt] = format_regex # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype='M8[ns]') + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_regex_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_fmt, __pyx_v_format_regex) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L17; + } + __pyx_L17:; + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1508 + * + * global _TimeRE_cache, _regex_cache + * with _cache_lock: # <<<<<<<<<<<<<< + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_15, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_9 = ((!(__pyx_t_10 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_2, __pyx_t_4); + __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L14_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_3) { + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__53, NULL); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + goto __pyx_L6; + } + __pyx_L6:; + } + goto __pyx_L34; + __pyx_L3_error:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L1_error; + __pyx_L34:; + } + + /* "pandas/tslib.pyx":1533 + * _regex_cache[fmt] = format_regex + * + * result = np.empty(n, dtype='M8[ns]') # <<<<<<<<<<<<<< + * iresult = result.view('i8') + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_15; + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":1534 + * + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * + * dts.us = dts.ps = dts.as = 0 + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_view); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_14 < 0)) { + PyErr_Fetch(&__pyx_t_3, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_3, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1536 + * iresult = result.view('i8') + * + * dts.us = dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * + * cdef dict _parse_code_table = { + */ + __pyx_v_dts.us = 0; + __pyx_v_dts.ps = 0; + __pyx_v_dts.as = 0; + + /* "pandas/tslib.pyx":1538 + * dts.us = dts.ps = dts.as = 0 + * + * cdef dict _parse_code_table = { # <<<<<<<<<<<<<< + * 'y': 0, + * 'Y': 1, + */ + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Y, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_m, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_B, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_b, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_d, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_H, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_I, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_M, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_S, __pyx_int_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_f, __pyx_int_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_A, __pyx_int_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_a, __pyx_int_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_w, __pyx_int_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_j, __pyx_int_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_U, __pyx_int_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_W, __pyx_int_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Z_2, __pyx_int_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_p, __pyx_int_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v__parse_code_table = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1561 + * cdef int parse_code + * + * for i in range(n): # <<<<<<<<<<<<<< + * val = values[i] + * if util.is_string_object(val): + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_1; __pyx_t_18+=1) { + __pyx_v_i = __pyx_t_18; + + /* "pandas/tslib.pyx":1562 + * + * for i in range(n): + * val = values[i] # <<<<<<<<<<<<<< + * if util.is_string_object(val): + * if val in _nat_strings: + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1563 + * for i in range(n): + * val = values[i] + * if util.is_string_object(val): # <<<<<<<<<<<<<< + * if val in _nat_strings: + * iresult[i] = iNaT + */ + __pyx_t_9 = (is_string_object(__pyx_v_val) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1564 + * val = values[i] + * if util.is_string_object(val): + * if val in _nat_strings: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_nat_strings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_val, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "pandas/tslib.pyx":1565 + * if util.is_string_object(val): + * if val in _nat_strings: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_21 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1566 + * if val in _nat_strings: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * else: + * if _checknull_with_nat(val): + */ + goto __pyx_L35_continue; + } + goto __pyx_L37; + } + /*else*/ { + + /* "pandas/tslib.pyx":1568 + * continue + * else: + * if _checknull_with_nat(val): # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_10 = (__pyx_f_6pandas_5tslib__checknull_with_nat(__pyx_v_val) != 0); + if (__pyx_t_10) { + + /* "pandas/tslib.pyx":1569 + * else: + * if _checknull_with_nat(val): + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_22 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1570 + * if _checknull_with_nat(val): + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * else: + * val = str(val) + */ + goto __pyx_L35_continue; + } + /*else*/ { + + /* "pandas/tslib.pyx":1572 + * continue + * else: + * val = str(val) # <<<<<<<<<<<<<< + * + * found = format_regex.match(val) + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_15); + __pyx_t_15 = 0; + } + } + __pyx_L37:; + + /* "pandas/tslib.pyx":1574 + * val = str(val) + * + * found = format_regex.match(val) # <<<<<<<<<<<<<< + * if not found: + * if coerce: + */ + if (unlikely(!__pyx_v_format_regex)) { __Pyx_RaiseUnboundLocalError("format_regex"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_format_regex, __pyx_n_s_match); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_found, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1575 + * + * found = format_regex.match(val) + * if not found: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_found); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((!__pyx_t_10) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1576 + * found = format_regex.match(val) + * if not found: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1577 + * if not found: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise ValueError("time data %r does not match format %r" % + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_23 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1578 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise ValueError("time data %r does not match format %r" % + * (values[i], fmt)) + */ + goto __pyx_L35_continue; + } + + /* "pandas/tslib.pyx":1580 + * continue + * raise ValueError("time data %r does not match format %r" % + * (values[i], fmt)) # <<<<<<<<<<<<<< + * if len(val) != found.end(): + * if coerce: + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_fmt); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_fmt); + __Pyx_GIVEREF(__pyx_v_fmt); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1579 + * iresult[i] = iNaT + * continue + * raise ValueError("time data %r does not match format %r" % # <<<<<<<<<<<<<< + * (values[i], fmt)) + * if len(val) != found.end(): + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_time_data_r_does_not_match_forma, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1581 + * raise ValueError("time data %r does not match format %r" % + * (values[i], fmt)) + * if len(val) != found.end(): # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_25 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_25); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s_end); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_15, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1582 + * (values[i], fmt)) + * if len(val) != found.end(): + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1583 + * if len(val) != found.end(): + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise ValueError("unconverted data remains: %s" % + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_25 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1584 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise ValueError("unconverted data remains: %s" % + * values[i][found.end():]) + */ + goto __pyx_L35_continue; + } + + /* "pandas/tslib.pyx":1586 + * continue + * raise ValueError("unconverted data remains: %s" % + * values[i][found.end():]) # <<<<<<<<<<<<<< + * year = 1900 + * month = day = 1 + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_4); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s_end); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_5, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1585 + * iresult[i] = iNaT + * continue + * raise ValueError("unconverted data remains: %s" % # <<<<<<<<<<<<<< + * values[i][found.end():]) + * year = 1900 + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_unconverted_data_remains_s, __pyx_t_15); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1587 + * raise ValueError("unconverted data remains: %s" % + * values[i][found.end():]) + * year = 1900 # <<<<<<<<<<<<<< + * month = day = 1 + * hour = minute = second = fraction = 0 + */ + __pyx_v_year = 1900; + + /* "pandas/tslib.pyx":1588 + * values[i][found.end():]) + * year = 1900 + * month = day = 1 # <<<<<<<<<<<<<< + * hour = minute = second = fraction = 0 + * tz = -1 + */ + __pyx_v_month = 1; + __pyx_v_day = 1; + + /* "pandas/tslib.pyx":1589 + * year = 1900 + * month = day = 1 + * hour = minute = second = fraction = 0 # <<<<<<<<<<<<<< + * tz = -1 + * # Default to -1 to signify that values not known; not critical to have, + */ + __pyx_v_hour = 0; + __pyx_v_minute = 0; + __pyx_v_second = 0; + __pyx_v_fraction = 0; + + /* "pandas/tslib.pyx":1590 + * month = day = 1 + * hour = minute = second = fraction = 0 + * tz = -1 # <<<<<<<<<<<<<< + * # Default to -1 to signify that values not known; not critical to have, + * # though + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_XDECREF_SET(__pyx_v_tz, __pyx_int_neg_1); + + /* "pandas/tslib.pyx":1593 + * # Default to -1 to signify that values not known; not critical to have, + * # though + * week_of_year = -1 # <<<<<<<<<<<<<< + * week_of_year_start = -1 + * # weekday and julian defaulted to -1 so as to signal need to calculate + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_XDECREF_SET(__pyx_v_week_of_year, __pyx_int_neg_1); + + /* "pandas/tslib.pyx":1594 + * # though + * week_of_year = -1 + * week_of_year_start = -1 # <<<<<<<<<<<<<< + * # weekday and julian defaulted to -1 so as to signal need to calculate + * # values + */ + __pyx_v_week_of_year_start = -1; + + /* "pandas/tslib.pyx":1597 + * # weekday and julian defaulted to -1 so as to signal need to calculate + * # values + * weekday = julian = -1 # <<<<<<<<<<<<<< + * found_dict = found.groupdict() + * for group_key in found_dict.iterkeys(): + */ + __pyx_v_weekday = -1; + __pyx_v_julian = -1; + + /* "pandas/tslib.pyx":1598 + * # values + * weekday = julian = -1 + * found_dict = found.groupdict() # <<<<<<<<<<<<<< + * for group_key in found_dict.iterkeys(): + * # Directives not explicitly handled below: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s_groupdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_found_dict, __pyx_t_15); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":1599 + * weekday = julian = -1 + * found_dict = found.groupdict() + * for group_key in found_dict.iterkeys(): # <<<<<<<<<<<<<< + * # Directives not explicitly handled below: + * # c, x, X + */ + __pyx_t_27 = 0; + if (unlikely(__pyx_v_found_dict == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iterkeys"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_found_dict, 0, __pyx_n_s_iterkeys, (&__pyx_t_28), (&__pyx_t_14)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_15); + __pyx_t_15 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_29 = __Pyx_dict_iter_next(__pyx_t_15, __pyx_t_28, &__pyx_t_27, &__pyx_t_5, NULL, NULL, __pyx_t_14); + if (unlikely(__pyx_t_29 == 0)) break; + if (unlikely(__pyx_t_29 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_group_key, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1605 + * # U, W + * # worthless without day of the week + * parse_code = _parse_code_table[group_key] # <<<<<<<<<<<<<< + * + * if parse_code == 0: + */ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v__parse_code_table, __pyx_v_group_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_parse_code = __pyx_t_29; + + /* "pandas/tslib.pyx":1677 + * # W starts week on Monday. + * week_of_year_start = 0 + * elif parse_code == 17: # <<<<<<<<<<<<<< + * # Since -1 is default value only need to worry about setting tz + * # if it can be something other than -1. + */ + switch (__pyx_v_parse_code) { + + /* "pandas/tslib.pyx":1607 + * parse_code = _parse_code_table[group_key] + * + * if parse_code == 0: # <<<<<<<<<<<<<< + * year = int(found_dict['y']) + * # Open Group specification for strptime() states that a %y + */ + case 0: + + /* "pandas/tslib.pyx":1608 + * + * if parse_code == 0: + * year = int(found_dict['y']) # <<<<<<<<<<<<<< + * # Open Group specification for strptime() states that a %y + * #value in the range of [00, 68] is in the century 2000, while + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_y); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_year = __pyx_t_29; + + /* "pandas/tslib.pyx":1612 + * #value in the range of [00, 68] is in the century 2000, while + * #[69,99] is in the century 1900 + * if year <= 68: # <<<<<<<<<<<<<< + * year += 2000 + * else: + */ + __pyx_t_9 = ((__pyx_v_year <= 68) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1613 + * #[69,99] is in the century 1900 + * if year <= 68: + * year += 2000 # <<<<<<<<<<<<<< + * else: + * year += 1900 + */ + __pyx_v_year = (__pyx_v_year + 2000); + goto __pyx_L46; + } + /*else*/ { + + /* "pandas/tslib.pyx":1615 + * year += 2000 + * else: + * year += 1900 # <<<<<<<<<<<<<< + * elif parse_code == 1: + * year = int(found_dict['Y']) + */ + __pyx_v_year = (__pyx_v_year + 1900); + } + __pyx_L46:; + break; + + /* "pandas/tslib.pyx":1616 + * else: + * year += 1900 + * elif parse_code == 1: # <<<<<<<<<<<<<< + * year = int(found_dict['Y']) + * elif parse_code == 2: + */ + case 1: + + /* "pandas/tslib.pyx":1617 + * year += 1900 + * elif parse_code == 1: + * year = int(found_dict['Y']) # <<<<<<<<<<<<<< + * elif parse_code == 2: + * month = int(found_dict['m']) + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_Y); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_year = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1618 + * elif parse_code == 1: + * year = int(found_dict['Y']) + * elif parse_code == 2: # <<<<<<<<<<<<<< + * month = int(found_dict['m']) + * elif parse_code == 3: + */ + case 2: + + /* "pandas/tslib.pyx":1619 + * year = int(found_dict['Y']) + * elif parse_code == 2: + * month = int(found_dict['m']) # <<<<<<<<<<<<<< + * elif parse_code == 3: + * # elif group_key == 'B': + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_m); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_month = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1620 + * elif parse_code == 2: + * month = int(found_dict['m']) + * elif parse_code == 3: # <<<<<<<<<<<<<< + * # elif group_key == 'B': + * month = locale_time.f_month.index(found_dict['B'].lower()) + */ + case 3: + + /* "pandas/tslib.pyx":1622 + * elif parse_code == 3: + * # elif group_key == 'B': + * month = locale_time.f_month.index(found_dict['B'].lower()) # <<<<<<<<<<<<<< + * elif parse_code == 4: + * # elif group_key == 'b': + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_f_month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_B); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_month = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1623 + * # elif group_key == 'B': + * month = locale_time.f_month.index(found_dict['B'].lower()) + * elif parse_code == 4: # <<<<<<<<<<<<<< + * # elif group_key == 'b': + * month = locale_time.a_month.index(found_dict['b'].lower()) + */ + case 4: + + /* "pandas/tslib.pyx":1625 + * elif parse_code == 4: + * # elif group_key == 'b': + * month = locale_time.a_month.index(found_dict['b'].lower()) # <<<<<<<<<<<<<< + * elif parse_code == 5: + * # elif group_key == 'd': + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_a_month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_b); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_month = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1626 + * # elif group_key == 'b': + * month = locale_time.a_month.index(found_dict['b'].lower()) + * elif parse_code == 5: # <<<<<<<<<<<<<< + * # elif group_key == 'd': + * day = int(found_dict['d']) + */ + case 5: + + /* "pandas/tslib.pyx":1628 + * elif parse_code == 5: + * # elif group_key == 'd': + * day = int(found_dict['d']) # <<<<<<<<<<<<<< + * elif parse_code == 6: + * # elif group_key == 'H': + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_d); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_day = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1629 + * # elif group_key == 'd': + * day = int(found_dict['d']) + * elif parse_code == 6: # <<<<<<<<<<<<<< + * # elif group_key == 'H': + * hour = int(found_dict['H']) + */ + case 6: + + /* "pandas/tslib.pyx":1631 + * elif parse_code == 6: + * # elif group_key == 'H': + * hour = int(found_dict['H']) # <<<<<<<<<<<<<< + * elif parse_code == 7: + * hour = int(found_dict['I']) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_H); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_hour = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1632 + * # elif group_key == 'H': + * hour = int(found_dict['H']) + * elif parse_code == 7: # <<<<<<<<<<<<<< + * hour = int(found_dict['I']) + * ampm = found_dict.get('p', '').lower() + */ + case 7: + + /* "pandas/tslib.pyx":1633 + * hour = int(found_dict['H']) + * elif parse_code == 7: + * hour = int(found_dict['I']) # <<<<<<<<<<<<<< + * ampm = found_dict.get('p', '').lower() + * # If there was no AM/PM indicator, we'll treat this like AM + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_I); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_hour = __pyx_t_29; + + /* "pandas/tslib.pyx":1634 + * elif parse_code == 7: + * hour = int(found_dict['I']) + * ampm = found_dict.get('p', '').lower() # <<<<<<<<<<<<<< + * # If there was no AM/PM indicator, we'll treat this like AM + * if ampm in ('', locale_time.am_pm[0]): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_found_dict, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_ampm, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1636 + * ampm = found_dict.get('p', '').lower() + * # If there was no AM/PM indicator, we'll treat this like AM + * if ampm in ('', locale_time.am_pm[0]): # <<<<<<<<<<<<<< + * # We're in AM so the hour is correct unless we're + * # looking at 12 midnight. + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_am_pm); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_v_ampm); + __pyx_t_4 = __pyx_v_ampm; + __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__5, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_9) { + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_30 = __pyx_t_10; + } else { + __pyx_t_30 = __pyx_t_9; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = (__pyx_t_30 != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1640 + * # looking at 12 midnight. + * # 12 midnight == 12 AM == hour 0 + * if hour == 12: # <<<<<<<<<<<<<< + * hour = 0 + * elif ampm == locale_time.am_pm[1]: + */ + __pyx_t_9 = ((__pyx_v_hour == 12) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1641 + * # 12 midnight == 12 AM == hour 0 + * if hour == 12: + * hour = 0 # <<<<<<<<<<<<<< + * elif ampm == locale_time.am_pm[1]: + * # We're in PM so we need to add 12 to the hour unless + */ + __pyx_v_hour = 0; + goto __pyx_L48; + } + __pyx_L48:; + goto __pyx_L47; + } + + /* "pandas/tslib.pyx":1642 + * if hour == 12: + * hour = 0 + * elif ampm == locale_time.am_pm[1]: # <<<<<<<<<<<<<< + * # We're in PM so we need to add 12 to the hour unless + * # we're looking at 12 noon. + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_am_pm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_v_ampm, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1646 + * # we're looking at 12 noon. + * # 12 noon == 12 PM == hour 12 + * if hour != 12: # <<<<<<<<<<<<<< + * hour += 12 + * elif parse_code == 8: + */ + __pyx_t_9 = ((__pyx_v_hour != 12) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1647 + * # 12 noon == 12 PM == hour 12 + * if hour != 12: + * hour += 12 # <<<<<<<<<<<<<< + * elif parse_code == 8: + * minute = int(found_dict['M']) + */ + __pyx_v_hour = (__pyx_v_hour + 12); + goto __pyx_L49; + } + __pyx_L49:; + goto __pyx_L47; + } + __pyx_L47:; + break; + + /* "pandas/tslib.pyx":1648 + * if hour != 12: + * hour += 12 + * elif parse_code == 8: # <<<<<<<<<<<<<< + * minute = int(found_dict['M']) + * elif parse_code == 9: + */ + case 8: + + /* "pandas/tslib.pyx":1649 + * hour += 12 + * elif parse_code == 8: + * minute = int(found_dict['M']) # <<<<<<<<<<<<<< + * elif parse_code == 9: + * second = int(found_dict['S']) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_M); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_minute = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1650 + * elif parse_code == 8: + * minute = int(found_dict['M']) + * elif parse_code == 9: # <<<<<<<<<<<<<< + * second = int(found_dict['S']) + * elif parse_code == 10: + */ + case 9: + + /* "pandas/tslib.pyx":1651 + * minute = int(found_dict['M']) + * elif parse_code == 9: + * second = int(found_dict['S']) # <<<<<<<<<<<<<< + * elif parse_code == 10: + * s = found_dict['f'] + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_S); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_second = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1652 + * elif parse_code == 9: + * second = int(found_dict['S']) + * elif parse_code == 10: # <<<<<<<<<<<<<< + * s = found_dict['f'] + * # Pad to always return microseconds. + */ + case 10: + + /* "pandas/tslib.pyx":1653 + * second = int(found_dict['S']) + * elif parse_code == 10: + * s = found_dict['f'] # <<<<<<<<<<<<<< + * # Pad to always return microseconds. + * s += "0" * (6 - len(s)) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_f); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1655 + * s = found_dict['f'] + * # Pad to always return microseconds. + * s += "0" * (6 - len(s)) # <<<<<<<<<<<<<< + * fraction = int(s) + * elif parse_code == 11: + */ + __pyx_t_31 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_31 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t((6 - __pyx_t_31)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Multiply(__pyx_kp_s_0, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1656 + * # Pad to always return microseconds. + * s += "0" * (6 - len(s)) + * fraction = int(s) # <<<<<<<<<<<<<< + * elif parse_code == 11: + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) + */ + __pyx_t_5 = PyNumber_Int(__pyx_v_s); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_fraction = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1657 + * s += "0" * (6 - len(s)) + * fraction = int(s) + * elif parse_code == 11: # <<<<<<<<<<<<<< + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) + * elif parse_code == 12: + */ + case 11: + + /* "pandas/tslib.pyx":1658 + * fraction = int(s) + * elif parse_code == 11: + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) # <<<<<<<<<<<<<< + * elif parse_code == 12: + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_f_weekday); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_A); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_weekday = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1659 + * elif parse_code == 11: + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) + * elif parse_code == 12: # <<<<<<<<<<<<<< + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) + * elif parse_code == 13: + */ + case 12: + + /* "pandas/tslib.pyx":1660 + * weekday = locale_time.f_weekday.index(found_dict['A'].lower()) + * elif parse_code == 12: + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) # <<<<<<<<<<<<<< + * elif parse_code == 13: + * weekday = int(found_dict['w']) + */ + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_a_weekday); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_a); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_weekday = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1661 + * elif parse_code == 12: + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) + * elif parse_code == 13: # <<<<<<<<<<<<<< + * weekday = int(found_dict['w']) + * if weekday == 0: + */ + case 13: + + /* "pandas/tslib.pyx":1662 + * weekday = locale_time.a_weekday.index(found_dict['a'].lower()) + * elif parse_code == 13: + * weekday = int(found_dict['w']) # <<<<<<<<<<<<<< + * if weekday == 0: + * weekday = 6 + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_w); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_weekday = __pyx_t_29; + + /* "pandas/tslib.pyx":1663 + * elif parse_code == 13: + * weekday = int(found_dict['w']) + * if weekday == 0: # <<<<<<<<<<<<<< + * weekday = 6 + * else: + */ + __pyx_t_9 = ((__pyx_v_weekday == 0) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1664 + * weekday = int(found_dict['w']) + * if weekday == 0: + * weekday = 6 # <<<<<<<<<<<<<< + * else: + * weekday -= 1 + */ + __pyx_v_weekday = 6; + goto __pyx_L50; + } + /*else*/ { + + /* "pandas/tslib.pyx":1666 + * weekday = 6 + * else: + * weekday -= 1 # <<<<<<<<<<<<<< + * elif parse_code == 14: + * julian = int(found_dict['j']) + */ + __pyx_v_weekday = (__pyx_v_weekday - 1); + } + __pyx_L50:; + break; + + /* "pandas/tslib.pyx":1667 + * else: + * weekday -= 1 + * elif parse_code == 14: # <<<<<<<<<<<<<< + * julian = int(found_dict['j']) + * elif parse_code == 15 or parse_code == 16: + */ + case 14: + + /* "pandas/tslib.pyx":1668 + * weekday -= 1 + * elif parse_code == 14: + * julian = int(found_dict['j']) # <<<<<<<<<<<<<< + * elif parse_code == 15 or parse_code == 16: + * week_of_year = int(found_dict[group_key]) + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_j); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_29 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_29 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_julian = __pyx_t_29; + break; + + /* "pandas/tslib.pyx":1669 + * elif parse_code == 14: + * julian = int(found_dict['j']) + * elif parse_code == 15 or parse_code == 16: # <<<<<<<<<<<<<< + * week_of_year = int(found_dict[group_key]) + * if group_key == 'U': + */ + case 15: + case 16: + + /* "pandas/tslib.pyx":1670 + * julian = int(found_dict['j']) + * elif parse_code == 15 or parse_code == 16: + * week_of_year = int(found_dict[group_key]) # <<<<<<<<<<<<<< + * if group_key == 'U': + * # U starts week on Sunday. + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_found_dict, __pyx_v_group_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_week_of_year, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1671 + * elif parse_code == 15 or parse_code == 16: + * week_of_year = int(found_dict[group_key]) + * if group_key == 'U': # <<<<<<<<<<<<<< + * # U starts week on Sunday. + * week_of_year_start = 6 + */ + __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_group_key, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1673 + * if group_key == 'U': + * # U starts week on Sunday. + * week_of_year_start = 6 # <<<<<<<<<<<<<< + * else: + * # W starts week on Monday. + */ + __pyx_v_week_of_year_start = 6; + goto __pyx_L51; + } + /*else*/ { + + /* "pandas/tslib.pyx":1676 + * else: + * # W starts week on Monday. + * week_of_year_start = 0 # <<<<<<<<<<<<<< + * elif parse_code == 17: + * # Since -1 is default value only need to worry about setting tz + */ + __pyx_v_week_of_year_start = 0; + } + __pyx_L51:; + break; + + /* "pandas/tslib.pyx":1677 + * # W starts week on Monday. + * week_of_year_start = 0 + * elif parse_code == 17: # <<<<<<<<<<<<<< + * # Since -1 is default value only need to worry about setting tz + * # if it can be something other than -1. + */ + case 17: + + /* "pandas/tslib.pyx":1680 + * # Since -1 is default value only need to worry about setting tz + * # if it can be something other than -1. + * found_zone = found_dict['Z'].lower() # <<<<<<<<<<<<<< + * for value, tz_values in enumerate(locale_time.timezone): + * if found_zone in tz_values: + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_found_dict, __pyx_n_s_Z_2); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_found_zone, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1681 + * # if it can be something other than -1. + * found_zone = found_dict['Z'].lower() + * for value, tz_values in enumerate(locale_time.timezone): # <<<<<<<<<<<<<< + * if found_zone in tz_values: + * # Deal w/ bad locale setup where timezone names are the + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_4 = __pyx_int_0; + if (unlikely(!__pyx_v_locale_time)) { __Pyx_RaiseUnboundLocalError("locale_time"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_locale_time, __pyx_n_s_timezone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { + __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_31 = 0; + __pyx_t_32 = NULL; + } else { + __pyx_t_31 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_32 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + for (;;) { + if (!__pyx_t_32 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_31 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_31); __Pyx_INCREF(__pyx_t_5); __pyx_t_31++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_31); __pyx_t_31++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_32 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_31 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_31); __Pyx_INCREF(__pyx_t_5); __pyx_t_31++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_31); __pyx_t_31++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_32(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_tz_values, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1682 + * found_zone = found_dict['Z'].lower() + * for value, tz_values in enumerate(locale_time.timezone): + * if found_zone in tz_values: # <<<<<<<<<<<<<< + * # Deal w/ bad locale setup where timezone names are the + * # same and yet time.daylight is true; too ambiguous to + */ + __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_found_zone, __pyx_v_tz_values, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_30 = (__pyx_t_9 != 0); + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1686 + * # same and yet time.daylight is true; too ambiguous to + * # be able to tell what timezone has daylight savings + * if (time.tzname[0] == time.tzname[1] and # <<<<<<<<<<<<<< + * time.daylight and found_zone not in ("utc", "gmt")): + * break + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tzname); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_tzname); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_33, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_33 = PyObject_RichCompare(__pyx_t_5, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_33); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_33); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1687 + * # be able to tell what timezone has daylight savings + * if (time.tzname[0] == time.tzname[1] and + * time.daylight and found_zone not in ("utc", "gmt")): # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_33 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_daylight); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (__pyx_t_9) { + __Pyx_INCREF(__pyx_v_found_zone); + __pyx_t_16 = __pyx_v_found_zone; + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_16, __pyx_n_s_utc, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_10) { + __pyx_t_34 = (__Pyx_PyString_Equals(__pyx_t_16, __pyx_n_s_gmt, Py_NE)); if (unlikely(__pyx_t_34 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_35 = __pyx_t_34; + } else { + __pyx_t_35 = __pyx_t_10; + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_10 = __pyx_t_35; + __pyx_t_35 = __pyx_t_10; + } else { + __pyx_t_35 = __pyx_t_9; + } + __pyx_t_9 = __pyx_t_35; + } else { + __pyx_t_9 = __pyx_t_30; + } + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":1688 + * if (time.tzname[0] == time.tzname[1] and + * time.daylight and found_zone not in ("utc", "gmt")): + * break # <<<<<<<<<<<<<< + * else: + * tz = value + */ + goto __pyx_L53_break; + } + /*else*/ { + + /* "pandas/tslib.pyx":1690 + * break + * else: + * tz = value # <<<<<<<<<<<<<< + * break + * # If we know the wk of the year and what day of that wk, we can figure + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_v_value); + + /* "pandas/tslib.pyx":1691 + * else: + * tz = value + * break # <<<<<<<<<<<<<< + * # If we know the wk of the year and what day of that wk, we can figure + * # out the Julian day of the year. + */ + goto __pyx_L53_break; + } + } + } + __pyx_L53_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + break; + default: break; + } + } + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":1694 + * # If we know the wk of the year and what day of that wk, we can figure + * # out the Julian day of the year. + * if julian == -1 and week_of_year != -1 and weekday != -1: # <<<<<<<<<<<<<< + * week_starts_Mon = True if week_of_year_start == 0 else False + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, + */ + __pyx_t_9 = (__pyx_v_julian == -1); + if (__pyx_t_9) { + __pyx_t_15 = PyObject_RichCompare(__pyx_v_week_of_year, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_30) { + __pyx_t_35 = (__pyx_v_weekday != -1); + __pyx_t_10 = __pyx_t_35; + } else { + __pyx_t_10 = __pyx_t_30; + } + __pyx_t_30 = __pyx_t_10; + } else { + __pyx_t_30 = __pyx_t_9; + } + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1695 + * # out the Julian day of the year. + * if julian == -1 and week_of_year != -1 and weekday != -1: + * week_starts_Mon = True if week_of_year_start == 0 else False # <<<<<<<<<<<<<< + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, + * week_starts_Mon) + */ + if (((__pyx_v_week_of_year_start == 0) != 0)) { + __pyx_t_30 = 1; + } else { + __pyx_t_30 = 0; + } + __pyx_v_week_starts_Mon = __pyx_t_30; + + /* "pandas/tslib.pyx":1696 + * if julian == -1 and week_of_year != -1 and weekday != -1: + * week_starts_Mon = True if week_of_year_start == 0 else False + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, # <<<<<<<<<<<<<< + * week_starts_Mon) + * # Cannot pre-calculate datetime_date() since can change in Julian + */ + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_calc_julian_from_U_or_W); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_weekday); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":1697 + * week_starts_Mon = True if week_of_year_start == 0 else False + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, + * week_starts_Mon) # <<<<<<<<<<<<<< + * # Cannot pre-calculate datetime_date() since can change in Julian + * # calculation and thus could have different value for the day of the wk + */ + __pyx_t_16 = __Pyx_PyBool_FromLong(__pyx_v_week_starts_Mon); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + + /* "pandas/tslib.pyx":1696 + * if julian == -1 and week_of_year != -1 and weekday != -1: + * week_starts_Mon = True if week_of_year_start == 0 else False + * julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, # <<<<<<<<<<<<<< + * week_starts_Mon) + * # Cannot pre-calculate datetime_date() since can change in Julian + */ + __pyx_t_33 = PyTuple_New(4); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_week_of_year); + PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_v_week_of_year); + __Pyx_GIVEREF(__pyx_v_week_of_year); + PyTuple_SET_ITEM(__pyx_t_33, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_33, 3, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_33, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_julian = __pyx_t_14; + goto __pyx_L56; + } + __pyx_L56:; + + /* "pandas/tslib.pyx":1701 + * # calculation and thus could have different value for the day of the wk + * # calculation. + * if julian == -1: # <<<<<<<<<<<<<< + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ + */ + __pyx_t_30 = ((__pyx_v_julian == -1) != 0); + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1703 + * if julian == -1: + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ # <<<<<<<<<<<<<< + * datetime_date(year, 1, 1).toordinal() + 1 + * else: # Assume that if they bothered to include Julian day it will + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_33); + __Pyx_GIVEREF(__pyx_t_33); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_33 = 0; + __pyx_t_15 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1704 + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ + * datetime_date(year, 1, 1).toordinal() + 1 # <<<<<<<<<<<<<< + * else: # Assume that if they bothered to include Julian day it will + * # be accurate. + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":1703 + * if julian == -1: + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ # <<<<<<<<<<<<<< + * datetime_date(year, 1, 1).toordinal() + 1 + * else: # Assume that if they bothered to include Julian day it will + */ + __pyx_t_15 = PyNumber_Subtract(__pyx_t_2, __pyx_t_16); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":1704 + * # Need to add 1 to result since first day of the year is 1, not 0. + * julian = datetime_date(year, month, day).toordinal() - \ + * datetime_date(year, 1, 1).toordinal() + 1 # <<<<<<<<<<<<<< + * else: # Assume that if they bothered to include Julian day it will + * # be accurate. + */ + __pyx_t_16 = PyNumber_Add(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_julian = __pyx_t_14; + goto __pyx_L57; + } + /*else*/ { + + /* "pandas/tslib.pyx":1707 + * else: # Assume that if they bothered to include Julian day it will + * # be accurate. + * datetime_result = datetime_date.fromordinal( # <<<<<<<<<<<<<< + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) + * year = datetime_result.year + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_fromordinal); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":1708 + * # be accurate. + * datetime_result = datetime_date.fromordinal( + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) # <<<<<<<<<<<<<< + * year = datetime_result.year + * month = datetime_result.month + */ + __pyx_t_16 = __Pyx_PyInt_From_long((__pyx_v_julian - 1)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_33 = PyTuple_New(3); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_33, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_33, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_t_33 = PyNumber_Add(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1707 + * else: # Assume that if they bothered to include Julian day it will + * # be accurate. + * datetime_result = datetime_date.fromordinal( # <<<<<<<<<<<<<< + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) + * year = datetime_result.year + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_33); + __Pyx_GIVEREF(__pyx_t_33); + __pyx_t_33 = 0; + __pyx_t_33 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, NULL); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_datetime_result, __pyx_t_33); + __pyx_t_33 = 0; + + /* "pandas/tslib.pyx":1709 + * datetime_result = datetime_date.fromordinal( + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) + * year = datetime_result.year # <<<<<<<<<<<<<< + * month = datetime_result.month + * day = datetime_result.day + */ + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime_result, __pyx_n_s_year); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_33); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_v_year = __pyx_t_14; + + /* "pandas/tslib.pyx":1710 + * (julian - 1) + datetime_date(year, 1, 1).toordinal()) + * year = datetime_result.year + * month = datetime_result.month # <<<<<<<<<<<<<< + * day = datetime_result.day + * if weekday == -1: + */ + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime_result, __pyx_n_s_month); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_33); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_v_month = __pyx_t_14; + + /* "pandas/tslib.pyx":1711 + * year = datetime_result.year + * month = datetime_result.month + * day = datetime_result.day # <<<<<<<<<<<<<< + * if weekday == -1: + * weekday = datetime_date(year, month, day).weekday() + */ + __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime_result, __pyx_n_s_day); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_33); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __pyx_v_day = __pyx_t_14; + } + __pyx_L57:; + + /* "pandas/tslib.pyx":1712 + * month = datetime_result.month + * day = datetime_result.day + * if weekday == -1: # <<<<<<<<<<<<<< + * weekday = datetime_date(year, month, day).weekday() + * + */ + __pyx_t_30 = ((__pyx_v_weekday == -1) != 0); + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1713 + * day = datetime_result.day + * if weekday == -1: + * weekday = datetime_date(year, month, day).weekday() # <<<<<<<<<<<<<< + * + * dts.year = year + */ + __pyx_t_33 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_33); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_4 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_t_2, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_weekday); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_weekday = __pyx_t_14; + goto __pyx_L58; + } + __pyx_L58:; + + /* "pandas/tslib.pyx":1715 + * weekday = datetime_date(year, month, day).weekday() + * + * dts.year = year # <<<<<<<<<<<<<< + * dts.month = month + * dts.day = day + */ + __pyx_v_dts.year = __pyx_v_year; + + /* "pandas/tslib.pyx":1716 + * + * dts.year = year + * dts.month = month # <<<<<<<<<<<<<< + * dts.day = day + * dts.hour = hour + */ + __pyx_v_dts.month = __pyx_v_month; + + /* "pandas/tslib.pyx":1717 + * dts.year = year + * dts.month = month + * dts.day = day # <<<<<<<<<<<<<< + * dts.hour = hour + * dts.min = minute + */ + __pyx_v_dts.day = __pyx_v_day; + + /* "pandas/tslib.pyx":1718 + * dts.month = month + * dts.day = day + * dts.hour = hour # <<<<<<<<<<<<<< + * dts.min = minute + * dts.sec = second + */ + __pyx_v_dts.hour = __pyx_v_hour; + + /* "pandas/tslib.pyx":1719 + * dts.day = day + * dts.hour = hour + * dts.min = minute # <<<<<<<<<<<<<< + * dts.sec = second + * dts.us = fraction + */ + __pyx_v_dts.min = __pyx_v_minute; + + /* "pandas/tslib.pyx":1720 + * dts.hour = hour + * dts.min = minute + * dts.sec = second # <<<<<<<<<<<<<< + * dts.us = fraction + * + */ + __pyx_v_dts.sec = __pyx_v_second; + + /* "pandas/tslib.pyx":1721 + * dts.min = minute + * dts.sec = second + * dts.us = fraction # <<<<<<<<<<<<<< + * + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + */ + __pyx_v_dts.us = __pyx_v_fraction; + + /* "pandas/tslib.pyx":1723 + * dts.us = fraction + * + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * try: + * _check_dts_bounds(&dts) + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_iresult.diminfo[0].strides) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1724 + * + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * try: # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":1725 + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * try: + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * except ValueError: + * if coerce: + */ + __pyx_t_16 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L59_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L66_try_end; + __pyx_L59_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":1726 + * try: + * _check_dts_bounds(&dts) + * except ValueError: # <<<<<<<<<<<<<< + * if coerce: + * iresult[i] = iNaT + */ + __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_14) { + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_2, &__pyx_t_33) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_33); + + /* "pandas/tslib.pyx":1727 + * _check_dts_bounds(&dts) + * except ValueError: + * if coerce: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * continue + */ + __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_v_coerce); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + if (__pyx_t_30) { + + /* "pandas/tslib.pyx":1728 + * except ValueError: + * if coerce: + * iresult[i] = iNaT # <<<<<<<<<<<<<< + * continue + * raise + */ + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_15); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_27 = __pyx_v_i; + __pyx_t_14 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_14 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_14 = 0; + if (unlikely(__pyx_t_14 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_14); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_iresult.diminfo[0].strides) = __pyx_t_20; + + /* "pandas/tslib.pyx":1729 + * if coerce: + * iresult[i] = iNaT + * continue # <<<<<<<<<<<<<< + * raise + * + */ + goto __pyx_L68_except_continue; + } + + /* "pandas/tslib.pyx":1730 + * iresult[i] = iNaT + * continue + * raise # <<<<<<<<<<<<<< + * + * return result + */ + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_33); + __Pyx_ErrRestore(__pyx_t_16, __pyx_t_2, __pyx_t_33); + __pyx_t_16 = 0; __pyx_t_2 = 0; __pyx_t_33 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L61_except_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + goto __pyx_L60_exception_handled; + __pyx_L68_except_continue:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + goto __pyx_L65_try_continue; + } + goto __pyx_L61_except_error; + __pyx_L61_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L65_try_continue:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_3); + goto __pyx_L35_continue; + __pyx_L60_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_3); + __pyx_L66_try_end:; + } + __pyx_L35_continue:; + } + + /* "pandas/tslib.pyx":1732 + * raise + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1499 + * + * + * def array_strptime(ndarray[object] values, object fmt, coerce=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_33); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.array_strptime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_locale_time); + __Pyx_XDECREF(__pyx_v_format_regex); + __Pyx_XDECREF(__pyx_v_err); + __Pyx_XDECREF(__pyx_v_bad_directive); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v__parse_code_table); + __Pyx_XDECREF(__pyx_v_found); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XDECREF(__pyx_v_week_of_year); + __Pyx_XDECREF(__pyx_v_found_dict); + __Pyx_XDECREF(__pyx_v_group_key); + __Pyx_XDECREF(__pyx_v_ampm); + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_found_zone); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_tz_values); + __Pyx_XDECREF(__pyx_v_datetime_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1735 + * + * + * cdef inline _get_datetime64_nanos(object val): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__get_datetime64_nanos(PyObject *__pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PANDAS_DATETIMEUNIT __pyx_v_unit; + npy_datetime __pyx_v_ival; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_datetime64_nanos", 0); + + /* "pandas/tslib.pyx":1741 + * npy_datetime ival + * + * unit = get_datetime64_unit(val) # <<<<<<<<<<<<<< + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') + */ + __pyx_v_unit = get_datetime64_unit(__pyx_v_val); + + /* "pandas/tslib.pyx":1742 + * + * unit = get_datetime64_unit(val) + * if unit == 3: # <<<<<<<<<<<<<< + * raise ValueError('NumPy 1.6.1 business freq not supported') + * + */ + __pyx_t_1 = ((__pyx_v_unit == 3) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1743 + * unit = get_datetime64_unit(val) + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') # <<<<<<<<<<<<<< + * + * ival = get_datetime64_value(val) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1745 + * raise ValueError('NumPy 1.6.1 business freq not supported') + * + * ival = get_datetime64_value(val) # <<<<<<<<<<<<<< + * + * if unit != PANDAS_FR_ns: + */ + __pyx_v_ival = get_datetime64_value(__pyx_v_val); + + /* "pandas/tslib.pyx":1747 + * ival = get_datetime64_value(val) + * + * if unit != PANDAS_FR_ns: # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(ival, unit, &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_1 = ((__pyx_v_unit != PANDAS_FR_ns) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":1748 + * + * if unit != PANDAS_FR_ns: + * pandas_datetime_to_datetimestruct(ival, unit, &dts) # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + */ + pandas_datetime_to_datetimestruct(__pyx_v_ival, __pyx_v_unit, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1749 + * if unit != PANDAS_FR_ns: + * pandas_datetime_to_datetimestruct(ival, unit, &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * else: + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1750 + * pandas_datetime_to_datetimestruct(ival, unit, &dts) + * _check_dts_bounds(&dts) + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * else: + * return ival + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":1752 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * else: + * return ival # <<<<<<<<<<<<<< + * + * cpdef inline int64_t cast_from_unit(object ts, object unit) except -1: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_ival); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1735 + * + * + * cdef inline _get_datetime64_nanos(object val): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib._get_datetime64_nanos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1754 + * return ival + * + * cpdef inline int64_t cast_from_unit(object ts, object unit) except -1: # <<<<<<<<<<<<<< + * """ return a casting of the unit represented to nanoseconds + * round the fractional part of a float to our precision, p """ + */ + +static PyObject *__pyx_pw_6pandas_5tslib_37cast_from_unit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_cast_from_unit(PyObject *__pyx_v_ts, PyObject *__pyx_v_unit, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_m = NULL; + long __pyx_v_p; + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_frac = NULL; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_7; + __pyx_t_5numpy_int64_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cast_from_unit", 0); + + /* "pandas/tslib.pyx":1757 + * """ return a casting of the unit represented to nanoseconds + * round the fractional part of a float to our precision, p """ + * if unit == 'D' or unit == 'd': # <<<<<<<<<<<<<< + * m = 1000000000L * 86400 + * p = 6 + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_1) { + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_d, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1758 + * round the fractional part of a float to our precision, p """ + * if unit == 'D' or unit == 'd': + * m = 1000000000L * 86400 # <<<<<<<<<<<<<< + * p = 6 + * elif unit == 'h': + */ + __Pyx_INCREF(__pyx_int_86400000000000L); + __pyx_v_m = __pyx_int_86400000000000L; + + /* "pandas/tslib.pyx":1759 + * if unit == 'D' or unit == 'd': + * m = 1000000000L * 86400 + * p = 6 # <<<<<<<<<<<<<< + * elif unit == 'h': + * m = 1000000000L * 3600 + */ + __pyx_v_p = 6; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1760 + * m = 1000000000L * 86400 + * p = 6 + * elif unit == 'h': # <<<<<<<<<<<<<< + * m = 1000000000L * 3600 + * p = 6 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_h, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1761 + * p = 6 + * elif unit == 'h': + * m = 1000000000L * 3600 # <<<<<<<<<<<<<< + * p = 6 + * elif unit == 'm': + */ + __Pyx_INCREF(__pyx_int_3600000000000L); + __pyx_v_m = __pyx_int_3600000000000L; + + /* "pandas/tslib.pyx":1762 + * elif unit == 'h': + * m = 1000000000L * 3600 + * p = 6 # <<<<<<<<<<<<<< + * elif unit == 'm': + * m = 1000000000L * 60 + */ + __pyx_v_p = 6; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1763 + * m = 1000000000L * 3600 + * p = 6 + * elif unit == 'm': # <<<<<<<<<<<<<< + * m = 1000000000L * 60 + * p = 6 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_m, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1764 + * p = 6 + * elif unit == 'm': + * m = 1000000000L * 60 # <<<<<<<<<<<<<< + * p = 6 + * elif unit == 's': + */ + __Pyx_INCREF(__pyx_int_60000000000L); + __pyx_v_m = __pyx_int_60000000000L; + + /* "pandas/tslib.pyx":1765 + * elif unit == 'm': + * m = 1000000000L * 60 + * p = 6 # <<<<<<<<<<<<<< + * elif unit == 's': + * m = 1000000000L + */ + __pyx_v_p = 6; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1766 + * m = 1000000000L * 60 + * p = 6 + * elif unit == 's': # <<<<<<<<<<<<<< + * m = 1000000000L + * p = 6 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_s, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1767 + * p = 6 + * elif unit == 's': + * m = 1000000000L # <<<<<<<<<<<<<< + * p = 6 + * elif unit == 'ms': + */ + __Pyx_INCREF(__pyx_int_1000000000L); + __pyx_v_m = __pyx_int_1000000000L; + + /* "pandas/tslib.pyx":1768 + * elif unit == 's': + * m = 1000000000L + * p = 6 # <<<<<<<<<<<<<< + * elif unit == 'ms': + * m = 1000000L + */ + __pyx_v_p = 6; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1769 + * m = 1000000000L + * p = 6 + * elif unit == 'ms': # <<<<<<<<<<<<<< + * m = 1000000L + * p = 3 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_ms, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1770 + * p = 6 + * elif unit == 'ms': + * m = 1000000L # <<<<<<<<<<<<<< + * p = 3 + * elif unit == 'us': + */ + __Pyx_INCREF(__pyx_int_1000000L); + __pyx_v_m = __pyx_int_1000000L; + + /* "pandas/tslib.pyx":1771 + * elif unit == 'ms': + * m = 1000000L + * p = 3 # <<<<<<<<<<<<<< + * elif unit == 'us': + * m = 1000L + */ + __pyx_v_p = 3; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1772 + * m = 1000000L + * p = 3 + * elif unit == 'us': # <<<<<<<<<<<<<< + * m = 1000L + * p = 0 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_us, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1773 + * p = 3 + * elif unit == 'us': + * m = 1000L # <<<<<<<<<<<<<< + * p = 0 + * elif unit == 'ns' or unit is None: + */ + __Pyx_INCREF(__pyx_int_1000L); + __pyx_v_m = __pyx_int_1000L; + + /* "pandas/tslib.pyx":1774 + * elif unit == 'us': + * m = 1000L + * p = 0 # <<<<<<<<<<<<<< + * elif unit == 'ns' or unit is None: + * m = 1L + */ + __pyx_v_p = 0; + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":1775 + * m = 1000L + * p = 0 + * elif unit == 'ns' or unit is None: # <<<<<<<<<<<<<< + * m = 1L + * p = 0 + */ + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_ns, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_3) { + __pyx_t_1 = (__pyx_v_unit == Py_None); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":1776 + * p = 0 + * elif unit == 'ns' or unit is None: + * m = 1L # <<<<<<<<<<<<<< + * p = 0 + * else: + */ + __Pyx_INCREF(__pyx_int_1L); + __pyx_v_m = __pyx_int_1L; + + /* "pandas/tslib.pyx":1777 + * elif unit == 'ns' or unit is None: + * m = 1L + * p = 0 # <<<<<<<<<<<<<< + * else: + * raise ValueError("cannot cast unit {0}".format(unit)) + */ + __pyx_v_p = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":1779 + * p = 0 + * else: + * raise ValueError("cannot cast unit {0}".format(unit)) # <<<<<<<<<<<<<< + * + * # just give me the unit back + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_cast_unit_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_unit); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_unit); + __Pyx_GIVEREF(__pyx_v_unit); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1782 + * + * # just give me the unit back + * if ts is None: # <<<<<<<<<<<<<< + * return m + * + */ + __pyx_t_2 = (__pyx_v_ts == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1783 + * # just give me the unit back + * if ts is None: + * return m # <<<<<<<<<<<<<< + * + * # cast the unit, multiply base/frace separately + */ + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_v_m); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_7; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1787 + * # cast the unit, multiply base/frace separately + * # to avoid precision issues from float -> int + * base = ts # <<<<<<<<<<<<<< + * frac = ts-base + * if p: + */ + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(((__pyx_t_5numpy_int64_t)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_base = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1788 + * # to avoid precision issues from float -> int + * base = ts + * frac = ts-base # <<<<<<<<<<<<<< + * if p: + * frac = round(frac,p) + */ + __pyx_t_6 = PyNumber_Subtract(__pyx_v_ts, __pyx_v_base); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_frac = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":1789 + * base = ts + * frac = ts-base + * if p: # <<<<<<<<<<<<<< + * frac = round(frac,p) + * return (base*m) + (frac*m) + */ + __pyx_t_3 = (__pyx_v_p != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1790 + * frac = ts-base + * if p: + * frac = round(frac,p) # <<<<<<<<<<<<<< + * return (base*m) + (frac*m) + * + */ + __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_frac); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_frac); + __Pyx_GIVEREF(__pyx_v_frac); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_frac, __pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":1791 + * if p: + * frac = round(frac,p) + * return (base*m) + (frac*m) # <<<<<<<<<<<<<< + * + * def cast_to_nanoseconds(ndarray arr): + */ + __pyx_t_6 = PyNumber_Multiply(__pyx_v_base, __pyx_v_m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_7 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Multiply(__pyx_v_frac, __pyx_v_m); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = (((__pyx_t_5numpy_int64_t)__pyx_t_7) + ((__pyx_t_5numpy_int64_t)__pyx_t_8)); + goto __pyx_L0; + + /* "pandas/tslib.pyx":1754 + * return ival + * + * cpdef inline int64_t cast_from_unit(object ts, object unit) except -1: # <<<<<<<<<<<<<< + * """ return a casting of the unit represented to nanoseconds + * round the fractional part of a float to our precision, p """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.cast_from_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_m); + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_frac); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_37cast_from_unit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_36cast_from_unit[] = " return a casting of the unit represented to nanoseconds\n round the fractional part of a float to our precision, p "; +static PyObject *__pyx_pw_6pandas_5tslib_37cast_from_unit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ts = 0; + PyObject *__pyx_v_unit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cast_from_unit (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts,&__pyx_n_s_unit,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ts)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cast_from_unit", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast_from_unit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_ts = values[0]; + __pyx_v_unit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cast_from_unit", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.cast_from_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_36cast_from_unit(__pyx_self, __pyx_v_ts, __pyx_v_unit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_36cast_from_unit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ts, PyObject *__pyx_v_unit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_int64_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cast_from_unit", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_cast_from_unit(__pyx_v_ts, __pyx_v_unit, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.cast_from_unit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1793 + * return (base*m) + (frac*m) + * + * def cast_to_nanoseconds(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_39cast_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_39cast_to_nanoseconds = {__Pyx_NAMESTR("cast_to_nanoseconds"), (PyCFunction)__pyx_pw_6pandas_5tslib_39cast_to_nanoseconds, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_39cast_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_arr) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cast_to_nanoseconds (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_38cast_to_nanoseconds(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_38cast_to_nanoseconds(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_ivalues = 0; + PyArrayObject *__pyx_v_iresult = 0; + PANDAS_DATETIMEUNIT __pyx_v_unit; + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_v_shape = NULL; + PyObject *__pyx_v_result = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_iresult; + __Pyx_Buffer __pyx_pybuffer_iresult; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ivalues; + __Pyx_Buffer __pyx_pybuffer_ivalues; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyArrayObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cast_to_nanoseconds", 0); + __pyx_pybuffer_ivalues.pybuffer.buf = NULL; + __pyx_pybuffer_ivalues.refcount = 0; + __pyx_pybuffernd_ivalues.data = NULL; + __pyx_pybuffernd_ivalues.rcbuffer = &__pyx_pybuffer_ivalues; + __pyx_pybuffer_iresult.pybuffer.buf = NULL; + __pyx_pybuffer_iresult.refcount = 0; + __pyx_pybuffernd_iresult.data = NULL; + __pyx_pybuffernd_iresult.rcbuffer = &__pyx_pybuffer_iresult; + + /* "pandas/tslib.pyx":1795 + * def cast_to_nanoseconds(ndarray arr): + * cdef: + * Py_ssize_t i, n = arr.size # <<<<<<<<<<<<<< + * ndarray[int64_t] ivalues, iresult + * PANDAS_DATETIMEUNIT unit + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_n = __pyx_t_2; + + /* "pandas/tslib.pyx":1800 + * pandas_datetimestruct dts + * + * shape = ( arr).shape # <<<<<<<<<<<<<< + * + * ivalues = arr.view(np.int64).ravel() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_shape = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1802 + * shape = ( arr).shape + * + * ivalues = arr.view(np.int64).ravel() # <<<<<<<<<<<<<< + * + * result = np.empty(shape, dtype='M8[ns]') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_ivalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + } + } + __pyx_pybuffernd_ivalues.diminfo[0].strides = __pyx_pybuffernd_ivalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ivalues.diminfo[0].shape = __pyx_pybuffernd_ivalues.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_ivalues = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1804 + * ivalues = arr.view(np.int64).ravel() + * + * result = np.empty(shape, dtype='M8[ns]') # <<<<<<<<<<<<<< + * iresult = result.ravel().view(np.int64) + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":1805 + * + * result = np.empty(shape, dtype='M8[ns]') + * iresult = result.ravel().view(np.int64) # <<<<<<<<<<<<<< + * + * if len(iresult) == 0: + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_ravel); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_6 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7); + } + } + __pyx_pybuffernd_iresult.diminfo[0].strides = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_iresult.diminfo[0].shape = __pyx_pybuffernd_iresult.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = 0; + __pyx_v_iresult = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1807 + * iresult = result.ravel().view(np.int64) + * + * if len(iresult) == 0: # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_iresult)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = ((__pyx_t_2 == 0) != 0); + if (__pyx_t_11) { + + /* "pandas/tslib.pyx":1808 + * + * if len(iresult) == 0: + * return result # <<<<<<<<<<<<<< + * + * unit = get_datetime64_unit(arr.flat[0]) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1810 + * return result + * + * unit = get_datetime64_unit(arr.flat[0]) # <<<<<<<<<<<<<< + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_unit = get_datetime64_unit(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1811 + * + * unit = get_datetime64_unit(arr.flat[0]) + * if unit == 3: # <<<<<<<<<<<<<< + * raise ValueError('NumPy 1.6.1 business freq not supported') + * + */ + __pyx_t_11 = ((__pyx_v_unit == 3) != 0); + if (__pyx_t_11) { + + /* "pandas/tslib.pyx":1812 + * unit = get_datetime64_unit(arr.flat[0]) + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1814 + * raise ValueError('NumPy 1.6.1 business freq not supported') + * + * for i in range(n): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts) + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + */ + __pyx_t_2 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/tslib.pyx":1815 + * + * for i in range(n): + * pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts) # <<<<<<<<<<<<<< + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * _check_dts_bounds(&dts) + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_ivalues.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_ivalues.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ivalues.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ivalues.diminfo[0].strides)), __pyx_v_unit, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1816 + * for i in range(n): + * pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts) + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * _check_dts_bounds(&dts) + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_6 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_iresult.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_iresult.diminfo[0].shape)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_6 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_6); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_iresult.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_iresult.diminfo[0].strides) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1817 + * pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts) + * iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * _check_dts_bounds(&dts) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__check_dts_bounds((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "pandas/tslib.pyx":1819 + * _check_dts_bounds(&dts) + * + * return result # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1793 + * return (base*m) + (frac*m) + * + * def cast_to_nanoseconds(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.cast_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_iresult.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ivalues.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ivalues); + __Pyx_XDECREF((PyObject *)__pyx_v_iresult); + __Pyx_XDECREF(__pyx_v_shape); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1825 + * + * + * def pydt_to_i8(object pydt): # <<<<<<<<<<<<<< + * ''' + * Convert to int64 representation compatible with numpy datetime64; converts + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_41pydt_to_i8(PyObject *__pyx_self, PyObject *__pyx_v_pydt); /*proto*/ +static char __pyx_doc_6pandas_5tslib_40pydt_to_i8[] = "\n Convert to int64 representation compatible with numpy datetime64; converts\n to UTC\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_41pydt_to_i8 = {__Pyx_NAMESTR("pydt_to_i8"), (PyCFunction)__pyx_pw_6pandas_5tslib_41pydt_to_i8, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_40pydt_to_i8)}; +static PyObject *__pyx_pw_6pandas_5tslib_41pydt_to_i8(PyObject *__pyx_self, PyObject *__pyx_v_pydt) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pydt_to_i8 (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_40pydt_to_i8(__pyx_self, ((PyObject *)__pyx_v_pydt)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_40pydt_to_i8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pydt) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pydt_to_i8", 0); + + /* "pandas/tslib.pyx":1833 + * _TSObject ts + * + * ts = convert_to_tsobject(pydt, None, None) # <<<<<<<<<<<<<< + * + * return ts.value + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_v_pydt, Py_None, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ts = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1835 + * ts = convert_to_tsobject(pydt, None, None) + * + * return ts.value # <<<<<<<<<<<<<< + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_ts->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1825 + * + * + * def pydt_to_i8(object pydt): # <<<<<<<<<<<<<< + * ''' + * Convert to int64 representation compatible with numpy datetime64; converts + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.pydt_to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1837 + * return ts.value + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): # <<<<<<<<<<<<<< + * ''' + * Inverse of pydt_to_i8 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_43i8_to_pydt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_42i8_to_pydt[] = "\n Inverse of pydt_to_i8\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_43i8_to_pydt = {__Pyx_NAMESTR("i8_to_pydt"), (PyCFunction)__pyx_pw_6pandas_5tslib_43i8_to_pydt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_42i8_to_pydt)}; +static PyObject *__pyx_pw_6pandas_5tslib_43i8_to_pydt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_i8; + CYTHON_UNUSED PyObject *__pyx_v_tzinfo = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("i8_to_pydt (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i8,&__pyx_n_s_tzinfo,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i8)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tzinfo); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "i8_to_pydt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_i8 = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_i8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_tzinfo = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("i8_to_pydt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.i8_to_pydt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_42i8_to_pydt(__pyx_self, __pyx_v_i8, __pyx_v_tzinfo); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_42i8_to_pydt(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_i8, CYTHON_UNUSED PyObject *__pyx_v_tzinfo) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("i8_to_pydt", 0); + + /* "pandas/tslib.pyx":1841 + * Inverse of pydt_to_i8 + * ''' + * return Timestamp(i8) # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_i8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1837 + * return ts.value + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): # <<<<<<<<<<<<<< + * ''' + * Inverse of pydt_to_i8 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.i8_to_pydt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1853 + * have_pytz = False + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_45tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_45tz_convert = {__Pyx_NAMESTR("tz_convert"), (PyCFunction)__pyx_pw_6pandas_5tslib_45tz_convert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_45tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vals = 0; + PyObject *__pyx_v_tz1 = 0; + PyObject *__pyx_v_tz2 = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_convert (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vals,&__pyx_n_s_tz1,&__pyx_n_s_tz2,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_convert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_vals = ((PyArrayObject *)values[0]); + __pyx_v_tz1 = values[1]; + __pyx_v_tz2 = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_44tz_convert(__pyx_self, __pyx_v_vals, __pyx_v_tz1, __pyx_v_tz2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_44tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vals, PyObject *__pyx_v_tz1, PyObject *__pyx_v_tz2) { + PyArrayObject *__pyx_v_utc_dates = 0; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_pos; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_v; + __pyx_t_5numpy_int64_t __pyx_v_offset; + pandas_datetimestruct __pyx_v_dts; + CYTHON_UNUSED PyObject *__pyx_v_pytz = NULL; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + Py_ssize_t __pyx_v_trans_len; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + __Pyx_LocalBuf_ND __pyx_pybuffernd_utc_dates; + __Pyx_Buffer __pyx_pybuffer_utc_dates; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vals; + __Pyx_Buffer __pyx_pybuffer_vals; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + long __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + long __pyx_t_28; + long __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + int __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_convert", 0); + __pyx_pybuffer_utc_dates.pybuffer.buf = NULL; + __pyx_pybuffer_utc_dates.refcount = 0; + __pyx_pybuffernd_utc_dates.data = NULL; + __pyx_pybuffernd_utc_dates.rcbuffer = &__pyx_pybuffer_utc_dates; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_vals.pybuffer.buf = NULL; + __pyx_pybuffer_vals.refcount = 0; + __pyx_pybuffernd_vals.data = NULL; + __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":1856 + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + * Py_ssize_t i, pos, n = len(vals) # <<<<<<<<<<<<<< + * int64_t v, offset + * pandas_datetimestruct dts + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_vals)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":1860 + * pandas_datetimestruct dts + * + * if not have_pytz: # <<<<<<<<<<<<<< + * import pytz + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_have_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1861 + * + * if not have_pytz: + * import pytz # <<<<<<<<<<<<<< + * + * # Convert to UTC + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_pytz = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1865 + * # Convert to UTC + * + * if _get_zone(tz1) != 'UTC': # <<<<<<<<<<<<<< + * utc_dates = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz1): + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_UTC, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1866 + * + * if _get_zone(tz1) != 'UTC': + * utc_dates = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * if _is_tzlocal(tz1): + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer, (PyObject*)__pyx_v_utc_dates, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_utc_dates.diminfo[0].strides = __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_utc_dates.diminfo[0].shape = __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_utc_dates = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1867 + * if _get_zone(tz1) != 'UTC': + * utc_dates = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz1): # <<<<<<<<<<<<<< + * for i in range(n): + * v = vals[i] + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz1) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1868 + * utc_dates = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz1): + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_1; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":1869 + * if _is_tzlocal(tz1): + * for i in range(n): + * v = vals[i] # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_vals.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1870 + * for i in range(n): + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) + */ + pandas_datetime_to_datetimestruct(__pyx_v_v, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1871 + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz1) + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "pandas/tslib.pyx":1872 + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) # <<<<<<<<<<<<<< + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + * * 1000000000) + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + + /* "pandas/tslib.pyx":1871 + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz1) + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + */ + __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __Pyx_INCREF(__pyx_v_tz1); + PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_v_tz1); + __Pyx_GIVEREF(__pyx_v_tz1); + __pyx_t_8 = 0; + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_17)); + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":1873 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) # <<<<<<<<<<<<<< + * * 1000000000) + * utc_dates[i] = v - delta + */ + __pyx_t_17 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz1, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_17)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":1874 + * dts.min, dts.sec, dts.us, tz1) + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + * * 1000000000) # <<<<<<<<<<<<<< + * utc_dates[i] = v - delta + * else: + */ + __pyx_t_17 = PyNumber_Multiply(__pyx_t_18, __pyx_int_1000000000); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_17); + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":1875 + * delta = (int(total_seconds(_get_utcoffset(tz1, dt))) + * * 1000000000) + * utc_dates[i] = v - delta # <<<<<<<<<<<<<< + * else: + * deltas = _get_deltas(tz1) + */ + __pyx_t_17 = __Pyx_PyInt_From_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyNumber_Subtract(__pyx_t_17, __pyx_v_delta); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_18); if (unlikely((__pyx_t_19 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_20 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_utc_dates.diminfo[0].strides) = __pyx_t_19; + } + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1877 + * utc_dates[i] = v - delta + * else: + * deltas = _get_deltas(tz1) # <<<<<<<<<<<<<< + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(vals[0]) - 1 + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":1878 + * else: + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(vals[0]) - 1 + * if pos < 0: + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":1879 + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(vals[0]) - 1 # <<<<<<<<<<<<<< + * if pos < 0: + * raise ValueError('First time before start of DST info') + */ + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_21 = 0; + __pyx_t_10 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_vals.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyNumber_Subtract(__pyx_t_17, __pyx_int_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_pos = __pyx_t_1; + + /* "pandas/tslib.pyx":1880 + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(vals[0]) - 1 + * if pos < 0: # <<<<<<<<<<<<<< + * raise ValueError('First time before start of DST info') + * + */ + __pyx_t_4 = ((__pyx_v_pos < 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1881 + * pos = trans.searchsorted(vals[0]) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_Raise(__pyx_t_16, 0, 0, 0); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1883 + * raise ValueError('First time before start of DST info') + * + * offset = deltas[pos] # <<<<<<<<<<<<<< + * for i in range(n): + * v = vals[i] + */ + __pyx_t_1 = __pyx_v_pos; + __pyx_t_10 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_deltas.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1884 + * + * offset = deltas[pos] + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] + * if v >= [pos + 1]: + */ + __pyx_t_14 = __pyx_v_n; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_14; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "pandas/tslib.pyx":1885 + * offset = deltas[pos] + * for i in range(n): + * v = vals[i] # <<<<<<<<<<<<<< + * if v >= [pos + 1]: + * pos += 1 + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_vals.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1886 + * for i in range(n): + * v = vals[i] + * if v >= [pos + 1]: # <<<<<<<<<<<<<< + * pos += 1 + * offset = deltas[pos] + */ + __pyx_t_16 = __Pyx_PyInt_From_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = PyInt_FromSsize_t((__pyx_v_pos + 1)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyList_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = PyObject_RichCompare(__pyx_t_16, __pyx_t_18, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1887 + * v = vals[i] + * if v >= [pos + 1]: + * pos += 1 # <<<<<<<<<<<<<< + * offset = deltas[pos] + * utc_dates[i] = v - offset + */ + __pyx_v_pos = (__pyx_v_pos + 1); + + /* "pandas/tslib.pyx":1888 + * if v >= [pos + 1]: + * pos += 1 + * offset = deltas[pos] # <<<<<<<<<<<<<< + * utc_dates[i] = v - offset + * else: + */ + __pyx_t_24 = __pyx_v_pos; + __pyx_t_10 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_deltas.diminfo[0].strides)); + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":1889 + * pos += 1 + * offset = deltas[pos] + * utc_dates[i] = v - offset # <<<<<<<<<<<<<< + * else: + * utc_dates = vals + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_utc_dates.diminfo[0].strides) = (__pyx_v_v - __pyx_v_offset); + } + } + __pyx_L5:; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":1891 + * utc_dates[i] = v - offset + * else: + * utc_dates = vals # <<<<<<<<<<<<<< + * + * if _get_zone(tz2) == 'UTC': + */ + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_vals), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer, (PyObject*)__pyx_v_utc_dates, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_utc_dates.diminfo[0].strides = __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_utc_dates.diminfo[0].shape = __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_INCREF(((PyObject *)__pyx_v_vals)); + __pyx_v_utc_dates = ((PyArrayObject *)__pyx_v_vals); + } + __pyx_L4:; + + /* "pandas/tslib.pyx":1893 + * utc_dates = vals + * + * if _get_zone(tz2) == 'UTC': # <<<<<<<<<<<<<< + * return utc_dates + * + */ + __pyx_t_17 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_17, __pyx_n_s_UTC, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1894 + * + * if _get_zone(tz2) == 'UTC': + * return utc_dates # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_utc_dates)); + __pyx_r = ((PyObject *)__pyx_v_utc_dates); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1896 + * return utc_dates + * + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * if _is_tzlocal(tz2): + * for i in range(n): + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_empty); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = PyDict_New(); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":1897 + * + * result = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz2): # <<<<<<<<<<<<<< + * for i in range(n): + * v = utc_dates[i] + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz2) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1898 + * result = np.empty(n, dtype=np.int64) + * if _is_tzlocal(tz2): + * for i in range(n): # <<<<<<<<<<<<<< + * v = utc_dates[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + */ + __pyx_t_14 = __pyx_v_n; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_14; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "pandas/tslib.pyx":1899 + * if _is_tzlocal(tz2): + * for i in range(n): + * v = utc_dates[i] # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_26 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_utc_dates.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1900 + * for i in range(n): + * v = utc_dates[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) + */ + pandas_datetime_to_datetimestruct(__pyx_v_v, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1901 + * v = utc_dates[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + + /* "pandas/tslib.pyx":1902 + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * result[i] = v + delta + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":1901 + * v = utc_dates[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + */ + __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_tz2); + PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_v_tz2); + __Pyx_GIVEREF(__pyx_v_tz2); + __pyx_t_5 = 0; + __pyx_t_17 = 0; + __pyx_t_16 = 0; + __pyx_t_18 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1903 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 # <<<<<<<<<<<<<< + * result[i] = v + delta + * return result + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz2, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_t_8, __pyx_int_1000000000); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1904 + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * result[i] = v + delta # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_v_delta); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_19 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_27 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_19; + + /* "pandas/tslib.pyx":1905 + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * result[i] = v + delta + * return result # <<<<<<<<<<<<<< + * + * # Convert UTC to other timezone + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + } + goto __pyx_L13; + } + __pyx_L13:; + + /* "pandas/tslib.pyx":1908 + * + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_dates[0]) + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_trans, ((PyArrayObject *)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1909 + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) + * deltas = _get_deltas(tz2) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(utc_dates[0]) + * if pos == 0: + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_deltas, ((PyArrayObject *)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":1910 + * trans = _get_transitions(tz2) + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_dates[0]) # <<<<<<<<<<<<<< + * if pos == 0: + * raise ValueError('First time before start of DST info') + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_28 = 0; + __pyx_t_10 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_utc_dates.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_pos = __pyx_t_14; + + /* "pandas/tslib.pyx":1911 + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_dates[0]) + * if pos == 0: # <<<<<<<<<<<<<< + * raise ValueError('First time before start of DST info') + * elif pos == len(trans): + */ + __pyx_t_4 = ((__pyx_v_pos == 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1912 + * pos = trans.searchsorted(utc_dates[0]) + * if pos == 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * elif pos == len(trans): + * return utc_dates + deltas[-1] + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1913 + * if pos == 0: + * raise ValueError('First time before start of DST info') + * elif pos == len(trans): # <<<<<<<<<<<<<< + * return utc_dates + deltas[-1] + * + */ + __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_trans)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((__pyx_v_pos == __pyx_t_14) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1914 + * raise ValueError('First time before start of DST info') + * elif pos == len(trans): + * return utc_dates + deltas[-1] # <<<<<<<<<<<<<< + * + * # TODO: this assumed sortedness :/ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_29 = -1; + __pyx_t_10 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_deltas.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_v_utc_dates), __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1917 + * + * # TODO: this assumed sortedness :/ + * pos -= 1 # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_v_pos = (__pyx_v_pos - 1); + + /* "pandas/tslib.pyx":1919 + * pos -= 1 + * + * offset = deltas[pos] # <<<<<<<<<<<<<< + * cdef Py_ssize_t trans_len = len(trans) + * + */ + __pyx_t_14 = __pyx_v_pos; + __pyx_t_10 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_deltas.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1920 + * + * offset = deltas[pos] + * cdef Py_ssize_t trans_len = len(trans) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_22 = PyObject_Length(((PyObject *)__pyx_v_trans)); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_trans_len = __pyx_t_22; + + /* "pandas/tslib.pyx":1922 + * cdef Py_ssize_t trans_len = len(trans) + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = utc_dates[i] + * if vals[i] == NPY_NAT: + */ + __pyx_t_22 = __pyx_v_n; + for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_22; __pyx_t_30+=1) { + __pyx_v_i = __pyx_t_30; + + /* "pandas/tslib.pyx":1923 + * + * for i in range(n): + * v = utc_dates[i] # <<<<<<<<<<<<<< + * if vals[i] == NPY_NAT: + * result[i] = vals[i] + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_utc_dates.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_utc_dates.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_utc_dates.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_utc_dates.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1924 + * for i in range(n): + * v = utc_dates[i] + * if vals[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = vals[i] + * else: + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_vals.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":1925 + * v = utc_dates[i] + * if vals[i] == NPY_NAT: + * result[i] = vals[i] # <<<<<<<<<<<<<< + * else: + * if (pos + 1) < trans_len and v >= trans[pos + 1]: + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_vals.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_vals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_34 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_vals.diminfo[0].strides)); + goto __pyx_L19; + } + /*else*/ { + + /* "pandas/tslib.pyx":1927 + * result[i] = vals[i] + * else: + * if (pos + 1) < trans_len and v >= trans[pos + 1]: # <<<<<<<<<<<<<< + * pos += 1 + * offset = deltas[pos] + */ + __pyx_t_4 = (((__pyx_v_pos + 1) < __pyx_v_trans_len) != 0); + if (__pyx_t_4) { + __pyx_t_35 = (__pyx_v_pos + 1); + __pyx_t_10 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_trans.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_trans.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = ((__pyx_v_v >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_trans.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_trans.diminfo[0].strides))) != 0); + __pyx_t_36 = __pyx_t_3; + } else { + __pyx_t_36 = __pyx_t_4; + } + if (__pyx_t_36) { + + /* "pandas/tslib.pyx":1928 + * else: + * if (pos + 1) < trans_len and v >= trans[pos + 1]: + * pos += 1 # <<<<<<<<<<<<<< + * offset = deltas[pos] + * result[i] = v + offset + */ + __pyx_v_pos = (__pyx_v_pos + 1); + + /* "pandas/tslib.pyx":1929 + * if (pos + 1) < trans_len and v >= trans[pos + 1]: + * pos += 1 + * offset = deltas[pos] # <<<<<<<<<<<<<< + * result[i] = v + offset + * + */ + __pyx_t_37 = __pyx_v_pos; + __pyx_t_10 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_deltas.diminfo[0].strides)); + goto __pyx_L20; + } + __pyx_L20:; + + /* "pandas/tslib.pyx":1930 + * pos += 1 + * offset = deltas[pos] + * result[i] = v + offset # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_result.diminfo[0].strides) = (__pyx_v_v + __pyx_v_offset); + } + __pyx_L19:; + } + + /* "pandas/tslib.pyx":1932 + * result[i] = v + offset + * + * return result # <<<<<<<<<<<<<< + * + * def tz_convert_single(int64_t val, object tz1, object tz2): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":1853 + * have_pytz = False + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vals.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_utc_dates.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vals.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_utc_dates); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pytz); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1934 + * return result + * + * def tz_convert_single(int64_t val, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] trans, deltas + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_47tz_convert_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_47tz_convert_single = {__Pyx_NAMESTR("tz_convert_single"), (PyCFunction)__pyx_pw_6pandas_5tslib_47tz_convert_single, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_47tz_convert_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_val; + PyObject *__pyx_v_tz1 = 0; + PyObject *__pyx_v_tz2 = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_convert_single (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,&__pyx_n_s_tz1,&__pyx_n_s_tz2,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_convert_single") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_val = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_val == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_tz1 = values[1]; + __pyx_v_tz2 = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.tz_convert_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_46tz_convert_single(__pyx_self, __pyx_v_val, __pyx_v_tz1, __pyx_v_tz2); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_46tz_convert_single(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_val, PyObject *__pyx_v_tz1, PyObject *__pyx_v_tz2) { + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + Py_ssize_t __pyx_v_pos; + __pyx_t_5numpy_int64_t __pyx_v_offset; + __pyx_t_5numpy_int64_t __pyx_v_utc_date; + pandas_datetimestruct __pyx_v_dts; + CYTHON_UNUSED PyObject *__pyx_v_pytz = NULL; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_11; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_convert_single", 0); + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + + /* "pandas/tslib.pyx":1941 + * pandas_datetimestruct dts + * + * if not have_pytz: # <<<<<<<<<<<<<< + * import pytz + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_have_pytz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1942 + * + * if not have_pytz: + * import pytz # <<<<<<<<<<<<<< + * + * if val == NPY_NAT: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_pytz = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":1944 + * import pytz + * + * if val == NPY_NAT: # <<<<<<<<<<<<<< + * return val + * + */ + __pyx_t_3 = ((__pyx_v_val == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1945 + * + * if val == NPY_NAT: + * return val # <<<<<<<<<<<<<< + * + * # Convert to UTC + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1948 + * + * # Convert to UTC + * if _is_tzlocal(tz1): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_3 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz1) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1949 + * # Convert to UTC + * if _is_tzlocal(tz1): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1950 + * if _is_tzlocal(tz1): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz1) + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "pandas/tslib.pyx":1951 + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + * utc_date = val - delta + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":1950 + * if _is_tzlocal(tz1): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz1) + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + */ + __pyx_t_10 = PyTuple_New(8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_tz1); + PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_v_tz1); + __Pyx_GIVEREF(__pyx_v_tz1); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_dt = ((PyDateTime_DateTime *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1952 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz1) + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 # <<<<<<<<<<<<<< + * utc_date = val - delta + * elif _get_zone(tz1) != 'UTC': + */ + __pyx_t_9 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz1, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Multiply(__pyx_t_10, __pyx_int_1000000000); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_delta = __pyx_t_9; + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1953 + * dts.min, dts.sec, dts.us, tz1) + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + * utc_date = val - delta # <<<<<<<<<<<<<< + * elif _get_zone(tz1) != 'UTC': + * deltas = _get_deltas(tz1) + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyNumber_Subtract(__pyx_t_9, __pyx_v_delta); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_10); if (unlikely((__pyx_t_11 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_utc_date = __pyx_t_11; + goto __pyx_L5; + } + + /* "pandas/tslib.pyx":1954 + * delta = int(total_seconds(_get_utcoffset(tz1, dt))) * 1000000000 + * utc_date = val - delta + * elif _get_zone(tz1) != 'UTC': # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) + */ + __pyx_t_10 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_UTC, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1955 + * utc_date = val - delta + * elif _get_zone(tz1) != 'UTC': + * deltas = _get_deltas(tz1) # <<<<<<<<<<<<<< + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(val) - 1 + */ + __pyx_t_10 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":1956 + * elif _get_zone(tz1) != 'UTC': + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(val) - 1 + * if pos < 0: + */ + __pyx_t_10 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_10); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_15, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_15, __pyx_t_14); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":1957 + * deltas = _get_deltas(tz1) + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(val) - 1 # <<<<<<<<<<<<<< + * if pos < 0: + * raise ValueError('First time before start of DST info') + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Subtract(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_pos = __pyx_t_17; + + /* "pandas/tslib.pyx":1958 + * trans = _get_transitions(tz1) + * pos = trans.searchsorted(val) - 1 + * if pos < 0: # <<<<<<<<<<<<<< + * raise ValueError('First time before start of DST info') + * offset = deltas[pos] + */ + __pyx_t_3 = ((__pyx_v_pos < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1959 + * pos = trans.searchsorted(val) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * offset = deltas[pos] + * utc_date = val - offset + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1960 + * if pos < 0: + * raise ValueError('First time before start of DST info') + * offset = deltas[pos] # <<<<<<<<<<<<<< + * utc_date = val - offset + * else: + */ + __pyx_t_17 = __pyx_v_pos; + __pyx_t_13 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_deltas.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1961 + * raise ValueError('First time before start of DST info') + * offset = deltas[pos] + * utc_date = val - offset # <<<<<<<<<<<<<< + * else: + * utc_date = val + */ + __pyx_v_utc_date = (__pyx_v_val - __pyx_v_offset); + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":1963 + * utc_date = val - offset + * else: + * utc_date = val # <<<<<<<<<<<<<< + * + * if _get_zone(tz2) == 'UTC': + */ + __pyx_v_utc_date = __pyx_v_val; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":1965 + * utc_date = val + * + * if _get_zone(tz2) == 'UTC': # <<<<<<<<<<<<<< + * return utc_date + * if _is_tzlocal(tz2): + */ + __pyx_t_8 = __pyx_f_6pandas_5tslib__get_zone(__pyx_v_tz2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_UTC, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1966 + * + * if _get_zone(tz2) == 'UTC': + * return utc_date # <<<<<<<<<<<<<< + * if _is_tzlocal(tz2): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_utc_date); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1967 + * if _get_zone(tz2) == 'UTC': + * return utc_date + * if _is_tzlocal(tz2): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_3 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz2) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1968 + * return utc_date + * if _is_tzlocal(tz2): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":1969 + * if _is_tzlocal(tz2): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + + /* "pandas/tslib.pyx":1970 + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * return utc_date + delta + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":1969 + * if _is_tzlocal(tz2): + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + */ + __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_tz2); + PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_tz2); + __Pyx_GIVEREF(__pyx_v_tz2); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1971 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 # <<<<<<<<<<<<<< + * return utc_date + delta + * # Convert UTC to other timezone + */ + __pyx_t_4 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz2, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_int_1000000000); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":1972 + * dts.min, dts.sec, dts.us, tz2) + * delta = int(total_seconds(_get_utcoffset(tz2, dt))) * 1000000000 + * return utc_date + delta # <<<<<<<<<<<<<< + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_utc_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1974 + * return utc_date + delta + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_date) - 1 + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_trans, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1975 + * # Convert UTC to other timezone + * trans = _get_transitions(tz2) + * deltas = _get_deltas(tz2) # <<<<<<<<<<<<<< + * pos = trans.searchsorted(utc_date) - 1 + * if pos < 0: + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_13 < 0)) { + PyErr_Fetch(&__pyx_t_16, &__pyx_t_15, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_16, __pyx_t_15, __pyx_t_14); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_deltas, ((PyArrayObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1976 + * trans = _get_transitions(tz2) + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_date) - 1 # <<<<<<<<<<<<<< + * if pos < 0: + * raise ValueError('First time before start of DST info') + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_utc_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_pos = __pyx_t_18; + + /* "pandas/tslib.pyx":1977 + * deltas = _get_deltas(tz2) + * pos = trans.searchsorted(utc_date) - 1 + * if pos < 0: # <<<<<<<<<<<<<< + * raise ValueError('First time before start of DST info') + * + */ + __pyx_t_3 = ((__pyx_v_pos < 0) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":1978 + * pos = trans.searchsorted(utc_date) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":1980 + * raise ValueError('First time before start of DST info') + * + * offset = deltas[pos] # <<<<<<<<<<<<<< + * return utc_date + offset + * + */ + __pyx_t_18 = __pyx_v_pos; + __pyx_t_13 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_13 = 0; + if (unlikely(__pyx_t_13 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_13); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_deltas.diminfo[0].strides)); + + /* "pandas/tslib.pyx":1981 + * + * offset = deltas[pos] + * return utc_date + offset # <<<<<<<<<<<<<< + * + * # Timezone data caches, key is the pytz string or dateutil file name. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((__pyx_v_utc_date + __pyx_v_offset)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1934 + * return result + * + * def tz_convert_single(int64_t val, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] trans, deltas + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.tz_convert_single", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pytz); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1987 + * utc_offset_cache = {} + * + * cdef inline bint _treat_tz_as_pytz(object tz): # <<<<<<<<<<<<<< + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__treat_tz_as_pytz(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_treat_tz_as_pytz", 0); + + /* "pandas/tslib.pyx":1988 + * + * cdef inline bint _treat_tz_as_pytz(object tz): + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') # <<<<<<<<<<<<<< + * + * cdef inline bint _treat_tz_as_dateutil(object tz): + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_utc_transition_times); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __pyx_t_2 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1987 + * utc_offset_cache = {} + * + * cdef inline bint _treat_tz_as_pytz(object tz): # <<<<<<<<<<<<<< + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.tslib._treat_tz_as_pytz", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1990 + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') + * + * cdef inline bint _treat_tz_as_dateutil(object tz): # <<<<<<<<<<<<<< + * return hasattr(tz, '_trans_list') and hasattr(tz, '_trans_idx') + * + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__treat_tz_as_dateutil(PyObject *__pyx_v_tz) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_treat_tz_as_dateutil", 0); + + /* "pandas/tslib.pyx":1991 + * + * cdef inline bint _treat_tz_as_dateutil(object tz): + * return hasattr(tz, '_trans_list') and hasattr(tz, '_trans_idx') # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + __pyx_t_2 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_trans_idx); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1990 + * return hasattr(tz, '_utc_transition_times') and hasattr(tz, '_transition_info') + * + * cdef inline bint _treat_tz_as_dateutil(object tz): # <<<<<<<<<<<<<< + * return hasattr(tz, '_trans_list') and hasattr(tz, '_trans_idx') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.tslib._treat_tz_as_dateutil", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1994 + * + * + * def _p_tz_cache_key(tz): # <<<<<<<<<<<<<< + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_49_p_tz_cache_key(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/ +static char __pyx_doc_6pandas_5tslib_48_p_tz_cache_key[] = " Python interface for cache function to facilitate testing."; +static PyMethodDef __pyx_mdef_6pandas_5tslib_49_p_tz_cache_key = {__Pyx_NAMESTR("_p_tz_cache_key"), (PyCFunction)__pyx_pw_6pandas_5tslib_49_p_tz_cache_key, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_48_p_tz_cache_key)}; +static PyObject *__pyx_pw_6pandas_5tslib_49_p_tz_cache_key(PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_p_tz_cache_key (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_48_p_tz_cache_key(__pyx_self, ((PyObject *)__pyx_v_tz)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_48_p_tz_cache_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_p_tz_cache_key", 0); + + /* "pandas/tslib.pyx":1996 + * def _p_tz_cache_key(tz): + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib__tz_cache_key(__pyx_v_tz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":1994 + * + * + * def _p_tz_cache_key(tz): # <<<<<<<<<<<<<< + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._p_tz_cache_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":1999 + * + * + * cdef inline object _tz_cache_key(object tz): # <<<<<<<<<<<<<< + * """ + * Return the key in the cache for the timezone info object or None if unknown. + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib__tz_cache_key(PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_tz_cache_key", 0); + + /* "pandas/tslib.pyx":2012 + * Also, pytz objects are not always hashable so we use str(tz) instead. + * """ + * if isinstance(tz, _pytz_BaseTzInfo): # <<<<<<<<<<<<<< + * return tz.zone + * elif isinstance(tz, _dateutil_tzfile): + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz_BaseTzInfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2013 + * """ + * if isinstance(tz, _pytz_BaseTzInfo): + * return tz.zone # <<<<<<<<<<<<<< + * elif isinstance(tz, _dateutil_tzfile): + * if '.tar.gz' in tz._filename: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2014 + * if isinstance(tz, _pytz_BaseTzInfo): + * return tz.zone + * elif isinstance(tz, _dateutil_tzfile): # <<<<<<<<<<<<<< + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dateutil_tzfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2015 + * return tz.zone + * elif isinstance(tz, _dateutil_tzfile): + * if '.tar.gz' in tz._filename: # <<<<<<<<<<<<<< + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_kp_s_tar_gz, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2016 + * elif isinstance(tz, _dateutil_tzfile): + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' # <<<<<<<<<<<<<< + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2019 + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + * return 'dateutil' + tz._filename # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Add(__pyx_n_s_dateutil_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2021 + * return 'dateutil' + tz._filename + * else: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":1999 + * + * + * cdef inline object _tz_cache_key(object tz): # <<<<<<<<<<<<<< + * """ + * Return the key in the cache for the timezone info object or None if unknown. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib._tz_cache_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2024 + * + * + * cdef object _get_transitions(object tz): # <<<<<<<<<<<<<< + * """ + * Get UTC times of DST transitions + */ + +static PyObject *__pyx_f_6pandas_5tslib__get_transitions(PyObject *__pyx_v_tz) { + PyObject *__pyx_v_cache_key = NULL; + PyObject *__pyx_v_arr = NULL; + PyObject *__pyx_v_trans_list = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_transitions", 0); + + /* "pandas/tslib.pyx":2028 + * Get UTC times of DST transitions + * """ + * cache_key = _tz_cache_key(tz) # <<<<<<<<<<<<<< + * if cache_key is None: + * return np.array([NPY_NAT + 1], dtype=np.int64) + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__tz_cache_key(__pyx_v_tz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cache_key = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2029 + * """ + * cache_key = _tz_cache_key(tz) + * if cache_key is None: # <<<<<<<<<<<<<< + * return np.array([NPY_NAT + 1], dtype=np.int64) + * + */ + __pyx_t_2 = (__pyx_v_cache_key == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2030 + * cache_key = _tz_cache_key(tz) + * if cache_key is None: + * return np.array([NPY_NAT + 1], dtype=np.int64) # <<<<<<<<<<<<<< + * + * if cache_key not in trans_cache: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2032 + * return np.array([NPY_NAT + 1], dtype=np.int64) + * + * if cache_key not in trans_cache: # <<<<<<<<<<<<<< + * if _treat_tz_as_pytz(tz): + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_trans_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_cache_key, __pyx_t_7, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2033 + * + * if cache_key not in trans_cache: + * if _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + * arr = arr.view('i8') + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2034 + * if cache_key not in trans_cache: + * if _treat_tz_as_pytz(tz): + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') # <<<<<<<<<<<<<< + * arr = arr.view('i8') + * try: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utc_transition_times); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_arr = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":2035 + * if _treat_tz_as_pytz(tz): + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + * arr = arr.view('i8') # <<<<<<<<<<<<<< + * try: + * if tz._utc_transition_times[0].year == 1: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":2036 + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + * arr = arr.view('i8') + * try: # <<<<<<<<<<<<<< + * if tz._utc_transition_times[0].year == 1: + * arr[0] = NPY_NAT + 1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "pandas/tslib.pyx":2037 + * arr = arr.view('i8') + * try: + * if tz._utc_transition_times[0].year == 1: # <<<<<<<<<<<<<< + * arr[0] = NPY_NAT + 1 + * except Exception: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utc_transition_times); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_year); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2038 + * try: + * if tz._utc_transition_times[0].year == 1: + * arr[0] = NPY_NAT + 1 # <<<<<<<<<<<<<< + * except Exception: + * pass + */ + __pyx_t_4 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_SetItemInt(__pyx_v_arr, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L14; + } + __pyx_L14:; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":2039 + * if tz._utc_transition_times[0].year == 1: + * arr[0] = NPY_NAT + 1 + * except Exception: # <<<<<<<<<<<<<< + * pass + * elif _treat_tz_as_dateutil(tz): + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_11) { + PyErr_Restore(0,0,0); + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L13_try_end:; + } + goto __pyx_L5; + } + + /* "pandas/tslib.pyx":2041 + * except Exception: + * pass + * elif _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * if len(tz._trans_list): + * # get utc trans times + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2042 + * pass + * elif _treat_tz_as_dateutil(tz): + * if len(tz._trans_list): # <<<<<<<<<<<<<< + * # get utc trans times + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__pyx_t_12 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2044 + * if len(tz._trans_list): + * # get utc trans times + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) # <<<<<<<<<<<<<< + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + */ + __pyx_t_4 = __pyx_f_6pandas_5tslib__get_utc_trans_times_from_dateutil_tz(__pyx_v_tz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_trans_list = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":2045 + * # get utc trans times + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item # <<<<<<<<<<<<<< + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + * arr = arr.view('i8') + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_hstack); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_kp_s_M8_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":2046 + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed # <<<<<<<<<<<<<< + * arr = arr.view('i8') + * # scale transitions correctly in numpy 1.6 + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_trans_list); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_trans_list); + __Pyx_GIVEREF(__pyx_v_trans_list); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_kp_s_M8_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2045 + * # get utc trans times + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item # <<<<<<<<<<<<<< + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + * arr = arr.view('i8') + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_6 = 0; + __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "pandas/tslib.pyx":2046 + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed # <<<<<<<<<<<<<< + * arr = arr.view('i8') + * # scale transitions correctly in numpy 1.6 + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2047 + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + * arr = arr.view('i8') # <<<<<<<<<<<<<< + * # scale transitions correctly in numpy 1.6 + * if _np_version_under1p7: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_13); + __pyx_t_13 = 0; + + /* "pandas/tslib.pyx":2049 + * arr = arr.view('i8') + * # scale transitions correctly in numpy 1.6 + * if _np_version_under1p7: # <<<<<<<<<<<<<< + * arr *= 1000000000 + * arr[0] = NPY_NAT + 1 + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2050 + * # scale transitions correctly in numpy 1.6 + * if _np_version_under1p7: + * arr *= 1000000000 # <<<<<<<<<<<<<< + * arr[0] = NPY_NAT + 1 + * elif _is_fixed_offset(tz): + */ + __pyx_t_13 = PyNumber_InPlaceMultiply(__pyx_v_arr, __pyx_int_1000000000); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_13); + __pyx_t_13 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "pandas/tslib.pyx":2051 + * if _np_version_under1p7: + * arr *= 1000000000 + * arr[0] = NPY_NAT + 1 # <<<<<<<<<<<<<< + * elif _is_fixed_offset(tz): + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + */ + __pyx_t_13 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + if (unlikely(__Pyx_SetItemInt(__pyx_v_arr, 0, __pyx_t_13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L15; + } + + /* "pandas/tslib.pyx":2052 + * arr *= 1000000000 + * arr[0] = NPY_NAT + 1 + * elif _is_fixed_offset(tz): # <<<<<<<<<<<<<< + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + * else: + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__is_fixed_offset(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2053 + * arr[0] = NPY_NAT + 1 + * elif _is_fixed_offset(tz): + * arr = np.array([NPY_NAT + 1], dtype=np.int64) # <<<<<<<<<<<<<< + * else: + * arr = np.array([], dtype='M8[ns]') + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_arr = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L15; + } + /*else*/ { + + /* "pandas/tslib.pyx":2055 + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + * else: + * arr = np.array([], dtype='M8[ns]') # <<<<<<<<<<<<<< + * else: + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_kp_s_M8_ns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_arr = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L15:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":2057 + * arr = np.array([], dtype='M8[ns]') + * else: + * arr = np.array([NPY_NAT + 1], dtype=np.int64) # <<<<<<<<<<<<<< + * trans_cache[cache_key] = arr + * return trans_cache[cache_key] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_6pandas_5tslib_NPY_NAT + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_arr = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L5:; + + /* "pandas/tslib.pyx":2058 + * else: + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + * trans_cache[cache_key] = arr # <<<<<<<<<<<<<< + * return trans_cache[cache_key] + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_trans_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_cache_key, __pyx_v_arr) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":2059 + * arr = np.array([NPY_NAT + 1], dtype=np.int64) + * trans_cache[cache_key] = arr + * return trans_cache[cache_key] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_trans_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyObject_GetItem(__pyx_t_6, __pyx_v_cache_key); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2024 + * + * + * cdef object _get_transitions(object tz): # <<<<<<<<<<<<<< + * """ + * Get UTC times of DST transitions + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("pandas.tslib._get_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cache_key); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XDECREF(__pyx_v_trans_list); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2062 + * + * + * cdef object _get_utc_trans_times_from_dateutil_tz(object tz): # <<<<<<<<<<<<<< + * ''' + * Transition times in dateutil timezones are stored in local non-dst time. This code + */ + +static PyObject *__pyx_f_6pandas_5tslib__get_utc_trans_times_from_dateutil_tz(PyObject *__pyx_v_tz) { + PyObject *__pyx_v_new_trans = NULL; + PyObject *__pyx_v_last_std_offset = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_trans = NULL; + PyObject *__pyx_v_tti = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_utc_trans_times_from_dateutil_tz", 0); + + /* "pandas/tslib.pyx":2067 + * converts them to UTC. It's the reverse of the code in dateutil.tz.tzfile.__init__. + * ''' + * new_trans = list(tz._trans_list) # <<<<<<<<<<<<<< + * last_std_offset = 0 + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_new_trans = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2068 + * ''' + * new_trans = list(tz._trans_list) + * last_std_offset = 0 # <<<<<<<<<<<<<< + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): + * if not tti.isdst: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_last_std_offset = __pyx_int_0; + + /* "pandas/tslib.pyx":2069 + * new_trans = list(tz._trans_list) + * last_std_offset = 0 + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): # <<<<<<<<<<<<<< + * if not tti.isdst: + * last_std_offset = tti.offset + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_idx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_trans, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_tti, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":2070 + * last_std_offset = 0 + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): + * if not tti.isdst: # <<<<<<<<<<<<<< + * last_std_offset = tti.offset + * new_trans[i] = trans - last_std_offset + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tti, __pyx_n_s_isdst); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = ((!__pyx_t_10) != 0); + if (__pyx_t_11) { + + /* "pandas/tslib.pyx":2071 + * for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)): + * if not tti.isdst: + * last_std_offset = tti.offset # <<<<<<<<<<<<<< + * new_trans[i] = trans - last_std_offset + * return new_trans + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tti, __pyx_n_s_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_last_std_offset, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/tslib.pyx":2072 + * if not tti.isdst: + * last_std_offset = tti.offset + * new_trans[i] = trans - last_std_offset # <<<<<<<<<<<<<< + * return new_trans + * + */ + __pyx_t_3 = PyNumber_Subtract(__pyx_v_trans, __pyx_v_last_std_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyObject_SetItem(__pyx_v_new_trans, __pyx_v_i, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2073 + * last_std_offset = tti.offset + * new_trans[i] = trans - last_std_offset + * return new_trans # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_new_trans); + __pyx_r = __pyx_v_new_trans; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2062 + * + * + * cdef object _get_utc_trans_times_from_dateutil_tz(object tz): # <<<<<<<<<<<<<< + * ''' + * Transition times in dateutil timezones are stored in local non-dst time. This code + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.tslib._get_utc_trans_times_from_dateutil_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_new_trans); + __Pyx_XDECREF(__pyx_v_last_std_offset); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_trans); + __Pyx_XDECREF(__pyx_v_tti); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2076 + * + * + * cdef object _get_deltas(object tz): # <<<<<<<<<<<<<< + * """ + * Get UTC offsets in microseconds corresponding to DST transitions + */ + +static PyObject *__pyx_f_6pandas_5tslib__get_deltas(PyObject *__pyx_v_tz) { + PyObject *__pyx_v_cache_key = NULL; + PyObject *__pyx_v_num = NULL; + PyObject *__pyx_v_arr = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_deltas", 0); + + /* "pandas/tslib.pyx":2080 + * Get UTC offsets in microseconds corresponding to DST transitions + * """ + * cache_key = _tz_cache_key(tz) # <<<<<<<<<<<<<< + * if cache_key is None: + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__tz_cache_key(__pyx_v_tz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cache_key = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2081 + * """ + * cache_key = _tz_cache_key(tz) + * if cache_key is None: # <<<<<<<<<<<<<< + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 + * return np.array([num], dtype=np.int64) + */ + __pyx_t_2 = (__pyx_v_cache_key == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2082 + * cache_key = _tz_cache_key(tz) + * if cache_key is None: + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 # <<<<<<<<<<<<<< + * return np.array([num], dtype=np.int64) + * + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, Py_None, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_num = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2083 + * if cache_key is None: + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 + * return np.array([num], dtype=np.int64) # <<<<<<<<<<<<<< + * + * if cache_key not in utc_offset_cache: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_num); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_num); + __Pyx_GIVEREF(__pyx_v_num); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2085 + * return np.array([num], dtype=np.int64) + * + * if cache_key not in utc_offset_cache: # <<<<<<<<<<<<<< + * if _treat_tz_as_pytz(tz): + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_cache_key, __pyx_t_7, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2086 + * + * if cache_key not in utc_offset_cache: + * if _treat_tz_as_pytz(tz): # <<<<<<<<<<<<<< + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) + * elif _treat_tz_as_dateutil(tz): + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__treat_tz_as_pytz(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2087 + * if cache_key not in utc_offset_cache: + * if _treat_tz_as_pytz(tz): + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) # <<<<<<<<<<<<<< + * elif _treat_tz_as_dateutil(tz): + * if len(tz._trans_list): + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_5tslib__unbox_utcoffsets(__pyx_t_7, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_cache_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5; + } + + /* "pandas/tslib.pyx":2088 + * if _treat_tz_as_pytz(tz): + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) + * elif _treat_tz_as_dateutil(tz): # <<<<<<<<<<<<<< + * if len(tz._trans_list): + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__treat_tz_as_dateutil(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2089 + * utc_offset_cache[cache_key] = _unbox_utcoffsets(tz._transition_info) + * elif _treat_tz_as_dateutil(tz): + * if len(tz._trans_list): # <<<<<<<<<<<<<< + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) + * arr *= 1000000000 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_8 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2090 + * elif _treat_tz_as_dateutil(tz): + * if len(tz._trans_list): + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) # <<<<<<<<<<<<<< + * arr *= 1000000000 + * utc_offset_cache[cache_key] = arr + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_ttinfo_before); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_trans_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_9(__pyx_t_5); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2091 + * if len(tz._trans_list): + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) + * arr *= 1000000000 # <<<<<<<<<<<<<< + * utc_offset_cache[cache_key] = arr + * elif _is_fixed_offset(tz): + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_arr, __pyx_int_1000000000); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2092 + * arr = np.array([v.offset for v in (tz._ttinfo_before,) + tz._trans_idx], dtype='i8') # + (tz._ttinfo_std,) + * arr *= 1000000000 + * utc_offset_cache[cache_key] = arr # <<<<<<<<<<<<<< + * elif _is_fixed_offset(tz): + * utc_offset_cache[cache_key] = np.array([tz._ttinfo_std.offset], dtype='i8') * 1000000000 + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_cache_key, __pyx_v_arr) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + + /* "pandas/tslib.pyx":2093 + * arr *= 1000000000 + * utc_offset_cache[cache_key] = arr + * elif _is_fixed_offset(tz): # <<<<<<<<<<<<<< + * utc_offset_cache[cache_key] = np.array([tz._ttinfo_std.offset], dtype='i8') * 1000000000 + * else: + */ + __pyx_t_2 = (__pyx_f_6pandas_5tslib__is_fixed_offset(__pyx_v_tz) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2094 + * utc_offset_cache[cache_key] = arr + * elif _is_fixed_offset(tz): + * utc_offset_cache[cache_key] = np.array([tz._ttinfo_std.offset], dtype='i8') * 1000000000 # <<<<<<<<<<<<<< + * else: + * utc_offset_cache[cache_key] = np.array([], dtype='i8') + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_ttinfo_std); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_offset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_int_1000000000); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_cache_key, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6; + } + /*else*/ { + + /* "pandas/tslib.pyx":2096 + * utc_offset_cache[cache_key] = np.array([tz._ttinfo_std.offset], dtype='i8') * 1000000000 + * else: + * utc_offset_cache[cache_key] = np.array([], dtype='i8') # <<<<<<<<<<<<<< + * else: + * # static tzinfo + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_cache_key, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L6:; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":2099 + * else: + * # static tzinfo + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 # <<<<<<<<<<<<<< + * utc_offset_cache[cache_key] = np.array([num], dtype=np.int64) + * + */ + __pyx_t_1 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, Py_None, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_t_6, __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_num = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2100 + * # static tzinfo + * num = int(total_seconds(_get_utcoffset(tz, None))) * 1000000000 + * utc_offset_cache[cache_key] = np.array([num], dtype=np.int64) # <<<<<<<<<<<<<< + * + * return utc_offset_cache[cache_key] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_num); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_num); + __Pyx_GIVEREF(__pyx_v_num); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_cache_key, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L5:; + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":2102 + * utc_offset_cache[cache_key] = np.array([num], dtype=np.int64) + * + * return utc_offset_cache[cache_key] # <<<<<<<<<<<<<< + * + * cdef double total_seconds(object td): # Python 2.6 compat + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc_offset_cache); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_GetItem(__pyx_t_4, __pyx_v_cache_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2076 + * + * + * cdef object _get_deltas(object tz): # <<<<<<<<<<<<<< + * """ + * Get UTC offsets in microseconds corresponding to DST transitions + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("pandas.tslib._get_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cache_key); + __Pyx_XDECREF(__pyx_v_num); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2104 + * return utc_offset_cache[cache_key] + * + * cdef double total_seconds(object td): # Python 2.6 compat # <<<<<<<<<<<<<< + * return ((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) // + * 10**6) + */ + +static double __pyx_f_6pandas_5tslib_total_seconds(PyObject *__pyx_v_td) { + double __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + double __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("total_seconds", 0); + + /* "pandas/tslib.pyx":2105 + * + * cdef double total_seconds(object td): # Python 2.6 compat + * return ((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) // # <<<<<<<<<<<<<< + * 10**6) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_seconds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_days); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_int_24); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_3600); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_4, __pyx_int_1000000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2104 + * return utc_offset_cache[cache_key] + * + * cdef double total_seconds(object td): # Python 2.6 compat # <<<<<<<<<<<<<< + * return ((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) // + * 10**6) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("pandas.tslib.total_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2108 + * 10**6) + * + * def tot_seconds(td): # <<<<<<<<<<<<<< + * return total_seconds(td) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_51tot_seconds(PyObject *__pyx_self, PyObject *__pyx_v_td); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_51tot_seconds = {__Pyx_NAMESTR("tot_seconds"), (PyCFunction)__pyx_pw_6pandas_5tslib_51tot_seconds, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_51tot_seconds(PyObject *__pyx_self, PyObject *__pyx_v_td) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tot_seconds (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_50tot_seconds(__pyx_self, ((PyObject *)__pyx_v_td)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_50tot_seconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_td) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tot_seconds", 0); + + /* "pandas/tslib.pyx":2109 + * + * def tot_seconds(td): + * return total_seconds(td) # <<<<<<<<<<<<<< + * + * cpdef ndarray _unbox_utcoffsets(object transinfo): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_v_td)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2108 + * 10**6) + * + * def tot_seconds(td): # <<<<<<<<<<<<<< + * return total_seconds(td) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.tot_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2111 + * return total_seconds(td) + * + * cpdef ndarray _unbox_utcoffsets(object transinfo): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static PyObject *__pyx_pw_6pandas_5tslib_53_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo); /*proto*/ +static PyArrayObject *__pyx_f_6pandas_5tslib__unbox_utcoffsets(PyObject *__pyx_v_transinfo, CYTHON_UNUSED int __pyx_skip_dispatch) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyArrayObject *__pyx_v_arr = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + __pyx_t_5numpy_int64_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unbox_utcoffsets", 0); + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + + /* "pandas/tslib.pyx":2116 + * ndarray[int64_t] arr + * + * sz = len(transinfo) # <<<<<<<<<<<<<< + * arr = np.empty(sz, dtype='i8') + * + */ + __pyx_t_1 = PyObject_Length(__pyx_v_transinfo); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_sz = __pyx_t_1; + + /* "pandas/tslib.pyx":2117 + * + * sz = len(transinfo) + * arr = np.empty(sz, dtype='i8') # <<<<<<<<<<<<<< + * + * for i in range(sz): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_sz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_arr = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2119 + * arr = np.empty(sz, dtype='i8') + * + * for i in range(sz): # <<<<<<<<<<<<<< + * arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000 + * + */ + __pyx_t_1 = __pyx_v_sz; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2120 + * + * for i in range(sz): + * arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000 # <<<<<<<<<<<<<< + * + * return arr + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_transinfo, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_1000000000); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_t_12; + } + + /* "pandas/tslib.pyx":2122 + * arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000 + * + * return arr # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyArrayObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2111 + * return total_seconds(td) + * + * cpdef ndarray _unbox_utcoffsets(object transinfo): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib._unbox_utcoffsets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_arr); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_53_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_53_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_unbox_utcoffsets (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_52_unbox_utcoffsets(__pyx_self, ((PyObject *)__pyx_v_transinfo)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_52_unbox_utcoffsets(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_transinfo) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_unbox_utcoffsets", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_5tslib__unbox_utcoffsets(__pyx_v_transinfo, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib._unbox_utcoffsets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2127 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Localize tzinfo-naive DateRange to given time zone (using pytz). If + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_55tz_localize_to_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_54tz_localize_to_utc[] = "\n Localize tzinfo-naive DateRange to given time zone (using pytz). If\n there are ambiguities in the values, raise AmbiguousTimeError.\n\n Returns\n -------\n localized : DatetimeIndex\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_55tz_localize_to_utc = {__Pyx_NAMESTR("tz_localize_to_utc"), (PyCFunction)__pyx_pw_6pandas_5tslib_55tz_localize_to_utc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_54tz_localize_to_utc)}; +static PyObject *__pyx_pw_6pandas_5tslib_55tz_localize_to_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_vals = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_v_infer_dst; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tz_localize_to_utc (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vals,&__pyx_n_s_tz,&__pyx_n_s_infer_dst,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("tz_localize_to_utc", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infer_dst); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tz_localize_to_utc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_vals = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + if (values[2]) { + __pyx_v_infer_dst = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_infer_dst == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_infer_dst = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tz_localize_to_utc", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.tz_localize_to_utc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_54tz_localize_to_utc(__pyx_self, __pyx_v_vals, __pyx_v_tz, __pyx_v_infer_dst); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_54tz_localize_to_utc(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vals, PyObject *__pyx_v_tz, int __pyx_v_infer_dst) { + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + PyArrayObject *__pyx_v_idx_shifted = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_pos; + Py_ssize_t __pyx_v_ntrans; + Py_ssize_t __pyx_v_n; + __pyx_t_5numpy_int64_t *__pyx_v_tdata; + __pyx_t_5numpy_int64_t __pyx_v_v; + __pyx_t_5numpy_int64_t __pyx_v_left; + __pyx_t_5numpy_int64_t __pyx_v_right; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_result_a = 0; + PyArrayObject *__pyx_v_result_b = 0; + PyArrayObject *__pyx_v_dst_hours = 0; + pandas_datetimestruct __pyx_v_dts; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v_both_nat = NULL; + PyObject *__pyx_v_both_eq = NULL; + PyObject *__pyx_v_trans_idx = NULL; + PyObject *__pyx_v_stamp = NULL; + PyObject *__pyx_v_one_diff = NULL; + PyObject *__pyx_v_trans_grp = NULL; + PyObject *__pyx_v_grp = NULL; + PyObject *__pyx_v_switch_idx = NULL; + PyObject *__pyx_v_a_idx = NULL; + PyObject *__pyx_v_b_idx = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dst_hours; + __Pyx_Buffer __pyx_pybuffer_dst_hours; + __Pyx_LocalBuf_ND __pyx_pybuffernd_idx_shifted; + __Pyx_Buffer __pyx_pybuffer_idx_shifted; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result_a; + __Pyx_Buffer __pyx_pybuffer_result_a; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result_b; + __Pyx_Buffer __pyx_pybuffer_result_b; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + __Pyx_LocalBuf_ND __pyx_pybuffernd_vals; + __Pyx_Buffer __pyx_pybuffer_vals; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyArrayObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + PyArrayObject *__pyx_t_22 = NULL; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + PyObject *(*__pyx_t_34)(PyObject *); + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("tz_localize_to_utc", 0); + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_idx_shifted.pybuffer.buf = NULL; + __pyx_pybuffer_idx_shifted.refcount = 0; + __pyx_pybuffernd_idx_shifted.data = NULL; + __pyx_pybuffernd_idx_shifted.rcbuffer = &__pyx_pybuffer_idx_shifted; + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_result_a.pybuffer.buf = NULL; + __pyx_pybuffer_result_a.refcount = 0; + __pyx_pybuffernd_result_a.data = NULL; + __pyx_pybuffernd_result_a.rcbuffer = &__pyx_pybuffer_result_a; + __pyx_pybuffer_result_b.pybuffer.buf = NULL; + __pyx_pybuffer_result_b.refcount = 0; + __pyx_pybuffernd_result_b.data = NULL; + __pyx_pybuffernd_result_b.rcbuffer = &__pyx_pybuffer_result_b; + __pyx_pybuffer_dst_hours.pybuffer.buf = NULL; + __pyx_pybuffer_dst_hours.refcount = 0; + __pyx_pybuffernd_dst_hours.data = NULL; + __pyx_pybuffernd_dst_hours.rcbuffer = &__pyx_pybuffer_dst_hours; + __pyx_pybuffer_vals.pybuffer.buf = NULL; + __pyx_pybuffer_vals.refcount = 0; + __pyx_pybuffernd_vals.data = NULL; + __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2138 + * cdef: + * ndarray[int64_t] trans, deltas, idx_shifted + * Py_ssize_t i, idx, pos, ntrans, n = len(vals) # <<<<<<<<<<<<<< + * int64_t *tdata + * int64_t v, left, right + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_vals)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2146 + * # Vectorized version of DstTzInfo.localize + * + * if not have_pytz: # <<<<<<<<<<<<<< + * raise Exception("Could not find pytz module") + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_have_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2147 + * + * if not have_pytz: + * raise Exception("Could not find pytz module") # <<<<<<<<<<<<<< + * + * if tz == UTC or tz is None: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2149 + * raise Exception("Could not find pytz module") + * + * if tz == UTC or tz is None: # <<<<<<<<<<<<<< + * return vals + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_UTC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_tz, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!__pyx_t_4) { + __pyx_t_3 = (__pyx_v_tz == Py_None); + __pyx_t_6 = __pyx_t_3; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2150 + * + * if tz == UTC or tz is None: + * return vals # <<<<<<<<<<<<<< + * + * result = np.empty(n, dtype=np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_vals)); + __pyx_r = ((PyObject *)__pyx_v_vals); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2152 + * return vals + * + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * if _is_tzlocal(tz): + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":2154 + * result = np.empty(n, dtype=np.int64) + * + * if _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * v = vals[i] + */ + __pyx_t_6 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2155 + * + * if _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/tslib.pyx":2156 + * if _is_tzlocal(tz): + * for i in range(n): + * v = vals[i] # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_16 = __pyx_v_i; + __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_vals.diminfo[0].strides)); + + /* "pandas/tslib.pyx":2157 + * for i in range(n): + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + pandas_datetime_to_datetimestruct(__pyx_v_v, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2158 + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":2159 + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * result[i] = v - delta + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_17 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + + /* "pandas/tslib.pyx":2158 + * v = vals[i] + * pandas_datetime_to_datetimestruct(v, PANDAS_FR_ns, &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_19 = PyTuple_New(8); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_19, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_19, 5, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_19, 6, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_19, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_9 = 0; + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_17 = 0; + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_19, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_18)); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2160 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * result[i] = v - delta + * return result + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_18)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyNumber_Multiply(__pyx_t_19, __pyx_int_1000000000); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2161 + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * result[i] = v - delta # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_18 = __Pyx_PyInt_From_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = PyNumber_Subtract(__pyx_t_18, __pyx_v_delta); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_19); if (unlikely((__pyx_t_20 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_21 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_20; + } + + /* "pandas/tslib.pyx":2162 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * result[i] = v - delta + * return result # <<<<<<<<<<<<<< + * + * trans = _get_transitions(tz) # transition dates + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2164 + * return result + * + * trans = _get_transitions(tz) # transition dates # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) # utc offsets + * + */ + __pyx_t_19 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_19); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_19); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2165 + * + * trans = _get_transitions(tz) # transition dates + * deltas = _get_deltas(tz) # utc offsets # <<<<<<<<<<<<<< + * + * tdata = trans.data + */ + __pyx_t_19 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_19); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_19); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2167 + * deltas = _get_deltas(tz) # utc offsets + * + * tdata = trans.data # <<<<<<<<<<<<<< + * ntrans = len(trans) + * + */ + __pyx_v_tdata = ((__pyx_t_5numpy_int64_t *)__pyx_v_trans->data); + + /* "pandas/tslib.pyx":2168 + * + * tdata = trans.data + * ntrans = len(trans) # <<<<<<<<<<<<<< + * + * result_a = np.empty(n, dtype=np.int64) + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_trans)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_ntrans = __pyx_t_1; + + /* "pandas/tslib.pyx":2170 + * ntrans = len(trans) + * + * result_a = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * result_b = np.empty(n, dtype=np.int64) + * result_a.fill(NPY_NAT) + */ + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_empty); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_17, __pyx_t_19); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_result_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); + } + } + __pyx_pybuffernd_result_a.diminfo[0].strides = __pyx_pybuffernd_result_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result_a.diminfo[0].shape = __pyx_pybuffernd_result_a.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result_a = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2171 + * + * result_a = np.empty(n, dtype=np.int64) + * result_b = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * result_a.fill(NPY_NAT) + * result_b.fill(NPY_NAT) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_17, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_8); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer, (PyObject*)__pyx_v_result_b, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_result_b.diminfo[0].strides = __pyx_pybuffernd_result_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result_b.diminfo[0].shape = __pyx_pybuffernd_result_b.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_result_b = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2172 + * result_a = np.empty(n, dtype=np.int64) + * result_b = np.empty(n, dtype=np.int64) + * result_a.fill(NPY_NAT) # <<<<<<<<<<<<<< + * result_b.fill(NPY_NAT) + * + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result_a), __pyx_n_s_fill); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2173 + * result_b = np.empty(n, dtype=np.int64) + * result_a.fill(NPY_NAT) + * result_b.fill(NPY_NAT) # <<<<<<<<<<<<<< + * + * # left side + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result_b), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2177 + * # left side + * idx_shifted = _ensure_int64( + * np.maximum(0, trans.searchsorted(vals - DAY_NS, side='right') - 1)) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_maximum); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_DAY_NS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = PyNumber_Subtract(((PyObject *)__pyx_v_vals), __pyx_t_2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_2, __pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Subtract(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_18, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2176 + * + * # left side + * idx_shifted = _ensure_int64( # <<<<<<<<<<<<<< + * np.maximum(0, trans.searchsorted(vals - DAY_NS, side='right') - 1)) + * + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib__ensure_int64(__pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_v_idx_shifted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); + } + } + __pyx_pybuffernd_idx_shifted.diminfo[0].strides = __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx_shifted.diminfo[0].shape = __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __pyx_v_idx_shifted = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2179 + * np.maximum(0, trans.searchsorted(vals - DAY_NS, side='right') - 1)) + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] - deltas[idx_shifted[i]] + * pos = bisect_right_i8(tdata, v, ntrans) - 1 + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/tslib.pyx":2180 + * + * for i in range(n): + * v = vals[i] - deltas[idx_shifted[i]] # <<<<<<<<<<<<<< + * pos = bisect_right_i8(tdata, v, ntrans) - 1 + * + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_24 = __pyx_v_i; + __pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_idx_shifted.diminfo[0].strides)); + __pyx_v_v = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_vals.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_deltas.diminfo[0].strides))); + + /* "pandas/tslib.pyx":2181 + * for i in range(n): + * v = vals[i] - deltas[idx_shifted[i]] + * pos = bisect_right_i8(tdata, v, ntrans) - 1 # <<<<<<<<<<<<<< + * + * # timestamp falls to the left side of the DST transition + */ + __pyx_t_18 = __pyx_f_6pandas_5tslib_bisect_right_i8(__pyx_v_tdata, __pyx_v_v, __pyx_v_ntrans); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = PyNumber_Subtract(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_t_19); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_v_pos = __pyx_t_25; + + /* "pandas/tslib.pyx":2184 + * + * # timestamp falls to the left side of the DST transition + * if v + deltas[pos] == vals[i]: # <<<<<<<<<<<<<< + * result_a[i] = v + * + */ + __pyx_t_25 = __pyx_v_pos; + __pyx_t_26 = __pyx_v_i; + __pyx_t_6 = (((__pyx_v_v + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_deltas.diminfo[0].strides))) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_vals.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2185 + * # timestamp falls to the left side of the DST transition + * if v + deltas[pos] == vals[i]: + * result_a[i] = v # <<<<<<<<<<<<<< + * + * # right side + */ + __pyx_t_27 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result_a.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_result_a.diminfo[0].strides) = __pyx_v_v; + goto __pyx_L10; + } + __pyx_L10:; + } + + /* "pandas/tslib.pyx":2189 + * # right side + * idx_shifted = _ensure_int64( + * np.maximum(0, trans.searchsorted(vals + DAY_NS, side='right') - 1)) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_maximum); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_DAY_NS); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_vals), __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_17, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2188 + * + * # right side + * idx_shifted = _ensure_int64( # <<<<<<<<<<<<<< + * np.maximum(0, trans.searchsorted(vals + DAY_NS, side='right') - 1)) + * + */ + __pyx_t_17 = __pyx_f_6pandas_5tslib__ensure_int64(__pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_17); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_v_idx_shifted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + } + __pyx_pybuffernd_idx_shifted.diminfo[0].strides = __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx_shifted.diminfo[0].shape = __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_22 = 0; + __Pyx_DECREF_SET(__pyx_v_idx_shifted, ((PyArrayObject *)__pyx_t_17)); + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2191 + * np.maximum(0, trans.searchsorted(vals + DAY_NS, side='right') - 1)) + * + * for i in range(n): # <<<<<<<<<<<<<< + * v = vals[i] - deltas[idx_shifted[i]] + * pos = bisect_right_i8(tdata, v, ntrans) - 1 + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/tslib.pyx":2192 + * + * for i in range(n): + * v = vals[i] - deltas[idx_shifted[i]] # <<<<<<<<<<<<<< + * pos = bisect_right_i8(tdata, v, ntrans) - 1 + * + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_29 = __pyx_v_i; + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_idx_shifted.diminfo[0].strides)); + __pyx_v_v = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_vals.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_deltas.diminfo[0].strides))); + + /* "pandas/tslib.pyx":2193 + * for i in range(n): + * v = vals[i] - deltas[idx_shifted[i]] + * pos = bisect_right_i8(tdata, v, ntrans) - 1 # <<<<<<<<<<<<<< + * + * # timestamp falls to the right side of the DST transition + */ + __pyx_t_17 = __pyx_f_6pandas_5tslib_bisect_right_i8(__pyx_v_tdata, __pyx_v_v, __pyx_v_ntrans); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_17, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_31 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_31 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_pos = __pyx_t_31; + + /* "pandas/tslib.pyx":2196 + * + * # timestamp falls to the right side of the DST transition + * if v + deltas[pos] == vals[i]: # <<<<<<<<<<<<<< + * result_b[i] = v + * + */ + __pyx_t_31 = __pyx_v_pos; + __pyx_t_32 = __pyx_v_i; + __pyx_t_6 = (((__pyx_v_v + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_deltas.diminfo[0].strides))) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_vals.diminfo[0].strides))) != 0); + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2197 + * # timestamp falls to the right side of the DST transition + * if v + deltas[pos] == vals[i]: + * result_b[i] = v # <<<<<<<<<<<<<< + * + * if infer_dst: + */ + __pyx_t_33 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result_b.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_result_b.diminfo[0].strides) = __pyx_v_v; + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "pandas/tslib.pyx":2199 + * result_b[i] = v + * + * if infer_dst: # <<<<<<<<<<<<<< + * dst_hours = np.empty(n, dtype=np.int64) + * dst_hours.fill(NPY_NAT) + */ + __pyx_t_6 = (__pyx_v_infer_dst != 0); + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2200 + * + * if infer_dst: + * dst_hours = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * dst_hours.fill(NPY_NAT) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_18, __pyx_t_2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = ((PyArrayObject *)__pyx_t_19); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer, (PyObject*)__pyx_v_dst_hours, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12); + } + } + __pyx_pybuffernd_dst_hours.diminfo[0].strides = __pyx_pybuffernd_dst_hours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dst_hours.diminfo[0].shape = __pyx_pybuffernd_dst_hours.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = 0; + __pyx_v_dst_hours = ((PyArrayObject *)__pyx_t_19); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2201 + * if infer_dst: + * dst_hours = np.empty(n, dtype=np.int64) + * dst_hours.fill(NPY_NAT) # <<<<<<<<<<<<<< + * + * # Get the ambiguous hours (given the above, these are the hours + */ + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dst_hours), __pyx_n_s_fill); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2205 + * # Get the ambiguous hours (given the above, these are the hours + * # where result_a != result_b and neither of them are NAT) + * both_nat = np.logical_and(result_a != NPY_NAT, result_b != NPY_NAT) # <<<<<<<<<<<<<< + * both_eq = result_a == result_b + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = PyObject_RichCompare(((PyObject *)__pyx_v_result_a), __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = PyObject_RichCompare(((PyObject *)__pyx_v_result_b), __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_19 = 0; + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_2, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_both_nat = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2206 + * # where result_a != result_b and neither of them are NAT) + * both_nat = np.logical_and(result_a != NPY_NAT, result_b != NPY_NAT) + * both_eq = result_a == result_b # <<<<<<<<<<<<<< + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) + * if trans_idx.size == 1: + */ + __pyx_t_17 = PyObject_RichCompare(((PyObject *)__pyx_v_result_a), ((PyObject *)__pyx_v_result_b), Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_both_eq = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2207 + * both_nat = np.logical_and(result_a != NPY_NAT, result_b != NPY_NAT) + * both_eq = result_a == result_b + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) # <<<<<<<<<<<<<< + * if trans_idx.size == 1: + * stamp = Timestamp(vals[trans_idx]) + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyNumber_Invert(__pyx_v_both_eq); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_both_nat); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_both_nat); + __Pyx_GIVEREF(__pyx_v_both_nat); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_trans_idx = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2208 + * both_eq = result_a == result_b + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) + * if trans_idx.size == 1: # <<<<<<<<<<<<<< + * stamp = Timestamp(vals[trans_idx]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" + */ + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans_idx, __pyx_n_s_size); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_17, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2209 + * trans_idx = np.squeeze(np.nonzero(np.logical_and(both_nat, ~both_eq))) + * if trans_idx.size == 1: + * stamp = Timestamp(vals[trans_idx]) # <<<<<<<<<<<<<< + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" + * "there are no repeated times" % stamp) + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_17 = PyObject_GetItem(((PyObject *)__pyx_v_vals), __pyx_v_trans_idx); if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_stamp = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2210 + * if trans_idx.size == 1: + * stamp = Timestamp(vals[trans_idx]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" # <<<<<<<<<<<<<< + * "there are no repeated times" % stamp) + * # Split the array into contiguous chunks (where the difference between + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2211 + * stamp = Timestamp(vals[trans_idx]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" + * "there are no repeated times" % stamp) # <<<<<<<<<<<<<< + * # Split the array into contiguous chunks (where the difference between + * # indices is 1). These are effectively dst transitions in different years + */ + __pyx_t_17 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_infer_dst_time_from_s_ast, __pyx_v_stamp); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + + /* "pandas/tslib.pyx":2210 + * if trans_idx.size == 1: + * stamp = Timestamp(vals[trans_idx]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %s as" # <<<<<<<<<<<<<< + * "there are no repeated times" % stamp) + * # Split the array into contiguous chunks (where the difference between + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_17, 0, 0, 0); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2216 + * # which is useful for checking that there is not an ambiguous transition + * # in an individual year. + * if trans_idx.size > 0: # <<<<<<<<<<<<<< + * one_diff = np.where(np.diff(trans_idx)!=1)[0]+1 + * trans_grp = np.array_split(trans_idx, one_diff) + */ + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans_idx, __pyx_n_s_size); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_17, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":2217 + * # in an individual year. + * if trans_idx.size > 0: + * one_diff = np.where(np.diff(trans_idx)!=1)[0]+1 # <<<<<<<<<<<<<< + * trans_grp = np.array_split(trans_idx, one_diff) + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_where); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_diff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_trans_idx); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_trans_idx); + __Pyx_GIVEREF(__pyx_v_trans_idx); + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_18, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_v_one_diff = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2218 + * if trans_idx.size > 0: + * one_diff = np.where(np.diff(trans_idx)!=1)[0]+1 + * trans_grp = np.array_split(trans_idx, one_diff) # <<<<<<<<<<<<<< + * + * # Iterate through each day, if there are no hours where the delta is negative + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array_split); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_trans_idx); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_trans_idx); + __Pyx_GIVEREF(__pyx_v_trans_idx); + __Pyx_INCREF(__pyx_v_one_diff); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_one_diff); + __Pyx_GIVEREF(__pyx_v_one_diff); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_trans_grp = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2222 + * # Iterate through each day, if there are no hours where the delta is negative + * # (indicates a repeat of hour) the switch cannot be inferred + * for grp in trans_grp: # <<<<<<<<<<<<<< + * + * delta = np.diff(result_a[grp]) + */ + if (PyList_CheckExact(__pyx_v_trans_grp) || PyTuple_CheckExact(__pyx_v_trans_grp)) { + __pyx_t_17 = __pyx_v_trans_grp; __Pyx_INCREF(__pyx_t_17); __pyx_t_1 = 0; + __pyx_t_34 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_v_trans_grp); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_34 = Py_TYPE(__pyx_t_17)->tp_iternext; + } + for (;;) { + if (!__pyx_t_34 && PyList_CheckExact(__pyx_t_17)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_17)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_17, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_34 && PyTuple_CheckExact(__pyx_t_17)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_17)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_17, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_34(__pyx_t_17); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_grp, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2224 + * for grp in trans_grp: + * + * delta = np.diff(result_a[grp]) # <<<<<<<<<<<<<< + * if grp.size == 1 or np.all(delta>0): + * stamp = Timestamp(vals[grp[0]]) + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_diff); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_result_a), __pyx_v_grp); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2225 + * + * delta = np.diff(result_a[grp]) + * if grp.size == 1 or np.all(delta>0): # <<<<<<<<<<<<<< + * stamp = Timestamp(vals[grp[0]]) + * raise pytz.AmbiguousTimeError(stamp) + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_6) { + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_v_delta, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_t_4; + } else { + __pyx_t_3 = __pyx_t_6; + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2226 + * delta = np.diff(result_a[grp]) + * if grp.size == 1 or np.all(delta>0): + * stamp = Timestamp(vals[grp[0]]) # <<<<<<<<<<<<<< + * raise pytz.AmbiguousTimeError(stamp) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_grp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_vals), __pyx_t_18); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_v_stamp = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2227 + * if grp.size == 1 or np.all(delta>0): + * stamp = Timestamp(vals[grp[0]]) + * raise pytz.AmbiguousTimeError(stamp) # <<<<<<<<<<<<<< + * + * # Find the index for the switch and pull from a for dst and b for standard + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_stamp); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_stamp); + __Pyx_GIVEREF(__pyx_v_stamp); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2230 + * + * # Find the index for the switch and pull from a for dst and b for standard + * switch_idx = (delta<=0).nonzero()[0] # <<<<<<<<<<<<<< + * if switch_idx.size > 1: + * raise pytz.AmbiguousTimeError("There are %i dst switches " + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_delta, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_switch_idx, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":2231 + * # Find the index for the switch and pull from a for dst and b for standard + * switch_idx = (delta<=0).nonzero()[0] + * if switch_idx.size > 1: # <<<<<<<<<<<<<< + * raise pytz.AmbiguousTimeError("There are %i dst switches " + * "when there should only be 1." + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_switch_idx, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2232 + * switch_idx = (delta<=0).nonzero()[0] + * if switch_idx.size > 1: + * raise pytz.AmbiguousTimeError("There are %i dst switches " # <<<<<<<<<<<<<< + * "when there should only be 1." + * % switch_idx.size) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2234 + * raise pytz.AmbiguousTimeError("There are %i dst switches " + * "when there should only be 1." + * % switch_idx.size) # <<<<<<<<<<<<<< + * switch_idx = switch_idx[0]+1 # Pull the only index and adjust + * a_idx = grp[:switch_idx] + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_switch_idx, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_PyString_Format(__pyx_kp_s_There_are_i_dst_switches_when_th, __pyx_t_2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2232 + * switch_idx = (delta<=0).nonzero()[0] + * if switch_idx.size > 1: + * raise pytz.AmbiguousTimeError("There are %i dst switches " # <<<<<<<<<<<<<< + * "when there should only be 1." + * % switch_idx.size) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_18, 0, 0, 0); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2235 + * "when there should only be 1." + * % switch_idx.size) + * switch_idx = switch_idx[0]+1 # Pull the only index and adjust # <<<<<<<<<<<<<< + * a_idx = grp[:switch_idx] + * b_idx = grp[switch_idx:] + */ + __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_switch_idx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_2 = PyNumber_Add(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF_SET(__pyx_v_switch_idx, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2236 + * % switch_idx.size) + * switch_idx = switch_idx[0]+1 # Pull the only index and adjust + * a_idx = grp[:switch_idx] # <<<<<<<<<<<<<< + * b_idx = grp[switch_idx:] + * dst_hours[grp] = np.hstack((result_a[a_idx], result_b[b_idx])) + */ + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_grp, 0, 0, NULL, &__pyx_v_switch_idx, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_a_idx, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2237 + * switch_idx = switch_idx[0]+1 # Pull the only index and adjust + * a_idx = grp[:switch_idx] + * b_idx = grp[switch_idx:] # <<<<<<<<<<<<<< + * dst_hours[grp] = np.hstack((result_a[a_idx], result_b[b_idx])) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_grp, 0, 0, &__pyx_v_switch_idx, NULL, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_b_idx, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2238 + * a_idx = grp[:switch_idx] + * b_idx = grp[switch_idx:] + * dst_hours[grp] = np.hstack((result_a[a_idx], result_b[b_idx])) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hstack); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_result_a), __pyx_v_a_idx); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_result_b), __pyx_v_b_idx); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_2 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_8, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dst_hours), __pyx_v_grp, __pyx_t_19) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + } + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L16; + } + __pyx_L16:; + goto __pyx_L14; + } + __pyx_L14:; + + /* "pandas/tslib.pyx":2240 + * dst_hours[grp] = np.hstack((result_a[a_idx], result_b[b_idx])) + * + * for i in range(n): # <<<<<<<<<<<<<< + * left = result_a[i] + * right = result_b[i] + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + + /* "pandas/tslib.pyx":2241 + * + * for i in range(n): + * left = result_a[i] # <<<<<<<<<<<<<< + * right = result_b[i] + * if vals[i] == NPY_NAT: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_v_left = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result_a.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result_a.diminfo[0].strides)); + + /* "pandas/tslib.pyx":2242 + * for i in range(n): + * left = result_a[i] + * right = result_b[i] # <<<<<<<<<<<<<< + * if vals[i] == NPY_NAT: + * result[i] = vals[i] + */ + __pyx_t_36 = __pyx_v_i; + __pyx_v_right = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result_b.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result_b.diminfo[0].strides)); + + /* "pandas/tslib.pyx":2243 + * left = result_a[i] + * right = result_b[i] + * if vals[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = vals[i] + * elif left != NPY_NAT and right != NPY_NAT: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_3 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_vals.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2244 + * right = result_b[i] + * if vals[i] == NPY_NAT: + * result[i] = vals[i] # <<<<<<<<<<<<<< + * elif left != NPY_NAT and right != NPY_NAT: + * if left == right: + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_vals.diminfo[0].strides)); + goto __pyx_L23; + } + + /* "pandas/tslib.pyx":2245 + * if vals[i] == NPY_NAT: + * result[i] = vals[i] + * elif left != NPY_NAT and right != NPY_NAT: # <<<<<<<<<<<<<< + * if left == right: + * result[i] = left + */ + __pyx_t_3 = ((__pyx_v_left != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + __pyx_t_6 = ((__pyx_v_right != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + __pyx_t_4 = __pyx_t_6; + } else { + __pyx_t_4 = __pyx_t_3; + } + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2246 + * result[i] = vals[i] + * elif left != NPY_NAT and right != NPY_NAT: + * if left == right: # <<<<<<<<<<<<<< + * result[i] = left + * else: + */ + __pyx_t_4 = ((__pyx_v_left == __pyx_v_right) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2247 + * elif left != NPY_NAT and right != NPY_NAT: + * if left == right: + * result[i] = left # <<<<<<<<<<<<<< + * else: + * if infer_dst and dst_hours[i] != NPY_NAT: + */ + __pyx_t_40 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_left; + goto __pyx_L24; + } + /*else*/ { + + /* "pandas/tslib.pyx":2249 + * result[i] = left + * else: + * if infer_dst and dst_hours[i] != NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = dst_hours[i] + * else: + */ + if ((__pyx_v_infer_dst != 0)) { + __pyx_t_41 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dst_hours.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_dst_hours.diminfo[0].strides)) != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + __pyx_t_3 = __pyx_t_4; + } else { + __pyx_t_3 = (__pyx_v_infer_dst != 0); + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2250 + * else: + * if infer_dst and dst_hours[i] != NPY_NAT: + * result[i] = dst_hours[i] # <<<<<<<<<<<<<< + * else: + * stamp = Timestamp(vals[i]) + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_43 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dst_hours.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_dst_hours.diminfo[0].strides)); + goto __pyx_L25; + } + /*else*/ { + + /* "pandas/tslib.pyx":2252 + * result[i] = dst_hours[i] + * else: + * stamp = Timestamp(vals[i]) # <<<<<<<<<<<<<< + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %r, "\ + * "try using the 'infer_dst' argument" + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_44 = __pyx_v_i; + __pyx_t_19 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_vals.diminfo[0].strides))); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_8, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_stamp = __pyx_t_19; + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2253 + * else: + * stamp = Timestamp(vals[i]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %r, "\ # <<<<<<<<<<<<<< + * "try using the 'infer_dst' argument" + * % stamp) + */ + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2255 + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %r, "\ + * "try using the 'infer_dst' argument" + * % stamp) # <<<<<<<<<<<<<< + * elif left != NPY_NAT: + * result[i] = left + */ + __pyx_t_19 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_infer_dst_time_from_r_try, __pyx_v_stamp); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + + /* "pandas/tslib.pyx":2253 + * else: + * stamp = Timestamp(vals[i]) + * raise pytz.AmbiguousTimeError("Cannot infer dst time from %r, "\ # <<<<<<<<<<<<<< + * "try using the 'infer_dst' argument" + * % stamp) + */ + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_17, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_Raise(__pyx_t_19, 0, 0, 0); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L25:; + } + __pyx_L24:; + goto __pyx_L23; + } + + /* "pandas/tslib.pyx":2256 + * "try using the 'infer_dst' argument" + * % stamp) + * elif left != NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = left + * elif right != NPY_NAT: + */ + __pyx_t_3 = ((__pyx_v_left != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2257 + * % stamp) + * elif left != NPY_NAT: + * result[i] = left # <<<<<<<<<<<<<< + * elif right != NPY_NAT: + * result[i] = right + */ + __pyx_t_45 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_left; + goto __pyx_L23; + } + + /* "pandas/tslib.pyx":2258 + * elif left != NPY_NAT: + * result[i] = left + * elif right != NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = right + * else: + */ + __pyx_t_3 = ((__pyx_v_right != __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2259 + * result[i] = left + * elif right != NPY_NAT: + * result[i] = right # <<<<<<<<<<<<<< + * else: + * stamp = Timestamp(vals[i]) + */ + __pyx_t_46 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_right; + goto __pyx_L23; + } + /*else*/ { + + /* "pandas/tslib.pyx":2261 + * result[i] = right + * else: + * stamp = Timestamp(vals[i]) # <<<<<<<<<<<<<< + * raise pytz.NonExistentTimeError(stamp) + * + */ + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_47 = __pyx_v_i; + __pyx_t_17 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_vals.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_vals.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_stamp = __pyx_t_17; + __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":2262 + * else: + * stamp = Timestamp(vals[i]) + * raise pytz.NonExistentTimeError(stamp) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_NonExistentTimeError); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_INCREF(__pyx_v_stamp); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_stamp); + __Pyx_GIVEREF(__pyx_v_stamp); + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_17, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_Raise(__pyx_t_19, 0, 0, 0); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L23:; + } + + /* "pandas/tslib.pyx":2264 + * raise pytz.NonExistentTimeError(stamp) + * + * return result # <<<<<<<<<<<<<< + * + * cdef _ensure_int64(object arr): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2127 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Localize tzinfo-naive DateRange to given time zone (using pytz). If + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vals.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.tz_localize_to_utc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dst_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_idx_shifted.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_a.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result_b.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_vals.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF((PyObject *)__pyx_v_idx_shifted); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_result_a); + __Pyx_XDECREF((PyObject *)__pyx_v_result_b); + __Pyx_XDECREF((PyObject *)__pyx_v_dst_hours); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v_both_nat); + __Pyx_XDECREF(__pyx_v_both_eq); + __Pyx_XDECREF(__pyx_v_trans_idx); + __Pyx_XDECREF(__pyx_v_stamp); + __Pyx_XDECREF(__pyx_v_one_diff); + __Pyx_XDECREF(__pyx_v_trans_grp); + __Pyx_XDECREF(__pyx_v_grp); + __Pyx_XDECREF(__pyx_v_switch_idx); + __Pyx_XDECREF(__pyx_v_a_idx); + __Pyx_XDECREF(__pyx_v_b_idx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2266 + * return result + * + * cdef _ensure_int64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + */ + +static PyObject *__pyx_f_6pandas_5tslib__ensure_int64(PyObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_ensure_int64", 0); + + /* "pandas/tslib.pyx":2267 + * + * cdef _ensure_int64(object arr): + * if util.is_array(arr): # <<<<<<<<<<<<<< + * if ( arr).descr.type_num == NPY_INT64: + * return arr + */ + __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2268 + * cdef _ensure_int64(object arr): + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: # <<<<<<<<<<<<<< + * return arr + * else: + */ + __pyx_t_2 = ((((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT64) != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2269 + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + * return arr # <<<<<<<<<<<<<< + * else: + * return arr.astype(np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_arr); + __pyx_r = __pyx_v_arr; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2271 + * return arr + * else: + * return arr.astype(np.int64) # <<<<<<<<<<<<<< + * else: + * return np.array(arr, dtype=np.int64) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + } + /*else*/ { + + /* "pandas/tslib.pyx":2273 + * return arr.astype(np.int64) + * else: + * return np.array(arr, dtype=np.int64) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2266 + * return result + * + * cdef _ensure_int64(object arr): # <<<<<<<<<<<<<< + * if util.is_array(arr): + * if ( arr).descr.type_num == NPY_INT64: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib._ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2276 + * + * + * cdef inline bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n): # <<<<<<<<<<<<<< + * cdef Py_ssize_t pivot, left = 0, right = n + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6pandas_5tslib_bisect_right_i8(__pyx_t_5numpy_int64_t *__pyx_v_data, __pyx_t_5numpy_int64_t __pyx_v_val, Py_ssize_t __pyx_v_n) { + Py_ssize_t __pyx_v_pivot; + Py_ssize_t __pyx_v_left; + Py_ssize_t __pyx_v_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("bisect_right_i8", 0); + + /* "pandas/tslib.pyx":2277 + * + * cdef inline bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n): + * cdef Py_ssize_t pivot, left = 0, right = n # <<<<<<<<<<<<<< + * + * # edge cases + */ + __pyx_v_left = 0; + __pyx_v_right = __pyx_v_n; + + /* "pandas/tslib.pyx":2280 + * + * # edge cases + * if val > data[n - 1]: # <<<<<<<<<<<<<< + * return n + * + */ + __pyx_t_1 = ((__pyx_v_val > (__pyx_v_data[(__pyx_v_n - 1)])) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2281 + * # edge cases + * if val > data[n - 1]: + * return n # <<<<<<<<<<<<<< + * + * if val < data[0]: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2283 + * return n + * + * if val < data[0]: # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_1 = ((__pyx_v_val < (__pyx_v_data[0])) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2284 + * + * if val < data[0]: + * return 0 # <<<<<<<<<<<<<< + * + * while left < right: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_0); + __pyx_r = __pyx_int_0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2286 + * return 0 + * + * while left < right: # <<<<<<<<<<<<<< + * pivot = left + (right - left) // 2 + * + */ + while (1) { + __pyx_t_1 = ((__pyx_v_left < __pyx_v_right) != 0); + if (!__pyx_t_1) break; + + /* "pandas/tslib.pyx":2287 + * + * while left < right: + * pivot = left + (right - left) // 2 # <<<<<<<<<<<<<< + * + * if data[pivot] <= val: + */ + __pyx_v_pivot = (__pyx_v_left + __Pyx_div_Py_ssize_t((__pyx_v_right - __pyx_v_left), 2)); + + /* "pandas/tslib.pyx":2289 + * pivot = left + (right - left) // 2 + * + * if data[pivot] <= val: # <<<<<<<<<<<<<< + * left = pivot + 1 + * else: + */ + __pyx_t_1 = (((__pyx_v_data[__pyx_v_pivot]) <= __pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2290 + * + * if data[pivot] <= val: + * left = pivot + 1 # <<<<<<<<<<<<<< + * else: + * right = pivot + */ + __pyx_v_left = (__pyx_v_pivot + 1); + goto __pyx_L7; + } + /*else*/ { + + /* "pandas/tslib.pyx":2292 + * left = pivot + 1 + * else: + * right = pivot # <<<<<<<<<<<<<< + * + * return left + */ + __pyx_v_right = __pyx_v_pivot; + } + __pyx_L7:; + } + + /* "pandas/tslib.pyx":2294 + * right = pivot + * + * return left # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_left); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2276 + * + * + * cdef inline bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n): # <<<<<<<<<<<<<< + * cdef Py_ssize_t pivot, left = 0, right = n + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.bisect_right_i8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2300 + * #---------------------------------------------------------------------- + * + * def build_field_sarray(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_57build_field_sarray(PyObject *__pyx_self, PyObject *__pyx_v_dtindex); /*proto*/ +static char __pyx_doc_6pandas_5tslib_56build_field_sarray[] = "\n Datetime as int64 representation to a structured array of fields\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_57build_field_sarray = {__Pyx_NAMESTR("build_field_sarray"), (PyCFunction)__pyx_pw_6pandas_5tslib_57build_field_sarray, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_56build_field_sarray)}; +static PyObject *__pyx_pw_6pandas_5tslib_57build_field_sarray(PyObject *__pyx_self, PyObject *__pyx_v_dtindex) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("build_field_sarray (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_56build_field_sarray(__pyx_self, ((PyArrayObject *)__pyx_v_dtindex)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_56build_field_sarray(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_count; + pandas_datetimestruct __pyx_v_dts; + PyArrayObject *__pyx_v_years = 0; + PyArrayObject *__pyx_v_months = 0; + PyArrayObject *__pyx_v_days = 0; + PyArrayObject *__pyx_v_hours = 0; + PyArrayObject *__pyx_v_minutes = 0; + PyArrayObject *__pyx_v_seconds = 0; + PyArrayObject *__pyx_v_mus = 0; + PyObject *__pyx_v_sa_dtype = NULL; + PyObject *__pyx_v_out = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_days; + __Pyx_Buffer __pyx_pybuffer_days; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtindex; + __Pyx_Buffer __pyx_pybuffer_dtindex; + __Pyx_LocalBuf_ND __pyx_pybuffernd_hours; + __Pyx_Buffer __pyx_pybuffer_hours; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minutes; + __Pyx_Buffer __pyx_pybuffer_minutes; + __Pyx_LocalBuf_ND __pyx_pybuffernd_months; + __Pyx_Buffer __pyx_pybuffer_months; + __Pyx_LocalBuf_ND __pyx_pybuffernd_mus; + __Pyx_Buffer __pyx_pybuffer_mus; + __Pyx_LocalBuf_ND __pyx_pybuffernd_seconds; + __Pyx_Buffer __pyx_pybuffer_seconds; + __Pyx_LocalBuf_ND __pyx_pybuffernd_years; + __Pyx_Buffer __pyx_pybuffer_years; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + npy_int64 __pyx_t_13; + Py_ssize_t __pyx_t_14; + npy_int32 __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("build_field_sarray", 0); + __pyx_pybuffer_years.pybuffer.buf = NULL; + __pyx_pybuffer_years.refcount = 0; + __pyx_pybuffernd_years.data = NULL; + __pyx_pybuffernd_years.rcbuffer = &__pyx_pybuffer_years; + __pyx_pybuffer_months.pybuffer.buf = NULL; + __pyx_pybuffer_months.refcount = 0; + __pyx_pybuffernd_months.data = NULL; + __pyx_pybuffernd_months.rcbuffer = &__pyx_pybuffer_months; + __pyx_pybuffer_days.pybuffer.buf = NULL; + __pyx_pybuffer_days.refcount = 0; + __pyx_pybuffernd_days.data = NULL; + __pyx_pybuffernd_days.rcbuffer = &__pyx_pybuffer_days; + __pyx_pybuffer_hours.pybuffer.buf = NULL; + __pyx_pybuffer_hours.refcount = 0; + __pyx_pybuffernd_hours.data = NULL; + __pyx_pybuffernd_hours.rcbuffer = &__pyx_pybuffer_hours; + __pyx_pybuffer_minutes.pybuffer.buf = NULL; + __pyx_pybuffer_minutes.refcount = 0; + __pyx_pybuffernd_minutes.data = NULL; + __pyx_pybuffernd_minutes.rcbuffer = &__pyx_pybuffer_minutes; + __pyx_pybuffer_seconds.pybuffer.buf = NULL; + __pyx_pybuffer_seconds.refcount = 0; + __pyx_pybuffernd_seconds.data = NULL; + __pyx_pybuffernd_seconds.rcbuffer = &__pyx_pybuffer_seconds; + __pyx_pybuffer_mus.pybuffer.buf = NULL; + __pyx_pybuffer_mus.refcount = 0; + __pyx_pybuffernd_mus.data = NULL; + __pyx_pybuffernd_mus.rcbuffer = &__pyx_pybuffer_mus; + __pyx_pybuffer_dtindex.pybuffer.buf = NULL; + __pyx_pybuffer_dtindex.refcount = 0; + __pyx_pybuffernd_dtindex.data = NULL; + __pyx_pybuffernd_dtindex.rcbuffer = &__pyx_pybuffer_dtindex; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtindex.diminfo[0].strides = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtindex.diminfo[0].shape = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2305 + * ''' + * cdef: + * Py_ssize_t i, count = 0 # <<<<<<<<<<<<<< + * int isleap + * pandas_datetimestruct dts + */ + __pyx_v_count = 0; + + /* "pandas/tslib.pyx":2310 + * ndarray[int32_t] years, months, days, hours, minutes, seconds, mus + * + * count = len(dtindex) # <<<<<<<<<<<<<< + * + * sa_dtype = [('Y', 'i4'), # year + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_count = __pyx_t_1; + + /* "pandas/tslib.pyx":2312 + * count = len(dtindex) + * + * sa_dtype = [('Y', 'i4'), # year # <<<<<<<<<<<<<< + * ('M', 'i4'), # month + * ('D', 'i4'), # day + */ + __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_tuple__67); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __Pyx_INCREF(__pyx_tuple__68); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __Pyx_INCREF(__pyx_tuple__69); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __Pyx_INCREF(__pyx_tuple__70); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + __Pyx_INCREF(__pyx_tuple__71); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __Pyx_INCREF(__pyx_tuple__72); + PyList_SET_ITEM(__pyx_t_2, 5, __pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + __Pyx_INCREF(__pyx_tuple__73); + PyList_SET_ITEM(__pyx_t_2, 6, __pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_v_sa_dtype = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2320 + * ('u', 'i4')] # microsecond + * + * out = np.empty(count, dtype=sa_dtype) # <<<<<<<<<<<<<< + * + * years = out['Y'] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_sa_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_out = __pyx_t_5; + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2322 + * out = np.empty(count, dtype=sa_dtype) + * + * years = out['Y'] # <<<<<<<<<<<<<< + * months = out['M'] + * days = out['D'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_Y); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_years.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_years.rcbuffer->pybuffer, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_years.diminfo[0].strides = __pyx_pybuffernd_years.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_years.diminfo[0].shape = __pyx_pybuffernd_years.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_years = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2323 + * + * years = out['Y'] + * months = out['M'] # <<<<<<<<<<<<<< + * days = out['D'] + * hours = out['h'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_M); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_months.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_months.rcbuffer->pybuffer, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_months.diminfo[0].strides = __pyx_pybuffernd_months.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_months.diminfo[0].shape = __pyx_pybuffernd_months.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_months = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2324 + * years = out['Y'] + * months = out['M'] + * days = out['D'] # <<<<<<<<<<<<<< + * hours = out['h'] + * minutes = out['m'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_D); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_days.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_days.rcbuffer->pybuffer, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_days.diminfo[0].strides = __pyx_pybuffernd_days.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_days.diminfo[0].shape = __pyx_pybuffernd_days.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_days = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2325 + * months = out['M'] + * days = out['D'] + * hours = out['h'] # <<<<<<<<<<<<<< + * minutes = out['m'] + * seconds = out['s'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_h); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hours.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hours.rcbuffer->pybuffer, (PyObject*)__pyx_v_hours, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_hours.diminfo[0].strides = __pyx_pybuffernd_hours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hours.diminfo[0].shape = __pyx_pybuffernd_hours.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_hours = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2326 + * days = out['D'] + * hours = out['h'] + * minutes = out['m'] # <<<<<<<<<<<<<< + * seconds = out['s'] + * mus = out['u'] + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_m); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer, (PyObject*)__pyx_v_minutes, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_minutes.diminfo[0].strides = __pyx_pybuffernd_minutes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minutes.diminfo[0].shape = __pyx_pybuffernd_minutes.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_minutes = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2327 + * hours = out['h'] + * minutes = out['m'] + * seconds = out['s'] # <<<<<<<<<<<<<< + * mus = out['u'] + * + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_s); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer, (PyObject*)__pyx_v_seconds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_seconds.diminfo[0].strides = __pyx_pybuffernd_seconds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_seconds.diminfo[0].shape = __pyx_pybuffernd_seconds.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_seconds = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2328 + * minutes = out['m'] + * seconds = out['s'] + * mus = out['u'] # <<<<<<<<<<<<<< + * + * for i in range(count): + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_out, __pyx_n_s_u); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mus.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mus.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mus.rcbuffer->pybuffer, (PyObject*)__pyx_v_mus, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_mus.diminfo[0].strides = __pyx_pybuffernd_mus.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mus.diminfo[0].shape = __pyx_pybuffernd_mus.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_mus = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2330 + * mus = out['u'] + * + * for i in range(count): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * years[i] = dts.year + */ + __pyx_t_1 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2331 + * + * for i in range(count): + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * years[i] = dts.year + * months[i] = dts.month + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_dtindex.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2332 + * for i in range(count): + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * years[i] = dts.year # <<<<<<<<<<<<<< + * months[i] = dts.month + * days[i] = dts.day + */ + __pyx_t_13 = __pyx_v_dts.year; + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_years.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_years.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_years.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_years.diminfo[0].strides) = __pyx_t_13; + + /* "pandas/tslib.pyx":2333 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * years[i] = dts.year + * months[i] = dts.month # <<<<<<<<<<<<<< + * days[i] = dts.day + * hours[i] = dts.hour + */ + __pyx_t_15 = __pyx_v_dts.month; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_months.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_months.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_months.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_months.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2334 + * years[i] = dts.year + * months[i] = dts.month + * days[i] = dts.day # <<<<<<<<<<<<<< + * hours[i] = dts.hour + * minutes[i] = dts.min + */ + __pyx_t_15 = __pyx_v_dts.day; + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_days.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_days.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_days.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_days.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2335 + * months[i] = dts.month + * days[i] = dts.day + * hours[i] = dts.hour # <<<<<<<<<<<<<< + * minutes[i] = dts.min + * seconds[i] = dts.sec + */ + __pyx_t_15 = __pyx_v_dts.hour; + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_hours.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_hours.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_hours.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_hours.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2336 + * days[i] = dts.day + * hours[i] = dts.hour + * minutes[i] = dts.min # <<<<<<<<<<<<<< + * seconds[i] = dts.sec + * mus[i] = dts.us + */ + __pyx_t_15 = __pyx_v_dts.min; + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_minutes.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_minutes.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_minutes.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_minutes.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2337 + * hours[i] = dts.hour + * minutes[i] = dts.min + * seconds[i] = dts.sec # <<<<<<<<<<<<<< + * mus[i] = dts.us + * + */ + __pyx_t_15 = __pyx_v_dts.sec; + __pyx_t_20 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_seconds.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_seconds.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_seconds.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_seconds.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":2338 + * minutes[i] = dts.min + * seconds[i] = dts.sec + * mus[i] = dts.us # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_15 = __pyx_v_dts.us; + __pyx_t_21 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_mus.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_mus.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_mus.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_mus.diminfo[0].strides) = __pyx_t_15; + } + + /* "pandas/tslib.pyx":2340 + * mus[i] = dts.us + * + * return out # <<<<<<<<<<<<<< + * + * def get_time_micros(ndarray[int64_t] dtindex): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_out); + __pyx_r = __pyx_v_out; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2300 + * #---------------------------------------------------------------------- + * + * def build_field_sarray(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mus.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.build_field_sarray", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_days.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hours.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minutes.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_months.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mus.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_seconds.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_years.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_years); + __Pyx_XDECREF((PyObject *)__pyx_v_months); + __Pyx_XDECREF((PyObject *)__pyx_v_days); + __Pyx_XDECREF((PyObject *)__pyx_v_hours); + __Pyx_XDECREF((PyObject *)__pyx_v_minutes); + __Pyx_XDECREF((PyObject *)__pyx_v_seconds); + __Pyx_XDECREF((PyObject *)__pyx_v_mus); + __Pyx_XDECREF(__pyx_v_sa_dtype); + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2342 + * return out + * + * def get_time_micros(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_59get_time_micros(PyObject *__pyx_self, PyObject *__pyx_v_dtindex); /*proto*/ +static char __pyx_doc_6pandas_5tslib_58get_time_micros[] = "\n Datetime as int64 representation to a structured array of fields\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_59get_time_micros = {__Pyx_NAMESTR("get_time_micros"), (PyCFunction)__pyx_pw_6pandas_5tslib_59get_time_micros, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_58get_time_micros)}; +static PyObject *__pyx_pw_6pandas_5tslib_59get_time_micros(PyObject *__pyx_self, PyObject *__pyx_v_dtindex) { + CYTHON_UNUSED int __pyx_lineno = 0; + CYTHON_UNUSED const char *__pyx_filename = NULL; + CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_time_micros (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_58get_time_micros(__pyx_self, ((PyArrayObject *)__pyx_v_dtindex)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_58get_time_micros(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + PyArrayObject *__pyx_v_micros = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtindex; + __Pyx_Buffer __pyx_pybuffer_dtindex; + __Pyx_LocalBuf_ND __pyx_pybuffernd_micros; + __Pyx_Buffer __pyx_pybuffer_micros; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_time_micros", 0); + __pyx_pybuffer_micros.pybuffer.buf = NULL; + __pyx_pybuffer_micros.refcount = 0; + __pyx_pybuffernd_micros.data = NULL; + __pyx_pybuffernd_micros.rcbuffer = &__pyx_pybuffer_micros; + __pyx_pybuffer_dtindex.pybuffer.buf = NULL; + __pyx_pybuffer_dtindex.refcount = 0; + __pyx_pybuffernd_dtindex.data = NULL; + __pyx_pybuffernd_dtindex.rcbuffer = &__pyx_pybuffer_dtindex; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtindex.diminfo[0].strides = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtindex.diminfo[0].shape = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2347 + * ''' + * cdef: + * Py_ssize_t i, n = len(dtindex) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * ndarray[int64_t] micros + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2351 + * ndarray[int64_t] micros + * + * micros = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_micros.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_micros.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_micros.rcbuffer->pybuffer, (PyObject*)__pyx_v_micros, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_micros.diminfo[0].strides = __pyx_pybuffernd_micros.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_micros.diminfo[0].shape = __pyx_pybuffernd_micros.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_micros = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2353 + * micros = np.empty(n, dtype=np.int64) + * + * for i in range(n): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * micros[i] = 1000000LL * (dts.hour * 60 * 60 + + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "pandas/tslib.pyx":2354 + * + * for i in range(n): + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * micros[i] = 1000000LL * (dts.hour * 60 * 60 + + * 60 * dts.min + dts.sec) + dts.us + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_dtindex.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2355 + * for i in range(n): + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * micros[i] = 1000000LL * (dts.hour * 60 * 60 + # <<<<<<<<<<<<<< + * 60 * dts.min + dts.sec) + dts.us + * + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_micros.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_micros.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_micros.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_micros.diminfo[0].strides) = ((1000000LL * ((((__pyx_v_dts.hour * 60) * 60) + (60 * __pyx_v_dts.min)) + __pyx_v_dts.sec)) + __pyx_v_dts.us); + } + + /* "pandas/tslib.pyx":2358 + * 60 * dts.min + dts.sec) + dts.us + * + * return micros # <<<<<<<<<<<<<< + * + * @cython.wraparound(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_micros)); + __pyx_r = ((PyObject *)__pyx_v_micros); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2342 + * return out + * + * def get_time_micros(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_micros.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.get_time_micros", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_micros.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_micros); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2361 + * + * @cython.wraparound(False) + * def get_date_field(ndarray[int64_t] dtindex, object field): # <<<<<<<<<<<<<< + * ''' + * Given a int64-based datetime index, extract the year, month, etc., + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_61get_date_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_60get_date_field[] = "\n Given a int64-based datetime index, extract the year, month, etc.,\n field and return an array of these values.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_61get_date_field = {__Pyx_NAMESTR("get_date_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_61get_date_field, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_60get_date_field)}; +static PyObject *__pyx_pw_6pandas_5tslib_61get_date_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_dtindex = 0; + PyObject *__pyx_v_field = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_date_field (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtindex,&__pyx_n_s_field,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtindex)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_date_field", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_date_field") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_dtindex = ((PyArrayObject *)values[0]); + __pyx_v_field = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_date_field", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_date_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_60get_date_field(__pyx_self, __pyx_v_dtindex, __pyx_v_field); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_60get_date_field(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex, PyObject *__pyx_v_field) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_count; + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v__month_offset = 0; + int __pyx_v_isleap; + int __pyx_v_isleap_prev; + pandas_datetimestruct __pyx_v_dts; + int __pyx_v_mo_off; + int __pyx_v_doy; + int __pyx_v_dow; + int __pyx_v_woy; + __Pyx_LocalBuf_ND __pyx_pybuffernd__month_offset; + __Pyx_Buffer __pyx_pybuffer__month_offset; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtindex; + __Pyx_Buffer __pyx_pybuffer_dtindex; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + npy_int64 __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + npy_int32 __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + Py_ssize_t __pyx_t_47; + Py_ssize_t __pyx_t_48; + Py_ssize_t __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + long __pyx_t_52; + int __pyx_t_53; + Py_ssize_t __pyx_t_54; + Py_ssize_t __pyx_t_55; + Py_ssize_t __pyx_t_56; + Py_ssize_t __pyx_t_57; + Py_ssize_t __pyx_t_58; + Py_ssize_t __pyx_t_59; + Py_ssize_t __pyx_t_60; + Py_ssize_t __pyx_t_61; + Py_ssize_t __pyx_t_62; + long __pyx_t_63; + int __pyx_t_64; + int __pyx_t_65; + int __pyx_t_66; + Py_ssize_t __pyx_t_67; + Py_ssize_t __pyx_t_68; + Py_ssize_t __pyx_t_69; + Py_ssize_t __pyx_t_70; + Py_ssize_t __pyx_t_71; + Py_ssize_t __pyx_t_72; + Py_ssize_t __pyx_t_73; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_date_field", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer__month_offset.pybuffer.buf = NULL; + __pyx_pybuffer__month_offset.refcount = 0; + __pyx_pybuffernd__month_offset.data = NULL; + __pyx_pybuffernd__month_offset.rcbuffer = &__pyx_pybuffer__month_offset; + __pyx_pybuffer_dtindex.pybuffer.buf = NULL; + __pyx_pybuffer_dtindex.refcount = 0; + __pyx_pybuffernd_dtindex.data = NULL; + __pyx_pybuffernd_dtindex.rcbuffer = &__pyx_pybuffer_dtindex; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtindex.diminfo[0].strides = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtindex.diminfo[0].shape = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2368 + * cdef: + * _TSObject ts + * Py_ssize_t i, count = 0 # <<<<<<<<<<<<<< + * ndarray[int32_t] out + * ndarray[int32_t, ndim=2] _month_offset + */ + __pyx_v_count = 0; + + /* "pandas/tslib.pyx":2375 + * int mo_off, doy, dow, woy + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2376 + * + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], # <<<<<<<<<<<<<< + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) + */ + __pyx_t_1 = PyList_New(13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_31); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_31); + __Pyx_GIVEREF(__pyx_int_31); + __Pyx_INCREF(__pyx_int_59); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_59); + __Pyx_GIVEREF(__pyx_int_59); + __Pyx_INCREF(__pyx_int_90); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_90); + __Pyx_GIVEREF(__pyx_int_90); + __Pyx_INCREF(__pyx_int_120); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_120); + __Pyx_GIVEREF(__pyx_int_120); + __Pyx_INCREF(__pyx_int_151); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_151); + __Pyx_GIVEREF(__pyx_int_151); + __Pyx_INCREF(__pyx_int_181); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_181); + __Pyx_GIVEREF(__pyx_int_181); + __Pyx_INCREF(__pyx_int_212); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_212); + __Pyx_GIVEREF(__pyx_int_212); + __Pyx_INCREF(__pyx_int_243); + PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_243); + __Pyx_GIVEREF(__pyx_int_243); + __Pyx_INCREF(__pyx_int_273); + PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_273); + __Pyx_GIVEREF(__pyx_int_273); + __Pyx_INCREF(__pyx_int_304); + PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_304); + __Pyx_GIVEREF(__pyx_int_304); + __Pyx_INCREF(__pyx_int_334); + PyList_SET_ITEM(__pyx_t_1, 11, __pyx_int_334); + __Pyx_GIVEREF(__pyx_int_334); + __Pyx_INCREF(__pyx_int_365); + PyList_SET_ITEM(__pyx_t_1, 12, __pyx_int_365); + __Pyx_GIVEREF(__pyx_int_365); + + /* "pandas/tslib.pyx":2377 + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], # <<<<<<<<<<<<<< + * dtype=np.int32 ) + * + */ + __pyx_t_3 = PyList_New(13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_31); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_31); + __Pyx_GIVEREF(__pyx_int_31); + __Pyx_INCREF(__pyx_int_60); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_60); + __Pyx_GIVEREF(__pyx_int_60); + __Pyx_INCREF(__pyx_int_91); + PyList_SET_ITEM(__pyx_t_3, 3, __pyx_int_91); + __Pyx_GIVEREF(__pyx_int_91); + __Pyx_INCREF(__pyx_int_121); + PyList_SET_ITEM(__pyx_t_3, 4, __pyx_int_121); + __Pyx_GIVEREF(__pyx_int_121); + __Pyx_INCREF(__pyx_int_152); + PyList_SET_ITEM(__pyx_t_3, 5, __pyx_int_152); + __Pyx_GIVEREF(__pyx_int_152); + __Pyx_INCREF(__pyx_int_182); + PyList_SET_ITEM(__pyx_t_3, 6, __pyx_int_182); + __Pyx_GIVEREF(__pyx_int_182); + __Pyx_INCREF(__pyx_int_213); + PyList_SET_ITEM(__pyx_t_3, 7, __pyx_int_213); + __Pyx_GIVEREF(__pyx_int_213); + __Pyx_INCREF(__pyx_int_244); + PyList_SET_ITEM(__pyx_t_3, 8, __pyx_int_244); + __Pyx_GIVEREF(__pyx_int_244); + __Pyx_INCREF(__pyx_int_274); + PyList_SET_ITEM(__pyx_t_3, 9, __pyx_int_274); + __Pyx_GIVEREF(__pyx_int_274); + __Pyx_INCREF(__pyx_int_305); + PyList_SET_ITEM(__pyx_t_3, 10, __pyx_int_305); + __Pyx_GIVEREF(__pyx_int_305); + __Pyx_INCREF(__pyx_int_335); + PyList_SET_ITEM(__pyx_t_3, 11, __pyx_int_335); + __Pyx_GIVEREF(__pyx_int_335); + __Pyx_INCREF(__pyx_int_366); + PyList_SET_ITEM(__pyx_t_3, 12, __pyx_int_366); + __Pyx_GIVEREF(__pyx_int_366); + + /* "pandas/tslib.pyx":2376 + * + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], # <<<<<<<<<<<<<< + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) + */ + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":2375 + * int mo_off, doy, dow, woy + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":2378 + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) # <<<<<<<<<<<<<< + * + * count = len(dtindex) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2375 + * int mo_off, doy, dow, woy + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer, (PyObject*)__pyx_v__month_offset, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd__month_offset.diminfo[0].strides = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__month_offset.diminfo[0].shape = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd__month_offset.diminfo[1].strides = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd__month_offset.diminfo[1].shape = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v__month_offset = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2380 + * dtype=np.int32 ) + * + * count = len(dtindex) # <<<<<<<<<<<<<< + * out = np.empty(count, dtype='i4') + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_count = __pyx_t_11; + + /* "pandas/tslib.pyx":2381 + * + * count = len(dtindex) + * out = np.empty(count, dtype='i4') # <<<<<<<<<<<<<< + * + * if field == 'Y': + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2383 + * out = np.empty(count, dtype='i4') + * + * if field == 'Y': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_Y, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2384 + * + * if field == 'Y': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2385 + * if field == 'Y': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":2387 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.year + * return out + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2388 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.year # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_18 = __pyx_v_dts.year; + __pyx_t_19 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_18; + __pyx_L4_continue:; + } + + /* "pandas/tslib.pyx":2389 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.year + * return out # <<<<<<<<<<<<<< + * + * elif field == 'M': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2391 + * return out + * + * elif field == 'M': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_M, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2392 + * + * elif field == 'M': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2393 + * elif field == 'M': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_21 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L7_continue; + } + + /* "pandas/tslib.pyx":2395 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.month + * return out + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2396 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.month # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.month; + __pyx_t_24 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L7_continue:; + } + + /* "pandas/tslib.pyx":2397 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.month + * return out # <<<<<<<<<<<<<< + * + * elif field == 'D': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2399 + * return out + * + * elif field == 'D': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2400 + * + * elif field == 'D': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2401 + * elif field == 'D': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_26 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L10_continue; + } + + /* "pandas/tslib.pyx":2403 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.day + * return out + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2404 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.day # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.day; + __pyx_t_28 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L10_continue:; + } + + /* "pandas/tslib.pyx":2405 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.day + * return out # <<<<<<<<<<<<<< + * + * elif field == 'h': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2407 + * return out + * + * elif field == 'h': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_h, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2408 + * + * elif field == 'h': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2409 + * elif field == 'h': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_30 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L13_continue; + } + + /* "pandas/tslib.pyx":2411 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.hour + * return out + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2412 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.hour # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.hour; + __pyx_t_32 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L13_continue:; + } + + /* "pandas/tslib.pyx":2413 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.hour + * return out # <<<<<<<<<<<<<< + * + * elif field == 'm': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2415 + * return out + * + * elif field == 'm': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_m, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2416 + * + * elif field == 'm': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2417 + * elif field == 'm': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_34 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L16_continue; + } + + /* "pandas/tslib.pyx":2419 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.min + * return out + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2420 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.min # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.min; + __pyx_t_36 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L16_continue:; + } + + /* "pandas/tslib.pyx":2421 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.min + * return out # <<<<<<<<<<<<<< + * + * elif field == 's': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2423 + * return out + * + * elif field == 's': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_s, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2424 + * + * elif field == 's': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2425 + * elif field == 's': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_38 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L19_continue; + } + + /* "pandas/tslib.pyx":2427 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.sec + * return out + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_39 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2428 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.sec # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_23 = __pyx_v_dts.sec; + __pyx_t_40 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L19_continue:; + } + + /* "pandas/tslib.pyx":2429 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.sec + * return out # <<<<<<<<<<<<<< + * + * elif field == 'us': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2431 + * return out + * + * elif field == 'us': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_us, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2432 + * + * elif field == 'us': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2433 + * elif field == 'us': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_41 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_42 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L22_continue; + } + + /* "pandas/tslib.pyx":2435 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.us + * return out + */ + __pyx_t_43 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_43 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2436 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.us # <<<<<<<<<<<<<< + * return out + * elif field == 'ns': + */ + __pyx_t_23 = __pyx_v_dts.us; + __pyx_t_44 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + __pyx_L22_continue:; + } + + /* "pandas/tslib.pyx":2437 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.us + * return out # <<<<<<<<<<<<<< + * elif field == 'ns': + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2438 + * out[i] = dts.us + * return out + * elif field == 'ns': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_ns, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2439 + * return out + * elif field == 'ns': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2440 + * elif field == 'ns': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_45 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_45 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_46 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_46 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L25_continue; + } + + /* "pandas/tslib.pyx":2442 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.ps / 1000 + * return out + */ + __pyx_t_47 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_47 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2443 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.ps / 1000 # <<<<<<<<<<<<<< + * return out + * elif field == 'doy': + */ + __pyx_t_48 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_out.diminfo[0].strides) = __Pyx_div_long(__pyx_v_dts.ps, 1000); + __pyx_L25_continue:; + } + + /* "pandas/tslib.pyx":2444 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.ps / 1000 + * return out # <<<<<<<<<<<<<< + * elif field == 'doy': + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2445 + * out[i] = dts.ps / 1000 + * return out + * elif field == 'doy': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_doy, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2446 + * return out + * elif field == 'doy': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2447 + * elif field == 'doy': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_49 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_49 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_50 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L28_continue; + } + + /* "pandas/tslib.pyx":2449 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * out[i] = _month_offset[isleap, dts.month-1] + dts.day + */ + __pyx_t_51 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_51 < 0) { + __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2450 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * out[i] = _month_offset[isleap, dts.month-1] + dts.day + * return out + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2451 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) + * out[i] = _month_offset[isleap, dts.month-1] + dts.day # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_7 = __pyx_v_isleap; + __pyx_t_52 = (__pyx_v_dts.month - 1); + __pyx_t_53 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_53 = 0; + if (__pyx_t_52 < 0) { + __pyx_t_53 = 1; + } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_53 = 1; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_54 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_54 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_out.diminfo[0].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd__month_offset.diminfo[1].strides)) + __pyx_v_dts.day); + __pyx_L28_continue:; + } + + /* "pandas/tslib.pyx":2452 + * isleap = is_leapyear(dts.year) + * out[i] = _month_offset[isleap, dts.month-1] + dts.day + * return out # <<<<<<<<<<<<<< + * + * elif field == 'dow': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2454 + * return out + * + * elif field == 'dow': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_dow, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2455 + * + * elif field == 'dow': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2456 + * elif field == 'dow': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * ts = convert_to_tsobject(dtindex[i], None, None) + */ + __pyx_t_55 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_55 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_56 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_56 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L31_continue; + } + + /* "pandas/tslib.pyx":2458 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * out[i] = ts_dayofweek(ts) + * return out + */ + __pyx_t_57 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_57 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2459 + * + * ts = convert_to_tsobject(dtindex[i], None, None) + * out[i] = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_58 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_58 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + __pyx_L31_continue:; + } + + /* "pandas/tslib.pyx":2460 + * ts = convert_to_tsobject(dtindex[i], None, None) + * out[i] = ts_dayofweek(ts) + * return out # <<<<<<<<<<<<<< + * + * elif field == 'woy': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2462 + * return out + * + * elif field == 'woy': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_woy, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2463 + * + * elif field == 'woy': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2464 + * elif field == 'woy': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_59 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_59 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_60 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_60 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L34_continue; + } + + /* "pandas/tslib.pyx":2466 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_61 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_61 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2467 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * isleap_prev = is_leapyear(dts.year - 1) + */ + __pyx_t_62 = __pyx_v_i; + __pyx_t_53 = -1; + if (__pyx_t_62 < 0) { + __pyx_t_53 = 0; + } else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_53 = 0; + if (unlikely(__pyx_t_53 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_53); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2468 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * isleap_prev = is_leapyear(dts.year - 1) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2469 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * isleap_prev = is_leapyear(dts.year - 1) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dts.day + */ + __pyx_v_isleap_prev = is_leapyear((__pyx_v_dts.year - 1)); + + /* "pandas/tslib.pyx":2470 + * isleap = is_leapyear(dts.year) + * isleap_prev = is_leapyear(dts.year - 1) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * doy = mo_off + dts.day + * dow = ts_dayofweek(ts) + */ + __pyx_t_53 = __pyx_v_isleap; + __pyx_t_63 = (__pyx_v_dts.month - 1); + __pyx_t_64 = -1; + if (__pyx_t_53 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_64 = 0; + if (__pyx_t_63 < 0) { + __pyx_t_64 = 1; + } else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_64 = 1; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_63, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2471 + * isleap_prev = is_leapyear(dts.year - 1) + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dts.day # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dts.day); + + /* "pandas/tslib.pyx":2472 + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dts.day + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * #estimate + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2475 + * + * #estimate + * woy = (doy - 1) - dow + 3 # <<<<<<<<<<<<<< + * if woy >= 0: + * woy = woy / 7 + 1 + */ + __pyx_v_woy = (((__pyx_v_doy - 1) - __pyx_v_dow) + 3); + + /* "pandas/tslib.pyx":2476 + * #estimate + * woy = (doy - 1) - dow + 3 + * if woy >= 0: # <<<<<<<<<<<<<< + * woy = woy / 7 + 1 + * + */ + __pyx_t_13 = ((__pyx_v_woy >= 0) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2477 + * woy = (doy - 1) - dow + 3 + * if woy >= 0: + * woy = woy / 7 + 1 # <<<<<<<<<<<<<< + * + * # verify + */ + __pyx_v_woy = (__Pyx_div_long(__pyx_v_woy, 7) + 1); + goto __pyx_L37; + } + __pyx_L37:; + + /* "pandas/tslib.pyx":2480 + * + * # verify + * if woy < 0: # <<<<<<<<<<<<<< + * if (woy > -2) or (woy == -2 and isleap_prev): + * woy = 53 + */ + __pyx_t_13 = ((__pyx_v_woy < 0) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2481 + * # verify + * if woy < 0: + * if (woy > -2) or (woy == -2 and isleap_prev): # <<<<<<<<<<<<<< + * woy = 53 + * else: + */ + __pyx_t_13 = (__pyx_v_woy > -2); + if (!__pyx_t_13) { + __pyx_t_65 = (__pyx_v_woy == -2); + if (__pyx_t_65) { + __pyx_t_66 = (__pyx_v_isleap_prev != 0); + } else { + __pyx_t_66 = __pyx_t_65; + } + __pyx_t_65 = __pyx_t_66; + } else { + __pyx_t_65 = __pyx_t_13; + } + if (__pyx_t_65) { + + /* "pandas/tslib.pyx":2482 + * if woy < 0: + * if (woy > -2) or (woy == -2 and isleap_prev): + * woy = 53 # <<<<<<<<<<<<<< + * else: + * woy = 52 + */ + __pyx_v_woy = 53; + goto __pyx_L39; + } + /*else*/ { + + /* "pandas/tslib.pyx":2484 + * woy = 53 + * else: + * woy = 52 # <<<<<<<<<<<<<< + * elif woy == 53: + * if 31 - dts.day + dow < 3: + */ + __pyx_v_woy = 52; + } + __pyx_L39:; + goto __pyx_L38; + } + + /* "pandas/tslib.pyx":2485 + * else: + * woy = 52 + * elif woy == 53: # <<<<<<<<<<<<<< + * if 31 - dts.day + dow < 3: + * woy = 1 + */ + __pyx_t_65 = ((__pyx_v_woy == 53) != 0); + if (__pyx_t_65) { + + /* "pandas/tslib.pyx":2486 + * woy = 52 + * elif woy == 53: + * if 31 - dts.day + dow < 3: # <<<<<<<<<<<<<< + * woy = 1 + * + */ + __pyx_t_65 = ((((31 - __pyx_v_dts.day) + __pyx_v_dow) < 3) != 0); + if (__pyx_t_65) { + + /* "pandas/tslib.pyx":2487 + * elif woy == 53: + * if 31 - dts.day + dow < 3: + * woy = 1 # <<<<<<<<<<<<<< + * + * out[i] = woy + */ + __pyx_v_woy = 1; + goto __pyx_L40; + } + __pyx_L40:; + goto __pyx_L38; + } + __pyx_L38:; + + /* "pandas/tslib.pyx":2489 + * woy = 1 + * + * out[i] = woy # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_67 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_67 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_woy; + __pyx_L34_continue:; + } + + /* "pandas/tslib.pyx":2490 + * + * out[i] = woy + * return out # <<<<<<<<<<<<<< + * + * elif field == 'q': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2492 + * return out + * + * elif field == 'q': # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_65 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_q, Py_EQ)); if (unlikely(__pyx_t_65 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_65) { + + /* "pandas/tslib.pyx":2493 + * + * elif field == 'q': + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_11 = __pyx_v_count; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2494 + * elif field == 'q': + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_68 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_68 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_65 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_68, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_65) { + __pyx_t_69 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_69 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L41_continue; + } + + /* "pandas/tslib.pyx":2496 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = dts.month + * out[i] = ((out[i] - 1) / 3) + 1 + */ + __pyx_t_70 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_70 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2497 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.month # <<<<<<<<<<<<<< + * out[i] = ((out[i] - 1) / 3) + 1 + * return out + */ + __pyx_t_23 = __pyx_v_dts.month; + __pyx_t_71 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_71 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_23; + + /* "pandas/tslib.pyx":2498 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * out[i] = dts.month + * out[i] = ((out[i] - 1) / 3) + 1 # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_72 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_72 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_73 = __pyx_v_i; + __pyx_t_64 = -1; + if (__pyx_t_73 < 0) { + __pyx_t_64 = 0; + } else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_64 = 0; + if (unlikely(__pyx_t_64 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_64); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_73, __pyx_pybuffernd_out.diminfo[0].strides) = (__Pyx_div_long(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_out.diminfo[0].strides)) - 1), 3) + 1); + __pyx_L41_continue:; + } + + /* "pandas/tslib.pyx":2499 + * out[i] = dts.month + * out[i] = ((out[i] - 1) / 3) + 1 + * return out # <<<<<<<<<<<<<< + * + * raise ValueError("Field %s not supported" % field) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2501 + * return out + * + * raise ValueError("Field %s not supported" % field) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Field_s_not_supported, __pyx_v_field); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2361 + * + * @cython.wraparound(False) + * def get_date_field(ndarray[int64_t] dtindex, object field): # <<<<<<<<<<<<<< + * ''' + * Given a int64-based datetime index, extract the year, month, etc., + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.get_date_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XDECREF((PyObject *)__pyx_v__month_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2505 + * + * @cython.wraparound(False) + * def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=None, int month_kw=12): # <<<<<<<<<<<<<< + * ''' + * Given an int64-based datetime index return array of indicators + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_63get_start_end_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_62get_start_end_field[] = "\n Given an int64-based datetime index return array of indicators\n of whether timestamps are at the start/end of the month/quarter/year\n (defined by frequency).\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_63get_start_end_field = {__Pyx_NAMESTR("get_start_end_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_63get_start_end_field, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_62get_start_end_field)}; +static PyObject *__pyx_pw_6pandas_5tslib_63get_start_end_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_dtindex = 0; + PyObject *__pyx_v_field = 0; + PyObject *__pyx_v_freqstr = 0; + int __pyx_v_month_kw; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_start_end_field (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtindex,&__pyx_n_s_field,&__pyx_n_s_freqstr,&__pyx_n_s_month_kw,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtindex)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_start_end_field", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freqstr); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_month_kw); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_start_end_field") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dtindex = ((PyArrayObject *)values[0]); + __pyx_v_field = values[1]; + __pyx_v_freqstr = values[2]; + if (values[3]) { + __pyx_v_month_kw = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_month_kw == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_month_kw = ((int)12); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_start_end_field", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_start_end_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_62get_start_end_field(__pyx_self, __pyx_v_dtindex, __pyx_v_field, __pyx_v_freqstr, __pyx_v_month_kw); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_62get_start_end_field(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtindex, PyObject *__pyx_v_field, PyObject *__pyx_v_freqstr, int __pyx_v_month_kw) { + struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts = 0; + Py_ssize_t __pyx_v_i; + int __pyx_v_count; + int __pyx_v_is_business; + int __pyx_v_end_month; + int __pyx_v_start_month; + PyArrayObject *__pyx_v_out = 0; + PyArrayObject *__pyx_v__month_offset = 0; + int __pyx_v_isleap; + pandas_datetimestruct __pyx_v_dts; + int __pyx_v_mo_off; + int __pyx_v_dom; + int __pyx_v_doy; + int __pyx_v_dow; + int __pyx_v_ldom; + __Pyx_LocalBuf_ND __pyx_pybuffernd__month_offset; + __Pyx_Buffer __pyx_pybuffer__month_offset; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtindex; + __Pyx_Buffer __pyx_pybuffer_dtindex; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + npy_int32 __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + int __pyx_t_33; + int __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + long __pyx_t_39; + npy_int32 __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + npy_int32 __pyx_t_46; + int __pyx_t_47; + int __pyx_t_48; + int __pyx_t_49; + Py_ssize_t __pyx_t_50; + Py_ssize_t __pyx_t_51; + Py_ssize_t __pyx_t_52; + Py_ssize_t __pyx_t_53; + Py_ssize_t __pyx_t_54; + Py_ssize_t __pyx_t_55; + Py_ssize_t __pyx_t_56; + Py_ssize_t __pyx_t_57; + Py_ssize_t __pyx_t_58; + long __pyx_t_59; + int __pyx_t_60; + int __pyx_t_61; + Py_ssize_t __pyx_t_62; + Py_ssize_t __pyx_t_63; + Py_ssize_t __pyx_t_64; + Py_ssize_t __pyx_t_65; + long __pyx_t_66; + npy_int32 __pyx_t_67; + Py_ssize_t __pyx_t_68; + Py_ssize_t __pyx_t_69; + Py_ssize_t __pyx_t_70; + Py_ssize_t __pyx_t_71; + Py_ssize_t __pyx_t_72; + npy_int32 __pyx_t_73; + int __pyx_t_74; + int __pyx_t_75; + Py_ssize_t __pyx_t_76; + Py_ssize_t __pyx_t_77; + Py_ssize_t __pyx_t_78; + Py_ssize_t __pyx_t_79; + Py_ssize_t __pyx_t_80; + Py_ssize_t __pyx_t_81; + Py_ssize_t __pyx_t_82; + Py_ssize_t __pyx_t_83; + Py_ssize_t __pyx_t_84; + long __pyx_t_85; + int __pyx_t_86; + int __pyx_t_87; + Py_ssize_t __pyx_t_88; + Py_ssize_t __pyx_t_89; + Py_ssize_t __pyx_t_90; + Py_ssize_t __pyx_t_91; + Py_ssize_t __pyx_t_92; + long __pyx_t_93; + npy_int32 __pyx_t_94; + Py_ssize_t __pyx_t_95; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_start_end_field", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer__month_offset.pybuffer.buf = NULL; + __pyx_pybuffer__month_offset.refcount = 0; + __pyx_pybuffernd__month_offset.data = NULL; + __pyx_pybuffernd__month_offset.rcbuffer = &__pyx_pybuffer__month_offset; + __pyx_pybuffer_dtindex.pybuffer.buf = NULL; + __pyx_pybuffer_dtindex.refcount = 0; + __pyx_pybuffernd_dtindex.data = NULL; + __pyx_pybuffernd_dtindex.rcbuffer = &__pyx_pybuffer_dtindex; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtindex.diminfo[0].strides = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtindex.diminfo[0].shape = __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2514 + * _TSObject ts + * Py_ssize_t i + * int count = 0 # <<<<<<<<<<<<<< + * bint is_business = 0 + * int end_month = 12 + */ + __pyx_v_count = 0; + + /* "pandas/tslib.pyx":2515 + * Py_ssize_t i + * int count = 0 + * bint is_business = 0 # <<<<<<<<<<<<<< + * int end_month = 12 + * int start_month = 1 + */ + __pyx_v_is_business = 0; + + /* "pandas/tslib.pyx":2516 + * int count = 0 + * bint is_business = 0 + * int end_month = 12 # <<<<<<<<<<<<<< + * int start_month = 1 + * ndarray[int8_t] out + */ + __pyx_v_end_month = 12; + + /* "pandas/tslib.pyx":2517 + * bint is_business = 0 + * int end_month = 12 + * int start_month = 1 # <<<<<<<<<<<<<< + * ndarray[int8_t] out + * ndarray[int32_t, ndim=2] _month_offset + */ + __pyx_v_start_month = 1; + + /* "pandas/tslib.pyx":2524 + * int mo_off, dom, doy, dow, ldom + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2525 + * + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], # <<<<<<<<<<<<<< + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) + */ + __pyx_t_1 = PyList_New(13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_31); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_31); + __Pyx_GIVEREF(__pyx_int_31); + __Pyx_INCREF(__pyx_int_59); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_59); + __Pyx_GIVEREF(__pyx_int_59); + __Pyx_INCREF(__pyx_int_90); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_90); + __Pyx_GIVEREF(__pyx_int_90); + __Pyx_INCREF(__pyx_int_120); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_120); + __Pyx_GIVEREF(__pyx_int_120); + __Pyx_INCREF(__pyx_int_151); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_151); + __Pyx_GIVEREF(__pyx_int_151); + __Pyx_INCREF(__pyx_int_181); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_181); + __Pyx_GIVEREF(__pyx_int_181); + __Pyx_INCREF(__pyx_int_212); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_212); + __Pyx_GIVEREF(__pyx_int_212); + __Pyx_INCREF(__pyx_int_243); + PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_243); + __Pyx_GIVEREF(__pyx_int_243); + __Pyx_INCREF(__pyx_int_273); + PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_273); + __Pyx_GIVEREF(__pyx_int_273); + __Pyx_INCREF(__pyx_int_304); + PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_304); + __Pyx_GIVEREF(__pyx_int_304); + __Pyx_INCREF(__pyx_int_334); + PyList_SET_ITEM(__pyx_t_1, 11, __pyx_int_334); + __Pyx_GIVEREF(__pyx_int_334); + __Pyx_INCREF(__pyx_int_365); + PyList_SET_ITEM(__pyx_t_1, 12, __pyx_int_365); + __Pyx_GIVEREF(__pyx_int_365); + + /* "pandas/tslib.pyx":2526 + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], # <<<<<<<<<<<<<< + * dtype=np.int32 ) + * + */ + __pyx_t_3 = PyList_New(13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_0); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_31); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_31); + __Pyx_GIVEREF(__pyx_int_31); + __Pyx_INCREF(__pyx_int_60); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_60); + __Pyx_GIVEREF(__pyx_int_60); + __Pyx_INCREF(__pyx_int_91); + PyList_SET_ITEM(__pyx_t_3, 3, __pyx_int_91); + __Pyx_GIVEREF(__pyx_int_91); + __Pyx_INCREF(__pyx_int_121); + PyList_SET_ITEM(__pyx_t_3, 4, __pyx_int_121); + __Pyx_GIVEREF(__pyx_int_121); + __Pyx_INCREF(__pyx_int_152); + PyList_SET_ITEM(__pyx_t_3, 5, __pyx_int_152); + __Pyx_GIVEREF(__pyx_int_152); + __Pyx_INCREF(__pyx_int_182); + PyList_SET_ITEM(__pyx_t_3, 6, __pyx_int_182); + __Pyx_GIVEREF(__pyx_int_182); + __Pyx_INCREF(__pyx_int_213); + PyList_SET_ITEM(__pyx_t_3, 7, __pyx_int_213); + __Pyx_GIVEREF(__pyx_int_213); + __Pyx_INCREF(__pyx_int_244); + PyList_SET_ITEM(__pyx_t_3, 8, __pyx_int_244); + __Pyx_GIVEREF(__pyx_int_244); + __Pyx_INCREF(__pyx_int_274); + PyList_SET_ITEM(__pyx_t_3, 9, __pyx_int_274); + __Pyx_GIVEREF(__pyx_int_274); + __Pyx_INCREF(__pyx_int_305); + PyList_SET_ITEM(__pyx_t_3, 10, __pyx_int_305); + __Pyx_GIVEREF(__pyx_int_305); + __Pyx_INCREF(__pyx_int_335); + PyList_SET_ITEM(__pyx_t_3, 11, __pyx_int_335); + __Pyx_GIVEREF(__pyx_int_335); + __Pyx_INCREF(__pyx_int_366); + PyList_SET_ITEM(__pyx_t_3, 12, __pyx_int_366); + __Pyx_GIVEREF(__pyx_int_366); + + /* "pandas/tslib.pyx":2525 + * + * _month_offset = np.array( + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], # <<<<<<<<<<<<<< + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) + */ + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":2524 + * int mo_off, dom, doy, dow, ldom + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + + /* "pandas/tslib.pyx":2527 + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + * dtype=np.int32 ) # <<<<<<<<<<<<<< + * + * count = len(dtindex) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2524 + * int mo_off, dom, doy, dow, ldom + * + * _month_offset = np.array( # <<<<<<<<<<<<<< + * [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ], + * [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]], + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer, (PyObject*)__pyx_v__month_offset, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd__month_offset.diminfo[0].strides = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__month_offset.diminfo[0].shape = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd__month_offset.diminfo[1].strides = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd__month_offset.diminfo[1].shape = __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.shape[1]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v__month_offset = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2529 + * dtype=np.int32 ) + * + * count = len(dtindex) # <<<<<<<<<<<<<< + * out = np.zeros(count, dtype='int8') + * + */ + __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_count = __pyx_t_11; + + /* "pandas/tslib.pyx":2530 + * + * count = len(dtindex) + * out = np.zeros(count, dtype='int8') # <<<<<<<<<<<<<< + * + * if freqstr: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_int8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_2); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2532 + * out = np.zeros(count, dtype='int8') + * + * if freqstr: # <<<<<<<<<<<<<< + * if freqstr == 'C': + * raise ValueError("Custom business days is not supported by %s" % field) + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_freqstr); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2533 + * + * if freqstr: + * if freqstr == 'C': # <<<<<<<<<<<<<< + * raise ValueError("Custom business days is not supported by %s" % field) + * is_business = freqstr[0] == 'B' + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_freqstr, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2534 + * if freqstr: + * if freqstr == 'C': + * raise ValueError("Custom business days is not supported by %s" % field) # <<<<<<<<<<<<<< + * is_business = freqstr[0] == 'B' + * + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Custom_business_days_is_not_supp, __pyx_v_field); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2535 + * if freqstr == 'C': + * raise ValueError("Custom business days is not supported by %s" % field) + * is_business = freqstr[0] == 'B' # <<<<<<<<<<<<<< + * + * # YearBegin(), BYearBegin() use month = starting month of year + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_freqstr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_n_s_B, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_is_business = __pyx_t_13; + + /* "pandas/tslib.pyx":2541 + * # other offests use month, startingMonth as ending month of year. + * + * if (freqstr[0:2] in ['MS', 'QS', 'AS']) or (freqstr[1:3] in ['MS', 'QS', 'AS']): # <<<<<<<<<<<<<< + * end_month = 12 if month_kw == 1 else month_kw - 1 + * start_month = month_kw + */ + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_freqstr, 0, 2, NULL, NULL, &__pyx_slice__74, 1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_MS, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_13) { + __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_QS, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __pyx_t_14; + } else { + __pyx_t_15 = __pyx_t_13; + } + if (!__pyx_t_15) { + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_AS, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_t_13; + } else { + __pyx_t_14 = __pyx_t_15; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_15 = (__pyx_t_14 != 0); + if (!__pyx_t_15) { + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_freqstr, 1, 3, NULL, NULL, &__pyx_slice__75, 1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_MS, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_14) { + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_QS, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_t_13; + } else { + __pyx_t_16 = __pyx_t_14; + } + if (!__pyx_t_16) { + __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_AS, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __pyx_t_14; + } else { + __pyx_t_13 = __pyx_t_16; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_16 = (__pyx_t_13 != 0); + __pyx_t_13 = __pyx_t_16; + } else { + __pyx_t_13 = __pyx_t_15; + } + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2542 + * + * if (freqstr[0:2] in ['MS', 'QS', 'AS']) or (freqstr[1:3] in ['MS', 'QS', 'AS']): + * end_month = 12 if month_kw == 1 else month_kw - 1 # <<<<<<<<<<<<<< + * start_month = month_kw + * else: + */ + if (((__pyx_v_month_kw == 1) != 0)) { + __pyx_t_17 = 12; + } else { + __pyx_t_17 = (__pyx_v_month_kw - 1); + } + __pyx_v_end_month = __pyx_t_17; + + /* "pandas/tslib.pyx":2543 + * if (freqstr[0:2] in ['MS', 'QS', 'AS']) or (freqstr[1:3] in ['MS', 'QS', 'AS']): + * end_month = 12 if month_kw == 1 else month_kw - 1 + * start_month = month_kw # <<<<<<<<<<<<<< + * else: + * end_month = month_kw + */ + __pyx_v_start_month = __pyx_v_month_kw; + goto __pyx_L5; + } + /*else*/ { + + /* "pandas/tslib.pyx":2545 + * start_month = month_kw + * else: + * end_month = month_kw # <<<<<<<<<<<<<< + * start_month = (end_month % 12) + 1 + * else: + */ + __pyx_v_end_month = __pyx_v_month_kw; + + /* "pandas/tslib.pyx":2546 + * else: + * end_month = month_kw + * start_month = (end_month % 12) + 1 # <<<<<<<<<<<<<< + * else: + * end_month = 12 + */ + __pyx_v_start_month = (__Pyx_mod_long(__pyx_v_end_month, 12) + 1); + } + __pyx_L5:; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":2548 + * start_month = (end_month % 12) + 1 + * else: + * end_month = 12 # <<<<<<<<<<<<<< + * start_month = 1 + * + */ + __pyx_v_end_month = 12; + + /* "pandas/tslib.pyx":2549 + * else: + * end_month = 12 + * start_month = 1 # <<<<<<<<<<<<<< + * + * if field == 'is_month_start': + */ + __pyx_v_start_month = 1; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2551 + * start_month = 1 + * + * if field == 'is_month_start': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_month_start, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2552 + * + * if field == 'is_month_start': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__pyx_v_is_business != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2553 + * if field == 'is_month_start': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2554 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_20 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L8_continue; + } + + /* "pandas/tslib.pyx":2556 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2557 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * dom = dts.day + * dow = ts_dayofweek(ts) + */ + __pyx_t_22 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2558 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_23 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_23; + + /* "pandas/tslib.pyx":2559 + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if (dom == 1 and dow < 5) or (dom <= 3 and dow == 0): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2561 + * dow = ts_dayofweek(ts) + * + * if (dom == 1 and dow < 5) or (dom <= 3 and dow == 0): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_13 = ((__pyx_v_dom == 1) != 0); + if (__pyx_t_13) { + __pyx_t_15 = ((__pyx_v_dow < 5) != 0); + __pyx_t_16 = __pyx_t_15; + } else { + __pyx_t_16 = __pyx_t_13; + } + if (!__pyx_t_16) { + __pyx_t_13 = ((__pyx_v_dom <= 3) != 0); + if (__pyx_t_13) { + __pyx_t_15 = ((__pyx_v_dow == 0) != 0); + __pyx_t_14 = __pyx_t_15; + } else { + __pyx_t_14 = __pyx_t_13; + } + __pyx_t_13 = __pyx_t_14; + } else { + __pyx_t_13 = __pyx_t_16; + } + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2562 + * + * if (dom == 1 and dow < 5) or (dom <= 3 and dow == 0): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L11; + } + __pyx_L11:; + __pyx_L8_continue:; + } + + /* "pandas/tslib.pyx":2563 + * if (dom == 1 and dow < 5) or (dom <= 3 and dow == 0): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2565 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2566 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_26 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L12_continue; + } + + /* "pandas/tslib.pyx":2568 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dom = dts.day + * + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2569 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * dom = dts.day # <<<<<<<<<<<<<< + * + * if dom == 1: + */ + __pyx_t_23 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_23; + + /* "pandas/tslib.pyx":2571 + * dom = dts.day + * + * if dom == 1: # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_13 = ((__pyx_v_dom == 1) != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2572 + * + * if dom == 1: + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L15; + } + __pyx_L15:; + __pyx_L12_continue:; + } + + /* "pandas/tslib.pyx":2573 + * if dom == 1: + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_month_end': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2575 + * return out.view(bool) + * + * elif field == 'is_month_end': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_month_end, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2576 + * + * elif field == 'is_month_end': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_13 = (__pyx_v_is_business != 0); + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":2577 + * elif field == 'is_month_end': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2578 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_13) { + __pyx_t_30 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L17_continue; + } + + /* "pandas/tslib.pyx":2580 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2581 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2582 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2583 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_13 = __pyx_v_isleap; + __pyx_t_17 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_17 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2584 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_23 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_23; + + /* "pandas/tslib.pyx":2585 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * dow = ts_dayofweek(ts) + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2586 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_16 = __pyx_v_isleap; + __pyx_t_23 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_23 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2587 + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if (ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2)): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2589 + * dow = ts_dayofweek(ts) + * + * if (ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2)): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_14 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + if (__pyx_t_14) { + __pyx_t_15 = ((__pyx_v_dow < 5) != 0); + __pyx_t_33 = __pyx_t_15; + } else { + __pyx_t_33 = __pyx_t_14; + } + if (!__pyx_t_33) { + __pyx_t_14 = ((__pyx_v_dow == 4) != 0); + if (__pyx_t_14) { + __pyx_t_15 = (((__pyx_v_ldom - __pyx_v_doy) <= 2) != 0); + __pyx_t_34 = __pyx_t_15; + } else { + __pyx_t_34 = __pyx_t_14; + } + __pyx_t_14 = __pyx_t_34; + } else { + __pyx_t_14 = __pyx_t_33; + } + if (__pyx_t_14) { + + /* "pandas/tslib.pyx":2590 + * + * if (ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2)): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L20; + } + __pyx_L20:; + __pyx_L17_continue:; + } + + /* "pandas/tslib.pyx":2591 + * if (ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2)): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2593 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2594 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_14) { + __pyx_t_37 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L21_continue; + } + + /* "pandas/tslib.pyx":2596 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2597 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2598 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_14 = __pyx_v_isleap; + __pyx_t_39 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_39 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2599 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_40 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_40; + + /* "pandas/tslib.pyx":2600 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2601 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * + * if ldom == doy: + */ + __pyx_t_33 = __pyx_v_isleap; + __pyx_t_40 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_40 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2603 + * ldom = _month_offset[isleap, dts.month] + * + * if ldom == doy: # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_34 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + if (__pyx_t_34) { + + /* "pandas/tslib.pyx":2604 + * + * if ldom == doy: + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_41 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L24; + } + __pyx_L24:; + __pyx_L21_continue:; + } + + /* "pandas/tslib.pyx":2605 + * if ldom == doy: + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_quarter_start': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2607 + * return out.view(bool) + * + * elif field == 'is_quarter_start': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_34 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_quarter_start, Py_EQ)); if (unlikely(__pyx_t_34 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_34) { + + /* "pandas/tslib.pyx":2608 + * + * elif field == 'is_quarter_start': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_34 = (__pyx_v_is_business != 0); + if (__pyx_t_34) { + + /* "pandas/tslib.pyx":2609 + * elif field == 'is_quarter_start': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2610 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_42 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_34 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_34) { + __pyx_t_43 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_43 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L26_continue; + } + + /* "pandas/tslib.pyx":2612 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + */ + __pyx_t_44 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_44 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2613 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * dom = dts.day + * dow = ts_dayofweek(ts) + */ + __pyx_t_45 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_45 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2614 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_46 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_46; + + /* "pandas/tslib.pyx":2615 + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if ((dts.month - start_month) % 3 == 0) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2617 + * dow = ts_dayofweek(ts) + * + * if ((dts.month - start_month) % 3 == 0) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_34 = ((__Pyx_mod_long((__pyx_v_dts.month - __pyx_v_start_month), 3) == 0) != 0); + if (__pyx_t_34) { + __pyx_t_15 = ((__pyx_v_dom == 1) != 0); + if (__pyx_t_15) { + __pyx_t_47 = ((__pyx_v_dow < 5) != 0); + __pyx_t_48 = __pyx_t_47; + } else { + __pyx_t_48 = __pyx_t_15; + } + if (!__pyx_t_48) { + __pyx_t_15 = ((__pyx_v_dom <= 3) != 0); + if (__pyx_t_15) { + __pyx_t_47 = ((__pyx_v_dow == 0) != 0); + __pyx_t_49 = __pyx_t_47; + } else { + __pyx_t_49 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_49; + } else { + __pyx_t_15 = __pyx_t_48; + } + __pyx_t_48 = __pyx_t_15; + } else { + __pyx_t_48 = __pyx_t_34; + } + if (__pyx_t_48) { + + /* "pandas/tslib.pyx":2618 + * + * if ((dts.month - start_month) % 3 == 0) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_50 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_50 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L29; + } + __pyx_L29:; + __pyx_L26_continue:; + } + + /* "pandas/tslib.pyx":2619 + * if ((dts.month - start_month) % 3 == 0) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2621 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2622 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_51 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_51 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_48 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_48) { + __pyx_t_52 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_52 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L30_continue; + } + + /* "pandas/tslib.pyx":2624 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dom = dts.day + * + */ + __pyx_t_53 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_53 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2625 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * dom = dts.day # <<<<<<<<<<<<<< + * + * if ((dts.month - start_month) % 3 == 0) and dom == 1: + */ + __pyx_t_46 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_46; + + /* "pandas/tslib.pyx":2627 + * dom = dts.day + * + * if ((dts.month - start_month) % 3 == 0) and dom == 1: # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_48 = ((__Pyx_mod_long((__pyx_v_dts.month - __pyx_v_start_month), 3) == 0) != 0); + if (__pyx_t_48) { + __pyx_t_34 = ((__pyx_v_dom == 1) != 0); + __pyx_t_15 = __pyx_t_34; + } else { + __pyx_t_15 = __pyx_t_48; + } + if (__pyx_t_15) { + + /* "pandas/tslib.pyx":2628 + * + * if ((dts.month - start_month) % 3 == 0) and dom == 1: + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_54 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_54 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L33; + } + __pyx_L33:; + __pyx_L30_continue:; + } + + /* "pandas/tslib.pyx":2629 + * if ((dts.month - start_month) % 3 == 0) and dom == 1: + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_quarter_end': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2631 + * return out.view(bool) + * + * elif field == 'is_quarter_end': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_quarter_end, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_15) { + + /* "pandas/tslib.pyx":2632 + * + * elif field == 'is_quarter_end': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_15 = (__pyx_v_is_business != 0); + if (__pyx_t_15) { + + /* "pandas/tslib.pyx":2633 + * elif field == 'is_quarter_end': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2634 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_55 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_55 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_15) { + __pyx_t_56 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_56 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L35_continue; + } + + /* "pandas/tslib.pyx":2636 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_57 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_57 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2637 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_58 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_58 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2638 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2639 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_15 = __pyx_v_isleap; + __pyx_t_59 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_59 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2640 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_46 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_46; + + /* "pandas/tslib.pyx":2641 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * dow = ts_dayofweek(ts) + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2642 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_48 = __pyx_v_isleap; + __pyx_t_46 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_48 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_46 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2643 + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if ((dts.month - end_month) % 3 == 0) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2645 + * dow = ts_dayofweek(ts) + * + * if ((dts.month - end_month) % 3 == 0) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_34 = ((__Pyx_mod_long((__pyx_v_dts.month - __pyx_v_end_month), 3) == 0) != 0); + if (__pyx_t_34) { + __pyx_t_49 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + if (__pyx_t_49) { + __pyx_t_47 = ((__pyx_v_dow < 5) != 0); + __pyx_t_60 = __pyx_t_47; + } else { + __pyx_t_60 = __pyx_t_49; + } + if (!__pyx_t_60) { + __pyx_t_49 = ((__pyx_v_dow == 4) != 0); + if (__pyx_t_49) { + __pyx_t_47 = (((__pyx_v_ldom - __pyx_v_doy) <= 2) != 0); + __pyx_t_61 = __pyx_t_47; + } else { + __pyx_t_61 = __pyx_t_49; + } + __pyx_t_49 = __pyx_t_61; + } else { + __pyx_t_49 = __pyx_t_60; + } + __pyx_t_60 = __pyx_t_49; + } else { + __pyx_t_60 = __pyx_t_34; + } + if (__pyx_t_60) { + + /* "pandas/tslib.pyx":2646 + * + * if ((dts.month - end_month) % 3 == 0) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_62 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_62 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L38; + } + __pyx_L38:; + __pyx_L35_continue:; + } + + /* "pandas/tslib.pyx":2647 + * if ((dts.month - end_month) % 3 == 0) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2649 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2650 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_63 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_63 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_60 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_60) { + __pyx_t_64 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_64 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L39_continue; + } + + /* "pandas/tslib.pyx":2652 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_65 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_65 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2653 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2654 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_60 = __pyx_v_isleap; + __pyx_t_66 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_60 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_66 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_66, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2655 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_67 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_67; + + /* "pandas/tslib.pyx":2656 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2657 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * + * if ((dts.month - end_month) % 3 == 0) and (ldom == doy): + */ + __pyx_t_34 = __pyx_v_isleap; + __pyx_t_67 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_67 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2659 + * ldom = _month_offset[isleap, dts.month] + * + * if ((dts.month - end_month) % 3 == 0) and (ldom == doy): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_49 = ((__Pyx_mod_long((__pyx_v_dts.month - __pyx_v_end_month), 3) == 0) != 0); + if (__pyx_t_49) { + __pyx_t_61 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + __pyx_t_47 = __pyx_t_61; + } else { + __pyx_t_47 = __pyx_t_49; + } + if (__pyx_t_47) { + + /* "pandas/tslib.pyx":2660 + * + * if ((dts.month - end_month) % 3 == 0) and (ldom == doy): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_68 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_68 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_68, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L42; + } + __pyx_L42:; + __pyx_L39_continue:; + } + + /* "pandas/tslib.pyx":2661 + * if ((dts.month - end_month) % 3 == 0) and (ldom == doy): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_year_start': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2663 + * return out.view(bool) + * + * elif field == 'is_year_start': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_47 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_year_start, Py_EQ)); if (unlikely(__pyx_t_47 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_47) { + + /* "pandas/tslib.pyx":2664 + * + * elif field == 'is_year_start': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_47 = (__pyx_v_is_business != 0); + if (__pyx_t_47) { + + /* "pandas/tslib.pyx":2665 + * elif field == 'is_year_start': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2666 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_69 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_69 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_47 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_47) { + __pyx_t_70 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_70 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L44_continue; + } + + /* "pandas/tslib.pyx":2668 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + */ + __pyx_t_71 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_71 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2669 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * dom = dts.day + * dow = ts_dayofweek(ts) + */ + __pyx_t_72 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_72 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2670 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * + */ + __pyx_t_73 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_73; + + /* "pandas/tslib.pyx":2671 + * ts = convert_to_tsobject(dtindex[i], None, None) + * dom = dts.day + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * if (dts.month == start_month) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2673 + * dow = ts_dayofweek(ts) + * + * if (dts.month == start_month) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_47 = ((__pyx_v_dts.month == __pyx_v_start_month) != 0); + if (__pyx_t_47) { + __pyx_t_49 = ((__pyx_v_dom == 1) != 0); + if (__pyx_t_49) { + __pyx_t_61 = ((__pyx_v_dow < 5) != 0); + __pyx_t_74 = __pyx_t_61; + } else { + __pyx_t_74 = __pyx_t_49; + } + if (!__pyx_t_74) { + __pyx_t_49 = ((__pyx_v_dom <= 3) != 0); + if (__pyx_t_49) { + __pyx_t_61 = ((__pyx_v_dow == 0) != 0); + __pyx_t_75 = __pyx_t_61; + } else { + __pyx_t_75 = __pyx_t_49; + } + __pyx_t_49 = __pyx_t_75; + } else { + __pyx_t_49 = __pyx_t_74; + } + __pyx_t_74 = __pyx_t_49; + } else { + __pyx_t_74 = __pyx_t_47; + } + if (__pyx_t_74) { + + /* "pandas/tslib.pyx":2674 + * + * if (dts.month == start_month) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_76 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_76 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_76 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_76, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L47; + } + __pyx_L47:; + __pyx_L44_continue:; + } + + /* "pandas/tslib.pyx":2675 + * if (dts.month == start_month) and ((dom == 1 and dow < 5) or (dom <= 3 and dow == 0)): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2677 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2678 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_77 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_77 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_77 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_74 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_77, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_74) { + __pyx_t_78 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_78 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_78 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L48_continue; + } + + /* "pandas/tslib.pyx":2680 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * dom = dts.day + * + */ + __pyx_t_79 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_79 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_79 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2681 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * dom = dts.day # <<<<<<<<<<<<<< + * + * if (dts.month == start_month) and dom == 1: + */ + __pyx_t_73 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_73; + + /* "pandas/tslib.pyx":2683 + * dom = dts.day + * + * if (dts.month == start_month) and dom == 1: # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_74 = ((__pyx_v_dts.month == __pyx_v_start_month) != 0); + if (__pyx_t_74) { + __pyx_t_47 = ((__pyx_v_dom == 1) != 0); + __pyx_t_49 = __pyx_t_47; + } else { + __pyx_t_49 = __pyx_t_74; + } + if (__pyx_t_49) { + + /* "pandas/tslib.pyx":2684 + * + * if (dts.month == start_month) and dom == 1: + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_80 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_80 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_80 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_80, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L51; + } + __pyx_L51:; + __pyx_L48_continue:; + } + + /* "pandas/tslib.pyx":2685 + * if (dts.month == start_month) and dom == 1: + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * elif field == 'is_year_end': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2687 + * return out.view(bool) + * + * elif field == 'is_year_end': # <<<<<<<<<<<<<< + * if is_business: + * for i in range(count): + */ + __pyx_t_49 = (__Pyx_PyString_Equals(__pyx_v_field, __pyx_n_s_is_year_end, Py_EQ)); if (unlikely(__pyx_t_49 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_49) { + + /* "pandas/tslib.pyx":2688 + * + * elif field == 'is_year_end': + * if is_business: # <<<<<<<<<<<<<< + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + */ + __pyx_t_49 = (__pyx_v_is_business != 0); + if (__pyx_t_49) { + + /* "pandas/tslib.pyx":2689 + * elif field == 'is_year_end': + * if is_business: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2690 + * if is_business: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_81 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_81 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_81 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_49 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_81, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_49) { + __pyx_t_82 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_82 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_82 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L53_continue; + } + + /* "pandas/tslib.pyx":2692 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_83 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_83 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_83 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_83, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2693 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * dom = dts.day + */ + __pyx_t_84 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_84 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_84 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_84, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":2694 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * dom = dts.day + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2695 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * dom = dts.day # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dom + */ + __pyx_t_73 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_73; + + /* "pandas/tslib.pyx":2696 + * isleap = is_leapyear(dts.year) + * dom = dts.day + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * doy = mo_off + dom + * dow = ts_dayofweek(ts) + */ + __pyx_t_49 = __pyx_v_isleap; + __pyx_t_85 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_49 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_85 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_85 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_85, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2697 + * dom = dts.day + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dom # <<<<<<<<<<<<<< + * dow = ts_dayofweek(ts) + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2698 + * mo_off = _month_offset[isleap, dts.month - 1] + * doy = mo_off + dom + * dow = ts_dayofweek(ts) # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * + */ + __pyx_v_dow = __pyx_f_6pandas_5tslib_ts_dayofweek(__pyx_v_ts); + + /* "pandas/tslib.pyx":2699 + * doy = mo_off + dom + * dow = ts_dayofweek(ts) + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * + * if (dts.month == end_month) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + */ + __pyx_t_74 = __pyx_v_isleap; + __pyx_t_73 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_74 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_74 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_73 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_74, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_73, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2701 + * ldom = _month_offset[isleap, dts.month] + * + * if (dts.month == end_month) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_47 = ((__pyx_v_dts.month == __pyx_v_end_month) != 0); + if (__pyx_t_47) { + __pyx_t_75 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + if (__pyx_t_75) { + __pyx_t_61 = ((__pyx_v_dow < 5) != 0); + __pyx_t_86 = __pyx_t_61; + } else { + __pyx_t_86 = __pyx_t_75; + } + if (!__pyx_t_86) { + __pyx_t_75 = ((__pyx_v_dow == 4) != 0); + if (__pyx_t_75) { + __pyx_t_61 = (((__pyx_v_ldom - __pyx_v_doy) <= 2) != 0); + __pyx_t_87 = __pyx_t_61; + } else { + __pyx_t_87 = __pyx_t_75; + } + __pyx_t_75 = __pyx_t_87; + } else { + __pyx_t_75 = __pyx_t_86; + } + __pyx_t_86 = __pyx_t_75; + } else { + __pyx_t_86 = __pyx_t_47; + } + if (__pyx_t_86) { + + /* "pandas/tslib.pyx":2702 + * + * if (dts.month == end_month) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * else: + */ + __pyx_t_88 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_88 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_88 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_88, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L56; + } + __pyx_L56:; + __pyx_L53_continue:; + } + + /* "pandas/tslib.pyx":2703 + * if (dts.month == end_month) and ((ldom == doy and dow < 5) or (dow == 4 and (ldom - doy <= 2))): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * else: + * for i in range(count): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2705 + * return out.view(bool) + * else: + * for i in range(count): # <<<<<<<<<<<<<< + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + */ + __pyx_t_7 = __pyx_v_count; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_7; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":2706 + * else: + * for i in range(count): + * if dtindex[i] == NPY_NAT: out[i] = -1; continue # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_89 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_89 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_89 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_86 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_89, __pyx_pybuffernd_dtindex.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_86) { + __pyx_t_90 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_90 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_90 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_90, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + goto __pyx_L57_continue; + } + + /* "pandas/tslib.pyx":2708 + * if dtindex[i] == NPY_NAT: out[i] = -1; continue + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + */ + __pyx_t_91 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_91 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_91 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_91, __pyx_pybuffernd_dtindex.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2709 + * + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) # <<<<<<<<<<<<<< + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + */ + __pyx_t_92 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_92 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_92 >= __pyx_pybuffernd_dtindex.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtindex.rcbuffer->pybuffer.buf, __pyx_t_92, __pyx_pybuffernd_dtindex.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_ts, ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2710 + * pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts) + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) # <<<<<<<<<<<<<< + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + */ + __pyx_v_isleap = is_leapyear(__pyx_v_dts.year); + + /* "pandas/tslib.pyx":2711 + * ts = convert_to_tsobject(dtindex[i], None, None) + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] # <<<<<<<<<<<<<< + * dom = dts.day + * doy = mo_off + dom + */ + __pyx_t_86 = __pyx_v_isleap; + __pyx_t_93 = (__pyx_v_dts.month - 1); + __pyx_t_19 = -1; + if (__pyx_t_86 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_86 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_93 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_93 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_mo_off = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_93, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2712 + * isleap = is_leapyear(dts.year) + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day # <<<<<<<<<<<<<< + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] + */ + __pyx_t_94 = __pyx_v_dts.day; + __pyx_v_dom = __pyx_t_94; + + /* "pandas/tslib.pyx":2713 + * mo_off = _month_offset[isleap, dts.month - 1] + * dom = dts.day + * doy = mo_off + dom # <<<<<<<<<<<<<< + * ldom = _month_offset[isleap, dts.month] + * + */ + __pyx_v_doy = (__pyx_v_mo_off + __pyx_v_dom); + + /* "pandas/tslib.pyx":2714 + * dom = dts.day + * doy = mo_off + dom + * ldom = _month_offset[isleap, dts.month] # <<<<<<<<<<<<<< + * + * if (dts.month == end_month) and (ldom == doy): + */ + __pyx_t_47 = __pyx_v_isleap; + __pyx_t_94 = __pyx_v_dts.month; + __pyx_t_19 = -1; + if (__pyx_t_47 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd__month_offset.diminfo[0].shape)) __pyx_t_19 = 0; + if (__pyx_t_94 < 0) { + __pyx_t_19 = 1; + } else if (unlikely(__pyx_t_94 >= __pyx_pybuffernd__month_offset.diminfo[1].shape)) __pyx_t_19 = 1; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_ldom = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd__month_offset.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd__month_offset.diminfo[0].strides, __pyx_t_94, __pyx_pybuffernd__month_offset.diminfo[1].strides)); + + /* "pandas/tslib.pyx":2716 + * ldom = _month_offset[isleap, dts.month] + * + * if (dts.month == end_month) and (ldom == doy): # <<<<<<<<<<<<<< + * out[i] = 1 + * return out.view(bool) + */ + __pyx_t_75 = ((__pyx_v_dts.month == __pyx_v_end_month) != 0); + if (__pyx_t_75) { + __pyx_t_87 = ((__pyx_v_ldom == __pyx_v_doy) != 0); + __pyx_t_61 = __pyx_t_87; + } else { + __pyx_t_61 = __pyx_t_75; + } + if (__pyx_t_61) { + + /* "pandas/tslib.pyx":2717 + * + * if (dts.month == end_month) and (ldom == doy): + * out[i] = 1 # <<<<<<<<<<<<<< + * return out.view(bool) + * + */ + __pyx_t_95 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_95 < 0) { + __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_95 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_95, __pyx_pybuffernd_out.diminfo[0].strides) = 1; + goto __pyx_L60; + } + __pyx_L60:; + __pyx_L57_continue:; + } + + /* "pandas/tslib.pyx":2718 + * if (dts.month == end_month) and (ldom == doy): + * out[i] = 1 + * return out.view(bool) # <<<<<<<<<<<<<< + * + * raise ValueError("Field %s not supported" % field) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject*)&PyBool_Type)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject*)&PyBool_Type)); + __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + } + + /* "pandas/tslib.pyx":2720 + * return out.view(bool) + * + * raise ValueError("Field %s not supported" % field) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Field_s_not_supported, __pyx_v_field); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2505 + * + * @cython.wraparound(False) + * def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=None, int month_kw=12): # <<<<<<<<<<<<<< + * ''' + * Given an int64-based datetime index return array of indicators + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.get_start_end_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__month_offset.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtindex.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ts); + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XDECREF((PyObject *)__pyx_v__month_offset); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2723 + * + * + * cdef inline int m8_weekday(int64_t val): # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(val, None, None) + * return ts_dayofweek(ts) + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib_m8_weekday(__pyx_t_5numpy_int64_t __pyx_v_val) { + PyObject *__pyx_v_ts = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("m8_weekday", 0); + + /* "pandas/tslib.pyx":2724 + * + * cdef inline int m8_weekday(int64_t val): + * ts = convert_to_tsobject(val, None, None) # <<<<<<<<<<<<<< + * return ts_dayofweek(ts) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6pandas_5tslib_convert_to_tsobject(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_ts = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":2725 + * cdef inline int m8_weekday(int64_t val): + * ts = convert_to_tsobject(val, None, None) + * return ts_dayofweek(ts) # <<<<<<<<<<<<<< + * + * cdef int64_t DAY_NS = 86400000000000LL + */ + if (!(likely(((__pyx_v_ts) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ts, __pyx_ptype_6pandas_5tslib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_f_6pandas_5tslib_ts_dayofweek(((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_v_ts)); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2723 + * + * + * cdef inline int m8_weekday(int64_t val): # <<<<<<<<<<<<<< + * ts = convert_to_tsobject(val, None, None) + * return ts_dayofweek(ts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.tslib.m8_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ts); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2730 + * + * + * def date_normalize(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_65date_normalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_65date_normalize = {__Pyx_NAMESTR("date_normalize"), (PyCFunction)__pyx_pw_6pandas_5tslib_65date_normalize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_65date_normalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_stamps = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("date_normalize (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "date_normalize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_stamps = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("date_normalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.date_normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_64date_normalize(__pyx_self, __pyx_v_stamps, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_64date_normalize(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + CYTHON_UNUSED struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_tso = 0; + PyArrayObject *__pyx_v_result = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("date_normalize", 0); + __Pyx_INCREF(__pyx_v_tz); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2732 + * def date_normalize(ndarray[int64_t] stamps, tz=None): + * cdef: + * Py_ssize_t i, n = len(stamps) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * _TSObject tso + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2735 + * pandas_datetimestruct dts + * _TSObject tso + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2737 + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) + * + * if tz is not None: # <<<<<<<<<<<<<< + * tso = _TSObject() + * tz = maybe_get_tz(tz) + */ + __pyx_t_8 = (__pyx_v_tz != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2738 + * + * if tz is not None: + * tso = _TSObject() # <<<<<<<<<<<<<< + * tz = maybe_get_tz(tz) + * result = _normalize_local(stamps, tz) + */ + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__TSObject)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_tso = ((struct __pyx_obj_6pandas_5tslib__TSObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2739 + * if tz is not None: + * tso = _TSObject() + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * result = _normalize_local(stamps, tz) + * else: + */ + __pyx_t_6 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2740 + * tso = _TSObject() + * tz = maybe_get_tz(tz) + * result = _normalize_local(stamps, tz) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_6 = __pyx_f_6pandas_5tslib__normalize_local(((PyArrayObject *)__pyx_v_stamps), __pyx_v_tz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyArrayObject *)__pyx_t_6)); + __pyx_t_6 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":2742 + * result = _normalize_local(stamps, tz) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_1; __pyx_t_14+=1) { + __pyx_v_i = __pyx_t_14; + + /* "pandas/tslib.pyx":2743 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2744 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2745 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":2746 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2747 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L4_continue:; + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2749 + * result[i] = _normalized_stamp(&dts) + * + * return result # <<<<<<<<<<<<<< + * + * cdef _normalize_local(ndarray[int64_t] stamps, object tz): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2730 + * + * + * def date_normalize(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.date_normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_tso); + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2751 + * return result + * + * cdef _normalize_local(ndarray[int64_t] stamps, object tz): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t n = len(stamps) + */ + +static PyObject *__pyx_f_6pandas_5tslib__normalize_local(PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + PyArrayObject *__pyx_v_pos = 0; + pandas_datetimestruct __pyx_v_dts; + Py_ssize_t __pyx_v_i; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v__pos = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_pos; + __Pyx_Buffer __pyx_pybuffer_pos; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + Py_ssize_t __pyx_t_21; + npy_datetime __pyx_t_22; + Py_ssize_t __pyx_t_23; + PyArrayObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + PyObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + int __pyx_t_28; + Py_ssize_t __pyx_t_29; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + long __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + __pyx_t_5numpy_int64_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_normalize_local", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_pos.pybuffer.buf = NULL; + __pyx_pybuffer_pos.refcount = 0; + __pyx_pybuffernd_pos.data = NULL; + __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2753 + * cdef _normalize_local(ndarray[int64_t] stamps, object tz): + * cdef: + * Py_ssize_t n = len(stamps) # <<<<<<<<<<<<<< + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) + * ndarray[int64_t] trans, deltas, pos + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2754 + * cdef: + * Py_ssize_t n = len(stamps) + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * ndarray[int64_t] trans, deltas, pos + * pandas_datetimestruct dts + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2758 + * pandas_datetimestruct dts + * + * if _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_8 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2759 + * + * if _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":2760 + * if _is_utc(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_10 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_10 < 0) { + __pyx_t_10 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2761 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2762 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":2763 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * elif _is_tzlocal(tz): + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2764 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz): + * for i in range(n): + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L4_continue:; + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":2765 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_8 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2766 + * result[i] = _normalized_stamp(&dts) + * elif _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":2767 + * elif _is_tzlocal(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2768 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2769 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + */ + goto __pyx_L7_continue; + } + + /* "pandas/tslib.pyx":2770 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, # <<<<<<<<<<<<<< + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2771 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2772 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":2773 + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_18 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + + /* "pandas/tslib.pyx":2772 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_20 = PyTuple_New(8); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_20, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_20, 5, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_20, 6, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_20, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_18 = 0; + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_19)); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2774 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + */ + __pyx_t_19 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_19)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_19, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Multiply(__pyx_t_20, __pyx_int_1000000000); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_19); + __pyx_t_19 = 0; + + /* "pandas/tslib.pyx":2775 + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + __pyx_t_21 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_t_19, __pyx_v_delta); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_22 = __Pyx_PyInt_As_npy_int64(__pyx_t_20); if (unlikely((__pyx_t_22 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2776 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * else: + */ + pandas_datetime_to_datetimestruct(__pyx_t_22, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2777 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L7_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":2780 + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + */ + __pyx_t_20 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2781 + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + */ + __pyx_t_20 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 = ((PyArrayObject *)__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_24 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2782 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 # <<<<<<<<<<<<<< + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + */ + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_INCREF(((PyObject *)__pyx_v_stamps)); + PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_v_stamps)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_stamps)); + __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, __pyx_t_18); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyNumber_Subtract(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v__pos = __pyx_t_18; + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2783 + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: # <<<<<<<<<<<<<< + * _pos = _pos.astype(np.int64) + * pos = _pos + */ + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_dtype); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_18, __pyx_t_19, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2784 + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) # <<<<<<<<<<<<<< + * pos = _pos + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_int64); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_19, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF_SET(__pyx_v__pos, __pyx_t_18); + __pyx_t_18 = 0; + goto __pyx_L10; + } + __pyx_L10:; + + /* "pandas/tslib.pyx":2785 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + * pos = _pos # <<<<<<<<<<<<<< + * + * # statictzinfo + */ + if (!(likely(((__pyx_v__pos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__pos, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_v__pos; + __Pyx_INCREF(__pyx_t_18); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_18), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27); + } + } + __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_pos = ((PyArrayObject *)__pyx_t_18); + __pyx_t_18 = 0; + + /* "pandas/tslib.pyx":2788 + * + * # statictzinfo + * if not hasattr(tz, '_transition_info'): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_8 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_28 = ((!(__pyx_t_8 != 0)) != 0); + if (__pyx_t_28) { + + /* "pandas/tslib.pyx":2789 + * # statictzinfo + * if not hasattr(tz, '_transition_info'): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":2790 + * if not hasattr(tz, '_transition_info'): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_29 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_28) { + + /* "pandas/tslib.pyx":2791 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2792 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L12_continue; + } + + /* "pandas/tslib.pyx":2793 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_32 = 0; + __pyx_t_11 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2794 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * else: + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2795 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_33 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L12_continue:; + } + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/tslib.pyx":2797 + * result[i] = _normalized_stamp(&dts) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "pandas/tslib.pyx":2798 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_28 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_28) { + + /* "pandas/tslib.pyx":2799 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2800 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L15_continue; + } + + /* "pandas/tslib.pyx":2801 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_37 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_pos.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_38 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_pos.diminfo[0].strides)); + __pyx_t_11 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2802 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = _normalized_stamp(&dts) + * + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2803 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + * result[i] = _normalized_stamp(&dts) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_39 < 0) { + __pyx_t_39 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_f_6pandas_5tslib__normalized_stamp((&__pyx_v_dts)); + __pyx_L15_continue:; + } + } + __pyx_L11:; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2805 + * result[i] = _normalized_stamp(&dts) + * + * return result # <<<<<<<<<<<<<< + * + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2751 + * return result + * + * cdef _normalize_local(ndarray[int64_t] stamps, object tz): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib._normalize_local", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF((PyObject *)__pyx_v_pos); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v__pos); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2807 + * return result + * + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.hour = 0 + * dts.min = 0 + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib__normalized_stamp(pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_normalized_stamp", 0); + + /* "pandas/tslib.pyx":2808 + * + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): + * dts.hour = 0 # <<<<<<<<<<<<<< + * dts.min = 0 + * dts.sec = 0 + */ + __pyx_v_dts->hour = 0; + + /* "pandas/tslib.pyx":2809 + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): + * dts.hour = 0 + * dts.min = 0 # <<<<<<<<<<<<<< + * dts.sec = 0 + * dts.us = 0 + */ + __pyx_v_dts->min = 0; + + /* "pandas/tslib.pyx":2810 + * dts.hour = 0 + * dts.min = 0 + * dts.sec = 0 # <<<<<<<<<<<<<< + * dts.us = 0 + * dts.ps = 0 + */ + __pyx_v_dts->sec = 0; + + /* "pandas/tslib.pyx":2811 + * dts.min = 0 + * dts.sec = 0 + * dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = 0; + + /* "pandas/tslib.pyx":2812 + * dts.sec = 0 + * dts.us = 0 + * dts.ps = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + + /* "pandas/tslib.pyx":2813 + * dts.us = 0 + * dts.ps = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2807 + * return result + * + * cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.hour = 0 + * dts.min = 0 + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2816 + * + * + * cdef inline void m8_populate_tsobject(int64_t stamp, _TSObject tso, object tz): # <<<<<<<<<<<<<< + * tso.value = stamp + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) + */ + +static CYTHON_INLINE void __pyx_f_6pandas_5tslib_m8_populate_tsobject(__pyx_t_5numpy_int64_t __pyx_v_stamp, struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_tso, PyObject *__pyx_v_tz) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("m8_populate_tsobject", 0); + + /* "pandas/tslib.pyx":2817 + * + * cdef inline void m8_populate_tsobject(int64_t stamp, _TSObject tso, object tz): + * tso.value = stamp # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) + * + */ + __pyx_v_tso->value = __pyx_v_stamp; + + /* "pandas/tslib.pyx":2818 + * cdef inline void m8_populate_tsobject(int64_t stamp, _TSObject tso, object tz): + * tso.value = stamp + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + pandas_datetime_to_datetimestruct(__pyx_v_tso->value, PANDAS_FR_ns, (&__pyx_v_tso->dts)); + + /* "pandas/tslib.pyx":2820 + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) + * + * if tz is not None: # <<<<<<<<<<<<<< + * _localize_tso(tso, tz) + * + */ + __pyx_t_1 = (__pyx_v_tz != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "pandas/tslib.pyx":2821 + * + * if tz is not None: + * _localize_tso(tso, tz) # <<<<<<<<<<<<<< + * + * + */ + __pyx_f_6pandas_5tslib__localize_tso(__pyx_v_tso, __pyx_v_tz); + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2816 + * + * + * cdef inline void m8_populate_tsobject(int64_t stamp, _TSObject tso, object tz): # <<<<<<<<<<<<<< + * tso.value = stamp + * pandas_datetime_to_datetimestruct(tso.value, PANDAS_FR_ns, &tso.dts) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "pandas/tslib.pyx":2824 + * + * + * def dates_normalized(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_67dates_normalized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_67dates_normalized = {__Pyx_NAMESTR("dates_normalized"), (PyCFunction)__pyx_pw_6pandas_5tslib_67dates_normalized, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_67dates_normalized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_stamps = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dates_normalized (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dates_normalized") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_stamps = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dates_normalized", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.dates_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_66dates_normalized(__pyx_self, __pyx_v_stamps, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_66dates_normalized(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_v_dt = NULL; + PyObject *__pyx_v_trans = NULL; + PyObject *__pyx_v_deltas = NULL; + PyObject *__pyx_v_pos = NULL; + CYTHON_UNUSED PyObject *__pyx_v_inf = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + npy_datetime __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dates_normalized", 0); + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2826 + * def dates_normalized(ndarray[int64_t] stamps, tz=None): + * cdef: + * Py_ssize_t i, n = len(stamps) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2829 + * pandas_datetimestruct dts + * + * if tz is None or _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_2 = (__pyx_v_tz == Py_None); + if (!(__pyx_t_2 != 0)) { + __pyx_t_3 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = (__pyx_t_2 != 0); + } + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2830 + * + * if tz is None or _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":2831 + * if tz is None or _is_utc(tz): + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2832 + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: # <<<<<<<<<<<<<< + * return False + * elif _is_tzlocal(tz): + */ + __pyx_t_4 = (((((__pyx_v_dts.hour + __pyx_v_dts.min) + __pyx_v_dts.sec) + __pyx_v_dts.us) > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2833 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz): + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":2834 + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2835 + * return False + * elif _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.min + dts.sec + dts.us) > 0: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":2836 + * elif _is_tzlocal(tz): + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * if (dts.min + dts.sec + dts.us) > 0: + * return False + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2837 + * for i in range(n): + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.min + dts.sec + dts.us) > 0: # <<<<<<<<<<<<<< + * return False + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, + */ + __pyx_t_4 = ((((__pyx_v_dts.min + __pyx_v_dts.sec) + __pyx_v_dts.us) > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2838 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * if (dts.min + dts.sec + dts.us) > 0: + * return False # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, + * dts.sec, dts.us, tz) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2839 + * if (dts.min + dts.sec + dts.us) > 0: + * return False + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, # <<<<<<<<<<<<<< + * dts.sec, dts.us, tz) + * dt = dt + tz.utcoffset(dt) + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + + /* "pandas/tslib.pyx":2840 + * return False + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, + * dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * dt = dt + tz.utcoffset(dt) + * if dt.hour > 0: + */ + __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/tslib.pyx":2839 + * if (dts.min + dts.sec + dts.us) > 0: + * return False + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, # <<<<<<<<<<<<<< + * dts.sec, dts.us, tz) + * dt = dt + tz.utcoffset(dt) + */ + __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_15); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":2841 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, dts.min, + * dts.sec, dts.us, tz) + * dt = dt + tz.utcoffset(dt) # <<<<<<<<<<<<<< + * if dt.hour > 0: + * return False + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_dt); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_dt); + __Pyx_GIVEREF(__pyx_v_dt); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_16, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyNumber_Add(__pyx_v_dt, __pyx_t_14); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":2842 + * dts.sec, dts.us, tz) + * dt = dt + tz.utcoffset(dt) + * if dt.hour > 0: # <<<<<<<<<<<<<< + * return False + * else: + */ + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_hour); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_14 = PyObject_RichCompare(__pyx_t_16, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2843 + * dt = dt + tz.utcoffset(dt) + * if dt.hour > 0: + * return False # <<<<<<<<<<<<<< + * else: + * trans = _get_transitions(tz) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":2845 + * return False + * else: + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * for i in range(n): + */ + __pyx_t_14 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_v_trans = __pyx_t_14; + __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":2846 + * else: + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * for i in range(n): + * # Adjust datetime64 timestamp, recompute datetimestruct + */ + __pyx_t_14 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_v_deltas = __pyx_t_14; + __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":2847 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * for i in range(n): # <<<<<<<<<<<<<< + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(stamps[i]) - 1 + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":2849 + * for i in range(n): + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(stamps[i]) - 1 # <<<<<<<<<<<<<< + * inf = tz._transition_info[pos] + * + */ + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_trans, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_15); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":2850 + * # Adjust datetime64 timestamp, recompute datetimestruct + * pos = trans.searchsorted(stamps[i]) - 1 + * inf = tz._transition_info[pos] # <<<<<<<<<<<<<< + * + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos], + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyObject_GetItem(__pyx_t_15, __pyx_v_pos); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_inf, __pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":2852 + * inf = tz._transition_info[pos] + * + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_16 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = PyNumber_Add(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_19 = __Pyx_PyInt_As_npy_int64(__pyx_t_14); if (unlikely((__pyx_t_19 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":2853 + * + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False + */ + pandas_datetime_to_datetimestruct(__pyx_t_19, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2854 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos], + * PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_4 = (((((__pyx_v_dts.hour + __pyx_v_dts.min) + __pyx_v_dts.sec) + __pyx_v_dts.us) > 0) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":2855 + * PANDAS_FR_ns, &dts) + * if (dts.hour + dts.min + dts.sec + dts.us) > 0: + * return False # <<<<<<<<<<<<<< + * + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + } + __pyx_L3:; + + /* "pandas/tslib.pyx":2857 + * return False + * + * return True # <<<<<<<<<<<<<< + * + * # Some general helper functions + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2824 + * + * + * def dates_normalized(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.dates_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_trans); + __Pyx_XDECREF(__pyx_v_deltas); + __Pyx_XDECREF(__pyx_v_pos); + __Pyx_XDECREF(__pyx_v_inf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2862 + * #---------------------------------------------------------------------- + * + * def isleapyear(int64_t year): # <<<<<<<<<<<<<< + * return is_leapyear(year) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_69isleapyear(PyObject *__pyx_self, PyObject *__pyx_arg_year); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_69isleapyear = {__Pyx_NAMESTR("isleapyear"), (PyCFunction)__pyx_pw_6pandas_5tslib_69isleapyear, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_69isleapyear(PyObject *__pyx_self, PyObject *__pyx_arg_year) { + __pyx_t_5numpy_int64_t __pyx_v_year; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isleapyear (wrapper)", 0); + assert(__pyx_arg_year); { + __pyx_v_year = __Pyx_PyInt_As_npy_int64(__pyx_arg_year); if (unlikely((__pyx_v_year == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.isleapyear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_68isleapyear(__pyx_self, ((__pyx_t_5numpy_int64_t)__pyx_v_year)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_68isleapyear(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_year) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isleapyear", 0); + + /* "pandas/tslib.pyx":2863 + * + * def isleapyear(int64_t year): + * return is_leapyear(year) # <<<<<<<<<<<<<< + * + * def monthrange(int64_t year, int64_t month): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(is_leapyear(__pyx_v_year)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2862 + * #---------------------------------------------------------------------- + * + * def isleapyear(int64_t year): # <<<<<<<<<<<<<< + * return is_leapyear(year) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.isleapyear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2865 + * return is_leapyear(year) + * + * def monthrange(int64_t year, int64_t month): # <<<<<<<<<<<<<< + * cdef: + * int64_t days + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_71monthrange(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_71monthrange = {__Pyx_NAMESTR("monthrange"), (PyCFunction)__pyx_pw_6pandas_5tslib_71monthrange, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_71monthrange(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_year; + __pyx_t_5numpy_int64_t __pyx_v_month; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("monthrange (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_year,&__pyx_n_s_month,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_year)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_month)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("monthrange", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monthrange") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_year = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_year == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_month = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_month == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("monthrange", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.monthrange", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_70monthrange(__pyx_self, __pyx_v_year, __pyx_v_month); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_70monthrange(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_year, __pyx_t_5numpy_int64_t __pyx_v_month) { + __pyx_t_5numpy_int64_t __pyx_v_days; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("monthrange", 0); + + /* "pandas/tslib.pyx":2870 + * int64_t day_of_week + * + * if month < 1 or month > 12: # <<<<<<<<<<<<<< + * raise ValueError("bad month number 0; must be 1-12") + * + */ + __pyx_t_1 = ((__pyx_v_month < 1) != 0); + if (!__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_month > 12) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":2871 + * + * if month < 1 or month > 12: + * raise ValueError("bad month number 0; must be 1-12") # <<<<<<<<<<<<<< + * + * days = days_per_month_table[is_leapyear(year)][month-1] + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2873 + * raise ValueError("bad month number 0; must be 1-12") + * + * days = days_per_month_table[is_leapyear(year)][month-1] # <<<<<<<<<<<<<< + * + * return (dayofweek(year, month, 1), days) + */ + __pyx_v_days = ((days_per_month_table[is_leapyear(__pyx_v_year)])[(__pyx_v_month - 1)]); + + /* "pandas/tslib.pyx":2875 + * days = days_per_month_table[is_leapyear(year)][month-1] + * + * return (dayofweek(year, month, 1), days) # <<<<<<<<<<<<<< + * + * cdef inline int64_t ts_dayofweek(_TSObject ts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyInt_From_int(dayofweek(__pyx_v_year, __pyx_v_month, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_days); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":2865 + * return is_leapyear(year) + * + * def monthrange(int64_t year, int64_t month): # <<<<<<<<<<<<<< + * cdef: + * int64_t days + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.monthrange", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2877 + * return (dayofweek(year, month, 1), days) + * + * cdef inline int64_t ts_dayofweek(_TSObject ts): # <<<<<<<<<<<<<< + * return dayofweek(ts.dts.year, ts.dts.month, ts.dts.day) + * + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_ts_dayofweek(struct __pyx_obj_6pandas_5tslib__TSObject *__pyx_v_ts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ts_dayofweek", 0); + + /* "pandas/tslib.pyx":2878 + * + * cdef inline int64_t ts_dayofweek(_TSObject ts): + * return dayofweek(ts.dts.year, ts.dts.month, ts.dts.day) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = dayofweek(__pyx_v_ts->dts.year, __pyx_v_ts->dts.month, __pyx_v_ts->dts.day); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2877 + * return (dayofweek(year, month, 1), days) + * + * cdef inline int64_t ts_dayofweek(_TSObject ts): # <<<<<<<<<<<<<< + * return dayofweek(ts.dts.year, ts.dts.month, ts.dts.day) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2881 + * + * + * cpdef normalize_date(object dt): # <<<<<<<<<<<<<< + * ''' + * Normalize datetime.datetime value to midnight. Returns datetime.date as a + */ + +static PyObject *__pyx_pw_6pandas_5tslib_73normalize_date(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_normalize_date(PyObject *__pyx_v_dt, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("normalize_date", 0); + + /* "pandas/tslib.pyx":2890 + * normalized : datetime.datetime or Timestamp + * ''' + * if PyDateTime_Check(dt): # <<<<<<<<<<<<<< + * return dt.replace(hour=0, minute=0, second=0, microsecond=0) + * elif PyDate_Check(dt): + */ + __pyx_t_1 = (PyDateTime_Check(__pyx_v_dt) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2891 + * ''' + * if PyDateTime_Check(dt): + * return dt.replace(hour=0, minute=0, second=0, microsecond=0) # <<<<<<<<<<<<<< + * elif PyDate_Check(dt): + * return datetime(dt.year, dt.month, dt.day) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hour, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_minute, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_second, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_microsecond, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":2892 + * if PyDateTime_Check(dt): + * return dt.replace(hour=0, minute=0, second=0, microsecond=0) + * elif PyDate_Check(dt): # <<<<<<<<<<<<<< + * return datetime(dt.year, dt.month, dt.day) + * else: + */ + __pyx_t_1 = (PyDate_Check(__pyx_v_dt) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":2893 + * return dt.replace(hour=0, minute=0, second=0, microsecond=0) + * elif PyDate_Check(dt): + * return datetime(dt.year, dt.month, dt.day) # <<<<<<<<<<<<<< + * else: + * raise TypeError('Unrecognized type: %s' % type(dt)) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_month); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_day); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":2895 + * return datetime(dt.year, dt.month, dt.day) + * else: + * raise TypeError('Unrecognized type: %s' % type(dt)) # <<<<<<<<<<<<<< + * + * cdef ndarray[int64_t] localize_dt64arr_to_period(ndarray[int64_t] stamps, + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_type_s, ((PyObject *)Py_TYPE(__pyx_v_dt))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2881 + * + * + * cpdef normalize_date(object dt): # <<<<<<<<<<<<<< + * ''' + * Normalize datetime.datetime value to midnight. Returns datetime.date as a + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.normalize_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_73normalize_date(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/ +static char __pyx_doc_6pandas_5tslib_72normalize_date[] = "\n Normalize datetime.datetime value to midnight. Returns datetime.date as a\n datetime.datetime at midnight\n\n Returns\n -------\n normalized : datetime.datetime or Timestamp\n "; +static PyObject *__pyx_pw_6pandas_5tslib_73normalize_date(PyObject *__pyx_self, PyObject *__pyx_v_dt) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("normalize_date (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_72normalize_date(__pyx_self, ((PyObject *)__pyx_v_dt)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_72normalize_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dt) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("normalize_date", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6pandas_5tslib_normalize_date(__pyx_v_dt, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.normalize_date", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":2897 + * raise TypeError('Unrecognized type: %s' % type(dt)) + * + * cdef ndarray[int64_t] localize_dt64arr_to_period(ndarray[int64_t] stamps, # <<<<<<<<<<<<<< + * int freq, object tz): + * cdef: + */ + +static PyArrayObject *__pyx_f_6pandas_5tslib_localize_dt64arr_to_period(PyArrayObject *__pyx_v_stamps, int __pyx_v_freq, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_result = 0; + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + PyArrayObject *__pyx_v_pos = 0; + pandas_datetimestruct __pyx_v_dts; + Py_ssize_t __pyx_v_i; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v__pos = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_pos; + __Pyx_Buffer __pyx_pybuffer_pos; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + PyArrayObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + __pyx_t_5numpy_int64_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + Py_ssize_t __pyx_t_23; + npy_datetime __pyx_t_24; + Py_ssize_t __pyx_t_25; + PyArrayObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + PyObject *__pyx_t_28 = NULL; + PyObject *__pyx_t_29 = NULL; + Py_ssize_t __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + long __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + Py_ssize_t __pyx_t_36; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + __pyx_t_5numpy_int64_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("localize_dt64arr_to_period", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_pos.pybuffer.buf = NULL; + __pyx_pybuffer_pos.refcount = 0; + __pyx_pybuffernd_pos.data = NULL; + __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":2900 + * int freq, object tz): + * cdef: + * Py_ssize_t n = len(stamps) # <<<<<<<<<<<<<< + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) + * ndarray[int64_t] trans, deltas, pos + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":2901 + * cdef: + * Py_ssize_t n = len(stamps) + * ndarray[int64_t] result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * ndarray[int64_t] trans, deltas, pos + * pandas_datetimestruct dts + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":2905 + * pandas_datetimestruct dts + * + * if not have_pytz: # <<<<<<<<<<<<<< + * raise Exception('Could not find pytz module') + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_have_pytz); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = ((!__pyx_t_8) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2906 + * + * if not have_pytz: + * raise Exception('Could not find pytz module') # <<<<<<<<<<<<<< + * + * if _is_utc(tz): + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2908 + * raise Exception('Could not find pytz module') + * + * if _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_9 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2909 + * + * if _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/tslib.pyx":2910 + * if _is_utc(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_11 < 0) { + __pyx_t_11 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2911 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_13 < 0) { + __pyx_t_13 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_13 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2912 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + goto __pyx_L5_continue; + } + + /* "pandas/tslib.pyx":2913 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2914 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * + */ + __pyx_t_15 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_15 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + __pyx_L5_continue:; + } + goto __pyx_L4; + } + + /* "pandas/tslib.pyx":2917 + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_9 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2918 + * + * elif _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/tslib.pyx":2919 + * elif _is_tzlocal(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2920 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + */ + __pyx_t_18 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2921 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + */ + goto __pyx_L8_continue; + } + + /* "pandas/tslib.pyx":2922 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, # <<<<<<<<<<<<<< + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_19 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2923 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2924 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":2925 + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + */ + __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_20 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_21 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + + /* "pandas/tslib.pyx":2924 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_22 = PyTuple_New(8); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_22, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_22, 5, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_22, 6, __pyx_t_21); + __Pyx_GIVEREF(__pyx_t_21); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_22, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_20 = 0; + __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_22, NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_21)); + __pyx_t_21 = 0; + + /* "pandas/tslib.pyx":2926 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + */ + __pyx_t_21 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_22 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_21)); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22); + __Pyx_GIVEREF(__pyx_t_22); + __pyx_t_22 = 0; + __pyx_t_22 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_21, NULL); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = PyNumber_Multiply(__pyx_t_22, __pyx_int_1000000000); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_21); + __pyx_t_21 = 0; + + /* "pandas/tslib.pyx":2927 + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + __pyx_t_23 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_21 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_22 = PyNumber_Add(__pyx_t_21, __pyx_v_delta); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_24 = __Pyx_PyInt_As_npy_int64(__pyx_t_22); if (unlikely((__pyx_t_24 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + + /* "pandas/tslib.pyx":2928 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + pandas_datetime_to_datetimestruct(__pyx_t_24, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2929 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + */ + __pyx_t_15 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_15 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_25 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + __pyx_L8_continue:; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":2933 + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + */ + __pyx_t_22 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + if (!(likely(((__pyx_t_22) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_22, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_26 = ((PyArrayObject *)__pyx_t_22); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_29); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_27, __pyx_t_28, __pyx_t_29); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_22); + __pyx_t_22 = 0; + + /* "pandas/tslib.pyx":2934 + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + */ + __pyx_t_22 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + if (!(likely(((__pyx_t_22) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_22, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_26 = ((PyArrayObject *)__pyx_t_22); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_27); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_29, __pyx_t_28, __pyx_t_27); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_22); + __pyx_t_22 = 0; + + /* "pandas/tslib.pyx":2935 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 # <<<<<<<<<<<<<< + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + */ + __pyx_t_22 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_22); + __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_INCREF(((PyObject *)__pyx_v_stamps)); + PyTuple_SET_ITEM(__pyx_t_21, 0, ((PyObject *)__pyx_v_stamps)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_stamps)); + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_21, __pyx_t_20); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyNumber_Subtract(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v__pos = __pyx_t_20; + __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2936 + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: # <<<<<<<<<<<<<< + * _pos = _pos.astype(np.int64) + * pos = _pos + */ + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_dtype); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_20, __pyx_t_21, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "pandas/tslib.pyx":2937 + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) # <<<<<<<<<<<<<< + * pos = _pos + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_21 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); + PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_20); + __pyx_t_20 = 0; + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_21, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF_SET(__pyx_v__pos, __pyx_t_20); + __pyx_t_20 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":2938 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + * pos = _pos # <<<<<<<<<<<<<< + * + * # statictzinfo + */ + if (!(likely(((__pyx_v__pos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__pos, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __pyx_v__pos; + __Pyx_INCREF(__pyx_t_20); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_20), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_12 < 0)) { + PyErr_Fetch(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_29); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_27, __pyx_t_28, __pyx_t_29); + } + } + __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_pos = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; + + /* "pandas/tslib.pyx":2941 + * + * # statictzinfo + * if not hasattr(tz, '_transition_info'): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_9 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2942 + * # statictzinfo + * if not hasattr(tz, '_transition_info'): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/tslib.pyx":2943 + * if not hasattr(tz, '_transition_info'): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_30 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2944 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + */ + __pyx_t_31 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_31 < 0) { + __pyx_t_31 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_31 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2945 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L13_continue; + } + + /* "pandas/tslib.pyx":2946 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_32 < 0) { + __pyx_t_32 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_32 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_33 = 0; + __pyx_t_12 = -1; + if (__pyx_t_33 < 0) { + __pyx_t_33 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_33 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2947 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2948 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + */ + __pyx_t_15 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_15 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_34 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_34 < 0) { + __pyx_t_34 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_34 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_15; + __pyx_L13_continue:; + } + goto __pyx_L12; + } + /*else*/ { + + /* "pandas/tslib.pyx":2951 + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "pandas/tslib.pyx":2952 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * result[i] = NPY_NAT + * continue + */ + __pyx_t_35 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_35 < 0) { + __pyx_t_35 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_35 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_8) { + + /* "pandas/tslib.pyx":2953 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + */ + __pyx_t_36 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_36 < 0) { + __pyx_t_36 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_36 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_6pandas_5tslib_NPY_NAT; + + /* "pandas/tslib.pyx":2954 + * if stamps[i] == NPY_NAT: + * result[i] = NPY_NAT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L16_continue; + } + + /* "pandas/tslib.pyx":2955 + * result[i] = NPY_NAT + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_37 < 0) { + __pyx_t_37 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_38 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_38 < 0) { + __pyx_t_38 += __pyx_pybuffernd_pos.diminfo[0].shape; + if (unlikely(__pyx_t_38 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_pos.diminfo[0].strides)); + __pyx_t_12 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":2956 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":2957 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + * result[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * + */ + __pyx_t_39 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_39 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_40 = __pyx_v_i; + __pyx_t_12 = -1; + if (__pyx_t_40 < 0) { + __pyx_t_40 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_40 < 0)) __pyx_t_12 = 0; + } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_12 = 0; + if (unlikely(__pyx_t_12 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_12); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_39; + __pyx_L16_continue:; + } + } + __pyx_L12:; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":2960 + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyArrayObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":2897 + * raise TypeError('Unrecognized type: %s' % type(dt)) + * + * cdef ndarray[int64_t] localize_dt64arr_to_period(ndarray[int64_t] stamps, # <<<<<<<<<<<<<< + * int freq, object tz): + * cdef: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_22); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.localize_dt64arr_to_period", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF((PyObject *)__pyx_v_pos); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v__pos); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3024 + * #---------------------------------------------------------------------- + * + * cdef inline int64_t apply_mult(int64_t period_ord, int64_t mult): # <<<<<<<<<<<<<< + * """ + * Get freq+multiple ordinal value from corresponding freq-only ordinal value. + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_apply_mult(__pyx_t_5numpy_int64_t __pyx_v_period_ord, __pyx_t_5numpy_int64_t __pyx_v_mult) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("apply_mult", 0); + + /* "pandas/tslib.pyx":3030 + * integer). + * """ + * if mult == 1: # <<<<<<<<<<<<<< + * return period_ord + * + */ + __pyx_t_1 = ((__pyx_v_mult == 1) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3031 + * """ + * if mult == 1: + * return period_ord # <<<<<<<<<<<<<< + * + * return (period_ord - 1) // mult + */ + __pyx_r = __pyx_v_period_ord; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3033 + * return period_ord + * + * return (period_ord - 1) // mult # <<<<<<<<<<<<<< + * + * cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult): + */ + __pyx_t_2 = (__pyx_v_period_ord - 1); + if (unlikely(__pyx_v_mult == 0)) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + else if (sizeof(__pyx_t_5numpy_int64_t) == sizeof(long) && unlikely(__pyx_v_mult == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_2))) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); + #endif + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + #ifdef WITH_THREAD + PyGILState_Release(__pyx_gilstate_save); + #endif + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_r = __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_2, __pyx_v_mult); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3024 + * #---------------------------------------------------------------------- + * + * cdef inline int64_t apply_mult(int64_t period_ord, int64_t mult): # <<<<<<<<<<<<<< + * """ + * Get freq+multiple ordinal value from corresponding freq-only ordinal value. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("pandas.tslib.apply_mult", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3035 + * return (period_ord - 1) // mult + * + * cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult): # <<<<<<<<<<<<<< + * """ + * Get freq-only ordinal value from corresponding freq+multiple ordinal. + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_remove_mult(__pyx_t_5numpy_int64_t __pyx_v_period_ord_w_mult, __pyx_t_5numpy_int64_t __pyx_v_mult) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("remove_mult", 0); + + /* "pandas/tslib.pyx":3039 + * Get freq-only ordinal value from corresponding freq+multiple ordinal. + * """ + * if mult == 1: # <<<<<<<<<<<<<< + * return period_ord_w_mult + * + */ + __pyx_t_1 = ((__pyx_v_mult == 1) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3040 + * """ + * if mult == 1: + * return period_ord_w_mult # <<<<<<<<<<<<<< + * + * return period_ord_w_mult * mult + 1; + */ + __pyx_r = __pyx_v_period_ord_w_mult; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3042 + * return period_ord_w_mult + * + * return period_ord_w_mult * mult + 1; # <<<<<<<<<<<<<< + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): + */ + __pyx_r = ((__pyx_v_period_ord_w_mult * __pyx_v_mult) + 1); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3035 + * return (period_ord - 1) // mult + * + * cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult): # <<<<<<<<<<<<<< + * """ + * Get freq-only ordinal value from corresponding freq+multiple ordinal. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3044 + * return period_ord_w_mult * mult + 1; + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): # <<<<<<<<<<<<<< + * """ + * Convert array of datetime64 values (passed in as 'i8' dtype) to a set of + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_75dt64arr_to_periodarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_74dt64arr_to_periodarr[] = "\n Convert array of datetime64 values (passed in as 'i8' dtype) to a set of\n periods corresponding to desired frequency, per period convention.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_75dt64arr_to_periodarr = {__Pyx_NAMESTR("dt64arr_to_periodarr"), (PyCFunction)__pyx_pw_6pandas_5tslib_75dt64arr_to_periodarr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_74dt64arr_to_periodarr)}; +static PyObject *__pyx_pw_6pandas_5tslib_75dt64arr_to_periodarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_dtarr = 0; + int __pyx_v_freq; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dt64arr_to_periodarr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtarr,&__pyx_n_s_freq,&__pyx_n_s_tz,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtarr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dt64arr_to_periodarr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dtarr = ((PyArrayObject *)values[0]); + __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_tz = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.dt64arr_to_periodarr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtarr), __pyx_ptype_5numpy_ndarray, 1, "dtarr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_74dt64arr_to_periodarr(__pyx_self, __pyx_v_dtarr, __pyx_v_freq, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_74dt64arr_to_periodarr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dtarr, int __pyx_v_freq, PyObject *__pyx_v_tz) { + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_l; + pandas_datetimestruct __pyx_v_dts; + __Pyx_LocalBuf_ND __pyx_pybuffernd_dtarr; + __Pyx_Buffer __pyx_pybuffer_dtarr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + __pyx_t_5numpy_int64_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dt64arr_to_periodarr", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_dtarr.pybuffer.buf = NULL; + __pyx_pybuffer_dtarr.refcount = 0; + __pyx_pybuffernd_dtarr.data = NULL; + __pyx_pybuffernd_dtarr.rcbuffer = &__pyx_pybuffer_dtarr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dtarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_dtarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_dtarr.diminfo[0].strides = __pyx_pybuffernd_dtarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dtarr.diminfo[0].shape = __pyx_pybuffernd_dtarr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3054 + * pandas_datetimestruct dts + * + * l = len(dtarr) # <<<<<<<<<<<<<< + * + * out = np.empty(l, dtype='i8') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_dtarr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_l = __pyx_t_1; + + /* "pandas/tslib.pyx":3056 + * l = len(dtarr) + * + * out = np.empty(l, dtype='i8') # <<<<<<<<<<<<<< + * + * if tz is None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3058 + * out = np.empty(l, dtype='i8') + * + * if tz is None: # <<<<<<<<<<<<<< + * for i in range(l): + * if dtarr[i] == iNaT: + */ + __pyx_t_11 = (__pyx_v_tz == Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3059 + * + * if tz is None: + * for i in range(l): # <<<<<<<<<<<<<< + * if dtarr[i] == iNaT: + * out[i] = iNaT + */ + __pyx_t_1 = __pyx_v_l; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_1; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/tslib.pyx":3060 + * if tz is None: + * for i in range(l): + * if dtarr[i] == iNaT: # <<<<<<<<<<<<<< + * out[i] = iNaT + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_dtarr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_dtarr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtarr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_dtarr.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3061 + * for i in range(l): + * if dtarr[i] == iNaT: + * out[i] = iNaT # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(dtarr[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_15 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_15; + + /* "pandas/tslib.pyx":3062 + * if dtarr[i] == iNaT: + * out[i] = iNaT + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(dtarr[i], PANDAS_FR_ns, &dts) + * out[i] = get_period_ordinal(dts.year, dts.month, dts.day, + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":3063 + * out[i] = iNaT + * continue + * pandas_datetime_to_datetimestruct(dtarr[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * out[i] = get_period_ordinal(dts.year, dts.month, dts.day, + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_dtarr.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dtarr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dtarr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dtarr.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3064 + * continue + * pandas_datetime_to_datetimestruct(dtarr[i], PANDAS_FR_ns, &dts) + * out[i] = get_period_ordinal(dts.year, dts.month, dts.day, # <<<<<<<<<<<<<< + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + */ + __pyx_t_15 = get_period_ordinal(__pyx_v_dts.year, __pyx_v_dts.month, __pyx_v_dts.day, __pyx_v_dts.hour, __pyx_v_dts.min, __pyx_v_dts.sec, __pyx_v_dts.us, __pyx_v_dts.ps, __pyx_v_freq); if (unlikely(__pyx_t_15 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_15; + __pyx_L4_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3067 + * dts.hour, dts.min, dts.sec, dts.us, dts.ps, freq) + * else: + * out = localize_dt64arr_to_period(dtarr, freq, tz) # <<<<<<<<<<<<<< + * return out + * + */ + __pyx_t_4 = ((PyObject *)__pyx_f_6pandas_5tslib_localize_dt64arr_to_period(((PyArrayObject *)__pyx_v_dtarr), __pyx_v_freq, __pyx_v_tz)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF_SET(__pyx_v_out, ((PyArrayObject *)__pyx_t_4)); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3068 + * else: + * out = localize_dt64arr_to_period(dtarr, freq, tz) + * return out # <<<<<<<<<<<<<< + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3044 + * return period_ord_w_mult * mult + 1; + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): # <<<<<<<<<<<<<< + * """ + * Convert array of datetime64 values (passed in as 'i8' dtype) to a set of + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtarr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.dt64arr_to_periodarr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dtarr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3070 + * return out + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): # <<<<<<<<<<<<<< + * """ + * Convert array to datetime64 values from a set of ordinals corresponding to + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_77periodarr_to_dt64arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_76periodarr_to_dt64arr[] = "\n Convert array to datetime64 values from a set of ordinals corresponding to\n periods per period convention.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_77periodarr_to_dt64arr = {__Pyx_NAMESTR("periodarr_to_dt64arr"), (PyCFunction)__pyx_pw_6pandas_5tslib_77periodarr_to_dt64arr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_76periodarr_to_dt64arr)}; +static PyObject *__pyx_pw_6pandas_5tslib_77periodarr_to_dt64arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_periodarr = 0; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("periodarr_to_dt64arr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_periodarr,&__pyx_n_s_freq,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_periodarr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("periodarr_to_dt64arr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodarr_to_dt64arr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_periodarr = ((PyArrayObject *)values[0]); + __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("periodarr_to_dt64arr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.periodarr_to_dt64arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_periodarr), __pyx_ptype_5numpy_ndarray, 1, "periodarr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_76periodarr_to_dt64arr(__pyx_self, __pyx_v_periodarr, __pyx_v_freq); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_76periodarr_to_dt64arr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_periodarr, int __pyx_v_freq) { + PyArrayObject *__pyx_v_out = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_l; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + __Pyx_LocalBuf_ND __pyx_pybuffernd_periodarr; + __Pyx_Buffer __pyx_pybuffer_periodarr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + __pyx_t_5numpy_int64_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("periodarr_to_dt64arr", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_periodarr.pybuffer.buf = NULL; + __pyx_pybuffer_periodarr.refcount = 0; + __pyx_pybuffernd_periodarr.data = NULL; + __pyx_pybuffernd_periodarr.rcbuffer = &__pyx_pybuffer_periodarr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_periodarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_periodarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_periodarr.diminfo[0].strides = __pyx_pybuffernd_periodarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_periodarr.diminfo[0].shape = __pyx_pybuffernd_periodarr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3079 + * Py_ssize_t i, l + * + * l = len(periodarr) # <<<<<<<<<<<<<< + * + * out = np.empty(l, dtype='i8') + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_periodarr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_l = __pyx_t_1; + + /* "pandas/tslib.pyx":3081 + * l = len(periodarr) + * + * out = np.empty(l, dtype='i8') # <<<<<<<<<<<<<< + * + * for i in range(l): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_7 < 0)) { + PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3083 + * out = np.empty(l, dtype='i8') + * + * for i in range(l): # <<<<<<<<<<<<<< + * if periodarr[i] == iNaT: + * out[i] = iNaT + */ + __pyx_t_1 = __pyx_v_l; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "pandas/tslib.pyx":3084 + * + * for i in range(l): + * if periodarr[i] == iNaT: # <<<<<<<<<<<<<< + * out[i] = iNaT + * continue + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_periodarr.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_periodarr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_periodarr.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_periodarr.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":3085 + * for i in range(l): + * if periodarr[i] == iNaT: + * out[i] = iNaT # <<<<<<<<<<<<<< + * continue + * out[i] = period_ordinal_to_dt64(periodarr[i], freq) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_14 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_14; + + /* "pandas/tslib.pyx":3086 + * if periodarr[i] == iNaT: + * out[i] = iNaT + * continue # <<<<<<<<<<<<<< + * out[i] = period_ordinal_to_dt64(periodarr[i], freq) + * + */ + goto __pyx_L3_continue; + } + + /* "pandas/tslib.pyx":3087 + * out[i] = iNaT + * continue + * out[i] = period_ordinal_to_dt64(periodarr[i], freq) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_periodarr.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_periodarr.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_7 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_7 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_7); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_f_6pandas_5tslib_period_ordinal_to_dt64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_periodarr.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_periodarr.diminfo[0].strides)), __pyx_v_freq, 0); + __pyx_L3_continue:; + } + + /* "pandas/tslib.pyx":3089 + * out[i] = period_ordinal_to_dt64(periodarr[i], freq) + * + * return out # <<<<<<<<<<<<<< + * + * cdef char START = 'S' + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3070 + * return out + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): # <<<<<<<<<<<<<< + * """ + * Convert array to datetime64 values from a set of ordinals corresponding to + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_periodarr.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.periodarr_to_dt64arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_periodarr.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3094 + * cdef char END = 'E' + * + * cpdef int64_t period_asfreq(int64_t period_ordinal, int freq1, int freq2, # <<<<<<<<<<<<<< + * bint end): + * """ + */ + +static PyObject *__pyx_pw_6pandas_5tslib_79period_asfreq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_period_asfreq(__pyx_t_5numpy_int64_t __pyx_v_period_ordinal, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end, CYTHON_UNUSED int __pyx_skip_dispatch) { + __pyx_t_5numpy_int64_t __pyx_v_retval; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_asfreq", 0); + + /* "pandas/tslib.pyx":3103 + * int64_t retval + * + * if period_ordinal == iNaT: # <<<<<<<<<<<<<< + * return iNaT + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_period_ordinal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3104 + * + * if period_ordinal == iNaT: + * return iNaT # <<<<<<<<<<<<<< + * + * if end: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3106 + * return iNaT + * + * if end: # <<<<<<<<<<<<<< + * retval = asfreq(period_ordinal, freq1, freq2, END) + * else: + */ + __pyx_t_4 = (__pyx_v_end != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3107 + * + * if end: + * retval = asfreq(period_ordinal, freq1, freq2, END) # <<<<<<<<<<<<<< + * else: + * retval = asfreq(period_ordinal, freq1, freq2, START) + */ + __pyx_t_5 = asfreq(__pyx_v_period_ordinal, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_6pandas_5tslib_END); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_retval = __pyx_t_5; + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":3109 + * retval = asfreq(period_ordinal, freq1, freq2, END) + * else: + * retval = asfreq(period_ordinal, freq1, freq2, START) # <<<<<<<<<<<<<< + * + * if retval == INT32_MIN: + */ + __pyx_t_5 = asfreq(__pyx_v_period_ordinal, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_6pandas_5tslib_START); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_retval = __pyx_t_5; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":3111 + * retval = asfreq(period_ordinal, freq1, freq2, START) + * + * if retval == INT32_MIN: # <<<<<<<<<<<<<< + * raise ValueError('Frequency conversion failed') + * + */ + __pyx_t_4 = ((__pyx_v_retval == INT32_MIN) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3112 + * + * if retval == INT32_MIN: + * raise ValueError('Frequency conversion failed') # <<<<<<<<<<<<<< + * + * return retval + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3114 + * raise ValueError('Frequency conversion failed') + * + * return retval # <<<<<<<<<<<<<< + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): + */ + __pyx_r = __pyx_v_retval; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3094 + * cdef char END = 'E' + * + * cpdef int64_t period_asfreq(int64_t period_ordinal, int freq1, int freq2, # <<<<<<<<<<<<<< + * bint end): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("pandas.tslib.period_asfreq", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_79period_asfreq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_78period_asfreq[] = "\n Convert period ordinal from one frequency to another, and if upsampling,\n choose to use start ('S') or end ('E') of period.\n "; +static PyObject *__pyx_pw_6pandas_5tslib_79period_asfreq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_period_ordinal; + int __pyx_v_freq1; + int __pyx_v_freq2; + int __pyx_v_end; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_asfreq (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_period_ordinal,&__pyx_n_s_freq1,&__pyx_n_s_freq2,&__pyx_n_s_end,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_period_ordinal)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_asfreq") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_period_ordinal = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_period_ordinal == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq1 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq2 = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_freq2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_end = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3095; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_asfreq", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_asfreq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_78period_asfreq(__pyx_self, __pyx_v_period_ordinal, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_end); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_78period_asfreq(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_period_ordinal, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_asfreq", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_f_6pandas_5tslib_period_asfreq(__pyx_v_period_ordinal, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_end, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.period_asfreq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3116 + * return retval + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): # <<<<<<<<<<<<<< + * """ + * Convert int64-array of period ordinals from one frequency to another, and + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_81period_asfreq_arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_80period_asfreq_arr[] = "\n Convert int64-array of period ordinals from one frequency to another, and\n if upsampling, choose to use start ('S') or end ('E') of period.\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_81period_asfreq_arr = {__Pyx_NAMESTR("period_asfreq_arr"), (PyCFunction)__pyx_pw_6pandas_5tslib_81period_asfreq_arr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_80period_asfreq_arr)}; +static PyObject *__pyx_pw_6pandas_5tslib_81period_asfreq_arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_freq1; + int __pyx_v_freq2; + int __pyx_v_end; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_asfreq_arr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_freq1,&__pyx_n_s_freq2,&__pyx_n_s_end,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq1)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq_arr", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq_arr", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_asfreq_arr", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_asfreq_arr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_arr = ((PyArrayObject *)values[0]); + __pyx_v_freq1 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq2 = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_freq2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_end = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_asfreq_arr", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_asfreq_arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_80period_asfreq_arr(__pyx_self, __pyx_v_arr, __pyx_v_freq1, __pyx_v_freq2, __pyx_v_end); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_80period_asfreq_arr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int __pyx_v_freq1, int __pyx_v_freq2, int __pyx_v_end) { + PyArrayObject *__pyx_v_result = 0; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + freq_conv_func __pyx_v_func; + asfreq_info __pyx_v_finfo; + __pyx_t_5numpy_int64_t __pyx_v_val; + char __pyx_v_relation; + PyObject *__pyx_v_mask = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_result; + __Pyx_Buffer __pyx_pybuffer_result; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_asfreq_arr", 0); + __pyx_pybuffer_result.pybuffer.buf = NULL; + __pyx_pybuffer_result.refcount = 0; + __pyx_pybuffernd_result.data = NULL; + __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3129 + * char relation + * + * n = len(arr) # <<<<<<<<<<<<<< + * result = np.empty(n, dtype=np.int64) + * + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":3130 + * + * n = len(arr) + * result = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * + * func = get_asfreq_func(freq1, freq2) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + } + __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3132 + * result = np.empty(n, dtype=np.int64) + * + * func = get_asfreq_func(freq1, freq2) # <<<<<<<<<<<<<< + * get_asfreq_info(freq1, freq2, &finfo) + * + */ + __pyx_v_func = get_asfreq_func(__pyx_v_freq1, __pyx_v_freq2); + + /* "pandas/tslib.pyx":3133 + * + * func = get_asfreq_func(freq1, freq2) + * get_asfreq_info(freq1, freq2, &finfo) # <<<<<<<<<<<<<< + * + * if end: + */ + get_asfreq_info(__pyx_v_freq1, __pyx_v_freq2, (&__pyx_v_finfo)); + + /* "pandas/tslib.pyx":3135 + * get_asfreq_info(freq1, freq2, &finfo) + * + * if end: # <<<<<<<<<<<<<< + * relation = END + * else: + */ + __pyx_t_12 = (__pyx_v_end != 0); + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3136 + * + * if end: + * relation = END # <<<<<<<<<<<<<< + * else: + * relation = START + */ + __pyx_v_relation = __pyx_v_6pandas_5tslib_END; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3138 + * relation = END + * else: + * relation = START # <<<<<<<<<<<<<< + * + * mask = arr == iNaT + */ + __pyx_v_relation = __pyx_v_6pandas_5tslib_START; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3140 + * relation = START + * + * mask = arr == iNaT # <<<<<<<<<<<<<< + * if mask.any(): # NaT process + * for i in range(n): + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_arr), __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_mask = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3141 + * + * mask = arr == iNaT + * if mask.any(): # NaT process # <<<<<<<<<<<<<< + * for i in range(n): + * val = arr[i] + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3142 + * mask = arr == iNaT + * if mask.any(): # NaT process + * for i in range(n): # <<<<<<<<<<<<<< + * val = arr[i] + * if val != iNaT: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_1; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/tslib.pyx":3143 + * if mask.any(): # NaT process + * for i in range(n): + * val = arr[i] # <<<<<<<<<<<<<< + * if val != iNaT: + * val = func(val, relation, &finfo) + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides)); + + /* "pandas/tslib.pyx":3144 + * for i in range(n): + * val = arr[i] + * if val != iNaT: # <<<<<<<<<<<<<< + * val = func(val, relation, &finfo) + * if val == INT32_MIN: + */ + __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3145 + * val = arr[i] + * if val != iNaT: + * val = func(val, relation, &finfo) # <<<<<<<<<<<<<< + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") + */ + __pyx_v_val = __pyx_v_func(__pyx_v_val, __pyx_v_relation, (&__pyx_v_finfo)); + + /* "pandas/tslib.pyx":3146 + * if val != iNaT: + * val = func(val, relation, &finfo) + * if val == INT32_MIN: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert to desired frequency.") + * result[i] = val + */ + __pyx_t_12 = ((__pyx_v_val == INT32_MIN) != 0); + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3147 + * val = func(val, relation, &finfo) + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") # <<<<<<<<<<<<<< + * result[i] = val + * else: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + goto __pyx_L7; + } + __pyx_L7:; + + /* "pandas/tslib.pyx":3148 + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") + * result[i] = val # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val; + } + goto __pyx_L4; + } + /*else*/ { + + /* "pandas/tslib.pyx":3150 + * result[i] = val + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * val = func(arr[i], relation, &finfo) + * if val == INT32_MIN: + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_1; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/tslib.pyx":3151 + * else: + * for i in range(n): + * val = func(arr[i], relation, &finfo) # <<<<<<<<<<<<<< + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_val = __pyx_v_func((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_arr.diminfo[0].strides)), __pyx_v_relation, (&__pyx_v_finfo)); + + /* "pandas/tslib.pyx":3152 + * for i in range(n): + * val = func(arr[i], relation, &finfo) + * if val == INT32_MIN: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert to desired frequency.") + * result[i] = val + */ + __pyx_t_12 = ((__pyx_v_val == INT32_MIN) != 0); + if (__pyx_t_12) { + + /* "pandas/tslib.pyx":3153 + * val = func(arr[i], relation, &finfo) + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") # <<<<<<<<<<<<<< + * result[i] = val + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3154 + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") + * result[i] = val # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_8 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_result.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0; + if (unlikely(__pyx_t_8 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_8); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_v_val; + } + } + __pyx_L4:; + + /* "pandas/tslib.pyx":3156 + * result[i] = val + * + * return result # <<<<<<<<<<<<<< + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3116 + * return retval + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): # <<<<<<<<<<<<<< + * """ + * Convert int64-array of period ordinals from one frequency to another, and + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.period_asfreq_arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3158 + * return result + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): # <<<<<<<<<<<<<< + * cdef: + * int64_t ordinal + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_83period_ordinal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_83period_ordinal = {__Pyx_NAMESTR("period_ordinal"), (PyCFunction)__pyx_pw_6pandas_5tslib_83period_ordinal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_83period_ordinal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_y; + int __pyx_v_m; + int __pyx_v_d; + int __pyx_v_h; + int __pyx_v_min; + int __pyx_v_s; + int __pyx_v_us; + int __pyx_v_ps; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_ordinal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_m,&__pyx_n_s_d,&__pyx_n_s_h,&__pyx_n_s_min,&__pyx_n_s_s,&__pyx_n_s_us,&__pyx_n_s_ps,&__pyx_n_s_freq,0}; + PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 6: + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_us)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 7: + if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ps)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 8: + if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_ordinal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + } + __pyx_v_y = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_d = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_d == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_h = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_h == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_min == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_s = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_s == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_us = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_us == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_ps = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ps == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_ordinal", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_82period_ordinal(__pyx_self, __pyx_v_y, __pyx_v_m, __pyx_v_d, __pyx_v_h, __pyx_v_min, __pyx_v_s, __pyx_v_us, __pyx_v_ps, __pyx_v_freq); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_82period_ordinal(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_y, int __pyx_v_m, int __pyx_v_d, int __pyx_v_h, int __pyx_v_min, int __pyx_v_s, int __pyx_v_us, int __pyx_v_ps, int __pyx_v_freq) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __pyx_t_5numpy_int64_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_ordinal", 0); + + /* "pandas/tslib.pyx":3162 + * int64_t ordinal + * + * return get_period_ordinal(y, m, d, h, min, s, us, ps, freq) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = get_period_ordinal(__pyx_v_y, __pyx_v_m, __pyx_v_d, __pyx_v_h, __pyx_v_min, __pyx_v_s, __pyx_v_us, __pyx_v_ps, __pyx_v_freq); if (unlikely(__pyx_t_1 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3158 + * return result + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): # <<<<<<<<<<<<<< + * cdef: + * int64_t ordinal + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.period_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3165 + * + * + * cpdef int64_t period_ordinal_to_dt64(int64_t ordinal, int freq): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + +static PyObject *__pyx_pw_6pandas_5tslib_85period_ordinal_to_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static __pyx_t_5numpy_int64_t __pyx_f_6pandas_5tslib_period_ordinal_to_dt64(__pyx_t_5numpy_int64_t __pyx_v_ordinal, int __pyx_v_freq, CYTHON_UNUSED int __pyx_skip_dispatch) { + pandas_datetimestruct __pyx_v_dts; + date_info __pyx_v_dinfo; + float __pyx_v_subsecond_fraction; + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_ordinal_to_dt64", 0); + + /* "pandas/tslib.pyx":3171 + * float subsecond_fraction + * + * if ordinal == iNaT: # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_ordinal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3172 + * + * if ordinal == iNaT: + * return NPY_NAT # <<<<<<<<<<<<<< + * + * get_date_info(ordinal, freq, &dinfo) + */ + __pyx_r = __pyx_v_6pandas_5tslib_NPY_NAT; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3174 + * return NPY_NAT + * + * get_date_info(ordinal, freq, &dinfo) # <<<<<<<<<<<<<< + * + * dts.year = dinfo.year + */ + __pyx_t_5 = get_date_info(__pyx_v_ordinal, __pyx_v_freq, (&__pyx_v_dinfo)); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3176 + * get_date_info(ordinal, freq, &dinfo) + * + * dts.year = dinfo.year # <<<<<<<<<<<<<< + * dts.month = dinfo.month + * dts.day = dinfo.day + */ + __pyx_t_5 = __pyx_v_dinfo.year; + __pyx_v_dts.year = __pyx_t_5; + + /* "pandas/tslib.pyx":3177 + * + * dts.year = dinfo.year + * dts.month = dinfo.month # <<<<<<<<<<<<<< + * dts.day = dinfo.day + * dts.hour = dinfo.hour + */ + __pyx_t_5 = __pyx_v_dinfo.month; + __pyx_v_dts.month = __pyx_t_5; + + /* "pandas/tslib.pyx":3178 + * dts.year = dinfo.year + * dts.month = dinfo.month + * dts.day = dinfo.day # <<<<<<<<<<<<<< + * dts.hour = dinfo.hour + * dts.min = dinfo.minute + */ + __pyx_t_5 = __pyx_v_dinfo.day; + __pyx_v_dts.day = __pyx_t_5; + + /* "pandas/tslib.pyx":3179 + * dts.month = dinfo.month + * dts.day = dinfo.day + * dts.hour = dinfo.hour # <<<<<<<<<<<<<< + * dts.min = dinfo.minute + * dts.sec = int(dinfo.second) + */ + __pyx_t_5 = __pyx_v_dinfo.hour; + __pyx_v_dts.hour = __pyx_t_5; + + /* "pandas/tslib.pyx":3180 + * dts.day = dinfo.day + * dts.hour = dinfo.hour + * dts.min = dinfo.minute # <<<<<<<<<<<<<< + * dts.sec = int(dinfo.second) + * subsecond_fraction = dinfo.second - dts.sec + */ + __pyx_t_5 = __pyx_v_dinfo.minute; + __pyx_v_dts.min = __pyx_t_5; + + /* "pandas/tslib.pyx":3181 + * dts.hour = dinfo.hour + * dts.min = dinfo.minute + * dts.sec = int(dinfo.second) # <<<<<<<<<<<<<< + * subsecond_fraction = dinfo.second - dts.sec + * dts.us = int((subsecond_fraction) * 1e6) + */ + __pyx_v_dts.sec = ((npy_int32)__pyx_v_dinfo.second); + + /* "pandas/tslib.pyx":3182 + * dts.min = dinfo.minute + * dts.sec = int(dinfo.second) + * subsecond_fraction = dinfo.second - dts.sec # <<<<<<<<<<<<<< + * dts.us = int((subsecond_fraction) * 1e6) + * dts.ps = int(((subsecond_fraction) * 1e6 - dts.us) * 1e6) + */ + __pyx_v_subsecond_fraction = (__pyx_v_dinfo.second - __pyx_v_dts.sec); + + /* "pandas/tslib.pyx":3183 + * dts.sec = int(dinfo.second) + * subsecond_fraction = dinfo.second - dts.sec + * dts.us = int((subsecond_fraction) * 1e6) # <<<<<<<<<<<<<< + * dts.ps = int(((subsecond_fraction) * 1e6 - dts.us) * 1e6) + * + */ + __pyx_v_dts.us = ((npy_int32)(__pyx_v_subsecond_fraction * 1e6)); + + /* "pandas/tslib.pyx":3184 + * subsecond_fraction = dinfo.second - dts.sec + * dts.us = int((subsecond_fraction) * 1e6) + * dts.ps = int(((subsecond_fraction) * 1e6 - dts.us) * 1e6) # <<<<<<<<<<<<<< + * + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + */ + __pyx_v_dts.ps = ((npy_int32)(((__pyx_v_subsecond_fraction * 1e6) - __pyx_v_dts.us) * 1e6)); + + /* "pandas/tslib.pyx":3186 + * dts.ps = int(((subsecond_fraction) * 1e6 - dts.us) * 1e6) + * + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * + * def period_format(int64_t value, int freq, object fmt=None): + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts)); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3165 + * + * + * cpdef int64_t period_ordinal_to_dt64(int64_t ordinal, int freq): # <<<<<<<<<<<<<< + * cdef: + * pandas_datetimestruct dts + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("pandas.tslib.period_ordinal_to_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_85period_ordinal_to_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_85period_ordinal_to_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_ordinal; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_ordinal_to_dt64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ordinal,&__pyx_n_s_freq,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ordinal)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_ordinal_to_dt64", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_ordinal_to_dt64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_ordinal = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_ordinal == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_ordinal_to_dt64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_ordinal_to_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_84period_ordinal_to_dt64(__pyx_self, __pyx_v_ordinal, __pyx_v_freq); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_84period_ordinal_to_dt64(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_ordinal, int __pyx_v_freq) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_ordinal_to_dt64", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_f_6pandas_5tslib_period_ordinal_to_dt64(__pyx_v_ordinal, __pyx_v_freq, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("pandas.tslib.period_ordinal_to_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3188 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * + * def period_format(int64_t value, int freq, object fmt=None): # <<<<<<<<<<<<<< + * cdef: + * int freq_group + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_87period_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_87period_format = {__Pyx_NAMESTR("period_format"), (PyCFunction)__pyx_pw_6pandas_5tslib_87period_format, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_87period_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_5numpy_int64_t __pyx_v_value; + int __pyx_v_freq; + PyObject *__pyx_v_fmt = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("period_format (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_freq,&__pyx_n_s_fmt,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("period_format", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmt); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "period_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = __Pyx_PyInt_As_npy_int64(values[0]); if (unlikely((__pyx_v_value == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_fmt = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("period_format", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.period_format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_86period_format(__pyx_self, __pyx_v_value, __pyx_v_freq, __pyx_v_fmt); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_86period_format(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq, PyObject *__pyx_v_fmt) { + int __pyx_v_freq_group; + __pyx_t_5numpy_int64_t __pyx_v_left; + __pyx_t_5numpy_int64_t __pyx_v_right; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("period_format", 0); + __Pyx_INCREF(__pyx_v_fmt); + + /* "pandas/tslib.pyx":3192 + * int freq_group + * + * if value == iNaT: # <<<<<<<<<<<<<< + * return repr(NaT) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3193 + * + * if value == iNaT: + * return repr(NaT) # <<<<<<<<<<<<<< + * + * if fmt is None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3195 + * return repr(NaT) + * + * if fmt is None: # <<<<<<<<<<<<<< + * freq_group = (freq // 1000) * 1000 + * if freq_group == 1000: # FR_ANN + */ + __pyx_t_4 = (__pyx_v_fmt == Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3196 + * + * if fmt is None: + * freq_group = (freq // 1000) * 1000 # <<<<<<<<<<<<<< + * if freq_group == 1000: # FR_ANN + * fmt = b'%Y' + */ + __pyx_v_freq_group = (__Pyx_div_long(__pyx_v_freq, 1000) * 1000); + + /* "pandas/tslib.pyx":3221 + * elif freq_group == 11000: # MICROSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + * elif freq_group == 12000: # NANOSEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S.%n' + * else: + */ + switch (__pyx_v_freq_group) { + + /* "pandas/tslib.pyx":3197 + * if fmt is None: + * freq_group = (freq // 1000) * 1000 + * if freq_group == 1000: # FR_ANN # <<<<<<<<<<<<<< + * fmt = b'%Y' + * elif freq_group == 2000: # FR_QTR + */ + case 1000: + + /* "pandas/tslib.pyx":3198 + * freq_group = (freq // 1000) * 1000 + * if freq_group == 1000: # FR_ANN + * fmt = b'%Y' # <<<<<<<<<<<<<< + * elif freq_group == 2000: # FR_QTR + * fmt = b'%FQ%q' + */ + __Pyx_INCREF(__pyx_kp_b_Y_2); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_2); + break; + + /* "pandas/tslib.pyx":3199 + * if freq_group == 1000: # FR_ANN + * fmt = b'%Y' + * elif freq_group == 2000: # FR_QTR # <<<<<<<<<<<<<< + * fmt = b'%FQ%q' + * elif freq_group == 3000: # FR_MTH + */ + case 2000: + + /* "pandas/tslib.pyx":3200 + * fmt = b'%Y' + * elif freq_group == 2000: # FR_QTR + * fmt = b'%FQ%q' # <<<<<<<<<<<<<< + * elif freq_group == 3000: # FR_MTH + * fmt = b'%Y-%m' + */ + __Pyx_INCREF(__pyx_kp_b_FQ_q); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_FQ_q); + break; + + /* "pandas/tslib.pyx":3201 + * elif freq_group == 2000: # FR_QTR + * fmt = b'%FQ%q' + * elif freq_group == 3000: # FR_MTH # <<<<<<<<<<<<<< + * fmt = b'%Y-%m' + * elif freq_group == 4000: # WK + */ + case 3000: + + /* "pandas/tslib.pyx":3202 + * fmt = b'%FQ%q' + * elif freq_group == 3000: # FR_MTH + * fmt = b'%Y-%m' # <<<<<<<<<<<<<< + * elif freq_group == 4000: # WK + * left = period_asfreq(value, freq, 6000, 0) + */ + __Pyx_INCREF(__pyx_kp_b_Y_m); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m); + break; + + /* "pandas/tslib.pyx":3203 + * elif freq_group == 3000: # FR_MTH + * fmt = b'%Y-%m' + * elif freq_group == 4000: # WK # <<<<<<<<<<<<<< + * left = period_asfreq(value, freq, 6000, 0) + * right = period_asfreq(value, freq, 6000, 1) + */ + case 4000: + + /* "pandas/tslib.pyx":3204 + * fmt = b'%Y-%m' + * elif freq_group == 4000: # WK + * left = period_asfreq(value, freq, 6000, 0) # <<<<<<<<<<<<<< + * right = period_asfreq(value, freq, 6000, 1) + * return '%s/%s' % (period_format(left, 6000), + */ + __pyx_v_left = __pyx_f_6pandas_5tslib_period_asfreq(__pyx_v_value, __pyx_v_freq, 6000, 0, 0); + + /* "pandas/tslib.pyx":3205 + * elif freq_group == 4000: # WK + * left = period_asfreq(value, freq, 6000, 0) + * right = period_asfreq(value, freq, 6000, 1) # <<<<<<<<<<<<<< + * return '%s/%s' % (period_format(left, 6000), + * period_format(right, 6000)) + */ + __pyx_v_right = __pyx_f_6pandas_5tslib_period_asfreq(__pyx_v_value, __pyx_v_freq, 6000, 1, 0); + + /* "pandas/tslib.pyx":3206 + * left = period_asfreq(value, freq, 6000, 0) + * right = period_asfreq(value, freq, 6000, 1) + * return '%s/%s' % (period_format(left, 6000), # <<<<<<<<<<<<<< + * period_format(right, 6000)) + * elif (freq_group == 5000 # BUS + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_period_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_6000); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_6000); + __Pyx_GIVEREF(__pyx_int_6000); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3207 + * right = period_asfreq(value, freq, 6000, 1) + * return '%s/%s' % (period_format(left, 6000), + * period_format(right, 6000)) # <<<<<<<<<<<<<< + * elif (freq_group == 5000 # BUS + * or freq_group == 6000): # DAY + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_period_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_right); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_int_6000); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_6000); + __Pyx_GIVEREF(__pyx_int_6000); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3206 + * left = period_asfreq(value, freq, 6000, 0) + * right = period_asfreq(value, freq, 6000, 1) + * return '%s/%s' % (period_format(left, 6000), # <<<<<<<<<<<<<< + * period_format(right, 6000)) + * elif (freq_group == 5000 # BUS + */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3208 + * return '%s/%s' % (period_format(left, 6000), + * period_format(right, 6000)) + * elif (freq_group == 5000 # BUS # <<<<<<<<<<<<<< + * or freq_group == 6000): # DAY + * fmt = b'%Y-%m-%d' + */ + case 5000: + + /* "pandas/tslib.pyx":3209 + * period_format(right, 6000)) + * elif (freq_group == 5000 # BUS + * or freq_group == 6000): # DAY # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d' + * elif freq_group == 7000: # HR + */ + case 6000: + + /* "pandas/tslib.pyx":3210 + * elif (freq_group == 5000 # BUS + * or freq_group == 6000): # DAY + * fmt = b'%Y-%m-%d' # <<<<<<<<<<<<<< + * elif freq_group == 7000: # HR + * fmt = b'%Y-%m-%d %H:00' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d); + break; + + /* "pandas/tslib.pyx":3211 + * or freq_group == 6000): # DAY + * fmt = b'%Y-%m-%d' + * elif freq_group == 7000: # HR # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:00' + * elif freq_group == 8000: # MIN + */ + case 7000: + + /* "pandas/tslib.pyx":3212 + * fmt = b'%Y-%m-%d' + * elif freq_group == 7000: # HR + * fmt = b'%Y-%m-%d %H:00' # <<<<<<<<<<<<<< + * elif freq_group == 8000: # MIN + * fmt = b'%Y-%m-%d %H:%M' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_00); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_00); + break; + + /* "pandas/tslib.pyx":3213 + * elif freq_group == 7000: # HR + * fmt = b'%Y-%m-%d %H:00' + * elif freq_group == 8000: # MIN # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M' + * elif freq_group == 9000: # SEC + */ + case 8000: + + /* "pandas/tslib.pyx":3214 + * fmt = b'%Y-%m-%d %H:00' + * elif freq_group == 8000: # MIN + * fmt = b'%Y-%m-%d %H:%M' # <<<<<<<<<<<<<< + * elif freq_group == 9000: # SEC + * fmt = b'%Y-%m-%d %H:%M:%S' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M); + break; + + /* "pandas/tslib.pyx":3215 + * elif freq_group == 8000: # MIN + * fmt = b'%Y-%m-%d %H:%M' + * elif freq_group == 9000: # SEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S' + * elif freq_group == 10000: # MILLISEC + */ + case 9000: + + /* "pandas/tslib.pyx":3216 + * fmt = b'%Y-%m-%d %H:%M' + * elif freq_group == 9000: # SEC + * fmt = b'%Y-%m-%d %H:%M:%S' # <<<<<<<<<<<<<< + * elif freq_group == 10000: # MILLISEC + * fmt = b'%Y-%m-%d %H:%M:%S.%l' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M_S); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M_S); + break; + + /* "pandas/tslib.pyx":3217 + * elif freq_group == 9000: # SEC + * fmt = b'%Y-%m-%d %H:%M:%S' + * elif freq_group == 10000: # MILLISEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S.%l' + * elif freq_group == 11000: # MICROSEC + */ + case 10000: + + /* "pandas/tslib.pyx":3218 + * fmt = b'%Y-%m-%d %H:%M:%S' + * elif freq_group == 10000: # MILLISEC + * fmt = b'%Y-%m-%d %H:%M:%S.%l' # <<<<<<<<<<<<<< + * elif freq_group == 11000: # MICROSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M_S_l); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M_S_l); + break; + + /* "pandas/tslib.pyx":3219 + * elif freq_group == 10000: # MILLISEC + * fmt = b'%Y-%m-%d %H:%M:%S.%l' + * elif freq_group == 11000: # MICROSEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + * elif freq_group == 12000: # NANOSEC + */ + case 11000: + + /* "pandas/tslib.pyx":3220 + * fmt = b'%Y-%m-%d %H:%M:%S.%l' + * elif freq_group == 11000: # MICROSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%u' # <<<<<<<<<<<<<< + * elif freq_group == 12000: # NANOSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%n' + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M_S_u); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M_S_u); + break; + + /* "pandas/tslib.pyx":3221 + * elif freq_group == 11000: # MICROSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + * elif freq_group == 12000: # NANOSEC # <<<<<<<<<<<<<< + * fmt = b'%Y-%m-%d %H:%M:%S.%n' + * else: + */ + case 12000: + + /* "pandas/tslib.pyx":3222 + * fmt = b'%Y-%m-%d %H:%M:%S.%u' + * elif freq_group == 12000: # NANOSEC + * fmt = b'%Y-%m-%d %H:%M:%S.%n' # <<<<<<<<<<<<<< + * else: + * raise ValueError('Unknown freq: %d' % freq) + */ + __Pyx_INCREF(__pyx_kp_b_Y_m_d_H_M_S_n); + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_kp_b_Y_m_d_H_M_S_n); + break; + default: + + /* "pandas/tslib.pyx":3224 + * fmt = b'%Y-%m-%d %H:%M:%S.%n' + * else: + * raise ValueError('Unknown freq: %d' % freq) # <<<<<<<<<<<<<< + * + * return _period_strftime(value, freq, fmt) + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_freq_d, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + goto __pyx_L4; + } + __pyx_L4:; + + /* "pandas/tslib.pyx":3226 + * raise ValueError('Unknown freq: %d' % freq) + * + * return _period_strftime(value, freq, fmt) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __pyx_f_6pandas_5tslib__period_strftime(__pyx_v_value, __pyx_v_freq, __pyx_v_fmt); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3188 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * + * def period_format(int64_t value, int freq, object fmt=None): # <<<<<<<<<<<<<< + * cdef: + * int freq_group + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.period_format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fmt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3238 + * cdef list str_extra_fmts = ["^`AB`^", "^`CD`^", "^`EF`^", "^`GH`^", "^`IJ`^", "^`KL`^"] + * + * cdef object _period_strftime(int64_t value, int freq, object fmt): # <<<<<<<<<<<<<< + * import sys + * + */ + +static PyObject *__pyx_f_6pandas_5tslib__period_strftime(__pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq, PyObject *__pyx_v_fmt) { + CYTHON_UNUSED PyObject *__pyx_v_sys = NULL; + Py_ssize_t __pyx_v_i; + date_info __pyx_v_dinfo; + char *__pyx_v_formatted; + PyObject *__pyx_v_pat = 0; + PyObject *__pyx_v_repl = 0; + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_found_pat = 0; + int __pyx_v_year; + int __pyx_v_quarter; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_period_strftime", 0); + __Pyx_INCREF(__pyx_v_fmt); + + /* "pandas/tslib.pyx":3239 + * + * cdef object _period_strftime(int64_t value, int freq, object fmt): + * import sys # <<<<<<<<<<<<<< + * + * cdef: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sys = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3246 + * char *formatted + * object pat, repl, result + * list found_pat = [False] * len(extra_fmts) # <<<<<<<<<<<<<< + * int year, quarter + * + */ + __pyx_t_1 = __pyx_v_6pandas_5tslib_extra_fmts; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1 * ((__pyx_t_2<0) ? 0:__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_t_2; __pyx_temp++) { + __Pyx_INCREF(Py_False); + PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_False); + __Pyx_GIVEREF(Py_False); + } + } + __pyx_v_found_pat = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3249 + * int year, quarter + * + * if PyUnicode_Check(fmt): # <<<<<<<<<<<<<< + * fmt = fmt.encode('utf-8') + * + */ + __pyx_t_3 = (PyUnicode_Check(__pyx_v_fmt) != 0); + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":3250 + * + * if PyUnicode_Check(fmt): + * fmt = fmt.encode('utf-8') # <<<<<<<<<<<<<< + * + * get_date_info(value, freq, &dinfo) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3252 + * fmt = fmt.encode('utf-8') + * + * get_date_info(value, freq, &dinfo) # <<<<<<<<<<<<<< + * for i in range(len(extra_fmts)): + * pat = extra_fmts[i][0] + */ + __pyx_t_5 = get_date_info(__pyx_v_value, __pyx_v_freq, (&__pyx_v_dinfo)); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3253 + * + * get_date_info(value, freq, &dinfo) + * for i in range(len(extra_fmts)): # <<<<<<<<<<<<<< + * pat = extra_fmts[i][0] + * repl = extra_fmts[i][1] + */ + __pyx_t_4 = __pyx_v_6pandas_5tslib_extra_fmts; + __Pyx_INCREF(__pyx_t_4); + if (unlikely(__pyx_t_4 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/tslib.pyx":3254 + * get_date_info(value, freq, &dinfo) + * for i in range(len(extra_fmts)): + * pat = extra_fmts[i][0] # <<<<<<<<<<<<<< + * repl = extra_fmts[i][1] + * if pat in fmt: + */ + if (unlikely(__pyx_v_6pandas_5tslib_extra_fmts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_6pandas_5tslib_extra_fmts, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_pat, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3255 + * for i in range(len(extra_fmts)): + * pat = extra_fmts[i][0] + * repl = extra_fmts[i][1] # <<<<<<<<<<<<<< + * if pat in fmt: + * fmt = fmt.replace(pat, repl) + */ + if (unlikely(__pyx_v_6pandas_5tslib_extra_fmts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_6pandas_5tslib_extra_fmts, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3256 + * pat = extra_fmts[i][0] + * repl = extra_fmts[i][1] + * if pat in fmt: # <<<<<<<<<<<<<< + * fmt = fmt.replace(pat, repl) + * found_pat[i] = True + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_pat, __pyx_v_fmt, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = (__pyx_t_3 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3257 + * repl = extra_fmts[i][1] + * if pat in fmt: + * fmt = fmt.replace(pat, repl) # <<<<<<<<<<<<<< + * found_pat[i] = True + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_pat); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pat); + __Pyx_GIVEREF(__pyx_v_pat); + __Pyx_INCREF(__pyx_v_repl); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_repl); + __Pyx_GIVEREF(__pyx_v_repl); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_t_8); + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":3258 + * if pat in fmt: + * fmt = fmt.replace(pat, repl) + * found_pat[i] = True # <<<<<<<<<<<<<< + * + * formatted = c_strftime(&dinfo, fmt) + */ + if (unlikely(__Pyx_SetItemInt(__pyx_v_found_pat, __pyx_v_i, Py_True, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + } + + /* "pandas/tslib.pyx":3260 + * found_pat[i] = True + * + * formatted = c_strftime(&dinfo, fmt) # <<<<<<<<<<<<<< + * + * result = util.char_to_string(formatted) + */ + __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_fmt); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_formatted = c_strftime((&__pyx_v_dinfo), ((char *)__pyx_t_9)); + + /* "pandas/tslib.pyx":3262 + * formatted = c_strftime(&dinfo, fmt) + * + * result = util.char_to_string(formatted) # <<<<<<<<<<<<<< + * free(formatted) + * + */ + __pyx_t_8 = char_to_string(__pyx_v_formatted); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_result = __pyx_t_8; + __pyx_t_8 = 0; + + /* "pandas/tslib.pyx":3263 + * + * result = util.char_to_string(formatted) + * free(formatted) # <<<<<<<<<<<<<< + * + * for i in range(len(extra_fmts)): + */ + free(__pyx_v_formatted); + + /* "pandas/tslib.pyx":3265 + * free(formatted) + * + * for i in range(len(extra_fmts)): # <<<<<<<<<<<<<< + * if found_pat[i]: + * if get_yq(value, freq, &quarter, &year) < 0: + */ + __pyx_t_8 = __pyx_v_6pandas_5tslib_extra_fmts; + __Pyx_INCREF(__pyx_t_8); + if (unlikely(__pyx_t_8 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(__pyx_t_8); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/tslib.pyx":3266 + * + * for i in range(len(extra_fmts)): + * if found_pat[i]: # <<<<<<<<<<<<<< + * if get_yq(value, freq, &quarter, &year) < 0: + * raise ValueError('Unable to get quarter and year') + */ + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_found_pat, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3267 + * for i in range(len(extra_fmts)): + * if found_pat[i]: + * if get_yq(value, freq, &quarter, &year) < 0: # <<<<<<<<<<<<<< + * raise ValueError('Unable to get quarter and year') + * + */ + __pyx_t_7 = ((get_yq(__pyx_v_value, __pyx_v_freq, (&__pyx_v_quarter), (&__pyx_v_year)) < 0) != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3268 + * if found_pat[i]: + * if get_yq(value, freq, &quarter, &year) < 0: + * raise ValueError('Unable to get quarter and year') # <<<<<<<<<<<<<< + * + * if i == 0: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3280 + * elif i == 4: + * repl = '%06d' % (value % 1000000) + * elif i == 5: # <<<<<<<<<<<<<< + * repl = '%09d' % (value % 1000000000) + * + */ + switch (__pyx_v_i) { + + /* "pandas/tslib.pyx":3270 + * raise ValueError('Unable to get quarter and year') + * + * if i == 0: # <<<<<<<<<<<<<< + * repl = '%d' % quarter + * elif i == 1: # %f, 2-digit year + */ + case 0: + + /* "pandas/tslib.pyx":3271 + * + * if i == 0: + * repl = '%d' % quarter # <<<<<<<<<<<<<< + * elif i == 1: # %f, 2-digit year + * repl = '%.2d' % (year % 100) + */ + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_quarter); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_1); + __pyx_t_1 = 0; + break; + + /* "pandas/tslib.pyx":3272 + * if i == 0: + * repl = '%d' % quarter + * elif i == 1: # %f, 2-digit year # <<<<<<<<<<<<<< + * repl = '%.2d' % (year % 100) + * elif i == 2: + */ + case 1: + + /* "pandas/tslib.pyx":3273 + * repl = '%d' % quarter + * elif i == 1: # %f, 2-digit year + * repl = '%.2d' % (year % 100) # <<<<<<<<<<<<<< + * elif i == 2: + * repl = '%d' % year + */ + __pyx_t_1 = __Pyx_PyInt_From_long(__Pyx_mod_long(__pyx_v_year, 100)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_2d, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_8); + __pyx_t_8 = 0; + break; + + /* "pandas/tslib.pyx":3274 + * elif i == 1: # %f, 2-digit year + * repl = '%.2d' % (year % 100) + * elif i == 2: # <<<<<<<<<<<<<< + * repl = '%d' % year + * elif i == 3: + */ + case 2: + + /* "pandas/tslib.pyx":3275 + * repl = '%.2d' % (year % 100) + * elif i == 2: + * repl = '%d' % year # <<<<<<<<<<<<<< + * elif i == 3: + * repl = '%03d' % (value % 1000) + */ + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_1); + __pyx_t_1 = 0; + break; + + /* "pandas/tslib.pyx":3276 + * elif i == 2: + * repl = '%d' % year + * elif i == 3: # <<<<<<<<<<<<<< + * repl = '%03d' % (value % 1000) + * elif i == 4: + */ + case 3: + + /* "pandas/tslib.pyx":3277 + * repl = '%d' % year + * elif i == 3: + * repl = '%03d' % (value % 1000) # <<<<<<<<<<<<<< + * elif i == 4: + * repl = '%06d' % (value % 1000000) + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_value, 1000)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_03d, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_8); + __pyx_t_8 = 0; + break; + + /* "pandas/tslib.pyx":3278 + * elif i == 3: + * repl = '%03d' % (value % 1000) + * elif i == 4: # <<<<<<<<<<<<<< + * repl = '%06d' % (value % 1000000) + * elif i == 5: + */ + case 4: + + /* "pandas/tslib.pyx":3279 + * repl = '%03d' % (value % 1000) + * elif i == 4: + * repl = '%06d' % (value % 1000000) # <<<<<<<<<<<<<< + * elif i == 5: + * repl = '%09d' % (value % 1000000000) + */ + __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_value, 1000000)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_06d, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_1); + __pyx_t_1 = 0; + break; + + /* "pandas/tslib.pyx":3280 + * elif i == 4: + * repl = '%06d' % (value % 1000000) + * elif i == 5: # <<<<<<<<<<<<<< + * repl = '%09d' % (value % 1000000000) + * + */ + case 5: + + /* "pandas/tslib.pyx":3281 + * repl = '%06d' % (value % 1000000) + * elif i == 5: + * repl = '%09d' % (value % 1000000000) # <<<<<<<<<<<<<< + * + * result = result.replace(str_extra_fmts[i], repl) + */ + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_value, 1000000000)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_09d, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_repl, __pyx_t_8); + __pyx_t_8 = 0; + break; + default: break; + } + + /* "pandas/tslib.pyx":3283 + * repl = '%09d' % (value % 1000000000) + * + * result = result.replace(str_extra_fmts[i], repl) # <<<<<<<<<<<<<< + * + * if PY2: + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_replace); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__pyx_v_6pandas_5tslib_str_extra_fmts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_6pandas_5tslib_str_extra_fmts, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_v_repl)) { __Pyx_RaiseUnboundLocalError("repl"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_repl); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_repl); + __Pyx_GIVEREF(__pyx_v_repl); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L9; + } + __pyx_L9:; + } + + /* "pandas/tslib.pyx":3285 + * result = result.replace(str_extra_fmts[i], repl) + * + * if PY2: # <<<<<<<<<<<<<< + * result = result.decode('utf-8', 'ignore') + * + */ + __pyx_t_7 = (__pyx_v_6pandas_5tslib_PY2 != 0); + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3286 + * + * if PY2: + * result = result.decode('utf-8', 'ignore') # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":3288 + * result = result.decode('utf-8', 'ignore') + * + * return result # <<<<<<<<<<<<<< + * + * # period accessors + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3238 + * cdef list str_extra_fmts = ["^`AB`^", "^`CD`^", "^`EF`^", "^`GH`^", "^`IJ`^", "^`KL`^"] + * + * cdef object _period_strftime(int64_t value, int freq, object fmt): # <<<<<<<<<<<<<< + * import sys + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("pandas.tslib._period_strftime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_sys); + __Pyx_XDECREF(__pyx_v_pat); + __Pyx_XDECREF(__pyx_v_repl); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_found_pat); + __Pyx_XDECREF(__pyx_v_fmt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3294 + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN + * + * def get_period_field(int code, int64_t value, int freq): # <<<<<<<<<<<<<< + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_89get_period_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_89get_period_field = {__Pyx_NAMESTR("get_period_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_89get_period_field, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_89get_period_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_code; + __pyx_t_5numpy_int64_t __pyx_v_value; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_period_field (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_code,&__pyx_n_s_value,&__pyx_n_s_freq,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_code)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_period_field", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_period_field", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_period_field") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_code = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_value = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_value == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_freq = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_period_field", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_period_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_88get_period_field(__pyx_self, __pyx_v_code, __pyx_v_value, __pyx_v_freq); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_88get_period_field(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_code, __pyx_t_5numpy_int64_t __pyx_v_value, int __pyx_v_freq) { + __pyx_t_6pandas_5tslib_accessor __pyx_v_f; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_period_field", 0); + + /* "pandas/tslib.pyx":3295 + * + * def get_period_field(int code, int64_t value, int freq): + * cdef accessor f = _get_accessor_func(code) # <<<<<<<<<<<<<< + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) + */ + __pyx_v_f = __pyx_f_6pandas_5tslib__get_accessor_func(__pyx_v_code); + + /* "pandas/tslib.pyx":3296 + * def get_period_field(int code, int64_t value, int freq): + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: # <<<<<<<<<<<<<< + * raise ValueError('Unrecognized period code: %d' % code) + * if value == iNaT: + */ + __pyx_t_1 = ((__pyx_v_f == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3297 + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) # <<<<<<<<<<<<<< + * if value == iNaT: + * return -1 + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_period_code_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3298 + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) + * if value == iNaT: # <<<<<<<<<<<<<< + * return -1 + * return f(value, freq) + */ + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3299 + * raise ValueError('Unrecognized period code: %d' % code) + * if value == iNaT: + * return -1 # <<<<<<<<<<<<<< + * return f(value, freq) + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_r = __pyx_int_neg_1; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3300 + * if value == iNaT: + * return -1 + * return f(value, freq) # <<<<<<<<<<<<<< + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __pyx_v_f(__pyx_v_value, __pyx_v_freq); if (unlikely(__pyx_t_5 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3294 + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN + * + * def get_period_field(int code, int64_t value, int freq): # <<<<<<<<<<<<<< + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.get_period_field", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3302 + * return f(value, freq) + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_91get_period_field_arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_91get_period_field_arr = {__Pyx_NAMESTR("get_period_field_arr"), (PyCFunction)__pyx_pw_6pandas_5tslib_91get_period_field_arr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_91get_period_field_arr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_code; + PyArrayObject *__pyx_v_arr = 0; + int __pyx_v_freq; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_period_field_arr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_code,&__pyx_n_s_arr,&__pyx_n_s_freq,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_code)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_period_field_arr", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_period_field_arr", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_period_field_arr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_code = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_arr = ((PyArrayObject *)values[1]); + __pyx_v_freq = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_period_field_arr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.get_period_field_arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_90get_period_field_arr(__pyx_self, __pyx_v_code, __pyx_v_arr, __pyx_v_freq); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_90get_period_field_arr(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_code, PyArrayObject *__pyx_v_arr, int __pyx_v_freq) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyArrayObject *__pyx_v_out = 0; + __pyx_t_6pandas_5tslib_accessor __pyx_v_f; + __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; + __Pyx_Buffer __pyx_pybuffer_arr; + __Pyx_LocalBuf_ND __pyx_pybuffernd_out; + __Pyx_Buffer __pyx_pybuffer_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyArrayObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + int __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_period_field_arr", 0); + __pyx_pybuffer_out.pybuffer.buf = NULL; + __pyx_pybuffer_out.refcount = 0; + __pyx_pybuffernd_out.data = NULL; + __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; + __pyx_pybuffer_arr.pybuffer.buf = NULL; + __pyx_pybuffer_arr.refcount = 0; + __pyx_pybuffernd_arr.data = NULL; + __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3308 + * accessor f + * + * f = _get_accessor_func(code) # <<<<<<<<<<<<<< + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) + */ + __pyx_v_f = __pyx_f_6pandas_5tslib__get_accessor_func(__pyx_v_code); + + /* "pandas/tslib.pyx":3309 + * + * f = _get_accessor_func(code) + * if f is NULL: # <<<<<<<<<<<<<< + * raise ValueError('Unrecognized period code: %d' % code) + * + */ + __pyx_t_1 = ((__pyx_v_f == NULL) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3310 + * f = _get_accessor_func(code) + * if f is NULL: + * raise ValueError('Unrecognized period code: %d' % code) # <<<<<<<<<<<<<< + * + * sz = len(arr) + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Unrecognized_period_code_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3312 + * raise ValueError('Unrecognized period code: %d' % code) + * + * sz = len(arr) # <<<<<<<<<<<<<< + * out = np.empty(sz, dtype=np.int64) + * + */ + __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_sz = __pyx_t_4; + + /* "pandas/tslib.pyx":3313 + * + * sz = len(arr) + * out = np.empty(sz, dtype=np.int64) # <<<<<<<<<<<<<< + * + * for i in range(sz): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_sz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_9 < 0)) { + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + } + __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_8 = 0; + __pyx_v_out = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":3315 + * out = np.empty(sz, dtype=np.int64) + * + * for i in range(sz): # <<<<<<<<<<<<<< + * if arr[i] == iNaT: + * out[i] = -1 + */ + __pyx_t_4 = __pyx_v_sz; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_4; __pyx_t_13+=1) { + __pyx_v_i = __pyx_t_13; + + /* "pandas/tslib.pyx":3316 + * + * for i in range(sz): + * if arr[i] == iNaT: # <<<<<<<<<<<<<< + * out[i] = -1 + * continue + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_14 < 0) { + __pyx_t_14 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_iNaT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3317 + * for i in range(sz): + * if arr[i] == iNaT: + * out[i] = -1 # <<<<<<<<<<<<<< + * continue + * out[i] = f(arr[i], freq) + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_15 < 0) { + __pyx_t_15 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_out.diminfo[0].strides) = -1; + + /* "pandas/tslib.pyx":3318 + * if arr[i] == iNaT: + * out[i] = -1 + * continue # <<<<<<<<<<<<<< + * out[i] = f(arr[i], freq) + * + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":3319 + * out[i] = -1 + * continue + * out[i] = f(arr[i], freq) # <<<<<<<<<<<<<< + * + * return out + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_9 = -1; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_arr.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_arr.diminfo[0].shape)) __pyx_t_9 = 0; + if (unlikely(__pyx_t_9 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_9); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_9 = __pyx_v_f((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_arr.diminfo[0].strides)), __pyx_v_freq); if (unlikely(__pyx_t_9 == INT32_MIN)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_out.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_out.diminfo[0].shape)) __pyx_t_18 = 0; + if (unlikely(__pyx_t_18 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_18); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_t_9; + __pyx_L4_continue:; + } + + /* "pandas/tslib.pyx":3321 + * out[i] = f(arr[i], freq) + * + * return out # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_out)); + __pyx_r = ((PyObject *)__pyx_v_out); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3302 + * return f(value, freq) + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.get_period_field_arr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3325 + * + * + * cdef accessor _get_accessor_func(int code): # <<<<<<<<<<<<<< + * if code == 0: + * return &pyear + */ + +static __pyx_t_6pandas_5tslib_accessor __pyx_f_6pandas_5tslib__get_accessor_func(int __pyx_v_code) { + __pyx_t_6pandas_5tslib_accessor __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_accessor_func", 0); + + /* "pandas/tslib.pyx":3346 + * elif code == 9: + * return &pday_of_year + * elif code == 10: # <<<<<<<<<<<<<< + * return &pweekday + * return NULL + */ + switch (__pyx_v_code) { + + /* "pandas/tslib.pyx":3326 + * + * cdef accessor _get_accessor_func(int code): + * if code == 0: # <<<<<<<<<<<<<< + * return &pyear + * elif code == 1: + */ + case 0: + + /* "pandas/tslib.pyx":3327 + * cdef accessor _get_accessor_func(int code): + * if code == 0: + * return &pyear # <<<<<<<<<<<<<< + * elif code == 1: + * return &pqyear + */ + __pyx_r = (&pyear); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3328 + * if code == 0: + * return &pyear + * elif code == 1: # <<<<<<<<<<<<<< + * return &pqyear + * elif code == 2: + */ + case 1: + + /* "pandas/tslib.pyx":3329 + * return &pyear + * elif code == 1: + * return &pqyear # <<<<<<<<<<<<<< + * elif code == 2: + * return &pquarter + */ + __pyx_r = (&pqyear); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3330 + * elif code == 1: + * return &pqyear + * elif code == 2: # <<<<<<<<<<<<<< + * return &pquarter + * elif code == 3: + */ + case 2: + + /* "pandas/tslib.pyx":3331 + * return &pqyear + * elif code == 2: + * return &pquarter # <<<<<<<<<<<<<< + * elif code == 3: + * return &pmonth + */ + __pyx_r = (&pquarter); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3332 + * elif code == 2: + * return &pquarter + * elif code == 3: # <<<<<<<<<<<<<< + * return &pmonth + * elif code == 4: + */ + case 3: + + /* "pandas/tslib.pyx":3333 + * return &pquarter + * elif code == 3: + * return &pmonth # <<<<<<<<<<<<<< + * elif code == 4: + * return &pday + */ + __pyx_r = (&pmonth); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3334 + * elif code == 3: + * return &pmonth + * elif code == 4: # <<<<<<<<<<<<<< + * return &pday + * elif code == 5: + */ + case 4: + + /* "pandas/tslib.pyx":3335 + * return &pmonth + * elif code == 4: + * return &pday # <<<<<<<<<<<<<< + * elif code == 5: + * return &phour + */ + __pyx_r = (&pday); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3336 + * elif code == 4: + * return &pday + * elif code == 5: # <<<<<<<<<<<<<< + * return &phour + * elif code == 6: + */ + case 5: + + /* "pandas/tslib.pyx":3337 + * return &pday + * elif code == 5: + * return &phour # <<<<<<<<<<<<<< + * elif code == 6: + * return &pminute + */ + __pyx_r = (&phour); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3338 + * elif code == 5: + * return &phour + * elif code == 6: # <<<<<<<<<<<<<< + * return &pminute + * elif code == 7: + */ + case 6: + + /* "pandas/tslib.pyx":3339 + * return &phour + * elif code == 6: + * return &pminute # <<<<<<<<<<<<<< + * elif code == 7: + * return &psecond + */ + __pyx_r = (&pminute); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3340 + * elif code == 6: + * return &pminute + * elif code == 7: # <<<<<<<<<<<<<< + * return &psecond + * elif code == 8: + */ + case 7: + + /* "pandas/tslib.pyx":3341 + * return &pminute + * elif code == 7: + * return &psecond # <<<<<<<<<<<<<< + * elif code == 8: + * return &pweek + */ + __pyx_r = (&psecond); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3342 + * elif code == 7: + * return &psecond + * elif code == 8: # <<<<<<<<<<<<<< + * return &pweek + * elif code == 9: + */ + case 8: + + /* "pandas/tslib.pyx":3343 + * return &psecond + * elif code == 8: + * return &pweek # <<<<<<<<<<<<<< + * elif code == 9: + * return &pday_of_year + */ + __pyx_r = (&pweek); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3344 + * elif code == 8: + * return &pweek + * elif code == 9: # <<<<<<<<<<<<<< + * return &pday_of_year + * elif code == 10: + */ + case 9: + + /* "pandas/tslib.pyx":3345 + * return &pweek + * elif code == 9: + * return &pday_of_year # <<<<<<<<<<<<<< + * elif code == 10: + * return &pweekday + */ + __pyx_r = (&pday_of_year); + goto __pyx_L0; + break; + + /* "pandas/tslib.pyx":3346 + * elif code == 9: + * return &pday_of_year + * elif code == 10: # <<<<<<<<<<<<<< + * return &pweekday + * return NULL + */ + case 10: + + /* "pandas/tslib.pyx":3347 + * return &pday_of_year + * elif code == 10: + * return &pweekday # <<<<<<<<<<<<<< + * return NULL + * + */ + __pyx_r = (&pweekday); + goto __pyx_L0; + break; + default: break; + } + + /* "pandas/tslib.pyx":3348 + * elif code == 10: + * return &pweekday + * return NULL # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = NULL; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3325 + * + * + * cdef accessor _get_accessor_func(int code): # <<<<<<<<<<<<<< + * if code == 0: + * return &pyear + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3351 + * + * + * def extract_ordinals(ndarray[object] values, freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_93extract_ordinals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_93extract_ordinals = {__Pyx_NAMESTR("extract_ordinals"), (PyCFunction)__pyx_pw_6pandas_5tslib_93extract_ordinals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_93extract_ordinals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_values = 0; + PyObject *__pyx_v_freq = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("extract_ordinals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_freq,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("extract_ordinals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_ordinals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_values = ((PyArrayObject *)values[0]); + __pyx_v_freq = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("extract_ordinals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.extract_ordinals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_92extract_ordinals(__pyx_self, __pyx_v_values, __pyx_v_freq); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_92extract_ordinals(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_freq) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + PyArrayObject *__pyx_v_ordinals = 0; + PyObject *__pyx_v_p = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_ordinals; + __Pyx_Buffer __pyx_pybuffer_ordinals; + __Pyx_LocalBuf_ND __pyx_pybuffernd_values; + __Pyx_Buffer __pyx_pybuffer_values; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + __pyx_t_5numpy_int64_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("extract_ordinals", 0); + __pyx_pybuffer_ordinals.pybuffer.buf = NULL; + __pyx_pybuffer_ordinals.refcount = 0; + __pyx_pybuffernd_ordinals.data = NULL; + __pyx_pybuffernd_ordinals.rcbuffer = &__pyx_pybuffer_ordinals; + __pyx_pybuffer_values.pybuffer.buf = NULL; + __pyx_pybuffer_values.refcount = 0; + __pyx_pybuffernd_values.data = NULL; + __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3353 + * def extract_ordinals(ndarray[object] values, freq): + * cdef: + * Py_ssize_t i, n = len(values) # <<<<<<<<<<<<<< + * ndarray[int64_t] ordinals = np.empty(n, dtype=np.int64) + * object p + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":3354 + * cdef: + * Py_ssize_t i, n = len(values) + * ndarray[int64_t] ordinals = np.empty(n, dtype=np.int64) # <<<<<<<<<<<<<< + * object p + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ordinals.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + __pyx_v_ordinals = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ordinals.rcbuffer->pybuffer.buf = NULL; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else {__pyx_pybuffernd_ordinals.diminfo[0].strides = __pyx_pybuffernd_ordinals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ordinals.diminfo[0].shape = __pyx_pybuffernd_ordinals.rcbuffer->pybuffer.shape[0]; + } + } + __pyx_t_7 = 0; + __pyx_v_ordinals = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3357 + * object p + * + * for i in range(n): # <<<<<<<<<<<<<< + * p = values[i] + * ordinals[i] = p.ordinal + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "pandas/tslib.pyx":3358 + * + * for i in range(n): + * p = values[i] # <<<<<<<<<<<<<< + * ordinals[i] = p.ordinal + * if p.freq != freq: + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_values.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_values.diminfo[0].strides); + __Pyx_INCREF((PyObject*)__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3359 + * for i in range(n): + * p = values[i] + * ordinals[i] = p.ordinal # <<<<<<<<<<<<<< + * if p.freq != freq: + * raise ValueError("%s is wrong freq" % p) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_ordinal); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_11 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __pyx_v_i; + __pyx_t_10 = -1; + if (__pyx_t_12 < 0) { + __pyx_t_12 += __pyx_pybuffernd_ordinals.diminfo[0].shape; + if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0; + } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_ordinals.diminfo[0].shape)) __pyx_t_10 = 0; + if (unlikely(__pyx_t_10 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_10); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ordinals.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ordinals.diminfo[0].strides) = __pyx_t_11; + + /* "pandas/tslib.pyx":3360 + * p = values[i] + * ordinals[i] = p.ordinal + * if p.freq != freq: # <<<<<<<<<<<<<< + * raise ValueError("%s is wrong freq" % p) + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_freq); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_freq, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":3361 + * ordinals[i] = p.ordinal + * if p.freq != freq: + * raise ValueError("%s is wrong freq" % p) # <<<<<<<<<<<<<< + * + * return ordinals + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_is_wrong_freq, __pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + + /* "pandas/tslib.pyx":3363 + * raise ValueError("%s is wrong freq" % p) + * + * return ordinals # <<<<<<<<<<<<<< + * + * cpdef resolution(ndarray[int64_t] stamps, tz=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_ordinals)); + __pyx_r = ((PyObject *)__pyx_v_ordinals); + goto __pyx_L0; + + /* "pandas/tslib.pyx":3351 + * + * + * def extract_ordinals(ndarray[object] values, freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ordinals.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.extract_ordinals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ordinals.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_ordinals); + __Pyx_XDECREF(__pyx_v_p); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3365 + * return ordinals + * + * cpdef resolution(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + +static PyObject *__pyx_pw_6pandas_5tslib_95resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6pandas_5tslib_resolution(PyArrayObject *__pyx_v_stamps, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_5tslib_resolution *__pyx_optional_args) { + PyObject *__pyx_v_tz = ((PyObject *)Py_None); + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_n; + pandas_datetimestruct __pyx_v_dts; + int __pyx_v_reso; + int __pyx_v_curr_reso; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("resolution", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_tz = __pyx_optional_args->tz; + } + } + __Pyx_INCREF(__pyx_v_tz); + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3367 + * cpdef resolution(ndarray[int64_t] stamps, tz=None): + * cdef: + * Py_ssize_t i, n = len(stamps) # <<<<<<<<<<<<<< + * pandas_datetimestruct dts + * int reso = D_RESO, curr_reso + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":3369 + * Py_ssize_t i, n = len(stamps) + * pandas_datetimestruct dts + * int reso = D_RESO, curr_reso # <<<<<<<<<<<<<< + * + * if tz is not None: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_D_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_reso = __pyx_t_3; + + /* "pandas/tslib.pyx":3371 + * int reso = D_RESO, curr_reso + * + * if tz is not None: # <<<<<<<<<<<<<< + * tz = maybe_get_tz(tz) + * return _reso_local(stamps, tz) + */ + __pyx_t_4 = (__pyx_v_tz != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3372 + * + * if tz is not None: + * tz = maybe_get_tz(tz) # <<<<<<<<<<<<<< + * return _reso_local(stamps, tz) + * else: + */ + __pyx_t_2 = __pyx_f_6pandas_5tslib_maybe_get_tz(__pyx_v_tz, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3373 + * if tz is not None: + * tz = maybe_get_tz(tz) + * return _reso_local(stamps, tz) # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_6pandas_5tslib__reso_local(((PyArrayObject *)__pyx_v_stamps), __pyx_v_tz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":3375 + * return _reso_local(stamps, tz) + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "pandas/tslib.pyx":3376 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3377 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":3378 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3379 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3380 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * return reso + */ + __pyx_t_5 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3381 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * return reso + * + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_L4_continue:; + } + + /* "pandas/tslib.pyx":3382 + * if curr_reso < reso: + * reso = curr_reso + * return reso # <<<<<<<<<<<<<< + * + * US_RESO = 0 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_reso); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3365 + * return ordinals + * + * cpdef resolution(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.resolution", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_95resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6pandas_5tslib_95resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_stamps = 0; + PyObject *__pyx_v_tz = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("resolution (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tz); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resolution") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_stamps = ((PyArrayObject *)values[0]); + __pyx_v_tz = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("resolution", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.resolution", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_6pandas_5tslib_94resolution(__pyx_self, __pyx_v_stamps, __pyx_v_tz); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_94resolution(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6pandas_5tslib_resolution __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("resolution", 0); + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.tz = __pyx_v_tz; + __pyx_t_1 = __pyx_f_6pandas_5tslib_resolution(__pyx_v_stamps, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib.resolution", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3391 + * D_RESO = 5 + * + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * if dts.us != 0: + * if dts.us % 1000 == 0: + */ + +static CYTHON_INLINE int __pyx_f_6pandas_5tslib__reso_stamp(pandas_datetimestruct *__pyx_v_dts) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_reso_stamp", 0); + + /* "pandas/tslib.pyx":3392 + * + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): + * if dts.us != 0: # <<<<<<<<<<<<<< + * if dts.us % 1000 == 0: + * return MS_RESO + */ + __pyx_t_1 = ((__pyx_v_dts->us != 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3393 + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): + * if dts.us != 0: + * if dts.us % 1000 == 0: # <<<<<<<<<<<<<< + * return MS_RESO + * return US_RESO + */ + __pyx_t_1 = ((__Pyx_mod_long(__pyx_v_dts->us, 1000) == 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3394 + * if dts.us != 0: + * if dts.us % 1000 == 0: + * return MS_RESO # <<<<<<<<<<<<<< + * return US_RESO + * elif dts.sec != 0: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MS_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3395 + * if dts.us % 1000 == 0: + * return MS_RESO + * return US_RESO # <<<<<<<<<<<<<< + * elif dts.sec != 0: + * return S_RESO + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_US_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3396 + * return MS_RESO + * return US_RESO + * elif dts.sec != 0: # <<<<<<<<<<<<<< + * return S_RESO + * elif dts.min != 0: + */ + __pyx_t_1 = ((__pyx_v_dts->sec != 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3397 + * return US_RESO + * elif dts.sec != 0: + * return S_RESO # <<<<<<<<<<<<<< + * elif dts.min != 0: + * return T_RESO + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_S_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3398 + * elif dts.sec != 0: + * return S_RESO + * elif dts.min != 0: # <<<<<<<<<<<<<< + * return T_RESO + * elif dts.hour != 0: + */ + __pyx_t_1 = ((__pyx_v_dts->min != 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3399 + * return S_RESO + * elif dts.min != 0: + * return T_RESO # <<<<<<<<<<<<<< + * elif dts.hour != 0: + * return H_RESO + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_T_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3400 + * elif dts.min != 0: + * return T_RESO + * elif dts.hour != 0: # <<<<<<<<<<<<<< + * return H_RESO + * return D_RESO + */ + __pyx_t_1 = ((__pyx_v_dts->hour != 0) != 0); + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3401 + * return T_RESO + * elif dts.hour != 0: + * return H_RESO # <<<<<<<<<<<<<< + * return D_RESO + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_H_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3402 + * elif dts.hour != 0: + * return H_RESO + * return D_RESO # <<<<<<<<<<<<<< + * + * cdef _reso_local(ndarray[int64_t] stamps, object tz): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_D_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3391 + * D_RESO = 5 + * + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * if dts.us != 0: + * if dts.us % 1000 == 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("pandas.tslib._reso_stamp", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3404 + * return D_RESO + * + * cdef _reso_local(ndarray[int64_t] stamps, object tz): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t n = len(stamps) + */ + +static PyObject *__pyx_f_6pandas_5tslib__reso_local(PyArrayObject *__pyx_v_stamps, PyObject *__pyx_v_tz) { + Py_ssize_t __pyx_v_n; + int __pyx_v_reso; + int __pyx_v_curr_reso; + PyArrayObject *__pyx_v_trans = 0; + PyArrayObject *__pyx_v_deltas = 0; + PyArrayObject *__pyx_v_pos = 0; + pandas_datetimestruct __pyx_v_dts; + Py_ssize_t __pyx_v_i; + PyDateTime_DateTime *__pyx_v_dt = NULL; + PyObject *__pyx_v_delta = NULL; + PyObject *__pyx_v__pos = NULL; + __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas; + __Pyx_Buffer __pyx_pybuffer_deltas; + __Pyx_LocalBuf_ND __pyx_pybuffernd_pos; + __Pyx_Buffer __pyx_pybuffer_pos; + __Pyx_LocalBuf_ND __pyx_pybuffernd_stamps; + __Pyx_Buffer __pyx_pybuffer_stamps; + __Pyx_LocalBuf_ND __pyx_pybuffernd_trans; + __Pyx_Buffer __pyx_pybuffer_trans; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + Py_ssize_t __pyx_t_17; + npy_datetime __pyx_t_18; + PyArrayObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + int __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + long __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_5numpy_int64_t __pyx_t_30; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_reso_local", 0); + __pyx_pybuffer_trans.pybuffer.buf = NULL; + __pyx_pybuffer_trans.refcount = 0; + __pyx_pybuffernd_trans.data = NULL; + __pyx_pybuffernd_trans.rcbuffer = &__pyx_pybuffer_trans; + __pyx_pybuffer_deltas.pybuffer.buf = NULL; + __pyx_pybuffer_deltas.refcount = 0; + __pyx_pybuffernd_deltas.data = NULL; + __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas; + __pyx_pybuffer_pos.pybuffer.buf = NULL; + __pyx_pybuffer_pos.refcount = 0; + __pyx_pybuffernd_pos.data = NULL; + __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos; + __pyx_pybuffer_stamps.pybuffer.buf = NULL; + __pyx_pybuffer_stamps.refcount = 0; + __pyx_pybuffernd_stamps.data = NULL; + __pyx_pybuffernd_stamps.rcbuffer = &__pyx_pybuffer_stamps; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_stamps.diminfo[0].strides = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_stamps.diminfo[0].shape = __pyx_pybuffernd_stamps.rcbuffer->pybuffer.shape[0]; + + /* "pandas/tslib.pyx":3406 + * cdef _reso_local(ndarray[int64_t] stamps, object tz): + * cdef: + * Py_ssize_t n = len(stamps) # <<<<<<<<<<<<<< + * int reso = D_RESO, curr_reso + * ndarray[int64_t] trans, deltas, pos + */ + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_stamps)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_n = __pyx_t_1; + + /* "pandas/tslib.pyx":3407 + * cdef: + * Py_ssize_t n = len(stamps) + * int reso = D_RESO, curr_reso # <<<<<<<<<<<<<< + * ndarray[int64_t] trans, deltas, pos + * pandas_datetimestruct dts + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_D_RESO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_reso = __pyx_t_3; + + /* "pandas/tslib.pyx":3411 + * pandas_datetimestruct dts + * + * if _is_utc(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_utc(__pyx_v_tz) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3412 + * + * if _is_utc(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":3413 + * if _is_utc(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3414 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + goto __pyx_L4_continue; + } + + /* "pandas/tslib.pyx":3415 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + __pyx_t_7 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3416 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3417 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * elif _is_tzlocal(tz): + */ + __pyx_t_4 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3418 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * elif _is_tzlocal(tz): + * for i in range(n): + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_L4_continue:; + } + goto __pyx_L3; + } + + /* "pandas/tslib.pyx":3419 + * if curr_reso < reso: + * reso = curr_reso + * elif _is_tzlocal(tz): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_4 = (__pyx_f_6pandas_5tslib__is_tzlocal(__pyx_v_tz) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3420 + * reso = curr_reso + * elif _is_tzlocal(tz): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":3421 + * elif _is_tzlocal(tz): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3422 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + */ + goto __pyx_L8_continue; + } + + /* "pandas/tslib.pyx":3423 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, # <<<<<<<<<<<<<< + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + */ + __pyx_t_9 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_9 < 0) { + __pyx_t_9 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3424 + * continue + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) # <<<<<<<<<<<<<< + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + */ + pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_stamps.diminfo[0].strides)), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3425 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + + /* "pandas/tslib.pyx":3426 + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) # <<<<<<<<<<<<<< + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + */ + __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + + /* "pandas/tslib.pyx":3425 + * pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, + * &dts) + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, # <<<<<<<<<<<<<< + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + */ + __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __pyx_t_2 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_15)); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":3427 + * dt = datetime(dts.year, dts.month, dts.day, dts.hour, + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + */ + __pyx_t_15 = __pyx_f_6pandas_5tslib__get_utcoffset(__pyx_v_tz, ((PyObject *)__pyx_v_dt), 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyFloat_FromDouble(__pyx_f_6pandas_5tslib_total_seconds(__pyx_t_15)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_15, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyNumber_Multiply(__pyx_t_16, __pyx_int_1000000000); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_t_15); + __pyx_t_15 = 0; + + /* "pandas/tslib.pyx":3428 + * dts.min, dts.sec, dts.us, tz) + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_15 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_stamps.diminfo[0].strides))); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = PyNumber_Add(__pyx_t_15, __pyx_v_delta); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_18 = __Pyx_PyInt_As_npy_int64(__pyx_t_16); if (unlikely((__pyx_t_18 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":3429 + * delta = int(total_seconds(_get_utcoffset(tz, dt))) * 1000000000 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + pandas_datetime_to_datetimestruct(__pyx_t_18, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3430 + * pandas_datetime_to_datetimestruct(stamps[i] + delta, + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3431 + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * else: + */ + __pyx_t_4 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3432 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L11; + } + __pyx_L11:; + __pyx_L8_continue:; + } + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3435 + * else: + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) # <<<<<<<<<<<<<< + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + */ + __pyx_t_16 = __pyx_f_6pandas_5tslib__get_transitions(__pyx_v_tz); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_16); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_trans.rcbuffer->pybuffer, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + } + __pyx_pybuffernd_trans.diminfo[0].strides = __pyx_pybuffernd_trans.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_trans.diminfo[0].shape = __pyx_pybuffernd_trans.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_trans = ((PyArrayObject *)__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":3436 + * # Adjust datetime64 timestamp, recompute datetimestruct + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) # <<<<<<<<<<<<<< + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + */ + __pyx_t_16 = __pyx_f_6pandas_5tslib__get_deltas(__pyx_v_tz); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_16); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20); + } + } + __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = 0; + __pyx_v_deltas = ((PyArrayObject *)__pyx_t_16); + __pyx_t_16 = 0; + + /* "pandas/tslib.pyx":3437 + * trans = _get_transitions(tz) + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 # <<<<<<<<<<<<<< + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + */ + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_trans), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(((PyObject *)__pyx_v_stamps)); + PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_stamps)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_stamps)); + __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_side, __pyx_n_s_right) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyNumber_Subtract(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v__pos = __pyx_t_14; + __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":3438 + * deltas = _get_deltas(tz) + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: # <<<<<<<<<<<<<< + * _pos = _pos.astype(np.int64) + * pos = _pos + */ + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_int64); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyObject_RichCompare(__pyx_t_14, __pyx_t_15, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3439 + * _pos = trans.searchsorted(stamps, side='right') - 1 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) # <<<<<<<<<<<<<< + * pos = _pos + * + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v__pos, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF_SET(__pyx_v__pos, __pyx_t_14); + __pyx_t_14 = 0; + goto __pyx_L12; + } + __pyx_L12:; + + /* "pandas/tslib.pyx":3440 + * if _pos.dtype != np.int64: + * _pos = _pos.astype(np.int64) + * pos = _pos # <<<<<<<<<<<<<< + * + * # statictzinfo + */ + if (!(likely(((__pyx_v__pos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__pos, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_v__pos; + __Pyx_INCREF(__pyx_t_14); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_14), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_3 < 0)) { + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); + __Pyx_RaiseBufferFallbackError(); + } else { + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + } + __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_v_pos = ((PyArrayObject *)__pyx_t_14); + __pyx_t_14 = 0; + + /* "pandas/tslib.pyx":3443 + * + * # statictzinfo + * if not hasattr(tz, '_transition_info'): # <<<<<<<<<<<<<< + * for i in range(n): + * if stamps[i] == NPY_NAT: + */ + __pyx_t_4 = PyObject_HasAttr(__pyx_v_tz, __pyx_n_s_transition_info); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_23 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3444 + * # statictzinfo + * if not hasattr(tz, '_transition_info'): + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":3445 + * if not hasattr(tz, '_transition_info'): + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3446 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L14_continue; + } + + /* "pandas/tslib.pyx":3447 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_25 < 0) { + __pyx_t_25 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_26 = 0; + __pyx_t_3 = -1; + if (__pyx_t_26 < 0) { + __pyx_t_26 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3448 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3449 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[0], + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3450 + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * else: + */ + __pyx_t_23 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3451 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * else: + * for i in range(n): + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L17; + } + __pyx_L17:; + __pyx_L14_continue:; + } + goto __pyx_L13; + } + /*else*/ { + + /* "pandas/tslib.pyx":3453 + * reso = curr_reso + * else: + * for i in range(n): # <<<<<<<<<<<<<< + * if stamps[i] == NPY_NAT: + * continue + */ + __pyx_t_1 = __pyx_v_n; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "pandas/tslib.pyx":3454 + * else: + * for i in range(n): + * if stamps[i] == NPY_NAT: # <<<<<<<<<<<<<< + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_27 < 0) { + __pyx_t_27 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_23 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_stamps.diminfo[0].strides)) == __pyx_v_6pandas_5tslib_NPY_NAT) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3455 + * for i in range(n): + * if stamps[i] == NPY_NAT: + * continue # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + */ + goto __pyx_L18_continue; + } + + /* "pandas/tslib.pyx":3456 + * if stamps[i] == NPY_NAT: + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], # <<<<<<<<<<<<<< + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + */ + __pyx_t_28 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_28 < 0) { + __pyx_t_28 += __pyx_pybuffernd_stamps.diminfo[0].shape; + if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_stamps.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_29 = __pyx_v_i; + __pyx_t_3 = -1; + if (__pyx_t_29 < 0) { + __pyx_t_29 += __pyx_pybuffernd_pos.diminfo[0].shape; + if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_pos.diminfo[0].strides)); + __pyx_t_3 = -1; + if (__pyx_t_30 < 0) { + __pyx_t_30 += __pyx_pybuffernd_deltas.diminfo[0].shape; + if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_deltas.diminfo[0].shape)) __pyx_t_3 = 0; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3457 + * continue + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + */ + pandas_datetime_to_datetimestruct(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_stamps.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_stamps.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_deltas.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_deltas.diminfo[0].strides))), PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3458 + * pandas_datetime_to_datetimestruct(stamps[i] + deltas[pos[i]], + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) # <<<<<<<<<<<<<< + * if curr_reso < reso: + * reso = curr_reso + */ + __pyx_v_curr_reso = __pyx_f_6pandas_5tslib__reso_stamp((&__pyx_v_dts)); + + /* "pandas/tslib.pyx":3459 + * PANDAS_FR_ns, &dts) + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: # <<<<<<<<<<<<<< + * reso = curr_reso + * + */ + __pyx_t_23 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0); + if (__pyx_t_23) { + + /* "pandas/tslib.pyx":3460 + * curr_reso = _reso_stamp(&dts) + * if curr_reso < reso: + * reso = curr_reso # <<<<<<<<<<<<<< + * + * return reso + */ + __pyx_v_reso = __pyx_v_curr_reso; + goto __pyx_L21; + } + __pyx_L21:; + __pyx_L18_continue:; + } + } + __pyx_L13:; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3462 + * reso = curr_reso + * + * return reso # <<<<<<<<<<<<<< + * + * #---------------------------------------------------------------------- + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_reso); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3404 + * return D_RESO + * + * cdef _reso_local(ndarray[int64_t] stamps, object tz): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t n = len(stamps) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("pandas.tslib._reso_local", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_stamps.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_trans.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_trans); + __Pyx_XDECREF((PyObject *)__pyx_v_deltas); + __Pyx_XDECREF((PyObject *)__pyx_v_pos); + __Pyx_XDECREF((PyObject *)__pyx_v_dt); + __Pyx_XDECREF(__pyx_v_delta); + __Pyx_XDECREF(__pyx_v__pos); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3501 + * __all__ = [] + * + * def _getlang(): # <<<<<<<<<<<<<< + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_97_getlang(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_97_getlang = {__Pyx_NAMESTR("_getlang"), (PyCFunction)__pyx_pw_6pandas_5tslib_97_getlang, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_97_getlang(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getlang (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_96_getlang(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_96_getlang(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getlang", 0); + + /* "pandas/tslib.pyx":3503 + * def _getlang(): + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) # <<<<<<<<<<<<<< + * + * class LocaleTime(object): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_locale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getlocale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_locale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LC_TIME); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3501 + * __all__ = [] + * + * def _getlang(): # <<<<<<<<<<<<<< + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib._getlang", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3524 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * """Set all attributes. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6pandas_5tslib_10LocaleTime___init__[] = "Set all attributes.\n\n Order of methods called matters for dependency reasons.\n\n The locale language is set at the offset and then checked again before\n exiting. This is to make sure that the attributes were not set with a\n mix of information from more than one locale. This would most likely\n happen when using threads where one thread calls a locale-dependent\n function while another thread changes the locale while the function in\n the other thread is still running. Proper coding would call for\n locks to prevent changing the locale while locale-dependent code is\n running. The check here is done in case someone does not think about\n doing this.\n\n Only other possible issue is if someone changed the timezone and did\n not call tz.tzset . That is an issue for the programmer, though,\n since changing the timezone is worthless without that call.\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_1__init__, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_10LocaleTime___init__)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "pandas/tslib.pyx":3544 + * + * """ + * self.lang = _getlang() # <<<<<<<<<<<<<< + * self.__calc_weekday() + * self.__calc_month() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_getlang); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lang, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3545 + * """ + * self.lang = _getlang() + * self.__calc_weekday() # <<<<<<<<<<<<<< + * self.__calc_month() + * self.__calc_am_pm() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_weekday); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3546 + * self.lang = _getlang() + * self.__calc_weekday() + * self.__calc_month() # <<<<<<<<<<<<<< + * self.__calc_am_pm() + * self.__calc_timezone() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3547 + * self.__calc_weekday() + * self.__calc_month() + * self.__calc_am_pm() # <<<<<<<<<<<<<< + * self.__calc_timezone() + * self.__calc_date_time() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_am_pm); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3548 + * self.__calc_month() + * self.__calc_am_pm() + * self.__calc_timezone() # <<<<<<<<<<<<<< + * self.__calc_date_time() + * if _getlang() != self.lang: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_timezone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3549 + * self.__calc_am_pm() + * self.__calc_timezone() + * self.__calc_date_time() # <<<<<<<<<<<<<< + * if _getlang() != self.lang: + * raise ValueError("locale changed during initialization") + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_LocaleTime__calc_date_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3550 + * self.__calc_timezone() + * self.__calc_date_time() + * if _getlang() != self.lang: # <<<<<<<<<<<<<< + * raise ValueError("locale changed during initialization") + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_getlang); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lang); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "pandas/tslib.pyx":3551 + * self.__calc_date_time() + * if _getlang() != self.lang: + * raise ValueError("locale changed during initialization") # <<<<<<<<<<<<<< + * + * def __pad(self, seq, front): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "pandas/tslib.pyx":3524 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * """Set all attributes. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3553 + * raise ValueError("locale changed during initialization") + * + * def __pad(self, seq, front): # <<<<<<<<<<<<<< + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_3__pad(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_3__pad = {__Pyx_NAMESTR("__pad"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_3__pad, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_3__pad(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_seq = 0; + PyObject *__pyx_v_front = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pad (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq,&__pyx_n_s_front,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pad", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_front)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pad", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pad") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_seq = values[1]; + __pyx_v_front = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pad", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__pad", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_2__pad(__pyx_self, __pyx_v_self, __pyx_v_seq, __pyx_v_front); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_2__pad(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_front) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pad", 0); + __Pyx_INCREF(__pyx_v_seq); + + /* "pandas/tslib.pyx":3555 + * def __pad(self, seq, front): + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) # <<<<<<<<<<<<<< + * if front: + * seq.insert(0, '') + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_seq); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq); + __Pyx_GIVEREF(__pyx_v_seq); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3556 + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + * if front: # <<<<<<<<<<<<<< + * seq.insert(0, '') + * else: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_front); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "pandas/tslib.pyx":3557 + * seq = list(seq) + * if front: + * seq.insert(0, '') # <<<<<<<<<<<<<< + * else: + * seq.append('') + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_seq, __pyx_n_s_insert); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3559 + * seq.insert(0, '') + * else: + * seq.append('') # <<<<<<<<<<<<<< + * return seq + * + */ + __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_seq, __pyx_kp_s__5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3560 + * else: + * seq.append('') + * return seq # <<<<<<<<<<<<<< + * + * def __calc_weekday(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_seq); + __pyx_r = __pyx_v_seq; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3553 + * raise ValueError("locale changed during initialization") + * + * def __pad(self, seq, front): # <<<<<<<<<<<<<< + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__pad", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_seq); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3562 + * return seq + * + * def __calc_weekday(self): # <<<<<<<<<<<<<< + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_5__calc_weekday(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_5__calc_weekday = {__Pyx_NAMESTR("__calc_weekday"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_5__calc_weekday, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_5__calc_weekday(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_weekday (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_4__calc_weekday(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_4__calc_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_a_weekday = NULL; + PyObject *__pyx_v_f_weekday = NULL; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + long __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_weekday", 0); + + /* "pandas/tslib.pyx":3565 + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + * a_weekday = [calendar.day_abbr[i].lower() for i in range(7)] # <<<<<<<<<<<<<< + * f_weekday = [calendar.day_name[i].lower() for i in range(7)] + * self.a_weekday = a_weekday + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + for (__pyx_t_2 = 0; __pyx_t_2 < 7; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_day_abbr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_a_weekday = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3566 + * # module. + * a_weekday = [calendar.day_abbr[i].lower() for i in range(7)] + * f_weekday = [calendar.day_name[i].lower() for i in range(7)] # <<<<<<<<<<<<<< + * self.a_weekday = a_weekday + * self.f_weekday = f_weekday + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + for (__pyx_t_2 = 0; __pyx_t_2 < 7; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_day_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_f_weekday = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3567 + * a_weekday = [calendar.day_abbr[i].lower() for i in range(7)] + * f_weekday = [calendar.day_name[i].lower() for i in range(7)] + * self.a_weekday = a_weekday # <<<<<<<<<<<<<< + * self.f_weekday = f_weekday + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_a_weekday, __pyx_v_a_weekday) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3568 + * f_weekday = [calendar.day_name[i].lower() for i in range(7)] + * self.a_weekday = a_weekday + * self.f_weekday = f_weekday # <<<<<<<<<<<<<< + * + * def __calc_month(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_f_weekday, __pyx_v_f_weekday) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3562 + * return seq + * + * def __calc_weekday(self): # <<<<<<<<<<<<<< + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_a_weekday); + __Pyx_XDECREF(__pyx_v_f_weekday); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3570 + * self.f_weekday = f_weekday + * + * def __calc_month(self): # <<<<<<<<<<<<<< + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_7__calc_month(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_7__calc_month = {__Pyx_NAMESTR("__calc_month"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_7__calc_month, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_7__calc_month(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_month (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_6__calc_month(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_6__calc_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_a_month = NULL; + PyObject *__pyx_v_f_month = NULL; + long __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + long __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_month", 0); + + /* "pandas/tslib.pyx":3572 + * def __calc_month(self): + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] # <<<<<<<<<<<<<< + * f_month = [calendar.month_name[i].lower() for i in range(13)] + * self.a_month = a_month + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + for (__pyx_t_2 = 0; __pyx_t_2 < 13; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_month_abbr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_a_month = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3573 + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + * f_month = [calendar.month_name[i].lower() for i in range(13)] # <<<<<<<<<<<<<< + * self.a_month = a_month + * self.f_month = f_month + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + for (__pyx_t_2 = 0; __pyx_t_2 < 13; __pyx_t_2+=1) { + __pyx_v_i = __pyx_t_2; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_calendar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_month_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_f_month = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3574 + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + * f_month = [calendar.month_name[i].lower() for i in range(13)] + * self.a_month = a_month # <<<<<<<<<<<<<< + * self.f_month = f_month + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_a_month, __pyx_v_a_month) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3575 + * f_month = [calendar.month_name[i].lower() for i in range(13)] + * self.a_month = a_month + * self.f_month = f_month # <<<<<<<<<<<<<< + * + * def __calc_am_pm(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_f_month, __pyx_v_f_month) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3570 + * self.f_weekday = f_weekday + * + * def __calc_month(self): # <<<<<<<<<<<<<< + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_month", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_a_month); + __Pyx_XDECREF(__pyx_v_f_month); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3577 + * self.f_month = f_month + * + * def __calc_am_pm(self): # <<<<<<<<<<<<<< + * # Set self.am_pm by using time.strftime(). + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_9__calc_am_pm(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_9__calc_am_pm = {__Pyx_NAMESTR("__calc_am_pm"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_9__calc_am_pm, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_9__calc_am_pm(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_am_pm (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_8__calc_am_pm(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_8__calc_am_pm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_am_pm = NULL; + long __pyx_v_hour; + PyObject *__pyx_v_time_tuple = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + long __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_am_pm", 0); + + /* "pandas/tslib.pyx":3583 + * # magical; just happened to have used it everywhere else where a + * # static date was needed. + * am_pm = [] # <<<<<<<<<<<<<< + * for hour in (01,22): + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_am_pm = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3584 + * # static date was needed. + * am_pm = [] + * for hour in (01,22): # <<<<<<<<<<<<<< + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + * am_pm.append(time.strftime("%p", time_tuple).lower()) + */ + __pyx_t_1 = __pyx_tuple__86; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= 2) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_t_4 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_hour = __pyx_t_4; + + /* "pandas/tslib.pyx":3585 + * am_pm = [] + * for hour in (01,22): + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) # <<<<<<<<<<<<<< + * am_pm.append(time.strftime("%p", time_tuple).lower()) + * self.am_pm = am_pm + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_struct_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_1999); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_1999); + __Pyx_GIVEREF(__pyx_int_1999); + __Pyx_INCREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + __Pyx_INCREF(__pyx_int_17); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_17); + __Pyx_GIVEREF(__pyx_int_17); + PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_44); + PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_int_44); + __Pyx_GIVEREF(__pyx_int_44); + __Pyx_INCREF(__pyx_int_55); + PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_55); + __Pyx_GIVEREF(__pyx_int_55); + __Pyx_INCREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + __Pyx_INCREF(__pyx_int_76); + PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_int_76); + __Pyx_GIVEREF(__pyx_int_76); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_6, 8, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_time_tuple, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3586 + * for hour in (01,22): + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + * am_pm.append(time.strftime("%p", time_tuple).lower()) # <<<<<<<<<<<<<< + * self.am_pm = am_pm + * + */ + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strftime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_kp_s_p_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_p_2); + __Pyx_GIVEREF(__pyx_kp_s_p_2); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lower); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_am_pm, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3587 + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + * am_pm.append(time.strftime("%p", time_tuple).lower()) + * self.am_pm = am_pm # <<<<<<<<<<<<<< + * + * def __calc_date_time(self): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_am_pm, __pyx_v_am_pm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3577 + * self.f_month = f_month + * + * def __calc_am_pm(self): # <<<<<<<<<<<<<< + * # Set self.am_pm by using time.strftime(). + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_am_pm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_am_pm); + __Pyx_XDECREF(__pyx_v_time_tuple); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3589 + * self.am_pm = am_pm + * + * def __calc_date_time(self): # <<<<<<<<<<<<<< + * # Set self.date_time, self.date, & self.time by using + * # time.strftime(). + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_11__calc_date_time(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_11__calc_date_time = {__Pyx_NAMESTR("__calc_date_time"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_11__calc_date_time, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_11__calc_date_time(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_date_time (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_10__calc_date_time(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_10__calc_date_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_time_tuple = NULL; + PyObject *__pyx_v_date_time = NULL; + PyObject *__pyx_v_replacement_pairs = NULL; + PyObject *__pyx_v_offset = NULL; + PyObject *__pyx_v_directive = NULL; + PyObject *__pyx_v_current_format = NULL; + PyObject *__pyx_v_old = NULL; + PyObject *__pyx_v_new = NULL; + PyObject *__pyx_v_U_W = NULL; + PyObject *__pyx_v_tz_values = NULL; + PyObject *__pyx_v_tz = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + int __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_date_time", 0); + + /* "pandas/tslib.pyx":3597 + * # values within the format string is very important; it eliminates + * # possible ambiguity for what something represents. + * time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) # <<<<<<<<<<<<<< + * date_time = [None, None, None] + * date_time[0] = time.strftime("%c", time_tuple).lower() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_struct_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_time_tuple = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3598 + * # possible ambiguity for what something represents. + * time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) + * date_time = [None, None, None] # <<<<<<<<<<<<<< + * date_time[0] = time.strftime("%c", time_tuple).lower() + * date_time[1] = time.strftime("%x", time_tuple).lower() + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyList_SET_ITEM(__pyx_t_1, 2, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_v_date_time = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3599 + * time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) + * date_time = [None, None, None] + * date_time[0] = time.strftime("%c", time_tuple).lower() # <<<<<<<<<<<<<< + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strftime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_c); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_c); + __Pyx_GIVEREF(__pyx_kp_s_c); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_date_time, 0, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3600 + * date_time = [None, None, None] + * date_time[0] = time.strftime("%c", time_tuple).lower() + * date_time[1] = time.strftime("%x", time_tuple).lower() # <<<<<<<<<<<<<< + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strftime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_x); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_x); + __Pyx_GIVEREF(__pyx_kp_s_x); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_date_time, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3601 + * date_time[0] = time.strftime("%c", time_tuple).lower() + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() # <<<<<<<<<<<<<< + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strftime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_s_X); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_X); + __Pyx_GIVEREF(__pyx_kp_s_X); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_date_time, 2, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3602 + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), # <<<<<<<<<<<<<< + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_f_weekday); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_s_A_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_A_2); + __Pyx_GIVEREF(__pyx_kp_s_A_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3603 + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), # <<<<<<<<<<<<<< + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_f_month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_B_2); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_B_2); + __Pyx_GIVEREF(__pyx_kp_s_B_2); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a_weekday); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_a_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_a_2); + __Pyx_GIVEREF(__pyx_kp_s_a_2); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3604 + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), # <<<<<<<<<<<<<< + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), + * ('44', '%M'), ('55', '%S'), ('76', '%j'), + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a_month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_b_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_s_b_2); + __Pyx_GIVEREF(__pyx_kp_s_b_2); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_am_pm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_kp_s_p_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_p_2); + __Pyx_GIVEREF(__pyx_kp_s_p_2); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3602 + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), # <<<<<<<<<<<<<< + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + */ + __pyx_t_6 = PyList_New(17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_tuple__90); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_6, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_6, 4, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_6, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_tuple__91); + PyList_SET_ITEM(__pyx_t_6, 6, __pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + __Pyx_INCREF(__pyx_tuple__92); + PyList_SET_ITEM(__pyx_t_6, 7, __pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __Pyx_INCREF(__pyx_tuple__93); + PyList_SET_ITEM(__pyx_t_6, 8, __pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + __Pyx_INCREF(__pyx_tuple__94); + PyList_SET_ITEM(__pyx_t_6, 9, __pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __Pyx_INCREF(__pyx_tuple__95); + PyList_SET_ITEM(__pyx_t_6, 10, __pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __Pyx_INCREF(__pyx_tuple__96); + PyList_SET_ITEM(__pyx_t_6, 11, __pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __Pyx_INCREF(__pyx_tuple__97); + PyList_SET_ITEM(__pyx_t_6, 12, __pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __Pyx_INCREF(__pyx_tuple__98); + PyList_SET_ITEM(__pyx_t_6, 13, __pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __Pyx_INCREF(__pyx_tuple__99); + PyList_SET_ITEM(__pyx_t_6, 14, __pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __Pyx_INCREF(__pyx_tuple__100); + PyList_SET_ITEM(__pyx_t_6, 15, __pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __Pyx_INCREF(__pyx_tuple__101); + PyList_SET_ITEM(__pyx_t_6, 16, __pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_v_replacement_pairs = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3610 + * # '3' needed for when no leading zero. + * ('2', '%w'), ('10', '%I')] + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone # <<<<<<<<<<<<<< + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_timezone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { + __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_tz_values, __pyx_t_5); + __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3611 + * ('2', '%w'), ('10', '%I')] + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone + * for tz in tz_values]) # <<<<<<<<<<<<<< + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + * current_format = date_time[offset] + */ + if (PyList_CheckExact(__pyx_v_tz_values) || PyTuple_CheckExact(__pyx_v_tz_values)) { + __pyx_t_5 = __pyx_v_tz_values; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_tz_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + for (;;) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_10(__pyx_t_5); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_tz, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3610 + * # '3' needed for when no leading zero. + * ('2', '%w'), ('10', '%I')] + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone # <<<<<<<<<<<<<< + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_tz); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tz); + __Pyx_GIVEREF(__pyx_v_tz); + __Pyx_INCREF(__pyx_kp_s_Z_3); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_Z_3); + __Pyx_GIVEREF(__pyx_kp_s_Z_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyList_Extend(__pyx_v_replacement_pairs, __pyx_t_6); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3612 + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): # <<<<<<<<<<<<<< + * current_format = date_time[offset] + * for old, new in replacement_pairs: + */ + __pyx_t_6 = __pyx_tuple__105; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= 3) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (likely(__pyx_t_4 != Py_None)) { + PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_XDECREF_SET(__pyx_v_offset, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_directive, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3613 + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + * current_format = date_time[offset] # <<<<<<<<<<<<<< + * for old, new in replacement_pairs: + * # Must deal with possible lack of locale info + */ + __pyx_t_4 = PyObject_GetItem(__pyx_v_date_time, __pyx_v_offset); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_current_format, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3614 + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): + * current_format = date_time[offset] + * for old, new in replacement_pairs: # <<<<<<<<<<<<<< + * # Must deal with possible lack of locale info + * # manifesting itself as the empty string (e.g., Swedish's + */ + __pyx_t_4 = __pyx_v_replacement_pairs; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; + for (;;) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_2 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L12_unpacking_done; + __pyx_L11_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L12_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3619 + * # lack of AM/PM info) or a platform returning a tuple of empty + * # strings (e.g., MacOS 9 having timezone as ('','')). + * if old: # <<<<<<<<<<<<<< + * current_format = current_format.replace(old, new) + * # If %W is used, then Sunday, 2005-01-03 will fall on week 0 since + */ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_old); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_13) { + + /* "pandas/tslib.pyx":3620 + * # strings (e.g., MacOS 9 having timezone as ('','')). + * if old: + * current_format = current_format.replace(old, new) # <<<<<<<<<<<<<< + * # If %W is used, then Sunday, 2005-01-03 will fall on week 0 since + * # 2005-01-03 occurs before the first Monday of the year. Otherwise + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_current_format, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_old); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_old); + __Pyx_GIVEREF(__pyx_v_old); + __Pyx_INCREF(__pyx_v_new); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_new); + __Pyx_GIVEREF(__pyx_v_new); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_current_format, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3624 + * # 2005-01-03 occurs before the first Monday of the year. Otherwise + * # %U is used. + * time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0)) # <<<<<<<<<<<<<< + * if '00' in time.strftime(directive, time_tuple): + * U_W = '%W' + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_struct_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_time_tuple, __pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3625 + * # %U is used. + * time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0)) + * if '00' in time.strftime(directive, time_tuple): # <<<<<<<<<<<<<< + * U_W = '%W' + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strftime); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_directive); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_directive); + __Pyx_GIVEREF(__pyx_v_directive); + __Pyx_INCREF(__pyx_v_time_tuple); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_time_tuple); + __Pyx_GIVEREF(__pyx_v_time_tuple); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = (__Pyx_PySequence_Contains(__pyx_kp_s_00, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = (__pyx_t_13 != 0); + if (__pyx_t_14) { + + /* "pandas/tslib.pyx":3626 + * time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0)) + * if '00' in time.strftime(directive, time_tuple): + * U_W = '%W' # <<<<<<<<<<<<<< + * else: + * U_W = '%U' + */ + __Pyx_INCREF(__pyx_kp_s_W_2); + __Pyx_XDECREF_SET(__pyx_v_U_W, __pyx_kp_s_W_2); + goto __pyx_L14; + } + /*else*/ { + + /* "pandas/tslib.pyx":3628 + * U_W = '%W' + * else: + * U_W = '%U' # <<<<<<<<<<<<<< + * date_time[offset] = current_format.replace('11', U_W) + * self.LC_date_time = date_time[0] + */ + __Pyx_INCREF(__pyx_kp_s_U_2); + __Pyx_XDECREF_SET(__pyx_v_U_W, __pyx_kp_s_U_2); + } + __pyx_L14:; + + /* "pandas/tslib.pyx":3629 + * else: + * U_W = '%U' + * date_time[offset] = current_format.replace('11', U_W) # <<<<<<<<<<<<<< + * self.LC_date_time = date_time[0] + * self.LC_date = date_time[1] + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_current_format, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_11); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_11); + __Pyx_GIVEREF(__pyx_kp_s_11); + __Pyx_INCREF(__pyx_v_U_W); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_U_W); + __Pyx_GIVEREF(__pyx_v_U_W); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_date_time, __pyx_v_offset, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3630 + * U_W = '%U' + * date_time[offset] = current_format.replace('11', U_W) + * self.LC_date_time = date_time[0] # <<<<<<<<<<<<<< + * self.LC_date = date_time[1] + * self.LC_time = date_time[2] + */ + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_date_time, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_LC_date_time, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3631 + * date_time[offset] = current_format.replace('11', U_W) + * self.LC_date_time = date_time[0] + * self.LC_date = date_time[1] # <<<<<<<<<<<<<< + * self.LC_time = date_time[2] + * + */ + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_date_time, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_LC_date, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3632 + * self.LC_date_time = date_time[0] + * self.LC_date = date_time[1] + * self.LC_time = date_time[2] # <<<<<<<<<<<<<< + * + * def __calc_timezone(self): + */ + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_date_time, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_LC_time, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3589 + * self.am_pm = am_pm + * + * def __calc_date_time(self): # <<<<<<<<<<<<<< + * # Set self.date_time, self.date, & self.time by using + * # time.strftime(). + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_date_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_time_tuple); + __Pyx_XDECREF(__pyx_v_date_time); + __Pyx_XDECREF(__pyx_v_replacement_pairs); + __Pyx_XDECREF(__pyx_v_offset); + __Pyx_XDECREF(__pyx_v_directive); + __Pyx_XDECREF(__pyx_v_current_format); + __Pyx_XDECREF(__pyx_v_old); + __Pyx_XDECREF(__pyx_v_new); + __Pyx_XDECREF(__pyx_v_U_W); + __Pyx_XDECREF(__pyx_v_tz_values); + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3634 + * self.LC_time = date_time[2] + * + * def __calc_timezone(self): # <<<<<<<<<<<<<< + * # Set self.timezone by using time.tzname. + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_13__calc_timezone(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6pandas_5tslib_10LocaleTime_13__calc_timezone = {__Pyx_NAMESTR("__calc_timezone"), (PyCFunction)__pyx_pw_6pandas_5tslib_10LocaleTime_13__calc_timezone, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_6pandas_5tslib_10LocaleTime_13__calc_timezone(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__calc_timezone (wrapper)", 0); + __pyx_r = __pyx_pf_6pandas_5tslib_10LocaleTime_12__calc_timezone(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_10LocaleTime_12__calc_timezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_no_saving = NULL; + PyObject *__pyx_v_has_saving = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__calc_timezone", 0); + + /* "pandas/tslib.pyx":3638 + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + * # and time.daylight; handle that in strptime . + * try: # <<<<<<<<<<<<<< + * time.tzset() + * except AttributeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "pandas/tslib.pyx":3639 + * # and time.daylight; handle that in strptime . + * try: + * time.tzset() # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tzset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3640 + * try: + * time.tzset() + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_6) { + PyErr_Restore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "pandas/tslib.pyx":3642 + * except AttributeError: + * pass + * no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) # <<<<<<<<<<<<<< + * if time.daylight: + * has_saving = frozenset([time.tzname[1].lower()]) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tzname); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_utc); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_utc); + __Pyx_GIVEREF(__pyx_n_s_utc); + __Pyx_INCREF(__pyx_n_s_gmt); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_gmt); + __Pyx_GIVEREF(__pyx_n_s_gmt); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyFrozenSet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_no_saving = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3643 + * pass + * no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) + * if time.daylight: # <<<<<<<<<<<<<< + * has_saving = frozenset([time.tzname[1].lower()]) + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_daylight); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_7) { + + /* "pandas/tslib.pyx":3644 + * no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) + * if time.daylight: + * has_saving = frozenset([time.tzname[1].lower()]) # <<<<<<<<<<<<<< + * else: + * has_saving = frozenset() + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tzname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyFrozenSet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_has_saving = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "pandas/tslib.pyx":3646 + * has_saving = frozenset([time.tzname[1].lower()]) + * else: + * has_saving = frozenset() # <<<<<<<<<<<<<< + * self.timezone = (no_saving, has_saving) + * + */ + __pyx_t_5 = __Pyx_PyFrozenSet_New(((PyObject *)NULL)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_has_saving = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L11:; + + /* "pandas/tslib.pyx":3647 + * else: + * has_saving = frozenset() + * self.timezone = (no_saving, has_saving) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_no_saving); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_no_saving); + __Pyx_GIVEREF(__pyx_v_no_saving); + __Pyx_INCREF(__pyx_v_has_saving); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_has_saving); + __Pyx_GIVEREF(__pyx_v_has_saving); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_timezone, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3634 + * self.LC_time = date_time[2] + * + * def __calc_timezone(self): # <<<<<<<<<<<<<< + * # Set self.timezone by using time.tzname. + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pandas.tslib.LocaleTime.__calc_timezone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_no_saving); + __Pyx_XDECREF(__pyx_v_has_saving); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_6TimeRE___init__[] = "Create keys/values.\n\n Order of execution is important for dependency reasons.\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_6TimeRE_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_6pandas_5tslib_6TimeRE_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_6TimeRE___init__)}; +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_locale_time = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_locale_time,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_locale_time); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_locale_time = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_6TimeRE___init__(__pyx_self, __pyx_v_self, __pyx_v_locale_time); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_6pandas_5tslib_6TimeRE_8__init___2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + +/* "pandas/tslib.pyx":3686 + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone # <<<<<<<<<<<<<< + * for tz in tz_names), + * 'Z'), + */ + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_8__init___genexpr(PyObject *__pyx_self) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_1_genexpr(__pyx_ptype_6pandas_5tslib___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *) __pyx_self; + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6pandas_5tslib_6TimeRE_8__init___2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.__init__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6pandas_5tslib_6TimeRE_8__init___2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L8_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tz_names); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tz_names, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3687 + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone + * for tz in tz_names), # <<<<<<<<<<<<<< + * 'Z'), + * '%': '%'}) + */ + if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_tz_names) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_tz_names)) { + __pyx_t_2 = __pyx_cur_scope->__pyx_v_tz_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_tz_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_2); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tz); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tz, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "pandas/tslib.pyx":3686 + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone # <<<<<<<<<<<<<< + * for tz in tz_names), + * 'Z'), + */ + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tz); + __pyx_r = __pyx_cur_scope->__pyx_v_tz; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __Pyx_XGIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; + __pyx_cur_scope->__pyx_t_4 = __pyx_t_5; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_6; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L8_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_5 = __pyx_cur_scope->__pyx_t_4; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_5; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return NULL; +} + +/* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_locale_time) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *__pyx_cur_scope; + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)__pyx_tp_new_6pandas_5tslib___pyx_scope_struct____init__(__pyx_ptype_6pandas_5tslib___pyx_scope_struct____init__, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); + + /* "pandas/tslib.pyx":3659 + * + * """ + * if locale_time: # <<<<<<<<<<<<<< + * self.locale_time = locale_time + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_locale_time); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "pandas/tslib.pyx":3660 + * """ + * if locale_time: + * self.locale_time = locale_time # <<<<<<<<<<<<<< + * else: + * self.locale_time = LocaleTime() + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time, __pyx_v_locale_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "pandas/tslib.pyx":3662 + * self.locale_time = locale_time + * else: + * self.locale_time = LocaleTime() # <<<<<<<<<<<<<< + * base = super(TimeRE, self) + * base.__init__({ + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LocaleTime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3663 + * else: + * self.locale_time = LocaleTime() + * base = super(TimeRE, self) # <<<<<<<<<<<<<< + * base.__init__({ + * # The " \d" part of the regex is to make %c from ANSI C work + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_base = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3664 + * self.locale_time = LocaleTime() + * base = super(TimeRE, self) + * base.__init__({ # <<<<<<<<<<<<<< + * # The " \d" part of the regex is to make %c from ANSI C work + * 'd': r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])", + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_d, __pyx_kp_s_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_f, __pyx_kp_s_P_f_0_9_1_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_H, __pyx_kp_s_P_H_2_0_3_0_1_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_I, __pyx_kp_s_P_I_1_0_2_0_1_9_1_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_j, __pyx_kp_s_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_m, __pyx_kp_s_P_m_1_0_2_0_1_9_1_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_M, __pyx_kp_s_P_M_0_5_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_S, __pyx_kp_s_P_S_6_0_1_0_5_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_U, __pyx_kp_s_P_U_5_0_3_0_4_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_w, __pyx_kp_s_P_w_0_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_y, __pyx_kp_s_P_y_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_Y, __pyx_kp_s_P_Y_d_d_d_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3681 + * # 4 digits? + * 'Y': r"(?P\d\d\d\d)", + * 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), # <<<<<<<<<<<<<< + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_f_weekday); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_A); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_A); + __Pyx_GIVEREF(__pyx_n_s_A); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_A, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3682 + * 'Y': r"(?P\d\d\d\d)", + * 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), # <<<<<<<<<<<<<< + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_a_weekday); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_a); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_a); + __Pyx_GIVEREF(__pyx_n_s_a); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_a, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3683 + * 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), # <<<<<<<<<<<<<< + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_f_month); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_6, 1, 0, NULL, NULL, &__pyx_slice__108, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_B); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_B); + __Pyx_GIVEREF(__pyx_n_s_B); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_B, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3684 + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), # <<<<<<<<<<<<<< + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_a_month); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__109, 1, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_b); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_b); + __Pyx_GIVEREF(__pyx_n_s_b); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_b, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3685 + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), # <<<<<<<<<<<<<< + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone + * for tz in tz_names), + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_am_pm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_p); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_p); + __Pyx_GIVEREF(__pyx_n_s_p); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_p, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "pandas/tslib.pyx":3686 + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone # <<<<<<<<<<<<<< + * for tz in tz_names), + * 'Z'), + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_TimeRE__seqToRE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __pyx_pf_6pandas_5tslib_6TimeRE_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_Z_2); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_Z_2); + __Pyx_GIVEREF(__pyx_n_s_Z_2); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_Z_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s__52, __pyx_kp_s__52) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3664 + * self.locale_time = LocaleTime() + * base = super(TimeRE, self) + * base.__init__({ # <<<<<<<<<<<<<< + * # The " \d" part of the regex is to make %c from ANSI C work + * 'd': r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])", + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3690 + * 'Z'), + * '%': '%'}) + * base.__setitem__('W', base.__getitem__('U').replace('U', 'W')) # <<<<<<<<<<<<<< + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_setitem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_getitem); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_W); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_W); + __Pyx_GIVEREF(__pyx_n_s_W); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3691 + * '%': '%'}) + * base.__setitem__('W', base.__getitem__('U').replace('U', 'W')) + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) # <<<<<<<<<<<<<< + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_setitem); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_pattern); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_LC_date_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_c_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_c_2); + __Pyx_GIVEREF(__pyx_n_s_c_2); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pandas/tslib.pyx":3692 + * base.__setitem__('W', base.__getitem__('U').replace('U', 'W')) + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) # <<<<<<<<<<<<<< + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_setitem); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_pattern); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_LC_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_x_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_x_2); + __Pyx_GIVEREF(__pyx_n_s_x_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "pandas/tslib.pyx":3693 + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) # <<<<<<<<<<<<<< + * + * def __seqToRE(self, to_convert, directive): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_setitem); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_pattern); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_locale_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_LC_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_X_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_X_2); + __Pyx_GIVEREF(__pyx_n_s_X_2); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pandas.tslib.TimeRE.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_base); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_3__seqToRE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_6TimeRE_2__seqToRE[] = "Convert a list to a regex string for matching a directive.\n\n Want possible matching values to be from longest to shortest. This\n prevents the possibility of a match occuring for a value that also\n a substring of a larger value that should have matched (e.g., 'abc'\n matching when 'abcdef' should have been the match).\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_6TimeRE_3__seqToRE = {__Pyx_NAMESTR("__seqToRE"), (PyCFunction)__pyx_pw_6pandas_5tslib_6TimeRE_3__seqToRE, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_6TimeRE_2__seqToRE)}; +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_3__seqToRE(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_to_convert = 0; + PyObject *__pyx_v_directive = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__seqToRE (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_to_convert,&__pyx_n_s_directive,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_convert)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__seqToRE", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_directive)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__seqToRE", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__seqToRE") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_to_convert = values[1]; + __pyx_v_directive = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__seqToRE", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.__seqToRE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_6TimeRE_2__seqToRE(__pyx_self, __pyx_v_self, __pyx_v_to_convert, __pyx_v_directive); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_6pandas_5tslib_6TimeRE_9__seqToRE_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ + +/* "pandas/tslib.pyx":3710 + * else: + * return '' + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) # <<<<<<<<<<<<<< + * regex = '(?P<%s>%s' % (directive, regex) + * return '%s)' % regex + */ + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_9__seqToRE_genexpr(PyObject *__pyx_self) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_3_genexpr(__pyx_ptype_6pandas_5tslib___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *) __pyx_self; + __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6pandas_5tslib_6TimeRE_9__seqToRE_2generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.__seqToRE.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6pandas_5tslib_6TimeRE_9__seqToRE_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert)) { __Pyx_RaiseClosureNameError("to_convert"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_to_convert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_stuff); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_stuff, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re_escape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stuff); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_stuff); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stuff); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return NULL; +} + +/* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_2__seqToRE(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_to_convert, PyObject *__pyx_v_directive) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *__pyx_cur_scope; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_regex = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__seqToRE", 0); + __pyx_cur_scope = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_2___seqToRE(__pyx_ptype_6pandas_5tslib___pyx_scope_struct_2___seqToRE, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_to_convert = __pyx_v_to_convert; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_to_convert); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_to_convert); + + /* "pandas/tslib.pyx":3704 + * + * """ + * to_convert = sorted(to_convert, key=len, reverse=True) # <<<<<<<<<<<<<< + * for value in to_convert: + * if value != '': + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_to_convert); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_to_convert); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_to_convert); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetBuiltinName(__pyx_n_s_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_to_convert); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_to_convert, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3705 + * """ + * to_convert = sorted(to_convert, key=len, reverse=True) + * for value in to_convert: # <<<<<<<<<<<<<< + * if value != '': + * break + */ + if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_to_convert) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_to_convert)) { + __pyx_t_3 = __pyx_cur_scope->__pyx_v_to_convert; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_to_convert); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3706 + * to_convert = sorted(to_convert, key=len, reverse=True) + * for value in to_convert: + * if value != '': # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_kp_s__5, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + + /* "pandas/tslib.pyx":3707 + * for value in to_convert: + * if value != '': + * break # <<<<<<<<<<<<<< + * else: + * return '' + */ + goto __pyx_L4_break; + } + } + /*else*/ { + + /* "pandas/tslib.pyx":3709 + * break + * else: + * return '' # <<<<<<<<<<<<<< + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) + * regex = '(?P<%s>%s' % (directive, regex) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_r = __pyx_kp_s__5; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + } + __pyx_L4_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3710 + * else: + * return '' + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) # <<<<<<<<<<<<<< + * regex = '(?P<%s>%s' % (directive, regex) + * return '%s)' % regex + */ + __pyx_t_3 = __pyx_pf_6pandas_5tslib_6TimeRE_9__seqToRE_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__112, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_regex = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3711 + * return '' + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) + * regex = '(?P<%s>%s' % (directive, regex) # <<<<<<<<<<<<<< + * return '%s)' % regex + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_directive); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_directive); + __Pyx_GIVEREF(__pyx_v_directive); + __Pyx_INCREF(__pyx_v_regex); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_regex); + __Pyx_GIVEREF(__pyx_v_regex); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_P_s_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_regex, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3712 + * regex = '|'.join(re_escape(stuff) for stuff in to_convert) + * regex = '(?P<%s>%s' % (directive, regex) + * return '%s)' % regex # <<<<<<<<<<<<<< + * + * def pattern(self, format): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_2, __pyx_v_regex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.TimeRE.__seqToRE", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_regex); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3714 + * return '%s)' % regex + * + * def pattern(self, format): # <<<<<<<<<<<<<< + * """Return regex pattern for the format string. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_5pattern(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_6TimeRE_4pattern[] = "Return regex pattern for the format string.\n\n Need to make sure that any characters that might be interpreted as\n regex syntax are escaped.\n\n "; +static PyMethodDef __pyx_mdef_6pandas_5tslib_6TimeRE_5pattern = {__Pyx_NAMESTR("pattern"), (PyCFunction)__pyx_pw_6pandas_5tslib_6TimeRE_5pattern, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_6TimeRE_4pattern)}; +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_5pattern(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_format = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pattern (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pattern", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pattern") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_format = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pattern", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.pattern", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_6TimeRE_4pattern(__pyx_self, __pyx_v_self, __pyx_v_format); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_4pattern(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format) { + PyObject *__pyx_v_processed_format = NULL; + PyObject *__pyx_v_regex_chars = NULL; + PyObject *__pyx_v_whitespace_replacement = NULL; + PyObject *__pyx_v_directive_index = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pattern", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "pandas/tslib.pyx":3721 + * + * """ + * processed_format = '' # <<<<<<<<<<<<<< + * # The sub() call escapes all characters that might be misconstrued + * # as regex syntax. Cannot use re.escape since we have to deal with + */ + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_v_processed_format = __pyx_kp_s__5; + + /* "pandas/tslib.pyx":3725 + * # as regex syntax. Cannot use re.escape since we have to deal with + * # format directives (%m, etc.). + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") # <<<<<<<<<<<<<< + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re_compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_regex_chars = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3726 + * # format directives (%m, etc.). + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") + * format = regex_chars.sub(r"\\\1", format) # <<<<<<<<<<<<<< + * whitespace_replacement = re_compile('\s+') + * format = whitespace_replacement.sub('\s+', format) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_regex_chars, __pyx_n_s_sub_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_1); + __Pyx_GIVEREF(__pyx_kp_s_1); + __Pyx_INCREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3727 + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') # <<<<<<<<<<<<<< + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re_compile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_whitespace_replacement = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3728 + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') + * format = whitespace_replacement.sub('\s+', format) # <<<<<<<<<<<<<< + * while '%' in format: + * directive_index = format.index('%')+1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_whitespace_replacement, __pyx_n_s_sub_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_s_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_s_3); + __Pyx_GIVEREF(__pyx_kp_s_s_3); + __Pyx_INCREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3729 + * whitespace_replacement = re_compile('\s+') + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: # <<<<<<<<<<<<<< + * directive_index = format.index('%')+1 + * processed_format = "%s%s%s" % (processed_format, + */ + while (1) { + __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_kp_s__52, __pyx_v_format, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = (__pyx_t_4 != 0); + if (!__pyx_t_5) break; + + /* "pandas/tslib.pyx":3730 + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: + * directive_index = format.index('%')+1 # <<<<<<<<<<<<<< + * processed_format = "%s%s%s" % (processed_format, + * format[:directive_index-1], + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_directive_index, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3732 + * directive_index = format.index('%')+1 + * processed_format = "%s%s%s" % (processed_format, + * format[:directive_index-1], # <<<<<<<<<<<<<< + * self[format[directive_index]]) + * format = format[directive_index+1:] + */ + __pyx_t_2 = PyNumber_Subtract(__pyx_v_directive_index, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_format, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3733 + * processed_format = "%s%s%s" % (processed_format, + * format[:directive_index-1], + * self[format[directive_index]]) # <<<<<<<<<<<<<< + * format = format[directive_index+1:] + * return "%s%s" % (processed_format, format) + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_format, __pyx_v_directive_index); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetItem(__pyx_v_self, __pyx_t_2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3731 + * while '%' in format: + * directive_index = format.index('%')+1 + * processed_format = "%s%s%s" % (processed_format, # <<<<<<<<<<<<<< + * format[:directive_index-1], + * self[format[directive_index]]) + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_processed_format); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_processed_format); + __Pyx_GIVEREF(__pyx_v_processed_format); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_processed_format, __pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3734 + * format[:directive_index-1], + * self[format[directive_index]]) + * format = format[directive_index+1:] # <<<<<<<<<<<<<< + * return "%s%s" % (processed_format, format) + * + */ + __pyx_t_1 = PyNumber_Add(__pyx_v_directive_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_format, 0, 0, &__pyx_t_1, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_2); + __pyx_t_2 = 0; + } + + /* "pandas/tslib.pyx":3735 + * self[format[directive_index]]) + * format = format[directive_index+1:] + * return "%s%s" % (processed_format, format) # <<<<<<<<<<<<<< + * + * def compile(self, format): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_processed_format); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_processed_format); + __Pyx_GIVEREF(__pyx_v_processed_format); + __Pyx_INCREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3714 + * return '%s)' % regex + * + * def pattern(self, format): # <<<<<<<<<<<<<< + * """Return regex pattern for the format string. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib.TimeRE.pattern", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_processed_format); + __Pyx_XDECREF(__pyx_v_regex_chars); + __Pyx_XDECREF(__pyx_v_whitespace_replacement); + __Pyx_XDECREF(__pyx_v_directive_index); + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3737 + * return "%s%s" % (processed_format, format) + * + * def compile(self, format): # <<<<<<<<<<<<<< + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_7compile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_6TimeRE_6compile[] = "Return a compiled re object for the format string."; +static PyMethodDef __pyx_mdef_6pandas_5tslib_6TimeRE_7compile = {__Pyx_NAMESTR("compile"), (PyCFunction)__pyx_pw_6pandas_5tslib_6TimeRE_7compile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_6TimeRE_6compile)}; +static PyObject *__pyx_pw_6pandas_5tslib_6TimeRE_7compile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_format = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compile (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compile", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_format = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compile", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib.TimeRE.compile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_6TimeRE_6compile(__pyx_self, __pyx_v_self, __pyx_v_format); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_6TimeRE_6compile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compile", 0); + + /* "pandas/tslib.pyx":3739 + * def compile(self, format): + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) # <<<<<<<<<<<<<< + * + * _cache_lock = _thread_allocate_lock() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re_compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pattern); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_IGNORECASE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "pandas/tslib.pyx":3737 + * return "%s%s" % (processed_format, format) + * + * def compile(self, format): # <<<<<<<<<<<<<< + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("pandas.tslib.TimeRE.compile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "pandas/tslib.pyx":3748 + * _regex_cache = {} + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): # <<<<<<<<<<<<<< + * """Calculate the Julian day based on the year, week of the year, and day of + * the week, with week_start_day representing whether the week of the year + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6pandas_5tslib_99_calc_julian_from_U_or_W(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6pandas_5tslib_98_calc_julian_from_U_or_W[] = "Calculate the Julian day based on the year, week of the year, and day of\n the week, with week_start_day representing whether the week of the year\n assumes the week starts on Sunday or Monday (6 or 0)."; +static PyMethodDef __pyx_mdef_6pandas_5tslib_99_calc_julian_from_U_or_W = {__Pyx_NAMESTR("_calc_julian_from_U_or_W"), (PyCFunction)__pyx_pw_6pandas_5tslib_99_calc_julian_from_U_or_W, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_98_calc_julian_from_U_or_W)}; +static PyObject *__pyx_pw_6pandas_5tslib_99_calc_julian_from_U_or_W(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_year = 0; + PyObject *__pyx_v_week_of_year = 0; + PyObject *__pyx_v_day_of_week = 0; + PyObject *__pyx_v_week_starts_Mon = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_calc_julian_from_U_or_W (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_year,&__pyx_n_s_week_of_year,&__pyx_n_s_day_of_week,&__pyx_n_s_week_starts_Mon,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_year)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_week_of_year)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_calc_julian_from_U_or_W", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_day_of_week)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_calc_julian_from_U_or_W", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_week_starts_Mon)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_calc_julian_from_U_or_W", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_calc_julian_from_U_or_W") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_year = values[0]; + __pyx_v_week_of_year = values[1]; + __pyx_v_day_of_week = values[2]; + __pyx_v_week_starts_Mon = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_calc_julian_from_U_or_W", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("pandas.tslib._calc_julian_from_U_or_W", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6pandas_5tslib_98_calc_julian_from_U_or_W(__pyx_self, __pyx_v_year, __pyx_v_week_of_year, __pyx_v_day_of_week, __pyx_v_week_starts_Mon); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6pandas_5tslib_98_calc_julian_from_U_or_W(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_year, PyObject *__pyx_v_week_of_year, PyObject *__pyx_v_day_of_week, PyObject *__pyx_v_week_starts_Mon) { + PyObject *__pyx_v_first_weekday = NULL; + PyObject *__pyx_v_week_0_length = NULL; + PyObject *__pyx_v_days_to_week = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_calc_julian_from_U_or_W", 0); + __Pyx_INCREF(__pyx_v_day_of_week); + + /* "pandas/tslib.pyx":3752 + * the week, with week_start_day representing whether the week of the year + * assumes the week starts on Sunday or Monday (6 or 0).""" + * first_weekday = datetime_date(year, 1, 1).weekday() # <<<<<<<<<<<<<< + * # If we are dealing with the %U directive (week starts on Sunday), it's + * # easier to just shift the view to Sunday being the first day of the + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_year); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_year); + __Pyx_GIVEREF(__pyx_v_year); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_weekday); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_first_weekday = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3756 + * # easier to just shift the view to Sunday being the first day of the + * # week. + * if not week_starts_Mon: # <<<<<<<<<<<<<< + * first_weekday = (first_weekday + 1) % 7 + * day_of_week = (day_of_week + 1) % 7 + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_week_starts_Mon); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3757 + * # week. + * if not week_starts_Mon: + * first_weekday = (first_weekday + 1) % 7 # <<<<<<<<<<<<<< + * day_of_week = (day_of_week + 1) % 7 + * # Need to watch out for a week 0 (when the first day of the year is not + */ + __pyx_t_3 = PyNumber_Add(__pyx_v_first_weekday, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Remainder(__pyx_t_3, __pyx_int_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_first_weekday, __pyx_t_2); + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3758 + * if not week_starts_Mon: + * first_weekday = (first_weekday + 1) % 7 + * day_of_week = (day_of_week + 1) % 7 # <<<<<<<<<<<<<< + * # Need to watch out for a week 0 (when the first day of the year is not + * # the same as that specified by %U or %W). + */ + __pyx_t_2 = PyNumber_Add(__pyx_v_day_of_week, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Remainder(__pyx_t_2, __pyx_int_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_day_of_week, __pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "pandas/tslib.pyx":3761 + * # Need to watch out for a week 0 (when the first day of the year is not + * # the same as that specified by %U or %W). + * week_0_length = (7 - first_weekday) % 7 # <<<<<<<<<<<<<< + * if week_of_year == 0: + * return 1 + day_of_week - first_weekday + */ + __pyx_t_3 = PyNumber_Subtract(__pyx_int_7, __pyx_v_first_weekday); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Remainder(__pyx_t_3, __pyx_int_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_week_0_length = __pyx_t_2; + __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3762 + * # the same as that specified by %U or %W). + * week_0_length = (7 - first_weekday) % 7 + * if week_of_year == 0: # <<<<<<<<<<<<<< + * return 1 + day_of_week - first_weekday + * else: + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_week_of_year, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "pandas/tslib.pyx":3763 + * week_0_length = (7 - first_weekday) % 7 + * if week_of_year == 0: + * return 1 + day_of_week - first_weekday # <<<<<<<<<<<<<< + * else: + * days_to_week = week_0_length + (7 * (week_of_year - 1)) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyNumber_Add(__pyx_int_1, __pyx_v_day_of_week); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_v_first_weekday); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "pandas/tslib.pyx":3765 + * return 1 + day_of_week - first_weekday + * else: + * days_to_week = week_0_length + (7 * (week_of_year - 1)) # <<<<<<<<<<<<<< + * return 1 + days_to_week + day_of_week + * + */ + __pyx_t_3 = PyNumber_Subtract(__pyx_v_week_of_year, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Multiply(__pyx_int_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_week_0_length, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_days_to_week = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":3766 + * else: + * days_to_week = week_0_length + (7 * (week_of_year - 1)) + * return 1 + days_to_week + day_of_week # <<<<<<<<<<<<<< + * + * # def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyNumber_Add(__pyx_int_1, __pyx_v_days_to_week); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_day_of_week); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "pandas/tslib.pyx":3748 + * _regex_cache = {} + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): # <<<<<<<<<<<<<< + * """Calculate the Julian day based on the year, week of the year, and day of + * the week, with week_start_day representing whether the week of the year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pandas.tslib._calc_julian_from_U_or_W", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_first_weekday); + __Pyx_XDECREF(__pyx_v_week_0_length); + __Pyx_XDECREF(__pyx_v_days_to_week); + __Pyx_XDECREF(__pyx_v_day_of_week); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getbuffer__", 0); + if (__pyx_v_info != NULL) { + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + } + + /* "numpy.pxd":202 + * # of flags + * + * if info == NULL: return # <<<<<<<<<<<<<< + * + * cdef int copy_shape, i, ndim + */ + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); + if (__pyx_t_1) { + __pyx_r = 0; + goto __pyx_L0; + } + + /* "numpy.pxd":205 + * + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":206 + * cdef int copy_shape, i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":208 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "numpy.pxd":210 + * ndim = PyArray_NDIM(self) + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * copy_shape = 1 + * else: + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":211 + * + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * copy_shape = 1 # <<<<<<<<<<<<<< + * else: + * copy_shape = 0 + */ + __pyx_v_copy_shape = 1; + goto __pyx_L4; + } + /*else*/ { + + /* "numpy.pxd":213 + * copy_shape = 1 + * else: + * copy_shape = 0 # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_copy_shape = 0; + } + __pyx_L4:; + + /* "numpy.pxd":215 + * copy_shape = 0 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":216 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (__pyx_t_3) { + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":219 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_3) { + + /* "numpy.pxd":220 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_2 = __pyx_t_1; + } else { + __pyx_t_2 = __pyx_t_3; + } + if (__pyx_t_2) { + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":223 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if copy_shape: + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "numpy.pxd":224 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if copy_shape: + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "numpy.pxd":225 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if copy_shape: # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":228 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); + + /* "numpy.pxd":229 + * # This is allocated as one block, strides first. + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "numpy.pxd":230 + * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "numpy.pxd":231 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "numpy.pxd":232 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + goto __pyx_L7; + } + /*else*/ { + + /* "numpy.pxd":234 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "numpy.pxd":235 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L7:; + + /* "numpy.pxd":236 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "numpy.pxd":237 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "numpy.pxd":238 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "numpy.pxd":241 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef list stack + */ + __pyx_v_f = NULL; + + /* "numpy.pxd":242 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef list stack + * cdef int offset + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":246 + * cdef int offset + * + * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< + * + * if not hasfields and not copy_shape: + */ + __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); + + /* "numpy.pxd":248 + * cdef bint hasfields = PyDataType_HASFIELDS(descr) + * + * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< + * # do not call releasebuffer + * info.obj = None + */ + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_2) { + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); + __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":250 + * if not hasfields and not copy_shape: + * # do not call releasebuffer + * info.obj = None # <<<<<<<<<<<<<< + * else: + * # need to call releasebuffer + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = Py_None; + goto __pyx_L10; + } + /*else*/ { + + /* "numpy.pxd":253 + * else: + * # need to call releasebuffer + * info.obj = self # <<<<<<<<<<<<<< + * + * if not hasfields: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + } + __pyx_L10:; + + /* "numpy.pxd":255 + * info.obj = self + * + * if not hasfields: # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + */ + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":256 + * + * if not hasfields: + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + */ + __pyx_t_5 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_5; + + /* "numpy.pxd":257 + * if not hasfields: + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) { + + /* "numpy.pxd":258 + * t = descr.type_num + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_1) { + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_7 = __pyx_t_3; + } else { + __pyx_t_7 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_7; + } else { + __pyx_t_1 = __pyx_t_2; + } + if (__pyx_t_1) { + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + switch (__pyx_v_t) { + + /* "numpy.pxd":260 + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + case NPY_BYTE: + __pyx_v_f = __pyx_k_b; + break; + + /* "numpy.pxd":261 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = __pyx_k_B; + break; + + /* "numpy.pxd":262 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = __pyx_k_h; + break; + + /* "numpy.pxd":263 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = __pyx_k_H; + break; + + /* "numpy.pxd":264 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = __pyx_k_i; + break; + + /* "numpy.pxd":265 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = __pyx_k_I; + break; + + /* "numpy.pxd":266 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = __pyx_k_l; + break; + + /* "numpy.pxd":267 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = __pyx_k_L; + break; + + /* "numpy.pxd":268 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = __pyx_k_q; + break; + + /* "numpy.pxd":269 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = __pyx_k_Q; + break; + + /* "numpy.pxd":270 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = __pyx_k_f; + break; + + /* "numpy.pxd":271 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = __pyx_k_d; + break; + + /* "numpy.pxd":272 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = __pyx_k_g; + break; + + /* "numpy.pxd":273 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = __pyx_k_Zf; + break; + + /* "numpy.pxd":274 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = __pyx_k_Zd; + break; + + /* "numpy.pxd":275 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = __pyx_k_Zg; + break; + + /* "numpy.pxd":276 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = __pyx_k_O; + break; + default: + + /* "numpy.pxd":278 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + /* "numpy.pxd":279 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "numpy.pxd":280 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":282 + * return + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + */ + __pyx_v_info->format = ((char *)malloc(255)); + + /* "numpy.pxd":283 + * else: + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "numpy.pxd":284 + * info.format = stdlib.malloc(_buffer_format_string_len) + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "numpy.pxd":285 + * info.format[0] = '^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_9; + + /* "numpy.pxd":288 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = 0; + } + + /* "numpy.pxd":196 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(Py_None); + __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "numpy.pxd":291 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":292 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) + */ + free(__pyx_v_info->format); + goto __pyx_L3; + } + __pyx_L3:; + + /* "numpy.pxd":293 + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * stdlib.free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":294 + * stdlib.free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * stdlib.free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + free(__pyx_v_info->strides); + goto __pyx_L4; + } + __pyx_L4:; + + /* "numpy.pxd":290 + * f[0] = 0 # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * stdlib.free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "numpy.pxd":773 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":772 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "numpy.pxd":776 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":775 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "numpy.pxd":779 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":778 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "numpy.pxd":782 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":781 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "numpy.pxd":785 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numpy.pxd":784 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + long __pyx_t_10; + char *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "numpy.pxd":794 + * cdef int delta_offset + * cdef tuple i + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "numpy.pxd":795 + * cdef tuple i + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "numpy.pxd":798 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":799 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "numpy.pxd":800 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "numpy.pxd":802 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":805 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); + if (__pyx_t_6) { + __pyx_t_7 = (__pyx_v_little_endian != 0); + } else { + __pyx_t_7 = __pyx_t_6; + } + if (!__pyx_t_7) { + + /* "numpy.pxd":806 + * + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_6) { + __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_6; + } + __pyx_t_6 = __pyx_t_9; + } else { + __pyx_t_6 = __pyx_t_7; + } + if (__pyx_t_6) { + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":817 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_6) break; + + /* "numpy.pxd":818 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 120; + + /* "numpy.pxd":819 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "numpy.pxd":820 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + } + + /* "numpy.pxd":822 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + + /* "numpy.pxd":824 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":825 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3); + __pyx_t_3 = 0; + + /* "numpy.pxd":826 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (__pyx_t_6) { + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "numpy.pxd":830 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L11; + } + + /* "numpy.pxd":831 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L11; + } + + /* "numpy.pxd":832 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 104; + goto __pyx_L11; + } + + /* "numpy.pxd":833 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L11; + } + + /* "numpy.pxd":834 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 105; + goto __pyx_L11; + } + + /* "numpy.pxd":835 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L11; + } + + /* "numpy.pxd":836 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 108; + goto __pyx_L11; + } + + /* "numpy.pxd":837 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L11; + } + + /* "numpy.pxd":838 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 113; + goto __pyx_L11; + } + + /* "numpy.pxd":839 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L11; + } + + /* "numpy.pxd":840 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 102; + goto __pyx_L11; + } + + /* "numpy.pxd":841 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 100; + goto __pyx_L11; + } + + /* "numpy.pxd":842 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 103; + goto __pyx_L11; + } + + /* "numpy.pxd":843 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 102; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":844 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 100; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":845 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 103; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L11; + } + + /* "numpy.pxd":846 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 79; + goto __pyx_L11; + } + /*else*/ { + + /* "numpy.pxd":848 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L11:; + + /* "numpy.pxd":849 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L9; + } + /*else*/ { + + /* "numpy.pxd":853 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; + } + __pyx_L9:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numpy.pxd":854 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "numpy.pxd":787 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "numpy.pxd":972 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "numpy.pxd":973 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + goto __pyx_L3; + } + /*else*/ { + + /* "numpy.pxd":975 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + Py_INCREF(__pyx_v_base); + + /* "numpy.pxd":976 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "numpy.pxd":977 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "numpy.pxd":978 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "numpy.pxd":970 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "numpy.pxd":981 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "numpy.pxd":982 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + /*else*/ { + + /* "numpy.pxd":984 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "numpy.pxd":980 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":30 + * Py_ssize_t i, sz + * void* data_ptr + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":31 + * void* data_ptr + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":32 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":33 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":34 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":35 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0 and sz > 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":37 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0 and sz > 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz or sz == 0: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + __pyx_t_4 = ((__pyx_v_sz > 0) != 0); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_t_1; + } + if (__pyx_t_5) { + + /* "util.pxd":38 + * + * if i < 0 and sz > 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":39 + * if i < 0 and sz > 0: + * i += sz + * elif i >= sz or sz == 0: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_5 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (!__pyx_t_5) { + __pyx_t_1 = ((__pyx_v_sz == 0) != 0); + __pyx_t_4 = __pyx_t_1; + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":42 + * raise IndexError('index out of bounds') + * + * return get_value_1d(arr, i) # <<<<<<<<<<<<<< + * + * cdef inline set_value_at(ndarray arr, object loc, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "util.pxd":26 + * object sarr_from_data(cnp.dtype, int length, void* data) + * + * cdef inline object get_value_at(ndarray arr, object loc): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) { + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_sz; + PyObject *__pyx_v_casted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_value_at", 0); + __Pyx_INCREF(__pyx_v_loc); + + /* "util.pxd":47 + * cdef: + * Py_ssize_t i, sz + * if is_float_object(loc): # <<<<<<<<<<<<<< + * casted = int(loc) + * if casted == loc: + */ + __pyx_t_1 = (is_float_object(__pyx_v_loc) != 0); + if (__pyx_t_1) { + + /* "util.pxd":48 + * Py_ssize_t i, sz + * if is_float_object(loc): + * casted = int(loc) # <<<<<<<<<<<<<< + * if casted == loc: + * loc = casted + */ + __pyx_t_2 = PyNumber_Int(__pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_casted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "util.pxd":49 + * if is_float_object(loc): + * casted = int(loc) + * if casted == loc: # <<<<<<<<<<<<<< + * loc = casted + * i = loc + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "util.pxd":50 + * casted = int(loc) + * if casted == loc: + * loc = casted # <<<<<<<<<<<<<< + * i = loc + * sz = cnp.PyArray_SIZE(arr) + */ + __Pyx_INCREF(__pyx_v_casted); + __Pyx_DECREF_SET(__pyx_v_loc, __pyx_v_casted); + goto __pyx_L4; + } + __pyx_L4:; + goto __pyx_L3; + } + __pyx_L3:; + + /* "util.pxd":51 + * if casted == loc: + * loc = casted + * i = loc # <<<<<<<<<<<<<< + * sz = cnp.PyArray_SIZE(arr) + * + */ + __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = ((Py_ssize_t)__pyx_t_3); + + /* "util.pxd":52 + * loc = casted + * i = loc + * sz = cnp.PyArray_SIZE(arr) # <<<<<<<<<<<<<< + * + * if i < 0: + */ + __pyx_v_sz = PyArray_SIZE(__pyx_v_arr); + + /* "util.pxd":54 + * sz = cnp.PyArray_SIZE(arr) + * + * if i < 0: # <<<<<<<<<<<<<< + * i += sz + * elif i >= sz: + */ + __pyx_t_1 = ((__pyx_v_i < 0) != 0); + if (__pyx_t_1) { + + /* "util.pxd":55 + * + * if i < 0: + * i += sz # <<<<<<<<<<<<<< + * elif i >= sz: + * raise IndexError('index out of bounds') + */ + __pyx_v_i = (__pyx_v_i + __pyx_v_sz); + goto __pyx_L5; + } + + /* "util.pxd":56 + * if i < 0: + * i += sz + * elif i >= sz: # <<<<<<<<<<<<<< + * raise IndexError('index out of bounds') + * + */ + __pyx_t_1 = ((__pyx_v_i >= __pyx_v_sz) != 0); + if (__pyx_t_1) { + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L5:; + + /* "util.pxd":59 + * raise IndexError('index out of bounds') + * + * assign_value_1d(arr, i, value) # <<<<<<<<<<<<<< + * + * cdef inline int is_contiguous(ndarray arr): + */ + __pyx_t_4 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "util.pxd":44 + * return get_value_1d(arr, i) + * + * cdef inline set_value_at(ndarray arr, object loc, object value): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_casted); + __Pyx_XDECREF(__pyx_v_loc); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + +static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_contiguous", 0); + + /* "util.pxd":62 + * + * cdef inline int is_contiguous(ndarray arr): + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * + * cdef inline is_array(object o): + */ + __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS); + goto __pyx_L0; + + /* "util.pxd":61 + * assign_value_1d(arr, i, value) + * + * cdef inline int is_contiguous(ndarray arr): # <<<<<<<<<<<<<< + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_array", 0); + + /* "util.pxd":65 + * + * cdef inline is_array(object o): + * return cnp.PyArray_Check(o) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "util.pxd":64 + * return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS) + * + * cdef inline is_array(object o): # <<<<<<<<<<<<<< + * return cnp.PyArray_Check(o) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull", 0); + + /* "util.pxd":69 + * + * cdef inline bint _checknull(object val): + * try: # <<<<<<<<<<<<<< + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "util.pxd":70 + * cdef inline bint _checknull(object val): + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_4 = (__pyx_v_val == Py_None); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong(PyFloat_Check(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "util.pxd":71 + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_9) { + __Pyx_AddTraceback("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + + /* "util.pxd":72 + * return val is None or (cpython.PyFloat_Check(val) and val != val) + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknull_old(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "util.pxd":68 + * + * + * cdef inline bint _checknull(object val): # <<<<<<<<<<<<<< + * try: + * return val is None or (cpython.PyFloat_Check(val) and val != val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + +static CYTHON_INLINE int __pyx_f_4util__checknull_old(PyObject *__pyx_v_val) { + PyObject *__pyx_v_np = NULL; + double __pyx_v_INF; + double __pyx_v_NEGINF; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknull_old", 0); + + /* "util.pxd":75 + * + * cdef inline bint _checknull_old(object val): + * import numpy as np # <<<<<<<<<<<<<< + * cdef double INF = np.inf + * cdef double NEGINF = -INF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_np = __pyx_t_1; + __pyx_t_1 = 0; + + /* "util.pxd":76 + * cdef inline bint _checknull_old(object val): + * import numpy as np + * cdef double INF = np.inf # <<<<<<<<<<<<<< + * cdef double NEGINF = -INF + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_INF = ((double)__pyx_t_2); + + /* "util.pxd":77 + * import numpy as np + * cdef double INF = np.inf + * cdef double NEGINF = -INF # <<<<<<<<<<<<<< + * try: + * return val is None or val != val or val == INF or val == NEGINF + */ + __pyx_v_NEGINF = (-__pyx_v_INF); + + /* "util.pxd":78 + * cdef double INF = np.inf + * cdef double NEGINF = -INF + * try: # <<<<<<<<<<<<<< + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "util.pxd":79 + * cdef double NEGINF = -INF + * try: + * return val is None or val != val or val == INF or val == NEGINF # <<<<<<<<<<<<<< + * except ValueError: + * return False + */ + __pyx_t_6 = (__pyx_v_val == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_INF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_NEGINF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_val, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_8 = __pyx_t_9; + __pyx_t_9 = 0; + } + __pyx_t_9 = __pyx_t_8; + __pyx_t_8 = 0; + } else { + __pyx_t_9 = __pyx_t_7; + __pyx_t_7 = 0; + } + __pyx_t_7 = __pyx_t_9; + __pyx_t_9 = 0; + } else { + __pyx_t_7 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "util.pxd":80 + * try: + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_11) { + __Pyx_AddTraceback("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_9); + + /* "util.pxd":81 + * return val is None or val != val or val == INF or val == NEGINF + * except ValueError: + * return False # <<<<<<<<<<<<<< + * + * cdef inline bint _checknan(object val): + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L10_try_end:; + } + + /* "util.pxd":74 + * return False + * + * cdef inline bint _checknull_old(object val): # <<<<<<<<<<<<<< + * import numpy as np + * cdef double INF = np.inf + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("util._checknull_old", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_np); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + +static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_checknan", 0); + + /* "util.pxd":84 + * + * cdef inline bint _checknan(object val): + * return not cnp.PyArray_Check(val) and val != val # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyBool_FromLong((!(PyArray_Check(__pyx_v_val) != 0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "util.pxd":83 + * return False + * + * cdef inline bint _checknan(object val): # <<<<<<<<<<<<<< + * return not cnp.PyArray_Check(val) and val != val + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + int __pyx_v_result; + char *__pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_string_to_dts", 0); + __Pyx_INCREF(__pyx_v_val); + + /* "datetime.pxd":130 + * cdef char *tmp + * + * if PyUnicode_Check(val): # <<<<<<<<<<<<<< + * val = PyUnicode_AsASCIIString(val); + * + */ + __pyx_t_1 = (PyUnicode_Check(__pyx_v_val) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":131 + * + * if PyUnicode_Check(val): + * val = PyUnicode_AsASCIIString(val); # <<<<<<<<<<<<<< + * + * tmp = val + */ + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "datetime.pxd":133 + * val = PyUnicode_AsASCIIString(val); + * + * tmp = val # <<<<<<<<<<<<<< + * result = _cstring_to_dts(tmp, len(val), dts) + * + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_tmp = __pyx_t_3; + + /* "datetime.pxd":134 + * + * tmp = val + * result = _cstring_to_dts(tmp, len(val), dts) # <<<<<<<<<<<<<< + * + * if result == -1: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = __pyx_f_8datetime__cstring_to_dts(__pyx_v_tmp, __pyx_t_4, __pyx_v_dts); + + /* "datetime.pxd":136 + * result = _cstring_to_dts(tmp, len(val), dts) + * + * if result == -1: # <<<<<<<<<<<<<< + * raise ValueError('Unable to parse %s' % str(val)) + * + */ + __pyx_t_1 = ((__pyx_v_result == -1) != 0); + if (__pyx_t_1) { + + /* "datetime.pxd":137 + * + * if result == -1: + * raise ValueError('Unable to parse %s' % str(val)) # <<<<<<<<<<<<<< + * + * cdef inline int _cstring_to_dts(char *val, int length, + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_val); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val); + __Pyx_GIVEREF(__pyx_v_val); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_parse_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + + /* "datetime.pxd":126 + * + * + * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts): # <<<<<<<<<<<<<< + * cdef int result + * cdef char *tmp + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("datetime._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + +static CYTHON_INLINE int __pyx_f_8datetime__cstring_to_dts(char *__pyx_v_val, int __pyx_v_length, pandas_datetimestruct *__pyx_v_dts) { + npy_bool __pyx_v_islocal; + npy_bool __pyx_v_special; + PANDAS_DATETIMEUNIT __pyx_v_out_bestunit; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cstring_to_dts", 0); + + /* "datetime.pxd":146 + * int result + * + * result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns, # <<<<<<<<<<<<<< + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + */ + __pyx_v_result = parse_iso_8601_datetime(__pyx_v_val, __pyx_v_length, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, (&__pyx_v_islocal), (&__pyx_v_out_bestunit), (&__pyx_v_special)); + + /* "datetime.pxd":149 + * NPY_UNSAFE_CASTING, + * dts, &islocal, &out_bestunit, &special) + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "datetime.pxd":139 + * raise ValueError('Unable to parse %s' % str(val)) + * + * cdef inline int _cstring_to_dts(char *val, int length, # <<<<<<<<<<<<<< + * pandas_datetimestruct* dts): + * cdef: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) { + pandas_datetimestruct __pyx_v_dts; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_datetime64_to_datetime", 0); + + /* "datetime.pxd":154 + * cdef inline object _datetime64_to_datetime(int64_t val): + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) # <<<<<<<<<<<<<< + * return _dts_to_pydatetime(&dts) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts)); + + /* "datetime.pxd":155 + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + * return _dts_to_pydatetime(&dts) # <<<<<<<<<<<<<< + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_8datetime__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":152 + * + * + * cdef inline object _datetime64_to_datetime(int64_t val): # <<<<<<<<<<<<<< + * cdef pandas_datetimestruct dts + * pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + +static CYTHON_INLINE PyObject *__pyx_f_8datetime__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dts_to_pydatetime", 0); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_XDECREF(__pyx_r); + + /* "datetime.pxd":160 + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + */ + __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "datetime.pxd":158 + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): + * return PyDateTime_FromDateAndTime(dts.year, dts.month, # <<<<<<<<<<<<<< + * dts.day, dts.hour, + * dts.min, dts.sec, dts.us) + */ + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "datetime.pxd":157 + * return _dts_to_pydatetime(&dts) + * + * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * return PyDateTime_FromDateAndTime(dts.year, dts.month, + * dts.day, dts.hour, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("datetime._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_pydatetime_to_dts", 0); + + /* "datetime.pxd":163 + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":164 + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":165 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":166 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) # <<<<<<<<<<<<<< + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + */ + __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val); + + /* "datetime.pxd":167 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) # <<<<<<<<<<<<<< + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + */ + __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val); + + /* "datetime.pxd":168 + * dts.hour = PyDateTime_DATE_GET_HOUR(val) + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) # <<<<<<<<<<<<<< + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + */ + __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val); + + /* "datetime.pxd":169 + * dts.min = PyDateTime_DATE_GET_MINUTE(val) + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val); + + /* "datetime.pxd":170 + * dts.sec = PyDateTime_DATE_GET_SECOND(val) + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":171 + * dts.us = PyDateTime_DATE_GET_MICROSECOND(val) + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _dtlike_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":162 + * dts.min, dts.sec, dts.us) + * + * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts): # <<<<<<<<<<<<<< + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + npy_int64 __pyx_t_2; + npy_int32 __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dtlike_to_datetime64", 0); + + /* "datetime.pxd":175 + * cdef inline int64_t _dtlike_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = val.year # <<<<<<<<<<<<<< + * dts.month = val.month + * dts.day = val.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->year = __pyx_t_2; + + /* "datetime.pxd":176 + * pandas_datetimestruct *dts): + * dts.year = val.year + * dts.month = val.month # <<<<<<<<<<<<<< + * dts.day = val.day + * dts.hour = val.hour + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->month = __pyx_t_3; + + /* "datetime.pxd":177 + * dts.year = val.year + * dts.month = val.month + * dts.day = val.day # <<<<<<<<<<<<<< + * dts.hour = val.hour + * dts.min = val.minute + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->day = __pyx_t_3; + + /* "datetime.pxd":178 + * dts.month = val.month + * dts.day = val.day + * dts.hour = val.hour # <<<<<<<<<<<<<< + * dts.min = val.minute + * dts.sec = val.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->hour = __pyx_t_3; + + /* "datetime.pxd":179 + * dts.day = val.day + * dts.hour = val.hour + * dts.min = val.minute # <<<<<<<<<<<<<< + * dts.sec = val.second + * dts.us = val.microsecond + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->min = __pyx_t_3; + + /* "datetime.pxd":180 + * dts.hour = val.hour + * dts.min = val.minute + * dts.sec = val.second # <<<<<<<<<<<<<< + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->sec = __pyx_t_3; + + /* "datetime.pxd":181 + * dts.min = val.minute + * dts.sec = val.second + * dts.us = val.microsecond # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dts->us = __pyx_t_3; + + /* "datetime.pxd":182 + * dts.sec = val.second + * dts.us = val.microsecond + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":183 + * dts.us = val.microsecond + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + * cdef inline int64_t _date_to_datetime64(object val, + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":173 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _dtlike_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = val.year + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_WriteUnraisable("datetime._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_8datetime__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) { + __pyx_t_5numpy_int64_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_date_to_datetime64", 0); + + /* "datetime.pxd":187 + * cdef inline int64_t _date_to_datetime64(object val, + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) # <<<<<<<<<<<<<< + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":188 + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) # <<<<<<<<<<<<<< + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":189 + * dts.year = PyDateTime_GET_YEAR(val) + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) # <<<<<<<<<<<<<< + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + */ + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_v_val)); + + /* "datetime.pxd":190 + * dts.month = PyDateTime_GET_MONTH(val) + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 # <<<<<<<<<<<<<< + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + */ + __pyx_v_dts->hour = 0; + __pyx_v_dts->min = 0; + __pyx_v_dts->sec = 0; + __pyx_v_dts->us = 0; + + /* "datetime.pxd":191 + * dts.day = PyDateTime_GET_DAY(val) + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 # <<<<<<<<<<<<<< + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + */ + __pyx_v_dts->ps = 0; + __pyx_v_dts->as = 0; + + /* "datetime.pxd":192 + * dts.hour = dts.min = dts.sec = dts.us = 0 + * dts.ps = dts.as = 0 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) # <<<<<<<<<<<<<< + * + */ + __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts); + goto __pyx_L0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("datetime._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6pandas_5tslib__Timestamp __pyx_vtable_6pandas_5tslib__Timestamp; + +static PyObject *__pyx_tp_new_6pandas_5tslib__Timestamp(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5tslib__Timestamp *p; + PyObject *o = __pyx_ptype_8datetime_datetime->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5tslib__Timestamp *)o); + p->__pyx_vtab = __pyx_vtabptr_6pandas_5tslib__Timestamp; + p->offset = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib__Timestamp(PyObject *o) { + struct __pyx_obj_6pandas_5tslib__Timestamp *p = (struct __pyx_obj_6pandas_5tslib__Timestamp *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->offset); + #if CYTHON_COMPILING_IN_CPYTHON + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + if (likely(__pyx_ptype_8datetime_datetime)) __pyx_ptype_8datetime_datetime->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6pandas_5tslib__Timestamp); +} + +static int __pyx_tp_traverse_6pandas_5tslib__Timestamp(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib__Timestamp *p = (struct __pyx_obj_6pandas_5tslib__Timestamp *)o; + e = ((likely(__pyx_ptype_8datetime_datetime)) ? ((__pyx_ptype_8datetime_datetime->tp_traverse) ? __pyx_ptype_8datetime_datetime->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6pandas_5tslib__Timestamp)); if (e) return e; + if (p->offset) { + e = (*v)(p->offset, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib__Timestamp(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib__Timestamp *p = (struct __pyx_obj_6pandas_5tslib__Timestamp *)o; + if (likely(__pyx_ptype_8datetime_datetime)) { if (__pyx_ptype_8datetime_datetime->tp_clear) __pyx_ptype_8datetime_datetime->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6pandas_5tslib__Timestamp); + tmp = ((PyObject*)p->offset); + p->offset = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_5tslib_10_Timestamp_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5tslib_10_Timestamp_5value_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5tslib_10_Timestamp_nanosecond(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5tslib_10_Timestamp_10nanosecond_1__get__(o); +} + +static PyObject *__pyx_getprop_6pandas_5tslib_10_Timestamp_offset(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5tslib_10_Timestamp_6offset_1__get__(o); +} + +static PyMethodDef __pyx_methods_6pandas_5tslib__Timestamp[] = { + {__Pyx_NAMESTR("to_datetime"), (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_5to_datetime, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_11_get_field, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_start_end_field"), (PyCFunction)__pyx_pw_6pandas_5tslib_10_Timestamp_13_get_start_end_field, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6pandas_5tslib__Timestamp[] = { + {(char *)"value", __pyx_getprop_6pandas_5tslib_10_Timestamp_value, 0, 0, 0}, + {(char *)"nanosecond", __pyx_getprop_6pandas_5tslib_10_Timestamp_nanosecond, 0, 0, 0}, + {(char *)"offset", __pyx_getprop_6pandas_5tslib_10_Timestamp_offset, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number__Timestamp = { + __pyx_pw_6pandas_5tslib_10_Timestamp_7__add__, /*nb_add*/ + __pyx_pw_6pandas_5tslib_10_Timestamp_9__sub__, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PyTypeObject __pyx_type_6pandas_5tslib__Timestamp = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib._Timestamp"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib__Timestamp), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib__Timestamp, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number__Timestamp, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + __pyx_pw_6pandas_5tslib_10_Timestamp_1__hash__, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib__Timestamp, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib__Timestamp, /*tp_clear*/ + __pyx_pw_6pandas_5tslib_10_Timestamp_3__richcmp__, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5tslib__Timestamp, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_5tslib__Timestamp, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib__Timestamp, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6pandas_5tslib__NaT __pyx_vtable_6pandas_5tslib__NaT; + +static PyObject *__pyx_tp_new_6pandas_5tslib__NaT(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6pandas_5tslib__NaT *p; + PyObject *o = __pyx_tp_new_6pandas_5tslib__Timestamp(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5tslib__NaT *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_5tslib__Timestamp*)__pyx_vtabptr_6pandas_5tslib__NaT; + return o; +} + +static PyMethodDef __pyx_methods_6pandas_5tslib__NaT[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number__NaT = { + __pyx_pw_6pandas_5tslib_4_NaT_5__add__, /*nb_add*/ + __pyx_pw_6pandas_5tslib_4_NaT_7__sub__, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PyTypeObject __pyx_type_6pandas_5tslib__NaT = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib._NaT"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib__NaT), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib__Timestamp, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number__NaT, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + __pyx_pw_6pandas_5tslib_4_NaT_1__hash__, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib__Timestamp, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib__Timestamp, /*tp_clear*/ + __pyx_pw_6pandas_5tslib_4_NaT_3__richcmp__, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6pandas_5tslib__NaT, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib__NaT, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6pandas_5tslib__TSObject(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6pandas_5tslib__TSObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6pandas_5tslib__TSObject *)o); + p->tzinfo = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib__TSObject(PyObject *o) { + struct __pyx_obj_6pandas_5tslib__TSObject *p = (struct __pyx_obj_6pandas_5tslib__TSObject *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->tzinfo); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6pandas_5tslib__TSObject(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib__TSObject *p = (struct __pyx_obj_6pandas_5tslib__TSObject *)o; + if (p->tzinfo) { + e = (*v)(p->tzinfo, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib__TSObject(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib__TSObject *p = (struct __pyx_obj_6pandas_5tslib__TSObject *)o; + tmp = ((PyObject*)p->tzinfo); + p->tzinfo = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6pandas_5tslib_9_TSObject_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6pandas_5tslib_9_TSObject_5value_1__get__(o); +} + +static struct PyGetSetDef __pyx_getsets_6pandas_5tslib__TSObject[] = { + {(char *)"value", __pyx_getprop_6pandas_5tslib_9_TSObject_value, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6pandas_5tslib__TSObject = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib._TSObject"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib__TSObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib__TSObject, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib__TSObject, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib__TSObject, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6pandas_5tslib__TSObject, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib__TSObject, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *__pyx_freelist_6pandas_5tslib___pyx_scope_struct____init__[8]; +static int __pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__ = 0; + +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct____init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__)))) { + o = (PyObject*)__pyx_freelist_6pandas_5tslib___pyx_scope_struct____init__[--__pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct____init__(PyObject *o) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_self); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__)))) { + __pyx_freelist_6pandas_5tslib___pyx_scope_struct____init__[__pyx_freecount_6pandas_5tslib___pyx_scope_struct____init__++] = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct____init__(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)o; + if (p->__pyx_v_self) { + e = (*v)(p->__pyx_v_self, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct____init__(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)o; + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_5tslib___pyx_scope_struct____init__ = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib.__pyx_scope_struct____init__"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct____init__, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct____init__, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct____init__, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib___pyx_scope_struct____init__, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *__pyx_freelist_6pandas_5tslib___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr = 0; + +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_6pandas_5tslib___pyx_scope_struct_1_genexpr[--__pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_tz); + Py_CLEAR(p->__pyx_v_tz_names); + Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_t_1); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_6pandas_5tslib___pyx_scope_struct_1_genexpr[__pyx_freecount_6pandas_5tslib___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_tz) { + e = (*v)(p->__pyx_v_tz, a); if (e) return e; + } + if (p->__pyx_v_tz_names) { + e = (*v)(p->__pyx_v_tz_names, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + if (p->__pyx_t_1) { + e = (*v)(p->__pyx_t_1, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_1_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct____init__ *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_tz); + p->__pyx_v_tz = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_tz_names); + p->__pyx_v_tz_names = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_1); + p->__pyx_t_1 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_5tslib___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib.__pyx_scope_struct_1_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_1_genexpr, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib___pyx_scope_struct_1_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *__pyx_freelist_6pandas_5tslib___pyx_scope_struct_2___seqToRE[8]; +static int __pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE = 0; + +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE)))) { + o = (PyObject*)__pyx_freelist_6pandas_5tslib___pyx_scope_struct_2___seqToRE[--__pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyObject *o) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_to_convert); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE)))) { + __pyx_freelist_6pandas_5tslib___pyx_scope_struct_2___seqToRE[__pyx_freecount_6pandas_5tslib___pyx_scope_struct_2___seqToRE++] = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)o; + if (p->__pyx_v_to_convert) { + e = (*v)(p->__pyx_v_to_convert, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_2___seqToRE(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)o; + tmp = ((PyObject*)p->__pyx_v_to_convert); + p->__pyx_v_to_convert = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_5tslib___pyx_scope_struct_2___seqToRE = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib.__pyx_scope_struct_2___seqToRE"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_2___seqToRE, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_2___seqToRE, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_2___seqToRE, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib___pyx_scope_struct_2___seqToRE, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *__pyx_freelist_6pandas_5tslib___pyx_scope_struct_3_genexpr[8]; +static int __pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr = 0; + +static PyObject *__pyx_tp_new_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr)))) { + o = (PyObject*)__pyx_freelist_6pandas_5tslib___pyx_scope_struct_3_genexpr[--__pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyObject *o) { + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_stuff); + Py_CLEAR(p->__pyx_t_0); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr)))) { + __pyx_freelist_6pandas_5tslib___pyx_scope_struct_3_genexpr[__pyx_freecount_6pandas_5tslib___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_v_stuff) { + e = (*v)(p->__pyx_v_stuff, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_3_genexpr(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr *)o; + tmp = ((PyObject*)p->__pyx_outer_scope); + p->__pyx_outer_scope = ((struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_2___seqToRE *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_stuff); + p->__pyx_v_stuff = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_0); + p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6pandas_5tslib___pyx_scope_struct_3_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("pandas.tslib.__pyx_scope_struct_3_genexpr"), /*tp_name*/ + sizeof(struct __pyx_obj_6pandas_5tslib___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6pandas_5tslib___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6pandas_5tslib___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_clear_6pandas_5tslib___pyx_scope_struct_3_genexpr, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6pandas_5tslib___pyx_scope_struct_3_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("get_value_box"), (PyCFunction)__pyx_pw_6pandas_5tslib_7get_value_box, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_utcoffset"), (PyCFunction)__pyx_pw_6pandas_5tslib_15_get_utcoffset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("maybe_get_tz"), (PyCFunction)__pyx_pw_6pandas_5tslib_19maybe_get_tz, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_18maybe_get_tz)}, + {__Pyx_NAMESTR("cast_from_unit"), (PyCFunction)__pyx_pw_6pandas_5tslib_37cast_from_unit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_36cast_from_unit)}, + {__Pyx_NAMESTR("_unbox_utcoffsets"), (PyCFunction)__pyx_pw_6pandas_5tslib_53_unbox_utcoffsets, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("normalize_date"), (PyCFunction)__pyx_pw_6pandas_5tslib_73normalize_date, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_72normalize_date)}, + {__Pyx_NAMESTR("period_asfreq"), (PyCFunction)__pyx_pw_6pandas_5tslib_79period_asfreq, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_5tslib_78period_asfreq)}, + {__Pyx_NAMESTR("period_ordinal_to_dt64"), (PyCFunction)__pyx_pw_6pandas_5tslib_85period_ordinal_to_dt64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("resolution"), (PyCFunction)__pyx_pw_6pandas_5tslib_95resolution, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("tslib"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0}, + {&__pyx_kp_s_00, __pyx_k_00, sizeof(__pyx_k_00), 0, 0, 1, 0}, + {&__pyx_kp_s_02d, __pyx_k_02d, sizeof(__pyx_k_02d), 0, 0, 1, 0}, + {&__pyx_kp_s_02d_06d, __pyx_k_02d_06d, sizeof(__pyx_k_02d_06d), 0, 0, 1, 0}, + {&__pyx_kp_s_03, __pyx_k_03, sizeof(__pyx_k_03), 0, 0, 1, 0}, + {&__pyx_kp_s_03d, __pyx_k_03d, sizeof(__pyx_k_03d), 0, 0, 1, 0}, + {&__pyx_kp_s_06d, __pyx_k_06d, sizeof(__pyx_k_06d), 0, 0, 1, 0}, + {&__pyx_kp_s_09d, __pyx_k_09d, sizeof(__pyx_k_09d), 0, 0, 1, 0}, + {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, + {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, + {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, + {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0}, + {&__pyx_kp_s_1999, __pyx_k_1999, sizeof(__pyx_k_1999), 0, 0, 1, 0}, + {&__pyx_kp_s_1_6, __pyx_k_1_6, sizeof(__pyx_k_1_6), 0, 0, 1, 0}, + {&__pyx_kp_s_1_7, __pyx_k_1_7, sizeof(__pyx_k_1_7), 0, 0, 1, 0}, + {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, + {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, + {&__pyx_kp_s_2d, __pyx_k_2d, sizeof(__pyx_k_2d), 0, 0, 1, 0}, + {&__pyx_kp_s_2d_2d_2d, __pyx_k_2d_2d_2d, sizeof(__pyx_k_2d_2d_2d), 0, 0, 1, 0}, + {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, + {&__pyx_kp_s_3d, __pyx_k_3d, sizeof(__pyx_k_3d), 0, 0, 1, 0}, + {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0}, + {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0}, + {&__pyx_kp_s_6d, __pyx_k_6d, sizeof(__pyx_k_6d), 0, 0, 1, 0}, + {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0}, + {&__pyx_kp_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 0}, + {&__pyx_kp_s_9d, __pyx_k_9d, sizeof(__pyx_k_9d), 0, 0, 1, 0}, + {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, + {&__pyx_kp_b_AB, __pyx_k_AB, sizeof(__pyx_k_AB), 0, 0, 0, 0}, + {&__pyx_kp_s_AB, __pyx_k_AB, sizeof(__pyx_k_AB), 0, 0, 1, 0}, + {&__pyx_n_s_AS, __pyx_k_AS, sizeof(__pyx_k_AS), 0, 0, 1, 1}, + {&__pyx_kp_s_A_2, __pyx_k_A_2, sizeof(__pyx_k_A_2), 0, 0, 1, 0}, + {&__pyx_n_s_AmbiguousTimeError, __pyx_k_AmbiguousTimeError, sizeof(__pyx_k_AmbiguousTimeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Array_must_be_all_same_time_zone, __pyx_k_Array_must_be_all_same_time_zone, sizeof(__pyx_k_Array_must_be_all_same_time_zone), 0, 0, 1, 0}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, + {&__pyx_kp_s_B_2, __pyx_k_B_2, sizeof(__pyx_k_B_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Bad_tz_filename_Dateutil_on_pyth, __pyx_k_Bad_tz_filename_Dateutil_on_pyth, sizeof(__pyx_k_Bad_tz_filename_Dateutil_on_pyth), 0, 0, 1, 0}, + {&__pyx_n_s_BaseTzInfo, __pyx_k_BaseTzInfo, sizeof(__pyx_k_BaseTzInfo), 0, 0, 1, 1}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, + {&__pyx_n_s_CACHE_MAX_SIZE, __pyx_k_CACHE_MAX_SIZE, sizeof(__pyx_k_CACHE_MAX_SIZE), 0, 0, 1, 1}, + {&__pyx_kp_b_CD, __pyx_k_CD, sizeof(__pyx_k_CD), 0, 0, 0, 0}, + {&__pyx_kp_s_CD, __pyx_k_CD, sizeof(__pyx_k_CD), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_add_integral_value_to_Tim, __pyx_k_Cannot_add_integral_value_to_Tim, sizeof(__pyx_k_Cannot_add_integral_value_to_Tim), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_compare_type_r_with_type, __pyx_k_Cannot_compare_type_r_with_type, sizeof(__pyx_k_Cannot_compare_type_r_with_type), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_compare_tz_naive_and_tz_a, __pyx_k_Cannot_compare_tz_naive_and_tz_a, sizeof(__pyx_k_Cannot_compare_tz_naive_and_tz_a), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_convert_tz_naive_Timestam, __pyx_k_Cannot_convert_tz_naive_Timestam, sizeof(__pyx_k_Cannot_convert_tz_naive_Timestam), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_infer_dst_time_from_r_try, __pyx_k_Cannot_infer_dst_time_from_r_try, sizeof(__pyx_k_Cannot_infer_dst_time_from_r_try), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_infer_dst_time_from_s_ast, __pyx_k_Cannot_infer_dst_time_from_s_ast, sizeof(__pyx_k_Cannot_infer_dst_time_from_s_ast), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_localize_tz_aware_Timesta, __pyx_k_Cannot_localize_tz_aware_Timesta, sizeof(__pyx_k_Cannot_localize_tz_aware_Timesta), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_mix_tz_aware_with_tz_naiv, __pyx_k_Cannot_mix_tz_aware_with_tz_naiv, sizeof(__pyx_k_Cannot_mix_tz_aware_with_tz_naiv), 0, 0, 1, 0}, + {&__pyx_kp_s_Could_not_construct_Timestamp_fr, __pyx_k_Could_not_construct_Timestamp_fr, sizeof(__pyx_k_Could_not_construct_Timestamp_fr), 0, 0, 1, 0}, + {&__pyx_kp_s_Could_not_find_pytz_module, __pyx_k_Could_not_find_pytz_module, sizeof(__pyx_k_Could_not_find_pytz_module), 0, 0, 1, 0}, + {&__pyx_kp_s_Custom_business_days_is_not_supp, __pyx_k_Custom_business_days_is_not_supp, sizeof(__pyx_k_Custom_business_days_is_not_supp), 0, 0, 1, 0}, + {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, + {&__pyx_n_s_D_RESO, __pyx_k_D_RESO, sizeof(__pyx_k_D_RESO), 0, 0, 1, 1}, + {&__pyx_kp_b_EF, __pyx_k_EF, sizeof(__pyx_k_EF), 0, 0, 0, 0}, + {&__pyx_kp_s_EF, __pyx_k_EF, sizeof(__pyx_k_EF), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_b_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 0, 0}, + {&__pyx_kp_b_FQ_q, __pyx_k_FQ_q, sizeof(__pyx_k_FQ_q), 0, 0, 0, 0}, + {&__pyx_kp_s_Field_s_not_supported, __pyx_k_Field_s_not_supported, sizeof(__pyx_k_Field_s_not_supported), 0, 0, 1, 0}, + {&__pyx_kp_s_First_time_before_start_of_DST_i, __pyx_k_First_time_before_start_of_DST_i, sizeof(__pyx_k_First_time_before_start_of_DST_i), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_kp_s_Frequency_conversion_failed, __pyx_k_Frequency_conversion_failed, sizeof(__pyx_k_Frequency_conversion_failed), 0, 0, 1, 0}, + {&__pyx_kp_b_GH, __pyx_k_GH, sizeof(__pyx_k_GH), 0, 0, 0, 0}, + {&__pyx_kp_s_GH, __pyx_k_GH, sizeof(__pyx_k_GH), 0, 0, 1, 0}, + {&__pyx_kp_s_Given_date_string_not_likely_a_d, __pyx_k_Given_date_string_not_likely_a_d, sizeof(__pyx_k_Given_date_string_not_likely_a_d), 0, 0, 1, 0}, + {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1}, + {&__pyx_kp_s_H_2, __pyx_k_H_2, sizeof(__pyx_k_H_2), 0, 0, 1, 0}, + {&__pyx_n_s_H_RESO, __pyx_k_H_RESO, sizeof(__pyx_k_H_RESO), 0, 0, 1, 1}, + {&__pyx_kp_s_Handle_conversion_from_format_di, __pyx_k_Handle_conversion_from_format_di, sizeof(__pyx_k_Handle_conversion_from_format_di), 0, 0, 1, 0}, + {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1}, + {&__pyx_n_s_IGNORECASE, __pyx_k_IGNORECASE, sizeof(__pyx_k_IGNORECASE), 0, 0, 1, 1}, + {&__pyx_kp_b_IJ, __pyx_k_IJ, sizeof(__pyx_k_IJ), 0, 0, 0, 0}, + {&__pyx_kp_s_IJ, __pyx_k_IJ, sizeof(__pyx_k_IJ), 0, 0, 1, 0}, + {&__pyx_kp_s_I_2, __pyx_k_I_2, sizeof(__pyx_k_I_2), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_type_for_timedelta_scala, __pyx_k_Invalid_type_for_timedelta_scala, sizeof(__pyx_k_Invalid_type_for_timedelta_scala), 0, 0, 1, 0}, + {&__pyx_kp_b_KL, __pyx_k_KL, sizeof(__pyx_k_KL), 0, 0, 0, 0}, + {&__pyx_kp_s_KL, __pyx_k_KL, sizeof(__pyx_k_KL), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_LC_TIME, __pyx_k_LC_TIME, sizeof(__pyx_k_LC_TIME), 0, 0, 1, 1}, + {&__pyx_n_s_LC_date, __pyx_k_LC_date, sizeof(__pyx_k_LC_date), 0, 0, 1, 1}, + {&__pyx_n_s_LC_date_time, __pyx_k_LC_date_time, sizeof(__pyx_k_LC_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_LC_time, __pyx_k_LC_time, sizeof(__pyx_k_LC_time), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime, __pyx_k_LocaleTime, sizeof(__pyx_k_LocaleTime), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_am_pm, __pyx_k_LocaleTime___calc_am_pm, sizeof(__pyx_k_LocaleTime___calc_am_pm), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_date_time, __pyx_k_LocaleTime___calc_date_time, sizeof(__pyx_k_LocaleTime___calc_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_month, __pyx_k_LocaleTime___calc_month, sizeof(__pyx_k_LocaleTime___calc_month), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_timezone, __pyx_k_LocaleTime___calc_timezone, sizeof(__pyx_k_LocaleTime___calc_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___calc_weekday, __pyx_k_LocaleTime___calc_weekday, sizeof(__pyx_k_LocaleTime___calc_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___init, __pyx_k_LocaleTime___init, sizeof(__pyx_k_LocaleTime___init), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime___pad, __pyx_k_LocaleTime___pad, sizeof(__pyx_k_LocaleTime___pad), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_am_pm, __pyx_k_LocaleTime__calc_am_pm, sizeof(__pyx_k_LocaleTime__calc_am_pm), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_date_time, __pyx_k_LocaleTime__calc_date_time, sizeof(__pyx_k_LocaleTime__calc_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_month, __pyx_k_LocaleTime__calc_month, sizeof(__pyx_k_LocaleTime__calc_month), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_timezone, __pyx_k_LocaleTime__calc_timezone, sizeof(__pyx_k_LocaleTime__calc_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__calc_weekday, __pyx_k_LocaleTime__calc_weekday, sizeof(__pyx_k_LocaleTime__calc_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_LocaleTime__pad, __pyx_k_LocaleTime__pad, sizeof(__pyx_k_LocaleTime__pad), 0, 0, 1, 1}, + {&__pyx_n_s_LooseVersion, __pyx_k_LooseVersion, sizeof(__pyx_k_LooseVersion), 0, 0, 1, 1}, + {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1}, + {&__pyx_kp_s_M8_ns, __pyx_k_M8_ns, sizeof(__pyx_k_M8_ns), 0, 0, 1, 0}, + {&__pyx_kp_s_M8_s, __pyx_k_M8_s, sizeof(__pyx_k_M8_s), 0, 0, 1, 0}, + {&__pyx_n_s_MS, __pyx_k_MS, sizeof(__pyx_k_MS), 0, 0, 1, 1}, + {&__pyx_n_s_MS_RESO, __pyx_k_MS_RESO, sizeof(__pyx_k_MS_RESO), 0, 0, 1, 1}, + {&__pyx_kp_s_M_2, __pyx_k_M_2, sizeof(__pyx_k_M_2), 0, 0, 1, 0}, + {&__pyx_n_s_NAN, __pyx_k_NAN, sizeof(__pyx_k_NAN), 0, 0, 1, 1}, + {&__pyx_n_s_NAT, __pyx_k_NAT, sizeof(__pyx_k_NAT), 0, 0, 1, 1}, + {&__pyx_kp_s_N_ot_A_T_ime_the_time_equivalen, __pyx_k_N_ot_A_T_ime_the_time_equivalen, sizeof(__pyx_k_N_ot_A_T_ime_the_time_equivalen), 0, 0, 1, 0}, + {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1}, + {&__pyx_n_s_NaT, __pyx_k_NaT, sizeof(__pyx_k_NaT), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType, __pyx_k_NaTType, sizeof(__pyx_k_NaTType), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___hash, __pyx_k_NaTType___hash, sizeof(__pyx_k_NaTType___hash), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___int, __pyx_k_NaTType___int, sizeof(__pyx_k_NaTType___int), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___long, __pyx_k_NaTType___long, sizeof(__pyx_k_NaTType___long), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___new, __pyx_k_NaTType___new, sizeof(__pyx_k_NaTType___new), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___reduce, __pyx_k_NaTType___reduce, sizeof(__pyx_k_NaTType___reduce), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___repr, __pyx_k_NaTType___repr, sizeof(__pyx_k_NaTType___repr), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType___str, __pyx_k_NaTType___str, sizeof(__pyx_k_NaTType___str), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType_toordinal, __pyx_k_NaTType_toordinal, sizeof(__pyx_k_NaTType_toordinal), 0, 0, 1, 1}, + {&__pyx_n_s_NaTType_weekday, __pyx_k_NaTType_weekday, sizeof(__pyx_k_NaTType_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_NameError, __pyx_k_NameError, sizeof(__pyx_k_NameError), 0, 0, 1, 1}, + {&__pyx_n_s_NonExistentTimeError, __pyx_k_NonExistentTimeError, sizeof(__pyx_k_NonExistentTimeError), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1}, + {&__pyx_kp_s_NumPy_1_6_1_business_freq_not_su, __pyx_k_NumPy_1_6_1_business_freq_not_su, sizeof(__pyx_k_NumPy_1_6_1_business_freq_not_su), 0, 0, 1, 0}, + {&__pyx_n_s_OutOfBoundsDatetime, __pyx_k_OutOfBoundsDatetime, sizeof(__pyx_k_OutOfBoundsDatetime), 0, 0, 1, 1}, + {&__pyx_kp_s_Out_of_bounds_nanosecond_timesta, __pyx_k_Out_of_bounds_nanosecond_timesta, sizeof(__pyx_k_Out_of_bounds_nanosecond_timesta), 0, 0, 1, 0}, + {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, + {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1}, + {&__pyx_kp_s_P_H_2_0_3_0_1_d_d, __pyx_k_P_H_2_0_3_0_1_d_d, sizeof(__pyx_k_P_H_2_0_3_0_1_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_I_1_0_2_0_1_9_1_9, __pyx_k_P_I_1_0_2_0_1_9_1_9, sizeof(__pyx_k_P_I_1_0_2_0_1_9_1_9), 0, 0, 1, 0}, + {&__pyx_kp_s_P_M_0_5_d_d, __pyx_k_P_M_0_5_d_d, sizeof(__pyx_k_P_M_0_5_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_S_6_0_1_0_5_d_d, __pyx_k_P_S_6_0_1_0_5_d_d, sizeof(__pyx_k_P_S_6_0_1_0_5_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_U_5_0_3_0_4_d_d, __pyx_k_P_U_5_0_3_0_4_d_d, sizeof(__pyx_k_P_U_5_0_3_0_4_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_Y_d_d_d_d, __pyx_k_P_Y_d_d_d_d, sizeof(__pyx_k_P_Y_d_d_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9, __pyx_k_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9, sizeof(__pyx_k_P_d_3_0_1_1_2_d_0_1_9_1_9_1_9), 0, 0, 1, 0}, + {&__pyx_kp_s_P_f_0_9_1_6, __pyx_k_P_f_0_9_1_6, sizeof(__pyx_k_P_f_0_9_1_6), 0, 0, 1, 0}, + {&__pyx_kp_s_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1, __pyx_k_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1, sizeof(__pyx_k_P_j_36_0_6_3_0_5_d_1_2_d_d_0_1), 0, 0, 1, 0}, + {&__pyx_kp_s_P_m_1_0_2_0_1_9_1_9, __pyx_k_P_m_1_0_2_0_1_9_1_9, sizeof(__pyx_k_P_m_1_0_2_0_1_9_1_9), 0, 0, 1, 0}, + {&__pyx_kp_s_P_s_s, __pyx_k_P_s_s, sizeof(__pyx_k_P_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_P_w_0_6, __pyx_k_P_w_0_6, sizeof(__pyx_k_P_w_0_6), 0, 0, 1, 0}, + {&__pyx_kp_s_P_y_d_d, __pyx_k_P_y_d_d, sizeof(__pyx_k_P_y_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_Period, __pyx_k_Period, sizeof(__pyx_k_Period), 0, 0, 1, 1}, + {&__pyx_n_s_QS, __pyx_k_QS, sizeof(__pyx_k_QS), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_kp_s_S_2, __pyx_k_S_2, sizeof(__pyx_k_S_2), 0, 0, 1, 0}, + {&__pyx_n_s_S_RESO, __pyx_k_S_RESO, sizeof(__pyx_k_S_RESO), 0, 0, 1, 1}, + {&__pyx_kp_s_Stores_and_handles_locale_specif, __pyx_k_Stores_and_handles_locale_specif, sizeof(__pyx_k_Stores_and_handles_locale_specif), 0, 0, 1, 0}, + {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, + {&__pyx_n_s_T_RESO, __pyx_k_T_RESO, sizeof(__pyx_k_T_RESO), 0, 0, 1, 1}, + {&__pyx_kp_s_There_are_i_dst_switches_when_th, __pyx_k_There_are_i_dst_switches_when_th, sizeof(__pyx_k_There_are_i_dst_switches_when_th), 0, 0, 1, 0}, + {&__pyx_n_s_TimeRE, __pyx_k_TimeRE, sizeof(__pyx_k_TimeRE), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE___init, __pyx_k_TimeRE___init, sizeof(__pyx_k_TimeRE___init), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE___seqToRE, __pyx_k_TimeRE___seqToRE, sizeof(__pyx_k_TimeRE___seqToRE), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE__seqToRE, __pyx_k_TimeRE__seqToRE, sizeof(__pyx_k_TimeRE__seqToRE), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE_cache, __pyx_k_TimeRE_cache, sizeof(__pyx_k_TimeRE_cache), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE_compile, __pyx_k_TimeRE_compile, sizeof(__pyx_k_TimeRE_compile), 0, 0, 1, 1}, + {&__pyx_n_s_TimeRE_pattern, __pyx_k_TimeRE_pattern, sizeof(__pyx_k_TimeRE_pattern), 0, 0, 1, 1}, + {&__pyx_kp_s_TimeStamp_is_the_pandas_equivale, __pyx_k_TimeStamp_is_the_pandas_equivale, sizeof(__pyx_k_TimeStamp_is_the_pandas_equivale), 0, 0, 1, 0}, + {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp___new, __pyx_k_Timestamp___new, sizeof(__pyx_k_Timestamp___new), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp___reduce, __pyx_k_Timestamp___reduce, sizeof(__pyx_k_Timestamp___reduce), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp___repr, __pyx_k_Timestamp___repr, sizeof(__pyx_k_Timestamp___repr), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp___setstate, __pyx_k_Timestamp___setstate, sizeof(__pyx_k_Timestamp___setstate), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp__date_repr, __pyx_k_Timestamp__date_repr, sizeof(__pyx_k_Timestamp__date_repr), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp__has_time_component, __pyx_k_Timestamp__has_time_component, sizeof(__pyx_k_Timestamp__has_time_component), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp__repr_base, __pyx_k_Timestamp__repr_base, sizeof(__pyx_k_Timestamp__repr_base), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp__time_repr, __pyx_k_Timestamp__time_repr, sizeof(__pyx_k_Timestamp__time_repr), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_asm8, __pyx_k_Timestamp_asm8, sizeof(__pyx_k_Timestamp_asm8), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_dayofweek, __pyx_k_Timestamp_dayofweek, sizeof(__pyx_k_Timestamp_dayofweek), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_dayofyear, __pyx_k_Timestamp_dayofyear, sizeof(__pyx_k_Timestamp_dayofyear), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_freq, __pyx_k_Timestamp_freq, sizeof(__pyx_k_Timestamp_freq), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_freqstr, __pyx_k_Timestamp_freqstr, sizeof(__pyx_k_Timestamp_freqstr), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_fromordinal, __pyx_k_Timestamp_fromordinal, sizeof(__pyx_k_Timestamp_fromordinal), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_month_end, __pyx_k_Timestamp_is_month_end, sizeof(__pyx_k_Timestamp_is_month_end), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_month_start, __pyx_k_Timestamp_is_month_start, sizeof(__pyx_k_Timestamp_is_month_start), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_quarter_end, __pyx_k_Timestamp_is_quarter_end, sizeof(__pyx_k_Timestamp_is_quarter_end), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_quarter_start, __pyx_k_Timestamp_is_quarter_start, sizeof(__pyx_k_Timestamp_is_quarter_start), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_year_end, __pyx_k_Timestamp_is_year_end, sizeof(__pyx_k_Timestamp_is_year_end), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_is_year_start, __pyx_k_Timestamp_is_year_start, sizeof(__pyx_k_Timestamp_is_year_start), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_isoformat, __pyx_k_Timestamp_isoformat, sizeof(__pyx_k_Timestamp_isoformat), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_now, __pyx_k_Timestamp_now, sizeof(__pyx_k_Timestamp_now), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_quarter, __pyx_k_Timestamp_quarter, sizeof(__pyx_k_Timestamp_quarter), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_replace, __pyx_k_Timestamp_replace, sizeof(__pyx_k_Timestamp_replace), 0, 0, 1, 1}, + {&__pyx_kp_s_Timestamp_stamp_tz_offset, __pyx_k_Timestamp_stamp_tz_offset, sizeof(__pyx_k_Timestamp_stamp_tz_offset), 0, 0, 1, 0}, + {&__pyx_n_s_Timestamp_to_julian_date, __pyx_k_Timestamp_to_julian_date, sizeof(__pyx_k_Timestamp_to_julian_date), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_to_period, __pyx_k_Timestamp_to_period, sizeof(__pyx_k_Timestamp_to_period), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_to_pydatetime, __pyx_k_Timestamp_to_pydatetime, sizeof(__pyx_k_Timestamp_to_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_today, __pyx_k_Timestamp_today, sizeof(__pyx_k_Timestamp_today), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_tz, __pyx_k_Timestamp_tz, sizeof(__pyx_k_Timestamp_tz), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_tz_convert, __pyx_k_Timestamp_tz_convert, sizeof(__pyx_k_Timestamp_tz_convert), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_tz_localize, __pyx_k_Timestamp_tz_localize, sizeof(__pyx_k_Timestamp_tz_localize), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_utcnow, __pyx_k_Timestamp_utcnow, sizeof(__pyx_k_Timestamp_utcnow), 0, 0, 1, 1}, + {&__pyx_n_s_Timestamp_week, __pyx_k_Timestamp_week, sizeof(__pyx_k_Timestamp_week), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Tz_aware_datetime_datetime_canno, __pyx_k_Tz_aware_datetime_datetime_canno, sizeof(__pyx_k_Tz_aware_datetime_datetime_canno), 0, 0, 1, 0}, + {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, + {&__pyx_n_s_US_RESO, __pyx_k_US_RESO, sizeof(__pyx_k_US_RESO), 0, 0, 1, 1}, + {&__pyx_n_s_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 0, 1, 1}, + {&__pyx_kp_s_U_2, __pyx_k_U_2, sizeof(__pyx_k_U_2), 0, 0, 1, 0}, + {&__pyx_n_s_U_W, __pyx_k_U_W, sizeof(__pyx_k_U_W), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_to_desired_fre, __pyx_k_Unable_to_convert_to_desired_fre, sizeof(__pyx_k_Unable_to_convert_to_desired_fre), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_get_quarter_and_year, __pyx_k_Unable_to_get_quarter_and_year, sizeof(__pyx_k_Unable_to_get_quarter_and_year), 0, 0, 1, 0}, + {&__pyx_kp_s_Unable_to_parse_s, __pyx_k_Unable_to_parse_s, sizeof(__pyx_k_Unable_to_parse_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Unknown_freq_d, __pyx_k_Unknown_freq_d, sizeof(__pyx_k_Unknown_freq_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_period_code_d, __pyx_k_Unrecognized_period_code_d, sizeof(__pyx_k_Unrecognized_period_code_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_type_s, __pyx_k_Unrecognized_type_s, sizeof(__pyx_k_Unrecognized_type_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Unrecognized_value_type_s, __pyx_k_Unrecognized_value_type_s, sizeof(__pyx_k_Unrecognized_value_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1}, + {&__pyx_kp_s_W_2, __pyx_k_W_2, sizeof(__pyx_k_W_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Warning_discarding_nonzero_nanos, __pyx_k_Warning_discarding_nonzero_nanos, sizeof(__pyx_k_Warning_discarding_nonzero_nanos), 0, 0, 1, 0}, + {&__pyx_kp_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 0}, + {&__pyx_n_s_X_2, __pyx_k_X_2, sizeof(__pyx_k_X_2), 0, 0, 1, 1}, + {&__pyx_n_s_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 0, 1, 1}, + {&__pyx_kp_b_Y_2, __pyx_k_Y_2, sizeof(__pyx_k_Y_2), 0, 0, 0, 0}, + {&__pyx_kp_s_Y_2, __pyx_k_Y_2, sizeof(__pyx_k_Y_2), 0, 0, 1, 0}, + {&__pyx_kp_b_Y_m, __pyx_k_Y_m, sizeof(__pyx_k_Y_m), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d, __pyx_k_Y_m_d, sizeof(__pyx_k_Y_m_d), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_00, __pyx_k_Y_m_d_H_00, sizeof(__pyx_k_Y_m_d_H_00), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M, __pyx_k_Y_m_d_H_M, sizeof(__pyx_k_Y_m_d_H_M), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M_S, __pyx_k_Y_m_d_H_M_S, sizeof(__pyx_k_Y_m_d_H_M_S), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M_S_l, __pyx_k_Y_m_d_H_M_S_l, sizeof(__pyx_k_Y_m_d_H_M_S_l), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M_S_n, __pyx_k_Y_m_d_H_M_S_n, sizeof(__pyx_k_Y_m_d_H_M_S_n), 0, 0, 0, 0}, + {&__pyx_kp_b_Y_m_d_H_M_S_u, __pyx_k_Y_m_d_H_M_S_u, sizeof(__pyx_k_Y_m_d_H_M_S_u), 0, 0, 0, 0}, + {&__pyx_kp_s_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 0, 1, 0}, + {&__pyx_n_s_Z_2, __pyx_k_Z_2, sizeof(__pyx_k_Z_2), 0, 0, 1, 1}, + {&__pyx_kp_s_Z_3, __pyx_k_Z_3, sizeof(__pyx_k_Z_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Z_tz_s, __pyx_k_Z_tz_s, sizeof(__pyx_k_Z_tz_s), 0, 0, 1, 0}, + {&__pyx_kp_s__112, __pyx_k__112, sizeof(__pyx_k__112), 0, 0, 1, 0}, + {&__pyx_kp_s__113, __pyx_k__113, sizeof(__pyx_k__113), 0, 0, 1, 0}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 0, 1, 0}, + {&__pyx_kp_s__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 0, 1, 0}, + {&__pyx_kp_s__52, __pyx_k__52, sizeof(__pyx_k__52), 0, 0, 1, 0}, + {&__pyx_kp_s__89, __pyx_k__89, sizeof(__pyx_k__89), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_kp_s_a_2, __pyx_k_a_2, sizeof(__pyx_k_a_2), 0, 0, 1, 0}, + {&__pyx_n_s_a_idx, __pyx_k_a_idx, sizeof(__pyx_k_a_idx), 0, 0, 1, 1}, + {&__pyx_n_s_a_month, __pyx_k_a_month, sizeof(__pyx_k_a_month), 0, 0, 1, 1}, + {&__pyx_n_s_a_weekday, __pyx_k_a_weekday, sizeof(__pyx_k_a_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1}, + {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_all_2, __pyx_k_all_2, sizeof(__pyx_k_all_2), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_lock, __pyx_k_allocate_lock, sizeof(__pyx_k_allocate_lock), 0, 0, 1, 1}, + {&__pyx_n_s_am_pm, __pyx_k_am_pm, sizeof(__pyx_k_am_pm), 0, 0, 1, 1}, + {&__pyx_n_s_ampm, __pyx_k_ampm, sizeof(__pyx_k_ampm), 0, 0, 1, 1}, + {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1}, + {&__pyx_n_s_apply_offset, __pyx_k_apply_offset, sizeof(__pyx_k_apply_offset), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_array_split, __pyx_k_array_split, sizeof(__pyx_k_array_split), 0, 0, 1, 1}, + {&__pyx_n_s_array_strptime, __pyx_k_array_strptime, sizeof(__pyx_k_array_strptime), 0, 0, 1, 1}, + {&__pyx_n_s_array_to_datetime, __pyx_k_array_to_datetime, sizeof(__pyx_k_array_to_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_array_to_timedelta64, __pyx_k_array_to_timedelta64, sizeof(__pyx_k_array_to_timedelta64), 0, 0, 1, 1}, + {&__pyx_n_s_asm8, __pyx_k_asm8, sizeof(__pyx_k_asm8), 0, 0, 1, 1}, + {&__pyx_n_s_astimezone, __pyx_k_astimezone, sizeof(__pyx_k_astimezone), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_kp_s_b_2, __pyx_k_b_2, sizeof(__pyx_k_b_2), 0, 0, 1, 0}, + {&__pyx_n_s_b_idx, __pyx_k_b_idx, sizeof(__pyx_k_b_idx), 0, 0, 1, 1}, + {&__pyx_n_s_bad_directive, __pyx_k_bad_directive, sizeof(__pyx_k_bad_directive), 0, 0, 1, 1}, + {&__pyx_kp_s_bad_month_number_0_must_be_1_12, __pyx_k_bad_month_number_0_must_be_1_12, sizeof(__pyx_k_bad_month_number_0_must_be_1_12), 0, 0, 1, 0}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_base1, __pyx_k_base1, sizeof(__pyx_k_base1), 0, 0, 1, 1}, + {&__pyx_n_s_base2, __pyx_k_base2, sizeof(__pyx_k_base2), 0, 0, 1, 1}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_both_eq, __pyx_k_both_eq, sizeof(__pyx_k_both_eq), 0, 0, 1, 1}, + {&__pyx_n_s_both_nat, __pyx_k_both_nat, sizeof(__pyx_k_both_nat), 0, 0, 1, 1}, + {&__pyx_n_s_boxed, __pyx_k_boxed, sizeof(__pyx_k_boxed), 0, 0, 1, 1}, + {&__pyx_n_s_build_field_sarray, __pyx_k_build_field_sarray, sizeof(__pyx_k_build_field_sarray), 0, 0, 1, 1}, + {&__pyx_kp_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 0}, + {&__pyx_n_s_c_2, __pyx_k_c_2, sizeof(__pyx_k_c_2), 0, 0, 1, 1}, + {&__pyx_n_s_cache_lock, __pyx_k_cache_lock, sizeof(__pyx_k_cache_lock), 0, 0, 1, 1}, + {&__pyx_n_s_calc_am_pm, __pyx_k_calc_am_pm, sizeof(__pyx_k_calc_am_pm), 0, 0, 1, 1}, + {&__pyx_n_s_calc_date_time, __pyx_k_calc_date_time, sizeof(__pyx_k_calc_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_calc_julian_from_U_or_W, __pyx_k_calc_julian_from_U_or_W, sizeof(__pyx_k_calc_julian_from_U_or_W), 0, 0, 1, 1}, + {&__pyx_n_s_calc_month, __pyx_k_calc_month, sizeof(__pyx_k_calc_month), 0, 0, 1, 1}, + {&__pyx_n_s_calc_timezone, __pyx_k_calc_timezone, sizeof(__pyx_k_calc_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_calc_weekday, __pyx_k_calc_weekday, sizeof(__pyx_k_calc_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_calendar, __pyx_k_calendar, sizeof(__pyx_k_calendar), 0, 0, 1, 1}, + {&__pyx_kp_s_cannot_cast_unit_0, __pyx_k_cannot_cast_unit_0, sizeof(__pyx_k_cannot_cast_unit_0), 0, 0, 1, 0}, + {&__pyx_n_s_cast_to_nanoseconds, __pyx_k_cast_to_nanoseconds, sizeof(__pyx_k_cast_to_nanoseconds), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, + {&__pyx_n_s_coerce, __pyx_k_coerce, sizeof(__pyx_k_coerce), 0, 0, 1, 1}, + {&__pyx_n_s_combine, __pyx_k_combine, sizeof(__pyx_k_combine), 0, 0, 1, 1}, + {&__pyx_n_s_compat_NaT, __pyx_k_compat_NaT, sizeof(__pyx_k_compat_NaT), 0, 0, 1, 1}, + {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, + {&__pyx_n_s_convert_to_timedelta, __pyx_k_convert_to_timedelta, sizeof(__pyx_k_convert_to_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_current_format, __pyx_k_current_format, sizeof(__pyx_k_current_format), 0, 0, 1, 1}, + {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, + {&__pyx_kp_s_d_2, __pyx_k_d_2, sizeof(__pyx_k_d_2), 0, 0, 1, 0}, + {&__pyx_kp_s_d_2d_2d, __pyx_k_d_2d_2d, sizeof(__pyx_k_d_2d_2d), 0, 0, 1, 0}, + {&__pyx_kp_s_d_2d_2d_2d_2d_2d, __pyx_k_d_2d_2d_2d_2d_2d, sizeof(__pyx_k_d_2d_2d_2d_2d_2d), 0, 0, 1, 0}, + {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, + {&__pyx_n_s_date_normalize, __pyx_k_date_normalize, sizeof(__pyx_k_date_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_date_repr, __pyx_k_date_repr, sizeof(__pyx_k_date_repr), 0, 0, 1, 1}, + {&__pyx_n_s_date_string, __pyx_k_date_string, sizeof(__pyx_k_date_string), 0, 0, 1, 1}, + {&__pyx_n_s_date_time, __pyx_k_date_time, sizeof(__pyx_k_date_time), 0, 0, 1, 1}, + {&__pyx_n_s_dates_normalized, __pyx_k_dates_normalized, sizeof(__pyx_k_dates_normalized), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_datetime64, __pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_date, __pyx_k_datetime_date, sizeof(__pyx_k_datetime_date), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_result, __pyx_k_datetime_result, sizeof(__pyx_k_datetime_result), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_time, __pyx_k_datetime_time, sizeof(__pyx_k_datetime_time), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_to_datetime64, __pyx_k_datetime_to_datetime64, sizeof(__pyx_k_datetime_to_datetime64), 0, 0, 1, 1}, + {&__pyx_kp_s_dateutil, __pyx_k_dateutil, sizeof(__pyx_k_dateutil), 0, 0, 1, 0}, + {&__pyx_n_s_dateutil_2, __pyx_k_dateutil_2, sizeof(__pyx_k_dateutil_2), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_gettz, __pyx_k_dateutil_gettz, sizeof(__pyx_k_dateutil_gettz), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tz, __pyx_k_dateutil_tz, sizeof(__pyx_k_dateutil_tz), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tzfile, __pyx_k_dateutil_tzfile, sizeof(__pyx_k_dateutil_tzfile), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tzlocal, __pyx_k_dateutil_tzlocal, sizeof(__pyx_k_dateutil_tzlocal), 0, 0, 1, 1}, + {&__pyx_n_s_dateutil_tzutc, __pyx_k_dateutil_tzutc, sizeof(__pyx_k_dateutil_tzutc), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_day_abbr, __pyx_k_day_abbr, sizeof(__pyx_k_day_abbr), 0, 0, 1, 1}, + {&__pyx_n_s_day_name, __pyx_k_day_name, sizeof(__pyx_k_day_name), 0, 0, 1, 1}, + {&__pyx_n_s_day_of_week, __pyx_k_day_of_week, sizeof(__pyx_k_day_of_week), 0, 0, 1, 1}, + {&__pyx_n_s_dayfirst, __pyx_k_dayfirst, sizeof(__pyx_k_dayfirst), 0, 0, 1, 1}, + {&__pyx_n_s_daylight, __pyx_k_daylight, sizeof(__pyx_k_daylight), 0, 0, 1, 1}, + {&__pyx_n_s_dayofweek, __pyx_k_dayofweek, sizeof(__pyx_k_dayofweek), 0, 0, 1, 1}, + {&__pyx_n_s_dayofyear, __pyx_k_dayofyear, sizeof(__pyx_k_dayofyear), 0, 0, 1, 1}, + {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1}, + {&__pyx_n_s_days_to_week, __pyx_k_days_to_week, sizeof(__pyx_k_days_to_week), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1}, + {&__pyx_n_s_delta_to_nanoseconds, __pyx_k_delta_to_nanoseconds, sizeof(__pyx_k_delta_to_nanoseconds), 0, 0, 1, 1}, + {&__pyx_n_s_deltas, __pyx_k_deltas, sizeof(__pyx_k_deltas), 0, 0, 1, 1}, + {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, + {&__pyx_n_s_directive, __pyx_k_directive, sizeof(__pyx_k_directive), 0, 0, 1, 1}, + {&__pyx_n_s_directive_index, __pyx_k_directive_index, sizeof(__pyx_k_directive_index), 0, 0, 1, 1}, + {&__pyx_n_s_distutils_version, __pyx_k_distutils_version, sizeof(__pyx_k_distutils_version), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_does_string_look_like_datetime, __pyx_k_does_string_look_like_datetime, sizeof(__pyx_k_does_string_look_like_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_dom, __pyx_k_dom, sizeof(__pyx_k_dom), 0, 0, 1, 1}, + {&__pyx_n_s_dow, __pyx_k_dow, sizeof(__pyx_k_dow), 0, 0, 1, 1}, + {&__pyx_n_s_doy, __pyx_k_doy, sizeof(__pyx_k_doy), 0, 0, 1, 1}, + {&__pyx_n_s_dst_hours, __pyx_k_dst_hours, sizeof(__pyx_k_dst_hours), 0, 0, 1, 1}, + {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, + {&__pyx_n_s_dt64arr_to_periodarr, __pyx_k_dt64arr_to_periodarr, sizeof(__pyx_k_dt64arr_to_periodarr), 0, 0, 1, 1}, + {&__pyx_n_s_dtarr, __pyx_k_dtarr, sizeof(__pyx_k_dtarr), 0, 0, 1, 1}, + {&__pyx_n_s_dtindex, __pyx_k_dtindex, sizeof(__pyx_k_dtindex), 0, 0, 1, 1}, + {&__pyx_n_s_dts, __pyx_k_dts, sizeof(__pyx_k_dts), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_thread, __pyx_k_dummy_thread, sizeof(__pyx_k_dummy_thread), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_thread_2, __pyx_k_dummy_thread_2, sizeof(__pyx_k_dummy_thread_2), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_end_month, __pyx_k_end_month, sizeof(__pyx_k_end_month), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, + {&__pyx_n_s_escape, __pyx_k_escape, sizeof(__pyx_k_escape), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_extract_ordinals, __pyx_k_extract_ordinals, sizeof(__pyx_k_extract_ordinals), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_kp_b_f_2, __pyx_k_f_2, sizeof(__pyx_k_f_2), 0, 0, 0, 0}, + {&__pyx_n_s_f_month, __pyx_k_f_month, sizeof(__pyx_k_f_month), 0, 0, 1, 1}, + {&__pyx_n_s_f_weekday, __pyx_k_f_weekday, sizeof(__pyx_k_f_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_fget, __pyx_k_fget, sizeof(__pyx_k_fget), 0, 0, 1, 1}, + {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, + {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, + {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, + {&__pyx_n_s_finfo, __pyx_k_finfo, sizeof(__pyx_k_finfo), 0, 0, 1, 1}, + {&__pyx_n_s_first_weekday, __pyx_k_first_weekday, sizeof(__pyx_k_first_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_fix, __pyx_k_fix, sizeof(__pyx_k_fix), 0, 0, 1, 1}, + {&__pyx_n_s_flat, __pyx_k_flat, sizeof(__pyx_k_flat), 0, 0, 1, 1}, + {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1}, + {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_format_regex, __pyx_k_format_regex, sizeof(__pyx_k_format_regex), 0, 0, 1, 1}, + {&__pyx_n_s_found, __pyx_k_found, sizeof(__pyx_k_found), 0, 0, 1, 1}, + {&__pyx_n_s_found_dict, __pyx_k_found_dict, sizeof(__pyx_k_found_dict), 0, 0, 1, 1}, + {&__pyx_n_s_found_zone, __pyx_k_found_zone, sizeof(__pyx_k_found_zone), 0, 0, 1, 1}, + {&__pyx_n_s_frac, __pyx_k_frac, sizeof(__pyx_k_frac), 0, 0, 1, 1}, + {&__pyx_n_s_fraction, __pyx_k_fraction, sizeof(__pyx_k_fraction), 0, 0, 1, 1}, + {&__pyx_n_s_freq, __pyx_k_freq, sizeof(__pyx_k_freq), 0, 0, 1, 1}, + {&__pyx_n_s_freq1, __pyx_k_freq1, sizeof(__pyx_k_freq1), 0, 0, 1, 1}, + {&__pyx_n_s_freq2, __pyx_k_freq2, sizeof(__pyx_k_freq2), 0, 0, 1, 1}, + {&__pyx_n_s_freq_group, __pyx_k_freq_group, sizeof(__pyx_k_freq_group), 0, 0, 1, 1}, + {&__pyx_n_s_freqstr, __pyx_k_freqstr, sizeof(__pyx_k_freqstr), 0, 0, 1, 1}, + {&__pyx_n_s_fromordinal, __pyx_k_fromordinal, sizeof(__pyx_k_fromordinal), 0, 0, 1, 1}, + {&__pyx_n_s_front, __pyx_k_front, sizeof(__pyx_k_front), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_date_field, __pyx_k_get_date_field, sizeof(__pyx_k_get_date_field), 0, 0, 1, 1}, + {&__pyx_n_s_get_field, __pyx_k_get_field, sizeof(__pyx_k_get_field), 0, 0, 1, 1}, + {&__pyx_n_s_get_period_field, __pyx_k_get_period_field, sizeof(__pyx_k_get_period_field), 0, 0, 1, 1}, + {&__pyx_n_s_get_period_field_arr, __pyx_k_get_period_field_arr, sizeof(__pyx_k_get_period_field_arr), 0, 0, 1, 1}, + {&__pyx_n_s_get_start_end_field, __pyx_k_get_start_end_field, sizeof(__pyx_k_get_start_end_field), 0, 0, 1, 1}, + {&__pyx_n_s_get_start_end_field_2, __pyx_k_get_start_end_field_2, sizeof(__pyx_k_get_start_end_field_2), 0, 0, 1, 1}, + {&__pyx_n_s_get_time_micros, __pyx_k_get_time_micros, sizeof(__pyx_k_get_time_micros), 0, 0, 1, 1}, + {&__pyx_n_s_get_timezone, __pyx_k_get_timezone, sizeof(__pyx_k_get_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_getlang, __pyx_k_getlang, sizeof(__pyx_k_getlang), 0, 0, 1, 1}, + {&__pyx_n_s_getlocale, __pyx_k_getlocale, sizeof(__pyx_k_getlocale), 0, 0, 1, 1}, + {&__pyx_n_s_gettz, __pyx_k_gettz, sizeof(__pyx_k_gettz), 0, 0, 1, 1}, + {&__pyx_n_s_gmt, __pyx_k_gmt, sizeof(__pyx_k_gmt), 0, 0, 1, 1}, + {&__pyx_n_s_group_key, __pyx_k_group_key, sizeof(__pyx_k_group_key), 0, 0, 1, 1}, + {&__pyx_n_s_groupdict, __pyx_k_groupdict, sizeof(__pyx_k_groupdict), 0, 0, 1, 1}, + {&__pyx_n_s_grp, __pyx_k_grp, sizeof(__pyx_k_grp), 0, 0, 1, 1}, + {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, + {&__pyx_n_s_has_saving, __pyx_k_has_saving, sizeof(__pyx_k_has_saving), 0, 0, 1, 1}, + {&__pyx_n_s_has_time_component, __pyx_k_has_time_component, sizeof(__pyx_k_has_time_component), 0, 0, 1, 1}, + {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1}, + {&__pyx_n_s_have_pytz, __pyx_k_have_pytz, sizeof(__pyx_k_have_pytz), 0, 0, 1, 1}, + {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1}, + {&__pyx_n_s_hstack, __pyx_k_hstack, sizeof(__pyx_k_hstack), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 0, 1, 1}, + {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1}, + {&__pyx_n_s_i8_to_pydt, __pyx_k_i8_to_pydt, sizeof(__pyx_k_i8_to_pydt), 0, 0, 1, 1}, + {&__pyx_n_s_iNaT, __pyx_k_iNaT, sizeof(__pyx_k_iNaT), 0, 0, 1, 1}, + {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, + {&__pyx_n_s_idx_shifted, __pyx_k_idx_shifted, sizeof(__pyx_k_idx_shifted), 0, 0, 1, 1}, + {&__pyx_n_s_ignore, __pyx_k_ignore, sizeof(__pyx_k_ignore), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, + {&__pyx_n_s_infer_dst, __pyx_k_infer_dst, sizeof(__pyx_k_infer_dst), 0, 0, 1, 1}, + {&__pyx_n_s_inferred_tz, __pyx_k_inferred_tz, sizeof(__pyx_k_inferred_tz), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_ints_to_pydatetime, __pyx_k_ints_to_pydatetime, sizeof(__pyx_k_ints_to_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_iresult, __pyx_k_iresult, sizeof(__pyx_k_iresult), 0, 0, 1, 1}, + {&__pyx_n_s_is_business, __pyx_k_is_business, sizeof(__pyx_k_is_business), 0, 0, 1, 1}, + {&__pyx_n_s_is_month_end, __pyx_k_is_month_end, sizeof(__pyx_k_is_month_end), 0, 0, 1, 1}, + {&__pyx_n_s_is_month_start, __pyx_k_is_month_start, sizeof(__pyx_k_is_month_start), 0, 0, 1, 1}, + {&__pyx_n_s_is_quarter_end, __pyx_k_is_quarter_end, sizeof(__pyx_k_is_quarter_end), 0, 0, 1, 1}, + {&__pyx_n_s_is_quarter_start, __pyx_k_is_quarter_start, sizeof(__pyx_k_is_quarter_start), 0, 0, 1, 1}, + {&__pyx_n_s_is_timestamp_array, __pyx_k_is_timestamp_array, sizeof(__pyx_k_is_timestamp_array), 0, 0, 1, 1}, + {&__pyx_n_s_is_year_end, __pyx_k_is_year_end, sizeof(__pyx_k_is_year_end), 0, 0, 1, 1}, + {&__pyx_n_s_is_year_start, __pyx_k_is_year_start, sizeof(__pyx_k_is_year_start), 0, 0, 1, 1}, + {&__pyx_n_s_isdst, __pyx_k_isdst, sizeof(__pyx_k_isdst), 0, 0, 1, 1}, + {&__pyx_n_s_isleap, __pyx_k_isleap, sizeof(__pyx_k_isleap), 0, 0, 1, 1}, + {&__pyx_n_s_isleap_prev, __pyx_k_isleap_prev, sizeof(__pyx_k_isleap_prev), 0, 0, 1, 1}, + {&__pyx_n_s_isleapyear, __pyx_k_isleapyear, sizeof(__pyx_k_isleapyear), 0, 0, 1, 1}, + {&__pyx_n_s_isoformat, __pyx_k_isoformat, sizeof(__pyx_k_isoformat), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_iterkeys, __pyx_k_iterkeys, sizeof(__pyx_k_iterkeys), 0, 0, 1, 1}, + {&__pyx_n_s_ivalue, __pyx_k_ivalue, sizeof(__pyx_k_ivalue), 0, 0, 1, 1}, + {&__pyx_n_s_ivalues, __pyx_k_ivalues, sizeof(__pyx_k_ivalues), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_kp_s_j_2, __pyx_k_j_2, sizeof(__pyx_k_j_2), 0, 0, 1, 0}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_julian, __pyx_k_julian, sizeof(__pyx_k_julian), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_kwds, __pyx_k_kwds, sizeof(__pyx_k_kwds), 0, 0, 1, 1}, + {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, + {&__pyx_kp_b_l_2, __pyx_k_l_2, sizeof(__pyx_k_l_2), 0, 0, 0, 0}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_lang, __pyx_k_lang, sizeof(__pyx_k_lang), 0, 0, 1, 1}, + {&__pyx_n_s_ldom, __pyx_k_ldom, sizeof(__pyx_k_ldom), 0, 0, 1, 1}, + {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, + {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1}, + {&__pyx_n_s_locale, __pyx_k_locale, sizeof(__pyx_k_locale), 0, 0, 1, 1}, + {&__pyx_kp_s_locale_changed_during_initializa, __pyx_k_locale_changed_during_initializa, sizeof(__pyx_k_locale_changed_during_initializa), 0, 0, 1, 0}, + {&__pyx_n_s_locale_time, __pyx_k_locale_time, sizeof(__pyx_k_locale_time), 0, 0, 1, 1}, + {&__pyx_n_s_localize, __pyx_k_localize, sizeof(__pyx_k_localize), 0, 0, 1, 1}, + {&__pyx_n_s_logical_and, __pyx_k_logical_and, sizeof(__pyx_k_logical_and), 0, 0, 1, 1}, + {&__pyx_n_s_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 0, 1, 1}, + {&__pyx_n_s_long_2, __pyx_k_long_2, sizeof(__pyx_k_long_2), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, + {&__pyx_kp_s_m8_0, __pyx_k_m8_0, sizeof(__pyx_k_m8_0), 0, 0, 1, 0}, + {&__pyx_kp_s_m8_ns, __pyx_k_m8_ns, sizeof(__pyx_k_m8_ns), 0, 0, 1, 0}, + {&__pyx_kp_s_m_2, __pyx_k_m_2, sizeof(__pyx_k_m_2), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_micros, __pyx_k_micros, sizeof(__pyx_k_micros), 0, 0, 1, 1}, + {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, + {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1}, + {&__pyx_kp_s_mixed_datetimes_and_integers_in, __pyx_k_mixed_datetimes_and_integers_in, sizeof(__pyx_k_mixed_datetimes_and_integers_in), 0, 0, 1, 0}, + {&__pyx_n_s_mo_off, __pyx_k_mo_off, sizeof(__pyx_k_mo_off), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_month_abbr, __pyx_k_month_abbr, sizeof(__pyx_k_month_abbr), 0, 0, 1, 1}, + {&__pyx_n_s_month_kw, __pyx_k_month_kw, sizeof(__pyx_k_month_kw), 0, 0, 1, 1}, + {&__pyx_n_s_month_name, __pyx_k_month_name, sizeof(__pyx_k_month_name), 0, 0, 1, 1}, + {&__pyx_n_s_month_offset, __pyx_k_month_offset, sizeof(__pyx_k_month_offset), 0, 0, 1, 1}, + {&__pyx_n_s_monthrange, __pyx_k_monthrange, sizeof(__pyx_k_monthrange), 0, 0, 1, 1}, + {&__pyx_n_s_months, __pyx_k_months, sizeof(__pyx_k_months), 0, 0, 1, 1}, + {&__pyx_n_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1}, + {&__pyx_n_s_mus, __pyx_k_mus, sizeof(__pyx_k_mus), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_kp_b_n_2, __pyx_k_n_2, sizeof(__pyx_k_n_2), 0, 0, 0, 0}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1}, + {&__pyx_n_s_nanos, __pyx_k_nanos, sizeof(__pyx_k_nanos), 0, 0, 1, 1}, + {&__pyx_n_s_nanosecond, __pyx_k_nanosecond, sizeof(__pyx_k_nanosecond), 0, 0, 1, 1}, + {&__pyx_n_s_nat, __pyx_k_nat, sizeof(__pyx_k_nat), 0, 0, 1, 1}, + {&__pyx_n_s_nat_strings, __pyx_k_nat_strings, sizeof(__pyx_k_nat_strings), 0, 0, 1, 1}, + {&__pyx_n_s_nat_unpickle, __pyx_k_nat_unpickle, sizeof(__pyx_k_nat_unpickle), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_new_2, __pyx_k_new_2, sizeof(__pyx_k_new_2), 0, 0, 1, 1}, + {&__pyx_n_s_new_tz, __pyx_k_new_tz, sizeof(__pyx_k_new_tz), 0, 0, 1, 1}, + {&__pyx_n_s_new_values, __pyx_k_new_values, sizeof(__pyx_k_new_values), 0, 0, 1, 1}, + {&__pyx_n_s_no_saving, __pyx_k_no_saving, sizeof(__pyx_k_no_saving), 0, 0, 1, 1}, + {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, + {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_not_datelike_strings, __pyx_k_not_datelike_strings, sizeof(__pyx_k_not_datelike_strings), 0, 0, 1, 1}, + {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_np_NaT, __pyx_k_np_NaT, sizeof(__pyx_k_np_NaT), 0, 0, 1, 1}, + {&__pyx_n_s_np_version, __pyx_k_np_version, sizeof(__pyx_k_np_version), 0, 0, 1, 1}, + {&__pyx_n_s_np_version_under1p6, __pyx_k_np_version_under1p6, sizeof(__pyx_k_np_version_under1p6), 0, 0, 1, 1}, + {&__pyx_n_s_np_version_under1p7, __pyx_k_np_version_under1p7, sizeof(__pyx_k_np_version_under1p7), 0, 0, 1, 1}, + {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1}, + {&__pyx_n_s_ntrans, __pyx_k_ntrans, sizeof(__pyx_k_ntrans), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_object_state, __pyx_k_object_state, sizeof(__pyx_k_object_state), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_kp_s_offset_0, __pyx_k_offset_0, sizeof(__pyx_k_offset_0), 0, 0, 1, 0}, + {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1}, + {&__pyx_n_s_one_diff, __pyx_k_one_diff, sizeof(__pyx_k_one_diff), 0, 0, 1, 1}, + {&__pyx_n_s_ordinal, __pyx_k_ordinal, sizeof(__pyx_k_ordinal), 0, 0, 1, 1}, + {&__pyx_n_s_ordinals, __pyx_k_ordinals, sizeof(__pyx_k_ordinals), 0, 0, 1, 1}, + {&__pyx_n_s_oresult, __pyx_k_oresult, sizeof(__pyx_k_oresult), 0, 0, 1, 1}, + {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, + {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, + {&__pyx_kp_s_p_2, __pyx_k_p_2, sizeof(__pyx_k_p_2), 0, 0, 1, 0}, + {&__pyx_n_s_p_tz_cache_key, __pyx_k_p_tz_cache_key, sizeof(__pyx_k_p_tz_cache_key), 0, 0, 1, 1}, + {&__pyx_n_s_pad, __pyx_k_pad, sizeof(__pyx_k_pad), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_compat, __pyx_k_pandas_compat, sizeof(__pyx_k_pandas_compat), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_tseries_frequencies, __pyx_k_pandas_tseries_frequencies, sizeof(__pyx_k_pandas_tseries_frequencies), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_tseries_period, __pyx_k_pandas_tseries_period, sizeof(__pyx_k_pandas_tseries_period), 0, 0, 1, 1}, + {&__pyx_n_s_pandas_tslib, __pyx_k_pandas_tslib, sizeof(__pyx_k_pandas_tslib), 0, 0, 1, 1}, + {&__pyx_n_s_parse_code, __pyx_k_parse_code, sizeof(__pyx_k_parse_code), 0, 0, 1, 1}, + {&__pyx_n_s_parse_code_table, __pyx_k_parse_code_table, sizeof(__pyx_k_parse_code_table), 0, 0, 1, 1}, + {&__pyx_n_s_parse_date, __pyx_k_parse_date, sizeof(__pyx_k_parse_date), 0, 0, 1, 1}, + {&__pyx_n_s_parse_datetime_string, __pyx_k_parse_datetime_string, sizeof(__pyx_k_parse_datetime_string), 0, 0, 1, 1}, + {&__pyx_n_s_pattern, __pyx_k_pattern, sizeof(__pyx_k_pattern), 0, 0, 1, 1}, + {&__pyx_n_s_period_asfreq_arr, __pyx_k_period_asfreq_arr, sizeof(__pyx_k_period_asfreq_arr), 0, 0, 1, 1}, + {&__pyx_n_s_period_format, __pyx_k_period_format, sizeof(__pyx_k_period_format), 0, 0, 1, 1}, + {&__pyx_n_s_period_ordinal, __pyx_k_period_ordinal, sizeof(__pyx_k_period_ordinal), 0, 0, 1, 1}, + {&__pyx_n_s_periodarr, __pyx_k_periodarr, sizeof(__pyx_k_periodarr), 0, 0, 1, 1}, + {&__pyx_n_s_periodarr_to_dt64arr, __pyx_k_periodarr_to_dt64arr, sizeof(__pyx_k_periodarr_to_dt64arr), 0, 0, 1, 1}, + {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_processed_format, __pyx_k_processed_format, sizeof(__pyx_k_processed_format), 0, 0, 1, 1}, + {&__pyx_n_s_prop, __pyx_k_prop, sizeof(__pyx_k_prop), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, + {&__pyx_n_s_ps, __pyx_k_ps, sizeof(__pyx_k_ps), 0, 0, 1, 1}, + {&__pyx_n_s_py_dt, __pyx_k_py_dt, sizeof(__pyx_k_py_dt), 0, 0, 1, 1}, + {&__pyx_n_s_pydt, __pyx_k_pydt, sizeof(__pyx_k_pydt), 0, 0, 1, 1}, + {&__pyx_n_s_pydt_to_i8, __pyx_k_pydt_to_i8, sizeof(__pyx_k_pydt_to_i8), 0, 0, 1, 1}, + {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1}, + {&__pyx_n_s_pytz_BaseTzInfo, __pyx_k_pytz_BaseTzInfo, sizeof(__pyx_k_pytz_BaseTzInfo), 0, 0, 1, 1}, + {&__pyx_n_s_pytz_tzinfo, __pyx_k_pytz_tzinfo, sizeof(__pyx_k_pytz_tzinfo), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, + {&__pyx_kp_b_q_2, __pyx_k_q_2, sizeof(__pyx_k_q_2), 0, 0, 0, 0}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_quarter, __pyx_k_quarter, sizeof(__pyx_k_quarter), 0, 0, 1, 1}, + {&__pyx_n_s_raise, __pyx_k_raise, sizeof(__pyx_k_raise), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1}, + {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, + {&__pyx_n_s_re_compile, __pyx_k_re_compile, sizeof(__pyx_k_re_compile), 0, 0, 1, 1}, + {&__pyx_n_s_re_escape, __pyx_k_re_escape, sizeof(__pyx_k_re_escape), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_regex, __pyx_k_regex, sizeof(__pyx_k_regex), 0, 0, 1, 1}, + {&__pyx_n_s_regex_cache, __pyx_k_regex_cache, sizeof(__pyx_k_regex_cache), 0, 0, 1, 1}, + {&__pyx_n_s_regex_chars, __pyx_k_regex_chars, sizeof(__pyx_k_regex_chars), 0, 0, 1, 1}, + {&__pyx_n_s_relation, __pyx_k_relation, sizeof(__pyx_k_relation), 0, 0, 1, 1}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_replacement_pairs, __pyx_k_replacement_pairs, sizeof(__pyx_k_replacement_pairs), 0, 0, 1, 1}, + {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, + {&__pyx_n_s_repr_base, __pyx_k_repr_base, sizeof(__pyx_k_repr_base), 0, 0, 1, 1}, + {&__pyx_n_s_repr_timedelta64, __pyx_k_repr_timedelta64, sizeof(__pyx_k_repr_timedelta64), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_result_a, __pyx_k_result_a, sizeof(__pyx_k_result_a), 0, 0, 1, 1}, + {&__pyx_n_s_result_b, __pyx_k_result_b, sizeof(__pyx_k_result_b), 0, 0, 1, 1}, + {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, + {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_kp_s_s_02d_02d_s, __pyx_k_s_02d_02d_s, sizeof(__pyx_k_s_02d_02d_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 0}, + {&__pyx_kp_s_s_d_days, __pyx_k_s_d_days, sizeof(__pyx_k_s_d_days), 0, 0, 1, 0}, + {&__pyx_kp_s_s_d_days_02d_02d_s, __pyx_k_s_d_days_02d_02d_s, sizeof(__pyx_k_s_d_days_02d_02d_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_is_a_bad_directive_in_format, __pyx_k_s_is_a_bad_directive_in_format, sizeof(__pyx_k_s_is_a_bad_directive_in_format), 0, 0, 1, 0}, + {&__pyx_kp_s_s_is_wrong_freq, __pyx_k_s_is_wrong_freq, sizeof(__pyx_k_s_is_wrong_freq), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_2, __pyx_k_s_s_2, sizeof(__pyx_k_s_s_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_3, __pyx_k_s_s_3, sizeof(__pyx_k_s_s_3), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_s, __pyx_k_s_s_s, sizeof(__pyx_k_s_s_s), 0, 0, 1, 0}, + {&__pyx_n_s_sa_dtype, __pyx_k_sa_dtype, sizeof(__pyx_k_sa_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_searchsorted, __pyx_k_searchsorted, sizeof(__pyx_k_searchsorted), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_seconds_pretty, __pyx_k_seconds_pretty, sizeof(__pyx_k_seconds_pretty), 0, 0, 1, 1}, + {&__pyx_n_s_seen_datetime, __pyx_k_seen_datetime, sizeof(__pyx_k_seen_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_seen_integer, __pyx_k_seen_integer, sizeof(__pyx_k_seen_integer), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_sep, __pyx_k_sep, sizeof(__pyx_k_sep), 0, 0, 1, 1}, + {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1}, + {&__pyx_n_s_seqToRE, __pyx_k_seqToRE, sizeof(__pyx_k_seqToRE), 0, 0, 1, 1}, + {&__pyx_n_s_setitem, __pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_short, __pyx_k_short, sizeof(__pyx_k_short), 0, 0, 1, 1}, + {&__pyx_n_s_short_version, __pyx_k_short_version, sizeof(__pyx_k_short_version), 0, 0, 1, 1}, + {&__pyx_n_s_side, __pyx_k_side, sizeof(__pyx_k_side), 0, 0, 1, 1}, + {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, + {&__pyx_n_s_sign_pretty, __pyx_k_sign_pretty, sizeof(__pyx_k_sign_pretty), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, + {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, + {&__pyx_n_s_sp, __pyx_k_sp, sizeof(__pyx_k_sp), 0, 0, 1, 1}, + {&__pyx_n_s_squeeze, __pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 0, 1, 1}, + {&__pyx_n_s_stamp, __pyx_k_stamp, sizeof(__pyx_k_stamp), 0, 0, 1, 1}, + {&__pyx_n_s_stamps, __pyx_k_stamps, sizeof(__pyx_k_stamps), 0, 0, 1, 1}, + {&__pyx_n_s_start_month, __pyx_k_start_month, sizeof(__pyx_k_start_month), 0, 0, 1, 1}, + {&__pyx_n_s_startingMonth, __pyx_k_startingMonth, sizeof(__pyx_k_startingMonth), 0, 0, 1, 1}, + {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, + {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_kp_s_stray_in_format_s, __pyx_k_stray_in_format_s, sizeof(__pyx_k_stray_in_format_s), 0, 0, 1, 0}, + {&__pyx_n_s_strftime, __pyx_k_strftime, sizeof(__pyx_k_strftime), 0, 0, 1, 1}, + {&__pyx_n_s_string_types, __pyx_k_string_types, sizeof(__pyx_k_string_types), 0, 0, 1, 1}, + {&__pyx_n_s_struct_time, __pyx_k_struct_time, sizeof(__pyx_k_struct_time), 0, 0, 1, 1}, + {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, + {&__pyx_n_s_sub_2, __pyx_k_sub_2, sizeof(__pyx_k_sub_2), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_switch_idx, __pyx_k_switch_idx, sizeof(__pyx_k_switch_idx), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_sz, __pyx_k_sz, sizeof(__pyx_k_sz), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, + {&__pyx_kp_s_tar_gz, __pyx_k_tar_gz, sizeof(__pyx_k_tar_gz), 0, 0, 1, 0}, + {&__pyx_n_s_td, __pyx_k_td, sizeof(__pyx_k_td), 0, 0, 1, 1}, + {&__pyx_n_s_tdata, __pyx_k_tdata, sizeof(__pyx_k_tdata), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_thread, __pyx_k_thread, sizeof(__pyx_k_thread), 0, 0, 1, 1}, + {&__pyx_n_s_thread_2, __pyx_k_thread_2, sizeof(__pyx_k_thread_2), 0, 0, 1, 1}, + {&__pyx_n_s_thread_allocate_lock, __pyx_k_thread_allocate_lock, sizeof(__pyx_k_thread_allocate_lock), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_kp_s_time_data_r_does_not_match_forma, __pyx_k_time_data_r_does_not_match_forma, sizeof(__pyx_k_time_data_r_does_not_match_forma), 0, 0, 1, 0}, + {&__pyx_n_s_time_repr, __pyx_k_time_repr, sizeof(__pyx_k_time_repr), 0, 0, 1, 1}, + {&__pyx_n_s_time_tuple, __pyx_k_time_tuple, sizeof(__pyx_k_time_tuple), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta64, __pyx_k_timedelta64, sizeof(__pyx_k_timedelta64), 0, 0, 1, 1}, + {&__pyx_kp_s_timedelta64_ns, __pyx_k_timedelta64_ns, sizeof(__pyx_k_timedelta64_ns), 0, 0, 1, 0}, + {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_to_convert, __pyx_k_to_convert, sizeof(__pyx_k_to_convert), 0, 0, 1, 1}, + {&__pyx_n_s_to_datetime, __pyx_k_to_datetime, sizeof(__pyx_k_to_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_to_julian_date, __pyx_k_to_julian_date, sizeof(__pyx_k_to_julian_date), 0, 0, 1, 1}, + {&__pyx_n_s_to_offset, __pyx_k_to_offset, sizeof(__pyx_k_to_offset), 0, 0, 1, 1}, + {&__pyx_n_s_to_period, __pyx_k_to_period, sizeof(__pyx_k_to_period), 0, 0, 1, 1}, + {&__pyx_n_s_to_pydatetime, __pyx_k_to_pydatetime, sizeof(__pyx_k_to_pydatetime), 0, 0, 1, 1}, + {&__pyx_n_s_today, __pyx_k_today, sizeof(__pyx_k_today), 0, 0, 1, 1}, + {&__pyx_n_s_toordinal, __pyx_k_toordinal, sizeof(__pyx_k_toordinal), 0, 0, 1, 1}, + {&__pyx_n_s_tot_seconds, __pyx_k_tot_seconds, sizeof(__pyx_k_tot_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_total_seconds, __pyx_k_total_seconds, sizeof(__pyx_k_total_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_trans, __pyx_k_trans, sizeof(__pyx_k_trans), 0, 0, 1, 1}, + {&__pyx_n_s_trans_cache, __pyx_k_trans_cache, sizeof(__pyx_k_trans_cache), 0, 0, 1, 1}, + {&__pyx_n_s_trans_grp, __pyx_k_trans_grp, sizeof(__pyx_k_trans_grp), 0, 0, 1, 1}, + {&__pyx_n_s_trans_idx, __pyx_k_trans_idx, sizeof(__pyx_k_trans_idx), 0, 0, 1, 1}, + {&__pyx_n_s_trans_idx_2, __pyx_k_trans_idx_2, sizeof(__pyx_k_trans_idx_2), 0, 0, 1, 1}, + {&__pyx_n_s_trans_len, __pyx_k_trans_len, sizeof(__pyx_k_trans_len), 0, 0, 1, 1}, + {&__pyx_n_s_trans_list, __pyx_k_trans_list, sizeof(__pyx_k_trans_list), 0, 0, 1, 1}, + {&__pyx_n_s_transition_info, __pyx_k_transition_info, sizeof(__pyx_k_transition_info), 0, 0, 1, 1}, + {&__pyx_n_s_ts, __pyx_k_ts, sizeof(__pyx_k_ts), 0, 0, 1, 1}, + {&__pyx_n_s_ts_2, __pyx_k_ts_2, sizeof(__pyx_k_ts_2), 0, 0, 1, 1}, + {&__pyx_n_s_ts_base, __pyx_k_ts_base, sizeof(__pyx_k_ts_base), 0, 0, 1, 1}, + {&__pyx_n_s_ts_input, __pyx_k_ts_input, sizeof(__pyx_k_ts_input), 0, 0, 1, 1}, + {&__pyx_n_s_tso, __pyx_k_tso, sizeof(__pyx_k_tso), 0, 0, 1, 1}, + {&__pyx_n_s_ttinfo_before, __pyx_k_ttinfo_before, sizeof(__pyx_k_ttinfo_before), 0, 0, 1, 1}, + {&__pyx_n_s_ttinfo_std, __pyx_k_ttinfo_std, sizeof(__pyx_k_ttinfo_std), 0, 0, 1, 1}, + {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1}, + {&__pyx_n_s_tz1, __pyx_k_tz1, sizeof(__pyx_k_tz1), 0, 0, 1, 1}, + {&__pyx_n_s_tz2, __pyx_k_tz2, sizeof(__pyx_k_tz2), 0, 0, 1, 1}, + {&__pyx_kp_s_tz_0, __pyx_k_tz_0, sizeof(__pyx_k_tz_0), 0, 0, 1, 0}, + {&__pyx_n_s_tz_convert, __pyx_k_tz_convert, sizeof(__pyx_k_tz_convert), 0, 0, 1, 1}, + {&__pyx_n_s_tz_convert_single, __pyx_k_tz_convert_single, sizeof(__pyx_k_tz_convert_single), 0, 0, 1, 1}, + {&__pyx_n_s_tz_localize, __pyx_k_tz_localize, sizeof(__pyx_k_tz_localize), 0, 0, 1, 1}, + {&__pyx_n_s_tz_localize_to_utc, __pyx_k_tz_localize_to_utc, sizeof(__pyx_k_tz_localize_to_utc), 0, 0, 1, 1}, + {&__pyx_kp_s_tz_s, __pyx_k_tz_s, sizeof(__pyx_k_tz_s), 0, 0, 1, 0}, + {&__pyx_n_s_tz_values, __pyx_k_tz_values, sizeof(__pyx_k_tz_values), 0, 0, 1, 1}, + {&__pyx_n_s_tzfile, __pyx_k_tzfile, sizeof(__pyx_k_tzfile), 0, 0, 1, 1}, + {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1}, + {&__pyx_n_s_tzinfos, __pyx_k_tzinfos, sizeof(__pyx_k_tzinfos), 0, 0, 1, 1}, + {&__pyx_n_s_tzlocal, __pyx_k_tzlocal, sizeof(__pyx_k_tzlocal), 0, 0, 1, 1}, + {&__pyx_n_s_tzname, __pyx_k_tzname, sizeof(__pyx_k_tzname), 0, 0, 1, 1}, + {&__pyx_n_s_tzoffset, __pyx_k_tzoffset, sizeof(__pyx_k_tzoffset), 0, 0, 1, 1}, + {&__pyx_n_s_tzset, __pyx_k_tzset, sizeof(__pyx_k_tzset), 0, 0, 1, 1}, + {&__pyx_n_s_tzutc, __pyx_k_tzutc, sizeof(__pyx_k_tzutc), 0, 0, 1, 1}, + {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, + {&__pyx_kp_b_u_2, __pyx_k_u_2, sizeof(__pyx_k_u_2), 0, 0, 0, 0}, + {&__pyx_kp_s_unconverted_data_remains_s, __pyx_k_unconverted_data_remains_s, sizeof(__pyx_k_unconverted_data_remains_s), 0, 0, 1, 0}, + {&__pyx_n_s_unique_deltas, __pyx_k_unique_deltas, sizeof(__pyx_k_unique_deltas), 0, 0, 1, 1}, + {&__pyx_n_s_uniques, __pyx_k_uniques, sizeof(__pyx_k_uniques), 0, 0, 1, 1}, + {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_kp_s_unsupported_unit_for_native_time, __pyx_k_unsupported_unit_for_native_time, sizeof(__pyx_k_unsupported_unit_for_native_time), 0, 0, 1, 0}, + {&__pyx_n_s_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 0, 1, 1}, + {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1}, + {&__pyx_n_s_utc_convert, __pyx_k_utc_convert, sizeof(__pyx_k_utc_convert), 0, 0, 1, 1}, + {&__pyx_n_s_utc_date, __pyx_k_utc_date, sizeof(__pyx_k_utc_date), 0, 0, 1, 1}, + {&__pyx_n_s_utc_dates, __pyx_k_utc_dates, sizeof(__pyx_k_utc_dates), 0, 0, 1, 1}, + {&__pyx_n_s_utc_offset_cache, __pyx_k_utc_offset_cache, sizeof(__pyx_k_utc_offset_cache), 0, 0, 1, 1}, + {&__pyx_n_s_utc_transition_times, __pyx_k_utc_transition_times, sizeof(__pyx_k_utc_transition_times), 0, 0, 1, 1}, + {&__pyx_n_s_utcnow, __pyx_k_utcnow, sizeof(__pyx_k_utcnow), 0, 0, 1, 1}, + {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1}, + {&__pyx_n_s_utcoffset_2, __pyx_k_utcoffset_2, sizeof(__pyx_k_utcoffset_2), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, + {&__pyx_n_s_vals, __pyx_k_vals, sizeof(__pyx_k_vals), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_kp_s_w_2, __pyx_k_w_2, sizeof(__pyx_k_w_2), 0, 0, 1, 0}, + {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, + {&__pyx_n_s_week, __pyx_k_week, sizeof(__pyx_k_week), 0, 0, 1, 1}, + {&__pyx_n_s_week_0_length, __pyx_k_week_0_length, sizeof(__pyx_k_week_0_length), 0, 0, 1, 1}, + {&__pyx_n_s_week_of_year, __pyx_k_week_of_year, sizeof(__pyx_k_week_of_year), 0, 0, 1, 1}, + {&__pyx_n_s_week_of_year_start, __pyx_k_week_of_year_start, sizeof(__pyx_k_week_of_year_start), 0, 0, 1, 1}, + {&__pyx_n_s_week_starts_Mon, __pyx_k_week_starts_Mon, sizeof(__pyx_k_week_starts_Mon), 0, 0, 1, 1}, + {&__pyx_n_s_weekday, __pyx_k_weekday, sizeof(__pyx_k_weekday), 0, 0, 1, 1}, + {&__pyx_n_s_weekofyear, __pyx_k_weekofyear, sizeof(__pyx_k_weekofyear), 0, 0, 1, 1}, + {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1}, + {&__pyx_n_s_whitespace_replacement, __pyx_k_whitespace_replacement, sizeof(__pyx_k_whitespace_replacement), 0, 0, 1, 1}, + {&__pyx_n_s_woy, __pyx_k_woy, sizeof(__pyx_k_woy), 0, 0, 1, 1}, + {&__pyx_kp_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 0}, + {&__pyx_n_s_x_2, __pyx_k_x_2, sizeof(__pyx_k_x_2), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {&__pyx_kp_s_y_2, __pyx_k_y_2, sizeof(__pyx_k_y_2), 0, 0, 1, 0}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {&__pyx_n_s_year2000, __pyx_k_year2000, sizeof(__pyx_k_year2000), 0, 0, 1, 1}, + {&__pyx_n_s_years, __pyx_k_years, sizeof(__pyx_k_years), 0, 0, 1, 1}, + {&__pyx_kp_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 0}, + {&__pyx_n_s_zero_time, __pyx_k_zero_time, sizeof(__pyx_k_zero_time), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {&__pyx_n_s_zone, __pyx_k_zone, sizeof(__pyx_k_zone), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pandas/tslib.pyx":184 + * @classmethod + * def utcnow(cls): + * return cls.now('UTC') # <<<<<<<<<<<<<< + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_UTC); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "pandas/tslib.pyx":222 + * + * try: + * stamp += self.strftime('%z') # <<<<<<<<<<<<<< + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_z); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "pandas/tslib.pyx":227 + * except ValueError: + * year2000 = self.replace(year=2000) + * stamp += year2000.strftime('%z') # <<<<<<<<<<<<<< + * if self.tzinfo: + * zone = _get_zone(self.tzinfo) + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_z); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "pandas/tslib.pyx":232 + * + * try: + * stamp += zone.strftime(' %%Z') # <<<<<<<<<<<<<< + * except: + * pass + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Z); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "pandas/tslib.pyx":300 + * @property + * def dayofyear(self): + * return self._get_field('doy') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_doy); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "pandas/tslib.pyx":304 + * @property + * def week(self): + * return self._get_field('woy') # <<<<<<<<<<<<<< + * + * weekofyear = week + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_woy); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "pandas/tslib.pyx":310 + * @property + * def quarter(self): + * return self._get_field('q') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_q); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "pandas/tslib.pyx":318 + * @property + * def asm8(self): + * return np.int64(self.value).view('M8[ns]') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_M8_ns); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "pandas/tslib.pyx":322 + * @property + * def is_month_start(self): + * return self._get_start_end_field('is_month_start') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_is_month_start); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "pandas/tslib.pyx":326 + * @property + * def is_month_end(self): + * return self._get_start_end_field('is_month_end') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_is_month_end); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "pandas/tslib.pyx":330 + * @property + * def is_quarter_start(self): + * return self._get_start_end_field('is_quarter_start') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_is_quarter_start); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "pandas/tslib.pyx":334 + * @property + * def is_quarter_end(self): + * return self._get_start_end_field('is_quarter_end') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_is_quarter_end); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "pandas/tslib.pyx":338 + * @property + * def is_year_start(self): + * return self._get_start_end_field('is_year_start') # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_is_year_start); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "pandas/tslib.pyx":342 + * @property + * def is_year_end(self): + * return self._get_start_end_field('is_year_end') # <<<<<<<<<<<<<< + * + * def tz_localize(self, tz, infer_dst=False): + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_is_year_end); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "pandas/tslib.pyx":365 + * return Timestamp(value, tz=tz) + * else: + * raise Exception('Cannot localize tz-aware Timestamp, use ' # <<<<<<<<<<<<<< + * 'tz_convert for conversions') + * + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_localize_tz_aware_Timesta); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "pandas/tslib.pyx":383 + * if self.tzinfo is None: + * # tz naive, use tz_localize + * raise Exception('Cannot convert tz-naive Timestamp, use ' # <<<<<<<<<<<<<< + * 'tz_localize to localize') + * else: + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_convert_tz_naive_Timestam); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "pandas/tslib.pyx":417 + * + * if self.tzinfo is not None: + * base1, base2 = base[:-6], base[-6:] # <<<<<<<<<<<<<< + * else: + * base1, base2 = base, "" + */ + __pyx_slice__18 = PySlice_New(Py_None, __pyx_int_neg_6, Py_None); if (unlikely(!__pyx_slice__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__18); + __Pyx_GIVEREF(__pyx_slice__18); + __pyx_slice__19 = PySlice_New(__pyx_int_neg_6, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__19); + __Pyx_GIVEREF(__pyx_slice__19); + + /* "pandas/tslib.pyx":497 + * + * def __reduce__(self): + * return (__nat_unpickle, (None, )) # <<<<<<<<<<<<<< + * + * fields = ['year', 'quarter', 'month', 'day', 'hour', + */ + __pyx_tuple__20 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "pandas/tslib.pyx":555 + * + * if i >= sz or sz == 0 or i < 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * if arr.descr.type_num == NPY_DATETIME: + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "pandas/tslib.pyx":615 + * + * result = np.empty(n, dtype='M8[ns]') + * new_values = result.view('i8') # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "pandas/tslib.pyx":726 + * if self.tzinfo is None: + * if other.tzinfo is not None: + * raise ValueError('Cannot compare tz-naive and tz-aware ' # <<<<<<<<<<<<<< + * 'timestamps') + * elif other.tzinfo is None: + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_compare_tz_naive_and_tz_a); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "pandas/tslib.pyx":729 + * 'timestamps') + * elif other.tzinfo is None: + * raise ValueError('Cannot compare tz-naive and tz-aware timestamps') # <<<<<<<<<<<<<< + * + * cpdef datetime to_datetime(_Timestamp self): + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_compare_tz_naive_and_tz_a); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "pandas/tslib.pyx":745 + * + * if is_timedelta64_object(other): + * other_int = other.astype('timedelta64[ns]').view('i8') # <<<<<<<<<<<<<< + * return Timestamp(self.value + other_int, tz=self.tzinfo, offset=self.offset) + * + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_timedelta64_ns); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "pandas/tslib.pyx":750 + * elif is_integer_object(other): + * if self.offset is None: + * raise ValueError("Cannot add integral value to Timestamp " # <<<<<<<<<<<<<< + * "without offset.") + * return Timestamp((self.offset * other).apply(self), offset=self.offset) + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_add_integral_value_to_Tim); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "pandas/tslib.pyx":781 + * + * cpdef _get_start_end_field(self, field): + * month_kw = self.freq.kwds.get('startingMonth', self.freq.kwds.get('month', 12)) if self.freq else 12 # <<<<<<<<<<<<<< + * freqstr = self.freqstr if self.freq else None + * out = get_start_end_field(np.array([self.value], dtype=np.int64), field, freqstr, month_kw) + */ + __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_month, __pyx_int_12); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "pandas/tslib.pyx":849 + * delta = delta.delta + * if is_timedelta64_object(delta): + * return delta.astype("timedelta64[ns]").item() # <<<<<<<<<<<<<< + * if is_integer_object(delta): + * return delta + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_timedelta64_ns); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "pandas/tslib.pyx":898 + * obj.value = NPY_NAT + * elif is_datetime64_object(ts): + * if ts.view('i8') == iNaT: # <<<<<<<<<<<<<< + * obj.value = NPY_NAT + * else: + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "pandas/tslib.pyx":1045 + * if _treat_tz_as_dateutil(tz): + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' # <<<<<<<<<<<<<< + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Bad_tz_filename_Dateutil_on_pyth); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "pandas/tslib.pyx":1066 + * ''' + * if isinstance(tz, string_types): + * if tz.startswith('dateutil/'): # <<<<<<<<<<<<<< + * zone = tz[9:] + * tz = _dateutil_gettz(tz[9:]) + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dateutil); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "pandas/tslib.pyx":1067 + * if isinstance(tz, string_types): + * if tz.startswith('dateutil/'): + * zone = tz[9:] # <<<<<<<<<<<<<< + * tz = _dateutil_gettz(tz[9:]) + * # On Python 3 on Windows, the filename is not always set correctly. + */ + __pyx_slice__33 = PySlice_New(__pyx_int_9, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__33); + __Pyx_GIVEREF(__pyx_slice__33); + + /* "pandas/tslib.pyx":1068 + * if tz.startswith('dateutil/'): + * zone = tz[9:] + * tz = _dateutil_gettz(tz[9:]) # <<<<<<<<<<<<<< + * # On Python 3 on Windows, the filename is not always set correctly. + * if isinstance(tz, _dateutil_tzfile) and '.tar.gz' in tz._filename: + */ + __pyx_slice__34 = PySlice_New(__pyx_int_9, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__34); + __Pyx_GIVEREF(__pyx_slice__34); + + /* "pandas/tslib.pyx":1118 + * + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "pandas/tslib.pyx":1127 + * if inferred_tz is not None: + * if _get_zone(val.tzinfo) != inferred_tz: + * raise ValueError('Array must be all same time zone') # <<<<<<<<<<<<<< + * else: + * inferred_tz = _get_zone(val.tzinfo) + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Array_must_be_all_same_time_zone); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "pandas/tslib.pyx":1136 + * else: + * if inferred_tz is not None: + * raise ValueError('Cannot mix tz-aware with tz-naive values') # <<<<<<<<<<<<<< + * iresult[i] = _pydatetime_to_dts(val, &dts) + * _check_dts_bounds(&dts) + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Cannot_mix_tz_aware_with_tz_naiv); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "pandas/tslib.pyx":1147 + * + * def _does_string_look_like_datetime(date_string): + * if date_string.startswith('0'): # <<<<<<<<<<<<<< + * # Strings starting with 0 are more consistent with a + * # date-like string than a number + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "pandas/tslib.pyx":1165 + * def parse_datetime_string(date_string, **kwargs): + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') # <<<<<<<<<<<<<< + * + * dt = parse_date(date_string, **kwargs) + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Given_date_string_not_likely_a_d); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "pandas/tslib.pyx":1184 + * try: + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * for i in range(n): + * val = values[i] + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "pandas/tslib.pyx":1203 + * raise + * else: + * raise ValueError('Tz-aware datetime.datetime cannot ' # <<<<<<<<<<<<<< + * 'be converted to datetime64 unless ' + * 'utc=True') + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Tz_aware_datetime_datetime_canno); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "pandas/tslib.pyx":1228 + * raise + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: # <<<<<<<<<<<<<< + * iresult[i] = iNaT + * else: + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "pandas/tslib.pyx":1294 + * # example + * if seen_integer and seen_datetime: + * raise ValueError("mixed datetimes and integers in passed array") # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_mixed_datetimes_and_integers_in); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "pandas/tslib.pyx":1309 + * oresult[i] = np.nan + * elif util.is_datetime64_object(val): + * if val is np_NaT or val.view('i8') == iNaT: # <<<<<<<<<<<<<< + * oresult[i] = np.nan + * else: + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "pandas/tslib.pyx":1354 + * n = values.shape[0] + * result = np.empty(n, dtype='m8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "pandas/tslib.pyx":1384 + * elif util.is_datetime64_object(ts): + * # only accept a NaT here + * if ts.astype('int64') == iNaT: # <<<<<<<<<<<<<< + * return np.timedelta64(iNaT) + * elif isinstance(ts, np.timedelta64): + */ + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "pandas/tslib.pyx":1393 + * else: + * if util.is_array(ts): + * ts = ts.astype('int64').item() # <<<<<<<<<<<<<< + * if unit in ['Y','M','W']: + * if _np_version_under1p7: + */ + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "pandas/tslib.pyx":1428 + * return np.timedelta64(iNaT) + * raise ValueError("Invalid type for timedelta scalar: %s" % type(ts)) + * return ts.astype('timedelta64[ns]') # <<<<<<<<<<<<<< + * + * def repr_timedelta64(object value, format=None): + */ + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_timedelta64_ns); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "pandas/tslib.pyx":1446 + * cdef object ivalue + * + * ivalue = value.view('i8') # <<<<<<<<<<<<<< + * + * # put frac in seconds + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + + /* "pandas/tslib.pyx":1508 + * + * global _TimeRE_cache, _regex_cache + * with _cache_lock: # <<<<<<<<<<<<<< + * if _getlang() != _TimeRE_cache.locale_time.lang: + * _TimeRE_cache = TimeRE() + */ + __pyx_tuple__53 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + + /* "pandas/tslib.pyx":1534 + * + * result = np.empty(n, dtype='M8[ns]') + * iresult = result.view('i8') # <<<<<<<<<<<<<< + * + * dts.us = dts.ps = dts.as = 0 + */ + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + + /* "pandas/tslib.pyx":1634 + * elif parse_code == 7: + * hour = int(found_dict['I']) + * ampm = found_dict.get('p', '').lower() # <<<<<<<<<<<<<< + * # If there was no AM/PM indicator, we'll treat this like AM + * if ampm in ('', locale_time.am_pm[0]): + */ + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "pandas/tslib.pyx":1743 + * unit = get_datetime64_unit(val) + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') # <<<<<<<<<<<<<< + * + * ival = get_datetime64_value(val) + */ + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_NumPy_1_6_1_business_freq_not_su); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + + /* "pandas/tslib.pyx":1812 + * unit = get_datetime64_unit(arr.flat[0]) + * if unit == 3: + * raise ValueError('NumPy 1.6.1 business freq not supported') # <<<<<<<<<<<<<< + * + * for i in range(n): + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_NumPy_1_6_1_business_freq_not_su); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + + /* "pandas/tslib.pyx":1881 + * pos = trans.searchsorted(vals[0]) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_First_time_before_start_of_DST_i); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + + /* "pandas/tslib.pyx":1912 + * pos = trans.searchsorted(utc_dates[0]) + * if pos == 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * elif pos == len(trans): + * return utc_dates + deltas[-1] + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_First_time_before_start_of_DST_i); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "pandas/tslib.pyx":1959 + * pos = trans.searchsorted(val) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * offset = deltas[pos] + * utc_date = val - offset + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_First_time_before_start_of_DST_i); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "pandas/tslib.pyx":1978 + * pos = trans.searchsorted(utc_date) - 1 + * if pos < 0: + * raise ValueError('First time before start of DST info') # <<<<<<<<<<<<<< + * + * offset = deltas[pos] + */ + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_First_time_before_start_of_DST_i); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + + /* "pandas/tslib.pyx":2016 + * elif isinstance(tz, _dateutil_tzfile): + * if '.tar.gz' in tz._filename: + * raise ValueError('Bad tz filename. Dateutil on python 3 on windows has a bug which causes tzfile._filename to be the same for all ' # <<<<<<<<<<<<<< + * 'timezone files. Please construct dateutil timezones implicitly by passing a string like "dateutil/Europe/London" ' + * 'when you construct your pandas objects instead of passing a timezone object. See https://github.com/pydata/pandas/pull/7362') + */ + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Bad_tz_filename_Dateutil_on_pyth); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "pandas/tslib.pyx":2035 + * if _treat_tz_as_pytz(tz): + * arr = np.array(tz._utc_transition_times, dtype='M8[ns]') + * arr = arr.view('i8') # <<<<<<<<<<<<<< + * try: + * if tz._utc_transition_times[0].year == 1: + */ + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + + /* "pandas/tslib.pyx":2046 + * trans_list = _get_utc_trans_times_from_dateutil_tz(tz) + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed # <<<<<<<<<<<<<< + * arr = arr.view('i8') + * # scale transitions correctly in numpy 1.6 + */ + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_M8_ns); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + + /* "pandas/tslib.pyx":2047 + * arr = np.hstack([np.array([0], dtype='M8[s]'), # place holder for first item + * np.array(trans_list, dtype='M8[s]')]).astype('M8[ns]') # all trans listed + * arr = arr.view('i8') # <<<<<<<<<<<<<< + * # scale transitions correctly in numpy 1.6 + * if _np_version_under1p7: + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_i8); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "pandas/tslib.pyx":2147 + * + * if not have_pytz: + * raise Exception("Could not find pytz module") # <<<<<<<<<<<<<< + * + * if tz == UTC or tz is None: + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_Could_not_find_pytz_module); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "pandas/tslib.pyx":2312 + * count = len(dtindex) + * + * sa_dtype = [('Y', 'i4'), # year # <<<<<<<<<<<<<< + * ('M', 'i4'), # month + * ('D', 'i4'), # day + */ + __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_Y, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "pandas/tslib.pyx":2313 + * + * sa_dtype = [('Y', 'i4'), # year + * ('M', 'i4'), # month # <<<<<<<<<<<<<< + * ('D', 'i4'), # day + * ('h', 'i4'), # hour + */ + __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_M, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + + /* "pandas/tslib.pyx":2314 + * sa_dtype = [('Y', 'i4'), # year + * ('M', 'i4'), # month + * ('D', 'i4'), # day # <<<<<<<<<<<<<< + * ('h', 'i4'), # hour + * ('m', 'i4'), # min + */ + __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_D, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + + /* "pandas/tslib.pyx":2315 + * ('M', 'i4'), # month + * ('D', 'i4'), # day + * ('h', 'i4'), # hour # <<<<<<<<<<<<<< + * ('m', 'i4'), # min + * ('s', 'i4'), # second + */ + __pyx_tuple__70 = PyTuple_Pack(2, __pyx_n_s_h, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "pandas/tslib.pyx":2316 + * ('D', 'i4'), # day + * ('h', 'i4'), # hour + * ('m', 'i4'), # min # <<<<<<<<<<<<<< + * ('s', 'i4'), # second + * ('u', 'i4')] # microsecond + */ + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_m, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + + /* "pandas/tslib.pyx":2317 + * ('h', 'i4'), # hour + * ('m', 'i4'), # min + * ('s', 'i4'), # second # <<<<<<<<<<<<<< + * ('u', 'i4')] # microsecond + * + */ + __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_s, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + + /* "pandas/tslib.pyx":2318 + * ('m', 'i4'), # min + * ('s', 'i4'), # second + * ('u', 'i4')] # microsecond # <<<<<<<<<<<<<< + * + * out = np.empty(count, dtype=sa_dtype) + */ + __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_u, __pyx_n_s_i4); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + + /* "pandas/tslib.pyx":2541 + * # other offests use month, startingMonth as ending month of year. + * + * if (freqstr[0:2] in ['MS', 'QS', 'AS']) or (freqstr[1:3] in ['MS', 'QS', 'AS']): # <<<<<<<<<<<<<< + * end_month = 12 if month_kw == 1 else month_kw - 1 + * start_month = month_kw + */ + __pyx_slice__74 = PySlice_New(__pyx_int_0, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__74); + __Pyx_GIVEREF(__pyx_slice__74); + __pyx_slice__75 = PySlice_New(__pyx_int_1, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__75); + __Pyx_GIVEREF(__pyx_slice__75); + + /* "pandas/tslib.pyx":2871 + * + * if month < 1 or month > 12: + * raise ValueError("bad month number 0; must be 1-12") # <<<<<<<<<<<<<< + * + * days = days_per_month_table[is_leapyear(year)][month-1] + */ + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_bad_month_number_0_must_be_1_12); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + + /* "pandas/tslib.pyx":2906 + * + * if not have_pytz: + * raise Exception('Could not find pytz module') # <<<<<<<<<<<<<< + * + * if _is_utc(tz): + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Could_not_find_pytz_module); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + + /* "pandas/tslib.pyx":3112 + * + * if retval == INT32_MIN: + * raise ValueError('Frequency conversion failed') # <<<<<<<<<<<<<< + * + * return retval + */ + __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Frequency_conversion_failed); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + + /* "pandas/tslib.pyx":3147 + * val = func(val, relation, &finfo) + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") # <<<<<<<<<<<<<< + * result[i] = val + * else: + */ + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_to_desired_fre); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + + /* "pandas/tslib.pyx":3153 + * val = func(arr[i], relation, &finfo) + * if val == INT32_MIN: + * raise ValueError("Unable to convert to desired frequency.") # <<<<<<<<<<<<<< + * result[i] = val + * + */ + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_to_desired_fre); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + + /* "pandas/tslib.pyx":3250 + * + * if PyUnicode_Check(fmt): + * fmt = fmt.encode('utf-8') # <<<<<<<<<<<<<< + * + * get_date_info(value, freq, &dinfo) + */ + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + + /* "pandas/tslib.pyx":3268 + * if found_pat[i]: + * if get_yq(value, freq, &quarter, &year) < 0: + * raise ValueError('Unable to get quarter and year') # <<<<<<<<<<<<<< + * + * if i == 0: + */ + __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_get_quarter_and_year); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + + /* "pandas/tslib.pyx":3286 + * + * if PY2: + * result = result.decode('utf-8', 'ignore') # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_tuple__83 = PyTuple_Pack(2, __pyx_kp_s_utf_8, __pyx_n_s_ignore); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + + /* "pandas/tslib.pyx":3551 + * self.__calc_date_time() + * if _getlang() != self.lang: + * raise ValueError("locale changed during initialization") # <<<<<<<<<<<<<< + * + * def __pad(self, seq, front): + */ + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_locale_changed_during_initializa); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + + /* "pandas/tslib.pyx":3557 + * seq = list(seq) + * if front: + * seq.insert(0, '') # <<<<<<<<<<<<<< + * else: + * seq.append('') + */ + __pyx_tuple__85 = PyTuple_Pack(2, __pyx_int_0, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + + /* "pandas/tslib.pyx":3584 + * # static date was needed. + * am_pm = [] + * for hour in (01,22): # <<<<<<<<<<<<<< + * time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) + * am_pm.append(time.strftime("%p", time_tuple).lower()) + */ + __pyx_tuple__86 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_22); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + + /* "pandas/tslib.pyx":3597 + * # values within the format string is very important; it eliminates + * # possible ambiguity for what something represents. + * time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) # <<<<<<<<<<<<<< + * date_time = [None, None, None] + * date_time[0] = time.strftime("%c", time_tuple).lower() + */ + __pyx_tuple__87 = PyTuple_Pack(9, __pyx_int_1999, __pyx_int_3, __pyx_int_17, __pyx_int_22, __pyx_int_44, __pyx_int_55, __pyx_int_2, __pyx_int_76, __pyx_int_0); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_tuple__87); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + + /* "pandas/tslib.pyx":3602 + * date_time[1] = time.strftime("%x", time_tuple).lower() + * date_time[2] = time.strftime("%X", time_tuple).lower() + * replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), # <<<<<<<<<<<<<< + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + */ + __pyx_tuple__90 = PyTuple_Pack(2, __pyx_kp_s__52, __pyx_kp_s__89); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + + /* "pandas/tslib.pyx":3605 + * (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), # <<<<<<<<<<<<<< + * ('44', '%M'), ('55', '%S'), ('76', '%j'), + * ('17', '%d'), ('03', '%m'), ('3', '%m'), + */ + __pyx_tuple__91 = PyTuple_Pack(2, __pyx_kp_s_1999, __pyx_kp_s_Y_2); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + __pyx_tuple__92 = PyTuple_Pack(2, __pyx_kp_s_99, __pyx_kp_s_y_2); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_tuple__93 = PyTuple_Pack(2, __pyx_kp_s_22, __pyx_kp_s_H_2); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + + /* "pandas/tslib.pyx":3606 + * (self.a_month[3], '%b'), (self.am_pm[1], '%p'), + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), + * ('44', '%M'), ('55', '%S'), ('76', '%j'), # <<<<<<<<<<<<<< + * ('17', '%d'), ('03', '%m'), ('3', '%m'), + * # '3' needed for when no leading zero. + */ + __pyx_tuple__94 = PyTuple_Pack(2, __pyx_kp_s_44, __pyx_kp_s_M_2); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __pyx_tuple__95 = PyTuple_Pack(2, __pyx_kp_s_55, __pyx_kp_s_S_2); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_tuple__96 = PyTuple_Pack(2, __pyx_kp_s_76, __pyx_kp_s_j_2); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + + /* "pandas/tslib.pyx":3607 + * ('1999', '%Y'), ('99', '%y'), ('22', '%H'), + * ('44', '%M'), ('55', '%S'), ('76', '%j'), + * ('17', '%d'), ('03', '%m'), ('3', '%m'), # <<<<<<<<<<<<<< + * # '3' needed for when no leading zero. + * ('2', '%w'), ('10', '%I')] + */ + __pyx_tuple__97 = PyTuple_Pack(2, __pyx_kp_s_17, __pyx_kp_s_d_2); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_tuple__98 = PyTuple_Pack(2, __pyx_kp_s_03, __pyx_kp_s_m_2); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_tuple__99 = PyTuple_Pack(2, __pyx_kp_s_3, __pyx_kp_s_m_2); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + + /* "pandas/tslib.pyx":3609 + * ('17', '%d'), ('03', '%m'), ('3', '%m'), + * # '3' needed for when no leading zero. + * ('2', '%w'), ('10', '%I')] # <<<<<<<<<<<<<< + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone + * for tz in tz_values]) + */ + __pyx_tuple__100 = PyTuple_Pack(2, __pyx_kp_s_2, __pyx_kp_s_w_2); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_tuple__101 = PyTuple_Pack(2, __pyx_kp_s_10, __pyx_kp_s_I_2); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + + /* "pandas/tslib.pyx":3612 + * replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone + * for tz in tz_values]) + * for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): # <<<<<<<<<<<<<< + * current_format = date_time[offset] + * for old, new in replacement_pairs: + */ + __pyx_tuple__102 = PyTuple_Pack(2, __pyx_int_0, __pyx_kp_s_c); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__102); + __Pyx_GIVEREF(__pyx_tuple__102); + __pyx_tuple__103 = PyTuple_Pack(2, __pyx_int_1, __pyx_kp_s_x); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + __pyx_tuple__104 = PyTuple_Pack(2, __pyx_int_2, __pyx_kp_s_X); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__104); + __Pyx_GIVEREF(__pyx_tuple__104); + __pyx_tuple__105 = PyTuple_Pack(3, __pyx_tuple__102, __pyx_tuple__103, __pyx_tuple__104); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + + /* "pandas/tslib.pyx":3624 + * # 2005-01-03 occurs before the first Monday of the year. Otherwise + * # %U is used. + * time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0)) # <<<<<<<<<<<<<< + * if '00' in time.strftime(directive, time_tuple): + * U_W = '%W' + */ + __pyx_tuple__106 = PyTuple_Pack(9, __pyx_int_1999, __pyx_int_1, __pyx_int_3, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_6, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__106); + __Pyx_GIVEREF(__pyx_tuple__106); + __pyx_tuple__107 = PyTuple_Pack(1, __pyx_tuple__106); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + + /* "pandas/tslib.pyx":3683 + * 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), # <<<<<<<<<<<<<< + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + */ + __pyx_slice__108 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__108); + __Pyx_GIVEREF(__pyx_slice__108); + + /* "pandas/tslib.pyx":3684 + * 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), + * 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), + * 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), # <<<<<<<<<<<<<< + * 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), + * 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone + */ + __pyx_slice__109 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__109); + __Pyx_GIVEREF(__pyx_slice__109); + + /* "pandas/tslib.pyx":3690 + * 'Z'), + * '%': '%'}) + * base.__setitem__('W', base.__getitem__('U').replace('U', 'W')) # <<<<<<<<<<<<<< + * base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) + * base.__setitem__('x', self.pattern(self.locale_time.LC_date)) + */ + __pyx_tuple__110 = PyTuple_Pack(1, __pyx_n_s_U); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_tuple__111 = PyTuple_Pack(2, __pyx_n_s_U, __pyx_n_s_W); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + + /* "pandas/tslib.pyx":3725 + * # as regex syntax. Cannot use re.escape since we have to deal with + * # format directives (%m, etc.). + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") # <<<<<<<<<<<<<< + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') + */ + __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s__113); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__114); + __Pyx_GIVEREF(__pyx_tuple__114); + + /* "pandas/tslib.pyx":3727 + * regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") + * format = regex_chars.sub(r"\\\1", format) + * whitespace_replacement = re_compile('\s+') # <<<<<<<<<<<<<< + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: + */ + __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_s_3); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + + /* "pandas/tslib.pyx":3730 + * format = whitespace_replacement.sub('\s+', format) + * while '%' in format: + * directive_index = format.index('%')+1 # <<<<<<<<<<<<<< + * processed_format = "%s%s%s" % (processed_format, + * format[:directive_index-1], + */ + __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s__52); if (unlikely(!__pyx_tuple__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__116); + __Pyx_GIVEREF(__pyx_tuple__116); + + /* "numpy.pxd":217 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__117); + __Pyx_GIVEREF(__pyx_tuple__117); + + /* "numpy.pxd":221 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + + /* "numpy.pxd":259 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__119)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); + + /* "numpy.pxd":803 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + + /* "numpy.pxd":807 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__121)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + + /* "numpy.pxd":827 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__122); + __Pyx_GIVEREF(__pyx_tuple__122); + + /* "util.pxd":40 + * i += sz + * elif i >= sz or sz == 0: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * return get_value_1d(arr, i) + */ + __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + + /* "util.pxd":57 + * i += sz + * elif i >= sz: + * raise IndexError('index out of bounds') # <<<<<<<<<<<<<< + * + * assign_value_1d(arr, i, value) + */ + __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__124); + __Pyx_GIVEREF(__pyx_tuple__124); + + /* "pandas/tslib.pyx":67 + * + * # < numpy 1.7 compat for NaT + * compat_NaT = np.array([NPY_NAT]).astype('m8[ns]').item() # <<<<<<<<<<<<<< + * + * # numpy actual nat object + */ + __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_m8_ns); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + + /* "pandas/tslib.pyx":70 + * + * # numpy actual nat object + * np_NaT = np.datetime64('NaT') # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_tuple__126 = PyTuple_Pack(1, __pyx_n_s_NaT); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__126); + __Pyx_GIVEREF(__pyx_tuple__126); + + /* "pandas/tslib.pyx":77 + * basestring = str + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__127 = PyTuple_Pack(11, __pyx_n_s_arr, __pyx_n_s_tz, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_result, __pyx_n_s_dt, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_pos, __pyx_n_s_new_tz); if (unlikely(!__pyx_tuple__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_ints_to_pydatetime, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":153 + * + * + * _zero_time = datetime_time(0, 0) # <<<<<<<<<<<<<< + * + * # Python front end to C extension type _Timestamp + */ + __pyx_tuple__129 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + + /* "pandas/tslib.pyx":165 + * + * @classmethod + * def fromordinal(cls, ordinal, offset=None, tz=None): # <<<<<<<<<<<<<< + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + */ + __pyx_tuple__130 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_ordinal, __pyx_n_s_offset, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__130); + __Pyx_GIVEREF(__pyx_tuple__130); + __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_fromordinal, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__132 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__132); + __Pyx_GIVEREF(__pyx_tuple__132); + + /* "pandas/tslib.pyx":171 + * + * @classmethod + * def now(cls, tz=None): # <<<<<<<<<<<<<< + * """ compat now with datetime """ + * if isinstance(tz, basestring): + */ + __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__133); + __Pyx_GIVEREF(__pyx_tuple__133); + __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_now, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__135 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__135); + __Pyx_GIVEREF(__pyx_tuple__135); + + /* "pandas/tslib.pyx":178 + * + * @classmethod + * def today(cls): # <<<<<<<<<<<<<< + * """ compat today with datetime """ + * return cls(datetime.today()) + */ + __pyx_tuple__136 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__136); + __Pyx_GIVEREF(__pyx_tuple__136); + __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_today, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":183 + * + * @classmethod + * def utcnow(cls): # <<<<<<<<<<<<<< + * return cls.now('UTC') + * + */ + __pyx_tuple__138 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__138); + __Pyx_GIVEREF(__pyx_tuple__138); + __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_utcnow, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":186 + * return cls.now('UTC') + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): # <<<<<<<<<<<<<< + * cdef _TSObject ts + * cdef _Timestamp ts_base + */ + __pyx_tuple__140 = PyTuple_Pack(8, __pyx_n_s_cls, __pyx_n_s_ts_input, __pyx_n_s_offset, __pyx_n_s_tz, __pyx_n_s_unit, __pyx_n_s_ts, __pyx_n_s_ts_base, __pyx_n_s_to_offset); if (unlikely(!__pyx_tuple__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__140); + __Pyx_GIVEREF(__pyx_tuple__140); + __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_new, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__142 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__142); + __Pyx_GIVEREF(__pyx_tuple__142); + + /* "pandas/tslib.pyx":217 + * return ts_base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * stamp = self._repr_base + * zone = None + */ + __pyx_tuple__143 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_stamp, __pyx_n_s_zone, __pyx_n_s_year2000, __pyx_n_s_tz, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__143); + __Pyx_GIVEREF(__pyx_tuple__143); + __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_repr, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":242 + * + * @property + * def _date_repr(self): # <<<<<<<<<<<<<< + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + */ + __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__145); + __Pyx_GIVEREF(__pyx_tuple__145); + __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_date_repr, 242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":248 + * + * @property + * def _time_repr(self): # <<<<<<<<<<<<<< + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + */ + __pyx_tuple__147 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_result, __pyx_n_s_nanos); if (unlikely(!__pyx_tuple__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__147); + __Pyx_GIVEREF(__pyx_tuple__147); + __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_time_repr, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":260 + * + * @property + * def _repr_base(self): # <<<<<<<<<<<<<< + * return '%s %s' % (self._date_repr, self._time_repr) + * + */ + __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__149); + __Pyx_GIVEREF(__pyx_tuple__149); + __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_repr_base, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":264 + * + * @property + * def tz(self): # <<<<<<<<<<<<<< + * """ + * Alias for tzinfo + */ + __pyx_tuple__151 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__151); + __Pyx_GIVEREF(__pyx_tuple__151); + __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":271 + * + * @property + * def freq(self): # <<<<<<<<<<<<<< + * return self.offset + * + */ + __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__153); + __Pyx_GIVEREF(__pyx_tuple__153); + __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_freq, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":274 + * return self.offset + * + * def __setstate__(self, state): # <<<<<<<<<<<<<< + * self.value = state[0] + * self.offset = state[1] + */ + __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_state); if (unlikely(!__pyx_tuple__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__155); + __Pyx_GIVEREF(__pyx_tuple__155); + __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_setstate, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":279 + * self.tzinfo = state[2] + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) + */ + __pyx_tuple__157 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_object_state); if (unlikely(!__pyx_tuple__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__157); + __Pyx_GIVEREF(__pyx_tuple__157); + __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_reduce, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":283 + * return (Timestamp, object_state) + * + * def to_period(self, freq=None): # <<<<<<<<<<<<<< + * """ + * Return an period of which this timestamp is an observation. + */ + __pyx_tuple__159 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_freq, __pyx_n_s_Period); if (unlikely(!__pyx_tuple__159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__159); + __Pyx_GIVEREF(__pyx_tuple__159); + __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_to_period, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__161 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__161); + __Pyx_GIVEREF(__pyx_tuple__161); + + /* "pandas/tslib.pyx":295 + * + * @property + * def dayofweek(self): # <<<<<<<<<<<<<< + * return self.weekday() + * + */ + __pyx_tuple__162 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__162); + __Pyx_GIVEREF(__pyx_tuple__162); + __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dayofweek, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":299 + * + * @property + * def dayofyear(self): # <<<<<<<<<<<<<< + * return self._get_field('doy') + * + */ + __pyx_tuple__164 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__164); + __Pyx_GIVEREF(__pyx_tuple__164); + __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dayofyear, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":303 + * + * @property + * def week(self): # <<<<<<<<<<<<<< + * return self._get_field('woy') + * + */ + __pyx_tuple__166 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__166); + __Pyx_GIVEREF(__pyx_tuple__166); + __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_week, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":309 + * + * @property + * def quarter(self): # <<<<<<<<<<<<<< + * return self._get_field('q') + * + */ + __pyx_tuple__168 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__168); + __Pyx_GIVEREF(__pyx_tuple__168); + __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_quarter, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":313 + * + * @property + * def freqstr(self): # <<<<<<<<<<<<<< + * return getattr(self.offset, 'freqstr', self.offset) + * + */ + __pyx_tuple__170 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__170); + __Pyx_GIVEREF(__pyx_tuple__170); + __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_freqstr, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":317 + * + * @property + * def asm8(self): # <<<<<<<<<<<<<< + * return np.int64(self.value).view('M8[ns]') + * + */ + __pyx_tuple__172 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__172); + __Pyx_GIVEREF(__pyx_tuple__172); + __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_asm8, 317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":321 + * + * @property + * def is_month_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_start') + * + */ + __pyx_tuple__174 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__174); + __Pyx_GIVEREF(__pyx_tuple__174); + __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_month_start, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":325 + * + * @property + * def is_month_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_end') + * + */ + __pyx_tuple__176 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__176); + __Pyx_GIVEREF(__pyx_tuple__176); + __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_month_end, 325, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":329 + * + * @property + * def is_quarter_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_start') + * + */ + __pyx_tuple__178 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__178); + __Pyx_GIVEREF(__pyx_tuple__178); + __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_quarter_start, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":333 + * + * @property + * def is_quarter_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_end') + * + */ + __pyx_tuple__180 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__180); + __Pyx_GIVEREF(__pyx_tuple__180); + __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_quarter_end, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":337 + * + * @property + * def is_year_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_start') + * + */ + __pyx_tuple__182 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__182); + __Pyx_GIVEREF(__pyx_tuple__182); + __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_year_start, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":341 + * + * @property + * def is_year_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_end') + * + */ + __pyx_tuple__184 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__184); + __Pyx_GIVEREF(__pyx_tuple__184); + __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_year_end, 341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":344 + * return self._get_start_end_field('is_year_end') + * + * def tz_localize(self, tz, infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Convert naive Timestamp to local time zone + */ + __pyx_tuple__186 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tz, __pyx_n_s_infer_dst, __pyx_n_s_value); if (unlikely(!__pyx_tuple__186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__186); + __Pyx_GIVEREF(__pyx_tuple__186); + __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_localize, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__188 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__188); + __Pyx_GIVEREF(__pyx_tuple__188); + + /* "pandas/tslib.pyx":368 + * 'tz_convert for conversions') + * + * def tz_convert(self, tz): # <<<<<<<<<<<<<< + * """ + * Convert Timestamp to another time zone or localize to requested time + */ + __pyx_tuple__189 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__189); + __Pyx_GIVEREF(__pyx_tuple__189); + __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_convert, 368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":391 + * astimezone = tz_convert + * + * def replace(self, **kwds): # <<<<<<<<<<<<<< + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) + */ + __pyx_tuple__191 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kwds); if (unlikely(!__pyx_tuple__191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__191); + __Pyx_GIVEREF(__pyx_tuple__191); + __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_replace, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":395 + * offset=self.offset) + * + * def to_pydatetime(self, warn=True): # <<<<<<<<<<<<<< + * """ + * If warn=True, issue warning if nanoseconds is nonzero + */ + __pyx_tuple__193 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_warn, __pyx_n_s_dts, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__193); + __Pyx_GIVEREF(__pyx_tuple__193); + __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_to_pydatetime, 395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__195 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__195); + __Pyx_GIVEREF(__pyx_tuple__195); + + /* "pandas/tslib.pyx":411 + * ts.dts.us, ts.tzinfo) + * + * def isoformat(self, sep='T'): # <<<<<<<<<<<<<< + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + */ + __pyx_tuple__196 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sep, __pyx_n_s_base, __pyx_n_s_base1, __pyx_n_s_base2); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__196); + __Pyx_GIVEREF(__pyx_tuple__196); + __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isoformat, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__198 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_T)); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__198); + __Pyx_GIVEREF(__pyx_tuple__198); + + /* "pandas/tslib.pyx":428 + * return base1 + base2 + * + * def _has_time_component(self): # <<<<<<<<<<<<<< + * """ + * Returns if the Timestamp has a time component + */ + __pyx_tuple__199 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__199); + __Pyx_GIVEREF(__pyx_tuple__199); + __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_has_time_component, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":437 + * or self.nanosecond != 0) + * + * def to_julian_date(self): # <<<<<<<<<<<<<< + * """ + * Convert TimeStamp to a Julian Date. + */ + __pyx_tuple__201 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_to_julian_date, 437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":466 + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + * def __new__(cls): # <<<<<<<<<<<<<< + * cdef _NaT base + * + */ + __pyx_tuple__203 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_base); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__203); + __Pyx_GIVEREF(__pyx_tuple__203); + __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_new, 466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":475 + * return base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + __pyx_tuple__205 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__205); + __Pyx_GIVEREF(__pyx_tuple__205); + __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_repr, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":478 + * return 'NaT' + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + __pyx_tuple__207 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__207); + __Pyx_GIVEREF(__pyx_tuple__207); + __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_str, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":481 + * return 'NaT' + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return iNaT + * + */ + __pyx_tuple__209 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__209); + __Pyx_GIVEREF(__pyx_tuple__209); + __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_hash, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":484 + * return iNaT + * + * def __int__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_tuple__211 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__211); + __Pyx_GIVEREF(__pyx_tuple__211); + __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_int, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":487 + * return NPY_NAT + * + * def __long__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_tuple__213 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__213); + __Pyx_GIVEREF(__pyx_tuple__213); + __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_long_2, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":490 + * return NPY_NAT + * + * def weekday(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_tuple__215 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__215); + __Pyx_GIVEREF(__pyx_tuple__215); + __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_weekday, 490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":493 + * return -1 + * + * def toordinal(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_tuple__217 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__217); + __Pyx_GIVEREF(__pyx_tuple__217); + __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_toordinal, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":496 + * return -1 + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * return (__nat_unpickle, (None, )) + * + */ + __pyx_tuple__219 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__219); + __Pyx_GIVEREF(__pyx_tuple__219); + __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_reduce, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":506 + * setattr(NaTType, field, prop) + * + * def __nat_unpickle(*args): # <<<<<<<<<<<<<< + * # return constant defined in the module + * return NaT + */ + __pyx_tuple__221 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__221)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__221); + __Pyx_GIVEREF(__pyx_tuple__221); + __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_nat_unpickle, 506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":530 + * return ', tz=%s' % zone + * + * def is_timestamp_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_tuple__223 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n); if (unlikely(!__pyx_tuple__223)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__223); + __Pyx_GIVEREF(__pyx_tuple__223); + __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_is_timestamp_array, 530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":580 + * # Frequency inference + * + * def unique_deltas(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_tuple__225 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_k, __pyx_n_s_table, __pyx_n_s_ret, __pyx_n_s_uniques, __pyx_n_s_result); if (unlikely(!__pyx_tuple__225)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__225); + __Pyx_GIVEREF(__pyx_tuple__225); + __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_unique_deltas, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":608 + * + * + * def apply_offset(ndarray[object] values, object offset): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__227 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_offset, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_new_values, __pyx_n_s_boxed, __pyx_n_s_result); if (unlikely(!__pyx_tuple__227)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__227); + __Pyx_GIVEREF(__pyx_tuple__227); + __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_apply_offset, 608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":845 + * + * + * def _delta_to_nanoseconds(delta): # <<<<<<<<<<<<<< + * if hasattr(delta, 'delta'): + * delta = delta.delta + */ + __pyx_tuple__229 = PyTuple_Pack(1, __pyx_n_s_delta); if (unlikely(!__pyx_tuple__229)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__229); + __Pyx_GIVEREF(__pyx_tuple__229); + __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_delta_to_nanoseconds, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1024 + * + * + * def get_timezone(tz): # <<<<<<<<<<<<<< + * return _get_zone(tz) + * + */ + __pyx_tuple__231 = PyTuple_Pack(1, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__231)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__231); + __Pyx_GIVEREF(__pyx_tuple__231); + __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_timezone, 1024, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1109 + * # obj.dtval = _dts_to_pydatetime(&obj.dts) + * + * def datetime_to_datetime64(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__233 = PyTuple_Pack(9, __pyx_n_s_values, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_inferred_tz, __pyx_n_s_iresult, __pyx_n_s_dts, __pyx_n_s_ts_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__233)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__233); + __Pyx_GIVEREF(__pyx_tuple__233); + __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_datetime_to_datetime64, 1109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1146 + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + * + * def _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * if date_string.startswith('0'): + * # Strings starting with 0 are more consistent with a + */ + __pyx_tuple__235 = PyTuple_Pack(1, __pyx_n_s_date_string); if (unlikely(!__pyx_tuple__235)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__235); + __Pyx_GIVEREF(__pyx_tuple__235); + __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_does_string_look_like_datetime, 1146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1163 + * return True + * + * def parse_datetime_string(date_string, **kwargs): # <<<<<<<<<<<<<< + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') + */ + __pyx_tuple__237 = PyTuple_Pack(3, __pyx_n_s_date_string, __pyx_n_s_kwargs, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__237)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__237); + __Pyx_GIVEREF(__pyx_tuple__237); + __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_parse_datetime_string, 1163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + __pyx_tuple__239 = PyTuple_Pack(20, __pyx_n_s_values, __pyx_n_s_raise, __pyx_n_s_dayfirst, __pyx_n_s_format, __pyx_n_s_utc, __pyx_n_s_coerce, __pyx_n_s_unit, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_val, __pyx_n_s_py_dt, __pyx_n_s_iresult, __pyx_n_s_oresult, __pyx_n_s_dts, __pyx_n_s_utc_convert, __pyx_n_s_seen_integer, __pyx_n_s_seen_datetime, __pyx_n_s_ts_2, __pyx_n_s_m, __pyx_n_s_result); if (unlikely(!__pyx_tuple__239)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__239); + __Pyx_GIVEREF(__pyx_tuple__239); + __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(7, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_array_to_datetime, 1170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1344 + * return oresult + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): # <<<<<<<<<<<<<< + * """ convert an ndarray to an array of ints that are timedeltas + * force conversion if coerce = True, + */ + __pyx_tuple__241 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_unit, __pyx_n_s_coerce, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_iresult, __pyx_n_s_result); if (unlikely(!__pyx_tuple__241)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__241); + __Pyx_GIVEREF(__pyx_tuple__241); + __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_array_to_timedelta64, 1344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1360 + * return iresult + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): # <<<<<<<<<<<<<< + * return convert_to_timedelta64(ts, unit, coerce) + * + */ + __pyx_tuple__243 = PyTuple_Pack(3, __pyx_n_s_ts, __pyx_n_s_unit, __pyx_n_s_coerce); if (unlikely(!__pyx_tuple__243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__243); + __Pyx_GIVEREF(__pyx_tuple__243); + __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_convert_to_timedelta, 1360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1430 + * return ts.astype('timedelta64[ns]') + * + * def repr_timedelta64(object value, format=None): # <<<<<<<<<<<<<< + * """ + * provide repr for timedelta64 + */ + __pyx_tuple__245 = PyTuple_Pack(12, __pyx_n_s_value, __pyx_n_s_format, __pyx_n_s_ivalue, __pyx_n_s_frac, __pyx_n_s_sign, __pyx_n_s_days, __pyx_n_s_hours, __pyx_n_s_minutes, __pyx_n_s_seconds, __pyx_n_s_seconds_pretty, __pyx_n_s_sp, __pyx_n_s_sign_pretty); if (unlikely(!__pyx_tuple__245)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__245); + __Pyx_GIVEREF(__pyx_tuple__245); + __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_repr_timedelta64, 1430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1499 + * + * + * def array_strptime(ndarray[object] values, object fmt, coerce=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__247 = PyTuple_Pack(37, __pyx_n_s_values, __pyx_n_s_fmt, __pyx_n_s_coerce, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_iresult, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_minute, __pyx_n_s_hour, __pyx_n_s_second, __pyx_n_s_fraction, __pyx_n_s_weekday, __pyx_n_s_julian, __pyx_n_s_val, __pyx_n_s_locale_time, __pyx_n_s_format_regex, __pyx_n_s_err, __pyx_n_s_bad_directive, __pyx_n_s_result, __pyx_n_s_parse_code_table, __pyx_n_s_parse_code, __pyx_n_s_found, __pyx_n_s_tz, __pyx_n_s_week_of_year, __pyx_n_s_week_of_year_start, __pyx_n_s_found_dict, __pyx_n_s_group_key, __pyx_n_s_ampm, __pyx_n_s_s, __pyx_n_s_found_zone, __pyx_n_s_value, __pyx_n_s_tz_values, __pyx_n_s_week_starts_Mon, __pyx_n_s_datetime_result); if (unlikely(!__pyx_tuple__247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__247); + __Pyx_GIVEREF(__pyx_tuple__247); + __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(3, 0, 37, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_array_strptime, 1499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1793 + * return (base*m) + (frac*m) + * + * def cast_to_nanoseconds(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + __pyx_tuple__249 = PyTuple_Pack(9, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_ivalues, __pyx_n_s_iresult, __pyx_n_s_unit, __pyx_n_s_dts, __pyx_n_s_shape, __pyx_n_s_result); if (unlikely(!__pyx_tuple__249)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__249); + __Pyx_GIVEREF(__pyx_tuple__249); + __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_cast_to_nanoseconds, 1793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1825 + * + * + * def pydt_to_i8(object pydt): # <<<<<<<<<<<<<< + * ''' + * Convert to int64 representation compatible with numpy datetime64; converts + */ + __pyx_tuple__251 = PyTuple_Pack(2, __pyx_n_s_pydt, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__251)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__251); + __Pyx_GIVEREF(__pyx_tuple__251); + __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pydt_to_i8, 1825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1837 + * return ts.value + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): # <<<<<<<<<<<<<< + * ''' + * Inverse of pydt_to_i8 + */ + __pyx_tuple__253 = PyTuple_Pack(2, __pyx_n_s_i8, __pyx_n_s_tzinfo); if (unlikely(!__pyx_tuple__253)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__253); + __Pyx_GIVEREF(__pyx_tuple__253); + __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_i8_to_pydt, 1837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1853 + * have_pytz = False + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + */ + __pyx_tuple__255 = PyTuple_Pack(17, __pyx_n_s_vals, __pyx_n_s_tz1, __pyx_n_s_tz2, __pyx_n_s_utc_dates, __pyx_n_s_result, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_n, __pyx_n_s_v, __pyx_n_s_offset, __pyx_n_s_dts, __pyx_n_s_pytz, __pyx_n_s_dt, __pyx_n_s_delta, __pyx_n_s_trans_len); if (unlikely(!__pyx_tuple__255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__255); + __Pyx_GIVEREF(__pyx_tuple__255); + __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_convert, 1853, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1934 + * return result + * + * def tz_convert_single(int64_t val, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] trans, deltas + */ + __pyx_tuple__257 = PyTuple_Pack(13, __pyx_n_s_val, __pyx_n_s_tz1, __pyx_n_s_tz2, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_pos, __pyx_n_s_v, __pyx_n_s_offset, __pyx_n_s_utc_date, __pyx_n_s_dts, __pyx_n_s_pytz, __pyx_n_s_dt, __pyx_n_s_delta); if (unlikely(!__pyx_tuple__257)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__257); + __Pyx_GIVEREF(__pyx_tuple__257); + __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_convert_single, 1934, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":1994 + * + * + * def _p_tz_cache_key(tz): # <<<<<<<<<<<<<< + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) + */ + __pyx_tuple__259 = PyTuple_Pack(1, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__259)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__259); + __Pyx_GIVEREF(__pyx_tuple__259); + __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_p_tz_cache_key, 1994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2108 + * 10**6) + * + * def tot_seconds(td): # <<<<<<<<<<<<<< + * return total_seconds(td) + * + */ + __pyx_tuple__261 = PyTuple_Pack(1, __pyx_n_s_td); if (unlikely(!__pyx_tuple__261)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__261); + __Pyx_GIVEREF(__pyx_tuple__261); + __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tot_seconds, 2108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2127 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Localize tzinfo-naive DateRange to given time zone (using pytz). If + */ + __pyx_tuple__263 = PyTuple_Pack(32, __pyx_n_s_vals, __pyx_n_s_tz, __pyx_n_s_infer_dst, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_idx_shifted, __pyx_n_s_i, __pyx_n_s_idx, __pyx_n_s_pos, __pyx_n_s_ntrans, __pyx_n_s_n, __pyx_n_s_tdata, __pyx_n_s_v, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_result, __pyx_n_s_result_a, __pyx_n_s_result_b, __pyx_n_s_dst_hours, __pyx_n_s_dts, __pyx_n_s_dt, __pyx_n_s_delta, __pyx_n_s_both_nat, __pyx_n_s_both_eq, __pyx_n_s_trans_idx_2, __pyx_n_s_stamp, __pyx_n_s_one_diff, __pyx_n_s_trans_grp, __pyx_n_s_grp, __pyx_n_s_switch_idx, __pyx_n_s_a_idx, __pyx_n_s_b_idx); if (unlikely(!__pyx_tuple__263)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__263); + __Pyx_GIVEREF(__pyx_tuple__263); + __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(3, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_tz_localize_to_utc, 2127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2300 + * #---------------------------------------------------------------------- + * + * def build_field_sarray(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + __pyx_tuple__265 = PyTuple_Pack(14, __pyx_n_s_dtindex, __pyx_n_s_i, __pyx_n_s_count, __pyx_n_s_isleap, __pyx_n_s_dts, __pyx_n_s_years, __pyx_n_s_months, __pyx_n_s_days, __pyx_n_s_hours, __pyx_n_s_minutes, __pyx_n_s_seconds, __pyx_n_s_mus, __pyx_n_s_sa_dtype, __pyx_n_s_out); if (unlikely(!__pyx_tuple__265)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__265); + __Pyx_GIVEREF(__pyx_tuple__265); + __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(1, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_build_field_sarray, 2300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2342 + * return out + * + * def get_time_micros(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + __pyx_tuple__267 = PyTuple_Pack(5, __pyx_n_s_dtindex, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_micros); if (unlikely(!__pyx_tuple__267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__267); + __Pyx_GIVEREF(__pyx_tuple__267); + __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_time_micros, 2342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2361 + * + * @cython.wraparound(False) + * def get_date_field(ndarray[int64_t] dtindex, object field): # <<<<<<<<<<<<<< + * ''' + * Given a int64-based datetime index, extract the year, month, etc., + */ + __pyx_tuple__269 = PyTuple_Pack(14, __pyx_n_s_dtindex, __pyx_n_s_field, __pyx_n_s_ts, __pyx_n_s_i, __pyx_n_s_count, __pyx_n_s_out, __pyx_n_s_month_offset, __pyx_n_s_isleap, __pyx_n_s_isleap_prev, __pyx_n_s_dts, __pyx_n_s_mo_off, __pyx_n_s_doy, __pyx_n_s_dow, __pyx_n_s_woy); if (unlikely(!__pyx_tuple__269)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__269); + __Pyx_GIVEREF(__pyx_tuple__269); + __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_date_field, 2361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2505 + * + * @cython.wraparound(False) + * def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=None, int month_kw=12): # <<<<<<<<<<<<<< + * ''' + * Given an int64-based datetime index return array of indicators + */ + __pyx_tuple__271 = PyTuple_Pack(19, __pyx_n_s_dtindex, __pyx_n_s_field, __pyx_n_s_freqstr, __pyx_n_s_month_kw, __pyx_n_s_ts, __pyx_n_s_i, __pyx_n_s_count, __pyx_n_s_is_business, __pyx_n_s_end_month, __pyx_n_s_start_month, __pyx_n_s_out, __pyx_n_s_month_offset, __pyx_n_s_isleap, __pyx_n_s_dts, __pyx_n_s_mo_off, __pyx_n_s_dom, __pyx_n_s_doy, __pyx_n_s_dow, __pyx_n_s_ldom); if (unlikely(!__pyx_tuple__271)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__271); + __Pyx_GIVEREF(__pyx_tuple__271); + __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_start_end_field_2, 2505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2730 + * + * + * def date_normalize(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + __pyx_tuple__273 = PyTuple_Pack(7, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_tso, __pyx_n_s_result); if (unlikely(!__pyx_tuple__273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__273); + __Pyx_GIVEREF(__pyx_tuple__273); + __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_date_normalize, 2730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2824 + * + * + * def dates_normalized(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + __pyx_tuple__275 = PyTuple_Pack(10, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_dts, __pyx_n_s_dt, __pyx_n_s_trans, __pyx_n_s_deltas, __pyx_n_s_pos, __pyx_n_s_inf); if (unlikely(!__pyx_tuple__275)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__275); + __Pyx_GIVEREF(__pyx_tuple__275); + __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dates_normalized, 2824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2862 + * #---------------------------------------------------------------------- + * + * def isleapyear(int64_t year): # <<<<<<<<<<<<<< + * return is_leapyear(year) + * + */ + __pyx_tuple__277 = PyTuple_Pack(2, __pyx_n_s_year, __pyx_n_s_year); if (unlikely(!__pyx_tuple__277)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__277); + __Pyx_GIVEREF(__pyx_tuple__277); + __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_isleapyear, 2862, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":2865 + * return is_leapyear(year) + * + * def monthrange(int64_t year, int64_t month): # <<<<<<<<<<<<<< + * cdef: + * int64_t days + */ + __pyx_tuple__279 = PyTuple_Pack(4, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_days, __pyx_n_s_day_of_week); if (unlikely(!__pyx_tuple__279)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__279); + __Pyx_GIVEREF(__pyx_tuple__279); + __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_monthrange, 2865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3044 + * return period_ord_w_mult * mult + 1; + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): # <<<<<<<<<<<<<< + * """ + * Convert array of datetime64 values (passed in as 'i8' dtype) to a set of + */ + __pyx_tuple__281 = PyTuple_Pack(7, __pyx_n_s_dtarr, __pyx_n_s_freq, __pyx_n_s_tz, __pyx_n_s_out, __pyx_n_s_i, __pyx_n_s_l, __pyx_n_s_dts); if (unlikely(!__pyx_tuple__281)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__281); + __Pyx_GIVEREF(__pyx_tuple__281); + __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_dt64arr_to_periodarr, 3044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3070 + * return out + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): # <<<<<<<<<<<<<< + * """ + * Convert array to datetime64 values from a set of ordinals corresponding to + */ + __pyx_tuple__283 = PyTuple_Pack(5, __pyx_n_s_periodarr, __pyx_n_s_freq, __pyx_n_s_out, __pyx_n_s_i, __pyx_n_s_l); if (unlikely(!__pyx_tuple__283)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__283); + __Pyx_GIVEREF(__pyx_tuple__283); + __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_periodarr_to_dt64arr, 3070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3116 + * return retval + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): # <<<<<<<<<<<<<< + * """ + * Convert int64-array of period ordinals from one frequency to another, and + */ + __pyx_tuple__285 = PyTuple_Pack(13, __pyx_n_s_arr, __pyx_n_s_freq1, __pyx_n_s_freq2, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_func, __pyx_n_s_finfo, __pyx_n_s_val, __pyx_n_s_ordinal, __pyx_n_s_relation, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__285)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__285); + __Pyx_GIVEREF(__pyx_tuple__285); + __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_period_asfreq_arr, 3116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3158 + * return result + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): # <<<<<<<<<<<<<< + * cdef: + * int64_t ordinal + */ + __pyx_tuple__287 = PyTuple_Pack(10, __pyx_n_s_y, __pyx_n_s_m, __pyx_n_s_d, __pyx_n_s_h, __pyx_n_s_min, __pyx_n_s_s, __pyx_n_s_us, __pyx_n_s_ps, __pyx_n_s_freq, __pyx_n_s_ordinal); if (unlikely(!__pyx_tuple__287)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__287); + __Pyx_GIVEREF(__pyx_tuple__287); + __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(9, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_period_ordinal, 3158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3188 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * + * def period_format(int64_t value, int freq, object fmt=None): # <<<<<<<<<<<<<< + * cdef: + * int freq_group + */ + __pyx_tuple__289 = PyTuple_Pack(6, __pyx_n_s_value, __pyx_n_s_freq, __pyx_n_s_fmt, __pyx_n_s_freq_group, __pyx_n_s_left, __pyx_n_s_right); if (unlikely(!__pyx_tuple__289)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__289); + __Pyx_GIVEREF(__pyx_tuple__289); + __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_period_format, 3188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3229 + * + * + * cdef list extra_fmts = [(b"%q", b"^`AB`^"), # <<<<<<<<<<<<<< + * (b"%f", b"^`CD`^"), + * (b"%F", b"^`EF`^"), + */ + __pyx_tuple__291 = PyTuple_Pack(2, __pyx_kp_b_q_2, __pyx_kp_b_AB); if (unlikely(!__pyx_tuple__291)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__291); + __Pyx_GIVEREF(__pyx_tuple__291); + + /* "pandas/tslib.pyx":3230 + * + * cdef list extra_fmts = [(b"%q", b"^`AB`^"), + * (b"%f", b"^`CD`^"), # <<<<<<<<<<<<<< + * (b"%F", b"^`EF`^"), + * (b"%l", b"^`GH`^"), + */ + __pyx_tuple__292 = PyTuple_Pack(2, __pyx_kp_b_f_2, __pyx_kp_b_CD); if (unlikely(!__pyx_tuple__292)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__292); + __Pyx_GIVEREF(__pyx_tuple__292); + + /* "pandas/tslib.pyx":3231 + * cdef list extra_fmts = [(b"%q", b"^`AB`^"), + * (b"%f", b"^`CD`^"), + * (b"%F", b"^`EF`^"), # <<<<<<<<<<<<<< + * (b"%l", b"^`GH`^"), + * (b"%u", b"^`IJ`^"), + */ + __pyx_tuple__293 = PyTuple_Pack(2, __pyx_kp_b_F, __pyx_kp_b_EF); if (unlikely(!__pyx_tuple__293)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__293); + __Pyx_GIVEREF(__pyx_tuple__293); + + /* "pandas/tslib.pyx":3232 + * (b"%f", b"^`CD`^"), + * (b"%F", b"^`EF`^"), + * (b"%l", b"^`GH`^"), # <<<<<<<<<<<<<< + * (b"%u", b"^`IJ`^"), + * (b"%n", b"^`KL`^")] + */ + __pyx_tuple__294 = PyTuple_Pack(2, __pyx_kp_b_l_2, __pyx_kp_b_GH); if (unlikely(!__pyx_tuple__294)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__294); + __Pyx_GIVEREF(__pyx_tuple__294); + + /* "pandas/tslib.pyx":3233 + * (b"%F", b"^`EF`^"), + * (b"%l", b"^`GH`^"), + * (b"%u", b"^`IJ`^"), # <<<<<<<<<<<<<< + * (b"%n", b"^`KL`^")] + * + */ + __pyx_tuple__295 = PyTuple_Pack(2, __pyx_kp_b_u_2, __pyx_kp_b_IJ); if (unlikely(!__pyx_tuple__295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__295); + __Pyx_GIVEREF(__pyx_tuple__295); + + /* "pandas/tslib.pyx":3234 + * (b"%l", b"^`GH`^"), + * (b"%u", b"^`IJ`^"), + * (b"%n", b"^`KL`^")] # <<<<<<<<<<<<<< + * + * cdef list str_extra_fmts = ["^`AB`^", "^`CD`^", "^`EF`^", "^`GH`^", "^`IJ`^", "^`KL`^"] + */ + __pyx_tuple__296 = PyTuple_Pack(2, __pyx_kp_b_n_2, __pyx_kp_b_KL); if (unlikely(!__pyx_tuple__296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__296); + __Pyx_GIVEREF(__pyx_tuple__296); + + /* "pandas/tslib.pyx":3294 + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN + * + * def get_period_field(int code, int64_t value, int freq): # <<<<<<<<<<<<<< + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + */ + __pyx_tuple__297 = PyTuple_Pack(4, __pyx_n_s_code, __pyx_n_s_value, __pyx_n_s_freq, __pyx_n_s_f); if (unlikely(!__pyx_tuple__297)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__297); + __Pyx_GIVEREF(__pyx_tuple__297); + __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_period_field, 3294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3302 + * return f(value, freq) + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + __pyx_tuple__299 = PyTuple_Pack(7, __pyx_n_s_code, __pyx_n_s_arr, __pyx_n_s_freq, __pyx_n_s_i, __pyx_n_s_sz, __pyx_n_s_out, __pyx_n_s_f); if (unlikely(!__pyx_tuple__299)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__299); + __Pyx_GIVEREF(__pyx_tuple__299); + __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_period_field_arr, 3302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3351 + * + * + * def extract_ordinals(ndarray[object] values, freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_tuple__301 = PyTuple_Pack(6, __pyx_n_s_values, __pyx_n_s_freq, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_ordinals, __pyx_n_s_p); if (unlikely(!__pyx_tuple__301)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__301); + __Pyx_GIVEREF(__pyx_tuple__301); + __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_extract_ordinals, 3351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3501 + * __all__ = [] + * + * def _getlang(): # <<<<<<<<<<<<<< + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) + */ + __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_getlang, 3501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3524 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * """Set all attributes. + * + */ + __pyx_tuple__304 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__304); + __Pyx_GIVEREF(__pyx_tuple__304); + __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_init, 3524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3553 + * raise ValueError("locale changed during initialization") + * + * def __pad(self, seq, front): # <<<<<<<<<<<<<< + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + */ + __pyx_tuple__306 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_seq, __pyx_n_s_front); if (unlikely(!__pyx_tuple__306)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__306); + __Pyx_GIVEREF(__pyx_tuple__306); + __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pad, 3553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3562 + * return seq + * + * def __calc_weekday(self): # <<<<<<<<<<<<<< + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + */ + __pyx_tuple__308 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_a_weekday, __pyx_n_s_f_weekday, __pyx_n_s_i); if (unlikely(!__pyx_tuple__308)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__308); + __Pyx_GIVEREF(__pyx_tuple__308); + __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_weekday, 3562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3570 + * self.f_weekday = f_weekday + * + * def __calc_month(self): # <<<<<<<<<<<<<< + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + */ + __pyx_tuple__310 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_a_month, __pyx_n_s_f_month, __pyx_n_s_i); if (unlikely(!__pyx_tuple__310)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__310); + __Pyx_GIVEREF(__pyx_tuple__310); + __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_month, 3570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3577 + * self.f_month = f_month + * + * def __calc_am_pm(self): # <<<<<<<<<<<<<< + * # Set self.am_pm by using time.strftime(). + * + */ + __pyx_tuple__312 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_am_pm, __pyx_n_s_hour, __pyx_n_s_time_tuple); if (unlikely(!__pyx_tuple__312)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__312); + __Pyx_GIVEREF(__pyx_tuple__312); + __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_am_pm, 3577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3589 + * self.am_pm = am_pm + * + * def __calc_date_time(self): # <<<<<<<<<<<<<< + * # Set self.date_time, self.date, & self.time by using + * # time.strftime(). + */ + __pyx_tuple__314 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_time_tuple, __pyx_n_s_date_time, __pyx_n_s_replacement_pairs, __pyx_n_s_offset, __pyx_n_s_directive, __pyx_n_s_current_format, __pyx_n_s_old, __pyx_n_s_new_2, __pyx_n_s_U_W, __pyx_n_s_tz_values, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__314)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__314); + __Pyx_GIVEREF(__pyx_tuple__314); + __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_date_time, 3589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3634 + * self.LC_time = date_time[2] + * + * def __calc_timezone(self): # <<<<<<<<<<<<<< + * # Set self.timezone by using time.tzname. + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + */ + __pyx_tuple__316 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_no_saving, __pyx_n_s_has_saving); if (unlikely(!__pyx_tuple__316)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__316); + __Pyx_GIVEREF(__pyx_tuple__316); + __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_timezone, 3634, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + __pyx_tuple__318 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_locale_time, __pyx_n_s_base, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__318)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__318); + __Pyx_GIVEREF(__pyx_tuple__318); + __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__318, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_init, 3653, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__320 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__320)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__320); + __Pyx_GIVEREF(__pyx_tuple__320); + + /* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + __pyx_tuple__321 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_to_convert, __pyx_n_s_directive, __pyx_n_s_value, __pyx_n_s_regex, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__321)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__321); + __Pyx_GIVEREF(__pyx_tuple__321); + __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_seqToRE, 3695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3714 + * return '%s)' % regex + * + * def pattern(self, format): # <<<<<<<<<<<<<< + * """Return regex pattern for the format string. + * + */ + __pyx_tuple__323 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_format, __pyx_n_s_processed_format, __pyx_n_s_regex_chars, __pyx_n_s_whitespace_replacement, __pyx_n_s_directive_index); if (unlikely(!__pyx_tuple__323)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__323); + __Pyx_GIVEREF(__pyx_tuple__323); + __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_pattern, 3714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3737 + * return "%s%s" % (processed_format, format) + * + * def compile(self, format): # <<<<<<<<<<<<<< + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) + */ + __pyx_tuple__325 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_format); if (unlikely(!__pyx_tuple__325)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__325); + __Pyx_GIVEREF(__pyx_tuple__325); + __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_compile, 3737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3748 + * _regex_cache = {} + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): # <<<<<<<<<<<<<< + * """Calculate the Julian day based on the year, week of the year, and day of + * the week, with week_start_day representing whether the week of the year + */ + __pyx_tuple__327 = PyTuple_Pack(7, __pyx_n_s_year, __pyx_n_s_week_of_year, __pyx_n_s_day_of_week, __pyx_n_s_week_starts_Mon, __pyx_n_s_first_weekday, __pyx_n_s_week_0_length, __pyx_n_s_days_to_week); if (unlikely(!__pyx_tuple__327)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__327); + __Pyx_GIVEREF(__pyx_tuple__327); + __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_calc_julian_from_U_or_W, 3748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_float_1e6 = PyFloat_FromDouble(1e6); if (unlikely(!__pyx_float_1e6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1e9 = PyFloat_FromDouble(1e9); if (unlikely(!__pyx_float_1e9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1e_6 = PyFloat_FromDouble(1e+6); if (unlikely(!__pyx_float_1e_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1e_9 = PyFloat_FromDouble(1e+9); if (unlikely(!__pyx_float_1e_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_24_0 = PyFloat_FromDouble(24.0); if (unlikely(!__pyx_float_24_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_60_0 = PyFloat_FromDouble(60.0); if (unlikely(!__pyx_float_60_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1000_0 = PyFloat_FromDouble(1000.0); if (unlikely(!__pyx_float_1000_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_3600_0 = PyFloat_FromDouble(3600.0); if (unlikely(!__pyx_float_3600_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_float_1721118_5 = PyFloat_FromDouble(1721118.5); if (unlikely(!__pyx_float_1721118_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_55 = PyInt_FromLong(55); if (unlikely(!__pyx_int_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_153 = PyInt_FromLong(153); if (unlikely(!__pyx_int_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_182 = PyInt_FromLong(182); if (unlikely(!__pyx_int_182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_212 = PyInt_FromLong(212); if (unlikely(!__pyx_int_212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_213 = PyInt_FromLong(213); if (unlikely(!__pyx_int_213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_243 = PyInt_FromLong(243); if (unlikely(!__pyx_int_243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_244 = PyInt_FromLong(244); if (unlikely(!__pyx_int_244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_273 = PyInt_FromLong(273); if (unlikely(!__pyx_int_273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_274 = PyInt_FromLong(274); if (unlikely(!__pyx_int_274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_304 = PyInt_FromLong(304); if (unlikely(!__pyx_int_304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_305 = PyInt_FromLong(305); if (unlikely(!__pyx_int_305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_334 = PyInt_FromLong(334); if (unlikely(!__pyx_int_334)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_335 = PyInt_FromLong(335); if (unlikely(!__pyx_int_335)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_365 = PyInt_FromLong(365); if (unlikely(!__pyx_int_365)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_366 = PyInt_FromLong(366); if (unlikely(!__pyx_int_366)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_400 = PyInt_FromLong(400); if (unlikely(!__pyx_int_400)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_457 = PyInt_FromLong(457); if (unlikely(!__pyx_int_457)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1999 = PyInt_FromLong(1999); if (unlikely(!__pyx_int_1999)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3600 = PyInt_FromLong(3600); if (unlikely(!__pyx_int_3600)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_6000 = PyInt_FromLong(6000); if (unlikely(!__pyx_int_6000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_86400 = PyInt_FromLong(86400L); if (unlikely(!__pyx_int_86400)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000000 = PyInt_FromLong(1000000000L); if (unlikely(!__pyx_int_1000000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_6 = PyInt_FromLong(-6); if (unlikely(!__pyx_int_neg_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1L = PyLong_FromString((char *)"1", 0, 0); if (unlikely(!__pyx_int_1L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000L = PyLong_FromString((char *)"1000", 0, 0); if (unlikely(!__pyx_int_1000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000L = PyLong_FromString((char *)"1000000", 0, 0); if (unlikely(!__pyx_int_1000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000000L = PyLong_FromString((char *)"1000000000", 0, 0); if (unlikely(!__pyx_int_1000000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_60000000000L = PyLong_FromString((char *)"60000000000", 0, 0); if (unlikely(!__pyx_int_60000000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3600000000000L = PyLong_FromString((char *)"3600000000000", 0, 0); if (unlikely(!__pyx_int_3600000000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_86400000000000L = PyLong_FromString((char *)"86400000000000", 0, 0); if (unlikely(!__pyx_int_86400000000000L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC inittslib(void); /*proto*/ +PyMODINIT_FUNC inittslib(void) +#else +PyMODINIT_FUNC PyInit_tslib(void); /*proto*/ +PyMODINIT_FUNC PyInit_tslib(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_tslib(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("tslib"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_pandas__tslib) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "pandas.tslib")) { + if (unlikely(PyDict_SetItemString(modules, "pandas.tslib", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + __pyx_v_6pandas_5tslib__NDIM_STRING = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_6pandas_5tslib_extra_fmts = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_6pandas_5tslib_str_extra_fmts = ((PyObject*)Py_None); Py_INCREF(Py_None); + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("convert_to_tsobject", (void (*)(void))__pyx_f_6pandas_5tslib_convert_to_tsobject, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ExportFunction("convert_to_timedelta64", (void (*)(void))__pyx_f_6pandas_5tslib_convert_to_timedelta64, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Type init code ---*/ + __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_6pandas_5tslib__Timestamp = &__pyx_vtable_6pandas_5tslib__Timestamp; + __pyx_vtable_6pandas_5tslib__Timestamp._compare_outside_nanorange = (int (*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyDateTime_DateTime *, int))__pyx_f_6pandas_5tslib_10_Timestamp__compare_outside_nanorange; + __pyx_vtable_6pandas_5tslib__Timestamp._assert_tzawareness_compat = (int (*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *))__pyx_f_6pandas_5tslib_10_Timestamp__assert_tzawareness_compat; + __pyx_vtable_6pandas_5tslib__Timestamp.to_datetime = (PyDateTime_DateTime *(*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, int __pyx_skip_dispatch))__pyx_f_6pandas_5tslib_10_Timestamp_to_datetime; + __pyx_vtable_6pandas_5tslib__Timestamp._get_field = (PyObject *(*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5tslib_10_Timestamp__get_field; + __pyx_vtable_6pandas_5tslib__Timestamp._get_start_end_field = (PyObject *(*)(struct __pyx_obj_6pandas_5tslib__Timestamp *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_5tslib_10_Timestamp__get_start_end_field; + __pyx_type_6pandas_5tslib__Timestamp.tp_base = __pyx_ptype_8datetime_datetime; + if (PyType_Ready(&__pyx_type_6pandas_5tslib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib__Timestamp.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5tslib__Timestamp.tp_dict, __pyx_vtabptr_6pandas_5tslib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "_Timestamp", (PyObject *)&__pyx_type_6pandas_5tslib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5tslib__Timestamp = &__pyx_type_6pandas_5tslib__Timestamp; + __pyx_vtabptr_6pandas_5tslib__NaT = &__pyx_vtable_6pandas_5tslib__NaT; + __pyx_vtable_6pandas_5tslib__NaT.__pyx_base = *__pyx_vtabptr_6pandas_5tslib__Timestamp; + __pyx_type_6pandas_5tslib__NaT.tp_base = __pyx_ptype_6pandas_5tslib__Timestamp; + if (PyType_Ready(&__pyx_type_6pandas_5tslib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib__NaT.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6pandas_5tslib__NaT.tp_dict, __pyx_vtabptr_6pandas_5tslib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "_NaT", (PyObject *)&__pyx_type_6pandas_5tslib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5tslib__NaT = &__pyx_type_6pandas_5tslib__NaT; + if (PyType_Ready(&__pyx_type_6pandas_5tslib__TSObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib__TSObject.tp_print = 0; + if (__Pyx_SetAttrString(__pyx_m, "_TSObject", (PyObject *)&__pyx_type_6pandas_5tslib__TSObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6pandas_5tslib__TSObject = &__pyx_type_6pandas_5tslib__TSObject; + if (PyType_Ready(&__pyx_type_6pandas_5tslib___pyx_scope_struct____init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib___pyx_scope_struct____init__.tp_print = 0; + __pyx_ptype_6pandas_5tslib___pyx_scope_struct____init__ = &__pyx_type_6pandas_5tslib___pyx_scope_struct____init__; + if (PyType_Ready(&__pyx_type_6pandas_5tslib___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib___pyx_scope_struct_1_genexpr.tp_print = 0; + __pyx_ptype_6pandas_5tslib___pyx_scope_struct_1_genexpr = &__pyx_type_6pandas_5tslib___pyx_scope_struct_1_genexpr; + if (PyType_Ready(&__pyx_type_6pandas_5tslib___pyx_scope_struct_2___seqToRE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib___pyx_scope_struct_2___seqToRE.tp_print = 0; + __pyx_ptype_6pandas_5tslib___pyx_scope_struct_2___seqToRE = &__pyx_type_6pandas_5tslib___pyx_scope_struct_2___seqToRE; + if (PyType_Ready(&__pyx_type_6pandas_5tslib___pyx_scope_struct_3_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6pandas_5tslib___pyx_scope_struct_3_genexpr.tp_print = 0; + __pyx_ptype_6pandas_5tslib___pyx_scope_struct_3_genexpr = &__pyx_type_6pandas_5tslib___pyx_scope_struct_3_genexpr; + /*--- Type import code ---*/ + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if CYTHON_COMPILING_IN_PYPY + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "pandas/tslib.pyx":6 + * from numpy cimport (int8_t, int32_t, int64_t, import_array, ndarray, + * NPY_INT64, NPY_DATETIME, NPY_TIMEDELTA) + * import numpy as np # <<<<<<<<<<<<<< + * + * from cpython cimport ( + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":35 + * cimport cython + * + * from datetime import timedelta, datetime # <<<<<<<<<<<<<< + * from datetime import time as datetime_time + * from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile, + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_timedelta); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_timedelta); + __Pyx_GIVEREF(__pyx_n_s_timedelta); + __Pyx_INCREF(__pyx_n_s_datetime); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_datetime); + __Pyx_GIVEREF(__pyx_n_s_datetime); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":36 + * + * from datetime import timedelta, datetime + * from datetime import time as datetime_time # <<<<<<<<<<<<<< + * from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile, + * tzutc as _dateutil_tzutc, gettz as _dateutil_gettz) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_time); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_time); + __Pyx_GIVEREF(__pyx_n_s_time); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":37 + * from datetime import timedelta, datetime + * from datetime import time as datetime_time + * from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile, # <<<<<<<<<<<<<< + * tzutc as _dateutil_tzutc, gettz as _dateutil_gettz) + * from pytz.tzinfo import BaseTzInfo as _pytz_BaseTzInfo + */ + __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_tzoffset); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_tzoffset); + __Pyx_GIVEREF(__pyx_n_s_tzoffset); + __Pyx_INCREF(__pyx_n_s_tzlocal); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_tzlocal); + __Pyx_GIVEREF(__pyx_n_s_tzlocal); + __Pyx_INCREF(__pyx_n_s_tzfile); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_tzfile); + __Pyx_GIVEREF(__pyx_n_s_tzfile); + __Pyx_INCREF(__pyx_n_s_tzutc); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_tzutc); + __Pyx_GIVEREF(__pyx_n_s_tzutc); + __Pyx_INCREF(__pyx_n_s_gettz); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_gettz); + __Pyx_GIVEREF(__pyx_n_s_gettz); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_dateutil_tz, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzoffset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tzoffset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzlocal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateutil_tzlocal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateutil_tzfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tzutc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateutil_tzutc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gettz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dateutil_gettz, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":39 + * from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile, + * tzutc as _dateutil_tzutc, gettz as _dateutil_gettz) + * from pytz.tzinfo import BaseTzInfo as _pytz_BaseTzInfo # <<<<<<<<<<<<<< + * from pandas.compat import parse_date + * from pandas.compat import parse_date, string_types + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_BaseTzInfo); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BaseTzInfo); + __Pyx_GIVEREF(__pyx_n_s_BaseTzInfo); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz_tzinfo, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BaseTzInfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz_BaseTzInfo, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":40 + * tzutc as _dateutil_tzutc, gettz as _dateutil_gettz) + * from pytz.tzinfo import BaseTzInfo as _pytz_BaseTzInfo + * from pandas.compat import parse_date # <<<<<<<<<<<<<< + * from pandas.compat import parse_date, string_types + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_parse_date); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_parse_date); + __Pyx_GIVEREF(__pyx_n_s_parse_date); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_pandas_compat, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_parse_date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_date, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":41 + * from pytz.tzinfo import BaseTzInfo as _pytz_BaseTzInfo + * from pandas.compat import parse_date + * from pandas.compat import parse_date, string_types # <<<<<<<<<<<<<< + * + * from sys import version_info + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_parse_date); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_parse_date); + __Pyx_GIVEREF(__pyx_n_s_parse_date); + __Pyx_INCREF(__pyx_n_s_string_types); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_string_types); + __Pyx_GIVEREF(__pyx_n_s_string_types); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas_compat, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_parse_date); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_date, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_types, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":43 + * from pandas.compat import parse_date, string_types + * + * from sys import version_info # <<<<<<<<<<<<<< + * + * # numpy compat + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_version_info); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_version_info); + __Pyx_GIVEREF(__pyx_n_s_version_info); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":46 + * + * # numpy compat + * from distutils.version import LooseVersion # <<<<<<<<<<<<<< + * _np_version = np.version.short_version + * _np_version_under1p6 = LooseVersion(_np_version) < '1.6' + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_LooseVersion); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_LooseVersion); + __Pyx_GIVEREF(__pyx_n_s_LooseVersion); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_distutils_version, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LooseVersion, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":47 + * # numpy compat + * from distutils.version import LooseVersion + * _np_version = np.version.short_version # <<<<<<<<<<<<<< + * _np_version_under1p6 = LooseVersion(_np_version) < '1.6' + * _np_version_under1p7 = LooseVersion(_np_version) < '1.7' + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_short_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":48 + * from distutils.version import LooseVersion + * _np_version = np.version.short_version + * _np_version_under1p6 = LooseVersion(_np_version) < '1.6' # <<<<<<<<<<<<<< + * _np_version_under1p7 = LooseVersion(_np_version) < '1.7' + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_s_1_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version_under1p6, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":49 + * _np_version = np.version.short_version + * _np_version_under1p6 = LooseVersion(_np_version) < '1.6' + * _np_version_under1p7 = LooseVersion(_np_version) < '1.7' # <<<<<<<<<<<<<< + * + * # GH3363 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_s_1_7, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version_under1p7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":52 + * + * # GH3363 + * cdef bint PY2 = version_info[0] == 2 # <<<<<<<<<<<<<< + * + * # initialize numpy + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_6pandas_5tslib_PY2 = __pyx_t_4; + + /* "pandas/tslib.pyx":55 + * + * # initialize numpy + * import_array() # <<<<<<<<<<<<<< + * #import_ufunc() + * + */ + import_array(); + + /* "pandas/tslib.pyx":59 + * + * # import datetime C API + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * # in numpy 1.7, will prob need the following: + */ + PyDateTime_IMPORT; + + /* "pandas/tslib.pyx":64 + * # numpy_pydatetime_import + * + * cdef int64_t NPY_NAT = util.get_nat() # <<<<<<<<<<<<<< + * + * # < numpy 1.7 compat for NaT + */ + __pyx_v_6pandas_5tslib_NPY_NAT = get_nat(); + + /* "pandas/tslib.pyx":67 + * + * # < numpy 1.7 compat for NaT + * compat_NaT = np.array([NPY_NAT]).astype('m8[ns]').item() # <<<<<<<<<<<<<< + * + * # numpy actual nat object + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib_NPY_NAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat_NaT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":70 + * + * # numpy actual nat object + * np_NaT = np.datetime64('NaT') # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_NaT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":72 + * np_NaT = np.datetime64('NaT') + * + * try: # <<<<<<<<<<<<<< + * basestring + * except NameError: # py3 + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/tslib.pyx":73 + * + * try: + * basestring # <<<<<<<<<<<<<< + * except NameError: # py3 + * basestring = str + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L9_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":74 + * try: + * basestring + * except NameError: # py3 # <<<<<<<<<<<<<< + * basestring = str + * + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_NameError); + if (__pyx_t_8) { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":75 + * basestring + * except NameError: # py3 + * basestring = str # <<<<<<<<<<<<<< + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L9_try_end:; + } + + /* "pandas/tslib.pyx":77 + * basestring = str + * + * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_1ints_to_pydatetime, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ints_to_pydatetime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":153 + * + * + * _zero_time = datetime_time(0, 0) # <<<<<<<<<<<<<< + * + * # Python front end to C extension type _Timestamp + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_zero_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":157 + * # Python front end to C extension type _Timestamp + * # This serves as the box for datetime64 + * class Timestamp(_Timestamp): # <<<<<<<<<<<<<< + * """TimeStamp is the pandas equivalent of python's Datetime + * and is interchangable with it in most cases. It's the type used + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__Timestamp))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Timestamp, __pyx_n_s_Timestamp, (PyObject *) NULL, __pyx_n_s_pandas_tslib, __pyx_kp_s_TimeStamp_is_the_pandas_equivale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":165 + * + * @classmethod + * def fromordinal(cls, ordinal, offset=None, tz=None): # <<<<<<<<<<<<<< + * """ passed an ordinal, translate and convert to a ts + * note: by definition there cannot be any tz info on the ordinal itself """ + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_1fromordinal, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Timestamp_fromordinal, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__132); + + /* "pandas/tslib.pyx":164 + * """ + * + * @classmethod # <<<<<<<<<<<<<< + * def fromordinal(cls, ordinal, offset=None, tz=None): + * """ passed an ordinal, translate and convert to a ts + */ + __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_fromordinal, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":171 + * + * @classmethod + * def now(cls, tz=None): # <<<<<<<<<<<<<< + * """ compat now with datetime """ + * if isinstance(tz, basestring): + */ + __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_3now, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Timestamp_now, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__135); + + /* "pandas/tslib.pyx":170 + * return cls(datetime.fromordinal(ordinal),offset=offset,tz=tz) + * + * @classmethod # <<<<<<<<<<<<<< + * def now(cls, tz=None): + * """ compat now with datetime """ + */ + __pyx_t_9 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_now, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":178 + * + * @classmethod + * def today(cls): # <<<<<<<<<<<<<< + * """ compat today with datetime """ + * return cls(datetime.today()) + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_5today, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Timestamp_today, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":177 + * return cls(datetime.now(tz)) + * + * @classmethod # <<<<<<<<<<<<<< + * def today(cls): + * """ compat today with datetime """ + */ + __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_today, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":183 + * + * @classmethod + * def utcnow(cls): # <<<<<<<<<<<<<< + * return cls.now('UTC') + * + */ + __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_7utcnow, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Timestamp_utcnow, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + + /* "pandas/tslib.pyx":182 + * return cls(datetime.today()) + * + * @classmethod # <<<<<<<<<<<<<< + * def utcnow(cls): + * return cls.now('UTC') + */ + __pyx_t_9 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_utcnow, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":186 + * return cls.now('UTC') + * + * def __new__(cls, object ts_input, object offset=None, tz=None, unit=None): # <<<<<<<<<<<<<< + * cdef _TSObject ts + * cdef _Timestamp ts_base + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_9__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Timestamp___new, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__142); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":217 + * return ts_base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * stamp = self._repr_base + * zone = None + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_11__repr__, 0, __pyx_n_s_Timestamp___repr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":242 + * + * @property + * def _date_repr(self): # <<<<<<<<<<<<<< + * # Ideal here would be self.strftime("%Y-%m-%d"), but + * # the datetime strftime() methods require year >= 1900 + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_13_date_repr, 0, __pyx_n_s_Timestamp__date_repr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":241 + * return "Timestamp('{stamp}'{tz}{offset})".format(stamp=stamp, tz=tz, offset=offset) + * + * @property # <<<<<<<<<<<<<< + * def _date_repr(self): + * # Ideal here would be self.strftime("%Y-%m-%d"), but + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_date_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":248 + * + * @property + * def _time_repr(self): # <<<<<<<<<<<<<< + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_15_time_repr, 0, __pyx_n_s_Timestamp__time_repr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":247 + * return '%d-%.2d-%.2d' % (self.year, self.month, self.day) + * + * @property # <<<<<<<<<<<<<< + * def _time_repr(self): + * result = '%.2d:%.2d:%.2d' % (self.hour, self.minute, self.second) + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_time_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":260 + * + * @property + * def _repr_base(self): # <<<<<<<<<<<<<< + * return '%s %s' % (self._date_repr, self._time_repr) + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_17_repr_base, 0, __pyx_n_s_Timestamp__repr_base, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":259 + * return result + * + * @property # <<<<<<<<<<<<<< + * def _repr_base(self): + * return '%s %s' % (self._date_repr, self._time_repr) + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_repr_base, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":264 + * + * @property + * def tz(self): # <<<<<<<<<<<<<< + * """ + * Alias for tzinfo + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_19tz, 0, __pyx_n_s_Timestamp_tz, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":263 + * return '%s %s' % (self._date_repr, self._time_repr) + * + * @property # <<<<<<<<<<<<<< + * def tz(self): + * """ + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":271 + * + * @property + * def freq(self): # <<<<<<<<<<<<<< + * return self.offset + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_21freq, 0, __pyx_n_s_Timestamp_freq, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":270 + * return self.tzinfo + * + * @property # <<<<<<<<<<<<<< + * def freq(self): + * return self.offset + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_freq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":274 + * return self.offset + * + * def __setstate__(self, state): # <<<<<<<<<<<<<< + * self.value = state[0] + * self.offset = state[1] + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_23__setstate__, 0, __pyx_n_s_Timestamp___setstate, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_setstate, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":279 + * self.tzinfo = state[2] + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * object_state = self.value, self.offset, self.tzinfo + * return (Timestamp, object_state) + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_25__reduce__, 0, __pyx_n_s_Timestamp___reduce, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_reduce, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":283 + * return (Timestamp, object_state) + * + * def to_period(self, freq=None): # <<<<<<<<<<<<<< + * """ + * Return an period of which this timestamp is an observation. + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_27to_period, 0, __pyx_n_s_Timestamp_to_period, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__161); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_to_period, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":295 + * + * @property + * def dayofweek(self): # <<<<<<<<<<<<<< + * return self.weekday() + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_29dayofweek, 0, __pyx_n_s_Timestamp_dayofweek, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":294 + * return Period(self, freq=freq) + * + * @property # <<<<<<<<<<<<<< + * def dayofweek(self): + * return self.weekday() + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_dayofweek, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":299 + * + * @property + * def dayofyear(self): # <<<<<<<<<<<<<< + * return self._get_field('doy') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_31dayofyear, 0, __pyx_n_s_Timestamp_dayofyear, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":298 + * return self.weekday() + * + * @property # <<<<<<<<<<<<<< + * def dayofyear(self): + * return self._get_field('doy') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_dayofyear, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":303 + * + * @property + * def week(self): # <<<<<<<<<<<<<< + * return self._get_field('woy') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_33week, 0, __pyx_n_s_Timestamp_week, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":302 + * return self._get_field('doy') + * + * @property # <<<<<<<<<<<<<< + * def week(self): + * return self._get_field('woy') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_week, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":306 + * return self._get_field('woy') + * + * weekofyear = week # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_week); + if (unlikely(!__pyx_t_9)) { + PyErr_Clear(); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_week); + } + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_weekofyear, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":309 + * + * @property + * def quarter(self): # <<<<<<<<<<<<<< + * return self._get_field('q') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_35quarter, 0, __pyx_n_s_Timestamp_quarter, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":308 + * weekofyear = week + * + * @property # <<<<<<<<<<<<<< + * def quarter(self): + * return self._get_field('q') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_quarter, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":313 + * + * @property + * def freqstr(self): # <<<<<<<<<<<<<< + * return getattr(self.offset, 'freqstr', self.offset) + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_37freqstr, 0, __pyx_n_s_Timestamp_freqstr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":312 + * return self._get_field('q') + * + * @property # <<<<<<<<<<<<<< + * def freqstr(self): + * return getattr(self.offset, 'freqstr', self.offset) + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_freqstr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":317 + * + * @property + * def asm8(self): # <<<<<<<<<<<<<< + * return np.int64(self.value).view('M8[ns]') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_39asm8, 0, __pyx_n_s_Timestamp_asm8, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":316 + * return getattr(self.offset, 'freqstr', self.offset) + * + * @property # <<<<<<<<<<<<<< + * def asm8(self): + * return np.int64(self.value).view('M8[ns]') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_asm8, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":321 + * + * @property + * def is_month_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_start') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_41is_month_start, 0, __pyx_n_s_Timestamp_is_month_start, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":320 + * return np.int64(self.value).view('M8[ns]') + * + * @property # <<<<<<<<<<<<<< + * def is_month_start(self): + * return self._get_start_end_field('is_month_start') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_month_start, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":325 + * + * @property + * def is_month_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_month_end') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_43is_month_end, 0, __pyx_n_s_Timestamp_is_month_end, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":324 + * return self._get_start_end_field('is_month_start') + * + * @property # <<<<<<<<<<<<<< + * def is_month_end(self): + * return self._get_start_end_field('is_month_end') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_month_end, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":329 + * + * @property + * def is_quarter_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_start') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_45is_quarter_start, 0, __pyx_n_s_Timestamp_is_quarter_start, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":328 + * return self._get_start_end_field('is_month_end') + * + * @property # <<<<<<<<<<<<<< + * def is_quarter_start(self): + * return self._get_start_end_field('is_quarter_start') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_quarter_start, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":333 + * + * @property + * def is_quarter_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_quarter_end') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_47is_quarter_end, 0, __pyx_n_s_Timestamp_is_quarter_end, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":332 + * return self._get_start_end_field('is_quarter_start') + * + * @property # <<<<<<<<<<<<<< + * def is_quarter_end(self): + * return self._get_start_end_field('is_quarter_end') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_quarter_end, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":337 + * + * @property + * def is_year_start(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_start') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_49is_year_start, 0, __pyx_n_s_Timestamp_is_year_start, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":336 + * return self._get_start_end_field('is_quarter_end') + * + * @property # <<<<<<<<<<<<<< + * def is_year_start(self): + * return self._get_start_end_field('is_year_start') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_year_start, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":341 + * + * @property + * def is_year_end(self): # <<<<<<<<<<<<<< + * return self._get_start_end_field('is_year_end') + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_51is_year_end, 0, __pyx_n_s_Timestamp_is_year_end, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":340 + * return self._get_start_end_field('is_year_start') + * + * @property # <<<<<<<<<<<<<< + * def is_year_end(self): + * return self._get_start_end_field('is_year_end') + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_is_year_end, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":344 + * return self._get_start_end_field('is_year_end') + * + * def tz_localize(self, tz, infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Convert naive Timestamp to local time zone + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_53tz_localize, 0, __pyx_n_s_Timestamp_tz_localize, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__188); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_tz_localize, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":368 + * 'tz_convert for conversions') + * + * def tz_convert(self, tz): # <<<<<<<<<<<<<< + * """ + * Convert Timestamp to another time zone or localize to requested time + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_55tz_convert, 0, __pyx_n_s_Timestamp_tz_convert, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_tz_convert, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":389 + * return Timestamp(self.value, tz=tz) + * + * astimezone = tz_convert # <<<<<<<<<<<<<< + * + * def replace(self, **kwds): + */ + __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_tz_convert); + if (unlikely(!__pyx_t_9)) { + PyErr_Clear(); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_tz_convert); + } + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_astimezone, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":391 + * astimezone = tz_convert + * + * def replace(self, **kwds): # <<<<<<<<<<<<<< + * return Timestamp(datetime.replace(self, **kwds), + * offset=self.offset) + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_57replace, 0, __pyx_n_s_Timestamp_replace, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_replace, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":395 + * offset=self.offset) + * + * def to_pydatetime(self, warn=True): # <<<<<<<<<<<<<< + * """ + * If warn=True, issue warning if nanoseconds is nonzero + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_59to_pydatetime, 0, __pyx_n_s_Timestamp_to_pydatetime, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__195); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_to_pydatetime, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":411 + * ts.dts.us, ts.tzinfo) + * + * def isoformat(self, sep='T'): # <<<<<<<<<<<<<< + * base = super(_Timestamp, self).isoformat(sep=sep) + * if self.nanosecond == 0: + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_61isoformat, 0, __pyx_n_s_Timestamp_isoformat, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__198); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_isoformat, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":428 + * return base1 + base2 + * + * def _has_time_component(self): # <<<<<<<<<<<<<< + * """ + * Returns if the Timestamp has a time component + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_63_has_time_component, 0, __pyx_n_s_Timestamp__has_time_component, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_has_time_component, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":437 + * or self.nanosecond != 0) + * + * def to_julian_date(self): # <<<<<<<<<<<<<< + * """ + * Convert TimeStamp to a Julian Date. + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9Timestamp_65to_julian_date, 0, __pyx_n_s_Timestamp_to_julian_date, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_to_julian_date, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":157 + * # Python front end to C extension type _Timestamp + * # This serves as the box for datetime64 + * class Timestamp(_Timestamp): # <<<<<<<<<<<<<< + * """TimeStamp is the pandas equivalent of python's Datetime + * and is interchangable with it in most cases. It's the type used + */ + __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Timestamp, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":462 + * )/24.0) + * + * _nat_strings = set(['NaT','nat','NAT','nan','NaN','NAN']) # <<<<<<<<<<<<<< + * class NaTType(_NaT): + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PySet_Add(__pyx_t_1, __pyx_n_s_NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_nat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_NAT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_nan) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_NaN) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_1, __pyx_n_s_NAN) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nat_strings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":463 + * + * _nat_strings = set(['NaT','nat','NAT','nan','NaN','NAN']) + * class NaTType(_NaT): # <<<<<<<<<<<<<< + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__NaT))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__NaT))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_5tslib__NaT))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_NaTType, __pyx_n_s_NaTType, (PyObject *) NULL, __pyx_n_s_pandas_tslib, __pyx_kp_s_N_ot_A_T_ime_the_time_equivalen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "pandas/tslib.pyx":466 + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + * def __new__(cls): # <<<<<<<<<<<<<< + * cdef _NaT base + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_NaTType___new, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":475 + * return base + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_3__repr__, 0, __pyx_n_s_NaTType___repr, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_repr, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":478 + * return 'NaT' + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'NaT' + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_5__str__, 0, __pyx_n_s_NaTType___str, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":481 + * return 'NaT' + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return iNaT + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_7__hash__, 0, __pyx_n_s_NaTType___hash, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_hash, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":484 + * return iNaT + * + * def __int__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_9__int__, 0, __pyx_n_s_NaTType___int, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_int, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":487 + * return NPY_NAT + * + * def __long__(self): # <<<<<<<<<<<<<< + * return NPY_NAT + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_11__long__, 0, __pyx_n_s_NaTType___long, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_long_2, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":490 + * return NPY_NAT + * + * def weekday(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_13weekday, 0, __pyx_n_s_NaTType_weekday, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_weekday, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":493 + * return -1 + * + * def toordinal(self): # <<<<<<<<<<<<<< + * return -1 + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_15toordinal, 0, __pyx_n_s_NaTType_toordinal, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_toordinal, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":496 + * return -1 + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * return (__nat_unpickle, (None, )) + * + */ + __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_7NaTType_17__reduce__, 0, __pyx_n_s_NaTType___reduce, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_reduce, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":463 + * + * _nat_strings = set(['NaT','nat','NAT','nan','NaN','NAN']) + * class NaTType(_NaT): # <<<<<<<<<<<<<< + * """(N)ot-(A)-(T)ime, the time equivalent of NaN""" + * + */ + __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_NaTType, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaTType, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":499 + * return (__nat_unpickle, (None, )) + * + * fields = ['year', 'quarter', 'month', 'day', 'hour', # <<<<<<<<<<<<<< + * 'minute', 'second', 'microsecond', 'nanosecond', + * 'week', 'dayofyear'] + */ + __pyx_t_1 = PyList_New(11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_year); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_year); + __Pyx_GIVEREF(__pyx_n_s_year); + __Pyx_INCREF(__pyx_n_s_quarter); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_quarter); + __Pyx_GIVEREF(__pyx_n_s_quarter); + __Pyx_INCREF(__pyx_n_s_month); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_month); + __Pyx_GIVEREF(__pyx_n_s_month); + __Pyx_INCREF(__pyx_n_s_day); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_day); + __Pyx_GIVEREF(__pyx_n_s_day); + __Pyx_INCREF(__pyx_n_s_hour); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_hour); + __Pyx_GIVEREF(__pyx_n_s_hour); + __Pyx_INCREF(__pyx_n_s_minute); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_minute); + __Pyx_GIVEREF(__pyx_n_s_minute); + __Pyx_INCREF(__pyx_n_s_second); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_second); + __Pyx_GIVEREF(__pyx_n_s_second); + __Pyx_INCREF(__pyx_n_s_microsecond); + PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_microsecond); + __Pyx_GIVEREF(__pyx_n_s_microsecond); + __Pyx_INCREF(__pyx_n_s_nanosecond); + PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_nanosecond); + __Pyx_GIVEREF(__pyx_n_s_nanosecond); + __Pyx_INCREF(__pyx_n_s_week); + PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_week); + __Pyx_GIVEREF(__pyx_n_s_week); + __Pyx_INCREF(__pyx_n_s_dayofyear); + PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_dayofyear); + __Pyx_GIVEREF(__pyx_n_s_dayofyear); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fields, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":502 + * 'minute', 'second', 'microsecond', 'nanosecond', + * 'week', 'dayofyear'] + * for field in fields: # <<<<<<<<<<<<<< + * prop = property(fget=lambda self: -1) + * setattr(NaTType, field, prop) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_12(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if (PyDict_SetItem(__pyx_d, __pyx_n_s_field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":503 + * 'week', 'dayofyear'] + * for field in fields: + * prop = property(fget=lambda self: -1) # <<<<<<<<<<<<<< + * setattr(NaTType, field, prop) + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_100lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fget, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_prop, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pandas/tslib.pyx":504 + * for field in fields: + * prop = property(fget=lambda self: -1) + * setattr(NaTType, field, prop) # <<<<<<<<<<<<<< + * + * def __nat_unpickle(*args): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaTType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_prop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = PyObject_SetAttr(__pyx_t_3, __pyx_t_1, __pyx_t_9); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":506 + * setattr(NaTType, field, prop) + * + * def __nat_unpickle(*args): # <<<<<<<<<<<<<< + * # return constant defined in the module + * return NaT + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_3__nat_unpickle, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nat_unpickle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":510 + * return NaT + * + * NaT = NaTType() # <<<<<<<<<<<<<< + * + * iNaT = util.get_nat() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NaTType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NaT, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":512 + * NaT = NaTType() + * + * iNaT = util.get_nat() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __Pyx_PyInt_From_npy_int64(get_nat()); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_iNaT, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":530 + * return ', tz=%s' % zone + * + * def is_timestamp_array(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef int i, n = len(values) + * if n == 0: + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_5is_timestamp_array, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_timestamp_array, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":566 + * # These are defined as magic numbers due to strange + * # wraparound behavior when using the true int64 lower boundary + * cdef int64_t _NS_LOWER_BOUND = -9223285636854775000LL # <<<<<<<<<<<<<< + * cdef int64_t _NS_UPPER_BOUND = 9223372036854775807LL + * + */ + __pyx_v_6pandas_5tslib__NS_LOWER_BOUND = -9223285636854775000LL; + + /* "pandas/tslib.pyx":567 + * # wraparound behavior when using the true int64 lower boundary + * cdef int64_t _NS_LOWER_BOUND = -9223285636854775000LL + * cdef int64_t _NS_UPPER_BOUND = 9223372036854775807LL # <<<<<<<<<<<<<< + * + * cdef pandas_datetimestruct _NS_MIN_DTS, _NS_MAX_DTS + */ + __pyx_v_6pandas_5tslib__NS_UPPER_BOUND = 9223372036854775807LL; + + /* "pandas/tslib.pyx":570 + * + * cdef pandas_datetimestruct _NS_MIN_DTS, _NS_MAX_DTS + * pandas_datetime_to_datetimestruct(_NS_LOWER_BOUND, PANDAS_FR_ns, &_NS_MIN_DTS) # <<<<<<<<<<<<<< + * pandas_datetime_to_datetimestruct(_NS_UPPER_BOUND, PANDAS_FR_ns, &_NS_MAX_DTS) + * + */ + pandas_datetime_to_datetimestruct(__pyx_v_6pandas_5tslib__NS_LOWER_BOUND, PANDAS_FR_ns, (&__pyx_v_6pandas_5tslib__NS_MIN_DTS)); + + /* "pandas/tslib.pyx":571 + * cdef pandas_datetimestruct _NS_MIN_DTS, _NS_MAX_DTS + * pandas_datetime_to_datetimestruct(_NS_LOWER_BOUND, PANDAS_FR_ns, &_NS_MIN_DTS) + * pandas_datetime_to_datetimestruct(_NS_UPPER_BOUND, PANDAS_FR_ns, &_NS_MAX_DTS) # <<<<<<<<<<<<<< + * + * Timestamp.min = Timestamp(_NS_LOWER_BOUND) + */ + pandas_datetime_to_datetimestruct(__pyx_v_6pandas_5tslib__NS_UPPER_BOUND, PANDAS_FR_ns, (&__pyx_v_6pandas_5tslib__NS_MAX_DTS)); + + /* "pandas/tslib.pyx":573 + * pandas_datetime_to_datetimestruct(_NS_UPPER_BOUND, PANDAS_FR_ns, &_NS_MAX_DTS) + * + * Timestamp.min = Timestamp(_NS_LOWER_BOUND) # <<<<<<<<<<<<<< + * Timestamp.max = Timestamp(_NS_UPPER_BOUND) + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib__NS_LOWER_BOUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":574 + * + * Timestamp.min = Timestamp(_NS_LOWER_BOUND) + * Timestamp.max = Timestamp(_NS_UPPER_BOUND) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_6pandas_5tslib__NS_UPPER_BOUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_PyObject_SetAttrStr(__pyx_t_9, __pyx_n_s_max, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":580 + * # Frequency inference + * + * def unique_deltas(ndarray[int64_t] arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(arr) + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_9unique_deltas, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_deltas, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":608 + * + * + * def apply_offset(ndarray[object] values, object offset): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_11apply_offset, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_offset, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":635 + * cdef int _reverse_ops[6] + * + * _reverse_ops[Py_LT] = Py_GT # <<<<<<<<<<<<<< + * _reverse_ops[Py_LE] = Py_GE + * _reverse_ops[Py_EQ] = Py_EQ + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_LT]) = Py_GT; + + /* "pandas/tslib.pyx":636 + * + * _reverse_ops[Py_LT] = Py_GT + * _reverse_ops[Py_LE] = Py_GE # <<<<<<<<<<<<<< + * _reverse_ops[Py_EQ] = Py_EQ + * _reverse_ops[Py_NE] = Py_NE + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_LE]) = Py_GE; + + /* "pandas/tslib.pyx":637 + * _reverse_ops[Py_LT] = Py_GT + * _reverse_ops[Py_LE] = Py_GE + * _reverse_ops[Py_EQ] = Py_EQ # <<<<<<<<<<<<<< + * _reverse_ops[Py_NE] = Py_NE + * _reverse_ops[Py_GT] = Py_LT + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_EQ]) = Py_EQ; + + /* "pandas/tslib.pyx":638 + * _reverse_ops[Py_LE] = Py_GE + * _reverse_ops[Py_EQ] = Py_EQ + * _reverse_ops[Py_NE] = Py_NE # <<<<<<<<<<<<<< + * _reverse_ops[Py_GT] = Py_LT + * _reverse_ops[Py_GE] = Py_LE + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_NE]) = Py_NE; + + /* "pandas/tslib.pyx":639 + * _reverse_ops[Py_EQ] = Py_EQ + * _reverse_ops[Py_NE] = Py_NE + * _reverse_ops[Py_GT] = Py_LT # <<<<<<<<<<<<<< + * _reverse_ops[Py_GE] = Py_LE + * + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_GT]) = Py_LT; + + /* "pandas/tslib.pyx":640 + * _reverse_ops[Py_NE] = Py_NE + * _reverse_ops[Py_GT] = Py_LT + * _reverse_ops[Py_GE] = Py_LE # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_6pandas_5tslib__reverse_ops[Py_GE]) = Py_LE; + + /* "pandas/tslib.pyx":643 + * + * + * cdef str _NDIM_STRING = "ndim" # <<<<<<<<<<<<<< + * + * # This is PITA. Because we inherit from datetime, which has very specific + */ + __Pyx_INCREF(__pyx_n_s_ndim); + __Pyx_XGOTREF(__pyx_v_6pandas_5tslib__NDIM_STRING); + __Pyx_DECREF_SET(__pyx_v_6pandas_5tslib__NDIM_STRING, __pyx_n_s_ndim); + __Pyx_GIVEREF(__pyx_n_s_ndim); + + /* "pandas/tslib.pyx":787 + * + * + * cdef PyTypeObject* ts_type = Timestamp # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_6pandas_5tslib_ts_type = ((PyTypeObject *)__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":796 + * cdef bint _nat_scalar_rules[6] + * + * _nat_scalar_rules[Py_EQ] = False # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_NE] = True + * _nat_scalar_rules[Py_LT] = False + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_EQ]) = 0; + + /* "pandas/tslib.pyx":797 + * + * _nat_scalar_rules[Py_EQ] = False + * _nat_scalar_rules[Py_NE] = True # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_LT] = False + * _nat_scalar_rules[Py_LE] = False + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_NE]) = 1; + + /* "pandas/tslib.pyx":798 + * _nat_scalar_rules[Py_EQ] = False + * _nat_scalar_rules[Py_NE] = True + * _nat_scalar_rules[Py_LT] = False # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_LE] = False + * _nat_scalar_rules[Py_GT] = False + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_LT]) = 0; + + /* "pandas/tslib.pyx":799 + * _nat_scalar_rules[Py_NE] = True + * _nat_scalar_rules[Py_LT] = False + * _nat_scalar_rules[Py_LE] = False # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_GT] = False + * _nat_scalar_rules[Py_GE] = False + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_LE]) = 0; + + /* "pandas/tslib.pyx":800 + * _nat_scalar_rules[Py_LT] = False + * _nat_scalar_rules[Py_LE] = False + * _nat_scalar_rules[Py_GT] = False # <<<<<<<<<<<<<< + * _nat_scalar_rules[Py_GE] = False + * + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_GT]) = 0; + + /* "pandas/tslib.pyx":801 + * _nat_scalar_rules[Py_LE] = False + * _nat_scalar_rules[Py_GT] = False + * _nat_scalar_rules[Py_GE] = False # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_6pandas_5tslib__nat_scalar_rules[Py_GE]) = 0; + + /* "pandas/tslib.pyx":845 + * + * + * def _delta_to_nanoseconds(delta): # <<<<<<<<<<<<<< + * if hasattr(delta, 'delta'): + * delta = delta.delta + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_13_delta_to_nanoseconds, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_delta_to_nanoseconds, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1024 + * + * + * def get_timezone(tz): # <<<<<<<<<<<<<< + * return _get_zone(tz) + * + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_17get_timezone, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_timezone, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1079 + * + * + * class OutOfBoundsDatetime(ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_9, __pyx_n_s_OutOfBoundsDatetime, __pyx_n_s_OutOfBoundsDatetime, (PyObject *) NULL, __pyx_n_s_pandas_tslib, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OutOfBoundsDatetime, __pyx_t_9, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutOfBoundsDatetime, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1109 + * # obj.dtval = _dts_to_pydatetime(&obj.dts) + * + * def datetime_to_datetime64(ndarray[object] values): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_21datetime_to_datetime64, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_to_datetime64, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1144 + * return result, inferred_tz + * + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) # <<<<<<<<<<<<<< + * + * def _does_string_look_like_datetime(date_string): + */ + __pyx_t_9 = PySet_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PySet_Add(__pyx_t_9, __pyx_n_s_a) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_A) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_M) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_P) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PySet_Add(__pyx_t_9, __pyx_n_s_T) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_not_datelike_strings, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1146 + * _not_datelike_strings = set(['a','A','m','M','p','P','t','T']) + * + * def _does_string_look_like_datetime(date_string): # <<<<<<<<<<<<<< + * if date_string.startswith('0'): + * # Strings starting with 0 are more consistent with a + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_23_does_string_look_like_datetime, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_does_string_look_like_datetime, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1163 + * return True + * + * def parse_datetime_string(date_string, **kwargs): # <<<<<<<<<<<<<< + * if not _does_string_look_like_datetime(date_string): + * raise ValueError('Given date string not likely a datetime.') + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_25parse_datetime_string, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_datetime_string, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1170 + * return dt + * + * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False, # <<<<<<<<<<<<<< + * format=None, utc=None, coerce=False, unit=None): + * cdef: + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_27array_to_datetime, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_to_datetime, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1344 + * return oresult + * + * def array_to_timedelta64(ndarray[object] values, unit='ns', coerce=False): # <<<<<<<<<<<<<< + * """ convert an ndarray to an array of ints that are timedeltas + * force conversion if coerce = True, + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_29array_to_timedelta64, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_to_timedelta64, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1360 + * return iresult + * + * def convert_to_timedelta(object ts, object unit='ns', coerce=False): # <<<<<<<<<<<<<< + * return convert_to_timedelta64(ts, unit, coerce) + * + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_31convert_to_timedelta, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_to_timedelta, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1430 + * return ts.astype('timedelta64[ns]') + * + * def repr_timedelta64(object value, format=None): # <<<<<<<<<<<<<< + * """ + * provide repr for timedelta64 + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_33repr_timedelta64, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_repr_timedelta64, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1499 + * + * + * def array_strptime(ndarray[object] values, object fmt, coerce=False): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_35array_strptime, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_strptime, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1793 + * return (base*m) + (frac*m) + * + * def cast_to_nanoseconds(ndarray arr): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = arr.size + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_39cast_to_nanoseconds, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cast_to_nanoseconds, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1825 + * + * + * def pydt_to_i8(object pydt): # <<<<<<<<<<<<<< + * ''' + * Convert to int64 representation compatible with numpy datetime64; converts + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_41pydt_to_i8, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydt_to_i8, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1837 + * return ts.value + * + * def i8_to_pydt(int64_t i8, object tzinfo = None): # <<<<<<<<<<<<<< + * ''' + * Inverse of pydt_to_i8 + */ + __pyx_t_9 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_43i8_to_pydt, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_i8_to_pydt, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1846 + * # time zone conversion helpers + * + * try: # <<<<<<<<<<<<<< + * import pytz + * UTC = pytz.utc + */ + { + __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "pandas/tslib.pyx":1847 + * + * try: + * import pytz # <<<<<<<<<<<<<< + * UTC = pytz.utc + * have_pytz = True + */ + __pyx_t_9 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":1848 + * try: + * import pytz + * UTC = pytz.utc # <<<<<<<<<<<<<< + * have_pytz = True + * except: + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pytz); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_utc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTC, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1849 + * import pytz + * UTC = pytz.utc + * have_pytz = True # <<<<<<<<<<<<<< + * except: + * have_pytz = False + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_pytz, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + } + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L21_try_end; + __pyx_L14_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1850 + * UTC = pytz.utc + * have_pytz = True + * except: # <<<<<<<<<<<<<< + * have_pytz = False + * + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_1); + + /* "pandas/tslib.pyx":1851 + * have_pytz = True + * except: + * have_pytz = False # <<<<<<<<<<<<<< + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_pytz, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L15_exception_handled; + } + __pyx_L16_except_error:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L15_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5); + __pyx_L21_try_end:; + } + + /* "pandas/tslib.pyx":1853 + * have_pytz = False + * + * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] utc_dates, result, trans, deltas + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_45tz_convert, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tz_convert, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1934 + * return result + * + * def tz_convert_single(int64_t val, object tz1, object tz2): # <<<<<<<<<<<<<< + * cdef: + * ndarray[int64_t] trans, deltas + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_47tz_convert_single, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tz_convert_single, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1984 + * + * # Timezone data caches, key is the pytz string or dateutil file name. + * trans_cache = {} # <<<<<<<<<<<<<< + * utc_offset_cache = {} + * + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_trans_cache, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1985 + * # Timezone data caches, key is the pytz string or dateutil file name. + * trans_cache = {} + * utc_offset_cache = {} # <<<<<<<<<<<<<< + * + * cdef inline bint _treat_tz_as_pytz(object tz): + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc_offset_cache, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":1994 + * + * + * def _p_tz_cache_key(tz): # <<<<<<<<<<<<<< + * ''' Python interface for cache function to facilitate testing.''' + * return _tz_cache_key(tz) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_49_p_tz_cache_key, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_p_tz_cache_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2108 + * 10**6) + * + * def tot_seconds(td): # <<<<<<<<<<<<<< + * return total_seconds(td) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_51tot_seconds, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tot_seconds, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2127 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False): # <<<<<<<<<<<<<< + * """ + * Localize tzinfo-naive DateRange to given time zone (using pytz). If + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_55tz_localize_to_utc, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_tz_localize_to_utc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2300 + * #---------------------------------------------------------------------- + * + * def build_field_sarray(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_57build_field_sarray, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_build_field_sarray, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2342 + * return out + * + * def get_time_micros(ndarray[int64_t] dtindex): # <<<<<<<<<<<<<< + * ''' + * Datetime as int64 representation to a structured array of fields + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_59get_time_micros, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_time_micros, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2361 + * + * @cython.wraparound(False) + * def get_date_field(ndarray[int64_t] dtindex, object field): # <<<<<<<<<<<<<< + * ''' + * Given a int64-based datetime index, extract the year, month, etc., + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_61get_date_field, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_date_field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2505 + * + * @cython.wraparound(False) + * def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=None, int month_kw=12): # <<<<<<<<<<<<<< + * ''' + * Given an int64-based datetime index return array of indicators + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_63get_start_end_field, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_start_end_field_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2727 + * return ts_dayofweek(ts) + * + * cdef int64_t DAY_NS = 86400000000000LL # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6pandas_5tslib_DAY_NS = 86400000000000LL; + + /* "pandas/tslib.pyx":2730 + * + * + * def date_normalize(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_65date_normalize, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_date_normalize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2824 + * + * + * def dates_normalized(ndarray[int64_t] stamps, tz=None): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(stamps) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_67dates_normalized, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dates_normalized, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2862 + * #---------------------------------------------------------------------- + * + * def isleapyear(int64_t year): # <<<<<<<<<<<<<< + * return is_leapyear(year) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_69isleapyear, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_isleapyear, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":2865 + * return is_leapyear(year) + * + * def monthrange(int64_t year, int64_t month): # <<<<<<<<<<<<<< + * cdef: + * int64_t days + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_71monthrange, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_monthrange, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3019 + * int get_yq(int64_t ordinal, int freq, int *quarter, int *year) + * + * initialize_daytime_conversion_factor_matrix() # <<<<<<<<<<<<<< + * + * # Period logic + */ + initialize_daytime_conversion_factor_matrix(); + + /* "pandas/tslib.pyx":3044 + * return period_ord_w_mult * mult + 1; + * + * def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): # <<<<<<<<<<<<<< + * """ + * Convert array of datetime64 values (passed in as 'i8' dtype) to a set of + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_75dt64arr_to_periodarr, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt64arr_to_periodarr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3070 + * return out + * + * def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): # <<<<<<<<<<<<<< + * """ + * Convert array to datetime64 values from a set of ordinals corresponding to + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_77periodarr_to_dt64arr, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_periodarr_to_dt64arr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3091 + * return out + * + * cdef char START = 'S' # <<<<<<<<<<<<<< + * cdef char END = 'E' + * + */ + __pyx_v_6pandas_5tslib_START = 'S'; + + /* "pandas/tslib.pyx":3092 + * + * cdef char START = 'S' + * cdef char END = 'E' # <<<<<<<<<<<<<< + * + * cpdef int64_t period_asfreq(int64_t period_ordinal, int freq1, int freq2, + */ + __pyx_v_6pandas_5tslib_END = 'E'; + + /* "pandas/tslib.pyx":3116 + * return retval + * + * def period_asfreq_arr(ndarray[int64_t] arr, int freq1, int freq2, bint end): # <<<<<<<<<<<<<< + * """ + * Convert int64-array of period ordinals from one frequency to another, and + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_81period_asfreq_arr, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_period_asfreq_arr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3158 + * return result + * + * def period_ordinal(int y, int m, int d, int h, int min, int s, int us, int ps, int freq): # <<<<<<<<<<<<<< + * cdef: + * int64_t ordinal + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_83period_ordinal, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_period_ordinal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3188 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts) + * + * def period_format(int64_t value, int freq, object fmt=None): # <<<<<<<<<<<<<< + * cdef: + * int freq_group + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_87period_format, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_period_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3229 + * + * + * cdef list extra_fmts = [(b"%q", b"^`AB`^"), # <<<<<<<<<<<<<< + * (b"%f", b"^`CD`^"), + * (b"%F", b"^`EF`^"), + */ + __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_tuple__291); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_tuple__291); + __Pyx_GIVEREF(__pyx_tuple__291); + __Pyx_INCREF(__pyx_tuple__292); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_tuple__292); + __Pyx_GIVEREF(__pyx_tuple__292); + __Pyx_INCREF(__pyx_tuple__293); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_tuple__293); + __Pyx_GIVEREF(__pyx_tuple__293); + __Pyx_INCREF(__pyx_tuple__294); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_tuple__294); + __Pyx_GIVEREF(__pyx_tuple__294); + __Pyx_INCREF(__pyx_tuple__295); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_tuple__295); + __Pyx_GIVEREF(__pyx_tuple__295); + __Pyx_INCREF(__pyx_tuple__296); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_tuple__296); + __Pyx_GIVEREF(__pyx_tuple__296); + __Pyx_XGOTREF(__pyx_v_6pandas_5tslib_extra_fmts); + __Pyx_DECREF_SET(__pyx_v_6pandas_5tslib_extra_fmts, ((PyObject*)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3236 + * (b"%n", b"^`KL`^")] + * + * cdef list str_extra_fmts = ["^`AB`^", "^`CD`^", "^`EF`^", "^`GH`^", "^`IJ`^", "^`KL`^"] # <<<<<<<<<<<<<< + * + * cdef object _period_strftime(int64_t value, int freq, object fmt): + */ + __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_AB); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_AB); + __Pyx_GIVEREF(__pyx_kp_s_AB); + __Pyx_INCREF(__pyx_kp_s_CD); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_CD); + __Pyx_GIVEREF(__pyx_kp_s_CD); + __Pyx_INCREF(__pyx_kp_s_EF); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_s_EF); + __Pyx_GIVEREF(__pyx_kp_s_EF); + __Pyx_INCREF(__pyx_kp_s_GH); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_s_GH); + __Pyx_GIVEREF(__pyx_kp_s_GH); + __Pyx_INCREF(__pyx_kp_s_IJ); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_s_IJ); + __Pyx_GIVEREF(__pyx_kp_s_IJ); + __Pyx_INCREF(__pyx_kp_s_KL); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_s_KL); + __Pyx_GIVEREF(__pyx_kp_s_KL); + __Pyx_XGOTREF(__pyx_v_6pandas_5tslib_str_extra_fmts); + __Pyx_DECREF_SET(__pyx_v_6pandas_5tslib_str_extra_fmts, ((PyObject*)__pyx_t_1)); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3294 + * ctypedef int (*accessor)(int64_t ordinal, int freq) except INT32_MIN + * + * def get_period_field(int code, int64_t value, int freq): # <<<<<<<<<<<<<< + * cdef accessor f = _get_accessor_func(code) + * if f is NULL: + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_89get_period_field, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_period_field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3302 + * return f(value, freq) + * + * def get_period_field_arr(int code, ndarray[int64_t] arr, int freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, sz + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_91get_period_field_arr, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_period_field_arr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3351 + * + * + * def extract_ordinals(ndarray[object] values, freq): # <<<<<<<<<<<<<< + * cdef: + * Py_ssize_t i, n = len(values) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_93extract_ordinals, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_ordinals, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3384 + * return reso + * + * US_RESO = 0 # <<<<<<<<<<<<<< + * MS_RESO = 1 + * S_RESO = 2 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_US_RESO, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3385 + * + * US_RESO = 0 + * MS_RESO = 1 # <<<<<<<<<<<<<< + * S_RESO = 2 + * T_RESO = 3 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MS_RESO, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3386 + * US_RESO = 0 + * MS_RESO = 1 + * S_RESO = 2 # <<<<<<<<<<<<<< + * T_RESO = 3 + * H_RESO = 4 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_S_RESO, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3387 + * MS_RESO = 1 + * S_RESO = 2 + * T_RESO = 3 # <<<<<<<<<<<<<< + * H_RESO = 4 + * D_RESO = 5 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_T_RESO, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3388 + * S_RESO = 2 + * T_RESO = 3 + * H_RESO = 4 # <<<<<<<<<<<<<< + * D_RESO = 5 + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_H_RESO, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3389 + * T_RESO = 3 + * H_RESO = 4 + * D_RESO = 5 # <<<<<<<<<<<<<< + * + * cdef inline int _reso_stamp(pandas_datetimestruct *dts): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_D_RESO, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3479 + * + * """ + * import time # <<<<<<<<<<<<<< + * import locale + * import calendar + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3480 + * """ + * import time + * import locale # <<<<<<<<<<<<<< + * import calendar + * from re import compile as re_compile + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_locale, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_locale, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3481 + * import time + * import locale + * import calendar # <<<<<<<<<<<<<< + * from re import compile as re_compile + * from re import IGNORECASE + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_calendar, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calendar, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3482 + * import locale + * import calendar + * from re import compile as re_compile # <<<<<<<<<<<<<< + * from re import IGNORECASE + * from re import escape as re_escape + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_compile); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_compile); + __Pyx_GIVEREF(__pyx_n_s_compile); + __pyx_t_9 = __Pyx_Import(__pyx_n_s_re, __pyx_t_1, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_compile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":3483 + * import calendar + * from re import compile as re_compile + * from re import IGNORECASE # <<<<<<<<<<<<<< + * from re import escape as re_escape + * from datetime import date as datetime_date + */ + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_s_IGNORECASE); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_IGNORECASE); + __Pyx_GIVEREF(__pyx_n_s_IGNORECASE); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, __pyx_t_9, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_IGNORECASE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IGNORECASE, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3484 + * from re import compile as re_compile + * from re import IGNORECASE + * from re import escape as re_escape # <<<<<<<<<<<<<< + * from datetime import date as datetime_date + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_escape); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_escape); + __Pyx_GIVEREF(__pyx_n_s_escape); + __pyx_t_9 = __Pyx_Import(__pyx_n_s_re, __pyx_t_1, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_escape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_escape, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":3485 + * from re import IGNORECASE + * from re import escape as re_escape + * from datetime import date as datetime_date # <<<<<<<<<<<<<< + * + * # Python 2 vs Python 3 + */ + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_n_s_date); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_date); + __Pyx_GIVEREF(__pyx_n_s_date); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_9, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_date, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3488 + * + * # Python 2 vs Python 3 + * try: # <<<<<<<<<<<<<< + * from thread import allocate_lock as _thread_allocate_lock + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "pandas/tslib.pyx":3489 + * # Python 2 vs Python 3 + * try: + * from thread import allocate_lock as _thread_allocate_lock # <<<<<<<<<<<<<< + * except: + * try: + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L24_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_allocate_lock); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_allocate_lock); + __Pyx_GIVEREF(__pyx_n_s_allocate_lock); + __pyx_t_9 = __Pyx_Import(__pyx_n_s_thread, __pyx_t_1, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L24_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L24_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_allocate_lock, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L24_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L31_try_end; + __pyx_L24_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "pandas/tslib.pyx":3490 + * try: + * from thread import allocate_lock as _thread_allocate_lock + * except: # <<<<<<<<<<<<<< + * try: + * from _thread import allocate_lock as _thread_allocate_lock + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + + /* "pandas/tslib.pyx":3491 + * from thread import allocate_lock as _thread_allocate_lock + * except: + * try: # <<<<<<<<<<<<<< + * from _thread import allocate_lock as _thread_allocate_lock + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + /*try:*/ { + + /* "pandas/tslib.pyx":3492 + * except: + * try: + * from _thread import allocate_lock as _thread_allocate_lock # <<<<<<<<<<<<<< + * except: + * try: + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L34_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_allocate_lock); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_allocate_lock); + __Pyx_GIVEREF(__pyx_n_s_allocate_lock); + __pyx_t_10 = __Pyx_Import(__pyx_n_s_thread_2, __pyx_t_3, -1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L34_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_10, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L34_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_allocate_lock, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L34_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L41_try_end; + __pyx_L34_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "pandas/tslib.pyx":3493 + * try: + * from _thread import allocate_lock as _thread_allocate_lock + * except: # <<<<<<<<<<<<<< + * try: + * from dummy_thread import allocate_lock as _thread_allocate_lock + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_3, &__pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3493; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_17); + + /* "pandas/tslib.pyx":3494 + * from _thread import allocate_lock as _thread_allocate_lock + * except: + * try: # <<<<<<<<<<<<<< + * from dummy_thread import allocate_lock as _thread_allocate_lock + * except: + */ + { + __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + /*try:*/ { + + /* "pandas/tslib.pyx":3495 + * except: + * try: + * from dummy_thread import allocate_lock as _thread_allocate_lock # <<<<<<<<<<<<<< + * except: + * from _dummy_thread import allocate_lock as _thread_allocate_lock + */ + __pyx_t_21 = PyList_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L44_error;} + __Pyx_GOTREF(__pyx_t_21); + __Pyx_INCREF(__pyx_n_s_allocate_lock); + PyList_SET_ITEM(__pyx_t_21, 0, __pyx_n_s_allocate_lock); + __Pyx_GIVEREF(__pyx_n_s_allocate_lock); + __pyx_t_22 = __Pyx_Import(__pyx_n_s_dummy_thread, __pyx_t_21, -1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L44_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_ImportFrom(__pyx_t_22, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L44_error;} + __Pyx_GOTREF(__pyx_t_21); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_allocate_lock, __pyx_t_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L44_error;} + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + } + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + goto __pyx_L51_try_end; + __pyx_L44_error:; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; + + /* "pandas/tslib.pyx":3496 + * try: + * from dummy_thread import allocate_lock as _thread_allocate_lock + * except: # <<<<<<<<<<<<<< + * from _dummy_thread import allocate_lock as _thread_allocate_lock + * + */ + /*except:*/ { + __Pyx_AddTraceback("pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_23) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3496; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_GOTREF(__pyx_t_22); + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GOTREF(__pyx_t_23); + + /* "pandas/tslib.pyx":3497 + * from dummy_thread import allocate_lock as _thread_allocate_lock + * except: + * from _dummy_thread import allocate_lock as _thread_allocate_lock # <<<<<<<<<<<<<< + * + * __all__ = [] + */ + __pyx_t_24 = PyList_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_GOTREF(__pyx_t_24); + __Pyx_INCREF(__pyx_n_s_allocate_lock); + PyList_SET_ITEM(__pyx_t_24, 0, __pyx_n_s_allocate_lock); + __Pyx_GIVEREF(__pyx_n_s_allocate_lock); + __pyx_t_25 = __Pyx_Import(__pyx_n_s_dummy_thread_2, __pyx_t_24, -1); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_GOTREF(__pyx_t_25); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_ImportFrom(__pyx_t_25, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_allocate_lock, __pyx_t_24) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;} + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; + goto __pyx_L45_exception_handled; + } + __pyx_L46_except_error:; + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); + goto __pyx_L36_except_error; + __pyx_L45_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); + __pyx_L51_try_end:; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L35_exception_handled; + } + __pyx_L36_except_error:; + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + goto __pyx_L26_except_error; + __pyx_L35_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __pyx_L41_try_end:; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L25_exception_handled; + } + __pyx_L26_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L25_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L31_try_end:; + } + + /* "pandas/tslib.pyx":3499 + * from _dummy_thread import allocate_lock as _thread_allocate_lock + * + * __all__ = [] # <<<<<<<<<<<<<< + * + * def _getlang(): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3501 + * __all__ = [] + * + * def _getlang(): # <<<<<<<<<<<<<< + * # Figure out what the current language is set to. + * return locale.getlocale(locale.LC_TIME) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_97_getlang, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_getlang, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3505 + * return locale.getlocale(locale.LC_TIME) + * + * class LocaleTime(object): # <<<<<<<<<<<<<< + * """Stores and handles locale-specific information related to time. + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_LocaleTime, __pyx_n_s_LocaleTime, (PyObject *) NULL, __pyx_n_s_pandas_tslib, __pyx_kp_s_Stores_and_handles_locale_specif); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":3524 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * """Set all attributes. + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_1__init__, 0, __pyx_n_s_LocaleTime___init, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_init, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3553 + * raise ValueError("locale changed during initialization") + * + * def __pad(self, seq, front): # <<<<<<<<<<<<<< + * # Add '' to seq to either the front (is True), else the back. + * seq = list(seq) + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_3__pad, 0, __pyx_n_s_LocaleTime___pad, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__307)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__pad, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3562 + * return seq + * + * def __calc_weekday(self): # <<<<<<<<<<<<<< + * # Set self.a_weekday and self.f_weekday using the calendar + * # module. + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_5__calc_weekday, 0, __pyx_n_s_LocaleTime___calc_weekday, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_weekday, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3570 + * self.f_weekday = f_weekday + * + * def __calc_month(self): # <<<<<<<<<<<<<< + * # Set self.f_month and self.a_month using the calendar module. + * a_month = [calendar.month_abbr[i].lower() for i in range(13)] + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_7__calc_month, 0, __pyx_n_s_LocaleTime___calc_month, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_month, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3577 + * self.f_month = f_month + * + * def __calc_am_pm(self): # <<<<<<<<<<<<<< + * # Set self.am_pm by using time.strftime(). + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_9__calc_am_pm, 0, __pyx_n_s_LocaleTime___calc_am_pm, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_am_pm, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3589 + * self.am_pm = am_pm + * + * def __calc_date_time(self): # <<<<<<<<<<<<<< + * # Set self.date_time, self.date, & self.time by using + * # time.strftime(). + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_11__calc_date_time, 0, __pyx_n_s_LocaleTime___calc_date_time, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_date_time, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3634 + * self.LC_time = date_time[2] + * + * def __calc_timezone(self): # <<<<<<<<<<<<<< + * # Set self.timezone by using time.tzname. + * # Do not worry about possibility of time.tzname[0] == timetzname[1] + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_10LocaleTime_13__calc_timezone, 0, __pyx_n_s_LocaleTime___calc_timezone, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_LocaleTime__calc_timezone, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3505 + * return locale.getlocale(locale.LC_TIME) + * + * class LocaleTime(object): # <<<<<<<<<<<<<< + * """Stores and handles locale-specific information related to time. + * + */ + __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LocaleTime, __pyx_t_2, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LocaleTime, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3650 + * + * + * class TimeRE(dict): # <<<<<<<<<<<<<< + * """Handle conversion from format directives to regexes.""" + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyDict_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyDict_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyDict_Type)))); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_TimeRE, __pyx_n_s_TimeRE, (PyObject *) NULL, __pyx_n_s_pandas_tslib, __pyx_kp_s_Handle_conversion_from_format_di); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + + /* "pandas/tslib.pyx":3653 + * """Handle conversion from format directives to regexes.""" + * + * def __init__(self, locale_time=None): # <<<<<<<<<<<<<< + * """Create keys/values. + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_6TimeRE_1__init__, 0, __pyx_n_s_TimeRE___init, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__319)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_17, __pyx_tuple__320); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_init, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3695 + * base.__setitem__('X', self.pattern(self.locale_time.LC_time)) + * + * def __seqToRE(self, to_convert, directive): # <<<<<<<<<<<<<< + * """Convert a list to a regex string for matching a directive. + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_6TimeRE_3__seqToRE, 0, __pyx_n_s_TimeRE___seqToRE, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_TimeRE__seqToRE, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3714 + * return '%s)' % regex + * + * def pattern(self, format): # <<<<<<<<<<<<<< + * """Return regex pattern for the format string. + * + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_6TimeRE_5pattern, 0, __pyx_n_s_TimeRE_pattern, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_pattern, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3737 + * return "%s%s" % (processed_format, format) + * + * def compile(self, format): # <<<<<<<<<<<<<< + * """Return a compiled re object for the format string.""" + * return re_compile(self.pattern(format), IGNORECASE) + */ + __pyx_t_17 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_5tslib_6TimeRE_7compile, 0, __pyx_n_s_TimeRE_compile, NULL, __pyx_n_s_pandas_tslib, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_compile, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "pandas/tslib.pyx":3650 + * + * + * class TimeRE(dict): # <<<<<<<<<<<<<< + * """Handle conversion from format directives to regexes.""" + * + */ + __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_TimeRE, __pyx_t_2, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_17); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeRE, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3741 + * return re_compile(self.pattern(format), IGNORECASE) + * + * _cache_lock = _thread_allocate_lock() # <<<<<<<<<<<<<< + * # DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock + * # first! + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_thread_allocate_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cache_lock, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pandas/tslib.pyx":3744 + * # DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock + * # first! + * _TimeRE_cache = TimeRE() # <<<<<<<<<<<<<< + * _CACHE_MAX_SIZE = 5 # Max number of regexes stored in _regex_cache + * _regex_cache = {} + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeRE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeRE_cache, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3745 + * # first! + * _TimeRE_cache = TimeRE() + * _CACHE_MAX_SIZE = 5 # Max number of regexes stored in _regex_cache # <<<<<<<<<<<<<< + * _regex_cache = {} + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CACHE_MAX_SIZE, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "pandas/tslib.pyx":3746 + * _TimeRE_cache = TimeRE() + * _CACHE_MAX_SIZE = 5 # Max number of regexes stored in _regex_cache + * _regex_cache = {} # <<<<<<<<<<<<<< + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_regex_cache, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":3748 + * _regex_cache = {} + * + * def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): # <<<<<<<<<<<<<< + * """Calculate the Julian day based on the year, week of the year, and day of + * the week, with week_start_day representing whether the week of the year + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5tslib_99_calc_julian_from_U_or_W, NULL, __pyx_n_s_pandas_tslib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_julian_from_U_or_W, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pandas/tslib.pyx":1 + * # cython: profile=False # <<<<<<<<<<<<<< + * + * cimport numpy as np + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "datetime.pxd":185 + * return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts) + * + * cdef inline int64_t _date_to_datetime64(object val, # <<<<<<<<<<<<<< + * pandas_datetimestruct *dts): + * dts.year = PyDateTime_GET_YEAR(val) + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_22); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_XDECREF(__pyx_t_24); + __Pyx_XDECREF(__pyx_t_25); + if (__pyx_m) { + __Pyx_AddTraceback("init pandas.tslib", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pandas.tslib"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); +} +static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 + else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(PyObject_TypeCheck(obj, type))) return 1; + } + __Pyx_RaiseArgumentTypeInvalid(name, obj, type); + return 0; +} + +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { + unsigned int n = 1; + return *(unsigned char*)(&n) != 0; +} +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) /* First char was not a digit */ + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; /* Consume from buffer string */ + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; /* breaks both loops as ctx->enc_count == 0 */ + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; /* empty struct */ + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static CYTHON_INLINE PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_IsLittleEndian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': /* substruct */ + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': /* end of substruct; either repeat or move on */ + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; /* Erase processed last struct element */ + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static CYTHON_INLINE int __Pyx_GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + if (obj == Py_None || obj == NULL) { + __Pyx_ZeroBuffer(buf); + return 0; + } + buf->buf = NULL; + if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; + if (buf->ndim != nd) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned)buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_ZeroBuffer(buf); + return -1; +} +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (info->buf == NULL) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(PyObject_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) + goto bad; + PyErr_Clear(); + r = d; + Py_INCREF(d); + } + return r; +bad: + return NULL; +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +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, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) { + __pyx_t_5numpy_int64_t r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +static void __Pyx_RaiseBufferFallbackError(void) { + PyErr_SetString(PyExc_ValueError, + "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); +} + +static double __Pyx__PyObject_AsDouble(PyObject* obj) { + PyObject* float_value; +#if CYTHON_COMPILING_IN_PYPY + float_value = PyNumber_Float(obj); +#else + PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; + if (likely(nb) && likely(nb->nb_float)) { + float_value = nb->nb_float(obj); + if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { + PyErr_Format(PyExc_TypeError, + "__float__ returned non-float (type %.200s)", + Py_TYPE(float_value)->tp_name); + Py_DECREF(float_value); + goto bad; + } + } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { +#if PY_MAJOR_VERSION >= 3 + float_value = PyFloat_FromString(obj); +#else + float_value = PyFloat_FromString(obj, 0); +#endif + } else { + PyObject* args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + PyTuple_SET_ITEM(args, 0, obj); + float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); + PyTuple_SET_ITEM(args, 0, 0); + Py_DECREF(args); + } +#endif + if (likely(float_value)) { + double value = PyFloat_AS_DOUBLE(float_value); + Py_DECREF(float_value); + return value; + } +bad: + return (double)-1; +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int is_tuple, int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + } else { + if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { + __Pyx_UnpackTupleError(tuple, 2); + goto bad; + } +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); + if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); + if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); + value2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(value1); + Py_INCREF(value2); +#endif + if (decref_tuple) { Py_DECREF(tuple); } + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; +#if !CYTHON_COMPILING_IN_PYPY + if (is_dict) { + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#endif + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { + long r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) { + __pyx_t_5numpy_int64_t q = a / b; + __pyx_t_5numpy_int64_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *getbuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer); + if (getbuffer_cobj) { + getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj); + Py_DECREF(getbuffer_cobj); + if (!func) + goto fail; + return func(obj, view, flags); + } else { + PyErr_Clear(); + } + } + #endif + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + #if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + #endif + if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; } + #if PY_VERSION_HEX < 0x02060000 + if (obj->ob_type->tp_dict) { + PyObject *releasebuffer_cobj = PyObject_GetItem( + obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer); + if (releasebuffer_cobj) { + releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj); + Py_DECREF(releasebuffer_cobj); + if (!func) + goto fail; + func(obj, view); + return; + } else { + PyErr_Clear(); + } + } + #endif + goto nofail; +#if PY_VERSION_HEX < 0x02060000 +fail: +#endif + PyErr_WriteUnraisable(obj); +nofail: + Py_DECREF(obj); + view->obj = NULL; +} +#endif /* PY_MAJOR_VERSION < 3 */ + + + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; + } + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int64)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int64) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong) + } else if (sizeof(npy_int64) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int32) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(npy_int32) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int32) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); + } +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) { + const npy_int32 neg_one = (npy_int32) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int32) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + return (npy_int32) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int32"); + return (npy_int32) -1; + } + if (sizeof(npy_int32) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(npy_int32)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(npy_int32) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(npy_int32) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong) + } else if (sizeof(npy_int32) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(npy_int32, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int32) -1; + } + } else { + npy_int32 val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (npy_int32) -1; + val = __Pyx_PyInt_As_npy_int32(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { +#if CYTHON_COMPILING_IN_PYPY + if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { /* cdef classes */ + return PyClassMethod_New(method); + } +#else + static PyTypeObject *methoddescr_type = NULL; + if (methoddescr_type == NULL) { + PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append"); + if (!meth) return NULL; + methoddescr_type = Py_TYPE(meth); + Py_DECREF(meth); + } + if (PyObject_TypeCheck(method, methoddescr_type)) { /* cdef classes */ + PyMethodDescrObject *descr = (PyMethodDescrObject *)method; + #if PY_VERSION_HEX < 0x03020000 + PyTypeObject *d_type = descr->d_type; + #else + PyTypeObject *d_type = descr->d_common.d_type; + #endif + return PyDescr_NewClassMethod(d_type, descr->d_method); + } +#endif + else if (PyMethod_Check(method)) { /* python classes */ + return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); + } + else if (PyCFunction_Check(method)) { + return PyClassMethod_New(method); + } +#ifdef __Pyx_CyFunction_USED + else if (PyObject_TypeCheck(method, __pyx_CyFunctionType)) { + return PyClassMethod_New(method); + } +#endif + PyErr_SetString(PyExc_TypeError, + "Class-level classmethod() can only be called on " + "a method_descriptor or instance method."); + return NULL; +} + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +#if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double denom = b.real * b.real + b.imag * b.imag; + z.real = (a.real * b.real + a.imag * b.imag) / denom; + z.imag = (a.imag * b.real - a.real * b.imag) / denom; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} + +static PyObject *__Pyx_Generator_Next(PyObject *self); +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Generator_Close(PyObject *self); +static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args); +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (unlikely(et != PyExc_StopIteration) && + unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + if (likely(et == PyExc_StopIteration)) { + if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + ev = Py_None; + } + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = ev; + return 0; + } + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PyObject_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +#endif +static CYTHON_INLINE +void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) { + PyObject *exc_type = self->exc_type; + PyObject *exc_value = self->exc_value; + PyObject *exc_traceback = self->exc_traceback; + self->exc_type = NULL; + self->exc_value = NULL; + self->exc_traceback = NULL; + Py_XDECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_traceback); +} +static CYTHON_INLINE +int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) { + if (unlikely(gen->is_running)) { + PyErr_SetString(PyExc_ValueError, + "generator already executing"); + return 1; + } + return 0; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + PyErr_SetString(PyExc_TypeError, + "can't send non-None value to a " + "just-started generator"); + return NULL; + } + } + if (unlikely(self->resume_label == -1)) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } + if (value) { +#if CYTHON_COMPILING_IN_PYPY +#else + /* Generators always return to their most recent caller, not + * necessarily their creator. */ + if (self->exc_traceback) { + PyThreadState *tstate = PyThreadState_GET(); + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(tstate->frame); + assert(f->f_back == NULL); + f->f_back = tstate->frame; + } +#endif + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); + } else { + __Pyx_Generator_ExceptionClear(self); + } + self->is_running = 1; + retval = self->body((PyObject *) self, value); + self->is_running = 0; + if (retval) { + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); +#if CYTHON_COMPILING_IN_PYPY +#else + /* Don't keep the reference to f_back any longer than necessary. It + * may keep a chain of frames alive or it could create a reference + * cycle. */ + if (self->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + } +#endif + } else { + __Pyx_Generator_ExceptionClear(self); + } + return retval; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Generator_Undelegate(gen); + __Pyx_PyGen_FetchStopIterationValue(&val); + ret = __Pyx_Generator_SendEx(gen, val); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, Py_None); +} +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Send(yf, value); + } else { + if (value == Py_None) + ret = PyIter_Next(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, value); +} +static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Generator_Close(yf); + if (!retval) + return -1; + } else { + PyObject *meth; + gen->is_running = 1; + meth = PyObject_GetAttr(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Close(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + Py_INCREF(yf); + err = __Pyx_Generator_CloseIter(gen, yf); + __Pyx_Generator_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) +#if PY_VERSION_HEX < 0x02050000 + PyErr_SetNone(PyExc_StopIteration); +#else + PyErr_SetNone(PyExc_GeneratorExit); +#endif + retval = __Pyx_Generator_SendEx(gen, NULL); + if (retval) { + Py_DECREF(retval); + PyErr_SetString(PyExc_RuntimeError, + "generator ignored GeneratorExit"); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (!raised_exception + || raised_exception == PyExc_StopIteration +#if PY_VERSION_HEX >= 0x02050000 + || raised_exception == PyExc_GeneratorExit + || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) +#endif + || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) + { + if (raised_exception) PyErr_Clear(); /* ignore these errors */ + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *typ; + PyObject *tb = NULL; + PyObject *val = NULL; + PyObject *yf = gen->yieldfrom; + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) + return NULL; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + Py_INCREF(yf); +#if PY_VERSION_HEX >= 0x02050000 + if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { + int err = __Pyx_Generator_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Generator_Undelegate(gen); + if (err < 0) + return __Pyx_Generator_SendEx(gen, NULL); + goto throw_here; + } +#endif + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Throw(yf, args); + } else { + PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Generator_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + ret = PyObject_CallObject(meth, args); + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Generator_FinishDelegation(gen); + } + return ret; + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Generator_SendEx(gen, NULL); +} +static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + Py_VISIT(gen->exc_type); + Py_VISIT(gen->exc_value); + Py_VISIT(gen->exc_traceback); + return 0; +} +static int __Pyx_Generator_clear(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + Py_CLEAR(gen->exc_type); + Py_CLEAR(gen->exc_value); + Py_CLEAR(gen->exc_traceback); + return 0; +} +static void __Pyx_Generator_dealloc(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label > 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 + if (PyObject_CallFinalizerFromDealloc(self)) +#else + Py_TYPE(gen)->tp_del(self); + if (self->ob_refcnt > 0) +#endif + return; /* resurrected. :( */ + PyObject_GC_UnTrack(self); + } + __Pyx_Generator_clear(self); + PyObject_GC_Del(gen); +} +static void __Pyx_Generator_del(PyObject *self) { + PyObject *res; + PyObject *error_type, *error_value, *error_traceback; + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + if (gen->resume_label <= 0) + return ; +#if PY_VERSION_HEX < 0x030400a1 + assert(self->ob_refcnt == 0); + self->ob_refcnt = 1; +#endif + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); + res = __Pyx_Generator_Close(self); + if (res == NULL) + PyErr_WriteUnraisable(self); + else + Py_DECREF(res); + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if PY_VERSION_HEX < 0x030400a1 + /* Undo the temporary resurrection; can't use DECREF here, it would + * cause a recursive call. + */ + assert(self->ob_refcnt > 0); + if (--self->ob_refcnt == 0) + return; /* this is the normal path out */ + /* close() resurrected it! Make it look like the original Py_DECREF + * never happened. + */ + { + Py_ssize_t refcnt = self->ob_refcnt; + _Py_NewReference(self); + self->ob_refcnt = refcnt; + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(self->ob_type) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so + * we need to undo that. */ + _Py_DEC_REFTOTAL; +#endif + /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object + * chain, so no more to do there. + * If COUNT_ALLOCS, the original decref bumped tp_frees, and + * _Py_NewReference bumped tp_allocs: both of those need to be + * undone. + */ +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", +#if PY_VERSION_HEX >= 0x02060000 + T_BOOL, +#else + T_BYTE, +#endif + offsetof(__pyx_GeneratorObject, is_running), + READONLY, + NULL}, + {0, 0, 0, 0, 0} +}; +static PyMethodDef __pyx_Generator_methods[] = { + {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0}, + {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0}, + {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("generator"), /*tp_name*/ + sizeof(__pyx_GeneratorObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_Generator_traverse, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/ + __pyx_Generator_methods, /*tp_methods*/ + __pyx_Generator_memberlist, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_del*/ +#else + __Pyx_Generator_del, /*tp_del*/ +#endif +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + __Pyx_Generator_del, /*tp_finalize*/ +#endif +}; +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure) { + __pyx_GeneratorObject *gen = + PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type); + if (gen == NULL) + return NULL; + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + gen->exc_type = NULL; + gen->exc_value = NULL; + gen->exc_traceback = NULL; + gen->gi_weakreflist = NULL; + PyObject_GC_Track(gen); + return gen; +} +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (__pyx_GeneratorType == NULL) { + return -1; + } + return 0; +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +#ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/gbp.conf b/gbp.conf new file mode 100644 index 00000000..9688b7a8 --- /dev/null +++ b/gbp.conf @@ -0,0 +1,10 @@ +[DEFAULT] +# the default branch for upstream sources: +upstream-branch = master +# the default branch for the debian patch: +debian-branch = debian +# the default tag formats used: +upstream-tag = v%(version)s +debian-tag = debian/%(version)s + + diff --git a/patches/changeset_314012d.diff b/patches/changeset_314012d.diff new file mode 100644 index 00000000..aa091629 --- /dev/null +++ b/patches/changeset_314012d.diff @@ -0,0 +1,14 @@ +From: sinhrks +Subject: TST: Fix converter test for MPL1.4 + +--- a/pandas/tseries/tests/test_converter.py ++++ b/pandas/tseries/tests/test_converter.py +@@ -74,7 +74,7 @@ class TestDateTimeConverter(tm.TestCase) + for freq in ('B', 'L', 'S'): + dateindex = tm.makeDateIndex(k = 10, freq = freq) + rs = self.dtc.convert(dateindex, None, None) +- xp = converter.dates.date2num(dateindex) ++ xp = converter.dates.date2num(dateindex._mpl_repr()) + np_assert_almost_equal(rs, xp, decimals) + + def test_resolution(self): diff --git a/patches/deb_disable_googleanalytics b/patches/deb_disable_googleanalytics new file mode 100644 index 00000000..c6d14254 --- /dev/null +++ b/patches/deb_disable_googleanalytics @@ -0,0 +1,92 @@ +--- a/pandas/io/tests/data/macau.html ++++ b/pandas/io/tests/data/macau.html +@@ -53,21 +53,10 @@ jQuery("#tbNotice").hide(); + + Traffic Statistics - Passengers + +- + +- +---> + + +@@ -3688,4 +3677,4 @@ a.hiddenajaxlink{display: none} + + + +- +\ No newline at end of file ++ +--- a/pandas/io/tests/data/spam.html ++++ b/pandas/io/tests/data/spam.html +@@ -27,45 +27,9 @@ + + + +- +- ++ + + + +@@ -794,4 +758,4 @@ handler: function() {this.cancel();}, +   Software v.1.2.2 + + +- +\ No newline at end of file ++ diff --git a/patches/deb_skip_sequencelike_on_armel b/patches/deb_skip_sequencelike_on_armel new file mode 100644 index 00000000..b9553db6 --- /dev/null +++ b/patches/deb_skip_sequencelike_on_armel @@ -0,0 +1,12 @@ +--- a/pandas/tests/test_frame.py ++++ b/pandas/tests/test_frame.py +@@ -4135,6 +4135,9 @@ class TestDataFrame(tm.TestCase, CheckIn + self.assertEqual(len(tst.columns), 3) + + def test_from_records_sequencelike(self): ++ import platform ++ if platform.uname()[4].startswith('armv'): ++ raise nose.SkipTest("Fails on Debian arm boxes due to locales or whatelse") + df = DataFrame({'A' : np.array(np.random.randn(6), dtype = np.float64), + 'A1': np.array(np.random.randn(6), dtype = np.float64), + 'B' : np.array(np.arange(6), dtype = np.int64), diff --git a/patches/deb_skip_test_pytables_failure b/patches/deb_skip_test_pytables_failure new file mode 100644 index 00000000..893f3d97 --- /dev/null +++ b/patches/deb_skip_test_pytables_failure @@ -0,0 +1,27 @@ +From: Yaroslav Halchenko +Subject: swallow the error from pytables + +happens on wheezy and ubuntu 12.04, only in amd64, only if the entire test +battery is run -- difficult to troubleshoot, and definetly resolved on later +releases of Debian/Ubuntu. Thus skipping for now -- must be some glitch in +pytables + +Origin: NeuroDebian +Last-Update: 2014-02-04 + +--- a/pandas/io/tests/test_pytables.py ++++ b/pandas/io/tests/test_pytables.py +@@ -3178,7 +3178,12 @@ class TestHDFStore(tm.TestCase): + + # big selector along the columns + selector = [ 'a','b','c' ] + [ 'a%03d' % i for i in range(60) ] +- result = store.select('df', [Term("ts>=Timestamp('2012-02-01')"),Term('users=selector')]) ++ try: ++ result = store.select('df', [Term("ts>=Timestamp('2012-02-01')"),Term('users=selector')]) ++ except KeyError as e: ++ if "No object named df in" in str(e): ++ raise nose.SkipTest("Skipping the test due to catching known %s" % e) ++ + expected = df[ (df.ts >= Timestamp('2012-02-01')) & df.users.isin(selector) ] + tm.assert_frame_equal(expected, result) + diff --git a/patches/jessie-dsc-patch b/patches/jessie-dsc-patch new file mode 120000 index 00000000..28822df5 --- /dev/null +++ b/patches/jessie-dsc-patch @@ -0,0 +1 @@ +nocython3-dsc-patch \ No newline at end of file diff --git a/patches/nocython3-dsc-patch b/patches/nocython3-dsc-patch new file mode 100644 index 00000000..a3fa187e --- /dev/null +++ b/patches/nocython3-dsc-patch @@ -0,0 +1,20 @@ +From: Yaroslav Halchenko +Subject: For backports to older suites/releases -- allow to have no cython3 + +achieved through removing versioning on cython itself at all and allowing older +cythons than when cython3 was introduced while requiring cython3 + +Origin: NeuroDebian +Last-Update: 2012-12-14 + +--- a/debian/control 2012-12-13 22:48:33.000000000 -0500 ++++ b/debian/control 2012-12-13 22:54:11.000000000 -0500 +@@ -6,7 +6,7 @@ + Build-Depends: debhelper (>= 7.0.50), + python-all-dev (>= 2.5), + python-setuptools, +- cython (>= 0.17.1~), ++ cython, + python-numpy (>= 1:1.6.1~), python-dateutil, + python-scipy, + python-tz, diff --git a/patches/precise-dsc-patch b/patches/precise-dsc-patch new file mode 120000 index 00000000..28822df5 --- /dev/null +++ b/patches/precise-dsc-patch @@ -0,0 +1 @@ +nocython3-dsc-patch \ No newline at end of file diff --git a/patches/quantal-dsc-patch b/patches/quantal-dsc-patch new file mode 120000 index 00000000..28822df5 --- /dev/null +++ b/patches/quantal-dsc-patch @@ -0,0 +1 @@ +nocython3-dsc-patch \ No newline at end of file diff --git a/patches/series b/patches/series new file mode 100644 index 00000000..cf955f83 --- /dev/null +++ b/patches/series @@ -0,0 +1,4 @@ +changeset_314012d.diff +deb_disable_googleanalytics +deb_skip_sequencelike_on_armel +deb_skip_test_pytables_failure diff --git a/patches/sid-dsc-patch b/patches/sid-dsc-patch new file mode 120000 index 00000000..28822df5 --- /dev/null +++ b/patches/sid-dsc-patch @@ -0,0 +1 @@ +nocython3-dsc-patch \ No newline at end of file diff --git a/patches/wheezy-dsc-patch b/patches/wheezy-dsc-patch new file mode 120000 index 00000000..28822df5 --- /dev/null +++ b/patches/wheezy-dsc-patch @@ -0,0 +1 @@ +nocython3-dsc-patch \ No newline at end of file diff --git a/pycompat b/pycompat new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/pycompat @@ -0,0 +1 @@ +2 diff --git a/python-pandas-doc.docs b/python-pandas-doc.docs new file mode 100644 index 00000000..7123782b --- /dev/null +++ b/python-pandas-doc.docs @@ -0,0 +1 @@ +doc/_build/html diff --git a/python-pandas-doc.examples b/python-pandas-doc.examples new file mode 100644 index 00000000..e39721e2 --- /dev/null +++ b/python-pandas-doc.examples @@ -0,0 +1 @@ +examples/* diff --git a/python-pandas-doc.links b/python-pandas-doc.links new file mode 100644 index 00000000..2d066cc2 --- /dev/null +++ b/python-pandas-doc.links @@ -0,0 +1 @@ +usr/share/javascript/jquery/jquery.js usr/share/doc/python-scikits-learn-doc/html/_static/jquery.js diff --git a/python-pandas-lib.install b/python-pandas-lib.install new file mode 100644 index 00000000..eb172023 --- /dev/null +++ b/python-pandas-lib.install @@ -0,0 +1 @@ +usr/lib/python2*/dist-packages/pandas/*.so diff --git a/python-pandas.install b/python-pandas.install new file mode 100644 index 00000000..4c0c522c --- /dev/null +++ b/python-pandas.install @@ -0,0 +1 @@ +usr/lib/python2*/ diff --git a/python3-pandas-lib.install b/python3-pandas-lib.install new file mode 100644 index 00000000..9775cfea --- /dev/null +++ b/python3-pandas-lib.install @@ -0,0 +1 @@ +usr/lib/python3/dist-packages/pandas/*.so diff --git a/python3-pandas.install b/python3-pandas.install new file mode 100644 index 00000000..eae3930a --- /dev/null +++ b/python3-pandas.install @@ -0,0 +1 @@ +usr/lib/python3/ diff --git a/rules b/rules new file mode 100755 index 00000000..29324ce3 --- /dev/null +++ b/rules @@ -0,0 +1,136 @@ +#!/usr/bin/make -f +# -*- mode: makefile; coding: utf-8 -*- + +export DEB_BUILD_HARDENING=1 + +# Pass hardening flags into distutils +CFLAGS = $(shell dpkg-buildflags --get CFLAGS) +export CFLAGS + +PACKAGE2_NAME = python-pandas +PACKAGE3_NAME = python3-pandas +PACKAGE2_ROOT_DIR = debian/${PACKAGE2_NAME} +PACKAGE3_ROOT_DIR = debian/${PACKAGE3_NAME} + +PYVERS = $(shell pyversions -vr) +PYVER = $(shell pyversions -vd) +PY3VERS = $(shell py3versions -vr) +PY3VER = $(shell py3versions -vd) + +UVER := $(shell LC_ALL=C dpkg-parsechangelog | awk '/^Version:/{print $$2;}' | sed -e 's,-[^-]*$$,,g') + +MIN_CYTHONVER = 0.20.2 + +# Some unittests might need to be excluded for different Python versions +EXCLUDE_TESTS := --exclude test_bar_log +EXCLUDE_TESTS2 := +EXCLUDE_TESTS3.2 := +#--exclude "test_bootstrap_plot" +EXCLUDE_TESTS3.3 := +#--exclude "test_(bootstrap_plot|quoting|cant_compare_tz_naive_w_aware|more_flexible_frame_multi_function|yahoo)" + +# MPLVER := $(shell dpkg -l python-matplotlib | awk '/^ii/{print $$3;}' || echo 0) +# $(shell dpkg --compare-versions $(MPLVER) lt 1.0 && echo '|test_hist|test_plot|test_boxplot|test_corr_rank' || echo '') + +# try to prevent unsunctioned downloads +export http_proxy=http://127.0.0.1:9/ +export https_proxy=http://127.0.0.1:9/ + +# Mega rule +%: + : # Explicit build system to avoid use of all-in-1 Makefile + dh $@ --buildsystem=python_distutils --with python2,python3 + +clean_generated: + find pandas/ -regex '.*\.c\(\|pp\)' | xargs grep -l -e 'Generated by Cython' | xargs -r rm -f + +_cythonize%: + debian/rules clean_generated # force removal of previous copies + python$(*:2=) setup.py cython + D=debian/cythonized-files$(*:2=) && \ + git rm -rf $$D; \ + find pandas/ -regex '.*\.c\(\|pp\)' | while read f; do \ + grep -q 'Generated by Cython' "$$f" || continue; \ + mkdir -p "$$D/$$(dirname $$f)"; \ + cp "$$f" "$$D/$$(dirname $$f)"; \ + git add -f "$$D/$$f"; \ + done; \ + echo "$(UVER)" >| $$D/VERSION; git add $$D/VERSION + +_uncythonize%: + echo "$*" | grep -q '^3' && PY=3 || PY= ; \ + CYTHONVER=$$(dpkg -l cython$$PY 2>/dev/null | awk '/^ii/{print $$3;}' || echo 0); \ + dpkg --compare-versions "$$CYTHONVER" lt "$(MIN_CYTHONVER)" && { \ + echo "I: Using pre-Cython-ed files for Python $*"; \ + cd debian/cythonized-files$$PY/ ; \ + find . -regex '.*\.c\(\|pp\)' | while read f; do cp $$f ../../$$f; done; } || : + +cythonize: _cythonize2 _cythonize3 + +override_dh_clean: clean_generated + : # Make sure that cythonized sources are up-to-date + [ "$(UVER)" = "`cat debian/cythonized-files/VERSION`" ] + rm -rf build doc/_build *-stamp # pandas.egg-info pandas/datasets/__config__.py + dh_clean + : # prune auto-generated version.py -- will be generated during build again + rm -f pandas/version.py + +override_dh_auto_build: + # Override default build operation which --force's re-cythonization + # on elderly ubuntus + : + +override_dh_auto_install: ${PYVERS:%=python-install%} ${PY3VERS:%=python-install%} ${PYVERS:%=python-test%} ${PY3VERS:%=python-test%} +# Per Python version logic -- install, test, remomove .so (installed into -lib) +python-install%: _uncythonize% + python$* setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp + +python-test%: python-install% +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + echo "backend : Agg" >| $(CURDIR)/build/matplotlibrc + : # Run unittests here against installed pandas + echo "$*" | grep -q '^3' && PY=3 || PY=$*; \ + export PYTHONPATH=`/bin/ls -d $$PWD/debian/tmp/usr/lib/python$$PY/*/`; \ + export MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \ + python$* ci/print_versions.py; \ + cd build/; xvfb-run -a -s "-screen 0 1280x1024x24 -noreset" \ + python$* /usr/bin/nosetests -s -v -A 'not network and not disabled' $(EXCLUDE_TESTS) $(EXCLUDE_TESTS$*) pandas; +else + : # Skip unittests due to nocheck +endif + +override_dh_installdocs: + : # Build Documentation using installed pandas +ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) +ifneq (,$(findstring -a,$(DH_INTERNAL_OPTIONS))) + : # not building documentation in -a +else + : # not building documentation ATM since requires ipython 0.11 +# export PYTHONPATH=`/bin/ls -d $$PWD/$(PACKAGE2_ROOT_DIR)/usr/lib/python$(PYVER)/*`; \ +# export MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \ +# cd doc; python make.py html +endif +endif + : # Use jquery from Debian package, so prune shipped one + #TODO -rm doc/_build/html/_static/jquery.js + dh_installdocs -A *.md + +#override_dh_installchangelogs: +# dh_installchangelogs doc/whats_new.rst + +## remove .so libraries from main package, and call dh_numpy* +## while removing 2 if not present +_dh_python%: + if [ -d debian/$(PACKAGE$*_NAME)/usr/lib ]; then \ + find debian/$(PACKAGE$*_NAME)/usr/lib -name "*.so" -delete; \ + fi + [ -e /usr/bin/dh_numpy$(*:2=) ] && dh_numpy$(*:2=) -p$(PACKAGE$*_NAME)-lib || : + dh_python$* + +## "Instantiate" both rules so dh sees them +override_dh_python2: _dh_python2 +override_dh_python3: _dh_python3 + +## immediately useable documentation and exemplar scripts/data +override_dh_compress: + dh_compress -X.py -X.html -X.pdf -X.css -X.jpg -X.txt -X.js -X.json -X.rtc -Xobjects.inv diff --git a/source/format b/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/source/options b/source/options new file mode 100644 index 00000000..b2b7b88b --- /dev/null +++ b/source/options @@ -0,0 +1 @@ +extend-diff-ignore="^[^/]+\.egg-info/" diff --git a/tests/control b/tests/control new file mode 100644 index 00000000..38521c8a --- /dev/null +++ b/tests/control @@ -0,0 +1,33 @@ +Tests: unittests +Depends: python-all, + python-dateutil, + python-matplotlib, + python-nose, + python-numpy, + python-openpyxl, + python-pandas, + python-scipy, + python-statsmodels, + python-tables, + python-tk, + python-tz, + python-xlrd, + python-xlwt, + python-bs4, + python-html5lib, + xauth, + xvfb + +Tests: unittests3 +Depends: python3-all, + python3-dateutil, + python3-matplotlib, + python3-nose, + python3-numpy, + python3-pandas, + python3-scipy, + python3-tk, + python3-tz, + python3-bs4, + xauth, + xvfb diff --git a/tests/unittests b/tests/unittests new file mode 100755 index 00000000..e85c685c --- /dev/null +++ b/tests/unittests @@ -0,0 +1,11 @@ +#!/bin/sh +set -efu + +pys="$(pyversions -rv 2>/dev/null)" + +cd "$ADTTMP" + +for py in $pys; do + echo "=== python$py ===" + xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" nosetests-$py -a '!network' -v pandas 2>&1 +done diff --git a/tests/unittests3 b/tests/unittests3 new file mode 100755 index 00000000..0d26afb4 --- /dev/null +++ b/tests/unittests3 @@ -0,0 +1,11 @@ +#!/bin/sh +set -efu + +pys="$(py3versions -r 2>/dev/null)" + +cd "$ADTTMP" + +for py in $pys; do + echo "=== $py ===" + xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" $py /usr/bin/nosetests3 -a '!network' -v pandas 2>&1 +done diff --git a/watch b/watch new file mode 100644 index 00000000..075aad65 --- /dev/null +++ b/watch @@ -0,0 +1,3 @@ +version=3 +opts="dversionmangle=s/.dfsg$//,uversionmangle=s/v//,filenamemangle=s/.*\/(.*)/pandas-$1\.tar\.gz/" \ + http://github.com/pydata/pandas/tags .*archive/v?([\d\.rc]+).tar.gz -- 2.30.2